瀏覽代碼

推送过磅图片

donglang 3 周之前
父節點
當前提交
5f4a1af03a

+ 14 - 0
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/controller/enterpriseApp/AppWayBillController.java

@@ -416,4 +416,18 @@ public class AppWayBillController {
     }
 
 
+    /**
+     * 推送过磅图片
+     *
+     * @param param
+     * @return
+     */
+    @Operation(summary = "推送过磅图片", description = "推送过磅图片")
+    @PostMapping("/weighImage")
+    public BaseResult weighImage(@RequestBody @Valid WaybillOrderWeighImageParam param){
+        waybillOrderService.weighImage(param);
+        return BaseResult.success();
+    }
+
+
 }

+ 34 - 0
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/model/param/WaybillOrderWeighImageParam.java

@@ -0,0 +1,34 @@
+package com.sckw.transport.model.param;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+import java.io.Serial;
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * @author :donglang
+ * @version :1.0
+ * @description : 车辆过磅入参信息
+ * @create :2025-11-13 08:59:00
+ */
+@Data
+public class WaybillOrderWeighImageParam extends WaybillOrderProcessParam implements Serializable {
+
+    @Serial
+    private static final long serialVersionUID = 1038619782660342061L;
+
+    /**
+     * 车辆号
+     */
+    @Schema(description = "车辆号")
+    private String truckNo;
+
+    /**
+     * 称重重量(毛重/皮重)
+     */
+    @Schema(description = "称重重量")
+    private List<String> weighImageList;
+
+}

+ 37 - 0
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/service/app/WaybillOrderService.java

@@ -74,6 +74,7 @@ public class WaybillOrderService {
     private final KwtWaybillOrderAddressRepository waybillOrderAddressRepository;
     private final KwtWaybillOrderTicketRepository waybillOrderTicketRepository;
     private final KwtWaybillOrderNodeRepository waybillOrderNodeRepository;
+    private final KwtWaybillOrderWeighbridgeRepository waybillOrderWeighbridgeRepository;
 
     @DubboReference(version = "1.0.0", group = "design", check = false, timeout = 6000)
     RemoteSystemService remoteSystemService;
@@ -1734,6 +1735,42 @@ public class WaybillOrderService {
         unloadingHandler.handler(param);
     }
 
+    /**
+     * 过磅推送图片
+     * @param param
+     */
+    public void weighImage(WaybillOrderWeighImageParam param) {
+        if (StringUtils.isBlank(param.getTruckNo())){
+            throw new BusinessPlatfromException(ErrorCodeEnum.PARAM_ERROR, "车牌号不能为空!");
+        }
+        // 定义运单可以过磅的状态集合(无论山上山下地磅)
+        List<Integer> FORBIDDEN_STATUSES = Arrays.asList(
+                CarWaybillV1Enum.PENDING_VEHICLE.getCode(),
+                CarWaybillV1Enum.REFUSE_TRAFFIC.getCode(),
+                CarWaybillV1Enum.EXIT_COMPLETED.getCode(),
+                CarWaybillV1Enum.EMPTY_WAIT_LEAVE.getCode(),
+                CarWaybillV1Enum.WAIT_LEAVE.getCode(),
+                CarWaybillV1Enum.UNLOADING.getCode(),
+                CarWaybillV1Enum.REPLENISHING.getCode(),
+                CarWaybillV1Enum.REPLENISH_FINISH.getCode(),
+                CarWaybillV1Enum.WAIT_LOADING.getCode(),
+                CarWaybillV1Enum.UNLOADING_POINT.getCode()
+        );
+        List<KwtWaybillOrder> wbOrderByTruckNo = waybillOrderRepository.findWbOrderByTruckNoAndStatus(param.getTruckNo(), FORBIDDEN_STATUSES);
+        if (CollectionUtils.isEmpty(wbOrderByTruckNo)) {
+            throw new BusinessPlatfromException(ErrorCodeEnum.WAYBILL_ORDER_NOT_FOUND, "[过磅推送图片]当前车辆没有可以过磅称重状态的运单");
+        }
+        if (wbOrderByTruckNo.size() > 1) {
+            throw new BusinessPlatfromException(ErrorCodeEnum.WAYBILL_ORDER_NOT_FOUND, "[过磅推送图片]当前车辆过磅称重状态存在多条运单");
+        }
+        KwtWaybillOrder waybillOrder = wbOrderByTruckNo.get(0);
+        KwtWaybillOrderNode waybillOrderNode = waybillOrderNodeRepository.queryNodesByOrderId(waybillOrder.getId(), waybillOrder.getStatus());
+        if (waybillOrderNode == null) {
+            throw new BusinessPlatfromException(ErrorCodeEnum.WAYBILL_ORDER_NOT_FOUND, "[过磅推送图片]未查询运单节点数据");
+        }
+        waybillOrderNode.setWeighUrl(param.getWeighUrl());
+    }
+
 
 
 //    /**