Browse Source

日志

feature/evaluate
jianjun 3 years ago
parent
commit
8a1aba189e
  1. 13
      epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java

13
epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java

@ -607,8 +607,16 @@ public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResol
@Override @Override
public List<StaffOrgsResultDTO> getMyOrgByAccount(ThirdStaffOrgByAccountFormDTO formDTO) { public List<StaffOrgsResultDTO> getMyOrgByAccount(ThirdStaffOrgByAccountFormDTO formDTO) {
//{"isNovice":false,"mobile":"","userAccount":"18700011111","password":"Py011111","appId":"wx2b75d556ba867750"}
String appId = formDTO.getAppId();
String userAccount = formDTO.getUserAccount();
String password = formDTO.getPassword();
logger.info("getMyOrgByAccount start at:{}",System.currentTimeMillis());
//0.根据appId查询对应客户Id //0.根据appId查询对应客户Id
PaCustomerDTO customer = this.getCustomerInfo(formDTO.getAppId()); PaCustomerDTO customer = this.getCustomerInfo(formDTO.getAppId());
logger.info("getMyOrgByAccount getCustomerInfo cost:{}",System.currentTimeMillis());
//7.28 上边根据appId只能锁定一条客户id,后边的批量循环操作暂不做调整,还是使用之前的代码 sun //7.28 上边根据appId只能锁定一条客户id,后边的批量循环操作暂不做调整,还是使用之前的代码 sun
//1、根据手机号查询到用户信息 //1、根据手机号查询到用户信息
ThirdCustomerStaffByAccountFormDTO dto = new ThirdCustomerStaffByAccountFormDTO(); ThirdCustomerStaffByAccountFormDTO dto = new ThirdCustomerStaffByAccountFormDTO();
@ -619,6 +627,7 @@ public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResol
logger.warn(String.format("账户密码登录异常,账户[%s],code[%s],msg[%s]", formDTO.getUserAccount(), customerStaffResult.getCode(), customerStaffResult.getMsg())); logger.warn(String.format("账户密码登录异常,账户[%s],code[%s],msg[%s]", formDTO.getUserAccount(), customerStaffResult.getCode(), customerStaffResult.getMsg()));
throw new RenException(customerStaffResult.getCode()); throw new RenException(customerStaffResult.getCode());
} }
logger.info("getMyOrgByAccount getCustsomerStaffByIdAndAccount cost:{}",System.currentTimeMillis());
//2、密码是否正确 //2、密码是否正确
List<CustomerStaffDTO> customerStaffList=customerStaffResult.getData(); List<CustomerStaffDTO> customerStaffList=customerStaffResult.getData();
if (CollectionUtils.isEmpty(customerStaffList)){ if (CollectionUtils.isEmpty(customerStaffList)){
@ -656,18 +665,22 @@ public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResol
logger.warn(String.format("根据当前账户(%s)密码未找到所属组织,密码错误",formDTO.getUserAccount())); logger.warn(String.format("根据当前账户(%s)密码未找到所属组织,密码错误",formDTO.getUserAccount()));
throw new RenException(EpmetErrorCode.PASSWORD_ERROR.getCode()); throw new RenException(EpmetErrorCode.PASSWORD_ERROR.getCode());
} }
logger.info("getMyOrgByAccount checkpassword cost:{}",System.currentTimeMillis());
CustomerStaffDTO customerStaffDTO = customerStaffList.get(0); CustomerStaffDTO customerStaffDTO = customerStaffList.get(0);
String tempKey = RedisKeys.getCustomerStaffTempKey(customerStaffDTO.getUserId()); String tempKey = RedisKeys.getCustomerStaffTempKey(customerStaffDTO.getUserId());
List<StaffOrgsResultDTO> redisTemp = (List<StaffOrgsResultDTO>)redisUtils.get(tempKey); List<StaffOrgsResultDTO> redisTemp = (List<StaffOrgsResultDTO>)redisUtils.get(tempKey);
if (redisTemp != null){ if (redisTemp != null){
return redisTemp; return redisTemp;
} }
logger.info("getMyOrgByAccount getCustomerStaffTempKey cost:{}",System.currentTimeMillis());
StaffOrgFormDTO staffOrgFormDTO = new StaffOrgFormDTO(); StaffOrgFormDTO staffOrgFormDTO = new StaffOrgFormDTO();
staffOrgFormDTO.setCustomerIdList(customerIdList); staffOrgFormDTO.setCustomerIdList(customerIdList);
Result<List<StaffOrgsResultDTO>> result = govOrgOpenFeignClient.getStaffOrgList(staffOrgFormDTO); Result<List<StaffOrgsResultDTO>> result = govOrgOpenFeignClient.getStaffOrgList(staffOrgFormDTO);
if(result.success()&&null!=result.getData()){ if(result.success()&&null!=result.getData()){
List<StaffOrgsResultDTO> data = result.getData(); List<StaffOrgsResultDTO> data = result.getData();
logger.info("getMyOrgByAccount getStaffOrgList from db cost:{}",System.currentTimeMillis());
redisUtils.set(tempKey,data); redisUtils.set(tempKey,data);
logger.info("getMyOrgByAccount getCustomerStaffTempKey set redis cost:{}",System.currentTimeMillis());
return data; return data;
} }
logger.warn(String .format("手机验证码获取组织,调用%s服务失败,入参账户%s,密码%s,返回错误码%s,错误提示信息%s", logger.warn(String .format("手机验证码获取组织,调用%s服务失败,入参账户%s,密码%s,返回错误码%s,错误提示信息%s",

Loading…
Cancel
Save