|
@@ -9,11 +9,15 @@ import com.tmzn.devicelinkykc.constant.ykc.StatusConstant;
|
|
|
import com.tmzn.devicelinkykc.entity.BillingModel;
|
|
import com.tmzn.devicelinkykc.entity.BillingModel;
|
|
|
import com.tmzn.devicelinkykc.entity.Device;
|
|
import com.tmzn.devicelinkykc.entity.Device;
|
|
|
import com.tmzn.devicelinkykc.entity.DeviceStatus;
|
|
import com.tmzn.devicelinkykc.entity.DeviceStatus;
|
|
|
|
|
+import com.tmzn.devicelinkykc.entity.OrderStatus;
|
|
|
import com.tmzn.devicelinkykc.entity.param.AjaxResult;
|
|
import com.tmzn.devicelinkykc.entity.param.AjaxResult;
|
|
|
import com.tmzn.devicelinkykc.entity.param.dto.BillingModelDTO;
|
|
import com.tmzn.devicelinkykc.entity.param.dto.BillingModelDTO;
|
|
|
import com.tmzn.devicelinkykc.frameMsg.DataConversion;
|
|
import com.tmzn.devicelinkykc.frameMsg.DataConversion;
|
|
|
import com.tmzn.devicelinkykc.frameMsg.FrameDataSplicing;
|
|
import com.tmzn.devicelinkykc.frameMsg.FrameDataSplicing;
|
|
|
|
|
+import com.tmzn.devicelinkykc.frameMsg.TransMoney;
|
|
|
import com.tmzn.devicelinkykc.frameMsg.frameType.LoginFrame;
|
|
import com.tmzn.devicelinkykc.frameMsg.frameType.LoginFrame;
|
|
|
|
|
+import com.tmzn.devicelinkykc.frameMsg.frameType.RealTimeStatusPushFrame;
|
|
|
|
|
+import com.tmzn.devicelinkykc.frameMsg.frameType.TransactionFlowPushFrame;
|
|
|
import com.tmzn.devicelinkykc.mapstruct.BillingModelMapping;
|
|
import com.tmzn.devicelinkykc.mapstruct.BillingModelMapping;
|
|
|
import com.tmzn.devicelinkykc.message.DeviceMsgHandle;
|
|
import com.tmzn.devicelinkykc.message.DeviceMsgHandle;
|
|
|
import com.tmzn.devicelinkykc.msgEnum.DeviceSendYkc;
|
|
import com.tmzn.devicelinkykc.msgEnum.DeviceSendYkc;
|
|
@@ -21,6 +25,7 @@ import com.tmzn.devicelinkykc.redis.RedisCache;
|
|
|
import com.tmzn.devicelinkykc.service.BillingModelService;
|
|
import com.tmzn.devicelinkykc.service.BillingModelService;
|
|
|
import com.tmzn.devicelinkykc.service.DeviceControlerService;
|
|
import com.tmzn.devicelinkykc.service.DeviceControlerService;
|
|
|
import com.tmzn.devicelinkykc.service.DeviceStatusService;
|
|
import com.tmzn.devicelinkykc.service.DeviceStatusService;
|
|
|
|
|
+import com.tmzn.devicelinkykc.service.OrderStatusService;
|
|
|
import com.tmzn.devicelinkykc.socket.DeviceConnectionMsg;
|
|
import com.tmzn.devicelinkykc.socket.DeviceConnectionMsg;
|
|
|
import com.tmzn.devicelinkykc.transdata.entity.DeviceParam;
|
|
import com.tmzn.devicelinkykc.transdata.entity.DeviceParam;
|
|
|
import com.tmzn.devicelinkykc.msgparser.MessageParseMgr;
|
|
import com.tmzn.devicelinkykc.msgparser.MessageParseMgr;
|
|
@@ -42,6 +47,7 @@ import java.math.BigDecimal;
|
|
|
import java.util.Arrays;
|
|
import java.util.Arrays;
|
|
|
import java.util.HashMap;
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
+import java.util.Map;
|
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -71,10 +77,48 @@ public class TestController {
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private DeviceMsgHandle deviceMsgHandle;
|
|
private DeviceMsgHandle deviceMsgHandle;
|
|
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private TransactionFlowPushFrame transactionFlowPushFrame;
|
|
|
|
|
+
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private OrderStatusService orderStatusService;
|
|
|
|
|
+
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private TransMoney transMoney;
|
|
|
@PostMapping("/msg")
|
|
@PostMapping("/msg")
|
|
|
- public String testMsg(@RequestBody String message) {
|
|
|
|
|
|
|
+ public String testMsg() {
|
|
|
try {
|
|
try {
|
|
|
- deviceMsgHandle.testMsg(message);
|
|
|
|
|
|
|
+
|
|
|
|
|
+// realTimeStatusPushFrame.upStatusDevice(null,);
|
|
|
|
|
+
|
|
|
|
|
+ String pileCode = "51220002000016";
|
|
|
|
|
+ QueryWrapper<BillingModel> billWapper = new QueryWrapper<>();
|
|
|
|
|
+ billWapper.eq("pile_code", pileCode);
|
|
|
|
|
+ BillingModel b = billingModelService.getOne(billWapper);
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ //查找所有充电中的订单
|
|
|
|
|
+ QueryWrapper<OrderStatus> queryWrapper = new QueryWrapper<>();
|
|
|
|
|
+ queryWrapper.eq("id", 57303); //充电中状态上报
|
|
|
|
|
+
|
|
|
|
|
+ //查询所有充电中设备的最新的订单记录,来上报设备状态消息.........?????????????????
|
|
|
|
|
+ OrderStatus orderStatus = orderStatusService.getOne(queryWrapper);
|
|
|
|
|
+
|
|
|
|
|
+ Map<String, BigDecimal> map = transMoney.compute(orderStatus.getGunsCode(), b, orderStatus.getCreateTime(), orderStatus.getEndTime());
|
|
|
|
|
+
|
|
|
|
|
+ byte[] params = transactionFlowPushFrame.params16(orderStatus.getTransOrder(), pileCode, orderStatus.getGunsCode(),
|
|
|
|
|
+ orderStatus.getCreateTime(), orderStatus.getEndTime(), b, orderStatus.getCard(), map,0);
|
|
|
|
|
+ //deviceMsgHandle.testMsg(message);
|
|
|
|
|
+
|
|
|
|
|
+ System.out.println( DataConversion.bytesToHexString(params));
|
|
|
|
|
+
|
|
|
|
|
+ int frameType = DeviceSendYkc.TRANSACTION_RECORDS_REQUEST_16.getFrameType();
|
|
|
|
|
+ byte[] encrypt = new byte[0];
|
|
|
|
|
+ encrypt = params;
|
|
|
|
|
+ byte[] b1 = FrameDataSplicing.spliceing(0,frameType , 0, encrypt, encrypt.length,false);
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ System.out.println( DataConversion.bytesToHexString(b1));
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
|
}
|
|
}
|