增加详情序号(0x0C);避免服务自调用
This commit is contained in:
parent
6c0bf83002
commit
f301a10193
@ -32,6 +32,8 @@ public class ChargeDetails {
|
|||||||
@JsonProperty("DetailSeviceMoney")
|
@JsonProperty("DetailSeviceMoney")
|
||||||
private Double detailSeviceMoney = 0.0;
|
private Double detailSeviceMoney = 0.0;
|
||||||
|
|
||||||
|
private int idx;
|
||||||
|
|
||||||
public ChargeDetails(XhpcStatisticsTimeInterval statistics) {
|
public ChargeDetails(XhpcStatisticsTimeInterval statistics) {
|
||||||
|
|
||||||
this.detailElecMoney = statistics.getPowerPrice().doubleValue();
|
this.detailElecMoney = statistics.getPowerPrice().doubleValue();
|
||||||
|
|||||||
@ -14,10 +14,10 @@ spring:
|
|||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 172.31.183.135:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 172.31.183.135:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|||||||
@ -14,10 +14,10 @@ spring:
|
|||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 172.31.183.135:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 172.31.183.135:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|||||||
@ -16,10 +16,10 @@ spring:
|
|||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 172.31.183.135:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 172.31.183.135:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
@ -35,7 +35,7 @@ spring:
|
|||||||
datasource:
|
datasource:
|
||||||
ds1:
|
ds1:
|
||||||
nacos:
|
nacos:
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 172.31.183.135:8848
|
||||||
dataId: sentinel-ruoyi-gateway
|
dataId: sentinel-ruoyi-gateway
|
||||||
groupId: DEFAULT_GROUP
|
groupId: DEFAULT_GROUP
|
||||||
data-type: json
|
data-type: json
|
||||||
|
|||||||
@ -14,10 +14,10 @@ spring:
|
|||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 172.31.183.135:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 172.31.183.135:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|||||||
@ -14,10 +14,10 @@ spring:
|
|||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 172.31.183.135:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 172.31.183.135:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|||||||
@ -14,10 +14,10 @@ spring:
|
|||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 172.31.183.135:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 172.31.183.135:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|||||||
@ -14,10 +14,10 @@ spring:
|
|||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 172.31.183.135:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 172.31.183.135:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|||||||
@ -14,10 +14,10 @@ spring:
|
|||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 172.31.183.135:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 172.31.183.135:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|||||||
@ -14,10 +14,10 @@ spring:
|
|||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 172.31.183.135:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 172.31.183.135:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|||||||
@ -14,10 +14,10 @@ spring:
|
|||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 172.31.183.135:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 172.31.183.135:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|||||||
@ -14,10 +14,10 @@ spring:
|
|||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 172.31.183.135:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 172.31.183.135:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|||||||
@ -14,10 +14,10 @@ spring:
|
|||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 172.31.183.135:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 172.31.183.135:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|||||||
@ -14,10 +14,10 @@ spring:
|
|||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 172.31.183.135:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 172.31.183.135:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|||||||
@ -15,10 +15,10 @@ spring:
|
|||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 172.31.183.135:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 172.31.183.135:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|||||||
@ -14,10 +14,10 @@ spring:
|
|||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 172.31.183.135:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 172.31.183.135:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|||||||
@ -14,10 +14,10 @@ spring:
|
|||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 172.31.183.135:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 172.31.183.135:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|||||||
@ -70,14 +70,21 @@ public class OrderDataLogic implements ServiceLogic {
|
|||||||
REDIS.setCacheMap(orderkey, cacheOrder);
|
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);
|
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);
|
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 {
|
private CacheOrderData translate(OrderData orderData) throws InvocationTargetException, IllegalAccessException, InstantiationException {
|
||||||
|
|||||||
@ -274,8 +274,11 @@ public class RealtimeDataLogic implements ServiceLogic {
|
|||||||
|
|
||||||
int sumPeriod = Integer.parseInt(hex.substring(0, 2), 16);
|
int sumPeriod = Integer.parseInt(hex.substring(0, 2), 16);
|
||||||
List<ChargeDetails> cds = new ArrayList<>();
|
List<ChargeDetails> cds = new ArrayList<>();
|
||||||
|
int idx = 0;
|
||||||
for (int i = 2; i < 2 + sumPeriod * 16; i = i + 16) { // todo
|
for (int i = 2; i < 2 + sumPeriod * 16; i = i + 16) { // todo
|
||||||
ChargeDetails cd = new ChargeDetails();
|
ChargeDetails cd = new ChargeDetails();
|
||||||
|
cd.setIdx(idx);
|
||||||
|
idx++;
|
||||||
cd.setDetailPower(HexUtils.reverseHexInt(hex.substring(i, i + 8)) / 100000.0);
|
cd.setDetailPower(HexUtils.reverseHexInt(hex.substring(i, i + 8)) / 100000.0);
|
||||||
cd.setDetailElecMoney(HexUtils.reverseHexInt(hex.substring(i + 8, i + 16)) / 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);
|
// 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);
|
int sumPeriod = Integer.parseInt(hex.substring(28, 30), 16);
|
||||||
List<ChargeDetails> cds = new ArrayList<>();
|
List<ChargeDetails> cds = new ArrayList<>();
|
||||||
|
int idx = 0;
|
||||||
for (int i = 38; i < 38 + sumPeriod * 16; i = i + 16) { // todo
|
for (int i = 38; i < 38 + sumPeriod * 16; i = i + 16) { // todo
|
||||||
ChargeDetails cd = new ChargeDetails();
|
ChargeDetails cd = new ChargeDetails();
|
||||||
|
cd.setIdx(idx);
|
||||||
|
idx++;
|
||||||
cd.setDetailPower(HexUtils.reverseHexInt(hex.substring(i, i + 8)) / 100000.0);
|
cd.setDetailPower(HexUtils.reverseHexInt(hex.substring(i, i + 8)) / 100000.0);
|
||||||
cd.setDetailElecMoney(HexUtils.reverseHexInt(hex.substring(i + 8, i + 16)) / 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);
|
// cd.setDetailSeviceMoney(HexUtils.reverseHexInt(hex.substring(i + 60, i + 68)) / 10000.0);
|
||||||
|
|||||||
@ -129,11 +129,9 @@ public class ChargingPileBinaryHandler implements ClientBinaryHandler {
|
|||||||
deviceMessage.setChargeOrderNo((String) req.get("orderNo"));
|
deviceMessage.setChargeOrderNo((String) req.get("orderNo"));
|
||||||
xhpcDeviceMessageMapper.insertByDomain(deviceMessage);
|
xhpcDeviceMessageMapper.insertByDomain(deviceMessage);
|
||||||
}
|
}
|
||||||
if (SERVICE_HB.equals(serviceName) && OK.equals(resultCode)) {
|
if (SERVICE_HB.equals(serviceName)) {
|
||||||
pileNo = ChargingPileServer.getPileNo(handler);
|
if (OK.equals(resultCode)) {
|
||||||
if (null == pileNo) {
|
pileNo = ChargingPileServer.getPileNo(handler);
|
||||||
handler.forceClose();
|
|
||||||
} else {
|
|
||||||
Boolean tcfg = (Boolean) cachePile.get("tcfg");
|
Boolean tcfg = (Boolean) cachePile.get("tcfg");
|
||||||
if (tcfg == null || !tcfg) {
|
if (tcfg == null || !tcfg) {
|
||||||
String skey = pilekey.concat(".seqhex");
|
String skey = pilekey.concat(".seqhex");
|
||||||
@ -155,7 +153,10 @@ public class ChargingPileBinaryHandler implements ClientBinaryHandler {
|
|||||||
REDIS.setCacheMap(pilekey, cachePile);
|
REDIS.setCacheMap(pilekey, cachePile);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
handler.forceClose();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -18,10 +18,10 @@ spring:
|
|||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 172.31.183.135:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 172.31.183.135:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|||||||
@ -15,10 +15,10 @@ spring:
|
|||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 172.31.183.135:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 172.31.183.135:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|||||||
@ -15,10 +15,10 @@ spring:
|
|||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 172.31.183.135:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 172.31.183.135:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
package com.xhpc.user.controller;
|
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.controller.BaseController;
|
||||||
import com.xhpc.common.core.web.domain.AjaxResult;
|
import com.xhpc.common.core.web.domain.AjaxResult;
|
||||||
import com.xhpc.common.util.UserTypeUtil;
|
import com.xhpc.common.util.UserTypeUtil;
|
||||||
@ -26,30 +27,31 @@ public class XhpcCommonController extends BaseController {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据手机号(账号),用户id和类型 获取用户信息
|
* 根据手机号(账号),用户id和类型 获取用户信息
|
||||||
|
*
|
||||||
* @param phone
|
* @param phone
|
||||||
* @param userId
|
* @param userId
|
||||||
* @param userType
|
* @param userType
|
||||||
* @param serialNumber 桩号
|
* @param serialNumber 桩号
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@GetMapping(value = "/getUser")
|
@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 (phone != null || "".equals(phone)) {
|
||||||
if(!UserTypeUtil.COMMUNIT.equals(phone.substring(0,2)) && !UserTypeUtil.CUSTOMERS.equals(phone.substring(0,2))){
|
if (!UserTypeUtil.COMMUNIT.equals(phone.substring(0, 2)) && !UserTypeUtil.CUSTOMERS.equals(phone.substring(0, 2))) {
|
||||||
//C端用户
|
//C端用户
|
||||||
return AjaxResult.success(xhpcCommonService.getLandUser(phone,null,UserTypeUtil.USER_TYPE,serialNumber,tenantId));
|
return R.ok(xhpcCommonService.getLandUser(phone, null, UserTypeUtil.USER_TYPE, serialNumber, tenantId));
|
||||||
}else if (UserTypeUtil.COMMUNIT.equals(phone.substring(0,2))){
|
} else if (UserTypeUtil.COMMUNIT.equals(phone.substring(0, 2))) {
|
||||||
//社区用户
|
//社区用户
|
||||||
return AjaxResult.success(xhpcCommonService.getLandUser(phone,null,UserTypeUtil.COMMUNIT_TYPE,serialNumber,tenantId));
|
return R.ok(xhpcCommonService.getLandUser(phone, null, UserTypeUtil.COMMUNIT_TYPE, serialNumber, tenantId));
|
||||||
}else if (UserTypeUtil.CUSTOMERS.equals(phone.substring(0,2))){
|
} 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{
|
}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();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -2,7 +2,6 @@ package com.xhpc.user.service.impl;
|
|||||||
|
|
||||||
import cn.hutool.core.date.DateField;
|
import cn.hutool.core.date.DateField;
|
||||||
import cn.hutool.core.date.DateUtil;
|
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.HttpStatus;
|
||||||
import com.xhpc.common.core.constant.StatusConstants;
|
import com.xhpc.common.core.constant.StatusConstants;
|
||||||
import com.xhpc.common.core.constant.UserConstants;
|
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.common.util.UserTypeUtil;
|
||||||
import com.xhpc.system.api.domain.SysUser;
|
import com.xhpc.system.api.domain.SysUser;
|
||||||
import com.xhpc.system.api.model.LoginUser;
|
import com.xhpc.system.api.model.LoginUser;
|
||||||
|
import com.xhpc.user.controller.XhpcCommonController;
|
||||||
import com.xhpc.user.domain.XhpcAppUser;
|
import com.xhpc.user.domain.XhpcAppUser;
|
||||||
import com.xhpc.user.mapper.XhpcAppUserMapper;
|
import com.xhpc.user.mapper.XhpcAppUserMapper;
|
||||||
import com.xhpc.user.service.IXhpcAppUserUserService;
|
import com.xhpc.user.service.IXhpcAppUserUserService;
|
||||||
@ -53,7 +53,7 @@ public class XhpcAppUserServiceImpl extends BaseService implements IXhpcAppUserU
|
|||||||
private LogUserUtils logUserUtils;
|
private LogUserUtils logUserUtils;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private UserTypeService userTypeService;
|
private XhpcCommonController xhpcCommonController;
|
||||||
|
|
||||||
|
|
||||||
private static final Logger logger = LoggerFactory.getLogger(XhpcAppUserServiceImpl.class);
|
private static final Logger logger = LoggerFactory.getLogger(XhpcAppUserServiceImpl.class);
|
||||||
@ -223,11 +223,11 @@ public class XhpcAppUserServiceImpl extends BaseService implements IXhpcAppUserU
|
|||||||
@Transactional
|
@Transactional
|
||||||
public R<?> appLogin(String username, String type, String openid, String tenantId) {
|
public R<?> appLogin(String username, String type, String openid, String tenantId) {
|
||||||
//统一沉睡300毫秒防止重复提交
|
//统一沉睡300毫秒防止重复提交
|
||||||
try {
|
// try {
|
||||||
Thread.sleep(300);
|
// Thread.sleep(300);
|
||||||
} catch (InterruptedException e) {
|
// } catch (InterruptedException e) {
|
||||||
e.printStackTrace();
|
// e.printStackTrace();
|
||||||
}
|
// }
|
||||||
// 用户名或密码为空 错误
|
// 用户名或密码为空 错误
|
||||||
if (StringUtils.isAnyBlank(username)) {
|
if (StringUtils.isAnyBlank(username)) {
|
||||||
return R.fail(HttpStatus.NOT_NULL, "用户必须填写");
|
return R.fail(HttpStatus.NOT_NULL, "用户必须填写");
|
||||||
@ -239,7 +239,7 @@ public class XhpcAppUserServiceImpl extends BaseService implements IXhpcAppUserU
|
|||||||
}
|
}
|
||||||
String sub = username.substring(0, 2);
|
String sub = username.substring(0, 2);
|
||||||
if (UserTypeUtil.COMMUNIT.equals(sub) || UserTypeUtil.CUSTOMERS.equals(sub)){
|
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){
|
if(lognUser !=null && lognUser.getData() !=null){
|
||||||
Map<String, Object> map = (Map<String, Object>)lognUser.getData();
|
Map<String, Object> map = (Map<String, Object>)lognUser.getData();
|
||||||
LoginUser userInfo = new LoginUser();
|
LoginUser userInfo = new LoginUser();
|
||||||
@ -362,7 +362,7 @@ public class XhpcAppUserServiceImpl extends BaseService implements IXhpcAppUserU
|
|||||||
Long userid = loginUser.getUserid();
|
Long userid = loginUser.getUserid();
|
||||||
String openId = loginUser.getOpenId();
|
String openId = loginUser.getOpenId();
|
||||||
String tenantId = loginUser.getTenantId();
|
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(user !=null && user.getData() !=null){
|
||||||
if(UserTypeUtil.USER_TYPE==userType){
|
if(UserTypeUtil.USER_TYPE==userType){
|
||||||
XhpcAppUser appUser = xhpcAppUserMapper.getAppUserByPhone(username,tenantId);
|
XhpcAppUser appUser = xhpcAppUserMapper.getAppUserByPhone(username,tenantId);
|
||||||
@ -418,7 +418,7 @@ public class XhpcAppUserServiceImpl extends BaseService implements IXhpcAppUserU
|
|||||||
if(userLoginTime ==null){
|
if(userLoginTime ==null){
|
||||||
return R.fail(HttpStatus.USER_LOGIN, "请重新登录");
|
return R.fail(HttpStatus.USER_LOGIN, "请重新登录");
|
||||||
}
|
}
|
||||||
logger.info("-------userLoginTime---"+userLoginTime.toString());
|
logger.info("-------userLoginTime---" + userLoginTime);
|
||||||
if(userLoginTime.get("status") == null){
|
if(userLoginTime.get("status") == null){
|
||||||
return R.fail(HttpStatus.USER_LOGIN, "请重新登录");
|
return R.fail(HttpStatus.USER_LOGIN, "请重新登录");
|
||||||
} else if(UserTypeUtil.NO_LOGIN.equals(userLoginTime.get("status").toString())){
|
} 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();
|
Long userid = loginUser.getUserid();
|
||||||
Integer userType = loginUser.getUserType();
|
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){
|
if(user !=null && user.getData() !=null){
|
||||||
Map<String, Object> map = (Map<String, Object>)user.getData();
|
Map<String, Object> map = (Map<String, Object>)user.getData();
|
||||||
//发票、留言板、版本、客服电话
|
//发票、留言板、版本、客服电话
|
||||||
@ -561,7 +561,8 @@ public class XhpcAppUserServiceImpl extends BaseService implements IXhpcAppUserU
|
|||||||
LoginUser loginUser = logUserUtils.getLogUser(request);
|
LoginUser loginUser = logUserUtils.getLogUser(request);
|
||||||
//根据不同的用户类型查询不同的信息
|
//根据不同的用户类型查询不同的信息
|
||||||
Long userid = loginUser.getUserid();
|
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){
|
if(user !=null && user.getData() !=null){
|
||||||
Map<String, Object> map = (Map<String, Object>)user.getData();
|
Map<String, Object> map = (Map<String, Object>)user.getData();
|
||||||
if(UserTypeUtil.USER_TYPE.equals(userType)){
|
if(UserTypeUtil.USER_TYPE.equals(userType)){
|
||||||
|
|||||||
@ -14,10 +14,10 @@ spring:
|
|||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 172.31.183.135:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 172.31.183.135:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|||||||
@ -15,10 +15,10 @@ spring:
|
|||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 172.31.183.135:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 172.31.183.135:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|||||||
@ -16,10 +16,10 @@ spring:
|
|||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 172.31.183.135:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 172.31.183.135:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user