新增0x13和0x3B的报文存入DB
This commit is contained in:
parent
ac432609c9
commit
c5b0d14cc0
@ -6,6 +6,9 @@ import com.xhpc.common.api.PileOrderService;
|
|||||||
import com.xhpc.common.core.domain.R;
|
import com.xhpc.common.core.domain.R;
|
||||||
import com.xhpc.common.data.redis.CacheOrderData;
|
import com.xhpc.common.data.redis.CacheOrderData;
|
||||||
import com.xhpc.common.data.up.OrderData;
|
import com.xhpc.common.data.up.OrderData;
|
||||||
|
import com.xhpc.common.enums.StationDeviceEnum;
|
||||||
|
import com.xhpc.pp.domain.XhpcDeviceMessage;
|
||||||
|
import com.xhpc.pp.mapper.XhpcDeviceMessageMapper;
|
||||||
import com.xhpc.pp.tx.ServiceParameter;
|
import com.xhpc.pp.tx.ServiceParameter;
|
||||||
import com.xhpc.pp.tx.ServiceResult;
|
import com.xhpc.pp.tx.ServiceResult;
|
||||||
import com.xhpc.pp.tx.logic.ServiceLogic;
|
import com.xhpc.pp.tx.logic.ServiceLogic;
|
||||||
@ -17,6 +20,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||||||
import org.springframework.context.annotation.Lazy;
|
import org.springframework.context.annotation.Lazy;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
import java.lang.reflect.InvocationTargetException;
|
import java.lang.reflect.InvocationTargetException;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
@ -34,6 +38,8 @@ public class OrderDataLogic implements ServiceLogic {
|
|||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private PileOrderService pileOrderService;
|
private PileOrderService pileOrderService;
|
||||||
|
@Resource
|
||||||
|
XhpcDeviceMessageMapper deviceMessageMapper;
|
||||||
private static Map<String, String> SM = new HashMap<>();
|
private static Map<String, String> SM = new HashMap<>();
|
||||||
|
|
||||||
static {
|
static {
|
||||||
@ -89,6 +95,16 @@ public class OrderDataLogic implements ServiceLogic {
|
|||||||
"无效订单"))) {
|
"无效订单"))) {
|
||||||
log.error(">>INVALID order [{}] detected. MUST check the system or [{}].<<", orderNo, gunkey);
|
log.error(">>INVALID order [{}] detected. MUST check the system or [{}].<<", orderNo, gunkey);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
XhpcDeviceMessage deviceMessage = new XhpcDeviceMessage();
|
||||||
|
deviceMessage.setType(StationDeviceEnum.PILE.getCode());
|
||||||
|
deviceMessage.setSerialNumber(sp.getPileNo());
|
||||||
|
deviceMessage.setRemark("充电交易结算记录");
|
||||||
|
deviceMessage.setStatus(0);
|
||||||
|
deviceMessage.setContent((String) req.get("hex"));
|
||||||
|
deviceMessage.setChargeOrderNo((String) req.get("orderNo"));
|
||||||
|
deviceMessageMapper.insertByDomain(deviceMessage);
|
||||||
|
|
||||||
String resultStr = "6815".concat(req.get("seqhex").toString()).concat("0040").concat(orderNo);
|
String resultStr = "6815".concat(req.get("seqhex").toString()).concat("0040").concat(orderNo);
|
||||||
if ((r != null && r.getCode() == 200) || (r != null && r.getMsg() != null && r.getMsg().contains("重复结算"))) {
|
if ((r != null && r.getCode() == 200) || (r != null && r.getMsg() != null && r.getMsg().contains("重复结算"))) {
|
||||||
resultStr = resultStr.concat(ServiceResult.HEX_00);
|
resultStr = resultStr.concat(ServiceResult.HEX_00);
|
||||||
|
|||||||
@ -9,8 +9,11 @@ import com.xhpc.common.core.domain.R;
|
|||||||
import com.xhpc.common.data.redis.CacheOrderData;
|
import com.xhpc.common.data.redis.CacheOrderData;
|
||||||
import com.xhpc.common.data.redis.CacheRealtimeData;
|
import com.xhpc.common.data.redis.CacheRealtimeData;
|
||||||
import com.xhpc.common.data.up.RealtimeData;
|
import com.xhpc.common.data.up.RealtimeData;
|
||||||
|
import com.xhpc.common.enums.StationDeviceEnum;
|
||||||
import com.xhpc.evcs.dto.ChargeDetails;
|
import com.xhpc.evcs.dto.ChargeDetails;
|
||||||
import com.xhpc.pp.controller.ChargingController;
|
import com.xhpc.pp.controller.ChargingController;
|
||||||
|
import com.xhpc.pp.domain.XhpcDeviceMessage;
|
||||||
|
import com.xhpc.pp.mapper.XhpcDeviceMessageMapper;
|
||||||
import com.xhpc.pp.tx.ServiceParameter;
|
import com.xhpc.pp.tx.ServiceParameter;
|
||||||
import com.xhpc.pp.tx.ServiceResult;
|
import com.xhpc.pp.tx.ServiceResult;
|
||||||
import com.xhpc.pp.tx.logic.ServiceLogic;
|
import com.xhpc.pp.tx.logic.ServiceLogic;
|
||||||
@ -21,6 +24,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||||||
import org.springframework.context.annotation.Lazy;
|
import org.springframework.context.annotation.Lazy;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
import java.lang.reflect.InvocationTargetException;
|
import java.lang.reflect.InvocationTargetException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@ -45,6 +49,8 @@ public class RealtimeDataLogic implements ServiceLogic {
|
|||||||
private PileOrderService pileOrderService;
|
private PileOrderService pileOrderService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private ChargingController chargingController;
|
private ChargingController chargingController;
|
||||||
|
@Resource
|
||||||
|
XhpcDeviceMessageMapper deviceMessageMapper;
|
||||||
|
|
||||||
private static final Logger log = LoggerFactory.getLogger(RealtimeDataLogic.class);
|
private static final Logger log = LoggerFactory.getLogger(RealtimeDataLogic.class);
|
||||||
|
|
||||||
@ -243,6 +249,15 @@ public class RealtimeDataLogic implements ServiceLogic {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
REDIS.setCacheMap(gunkey, cacheGun);
|
REDIS.setCacheMap(gunkey, cacheGun);
|
||||||
|
|
||||||
|
XhpcDeviceMessage deviceMessage = new XhpcDeviceMessage();
|
||||||
|
deviceMessage.setType(StationDeviceEnum.PILE.getCode());
|
||||||
|
deviceMessage.setSerialNumber(sp.getPileNo());
|
||||||
|
deviceMessage.setRemark("实时数据");
|
||||||
|
deviceMessage.setStatus(0);
|
||||||
|
deviceMessage.setContent((String) req.get("hex"));
|
||||||
|
deviceMessage.setChargeOrderNo((String) req.get("orderNo"));
|
||||||
|
deviceMessageMapper.insertByDomain(deviceMessage);
|
||||||
return new ServiceResult(false);
|
return new ServiceResult(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user