From e78536738f58fca6aa1833eb7c58c8c3b88f4e04 Mon Sep 17 00:00:00 2001 From: yuyang Date: Wed, 24 Aug 2022 11:24:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=B0=8F=E7=A8=8B=E5=BA=8F?= =?UTF-8?q?=E7=94=A8=E6=88=B6=E7=8D=B2=E5=8F=96=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/XhpcChargeOrderServiceImpl.java | 15 +++---- .../src/main/resources/bootstrap.yml | 4 +- .../service/impl/XhpcAppUserServiceImpl.java | 41 +++++++++++-------- 3 files changed, 33 insertions(+), 27 deletions(-) diff --git a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcChargeOrderServiceImpl.java b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcChargeOrderServiceImpl.java index f15e1698..5fcf3d77 100644 --- a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcChargeOrderServiceImpl.java +++ b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcChargeOrderServiceImpl.java @@ -504,13 +504,14 @@ public class XhpcChargeOrderServiceImpl extends BaseService implements IXhpcChar //终端信息 XhpcTerminal xhpcTerminal = xhpcChargeOrderMapper.getXhpcTerminalSerialNumber(connectorId,null); if (xhpcTerminal == null || xhpcTerminal.getTerminalId() == null || xhpcTerminal.getChargingPileId() == null || xhpcTerminal.getPileSerialNumber() == null) { - r.setCode(1); - String pilePrompt = redisService.getCacheObject("pilePrompt:000000"); - if(!"".equals(pilePrompt) && pilePrompt !=null){ - r.setMsg(pilePrompt); - }else{ - r.setMsg("因限电该桩已停用,请选择其他桩进行充电"); - } + r.setCode(500); +// String pilePrompt = redisService.getCacheObject("pilePrompt:000000"); +// if(!"".equals(pilePrompt) && pilePrompt !=null){ +// r.setMsg(pilePrompt); +// }else{ +// r.setMsg("因限电该桩已停用,请选择其他桩进行充电"); +// } + r.setMsg("因限电该桩已停用请选择其他桩进行充电"); return r; } //终端状态是否空闲 diff --git a/xhpc-modules/xhpc-order/src/main/resources/bootstrap.yml b/xhpc-modules/xhpc-order/src/main/resources/bootstrap.yml index fca35f2a..a45f7112 100644 --- a/xhpc-modules/xhpc-order/src/main/resources/bootstrap.yml +++ b/xhpc-modules/xhpc-order/src/main/resources/bootstrap.yml @@ -14,10 +14,10 @@ spring: nacos: discovery: # 服务注册地址 - server-addr: 172.31.183.135:8848 + server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848 config: # 配置中心地址 - server-addr: 172.31.183.135:8848 + server-addr: mse-e2a05960-nacos-ans.mse.aliyuncs.com:8848 # 配置文件格式 file-extension: yml # 共享配置 diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcAppUserServiceImpl.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcAppUserServiceImpl.java index 206eeeb9..0ce2ad23 100644 --- a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcAppUserServiceImpl.java +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcAppUserServiceImpl.java @@ -430,24 +430,28 @@ public class XhpcAppUserServiceImpl extends BaseService implements IXhpcAppUserU */ @Override public R voluntaryLogin(Map map) { - String type = StringUtils.valueOf(map.get("type")); - String openid = StringUtils.valueOf(map.get("openid")); - String tenantId = StringUtils.valueOf(map.get("tenantId")); - logger.info("<<<<<<<<<>>>>>>>>>>>"); - logger.info("<<<<<<<<<<自动登录openid>>>>>>>>>>>>"+openid); - logger.info("<<<<<<<<<>>>>>>>>>>>"); - Map userLoginTime = xhpcAppUserMapper.getUserLoginTime(Integer.valueOf(type), openid,tenantId); - if(userLoginTime ==null){ - return R.fail(HttpStatus.USER_LOGIN, "请重新登录"); - } - logger.info("-------userLoginTime---" + userLoginTime); - if(userLoginTime.get("status") == null){ - return R.fail(HttpStatus.USER_LOGIN, "请重新登录"); - } else if(UserTypeUtil.NO_LOGIN.equals(userLoginTime.get("status").toString())){ - return R.fail(HttpStatus.USER_LOGIN, "请重新登录"); - } - logger.info("-------status---"+userLoginTime.get("status").toString()); - return appLogin(userLoginTime.get("account").toString(), type, openid, tenantId); + try{ + String type = StringUtils.valueOf(map.get("type")); + String openid = StringUtils.valueOf(map.get("openid")); + String tenantId = StringUtils.valueOf(map.get("tenantId")); + logger.info("<<<<<<<<<>>>>>>>>>>>"); + logger.info("<<<<<<<<<<自动登录openid>>>>>>>>>>>>"+openid); + logger.info("<<<<<<<<<>>>>>>>>>>>"); + Map userLoginTime = xhpcAppUserMapper.getUserLoginTime(Integer.valueOf(type), openid,tenantId); + if(userLoginTime ==null){ + return R.fail(HttpStatus.USER_LOGIN, "请重新登录"); + } + logger.info("-------userLoginTime---" + userLoginTime); + if(userLoginTime.get("status") == null){ + return R.fail(HttpStatus.USER_LOGIN, "请重新登录"); + } else if(UserTypeUtil.NO_LOGIN.equals(userLoginTime.get("status").toString())){ + return R.fail(HttpStatus.USER_LOGIN, "请重新登录"); + } + logger.info("-------status---"+userLoginTime.get("status").toString()); + return appLogin(userLoginTime.get("account").toString(), type, openid, tenantId); + }catch (Exception e){ + return R.fail(HttpStatus.USER_LOGIN, "请重新登录"); + } } /** @@ -525,6 +529,7 @@ public class XhpcAppUserServiceImpl extends BaseService implements IXhpcAppUserU } }catch (Exception e){ e.printStackTrace(); + logger.info("-------appInfo----请重新登录---"); return AjaxResult.error("请重新登录",HttpStatus.USER_LOGIN); } }