From a234a27c5a0a74c1eea1ff1645f066458ff68ddf Mon Sep 17 00:00:00 2001 From: zhangyuan Date: Wed, 20 Jul 2022 15:16:22 +0800 Subject: [PATCH 001/147] =?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 006/147] =?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 007/147] =?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 008/147] 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 009/147] =?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 011/147] =?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 012/147] =?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 013/147] =?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 014/147] =?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 015/147] =?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 016/147] =?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 017/147] =?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()) { From 1d372aa184e1d4790f1222ba4b6df770d1242f0b Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 13 Sep 2022 18:30:06 +0800 Subject: [PATCH 018/147] =?UTF-8?q?third=E9=9B=86=E6=88=90=E6=B6=88?= =?UTF-8?q?=E6=81=AF=E5=9B=9E=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet-third/epmet-third-server/pom.xml | 13 ++- .../java/com/epmet/EpmetThirdApplication.java | 2 + .../dingtalk/CallbackController.java | 85 +++++++++++++++++++ .../src/main/resources/bootstrap.yml | 3 + .../src/main/resources/logback-spring.xml | 2 + .../java/com/epmet/ThirdPlatformTest.java | 30 +++++++ 6 files changed, 133 insertions(+), 2 deletions(-) create mode 100644 epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/dingtalk/CallbackController.java create mode 100644 epmet-module/epmet-third/epmet-third-server/src/main/test/java/com/epmet/ThirdPlatformTest.java diff --git a/epmet-module/epmet-third/epmet-third-server/pom.xml b/epmet-module/epmet-third/epmet-third-server/pom.xml index e991b981f3..a70d2ac789 100644 --- a/epmet-module/epmet-third/epmet-third-server/pom.xml +++ b/epmet-module/epmet-third/epmet-third-server/pom.xml @@ -157,7 +157,16 @@ rocketmq-acl 4.9.2 - + + dingtalk-spring-boot-starter + com.taobao + 1.0.0 + + + commons-codec + commons-codec + 1.15 + @@ -229,7 +238,7 @@ SECfcc020bdc83bb17a2c00f39977b1fbc409ef4188c7beaea11c5caa90eeaf87fd - + diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/EpmetThirdApplication.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/EpmetThirdApplication.java index 3efd642c87..21c518e033 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/EpmetThirdApplication.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/EpmetThirdApplication.java @@ -1,6 +1,7 @@ package com.epmet; import com.epmet.mq.properties.RocketMQProperties; +import com.taobao.dingtalk.spring.annotations.EnableDingTalk; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.context.properties.EnableConfigurationProperties; @@ -8,6 +9,7 @@ import org.springframework.boot.web.servlet.ServletComponentScan; import org.springframework.cloud.client.discovery.EnableDiscoveryClient; import org.springframework.cloud.openfeign.EnableFeignClients; +@EnableDingTalk @EnableConfigurationProperties(RocketMQProperties.class) @SpringBootApplication @EnableDiscoveryClient diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/dingtalk/CallbackController.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/dingtalk/CallbackController.java new file mode 100644 index 0000000000..69cbcffaca --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/dingtalk/CallbackController.java @@ -0,0 +1,85 @@ +package com.epmet.controller.dingtalk; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.aliyun.dingtalk.config.Constant; +import com.aliyun.dingtalk.util.DingCallbackCrypto; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.web.bind.annotation.*; + +/** + * ISV 小程序回调信息处理 + */ +@RestController +@RequestMapping("/dingTalk") +public class CallbackController { + + private final Logger log = LoggerFactory.getLogger(getClass()); + + /** + * 创建应用,验证回调URL创建有效事件(第一次保存回调URL之前) + */ + private static final String EVENT_CHECK_CREATE_SUITE_URL = "check_create_suite_url"; + + /** + * 创建应用,验证回调URL变更有效事件(第一次保存回调URL之后) + */ + private static final String EVENT_CHECK_UPADTE_SUITE_URL = "check_update_suite_url"; + + /** + * suite_ticket推送事件 + */ + private static final String EVENT_SUITE_TICKET = "suite_ticket"; + + /** + * 企业授权开通应用事件 + */ + private static final String EVENT_TMP_AUTH_CODE = "tmp_auth_code"; + + @PostMapping(value = "dingCallback") + public Object dingCallback( + @RequestParam(value = "signature") String signature, + @RequestParam(value = "timestamp") Long timestamp, + @RequestParam(value = "nonce") String nonce, + @RequestBody(required = false) JSONObject body + ) { + String params = "signature:" + signature + " timestamp:" + timestamp + " nonce:" + nonce + " body:" + body; + try { + log.info("begin callback:" + params); + + DingCallbackCrypto dingTalkEncryptor = new DingCallbackCrypto(Constant.TOKEN, Constant.ENCODING_AES_KEY, Constant.SUITE_KEY); + + // 从post请求的body中获取回调信息的加密数据进行解密处理 + String encrypt = body.getString("encrypt"); + String plainText = dingTalkEncryptor.getDecryptMsg(signature, timestamp.toString(), nonce, encrypt); + JSONObject callBackContent = JSON.parseObject(plainText); + + // 根据回调事件类型做不同的业务处理 + String eventType = callBackContent.getString("EventType"); + if (EVENT_CHECK_CREATE_SUITE_URL.equals(eventType)) { + log.info("验证新创建的回调URL有效性: " + plainText); + } else if (EVENT_CHECK_UPADTE_SUITE_URL.equals(eventType)) { + log.info("验证更新回调URL有效性: " + plainText); + } else if (EVENT_SUITE_TICKET.equals(eventType)) { + // suite_ticket用于用签名形式生成accessToken(访问钉钉服务端的凭证),需要保存到应用的db。 + // 钉钉会定期向本callback url推送suite_ticket新值用以提升安全性。 + // 应用在获取到新的时值时,保存db成功后,返回给钉钉success加密串(如本demo的return) + log.info("应用suite_ticket数据推送: " + plainText); + } else if (EVENT_TMP_AUTH_CODE.equals(eventType)) { + // 本事件应用应该异步进行授权开通企业的初始化,目的是尽最大努力快速返回给钉钉服务端。用以提升企业管理员开通应用体验 + // 即使本接口没有收到数据或者收到事件后处理初始化失败都可以后续再用户试用应用时从前端获取到corpId并拉取授权企业信息,进而初始化开通及企业。 + log.info("企业授权开通应用事件: " + plainText); + } else { + // 其他类型事件处理 + } + + // 返回success的加密信息表示回调处理成功 + return dingTalkEncryptor.getEncryptedMap("success", timestamp, nonce); + } catch (Exception e) { + //失败的情况,应用的开发者应该通过告警感知,并干预修复 + log.error("process callback fail." + params, e); + return "fail"; + } + } +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/resources/bootstrap.yml b/epmet-module/epmet-third/epmet-third-server/src/main/resources/bootstrap.yml index 67cbb2570e..225c468573 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/resources/bootstrap.yml +++ b/epmet-module/epmet-third/epmet-third-server/src/main/resources/bootstrap.yml @@ -146,6 +146,9 @@ third: - https://epmet-ext10.elinkservice.cn dingTalk: + appKey: dingo53zvltapzrstzbo + appsecret: o1hjFvWKwLG1GIuivX0nbynqFvFDZiI3CoqLyhdZXhghXMEsr34LKCud0Rz2Hd16 + agentid: 1880131092 robot: webHook: @dingTalk.robot.webHook@ secret: @dingTalk.robot.secret@ diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/resources/logback-spring.xml b/epmet-module/epmet-third/epmet-third-server/src/main/resources/logback-spring.xml index 31d6de459d..c95ac8b0f3 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/resources/logback-spring.xml +++ b/epmet-module/epmet-third/epmet-third-server/src/main/resources/logback-spring.xml @@ -145,6 +145,7 @@ + @@ -158,6 +159,7 @@ + diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/test/java/com/epmet/ThirdPlatformTest.java b/epmet-module/epmet-third/epmet-third-server/src/main/test/java/com/epmet/ThirdPlatformTest.java new file mode 100644 index 0000000000..f9151838e6 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/test/java/com/epmet/ThirdPlatformTest.java @@ -0,0 +1,30 @@ +package com.epmet; + +import com.alibaba.fastjson.JSON; +import com.aliyun.dingtalk.module.Result; +import com.taobao.dingtalk.client.DingTalkClientToken; +import lombok.extern.slf4j.Slf4j; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; + +/** + * desc:redisson测试类 + */ +@Slf4j +@RunWith(value = SpringRunner.class) +@SpringBootTest(classes = {EpmetThirdApplication.class}) +public class ThirdPlatformTest { + + + @Autowired + DingTalkClientToken dingTalkClientToken; + + @Test + public void sendText(){ + Result appAccessTokenToken = dingTalkClientToken.getAppAccessTokenToken(); + System.out.println("=======:"+JSON.toJSONString(appAccessTokenToken)); + } +} From ab268ba7982858bd21f70f820e823f6c8505e4f4 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Wed, 14 Sep 2022 10:13:19 +0800 Subject: [PATCH 019/147] =?UTF-8?q?=E6=96=B0=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dto/OpenSyncBizDataDTO.java | 97 +++++++++++++++++++ .../dingtalk/CallbackController.java | 33 ++++++- .../com/epmet/dao/OpenSyncBizDataDao.java | 16 +++ .../epmet/entity/OpenSyncBizDataEntity.java | 68 +++++++++++++ .../epmet/service/OpenSyncBizDataService.java | 78 +++++++++++++++ .../impl/OpenSyncBizDataServiceImpl.java | 82 ++++++++++++++++ .../resources/mapper/OpenSyncBizDataDao.xml | 6 ++ 7 files changed, 377 insertions(+), 3 deletions(-) create mode 100644 epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/OpenSyncBizDataDTO.java create mode 100644 epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/OpenSyncBizDataDao.java create mode 100644 epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/OpenSyncBizDataEntity.java create mode 100644 epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/OpenSyncBizDataService.java create mode 100644 epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/OpenSyncBizDataServiceImpl.java create mode 100644 epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/OpenSyncBizDataDao.xml diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/OpenSyncBizDataDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/OpenSyncBizDataDTO.java new file mode 100644 index 0000000000..b94711e55e --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/OpenSyncBizDataDTO.java @@ -0,0 +1,97 @@ +package com.epmet.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-09-14 + */ +@Data +public class OpenSyncBizDataDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * + */ + private String id; + + /** + * 第三方企业应用的suiteid加下划线0 + */ + private String subscribeId; + + /** + * 第三方企业应用的corpid + */ + private String corpId; + + /** + * 第三方企业应用的suiteid + */ + private String bizId; + + /** + * 数据为Json格式 + */ + private String bizData; + + /** + * 2:第三方企业应用票据; +4:企业授权变更,包含授权、解除授权、授权变更; +7:第三方企业应用变更,包含停用、启用、删除(删除保留授权); +13:企业用户变更,包含用户添加、修改、删除; +14:企业部门变更,包含部门添加、修改、删除; +15:企业角色变更,包含角色添加、修改、删除; +16:企业变更,包含企业修改、删除; +17:市场订单; +20:企业外部联系人变更,包含添加、修改、删除; +22:ISV自定义审批; +25:家校通讯录1.0(Deprecated)信息变更。家校通讯录升级,请查看家校通讯录2.0数据推送; +32:智能硬件绑定类型; +37:因订单到期或者用户退款等导致的服务关闭,目前仅推送因退款等导致的服务关闭; +50:家校通讯录2.0,部门信息变更; +51:家校通讯录2.0,人员信息变更; +63:应用试用记录回调信息; +66:工作台组件变更回调事件; +67:钉钉假期相关回调事件; +133:CRM客户动态相关数据回调事件; +137:人事平台员工异动V2相关数据回调事件; +139:异步转译通讯录id任务完成通知; +165:人事平台员工档案变动事件相关数据的回调事件; +175:人事解决方案变更事件; + */ + private String bizType; + + /** + * + */ + private Integer delFlag; + + /** + * + */ + private Date createdTime; + + /** + * + */ + private String createdBy; + + /** + * + */ + private Date updatedTime; + + /** + * + */ + private String updatedBy; + +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/dingtalk/CallbackController.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/dingtalk/CallbackController.java index 69cbcffaca..8edd48d46a 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/dingtalk/CallbackController.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/dingtalk/CallbackController.java @@ -2,12 +2,20 @@ package com.epmet.controller.dingtalk; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; -import com.aliyun.dingtalk.config.Constant; import com.aliyun.dingtalk.util.DingCallbackCrypto; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.entity.OpenSyncBizDataEntity; +import com.epmet.service.OpenSyncBizDataService; +import org.apache.commons.collections4.CollectionUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + /** * ISV 小程序回调信息处理 */ @@ -37,24 +45,33 @@ public class CallbackController { */ private static final String EVENT_TMP_AUTH_CODE = "tmp_auth_code"; + private static final String EVENT_SYNC_HTTP_PUSH_HIGH = "SYNC_HTTP_PUSH_HIGH"; + + @Autowired + private OpenSyncBizDataService openSyncBizDataService; + @PostMapping(value = "dingCallback") public Object dingCallback( @RequestParam(value = "signature") String signature, @RequestParam(value = "timestamp") Long timestamp, @RequestParam(value = "nonce") String nonce, + @RequestParam(value = "id") int id, @RequestBody(required = false) JSONObject body ) { + log.info("id is:"+id); String params = "signature:" + signature + " timestamp:" + timestamp + " nonce:" + nonce + " body:" + body; try { log.info("begin callback:" + params); - DingCallbackCrypto dingTalkEncryptor = new DingCallbackCrypto(Constant.TOKEN, Constant.ENCODING_AES_KEY, Constant.SUITE_KEY); + DingCallbackCrypto dingTalkEncryptor = new DingCallbackCrypto("vTUvaf6QtOJZsa1h7Wkoteo", "csRpvVFGL7Cf1N9ubajix8tDWhCllROhaxCHKFnbuAz", "suite5yxliro6wawv514w"); // 从post请求的body中获取回调信息的加密数据进行解密处理 String encrypt = body.getString("encrypt"); String plainText = dingTalkEncryptor.getDecryptMsg(signature, timestamp.toString(), nonce, encrypt); JSONObject callBackContent = JSON.parseObject(plainText); + log.info("推来的消息体:"+plainText); + // 根据回调事件类型做不同的业务处理 String eventType = callBackContent.getString("EventType"); if (EVENT_CHECK_CREATE_SUITE_URL.equals(eventType)) { @@ -70,7 +87,17 @@ public class CallbackController { // 本事件应用应该异步进行授权开通企业的初始化,目的是尽最大努力快速返回给钉钉服务端。用以提升企业管理员开通应用体验 // 即使本接口没有收到数据或者收到事件后处理初始化失败都可以后续再用户试用应用时从前端获取到corpId并拉取授权企业信息,进而初始化开通及企业。 log.info("企业授权开通应用事件: " + plainText); - } else { + } else if (EVENT_SYNC_HTTP_PUSH_HIGH.equals(eventType)){ + log.info("ticket: " + plainText); + List> bizData = (List>) callBackContent.get("bizData"); + if (CollectionUtils.isNotEmpty(bizData)){ + List list = new ArrayList<>(); + bizData.forEach(b -> { + list.add(ConvertUtils.mapToEntity(b, OpenSyncBizDataEntity.class)); + }); + openSyncBizDataService.insertBatch(list); + } + } else{ // 其他类型事件处理 } diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/OpenSyncBizDataDao.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/OpenSyncBizDataDao.java new file mode 100644 index 0000000000..800ff14a06 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/OpenSyncBizDataDao.java @@ -0,0 +1,16 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.OpenSyncBizDataEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-09-14 + */ +@Mapper +public interface OpenSyncBizDataDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/OpenSyncBizDataEntity.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/OpenSyncBizDataEntity.java new file mode 100644 index 0000000000..69f3d0a61f --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/OpenSyncBizDataEntity.java @@ -0,0 +1,68 @@ +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-09-14 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("open_sync_biz_data") +public class OpenSyncBizDataEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 第三方企业应用的suiteid加下划线0 + */ + private String subscribeId; + + /** + * 第三方企业应用的corpid + */ + private String corpId; + + /** + * 第三方企业应用的suiteid + */ + private String bizId; + + /** + * 数据为Json格式 + */ + private String bizData; + + /** + * 2:第三方企业应用票据; +4:企业授权变更,包含授权、解除授权、授权变更; +7:第三方企业应用变更,包含停用、启用、删除(删除保留授权); +13:企业用户变更,包含用户添加、修改、删除; +14:企业部门变更,包含部门添加、修改、删除; +15:企业角色变更,包含角色添加、修改、删除; +16:企业变更,包含企业修改、删除; +17:市场订单; +20:企业外部联系人变更,包含添加、修改、删除; +22:ISV自定义审批; +25:家校通讯录1.0(Deprecated)信息变更。家校通讯录升级,请查看家校通讯录2.0数据推送; +32:智能硬件绑定类型; +37:因订单到期或者用户退款等导致的服务关闭,目前仅推送因退款等导致的服务关闭; +50:家校通讯录2.0,部门信息变更; +51:家校通讯录2.0,人员信息变更; +63:应用试用记录回调信息; +66:工作台组件变更回调事件; +67:钉钉假期相关回调事件; +133:CRM客户动态相关数据回调事件; +137:人事平台员工异动V2相关数据回调事件; +139:异步转译通讯录id任务完成通知; +165:人事平台员工档案变动事件相关数据的回调事件; +175:人事解决方案变更事件; + */ + private String bizType; + +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/OpenSyncBizDataService.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/OpenSyncBizDataService.java new file mode 100644 index 0000000000..837eacceb7 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/OpenSyncBizDataService.java @@ -0,0 +1,78 @@ +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.OpenSyncBizDataDTO; +import com.epmet.entity.OpenSyncBizDataEntity; + +import java.util.List; +import java.util.Map; + +/** + * + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-09-14 + */ +public interface OpenSyncBizDataService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2022-09-14 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2022-09-14 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return OpenSyncBizDataDTO + * @author generator + * @date 2022-09-14 + */ + OpenSyncBizDataDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2022-09-14 + */ + void save(OpenSyncBizDataDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2022-09-14 + */ + void update(OpenSyncBizDataDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2022-09-14 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/OpenSyncBizDataServiceImpl.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/OpenSyncBizDataServiceImpl.java new file mode 100644 index 0000000000..5ac87c6159 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/OpenSyncBizDataServiceImpl.java @@ -0,0 +1,82 @@ +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dao.OpenSyncBizDataDao; +import com.epmet.dto.OpenSyncBizDataDTO; +import com.epmet.entity.OpenSyncBizDataEntity; +import com.epmet.service.OpenSyncBizDataService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-09-14 + */ +@Service +public class OpenSyncBizDataServiceImpl extends BaseServiceImpl implements OpenSyncBizDataService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, OpenSyncBizDataDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, OpenSyncBizDataDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public OpenSyncBizDataDTO get(String id) { + OpenSyncBizDataEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, OpenSyncBizDataDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(OpenSyncBizDataDTO dto) { + OpenSyncBizDataEntity entity = ConvertUtils.sourceToTarget(dto, OpenSyncBizDataEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(OpenSyncBizDataDTO dto) { + OpenSyncBizDataEntity entity = ConvertUtils.sourceToTarget(dto, OpenSyncBizDataEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/OpenSyncBizDataDao.xml b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/OpenSyncBizDataDao.xml new file mode 100644 index 0000000000..7f240f2ee3 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/OpenSyncBizDataDao.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file From 9110461cb662925d56d157dbcb236be93be51966 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Wed, 14 Sep 2022 13:54:11 +0800 Subject: [PATCH 020/147] =?UTF-8?q?=E5=9B=9E=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/commons/tools/redis/RedisKeys.java | 10 +++ .../java/com/epmet/dto/DingMiniInfoDTO.java | 89 +++++++++++++++++++ .../dingtalk/CallbackController.java | 32 +++++-- .../com/epmet/dao/OpenSyncBizDataDao.java | 8 +- .../epmet/redis/DingDingCallbackRedis.java | 26 ++++++ .../epmet/service/OpenSyncBizDataService.java | 2 + .../impl/OpenSyncBizDataServiceImpl.java | 6 ++ .../resources/mapper/OpenSyncBizDataDao.xml | 12 +++ 8 files changed, 176 insertions(+), 9 deletions(-) create mode 100644 epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/DingMiniInfoDTO.java create mode 100644 epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/redis/DingDingCallbackRedis.java diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java index bb7edb3e2a..1ec2b60a01 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java @@ -871,4 +871,14 @@ public class RedisKeys { public static String getDhToken() { return rootPrefix.concat("dh:token"); } + + /** + * Desc: 票据 + * @param suiteKey + * @author zxc + * @date 2022/9/14 10:46 + */ + public static String getSuiteTicketKey(String suiteKey) { + return rootPrefix.concat("ding:suiteTicket:" + suiteKey); + } } diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/DingMiniInfoDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/DingMiniInfoDTO.java new file mode 100644 index 0000000000..19ebfacdd9 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/DingMiniInfoDTO.java @@ -0,0 +1,89 @@ +package com.epmet.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 钉钉小程序信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-09-14 + */ +@Data +public class DingMiniInfoDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID + */ + private String id; + + /** + * + */ + private String suiteId; + + /** + * + */ + private String appId; + + /** + * + */ + private String miniAppId; + + /** + * + */ + private String suiteName; + + /** + * + */ + private String suiteKey; + + /** + * + */ + private String suiteSecret; + + private String token; + + private String aesKey; + + /** + * + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/dingtalk/CallbackController.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/dingtalk/CallbackController.java index 8edd48d46a..5940ce57f5 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/dingtalk/CallbackController.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/dingtalk/CallbackController.java @@ -3,8 +3,11 @@ package com.epmet.controller.dingtalk; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.aliyun.dingtalk.util.DingCallbackCrypto; -import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.dao.OpenSyncBizDataDao; +import com.epmet.dto.DingMiniInfoDTO; import com.epmet.entity.OpenSyncBizDataEntity; +import com.epmet.redis.DingDingCallbackRedis; import com.epmet.service.OpenSyncBizDataService; import org.apache.commons.collections4.CollectionUtils; import org.slf4j.Logger; @@ -49,21 +52,24 @@ public class CallbackController { @Autowired private OpenSyncBizDataService openSyncBizDataService; + @Autowired + private OpenSyncBizDataDao openSyncBizDataDao; + @Autowired + private DingDingCallbackRedis dingCallbackRedis; @PostMapping(value = "dingCallback") public Object dingCallback( @RequestParam(value = "signature") String signature, @RequestParam(value = "timestamp") Long timestamp, @RequestParam(value = "nonce") String nonce, - @RequestParam(value = "id") int id, + @RequestParam(value = "suiteKey") String suiteKey, @RequestBody(required = false) JSONObject body ) { - log.info("id is:"+id); - String params = "signature:" + signature + " timestamp:" + timestamp + " nonce:" + nonce + " body:" + body; + String params = "signature:" + signature + " timestamp:" + timestamp + " nonce:" + nonce + " body:" + body + "suiteKey::"+suiteKey; try { log.info("begin callback:" + params); - - DingCallbackCrypto dingTalkEncryptor = new DingCallbackCrypto("vTUvaf6QtOJZsa1h7Wkoteo", "csRpvVFGL7Cf1N9ubajix8tDWhCllROhaxCHKFnbuAz", "suite5yxliro6wawv514w"); + DingMiniInfoDTO dingMiniInfo = openSyncBizDataDao.getDingMiniInfo(suiteKey); + DingCallbackCrypto dingTalkEncryptor = new DingCallbackCrypto(dingMiniInfo.getToken(), dingMiniInfo.getAesKey(), suiteKey); // 从post请求的body中获取回调信息的加密数据进行解密处理 String encrypt = body.getString("encrypt"); @@ -88,12 +94,22 @@ public class CallbackController { // 即使本接口没有收到数据或者收到事件后处理初始化失败都可以后续再用户试用应用时从前端获取到corpId并拉取授权企业信息,进而初始化开通及企业。 log.info("企业授权开通应用事件: " + plainText); } else if (EVENT_SYNC_HTTP_PUSH_HIGH.equals(eventType)){ - log.info("ticket: " + plainText); List> bizData = (List>) callBackContent.get("bizData"); if (CollectionUtils.isNotEmpty(bizData)){ List list = new ArrayList<>(); bizData.forEach(b -> { - list.add(ConvertUtils.mapToEntity(b, OpenSyncBizDataEntity.class)); + OpenSyncBizDataEntity e = new OpenSyncBizDataEntity(); + e.setSubscribeId(b.get("subscribe_id").toString()); + e.setCorpId(b.get("corp_id").toString()); + e.setBizId(b.get("biz_id").toString()); + e.setBizData(b.get("biz_data").toString()); + e.setBizType(b.get("biz_type").toString()); + list.add(e); + openSyncBizDataService.delete(e); + if (e.getBizType().equals(NumConstant.TWO_STR)){ + Map ticketMap = JSON.parseObject(e.getBizData(), Map.class); + dingCallbackRedis.set(suiteKey,ticketMap.get("suiteTicket")); + } }); openSyncBizDataService.insertBatch(list); } diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/OpenSyncBizDataDao.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/OpenSyncBizDataDao.java index 800ff14a06..4d6ee1459e 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/OpenSyncBizDataDao.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/OpenSyncBizDataDao.java @@ -1,8 +1,10 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.DingMiniInfoDTO; import com.epmet.entity.OpenSyncBizDataEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; /** * @@ -12,5 +14,9 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface OpenSyncBizDataDao extends BaseDao { - + + DingMiniInfoDTO getDingMiniInfo(@Param("suiteKey")String suiteKey); + + Integer delOpenSyncData(OpenSyncBizDataEntity e); + } \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/redis/DingDingCallbackRedis.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/redis/DingDingCallbackRedis.java new file mode 100644 index 0000000000..13d026d20b --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/redis/DingDingCallbackRedis.java @@ -0,0 +1,26 @@ +package com.epmet.redis; + +import com.epmet.commons.tools.redis.RedisKeys; +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * @Author zxc + * @DateTime 2022/9/14 10:32 + * @DESC + */ +@Component +public class DingDingCallbackRedis { + @Autowired + private RedisUtils redisUtils; + + public void set(String suiteKey,String suiteTicket){ + String key = RedisKeys.getSuiteTicketKey(suiteKey); + redisUtils.set(key,suiteTicket,-1); + } + + public String get(String suiteKey){ + return redisUtils.getString(RedisKeys.getSuiteTicketKey(suiteKey)); + } +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/OpenSyncBizDataService.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/OpenSyncBizDataService.java index 837eacceb7..64f3668e38 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/OpenSyncBizDataService.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/OpenSyncBizDataService.java @@ -75,4 +75,6 @@ public interface OpenSyncBizDataService extends BaseService + + DELETE + FROM open_sync_biz_data + WHERE biz_id = #{bizId} + AND biz_type = #{bizType} + AND subscribe_id = #{subscribeId} + AND corp_id = #{corpId} + AND DEL_FLAG = 0 + + \ No newline at end of file From bc89d8cc35ff1dc16a2add357f70af1cca848c01 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Wed, 14 Sep 2022 15:43:39 +0800 Subject: [PATCH 021/147] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E8=AF=A6=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dto/OpenSyncBizDataDTO.java | 2 + .../form/ExemptLoginUserDetailFormDTO.java | 28 +++++++ .../epmet-third/epmet-third-server/pom.xml | 5 ++ .../dingtalk/CallbackController.java | 13 ++++ .../com/epmet/dao/OpenSyncBizDataDao.java | 7 ++ .../epmet/entity/OpenSyncBizDataEntity.java | 2 + .../com/epmet/service/DingTalkService.java | 14 ++++ .../service/impl/DingTalkServiceImpl.java | 78 +++++++++++++++++++ .../resources/mapper/OpenSyncBizDataDao.xml | 12 +++ 9 files changed, 161 insertions(+) create mode 100644 epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/ExemptLoginUserDetailFormDTO.java create mode 100644 epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/DingTalkService.java create mode 100644 epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/DingTalkServiceImpl.java diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/OpenSyncBizDataDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/OpenSyncBizDataDTO.java index b94711e55e..12dac445f0 100644 --- a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/OpenSyncBizDataDTO.java +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/OpenSyncBizDataDTO.java @@ -27,6 +27,8 @@ public class OpenSyncBizDataDTO implements Serializable { */ private String subscribeId; + private String suiteKey; + /** * 第三方企业应用的corpid */ diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/ExemptLoginUserDetailFormDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/ExemptLoginUserDetailFormDTO.java new file mode 100644 index 0000000000..7e84993d2f --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/ExemptLoginUserDetailFormDTO.java @@ -0,0 +1,28 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2022/9/14 14:52 + * @DESC + */ +@Data +public class ExemptLoginUserDetailFormDTO implements Serializable { + + private static final long serialVersionUID = -4333806195203619201L; + + public interface ExemptLoginUserDetailForm{} + + @NotBlank(message = "code不能为空",groups = ExemptLoginUserDetailForm.class) + private String code; + + @NotBlank(message = "corpId不能为空",groups = ExemptLoginUserDetailForm.class) + private String corpId; + + @NotBlank(message = "miniAppId不能为空",groups = ExemptLoginUserDetailForm.class) + private String miniAppId; +} diff --git a/epmet-module/epmet-third/epmet-third-server/pom.xml b/epmet-module/epmet-third/epmet-third-server/pom.xml index a70d2ac789..d3abda724e 100644 --- a/epmet-module/epmet-third/epmet-third-server/pom.xml +++ b/epmet-module/epmet-third/epmet-third-server/pom.xml @@ -167,6 +167,11 @@ commons-codec 1.15 + + com.aliyun + alibaba-dingtalk-service-sdk + 2.0.0 + diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/dingtalk/CallbackController.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/dingtalk/CallbackController.java index 5940ce57f5..89bcfb3dbd 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/dingtalk/CallbackController.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/dingtalk/CallbackController.java @@ -4,10 +4,14 @@ import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.aliyun.dingtalk.util.DingCallbackCrypto; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dao.OpenSyncBizDataDao; import com.epmet.dto.DingMiniInfoDTO; +import com.epmet.dto.form.ExemptLoginUserDetailFormDTO; import com.epmet.entity.OpenSyncBizDataEntity; import com.epmet.redis.DingDingCallbackRedis; +import com.epmet.service.DingTalkService; import com.epmet.service.OpenSyncBizDataService; import org.apache.commons.collections4.CollectionUtils; import org.slf4j.Logger; @@ -56,6 +60,8 @@ public class CallbackController { private OpenSyncBizDataDao openSyncBizDataDao; @Autowired private DingDingCallbackRedis dingCallbackRedis; + @Autowired + private DingTalkService dingTalkService; @PostMapping(value = "dingCallback") public Object dingCallback( @@ -99,6 +105,7 @@ public class CallbackController { List list = new ArrayList<>(); bizData.forEach(b -> { OpenSyncBizDataEntity e = new OpenSyncBizDataEntity(); + e.setSuiteKey(suiteKey); e.setSubscribeId(b.get("subscribe_id").toString()); e.setCorpId(b.get("corp_id").toString()); e.setBizId(b.get("biz_id").toString()); @@ -125,4 +132,10 @@ public class CallbackController { return "fail"; } } + + @PostMapping("getExemptLoginUserDetail") + public Result getExemptLoginUserDetail(@RequestBody ExemptLoginUserDetailFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, ExemptLoginUserDetailFormDTO.ExemptLoginUserDetailForm.class); + return new Result().ok(dingTalkService.getExemptLoginUserDetail(formDTO)); + } } diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/OpenSyncBizDataDao.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/OpenSyncBizDataDao.java index 4d6ee1459e..4737dabf93 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/OpenSyncBizDataDao.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/OpenSyncBizDataDao.java @@ -2,10 +2,13 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.DingMiniInfoDTO; +import com.epmet.dto.OpenSyncBizDataDTO; import com.epmet.entity.OpenSyncBizDataEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; +import java.util.List; + /** * * @@ -17,6 +20,10 @@ public interface OpenSyncBizDataDao extends BaseDao { DingMiniInfoDTO getDingMiniInfo(@Param("suiteKey")String suiteKey); + DingMiniInfoDTO getDingMiniInfoByAppId(@Param("miniAppId")String miniAppId); + Integer delOpenSyncData(OpenSyncBizDataEntity e); + List getOpenSyncData(@Param("suiteKey")String suiteKey, @Param("bizType")String bizType,@Param("corpId")String corpId); + } \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/OpenSyncBizDataEntity.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/OpenSyncBizDataEntity.java index 69f3d0a61f..b881b457bb 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/OpenSyncBizDataEntity.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/OpenSyncBizDataEntity.java @@ -23,6 +23,8 @@ public class OpenSyncBizDataEntity extends BaseEpmetEntity { */ private String subscribeId; + private String suiteKey; + /** * 第三方企业应用的corpid */ diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/DingTalkService.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/DingTalkService.java new file mode 100644 index 0000000000..cc07a3d42c --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/DingTalkService.java @@ -0,0 +1,14 @@ +package com.epmet.service; + +import com.epmet.dto.form.ExemptLoginUserDetailFormDTO; + +/** + * @Author zxc + * @DateTime 2022/9/14 14:56 + * @DESC + */ +public interface DingTalkService { + + Object getExemptLoginUserDetail(ExemptLoginUserDetailFormDTO formDTO); + +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/DingTalkServiceImpl.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/DingTalkServiceImpl.java new file mode 100644 index 0000000000..851e2af1b3 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/DingTalkServiceImpl.java @@ -0,0 +1,78 @@ +package com.epmet.service.impl; + +import com.alibaba.fastjson.JSON; +import com.aliyun.dingtalk.module.Result; +import com.dingtalk.api.DefaultDingTalkClient; +import com.dingtalk.api.DingTalkClient; +import com.dingtalk.api.request.OapiV2UserGetRequest; +import com.dingtalk.api.request.OapiV2UserGetuserinfoRequest; +import com.dingtalk.api.response.OapiV2UserGetResponse; +import com.dingtalk.api.response.OapiV2UserGetuserinfoResponse; +import com.epmet.commons.tools.exception.EpmetException; +import com.epmet.dao.OpenSyncBizDataDao; +import com.epmet.dto.DingMiniInfoDTO; +import com.epmet.dto.form.ExemptLoginUserDetailFormDTO; +import com.epmet.redis.DingDingCallbackRedis; +import com.epmet.service.DingTalkService; +import com.taobao.api.ApiException; +import com.taobao.dingtalk.client.DingTalkClientToken; +import com.taobao.dingtalk.vo.result.AccessTokenResult; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.Map; + +/** + * @Author zxc + * @DateTime 2022/9/14 14:57 + * @DESC + */ +@Service +@Slf4j +public class DingTalkServiceImpl implements DingTalkService { + + @Autowired + private DingTalkClientToken dingTalkClientToken; + @Autowired + private OpenSyncBizDataDao openSyncBizDataDao; + @Autowired + private DingDingCallbackRedis dingCallbackRedis; + + @Override + public Object getExemptLoginUserDetail(ExemptLoginUserDetailFormDTO formDTO) { + DingMiniInfoDTO dingMiniInfo = openSyncBizDataDao.getDingMiniInfoByAppId(formDTO.getMiniAppId()); + + Result isvAccessTokenToken = dingTalkClientToken.getIsvAccessTokenToken(formDTO.getCorpId(), dingMiniInfo.getSuiteKey(), dingMiniInfo.getSuiteSecret(), dingCallbackRedis.get(dingMiniInfo.getSuiteKey())); + if (!isvAccessTokenToken.success()){ + throw new EpmetException("获取accessToken失败..."); + } + String accessToken = isvAccessTokenToken.getData().getAccessToken(); + DingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.com/topapi/v2/user/getuserinfo"); + OapiV2UserGetuserinfoRequest req = new OapiV2UserGetuserinfoRequest(); + req.setCode(formDTO.getCode()); + Object o = new Object(); + try { + OapiV2UserGetuserinfoResponse rsp = client.execute(req, accessToken); + Map map = JSON.parseObject(rsp.getBody(), Map.class); + if (!map.containsValue("ok")){ + throw new EpmetException("通过免登码获取用户信息失败..."); + } + Map userInfo = JSON.parseObject(map.get("result").toString(), Map.class); + DingTalkClient userDetailClient = new DefaultDingTalkClient("https://oapi.dingtalk.com/topapi/v2/user/get"); + OapiV2UserGetRequest userDetailRequest = new OapiV2UserGetRequest(); + userDetailRequest.setUserid(userInfo.get("userid").toString()); + userDetailRequest.setLanguage("zh_CN"); + OapiV2UserGetResponse execute = userDetailClient.execute(userDetailRequest, accessToken); + Map userDetailResult = JSON.parseObject(execute.getBody(), Map.class); + if (!userDetailResult.containsValue("ok")){ + throw new EpmetException("查询用户详情失败..."); + } + o = userDetailResult.get("result"); + } catch (ApiException e) { + log.error(e.getMessage()); + e.printStackTrace(); + } + return o; + } +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/OpenSyncBizDataDao.xml b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/OpenSyncBizDataDao.xml index c5b2a5c3ff..b81b8b81ba 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/OpenSyncBizDataDao.xml +++ b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/OpenSyncBizDataDao.xml @@ -15,4 +15,16 @@ + + \ No newline at end of file From f42001862c649e49c6e1999e393624854d4a5214 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Wed, 14 Sep 2022 17:04:19 +0800 Subject: [PATCH 022/147] =?UTF-8?q?=E8=BF=9B=E5=85=A5=E7=BD=91=E6=A0=BC?= =?UTF-8?q?=EF=BC=8C=E8=87=AA=E5=8A=A8=E6=B3=A8=E5=86=8C=E5=B1=85=E6=B0=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/commons/tools/utils/NameUtils.java | 89 +++++++++++++++ .../controller/UserResiInfoController.java | 18 +++ .../epmet/service/UserResiInfoService.java | 10 ++ .../service/impl/UserResiInfoServiceImpl.java | 105 ++++++++++++++++-- 4 files changed, 213 insertions(+), 9 deletions(-) create mode 100644 epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/NameUtils.java diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/NameUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/NameUtils.java new file mode 100644 index 0000000000..8dec710c4a --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/NameUtils.java @@ -0,0 +1,89 @@ +package com.epmet.commons.tools.utils; + +import com.epmet.commons.tools.constant.NumConstant; + +import java.util.HashMap; +import java.util.Map; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2022/9/14 14:40 + */ +public class NameUtils { + /** + * 复姓(两字),国内现存81个。末尾添加三字以上的部分满姓 + */ + private static final String[] SURNAME_NOW = {"百里", "北堂", "北野", "北宫", "辟闾", "孛尔", "淳于", "成公", "陈生", "褚师", + "端木", "东方", "东郭", "东野", "东门", "第五", "大狐", "段干", "段阳", "带曰", "第二", "东宫", "公孙", "公冶", "公羊", + "公良", "公西", "公孟", "高堂", "高阳", "公析", "公肩", "公坚", "郭公", "谷梁", "毌将", "公乘", "毌丘", "公户", "公广", + "公仪", "公祖", "皇甫", "黄龙", "胡母", "何阳", "夹谷", "九方", "即墨", "梁丘", "闾丘", "洛阳", "陵尹", "冷富", "龙丘", + "令狐", "林彭", "南宫", "南郭", "女娲", "南伯", "南容", "南门", "南野", "欧阳", "欧侯", "濮阳", "青阳", "漆雕", "亓官", + "渠丘", "壤驷", "上官", "少室", "少叔", "司徒", "司马", "司空", "司寇", "士孙", "申屠", "申徒", "申鲜", "申叔", "夙沙", + "叔先", "叔仲", "侍其", "叔孙", "澹台", "太史", "太叔", "太公", "屠岸", "唐古", "闻人", "巫马", "微生", "王孙", "无庸", + "夏侯", "西门", "信平", "鲜于", "轩辕", "相里", "新垣", "徐离", "羊舌", "羊角", "延陵", "於陵", "伊祁", "吾丘", "乐正", + "只斤", "诸葛", "颛孙", "仲孙", "仲长", "钟离", "宗政", "主父", "中叔", "左人", "左丘", "宰父", "长儿", "仉督", "单于", + "叱干", "叱利", "车非", "车公", "车侯", "车长", "车绵", "独孤", "大野", "独吉", "达奚", "达官", "达仲", "达品", "哥舒", + "哥夜", "哥翰", "哥汗", "赫连", "呼延", "贺兰", "黑齿", "斛律", "斛粟", "贺若", "贺奴", "贺远", "贺元", "夹谷", "吉胡", + "吉利", "吉家", "可频", "慕容", "万俟", "万红", "万中", "抹捻", "纳兰", "纳西", "纳吉", "纳罕", "纳塞", "纳博", "纳称", + "纳勉", "普周", "仆固", "仆散", "蒲察", "屈突", "屈卢", "钳耳", "是云", "索卢", "厍狄", "拓跋", "同蹄", "秃发", "完颜", + "完明", "完忠", "宇文", "尉迟", "耶律", "耶红", "也先", "耶鲜", "耶闻", "长孙", "长南", "长北", "长西", "长红", "长元", + "长秋", "长寸", "长李", "长云", "萨嘛喇","赫舍里","萨克达","钮祜禄","他塔喇","喜塔腊","库雅喇","瓜尔佳","舒穆禄","索绰络", + "叶赫那拉","依尔觉罗","额尔德特","讷殷富察","叶赫那兰","爱新觉罗","依尔根觉罗"}; + + /** + * 获取复姓,非单字姓氏。未匹配上则依旧返回单字姓氏 + * @param name + * @return + */ + public static String getSurNameComplex(String name){ + for (String s : SURNAME_NOW) { + if (name.startsWith(s)) { + return name.substring(0, s.length()); + } + } + return name.substring(0,1); + } + + /** + * 获取复姓名,去除姓氏后名 + * @param name + * @return + */ + public static String getNameComplex(String name){ + for (String s : SURNAME_NOW) { + if (name.startsWith(s)) { + return name.substring(s.length()); + } + } + return name.substring(1); + } + + /** + * 获取姓氏与姓名
+ * 姓名在两字时,首字为姓。
+ * 姓名大于两字时,优先匹配复姓。
+ * 姓氏未匹配且姓名多于5字时,姓与名均在姓氏中,名为空;少于5字时则采用第一个字为姓。
+ * @param name 姓名 + * @return map类型数据,姓氏为key值“X”,名字为value值“M” + */ + public static Map getSurName(String name) { + Map mapData = new HashMap<>(NumConstant.TWO); + if (name.length() > NumConstant.ZERO && name.length() <= NumConstant.TWO){ + mapData.put("X", name.substring(NumConstant.ZERO, NumConstant.ONE)); + mapData.put("M", name.substring(NumConstant.ONE)); + } else if (name.length() > NumConstant.TWO) { + for (String s : SURNAME_NOW) {//遍历复姓数组 + if (name.startsWith(s)) { + mapData.put("X", s); + mapData.put("M", name.substring(s.length())); + return mapData; + } + } + //姓氏没有匹配时采用第一个字为姓 + mapData.put("X", name.substring(NumConstant.ZERO, NumConstant.ONE)); + mapData.put("M", name.substring(NumConstant.ONE)); + } + return mapData; + } +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserResiInfoController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserResiInfoController.java index 5f8a5ca171..84ab9375cb 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserResiInfoController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserResiInfoController.java @@ -243,4 +243,22 @@ public class UserResiInfoController { return new Result>().ok(userResiInfoService.getStaffAndResi(userIds)); } + /** + * 进入网格,自动注册居民 + * + * @Param tokenDto + * @Param userResiInfoDTO + * @Return {@link Result} + * @Author zhaoqifeng + * @Date 2022/9/14 15:34 + */ + @PostMapping("autoreguser-ding") + public Result autoRegister(@LoginUser TokenDto tokenDto, @RequestBody UserResiInfoDTO userResiInfoDTO) { + userResiInfoDTO.setCustomerId(tokenDto.getCustomerId()); + userResiInfoDTO.setUserId(tokenDto.getUserId()); + userResiInfoDTO.setApp(tokenDto.getApp()); + userResiInfoService.autoRegister(userResiInfoDTO); + return new Result(); + } + } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserResiInfoService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserResiInfoService.java index 9e3a9f86fe..f3b10414f7 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserResiInfoService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserResiInfoService.java @@ -213,4 +213,14 @@ public interface UserResiInfoService extends BaseService { */ List getStaffAndResi(List userIds); + /** + * 进入网格,自动注册居民 + * + * @Param userResiInfoDTO + * @Return + * @Author zhaoqifeng + * @Date 2022/9/14 14:19 + */ + void autoRegister(UserResiInfoDTO userResiInfoDTO); + } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserResiInfoServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserResiInfoServiceImpl.java index 5e7d901f6c..96b602f187 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserResiInfoServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserResiInfoServiceImpl.java @@ -18,6 +18,7 @@ package com.epmet.service.impl; import com.alibaba.fastjson.JSON; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.common.token.util.UserUtil; @@ -26,30 +27,28 @@ import com.epmet.commons.tools.constant.EpmetRoleKeyConstant; import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.StrConstant; -import com.epmet.commons.tools.enums.IdCardTypeEnum; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.redis.common.CustomerOrgRedis; +import com.epmet.commons.tools.redis.common.bean.GridInfoCache; +import com.epmet.commons.tools.redis.common.bean.ResiUserInfoCache; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.IdCardRegexUtils; +import com.epmet.commons.tools.utils.NameUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.constant.SmsTemplateConstant; import com.epmet.constant.UserConstant; import com.epmet.constant.UserResiRegisterConstant; import com.epmet.constant.UserRoleConstant; -import com.epmet.dao.UserCustomerDao; -import com.epmet.dao.UserResiInfoDao; -import com.epmet.dao.UserWechatDao; +import com.epmet.dao.*; import com.epmet.dto.UserResiInfoDTO; import com.epmet.dto.UserResiRegisterVisitDTO; import com.epmet.dto.UserRoleDTO; import com.epmet.dto.form.*; import com.epmet.dto.result.*; -import com.epmet.entity.UserBaseInfoEntity; -import com.epmet.entity.UserResiInfoEntity; -import com.epmet.entity.UserResiRegisterVisitEntity; -import com.epmet.entity.UserWechatEntity; +import com.epmet.entity.*; import com.epmet.feign.EpmetMessageOpenFeignClient; import com.epmet.feign.GovIssueOpenFeignClient; import com.epmet.redis.UserBaseInfoRedis; @@ -67,6 +66,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import javax.annotation.Resource; import java.util.*; /** @@ -103,9 +103,12 @@ public class UserResiInfoServiceImpl extends BaseServiceImpl page(Map params) { @@ -551,6 +554,90 @@ public class UserResiInfoServiceImpl extends BaseServiceImpl latestWrapper = new LambdaQueryWrapper<>(); + latestWrapper.eq(GridLatestEntity::getCustomerId, userResiInfoDTO.getCustomerId()); + latestWrapper.eq(GridLatestEntity::getGridId, userResiInfoDTO.getGridId()); + latestWrapper.eq(GridLatestEntity::getCustomerUserId, userResiInfoDTO.getUserId()); + GridLatestEntity latest = gridLatestDao.selectOne(latestWrapper); + if (null == latest) { + latest = new GridLatestEntity(); + latest.setCustomerId(userResiInfoDTO.getCustomerId()); + latest.setGridId(userResiInfoDTO.getGridId()); + latest.setCustomerUserId(userResiInfoDTO.getUserId()); + latest.setAreaCode(gridInfo.getAreaCode()); + latest.setPid(gridInfo.getPid()); + latest.setLatestTime(new Date()); + gridLatestDao.insert(latest); + } else { + GridLatestEntity latestEntity = new GridLatestEntity(); + latestEntity.setId(latest.getId()); + latestEntity.setLatestTime(new Date()); + gridLatestDao.updateById(latestEntity); + } + } /** * 自动认证居民:志愿者注册,自动认证居民 From 6a2421ed45403162248cb8257d7f0b71acade289 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 14 Sep 2022 17:37:58 +0800 Subject: [PATCH 023/147] resilogin-ding --- epmet-auth/pom.xml | 10 +++++ .../main/java/com/epmet/AuthApplication.java | 2 + .../controller/ThirdLoginController.java | 19 ++++++++++ .../dto/form/ResiDingAppLoginFormDTO.java | 25 +++++++++++++ .../dto/result/ResiDingAppLoginResDTO.java | 20 ++++++++++ .../com/epmet/service/ThirdLoginService.java | 8 ++++ .../service/impl/ThirdLoginServiceImpl.java | 37 +++++++++++++++++++ 7 files changed, 121 insertions(+) create mode 100644 epmet-auth/src/main/java/com/epmet/dto/form/ResiDingAppLoginFormDTO.java create mode 100644 epmet-auth/src/main/java/com/epmet/dto/result/ResiDingAppLoginResDTO.java diff --git a/epmet-auth/pom.xml b/epmet-auth/pom.xml index d14d863674..1822235cdc 100644 --- a/epmet-auth/pom.xml +++ b/epmet-auth/pom.xml @@ -138,6 +138,16 @@ epmet-auth-client 2.0.0 + + dingtalk-spring-boot-starter + com.taobao + 1.0.0 + + + commons-codec + commons-codec + 1.15 + diff --git a/epmet-auth/src/main/java/com/epmet/AuthApplication.java b/epmet-auth/src/main/java/com/epmet/AuthApplication.java index 0bf685bd5b..07d85a0d5f 100644 --- a/epmet-auth/src/main/java/com/epmet/AuthApplication.java +++ b/epmet-auth/src/main/java/com/epmet/AuthApplication.java @@ -8,6 +8,7 @@ package com.epmet; +import com.taobao.dingtalk.spring.annotations.EnableDingTalk; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.web.servlet.ServletComponentScan; @@ -20,6 +21,7 @@ import org.springframework.cloud.openfeign.EnableFeignClients; * @author Mark sunlightcs@gmail.com * @since 1.0.0 */ +@EnableDingTalk @SpringBootApplication @EnableDiscoveryClient @EnableFeignClients 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..917b29de53 100644 --- a/epmet-auth/src/main/java/com/epmet/controller/ThirdLoginController.java +++ b/epmet-auth/src/main/java/com/epmet/controller/ThirdLoginController.java @@ -3,6 +3,7 @@ package com.epmet.controller; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.form.*; +import com.epmet.dto.result.ResiDingAppLoginResDTO; import com.epmet.dto.result.StaffOrgsResultDTO; import com.epmet.dto.result.UserTokenResultDTO; import com.epmet.service.ThirdLoginService; @@ -116,4 +117,22 @@ public class ThirdLoginController { return new Result(); } + /** + *接入流程:https://open.dingtalk.com/document/isvapp-server/unified-authorization-suite-access-process + * 1、获取个人用户token:https://open.dingtalk.com/document/isvapp-server/obtain-user-token + * 2、获取用户通讯录个人信息:https://open.dingtalk.com/document/isvapp-server/dingtalk-retrieve-user-information + * 接口逻辑: + * (1)根据clientId去XXX表找到customerId + * (2)通过1、2拿到手机号之后,根据mobile+customerId去user_base_info表找userId, + * 是否注册居民:register_relation + * (3)没有则生成user、user_Base_info表记录 + * @param formDTO + * @return + */ + @PostMapping("resilogin-ding") + public Result resiLoginDing(@RequestBody ResiDingAppLoginFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); + return new Result().ok(thirdLoginService.resiLoginDing(formDTO)); + } + } diff --git a/epmet-auth/src/main/java/com/epmet/dto/form/ResiDingAppLoginFormDTO.java b/epmet-auth/src/main/java/com/epmet/dto/form/ResiDingAppLoginFormDTO.java new file mode 100644 index 0000000000..3e55c44cb3 --- /dev/null +++ b/epmet-auth/src/main/java/com/epmet/dto/form/ResiDingAppLoginFormDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; + +/** + * @Description + * @Author yzm + * @Date 2022/9/14 17:11 + */ +@Data +public class ResiDingAppLoginFormDTO { + /** + * 授权统一后的authCode + */ + @NotBlank(message = "authCode不能为空") + private String authCode; + /** + * 第三方企业应用传应用的SuiteSecret + */ + @NotBlank(message = "clientId不能为空") + private String clientId; +} + diff --git a/epmet-auth/src/main/java/com/epmet/dto/result/ResiDingAppLoginResDTO.java b/epmet-auth/src/main/java/com/epmet/dto/result/ResiDingAppLoginResDTO.java new file mode 100644 index 0000000000..83fc4accfe --- /dev/null +++ b/epmet-auth/src/main/java/com/epmet/dto/result/ResiDingAppLoginResDTO.java @@ -0,0 +1,20 @@ +package com.epmet.dto.result; + +import lombok.Data; + +/** + * @Description + * @Author yzm + * @Date 2022/9/14 17:20 + */ +@Data +public class ResiDingAppLoginResDTO { + private String authorization; + private String customerId; + private String gridId; + /** + * + */ + private String epmetUserId; +} + 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..9232fec5e6 100644 --- a/epmet-auth/src/main/java/com/epmet/service/ThirdLoginService.java +++ b/epmet-auth/src/main/java/com/epmet/service/ThirdLoginService.java @@ -1,6 +1,7 @@ package com.epmet.service; import com.epmet.dto.form.*; +import com.epmet.dto.result.ResiDingAppLoginResDTO; import com.epmet.dto.result.StaffOrgsResultDTO; import com.epmet.dto.result.UserTokenResultDTO; @@ -66,4 +67,11 @@ public interface ThirdLoginService { * @description 单客户-工作端微信小程序登录-发送验证码 **/ void sendSmsCode(ThirdSendSmsCodeFormDTO formDTO); + + /** + * 钉钉应用的登录-居民端 + * @param formDTO + * @return + */ + ResiDingAppLoginResDTO resiLoginDing(ResiDingAppLoginFormDTO formDTO); } 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..a1cd3e8ab7 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 @@ -32,6 +32,7 @@ import com.epmet.jwt.JwtTokenProperties; import com.epmet.jwt.JwtTokenUtils; import com.epmet.redis.CaptchaRedis; import com.epmet.service.ThirdLoginService; +import com.taobao.dingtalk.client.DingTalkClientToken; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; @@ -73,6 +74,8 @@ public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResol private EpmetMessageOpenFeignClient messageOpenFeignClient; @Autowired private LoginUserUtil loginUserUtil; + @Autowired + private DingTalkClientToken dingTalkClientToken; /** * @param formDTO @@ -690,4 +693,38 @@ public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResol //getResultDataOrThrowsException(result, ServiceConstant.EPMET_MESSAGE_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "调用Message服务,发送登录事件到MQ失败"); } +// 接入流程:https://open.dingtalk.com/document/isvapp-server/unified-authorization-suite-access-process +// 1、获取个人用户token:https://open.dingtalk.com/document/isvapp-server/obtain-user-token +// 2、获取用户通讯录个人信息:https://open.dingtalk.com/document/isvapp-server/dingtalk-retrieve-user-information +// 接口逻辑: +// (1)根据clientId去XXX表找到customerId +// (2)通过1、2拿到手机号之后,根据mobile+customerId去user_base_info表找userId, +// 是否注册居民:register_relation +// (3)没有则生成user、user_Base_info表记录 + /** + * 钉钉应用的登录-居民端 + * + * @param formDTO + * @return + */ + @Override + public ResiDingAppLoginResDTO resiLoginDing(ResiDingAppLoginFormDTO formDTO) { + //获取用户手机号 + log.info("authCode:"+formDTO.getAuthCode()); + //todo 调用一下接口 + + + ResiDingAppLoginResDTO resDTO=new ResiDingAppLoginResDTO(); + resDTO.setCustomerId("45687aa479955f9d06204d415238f7cc"); + resDTO.setGridId("763d6e09b9081d63195d53da84b3ae3a"); + resDTO.setEpmetUserId("f838614e67cf8ae0edaefe562b6660e5"); + //生成token串 + Map map = new HashMap<>(); + map.put("app", "resi"); + map.put("client", "miniding"); + map.put("userId", resDTO.getEpmetUserId()); + String token = jwtTokenUtils.createToken(map); + resDTO.setAuthorization(token); + return resDTO; + } } From 4aa139da9e9b4530a08640c7362e3a54deb68950 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 14 Sep 2022 17:50:18 +0800 Subject: [PATCH 024/147] corpId --- .../main/java/com/epmet/dto/form/ResiDingAppLoginFormDTO.java | 3 +++ .../java/com/epmet/service/impl/ThirdLoginServiceImpl.java | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/epmet-auth/src/main/java/com/epmet/dto/form/ResiDingAppLoginFormDTO.java b/epmet-auth/src/main/java/com/epmet/dto/form/ResiDingAppLoginFormDTO.java index 3e55c44cb3..4a8fd88b96 100644 --- a/epmet-auth/src/main/java/com/epmet/dto/form/ResiDingAppLoginFormDTO.java +++ b/epmet-auth/src/main/java/com/epmet/dto/form/ResiDingAppLoginFormDTO.java @@ -21,5 +21,8 @@ public class ResiDingAppLoginFormDTO { */ @NotBlank(message = "clientId不能为空") private String clientId; + + @NotBlank(message = "当前访问用户的企业corpId不能为空") + private String corpId; } 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 a1cd3e8ab7..2c1d76a75a 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 @@ -710,7 +710,7 @@ public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResol @Override public ResiDingAppLoginResDTO resiLoginDing(ResiDingAppLoginFormDTO formDTO) { //获取用户手机号 - log.info("authCode:"+formDTO.getAuthCode()); + log.info("钉钉居民端应用登录入参:"+ JSON.toJSONString(formDTO)); //todo 调用一下接口 From 580ea4447c3003208eaeb15181aa2b7100d83f24 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 14 Sep 2022 17:56:31 +0800 Subject: [PATCH 025/147] =?UTF-8?q?corpId=E4=B8=8D=E9=9C=80=E8=A6=81?= =?UTF-8?q?=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/dto/form/ResiDingAppLoginFormDTO.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-auth/src/main/java/com/epmet/dto/form/ResiDingAppLoginFormDTO.java b/epmet-auth/src/main/java/com/epmet/dto/form/ResiDingAppLoginFormDTO.java index 4a8fd88b96..1e3453c474 100644 --- a/epmet-auth/src/main/java/com/epmet/dto/form/ResiDingAppLoginFormDTO.java +++ b/epmet-auth/src/main/java/com/epmet/dto/form/ResiDingAppLoginFormDTO.java @@ -22,7 +22,7 @@ public class ResiDingAppLoginFormDTO { @NotBlank(message = "clientId不能为空") private String clientId; - @NotBlank(message = "当前访问用户的企业corpId不能为空") - private String corpId; + // @NotBlank(message = "当前访问用户的企业corpId不能为空") + // private String corpId; } From d5cc56f53efdbc96bc46ae7a017cb376f4e5f403 Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 14 Sep 2022 18:05:16 +0800 Subject: [PATCH 026/147] =?UTF-8?q?third=E9=9B=86=E6=88=90=E6=B6=88?= =?UTF-8?q?=E6=81=AF=E5=9B=9E=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/result/ResiDingAppLoginResDTO.java | 2 + .../service/impl/ThirdLoginServiceImpl.java | 56 ++++++++++++++----- 2 files changed, 43 insertions(+), 15 deletions(-) diff --git a/epmet-auth/src/main/java/com/epmet/dto/result/ResiDingAppLoginResDTO.java b/epmet-auth/src/main/java/com/epmet/dto/result/ResiDingAppLoginResDTO.java index 83fc4accfe..28a5e899db 100644 --- a/epmet-auth/src/main/java/com/epmet/dto/result/ResiDingAppLoginResDTO.java +++ b/epmet-auth/src/main/java/com/epmet/dto/result/ResiDingAppLoginResDTO.java @@ -16,5 +16,7 @@ public class ResiDingAppLoginResDTO { * */ private String epmetUserId; + + private String extInfo; } 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 a1cd3e8ab7..166580cc04 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 @@ -11,6 +11,7 @@ import com.epmet.commons.rocketmq.messages.LoginMQMsg; import com.epmet.commons.tools.constant.AppClientConstant; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.exception.ExceptionUtils; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.feign.ResultDataResolver; @@ -32,7 +33,11 @@ import com.epmet.jwt.JwtTokenProperties; import com.epmet.jwt.JwtTokenUtils; import com.epmet.redis.CaptchaRedis; import com.epmet.service.ThirdLoginService; +import com.taobao.api.ApiException; import com.taobao.dingtalk.client.DingTalkClientToken; +import com.taobao.dingtalk.client.DingTalkClientUser; +import com.taobao.dingtalk.vo.result.AccessTokenResult; +import com.taobao.dingtalk.vo.result.UserBaseInfo; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; @@ -76,6 +81,8 @@ public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResol private LoginUserUtil loginUserUtil; @Autowired private DingTalkClientToken dingTalkClientToken; + @Autowired + private DingTalkClientUser dingTalkClientUser; /** * @param formDTO @@ -709,22 +716,41 @@ public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResol */ @Override public ResiDingAppLoginResDTO resiLoginDing(ResiDingAppLoginFormDTO formDTO) { - //获取用户手机号 - log.info("authCode:"+formDTO.getAuthCode()); - //todo 调用一下接口 - + ResiDingAppLoginResDTO resDTO= null; + try { + resDTO = new ResiDingAppLoginResDTO(); + + Map miniInfo = new HashMap<>(); + miniInfo.put("suitew6ccvkquinmrghqy","TooAxiegdsE5BPP6xo1AxK1LdmaUoMpPMyomOcGcBSXtnsxRc8dEfyOlG56oSmEB"); + miniInfo.put("suitezhyj12glsrp8em0f","-z5Q_lvMP6l7fTzlArEzUT8D_-5pvqBQaJMuTGHoXnz0nuiqGQMZ8aeya_cxTsN-"); + miniInfo.put("suite5yxliro6wawv514w","aQxiPi7DwJSUa9HlbUU_L7Q4wGCLEDmgf__Ffx75cTn3jZwuHy9vdl-9Iv5FeyJU"); + miniInfo.put("suitemcestnonr6y0xigc","kKCNCkfDhmLoVnl_wuAiScyDG4776mkTevuSBuiYhHg-Bvz1-vhb_4IA-Km7nK2I"); + //获取用户手机号 + log.info("authCode:"+formDTO.getAuthCode()); + //todo 调用一下接口 + String clientId = formDTO.getClientId(); + + com.aliyun.dingtalk.module.Result userAccessToken = dingTalkClientToken.getUserAccessToken(formDTO.getAuthCode(), clientId, miniInfo.get(clientId)); + log.info("resiLoginDing userAccessToken:{}",JSON.toJSONString(userAccessToken)); + if (userAccessToken.success() && userAccessToken.getData() != null){ + com.aliyun.dingtalk.module.Result me = dingTalkClientUser.getUserInfo("me", userAccessToken.getData().getAccessToken()); + log.info("resiLoginDing me:{}",JSON.toJSONString(me)); + resDTO.setExtInfo(JSON.toJSONString(me.getData())); + } - ResiDingAppLoginResDTO resDTO=new ResiDingAppLoginResDTO(); - resDTO.setCustomerId("45687aa479955f9d06204d415238f7cc"); - resDTO.setGridId("763d6e09b9081d63195d53da84b3ae3a"); - resDTO.setEpmetUserId("f838614e67cf8ae0edaefe562b6660e5"); - //生成token串 - Map map = new HashMap<>(); - map.put("app", "resi"); - map.put("client", "miniding"); - map.put("userId", resDTO.getEpmetUserId()); - String token = jwtTokenUtils.createToken(map); - resDTO.setAuthorization(token); + resDTO.setCustomerId("45687aa479955f9d06204d415238f7cc"); + resDTO.setGridId("763d6e09b9081d63195d53da84b3ae3a"); + resDTO.setEpmetUserId("f838614e67cf8ae0edaefe562b6660e5"); + //生成token串 + Map map = new HashMap<>(); + map.put("app", "resi"); + map.put("client", "miniding"); + map.put("userId", resDTO.getEpmetUserId()); + String token = jwtTokenUtils.createToken(map); + resDTO.setAuthorization(token); + } catch (ApiException e) { + throw new EpmetException(e.getErrMsg()); + } return resDTO; } } From 7e1cc720ad4d7ba66f854ddd8968efb4a43e8765 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 14 Sep 2022 18:16:34 +0800 Subject: [PATCH 027/147] redis token --- .../service/impl/ThirdLoginServiceImpl.java | 23 +++++++++++++++++-- .../tools/constant/AppClientConstant.java | 5 ++++ 2 files changed, 26 insertions(+), 2 deletions(-) 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 365f9dd7b3..5c2c37e085 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 @@ -746,14 +746,33 @@ public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResol resDTO.setEpmetUserId("f838614e67cf8ae0edaefe562b6660e5"); //生成token串 Map map = new HashMap<>(); - map.put("app", "resi"); - map.put("client", "miniding"); + map.put("app", AppClientConstant.APP_RESI); + map.put("client", AppClientConstant.MINI_DING); map.put("userId", resDTO.getEpmetUserId()); String token = jwtTokenUtils.createToken(map); resDTO.setAuthorization(token); + + //4.存放Redis + this.saveTokenDtoDing(AppClientConstant.APP_RESI,AppClientConstant.MINI_DING, resDTO.getEpmetUserId(), token, resDTO.getCustomerId()); } catch (ApiException e) { throw new EpmetException(e.getErrMsg()); } return resDTO; } + + private String saveTokenDtoDing(String app,String client, String userId, String token, String customerId) { + int expire = jwtTokenProperties.getExpire(); + TokenDto tokenDto = new TokenDto(); + tokenDto.setCustomerId(customerId); + tokenDto.setApp(AppClientConstant.APP_RESI); + tokenDto.setClient(AppClientConstant.MINI_DING); + tokenDto.setUserId(userId); + tokenDto.setToken(token); + tokenDto.setUpdateTime(System.currentTimeMillis()); + tokenDto.setExpireTime(jwtTokenUtils.getExpiration(token).getTime()); + cpUserDetailRedis.set(tokenDto, expire); + logger.info("截止时间:" + DateUtils.format(jwtTokenUtils.getExpiration(token), "yyyy-MM-dd HH:mm:ss")); + return token; + } + } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/AppClientConstant.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/AppClientConstant.java index 0b42461f6e..049f335aa4 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/AppClientConstant.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/AppClientConstant.java @@ -32,6 +32,11 @@ public interface AppClientConstant { */ String CLIENT_WXMP = "wxmp"; + /** + * 钉钉小程序 + */ + String MINI_DING = "mini_ding"; + /** * 客户来源App * */ From c26b2dc7f0b91c38249db81b3435e14649b9da83 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 14 Sep 2022 19:02:38 +0800 Subject: [PATCH 028/147] temp --- .../dto/result/ResiDingAppLoginResDTO.java | 15 ++++++++++++++- .../service/impl/ThirdLoginServiceImpl.java | 18 ++++++++++++++---- 2 files changed, 28 insertions(+), 5 deletions(-) diff --git a/epmet-auth/src/main/java/com/epmet/dto/result/ResiDingAppLoginResDTO.java b/epmet-auth/src/main/java/com/epmet/dto/result/ResiDingAppLoginResDTO.java index 28a5e899db..89b51ab6c1 100644 --- a/epmet-auth/src/main/java/com/epmet/dto/result/ResiDingAppLoginResDTO.java +++ b/epmet-auth/src/main/java/com/epmet/dto/result/ResiDingAppLoginResDTO.java @@ -13,10 +13,23 @@ public class ResiDingAppLoginResDTO { private String customerId; private String gridId; /** - * + * 网格名 + */ + private String gridName; + /** + * 网格所属的组织id + */ + private String agencyId; + /** + * 居民端用户id */ private String epmetUserId; + /** + * 5.获取用户手机号。使用用户个人access_token调用获取用户通讯录个人信息接口获取 + * 返参信息 + * 接口文档:https://open.dingtalk.com/document/isvapp-server/dingtalk-retrieve-user-information + */ private String extInfo; } 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 5c2c37e085..c01412baa6 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 @@ -10,6 +10,7 @@ import com.epmet.common.token.constant.LoginConstant; import com.epmet.commons.rocketmq.messages.LoginMQMsg; import com.epmet.commons.tools.constant.AppClientConstant; import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.enums.EnvEnum; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.exception.ExceptionUtils; @@ -722,6 +723,14 @@ public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResol ResiDingAppLoginResDTO resDTO= null; try { resDTO = new ResiDingAppLoginResDTO(); + EnvEnum currentEnv = EnvEnum.getCurrentEnv(); + if (EnvEnum.PROD.getCode().equals(currentEnv.getCode())) { + //烟台的客户id + resDTO.setCustomerId("1535072605621841922"); + }else{ + //其余统一走开发环境 + resDTO.setCustomerId("45687aa479955f9d06204d415238f7cc"); + } Map miniInfo = new HashMap<>(); miniInfo.put("suitew6ccvkquinmrghqy","TooAxiegdsE5BPP6xo1AxK1LdmaUoMpPMyomOcGcBSXtnsxRc8dEfyOlG56oSmEB"); @@ -729,8 +738,7 @@ public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResol miniInfo.put("suite5yxliro6wawv514w","aQxiPi7DwJSUa9HlbUU_L7Q4wGCLEDmgf__Ffx75cTn3jZwuHy9vdl-9Iv5FeyJU"); miniInfo.put("suitemcestnonr6y0xigc","kKCNCkfDhmLoVnl_wuAiScyDG4776mkTevuSBuiYhHg-Bvz1-vhb_4IA-Km7nK2I"); //获取用户手机号 - log.info("authCode:"+formDTO.getAuthCode()); - //todo 调用一下接口 + String clientId = formDTO.getClientId(); com.aliyun.dingtalk.module.Result userAccessToken = dingTalkClientToken.getUserAccessToken(formDTO.getAuthCode(), clientId, miniInfo.get(clientId)); @@ -741,7 +749,7 @@ public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResol resDTO.setExtInfo(JSON.toJSONString(me.getData())); } - resDTO.setCustomerId("45687aa479955f9d06204d415238f7cc"); + // //todo 调用一下接口 调用userfeign接口,拿到用户id以及注册网格id resDTO.setGridId("763d6e09b9081d63195d53da84b3ae3a"); resDTO.setEpmetUserId("f838614e67cf8ae0edaefe562b6660e5"); //生成token串 @@ -755,12 +763,14 @@ public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResol //4.存放Redis this.saveTokenDtoDing(AppClientConstant.APP_RESI,AppClientConstant.MINI_DING, resDTO.getEpmetUserId(), token, resDTO.getCustomerId()); } catch (ApiException e) { - throw new EpmetException(e.getErrMsg()); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), e.getErrMsg(), EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getMsg()); } return resDTO; } private String saveTokenDtoDing(String app,String client, String userId, String token, String customerId) { + + int expire = jwtTokenProperties.getExpire(); TokenDto tokenDto = new TokenDto(); tokenDto.setCustomerId(customerId); From 414b68908c613cf9620fd0640cce29ad36f5397f Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Thu, 15 Sep 2022 09:08:31 +0800 Subject: [PATCH 029/147] =?UTF-8?q?=E4=BA=BA=E5=91=98=E5=9B=BE=E8=B0=B1-?= =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E8=AF=A6=E6=83=85=E9=87=8C=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E7=9A=84=E6=88=BF=E5=B1=8B=E4=BF=A1=E6=81=AF=E7=94=B1=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E6=9C=AC=E4=BA=BA=E6=98=AF=E6=88=BF=E4=B8=9C=E7=9A=84?= =?UTF-8?q?=E6=88=BF=E5=B1=8B=E4=BF=A1=E6=81=AF=E6=94=B9=E4=B8=BA=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E5=BD=93=E5=89=8D=E4=BA=BA=E5=91=98=E5=B1=85=E4=BD=8F?= =?UTF-8?q?=E7=9A=84=E6=88=BF=E5=B1=8B=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/dto/result/PersonDataResultDTO.java | 3 +++ .../service/impl/IcResiUserServiceImpl.java | 16 +++++++++++++++- .../src/main/resources/mapper/IcResiUserDao.xml | 4 +++- 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/PersonDataResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/PersonDataResultDTO.java index 5e739016b3..e9873965b7 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/PersonDataResultDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/PersonDataResultDTO.java @@ -95,4 +95,7 @@ public class PersonDataResultDTO implements Serializable { @JsonIgnore private String gridId; + + @JsonIgnore + private String homeId; } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java index 5b1fd7f8f1..ec9bf3043c 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java @@ -1143,11 +1143,25 @@ public class IcResiUserServiceImpl extends BaseServiceImpl> listResult = govOrgOpenFeignClient.selectHouseInfoByIdCard(personData.getIdCard(), formDTO.getCustomerId()); + //2022.9.14 应产品要求之前返的是这个人是房东的房屋信息,现在改成返回这个人当前居住的房屋信息 syc + /*Result> listResult = govOrgOpenFeignClient.selectHouseInfoByIdCard(personData.getIdCard(), formDTO.getCustomerId()); if (!listResult.success()) { throw new RenException("查询房屋信息失败"); } personData.setHouseInfo(listResult.getData()); + */ + Set houseIds = new HashSet<>(); + houseIds.add(personData.getHomeId()); + Result> houseInfoRes = govOrgOpenFeignClient.queryListHouseInfo(houseIds, formDTO.getCustomerId()); + if (!houseInfoRes.success()) { + throw new RenException("查询房屋信息失败"); + } + List houseInfo = new ArrayList<>(); + if(null!=houseInfoRes.getData()&& !CollectionUtils.isEmpty(houseInfoRes.getData())){ + houseInfo.add(houseInfoRes.getData().get(0).getAllName()); + } + //2022.9.14 end + personData.setHouseInfo(houseInfo); // 志愿者处理 if (personData.getIsVolunteer().equals(NumConstant.ONE_STR)) { diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml index fe17400279..4674e07b37 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml @@ -300,6 +300,7 @@ + @@ -316,7 +317,8 @@ IS_TENANT as isTenant, IFNULL(IS_VOLUNTEER,'0') AS isVolunteer, CUSTOMER_ID, - GRID_ID + GRID_ID, + HOME_ID FROM ic_resi_user WHERE DEL_FLAG = '0' AND ID = #{userId} From 0c8cc30db7d56c18563b12494262d2dbed5b9f71 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Thu, 15 Sep 2022 09:24:14 +0800 Subject: [PATCH 030/147] =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E8=BF=94=E5=8F=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/dto/result/IcEventResultDTO.java | 1 + .../src/main/resources/mapper/IcEventDao.xml | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventResultDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventResultDTO.java index 0408211603..24f8e387d0 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventResultDTO.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventResultDTO.java @@ -16,4 +16,5 @@ public class IcEventResultDTO { private String reportUserName; private String mobile; private String address; + private String happenTime; } diff --git a/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/IcEventDao.xml b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/IcEventDao.xml index ec9ff0745f..578e1073c0 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/IcEventDao.xml +++ b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/IcEventDao.xml @@ -43,7 +43,8 @@ e.REPORT_USER_ID reportUserId, e.NAME reportUserName, e.MOBILE mobile, - e.STATUS processStatus + e.STATUS processStatus, + e.happen_time happenTime from ic_event e From 9fe69ef16b65caee732faac5ca31251aed1d75c5 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Thu, 15 Sep 2022 09:43:42 +0800 Subject: [PATCH 031/147] =?UTF-8?q?=E7=BC=93=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/redis/DingDingCallbackRedis.java | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/redis/DingDingCallbackRedis.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/redis/DingDingCallbackRedis.java index 13d026d20b..c6b02998f9 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/redis/DingDingCallbackRedis.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/redis/DingDingCallbackRedis.java @@ -1,10 +1,19 @@ package com.epmet.redis; +import com.alibaba.fastjson.JSON; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.redis.RedisKeys; import com.epmet.commons.tools.redis.RedisUtils; +import com.epmet.dao.OpenSyncBizDataDao; +import com.epmet.dto.OpenSyncBizDataDTO; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; +import java.util.List; +import java.util.Map; + /** * @Author zxc * @DateTime 2022/9/14 10:32 @@ -14,6 +23,8 @@ import org.springframework.stereotype.Component; public class DingDingCallbackRedis { @Autowired private RedisUtils redisUtils; + @Autowired + private OpenSyncBizDataDao openSyncBizDataDao; public void set(String suiteKey,String suiteTicket){ String key = RedisKeys.getSuiteTicketKey(suiteKey); @@ -21,6 +32,15 @@ public class DingDingCallbackRedis { } public String get(String suiteKey){ - return redisUtils.getString(RedisKeys.getSuiteTicketKey(suiteKey)); + String ticket = redisUtils.getString(RedisKeys.getSuiteTicketKey(suiteKey)); + if (StringUtils.isNotBlank(ticket)){ + return ticket; + } + List openSyncData = openSyncBizDataDao.getOpenSyncData(suiteKey, NumConstant.TWO_STR, null); + if (null == openSyncData){ + throw new EpmetException("未查询到"+suiteKey+"的ticket"); + } + Map map = JSON.parseObject(openSyncData.get(NumConstant.ZERO).getBizData(), Map.class); + return map.get("suiteTicket").toString(); } } From bffa8e9f35fd94d61c46ae1864360fd409daca15 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 15 Sep 2022 09:44:22 +0800 Subject: [PATCH 032/147] /epmetuser/userbaseinfo/dingResiLogin --- .../dto/form/ResiDingAppLoginFormDTO.java | 2 +- .../dto/result/ResiDingAppLoginResDTO.java | 7 ++ .../service/impl/ThirdLoginServiceImpl.java | 65 +++++++-------- .../commons/tools/enums/DingMiniAppEnum.java | 79 +++++++++++++++++++ .../epmet/dto/form/DingLoginResiFormDTO.java | 60 ++++++++++++++ .../epmet/dto/result/DingLoginResiResDTO.java | 34 ++++++++ .../epmet/feign/EpmetUserOpenFeignClient.java | 16 ++++ .../EpmetUserOpenFeignClientFallback.java | 19 +++++ 8 files changed, 250 insertions(+), 32 deletions(-) create mode 100644 epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/DingMiniAppEnum.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/DingLoginResiFormDTO.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/DingLoginResiResDTO.java diff --git a/epmet-auth/src/main/java/com/epmet/dto/form/ResiDingAppLoginFormDTO.java b/epmet-auth/src/main/java/com/epmet/dto/form/ResiDingAppLoginFormDTO.java index 1e3453c474..ed47deedf4 100644 --- a/epmet-auth/src/main/java/com/epmet/dto/form/ResiDingAppLoginFormDTO.java +++ b/epmet-auth/src/main/java/com/epmet/dto/form/ResiDingAppLoginFormDTO.java @@ -17,7 +17,7 @@ public class ResiDingAppLoginFormDTO { @NotBlank(message = "authCode不能为空") private String authCode; /** - * 第三方企业应用传应用的SuiteSecret + * 第三方企业应用传应用的SuiteKey */ @NotBlank(message = "clientId不能为空") private String clientId; diff --git a/epmet-auth/src/main/java/com/epmet/dto/result/ResiDingAppLoginResDTO.java b/epmet-auth/src/main/java/com/epmet/dto/result/ResiDingAppLoginResDTO.java index 89b51ab6c1..7a0517574a 100644 --- a/epmet-auth/src/main/java/com/epmet/dto/result/ResiDingAppLoginResDTO.java +++ b/epmet-auth/src/main/java/com/epmet/dto/result/ResiDingAppLoginResDTO.java @@ -31,5 +31,12 @@ public class ResiDingAppLoginResDTO { * 接口文档:https://open.dingtalk.com/document/isvapp-server/dingtalk-retrieve-user-information */ private String extInfo; + + /** + * 是否注册居民 + * true:已注册 + * false:未注册 + */ + private Boolean regFlag; } 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 c01412baa6..13eac20dca 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 @@ -10,6 +10,7 @@ import com.epmet.common.token.constant.LoginConstant; import com.epmet.commons.rocketmq.messages.LoginMQMsg; import com.epmet.commons.tools.constant.AppClientConstant; import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.enums.DingMiniAppEnum; import com.epmet.commons.tools.enums.EnvEnum; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetException; @@ -719,7 +720,6 @@ public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResol public ResiDingAppLoginResDTO resiLoginDing(ResiDingAppLoginFormDTO formDTO) { //获取用户手机号 log.info("钉钉居民端应用登录入参:"+ JSON.toJSONString(formDTO)); - //todo 调用一下接口 ResiDingAppLoginResDTO resDTO= null; try { resDTO = new ResiDingAppLoginResDTO(); @@ -732,50 +732,53 @@ public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResol resDTO.setCustomerId("45687aa479955f9d06204d415238f7cc"); } - Map miniInfo = new HashMap<>(); - miniInfo.put("suitew6ccvkquinmrghqy","TooAxiegdsE5BPP6xo1AxK1LdmaUoMpPMyomOcGcBSXtnsxRc8dEfyOlG56oSmEB"); - miniInfo.put("suitezhyj12glsrp8em0f","-z5Q_lvMP6l7fTzlArEzUT8D_-5pvqBQaJMuTGHoXnz0nuiqGQMZ8aeya_cxTsN-"); - miniInfo.put("suite5yxliro6wawv514w","aQxiPi7DwJSUa9HlbUU_L7Q4wGCLEDmgf__Ffx75cTn3jZwuHy9vdl-9Iv5FeyJU"); - miniInfo.put("suitemcestnonr6y0xigc","kKCNCkfDhmLoVnl_wuAiScyDG4776mkTevuSBuiYhHg-Bvz1-vhb_4IA-Km7nK2I"); - //获取用户手机号 - + //1、获取用户手机号 String clientId = formDTO.getClientId(); - - com.aliyun.dingtalk.module.Result userAccessToken = dingTalkClientToken.getUserAccessToken(formDTO.getAuthCode(), clientId, miniInfo.get(clientId)); + com.aliyun.dingtalk.module.Result userAccessToken = dingTalkClientToken.getUserAccessToken(formDTO.getAuthCode(), clientId, DingMiniAppEnum.getEnum(clientId).getSuiteSecret()); log.info("resiLoginDing userAccessToken:{}",JSON.toJSONString(userAccessToken)); - if (userAccessToken.success() && userAccessToken.getData() != null){ - com.aliyun.dingtalk.module.Result me = dingTalkClientUser.getUserInfo("me", userAccessToken.getData().getAccessToken()); - log.info("resiLoginDing me:{}",JSON.toJSONString(me)); - resDTO.setExtInfo(JSON.toJSONString(me.getData())); + if (!userAccessToken.success() || null == userAccessToken.getData()) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "调用微信api异常:" + JSON.toJSONString(userAccessToken), EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getMsg()); } - - // //todo 调用一下接口 调用userfeign接口,拿到用户id以及注册网格id - resDTO.setGridId("763d6e09b9081d63195d53da84b3ae3a"); - resDTO.setEpmetUserId("f838614e67cf8ae0edaefe562b6660e5"); - //生成token串 - Map map = new HashMap<>(); - map.put("app", AppClientConstant.APP_RESI); - map.put("client", AppClientConstant.MINI_DING); - map.put("userId", resDTO.getEpmetUserId()); - String token = jwtTokenUtils.createToken(map); + com.aliyun.dingtalk.module.Result me = dingTalkClientUser.getUserInfo("me", userAccessToken.getData().getAccessToken()); + log.info("resiLoginDing me:{}",JSON.toJSONString(me)); + resDTO.setExtInfo(JSON.toJSONString(me.getData())); + + // 2、调用userfeign接口获取userId、注册网格相关信息 todo + DingLoginResiFormDTO dingLoginResiFormDTO=ConvertUtils.sourceToTarget(me.getData(),DingLoginResiFormDTO.class); + dingLoginResiFormDTO.setCustomerId(resDTO.getCustomerId()); + Result loginResiResDTOResult = epmetUserOpenFeignClient.dingResiLogin(dingLoginResiFormDTO); + if (!loginResiResDTOResult.success() || null == loginResiResDTOResult.getData()) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取epmetUserId异常:" + JSON.toJSONString(loginResiResDTOResult), EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getMsg()); + } + DingLoginResiResDTO resiResDTO=loginResiResDTOResult.getData(); + resDTO.setGridId(resiResDTO.getGridId()); + resDTO.setGridName(resiResDTO.getGridName()); + resDTO.setAgencyId(resiResDTO.getAgencyId()); + resDTO.setEpmetUserId(resiResDTO.getEpmetUserId()); + resDTO.setRegFlag(resiResDTO.getRegFlag()); + + //3.生成token,并且存放Redis + String token=this.saveTokenDtoDing(AppClientConstant.APP_RESI,AppClientConstant.MINI_DING, resDTO.getEpmetUserId(), resDTO.getCustomerId()); resDTO.setAuthorization(token); - //4.存放Redis - this.saveTokenDtoDing(AppClientConstant.APP_RESI,AppClientConstant.MINI_DING, resDTO.getEpmetUserId(), token, resDTO.getCustomerId()); } catch (ApiException e) { throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), e.getErrMsg(), EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getMsg()); } return resDTO; } - private String saveTokenDtoDing(String app,String client, String userId, String token, String customerId) { - - + private String saveTokenDtoDing(String app,String client, String userId,String customerId) { + //生成token串 + Map map = new HashMap<>(); + map.put(AppClientConstant.APP, AppClientConstant.APP_RESI); + map.put(AppClientConstant.CLIENT, AppClientConstant.MINI_DING); + map.put("userId", userId); + String token = jwtTokenUtils.createToken(map); int expire = jwtTokenProperties.getExpire(); TokenDto tokenDto = new TokenDto(); tokenDto.setCustomerId(customerId); - tokenDto.setApp(AppClientConstant.APP_RESI); - tokenDto.setClient(AppClientConstant.MINI_DING); + tokenDto.setApp(app); + tokenDto.setClient(client); tokenDto.setUserId(userId); tokenDto.setToken(token); tokenDto.setUpdateTime(System.currentTimeMillis()); diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/DingMiniAppEnum.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/DingMiniAppEnum.java new file mode 100644 index 0000000000..b0c0054ebb --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/DingMiniAppEnum.java @@ -0,0 +1,79 @@ +package com.epmet.commons.tools.enums; + +/** + * @Description + * @Author yzm + * @Date 2022/9/14 19:11 + */ +public enum DingMiniAppEnum { + // 亿联云盘CorpId:dingd1e19e397c754c7735c2f4657eb6378f + // + // //各应用秘钥 + // 随手拍 + // SuiteId:27501006 + // AppId:119450 + // MiniAppId:5000000002934668 + // SuiteKey:suitew6ccvkquinmrghqy + // SuiteSecret:TooAxiegdsE5BPP6xo1AxK1LdmaUoMpPMyomOcGcBSXtnsxRc8dEfyOlG56oSmEB + // + // 随时讲 + // SuiteId:27564007 + // AppId:119451 + // MiniAppId:5000000002934374 + // SuiteKey:suitezhyj12glsrp8em0f + // SuiteSecret:-z5Q_lvMP6l7fTzlArEzUT8D_-5pvqBQaJMuTGHoXnz0nuiqGQMZ8aeya_cxTsN- + // + // 我的报事 + // SuiteId:27569006 + // AppId:119452 + // MiniAppId:5000000002934456 + // SuiteKey:suite5yxliro6wawv514w + // SuiteSecret:aQxiPi7DwJSUa9HlbUU_L7Q4wGCLEDmgf__Ffx75cTn3jZwuHy9vdl-9Iv5FeyJU + // + // 实时动态 + // SuiteId:27458011 + // AppId:119453 + // MiniAppId:5000000002934488 + // SuiteKey:suitemcestnonr6y0xigc + // SuiteSecret:kKCNCkfDhmLoVnl_wuAiScyDG4776mkTevuSBuiYhHg-Bvz1-vhb_4IA-Km7nK2I + SSP("suitew6ccvkquinmrghqy", "随手拍", "TooAxiegdsE5BPP6xo1AxK1LdmaUoMpPMyomOcGcBSXtnsxRc8dEfyOlG56oSmEB"), + SSJ("suitezhyj12glsrp8em0f", "随时讲", "-z5Q_lvMP6l7fTzlArEzUT8D_-5pvqBQaJMuTGHoXnz0nuiqGQMZ8aeya_cxTsN-"), + MY_REPORT_EVENT("suite5yxliro6wawv514w", "我的报事", "aQxiPi7DwJSUa9HlbUU_L7Q4wGCLEDmgf__Ffx75cTn3jZwuHy9vdl-9Iv5FeyJU"), + SSDT("suitemcestnonr6y0xigc", "实时动态", "kKCNCkfDhmLoVnl_wuAiScyDG4776mkTevuSBuiYhHg-Bvz1-vhb_4IA-Km7nK2I"); + + private String suiteKey; + private String name; + private String suiteSecret; + + + DingMiniAppEnum(String suiteKey, String name, String suiteSecret) { + this.suiteKey = suiteKey; + this.name = name; + this.suiteSecret = suiteSecret; + } + + public static DingMiniAppEnum getEnum(String suiteKey) { + DingMiniAppEnum[] values = DingMiniAppEnum.values(); + for (DingMiniAppEnum value : values) { + if (value.getSuiteKey().equals(suiteKey)) { + return value; + } + } + return null; + } + + + public String getSuiteKey() { + return suiteKey; + } + + public String getName() { + return name; + } + + public String getSuiteSecret() { + return suiteSecret; + } + +} + diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/DingLoginResiFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/DingLoginResiFormDTO.java new file mode 100644 index 0000000000..7f756f2ed9 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/DingLoginResiFormDTO.java @@ -0,0 +1,60 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; + +/** + * @Description 钉钉居民端应用注册 // 接口逻辑: + * // (1)根据clientId去XXX表找到customerId + * // (2)通过1、2拿到手机号之后,根据mobile+customerId去user_base_info表找userId, + * // 是否注册居民:register_relation + * // (3)没有则生成user、user_Base_info表记录 + * @Author yzm + * @Date 2022/9/15 9:28 + */ +@Data +public class DingLoginResiFormDTO { + public interface AddUserInternalGroup { + } + + public interface AddUserShowGroup extends CustomerClientShowGroup { + } + + @NotBlank(message = "customerId不能为空", groups = AddUserShowGroup.class) + private String customerId; + + // 以下参数是微信返回的 + /** + * 头像URL。 + */ + public String avatarUrl; + /** + * 用户的个人邮箱。 + */ + public String email; + /** + * 用户的手机号。 + * 说明 如果要获取用户手机号,需要在开发者后台申请个人手机号信息权限,如下图。 + */ + @NotBlank(message = "手机号不能为空", groups = AddUserShowGroup.class) + public String mobile; + /** + * 用户的钉钉昵称。 + */ + public String nick; + /** + * + */ + public String openId; + /** + * 手机号对应的国家号。 + */ + public String stateCode; + /** + * + */ + public String unionId; +} + diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/DingLoginResiResDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/DingLoginResiResDTO.java new file mode 100644 index 0000000000..a9ca3d693a --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/DingLoginResiResDTO.java @@ -0,0 +1,34 @@ +package com.epmet.dto.result; + +import lombok.Data; + +/** + * @Description + * @Author yzm + * @Date 2022/9/15 9:33 + */ +@Data +public class DingLoginResiResDTO { + private String customerId; + private String gridId; + /** + * XXX社区-网格名 + */ + private String gridName; + /** + * 网格所属的组织id + */ + private String agencyId; + /** + * 居民端用户id + */ + private String epmetUserId; + + /** + * 是否注册居民 + * true:已注册 + * false:未注册 + */ + private Boolean regFlag; +} + 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 73d770a411..3c6f82398f 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 @@ -885,4 +885,20 @@ public interface EpmetUserOpenFeignClient { @PostMapping("/epmetuser/icresiuser/updateYlfn") Result updateYlfn(); + + /** + * 钉钉居民端登录 + * // 接入流程:https://open.dingtalk.com/document/isvapp-server/unified-authorization-suite-access-process + * // 1、获取个人用户token:https://open.dingtalk.com/document/isvapp-server/obtain-user-token + * // 2、获取用户通讯录个人信息:https://open.dingtalk.com/document/isvapp-server/dingtalk-retrieve-user-information + * // 接口逻辑: + * // (1)根据clientId去XXX表找到customerId + * // (2)通过1、2拿到手机号之后,根据mobile+customerId去user_base_info表找userId, + * // 是否注册居民:register_relation + * // (3)没有则生成user、user_Base_info表记录 + * @param formDTO + * @return + */ + @PostMapping("/epmetuser/userbaseinfo/dingResiLogin") + Result dingResiLogin(@RequestBody DingLoginResiFormDTO 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 2de7371623..88abc4b4f8 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 @@ -683,4 +683,23 @@ public class EpmetUserOpenFeignClientFallback implements EpmetUserOpenFeignClien public Result updateYlfn() { return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "updateYlfn", null); } + + /** + * 钉钉居民端登录 + * // 接入流程:https://open.dingtalk.com/document/isvapp-server/unified-authorization-suite-access-process + * // 1、获取个人用户token:https://open.dingtalk.com/document/isvapp-server/obtain-user-token + * // 2、获取用户通讯录个人信息:https://open.dingtalk.com/document/isvapp-server/dingtalk-retrieve-user-information + * // 接口逻辑: + * // (1)根据clientId去XXX表找到customerId + * // (2)通过1、2拿到手机号之后,根据mobile+customerId去user_base_info表找userId, + * // 是否注册居民:register_relation + * // (3)没有则生成user、user_Base_info表记录 + * + * @param formDTO + * @return + */ + @Override + public Result dingResiLogin(DingLoginResiFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "dingResiLogin", formDTO); + } } From 4518f2972b8cacb817f3da91b4104fd4ab82fb90 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 15 Sep 2022 09:48:03 +0800 Subject: [PATCH 033/147] dingResiLogin --- .../controller/UserBaseInfoController.java | 26 ++++++++++++++++--- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserBaseInfoController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserBaseInfoController.java index a60efed8cc..8492a5efea 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserBaseInfoController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserBaseInfoController.java @@ -31,12 +31,10 @@ import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.dto.RegisterRelationDTO; import com.epmet.dto.UserBaseInfoDTO; import com.epmet.dto.form.CommonUserIdFormDTO; +import com.epmet.dto.form.DingLoginResiFormDTO; import com.epmet.dto.form.IssueInitiatorFormDTO; import com.epmet.dto.form.VolunteerRegResiFormDTO; -import com.epmet.dto.result.CustomerUserDetailResultDTO; -import com.epmet.dto.result.ExtUserInfoResultDTO; -import com.epmet.dto.result.ResiUserBaseInfoResultDTO; -import com.epmet.dto.result.UserBaseInfoResultDTO; +import com.epmet.dto.result.*; import com.epmet.entity.UserBaseInfoEntity; import com.epmet.excel.UserBaseInfoExcel; import com.epmet.service.UserBaseInfoService; @@ -221,5 +219,25 @@ public class UserBaseInfoController { public Result getUserInfo(@PathVariable("userId") String userId){ return new Result().ok(userBaseInfoService.getUserInfo(userId)); } + +// 接入流程:https://open.dingtalk.com/document/isvapp-server/unified-authorization-suite-access-process +// 1、获取个人用户token:https://open.dingtalk.com/document/isvapp-server/obtain-user-token +// 2、获取用户通讯录个人信息:https://open.dingtalk.com/document/isvapp-server/dingtalk-retrieve-user-information +// 接口逻辑: +// (1)根据clientId去XXX表找到customerId +// (2)通过1、2拿到手机号之后,根据mobile+customerId去user_base_info表找userId, +// 是否注册居民:register_relation +// (3)没有则生成user、user_Base_info表记录 + /** + * yapi: http://yapi.elinkservice.cn/project/245/interface/api/8118 + * + * @param formDTO + * @return + */ + @PostMapping("dingResiLogin") + public Result dingResiLogin(@RequestBody DingLoginResiFormDTO formDTO){ + // todo + return new Result<>(); + } } From 056021b28be8933076addbce09b3921a9267ece5 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Thu, 15 Sep 2022 10:56:19 +0800 Subject: [PATCH 034/147] =?UTF-8?q?=E7=BC=93=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tools/dto/form/DingMiniInfoFormDTO.java | 26 +++++++++ .../tools/feign/CommonThirdFeignClient.java | 24 ++++++++ ...CommonThirdFeignClientFallBackFactory.java | 20 +++++++ .../CommonThirdFeignClientFallback.java | 24 ++++++++ .../epmet/commons/tools/redis/RedisKeys.java | 4 ++ .../redis/common/CustomerDingDingRedis.java | 58 +++++++++++++++++++ .../redis/common/bean/DingMiniInfoCache.java | 52 +++++++++++++++++ .../dingtalk/CallbackController.java | 14 +++++ .../com/epmet/service/DingTalkService.java | 10 ++++ .../service/impl/DingTalkServiceImpl.java | 31 ++++++++++ 10 files changed, 263 insertions(+) create mode 100644 epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/DingMiniInfoFormDTO.java create mode 100644 epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/CommonThirdFeignClient.java create mode 100644 epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/fallback/CommonThirdFeignClientFallBackFactory.java create mode 100644 epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/fallback/CommonThirdFeignClientFallback.java create mode 100644 epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerDingDingRedis.java create mode 100644 epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/DingMiniInfoCache.java diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/DingMiniInfoFormDTO.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/DingMiniInfoFormDTO.java new file mode 100644 index 0000000000..57a28cadc8 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/DingMiniInfoFormDTO.java @@ -0,0 +1,26 @@ +package com.epmet.commons.tools.dto.form; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2022/9/15 10:25 + * @DESC + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +public class DingMiniInfoFormDTO implements Serializable { + + private static final long serialVersionUID = 2661531490851265637L; + + public interface DingMiniInfoForm{} + + @NotBlank(message = "suiteKey不能为空",groups = DingMiniInfoForm.class) + private String suiteKey; +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/CommonThirdFeignClient.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/CommonThirdFeignClient.java new file mode 100644 index 0000000000..6bc986aca0 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/CommonThirdFeignClient.java @@ -0,0 +1,24 @@ +package com.epmet.commons.tools.feign; + +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.dto.form.DingMiniInfoFormDTO; +import com.epmet.commons.tools.feign.fallback.CommonThirdFeignClientFallBackFactory; +import com.epmet.commons.tools.redis.common.bean.DingMiniInfoCache; +import com.epmet.commons.tools.utils.Result; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; + + +/** + * @Description + * @Author zxc + */ +@FeignClient(name = ServiceConstant.EPMET_THIRD_SERVER, fallbackFactory = CommonThirdFeignClientFallBackFactory.class) +// @FeignClient(name = ServiceConstant.EPMET_THIRD_SERVER, fallbackFactory = CommonAggFeignClientFallBackFactory.class,url = "localhost:8110") +public interface CommonThirdFeignClient { + + @PostMapping("/third/dingTalk/getDingMiniInfo") + Result getDingMiniInfo(@RequestBody DingMiniInfoFormDTO formDTO); + +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/fallback/CommonThirdFeignClientFallBackFactory.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/fallback/CommonThirdFeignClientFallBackFactory.java new file mode 100644 index 0000000000..4a43935086 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/fallback/CommonThirdFeignClientFallBackFactory.java @@ -0,0 +1,20 @@ +package com.epmet.commons.tools.feign.fallback; + +import com.epmet.commons.tools.exception.ExceptionUtils; +import com.epmet.commons.tools.feign.CommonThirdFeignClient; +import feign.hystrix.FallbackFactory; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Component; + +@Component +@Slf4j +public class CommonThirdFeignClientFallBackFactory implements FallbackFactory { + + private CommonThirdFeignClientFallback fallback = new CommonThirdFeignClientFallback(); + + @Override + public CommonThirdFeignClient create(Throwable cause) { + log.error(String.format("FeignClient调用发生异常,异常信息:%s", ExceptionUtils.getThrowableErrorStackTrace(cause))); + return fallback; + } +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/fallback/CommonThirdFeignClientFallback.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/fallback/CommonThirdFeignClientFallback.java new file mode 100644 index 0000000000..47e278f846 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/fallback/CommonThirdFeignClientFallback.java @@ -0,0 +1,24 @@ +package com.epmet.commons.tools.feign.fallback; + +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.dto.form.DingMiniInfoFormDTO; +import com.epmet.commons.tools.feign.CommonThirdFeignClient; +import com.epmet.commons.tools.redis.common.bean.DingMiniInfoCache; +import com.epmet.commons.tools.utils.ModuleUtils; +import com.epmet.commons.tools.utils.Result; +import org.springframework.stereotype.Component; + +/** + * + * @Author zxc + * @Description + * @Date + **/ +@Component +public class CommonThirdFeignClientFallback implements CommonThirdFeignClient { + + @Override + public Result getDingMiniInfo(DingMiniInfoFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_THIRD_SERVER, "getDingMiniInfo", formDTO); + } +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java index 1ec2b60a01..0f06a94c4b 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java @@ -881,4 +881,8 @@ public class RedisKeys { public static String getSuiteTicketKey(String suiteKey) { return rootPrefix.concat("ding:suiteTicket:" + suiteKey); } + + public static String getDingMiniInfoKey(String suiteKey) { + return rootPrefix.concat("ding:miniInfo:" + suiteKey); + } } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerDingDingRedis.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerDingDingRedis.java new file mode 100644 index 0000000000..834fccad2c --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerDingDingRedis.java @@ -0,0 +1,58 @@ +package com.epmet.commons.tools.redis.common; + +import com.epmet.commons.tools.dto.form.DingMiniInfoFormDTO; +import com.epmet.commons.tools.exception.EpmetException; +import com.epmet.commons.tools.feign.CommonThirdFeignClient; +import com.epmet.commons.tools.redis.RedisKeys; +import com.epmet.commons.tools.redis.RedisUtils; +import com.epmet.commons.tools.redis.common.bean.DingMiniInfoCache; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.Result; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; +import org.springframework.util.CollectionUtils; + +import javax.annotation.PostConstruct; +import java.util.Map; + +/** + * @Author zxc + * @DateTime 2022/9/15 10:01 + * @DESC + */ +@Slf4j +@Component +public class CustomerDingDingRedis { + + @Autowired + private CommonThirdFeignClient thirdFeignClient; + @Autowired + private RedisUtils redisUtils; + + private static CustomerDingDingRedis customerDingDingRedis; + + @PostConstruct + public void init() { + customerDingDingRedis = this; + customerDingDingRedis.thirdFeignClient = this.thirdFeignClient; + customerDingDingRedis.redisUtils = this.redisUtils; + } + + public static DingMiniInfoCache getDingMiniInfo(String suiteKey){ + String key = RedisKeys.getDingMiniInfoKey(suiteKey); + Map miniInfoMap = customerDingDingRedis.redisUtils.hGetAll(key); + if (!CollectionUtils.isEmpty(miniInfoMap)){ + return ConvertUtils.mapToEntity(miniInfoMap,DingMiniInfoCache.class); + } + Result dingMiniInfoResult = customerDingDingRedis.thirdFeignClient.getDingMiniInfo(new DingMiniInfoFormDTO(suiteKey)); + if (!dingMiniInfoResult.success()){ + throw new EpmetException("查询dingMiniInfo失败..."); + } + if (null == dingMiniInfoResult.getData()){ + return null; + } + return dingMiniInfoResult.getData(); + } + +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/DingMiniInfoCache.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/DingMiniInfoCache.java new file mode 100644 index 0000000000..bd656c9a7e --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/DingMiniInfoCache.java @@ -0,0 +1,52 @@ +package com.epmet.commons.tools.redis.common.bean; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2022/9/15 10:11 + * @DESC + */ +@Data +public class DingMiniInfoCache implements Serializable { + + private static final long serialVersionUID = -6956910978074595334L; + + private String id; + + /** + * + */ + private String suiteId; + + /** + * + */ + private String appId; + + /** + * + */ + private String miniAppId; + + /** + * + */ + private String suiteName; + + /** + * + */ + private String suiteKey; + + /** + * + */ + private String suiteSecret; + + private String token; + + private String aesKey; +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/dingtalk/CallbackController.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/dingtalk/CallbackController.java index 89bcfb3dbd..8164c4cdbe 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/dingtalk/CallbackController.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/dingtalk/CallbackController.java @@ -4,6 +4,8 @@ import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.aliyun.dingtalk.util.DingCallbackCrypto; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.dto.form.DingMiniInfoFormDTO; +import com.epmet.commons.tools.redis.common.bean.DingMiniInfoCache; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dao.OpenSyncBizDataDao; @@ -138,4 +140,16 @@ public class CallbackController { ValidatorUtils.validateEntity(formDTO, ExemptLoginUserDetailFormDTO.ExemptLoginUserDetailForm.class); return new Result().ok(dingTalkService.getExemptLoginUserDetail(formDTO)); } + + /** + * Desc: 获取钉钉小程序信息 + * @param formDTO + * @author zxc + * @date 2022/9/15 10:46 + */ + @PostMapping("getDingMiniInfo") + public Result getDingMiniInfo(@RequestBody DingMiniInfoFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, DingMiniInfoFormDTO.DingMiniInfoForm.class); + return new Result().ok(dingTalkService.getDingMiniInfo(formDTO)); + } } diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/DingTalkService.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/DingTalkService.java index cc07a3d42c..ca0ba390f8 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/DingTalkService.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/DingTalkService.java @@ -1,5 +1,7 @@ package com.epmet.service; +import com.epmet.commons.tools.dto.form.DingMiniInfoFormDTO; +import com.epmet.commons.tools.redis.common.bean.DingMiniInfoCache; import com.epmet.dto.form.ExemptLoginUserDetailFormDTO; /** @@ -11,4 +13,12 @@ public interface DingTalkService { Object getExemptLoginUserDetail(ExemptLoginUserDetailFormDTO formDTO); + /** + * Desc: 获取钉钉小程序信息 + * @param formDTO + * @author zxc + * @date 2022/9/15 10:46 + */ + DingMiniInfoCache getDingMiniInfo(DingMiniInfoFormDTO formDTO); + } diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/DingTalkServiceImpl.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/DingTalkServiceImpl.java index 851e2af1b3..c4bc751903 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/DingTalkServiceImpl.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/DingTalkServiceImpl.java @@ -1,5 +1,6 @@ package com.epmet.service.impl; +import cn.hutool.core.bean.BeanUtil; import com.alibaba.fastjson.JSON; import com.aliyun.dingtalk.module.Result; import com.dingtalk.api.DefaultDingTalkClient; @@ -8,7 +9,12 @@ import com.dingtalk.api.request.OapiV2UserGetRequest; import com.dingtalk.api.request.OapiV2UserGetuserinfoRequest; import com.dingtalk.api.response.OapiV2UserGetResponse; import com.dingtalk.api.response.OapiV2UserGetuserinfoResponse; +import com.epmet.commons.tools.dto.form.DingMiniInfoFormDTO; import com.epmet.commons.tools.exception.EpmetException; +import com.epmet.commons.tools.redis.RedisKeys; +import com.epmet.commons.tools.redis.RedisUtils; +import com.epmet.commons.tools.redis.common.bean.DingMiniInfoCache; +import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.dao.OpenSyncBizDataDao; import com.epmet.dto.DingMiniInfoDTO; import com.epmet.dto.form.ExemptLoginUserDetailFormDTO; @@ -20,6 +26,7 @@ import com.taobao.dingtalk.vo.result.AccessTokenResult; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; import java.util.Map; @@ -38,6 +45,8 @@ public class DingTalkServiceImpl implements DingTalkService { private OpenSyncBizDataDao openSyncBizDataDao; @Autowired private DingDingCallbackRedis dingCallbackRedis; + @Autowired + private RedisUtils redisUtils; @Override public Object getExemptLoginUserDetail(ExemptLoginUserDetailFormDTO formDTO) { @@ -75,4 +84,26 @@ public class DingTalkServiceImpl implements DingTalkService { } return o; } + + /** + * Desc: 获取钉钉小程序信息 + * @param formDTO + * @author zxc + * @date 2022/9/15 10:46 + */ + @Override + public DingMiniInfoCache getDingMiniInfo(DingMiniInfoFormDTO formDTO) { + String key = RedisKeys.getDingMiniInfoKey(formDTO.getSuiteKey()); + Map dingMiniInfoMap = redisUtils.hGetAll(key); + if (!CollectionUtils.isEmpty(dingMiniInfoMap)) { + DingMiniInfoCache dingMiniInfoCache = ConvertUtils.mapToEntity(dingMiniInfoMap,DingMiniInfoCache.class); + return dingMiniInfoCache; + } + DingMiniInfoDTO dingMiniInfo = openSyncBizDataDao.getDingMiniInfo(formDTO.getSuiteKey()); + if (null != dingMiniInfo){ + redisUtils.hMSet(key, BeanUtil.beanToMap(dingMiniInfo)); + return ConvertUtils.sourceToTarget(dingMiniInfo,DingMiniInfoCache.class); + } + return null; + } } From 814fdf6b3b6b69453d25bae0f545ee94748398a1 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Thu, 15 Sep 2022 11:06:19 +0800 Subject: [PATCH 035/147] emm --- .../java/com/epmet/service/impl/DingTalkServiceImpl.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/DingTalkServiceImpl.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/DingTalkServiceImpl.java index c4bc751903..8d4fc03612 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/DingTalkServiceImpl.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/DingTalkServiceImpl.java @@ -51,12 +51,11 @@ public class DingTalkServiceImpl implements DingTalkService { @Override public Object getExemptLoginUserDetail(ExemptLoginUserDetailFormDTO formDTO) { DingMiniInfoDTO dingMiniInfo = openSyncBizDataDao.getDingMiniInfoByAppId(formDTO.getMiniAppId()); - - Result isvAccessTokenToken = dingTalkClientToken.getIsvAccessTokenToken(formDTO.getCorpId(), dingMiniInfo.getSuiteKey(), dingMiniInfo.getSuiteSecret(), dingCallbackRedis.get(dingMiniInfo.getSuiteKey())); - if (!isvAccessTokenToken.success()){ + Result isvAccessToken = dingTalkClientToken.getIsvAccessToken(formDTO.getCorpId(), dingMiniInfo.getSuiteKey(), dingMiniInfo.getSuiteSecret(), dingCallbackRedis.get(dingMiniInfo.getSuiteKey())); + if (!isvAccessToken.success()){ throw new EpmetException("获取accessToken失败..."); } - String accessToken = isvAccessTokenToken.getData().getAccessToken(); + String accessToken = isvAccessToken.getData().getAccessToken(); DingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.com/topapi/v2/user/getuserinfo"); OapiV2UserGetuserinfoRequest req = new OapiV2UserGetuserinfoRequest(); req.setCode(formDTO.getCode()); From 309d3085c4451cfb7bab2b63533fd0538eb34e04 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 15 Sep 2022 13:08:45 +0800 Subject: [PATCH 036/147] resiLoginDingTemp --- .../controller/ThirdLoginController.java | 2 +- .../com/epmet/service/ThirdLoginService.java | 1 + .../service/impl/ThirdLoginServiceImpl.java | 52 +++++++++++++++++++ 3 files changed, 54 insertions(+), 1 deletion(-) 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 917b29de53..291652e5c1 100644 --- a/epmet-auth/src/main/java/com/epmet/controller/ThirdLoginController.java +++ b/epmet-auth/src/main/java/com/epmet/controller/ThirdLoginController.java @@ -132,7 +132,7 @@ public class ThirdLoginController { @PostMapping("resilogin-ding") public Result resiLoginDing(@RequestBody ResiDingAppLoginFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO); - return new Result().ok(thirdLoginService.resiLoginDing(formDTO)); + return new Result().ok(thirdLoginService.resiLoginDingTemp(formDTO)); } } 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 9232fec5e6..731f350386 100644 --- a/epmet-auth/src/main/java/com/epmet/service/ThirdLoginService.java +++ b/epmet-auth/src/main/java/com/epmet/service/ThirdLoginService.java @@ -74,4 +74,5 @@ public interface ThirdLoginService { * @return */ ResiDingAppLoginResDTO resiLoginDing(ResiDingAppLoginFormDTO formDTO); + ResiDingAppLoginResDTO resiLoginDingTemp(ResiDingAppLoginFormDTO formDTO); } 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 13eac20dca..0279007e46 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 @@ -788,4 +788,56 @@ public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResol return token; } + + @Override + public ResiDingAppLoginResDTO resiLoginDingTemp(ResiDingAppLoginFormDTO formDTO) { + //获取用户手机号 + log.info("钉钉居民端应用登录入参:"+ JSON.toJSONString(formDTO)); + ResiDingAppLoginResDTO resDTO= null; + try { + resDTO = new ResiDingAppLoginResDTO(); + EnvEnum currentEnv = EnvEnum.getCurrentEnv(); + if (EnvEnum.PROD.getCode().equals(currentEnv.getCode())) { + //烟台的客户id + resDTO.setCustomerId("1535072605621841922"); + }else if(EnvEnum.TEST.getCode().equals(currentEnv.getCode())){ + //最美琴岛 + resDTO.setCustomerId("0c41b272ee9ee95ac6f184ad548a30eb"); + resDTO.setGridId("f896b59f3cddf1f54280546d79803652"); + resDTO.setGridName("抚顺社区-抚顺第一网格"); + resDTO.setAgencyId("f6e183d8e6687020074e6d8061926bfa"); + resDTO.setEpmetUserId("f838614e67cf8ae0edaefe562b6660e5"); + resDTO.setRegFlag(true); + }else if(EnvEnum.LOCAL.getCode().equals(currentEnv.getCode())||EnvEnum.DEV.getCode().equals(currentEnv.getCode())){ + //其余统一走开发环境 + resDTO.setCustomerId("45687aa479955f9d06204d415238f7cc"); + resDTO.setGridId("763d6e09b9081d63195d53da84b3ae3a"); + resDTO.setGridName("抚顺社区-抚顺第二网格"); + resDTO.setAgencyId("f6e183d8e6687020074e6d8061926bfa"); + resDTO.setEpmetUserId("f838614e67cf8ae0edaefe562b6660e5"); + resDTO.setRegFlag(true); + } + + //1、获取用户手机号 + String clientId = formDTO.getClientId(); + com.aliyun.dingtalk.module.Result userAccessToken = dingTalkClientToken.getUserAccessToken(formDTO.getAuthCode(), clientId, DingMiniAppEnum.getEnum(clientId).getSuiteSecret()); + log.info("resiLoginDing userAccessToken:{}",JSON.toJSONString(userAccessToken)); + if (!userAccessToken.success() || null == userAccessToken.getData()) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "调用微信api异常:" + JSON.toJSONString(userAccessToken), EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getMsg()); + } + com.aliyun.dingtalk.module.Result me = dingTalkClientUser.getUserInfo("me", userAccessToken.getData().getAccessToken()); + log.info("resiLoginDing me:{}",JSON.toJSONString(me)); + resDTO.setExtInfo(JSON.toJSONString(me.getData())); + + // 2、调用userfeign接口获取userId、注册网格相关信息 todo + + //3.生成token,并且存放Redis + String token=this.saveTokenDtoDing(AppClientConstant.APP_RESI,AppClientConstant.MINI_DING, resDTO.getEpmetUserId(), resDTO.getCustomerId()); + resDTO.setAuthorization(token); + + } catch (ApiException e) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), e.getErrMsg(), EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getMsg()); + } + return resDTO; + } } From 9df9ef89db3f2d30e414f4f49d33c8c7599f699d Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Thu, 15 Sep 2022 13:49:11 +0800 Subject: [PATCH 037/147] =?UTF-8?q?=E6=B3=A8=E5=86=8C=E7=94=A8=E6=88=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/constant/UserConstant.java | 5 ++ .../epmet/service/UserBaseInfoService.java | 15 +++- .../service/impl/UserBaseInfoServiceImpl.java | 73 ++++++++++++++++++- 3 files changed, 88 insertions(+), 5 deletions(-) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/constant/UserConstant.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/constant/UserConstant.java index b9b1c5c87d..e3e279563e 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/constant/UserConstant.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/constant/UserConstant.java @@ -38,6 +38,11 @@ public interface UserConstant { */ String CLIENT_WX = "wxmp"; + /** + * 钉钉端 + */ + String CLIENT_DING = "dingding"; + /** * 居民角色 */ diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserBaseInfoService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserBaseInfoService.java index f66453c243..ccd55f362c 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserBaseInfoService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserBaseInfoService.java @@ -24,11 +24,9 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.dto.RegisterRelationDTO; import com.epmet.dto.UserBaseInfoDTO; import com.epmet.dto.form.CommonUserIdFormDTO; +import com.epmet.dto.form.DingLoginResiFormDTO; import com.epmet.dto.form.VolunteerRegResiFormDTO; -import com.epmet.dto.result.CustomerUserDetailResultDTO; -import com.epmet.dto.result.ExtUserInfoResultDTO; -import com.epmet.dto.result.ResiUserBaseInfoResultDTO; -import com.epmet.dto.result.UserBaseInfoResultDTO; +import com.epmet.dto.result.*; import com.epmet.entity.UserBaseInfoEntity; import java.util.List; @@ -213,4 +211,13 @@ public interface UserBaseInfoService extends BaseService { * @Date 2022/6/15 16:09 */ ResiUserInfoCache getUserInfo(String userId); + + /** + * 钉钉用户注册 + * @Param formDTO + * @Return {@link DingLoginResiResDTO} + * @Author zhaoqifeng + * @Date 2022/9/15 11:17 + */ + DingLoginResiResDTO dingResiLogin(DingLoginResiFormDTO formDTO); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBaseInfoServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBaseInfoServiceImpl.java index 56a5f56400..b28d03b9f0 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBaseInfoServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBaseInfoServiceImpl.java @@ -18,28 +18,37 @@ package com.epmet.service.impl; import com.alibaba.fastjson.JSON; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.AppClientConstant; import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.NumConstant; -import com.epmet.commons.tools.constant.StrConstant; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.redis.common.CustomerOrgRedis; +import com.epmet.commons.tools.redis.common.bean.GridInfoCache; import com.epmet.commons.tools.redis.common.bean.ResiUserInfoCache; import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.NameUtils; import com.epmet.commons.tools.utils.Result; +import com.epmet.constant.UserConstant; import com.epmet.dao.*; import com.epmet.dto.RegisterRelationDTO; import com.epmet.dto.UserBaseInfoDTO; import com.epmet.dto.UserResiInfoDTO; import com.epmet.dto.UserWechatDTO; import com.epmet.dto.form.CommonUserIdFormDTO; +import com.epmet.dto.form.DingLoginResiFormDTO; import com.epmet.dto.form.UserRoleFormDTO; import com.epmet.dto.form.VolunteerRegResiFormDTO; import com.epmet.dto.result.*; +import com.epmet.entity.RegisterRelationEntity; import com.epmet.entity.UserBaseInfoEntity; +import com.epmet.entity.UserEntity; import com.epmet.entity.UserWechatEntity; import com.epmet.feign.GovOrgOpenFeignClient; import com.epmet.redis.UserBaseInfoRedis; @@ -57,6 +66,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; +import javax.annotation.Resource; import java.util.*; /** @@ -90,6 +100,8 @@ public class UserBaseInfoServiceImpl extends BaseServiceImpl page(Map params) { @@ -519,4 +531,63 @@ public class UserBaseInfoServiceImpl extends BaseServiceImpl wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(UserBaseInfoEntity::getCustomerId, formDTO.getCustomerId()); + wrapper.eq(UserBaseInfoEntity::getMobile, formDTO.getMobile()); + UserBaseInfoEntity baseInfo = baseDao.selectOne(wrapper); + if (null == baseInfo) { + //注册 + UserEntity userEntity = new UserEntity(); + userEntity.setFromApp(UserConstant.APP_RESI); + userEntity.setFromClient(UserConstant.CLIENT_DING); + userEntity.setCustomerId(formDTO.getCustomerId()); + userDao.insert(userEntity); + //信息存入baseinfo + baseInfo = new UserBaseInfoEntity(); + baseInfo.setCustomerId(formDTO.getCustomerId()); + baseInfo.setUserId(userEntity.getId()); + baseInfo.setMobile(formDTO.getMobile()); + baseInfo.setRealName(formDTO.getNick()); + baseInfo.setSurname(NameUtils.getSurNameComplex(formDTO.getNick())); + baseInfo.setName(NameUtils.getNameComplex(formDTO.getNick())); + baseInfo.setNickname(formDTO.getNick()); + baseInfo.setHeadImgUrl(formDTO.getAvatarUrl()); + baseDao.insert(baseInfo); + + result.setEpmetUserId(userEntity.getId()); + } else { + result.setEpmetUserId(baseInfo.getUserId()); + LambdaQueryWrapper registerWrapper = new LambdaQueryWrapper<>(); + registerWrapper.eq(RegisterRelationEntity::getCustomerId, formDTO.getCustomerId()); + registerWrapper.eq(RegisterRelationEntity::getUserId, baseInfo.getUserId()); + registerWrapper.eq(RegisterRelationEntity::getFirstRegister, NumConstant.ONE_STR); + RegisterRelationEntity registerRelation = registerRelationDao.selectOne(registerWrapper); + if (null != registerRelation) { + result.setAgencyId(registerRelation.getAgencyId()); + result.setGridId(registerRelation.getGridId()); + GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(registerRelation.getGridId()); + if (null == gridInfo) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取网格信息失败", "获取网格信息失败"); + } + result.setGridName(gridInfo.getGridNamePath()); + } + } + return result; + } } From 6b368520b6a7715d42417267a358e9c1908549e0 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Thu, 15 Sep 2022 13:51:59 +0800 Subject: [PATCH 038/147] =?UTF-8?q?=E6=B3=A8=E5=86=8C=E7=94=A8=E6=88=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/controller/UserBaseInfoController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserBaseInfoController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserBaseInfoController.java index 8492a5efea..86e0012ac4 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserBaseInfoController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserBaseInfoController.java @@ -236,7 +236,7 @@ public class UserBaseInfoController { */ @PostMapping("dingResiLogin") public Result dingResiLogin(@RequestBody DingLoginResiFormDTO formDTO){ - // todo + userBaseInfoService.dingResiLogin(formDTO); return new Result<>(); } } From 1e7ca19715c16dc963e2c1eb4bea11321a206631 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Thu, 15 Sep 2022 13:52:31 +0800 Subject: [PATCH 039/147] jiaoben --- .../db/migration/V0.0.14__add_ding_table.sql | 68 +++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 epmet-module/epmet-third/epmet-third-server/src/main/resources/db/migration/V0.0.14__add_ding_table.sql diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/resources/db/migration/V0.0.14__add_ding_table.sql b/epmet-module/epmet-third/epmet-third-server/src/main/resources/db/migration/V0.0.14__add_ding_table.sql new file mode 100644 index 0000000000..83e8ae7995 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/resources/db/migration/V0.0.14__add_ding_table.sql @@ -0,0 +1,68 @@ +CREATE TABLE `ding_mini_info` +( + `ID` varchar(64) NOT NULL COMMENT 'ID', + `SUITE_ID` varchar(255) NOT NULL, + `APP_ID` varchar(255) NOT NULL, + `MINI_APP_ID` varchar(255) NOT NULL, + `SUITE_NAME` varchar(255) NOT NULL, + `SUITE_KEY` varchar(255) NOT NULL, + `SUITE_SECRET` varchar(255) NOT NULL, + `TOKEN` varchar(255) NOT NULL, + `AES_KEY` varchar(255) DEFAULT NULL, + `DEL_FLAG` int(11) NOT NULL, + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) +) ENGINE = InnoDB + DEFAULT CHARSET = utf8mb4 COMMENT ='钉钉小程序信息'; + +INSERT INTO `ding_mini_info` (`ID`, `SUITE_ID`, `APP_ID`, `MINI_APP_ID`, `SUITE_NAME`, `SUITE_KEY`, `SUITE_SECRET`, + `TOKEN`, `AES_KEY`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, + `UPDATED_TIME`) +VALUES ('27805834197073948', '27501006', '119450', '5000000002934668', '随手拍', 'suitew6ccvkquinmrghqy', + 'TooAxiegdsE5BPP6xo1AxK1LdmaUoMpPMyomOcGcBSXtnsxRc8dEfyOlG56oSmEB', 'qN6Mg1XljdeHzVg2KeZGmBgY5', + 'CzBxlN3uVCo6S3AzB8gfkUMBQxYsrRUdXRqX4XcYcyw', 0, 0, 'APP_USER', '2022-09-14 11:09:15', 'APP_USER', + '2022-09-14 11:09:15'); +INSERT INTO `ding_mini_info` (`ID`, `SUITE_ID`, `APP_ID`, `MINI_APP_ID`, `SUITE_NAME`, `SUITE_KEY`, `SUITE_SECRET`, + `TOKEN`, `AES_KEY`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, + `UPDATED_TIME`) +VALUES ('27805834197073949', '27501007', '119451', '5000000002934374', '随时讲', 'suitezhyj12glsrp8em0f', + '-z5Q_lvMP6l7fTzlArEzUT8D_-5pvqBQaJMuTGHoXnz0nuiqGQMZ8aeya_cxTsN-', 'rKs2lIN1Oe6K34AtASGOQDh', + 'a7hsIIHVTiIB7SQwOiGNgxVo7zAigGUk4InTUNIikWy', 0, 0, 'APP_USER', '2022-09-14 11:11:13', 'APP_USER', + '2022-09-14 11:11:13'); +INSERT INTO `ding_mini_info` (`ID`, `SUITE_ID`, `APP_ID`, `MINI_APP_ID`, `SUITE_NAME`, `SUITE_KEY`, `SUITE_SECRET`, + `TOKEN`, `AES_KEY`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, + `UPDATED_TIME`) +VALUES ('27805834197073950', '27501008', '119452', '5000000002934456', '我的报事', 'suite5yxliro6wawv514w', + 'aQxiPi7DwJSUa9HlbUU_L7Q4wGCLEDmgf__Ffx75cTn3jZwuHy9vdl-9Iv5FeyJU', 'vTUvaf6QtOJZsa1h7Wkoteo', + 'csRpvVFGL7Cf1N9ubajix8tDWhCllROhaxCHKFnbuAz', 0, 0, 'APP_USER', '2022-09-14 11:11:13', 'APP_USER', + '2022-09-14 11:11:13'); +INSERT INTO `ding_mini_info` (`ID`, `SUITE_ID`, `APP_ID`, `MINI_APP_ID`, `SUITE_NAME`, `SUITE_KEY`, `SUITE_SECRET`, + `TOKEN`, `AES_KEY`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, + `UPDATED_TIME`) +VALUES ('27805834197073951', '27501009', '119453', '5000000002934488', '实时动态', 'suitemcestnonr6y0xigc', + 'kKCNCkfDhmLoVnl_wuAiScyDG4776mkTevuSBuiYhHg-Bvz1-vhb_4IA-Km7nK2I', 'MvWLkZGbC', + 'iSVLw69AeNXS8jgGefTG2ulkKWDQjcSsMBgkFMgfPuB', 0, 0, 'APP_USER', '2022-09-14 11:11:13', 'APP_USER', + '2022-09-14 11:11:13'); + +CREATE TABLE `open_sync_biz_data` +( + `ID` varchar(255) NOT NULL, + `SUITE_KEY` varchar(255) DEFAULT NULL, + `SUBSCRIBE_ID` varchar(255) NOT NULL COMMENT '第三方企业应用的suiteid加下划线0', + `CORP_ID` varchar(255) NOT NULL COMMENT '第三方企业应用的corpid', + `BIZ_ID` varchar(255) NOT NULL COMMENT '第三方企业应用的suiteid', + `BIZ_DATA` json NOT NULL COMMENT '数据为Json格式', + `BIZ_TYPE` varchar(10) NOT NULL COMMENT '2:第三方企业应用票据;\n4:企业授权变更,包含授权、解除授权、授权变更;\n7:第三方企业应用变更,包含停用、启用、删除(删除保留授权);\n13:企业用户变更,包含用户添加、修改、删除;\n14:企业部门变更,包含部门添加、修改、删除;\n15:企业角色变更,包含角色添加、修改、删除;\n16:企业变更,包含企业修改、删除;\n17:市场订单;\n20:企业外部联系人变更,包含添加、修改、删除;\n22:ISV自定义审批;\n25:家校通讯录1.0(Deprecated)信息变更。家校通讯录升级,请查看家校通讯录2.0数据推送;\n32:智能硬件绑定类型;\n37:因订单到期或者用户退款等导致的服务关闭,目前仅推送因退款等导致的服务关闭;\n50:家校通讯录2.0,部门信息变更;\n51:家校通讯录2.0,人员信息变更;\n63:应用试用记录回调信息;\n66:工作台组件变更回调事件;\n67:钉钉假期相关回调事件;\n133:CRM客户动态相关数据回调事件;\n137:人事平台员工异动V2相关数据回调事件;\n139:异步转译通讯录id任务完成通知;\n165:人事平台员工档案变动事件相关数据的回调事件;\n175:人事解决方案变更事件;', + `DEL_FLAG` int(1) NOT NULL, + `REVISION` int(1) NOT NULL, + `CREATED_TIME` datetime NOT NULL, + `CREATED_BY` varchar(255) NOT NULL, + `UPDATED_TIME` datetime NOT NULL, + `UPDATED_BY` varchar(255) NOT NULL, + PRIMARY KEY (`ID`) USING BTREE +) ENGINE = InnoDB + DEFAULT CHARSET = utf8mb4; \ No newline at end of file From ea8b89c019faa3375a30f845030565c3cd962382 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 15 Sep 2022 14:09:14 +0800 Subject: [PATCH 040/147] =?UTF-8?q?=E5=AE=8C=E6=95=B4=E7=9A=84=E7=99=BB?= =?UTF-8?q?=E9=99=86=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/controller/ThirdLoginController.java | 2 +- .../epmet/service/impl/ThirdLoginServiceImpl.java | 3 +++ .../main/java/com/epmet/constant/UserConstant.java | 4 ---- .../epmet/service/impl/UserBaseInfoServiceImpl.java | 12 +++++++++--- 4 files changed, 13 insertions(+), 8 deletions(-) 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 291652e5c1..917b29de53 100644 --- a/epmet-auth/src/main/java/com/epmet/controller/ThirdLoginController.java +++ b/epmet-auth/src/main/java/com/epmet/controller/ThirdLoginController.java @@ -132,7 +132,7 @@ public class ThirdLoginController { @PostMapping("resilogin-ding") public Result resiLoginDing(@RequestBody ResiDingAppLoginFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO); - return new Result().ok(thirdLoginService.resiLoginDingTemp(formDTO)); + return new Result().ok(thirdLoginService.resiLoginDing(formDTO)); } } 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 0279007e46..3abdb1b265 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 @@ -727,6 +727,9 @@ public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResol if (EnvEnum.PROD.getCode().equals(currentEnv.getCode())) { //烟台的客户id resDTO.setCustomerId("1535072605621841922"); + }else if(EnvEnum.TEST.getCode().equals(currentEnv.getCode())){ + //最美琴岛 + resDTO.setCustomerId("0c41b272ee9ee95ac6f184ad548a30eb"); }else{ //其余统一走开发环境 resDTO.setCustomerId("45687aa479955f9d06204d415238f7cc"); diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/constant/UserConstant.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/constant/UserConstant.java index e3e279563e..a51390f16f 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/constant/UserConstant.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/constant/UserConstant.java @@ -38,10 +38,6 @@ public interface UserConstant { */ String CLIENT_WX = "wxmp"; - /** - * 钉钉端 - */ - String CLIENT_DING = "dingding"; /** * 居民角色 diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBaseInfoServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBaseInfoServiceImpl.java index b28d03b9f0..605437fa0e 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBaseInfoServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBaseInfoServiceImpl.java @@ -25,6 +25,7 @@ import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.AppClientConstant; import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.exception.RenException; @@ -35,7 +36,6 @@ import com.epmet.commons.tools.redis.common.bean.ResiUserInfoCache; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.NameUtils; import com.epmet.commons.tools.utils.Result; -import com.epmet.constant.UserConstant; import com.epmet.dao.*; import com.epmet.dto.RegisterRelationDTO; import com.epmet.dto.UserBaseInfoDTO; @@ -546,6 +546,10 @@ public class UserBaseInfoServiceImpl extends BaseServiceImpl wrapper = new LambdaQueryWrapper<>(); wrapper.eq(UserBaseInfoEntity::getCustomerId, formDTO.getCustomerId()); @@ -554,8 +558,8 @@ public class UserBaseInfoServiceImpl extends BaseServiceImpl registerWrapper = new LambdaQueryWrapper<>(); @@ -586,6 +591,7 @@ public class UserBaseInfoServiceImpl extends BaseServiceImpl Date: Thu, 15 Sep 2022 14:57:26 +0800 Subject: [PATCH 041/147] =?UTF-8?q?=E8=87=AA=E5=8A=A8=E6=B3=A8=E5=86=8C?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/dto/result/DingAutoRegResDTO.java | 27 +++++++++++++++++ .../controller/UserResiInfoController.java | 6 ++-- .../epmet/service/UserResiInfoService.java | 3 +- .../service/impl/UserResiInfoServiceImpl.java | 29 +++++++++++++++++-- 4 files changed, 59 insertions(+), 6 deletions(-) create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/DingAutoRegResDTO.java diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/DingAutoRegResDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/DingAutoRegResDTO.java new file mode 100644 index 0000000000..dd1be77a56 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/DingAutoRegResDTO.java @@ -0,0 +1,27 @@ +package com.epmet.dto.result; + +import lombok.Data; + +/** + * @Description + * @Author yzm + * @Date 2022/9/15 14:31 + */ +@Data +public class DingAutoRegResDTO { + private String customerId; + private String gridId; + /** + * 网格名 + */ + private String gridName; + /** + * 网格所属的组织id + */ + private String agencyId; + /** + * 居民端用户id + */ + private String epmetUserId; +} + diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserResiInfoController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserResiInfoController.java index 84ab9375cb..de6daad253 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserResiInfoController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserResiInfoController.java @@ -29,6 +29,7 @@ import com.epmet.commons.tools.validator.group.DefaultGroup; import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.dto.UserResiInfoDTO; import com.epmet.dto.form.*; +import com.epmet.dto.result.DingAutoRegResDTO; import com.epmet.dto.result.IssueInitiatorResultDTO; import com.epmet.dto.result.StaffAndResiResultDTO; import com.epmet.dto.result.UserResiInfoResultDTO; @@ -253,12 +254,11 @@ public class UserResiInfoController { * @Date 2022/9/14 15:34 */ @PostMapping("autoreguser-ding") - public Result autoRegister(@LoginUser TokenDto tokenDto, @RequestBody UserResiInfoDTO userResiInfoDTO) { + public Result autoRegister(@LoginUser TokenDto tokenDto, @RequestBody UserResiInfoDTO userResiInfoDTO) { userResiInfoDTO.setCustomerId(tokenDto.getCustomerId()); userResiInfoDTO.setUserId(tokenDto.getUserId()); userResiInfoDTO.setApp(tokenDto.getApp()); - userResiInfoService.autoRegister(userResiInfoDTO); - return new Result(); + return new Result().ok( userResiInfoService.autoRegister(userResiInfoDTO)); } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserResiInfoService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserResiInfoService.java index f3b10414f7..d29db102e1 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserResiInfoService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserResiInfoService.java @@ -22,6 +22,7 @@ import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.UserResiInfoDTO; import com.epmet.dto.form.*; +import com.epmet.dto.result.DingAutoRegResDTO; import com.epmet.dto.result.IssueInitiatorResultDTO; import com.epmet.dto.result.StaffAndResiResultDTO; import com.epmet.dto.result.UserResiInfoResultDTO; @@ -221,6 +222,6 @@ public interface UserResiInfoService extends BaseService { * @Author zhaoqifeng * @Date 2022/9/14 14:19 */ - void autoRegister(UserResiInfoDTO userResiInfoDTO); + DingAutoRegResDTO autoRegister(UserResiInfoDTO userResiInfoDTO); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserResiInfoServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserResiInfoServiceImpl.java index 96b602f187..d249a5008a 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserResiInfoServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserResiInfoServiceImpl.java @@ -109,6 +109,8 @@ public class UserResiInfoServiceImpl extends BaseServiceImpl page(Map params) { @@ -565,7 +567,10 @@ public class UserResiInfoServiceImpl extends BaseServiceImpl registerWrapper = new LambdaQueryWrapper<>(); + registerWrapper.eq(RegisterRelationEntity::getCustomerId, userResiInfoDTO.getCustomerId()); + registerWrapper.eq(RegisterRelationEntity::getUserId, userResiInfoDTO.getUserId()); + registerWrapper.eq(RegisterRelationEntity::getFirstRegister, NumConstant.ONE_STR); + RegisterRelationEntity registerRelation = registerRelationDao.selectOne(registerWrapper); + if (null != registerRelation) { + resDTO.setGridId(registerRelation.getGridId()); + GridInfoCache regGridInfo = CustomerOrgRedis.getGridInfo(registerRelation.getGridId()); + if (null == regGridInfo) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取注册网格信息失败", "获取注册网格信息失败"); + } + resDTO.setGridName(regGridInfo.getGridName()); + resDTO.setAgencyId(regGridInfo.getPid()); + } } //6:记录用户访问的网格grid_latest LambdaQueryWrapper latestWrapper = new LambdaQueryWrapper<>(); @@ -637,6 +661,7 @@ public class UserResiInfoServiceImpl extends BaseServiceImpl Date: Thu, 15 Sep 2022 16:24:38 +0800 Subject: [PATCH 042/147] =?UTF-8?q?=E5=BF=98=E4=BA=86=E8=BF=94=E5=9B=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/controller/UserBaseInfoController.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserBaseInfoController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserBaseInfoController.java index 86e0012ac4..edd488e9e4 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserBaseInfoController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserBaseInfoController.java @@ -236,8 +236,7 @@ public class UserBaseInfoController { */ @PostMapping("dingResiLogin") public Result dingResiLogin(@RequestBody DingLoginResiFormDTO formDTO){ - userBaseInfoService.dingResiLogin(formDTO); - return new Result<>(); + return new Result().ok(userBaseInfoService.dingResiLogin(formDTO)); } } From 6594e67d486b28d07d592edfa6960292456ff2df Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Fri, 16 Sep 2022 09:32:18 +0800 Subject: [PATCH 043/147] try --- .../java/com/epmet/controller/IcResiUserController.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java index c25d1ff604..fb6a0c9f69 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java @@ -584,9 +584,9 @@ public class IcResiUserController implements ResultDataResolver { @RequestMapping(value = "/exportExcelCustomData") public Map exportExcelCustomData(@LoginUser TokenDto tokenDto, @RequestParam("templateId") String templateId, @RequestBody ExportResiUserFormDTO pageFormDTO) throws Exception { - log.warn("templateId=【"+templateId+"】"); log.warn("pageFormDTO入参【"+JSON.toJSONString(pageFormDTO)+"】"); - pageFormDTO.setTemplateId(templateId); + // pageFormDTO.setTemplateId(templateId); + pageFormDTO.setTemplateId(tokenDto.getCustomerId().concat("_").concat(templateId)); if (null == pageFormDTO.getSearchForm()) { IcResiUserPageFormDTO searchForm = new IcResiUserPageFormDTO(); searchForm.setFormCode("resi_base_info"); @@ -613,7 +613,8 @@ public class IcResiUserController implements ResultDataResolver { pageFormDTO.setExportConfig(exportTemplateSaveFormDTO); } //固定通用客户Id - pageFormDTO.setCustomerId("jmreport_resi_default"); + // pageFormDTO.setCustomerId("jmreport_resi_default"); + pageFormDTO.setCustomerId(tokenDto.getCustomerId()); Page> maps = icResiUserExportService.exportIcResiUser(tokenDto, pageFormDTO, null, true); Map result = new HashMap<>(); result.put("total",maps.getPages()); From a0c30c341c45c8ce3b87b156381c6691a7d3626f Mon Sep 17 00:00:00 2001 From: jianjun Date: Fri, 16 Sep 2022 10:13:05 +0800 Subject: [PATCH 044/147] =?UTF-8?q?result=E6=9B=B4=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/service/impl/ThirdLoginServiceImpl.java | 9 +++++---- .../java/com/epmet/service/impl/DingTalkServiceImpl.java | 4 ++-- .../src/main/test/java/com/epmet/ThirdPlatformTest.java | 4 ++-- 3 files changed, 9 insertions(+), 8 deletions(-) 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 3abdb1b265..2c1bb6a8a8 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 @@ -5,6 +5,7 @@ import cn.binarywang.wx.miniapp.bean.WxMaPhoneNumberInfo; import cn.binarywang.wx.miniapp.util.crypt.WxMaCryptUtils; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; +import com.aliyun.dingtalk.module.DingTalkResult; import com.epmet.auth.constants.AuthOperationConstants; import com.epmet.common.token.constant.LoginConstant; import com.epmet.commons.rocketmq.messages.LoginMQMsg; @@ -737,12 +738,12 @@ public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResol //1、获取用户手机号 String clientId = formDTO.getClientId(); - com.aliyun.dingtalk.module.Result userAccessToken = dingTalkClientToken.getUserAccessToken(formDTO.getAuthCode(), clientId, DingMiniAppEnum.getEnum(clientId).getSuiteSecret()); + DingTalkResult userAccessToken = dingTalkClientToken.getUserAccessToken(formDTO.getAuthCode(), clientId, DingMiniAppEnum.getEnum(clientId).getSuiteSecret()); log.info("resiLoginDing userAccessToken:{}",JSON.toJSONString(userAccessToken)); if (!userAccessToken.success() || null == userAccessToken.getData()) { throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "调用微信api异常:" + JSON.toJSONString(userAccessToken), EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getMsg()); } - com.aliyun.dingtalk.module.Result me = dingTalkClientUser.getUserInfo("me", userAccessToken.getData().getAccessToken()); + DingTalkResult me = dingTalkClientUser.getUserInfo("me", userAccessToken.getData().getAccessToken()); log.info("resiLoginDing me:{}",JSON.toJSONString(me)); resDTO.setExtInfo(JSON.toJSONString(me.getData())); @@ -823,12 +824,12 @@ public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResol //1、获取用户手机号 String clientId = formDTO.getClientId(); - com.aliyun.dingtalk.module.Result userAccessToken = dingTalkClientToken.getUserAccessToken(formDTO.getAuthCode(), clientId, DingMiniAppEnum.getEnum(clientId).getSuiteSecret()); + DingTalkResult userAccessToken = dingTalkClientToken.getUserAccessToken(formDTO.getAuthCode(), clientId, DingMiniAppEnum.getEnum(clientId).getSuiteSecret()); log.info("resiLoginDing userAccessToken:{}",JSON.toJSONString(userAccessToken)); if (!userAccessToken.success() || null == userAccessToken.getData()) { throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "调用微信api异常:" + JSON.toJSONString(userAccessToken), EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getMsg()); } - com.aliyun.dingtalk.module.Result me = dingTalkClientUser.getUserInfo("me", userAccessToken.getData().getAccessToken()); + DingTalkResult me = dingTalkClientUser.getUserInfo("me", userAccessToken.getData().getAccessToken()); log.info("resiLoginDing me:{}",JSON.toJSONString(me)); resDTO.setExtInfo(JSON.toJSONString(me.getData())); diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/DingTalkServiceImpl.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/DingTalkServiceImpl.java index 8d4fc03612..5b0470a338 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/DingTalkServiceImpl.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/DingTalkServiceImpl.java @@ -2,7 +2,7 @@ package com.epmet.service.impl; import cn.hutool.core.bean.BeanUtil; import com.alibaba.fastjson.JSON; -import com.aliyun.dingtalk.module.Result; +import com.aliyun.dingtalk.module.DingTalkResult; import com.dingtalk.api.DefaultDingTalkClient; import com.dingtalk.api.DingTalkClient; import com.dingtalk.api.request.OapiV2UserGetRequest; @@ -51,7 +51,7 @@ public class DingTalkServiceImpl implements DingTalkService { @Override public Object getExemptLoginUserDetail(ExemptLoginUserDetailFormDTO formDTO) { DingMiniInfoDTO dingMiniInfo = openSyncBizDataDao.getDingMiniInfoByAppId(formDTO.getMiniAppId()); - Result isvAccessToken = dingTalkClientToken.getIsvAccessToken(formDTO.getCorpId(), dingMiniInfo.getSuiteKey(), dingMiniInfo.getSuiteSecret(), dingCallbackRedis.get(dingMiniInfo.getSuiteKey())); + DingTalkResult isvAccessToken = dingTalkClientToken.getIsvAccessToken(formDTO.getCorpId(), dingMiniInfo.getSuiteKey(), dingMiniInfo.getSuiteSecret(), dingCallbackRedis.get(dingMiniInfo.getSuiteKey())); if (!isvAccessToken.success()){ throw new EpmetException("获取accessToken失败..."); } diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/test/java/com/epmet/ThirdPlatformTest.java b/epmet-module/epmet-third/epmet-third-server/src/main/test/java/com/epmet/ThirdPlatformTest.java index f9151838e6..02c064c0de 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/test/java/com/epmet/ThirdPlatformTest.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/test/java/com/epmet/ThirdPlatformTest.java @@ -1,7 +1,7 @@ package com.epmet; import com.alibaba.fastjson.JSON; -import com.aliyun.dingtalk.module.Result; +import com.aliyun.dingtalk.module.DingTalkResult; import com.taobao.dingtalk.client.DingTalkClientToken; import lombok.extern.slf4j.Slf4j; import org.junit.Test; @@ -24,7 +24,7 @@ public class ThirdPlatformTest { @Test public void sendText(){ - Result appAccessTokenToken = dingTalkClientToken.getAppAccessTokenToken(); + DingTalkResult appAccessTokenToken = dingTalkClientToken.getAppAccessTokenToken(); System.out.println("=======:"+JSON.toJSONString(appAccessTokenToken)); } } From 5a02851f4f62eb2d70e253a0864cdebf3018301e Mon Sep 17 00:00:00 2001 From: jianjun Date: Fri, 16 Sep 2022 10:14:50 +0800 Subject: [PATCH 045/147] =?UTF-8?q?=E6=8E=92=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/service/impl/DingTalkServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/DingTalkServiceImpl.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/DingTalkServiceImpl.java index 5b0470a338..3360ead835 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/DingTalkServiceImpl.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/DingTalkServiceImpl.java @@ -70,7 +70,7 @@ public class DingTalkServiceImpl implements DingTalkService { DingTalkClient userDetailClient = new DefaultDingTalkClient("https://oapi.dingtalk.com/topapi/v2/user/get"); OapiV2UserGetRequest userDetailRequest = new OapiV2UserGetRequest(); userDetailRequest.setUserid(userInfo.get("userid").toString()); - userDetailRequest.setLanguage("zh_CN"); + //userDetailRequest.setLanguage("zh_CN"); OapiV2UserGetResponse execute = userDetailClient.execute(userDetailRequest, accessToken); Map userDetailResult = JSON.parseObject(execute.getBody(), Map.class); if (!userDetailResult.containsValue("ok")){ From db54ff9e470630d1c98aad9e311a2104f52dd578 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Fri, 16 Sep 2022 10:58:52 +0800 Subject: [PATCH 046/147] =?UTF-8?q?=E5=BA=94=E9=A1=BA=E5=BE=B7=E5=B1=85?= =?UTF-8?q?=E8=A6=81=E6=B1=82=E9=83=A8=E5=88=86=E5=8D=81=E5=85=AB=E7=B1=BB?= =?UTF-8?q?=E5=AF=B9=E5=BA=94=E8=A1=A8=E5=8D=95=E4=B8=8D=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=EF=BC=8C=E5=AF=B9=E5=BA=94=E7=9A=84=E6=95=B0=E6=8D=AE=E5=BA=93?= =?UTF-8?q?=E4=BF=AE=E6=94=B9DISPLAY=E4=B8=BA=E5=B1=95=E7=A4=BA=EF=BC=8Csq?= =?UTF-8?q?l=E5=A2=9E=E5=8A=A0=E6=9F=A5=E8=AF=A2=E6=9D=A1=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/IcFormDao.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormDao.xml b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormDao.xml index 3fd2eae45e..75cd379f88 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormDao.xml +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormDao.xml @@ -80,6 +80,7 @@ i.DEL_FLAG = '0' AND i.PARENT_ITEM_ID = #{itemId} ) + AND g.DYNAMIC = '1' From a232c131026d0ebf7c2547937379f0dca3f1a37e Mon Sep 17 00:00:00 2001 From: jianjun Date: Fri, 16 Sep 2022 18:50:06 +0800 Subject: [PATCH 058/147] =?UTF-8?q?=E4=B8=8A=E6=8A=A5=E4=BA=8B=E4=BB=B6=20?= =?UTF-8?q?=20=E5=AE=A2=E6=88=B7id=20=E5=A6=82=E6=9E=9C=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=20=E4=BB=8Etoken=E9=87=8C=E5=8F=96=20gateway?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- epmet-gateway/src/main/resources/bootstrap.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/epmet-gateway/src/main/resources/bootstrap.yml b/epmet-gateway/src/main/resources/bootstrap.yml index b0b2492d33..bfc3d86130 100644 --- a/epmet-gateway/src/main/resources/bootstrap.yml +++ b/epmet-gateway/src/main/resources/bootstrap.yml @@ -498,6 +498,7 @@ epmet: - /resi/voice/** - /point/** - /heart/** + - /oss/** # 内部认证url白名单(在白名单中的,就不会再校验登录了) internalAuthUrlsWhiteList: From a14195130666ab87672a15cd4e5bcf6e8d3c4389 Mon Sep 17 00:00:00 2001 From: wangxianzhang Date: Fri, 16 Sep 2022 19:42:11 +0800 Subject: [PATCH 059/147] =?UTF-8?q?=E5=B1=85=E6=B0=91=E9=98=B2=E7=96=AB?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E5=88=97=E8=A1=A8=EF=BC=8C=E6=8C=89=E7=85=A7?= =?UTF-8?q?=E7=96=AB=E8=8B=97-=E6=A0=B8=E9=85=B8=E6=AC=A1=E6=95=B0?= =?UTF-8?q?=E9=99=8D=E5=BA=8F=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/IcResiUserDao.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml index 4674e07b37..2590bc1bd7 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml @@ -918,6 +918,7 @@ AND natCount = #{natCount} + order by t.vaccineCount desc, t.natCount desc - + From 7538334560f6dc5c910254bb8f1f8d76d774b694 Mon Sep 17 00:00:00 2001 From: wangxianzhang Date: Sat, 17 Sep 2022 01:30:27 +0800 Subject: [PATCH 062/147] =?UTF-8?q?=E5=B1=85=E6=B0=91=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E5=AF=BC=E5=85=A5=E6=A8=A1=E6=9D=BF-=E6=B0=91=E6=97=8F?= =?UTF-8?q?=E4=BB=8E=E5=AE=B6=E5=BA=AD=E4=BF=A1=E6=81=AF=E6=8C=AA=E5=88=B0?= =?UTF-8?q?=E5=9F=BA=E7=A1=80=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../excel/ic_resi_import_template.xls | Bin 74240 -> 74240 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/epmet-user/epmet-user-server/src/main/resources/excel/ic_resi_import_template.xls b/epmet-user/epmet-user-server/src/main/resources/excel/ic_resi_import_template.xls index 88b2dcd8e1257d5a5d6ef06dcee4e45706845e64..f93667a3bd3c379e37d4ba18c1b1b80b4562736e 100644 GIT binary patch delta 8222 zcmdU!dvsLA8Ng@mKC;>DBiY@&H%}lT@<>8Lc;{Il5Xc6zkdP;dBuK!-hKB}fHXG$2cnPm5*J^ja?bobnu z`OP;ockawL-*;zj*Q@HTSJlV9m(*<6)43q27Uo`Lj19PUbBx$_Ch_j-az`e!vHva~ z9#XZ!$Lc89p|-(swH?N*C&ERQ9qz`wgP7-3+aJ?Jz&yNc8av#p358QC9b_PXrHX;` zSfoZ{^X$;9)be1s8j{W}5NAl|Hdt(!A03XJx;YTa*m1`46Y~?9dQ##C*tsZp)({zO z9+d743wtHul?0{^mZc$Z$q>n{@T4&f;*DBvgj!QHrGKS8Xh*KbED^F(`q&3S~DQUngj!uAn3GCR`U&|M?J@^wN}0cOsNyVm^#tZ zl$sdLe-GR9lV*NeO#>LjtCmzc`yFj7mew~dxpT)h7Q=SelO&jzIxab0D)pDz*~g90 zpC2!kwF57(OXqe%LV=wJ!R&%KY5RVt#=OstLPvpp#+c`*86EGd&uh?h4ZlScJO8>O z<6Z0PUMd|fi(wUT7TbF2ZMceU^<9LJLOVCZ_`YeK2fBN4I@d-aIi3r=YY2`nzz6OOg{%-6)uh}lW@we6-!iCdo7V-17}5^s-h!2 z`X`j@`;j(=;YD$a`;eJW7^lLd4zIxymC8J5+@CXK<=91->uQNyl%8YmKFzWsB_GwKuVuNleY| z!vZ?|C#S9w9L$1Qhk1zgOwW!PhRTPq5caZVhz;1rEZYzpS)5<_coxsnB8KD%tN{8K zKfx2>{3DUDyHuO$U`F;G-i0v}E0hO?OIjo|l9C^aDH={MDjW_SggL^~V|=n$l+oxY zb?l-}9H!KAo$(mPW1R#@bf{NP_SH*Axki>7Fw8)r{}i7z3)9pGrPXXCr6*G{Mf2jt zzA~1Br2J?2O3p;~;u2JnjHVDabyQcLZT;DWGbW(L24xGlOod~83k#P z=+25P2#L&uLOLWgCO!&gYgm{|pdN)5K_N(1K?Wr1veJwZE0SeW$b_;8L1v^OStwE@ z%Dh;Dqeia|_(w69(nvH4qC_JxNJEXpB1H?C-A@*WL^H0m5|0!sC;`bXC=n@6P!du+ zkxL%>WW)p^9D|f7Xe?5apm9jaf>Myi2uej7D`-5@I6-MhDS~c8N|nh)Gd}^5bWnMU ziAZUJCL!G>Xfo2!$fP4p5V8!`#wH5NMA;-kQ~c^>Ax&0fF1&pPml^} zK2oQoM;oR_Vr8y;x~&RrQwu8=CACNk;E*%Ubr)NRxqWCMeu)NZHml+7DmBlQEbK)x zSn^Y?qy+xDb)k4EX$n{31H_@lQ0WxoCL4dP_HoQ+!GB}P5_Ow?WN^qFlW}1<iU!W7!Sw@n_@*u@ zC<)h+muEpiRXF^%E(xr4anMmW5w0Cb8{?~rgFwTe!GReVpjd@*C|VpZzhAC*zVZ$u zmvhMpdHFUu_h9WwUMr_Us^^$faV1hcioHBf&Ofz02rN}GzPjX~h9pV8+&FwlFRzfx z*Djyo%QfMcczL;;yS6$jWI8G{wT>~&sXA&IhcI7GR>$xVz-djfD zxos5oZK1HXp2E*7DRet1+_;{?`!-Vei!ut&9-wfgEN$OF>1=fOj3rc1`1sbpmQ$>% zdr~fuQ1N0l@oDGm8j5$6eOY$Sg^3G4`>~wyMq^C}3GAf}r4)NQT{|gmYku&j6rXmE z-&(SSQa3ttoi@3S_t8U5O6u>cY&9iIYUEq&a#1PE3JRZ*+v=^Cnu#tscFHCGvg4Ng z$ga;y*UG(9)kUtN0*|eHqmklw*Hp;8@At`*deY@`dHW18MAyVm#+1kl8TK&#jmEx%Co1w_f7s z)=StTTpWrU(6ACew_f7s)=T`{dI?)B>IGvx3*?=Rb(M-d1Lipd8Ij5anUIzUG9%qC zC={t&P#BU^kOgTeQXkrgt@y%e!+Nrj!93Z>KwD$5bp!(g_cY!kt!?yNYfP3#!8nD% z)&ArW`}v2aHvPQSjFsNS*td7n41;b(sV95Y7ZP6vsVxbkp!cyeDsZ$FjiFht6hyPU zToBE2l^~ksYESf<+L0&7bU6whUY`Ni);l1*dy=Mxj4Ud84kR|~p>u;ye|R%vleaMT z(1V`c8(P%72L9QRIvR$Z=1ot~f!9f1|RdM*yHvLV&A#kHlcmh|&El>2G6)N5goA!CdxuW|I z(~tt69@wXE|2bou4l{P;*Z3I!@N7BwmgKtIH=ndMUhbP`hVwjppY{V9blOaFyct?_ z$UK_{vwAF^=X)}^r}$TAf<}CxuxC$6N1h$hAMZ*V#P#QoY8^6Nu9Z#6)nhvS8@;$; ze}%F7*JNG#=7kR=z7F0w?ypP5em=C=&xaQK`OsoNA6o3^LyP@!{u>VB4YlCmeOQ;kTY@;9}(mjGqNcRddBXtN0McO1N3<)i$tX>lCx+~-j3mqj$ zxa+Qv4GO*4E|7Q5Do^W+*TY7dd{5o!46eWNCi6Gk*vKtO2ZHE&F)?e-^oAkEzt6t z+;5E+`T6`JKc8RZ=ktrOAA|l*gJ*GcI;D6&Ez-+_l5E(_4EZ1?p}K+uT{CDtvuA-Vddej zugwOWzF_vd0>-xDF(NS!U@3rA0jv&SO#o{HIB1An@(p!E88XvHui+ii2XIIL8v@uE zz@`8;3&zbRJ#nbWP&h1rEdgu|U|Rr(4`V%jQY>(vvhoam(tX{^$H-qFY1Qn&i@pNw z#S4F3$K8``JRygc(4Dx~U5o!VmWandt8tIqh&k=@OKv_DR===rRoPoyPWKqT%Rb|7 zvGLsAQ#KyMt=V`YoP$>;UeoY2cq+?uUk&H5FP@jBeLpZTK;Mue@uJT_#B`!eA9Lsv z4t=0pWQw;CqU%0=C;SQY&#aL^A9&NlNY23GB`9cHbsE0|$ cYQmAOxI658vo;!&TY2x22)>;kj_2xs0Ux9GfdBvi delta 7702 zcmd6sd2m!k9>=@i%p_zolVfsClF0=jA#x-!T)_yFgh(_bL&!i*a*%^N90@22OyYua zhzN}gu0(d#U3Xn@!C}GDGSpTH!tR22ChCHuP*+_MR=`zCV86fjh7M!-$NnXmsp;-d ze}CPtyWg*m_om|wea9R6eb*Je?a1f~q3G_L$nd%0dV*8@NQ1&RRhKz3SvcYUkuNst zT1BD3D$eSx!mb}74(M%Sz1}K9^xsSmsT2D#dHJV0`qKqh8UI?SH0mJl?vdS7IZKFX~SaJ z-p@5PwerZ%sC{2*>gR)4U1Z>_jeQ0^(ar-S<| zjE63KtJ(AJlvsW*pk&U+GyNEEsZN?3IeS&@q|);~G(im~ZQ=G^S zyuYOcQMIG88PN#m)6)?>R`S9c&o_lfl|ftBynMz?OqBMf81-n-P=Ch0DifW(C7uaW zZCrUdQ&bek7w^S72eM#W@ES7$FVq;7TK@Ii+78=c)VCz z5}WBjeb-PQV`i48jtE!$KtUiaKNu+*({6YhV<95c5s@D4)ncIOkgJu6m1S&5QD?f@ zFobbbMkG4?=;z8~BfX_Z!OEaonGmLf=$q+P??jqfqSc)R(%Lf`DU1>7rg=IBqC3?RC`rul*3d|vVg zVQul!AP{+*W*GpoxFi~ZVUhwtv`A{ECbp18NHRmC4ry8ts9y^PMM3L^1;?f5{p1_v zEoDW%6?QJIl4xLmB{3jc7d0)`N3((G?rT~cC{|KD$R;TP6elSW6fY?WltAQChkh_H zQHn!ANs^L5gCz|G4Uv=rN|uxg8Y*cRC`D2lC{@xOAaciR%td#8I516$BS3dZ8VTwj znNgtOQcGux*$7D)&_+ti^eJ~IXq42lKM3PP?n_ep#G+1 zgGNhj0%(k+yWl@#CFMXH=cP=}?goyR;zUrkq)DI&lI)jYjEJ|D~^K&gi z9{E4{g96WQWjS7Z1@701+BIKM;Q6hLjsu#d1vE)g7|1Ru9F!|50+c5y5`<;aTT4_B za5Au)RpIhh(N{Jc&C&~#GtxDWX^p!%2XfUyv`Eco1>P!j82|a~9!UyliX-SZ?Nf+iOOuMAi}na!3jW^|vAfG)-!uY`*IjwD^c&J{0al5k3^@Ls6jq z%UeOE@`BMmS_~+Ax)fu5L>s6~YH=VZs0Y11i4{GE)r-TtrOcnBZ24Bxb-5lkj z)Ob1?!qr_4cW}{+cAb@3J)h2K;M^g2MaoEnwAQIkU_hut=}5T8jT;8I1;xbOe1qsL zj}Q$NjS-4!MY}Vp6nFDFRoz{c?N!a_1E~~u^C_xYQ%rAqrcsT6nf z{c73L>aBsvSRQrAM=W+%&J0Y!l1PkL^i@p_8Ha^{nBs2!As74G!d)I5exiE$y*TJF z_SD)>%P8(^r7&*Ju3Z!_*!-=N;_fZKZ4R%Yl(IFgwWw4}r8tJRQ0mM~3T-6~B@`!= zQ@E|^_-u+#J2q5P{Qml@s@3H+6P;R3u4B$&YqhE_%n7e4Dy>lslb%d>PyuH}fKyYa zmef=apRT3faFo0L+^p%&3az5I))9a4L^^jg2H3Y9JLG2O(VMG zns!M|G^v+6KD%ZmWqa1RHc-5{<uRIsP&{deN$qQEOWP`9OFe~$>J&Bi>t#>v zCcavJbrZ!s4^ybC?NaM@tKn#Mocl@^s`O386f#-SPT{}3nIA7GS8u`|??4_@N95!) zWV38Jg}uLCs`h~<3f<6bmMuFWxI3Av(&(@o{ito0wg0)g`haVo5`x zGP53M%ojb~wZk}0?Ek78>T@V6Ql}rSP&6%yd=5oLK8KiO16Nt-|YtVP3** zZzb+fc7q&Ex?i1QDm4upP-8QUNBWIVVh7(Iv;fg49`Yabp^iG|;Q zC3K704`tJ8?;>2hu}ds%n4+xP?BSm%%585ydDmYbZ#90row0K}8Jn?79pS7e>UDgH z$T%?6Rm5(6B>Kf?zt~V8Cq_SKsncdH`BIzo9`dDjN#sk*CDCkOA&F-D{gP<5KOiX# zw9<2Q`?W#dJD4J@&+ITxevYxJFJMo55kvC5XW#C36xV|&q&;<-umovMVkrI#4G|rA zI38iKLWvkG4gpYxs7g+BXDq0fF(=(FDx`s_D_KKo6f&wf+r zv)>f@>^FtjZ(h6<%h!l+50o|Dd>&VDrE=Ec9d89kvU1ibDG2niq+k#hE7d*dp{Ja! zl@tnEC&>cJ@%-U0W{cZU@2t#{{5!Ut05XXAPAa%W`lmE`s(Hk}}7PYNsT9xDf)F#0Fr=0`D z`CIwSa5UYeA>Q7*bBymZ+l$qaf- zQV?jfq+rnFo{5*Q1S|Ga;^+ri?zws%#qI76Jug=5;iA6B=^kg`T?TtN&IQ6=K3K$6 z7{%^mA?^r2{2_44PvluO2LYhf}(v^69fV2i-~}pXd&W;MPO-NFKw(vhboR8$XK2 zA{@iA-HW2QID}>`;Uc3TWQUcH55Ion2K{HL{+mD-C3a7Z=T?4wf5X#!M+|>J>F{$u z7{k}_o$eoExMPqWX0W>9<`H~Y!m~OcKE*g)FUA|x2Ar!K@J6m3w2U>AQCdh04xd!y u=7(}K+#RuevWbct@FNLBl5C*I`}f>G#PWyy!jN3c4|UqOAOC$k*Z&WiQn>8^ From 21dbf58f63aa4f456b1ab9a88f90357e315b18ae Mon Sep 17 00:00:00 2001 From: wangxianzhang Date: Sat, 17 Sep 2022 13:51:17 +0800 Subject: [PATCH 063/147] =?UTF-8?q?=E5=B1=85=E6=B0=91=E7=B1=BB=E5=88=AB-?= =?UTF-8?q?=E5=B1=85=E6=B0=91=E5=88=97=E8=A1=A8-=E6=8E=92=E5=BA=8F?= =?UTF-8?q?=E6=8C=89=E7=85=A7=E5=88=9B=E5=BB=BA=E6=97=B6=E9=97=B4=E5=80=92?= =?UTF-8?q?=E5=BA=8F+name=E5=8D=87=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/IcResiUserDao.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml index 2590bc1bd7..caba921430 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml @@ -374,7 +374,7 @@ and ${columnName}='1' AND `STATUS`='0' - ORDER BY `NAME` + ORDER BY `CREATED_TIME` DESC, `NAME` SELECT a.id, @@ -83,12 +96,19 @@ b.BUILD_ID, b.UNIT_ID, b.HOME_ID, + b.id as userId, IFNULL((SELECT DATE_FORMAT(CREATED_TIME,'%Y-%m-%d %H:%i:%s') FROM ic_notice WHERE DEL_FLAG = '0' AND ORIGIN = #{attentionType} AND ID_CARD = a.ID_CARD ORDER BY CREATED_TIME DESC LIMIT 1),'') AS lastInformTime FROM ic_epidemic_special_attention a LEFT JOIN ic_resi_user b ON a.id_card = b.id_card AND b.del_flag = '0' and a.CUSTOMER_ID = b.CUSTOMER_ID WHERE a.DEL_FLAG = 0 AND concat(a.pids,':',ORG_ID) like concat('%',#{orgId},'%') AND a.ATTENTION_TYPE = #{attentionType} + + AND a.isolatedState = #{isolatedState} + + + AND a.is_history = 1 + AND a.`NAME` LIKE CONCAT('%',#{name},'%') @@ -158,8 +178,30 @@ a.MOBILE, a.ID_CARD, a.REMARK, - a.REASON + a.REASON, + a.ISOLATED_STATE FROM ic_epidemic_special_attention a WHERE a.ID = #{id} + + From cc84e4e3043647c4f07febd071a84a69d078c20d Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Mon, 19 Sep 2022 16:41:08 +0800 Subject: [PATCH 067/147] a --- .../java/com/epmet/dto/result/VaccinationListResultDTO.java | 1 + .../main/resources/mapper/IcEpidemicSpecialAttentionDao.xml | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/VaccinationListResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/VaccinationListResultDTO.java index cfb6fbc749..69d37b3e10 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/VaccinationListResultDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/VaccinationListResultDTO.java @@ -57,6 +57,7 @@ public class VaccinationListResultDTO implements Serializable { * 最后一次通知时间 */ private String lastInformTime; + private String lastNatTime; /** * 所属小区ID diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcEpidemicSpecialAttentionDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcEpidemicSpecialAttentionDao.xml index adacd9675a..f2467a9823 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcEpidemicSpecialAttentionDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcEpidemicSpecialAttentionDao.xml @@ -97,8 +97,7 @@ b.UNIT_ID, b.HOME_ID, b.id as userId, - IFNULL((SELECT DATE_FORMAT(CREATED_TIME,'%Y-%m-%d %H:%i:%s') FROM ic_notice WHERE DEL_FLAG = '0' AND ORIGIN = #{attentionType} AND ID_CARD = a.ID_CARD ORDER BY CREATED_TIME DESC LIMIT 1),'') AS lastInformTime - FROM ic_epidemic_special_attention a + IFNULL((SELECT DATE_FORMAT(NAT_TIME,'%Y-%m-%d %H:%i:%s') FROM ic_nat WHERE DEL_FLAG = '0' AND ID_CARD = a.ID_CARD ORDER BY CREATED_TIME DESC LIMIT 1),'') AS lastNatTime FROM ic_epidemic_special_attention a LEFT JOIN ic_resi_user b ON a.id_card = b.id_card AND b.del_flag = '0' and a.CUSTOMER_ID = b.CUSTOMER_ID WHERE a.DEL_FLAG = 0 AND concat(a.pids,':',ORG_ID) like concat('%',#{orgId},'%') From e0e69d39769204549d8e1f18c4bcfad45f03d40a Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Mon, 19 Sep 2022 16:42:37 +0800 Subject: [PATCH 068/147] bug --- .../src/main/resources/mapper/IcEpidemicSpecialAttentionDao.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcEpidemicSpecialAttentionDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcEpidemicSpecialAttentionDao.xml index f2467a9823..8c7db19ae1 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcEpidemicSpecialAttentionDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcEpidemicSpecialAttentionDao.xml @@ -114,7 +114,7 @@ AND a.MOBILE LIKE CONCAT('%',#{mobile},'%') - + AND a.ID_CARD LIKE CONCAT('%',#{idCard},'%') From 1dcdf6cd1aa91e36400ba2b504c54c1035614281 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Mon, 19 Sep 2022 16:57:17 +0800 Subject: [PATCH 069/147] bug --- .../src/main/resources/mapper/IcEpidemicSpecialAttentionDao.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcEpidemicSpecialAttentionDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcEpidemicSpecialAttentionDao.xml index 8c7db19ae1..d6d129d6a4 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcEpidemicSpecialAttentionDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcEpidemicSpecialAttentionDao.xml @@ -97,6 +97,7 @@ b.UNIT_ID, b.HOME_ID, b.id as userId, + a.ISOLATED_STATE, IFNULL((SELECT DATE_FORMAT(NAT_TIME,'%Y-%m-%d %H:%i:%s') FROM ic_nat WHERE DEL_FLAG = '0' AND ID_CARD = a.ID_CARD ORDER BY CREATED_TIME DESC LIMIT 1),'') AS lastNatTime FROM ic_epidemic_special_attention a LEFT JOIN ic_resi_user b ON a.id_card = b.id_card AND b.del_flag = '0' and a.CUSTOMER_ID = b.CUSTOMER_ID WHERE a.DEL_FLAG = 0 From 802a723bef0225e03dbdb0db4fbe92955119cf13 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Mon, 19 Sep 2022 17:07:07 +0800 Subject: [PATCH 070/147] bug --- .../service/impl/IcEpidemicSpecialAttentionServiceImpl.java | 1 + .../main/resources/mapper/IcEpidemicSpecialAttentionDao.xml | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcEpidemicSpecialAttentionServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcEpidemicSpecialAttentionServiceImpl.java index 677a5760ba..1c8f9fab4e 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcEpidemicSpecialAttentionServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcEpidemicSpecialAttentionServiceImpl.java @@ -326,6 +326,7 @@ public class IcEpidemicSpecialAttentionServiceImpl extends BaseServiceImpl - AND a.isolatedState = #{isolatedState} + AND a.isolated_state = #{isolatedState} AND a.is_history = 1 From c7a0d10a58345d7830e7452f266687f3e5d69e33 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Mon, 19 Sep 2022 17:26:22 +0800 Subject: [PATCH 071/147] =?UTF-8?q?=E5=8A=A0=E4=BA=86=E4=B8=AA=E7=BD=91?= =?UTF-8?q?=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dto/result/VaccinationListResultDTO.java | 2 ++ .../impl/IcEpidemicSpecialAttentionServiceImpl.java | 10 ++++++++++ .../resources/mapper/IcEpidemicSpecialAttentionDao.xml | 1 + 3 files changed, 13 insertions(+) diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/VaccinationListResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/VaccinationListResultDTO.java index 69d37b3e10..65c0eb51d9 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/VaccinationListResultDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/VaccinationListResultDTO.java @@ -73,6 +73,8 @@ public class VaccinationListResultDTO implements Serializable { * 所属楼宇Id */ private String buildId; + private String gridId; + private String gridName; /** * 所属楼宇名称 diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcEpidemicSpecialAttentionServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcEpidemicSpecialAttentionServiceImpl.java index 1c8f9fab4e..2cec386b53 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcEpidemicSpecialAttentionServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcEpidemicSpecialAttentionServiceImpl.java @@ -15,6 +15,7 @@ import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.redis.common.CustomerOrgRedis; import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache; +import com.epmet.commons.tools.redis.common.bean.GridInfoCache; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.ExcelPoiUtils; @@ -170,6 +171,15 @@ public class IcEpidemicSpecialAttentionServiceImpl extends BaseServiceImpl { + GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(r.getGridId()); + if (null == gridInfo){ + throw new EpmetException("查询网格失败:"+r.getGridId()); + } + r.setGridName(gridInfo.getGridNamePath()); + }); + } } if (CollectionUtils.isNotEmpty(result.getList())){ result.getList().forEach(v -> { diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcEpidemicSpecialAttentionDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcEpidemicSpecialAttentionDao.xml index 8a0e29a55f..c475e9cfbe 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcEpidemicSpecialAttentionDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcEpidemicSpecialAttentionDao.xml @@ -97,6 +97,7 @@ b.UNIT_ID, b.HOME_ID, b.id as userId, + b.grid_id as gridId, a.ISOLATED_STATE, IFNULL((SELECT DATE_FORMAT(NAT_TIME,'%Y-%m-%d %H:%i:%s') FROM ic_nat WHERE DEL_FLAG = '0' AND ID_CARD = a.ID_CARD ORDER BY CREATED_TIME DESC LIMIT 1),'') AS lastNatTime FROM ic_epidemic_special_attention a From 5c6b538bce680a0e5d03f6ee69375f3ae25b391b Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Mon, 19 Sep 2022 17:36:18 +0800 Subject: [PATCH 072/147] =?UTF-8?q?=E5=8A=A0=E4=BA=86=E4=B8=AA=E7=BD=91?= =?UTF-8?q?=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/IcEpidemicSpecialAttentionServiceImpl.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcEpidemicSpecialAttentionServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcEpidemicSpecialAttentionServiceImpl.java index 2cec386b53..d621eb4f92 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcEpidemicSpecialAttentionServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcEpidemicSpecialAttentionServiceImpl.java @@ -173,11 +173,13 @@ public class IcEpidemicSpecialAttentionServiceImpl extends BaseServiceImpl { - GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(r.getGridId()); - if (null == gridInfo){ - throw new EpmetException("查询网格失败:"+r.getGridId()); + if (StringUtils.isNotBlank(r.getGridId())){ + GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(r.getGridId()); + if (null == gridInfo){ + throw new EpmetException("查询网格失败:"+r.getGridId()); + } + r.setGridName(gridInfo.getGridNamePath()); } - r.setGridName(gridInfo.getGridNamePath()); }); } } From 7cf0214500958e0eb20e51a5184108cf93716369 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Mon, 19 Sep 2022 18:05:47 +0800 Subject: [PATCH 073/147] a --- .../service/impl/IcEpidemicSpecialAttentionServiceImpl.java | 1 + .../main/resources/mapper/IcEpidemicSpecialAttentionDao.xml | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcEpidemicSpecialAttentionServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcEpidemicSpecialAttentionServiceImpl.java index d621eb4f92..9dc1f79e72 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcEpidemicSpecialAttentionServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcEpidemicSpecialAttentionServiceImpl.java @@ -162,6 +162,7 @@ public class IcEpidemicSpecialAttentionServiceImpl extends BaseServiceImpl pageInfo = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.natList(formDTO)); result.setList(pageInfo.getList()); diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcEpidemicSpecialAttentionDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcEpidemicSpecialAttentionDao.xml index c475e9cfbe..abcabebdba 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcEpidemicSpecialAttentionDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcEpidemicSpecialAttentionDao.xml @@ -108,7 +108,10 @@ AND a.isolated_state = #{isolatedState} - + + AND a.IS_ATTENTION = 1 + + AND a.is_history = 1 From 86fc9c41d556adc029f98ec38261b2d8ae03ed1a Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Mon, 19 Sep 2022 18:07:19 +0800 Subject: [PATCH 074/147] a --- .../main/java/com/epmet/dto/IcEpidemicSpecialAttentionDTO.java | 1 + 1 file changed, 1 insertion(+) diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcEpidemicSpecialAttentionDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcEpidemicSpecialAttentionDTO.java index 4ae01cbce1..52a43eedf1 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcEpidemicSpecialAttentionDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcEpidemicSpecialAttentionDTO.java @@ -63,6 +63,7 @@ public class IcEpidemicSpecialAttentionDTO implements Serializable { /** * 隔离类型,来自字典表 */ + @NotBlank(message = "isolatedState不能为空",groups = {IcEpidemicSpecialAttentionAdd.class,IcEpidemicSpecialAttentionUpdate.class}) private String isolatedState; /** From f172f7dc60854ba3b644f3870c0c3cd9272cf0d1 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Mon, 19 Sep 2022 18:45:44 +0800 Subject: [PATCH 075/147] a --- .../dao/IcEpidemicSpecialAttentionDao.java | 1 + ...IcEpidemicSpecialAttentionServiceImpl.java | 4 ++- .../mapper/IcEpidemicSpecialAttentionDao.xml | 34 +++++++++++++++++++ 3 files changed, 38 insertions(+), 1 deletion(-) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcEpidemicSpecialAttentionDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcEpidemicSpecialAttentionDao.java index 6a7cb224dc..d57e5b7f94 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcEpidemicSpecialAttentionDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcEpidemicSpecialAttentionDao.java @@ -53,6 +53,7 @@ public interface IcEpidemicSpecialAttentionDao extends BaseDao list,@Param("attentionType")Integer attentionType); void addAttention(@Param("list")List list,@Param("attentionType")Integer attentionType); + void addExistAttention(@Param("list") List list,@Param("attentionType")Integer attentionType); /** * Desc: 查询已经存在的关注 diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcEpidemicSpecialAttentionServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcEpidemicSpecialAttentionServiceImpl.java index 9dc1f79e72..520b36bb5e 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcEpidemicSpecialAttentionServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcEpidemicSpecialAttentionServiceImpl.java @@ -283,17 +283,19 @@ public class IcEpidemicSpecialAttentionServiceImpl extends BaseServiceImpl idCards = entities.stream().map(m -> m.getIdCard()).collect(Collectors.toList()); Integer attentionType = entities.get(NumConstant.ZERO).getAttentionType(); List existList = baseDao.getExistList(attentionType, idCards); + List existsEntities = new ArrayList<>(); if (CollectionUtils.isNotEmpty(existList)){ for (String s : existList) { for (int i = NumConstant.ZERO; i < entities.size(); i++) { if (s.equals(entities.get(i).getIdCard())){ + existsEntities.add(entities.get(i)); entities.remove(i); continue; } } } + baseDao.addAttention(idCards,attentionType); } - baseDao.addAttention(idCards,attentionType); entities.forEach(e -> { e.setIsAttention(NumConstant.ONE); e.setOrgId(agencyInfo.getId()); diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcEpidemicSpecialAttentionDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcEpidemicSpecialAttentionDao.xml index abcabebdba..f814f838fc 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcEpidemicSpecialAttentionDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcEpidemicSpecialAttentionDao.xml @@ -31,6 +31,40 @@ ) + + UPDATE ic_epidemic_special_attention + + + + when id_card = #{item.idCard} then 1 + + + + + when id_card = #{item.idCard} then #{item.reason} + + + + + when id_card = #{item.idCard} then #{item.remark} + + + + + when id_card = #{item.idCard} then #{item.isolatedState} + + + updated_time = now() + + WHERE del_flag = 0 + AND attention_type = #{attentionType} + AND id_card IN ( + + #{l.idCard} + + ) + + SELECT a.id, a.`NAME`, + a.customer_id as customerId, a.MOBILE, a.ID_CARD, a.REMARK, @@ -187,6 +189,7 @@ ID_CARD FROM ic_epidemic_special_attention WHERE DEL_FLAG = 0 + AND IS_HISTORY = 0 AND ATTENTION_TYPE = #{attentionType} AND ID_CARD IN ( @@ -239,7 +242,7 @@ + \ No newline at end of file From 53a1fe5ab57b70e911a869734f804487ce8dae38 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Wed, 21 Sep 2022 10:17:11 +0800 Subject: [PATCH 098/147] =?UTF-8?q?=E6=A8=A1=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../excel/attention_nat_template.xlsx | Bin 8888 -> 8897 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/epmet-user/epmet-user-server/src/main/resources/excel/attention_nat_template.xlsx b/epmet-user/epmet-user-server/src/main/resources/excel/attention_nat_template.xlsx index 89a6df54c7a385aa571ab2f284856ac2cc9097f2..de79811f246d04ead8001250cda7a0a01ea40f6b 100644 GIT binary patch delta 3934 zcmV-k525h5MZra|lK};(H}dE$lb8V>f6Y$AFc5_ANW4Sjd*Yu$1y+(CKs|wkL=cFZ zWpCSv*s*LwTAm&!X+sbkIId^*^XzWE+Uq9y0O#x06o_U7C17N$YO^iSQ?*X7P~w9y zN;Iv30v*7kRe64vOUq^J;K8*PT&Te(kz_oVwm`cOEXUZ(9cbaR=rB>-v`&i(K81X-4t4H-OXr&xS#nIdvTl zHqLa6J7+67ij#Zq>&e)4UDhpz7%@M^FZXwk!>DO(`dvvtWv(Qb4n$~O`MH-lp4Cws zqKpPmNrdw;%1L=%+}u`cR5HR?ElMs@LMyW5msgyS*PivGzyEA}(D87a`X9vWl+lV3 zPM4gq8Sw-tbNuVTm)9(EcwMl=mX$kMTgpFJI}_b^hLq#@xVr5>J9g}3~>cickA ziHa%J2!9w-<>6TCtZ!K=h-pGpLu53ClSs&fXxPfJr7}rLSYArF)wJ!7l@ONVilHxW z!y%%G1#}>SJfW$sNF?P%L;WgdnOd->y`gB`HAbqMmCd4yuzSpVL~YFJXZcN<_L5 zh{UQ&TUEJfZPs)q!3xn0%}R)zn9XCQ9GIDgZ#QZDx0vW17z^4*X@8_evGq>+cW zo&M0l5HAr&j27zJ8fh|mLOBgI4Pn+8nHi3Rm>A$bglxlI0t_PwG@H_0%DIPu6{+Jg z$8ZgjtT}e8*Y0*qE^C?W`g)OgSQ_9^qL4-;=XzK0=PcAQ6wqmGbUJp|X*Ge$Y2gLr zv41EYQZ|k?V7iSCMk3dorSuV35(@feCJ#sE3;vL8S_!Q{Q&2DRd$D zhuB#~ICaGCDxz6O3|0{vb;RB(qE$zf}n_vbbtl1)w1pWGfkR#;$Pt058sdEI?l9l;!YmMc6`2n=iK9aud{XSxbJJX-Du#2 zK}#=h8oK5Nov`Z#2QB^kH|>9ohOP}_C+IqU7`QF{#2x6@w!i+htwDU^yEhJ9H`ahf zFlgzAaeQ>OR2p;+-M%x}43FFZzUhTg--+QgIw%c}BG>5-5K-SRnTAm-^&KzJx3_{} z-|oi)trHG|xTRa{l19FHvkMo?x<S+~()3ayO5|Hf;k#)}vE~;f?$@r(=Wk8(C)EG@>WmyvGZOAI-%`U;zrU0+ z=3>fVi_$bve<`UUdZa|7yS>#510H14fGDFY+gpQowA+pk_%l(2I-ws%S`09PD3@`} zoW4u$7@hz6`O^pZu0ww(8UXqTVZ}n%F!t!3eJ=D zbz{RYj7EOu33$vcZjwI*ftO0_1u^2y_h#Kj9~9DMfl@NAnm2z~Bx!;xY3wRC`s8Nb ztUyR}_*rG&-YnF3hf2Cvb}ZW#IYL%HhitoDOM+b&p+Wn``)TNl<%H6|*H)oA6g@G;3zFQ8utK z`O9x|i`OC_HwXEfS>t9_z{~Y&wNWiMO{?5QAj?sH(h`_9d~%jWyMa2lbuA&y+ojY@ zTz~VA-1RE@LN!@Sn1ya_E%po5Y_;;) z0J*o*Z09^cGFk0*b49(35ZBe>irU()?b*3E9?Y+{-Of9Pv-N7Vex>q-dhv?&5F+LM>hx$6+51x}I|o296JhrGz5+ zk0@bf3KpSSdVGi%k;sItGmJyJY*0csQSO=dVjZvwnYV(PiI$o75@WJ$0UK3bNci{N zt~cz1=ZKNBW4MJ{RjY0pb*pOD@N*mZ3^_74*(84~OA*lxhx@+E%wu^66XAINabZ&u ze@T#_?D#xzCNO3xGT<>wkOh)iikAzQ(qe`W6eEQuQ~s82UsMgHU}_bglU~%-0>xsk z76=pus^TwDT-L@Ze=THXCe5s!nIsBJGifestIBmdCi1<()P1u^yM~Qqj=jg~k`QEUI)SyoS9kD0%FnMS z8t_YRM`7%CV!W9HjkB+yB-(93Z8u?uL@|Gr6g*ijtdeDT24t>;*(L5uP=8LmR~Fwg zJS1_Y0Q7T|S|13DrKE*-^<#BEsOvqrJ`nQOFZCVsoXyxy64O z5MdNdJZBbHORglWnibWRXvm=*Zl$p4EVSWesdp?ADg{qUjs&pI$sD;6%DLM`?HUa> z>@qGYB+*v%L`!KHgwW6NWX`@rd&a3&Qptgn^(iGJhJ-nA;T)w_iaF3L@tdR~oGh&3 z&bl7@%P<}ma|{&VSY)?aNYBiPB!Yj0;yfV=X;rM@#zM96wR0zw$k(g{2n}YDvkP=f z&>%pzQrt;E;ql@%@vES5vF6@{*rUUwhnE^AXi4XdvC@oO&g~Od5%zl*bW9auU05B3 zJTLA;r7*KmqEbu0xphkP-&2uQ<{raq*oj#S5$Om6uwC*N%HjSdAB22+2oqlJFY&6*>$f?;YrGgbfMlTNH3uAP~al2zhG+3!8>so^9!) zCr>7i-V;>aA9_B#FF^tU8$^Gm32MeSv<+?a03N08t%3*7r2lY*r&Ds_oLC1pCxk9Odfxyz%N})i&eOb z2}F|voV-$38UNys&qlxe#rW?ZBr;Jg=S27ofN7bjaDn(zxS%ZMTq^jjs)gBryD1wP zc9zm*3J-8SWW>Rvry~BT=74mnhYUPeqP+|o24B3+!o3396BKMF=YM{2{*XzQp=T;3 zD?Gqemr)0MnG`ZF?)-oJ`IE;?rVKk%>GjlP=fRWVXDKl-I(y2*%E&X7_os?w21AZZ z&{L-T_@AfaJO522B8# zn5imtOpOFfKD_qH-AaD`W!kM&ZR+;`Ib6c z|MgdZDYINIPw=jS!tzvff;>{wD>BfkN;Znh%IX`m0g~!U*QG{)=>aB-Y^q8}&Hx6@ z4G4%+mS_>FLav}S4}nx!7-&{9n4pP$fd=+oD14r3D|3Gt+K?x(v6O76Yz7f)3TbLv z=k%^H@<>vZ*_En1tEix@$Odv=;RBM^GgTit7m*e=q5&;`+=A9VcHrd-yz!a!_5h5o z+jE9~e3O0I()sas@%ttaBYM}{-t92PELu80eha;~L(0E<9KSVymu=v`HjKQM{?omk zdUJQrHaB4!#!h3ys<_pSW_4$GqiVHxc6aTjVH)jsA!E?5$6Y-xTQk2P*Y`S6I0$?3 zW(Qse3VS`T}IFHUa08(I7_w50e=oCmYs1G%QdG001LT000dD00000 z00031AOHXWl#^Q_IssvmmLWC)h?C7BKmi|<4kA1OF_TLoAsmL|oV(5f005>1000;O s0000000031AOHXWT?CVQ1R54lO9ci10000H01*HO1ONb}9smFU0Au-I7ytkO delta 3937 zcmZ9PRaDfEqDE)vkOt`*x>G>up*tKU6%hfE(xF3t#7GV40Fn|z!vIQm3`mExbV;{> zwD*6`y7#Vi&dc|(ANKS9IyCAvDp6qk;g>Y_qNo%w8z5nX6{q~@!+oc=uK0D07FNd1 zs*#6$Q<^SCct=}rz0n{ z-W9W|1SEQglhL~e5~fhYW9WQE8#e0+zdJy3X-uPtofciCKzZ$>K{)%YhA3JfK+*iy zoeM)^>f_0~*PZ%>^&YjfXt@T8@-NZPrg@&pbP-)XZuYAOm^5RY7Y=nnf*t}XmF@4H z2S!4BkITqsDea|$qH!`}OosdQyaUWICOX9Vq7r?p!We#gGd;~-=aH))OMr}0(c600 zTZ&Z!eVrsxb4`oJ6snOR$(}ZH>kr_n6`UwAxd=yoPdg3>gv1Ad7(l252on$k8*m#} zpXh zuIT5#zJsA44@eyYHwPR3%m*ke9{BbD$k6Rp->{p8i|1PKLy`^N-|TJsdITkmaU+T7 z8PASG1e=-XTh@}G!!T&ECeR))z|Lp6sW$i27Wz0>IAQ#r_e;*lxhqc$U6b^5b9apU z_hZ*i_Y*7cP2W@VV==F;JY=Wto&0 zQmSiuYSRxDNQ|hVi<&6cvodS2JFNCBSYi4>Hl!PwL3hbZxyj+yDF=)rbw$aWOFr_A zkvB)EG7s*>=Y5U)Gruy^O<6%%7@fQ`%j6{K2YpEPAm+ssLn@;oB87383c-SX2ENBd z{2+ZCx4$8d0)!bZVW~vmoeN^myil&z2Dj?D5#RHcuT+jUg~y0r?OR#hwpQ(X%ZIWl zyuYvXV*S|v=r0<-)y6SOl(aLCHif&rt|MrFawir! zMoNBw?`zI4GFFhLt2<;t%tU2?V-!Ul91y*c!QkG6RjTHd?ogyTdq>Ds1XJ~7ll!6= zE{XuCu6K#*Vu~7nZfsRkp}k@;GOKS{f4FkB6aRfWYsKj@Is@pJ-)9XzecZ`-lkQIZ zF}HV6T;*i|>9z)W%euZ(G|^`6{3dt$0>qFO?ax*;R~hBQG(Y|R2zd+KSKO?9u37fnuw{G?=XdUOaY zOX+4KZsGJzd;M3+s|}GO_xEnrs)LTzjhdm#Rknnx1i<(=O;s2P2*hOs0+E40AYT_T z4^KZAdk;}xSC>iaIrq6KMu5HYZ}5vsMcOK!=bm~ZjtMR}xQ#g~lG*Jtc-87Z@%YEk zMeS}999C(5yYXPPS$iRpGUpY03S^xZmdVrLYD7KiW&+4rYB)M#*)~q3iOj_i>e06S zUih#C{IV{>IBUH(YS>5M${wYc)LJ~H>p8@GHofFtqTK4_I`PDw^5=)?bDSlolAd9e zmfG8WcUQ7pyOD->%W?@gY8Rme{*)TwW_tOmo9)|kp+n1~$1Ca2DbM$bl)|p_J8ZXR z7Qm350G<}>^5m=9-O@R$yGr*nbnqB)*oO%iVBoF8xpb3FO7HcA6I~N38Ufe4JQxXA zJ-wQ?$^0Z+Az;?(^Go+K`J{2ZG|O%9^3$k$JdkpCT}N9(JJ3yPE6UsD;MdAhyhNI7 z-6UhfU}wqjCdBu2nzqCnz5-oy7Fe?@o>@LciA#$4MEd&#l+s^BqRu3J8K3=JWNO9$ z^RGk8@OlKVd{(R*)?KS&{!PO+X-Po| zVb~o`z{psK;FmgFq}aDJ=<&0Y2vJ>bc*foRA^k8en?1&QLh7^ZJJM>cHt*YVk9Czf z>+a8b88gVJl%cOoyK3rF*V>Zfp*4kH zclL}pyYnjoz4C8uES3)8K|*s$c=zM6fJk!_6^Q=<#YDu2<-l#CA} zav zyQ#yXUSi)AzGtEZCmYbleD99}p|Dost7Agaao;5Jz0m0M{=h54Y1VT_b`srhh)RB> zxkHBtY&ALdIlsKaBgbS2R-+2fA~r4GJS?{F%~kFrI4yF!mrA&ZOY5Bp>#vzLf<%M` z?@-y7RBmbmDX06B54di|IzupBDX)3@%Tj-(S^Ox)TNdlFVp0U4EDm$3_3uq2@}iv( z+ zPc#zx+{RI3eZgwp0Vjyw%22EfXxN}?Xw2qN?{RcOl7{^q44`JpLH$QO%<3eo&MlBc(9|2WK_-IA(by)FJPpvv^!AD0wQNO_004eh?`!_ub$qpsFOCyp{A6v zXMO@wJ$;Wp$DF==kOOLxbCENnfBL;zN3!=zRjJ<1hWyW{P4AVM&$9@#Sbx2l7%kEK z(jcg5Fvamjm-#!5spqbCnQMe@+JYh%y6aj|IM(0Gb?Z?h*5eQoPfEnWT>NYUF7dV& zEl_FIPBp(mbo?66BR%AcsY?l(&xki}@t67nb0eEVoH`4*=XC*b$*)6x=Kie#G2Xw8 z@^@=}TgTYnMoMWn=Ti75TtDcg*9nT3u~OscEhn@}2?v_PiZ{1?-3o$KC((?1nS$mU zY5h*9S#*MOq|p3hXcw!}Z_+-(s4bV~1i*3SA+kHKs9On?ez#PfyU@a1>P>n>tH;Ow z{`s-hCuY}LWM#;IMBL_7OYI>M_8J-=&wSDTTlyBMtjv77F}((~vj0{u4JW4hK;)Fh zODDQ)LqboR-^Wkz;lN|Xwte1{fy%pJ;uSS1H#{OD6s17@x3C0vzL*7a^a6Pf0kGm1 zt7Oq#f^QX6B?s5{D#V7_B!?lVo&t`M_|!i%COW<~A~r8GZ4`l%lw(?3LOvuncX7uT zIU_`tKzIArseqjjghFOmv@==Yo`k515!1;UkQIG+qr6du6z4L!F+_WvUNSb>sMBS< z`K0~m?sWJerC8fuA0I@j6gVpsEPr|V*{RC3!6JIu!-bg2FTykJ zbx75^QNOYsHF7555%+^3sYTzNtfR1Q{m3EBKZiWbdZ;;Pr;H>)@n<*KEbsW!Z`pv9L6T*D%SHY_IpRnoZ_G5~v(p zzj^TjPlo<<)vgR^n)UR<79kj0aH({oDQmZ+p!NU-u7p?zEAeh>8AT?k5$UzJO1ges zc1@g%uQwihphJry2)%o{mqWks%0^~#{g&d`gJYS?e>(kOp9APrll})WZ#A%fy30gw z#efxDaQ`ORZplpgcw5zcA1=>#pBTVgg*nM3#c1Z&RGCQ3VKP}uO{NC+ZB)9lZQ`2z z^HQbSIHrB%ZN-WFe>f1b5t8^T)~yZRg;}E~A^;6?f`&&&%jNNcdLP>otes2d2_Z@{ z^bus5$RvI;{F#b5SD=cVp`8GXiyC250Xw58*`>g7D0Oz!{~p(Qb{KdSCBdOWNQL+B zKt%~aSWxkth??cl0u!JhoP2!$owNTGEeH(a_-DiasoVdLTht00$G;6Q sR2HWUH~=-psRF)_qK7DeB~dU4C-Z-vzJFQ%&+{A=4-q0rXZsiVA427A7XSbN From d358623ab2bac0cf5c494de3438bf71225653828 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 21 Sep 2022 10:26:07 +0800 Subject: [PATCH 099/147] id --- .../main/java/com/epmet/dto/result/IcNeighborHoodDetailDTO.java | 1 + 1 file changed, 1 insertion(+) diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcNeighborHoodDetailDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcNeighborHoodDetailDTO.java index aa585263a9..2ed20afbfa 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcNeighborHoodDetailDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcNeighborHoodDetailDTO.java @@ -12,6 +12,7 @@ import java.util.List; */ @Data public class IcNeighborHoodDetailDTO { + private String id; /** * 客户id */ From 7b8862ed693a594897e24fa4e788e6a8dbaabc76 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 21 Sep 2022 11:09:11 +0800 Subject: [PATCH 100/147] =?UTF-8?q?epmetuser/icBirthRecord/{id}=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/dto/IcBirthRecordDTO.java | 15 +++++++-- .../impl/IcBirthRecordServiceImpl.java | 32 ++++++++++++++++--- 2 files changed, 39 insertions(+), 8 deletions(-) diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcBirthRecordDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcBirthRecordDTO.java index 9215512142..46bee9f321 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcBirthRecordDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcBirthRecordDTO.java @@ -71,7 +71,11 @@ public class IcBirthRecordDTO implements Serializable { @NotBlank(message = "所属家庭不能为空", groups = {AddGroup.class}) private String homeId; private String home; - + /** + * 所属房屋全路径名称 + * 详情回显 + */ + private String homeAllName; /** * 姓名 */ @@ -84,10 +88,9 @@ public class IcBirthRecordDTO implements Serializable { private String mobile; /** - * 性别 + * 性别 1男2女 */ private String gender; - /** * 身份证号 */ @@ -139,6 +142,12 @@ public class IcBirthRecordDTO implements Serializable { */ private String householderRelation; + /** + * 与户主关系【字典表】 + * 详情回显 + */ + private String householderRelationName; + /** * 是否勾选补充居民信息0否 1是 */ diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcBirthRecordServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcBirthRecordServiceImpl.java index 37a65965d7..dc737eed05 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcBirthRecordServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcBirthRecordServiceImpl.java @@ -5,14 +5,15 @@ import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; -import com.epmet.commons.tools.enums.GenderEnum; -import com.epmet.commons.tools.enums.IcResiUserSubStatusEnum; -import com.epmet.commons.tools.enums.IdCardTypeEnum; -import com.epmet.commons.tools.enums.RelationshipEnum; +import com.epmet.commons.tools.enums.*; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.redis.common.CustomerIcHouseRedis; +import com.epmet.commons.tools.redis.common.CustomerOrgRedis; import com.epmet.commons.tools.redis.common.CustomerStaffRedis; +import com.epmet.commons.tools.redis.common.bean.GridInfoCache; +import com.epmet.commons.tools.redis.common.bean.HouseInfoCache; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.IdCardRegexUtils; @@ -29,6 +30,7 @@ import com.epmet.dto.result.HouseInfoDTO; import com.epmet.dto.result.SyncResiResDTO; import com.epmet.entity.IcBirthRecordEntity; import com.epmet.entity.IcResiUserEntity; +import com.epmet.feign.EpmetAdminOpenFeignClient; import com.epmet.feign.GovOrgOpenFeignClient; import com.epmet.service.ChangeWelfareService; import com.epmet.service.IcBirthRecordService; @@ -37,6 +39,7 @@ import com.epmet.service.IcUserTransferRecordService; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.collections4.MapUtils; import org.apache.commons.lang3.StringUtils; import org.jetbrains.annotations.NotNull; import org.springframework.stereotype.Service; @@ -65,6 +68,8 @@ public class IcBirthRecordServiceImpl extends BaseServiceImpl page(BirthRecordFormDTO formDTO) { @@ -118,7 +123,24 @@ public class IcBirthRecordServiceImpl extends BaseServiceImpl> relationshipRes = epmetAdminOpenFeignClient.dictMap(DictTypeEnum.RELATIONSHIP.getCode()); + if (relationshipRes.success() && MapUtils.isNotEmpty(relationshipRes.getData())) { + String householderRelationName = relationshipRes.getData().containsKey(recordDTO.getHouseholderRelation()) ? relationshipRes.getData().get(recordDTO.getHouseholderRelation()) : StrConstant.EPMETY_STR; + recordDTO.setHouseholderRelationName(householderRelationName); + } + return recordDTO; } @Override From ca8906ff317bbf26096d487a24edf8398c932eea Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 21 Sep 2022 13:12:11 +0800 Subject: [PATCH 101/147] =?UTF-8?q?=E7=96=AB=E6=83=85=E9=98=B2=E6=8E=A7?= =?UTF-8?q?=EF=BC=8C=E5=B0=8F=E7=A8=8B=E5=BA=8F=E9=80=9A=E7=9F=A5=EF=BC=8C?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=8F=91=E9=80=81=E7=BB=93=E6=9E=9C=EF=BC=8C?= =?UTF-8?q?sendRes:=E5=8F=91=E9=80=81=E7=BB=93=E6=9E=9C=EF=BC=9A1=E6=88=90?= =?UTF-8?q?=E5=8A=9F,0=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/dto/IcNoticeDTO.java | 4 ++++ .../src/main/java/com/epmet/entity/IcNoticeEntity.java | 4 ++++ .../java/com/epmet/service/impl/IcNoticeServiceImpl.java | 6 ++++++ .../resources/db/migration/V0.0.71__icnotice_sendres.sql | 1 + .../src/main/resources/mapper/UserBaseInfoDao.xml | 1 + 5 files changed, 16 insertions(+) create mode 100644 epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.71__icnotice_sendres.sql diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcNoticeDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcNoticeDTO.java index 72520ef800..d4184734a9 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcNoticeDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcNoticeDTO.java @@ -106,4 +106,8 @@ public class IcNoticeDTO implements Serializable { @JsonIgnore private Date updatedTime; + /** + * 发送结果:1成功,0失败 + */ + private String sendRes; } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcNoticeEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcNoticeEntity.java index 133d56dfcd..41deda8a70 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcNoticeEntity.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcNoticeEntity.java @@ -57,4 +57,8 @@ public class IcNoticeEntity extends BaseEpmetEntity { */ private String orgName; + /** + * 发送结果:1成功,0失败 + */ + private String sendRes; } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNoticeServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNoticeServiceImpl.java index 1abb00b5f3..bab4d5e5a6 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNoticeServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNoticeServiceImpl.java @@ -147,6 +147,8 @@ public class IcNoticeServiceImpl extends BaseServiceImpl SELECT r.*, - r.CREATED_TIME AS reportTime + r.CREATED_TIME AS reportTime, + r.ID_CARD as realIdCard FROM ic_trip_report_record r WHERE From e9c073516e5452edb1520e2ce888dd18aa865837 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 21 Sep 2022 15:04:17 +0800 Subject: [PATCH 111/147] =?UTF-8?q?=E4=BA=8B=E4=BB=B6=E8=BD=AC=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1=E6=97=B6=EF=BC=8C=E4=BA=8B=E4=BB=B6=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E8=A1=A8=E6=8F=92=E5=85=A5=E7=9A=84=E6=98=AFwantServiceTime?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/service/impl/IcEventServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventServiceImpl.java index 6f4d7afe6e..dda3a90647 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventServiceImpl.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventServiceImpl.java @@ -940,7 +940,7 @@ public class IcEventServiceImpl extends BaseServiceImpl Date: Wed, 21 Sep 2022 15:18:47 +0800 Subject: [PATCH 112/147] =?UTF-8?q?=E7=BD=AE=E9=A1=B6=E6=88=96=E8=80=85?= =?UTF-8?q?=E5=8F=96=E6=B6=88=E7=BD=AE=E9=A1=B6=E6=96=87=E7=AB=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dto/form/TopArticleFormDTO.java | 26 +++++++++++++++++++ .../epmet/controller/ArticleController.java | 11 ++++++++ .../com/epmet/service/ArticleService.java | 2 ++ .../service/impl/ArticleServiceImpl.java | 17 ++++++++++++ 4 files changed, 56 insertions(+) create mode 100644 epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/TopArticleFormDTO.java diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/TopArticleFormDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/TopArticleFormDTO.java new file mode 100644 index 0000000000..030fc58bd5 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/TopArticleFormDTO.java @@ -0,0 +1,26 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; + +/** + * @Description + * @Author yzm + * @Date 2022/9/21 15:13 + */ +@Data +public class TopArticleFormDTO { + /** + * 文章id + */ + @NotBlank(message = "文章id不能为空") + private String articleId; + /** + * top + * cancel_top + */ + @NotBlank(message = "type不能为空,置顶:top,取消置顶:cancel_top") + private String type; +} + diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java index 56b92b7d5c..bcbaf69fde 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java @@ -424,6 +424,17 @@ public class ArticleController { return new Result>().ok(articleService.articleListV2(formDTO)); } + /** + * 文章置顶、取消置顶 + * @param formDTO + * @return + */ + @PostMapping("topArticle") + public Result topArticle(@RequestBody TopArticleFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO); + articleService.topArticle(formDTO.getArticleId(),formDTO.getType()); + return new Result(); + } /** * @param tokenDTO * @return diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java index 127e7422ee..4a9269c42c 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java @@ -255,4 +255,6 @@ public interface ArticleService extends BaseService { PageData articleListV2(ArticleListFormDTO formDTO); PublishedListResultDTO detailV2(ArticleListFormDTO formDTO); + + void topArticle(String articleId, String type); } \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java index 3a01001543..b2099dd2a5 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java @@ -1775,4 +1775,21 @@ public class ArticleServiceImpl extends BaseServiceImpl Date: Wed, 21 Sep 2022 15:52:50 +0800 Subject: [PATCH 113/147] =?UTF-8?q?=E5=8F=91=E9=80=81=E9=80=9A=E7=9F=A5?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dto/form/SendNoticeFormDTO.java | 4 ---- .../service/impl/IcNoticeServiceImpl.java | 24 ++++++++----------- 2 files changed, 10 insertions(+), 18 deletions(-) diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/SendNoticeFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/SendNoticeFormDTO.java index 2ad93f4c75..56bdcc0fea 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/SendNoticeFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/SendNoticeFormDTO.java @@ -18,10 +18,6 @@ import java.util.List; @Data public class SendNoticeFormDTO implements Serializable { private static final long serialVersionUID = 4800907725063604885L; - /** - * 单独点击发送通知按钮:send_button - */ - // private String sendOrigin; private String customerId; private String staffId; /** diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNoticeServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNoticeServiceImpl.java index 23ddeb9e9f..4754780727 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNoticeServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNoticeServiceImpl.java @@ -145,14 +145,9 @@ public class IcNoticeServiceImpl extends BaseServiceImpl { if (StringUtils.isNotBlank(item.getIdCard())) { - //根据身份证获取居民ID + //根据身份证获取居民ID 如果一个客户下,存在多个身份证号相同的而用户,该接口只返回一个 List userList = userBaseInfoService.getCommonIdNumUser(item.getCustomerId(), item.getIdCard()); if (CollectionUtils.isNotEmpty(userList)) { - userList.forEach(user -> { + // userList.forEach(user -> { + UserBaseInfoDTO userBaseInfoDTO=userList.get(NumConstant.ZERO); UserMessageFormDTO messageFormDTO = new UserMessageFormDTO(); messageFormDTO.setCustomerId(item.getCustomerId()); messageFormDTO.setApp(AppClientConstant.APP_GOV); messageFormDTO.setGridId(StrConstant.STAR); - messageFormDTO.setUserId(user.getUserId()); + messageFormDTO.setUserId(userBaseInfoDTO.getUserId()); messageFormDTO.setTitle("您有一条通知消息!"); messageFormDTO.setMessageContent(item.getContent()); messageFormDTO.setReadFlag(Constant.UNREAD); messageFormDTO.setMessageType(UserMessageTypeConstant.ANTIEPIDEMIC); messageFormDTO.setTargetId(item.getId()); msgList.add(messageFormDTO); - }); + item.setUserId(userBaseInfoDTO.getUserId()); + // }); }else{ // 没有找到居民端的用户id,发送失败 item.setSendRes(NumConstant.ZERO_STR); - baseDao.updateById(item); } + baseDao.updateById(item); } //TODO 短信消息 - if (StringUtils.isNotBlank(item.getMobile())) { + /*if (StringUtils.isNotBlank(item.getMobile())) { ProjectSendMsgFormDTO sms = new ProjectSendMsgFormDTO(); sms.setCustomerId(item.getCustomerId()); sms.setMobile(item.getMobile()); sms.setAliyunTemplateCode(SmsTemplateConstant.PROJECT_OVERDUE); sms.setParameterKey("send_msg"); smsList.add(sms); - } + }*/ }); //发送小程序消息 Result result = messageFeignClient.saveUserMessageList(msgList); if (!result.success()) { log.error("发送小程序消息失败" + JSON.toJSONString(result)); } - //TODO 发送短信 } /** From eb29cf9965257405ca78f418f02d9d81466b76de Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Wed, 21 Sep 2022 16:52:06 +0800 Subject: [PATCH 114/147] =?UTF-8?q?=E8=A1=8C=E7=A8=8B=E9=9A=8F=E8=AE=BF?= =?UTF-8?q?=E7=9A=84=E9=9A=94=E7=A6=BB=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/service/impl/IcTripReportRecordServiceImpl.java | 1 + 1 file changed, 1 insertion(+) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcTripReportRecordServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcTripReportRecordServiceImpl.java index 97f5ed43e0..93c30d9d3f 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcTripReportRecordServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcTripReportRecordServiceImpl.java @@ -221,6 +221,7 @@ public class IcTripReportRecordServiceImpl extends BaseServiceImpl Date: Wed, 21 Sep 2022 17:11:24 +0800 Subject: [PATCH 115/147] =?UTF-8?q?=E7=96=AB=E8=8B=97=E5=85=B3=E6=B3=A8?= =?UTF-8?q?=E5=90=8D=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/IcEpidemicSpecialAttentionDao.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcEpidemicSpecialAttentionDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcEpidemicSpecialAttentionDao.xml index 951a4adee8..1b536b1618 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcEpidemicSpecialAttentionDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcEpidemicSpecialAttentionDao.xml @@ -86,6 +86,7 @@ WHERE a.DEL_FLAG = 0 AND concat(a.pids,':',ORG_ID) like concat('%',#{orgId},'%') AND a.ATTENTION_TYPE = #{attentionType} + AND a.IS_ATTENTION = 1 AND a.`NAME` LIKE CONCAT('%',#{name},'%') From 7153f5b95779e43f877fdfc52d24e8f63c0289ce Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 21 Sep 2022 17:47:55 +0800 Subject: [PATCH 116/147] =?UTF-8?q?=E7=94=A8miniappId=E8=8E=B7=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dto/form/ResiDingAppLoginFormDTO.java | 11 +++++++++-- .../com/epmet/service/impl/ThirdLoginServiceImpl.java | 7 +++++-- .../commons/tools/dto/form/DingMiniInfoFormDTO.java | 4 ++-- .../tools/redis/common/CustomerDingDingRedis.java | 6 +++--- .../com/epmet/service/impl/DingTalkServiceImpl.java | 7 +++---- .../src/main/resources/mapper/OpenSyncBizDataDao.xml | 2 +- 6 files changed, 23 insertions(+), 14 deletions(-) diff --git a/epmet-auth/src/main/java/com/epmet/dto/form/ResiDingAppLoginFormDTO.java b/epmet-auth/src/main/java/com/epmet/dto/form/ResiDingAppLoginFormDTO.java index 3638f76385..98c0f492b8 100644 --- a/epmet-auth/src/main/java/com/epmet/dto/form/ResiDingAppLoginFormDTO.java +++ b/epmet-auth/src/main/java/com/epmet/dto/form/ResiDingAppLoginFormDTO.java @@ -11,16 +11,23 @@ import javax.validation.constraints.NotBlank; */ @Data public class ResiDingAppLoginFormDTO { + public interface InnerMiniApp {} + public interface ThirdMiniApp {} /** * 授权统一后的authCode */ - @NotBlank(message = "authCode不能为空") + @NotBlank(message = "authCode不能为空",groups = InnerMiniApp.class) private String authCode; /** * 第三方企业应用传应用的SuiteKey */ @NotBlank(message = "clientId不能为空") private String clientId; + /** + * 第三方企业应用传应用的SuiteKey + */ + @NotBlank(message = "miniAppId不能为空",groups = InnerMiniApp.class) + private String miniAppId; // @NotBlank(message = "当前访问用户的企业corpId不能为空") // private String corpId; @@ -29,6 +36,6 @@ public class ResiDingAppLoginFormDTO { * third:第三方应用 * company_customize:企业定制应用 */ - private String appType="third"; + private String appType="company_customize"; } 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 0fad9bf77b..04c1fa4e0a 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 @@ -18,6 +18,8 @@ import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.exception.ExceptionUtils; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.feign.ResultDataResolver; +import com.epmet.commons.tools.redis.common.CustomerDingDingRedis; +import com.epmet.commons.tools.redis.common.bean.DingMiniInfoCache; import com.epmet.commons.tools.security.dto.GovTokenDto; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.security.password.PasswordUtils; @@ -737,8 +739,9 @@ public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResol } //1、获取用户手机号 - String clientId = formDTO.getClientId(); - DingTalkResult userAccessToken = dingTalkClientToken.getUserAccessToken(formDTO.getAuthCode(), clientId, DingMiniAppEnum.getEnum(clientId).getSuiteSecret()); + String miniAppId = formDTO.getMiniAppId(); + DingMiniInfoCache dingMiniInfo = CustomerDingDingRedis.getDingMiniInfo(miniAppId); + DingTalkResult userAccessToken = dingTalkClientToken.getUserAccessToken(formDTO.getAuthCode(), dingMiniInfo.getSuiteKey(), dingMiniInfo.getSuiteSecret()); log.info("2、resiLoginDing userAccessToken:{}",JSON.toJSONString(userAccessToken)); if (!userAccessToken.success() || null == userAccessToken.getData()) { throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "调用微信api异常:" + JSON.toJSONString(userAccessToken), EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getMsg()); diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/DingMiniInfoFormDTO.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/DingMiniInfoFormDTO.java index 57a28cadc8..bd36526985 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/DingMiniInfoFormDTO.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/DingMiniInfoFormDTO.java @@ -21,6 +21,6 @@ public class DingMiniInfoFormDTO implements Serializable { public interface DingMiniInfoForm{} - @NotBlank(message = "suiteKey不能为空",groups = DingMiniInfoForm.class) - private String suiteKey; + @NotBlank(message = "miniAppId不能为空",groups = DingMiniInfoForm.class) + private String miniAppId; } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerDingDingRedis.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerDingDingRedis.java index 834fccad2c..8a57fb1ca7 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerDingDingRedis.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerDingDingRedis.java @@ -39,13 +39,13 @@ public class CustomerDingDingRedis { customerDingDingRedis.redisUtils = this.redisUtils; } - public static DingMiniInfoCache getDingMiniInfo(String suiteKey){ - String key = RedisKeys.getDingMiniInfoKey(suiteKey); + public static DingMiniInfoCache getDingMiniInfo(String miniAppId){ + String key = RedisKeys.getDingMiniInfoKey(miniAppId); Map miniInfoMap = customerDingDingRedis.redisUtils.hGetAll(key); if (!CollectionUtils.isEmpty(miniInfoMap)){ return ConvertUtils.mapToEntity(miniInfoMap,DingMiniInfoCache.class); } - Result dingMiniInfoResult = customerDingDingRedis.thirdFeignClient.getDingMiniInfo(new DingMiniInfoFormDTO(suiteKey)); + Result dingMiniInfoResult = customerDingDingRedis.thirdFeignClient.getDingMiniInfo(new DingMiniInfoFormDTO(miniAppId)); if (!dingMiniInfoResult.success()){ throw new EpmetException("查询dingMiniInfo失败..."); } diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/DingTalkServiceImpl.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/DingTalkServiceImpl.java index 7fd6f809b5..ec239a3ee9 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/DingTalkServiceImpl.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/DingTalkServiceImpl.java @@ -53,13 +53,12 @@ public class DingTalkServiceImpl implements DingTalkService { */ @Override public DingMiniInfoCache getDingMiniInfo(DingMiniInfoFormDTO formDTO) { - String key = RedisKeys.getDingMiniInfoKey(formDTO.getSuiteKey()); + String key = RedisKeys.getDingMiniInfoKey(formDTO.getMiniAppId()); Map dingMiniInfoMap = redisUtils.hGetAll(key); if (!CollectionUtils.isEmpty(dingMiniInfoMap)) { - DingMiniInfoCache dingMiniInfoCache = ConvertUtils.mapToEntity(dingMiniInfoMap,DingMiniInfoCache.class); - return dingMiniInfoCache; + return ConvertUtils.mapToEntity(dingMiniInfoMap,DingMiniInfoCache.class); } - DingMiniInfoDTO dingMiniInfo = openSyncBizDataDao.getDingMiniInfo(formDTO.getSuiteKey()); + DingMiniInfoDTO dingMiniInfo = openSyncBizDataDao.getDingMiniInfoByAppId(formDTO.getMiniAppId()); if (null != dingMiniInfo){ redisUtils.hMSet(key, BeanUtil.beanToMap(dingMiniInfo)); return ConvertUtils.sourceToTarget(dingMiniInfo,DingMiniInfoCache.class); diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/OpenSyncBizDataDao.xml b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/OpenSyncBizDataDao.xml index b81b8b81ba..d6bec2cfa5 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/OpenSyncBizDataDao.xml +++ b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/OpenSyncBizDataDao.xml @@ -27,4 +27,4 @@ and corp_id = #{corpId} - \ No newline at end of file + From 9622de06154f6d9d5c5e394628b145d79894e92b Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 21 Sep 2022 17:51:57 +0800 Subject: [PATCH 117/147] =?UTF-8?q?=E8=A1=8C=E7=A8=8B=E4=B8=8A=E6=8A=A5?= =?UTF-8?q?=E3=80=81=E9=9A=94=E7=A6=BB=E9=98=B2=E7=96=AB=E3=80=81=E7=96=AB?= =?UTF-8?q?=E8=8B=97=E6=8E=A5=E7=A7=8D=E5=85=B3=E6=B3=A83=E4=B8=AA?= =?UTF-8?q?=E7=95=8C=E9=9D=A2=E5=8F=91=E9=80=81=E9=80=9A=E7=9F=A5=E8=B0=83?= =?UTF-8?q?=E7=94=A8sendNoticeV2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/dto/form/SendNoticeV2FormDTO.java | 50 +++++++++ .../epmet/controller/IcNoticeController.java | 16 ++- .../com/epmet/service/IcNoticeService.java | 7 ++ .../service/impl/IcNoticeServiceImpl.java | 101 ++++++++++++++++++ 4 files changed, 173 insertions(+), 1 deletion(-) create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/SendNoticeV2FormDTO.java diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/SendNoticeV2FormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/SendNoticeV2FormDTO.java new file mode 100644 index 0000000000..23e77ed29c --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/SendNoticeV2FormDTO.java @@ -0,0 +1,50 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotEmpty; +import javax.validation.constraints.Size; +import java.util.List; + +/** + * @Description + * @Author yzm + * @Date 2022/9/21 17:06 + */ +@Data +public class SendNoticeV2FormDTO { + // token获取 + private String customerId; + private String staffId; + // 前端传入 + /** + * 用户列表 + */ + @NotEmpty(message = "业务数据id不能为空", groups = CustomerClientShowGroup.class) + private List bdIds; + /** + * 通知渠道通知渠道 0小程序通知,1短信通知 + */ + @NotEmpty(message = "请选择通知渠道", groups = CustomerClientShowGroup.class) + private List channel; + /** + * v1:通知来源 0 行程上报,1 疫苗接种,2 核酸检测 + * v2:0行程上报,1疫苗接种关注名单,2重点人群关注名单-隔离防疫(原核酸检测关注名单) + */ + @NotEmpty(message = "通知来源不能为空", groups = CustomerClientShowGroup.class) + private String origin; + /** + * 通知内容 + */ + @Size(min = 1, max = 500, message = "通知内容不超过500字", groups = CustomerClientShowGroup.class) + private String content; + + // 接口内赋值 + /** + * 组织名 + */ + private String orgName; + +} + diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNoticeController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNoticeController.java index 325eb71c31..ada0124d86 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNoticeController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNoticeController.java @@ -4,7 +4,6 @@ import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.aop.NoRepeatSubmit; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; -import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.AssertUtils; import com.epmet.commons.tools.validator.ValidatorUtils; @@ -15,6 +14,7 @@ import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.dto.IcNoticeDTO; import com.epmet.dto.form.IcNoticeFormDTO; import com.epmet.dto.form.SendNoticeFormDTO; +import com.epmet.dto.form.SendNoticeV2FormDTO; import com.epmet.dto.form.SendPointNoticeFormDTO; import com.epmet.dto.result.CommunityInfoResultDTO; import com.epmet.feign.GovOrgFeignClient; @@ -108,4 +108,18 @@ public class IcNoticeController { return new Result(); } + /** + * 行程上报、重点人群关注名单、疫苗接种关注名单这几个页面的发送通知 + * @param tokenDto + * @param formDTO + * @return + */ + @PostMapping("sendNoticeV2") + public Result sendNoticeV2(@LoginUser TokenDto tokenDto, @RequestBody SendNoticeV2FormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, CustomerClientShowGroup.class); + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setStaffId(tokenDto.getUserId()); + icNoticeService.sendNoticeV2(formDTO); + return new Result(); + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcNoticeService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcNoticeService.java index 9c65229972..9be6485b37 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcNoticeService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcNoticeService.java @@ -5,6 +5,7 @@ import com.epmet.commons.tools.page.PageData; import com.epmet.dto.IcNoticeDTO; import com.epmet.dto.form.IcNoticeFormDTO; import com.epmet.dto.form.SendNoticeFormDTO; +import com.epmet.dto.form.SendNoticeV2FormDTO; import com.epmet.dto.form.SendPointNoticeFormDTO; import com.epmet.entity.IcNoticeEntity; @@ -115,4 +116,10 @@ public interface IcNoticeService extends BaseService { * @return */ Map getUserLatestNoticeTime(String customerId,List idCardSet); + + /** + * 行程上报、重点人群关注名单、疫苗接种关注名单这几个页面的发送通知 + * @param formDTO + */ + void sendNoticeV2(SendNoticeV2FormDTO formDTO); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNoticeServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNoticeServiceImpl.java index 4754780727..710dd05ee9 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNoticeServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNoticeServiceImpl.java @@ -13,11 +13,15 @@ import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.constant.SmsTemplateConstant; import com.epmet.constant.UserMessageTypeConstant; +import com.epmet.dao.IcEpidemicSpecialAttentionDao; import com.epmet.dao.IcNoticeDao; +import com.epmet.dao.IcTripReportRecordDao; import com.epmet.dto.IcNoticeDTO; import com.epmet.dto.UserBaseInfoDTO; import com.epmet.dto.form.*; +import com.epmet.entity.IcEpidemicSpecialAttentionEntity; import com.epmet.entity.IcNoticeEntity; +import com.epmet.entity.IcTripReportRecordEntity; import com.epmet.feign.MessageFeignClient; import com.epmet.service.IcNoticeService; import com.epmet.service.UserBaseInfoService; @@ -26,6 +30,7 @@ import com.github.pagehelper.PageInfo; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -47,6 +52,10 @@ public class IcNoticeServiceImpl extends BaseServiceImpl page(IcNoticeFormDTO formDTO) { @@ -333,4 +342,96 @@ public class IcNoticeServiceImpl extends BaseServiceImpl userBeanList = null; + List entityList = new ArrayList<>(); + for (String bdId : formDTO.getBdIds()) { + IcNoticeEntity entity = new IcNoticeEntity(); + entity.setCustomerId(formDTO.getCustomerId()); + entity.setChannel(channel); + entity.setContent(formDTO.getContent()); + entity.setOrigin(formDTO.getOrigin()); + // 这时候还不知道居民端的用户id + entity.setUserId(StrConstant.EPMETY_STR); + entity.setOrgName(finalOrgName); + // 发送结果:1成功,0失败 默认插入发送成功。下面没有找到居民端的用户id,会更新 + entity.setSendRes(NumConstant.ONE_STR); + // v2:0行程上报,1疫苗接种关注名单,2隔离防疫原核酸检测 + // 身份证号手机号 + if (NumConstant.ZERO_STR.equals(formDTO.getOrigin())) { + IcTripReportRecordEntity icTripReportRecordEntity = icTripReportRecordDao.selectById(bdId); + entity.setMobile(icTripReportRecordEntity.getMobile()); + entity.setIdCard(icTripReportRecordEntity.getIdCard()); + } else if (NumConstant.ONE_STR.equals(formDTO.getOrigin()) || NumConstant.TWO_STR.equals(formDTO.getOrigin())) { + IcEpidemicSpecialAttentionEntity icEpidemicSpecialAttentionEntity = icEpidemicSpecialAttentionDao.selectById(bdId); + entity.setMobile(icEpidemicSpecialAttentionEntity.getMobile()); + entity.setIdCard(icEpidemicSpecialAttentionEntity.getIdCard()); + } + entityList.add(entity); + } + if (CollectionUtils.isEmpty(entityList)) { + return; + } + insertBatch(entityList); + + // 通知渠道通知渠道 0小程序通知,1短信通知 + for (String channelValue : formDTO.getChannel()) { + if ("0".equals(channelValue)) { + // 小程序通知 + List msgList = new ArrayList<>(); + entityList.forEach(item -> { + // 根据身份证获取居民ID 如果一个客户下,存在多个身份证号相同的而用户,该接口只返回一个 + List userList = userBaseInfoService.getCommonIdNumUser(item.getCustomerId(), item.getIdCard()); + if (CollectionUtils.isNotEmpty(userList)) { + UserBaseInfoDTO userBaseInfoDTO = userList.get(NumConstant.ZERO); + UserMessageFormDTO messageFormDTO = new UserMessageFormDTO(); + messageFormDTO.setCustomerId(item.getCustomerId()); + messageFormDTO.setApp(AppClientConstant.APP_GOV); + messageFormDTO.setGridId(StrConstant.STAR); + messageFormDTO.setUserId(userBaseInfoDTO.getUserId()); + messageFormDTO.setTitle("您有一条通知消息!"); + messageFormDTO.setMessageContent(item.getContent()); + messageFormDTO.setReadFlag(Constant.UNREAD); + messageFormDTO.setMessageType(UserMessageTypeConstant.ANTIEPIDEMIC); + messageFormDTO.setTargetId(item.getId()); + msgList.add(messageFormDTO); + item.setUserId(userBaseInfoDTO.getUserId()); + } else { + // 没有找到居民端的用户id,发送失败 + item.setSendRes(NumConstant.ZERO_STR); + } + baseDao.updateById(item); + }); + // 发送小程序消息-站内信 + Result result = messageFeignClient.saveUserMessageList(msgList); + if (!result.success()) { + log.warn("发送小程序消息失败" + JSON.toJSONString(result)); + } + } else { + // 短信通知再说 todo + } + + + } + + + } + + + } From fed0d22f45ea92471397fdc11e9be9ae59d0a99c Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Wed, 21 Sep 2022 17:55:13 +0800 Subject: [PATCH 118/147] =?UTF-8?q?=E5=94=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dto/IcTripReportRecordDTO.java | 3 +++ .../mapper/IcTripReportRecordDao.xml | 21 ++++++++++--------- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcTripReportRecordDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcTripReportRecordDTO.java index 508f8dc2ad..af101625d0 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcTripReportRecordDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcTripReportRecordDTO.java @@ -35,6 +35,9 @@ public class IcTripReportRecordDTO implements Serializable { @ExcelIgnore private String id; + @ExcelIgnore + private String epidemicId; + /** * 居民端用户所在网格id,数字社区居民所属网格id */ diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcTripReportRecordDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcTripReportRecordDao.xml index 15a413748b..34d7f40da1 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcTripReportRecordDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcTripReportRecordDao.xml @@ -26,35 +26,36 @@ SELECT r.*, - a.ID AS epidemicId, r.CREATED_TIME AS reportTime, r.ID_CARD as realIdCard FROM ic_trip_report_record r - LEFT JOIN ic_epidemic_special_attention a ON (a.ID_CARD = r.ID_CARD AND a.DEL_FLAG = 0 AND a.IS_ATTENTION = 1 AND a.ATTENTION_TYPE = 2) WHERE r.DEL_FLAG = '0' AND r.CUSTOMER_ID = #{customerId} From d37b2cbecd3ff7141450a1329668d920ac08d015 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 21 Sep 2022 18:44:09 +0800 Subject: [PATCH 120/147] =?UTF-8?q?=E8=A1=8C=E7=A8=8B=E4=B8=8A=E6=8A=A5-?= =?UTF-8?q?=E5=88=97=E8=A1=A8huifu?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/IcTripReportRecordDao.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcTripReportRecordDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcTripReportRecordDao.xml index 13c42a47d7..fae60824fe 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcTripReportRecordDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcTripReportRecordDao.xml @@ -26,9 +26,11 @@ + + From b60550ec7791559c5d114ca7c4ef78972192d2d7 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Fri, 23 Sep 2022 09:58:07 +0800 Subject: [PATCH 137/147] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=B8=8B=E6=8A=A5?= =?UTF-8?q?=E9=94=99=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/service/impl/ThirdLoginServiceImpl.java | 4 ++-- .../java/com/epmet/service/impl/UserBaseInfoServiceImpl.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) 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 65b53528fa..70c253d2c3 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 @@ -910,8 +910,8 @@ public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResol Result loginResiResDTOResult = epmetUserOpenFeignClient.dingResiLogin(dingLoginResiFormDTO); if (!loginResiResDTOResult.success() || null == loginResiResDTOResult.getData()) { // 临时打个日志 - log.error(String.format("resiLoginInternalDing获取epmetUserId异常,入参:%s,user服务返参:%s", JSON.toJSONString(formDTO), JSON.toJSONString(loginResiResDTOResult))); - throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取epmetUserId异常:" + JSON.toJSONString(loginResiResDTOResult), EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getMsg()); + log.error(String.format("resiLoginInternalDing获取epmetUserId异常,入参:%s", JSON.toJSONString(dingLoginResiFormDTO))); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取epmetUserId异常:"+ JSON.toJSONString(loginResiResDTOResult), "获取epmetUserId异常"); } DingLoginResiResDTO resiResDTO = loginResiResDTOResult.getData(); resDTO.setGridId(resiResDTO.getGridId()); diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBaseInfoServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBaseInfoServiceImpl.java index 101836464e..a814563558 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBaseInfoServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBaseInfoServiceImpl.java @@ -593,8 +593,8 @@ public class UserBaseInfoServiceImpl extends BaseServiceImpl Date: Fri, 23 Sep 2022 10:35:09 +0800 Subject: [PATCH 138/147] =?UTF-8?q?=E6=8A=A5=E9=94=99=E8=A7=A3=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/UserBaseInfoDao.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/UserBaseInfoDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/UserBaseInfoDao.xml index ccde3a763e..3792e92ce5 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/UserBaseInfoDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/UserBaseInfoDao.xml @@ -154,16 +154,16 @@ AND ubi.DEL_FLAG = '0' + From 168f8469c6a6ba3fd92aa2801dd1a8180e369140 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Fri, 23 Sep 2022 11:12:46 +0800 Subject: [PATCH 139/147] =?UTF-8?q?=E4=B8=80=E8=BF=9B=E5=B1=85=E6=B0=91?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E9=A1=B5=E9=9D=A2=E5=B0=B1=E6=8A=A5=E9=94=99?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/service/impl/IcResiUserExportServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserExportServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserExportServiceImpl.java index 8157ac1ccf..b0b9a12f77 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserExportServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserExportServiceImpl.java @@ -276,7 +276,7 @@ public class IcResiUserExportServiceImpl implements IcResiUserExportService { param.setExportConfig(exportConfig); Result exportConfigResult = operCustomizeOpenFeignClient.getExcelHeaderAndSqlColumnForExport(param); if (!exportConfigResult.success()) { - log.error("获取模板失败,internalMsg:{},msg:{}", exportConfigResult.getInternalMsg(), exportConfigResult.getMsg()); + log.error("/oper/customize/icExportTemplate/getExcelHeaderAndSqlColumnForExport获取模板失败,入参{},internalMsg:{},msg:{}", JSON.toJSONString(param), exportConfigResult.getInternalMsg(), exportConfigResult.getMsg()); throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), exportConfigResult.getInternalMsg(), exportConfigResult.getInternalMsg()); } IcCustomExportResultDTO data = exportConfigResult.getData(); From ce49c308e7453c10ea1274deeed24d2a68b8730e Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Fri, 23 Sep 2022 13:05:46 +0800 Subject: [PATCH 140/147] =?UTF-8?q?=E8=A1=8C=E7=A8=8B=E9=9A=8F=E8=AE=BF?= =?UTF-8?q?=E7=82=B9=E5=87=BB=E5=8A=A0=E5=85=A5=E9=87=8D=E7=82=B9=E4=BA=BA?= =?UTF-8?q?=E7=BE=A4=E5=85=B3=E6=B3=A8=E9=BB=98=E8=AE=A4=E5=B1=85=E5=AE=B6?= =?UTF-8?q?=E9=9A=94=E7=A6=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/dto/IcEpidemicSpecialAttentionDTO.java | 7 +++++-- .../java/com/epmet/dto/form/VaccinationListFormDTO.java | 3 +++ .../com/epmet/dto/result/VaccinationListResultDTO.java | 3 +++ .../com/epmet/entity/IcEpidemicSpecialAttentionEntity.java | 2 +- .../impl/IcEpidemicSpecialAttentionServiceImpl.java | 4 ++++ .../db/migration/V0.0.72__icepidemic_ISOLATED_STATE .sql | 1 + 6 files changed, 17 insertions(+), 3 deletions(-) create mode 100644 epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.72__icepidemic_ISOLATED_STATE .sql diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcEpidemicSpecialAttentionDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcEpidemicSpecialAttentionDTO.java index fddaa92fc9..5d880153a6 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcEpidemicSpecialAttentionDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcEpidemicSpecialAttentionDTO.java @@ -62,13 +62,16 @@ public class IcEpidemicSpecialAttentionDTO implements Serializable { private String isHistory; /** - * 隔离类型,来自字典表 + * 隔离类型,来自字典表;集中隔离:0;居家隔离1;居家健康监测2;已出隔离期3 */ // @NotBlank(message = "isolatedState不能为空",groups = {IcEpidemicSpecialAttentionAdd.class,IcEpidemicSpecialAttentionUpdate.class}) private String isolatedState; /** - * 关注类型,核酸检测:2,疫苗接种:1,行程上报:0 + * 关注类型, + * 核酸检测:2, + * 疫苗接种:1, + * 行程上报:0 */ @NotNull(message = "attentionType不能为空",groups = {IcEpidemicSpecialAttentionAdd.class,IcEpidemicSpecialAttentionUpdate.class}) private Integer attentionType; diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/VaccinationListFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/VaccinationListFormDTO.java index 66742465ad..cc06182a72 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/VaccinationListFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/VaccinationListFormDTO.java @@ -24,6 +24,9 @@ public class VaccinationListFormDTO extends PageFormDTO implements Serializable @NotNull(message = "attentionType不能为空",groups = VaccinationListForm.class) private Integer attentionType; + /** + * 隔离类型,来自字典表;集中隔离:0;居家隔离1;居家健康监测2;已出隔离期3 + */ private String isolatedState; private String isHistory; diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/VaccinationListResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/VaccinationListResultDTO.java index b85a16a0d7..7099e1650b 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/VaccinationListResultDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/VaccinationListResultDTO.java @@ -117,6 +117,9 @@ public class VaccinationListResultDTO implements Serializable { * 小区名+楼栋名+单元名+房屋名 */ private String allName; + /** + * 隔离类型,来自字典表;集中隔离:0;居家隔离1;居家健康监测2;已出隔离期3 + */ private String isolatedState; private String id; private String userId; diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcEpidemicSpecialAttentionEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcEpidemicSpecialAttentionEntity.java index b4eb253957..a22f3f3537 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcEpidemicSpecialAttentionEntity.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcEpidemicSpecialAttentionEntity.java @@ -49,7 +49,7 @@ public class IcEpidemicSpecialAttentionEntity extends BaseEpmetEntity { private String isHistory; /** - * 隔离类型,来自字典表 + * 隔离类型,来自字典表;集中隔离:0;居家隔离1;居家健康监测2;已出隔离期3 */ private String isolatedState; diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcEpidemicSpecialAttentionServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcEpidemicSpecialAttentionServiceImpl.java index 25a3a82403..65070ee096 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcEpidemicSpecialAttentionServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcEpidemicSpecialAttentionServiceImpl.java @@ -309,6 +309,10 @@ public class IcEpidemicSpecialAttentionServiceImpl extends BaseServiceImpl Date: Fri, 23 Sep 2022 18:30:46 +0800 Subject: [PATCH 141/147] autoreguser-ding --- .../java/com/epmet/service/impl/UserResiInfoServiceImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserResiInfoServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserResiInfoServiceImpl.java index 7dee21dc15..3efd7e01fa 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserResiInfoServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserResiInfoServiceImpl.java @@ -579,7 +579,7 @@ public class UserResiInfoServiceImpl extends BaseServiceImpl Date: Mon, 26 Sep 2022 12:35:54 +0800 Subject: [PATCH 142/147] warn --- .../epmet/modules/group/service/impl/ResiGroupServiceImpl.java | 2 +- .../java/com/epmet/service/impl/UserBaseInfoServiceImpl.java | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java index 95b136c9ac..493d176a07 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java @@ -1171,7 +1171,7 @@ public class ResiGroupServiceImpl extends BaseServiceImpl Date: Mon, 26 Sep 2022 14:07:37 +0800 Subject: [PATCH 143/147] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E7=99=BB=E8=AE=B0=E3=80=81=E7=96=AB=E6=83=85=E9=98=B2=E6=8E=A7?= =?UTF-8?q?=E3=80=81=E8=AE=AE=E4=BA=8B=E5=8E=853=E4=B8=AA=E5=BA=94?= =?UTF-8?q?=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/db/migration/V0.0.15__other3app.sql | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 epmet-module/epmet-third/epmet-third-server/src/main/resources/db/migration/V0.0.15__other3app.sql diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/resources/db/migration/V0.0.15__other3app.sql b/epmet-module/epmet-third/epmet-third-server/src/main/resources/db/migration/V0.0.15__other3app.sql new file mode 100644 index 0000000000..0904d7bff2 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/resources/db/migration/V0.0.15__other3app.sql @@ -0,0 +1,3 @@ +INSERT INTO `epmet_third`.`ding_mini_info` (`ID`, `SUITE_ID`, `APP_ID`, `MINI_APP_ID`, `SUITE_NAME`, `SUITE_KEY`, `SUITE_SECRET`, `TOKEN`, `AES_KEY`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1005', '1912268145', '', '5000000003054196', '信息登记', 'dingtbmsztg41nmbclzi', '6mdIbt8xWkKOkGasxqQt44uNEri-KQWSmMX1u7weTMEuoGWwQsoYSyc0hBeoQGEj', '', NULL, 0, 0, '烟台企业内部应用', '2022-09-26 14:03:32', '烟台企业内部应用', '2022-09-26 14:03:40'); +INSERT INTO `epmet_third`.`ding_mini_info` (`ID`, `SUITE_ID`, `APP_ID`, `MINI_APP_ID`, `SUITE_NAME`, `SUITE_KEY`, `SUITE_SECRET`, `TOKEN`, `AES_KEY`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1006', '1912172899', '', '5000000003054651', '疫情防控', 'dingye4npkwn5l8gate0', 'iOqq_5nURdTr-69DKukTfpzmkJIN5UBCQNlOdB-g6PucCC2UG-wrXmyC2XEylkuE', '', NULL, 0, 0, '烟台企业内部应用', '2022-09-26 14:04:39', '烟台企业内部应用', '2022-09-26 14:04:46'); +INSERT INTO `epmet_third`.`ding_mini_info` (`ID`, `SUITE_ID`, `APP_ID`, `MINI_APP_ID`, `SUITE_NAME`, `SUITE_KEY`, `SUITE_SECRET`, `TOKEN`, `AES_KEY`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1007', '1912176853', '', '5000000003054757', '议事厅', 'ding56hee9xi5kxlmpbp', 'Y16WoB0qD0k8N7NY2J7HLyHGGAkhlBj9Bxkpa1cFuUUrTZlH2SfLvP4ZYnsvxC7f', '', NULL, 0, 0, '烟台企业内部应用', '2022-09-26 14:05:40', '烟台企业内部应用', '2022-09-26 14:05:43'); From 821f349eceab10e0c0fe3f75027d81bec36167f5 Mon Sep 17 00:00:00 2001 From: jianjun Date: Mon, 26 Sep 2022 14:58:23 +0800 Subject: [PATCH 144/147] =?UTF-8?q?=E8=8F=9C=E5=8D=95=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E9=A2=9C=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/dto/GovMenuDTO.java | 4 ++++ .../src/main/java/com/epmet/entity/GovMenuEntity.java | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/GovMenuDTO.java b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/GovMenuDTO.java index 91ef00b75a..d5ca9f7008 100644 --- a/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/GovMenuDTO.java +++ b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/GovMenuDTO.java @@ -65,6 +65,10 @@ public class GovMenuDTO extends TreeStringNode implements Serializab * 菜单图标 */ private String icon; + /** + * 菜单颜色 + */ + private String color; /** * 权限标识,如:sys:menu:save diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/entity/GovMenuEntity.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/entity/GovMenuEntity.java index 9c1c3922ed..6eba2e36d1 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/entity/GovMenuEntity.java +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/entity/GovMenuEntity.java @@ -47,6 +47,10 @@ public class GovMenuEntity extends BaseEpmetEntity { * 菜单图标 */ private String icon; + /** + * 菜单颜色 + */ + private String color; /** * 权限标识,如:sys:menu:save */ From c9fc14e729f623614fb761da97ab56818d7725cd Mon Sep 17 00:00:00 2001 From: jianjun Date: Mon, 26 Sep 2022 17:09:30 +0800 Subject: [PATCH 145/147] =?UTF-8?q?=E8=8F=9C=E5=8D=95=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E9=A2=9C=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dto/result/OftenUseFunctionListResultDTO.java | 5 +++++ .../src/main/resources/mapper/IcOftenUseFunctionDao.xml | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/result/OftenUseFunctionListResultDTO.java b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/result/OftenUseFunctionListResultDTO.java index 73ff018a10..46698701ed 100644 --- a/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/result/OftenUseFunctionListResultDTO.java +++ b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/result/OftenUseFunctionListResultDTO.java @@ -38,4 +38,9 @@ public class OftenUseFunctionListResultDTO implements Serializable { * 排序 */ private String sort; + + /** + * 菜单颜色 + */ + private String color; } diff --git a/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/IcOftenUseFunctionDao.xml b/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/IcOftenUseFunctionDao.xml index 5f25af85fc..35d01fb929 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/IcOftenUseFunctionDao.xml +++ b/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/IcOftenUseFunctionDao.xml @@ -15,7 +15,8 @@ ic.MENU_ID, gm.url, gm.icon, - gl.field_value AS menuName + gl.field_value AS menuName, + gm.color FROM ic_often_use_function ic INNER JOIN gov_customer_menu gc ON (gc.TABLE_ID = ic.MENU_ID AND gc.DEL_FLAG = '0' AND ic.CUSTOMER_ID = gc.CUSTOMER_ID) INNER JOIN gov_menu gm ON (gc.TABLE_ID = gm.id AND gm.DEL_FLAG = 0 AND gm.SHOW_FLAG = 1) @@ -24,4 +25,4 @@ AND ic.USER_ID = #{userId} ORDER BY ic.SORT - \ No newline at end of file + From 0d2b581510118948addc20ddafb8bb809b019997 Mon Sep 17 00:00:00 2001 From: jianjun Date: Mon, 26 Sep 2022 17:24:08 +0800 Subject: [PATCH 146/147] =?UTF-8?q?=E8=8F=9C=E5=8D=95=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E9=A2=9C=E8=89=B2=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/resources/db/migration/V0.0.9__alter_menu_color.sql | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 epmet-module/gov-access/gov-access-server/src/main/resources/db/migration/V0.0.9__alter_menu_color.sql diff --git a/epmet-module/gov-access/gov-access-server/src/main/resources/db/migration/V0.0.9__alter_menu_color.sql b/epmet-module/gov-access/gov-access-server/src/main/resources/db/migration/V0.0.9__alter_menu_color.sql new file mode 100644 index 0000000000..78036e8f34 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/resources/db/migration/V0.0.9__alter_menu_color.sql @@ -0,0 +1,2 @@ +ALTER TABLE `epmet_gov_access`.`gov_menu` + ADD COLUMN `color` varchar(16) DEFAULT '' COMMENT '菜单颜色' AFTER `icon`; From d32a8cd0ea4c184f4e91e8c47623dd21316f6d47 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 27 Sep 2022 13:32:05 +0800 Subject: [PATCH 147/147] =?UTF-8?q?=E6=85=8E=E7=A4=BC=E7=A4=BE=E5=8C=BA?= =?UTF-8?q?=E9=92=89=E9=92=89=E4=BC=81=E4=B8=9A=E5=86=85=E9=83=A8=E5=BA=94?= =?UTF-8?q?=E7=94=A8=E7=A7=98=E9=92=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/db/migration/V0.0.16__shenli4app.sql | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 epmet-module/epmet-third/epmet-third-server/src/main/resources/db/migration/V0.0.16__shenli4app.sql diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/resources/db/migration/V0.0.16__shenli4app.sql b/epmet-module/epmet-third/epmet-third-server/src/main/resources/db/migration/V0.0.16__shenli4app.sql new file mode 100644 index 0000000000..de86515689 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/resources/db/migration/V0.0.16__shenli4app.sql @@ -0,0 +1,4 @@ +INSERT INTO `epmet_third`.`ding_mini_info` (`ID`, `SUITE_ID`, `APP_ID`, `MINI_APP_ID`, `SUITE_NAME`, `SUITE_KEY`, `SUITE_SECRET`, `TOKEN`, `AES_KEY`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1008', '1914273833', '', '5000000003069546', '随手拍', 'dingpvk106h0eca7btlm', 'zLF8ld6pF40NLUxC2aRKP7yfXreRpSRJTCN48_kyAQtretSLBfSpFMX6prUOaH_Z', '', NULL, 0, 0, '烟台企业内部应用_慎礼社区', '2022-09-27 13:03:32', '烟台企业内部应用_慎礼社区', '2022-09-27 13:03:40'); +INSERT INTO `epmet_third`.`ding_mini_info` (`ID`, `SUITE_ID`, `APP_ID`, `MINI_APP_ID`, `SUITE_NAME`, `SUITE_KEY`, `SUITE_SECRET`, `TOKEN`, `AES_KEY`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1009', '1914301613', '', '5000000003069487', '随时讲', 'ding1ept2iaynjxu2w6o', 'xSXSennTbJG8nc-IjjsrG1zEugNoCp2rLhT7pS0vInT7OnPZ5FgY3974aR9D-xd2', '', NULL, 0, 0, '烟台企业内部应用_慎礼社区', '2022-09-27 13:03:32', '烟台企业内部应用_慎礼社区', '2022-09-27 13:03:40'); +INSERT INTO `epmet_third`.`ding_mini_info` (`ID`, `SUITE_ID`, `APP_ID`, `MINI_APP_ID`, `SUITE_NAME`, `SUITE_KEY`, `SUITE_SECRET`, `TOKEN`, `AES_KEY`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1010', '1914266905', '', '5000000003069391', '我的报事', 'dingpzsyljcsbu3fbac5', 'fWRzS2W59fwx__istOF23mHq1S0hAs64nZhcmljrSLLMYrceZVsz7GhgG4izZvhy', '', NULL, 0, 0, '烟台企业内部应用_慎礼社区', '2022-09-27 13:03:32', '烟台企业内部应用_慎礼社区', '2022-09-27 13:03:40'); +INSERT INTO `epmet_third`.`ding_mini_info` (`ID`, `SUITE_ID`, `APP_ID`, `MINI_APP_ID`, `SUITE_NAME`, `SUITE_KEY`, `SUITE_SECRET`, `TOKEN`, `AES_KEY`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1011', '1914338340', '', '5000000003069669', '实时动态', 'dingflbhlrd1epy11irl', '47OE8jNuSj-JoOPBx7ZCqEii4fycnWtY2x97ndu3Mk2BOh9ElKMNuOGNU0zzshVn', '', NULL, 0, 0, '烟台企业内部应用_慎礼社区', '2022-09-27 13:03:32', '烟台企业内部应用_慎礼社区', '2022-09-27 13:03:40');