diff --git a/epmet-auth/src/main/java/com/epmet/service/impl/GovWebServiceImpl.java b/epmet-auth/src/main/java/com/epmet/service/impl/GovWebServiceImpl.java index 91828cb561..e83b6e78e7 100644 --- a/epmet-auth/src/main/java/com/epmet/service/impl/GovWebServiceImpl.java +++ b/epmet-auth/src/main/java/com/epmet/service/impl/GovWebServiceImpl.java @@ -84,6 +84,11 @@ public class GovWebServiceImpl implements GovWebService, ResultDataResolver { logger.warn("根据手机号查询PC工作端登陆人员信息失败,返回10003账号不存在"); throw new RenException(EpmetErrorCode.ERR10003.getCode()); } + if ("diabled".equals(result.getData().getEnableFlag())) { + throw new EpmetException(EpmetErrorCode.GOV_STAFF_DISABLED.getCode(), + String.format("当前账号已被禁用staffId:%s", result.getData().getUserId()), + EpmetErrorCode.GOV_STAFF_DISABLED.getMsg()); + } GovWebOperLoginResultDTO resultDTO = result.getData(); //4.密码是否正确 diff --git a/epmet-auth/src/main/java/com/epmet/service/impl/SsoServiceImpl.java b/epmet-auth/src/main/java/com/epmet/service/impl/SsoServiceImpl.java index 29283f6b01..1d8cbf8b4f 100644 --- a/epmet-auth/src/main/java/com/epmet/service/impl/SsoServiceImpl.java +++ b/epmet-auth/src/main/java/com/epmet/service/impl/SsoServiceImpl.java @@ -478,7 +478,7 @@ public class SsoServiceImpl implements SsoService { customerStaffFormDTO.setMobile(formDTO.getMobile()); Result customerStaffDTOResult = epmetUserOpenFeignClient.getCustomerStaffInfo(customerStaffFormDTO); if (!customerStaffDTOResult.success() || null == customerStaffDTOResult.getData()) { - logger.error(String.format("获取工作人员信息失败,手机号[%s],客户id:[%s],code[%s],msg[%s]", formDTO.getMobile(), formDTO.getCustomerId(), customerStaffDTOResult.getCode(), customerStaffDTOResult.getMsg())); + logger.warn(String.format("获取工作人员信息失败,手机号[%s],客户id:[%s],code[%s],msg[%s]", formDTO.getMobile(), formDTO.getCustomerId(), customerStaffDTOResult.getCode(), customerStaffDTOResult.getMsg())); throw new RenException(customerStaffDTOResult.getCode()); } CustomerStaffDTO customerStaff = customerStaffDTOResult.getData(); 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 3d2c2ebee0..585835f705 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 @@ -12,7 +12,6 @@ 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.constant.StrConstant; -import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; import com.epmet.commons.tools.enums.EnvEnum; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetException; @@ -20,7 +19,6 @@ 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.CustomerStaffRedis; 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; @@ -403,7 +401,7 @@ public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResol customerStaffFormDTO.setMobile(formDTO.getMobile()); Result customerStaffDTOResult = epmetUserOpenFeignClient.getCustomerStaffInfo(customerStaffFormDTO); if (!customerStaffDTOResult.success() || null == customerStaffDTOResult.getData()) { - logger.error(String.format("获取工作人员信息失败,手机号[%s],客户id:[%s],code[%s],msg[%s]", formDTO.getMobile(), formDTO.getCustomerId(), customerStaffDTOResult.getCode(), customerStaffDTOResult.getMsg())); + logger.warn(String.format("获取工作人员信息失败,手机号[%s],客户id:[%s],code[%s],msg[%s]", formDTO.getMobile(), formDTO.getCustomerId(), customerStaffDTOResult.getCode(), customerStaffDTOResult.getMsg())); throw new RenException(customerStaffDTOResult.getCode()); } CustomerStaffDTO customerStaff = customerStaffDTOResult.getData(); diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/EnableStaffFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/EnableStaffFormDTO.java index e2212b7608..52cda8c2a0 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/EnableStaffFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/EnableStaffFormDTO.java @@ -18,5 +18,8 @@ public class EnableStaffFormDTO implements Serializable { * 被解禁用户Id */ private String staffId; - + /** + * token中获取 + */ + private String customerId; } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/GovWebOperLoginResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/GovWebOperLoginResultDTO.java index dc08614749..427f75cba5 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/GovWebOperLoginResultDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/GovWebOperLoginResultDTO.java @@ -13,4 +13,8 @@ public class GovWebOperLoginResultDTO implements Serializable { private static final long serialVersionUID = -5353521601282463394L; private String userId; private String passWord; + /** + * 未禁用enable,已禁用diabled + */ + private String enableFlag; } 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 8bea2e4fbf..45e9b098e7 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 @@ -19,8 +19,6 @@ package com.epmet.controller; import com.epmet.commons.rocketmq.messages.OrgOrStaffMQMsg; import com.epmet.commons.tools.annotation.LoginUser; -import com.epmet.commons.tools.annotation.RequirePermission; -import com.epmet.commons.tools.enums.RequirePermissionEnum; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; @@ -564,8 +562,9 @@ public class CustomerStaffController { * @author sun */ @PostMapping("enablestaff") - @RequirePermission(requirePermission = RequirePermissionEnum.ORG_STAFF_ENABLE) + // @RequirePermission(requirePermission = RequirePermissionEnum.ORG_STAFF_ENABLE) public Result enableStaff(@LoginUser TokenDto tokenDto, @RequestBody EnableStaffFormDTO fromDTO){ + fromDTO.setCustomerId(tokenDto.getCustomerId()); if (tokenDto.getUserId().equals(fromDTO.getStaffId())) { throw new RenException("工作人员自己不能解禁自己"); } 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 0bcb0b5eee..1ff4560c99 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 @@ -1055,6 +1055,8 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl SELECT user_id AS "userId", - `password` AS "passWord" + `password` AS "passWord", + ENABLE_FLAG as enableFlag FROM `customer_staff` WHERE