|
@@ -104,34 +104,49 @@ public class MsgCharngingRunner {
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- Set<String> devicePileCodes = map.keySet();
|
|
|
|
|
- QueryWrapper<BillingModel> billWapper = new QueryWrapper<>();
|
|
|
|
|
- billWapper.in("pile_code", devicePileCodes);
|
|
|
|
|
- List<BillingModel> billingModels = billingModelService.list(billWapper);
|
|
|
|
|
- if (billingModels.size() < 1) {
|
|
|
|
|
- log.info("无计费可上报模型");
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- Map<String, BillingModel> billingModelMap = billingModels.stream()
|
|
|
|
|
- .collect(Collectors.toMap(BillingModel::getPileCode, billingModel -> billingModel));
|
|
|
|
|
|
|
+// Set<String> devicePileCodes = map.keySet();
|
|
|
|
|
+// QueryWrapper<BillingModel> billWapper = new QueryWrapper<>();
|
|
|
|
|
+// billWapper.in("pile_code", devicePileCodes);
|
|
|
|
|
+// List<BillingModel> billingModels = billingModelService.list(billWapper);
|
|
|
|
|
+// if (billingModels.size() < 1) {
|
|
|
|
|
+// log.info("无计费可上报模型");
|
|
|
|
|
+// return;
|
|
|
|
|
+// }
|
|
|
|
|
+
|
|
|
|
|
+// Map<String, BillingModel> billingModelMap = billingModels.stream()
|
|
|
|
|
+// .collect(Collectors.toMap(BillingModel::getPileCode, billingModel -> billingModel));
|
|
|
|
|
|
|
|
//只上传最近的订单
|
|
//只上传最近的订单
|
|
|
Map<String, Boolean> dealMap = new HashMap<>();
|
|
Map<String, Boolean> dealMap = new HashMap<>();
|
|
|
list.forEach(item -> {
|
|
list.forEach(item -> {
|
|
|
try {
|
|
try {
|
|
|
- if(!deviceMsgHandle.checkConnection(item.getPileCode(),item.getDeviceImei())){
|
|
|
|
|
- log.info("{}重新连接句柄不存在等待下次执行",item.getPileCode());
|
|
|
|
|
|
|
+ //检查设备是否在线
|
|
|
|
|
+ QueryWrapper<DeviceStatus> deviceStatusQueryWrapper = new QueryWrapper<>();
|
|
|
|
|
+ deviceStatusQueryWrapper.eq("pile_code", item.getPileCode());
|
|
|
|
|
+ deviceStatusQueryWrapper.eq("gun_port", item.getGunsCode());
|
|
|
|
|
+// deviceStatusQueryWrapper.last("limit 1");
|
|
|
|
|
+ DeviceStatus statusServiceOne = deviceStatusService.getOne(deviceStatusQueryWrapper);
|
|
|
|
|
+ if(statusServiceOne != null && statusServiceOne.getOnlineStatus()==StatusConstant.OFFLINE){
|
|
|
|
|
+ log.info("{}设备已离线不上报",item.getPileCode());
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- DeviceConnectionMsg deviceConnectionMsg = map.get(item.getPileCode());
|
|
|
|
|
- BillingModel b = billingModelMap.get(item.getPileCode());
|
|
|
|
|
|
|
+ QueryWrapper<BillingModel> billWapper = new QueryWrapper<>();
|
|
|
|
|
+ billWapper.eq("pile_code", item.getPileCode());
|
|
|
|
|
+ billWapper.eq("device_imei", item.getDeviceImei());
|
|
|
|
|
+ BillingModel b = billingModelService.getOne(billWapper);
|
|
|
if (b == null) {
|
|
if (b == null) {
|
|
|
log.info("{}上报充电中未匹配计费模型", item.getPileCode());
|
|
log.info("{}上报充电中未匹配计费模型", item.getPileCode());
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ if(!deviceMsgHandle.checkConnection(item.getPileCode(),item.getDeviceImei())){
|
|
|
|
|
+ log.info("{}重新连接句柄不存在等待下次执行",item.getPileCode());
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ DeviceConnectionMsg deviceConnectionMsg = map.get(item.getPileCode());
|
|
|
|
|
+
|
|
|
String k = item.getPileCode() + "_" + item.getGunsCode();
|
|
String k = item.getPileCode() + "_" + item.getGunsCode();
|
|
|
if (dealMap.containsKey(k)) {
|
|
if (dealMap.containsKey(k)) {
|
|
|
log.info("{}本轮已上报充电中只报最后一个订单", k);
|
|
log.info("{}本轮已上报充电中只报最后一个订单", k);
|