|
@@ -57,8 +57,6 @@ public class UnloadingHandler extends AbstractWaybillOrderHandler<WaybillOrderUn
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private PaymentFeignService paymentFeignService;
|
|
private PaymentFeignService paymentFeignService;
|
|
|
|
|
|
|
|
- //用于存储动态状态
|
|
|
|
|
- private Integer targetStatus;
|
|
|
|
|
|
|
|
|
|
// 定义运单未完结的状态集合
|
|
// 定义运单未完结的状态集合
|
|
|
private static final List<Integer> UNFINISHED_STATUSES = Arrays.asList(
|
|
private static final List<Integer> UNFINISHED_STATUSES = Arrays.asList(
|
|
@@ -108,7 +106,7 @@ public class UnloadingHandler extends AbstractWaybillOrderHandler<WaybillOrderUn
|
|
|
BigDecimal loadAmount = getLoadAmount(param);
|
|
BigDecimal loadAmount = getLoadAmount(param);
|
|
|
//按照装货量计算:推送到已完成状态
|
|
//按照装货量计算:推送到已完成状态
|
|
|
if (orderDetailVo.getChargeType() == 1) {
|
|
if (orderDetailVo.getChargeType() == 1) {
|
|
|
- this.targetStatus = Global.NUMERICAL_ONE;
|
|
|
|
|
|
|
+ waybill.setTargetStatus(Global.NUMERICAL_ONE);
|
|
|
|
|
|
|
|
//1.更新物流订单装货量
|
|
//1.更新物流订单装货量
|
|
|
updateLogisticsOrder(waybill, logisticsOrder, loadAmount);
|
|
updateLogisticsOrder(waybill, logisticsOrder, loadAmount);
|
|
@@ -123,7 +121,7 @@ public class UnloadingHandler extends AbstractWaybillOrderHandler<WaybillOrderUn
|
|
|
if (param.getUnloadAmount() == null || StringUtils.isBlank(param.getUnloadUrl())) {
|
|
if (param.getUnloadAmount() == null || StringUtils.isBlank(param.getUnloadUrl())) {
|
|
|
throw new BusinessPlatfromException(ErrorCodeEnum.PARAM_ERROR, "卸货净重和卸货凭证不能为空!");
|
|
throw new BusinessPlatfromException(ErrorCodeEnum.PARAM_ERROR, "卸货净重和卸货凭证不能为空!");
|
|
|
}
|
|
}
|
|
|
- this.targetStatus = Global.NUMERICAL_TWO;
|
|
|
|
|
|
|
+ waybill.setTargetStatus(Global.NUMERICAL_TWO);
|
|
|
|
|
|
|
|
//1.更新子运单卸货量
|
|
//1.更新子运单卸货量
|
|
|
updateWaybillOrderSubtask(param, waybill);
|
|
updateWaybillOrderSubtask(param, waybill);
|
|
@@ -291,10 +289,10 @@ public class UnloadingHandler extends AbstractWaybillOrderHandler<WaybillOrderUn
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
protected void getStatus(KwtWaybillOrder waybillOrder) {
|
|
protected void getStatus(KwtWaybillOrder waybillOrder) {
|
|
|
- if (this.targetStatus == null) {
|
|
|
|
|
|
|
+ if (waybillOrder.getTargetStatus() == null) {
|
|
|
throw new BusinessPlatfromException(ErrorCodeEnum.SYSTEM_ERROR, "[卸货]计算方式为空!");
|
|
throw new BusinessPlatfromException(ErrorCodeEnum.SYSTEM_ERROR, "[卸货]计算方式为空!");
|
|
|
}
|
|
}
|
|
|
- CarWaybillV1Enum status = Objects.equals(this.targetStatus, Global.NUMERICAL_ONE) ? CarWaybillV1Enum.COMPLETED
|
|
|
|
|
|
|
+ CarWaybillV1Enum status = Objects.equals(waybillOrder.getTargetStatus(), Global.NUMERICAL_ONE) ? CarWaybillV1Enum.COMPLETED
|
|
|
: CarWaybillV1Enum.COMPLETION_LOADING;
|
|
: CarWaybillV1Enum.COMPLETION_LOADING;
|
|
|
|
|
|
|
|
// 1. 修改运单状态
|
|
// 1. 修改运单状态
|
|
@@ -317,11 +315,11 @@ public class UnloadingHandler extends AbstractWaybillOrderHandler<WaybillOrderUn
|
|
|
* 重写 createNodeTrace,生成两条轨迹记录
|
|
* 重写 createNodeTrace,生成两条轨迹记录
|
|
|
*/
|
|
*/
|
|
|
protected void createNodeTrace(WaybillOrderUnloadParam param, KwtWaybillOrder waybillOrder) {
|
|
protected void createNodeTrace(WaybillOrderUnloadParam param, KwtWaybillOrder waybillOrder) {
|
|
|
- if (this.targetStatus == null) {
|
|
|
|
|
|
|
+ if (waybillOrder.getTargetStatus() == null) {
|
|
|
throw new BusinessPlatfromException(ErrorCodeEnum.SYSTEM_ERROR, "[卸货]计算方式为空!");
|
|
throw new BusinessPlatfromException(ErrorCodeEnum.SYSTEM_ERROR, "[卸货]计算方式为空!");
|
|
|
}
|
|
}
|
|
|
//订单按照装货方式计算
|
|
//订单按照装货方式计算
|
|
|
- if (this.targetStatus == Global.NUMERICAL_ONE) {
|
|
|
|
|
|
|
+ if (waybillOrder.getTargetStatus() == Global.NUMERICAL_ONE) {
|
|
|
// 第一条:卸货已完成
|
|
// 第一条:卸货已完成
|
|
|
KwtWaybillOrderNode node1 = getWaybillOrderNode(param, waybillOrder);
|
|
KwtWaybillOrderNode node1 = getWaybillOrderNode(param, waybillOrder);
|
|
|
node1.setRemark("司机[" + waybillOrder.getDriverName() + "]已卸货");
|
|
node1.setRemark("司机[" + waybillOrder.getDriverName() + "]已卸货");
|
|
@@ -356,7 +354,7 @@ public class UnloadingHandler extends AbstractWaybillOrderHandler<WaybillOrderUn
|
|
|
checkFakeUnloadDistance(waybillOrder, driverRulesVO);
|
|
checkFakeUnloadDistance(waybillOrder, driverRulesVO);
|
|
|
|
|
|
|
|
//订单若按照装货方式计算:此时整个运单已经结束,计算运单总耗时。如按照卸货方式计算,运单还未结算,不进行司机加减分
|
|
//订单若按照装货方式计算:此时整个运单已经结束,计算运单总耗时。如按照卸货方式计算,运单还未结算,不进行司机加减分
|
|
|
- if (this.targetStatus == null || this.targetStatus != Global.NUMERICAL_ONE) {
|
|
|
|
|
|
|
+ if (waybillOrder.getTargetStatus() == null || waybillOrder.getTargetStatus() != Global.NUMERICAL_ONE) {
|
|
|
log.info("当前运单是按照“卸货方式计算“,运单未完成,跳过超时校验!运单id: {}", waybillOrder.getId());
|
|
log.info("当前运单是按照“卸货方式计算“,运单未完成,跳过超时校验!运单id: {}", waybillOrder.getId());
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|