From 690784b0800861e451b941de5acc1d1150367d58 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 20 Sep 2022 09:16:38 +0800 Subject: [PATCH 1/3] a --- .../main/resources/mapper/IcEpidemicSpecialAttentionDao.xml | 3 +++ 1 file changed, 3 insertions(+) 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 d6965038cd..2efa16eb77 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 @@ -142,6 +142,9 @@ AND a.isolated_state = #{isolatedState} + + AND a.isolated_state is not null + AND a.IS_ATTENTION = 1 From b2815d7482088b79aceab4079f9c53f32273bb25 Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 20 Sep 2022 11:20:45 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E9=80=9A=E8=BF=87=E8=B4=A6=E5=8F=B7?= =?UTF-8?q?=E7=99=BB=E9=99=86=20=E6=96=B9=E6=B3=95=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/ThirdLoginController.java | 2 +- .../form/ThirdStaffOrgByAccountFormDTO.java | 23 +++---------------- .../service/impl/ThirdLoginServiceImpl.java | 12 +++++++++- .../epmet/commons/tools/redis/RedisKeys.java | 12 ++++++++++ 4 files changed, 27 insertions(+), 22 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 e8977cd508..68a5526ece 100644 --- a/epmet-auth/src/main/java/com/epmet/controller/ThirdLoginController.java +++ b/epmet-auth/src/main/java/com/epmet/controller/ThirdLoginController.java @@ -110,7 +110,7 @@ public class ThirdLoginController { **/ @PostMapping(value = "/getmyorgbyaccount") public Result> getMyOrgByAccount(@RequestBody ThirdStaffOrgByAccountFormDTO formDTO) { - ValidatorUtils.validateEntity(formDTO, StaffOrgByAccountFormDTO.AddUserShowGroup.class, StaffOrgByAccountFormDTO.GetMyOrgByPassWordGroup.class); + ValidatorUtils.validateEntity(formDTO); List staffOrgs = thirdLoginService.getMyOrgByAccount(formDTO); return new Result>().ok(staffOrgs); } diff --git a/epmet-auth/src/main/java/com/epmet/dto/form/ThirdStaffOrgByAccountFormDTO.java b/epmet-auth/src/main/java/com/epmet/dto/form/ThirdStaffOrgByAccountFormDTO.java index 3cad308ab6..fd1d93b725 100644 --- a/epmet-auth/src/main/java/com/epmet/dto/form/ThirdStaffOrgByAccountFormDTO.java +++ b/epmet-auth/src/main/java/com/epmet/dto/form/ThirdStaffOrgByAccountFormDTO.java @@ -1,6 +1,5 @@ package com.epmet.dto.form; -import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; import lombok.Data; import javax.validation.constraints.NotBlank; @@ -13,36 +12,20 @@ import java.io.Serializable; @Data public class ThirdStaffOrgByAccountFormDTO 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}) + @NotBlank(message = "appId不能为空") private String appId; /** * 手机号 */ - @NotBlank(message = "账号不能为空", groups = {AddUserShowGroup.class}) + @NotBlank(message = "账号不能为空") private String userAccount; - /** - * 验证码 - */ - @NotBlank(message="验证码不能为空", groups = {GetMyOrgByLoginWxmp.class}) - private String smsCode; - - @NotBlank(message = "密码不能为空",groups ={GetMyOrgByPassWordGroup.class}) + @NotBlank(message = "密码不能为空") private String password; } 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 cd1495ddb2..01c844a156 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 @@ -14,6 +14,8 @@ import com.epmet.commons.tools.exception.EpmetErrorCode; 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.RedisKeys; +import com.epmet.commons.tools.redis.RedisUtils; import com.epmet.commons.tools.security.dto.GovTokenDto; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.security.password.PasswordUtils; @@ -73,6 +75,8 @@ public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResol private EpmetMessageOpenFeignClient messageOpenFeignClient; @Autowired private LoginUserUtil loginUserUtil; + @Autowired + private RedisUtils redisUtils; /** * @param formDTO @@ -669,6 +673,11 @@ public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResol * @author zxc */ public PaCustomerDTO getCustomerInfo(String appId){ + String redisKey = RedisKeys.getThirdCustomerInfoByAppId(appId); + PaCustomerDTO customer = (PaCustomerDTO) redisUtils.get(redisKey); + if (customer != null && StringUtils.isNotBlank(customer.getId())){ + return customer; + } JSONObject jsonObject = new JSONObject(); String data = HttpClientManager.getInstance().sendPostByJSON(AuthHttpUrlConstant.CUSTOMER_MSG_URL + appId, JSON.toJSONString(jsonObject)).getData(); logger.info("ThirdLoginServiceImpl.getCustomerInfo:httpclient->url:"+AuthHttpUrlConstant.CUSTOMER_MSG_URL+",结果->"+data); @@ -684,8 +693,9 @@ public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResol Object PublicCustomerResultDTO = mapToResult.getData(); JSONObject json = JSON.parseObject(PublicCustomerResultDTO.toString()); Map map = (Map)json.get("customer"); - PaCustomerDTO customer = ConvertUtils.mapToEntity(map, PaCustomerDTO.class); + customer = ConvertUtils.mapToEntity(map, PaCustomerDTO.class); logger.info("小程序登陆third服务获取客户用户信息PaCustomerDTO->"+customer); + redisUtils.set(redisKey,customer); return customer; } 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..b445618c07 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,16 @@ public class RedisKeys { public static String getDhToken() { return rootPrefix.concat("dh:token"); } + + /** + * desc:根据appId 获取 客户信息key + * @param appId + * @return + */ + public static String getThirdCustomerInfoByAppId(String appId) { + if (StringUtils.isBlank(appId)){ + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"参数错误"); + } + return rootPrefix.concat("third:customerInfo")+appId; + } } From 33070638713bb77ba0b197a20296cd4f6cfe847a Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 20 Sep 2022 12:23:34 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E9=80=9A=E8=BF=87=E8=B4=A6=E5=8F=B7?= =?UTF-8?q?=E7=99=BB=E9=99=86=20=E6=96=B9=E6=B3=95=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/commons/tools/redis/RedisKeys.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 b445618c07..4d371d366f 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,6 +881,6 @@ public class RedisKeys { if (StringUtils.isBlank(appId)){ throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"参数错误"); } - return rootPrefix.concat("third:customerInfo")+appId; + return rootPrefix.concat("third:customerInfo:appId:")+appId; } }