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