From bdc89ab26258d1da0d1105c6604e4fbb4b7fa630 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 17 Mar 2022 15:34:48 +0800 Subject: [PATCH 1/2] updatedTime --- .../com/epmet/dto/form/AbandonGridFormDTO.java | 1 + .../java/com/epmet/controller/GridController.java | 3 ++- .../com/epmet/service/CustomerGridService.java | 4 ++-- .../service/impl/CustomerGridServiceImpl.java | 14 ++++++++------ 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AbandonGridFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AbandonGridFormDTO.java index 1d1aca23e1..85f8d7fd34 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AbandonGridFormDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AbandonGridFormDTO.java @@ -11,4 +11,5 @@ import java.io.Serializable; public class AbandonGridFormDTO implements Serializable { @NotBlank(message = "网格id不能为空",groups = AddGroup.class) private String gridId; + private String userId; } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/GridController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/GridController.java index 20c4dd4aef..8f026e9f44 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/GridController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/GridController.java @@ -235,7 +235,8 @@ public class GridController { */ @RequirePermission(requirePermission = RequirePermissionEnum.ORG_GRID_DELETE) @PostMapping("abandon") - public Result abandonGrid(@RequestBody AbandonGridFormDTO formDTO){ + public Result abandonGrid(@LoginUser TokenDto tokenDto,@RequestBody AbandonGridFormDTO formDTO){ + formDTO.setUserId(tokenDto.getUserId()); ValidatorUtils.validateEntity(formDTO, AddGroup.class); customerGridService.abandonGrid(formDTO); return new Result(); diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java index 504555fbc7..c3ba7c1286 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java @@ -384,7 +384,7 @@ public interface CustomerGridService extends BaseService { /** * desc:移除网格内的工作人员关系 并迁移到组织 - * @param gridId + * @param formDTO */ - void abandonGridForDealBizData(String gridId); + void abandonGridForDealBizData(AbandonGridFormDTO formDTO); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java index 094df4ba53..60735f8615 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java @@ -981,17 +981,17 @@ public class CustomerGridServiceImpl extends BaseServiceImpl staffList = customerStaffGridDao.getGridStaffList(gridId); + List staffList = customerStaffGridDao.getGridStaffList(formDTO.getGridId()); if (CollectionUtils.isEmpty(staffList)){ - log.info("abandonGridForDealBizData gridId:{} have any staff", gridId); + log.info("abandonGridForDealBizData gridId:{} have any staff", formDTO.getGridId()); return; } logger.debug("abandonGridForDealBizData staffList:{}", JSON.toJSONString(staffList)); @@ -1015,7 +1015,7 @@ public class CustomerGridServiceImpl extends BaseServiceImplCustomerStaffRedis.delStaffInfoFormCache(customerId,staff.getStaffId())); @@ -1026,7 +1026,7 @@ public class CustomerGridServiceImpl extends BaseServiceImpl staffList, List updateList) { + public void dealBizDataForAbandon(String customerId, String gridId, String userId,List staffList, List updateList) { //1.删除工作人员与网格的关系 LambdaQueryWrapper updateWrapper = new LambdaQueryWrapper<>(); updateWrapper.eq(CustomerStaffGridEntity::getGridId,gridId); @@ -1048,6 +1048,8 @@ public class CustomerGridServiceImpl extends BaseServiceImpl updateGrid=new LambdaUpdateWrapper<>(); updateGrid.set(CustomerGridEntity::getAbandonFlag,NumConstant.ONE); + updateGrid.set(CustomerGridEntity::getUpdatedBy,userId); + updateGrid.set(CustomerGridEntity::getUpdatedTime,new Date()); updateGrid.eq(CustomerGridEntity::getId,gridId); baseDao.update(null,updateGrid); } From 7f4123c5cffd14dc662642663756c6f1ed3d3452 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 17 Mar 2022 15:38:01 +0800 Subject: [PATCH 2/2] merge --- .../java/com/epmet/service/impl/CustomerGridServiceImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java index b63db4f280..c337f989e3 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java @@ -992,7 +992,7 @@ public class CustomerGridServiceImpl extends BaseServiceImpl staffList = customerStaffGridDao.getGridStaffList(gridId); + List staffList = customerStaffGridDao.getGridStaffList(formDTO.getGridId()); if (staffList == null){ staffList = new ArrayList<>(); } @@ -1017,7 +1017,7 @@ public class CustomerGridServiceImpl extends BaseServiceImplCustomerStaffRedis.delStaffInfoFormCache(customerId,staff.getStaffId()));