Commit 57f4064d authored by KeYong's avatar KeYong

修改bug

parent 1ab38660
...@@ -1523,21 +1523,22 @@ public class PointController extends AbstractBaseController { ...@@ -1523,21 +1523,22 @@ public class PointController extends AbstractBaseController {
@ApiOperation(value = "新增巡检点", notes = "新增巡检点") @ApiOperation(value = "新增巡检点", notes = "新增巡检点")
@PostMapping(value = "/addPointNew", produces = "application/json;charset=UTF-8") @PostMapping(value = "/addPointNew", produces = "application/json;charset=UTF-8")
public CommonResponse AddPointNew(@ApiParam(value = "巡检点", required = true) @RequestBody PointNewVo pointNewVo){ public CommonResponse AddPointNew(@ApiParam(value = "巡检点", required = true) @RequestBody PointNewVo pointNewVo){
AgencyUserModel user = getUserInfo(); ReginParams reginParams = getSelectedOrgInfo();
AgencyUserModel user = reginParams.getUserModel();
if (ObjectUtils.isEmpty(user)) { if (ObjectUtils.isEmpty(user)) {
return CommonResponseUtil.failure("用户session过期"); return CommonResponseUtil.failure("用户session过期");
} }
if (ObjectUtils.isEmpty(pointNewVo.getChargePersonId())) { // if (ObjectUtils.isEmpty(pointNewVo.getChargePersonId())) {
return CommonResponseUtil.failure("责任人不能为空"); // return CommonResponseUtil.failure("责任人不能为空");
} // }
if (!ObjectUtils.isEmpty(pointNewVo.getName())) { 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)) { if (CollectionUtils.isNotEmpty(list)) {
throw new BadRequest("该名称巡检点已存在"); throw new BadRequest("该名称巡检点已存在");
} }
} }
if (!ObjectUtils.isEmpty(pointNewVo.getName())) { 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)) { if (CollectionUtils.isNotEmpty(list)) {
throw new BadRequest("该编号已存在"); throw new BadRequest("该编号已存在");
} }
...@@ -1551,22 +1552,28 @@ public class PointController extends AbstractBaseController { ...@@ -1551,22 +1552,28 @@ public class PointController extends AbstractBaseController {
point.setIsIndoor(pointNewVo.getIsIndoor().equals("1") ? true : false); point.setIsIndoor(pointNewVo.getIsIndoor().equals("1") ? true : false);
point.setOffline(pointNewVo.getOffline().equals("1") ? true : false); point.setOffline(pointNewVo.getOffline().equals("1") ? true : false);
ReginParams reginParams = getSelectedOrgInfo(); // ReginParams reginParams = getSelectedOrgInfo();
String loginOrgCode = getOrgCode(reginParams); String loginOrgCode = getOrgCode(reginParams);
point.setOrgCode(loginOrgCode); //点归属于公司 point.setOrgCode(loginOrgCode); //点归属于公司
point.setCreatorId(user.getUserId()); point.setCreatorId(user.getUserId());
ResponseModel<Object> companyInfo = jcsFeignClient.getCompanyInfo(point.getChargeDeptId()); // ResponseModel<Object> companyInfo = jcsFeignClient.getCompanyInfo(point.getChargeDeptId());
Object obj = companyInfo.getResult(); // Object obj = companyInfo.getResult();
String bizOrgCode = ((Map<String, Object>) obj).get("bizOrgCode").toString(); // String bizOrgCode = ((Map<String, Object>) obj).get("bizOrgCode").toString();
String bizOrgName = ((Map<String, Object>) obj).get("bizOrgName").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.setBizOrgCode(bizOrgCode);
point.setBizOrgName(bizOrgName); point.setBizOrgName(bizOrgName);
FeignClientResult userInfo = jcsFeignClient.selectById(point.getChargePersonId()); // FeignClientResult userInfo = jcsFeignClient.selectById(point.getChargePersonId());
Object result = userInfo.getResult(); // Object result = userInfo.getResult();
Map<String, Object> map = (Map<String, Object>) result; // Map<String, Object> map = (Map<String, Object>) result;
point.setChargePersonName(map.get("personName").toString()); point.setChargePersonId(user.getUserId());
point.setChargePersonName(user.getRealName());
iPointService.addPointNew(point); iPointService.addPointNew(point);
return CommonResponseUtil.success(); return CommonResponseUtil.success();
......
...@@ -47,7 +47,7 @@ public interface PointMapper extends BaseMapper { ...@@ -47,7 +47,7 @@ public interface PointMapper extends BaseMapper {
List<PointInputItemVo> getPointClassInputItemById(@Param(value = "pointId") Long pointId); 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); int listByParamsCount(PointQueryVo pointParams);
...@@ -130,7 +130,7 @@ public interface PointMapper extends BaseMapper { ...@@ -130,7 +130,7 @@ public interface PointMapper extends BaseMapper {
List<Map<String, Object>> queryAllPointConfig(String loginOrgCode); 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); 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 { ...@@ -159,4 +159,8 @@ public interface PointMapper extends BaseMapper {
List<Point> selectRoutePointList(Long number, Long size, String name, String pointNo); List<Point> selectRoutePointList(Long number, Long size, String name, String pointNo);
Integer countRoutePointList(String name, String pointNo); Integer countRoutePointList(String name, String pointNo);
List<RoutePoint> getRoutePoint(@Param("ids") List<Long> ids); 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 { ...@@ -2107,7 +2107,7 @@ public class PointServiceImpl implements IPointService {
/*13迭代新增列表方法*/ /*13迭代新增列表方法*/
public IPage<PointVo> queryPointInfoNew(PointQueryVo pointParams, int current ,int size, String loginOrgCode) { 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); 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); int num = pointMapper.listByParamsCount(pointParams);
List<PointVo> pointVoList = new ArrayList<>(); List<PointVo> pointVoList = new ArrayList<>();
for (Point point : pointPage) { for (Point point : pointPage) {
......
...@@ -90,15 +90,14 @@ ...@@ -90,15 +90,14 @@
ELSE ELSE
'移动点' '移动点'
END) isFixed END) isFixed
from p_point p from p_point p
<where> <where>
p.is_delete = 0 p.is_delete = 0
<if test="pointParams.pointNo != null and pointParams.pointNo != ''"> <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>
<if test="pointParams.name != null and pointParams.name != ''"> <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>
<if test="pointParams.isFixed != null and pointParams.isFixed != ''"> <if test="pointParams.isFixed != null and pointParams.isFixed != ''">
and p.is_fixed = #{pointParams.isFixed} and p.is_fixed = #{pointParams.isFixed}
...@@ -107,7 +106,7 @@ ...@@ -107,7 +106,7 @@
and p.catalog_id = #{pointParams.catalogId} and p.catalog_id = #{pointParams.catalogId}
</if> </if>
<if test="pointParams.bizOrgCode != null and pointParams.bizOrgCode != ''"> <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> </if>
</where> </where>
ORDER BY p.id DESC ORDER BY p.id DESC
...@@ -1211,28 +1210,57 @@ ...@@ -1211,28 +1210,57 @@
<!-- </select>--> <!-- </select>-->
<select id="queryEquipPointInputItem" resultType="java.util.Map"> <select id="queryEquipPointInputItem" resultType="java.util.Map">
SELECT SELECT
ppc.id, ppc.id,
ppc.point_id pointId, ppc.point_id pointId,
ppc.name, ppc.name,
ppc.code, ppc.code,
ppc.creator_id creatorId, ppc.creator_id creatorId,
ppc.create_date createDate, ppc.create_date createDate,
ppc.order_no orderNo, ppc.order_no orderNo,
ppc.original_id originalId, ppc.original_id originalId,
ppc.equipment_id equipmentId, ppc.equipment_id equipmentId,
ppc.inspection_spec_name inspectionSpecName, ppc.inspection_spec_name inspectionSpecName,
ppc.category_name categoryName, ppc.category_name categoryName,
ppc.address, ppc.address,
ppc.data_source_code dataSourceCode, ppc.data_source_code dataSourceCode,
ppc.data_source_name dataSourceName, ppc.data_source_name dataSourceName,
ppc.building_id buildingId, ppc.building_id buildingId,
ppc.building_name buildingName, ppc.building_name buildingName,
ppc.category_code categoryCode 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 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 WHERE
ppc.is_delete = 0 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>
<select id="queryPointCount4Route" parameterType="long" resultType="int"> <select id="queryPointCount4Route" parameterType="long" resultType="int">
...@@ -1466,4 +1494,28 @@ ...@@ -1466,4 +1494,28 @@
</foreach> </foreach>
</if> </if>
</select> </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> </mapper>
\ No newline at end of file
...@@ -311,12 +311,12 @@ ...@@ -311,12 +311,12 @@
<repository> <repository>
<id>Releases</id> <id>Releases</id>
<name>Releases</name> <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>
<repository> <repository>
<id>Snapshots</id> <id>Snapshots</id>
<name>Snapshots</name> <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>
<repository> <repository>
<id>com.e-iceblue</id> <id>com.e-iceblue</id>
...@@ -326,7 +326,7 @@ ...@@ -326,7 +326,7 @@
<repository> <repository>
<id>thirdparty</id> <id>thirdparty</id>
<name>thirdparty</name> <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> </repository>
</repositories> </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