提交 2e4d9531 authored 作者: huyufan's avatar huyufan

修改BUG,货单增加用车类型:平台,部分,自有

上级 181da7e0
package com.clx.performance.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
import java.util.Arrays;
import java.util.Optional;
@Getter
@AllArgsConstructor
@SuppressWarnings("all")
public enum TruckDemandEnum {
;
@Getter
@AllArgsConstructor
public enum TruckType {
PLATFORM_CAR(1, "平台车辆"),
PLATFORM_ANY_CAR(2, "部分平台车辆"),
OWNER_CAR(3, "自有车辆");
private final Integer code;
private final String msg;
public static Optional<TruckType> getByCode(int code) {
return Arrays.stream(values()).filter(e -> e.code == code).findFirst();
}
}
}
......@@ -35,6 +35,9 @@ public class OrderGoods implements HasKey<Integer> {
@ApiModelProperty("货单编号")
private String orderGoodsNo;
@ApiModelProperty("用车需求: 1平台车辆 2部分平台车辆 3自有车辆")
private Integer truckDemand;
@TableField("order_goods_status")
@ApiModelProperty("货单状态")
private Integer orderGoodsStatus;
......
......@@ -9,9 +9,7 @@ import com.clx.performance.component.GoodsOrderStrategyContext;
import com.clx.performance.component.OrderGoodsIdGenerate;
import com.clx.performance.constant.RabbitKeyConstants;
import com.clx.performance.dao.OrderGoodsTruckBindDao;
import com.clx.performance.enums.OrderGoodsStatusEnum;
import com.clx.performance.enums.OrderGoodsTypeEnum;
import com.clx.performance.enums.PerformanceResultEnum;
import com.clx.performance.enums.*;
import com.clx.performance.mapper.OrderGoodsMapper;
import com.clx.performance.model.OrderGoods;
import com.clx.performance.service.OrderGoodsService;
......@@ -90,7 +88,7 @@ public class OneGoodsOrderStrategy implements GoodsOrderStrategy, InitializingBe
orderGoods.setExtractWeight(child.getExtractWeight());
orderGoods.setResidueTransportWeight(child.getExtractWeight());
orderGoods.setLossPrice(orderInfo.getLossPrice());
orderGoods.setTruckDemand(TruckDemandEnum.TruckType.PLATFORM_CAR.getCode());
//提取方式 1提取全部 2提取部分
Integer extractWay = child.getExtractWay();
orderGoods.setExtractWay(extractWay);
......@@ -151,7 +149,7 @@ public class OneGoodsOrderStrategy implements GoodsOrderStrategy, InitializingBe
@Override
public void afterPropertiesSet() throws Exception {
goodsOrderStrategyContext.strategyContext.put(1, this);
goodsOrderStrategyContext.strategyContext.put(TruckDemandEnum.TruckType.PLATFORM_CAR.getCode(), this);
}
public void sendMq(Map<String, LocalDateTime> mqMap, LocalDateTime now) {
......
......@@ -12,6 +12,7 @@ import com.clx.performance.dao.OrderGoodsTruckBindDao;
import com.clx.performance.enums.OrderGoodsStatusEnum;
import com.clx.performance.enums.OrderGoodsTypeEnum;
import com.clx.performance.enums.PerformanceResultEnum;
import com.clx.performance.enums.TruckDemandEnum;
import com.clx.performance.mapper.OrderGoodsMapper;
import com.clx.performance.model.OrderGoods;
import com.clx.performance.service.OrderGoodsService;
......@@ -85,6 +86,8 @@ public class ThreeGoodsOrderStrategy implements GoodsOrderStrategy, Initializing
orderGoods.setExtractWeight(child.getExtractWeight());
orderGoods.setResidueTransportWeight(child.getExtractWeight());
orderGoods.setLossPrice(orderInfo.getLossPrice());
orderGoods.setTruckDemand(TruckDemandEnum.TruckType.OWNER_CAR.getCode());
//提取方式 1提取全部 2提取部分
Integer extractWay = child.getExtractWay();
if (extractWay.equals(2)) {
......@@ -146,7 +149,7 @@ public class ThreeGoodsOrderStrategy implements GoodsOrderStrategy, Initializing
@Override
public void afterPropertiesSet() throws Exception {
goodsOrderStrategyContext.strategyContext.put(3,this);
goodsOrderStrategyContext.strategyContext.put(TruckDemandEnum.TruckType.OWNER_CAR.getCode(),this);
}
public void sendMq(Map<String, LocalDateTime> mqMap, LocalDateTime now) {
......
......@@ -12,6 +12,7 @@ import com.clx.performance.dao.OrderGoodsTruckBindDao;
import com.clx.performance.enums.OrderGoodsStatusEnum;
import com.clx.performance.enums.OrderGoodsTypeEnum;
import com.clx.performance.enums.PerformanceResultEnum;
import com.clx.performance.enums.TruckDemandEnum;
import com.clx.performance.mapper.OrderGoodsMapper;
import com.clx.performance.model.OrderGoods;
import com.clx.performance.service.OrderGoodsService;
......@@ -92,6 +93,7 @@ public class TwoGoodsOrderStrategy implements GoodsOrderStrategy, InitializingBe
orderGoods.setExtractWeight(child.getExtractWeight());
orderGoods.setResidueTransportWeight(child.getExtractWeight());
orderGoods.setLossPrice(orderInfo.getLossPrice());
orderGoods.setTruckDemand(TruckDemandEnum.TruckType.PLATFORM_ANY_CAR.getCode());
//提取方式 1提取全部 2提取部分
Integer extractWay = child.getExtractWay();
......@@ -144,14 +146,14 @@ public class TwoGoodsOrderStrategy implements GoodsOrderStrategy, InitializingBe
orderGoodsMapper.insert(orderGoods);
}
orderFeign.updateOrderInfoResidueWeight(orderInfo.getId(),orderInfo.getResidueWeight().subtract(childSum));
orderFeign.updateOrderInfoResidueWeight(orderInfo.getId(), orderInfo.getResidueWeight().subtract(childSum));
sendMq(mqMap, now);
return sendLazyTime;
}
@Override
public void afterPropertiesSet() throws Exception {
goodsOrderStrategyContext.strategyContext.put(2,this);
goodsOrderStrategyContext.strategyContext.put(TruckDemandEnum.TruckType.PLATFORM_ANY_CAR.getCode(), this);
}
public void sendMq(Map<String, LocalDateTime> mqMap, LocalDateTime now) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论