Commit 57f4064d authored by KeYong's avatar KeYong

修改bug

parent 1ab38660
......@@ -1523,21 +1523,22 @@ public class PointController extends AbstractBaseController {
@ApiOperation(value = "新增巡检点", notes = "新增巡检点")
@PostMapping(value = "/addPointNew", produces = "application/json;charset=UTF-8")
public CommonResponse AddPointNew(@ApiParam(value = "巡检点", required = true) @RequestBody PointNewVo pointNewVo){
AgencyUserModel user = getUserInfo();
ReginParams reginParams = getSelectedOrgInfo();
AgencyUserModel user = reginParams.getUserModel();
if (ObjectUtils.isEmpty(user)) {
return CommonResponseUtil.failure("用户session过期");
}
if (ObjectUtils.isEmpty(pointNewVo.getChargePersonId())) {
return CommonResponseUtil.failure("责任人不能为空");
}
// if (ObjectUtils.isEmpty(pointNewVo.getChargePersonId())) {
// return CommonResponseUtil.failure("责任人不能为空");
// }
if (!ObjectUtils.isEmpty(pointNewVo.getName())) {
List<Point> list = iPointDao.findByName(pointNewVo.getName(), pointNewVo.getId() != 0 ? String.valueOf(pointNewVo.getId()) : null);
List<Point> list = pointMapper.findByName(pointNewVo.getName(), pointNewVo.getId() != 0 ? String.valueOf(pointNewVo.getId()) : null);
if (CollectionUtils.isNotEmpty(list)) {
throw new BadRequest("该名称巡检点已存在");
}
}
if (!ObjectUtils.isEmpty(pointNewVo.getName())) {
List<Point> list = iPointDao.findByNo(pointNewVo.getPointNo(), pointNewVo.getId() != 0 ? String.valueOf(pointNewVo.getId()) : null);
List<Point> list = pointMapper.findByNo(pointNewVo.getPointNo(), pointNewVo.getId() != 0 ? String.valueOf(pointNewVo.getId()) : null);
if (CollectionUtils.isNotEmpty(list)) {
throw new BadRequest("该编号已存在");
}
......@@ -1551,22 +1552,28 @@ public class PointController extends AbstractBaseController {
point.setIsIndoor(pointNewVo.getIsIndoor().equals("1") ? true : false);
point.setOffline(pointNewVo.getOffline().equals("1") ? true : false);
ReginParams reginParams = getSelectedOrgInfo();
// ReginParams reginParams = getSelectedOrgInfo();
String loginOrgCode = getOrgCode(reginParams);
point.setOrgCode(loginOrgCode); //点归属于公司
point.setCreatorId(user.getUserId());
ResponseModel<Object> companyInfo = jcsFeignClient.getCompanyInfo(point.getChargeDeptId());
Object obj = companyInfo.getResult();
String bizOrgCode = ((Map<String, Object>) obj).get("bizOrgCode").toString();
String bizOrgName = ((Map<String, Object>) obj).get("bizOrgName").toString();
// ResponseModel<Object> companyInfo = jcsFeignClient.getCompanyInfo(point.getChargeDeptId());
// Object obj = companyInfo.getResult();
// String bizOrgCode = ((Map<String, Object>) obj).get("bizOrgCode").toString();
// String bizOrgName = ((Map<String, Object>) obj).get("bizOrgName").toString();
// point.setBizOrgCode(bizOrgCode);
// point.setBizOrgName(bizOrgName);
String bizOrgCode = reginParams.getPersonIdentity().getCompanyBizOrgCode();
String bizOrgName = reginParams.getPersonIdentity().getCompanyName();
point.setBizOrgCode(bizOrgCode);
point.setBizOrgName(bizOrgName);
FeignClientResult userInfo = jcsFeignClient.selectById(point.getChargePersonId());
Object result = userInfo.getResult();
Map<String, Object> map = (Map<String, Object>) result;
point.setChargePersonName(map.get("personName").toString());
// FeignClientResult userInfo = jcsFeignClient.selectById(point.getChargePersonId());
// Object result = userInfo.getResult();
// Map<String, Object> map = (Map<String, Object>) result;
point.setChargePersonId(user.getUserId());
point.setChargePersonName(user.getRealName());
iPointService.addPointNew(point);
return CommonResponseUtil.success();
......
......@@ -47,7 +47,7 @@ public interface PointMapper extends BaseMapper {
List<PointInputItemVo> getPointClassInputItemById(@Param(value = "pointId") Long pointId);
List<Point> listByParams(PointQueryVo pointParams, Page page);
List<Point> listByParams(@Param(value = "pointParams") PointQueryVo pointParams);
int listByParamsCount(PointQueryVo pointParams);
......@@ -130,7 +130,7 @@ public interface PointMapper extends BaseMapper {
List<Map<String, Object>> queryAllPointConfig(String loginOrgCode);
List<Map<String, Object>> queryEquipPointInputItem(Long pointId);
List<Map<String, Object>> queryEquipPointInputItem(@Param(value = "pointId") Long pointId);
int queryPointCount4Route(@Param(value = "structureIdList") List<Long> structureIdList, @Param(value = "pointNo") String pointNo, @Param(value = "name") String name, @Param(value = "nullRiskSourceId") boolean nullRiskSourceId);
......@@ -159,4 +159,8 @@ public interface PointMapper extends BaseMapper {
List<Point> selectRoutePointList(Long number, Long size, String name, String pointNo);
Integer countRoutePointList(String name, String pointNo);
List<RoutePoint> getRoutePoint(@Param("ids") List<Long> ids);
List<Point> findByName(@Param(value = "pointName") String pointName, @Param(value = "pointId") String pointId);
List<Point> findByNo(@Param(value = "pointNo") String pointNo, @Param(value = "pointId") String pointId);
}
......@@ -2107,7 +2107,7 @@ public class PointServiceImpl implements IPointService {
/*13迭代新增列表方法*/
public IPage<PointVo> queryPointInfoNew(PointQueryVo pointParams, int current ,int size, String loginOrgCode) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<Object> page = new com.baomidou.mybatisplus.extension.plugins.pagination.Page<>(current, size);
List<Point> pointPage = pointMapper.listByParams(pointParams,page);
List<Point> pointPage = pointMapper.listByParams(pointParams);
int num = pointMapper.listByParamsCount(pointParams);
List<PointVo> pointVoList = new ArrayList<>();
for (Point point : pointPage) {
......
......@@ -90,15 +90,14 @@
ELSE
'移动点'
END) isFixed
from p_point p
<where>
p.is_delete = 0
<if test="pointParams.pointNo != null and pointParams.pointNo != ''">
and p.point_no LIKE CONCAT ('%',#{pointParams.pointNo},'%')
and p.point_no LIKE CONCAT ('%',#{pointParams.pointNo}::varchar,'%')
</if>
<if test="pointParams.name != null and pointParams.name != ''">
and p.name LIKE CONCAT ('%',#{pointParams.name},'%')
and p.name LIKE CONCAT ('%',#{pointParams.name}::varchar,'%')
</if>
<if test="pointParams.isFixed != null and pointParams.isFixed != ''">
and p.is_fixed = #{pointParams.isFixed}
......@@ -107,7 +106,7 @@
and p.catalog_id = #{pointParams.catalogId}
</if>
<if test="pointParams.bizOrgCode != null and pointParams.bizOrgCode != ''">
and p.biz_org_code LIKE CONCAT (#{pointParams.bizOrgCode} ,'%')
and p.biz_org_code LIKE CONCAT (#{pointParams.bizOrgCode}::varchar,'%')
</if>
</where>
ORDER BY p.id DESC
......@@ -1211,28 +1210,57 @@
<!-- </select>-->
<select id="queryEquipPointInputItem" resultType="java.util.Map">
SELECT
ppc.id,
ppc.point_id pointId,
ppc.name,
ppc.code,
ppc.creator_id creatorId,
ppc.create_date createDate,
ppc.order_no orderNo,
ppc.original_id originalId,
ppc.equipment_id equipmentId,
ppc.inspection_spec_name inspectionSpecName,
ppc.category_name categoryName,
ppc.address,
ppc.data_source_code dataSourceCode,
ppc.data_source_name dataSourceName,
ppc.building_id buildingId,
ppc.building_name buildingName,
ppc.category_code categoryCode
ppc.id,
ppc.point_id pointId,
ppc.name,
ppc.code,
ppc.creator_id creatorId,
ppc.create_date createDate,
ppc.order_no orderNo,
ppc.original_id originalId,
ppc.equipment_id equipmentId,
ppc.inspection_spec_name inspectionSpecName,
ppc.category_name categoryName,
ppc.address,
ppc.data_source_code dataSourceCode,
ppc.data_source_name dataSourceName,
ppc.building_id buildingId,
ppc.building_name buildingName,
ppc.category_code categoryCode,
ppc.check_style checkStryle,
ppi.order_no pOrderNo,
ppi.id pointItemId,
pii.input_classify inputClassify,
pii.name,
pii.risk_desc riskDesc,
pii.order_no orderNo,
pii.item_type itemType,
pii.is_must isMust,
pii.is_score isScore,
pii.default_value defaultValue,
pii.is_multiline isMultiline,
pii.catalog_id originalId,
pii.input_json inputJson,
pii.data_json dataJson,
pii.remark,
pii.picture_json pictureJson,
pii.create_by createBy,
pii.create_date createDate,
pii.is_delete isDelete,
pii.level,
pii.item_no itemNo,
pii.original_id originalId,
pii.basis_json basisJson,
pii.org_code orgCode
FROM
p_point_classify ppc
p_point_inputitem ppi
LEFT JOIN p_input_item pii ON pii.id = ppi.input_item_id
LEFT JOIN p_point_classify ppc ON FIND_IN_SET(ppc.id, ppi.classify_ids) > 0
WHERE
ppc.is_delete = 0
<if test = "pointId!=''" > AND ppc.point_id = #{pointId} </if>
<if test = "pointId!=''" > AND ppi.point_id = #{pointId} </if>
ORDER BY
ppi.order_no
</select>
<select id="queryPointCount4Route" parameterType="long" resultType="int">
......@@ -1466,4 +1494,28 @@
</foreach>
</if>
</select>
<select id="findByName" resultType="com.yeejoin.amos.patrol.dao.entity.Point">
SELECT * from p_point pp
WHERE
pp.is_delete = 0
<if test="pointName != null and pointName != ''">
AND pp.name like concat('%', #{pointName}::varchar, '%')
</if>
<if test="pointId != null">
AND pp.id = #{pointId}
</if>
</select>
<select id="findByNo" resultType="com.yeejoin.amos.patrol.dao.entity.Point">
SELECT * from p_point pp
WHERE
pp.is_delete = 0
<if test="pointNo != null and pointNo != ''">
AND pp.point_no = #{pointNo}
</if>
<if test="pointId != null">
AND pp.id = #{pointId}
</if>
</select>
</mapper>
\ No newline at end of file
......@@ -311,12 +311,12 @@
<repository>
<id>Releases</id>
<name>Releases</name>
<url>http://36.46.149.14:8081/nexus/content/repositories/releases/</url>
<url>http://113.142.68.105:8081/nexus/content/repositories/releases/</url>
</repository>
<repository>
<id>Snapshots</id>
<name>Snapshots</name>
<url>http://36.46.149.14:8081/nexus/content/repositories/snapshots/</url>
<url>http://113.142.68.105:8081/nexus/content/repositories/snapshots/</url>
</repository>
<repository>
<id>com.e-iceblue</id>
......@@ -326,7 +326,7 @@
<repository>
<id>thirdparty</id>
<name>thirdparty</name>
<url>http://36.46.149.14:8081/nexus/content/repositories/thirdparty/</url>
<url>http://113.142.68.105:8081/nexus/content/repositories/thirdparty/</url>
</repository>
</repositories>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment