From 6ebd4c765f84656d46844b41e8d7c17d6ef8bf33 Mon Sep 17 00:00:00 2001 From: zhangyuan Date: Thu, 21 Jul 2022 16:04:38 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BC=96=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/controller/StaffController.java | 6 +++--- .../java/com/epmet/feign/EpmetUserFeignClient.java | 4 ++-- .../fallback/EpmetUserFeignClientFallBack.java | 4 ++-- .../main/java/com/epmet/service/StaffService.java | 2 +- .../com/epmet/service/impl/StaffServiceImpl.java | 4 ++-- .../epmet/controller/CustomerStaffController.java | 6 +++--- .../com/epmet/service/CustomerStaffService.java | 2 +- .../service/impl/CustomerStaffServiceImpl.java | 13 +++++++++++-- 8 files changed, 25 insertions(+), 16 deletions(-) diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/StaffController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/StaffController.java index 1afee71a4b..5c5717a02b 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/StaffController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/StaffController.java @@ -107,11 +107,11 @@ public class StaffController { * @param fromDTO 参数 * @return Result */ - @PostMapping("editstaffv3") + @PostMapping("editstaffpy") @RequirePermission(requirePermission = RequirePermissionEnum.ORG_STAFF_UPDATE) - public Result editStaff(@LoginUser TokenDto tokenDto, @RequestBody StaffSubmitPyFromDTO fromDTO){ + public Result editStaffPy(@LoginUser TokenDto tokenDto, @RequestBody StaffSubmitPyFromDTO fromDTO){ ValidatorUtils.validateEntity(fromDTO); - return staffService.editStaffV3(tokenDto, fromDTO); + return staffService.editStaffPy(tokenDto, fromDTO); } /** diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/EpmetUserFeignClient.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/EpmetUserFeignClient.java index 9042cfbb3e..bdf22012e3 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/EpmetUserFeignClient.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/EpmetUserFeignClient.java @@ -116,8 +116,8 @@ public interface EpmetUserFeignClient { * @param fromDTO 参数 * @return Result */ - @PostMapping("/epmetuser/customerstaff/editstaffv3") - Result editStaffV3(@RequestBody StaffSubmitPyFromDTO fromDTO); + @PostMapping("/epmetuser/customerstaff/editstaffpy") + Result editStaffPy(@RequestBody StaffSubmitPyFromDTO fromDTO); /** diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallBack.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallBack.java index 4cc7a2884a..61751f50fe 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallBack.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallBack.java @@ -73,8 +73,8 @@ public class EpmetUserFeignClientFallBack implements EpmetUserFeignClient { } @Override - public Result editStaffV3(StaffSubmitPyFromDTO fromDTO) { - return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "editStaffV3", fromDTO); + public Result editStaffPy(StaffSubmitPyFromDTO fromDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "editStaffPy", fromDTO); } @Override diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/StaffService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/StaffService.java index 40ea290e27..a27625981b 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/StaffService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/StaffService.java @@ -70,7 +70,7 @@ public interface StaffService { * @param fromDTO 参数 * @return Result */ - Result editStaffV3(TokenDto tokenDto, StaffSubmitPyFromDTO fromDTO); + Result editStaffPy(TokenDto tokenDto, StaffSubmitPyFromDTO fromDTO); /** * 人员详情 diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java index 5e4af1cfba..c29719f436 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java @@ -196,13 +196,13 @@ public class StaffServiceImpl implements StaffService { } @Override - public Result editStaffV3(TokenDto tokenDto, StaffSubmitPyFromDTO fromDTO) { + public Result editStaffPy(TokenDto tokenDto, StaffSubmitPyFromDTO fromDTO) { CustomerAgencyEntity customerAgencyEntity = customerAgencyService.selectById(fromDTO.getAgencyId()); fromDTO.setCustomerId(customerAgencyEntity.getCustomerId()); fromDTO.setApp(tokenDto.getApp()); fromDTO.setClient(tokenDto.getClient()); - Result result = epmetUserFeignClient.editStaffV3(fromDTO); + Result result = epmetUserFeignClient.editStaffPy(fromDTO); if (!result.success()) { if (result.getCode() != EpmetErrorCode.SERVER_ERROR.getCode()) { return new Result().error(result.getCode(), result.getMsg()); diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java index 76bbf1fae6..e27e52c58f 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java @@ -311,9 +311,9 @@ public class CustomerStaffController { * @param fromDTO 参数 * @return Result */ - @PostMapping("editstaffv3") - public Result editStaffV3(@RequestBody StaffSubmitPyFromDTO fromDTO){ - Result result = customerStaffService.editStaffV3(fromDTO); + @PostMapping("editstaffpy") + public Result editStaffPy(@RequestBody StaffSubmitPyFromDTO fromDTO){ + Result result = customerStaffService.editStaffPy(fromDTO); //2021-10-18 推送mq,数据同步到中介库 start if (result.success()) { diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/CustomerStaffService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/CustomerStaffService.java index fa14d45111..6376d1200d 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/CustomerStaffService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/CustomerStaffService.java @@ -210,7 +210,7 @@ public interface CustomerStaffService extends BaseService { * @param fromDTO 参数 * @return Result */ - Result editStaffV3(StaffSubmitPyFromDTO fromDTO); + Result editStaffPy(StaffSubmitPyFromDTO fromDTO); /** * 人员详情 diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java index fc0f3e7b58..bc09f805c2 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java @@ -511,7 +511,7 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl().error(EpmetErrorCode.MOBILE_USED.getCode(), EpmetErrorCode.MOBILE_USED.getMsg()); } - + CustomerStaffByAccountFormDTO customerStaffAccountFormDTO = new CustomerStaffByAccountFormDTO(); + customerStaffAccountFormDTO.setCustomerId(fromDTO.getCustomerId()); + customerStaffAccountFormDTO.setUserAccount(fromDTO.getUserAccount()); + customerStaffDTO = baseDao.selectListCustomerStaffInfoByAccount(customerStaffAccountFormDTO); + if (null != customerStaffDTO && !fromDTO.getStaffId().equals(customerStaffDTO.getUserId())) { + return new Result().error(EpmetErrorCode.ACCOUNT_USED.getCode(), EpmetErrorCode.ACCOUNT_USED.getMsg()); + } CustomerStaffEntity customerStaffEntity = baseDao.selectByUserId(fromDTO.getStaffId()); //Customer_Staff表插入数据 CustomerStaffEntity staffEntity = new CustomerStaffEntity(); @@ -529,6 +535,9 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl