Browse Source

Merge remote-tracking branch 'origin/dev_renhu'

master
yinzuomei 3 years ago
parent
commit
4ada45e05b
  1. 5
      epmet-auth/src/main/java/com/epmet/service/impl/GovWebServiceImpl.java
  2. 2
      epmet-auth/src/main/java/com/epmet/service/impl/SsoServiceImpl.java
  3. 4
      epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java
  4. 5
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/EnableStaffFormDTO.java
  5. 4
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/GovWebOperLoginResultDTO.java
  6. 5
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java
  7. 2
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java
  8. 3
      epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml

5
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.密码是否正确

2
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<CustomerStaffDTO> 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();

4
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<CustomerStaffDTO> 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();

5
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;
}

4
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;
}

5
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("工作人员自己不能解禁自己");
}

2
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java

@ -1055,6 +1055,8 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl<CustomerStaffDao,
staffEntity.setId(customerStaffEntity.getId());
staffEntity.setEnableFlag(CustomerStaffConstant.ENABLE);
baseDao.updateById(staffEntity);
//2021.8.24 sun 人员禁用时删除工作人员的缓存信息
CustomerStaffRedis.delStaffInfoFormCache(fromDTO.getCustomerId(), fromDTO.getStaffId());
}
/**

3
epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml

@ -327,7 +327,8 @@
<select id="selectByCustomerIdAndPhone" resultType="com.epmet.dto.result.GovWebOperLoginResultDTO">
SELECT
user_id AS "userId",
`password` AS "passWord"
`password` AS "passWord",
ENABLE_FLAG as enableFlag
FROM
`customer_staff`
WHERE

Loading…
Cancel
Save