From f301a10193db5f1343d2234cc76107ecb5e57be3 Mon Sep 17 00:00:00 2001 From: ZZ Date: Thu, 31 Mar 2022 11:01:19 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=AF=A6=E6=83=85=E5=BA=8F?= =?UTF-8?q?=E5=8F=B7(0x0C);=E9=81=BF=E5=85=8D=E6=9C=8D=E5=8A=A1=E8=87=AA?= =?UTF-8?q?=E8=B0=83=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/xhpc/evcs/dto/ChargeDetails.java | 2 ++ .../src/main/resources/bootstrap.yml | 4 +-- ruoyi-auth/src/main/resources/bootstrap.yml | 4 +-- .../src/main/resources/bootstrap.yml | 6 ++--- .../src/main/resources/bootstrap.yml | 4 +-- .../src/main/resources/bootstrap.yml | 4 +-- .../src/main/resources/bootstrap.yml | 4 +-- .../src/main/resources/bootstrap.yml | 4 +-- .../src/main/resources/bootstrap.yml | 4 +-- .../src/main/resources/bootstrap.yml | 4 +-- .../src/main/resources/bootstrap.yml | 4 +-- .../src/main/resources/bootstrap.yml | 4 +-- .../src/main/resources/bootstrap.yml | 4 +-- .../src/main/resources/bootstrap.yml | 4 +-- .../xhpc-log/src/main/resources/bootstrap.yml | 4 +-- .../src/main/resources/bootstrap.yml | 4 +-- .../src/main/resources/bootstrap.yml | 4 +-- .../com/xhpc/pp/logic/OrderDataLogic.java | 17 +++++++++---- .../com/xhpc/pp/logic/RealtimeDataLogic.java | 6 +++++ .../pp/server/ChargingPileBinaryHandler.java | 11 ++++---- .../src/main/resources/bootstrap.yml | 4 +-- .../src/main/resources/bootstrap.yml | 4 +-- .../src/main/resources/bootstrap.yml | 4 +-- .../user/controller/XhpcCommonController.java | 24 ++++++++++-------- .../service/impl/XhpcAppUserServiceImpl.java | 25 ++++++++++--------- .../src/main/resources/bootstrap.yml | 4 +-- .../src/main/resources/bootstrap.yml | 4 +-- .../src/main/resources/bootstrap.yml | 4 +-- 28 files changed, 97 insertions(+), 78 deletions(-) diff --git a/evcs-modules/evcs-common/src/main/java/com/xhpc/evcs/dto/ChargeDetails.java b/evcs-modules/evcs-common/src/main/java/com/xhpc/evcs/dto/ChargeDetails.java index 44a8833a..4faf88af 100644 --- a/evcs-modules/evcs-common/src/main/java/com/xhpc/evcs/dto/ChargeDetails.java +++ b/evcs-modules/evcs-common/src/main/java/com/xhpc/evcs/dto/ChargeDetails.java @@ -32,6 +32,8 @@ public class ChargeDetails { @JsonProperty("DetailSeviceMoney") private Double detailSeviceMoney = 0.0; + private int idx; + public ChargeDetails(XhpcStatisticsTimeInterval statistics) { this.detailElecMoney = statistics.getPowerPrice().doubleValue(); diff --git a/evcs-modules/evcs-core/src/main/resources/bootstrap.yml b/evcs-modules/evcs-core/src/main/resources/bootstrap.yml index 1cd5322f..200f8415 100644 --- a/evcs-modules/evcs-core/src/main/resources/bootstrap.yml +++ b/evcs-modules/evcs-core/src/main/resources/bootstrap.yml @@ -14,10 +14,10 @@ spring: nacos: discovery: # 服务注册地址 - server-addr: 127.0.0.1:8848 + server-addr: 172.31.183.135:8848 config: # 配置中心地址 - server-addr: 127.0.0.1:8848 + server-addr: 172.31.183.135:8848 # 配置文件格式 file-extension: yml # 共享配置 diff --git a/ruoyi-auth/src/main/resources/bootstrap.yml b/ruoyi-auth/src/main/resources/bootstrap.yml index bd7dd225..e7e2a0b1 100644 --- a/ruoyi-auth/src/main/resources/bootstrap.yml +++ b/ruoyi-auth/src/main/resources/bootstrap.yml @@ -14,10 +14,10 @@ spring: nacos: discovery: # 服务注册地址 - server-addr: 127.0.0.1:8848 + server-addr: 172.31.183.135:8848 config: # 配置中心地址 - server-addr: 127.0.0.1:8848 + server-addr: 172.31.183.135:8848 # 配置文件格式 file-extension: yml # 共享配置 diff --git a/ruoyi-gateway/src/main/resources/bootstrap.yml b/ruoyi-gateway/src/main/resources/bootstrap.yml index 9bc1a55c..2a75caef 100644 --- a/ruoyi-gateway/src/main/resources/bootstrap.yml +++ b/ruoyi-gateway/src/main/resources/bootstrap.yml @@ -16,10 +16,10 @@ spring: nacos: discovery: # 服务注册地址 - server-addr: 127.0.0.1:8848 + server-addr: 172.31.183.135:8848 config: # 配置中心地址 - server-addr: 127.0.0.1:8848 + server-addr: 172.31.183.135:8848 # 配置文件格式 file-extension: yml # 共享配置 @@ -35,7 +35,7 @@ spring: datasource: ds1: nacos: - server-addr: 127.0.0.1:8848 + server-addr: 172.31.183.135:8848 dataId: sentinel-ruoyi-gateway groupId: DEFAULT_GROUP data-type: json diff --git a/ruoyi-modules/ruoyi-file/src/main/resources/bootstrap.yml b/ruoyi-modules/ruoyi-file/src/main/resources/bootstrap.yml index f1b6134d..6c2cdb09 100644 --- a/ruoyi-modules/ruoyi-file/src/main/resources/bootstrap.yml +++ b/ruoyi-modules/ruoyi-file/src/main/resources/bootstrap.yml @@ -14,10 +14,10 @@ spring: nacos: discovery: # 服务注册地址 - server-addr: 127.0.0.1:8848 + server-addr: 172.31.183.135:8848 config: # 配置中心地址 - server-addr: 127.0.0.1:8848 + server-addr: 172.31.183.135:8848 # 配置文件格式 file-extension: yml # 共享配置 diff --git a/ruoyi-modules/ruoyi-gen/src/main/resources/bootstrap.yml b/ruoyi-modules/ruoyi-gen/src/main/resources/bootstrap.yml index 48d8988c..de9b5154 100644 --- a/ruoyi-modules/ruoyi-gen/src/main/resources/bootstrap.yml +++ b/ruoyi-modules/ruoyi-gen/src/main/resources/bootstrap.yml @@ -14,10 +14,10 @@ spring: nacos: discovery: # 服务注册地址 - server-addr: 127.0.0.1:8848 + server-addr: 172.31.183.135:8848 config: # 配置中心地址 - server-addr: 127.0.0.1:8848 + server-addr: 172.31.183.135:8848 # 配置文件格式 file-extension: yml # 共享配置 diff --git a/ruoyi-modules/ruoyi-job/src/main/resources/bootstrap.yml b/ruoyi-modules/ruoyi-job/src/main/resources/bootstrap.yml index 65b833c4..cce34971 100644 --- a/ruoyi-modules/ruoyi-job/src/main/resources/bootstrap.yml +++ b/ruoyi-modules/ruoyi-job/src/main/resources/bootstrap.yml @@ -14,10 +14,10 @@ spring: nacos: discovery: # 服务注册地址 - server-addr: 127.0.0.1:8848 + server-addr: 172.31.183.135:8848 config: # 配置中心地址 - server-addr: 127.0.0.1:8848 + server-addr: 172.31.183.135:8848 # 配置文件格式 file-extension: yml # 共享配置 diff --git a/ruoyi-modules/ruoyi-system/src/main/resources/bootstrap.yml b/ruoyi-modules/ruoyi-system/src/main/resources/bootstrap.yml index 9f189be1..6881c7e6 100644 --- a/ruoyi-modules/ruoyi-system/src/main/resources/bootstrap.yml +++ b/ruoyi-modules/ruoyi-system/src/main/resources/bootstrap.yml @@ -14,10 +14,10 @@ spring: nacos: discovery: # 服务注册地址 - server-addr: 127.0.0.1:8848 + server-addr: 172.31.183.135:8848 config: # 配置中心地址 - server-addr: 127.0.0.1:8848 + server-addr: 172.31.183.135:8848 # 配置文件格式 file-extension: yml # 共享配置 diff --git a/ruoyi-visual/ruoyi-monitor/src/main/resources/bootstrap.yml b/ruoyi-visual/ruoyi-monitor/src/main/resources/bootstrap.yml index 4a049625..e61a355f 100644 --- a/ruoyi-visual/ruoyi-monitor/src/main/resources/bootstrap.yml +++ b/ruoyi-visual/ruoyi-monitor/src/main/resources/bootstrap.yml @@ -14,10 +14,10 @@ spring: nacos: discovery: # 服务注册地址 - server-addr: 127.0.0.1:8848 + server-addr: 172.31.183.135:8848 config: # 配置中心地址 - server-addr: 127.0.0.1:8848 + server-addr: 172.31.183.135:8848 # 配置文件格式 file-extension: yml # 共享配置 diff --git a/xhpc-modules/xhpc-card/src/main/resources/bootstrap.yml b/xhpc-modules/xhpc-card/src/main/resources/bootstrap.yml index f1df16d1..eee92898 100644 --- a/xhpc-modules/xhpc-card/src/main/resources/bootstrap.yml +++ b/xhpc-modules/xhpc-card/src/main/resources/bootstrap.yml @@ -14,10 +14,10 @@ spring: nacos: discovery: # 服务注册地址 - server-addr: 127.0.0.1:8848 + server-addr: 172.31.183.135:8848 config: # 配置中心地址 - server-addr: 127.0.0.1:8848 + server-addr: 172.31.183.135:8848 # 配置文件格式 file-extension: yml # 共享配置 diff --git a/xhpc-modules/xhpc-charging-station/src/main/resources/bootstrap.yml b/xhpc-modules/xhpc-charging-station/src/main/resources/bootstrap.yml index dd208f50..2c7674bb 100644 --- a/xhpc-modules/xhpc-charging-station/src/main/resources/bootstrap.yml +++ b/xhpc-modules/xhpc-charging-station/src/main/resources/bootstrap.yml @@ -14,10 +14,10 @@ spring: nacos: discovery: # 服务注册地址 - server-addr: 127.0.0.1:8848 + server-addr: 172.31.183.135:8848 config: # 配置中心地址 - server-addr: 127.0.0.1:8848 + server-addr: 172.31.183.135:8848 # 配置文件格式 file-extension: yml # 共享配置 diff --git a/xhpc-modules/xhpc-data-big-screen/src/main/resources/bootstrap.yml b/xhpc-modules/xhpc-data-big-screen/src/main/resources/bootstrap.yml index 767d47f1..546229d7 100644 --- a/xhpc-modules/xhpc-data-big-screen/src/main/resources/bootstrap.yml +++ b/xhpc-modules/xhpc-data-big-screen/src/main/resources/bootstrap.yml @@ -14,10 +14,10 @@ spring: nacos: discovery: # 服务注册地址 - server-addr: 127.0.0.1:8848 + server-addr: 172.31.183.135:8848 config: # 配置中心地址 - server-addr: 127.0.0.1:8848 + server-addr: 172.31.183.135:8848 # 配置文件格式 file-extension: yml # 共享配置 diff --git a/xhpc-modules/xhpc-general/src/main/resources/bootstrap.yml b/xhpc-modules/xhpc-general/src/main/resources/bootstrap.yml index d1cc6f1e..8c383dbe 100644 --- a/xhpc-modules/xhpc-general/src/main/resources/bootstrap.yml +++ b/xhpc-modules/xhpc-general/src/main/resources/bootstrap.yml @@ -14,10 +14,10 @@ spring: nacos: discovery: # 服务注册地址 - server-addr: 127.0.0.1:8848 + server-addr: 172.31.183.135:8848 config: # 配置中心地址 - server-addr: 127.0.0.1:8848 + server-addr: 172.31.183.135:8848 # 配置文件格式 file-extension: yml # 共享配置 diff --git a/xhpc-modules/xhpc-invoice/src/main/resources/bootstrap.yml b/xhpc-modules/xhpc-invoice/src/main/resources/bootstrap.yml index fdb63184..f02173a9 100644 --- a/xhpc-modules/xhpc-invoice/src/main/resources/bootstrap.yml +++ b/xhpc-modules/xhpc-invoice/src/main/resources/bootstrap.yml @@ -14,10 +14,10 @@ spring: nacos: discovery: # 服务注册地址 - server-addr: 127.0.0.1:8848 + server-addr: 172.31.183.135:8848 config: # 配置中心地址 - server-addr: 127.0.0.1:8848 + server-addr: 172.31.183.135:8848 # 配置文件格式 file-extension: yml # 共享配置 diff --git a/xhpc-modules/xhpc-log/src/main/resources/bootstrap.yml b/xhpc-modules/xhpc-log/src/main/resources/bootstrap.yml index 28ca6854..24f214fb 100644 --- a/xhpc-modules/xhpc-log/src/main/resources/bootstrap.yml +++ b/xhpc-modules/xhpc-log/src/main/resources/bootstrap.yml @@ -15,10 +15,10 @@ spring: nacos: discovery: # 服务注册地址 - server-addr: 127.0.0.1:8848 + server-addr: 172.31.183.135:8848 config: # 配置中心地址 - server-addr: 127.0.0.1:8848 + server-addr: 172.31.183.135:8848 # 配置文件格式 file-extension: yml # 共享配置 diff --git a/xhpc-modules/xhpc-message-board/src/main/resources/bootstrap.yml b/xhpc-modules/xhpc-message-board/src/main/resources/bootstrap.yml index 7da4f37b..eacfd07b 100644 --- a/xhpc-modules/xhpc-message-board/src/main/resources/bootstrap.yml +++ b/xhpc-modules/xhpc-message-board/src/main/resources/bootstrap.yml @@ -14,10 +14,10 @@ spring: nacos: discovery: # 服务注册地址 - server-addr: 127.0.0.1:8848 + server-addr: 172.31.183.135:8848 config: # 配置中心地址 - server-addr: 127.0.0.1:8848 + server-addr: 172.31.183.135:8848 # 配置文件格式 file-extension: yml # 共享配置 diff --git a/xhpc-modules/xhpc-payment/src/main/resources/bootstrap.yml b/xhpc-modules/xhpc-payment/src/main/resources/bootstrap.yml index c399f305..f7553392 100644 --- a/xhpc-modules/xhpc-payment/src/main/resources/bootstrap.yml +++ b/xhpc-modules/xhpc-payment/src/main/resources/bootstrap.yml @@ -14,10 +14,10 @@ spring: nacos: discovery: # 服务注册地址 - server-addr: 127.0.0.1:8848 + server-addr: 172.31.183.135:8848 config: # 配置中心地址 - server-addr: 127.0.0.1:8848 + server-addr: 172.31.183.135:8848 # 配置文件格式 file-extension: yml # 共享配置 diff --git a/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/logic/OrderDataLogic.java b/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/logic/OrderDataLogic.java index b91a71ac..6b757e97 100644 --- a/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/logic/OrderDataLogic.java +++ b/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/logic/OrderDataLogic.java @@ -70,14 +70,21 @@ public class OrderDataLogic implements ServiceLogic { REDIS.setCacheMap(orderkey, cacheOrder); } } - String resultStr = - "6815".concat(req.get("seqhex").toString()).concat("0040").concat(orderNo).concat(ServiceResult.HEX_00); - resultStr = resultStr.concat(CRCCalculator.calcCrc(resultStr)); final R r = pileOrderService.pileEndOrder(orderNo); - if (orderNo.equals("00000000000000000000000000000000") || (r.getMsg() != null && r.getMsg().contains("无效订单"))) { + if (orderNo.equals("00000000000000000000000000000000") || (r != null && r.getMsg() != null && r.getMsg().contains( + "无效订单"))) { log.error(">>INVALID order [{}] detected. MUST check the system.<<", orderNo); } - return new ServiceResult(HexUtils.toBytes(resultStr), ServiceResult.OK); + String resultStr = "6815".concat(req.get("seqhex").toString()).concat("0040").concat(orderNo); + if (r != null && r.getCode() == 200) { + resultStr = resultStr.concat(ServiceResult.HEX_00); + resultStr = resultStr.concat(CRCCalculator.calcCrc(resultStr)); + return new ServiceResult(HexUtils.toBytes(resultStr), ServiceResult.OK); + } else { + resultStr = resultStr.concat(ServiceResult.HEX_00); + resultStr = resultStr.concat(CRCCalculator.calcCrc(resultStr)); + return new ServiceResult(HexUtils.toBytes(resultStr), ServiceResult.FAIL); + } } private CacheOrderData translate(OrderData orderData) throws InvocationTargetException, IllegalAccessException, InstantiationException { diff --git a/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/logic/RealtimeDataLogic.java b/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/logic/RealtimeDataLogic.java index c05d6d58..6b6350e5 100644 --- a/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/logic/RealtimeDataLogic.java +++ b/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/logic/RealtimeDataLogic.java @@ -274,8 +274,11 @@ public class RealtimeDataLogic implements ServiceLogic { int sumPeriod = Integer.parseInt(hex.substring(0, 2), 16); List cds = new ArrayList<>(); + int idx = 0; for (int i = 2; i < 2 + sumPeriod * 16; i = i + 16) { // todo ChargeDetails cd = new ChargeDetails(); + cd.setIdx(idx); + idx++; cd.setDetailPower(HexUtils.reverseHexInt(hex.substring(i, i + 8)) / 100000.0); cd.setDetailElecMoney(HexUtils.reverseHexInt(hex.substring(i + 8, i + 16)) / 100000.0); // cd.setDetailSeviceMoney(HexUtils.reverseHexInt(hex.substring(i + 60, i + 68)) / 10000.0); @@ -288,8 +291,11 @@ public class RealtimeDataLogic implements ServiceLogic { int sumPeriod = Integer.parseInt(hex.substring(28, 30), 16); List cds = new ArrayList<>(); + int idx = 0; for (int i = 38; i < 38 + sumPeriod * 16; i = i + 16) { // todo ChargeDetails cd = new ChargeDetails(); + cd.setIdx(idx); + idx++; cd.setDetailPower(HexUtils.reverseHexInt(hex.substring(i, i + 8)) / 100000.0); cd.setDetailElecMoney(HexUtils.reverseHexInt(hex.substring(i + 8, i + 16)) / 100000.0); // cd.setDetailSeviceMoney(HexUtils.reverseHexInt(hex.substring(i + 60, i + 68)) / 10000.0); diff --git a/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/server/ChargingPileBinaryHandler.java b/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/server/ChargingPileBinaryHandler.java index b1c0b0dc..d9d6da81 100644 --- a/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/server/ChargingPileBinaryHandler.java +++ b/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/server/ChargingPileBinaryHandler.java @@ -129,11 +129,9 @@ public class ChargingPileBinaryHandler implements ClientBinaryHandler { deviceMessage.setChargeOrderNo((String) req.get("orderNo")); xhpcDeviceMessageMapper.insertByDomain(deviceMessage); } - if (SERVICE_HB.equals(serviceName) && OK.equals(resultCode)) { - pileNo = ChargingPileServer.getPileNo(handler); - if (null == pileNo) { - handler.forceClose(); - } else { + if (SERVICE_HB.equals(serviceName)) { + if (OK.equals(resultCode)) { + pileNo = ChargingPileServer.getPileNo(handler); Boolean tcfg = (Boolean) cachePile.get("tcfg"); if (tcfg == null || !tcfg) { String skey = pilekey.concat(".seqhex"); @@ -155,7 +153,10 @@ public class ChargingPileBinaryHandler implements ClientBinaryHandler { REDIS.setCacheMap(pilekey, cachePile); } } + } else { + handler.forceClose(); } + } } } diff --git a/xhpc-modules/xhpc-power-pile/src/main/resources/bootstrap.yml b/xhpc-modules/xhpc-power-pile/src/main/resources/bootstrap.yml index 8c12f14b..df3a5bc9 100644 --- a/xhpc-modules/xhpc-power-pile/src/main/resources/bootstrap.yml +++ b/xhpc-modules/xhpc-power-pile/src/main/resources/bootstrap.yml @@ -18,10 +18,10 @@ spring: nacos: discovery: # 服务注册地址 - server-addr: 127.0.0.1:8848 + server-addr: 172.31.183.135:8848 config: # 配置中心地址 - server-addr: 127.0.0.1:8848 + server-addr: 172.31.183.135:8848 # 配置文件格式 file-extension: yml # 共享配置 diff --git a/xhpc-modules/xhpc-tenant/src/main/resources/bootstrap.yml b/xhpc-modules/xhpc-tenant/src/main/resources/bootstrap.yml index ee58a62f..3847197a 100644 --- a/xhpc-modules/xhpc-tenant/src/main/resources/bootstrap.yml +++ b/xhpc-modules/xhpc-tenant/src/main/resources/bootstrap.yml @@ -15,10 +15,10 @@ spring: nacos: discovery: # 服务注册地址 - server-addr: 127.0.0.1:8848 + server-addr: 172.31.183.135:8848 config: # 配置中心地址 - server-addr: 127.0.0.1:8848 + server-addr: 172.31.183.135:8848 # 配置文件格式 file-extension: yml # 共享配置 diff --git a/xhpc-modules/xhpc-tradebill/src/main/resources/bootstrap.yml b/xhpc-modules/xhpc-tradebill/src/main/resources/bootstrap.yml index 6565119a..8b7bb1ee 100644 --- a/xhpc-modules/xhpc-tradebill/src/main/resources/bootstrap.yml +++ b/xhpc-modules/xhpc-tradebill/src/main/resources/bootstrap.yml @@ -15,10 +15,10 @@ spring: nacos: discovery: # 服务注册地址 - server-addr: 127.0.0.1:8848 + server-addr: 172.31.183.135:8848 config: # 配置中心地址 - server-addr: 127.0.0.1:8848 + server-addr: 172.31.183.135:8848 # 配置文件格式 file-extension: yml # 共享配置 diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcCommonController.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcCommonController.java index 2ac4221d..fd84cf5f 100644 --- a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcCommonController.java +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcCommonController.java @@ -1,5 +1,6 @@ package com.xhpc.user.controller; +import com.xhpc.common.core.domain.R; import com.xhpc.common.core.web.controller.BaseController; import com.xhpc.common.core.web.domain.AjaxResult; import com.xhpc.common.util.UserTypeUtil; @@ -26,30 +27,31 @@ public class XhpcCommonController extends BaseController { /** * 根据手机号(账号),用户id和类型 获取用户信息 + * * @param phone * @param userId * @param userType - * @param serialNumber 桩号 + * @param serialNumber 桩号 * @return */ @GetMapping(value = "/getUser") - public AjaxResult getMechanism(String phone,Long userId,Integer userType,String serialNumber,String tenantId) { + public R getMechanism(String phone, Long userId, Integer userType, String serialNumber, String tenantId) { - if(phone !=null || "".equals(phone)){ - if(!UserTypeUtil.COMMUNIT.equals(phone.substring(0,2)) && !UserTypeUtil.CUSTOMERS.equals(phone.substring(0,2))){ + if (phone != null || "".equals(phone)) { + if (!UserTypeUtil.COMMUNIT.equals(phone.substring(0, 2)) && !UserTypeUtil.CUSTOMERS.equals(phone.substring(0, 2))) { //C端用户 - return AjaxResult.success(xhpcCommonService.getLandUser(phone,null,UserTypeUtil.USER_TYPE,serialNumber,tenantId)); - }else if (UserTypeUtil.COMMUNIT.equals(phone.substring(0,2))){ + return R.ok(xhpcCommonService.getLandUser(phone, null, UserTypeUtil.USER_TYPE, serialNumber, tenantId)); + } else if (UserTypeUtil.COMMUNIT.equals(phone.substring(0, 2))) { //社区用户 - return AjaxResult.success(xhpcCommonService.getLandUser(phone,null,UserTypeUtil.COMMUNIT_TYPE,serialNumber,tenantId)); - }else if (UserTypeUtil.CUSTOMERS.equals(phone.substring(0,2))){ + return R.ok(xhpcCommonService.getLandUser(phone, null, UserTypeUtil.COMMUNIT_TYPE, serialNumber, tenantId)); + } else if (UserTypeUtil.CUSTOMERS.equals(phone.substring(0, 2))) { //大客户用户 - return AjaxResult.success(xhpcCommonService.getLandUser(phone,null,UserTypeUtil.CUSTOMERS_TYPE,serialNumber,tenantId)); + return R.ok(xhpcCommonService.getLandUser(phone, null, UserTypeUtil.CUSTOMERS_TYPE, serialNumber, tenantId)); } }else{ - return AjaxResult.success(xhpcCommonService.getLandUser(null,userId,userType,serialNumber,tenantId)); + return R.ok(xhpcCommonService.getLandUser(null, userId, userType, serialNumber, tenantId)); } - return AjaxResult.error(); + return R.fail(); } /** 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 8e7eba9b..24c7dcd9 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 @@ -2,7 +2,6 @@ package com.xhpc.user.service.impl; import cn.hutool.core.date.DateField; import cn.hutool.core.date.DateUtil; -import com.xhpc.common.api.UserTypeService; import com.xhpc.common.core.constant.HttpStatus; import com.xhpc.common.core.constant.StatusConstants; import com.xhpc.common.core.constant.UserConstants; @@ -18,6 +17,7 @@ import com.xhpc.common.util.LogUserUtils; import com.xhpc.common.util.UserTypeUtil; import com.xhpc.system.api.domain.SysUser; import com.xhpc.system.api.model.LoginUser; +import com.xhpc.user.controller.XhpcCommonController; import com.xhpc.user.domain.XhpcAppUser; import com.xhpc.user.mapper.XhpcAppUserMapper; import com.xhpc.user.service.IXhpcAppUserUserService; @@ -53,7 +53,7 @@ public class XhpcAppUserServiceImpl extends BaseService implements IXhpcAppUserU private LogUserUtils logUserUtils; @Autowired - private UserTypeService userTypeService; + private XhpcCommonController xhpcCommonController; private static final Logger logger = LoggerFactory.getLogger(XhpcAppUserServiceImpl.class); @@ -223,11 +223,11 @@ public class XhpcAppUserServiceImpl extends BaseService implements IXhpcAppUserU @Transactional public R appLogin(String username, String type, String openid, String tenantId) { //统一沉睡300毫秒防止重复提交 - try { - Thread.sleep(300); - } catch (InterruptedException e) { - e.printStackTrace(); - } +// try { +// Thread.sleep(300); +// } catch (InterruptedException e) { +// e.printStackTrace(); +// } // 用户名或密码为空 错误 if (StringUtils.isAnyBlank(username)) { return R.fail(HttpStatus.NOT_NULL, "用户必须填写"); @@ -239,7 +239,7 @@ public class XhpcAppUserServiceImpl extends BaseService implements IXhpcAppUserU } String sub = username.substring(0, 2); if (UserTypeUtil.COMMUNIT.equals(sub) || UserTypeUtil.CUSTOMERS.equals(sub)){ - R lognUser = userTypeService.getUser(username, null, null, null,tenantId); + R lognUser = xhpcCommonController.getMechanism(username, null, null, null, tenantId); if(lognUser !=null && lognUser.getData() !=null){ Map map = (Map)lognUser.getData(); LoginUser userInfo = new LoginUser(); @@ -362,7 +362,7 @@ public class XhpcAppUserServiceImpl extends BaseService implements IXhpcAppUserU Long userid = loginUser.getUserid(); String openId = loginUser.getOpenId(); String tenantId = loginUser.getTenantId(); - R user = userTypeService.getUser(null, userid, userType, null,tenantId); + R user = xhpcCommonController.getMechanism(null, userid, userType, null, tenantId); if(user !=null && user.getData() !=null){ if(UserTypeUtil.USER_TYPE==userType){ XhpcAppUser appUser = xhpcAppUserMapper.getAppUserByPhone(username,tenantId); @@ -418,7 +418,7 @@ public class XhpcAppUserServiceImpl extends BaseService implements IXhpcAppUserU if(userLoginTime ==null){ return R.fail(HttpStatus.USER_LOGIN, "请重新登录"); } - logger.info("-------userLoginTime---"+userLoginTime.toString()); + 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())){ @@ -444,7 +444,7 @@ public class XhpcAppUserServiceImpl extends BaseService implements IXhpcAppUserU Long userid = loginUser.getUserid(); Integer userType = loginUser.getUserType(); - R user = userTypeService.getUser(null, loginUser.getUserid(), loginUser.getUserType(), null,tenantId); + R user = xhpcCommonController.getMechanism(null, loginUser.getUserid(), loginUser.getUserType(), null, tenantId); if(user !=null && user.getData() !=null){ Map map = (Map)user.getData(); //发票、留言板、版本、客服电话 @@ -561,7 +561,8 @@ public class XhpcAppUserServiceImpl extends BaseService implements IXhpcAppUserU LoginUser loginUser = logUserUtils.getLogUser(request); //根据不同的用户类型查询不同的信息 Long userid = loginUser.getUserid(); - R user = userTypeService.getUser(null, loginUser.getUserid(), loginUser.getUserType(), null,loginUser.getTenantId()); + R user = xhpcCommonController.getMechanism(null, loginUser.getUserid(), loginUser.getUserType(), null, + loginUser.getTenantId()); if(user !=null && user.getData() !=null){ Map map = (Map)user.getData(); if(UserTypeUtil.USER_TYPE.equals(userType)){ diff --git a/xhpc-modules/xhpc-user/src/main/resources/bootstrap.yml b/xhpc-modules/xhpc-user/src/main/resources/bootstrap.yml index b8d77722..c190803d 100644 --- a/xhpc-modules/xhpc-user/src/main/resources/bootstrap.yml +++ b/xhpc-modules/xhpc-user/src/main/resources/bootstrap.yml @@ -14,10 +14,10 @@ spring: nacos: discovery: # 服务注册地址 - server-addr: 127.0.0.1:8848 + server-addr: 172.31.183.135:8848 config: # 配置中心地址 - server-addr: 127.0.0.1:8848 + server-addr: 172.31.183.135:8848 # 配置文件格式 file-extension: yml # 共享配置 diff --git a/xhpc-modules/xhpc-workorder/src/main/resources/bootstrap.yml b/xhpc-modules/xhpc-workorder/src/main/resources/bootstrap.yml index 3e08df7c..7fc81a54 100644 --- a/xhpc-modules/xhpc-workorder/src/main/resources/bootstrap.yml +++ b/xhpc-modules/xhpc-workorder/src/main/resources/bootstrap.yml @@ -15,10 +15,10 @@ spring: nacos: discovery: # 服务注册地址 - server-addr: 127.0.0.1:8848 + server-addr: 172.31.183.135:8848 config: # 配置中心地址 - server-addr: 127.0.0.1:8848 + server-addr: 172.31.183.135:8848 # 配置文件格式 file-extension: yml # 共享配置 diff --git a/xhpc-modules/xhpc-wxma/src/main/resources/bootstrap.yml b/xhpc-modules/xhpc-wxma/src/main/resources/bootstrap.yml index 35c8095c..c6ad3564 100644 --- a/xhpc-modules/xhpc-wxma/src/main/resources/bootstrap.yml +++ b/xhpc-modules/xhpc-wxma/src/main/resources/bootstrap.yml @@ -16,10 +16,10 @@ spring: nacos: discovery: # 服务注册地址 - server-addr: 127.0.0.1:8848 + server-addr: 172.31.183.135:8848 config: # 配置中心地址 - server-addr: 127.0.0.1:8848 + server-addr: 172.31.183.135:8848 # 配置文件格式 file-extension: yml # 共享配置