|
@@ -409,19 +409,34 @@ public class ComeIntoHandler extends AbstractWaybillOrderHandler<WaybillOrderCme
|
|
|
// 校验是否第一次过磅
|
|
// 校验是否第一次过磅
|
|
|
if (checkIsFirst(waybillOrder)) {
|
|
if (checkIsFirst(waybillOrder)) {
|
|
|
status = CarWaybillV1Enum.REFUSE_TRAFFIC.getCode();
|
|
status = CarWaybillV1Enum.REFUSE_TRAFFIC.getCode();
|
|
|
- } else {
|
|
|
|
|
- if (waybillOrder.getTargetStatus() == null) {
|
|
|
|
|
- waybillOrder.setLabel(Global.NUMERICAL_ONE);
|
|
|
|
|
- } else {
|
|
|
|
|
- waybillOrder.setLabel(Global.NUMERICAL_ZERO);
|
|
|
|
|
- }
|
|
|
|
|
- status = switch (waybillOrder.getTargetStatus()) {
|
|
|
|
|
- case 1 -> CarWaybillV1Enum.EMPTY_WAIT_LEAVE.getCode();
|
|
|
|
|
- case 2 -> CarWaybillV1Enum.WAIT_LEAVE.getCode();
|
|
|
|
|
- case 3 -> CarWaybillV1Enum.UNLOADING.getCode();
|
|
|
|
|
- default -> -1;
|
|
|
|
|
- };
|
|
|
|
|
|
|
+ updateOrderStatus(waybillOrder, status);
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ // 后续过磅,只更新label
|
|
|
|
|
+ if (waybillOrder.getTargetStatus() == null) {
|
|
|
|
|
+ waybillOrder.setLabel(Global.NUMERICAL_ONE);
|
|
|
|
|
+ waybillOrderRepository.updateById(waybillOrder);
|
|
|
|
|
+ return;
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ waybillOrder.setLabel(Global.NUMERICAL_ZERO);
|
|
|
|
|
+ status = switch (waybillOrder.getTargetStatus()) {
|
|
|
|
|
+ case 1 -> CarWaybillV1Enum.EMPTY_WAIT_LEAVE.getCode();
|
|
|
|
|
+ case 2 -> CarWaybillV1Enum.WAIT_LEAVE.getCode();
|
|
|
|
|
+ case 3 -> CarWaybillV1Enum.UNLOADING.getCode();
|
|
|
|
|
+ default -> -1;
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ updateOrderStatus(waybillOrder, status);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 修改运单状态
|
|
|
|
|
+ * @param waybillOrder
|
|
|
|
|
+ * @param status
|
|
|
|
|
+ */
|
|
|
|
|
+ private void updateOrderStatus(KwtWaybillOrder waybillOrder, Integer status) {
|
|
|
// 1. 修改运单状态
|
|
// 1. 修改运单状态
|
|
|
waybillOrder.setStatus(status);
|
|
waybillOrder.setStatus(status);
|
|
|
waybillOrderRepository.updateById(waybillOrder);
|
|
waybillOrderRepository.updateById(waybillOrder);
|