|
|
@@ -3499,15 +3499,15 @@ public class KwtWaybillOrderV1Service {
|
|
|
.collect(Collectors.toMap(KwtLogisticsOrderGoods::getLOrderId, Function.identity(), (k1, k2) -> k1));
|
|
|
|
|
|
// 查询过磅单据信息(如果有地磅)
|
|
|
- Set<Long> nodeIds = nodes.stream()
|
|
|
- .filter(n -> n.getWeighbridgeId() != null)
|
|
|
- .map(KwtWaybillOrderNode::getId)
|
|
|
- .collect(Collectors.toSet());
|
|
|
- Map<Long, KwtWaybillOrderTicket> ticketMap = new HashMap<>();
|
|
|
- if (!nodeIds.isEmpty()) {
|
|
|
- // 这里假设根据wSubtaskId和地址ID查询
|
|
|
- // 实际可能需要根据具体业务调整查询逻辑
|
|
|
- }
|
|
|
+// Set<Long> nodeIds = nodes.stream()
|
|
|
+// .filter(n -> n.getWeighbridgeId() != null)
|
|
|
+// .map(KwtWaybillOrderNode::getId)
|
|
|
+// .collect(Collectors.toSet());
|
|
|
+// Map<Long, KwtWaybillOrderTicket> ticketMap = new HashMap<>();
|
|
|
+// if (!nodeIds.isEmpty()) {
|
|
|
+// // 这里假设根据wSubtaskId和地址ID查询
|
|
|
+// // 实际可能需要根据具体业务调整查询逻辑
|
|
|
+// }
|
|
|
|
|
|
// 单位字典
|
|
|
Map<String, Map<String, String>> dict = remoteSystemService.queryDictByType(
|
|
|
@@ -3522,6 +3522,7 @@ public class KwtWaybillOrderV1Service {
|
|
|
vo.setId(node.getId());
|
|
|
vo.setCreateTime(DateUtils.format(node.getCreateTime(), DateUtils.DATE_TIME_PATTERN));
|
|
|
vo.setOrderStatus(node.getOrderStatus());
|
|
|
+ vo.setOrderStatusName(CarWaybillV1Enum.geDesc(node.getOrderStatus()));
|
|
|
vo.setTruckNo(node.getTruckNo());
|
|
|
vo.setDriverName(node.getDriverName());
|
|
|
vo.setWeighbridgeName(node.getWeighbridgeName());
|
|
|
@@ -3552,50 +3553,28 @@ public class KwtWaybillOrderV1Service {
|
|
|
KwtWaybillOrderSubtask subtask,
|
|
|
Map<Long, KwtLogisticsOrderGoods> goodsMap,
|
|
|
Map<String, String> unitMap) {
|
|
|
- StringBuilder sb = new StringBuilder();
|
|
|
-
|
|
|
- // 状态名称
|
|
|
- String statusName = CarWaybillEnum.getAlias(node.getOrderStatus());
|
|
|
- if (StringUtils.isNotBlank(statusName)) {
|
|
|
- sb.append(statusName);
|
|
|
+ if (Objects.isNull(subtask)){
|
|
|
+ return "";
|
|
|
}
|
|
|
-
|
|
|
- // 车辆信息
|
|
|
- if (StringUtils.isNotBlank(node.getTruckNo())) {
|
|
|
+ StringBuilder sb = new StringBuilder();
|
|
|
+
|
|
|
+ if (Objects.equals(node.getOrderStatus(), CarWaybillV1Enum.PENDING_VEHICLE.getCode())) {
|
|
|
sb.append(" 车辆【").append(node.getTruckNo()).append("】");
|
|
|
+ sb.append(" 司机【").append(node.getDriverName()).append("】接单成功");
|
|
|
+ sb.append(" 预计任务重量【").append(subtask.getEntrustAmount()).append(subtask.getUnit()).append("】");
|
|
|
}
|
|
|
-
|
|
|
- // 司机信息
|
|
|
- if (StringUtils.isNotBlank(node.getDriverName())) {
|
|
|
- sb.append(" 司机【").append(node.getDriverName()).append("】");
|
|
|
+
|
|
|
+ if (Objects.equals(node.getOrderStatus(), CarWaybillV1Enum.REFUSE_TRAFFIC.getCode())) {
|
|
|
+ sb.append(" 已到达装货点,").append(node.getWeighbridgeName()).append("】").append(subtask.getEntrustAmount()).append(subtask.getUnit());
|
|
|
}
|
|
|
-
|
|
|
- // 货物信息
|
|
|
- if (subtask != null) {
|
|
|
- KwtLogisticsOrderGoods goods = goodsMap.get(subtask.getLOrderId());
|
|
|
- if (goods != null && StringUtils.isNotBlank(goods.getGoodsName())) {
|
|
|
- sb.append(" 装载货物【").append(goods.getGoodsName()).append("】");
|
|
|
- }
|
|
|
-
|
|
|
- // 状态标签
|
|
|
- String statusLabel = getStatusLabel(node.getOrderStatus());
|
|
|
- if (StringUtils.isNotBlank(statusLabel)) {
|
|
|
- sb.append(" 【").append(statusLabel).append("】");
|
|
|
- }
|
|
|
-
|
|
|
- // 重量信息(根据状态显示不同的重量)
|
|
|
- String weight = getWeightByStatus(node.getOrderStatus(), subtask);
|
|
|
- String unit = unitMap.getOrDefault(subtask.getUnit(), "吨");
|
|
|
- if (StringUtils.isNotBlank(weight)) {
|
|
|
- sb.append(" 【").append(weight).append(unit).append("】");
|
|
|
- }
|
|
|
+ if (Objects.equals(node.getOrderStatus(), CarWaybillV1Enum.EXIT_COMPLETED.getCode())) {
|
|
|
+ sb.append(" 装货完成,").append(node.getTruckNo()).append(node.getDriverName());
|
|
|
+ sb.append(node.getWeighbridgeName()).append("称重").append(subtask.getLoadAmount());
|
|
|
}
|
|
|
-
|
|
|
- // 地磅信息
|
|
|
- if (StringUtils.isNotBlank(node.getWeighbridgeName())) {
|
|
|
- sb.append(" 地磅【").append(node.getWeighbridgeName()).append("】");
|
|
|
+
|
|
|
+ if (Objects.equals(node.getOrderStatus(), CarWaybillV1Enum.WAIT_LOADING.getCode())) {
|
|
|
+ sb.append(" 司机【").append(node.getDriverName()).append("】已确认离场");
|
|
|
}
|
|
|
-
|
|
|
return sb.toString();
|
|
|
}
|
|
|
|
|
|
@@ -3607,11 +3586,15 @@ public class KwtWaybillOrderV1Service {
|
|
|
return "";
|
|
|
}
|
|
|
// 根据具体业务逻辑返回标签,如:参运、实装、实卸等
|
|
|
- if (status.equals(CarWaybillEnum.COMPLETION_LOADING.getCode())) {
|
|
|
+ // CarWaybillV1Enum: 1-已接单, 5-到达装货点, 10-已装货, 15-已离场, 20-已卸货, 25-已完成, 30-审核驳回, 99-已取消
|
|
|
+ if (status.equals(CarWaybillV1Enum.EXIT_COMPLETED.getCode())) {
|
|
|
+ // 10-已装货
|
|
|
return "实装";
|
|
|
- } else if (status.equals(CarWaybillEnum.COMPLETION_UNLOADING.getCode())) {
|
|
|
+ } else if (status.equals(CarWaybillV1Enum.COMPLETION_LOADING.getCode())) {
|
|
|
+ // 20-已卸货
|
|
|
return "实卸";
|
|
|
- } else if (status.equals(CarWaybillEnum.EXIT_COMPLETED.getCode())) {
|
|
|
+ } else if (status.equals(CarWaybillV1Enum.WAIT_LOADING.getCode())) {
|
|
|
+ // 15-已离场
|
|
|
return "参运";
|
|
|
}
|
|
|
return "";
|
|
|
@@ -3626,14 +3609,15 @@ public class KwtWaybillOrderV1Service {
|
|
|
}
|
|
|
|
|
|
// 根据状态返回不同的重量
|
|
|
- if (status.equals(CarWaybillEnum.EXIT_COMPLETED.getCode())) {
|
|
|
- // 参运显示委托量
|
|
|
+ // CarWaybillV1Enum: 1-已接单, 5-到达装货点, 10-已装货, 15-已离场, 20-已卸货, 25-已完成, 30-审核驳回, 99-已取消
|
|
|
+ if (status.equals(CarWaybillV1Enum.WAIT_LOADING.getCode())) {
|
|
|
+ // 15-已离场-参运显示委托量
|
|
|
return String.valueOf(subtask.getEntrustAmount());
|
|
|
- } else if (status.equals(CarWaybillEnum.COMPLETION_LOADING.getCode())) {
|
|
|
- // 装货显示实装量
|
|
|
+ } else if (status.equals(CarWaybillV1Enum.EXIT_COMPLETED.getCode())) {
|
|
|
+ // 10-已装货-装货显示实装量
|
|
|
return String.valueOf(subtask.getLoadAmount());
|
|
|
- } else if (status.equals(CarWaybillEnum.COMPLETION_UNLOADING.getCode())) {
|
|
|
- // 卸货显示实卸量
|
|
|
+ } else if (status.equals(CarWaybillV1Enum.COMPLETION_LOADING.getCode())) {
|
|
|
+ // 20-已卸货-卸货显示实卸量
|
|
|
return String.valueOf(subtask.getUnloadAmount());
|
|
|
}
|
|
|
|