Browse Source

Merge remote-tracking branch 'remotes/origin/dev_fegin_concurrent' into pingyin_master

# Conflicts:
#	epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java
master
jianjun 3 years ago
parent
commit
61d97d42ab
  1. 23
      epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java

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

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

Loading…
Cancel
Save