|
@@ -1194,6 +1194,29 @@ public class WaybillOrderService {
|
|
|
*/
|
|
*/
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public void comeInto(WaybillOrderCmeIntoWeighParam param) {
|
|
public void comeInto(WaybillOrderCmeIntoWeighParam param) {
|
|
|
|
|
+ if (StringUtils.isBlank(param.getTruckNo())){
|
|
|
|
|
+ throw new BusinessPlatfromException(ErrorCodeEnum.PARAM_ERROR, "车牌号不能为空!");
|
|
|
|
|
+ }
|
|
|
|
|
+ if (param.getWeighAmount() == null) {
|
|
|
|
|
+ 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()
|
|
|
|
|
+ );
|
|
|
|
|
+ List<KwtWaybillOrder> wbOrderByTruckNo = waybillOrderRepository.findWbOrderByTruckNoAndStatus(param.getTruckNo(), FORBIDDEN_STATUSES);
|
|
|
|
|
+ if (CollectionUtils.isEmpty(wbOrderByTruckNo) || wbOrderByTruckNo.size() > 1) {
|
|
|
|
|
+ throw new BusinessPlatfromException(ErrorCodeEnum.WAYBILL_ORDER_NOT_FOUND, "当前车辆没有可以称重过磅状态的运单");
|
|
|
|
|
+ }
|
|
|
|
|
+ param.setWaybillOrderId(wbOrderByTruckNo.get(0).getId());
|
|
|
|
|
+
|
|
|
comeIntoHandler.handler(param);
|
|
comeIntoHandler.handler(param);
|
|
|
}
|
|
}
|
|
|
|
|
|