From a234a27c5a0a74c1eea1ff1645f066458ff68ddf Mon Sep 17 00:00:00 2001 From: zhangyuan Date: Wed, 20 Jul 2022 15:16:22 +0800 Subject: [PATCH 01/17] =?UTF-8?q?=E8=B4=A6=E5=8F=B7=E5=AF=86=E7=A0=81?= =?UTF-8?q?=E7=99=BB=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/ThirdLoginController.java | 13 ++++ .../dto/form/StaffAccountOrgsFormDTO.java | 43 +++++++++++++ .../form/ThirdStaffAccountOrgsFormDTO.java | 48 ++++++++++++++ .../com/epmet/service/ThirdLoginService.java | 9 +++ .../service/impl/ThirdLoginServiceImpl.java | 63 +++++++++++++++++++ .../ThirdAccountCustomerStaffFormDTO.java | 24 +++++++ .../epmet/feign/EpmetUserOpenFeignClient.java | 10 +++ .../EpmetUserOpenFeignClientFallback.java | 4 ++ .../controller/CustomerStaffController.java | 5 ++ .../java/com/epmet/dao/CustomerStaffDao.java | 8 +++ .../epmet/service/CustomerStaffService.java | 8 +++ .../impl/CustomerStaffServiceImpl.java | 13 ++++ .../resources/mapper/CustomerStaffDao.xml | 12 ++++ 13 files changed, 260 insertions(+) create mode 100644 epmet-auth/src/main/java/com/epmet/dto/form/StaffAccountOrgsFormDTO.java create mode 100644 epmet-auth/src/main/java/com/epmet/dto/form/ThirdStaffAccountOrgsFormDTO.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/ThirdAccountCustomerStaffFormDTO.java diff --git a/epmet-auth/src/main/java/com/epmet/controller/ThirdLoginController.java b/epmet-auth/src/main/java/com/epmet/controller/ThirdLoginController.java index 144e18d024..5604dd1d66 100644 --- a/epmet-auth/src/main/java/com/epmet/controller/ThirdLoginController.java +++ b/epmet-auth/src/main/java/com/epmet/controller/ThirdLoginController.java @@ -89,6 +89,19 @@ public class ThirdLoginController { return new Result>().ok(staffOrgs); } + /** + * @param formDTO + * @return + * @author sun + * @description 单客户-账号密码获取组织 + **/ + @PostMapping(value = "/getmyorgbyaccount") + public Result> getMyOrgByAccount(@RequestBody ThirdStaffAccountOrgsFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, StaffAccountOrgsFormDTO.AddUserShowGroup.class, StaffAccountOrgsFormDTO.GetMyOrgByPassWordGroup.class); + List staffOrgs = thirdLoginService.getMyOrgByAccount(formDTO); + return new Result>().ok(staffOrgs); + } + /** * @param formDTO * @return diff --git a/epmet-auth/src/main/java/com/epmet/dto/form/StaffAccountOrgsFormDTO.java b/epmet-auth/src/main/java/com/epmet/dto/form/StaffAccountOrgsFormDTO.java new file mode 100644 index 0000000000..1ac9076a1d --- /dev/null +++ b/epmet-auth/src/main/java/com/epmet/dto/form/StaffAccountOrgsFormDTO.java @@ -0,0 +1,43 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description 手机验证码获取组织接口入参 + * @Author yinzuomei + * @Date 2020/4/18 10:38 + */ +@Data +public class StaffAccountOrgsFormDTO implements Serializable { + private static final long serialVersionUID = 4193133227120225342L; + /** + * 添加用户操作的用户可见异常分组 + * 该分组用于校验需要返回给前端错误信息提示的列,需要继承CustomerClientShowGroup + * 返回错误码为8999,提示信息为DTO中具体的列的校验注解message的内容 + */ + public interface AddUserShowGroup extends CustomerClientShowGroup { + } + + public interface GetMyOrgByPassWordGroup extends CustomerClientShowGroup { + } + public interface GetMyOrgByLoginWxmp extends CustomerClientShowGroup{} + /** + * 手机号 + */ + @NotBlank(message = "账号不能为空", groups = {AddUserShowGroup.class}) + private String userAccount; + + /** + * 验证码 + */ + @NotBlank(message="验证码不能为空", groups = {GetMyOrgByLoginWxmp.class}) + private String smsCode; + + @NotBlank(message = "密码不能为空",groups ={GetMyOrgByPassWordGroup.class}) + private String password; +} + diff --git a/epmet-auth/src/main/java/com/epmet/dto/form/ThirdStaffAccountOrgsFormDTO.java b/epmet-auth/src/main/java/com/epmet/dto/form/ThirdStaffAccountOrgsFormDTO.java new file mode 100644 index 0000000000..c9a31bcf5b --- /dev/null +++ b/epmet-auth/src/main/java/com/epmet/dto/form/ThirdStaffAccountOrgsFormDTO.java @@ -0,0 +1,48 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description appId、账号、验证码获取组织-接口入参 + * @Author sun + */ +@Data +public class ThirdStaffAccountOrgsFormDTO implements Serializable { + private static final long serialVersionUID = 4193133227120225342L; + /** + * 添加用户操作的用户可见异常分组 + * 该分组用于校验需要返回给前端错误信息提示的列,需要继承CustomerClientShowGroup + * 返回错误码为8999,提示信息为DTO中具体的列的校验注解message的内容 + */ + public interface AddUserShowGroup extends CustomerClientShowGroup { + } + + public interface GetMyOrgByPassWordGroup extends CustomerClientShowGroup { + } + public interface GetMyOrgByLoginWxmp extends CustomerClientShowGroup{} + /** + * 小程序appId + */ + @NotBlank(message = "appId不能为空", groups = {AddUserShowGroup.class}) + private String appId; + + /** + * 手机号 + */ + @NotBlank(message = "账号不能为空", groups = {AddUserShowGroup.class}) + private String userAccount; + + /** + * 验证码 + */ + @NotBlank(message="验证码不能为空", groups = {GetMyOrgByLoginWxmp.class}) + private String smsCode; + + @NotBlank(message = "密码不能为空",groups ={GetMyOrgByPassWordGroup.class}) + private String password; +} + diff --git a/epmet-auth/src/main/java/com/epmet/service/ThirdLoginService.java b/epmet-auth/src/main/java/com/epmet/service/ThirdLoginService.java index c79a67d41c..08772e1947 100644 --- a/epmet-auth/src/main/java/com/epmet/service/ThirdLoginService.java +++ b/epmet-auth/src/main/java/com/epmet/service/ThirdLoginService.java @@ -52,6 +52,15 @@ public interface ThirdLoginService { **/ List getMyOrgByPassword(ThirdStaffOrgsFormDTO formDTO); + /** + * @param formDTO + * @return + * @author zhy + * @description 单客户-手机号密码获取组织 + **/ + List getMyOrgByAccount(ThirdStaffAccountOrgsFormDTO formDTO); + + /** * @param formDTO * @return diff --git a/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java b/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java index dd48a5577f..30b4aa2148 100644 --- a/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java +++ b/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java @@ -538,6 +538,69 @@ public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResol return new ArrayList<>(); } + @Override + public List getMyOrgByAccount(ThirdStaffAccountOrgsFormDTO formDTO) { + //0.根据appId查询对应客户Id + PaCustomerDTO customer = this.getCustomerInfo(formDTO.getAppId()); + //7.28 上边根据appId只能锁定一条客户id,后边的批量循环操作暂不做调整,还是使用之前的代码 sun + //1、根据手机号查询到用户信息 + ThirdAccountCustomerStaffFormDTO dto = new ThirdAccountCustomerStaffFormDTO(); + dto.setCustomerId(customer.getId()); + dto.setUserAccount(formDTO.getUserAccount()); + Result> customerStaffResult = epmetUserOpenFeignClient.getCustsomerStaffByIdAndAccount(dto); + if (!customerStaffResult.success()) { + logger.warn(String.format("账户密码登录异常,手机号[%s],code[%s],msg[%s]", formDTO.getUserAccount(), customerStaffResult.getCode(), customerStaffResult.getMsg())); + throw new RenException(customerStaffResult.getCode()); + } + //2、密码是否正确 + List customerStaffList=customerStaffResult.getData(); + //3、查询用户所有的组织信息 + List customerIdList = new ArrayList<>(); + //是否设置过密码 + boolean havePasswordFlag=false; + //密码是否正确 + boolean passwordRightFlag=false; + for (CustomerStaffDTO customerStaffDTO : customerStaffList) { + if(StringUtils.isNotBlank(customerStaffDTO.getPassword())){ + havePasswordFlag=true; + }else{ + logger.warn(String.format("当前用户:账户%s,客户Id%s下未设置密码.",formDTO.getUserAccount(),customerStaffDTO.getCustomerId())); + continue; + } + if (!PasswordUtils.matches(formDTO.getPassword(), customerStaffDTO.getPassword())) { + logger.warn(String.format("当前用户:账户%s,客户Id%s密码匹配错误.",formDTO.getUserAccount(),customerStaffDTO.getCustomerId())); + + }else{ + logger.warn(String.format("当前用户:账户%s,客户Id%s密码匹配正确.",formDTO.getUserAccount(),customerStaffDTO.getCustomerId())); + passwordRightFlag=true; + customerIdList.add(customerStaffDTO.getCustomerId()); + } + } + //根据手机号查出来所有用户,密码都为空,表明用户未激活账户,未设置密码 + if(!havePasswordFlag){ + logger.warn(String.format("当前账户(%s)下所有账户都未设置密码,请先使用验证码登录激活账户",formDTO.getUserAccount())); + throw new RenException(EpmetErrorCode.PASSWORD_ERROR.getCode()); + } + //密码错误 + if(!passwordRightFlag){ + logger.warn(String.format("根据当前账户(%s)密码未找到所属组织,密码错误",formDTO.getUserAccount())); + throw new RenException(EpmetErrorCode.PASSWORD_ERROR.getCode()); + } + StaffOrgFormDTO staffOrgFormDTO = new StaffOrgFormDTO(); + staffOrgFormDTO.setCustomerIdList(customerIdList); + Result> result = govOrgOpenFeignClient.getStaffOrgList(staffOrgFormDTO); + if(result.success()&&null!=result.getData()){ + return result.getData(); + } + logger.warn(String .format("手机验证码获取组织,调用%s服务失败,入参账户%s,密码%s,返回错误码%s,错误提示信息%s", + ServiceConstant.GOV_ORG_SERVER, + formDTO.getUserAccount(), + formDTO.getPassword(), + result.getCode(), + result.getMsg())); + return new ArrayList<>(); + } + /** * @Description 获取客户信息 * @param appId diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/ThirdAccountCustomerStaffFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/ThirdAccountCustomerStaffFormDTO.java new file mode 100644 index 0000000000..a19a33f586 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/ThirdAccountCustomerStaffFormDTO.java @@ -0,0 +1,24 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 根据客户ID、手机号查询政府端工作人员基本信息 + * @Author sun + */ +@Data +public class ThirdAccountCustomerStaffFormDTO implements Serializable{ + private static final long serialVersionUID = -7994579456530273809L; + + /** + * 客户Id + * */ + private String customerId; + + /** + * 账号 + * */ + private String userAccount; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java index d52625b704..6f0afaf4a7 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java @@ -231,6 +231,16 @@ public interface EpmetUserOpenFeignClient { @GetMapping(value = "epmetuser/customerstaff/getCustsomerStaffByIdAndPhone") Result> getCustsomerStaffByIdAndPhone(@RequestBody ThirdCustomerStaffFormDTO formDTO); + /** + * @param formDTO + * @return + * @Author zhy + * @Description 根据客户ID、手机号查询政府端工作人员基本信息,校验用户是否存在 + **/ + @GetMapping(value = "epmetuser/customerstaff/getCustsomerStaffByIdAndAccount") + Result> getCustsomerStaffByIdAndAccount(@RequestBody ThirdAccountCustomerStaffFormDTO formDTO); + + /** * 获取用户基础信息 * diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java index 56b203743a..765dfe2414 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java @@ -171,6 +171,10 @@ public class EpmetUserOpenFeignClientFallback implements EpmetUserOpenFeignClien return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getCustsomerStaffByIdAndPhone", formDTO); } + @Override + public Result> getCustsomerStaffByIdAndAccount(ThirdAccountCustomerStaffFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getCustsomerStaffByIdAndAccount", formDTO); + } @Override public Result selectUserBaseInfo(TokenDto tokenDTO) { return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "selectUserBaseInfo", tokenDTO); 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 274cb8ed87..6188c1e412 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 @@ -361,6 +361,11 @@ public class CustomerStaffController { return new Result>().ok(customerStaffService.getCustsomerStaffByIdAndPhone(formDTO)); } + @GetMapping(value = "getCustsomerStaffByIdAndAccount") + public Result> getCustsomerStaffByIdAndAccount(@RequestBody ThirdAccountCustomerStaffFormDTO formDTO) { + return new Result>().ok(customerStaffService.getCustsomerStaffByIdAndAccount(formDTO)); + } + /** * @Description 查询工作人员的信息 * @param formDTO diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java index 725a456b46..156b9f3d6f 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java @@ -147,6 +147,14 @@ public interface CustomerStaffDao extends BaseDao { **/ List selectStaff(ThirdCustomerStaffFormDTO formDTO); + /** + * @param formDTO + * @return + * @Author zhy + * @Description 根据客户ID、手机号查询政府端工作人员基本信息 + **/ + List selectStaffByAccount(ThirdAccountCustomerStaffFormDTO formDTO); + /** * @Description 查询工作人员的信息 * @param userIds 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 e986aa8f07..2f0ca459c0 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 @@ -259,6 +259,14 @@ public interface CustomerStaffService extends BaseService { **/ List getCustsomerStaffByIdAndPhone(ThirdCustomerStaffFormDTO formDTO); + /** + * @param formDTO + * @return + * @Author zhy + * @Description 根据客户ID、手机号查询政府端工作人员基本信息,校验用户是否存在 + **/ + List getCustsomerStaffByIdAndAccount(ThirdAccountCustomerStaffFormDTO formDTO); + /** * @Description 查询工作人员的信息 * @param formDTO 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 024d3aed37..e9062e1b27 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 @@ -583,6 +583,19 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl getCustsomerStaffByIdAndAccount(ThirdAccountCustomerStaffFormDTO formDTO) { + //根据客户Id和手机号查询工作人员信息 + List customerStaffDTOList = baseDao.selectStaffByAccount(formDTO); + if (null == customerStaffDTOList || customerStaffDTOList.size() < NumConstant.ONE) { + logger.warn(String.format("根据客户Id和账户查询用户异常,客户Id:[%s],手机号:[%s],code[%s],msg[%s]", + formDTO.getCustomerId(), formDTO.getUserAccount(), EpmetErrorCode.GOV_STAFF_NOT_EXISTS.getCode(), + EpmetErrorCode.GOV_STAFF_NOT_EXISTS.getMsg())); + throw new RenException(EpmetErrorCode.GOV_STAFF_NOT_EXISTS.getCode()); + } + return customerStaffDTOList; + } + /** * @param formDTO * @Description 查询工作人员的信息 diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml index 10965b93ce..fed6777817 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml @@ -221,6 +221,18 @@ ORDER BY active_time DESC, created_time ASC + + + + + - SELECT * FROM From a85cbb8986b5706006d8d550a6342b31a6dc5406 Mon Sep 17 00:00:00 2001 From: zhangyuan Date: Thu, 21 Jul 2022 10:08:16 +0800 Subject: [PATCH 06/17] =?UTF-8?q?=E4=BF=AE=E6=94=B9bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/CustomerStaffController.java | 16 +++++++++++----- .../java/com/epmet/dao/CustomerStaffDao.java | 2 +- .../com/epmet/service/CustomerStaffService.java | 8 ++++---- .../service/impl/CustomerStaffServiceImpl.java | 2 +- .../main/resources/mapper/CustomerStaffDao.xml | 4 ++-- 5 files changed, 19 insertions(+), 13 deletions(-) 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 40942a3967..ac64ab94c6 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 @@ -119,15 +119,15 @@ public class CustomerStaffController { } /** - * @param mobile 手机号 + * @param account 账户 * @return com.epmet.commons.tools.utils.Result - * @Author yinzuomei - * @Description 根据手机号查询政府端工作人员基本信息,校验用户是否存在 + * @Author zhy + * @Description 根据账户查询政府端工作人员基本信息,校验用户是否存在 * @Date 2020/4/18 14:07 **/ @GetMapping(value = "getcustsomerstaffbyaccount/{account}") - public Result> getCustsomerStaffByAccount(@PathVariable("account") String userAccount) { - return customerStaffService.getCustsomerStaffByAccount(userAccount); + public Result> getCustsomerStaffByAccount(@PathVariable("account") String account) { + return customerStaffService.getCustsomerStaffByAccount(account); } /** @@ -422,6 +422,12 @@ public class CustomerStaffController { return new Result>().ok(customerStaffService.getCustsomerStaffByIdAndPhone(formDTO)); } + /** + * @param formDTO + * @return + * @Author zhy + * @Description 根据客户ID、账户查询政府端工作人员基本信息,校验用户是否存在 + **/ @GetMapping(value = "getCustsomerStaffByIdAndAccount") public Result> getCustsomerStaffByIdAndAccount(@RequestBody ThirdCustomerStaffByAccountFormDTO formDTO) { return new Result>().ok(customerStaffService.getCustsomerStaffByIdAndAccount(formDTO)); diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java index df882b3a66..3840890ed3 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java @@ -153,7 +153,7 @@ public interface CustomerStaffDao extends BaseDao { * @param formDTO * @return * @Author zhy - * @Description 根据客户ID、手机号查询政府端工作人员基本信息 + * @Description 根据客户ID、账户查询政府端工作人员基本信息 **/ List selectStaffByAccount(ThirdCustomerStaffByAccountFormDTO formDTO); 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 b4e0e1a4f4..4955984be1 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 @@ -106,13 +106,13 @@ public interface CustomerStaffService extends BaseService { Result> getCustsomerStaffByPhone(String mobile); /** - * @param mobile 手机号 + * @param account 账户 * @return com.epmet.commons.tools.utils.Result - * @Author yinzuomei - * @Description 根据手机号查询政府端工作人员基本信息,校验用户是否存在 + * @Author zhy + * @Description 根据账户查询政府端工作人员基本信息,校验用户是否存在 * @Date 2020/4/18 14:07 **/ - Result> getCustsomerStaffByAccount(String userAccount); + Result> getCustsomerStaffByAccount(String account); /** * @param formDTO 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 08adfd0425..49e8c8f25a 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 @@ -161,7 +161,7 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl> getCustsomerStaffByAccount(String userAccount) { //判断用户是否存在 - List customerStaffDTOList = baseDao.selectListCustomerStaffDTO(userAccount); + List customerStaffDTOList = baseDao.listCustomerStaffByAccount(userAccount); if (null == customerStaffDTOList || customerStaffDTOList.size() == 0) { logger.warn(String.format("根据账户查询用户异常,账户:[%s],code[%s],msg[%s]", userAccount, EpmetErrorCode.GOV_STAFF_NOT_EXISTS.getCode(), EpmetErrorCode.GOV_STAFF_NOT_EXISTS.getMsg())); return new Result().error(EpmetErrorCode.GOV_STAFF_NOT_EXISTS.getCode()); diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml index 964481a4a8..ba87121aaf 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml @@ -11,7 +11,7 @@ order by cs.ACTIVE_TIME desc,cs.CREATED_TIME asc - + - SELECT * FROM From 293cf49010b3fbcf6b28ea9d88100b8379e1cc80 Mon Sep 17 00:00:00 2001 From: zhangyuan Date: Thu, 21 Jul 2022 10:32:59 +0800 Subject: [PATCH 07/17] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/commons/tools/exception/EpmetErrorCode.java | 1 + .../epmet/service/impl/CustomerStaffServiceImpl.java | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java index a13d6cf1db..ecb953e72f 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java @@ -40,6 +40,7 @@ public enum EpmetErrorCode { PASSWORD_NOT_FIT(8010,"两次填写的密码不一致"), PASSWORD_OUT_OF_ORDER(8011,"密码必须8-20个字符,而且同时包含大小写字母和数字"), PASSWORD_UPDATE_FAILED(8012,"密码修改失败"), + GOV_STAFF_ACCOUNT_NOT_EXISTS(8013,"手机号未注册,请联系贵单位管理员,确认其录入手机与您所持手机号相同"), MOBILE_HAS_BEEN_USED(8101, "该手机号已注册,请更换手机号或使用原绑定的微信账号登录"), MOBILE_CODE_ERROR(8102, "验证码错误"), AUTO_CONFIRM_FAILED(8103, "党员注册失败"), 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 49e8c8f25a..43c6358923 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 @@ -163,8 +163,8 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl customerStaffDTOList = baseDao.listCustomerStaffByAccount(userAccount); if (null == customerStaffDTOList || customerStaffDTOList.size() == 0) { - logger.warn(String.format("根据账户查询用户异常,账户:[%s],code[%s],msg[%s]", userAccount, EpmetErrorCode.GOV_STAFF_NOT_EXISTS.getCode(), EpmetErrorCode.GOV_STAFF_NOT_EXISTS.getMsg())); - return new Result().error(EpmetErrorCode.GOV_STAFF_NOT_EXISTS.getCode()); + logger.warn(String.format("根据账户查询用户异常,账户:[%s],code[%s],msg[%s]", userAccount, EpmetErrorCode.GOV_STAFF_ACCOUNT_NOT_EXISTS.getCode(), EpmetErrorCode.GOV_STAFF_ACCOUNT_NOT_EXISTS.getMsg())); + return new Result().error(EpmetErrorCode.GOV_STAFF_ACCOUNT_NOT_EXISTS.getCode()); } return new Result>().ok(customerStaffDTOList); } @@ -731,9 +731,9 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl customerStaffDTOList = baseDao.selectStaffByAccount(formDTO); if (null == customerStaffDTOList || customerStaffDTOList.size() < NumConstant.ONE) { logger.warn(String.format("根据客户Id和账户查询用户异常,客户Id:[%s],手机号:[%s],code[%s],msg[%s]", - formDTO.getCustomerId(), formDTO.getUserAccount(), EpmetErrorCode.GOV_STAFF_NOT_EXISTS.getCode(), - EpmetErrorCode.GOV_STAFF_NOT_EXISTS.getMsg())); - throw new RenException(EpmetErrorCode.GOV_STAFF_NOT_EXISTS.getCode()); + formDTO.getCustomerId(), formDTO.getUserAccount(), EpmetErrorCode.GOV_STAFF_ACCOUNT_NOT_EXISTS.getCode(), + EpmetErrorCode.GOV_STAFF_ACCOUNT_NOT_EXISTS.getMsg())); + throw new RenException(EpmetErrorCode.GOV_STAFF_ACCOUNT_NOT_EXISTS.getCode()); } return customerStaffDTOList; } From 10a3dfaefd84a9ec5076c05fb938413da738e65c Mon Sep 17 00:00:00 2001 From: zhangyuan Date: Thu, 21 Jul 2022 10:49:51 +0800 Subject: [PATCH 08/17] bug --- .../java/com/epmet/commons/tools/exception/EpmetErrorCode.java | 2 +- .../java/com/epmet/service/impl/CustomerStaffServiceImpl.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java index ecb953e72f..8b9dfc3bc7 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java @@ -40,7 +40,7 @@ public enum EpmetErrorCode { PASSWORD_NOT_FIT(8010,"两次填写的密码不一致"), PASSWORD_OUT_OF_ORDER(8011,"密码必须8-20个字符,而且同时包含大小写字母和数字"), PASSWORD_UPDATE_FAILED(8012,"密码修改失败"), - GOV_STAFF_ACCOUNT_NOT_EXISTS(8013,"手机号未注册,请联系贵单位管理员,确认其录入手机与您所持手机号相同"), + GOV_STAFF_ACCOUNT_NOT_EXISTS(8013,"账户未注册,请联系贵单位管理员"), MOBILE_HAS_BEEN_USED(8101, "该手机号已注册,请更换手机号或使用原绑定的微信账号登录"), MOBILE_CODE_ERROR(8102, "验证码错误"), AUTO_CONFIRM_FAILED(8103, "党员注册失败"), 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 43c6358923..92046f724c 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 @@ -730,7 +730,7 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl customerStaffDTOList = baseDao.selectStaffByAccount(formDTO); if (null == customerStaffDTOList || customerStaffDTOList.size() < NumConstant.ONE) { - logger.warn(String.format("根据客户Id和账户查询用户异常,客户Id:[%s],手机号:[%s],code[%s],msg[%s]", + logger.warn(String.format("根据客户Id和账户查询用户异常,客户Id:[%s],账户:[%s],code[%s],msg[%s]", formDTO.getCustomerId(), formDTO.getUserAccount(), EpmetErrorCode.GOV_STAFF_ACCOUNT_NOT_EXISTS.getCode(), EpmetErrorCode.GOV_STAFF_ACCOUNT_NOT_EXISTS.getMsg())); throw new RenException(EpmetErrorCode.GOV_STAFF_ACCOUNT_NOT_EXISTS.getCode()); From 47e40e6059597e94e0ce4c8922bde099545eab6b Mon Sep 17 00:00:00 2001 From: zhangyuan Date: Thu, 21 Jul 2022 14:15:08 +0800 Subject: [PATCH 09/17] =?UTF-8?q?=E7=99=BB=E9=99=86=E9=AA=8C=E8=AF=81?= =?UTF-8?q?=E6=96=B9=E6=B3=95=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/controller/GovLoginController.java | 14 +++++ .../controller/ThirdLoginController.java | 13 ++++ .../form/GovWxmpEnteOrgByAccountFormDTO.java | 48 ++++++++++++++ .../ThirdWxmpEnteOrgByAccountFormDTO.java | 47 ++++++++++++++ .../com/epmet/feign/EpmetUserFeignClient.java | 11 ++++ .../EpmetUserFeignClientFallback.java | 5 ++ .../com/epmet/service/GovLoginService.java | 9 +++ .../com/epmet/service/ThirdLoginService.java | 9 +++ .../service/impl/GovLoginServiceImpl.java | 30 +++++++++ .../service/impl/ThirdLoginServiceImpl.java | 62 +++++++++++++++++++ ...fV3FromDTO.java => AddStaffPyFromDTO.java} | 25 +++++--- ...FromDTO.java => StaffSubmitPyFromDTO.java} | 10 ++- .../com/epmet/controller/StaffController.java | 14 ++--- .../com/epmet/feign/EpmetUserFeignClient.java | 6 +- .../EpmetUserFeignClientFallBack.java | 6 +- .../java/com/epmet/service/StaffService.java | 6 +- .../epmet/service/impl/StaffServiceImpl.java | 13 ++-- .../form/CustomerStaffByAccountFormDTO.java | 36 +++++++++++ .../epmet/feign/EpmetUserOpenFeignClient.java | 10 +++ .../EpmetUserOpenFeignClientFallback.java | 5 ++ .../controller/CustomerStaffController.java | 21 +++++-- .../java/com/epmet/dao/CustomerStaffDao.java | 9 +++ .../epmet/service/CustomerStaffService.java | 13 +++- .../impl/CustomerStaffServiceImpl.java | 21 ++++++- .../resources/mapper/CustomerStaffDao.xml | 8 +++ 25 files changed, 406 insertions(+), 45 deletions(-) create mode 100644 epmet-auth/src/main/java/com/epmet/dto/form/GovWxmpEnteOrgByAccountFormDTO.java create mode 100644 epmet-auth/src/main/java/com/epmet/dto/form/ThirdWxmpEnteOrgByAccountFormDTO.java rename epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/{AddStaffV3FromDTO.java => AddStaffPyFromDTO.java} (67%) rename epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/{StaffSubmitV3FromDTO.java => StaffSubmitPyFromDTO.java} (90%) create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CustomerStaffByAccountFormDTO.java diff --git a/epmet-auth/src/main/java/com/epmet/controller/GovLoginController.java b/epmet-auth/src/main/java/com/epmet/controller/GovLoginController.java index 94a947819d..3ed824f33f 100644 --- a/epmet-auth/src/main/java/com/epmet/controller/GovLoginController.java +++ b/epmet-auth/src/main/java/com/epmet/controller/GovLoginController.java @@ -83,6 +83,20 @@ public class GovLoginController { return new Result().ok(userTokenResultDTO); } + /** + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhy + * @Description 4、选择组织,进入首页 + * @Date 2020/4/20 13:07 + **/ + @PostMapping(value = "/loginwxmp/enterorgbyaccount") + public Result enterOrgByAccount(@RequestBody GovWxmpEnteOrgByAccountFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO,GovWxmpEnteOrgByAccountFormDTO.AddUserShowGroup.class,GovWxmpEnteOrgByAccountFormDTO.AddUserInternalGroup.class); + UserTokenResultDTO userTokenResultDTO=govLoginService.enterOrgByAccount(formDTO); + return new Result().ok(userTokenResultDTO); + } + /** * @param tokenDto * @return com.epmet.commons.tools.utils.Result diff --git a/epmet-auth/src/main/java/com/epmet/controller/ThirdLoginController.java b/epmet-auth/src/main/java/com/epmet/controller/ThirdLoginController.java index 8efad1063c..e8977cd508 100644 --- a/epmet-auth/src/main/java/com/epmet/controller/ThirdLoginController.java +++ b/epmet-auth/src/main/java/com/epmet/controller/ThirdLoginController.java @@ -63,6 +63,19 @@ public class ThirdLoginController { return new Result().ok(userTokenResultDTO); } + /** + * @param formDTO + * @return + * @Author zhy + * @Description 单客户-选择组织,进入首页 + **/ + @PostMapping(value = "enterorgbyaccount") + public Result enterOrgByAccount(@RequestBody ThirdWxmpEnteOrgByAccountFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO,ThirdWxmpEnteOrgFormDTO.AddUserShowGroup.class,ThirdWxmpEnteOrgFormDTO.AddUserInternalGroup.class); + UserTokenResultDTO userTokenResultDTO=thirdLoginService.enterOrgByAccount(formDTO); + return new Result().ok(userTokenResultDTO); + } + /** * @param formDTO * @return diff --git a/epmet-auth/src/main/java/com/epmet/dto/form/GovWxmpEnteOrgByAccountFormDTO.java b/epmet-auth/src/main/java/com/epmet/dto/form/GovWxmpEnteOrgByAccountFormDTO.java new file mode 100644 index 0000000000..4996c0cd50 --- /dev/null +++ b/epmet-auth/src/main/java/com/epmet/dto/form/GovWxmpEnteOrgByAccountFormDTO.java @@ -0,0 +1,48 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description 选择组织,进入首页入参Dto + * @Author yinzuomei + * @Date 2020/4/20 13:03 + */ +@Data +public class GovWxmpEnteOrgByAccountFormDTO implements Serializable { + public interface AddUserInternalGroup {} + public interface AddUserShowGroup extends CustomerClientShowGroup {} + /** + * wxCode + */ + @NotBlank(message = "wxCode不能为空",groups = {AddUserInternalGroup.class}) + private String wxCode; + + /** + * 手机号 + */ + @NotBlank(message = "账号不能为空",groups = {AddUserShowGroup.class}) + private String userAccount; + + /** + * 选择的组织所属的id + */ + @NotBlank(message = "客户id不能为空",groups = {AddUserInternalGroup.class}) + private String customerId; + + /** + * 选择的要进入的组织(根组织id) + */ + @NotBlank(message = "组织id不能为空",groups = {AddUserInternalGroup.class}) + private String rootAgencyId; + + /** + * desc:小程序appId + */ + private String appId; + +} + diff --git a/epmet-auth/src/main/java/com/epmet/dto/form/ThirdWxmpEnteOrgByAccountFormDTO.java b/epmet-auth/src/main/java/com/epmet/dto/form/ThirdWxmpEnteOrgByAccountFormDTO.java new file mode 100644 index 0000000000..e89028eb4c --- /dev/null +++ b/epmet-auth/src/main/java/com/epmet/dto/form/ThirdWxmpEnteOrgByAccountFormDTO.java @@ -0,0 +1,47 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description 单客户-选择组织,进入首页入参Dto + * @Author sun + */ +@Data +public class ThirdWxmpEnteOrgByAccountFormDTO implements Serializable { + public interface AddUserInternalGroup {} + public interface AddUserShowGroup extends CustomerClientShowGroup {} + /** + * wxCode + */ + @NotBlank(message = "wxCode不能为空",groups = {AddUserInternalGroup.class}) + private String wxCode; + + /** + * 手机号 + */ + @NotBlank(message = "账号不能为空",groups = {AddUserShowGroup.class}) + private String userAccount; + + /** + * 选择的组织所属的id + */ + @NotBlank(message = "客户id不能为空",groups = {AddUserInternalGroup.class}) + private String customerId; + + /** + * 选择的要进入的组织(根组织id) + */ + @NotBlank(message = "组织id不能为空",groups = {AddUserInternalGroup.class}) + private String rootAgencyId; + + /** + * 客户appId(exJson文件中获取) + */ + @NotBlank(message = "appId不能为空",groups = {AddUserInternalGroup.class}) + private String appId; +} + diff --git a/epmet-auth/src/main/java/com/epmet/feign/EpmetUserFeignClient.java b/epmet-auth/src/main/java/com/epmet/feign/EpmetUserFeignClient.java index 1877439c9c..af33d8c632 100644 --- a/epmet-auth/src/main/java/com/epmet/feign/EpmetUserFeignClient.java +++ b/epmet-auth/src/main/java/com/epmet/feign/EpmetUserFeignClient.java @@ -111,6 +111,17 @@ public interface EpmetUserFeignClient { @PostMapping(value = "epmetuser/customerstaff/getcustomerstaffinfo", consumes = MediaType.APPLICATION_JSON_VALUE) Result getCustomerStaffInfo(@RequestBody CustomerStaffFormDTO customerStaffFormDTO); + /** + * @param customerStaffFormDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhy + * @Description 根据手机号+客户id获取工作人员基本信息 + * @Date 2020/4/20 14:16 + **/ + @PostMapping(value = "epmetuser/customerstaff/getcustomerstaffinfobyaccount", consumes = MediaType.APPLICATION_JSON_VALUE) + Result getCustomerStaffInfoByAccount(@RequestBody CustomerStaffByAccountFormDTO customerStaffFormDTO); + + /** * @param staffLoginHistoryFormDTO * @return com.epmet.commons.tools.utils.Result diff --git a/epmet-auth/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallback.java b/epmet-auth/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallback.java index 4f195cb3bd..d0ce30ab99 100644 --- a/epmet-auth/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallback.java +++ b/epmet-auth/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallback.java @@ -63,6 +63,11 @@ public class EpmetUserFeignClientFallback implements EpmetUserFeignClient { return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getCustomerStaffInfo", customerStaffFormDTO); } + @Override + public Result getCustomerStaffInfoByAccount(CustomerStaffByAccountFormDTO customerStaffFormDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getCustomerStaffInfoByAccount", customerStaffFormDTO); + } + @Override public Result saveStaffLoginRecord(StaffLoginAgencyRecordFormDTO staffLoginHistoryFormDTO) { return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "saveStaffLoginRecord", staffLoginHistoryFormDTO); diff --git a/epmet-auth/src/main/java/com/epmet/service/GovLoginService.java b/epmet-auth/src/main/java/com/epmet/service/GovLoginService.java index 67e8c37ceb..8ec5697a60 100644 --- a/epmet-auth/src/main/java/com/epmet/service/GovLoginService.java +++ b/epmet-auth/src/main/java/com/epmet/service/GovLoginService.java @@ -49,6 +49,15 @@ public interface GovLoginService { **/ UserTokenResultDTO enterOrg(GovWxmpEnteOrgFormDTO formDTO); + /** + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhy + * @Description 4、选择组织,进入首页 + * @Date 2020/4/20 13:08 + **/ + UserTokenResultDTO enterOrgByAccount(GovWxmpEnteOrgByAccountFormDTO formDTO); + /** * @return com.epmet.commons.tools.utils.Result * @param tokenDto diff --git a/epmet-auth/src/main/java/com/epmet/service/ThirdLoginService.java b/epmet-auth/src/main/java/com/epmet/service/ThirdLoginService.java index 3a07dda74f..69d13bf926 100644 --- a/epmet-auth/src/main/java/com/epmet/service/ThirdLoginService.java +++ b/epmet-auth/src/main/java/com/epmet/service/ThirdLoginService.java @@ -36,6 +36,15 @@ public interface ThirdLoginService { **/ UserTokenResultDTO enterOrg(ThirdWxmpEnteOrgFormDTO formDTO); + + /** + * @param formDTO + * @return + * @Author zhy + * @Description 单客户-选择组织,进入首页 + **/ + UserTokenResultDTO enterOrgByAccount(ThirdWxmpEnteOrgByAccountFormDTO formDTO); + /** * @param formDTO * @return diff --git a/epmet-auth/src/main/java/com/epmet/service/impl/GovLoginServiceImpl.java b/epmet-auth/src/main/java/com/epmet/service/impl/GovLoginServiceImpl.java index 3f392af088..24267debd1 100644 --- a/epmet-auth/src/main/java/com/epmet/service/impl/GovLoginServiceImpl.java +++ b/epmet-auth/src/main/java/com/epmet/service/impl/GovLoginServiceImpl.java @@ -289,6 +289,36 @@ public class GovLoginServiceImpl implements GovLoginService, ResultDataResolver return userTokenResultDTO; } + @Override + public UserTokenResultDTO enterOrgByAccount(GovWxmpEnteOrgByAccountFormDTO formDTO) { + //1、需要校验要登录的客户,是否被禁用 + CustomerStaffByAccountFormDTO customerStaffFormDTO = new CustomerStaffByAccountFormDTO(); + customerStaffFormDTO.setCustomerId(formDTO.getCustomerId()); + customerStaffFormDTO.setUserAccount(formDTO.getUserAccount()); + Result customerStaffDTOResult = epmetUserFeignClient.getCustomerStaffInfoByAccount(customerStaffFormDTO); + if (!customerStaffDTOResult.success() || null == customerStaffDTOResult.getData()) { + logger.warn(String.format("获取工作人员信息失败,账户[%s],客户id:[%s],code[%s],msg[%s]", formDTO.getUserAccount(), formDTO.getCustomerId(), customerStaffDTOResult.getCode(), customerStaffDTOResult.getMsg())); + throw new RenException(customerStaffDTOResult.getCode()); + } + CustomerStaffDTO customerStaff = customerStaffDTOResult.getData(); + //2、解析微信用户 + WxMaJscode2SessionResult wxMaJscode2SessionResult = loginService.getWxMaUser(LoginConstant.APP_GOV, formDTO.getWxCode(), formDTO.getAppId()); + + //3、记录staff_wechat,并记录用户激活状态,激活时间 + this.savestaffwechat(customerStaff.getUserId(), wxMaJscode2SessionResult.getOpenid(), formDTO.getCustomerId()); + //4、记录登录日志 + GovWxmpEnteOrgFormDTO orgDTO = ConvertUtils.sourceToTarget(formDTO, GovWxmpEnteOrgFormDTO.class); + orgDTO.setMobile(customerStaff.getMobile()); + this.saveStaffLoginRecord(orgDTO, customerStaff.getUserId(), wxMaJscode2SessionResult.getOpenid()); + //5.1、获取用户token + String token = this.generateGovWxmpToken(customerStaff.getUserId()); + //5.2、保存到redis + this.saveGovTokenDto(formDTO.getRootAgencyId(), formDTO.getCustomerId(), customerStaff.getUserId(), wxMaJscode2SessionResult, token); + UserTokenResultDTO userTokenResultDTO = new UserTokenResultDTO(); + userTokenResultDTO.setToken(token); + return userTokenResultDTO; + } + @Override public void loginOut(TokenDto tokenDto) { if(null == tokenDto){ diff --git a/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java b/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java index f8542f97e0..cd1495ddb2 100644 --- a/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java +++ b/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java @@ -425,6 +425,68 @@ public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResol return userTokenResultDTO; } + /** + * @param formDTO + * @return + * @Author sun + * @Description 单客户-选择组织,进入首页 + **/ + @Override + public UserTokenResultDTO enterOrgByAccount(ThirdWxmpEnteOrgByAccountFormDTO formDTO) { + //1、需要校验要登录的客户,是否被禁用 + CustomerStaffByAccountFormDTO customerStaffFormDTO = new CustomerStaffByAccountFormDTO(); + customerStaffFormDTO.setCustomerId(formDTO.getCustomerId()); + customerStaffFormDTO.setUserAccount(formDTO.getUserAccount()); + Result customerStaffDTOResult = epmetUserOpenFeignClient.getCustomerStaffInfoByAccount(customerStaffFormDTO); + if (!customerStaffDTOResult.success() || null == customerStaffDTOResult.getData()) { + logger.error(String.format("获取工作人员信息失败,账户[%s],客户id:[%s],code[%s],msg[%s]", formDTO.getUserAccount(), formDTO.getCustomerId(), customerStaffDTOResult.getCode(), customerStaffDTOResult.getMsg())); + throw new RenException(customerStaffDTOResult.getCode()); + } + CustomerStaffDTO customerStaff = customerStaffDTOResult.getData(); + //2020.7.24 获取微信信息接口调整,改调用微信api的方式 sun start + //2.调用epmet_third服务,校验appId是否有效以及是否授权,校验通过的调用微信API获取用户基本信息 + WxLoginFormDTO resiLoginFormDTO = new WxLoginFormDTO(); + resiLoginFormDTO.setAppId(formDTO.getAppId()); + resiLoginFormDTO.setWxCode(formDTO.getWxCode()); + UserWechatDTO userWechatDTO = this.getUserWeChat(resiLoginFormDTO); + WxMaJscode2SessionResult wxMaJscode2SessionResult = new WxMaJscode2SessionResult(); + wxMaJscode2SessionResult.setOpenid(userWechatDTO.getWxOpenId()); + wxMaJscode2SessionResult.setSessionKey(userWechatDTO.getSessionKey()); + wxMaJscode2SessionResult.setUnionid(""); + // end + //3、记录staff_wechat,并记录用户激活状态,激活时间 + this.savestaffwechat(customerStaff.getUserId(), userWechatDTO.getWxOpenId(), formDTO.getCustomerId()); + //4、记录登录日志 + StaffLatestAgencyResultDTO staffLatestAgencyResultDTO = new StaffLatestAgencyResultDTO(); + staffLatestAgencyResultDTO.setCustomerId(formDTO.getCustomerId()); + staffLatestAgencyResultDTO.setStaffId(customerStaff.getUserId()); + staffLatestAgencyResultDTO.setWxOpenId(userWechatDTO.getWxOpenId()); + staffLatestAgencyResultDTO.setMobile(customerStaff.getMobile()); + staffLatestAgencyResultDTO.setAgencyId(formDTO.getRootAgencyId()); + this.saveStaffLoginRecord(staffLatestAgencyResultDTO); + //5.1、获取用户token + String token = this.generateGovWxmpToken(customerStaff.getUserId()); + //5.2、保存到redis + StaffLatestAgencyResultDTO staffLatestAgency = new StaffLatestAgencyResultDTO(); + staffLatestAgency.setAgencyId(formDTO.getRootAgencyId()); + staffLatestAgency.setCustomerId(formDTO.getCustomerId()); + staffLatestAgency.setStaffId(customerStaff.getUserId()); + this.saveLatestGovTokenDto(staffLatestAgency, userWechatDTO, token); + + UserTokenResultDTO userTokenResultDTO = new UserTokenResultDTO(); + userTokenResultDTO.setToken(token); + + //6.发送登录事件 + try { + sendLoginEvent(customerStaff.getUserId(), formDTO.getAppId(), AppClientConstant.APP_GOV, AppClientConstant.CLIENT_WXMP); + } catch (RenException e) { + log.error(e.getInternalMsg()); + } catch (Exception e) { + log.error("【工作端enterOrg登录】发送登录事件失败,程序继续执行。错误信息"); + } + return userTokenResultDTO; + } + /** * @param formDTO * @return diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddStaffV3FromDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddStaffPyFromDTO.java similarity index 67% rename from epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddStaffV3FromDTO.java rename to epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddStaffPyFromDTO.java index bbcb0fbffb..9aa774bd31 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddStaffV3FromDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddStaffPyFromDTO.java @@ -17,7 +17,7 @@ import java.util.List; */ @NoArgsConstructor @Data -public class AddStaffV3FromDTO implements Serializable { +public class AddStaffPyFromDTO implements Serializable { private static final long serialVersionUID = 1L; /** * 新增人员所属类型Id @@ -34,8 +34,8 @@ public class AddStaffV3FromDTO implements Serializable { /** * 姓名 */ - @NotBlank(message = "姓名不能为空", groups = AddStaffV3FromDTO.AddStaff.class) - @Length(max = 15, message = "姓名仅允许输入15个字符", groups = AddStaffV3FromDTO.AddStaff.class) + @NotBlank(message = "姓名不能为空", groups = AddStaffPyFromDTO.AddStaff.class) + @Length(max = 15, message = "姓名仅允许输入15个字符", groups = AddStaffPyFromDTO.AddStaff.class) private String name; /** * 人员ID @@ -44,29 +44,36 @@ public class AddStaffV3FromDTO implements Serializable { /** * 手机 */ - @NotBlank(message = "手机号不能为空", groups = AddStaffV3FromDTO.AddStaff.class) - @Pattern(regexp = "^[1][3,4,5,6,7,8,9][0-9]{9}$", message = "请输入正确的手机号", groups = AddStaffV3FromDTO.AddStaff.class) + @NotBlank(message = "手机号不能为空", groups = AddStaffPyFromDTO.AddStaff.class) + @Pattern(regexp = "^[1][3,4,5,6,7,8,9][0-9]{9}$", message = "请输入正确的手机号", groups = AddStaffPyFromDTO.AddStaff.class) private String mobile; /** * 性别 */ - @NotNull(message = "性别不能为空", groups = AddStaffV3FromDTO.AddStaff.class) + @NotNull(message = "性别不能为空", groups = AddStaffPyFromDTO.AddStaff.class) private Integer gender; /** * 专兼职 */ - @NotBlank(message = "专兼职不能为空", groups = AddStaffV3FromDTO.AddStaff.class) + @NotBlank(message = "专兼职不能为空", groups = AddStaffPyFromDTO.AddStaff.class) private String workType; /** * 账户 */ - @NotBlank(message = "账户不能为空", groups = AddStaffV3FromDTO.AddStaff.class) + @NotBlank(message = "账号不能为空", groups = AddStaffPyFromDTO.AddStaff.class) private String userAccount; + + /** + * 密码 + */ + @NotBlank(message = "密码不能为空", groups = AddStaffPyFromDTO.AddStaff.class) + private String pwd; + /** * 角色id列表 */ - @NotNull(message = "角色不能为空", groups = AddStaffV3FromDTO.AddStaff.class) + @NotNull(message = "角色不能为空", groups = AddStaffPyFromDTO.AddStaff.class) private List roles; public interface AddStaff extends CustomerClientShowGroup {} /** diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/StaffSubmitV3FromDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/StaffSubmitPyFromDTO.java similarity index 90% rename from epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/StaffSubmitV3FromDTO.java rename to epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/StaffSubmitPyFromDTO.java index c010540299..31b527d6b9 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/StaffSubmitV3FromDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/StaffSubmitPyFromDTO.java @@ -11,13 +11,13 @@ import java.io.Serializable; import java.util.List; /** - * @author zhaoqifeng + * @author zhy * @dscription * @date 2020/4/24 10:43 */ @NoArgsConstructor @Data -public class StaffSubmitV3FromDTO implements Serializable { +public class StaffSubmitPyFromDTO implements Serializable { private static final long serialVersionUID = 1L; /** * 客户ID @@ -51,8 +51,12 @@ public class StaffSubmitV3FromDTO implements Serializable { /** * 性别 */ - @NotNull(message = "账户不能为空") + @NotNull(message = "账号不能为空") private String userAccount; + /** + * 密码 + */ + private String pwd; /** * 专兼职 */ 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 09e7d64871..4f51df6eb4 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 @@ -109,7 +109,7 @@ public class StaffController { */ @PostMapping("editstaffv3") @RequirePermission(requirePermission = RequirePermissionEnum.ORG_STAFF_UPDATE) - public Result editStaff(@LoginUser TokenDto tokenDto, @RequestBody StaffSubmitV3FromDTO fromDTO){ + public Result editStaff(@LoginUser TokenDto tokenDto, @RequestBody StaffSubmitPyFromDTO fromDTO){ ValidatorUtils.validateEntity(fromDTO); return staffService.editStaffV3(tokenDto, fromDTO); } @@ -209,17 +209,17 @@ public class StaffController { } /** - * 【通讯录】人员添加v2 - * @author sun + * 【通讯录】人员添加-平阴 + * @author zhy */ - @PostMapping("addstaffv3") + @PostMapping("addstaffpy") @RequirePermission(requirePermission = RequirePermissionEnum.ORG_STAFF_CREATE) - public Result addStaffV2(@LoginUser TokenDto tokenDto, @RequestBody AddStaffV3FromDTO fromDTO){ - ValidatorUtils.validateEntity(fromDTO, AddStaffV3FromDTO.AddStaff.class); + public Result addStaffPy(@LoginUser TokenDto tokenDto, @RequestBody AddStaffPyFromDTO fromDTO){ + ValidatorUtils.validateEntity(fromDTO, AddStaffPyFromDTO.AddStaff.class); fromDTO.setCustomerId(tokenDto.getCustomerId()); fromDTO.setApp(tokenDto.getApp()); fromDTO.setClient(tokenDto.getClient()); - return staffService.addStaffV3(fromDTO); + return staffService.addStaffPy(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 aa77af174b..9042cfbb3e 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 @@ -97,8 +97,8 @@ public interface EpmetUserFeignClient { * @param fromDTO 参数 * @return Result */ - @PostMapping("/epmetuser/customerstaff/addstaffv3") - Result addStaffV3(@RequestBody StaffSubmitV3FromDTO fromDTO); + @PostMapping("/epmetuser/customerstaff/addstaffpy") + Result addStaffPy(@RequestBody StaffSubmitPyFromDTO fromDTO); /** @@ -117,7 +117,7 @@ public interface EpmetUserFeignClient { * @return Result */ @PostMapping("/epmetuser/customerstaff/editstaffv3") - Result editStaffV3(@RequestBody StaffSubmitV3FromDTO fromDTO); + Result editStaffV3(@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 ed2d996101..4cc7a2884a 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 @@ -63,8 +63,8 @@ public class EpmetUserFeignClientFallBack implements EpmetUserFeignClient { } @Override - public Result addStaffV3(StaffSubmitV3FromDTO fromDTO) { - return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "addStaffv3", fromDTO); + public Result addStaffPy(StaffSubmitPyFromDTO fromDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "addStaffPy", fromDTO); } @Override @@ -73,7 +73,7 @@ public class EpmetUserFeignClientFallBack implements EpmetUserFeignClient { } @Override - public Result editStaffV3(StaffSubmitV3FromDTO fromDTO) { + public Result editStaffV3(StaffSubmitPyFromDTO fromDTO) { return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "editStaffV3", fromDTO); } 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 bd181a472a..157e3a3b59 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,StaffSubmitV3FromDTO fromDTO); + Result editStaffV3(TokenDto tokenDto, StaffSubmitPyFromDTO fromDTO); /** * 人员详情 @@ -140,10 +140,10 @@ public interface StaffService { /** - * 【通讯录】人员添加v3 + * 【通讯录】人员添加-平阴 * @author zhy */ - Result addStaffV3(AddStaffV3FromDTO fromDTO); + Result addStaffPy(AddStaffPyFromDTO fromDTO); /** * @Description 工作人员所属组织 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 bc30894037..ab2fc816e4 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,7 +196,7 @@ public class StaffServiceImpl implements StaffService { } @Override - public Result editStaffV3(TokenDto tokenDto, StaffSubmitV3FromDTO fromDTO) { + public Result editStaffV3(TokenDto tokenDto, StaffSubmitPyFromDTO fromDTO) { CustomerAgencyEntity customerAgencyEntity = customerAgencyService.selectById(fromDTO.getAgencyId()); fromDTO.setCustomerId(customerAgencyEntity.getCustomerId()); @@ -600,13 +600,10 @@ public class StaffServiceImpl implements StaffService { return new Result(); } - /** - * 【通讯录】人员添加v3 - * @author zhy - */ + @Override @Transactional(rollbackFor = Exception.class) - public Result addStaffV3(AddStaffV3FromDTO fromDTO) { + public Result addStaffPy(AddStaffPyFromDTO fromDTO) { //1.根据新增人员类型判断查询机关信息 OrgResultDTO orgDTO = customerAgencyDao.selectAgencyDetail(fromDTO.getOrgId(), fromDTO.getOrgType()); if (null == orgDTO) { @@ -615,9 +612,9 @@ public class StaffServiceImpl implements StaffService { } //2.调用user服务,新增用户信息 - StaffSubmitV3FromDTO submitDTO = ConvertUtils.sourceToTarget(fromDTO, StaffSubmitV3FromDTO.class); + StaffSubmitPyFromDTO submitDTO = ConvertUtils.sourceToTarget(fromDTO, StaffSubmitPyFromDTO.class); submitDTO.setAgencyId(orgDTO.getAgencyId()); - Result result = epmetUserFeignClient.addStaffV3(submitDTO); + Result result = epmetUserFeignClient.addStaffPy(submitDTO); 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-client/src/main/java/com/epmet/dto/form/CustomerStaffByAccountFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CustomerStaffByAccountFormDTO.java new file mode 100644 index 0000000000..75153c3305 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CustomerStaffByAccountFormDTO.java @@ -0,0 +1,36 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.List; + +/** + * @Description 根据手机号+客户id获取工作人员基本信息 + * @Author yinzuomei + * @Date 2020/4/20 14:02 + */ +@Data +public class CustomerStaffByAccountFormDTO implements Serializable { + private static final long serialVersionUID = 7619815083427853431L; + + // 根据手机号+客户id获取工作人员基本信息 + public interface GetCustomerStaffInfo {} + + @NotBlank(message = "账号不能为空", groups = { GetCustomerStaffInfo.class }) + private String userAccount; + @NotBlank(message = "客户id不能为空", groups = { GetCustomerStaffInfo.class }) + private String customerId; + + /** + * 姓名 + */ + private String realName; + + /** + * 用户id集合 + */ + private List userIds; +} + diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java index 631daa1354..21fab64783 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java @@ -150,6 +150,16 @@ public interface EpmetUserOpenFeignClient { @PostMapping(value = "epmetuser/customerstaff/getcustomerstaffinfo", consumes = MediaType.APPLICATION_JSON_VALUE) Result getCustomerStaffInfo(@RequestBody CustomerStaffFormDTO customerStaffFormDTO); + /** + * @param customerStaffFormDTO + * @return + * @Author sun + * @Description 根据账户+客户id获取工作人员基本信息 + **/ + @PostMapping(value = "epmetuser/customerstaff/getcustomerstaffinfobyaccount", consumes = MediaType.APPLICATION_JSON_VALUE) + Result getCustomerStaffInfoByAccount(@RequestBody CustomerStaffByAccountFormDTO customerStaffFormDTO); + + /** * @param userIdList * @return com.epmet.commons.tools.utils.Result> diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java index 31e62d076f..15a933dd9a 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java @@ -96,6 +96,11 @@ public class EpmetUserOpenFeignClientFallback implements EpmetUserOpenFeignClien return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getCustomerStaffInfo", customerStaffFormDTO); } + @Override + public Result getCustomerStaffInfoByAccount(CustomerStaffByAccountFormDTO customerStaffFormDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getCustomerStaffInfoByAccount", customerStaffFormDTO); + } + /** * @param userIdList * @return com.epmet.commons.tools.utils.Result> 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 ac64ab94c6..76bbf1fae6 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 @@ -143,6 +143,19 @@ public class CustomerStaffController { return customerStaffService.getCustomerStaffInfo(formDTO); } + /** + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhy + * @Description 根据账户+客户id获取工作人员基本信息 + * @Date 2020/4/20 14:04 + **/ + @PostMapping(value = "getcustomerstaffinfobyaccount") + public Result getCustomerStaffInfoByAccount(@RequestBody CustomerStaffByAccountFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, CustomerStaffFormDTO.GetCustomerStaffInfo.class); + return customerStaffService.getCustomerStaffInfoByAccount(formDTO); + } + /** * 根据userId查询网格下用户信息 * @param customerStaffGridDTOS @@ -250,9 +263,9 @@ public class CustomerStaffController { * @param fromDTO 参数 * @return Result */ - @PostMapping("addstaffv3") - public Result addStaffV3(@RequestBody StaffSubmitV3FromDTO fromDTO){ - Result result = customerStaffService.addStaffV3(fromDTO); + @PostMapping("addstaffpy") + public Result addStaffPy(@RequestBody StaffSubmitPyFromDTO fromDTO){ + Result result = customerStaffService.addStaffPy(fromDTO); //2021-10-18 推送mq,数据同步到中介库 start if (result.success()) { @@ -299,7 +312,7 @@ public class CustomerStaffController { * @return Result */ @PostMapping("editstaffv3") - public Result editStaffV3(@RequestBody StaffSubmitV3FromDTO fromDTO){ + public Result editStaffV3(@RequestBody StaffSubmitPyFromDTO fromDTO){ Result result = customerStaffService.editStaffV3(fromDTO); //2021-10-18 推送mq,数据同步到中介库 start diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java index 3840890ed3..26840db629 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java @@ -56,6 +56,15 @@ public interface CustomerStaffDao extends BaseDao { **/ CustomerStaffDTO selectListCustomerStaffInfo(CustomerStaffFormDTO formDTO); + /** + * @param formDTO + * @return com.epmet.dto.CustomerStaffDTO + * @Author zhy + * @Description 根据账户+客户id获取工作人员基本信息 + * @Date 2020/4/20 14:08 + **/ + CustomerStaffDTO selectListCustomerStaffInfoByAccount(CustomerStaffByAccountFormDTO formDTO); + CustomerStaffDTO selectStaffInfoByUserId(CustomerStaffDTO formDTO); /** 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 4955984be1..fa14d45111 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 @@ -123,6 +123,15 @@ public interface CustomerStaffService extends BaseService { **/ Result getCustomerStaffInfo(CustomerStaffFormDTO formDTO); + /** + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhy + * @Description 根据账户+客户id获取工作人员基本信息 + * @Date 2020/4/20 14:05 + **/ + Result getCustomerStaffInfoByAccount(CustomerStaffByAccountFormDTO formDTO); + /** * 根据用户ID获取工作人员基本信息 * @@ -184,7 +193,7 @@ public interface CustomerStaffService extends BaseService { * @param fromDTO 参数 * @return Result */ - Result addStaffV3(StaffSubmitV3FromDTO fromDTO); + Result addStaffPy(StaffSubmitPyFromDTO fromDTO); /** @@ -201,7 +210,7 @@ public interface CustomerStaffService extends BaseService { * @param fromDTO 参数 * @return Result */ - Result editStaffV3(StaffSubmitV3FromDTO fromDTO); + Result editStaffV3(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 92046f724c..85f770742e 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 @@ -184,6 +184,21 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl().ok(customerStaffDTO); } + @Override + public Result getCustomerStaffInfoByAccount(CustomerStaffByAccountFormDTO formDTO) { + CustomerStaffDTO customerStaffDTO = baseDao.selectListCustomerStaffInfoByAccount(formDTO); + if (null == customerStaffDTO) { + logger.warn(String.format("根据账户查询用户异常,账户:[%s],code[%s],msg[%s]", formDTO.getUserAccount(), EpmetErrorCode.GOV_STAFF_ACCOUNT_NOT_EXISTS.getCode(), EpmetErrorCode.GOV_STAFF_ACCOUNT_NOT_EXISTS.getMsg())); + return new Result().error(EpmetErrorCode.GOV_STAFF_ACCOUNT_NOT_EXISTS.getCode()); + } + //判断用户是否已被禁用 + if (null != customerStaffDTO && UserConstant.DISABLED.equals(customerStaffDTO.getEnableFlag())) { + logger.warn(String.format("根据账户查询用户异常,账户:[%s],客户id:[%s],code[%s],msg[%s]", formDTO.getUserAccount(), formDTO.getCustomerId(), EpmetErrorCode.GOV_STAFF_DISABLED.getCode(), EpmetErrorCode.GOV_STAFF_DISABLED.getMsg())); + return new Result().error(EpmetErrorCode.GOV_STAFF_DISABLED.getCode()); + } + return new Result().ok(customerStaffDTO); + } + @Override public Result getCustomerStaffInfoByUserId(CustomerStaffDTO formDTO) { CustomerStaffDTO customerStaffDTO = baseDao.selectStaffInfoByUserId(formDTO); @@ -355,7 +370,7 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl addStaffV3(StaffSubmitV3FromDTO fromDTO) { + public Result addStaffPy(StaffSubmitPyFromDTO fromDTO) { CustomerStaffFormDTO customerStaffFormDTO = new CustomerStaffFormDTO(); customerStaffFormDTO.setCustomerId(fromDTO.getCustomerId()); customerStaffFormDTO.setMobile(fromDTO.getMobile()); @@ -380,7 +395,7 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl + + + SELECT - USER_ID, - REAL_NAME, - MOBILE, - GENDER, - IFNULL(HEAD_PHOTO, "") AS "headPhoto", - ENABLE_FLAG, - ACTIVE_FLAG, - ACTIVE_TIME, - WORK_TYPE + * FROM customer_staff WHERE From 6ebd4c765f84656d46844b41e8d7c17d6ef8bf33 Mon Sep 17 00:00:00 2001 From: zhangyuan Date: Thu, 21 Jul 2022 16:04:38 +0800 Subject: [PATCH 11/17] =?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 Date: Thu, 21 Jul 2022 16:29:05 +0800 Subject: [PATCH 12/17] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/commons/tools/exception/EpmetErrorCode.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java index 99dfb014dd..9a190534ec 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java @@ -100,7 +100,7 @@ public enum EpmetErrorCode { EXIT_PEND_PROJECT(8408,"该工作人员有项目尚在处理,处理完毕方可操作"), EXIT_PUBLISHED_ACTIVITY(8409,"该工作人员有活动尚在进行,等活动完成方可操作"), CAN_NOT_SELF(8410,"无法对自己进行操作"), - ACCOUNT_USED(8411,"该手机号已注册"), + ACCOUNT_USED(8411,"该账号已注册"), PATROL_IS_NOT_OVER(8520,"巡查尚未结束"), ALREADY_EVALUATE(8501,"您已评价"), From 0e3b1796d540e72333aeeced822c73f2b5b9e121 Mon Sep 17 00:00:00 2001 From: zhangyuan Date: Thu, 21 Jul 2022 17:52:47 +0800 Subject: [PATCH 13/17] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...PyFromDTO.java => StaffSubmitAccountFromDTO.java} | 2 +- .../java/com/epmet/controller/StaffController.java | 8 ++++---- .../java/com/epmet/feign/EpmetUserFeignClient.java | 8 ++++---- .../feign/fallback/EpmetUserFeignClientFallBack.java | 8 ++++---- .../main/java/com/epmet/service/StaffService.java | 4 ++-- .../com/epmet/service/impl/StaffServiceImpl.java | 8 ++++---- .../epmet/controller/CustomerStaffController.java | 12 ++++++------ .../java/com/epmet/service/CustomerStaffService.java | 4 ++-- .../epmet/service/impl/CustomerStaffServiceImpl.java | 4 ++-- 9 files changed, 29 insertions(+), 29 deletions(-) rename epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/{StaffSubmitPyFromDTO.java => StaffSubmitAccountFromDTO.java} (95%) diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/StaffSubmitPyFromDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/StaffSubmitAccountFromDTO.java similarity index 95% rename from epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/StaffSubmitPyFromDTO.java rename to epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/StaffSubmitAccountFromDTO.java index 31b527d6b9..48b015614a 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/StaffSubmitPyFromDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/StaffSubmitAccountFromDTO.java @@ -17,7 +17,7 @@ import java.util.List; */ @NoArgsConstructor @Data -public class StaffSubmitPyFromDTO implements Serializable { +public class StaffSubmitAccountFromDTO implements Serializable { private static final long serialVersionUID = 1L; /** * 客户ID 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 5c5717a02b..939f740fc1 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 @@ -109,9 +109,9 @@ public class StaffController { */ @PostMapping("editstaffpy") @RequirePermission(requirePermission = RequirePermissionEnum.ORG_STAFF_UPDATE) - public Result editStaffPy(@LoginUser TokenDto tokenDto, @RequestBody StaffSubmitPyFromDTO fromDTO){ + public Result editStaffPy(@LoginUser TokenDto tokenDto, @RequestBody StaffSubmitAccountFromDTO fromDTO){ ValidatorUtils.validateEntity(fromDTO); - return staffService.editStaffPy(tokenDto, fromDTO); + return staffService.editStaffByAccount(tokenDto, fromDTO); } /** @@ -215,11 +215,11 @@ public class StaffController { @PostMapping("addstaffpy") @RequirePermission(requirePermission = RequirePermissionEnum.ORG_STAFF_CREATE) - public Result addStaffPy(@RequestBody StaffSubmitPyFromDTO fromDTO){ + public Result addStaffPy(@RequestBody StaffSubmitAccountFromDTO fromDTO){ fromDTO.setApp("gov"); fromDTO.setClient("wxmp"); ValidatorUtils.validateEntity(fromDTO); - return staffService.addStaffPy(fromDTO); + return staffService.addStaffByAccount(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 bdf22012e3..9f2c94e49c 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 @@ -97,8 +97,8 @@ public interface EpmetUserFeignClient { * @param fromDTO 参数 * @return Result */ - @PostMapping("/epmetuser/customerstaff/addstaffpy") - Result addStaffPy(@RequestBody StaffSubmitPyFromDTO fromDTO); + @PostMapping("/epmetuser/customerstaff/addstaffaccount") + Result addStaffByAccount(@RequestBody StaffSubmitAccountFromDTO fromDTO); /** @@ -116,8 +116,8 @@ public interface EpmetUserFeignClient { * @param fromDTO 参数 * @return Result */ - @PostMapping("/epmetuser/customerstaff/editstaffpy") - Result editStaffPy(@RequestBody StaffSubmitPyFromDTO fromDTO); + @PostMapping("/epmetuser/customerstaff/editstaffaccount") + Result editStaffByAccount(@RequestBody StaffSubmitAccountFromDTO 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 61751f50fe..5b5e7fc04e 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 @@ -63,8 +63,8 @@ public class EpmetUserFeignClientFallBack implements EpmetUserFeignClient { } @Override - public Result addStaffPy(StaffSubmitPyFromDTO fromDTO) { - return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "addStaffPy", fromDTO); + public Result addStaffByAccount(StaffSubmitAccountFromDTO fromDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "addStaffByAccount", fromDTO); } @Override @@ -73,8 +73,8 @@ public class EpmetUserFeignClientFallBack implements EpmetUserFeignClient { } @Override - public Result editStaffPy(StaffSubmitPyFromDTO fromDTO) { - return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "editStaffPy", fromDTO); + public Result editStaffByAccount(StaffSubmitAccountFromDTO fromDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "editStaffByAccount", 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 a27625981b..fc2f954b02 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 editStaffPy(TokenDto tokenDto, StaffSubmitPyFromDTO fromDTO); + Result editStaffByAccount(TokenDto tokenDto, StaffSubmitAccountFromDTO fromDTO); /** * 人员详情 @@ -143,7 +143,7 @@ public interface StaffService { * 【通讯录】人员添加-平阴 * @author zhy */ - Result addStaffPy(StaffSubmitPyFromDTO fromDTO); + Result addStaffByAccount(StaffSubmitAccountFromDTO fromDTO); /** * @Description 工作人员所属组织 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 c29719f436..2ea9803ac6 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 editStaffPy(TokenDto tokenDto, StaffSubmitPyFromDTO fromDTO) { + public Result editStaffByAccount(TokenDto tokenDto, StaffSubmitAccountFromDTO fromDTO) { CustomerAgencyEntity customerAgencyEntity = customerAgencyService.selectById(fromDTO.getAgencyId()); fromDTO.setCustomerId(customerAgencyEntity.getCustomerId()); fromDTO.setApp(tokenDto.getApp()); fromDTO.setClient(tokenDto.getClient()); - Result result = epmetUserFeignClient.editStaffPy(fromDTO); + Result result = epmetUserFeignClient.editStaffByAccount(fromDTO); if (!result.success()) { if (result.getCode() != EpmetErrorCode.SERVER_ERROR.getCode()) { return new Result().error(result.getCode(), result.getMsg()); @@ -603,12 +603,12 @@ public class StaffServiceImpl implements StaffService { @Override @Transactional(rollbackFor = Exception.class) - public Result addStaffPy(StaffSubmitPyFromDTO fromDTO) { + public Result addStaffByAccount(StaffSubmitAccountFromDTO fromDTO) { CustomerAgencyEntity customerAgencyEntity = customerAgencyService.selectById(fromDTO.getAgencyId()); //fromDTO.setApp(tokenDto.getApp()); //fromDTO.setClient(tokenDto.getClient()); fromDTO.setCustomerId(customerAgencyEntity.getCustomerId()); - Result result = epmetUserFeignClient.addStaffPy(fromDTO); + Result result = epmetUserFeignClient.addStaffByAccount(fromDTO); if (!result.success()) { if (result.getCode() != EpmetErrorCode.SERVER_ERROR.getCode()) { 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 e27e52c58f..33b8dfd087 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 @@ -263,9 +263,9 @@ public class CustomerStaffController { * @param fromDTO 参数 * @return Result */ - @PostMapping("addstaffpy") - public Result addStaffPy(@RequestBody StaffSubmitPyFromDTO fromDTO){ - Result result = customerStaffService.addStaffPy(fromDTO); + @PostMapping("addstaffaccount") + public Result addStaffByAccount(@RequestBody StaffSubmitAccountFromDTO fromDTO){ + Result result = customerStaffService.addStaffByAccount(fromDTO); //2021-10-18 推送mq,数据同步到中介库 start if (result.success()) { @@ -311,9 +311,9 @@ public class CustomerStaffController { * @param fromDTO 参数 * @return Result */ - @PostMapping("editstaffpy") - public Result editStaffPy(@RequestBody StaffSubmitPyFromDTO fromDTO){ - Result result = customerStaffService.editStaffPy(fromDTO); + @PostMapping("editstaffaccount") + public Result editStaffByAccount(@RequestBody StaffSubmitAccountFromDTO fromDTO){ + Result result = customerStaffService.editStaffByAccount(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 6376d1200d..232b951e2a 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 @@ -193,7 +193,7 @@ public interface CustomerStaffService extends BaseService { * @param fromDTO 参数 * @return Result */ - Result addStaffPy(StaffSubmitPyFromDTO fromDTO); + Result addStaffByAccount(StaffSubmitAccountFromDTO fromDTO); /** @@ -210,7 +210,7 @@ public interface CustomerStaffService extends BaseService { * @param fromDTO 参数 * @return Result */ - Result editStaffPy(StaffSubmitPyFromDTO fromDTO); + Result editStaffByAccount(StaffSubmitAccountFromDTO 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 bc09f805c2..561703a793 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 @@ -374,7 +374,7 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl addStaffPy(StaffSubmitPyFromDTO fromDTO) { + public Result addStaffByAccount(StaffSubmitAccountFromDTO fromDTO) { CustomerStaffFormDTO customerStaffFormDTO = new CustomerStaffFormDTO(); customerStaffFormDTO.setCustomerId(fromDTO.getCustomerId()); customerStaffFormDTO.setMobile(fromDTO.getMobile()); @@ -511,7 +511,7 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl Date: Thu, 21 Jul 2022 18:04:29 +0800 Subject: [PATCH 14/17] =?UTF-8?q?flyway=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/db/migration/V0.0.62__alter_customer_staff.sql | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.62__alter_customer_staff.sql diff --git a/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.62__alter_customer_staff.sql b/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.62__alter_customer_staff.sql new file mode 100644 index 0000000000..c8a15854eb --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.62__alter_customer_staff.sql @@ -0,0 +1,2 @@ +ALTER TABLE epmet_user.customer_staff ADD USER_ACCOUNT varchar(32) NULL COMMENT '登录账户'; +ALTER TABLE epmet_user.customer_staff CHANGE USER_ACCOUNT USER_ACCOUNT varchar(32) NULL COMMENT '登录账户' AFTER USER_ID; From 321d28c11639a28812456bc71d2ecac40d2e910f Mon Sep 17 00:00:00 2001 From: zhangyuan Date: Mon, 25 Jul 2022 10:53:06 +0800 Subject: [PATCH 15/17] =?UTF-8?q?log=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/service/impl/StaffServiceImpl.java | 1 + 1 file changed, 1 insertion(+) 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 2ea9803ac6..f589bfb0b7 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 @@ -202,6 +202,7 @@ public class StaffServiceImpl implements StaffService { fromDTO.setApp(tokenDto.getApp()); fromDTO.setClient(tokenDto.getClient()); + logger.info("获取到的参数为:"+fromDTO.toString()); Result result = epmetUserFeignClient.editStaffByAccount(fromDTO); if (!result.success()) { if (result.getCode() != EpmetErrorCode.SERVER_ERROR.getCode()) { From 4850edbbf4a32dc00fce967f54eccc4eb1a3ab8b Mon Sep 17 00:00:00 2001 From: zhangyuan Date: Mon, 25 Jul 2022 17:09:04 +0800 Subject: [PATCH 16/17] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=BA=AB=E4=BB=BD?= =?UTF-8?q?=E8=AF=81=E5=8F=B7=E6=98=BE=E7=A4=BA=E5=92=8C=E5=BD=95=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/dto/form/StaffSubmitAccountFromDTO.java | 4 ++++ .../main/java/com/epmet/dto/result/StaffInitResultDTO.java | 4 ++++ .../java/com/epmet/service/impl/CustomerStaffServiceImpl.java | 3 +++ 3 files changed, 11 insertions(+) diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/StaffSubmitAccountFromDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/StaffSubmitAccountFromDTO.java index 48b015614a..7e0bf7e36c 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/StaffSubmitAccountFromDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/StaffSubmitAccountFromDTO.java @@ -75,4 +75,8 @@ public class StaffSubmitAccountFromDTO implements Serializable { * 来源client(PC端:web、微信小程序:wxmp) */ private String client; + /** + * 身份证号 + */ + private String idCard; } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffInitResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffInitResultDTO.java index 3efc2d6342..9cb3a68c0a 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffInitResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffInitResultDTO.java @@ -37,6 +37,10 @@ public class StaffInitResultDTO implements Serializable { * 专兼职 */ private String workType; + /** + * 身份证号 + */ + private String idCard; /** * 职责列表 */ 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 561703a793..3ab515d58e 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 @@ -287,6 +287,7 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl Date: Mon, 25 Jul 2022 17:16:29 +0800 Subject: [PATCH 17/17] =?UTF-8?q?=E5=88=A0=E6=8E=89=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/service/impl/StaffServiceImpl.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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 f589bfb0b7..f1770a36a5 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 @@ -199,10 +199,9 @@ public class StaffServiceImpl implements StaffService { public Result editStaffByAccount(TokenDto tokenDto, StaffSubmitAccountFromDTO fromDTO) { CustomerAgencyEntity customerAgencyEntity = customerAgencyService.selectById(fromDTO.getAgencyId()); fromDTO.setCustomerId(customerAgencyEntity.getCustomerId()); - fromDTO.setApp(tokenDto.getApp()); fromDTO.setClient(tokenDto.getClient()); - logger.info("获取到的参数为:"+fromDTO.toString()); + Result result = epmetUserFeignClient.editStaffByAccount(fromDTO); if (!result.success()) { if (result.getCode() != EpmetErrorCode.SERVER_ERROR.getCode()) {