diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddPlacePatrolTeamFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddPlacePatrolTeamFormDTO.java index b4767e0315..a0ece62eb1 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddPlacePatrolTeamFormDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddPlacePatrolTeamFormDTO.java @@ -106,7 +106,7 @@ public class AddPlacePatrolTeamFormDTO implements Serializable { * 分队成员信息 */ @Valid - @NotEmpty(message = "成员列表不能为空") + @NotEmpty(message = "成员列表不能为空", groups = {Add.class}) private List memberList; //token中userId @@ -115,7 +115,7 @@ public class AddPlacePatrolTeamFormDTO implements Serializable { public interface Add { } @Data - public class Member { + public static class Member { //姓名 private String name; //联系电话 diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditPlacePatrolTeamFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditPlacePatrolTeamFormDTO.java index 8036d2dd12..4509c6f443 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditPlacePatrolTeamFormDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditPlacePatrolTeamFormDTO.java @@ -35,6 +35,11 @@ import java.util.List; public class EditPlacePatrolTeamFormDTO implements Serializable { private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; /** * 分队Id */ @@ -99,7 +104,7 @@ public class EditPlacePatrolTeamFormDTO implements Serializable { } @Data - public class Member { + public static class Member { //姓名 private String name; //联系电话 diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/GetListPlacePatrolReviewRecordFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/GetListPlacePatrolReviewRecordFormDTO.java index 596bad17d4..225962bb89 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/GetListPlacePatrolReviewRecordFormDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/GetListPlacePatrolReviewRecordFormDTO.java @@ -32,9 +32,9 @@ import java.io.Serializable; public class GetListPlacePatrolReviewRecordFormDTO implements Serializable { private static final long serialVersionUID = 1L; //巡查记录Id + @NotBlank(message = "巡查记录Id不能为空", groups = {GetData.class}) private String placePatrolRecordId; //复查记录Id - @NotBlank(message = "复查记录Id不能为空", groups = {GetData.class}) private String placePatrolReviewRecordId; //页码 @Min(1) diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPlacePatrolTeamController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPlacePatrolTeamController.java index 6d62a5f951..815505c2e9 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPlacePatrolTeamController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPlacePatrolTeamController.java @@ -68,6 +68,7 @@ public class IcPlacePatrolTeamController { @PostMapping("edit") public Result edit(@LoginUser TokenDto tokenDto, @RequestBody EditPlacePatrolTeamFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO, EditPlacePatrolTeamFormDTO.Edit.class); + formDTO.setCustomerId(tokenDto.getCustomerId()); placePatrolTeamService.edit(formDTO); return new Result(); } @@ -79,7 +80,7 @@ public class IcPlacePatrolTeamController { @PostMapping("del") public Result del(@LoginUser TokenDto tokenDto, @RequestBody EditPlacePatrolTeamFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO, EditPlacePatrolTeamFormDTO.Del.class); - placePatrolTeamService.del(formDTO.getTeamId()); + placePatrolTeamService.del(tokenDto.getUserId(), formDTO.getTeamId()); return new Result(); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPlacePatrolTeamStaffDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPlacePatrolTeamStaffDao.java index 56dee8582f..8f8df8c9dd 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPlacePatrolTeamStaffDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPlacePatrolTeamStaffDao.java @@ -51,4 +51,10 @@ public interface IcPlacePatrolTeamStaffDao extends BaseDao selectByTeamIds(@Param("teamIds") List teamIds); + + /** + * @Author sun + * @Description 逻辑删除分队成员子表数据 + **/ + int upByTeamId(@Param("staffId") String staffId, @Param("teamId") String teamId); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPlacePatrolTeamService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPlacePatrolTeamService.java index 2c17403e80..6ec9cf1a96 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPlacePatrolTeamService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPlacePatrolTeamService.java @@ -49,7 +49,7 @@ public interface IcPlacePatrolTeamService extends BaseService getList(String teamId); + + /** + * @Author sun + * @Description 逻辑删除分队成员子表数据 + **/ + void upByTeamId(String staffId, String teamId); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolRecordServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolRecordServiceImpl.java index ab8d20776f..7cbc07b966 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolRecordServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolRecordServiceImpl.java @@ -112,7 +112,7 @@ public class IcPlacePatrolRecordServiceImpl extends BaseServiceImpl result = baseDao.getList(dto); @@ -127,12 +127,27 @@ public class IcPlacePatrolRecordServiceImpl extends BaseServiceImpl teamIds = new ArrayList<>(); + teamIds.add(resultDTO.getPlacePatrolTeamId()); + List teamDTOList = icPlacePatrolTeamStaffDao.selectByTeamIds(teamIds); + + //4.封装九小场所、分队成员数据 for (OptionResultDTO n : nineList.getData()){ if(resultDTO.getNinePlaceVal().equals(n.getValue())){ resultDTO.setNinePlaceName(n.getLabel()); } } + //分队成员 + StringBuffer inspectorsNames = new StringBuffer(""); + for (String str : resultDTO.getInspectors().split(",")) { + teamDTOList.forEach(r -> { + if (str.equals(r.getId())) { + inspectorsNames.append("".equals(inspectorsNames.toString().trim()) ? r.getName() : "," + r.getName()); + } + }); + } + resultDTO.setInspectorsNames(inspectorsNames.toString()); return resultDTO; } @@ -175,7 +190,7 @@ public class IcPlacePatrolRecordServiceImpl extends BaseServiceImpl { if (str.equals(r.getId())) { - inspectorsNames.append("".equals(inspectorsNames) ? r.getName() : "," + r.getName()); + inspectorsNames.append("".equals(inspectorsNames.toString().trim()) ? r.getName() : "," + r.getName()); } }); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolReviewRecordServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolReviewRecordServiceImpl.java index ae5463de04..7341c0012a 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolReviewRecordServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolReviewRecordServiceImpl.java @@ -153,7 +153,7 @@ public class IcPlacePatrolReviewRecordServiceImpl extends BaseServiceImpl { if (str.equals(r.getId())) { - inspectorsNames.append("".equals(inspectorsNames) ? r.getName() : "," + r.getName()); + inspectorsNames.append("".equals(inspectorsNames.toString().trim()) ? r.getName() : "," + r.getName()); } }); } @@ -189,7 +189,7 @@ public class IcPlacePatrolReviewRecordServiceImpl extends BaseServiceImpl { if (str.equals(r.getId())) { - inspectorsNames.append("".equals(inspectorsNames) ? r.getName() : "," + r.getName()); + inspectorsNames.append("".equals(inspectorsNames.toString().trim()) ? r.getName() : "," + r.getName()); } }); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolTeamServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolTeamServiceImpl.java index 4a73f3b5e0..c3e5ff7fa5 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolTeamServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolTeamServiceImpl.java @@ -119,6 +119,7 @@ public class IcPlacePatrolTeamServiceImpl extends BaseServiceImpl%s", teamId)); } - //2.删除分队成员字表数据 - placePatrolTeamStaffService.delByTeamId(teamId); + //2.逻辑删除分队成员字表数据 + placePatrolTeamStaffService.upByTeamId(staffId, teamId); } /** @@ -174,7 +175,7 @@ public class IcPlacePatrolTeamServiceImpl extends BaseServiceImpl { - if (str.equals(r.getGridName())) { + if (str.equals(r.getId())) { gridNames.append("".equals(gridNames) ? r.getGridName() : "," + r.getGridName()); } }); @@ -230,7 +231,7 @@ public class IcPlacePatrolTeamServiceImpl extends BaseServiceImpl { - if (str.equals(r.getGridName())) { + if (str.equals(r.getId())) { gridNames.append("".equals(gridNames) ? r.getGridName() : "," + r.getGridName()); } }); diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolTeamStaffServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolTeamStaffServiceImpl.java index f8ca6fc890..8f26db929e 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolTeamStaffServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolTeamStaffServiceImpl.java @@ -48,9 +48,22 @@ public class IcPlacePatrolTeamStaffServiceImpl extends BaseServiceImpl getList(String teamId) { return baseDao.getByTeamId(teamId); } + /** + * @Author sun + * @Description 逻辑删除分队成员子表数据 + **/ + @Override + public void upByTeamId(String staffId, String teamId) { + baseDao.upByTeamId(staffId, teamId); + } + } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPlaceOrgDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPlaceOrgDao.xml index 4d04a72530..27514baefe 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPlaceOrgDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPlaceOrgDao.xml @@ -8,7 +8,7 @@ a.id placeOrgId, a.grid_id gridId, b.grid_name gridName, - a.nine_place_val ninePlaceVale, + a.nine_place_val ninePlaceVal, a.place_org_name placeOrgName, a.address address, a.scale scale, @@ -28,8 +28,8 @@ AND a.grid_id = #{gridId} - - AND a.nine_place_val = #{ninePlacsVal} + + AND a.nine_place_val = #{ninePlaceVal} AND a.place_org_name LIKE CONCAT('%', #{placeOrgName}, '%') diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPlacePatrolRecordDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPlacePatrolRecordDao.xml index efde00da1e..597a62e186 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPlacePatrolRecordDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPlacePatrolRecordDao.xml @@ -13,7 +13,7 @@ c.place_org_name placeOrgName, a.place_patrol_team_id placePatrolTeamId, d.team_name placePatrolTeamName, - a.nine_placs_val ninePlaceVal, + a.nine_place_val ninePlaceVal, a.inspectors inspectors, a.first_time firstTime, a.first_result firstResult, @@ -28,15 +28,17 @@ LEFT JOIN ic_place_patrol_team d ON a.place_patrol_team_id = d.id WHERE a.del_flag = '0' - AND a.customer_id = '' + + AND a.id = #{placePatrolRecordId} + AND a.customer_id = #{customerId} AND a.grid_id = #{gridId} - - AND a.nine_place_val = #{ninePlacsVal} + + AND a.nine_place_val = #{ninePlaceVal} AND a.place_org_id IN (select id from ic_place_org where place_org_name like concat('%', #{placeOrgName}, '%')) diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPlacePatrolTeamDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPlacePatrolTeamDao.xml index 99bbcb7886..a218d4f050 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPlacePatrolTeamDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPlacePatrolTeamDao.xml @@ -6,7 +6,7 @@ - + @@ -30,8 +30,8 @@ AND grid_ids LIKE CONCAT('%', #{gridId}, '%') - - AND nine_placs_vals LIKE CONCAT('%', #{ninePlacsVal}, '%') + + AND nine_place_vals LIKE CONCAT('%', #{ninePlaceVal}, '%') AND person_in_charge LIKE CONCAT('%', #{personInCharge}, '%') diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPlacePatrolTeamStaffDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPlacePatrolTeamStaffDao.xml index 7dddc8e731..06d8285f21 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPlacePatrolTeamStaffDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPlacePatrolTeamStaffDao.xml @@ -36,4 +36,15 @@ place_patrol_team_id ASC + + UPDATE + ic_place_patrol_team_staff + SET + del_flag = '1', + updated_by = #{staffId}, + updated_time = NOW() + WHERE + place_patrol_team_id = #{teamId} + + \ No newline at end of file