From fb76917f7994551a3827f62dc4c4c0016edb7cb9 Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 20 Sep 2022 17:25:08 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/service/impl/ThirdLoginServiceImpl.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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 459941582f..5207e1f743 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 @@ -607,8 +607,16 @@ public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResol @Override public List 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 PaCustomerDTO customer = this.getCustomerInfo(formDTO.getAppId()); + logger.info("getMyOrgByAccount getCustomerInfo cost:{}",System.currentTimeMillis()); //7.28 上边根据appId只能锁定一条客户id,后边的批量循环操作暂不做调整,还是使用之前的代码 sun //1、根据手机号查询到用户信息 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())); throw new RenException(customerStaffResult.getCode()); } + logger.info("getMyOrgByAccount getCustsomerStaffByIdAndAccount cost:{}",System.currentTimeMillis()); //2、密码是否正确 List customerStaffList=customerStaffResult.getData(); if (CollectionUtils.isEmpty(customerStaffList)){ @@ -656,18 +665,22 @@ 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()); CustomerStaffDTO customerStaffDTO = customerStaffList.get(0); String tempKey = RedisKeys.getCustomerStaffTempKey(customerStaffDTO.getUserId()); List redisTemp = (List)redisUtils.get(tempKey); if (redisTemp != null){ return redisTemp; } + logger.info("getMyOrgByAccount getCustomerStaffTempKey cost:{}",System.currentTimeMillis()); StaffOrgFormDTO staffOrgFormDTO = new StaffOrgFormDTO(); staffOrgFormDTO.setCustomerIdList(customerIdList); Result> result = govOrgOpenFeignClient.getStaffOrgList(staffOrgFormDTO); if(result.success()&&null!=result.getData()){ List data = result.getData(); + logger.info("getMyOrgByAccount getStaffOrgList from db cost:{}",System.currentTimeMillis()); redisUtils.set(tempKey,data); + logger.info("getMyOrgByAccount getCustomerStaffTempKey set redis cost:{}",System.currentTimeMillis()); return data; } logger.warn(String .format("手机验证码获取组织,调用%s服务失败,入参账户%s,密码%s,返回错误码%s,错误提示信息%s", From 9e38c0ec38b5fc37a97c9c7f422f68f95d4f32df Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 20 Sep 2022 17:41:38 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E6=97=A5=E5=BF=972?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/ThirdLoginServiceImpl.java | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) 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 5207e1f743..62f1fe4a83 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 @@ -613,10 +613,11 @@ public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResol String userAccount = formDTO.getUserAccount(); String password = formDTO.getPassword(); - logger.info("getMyOrgByAccount start 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 customerStaffList=customerStaffResult.getData(); if (CollectionUtils.isEmpty(customerStaffList)){ @@ -665,22 +667,25 @@ 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 redisTemp = (List)redisUtils.get(tempKey); if (redisTemp != null){ 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> result = govOrgOpenFeignClient.getStaffOrgList(staffOrgFormDTO); if(result.success()&&null!=result.getData()){ List 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); return data; } logger.warn(String .format("手机验证码获取组织,调用%s服务失败,入参账户%s,密码%s,返回错误码%s,错误提示信息%s", From 836e6294644d18da7d779b53fa4b500487a034e3 Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 20 Sep 2022 17:43:52 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E6=97=A5=E5=BF=973?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/service/impl/ThirdLoginServiceImpl.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 62f1fe4a83..8964ca475c 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 @@ -612,7 +612,7 @@ public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResol String appId = formDTO.getAppId(); String userAccount = formDTO.getUserAccount(); String password = formDTO.getPassword(); - + logger.info("getMyOrgByAccountService at :{}",System.currentTimeMillis()); long start = System.currentTimeMillis(); //0.根据appId查询对应客户Id PaCustomerDTO customer = this.getCustomerInfo(formDTO.getAppId()); @@ -673,6 +673,7 @@ public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResol String tempKey = RedisKeys.getCustomerStaffTempKey(customerStaffDTO.getUserId()); List redisTemp = (List)redisUtils.get(tempKey); if (redisTemp != null){ + logger.info("getMyOrgByAccountService end redis :{}",System.currentTimeMillis()); return redisTemp; } logger.info("getMyOrgByAccountService getCustomerStaffTempKey cost:{}",System.currentTimeMillis()-start); @@ -686,6 +687,7 @@ public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResol start = System.currentTimeMillis(); redisUtils.set(tempKey,data); 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",