diff --git a/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/entity/TrunklineAdvanceDetailEntity.java b/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/entity/TrunklineAdvanceDetailEntity.java index 68bce4889..613922761 100644 --- a/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/entity/TrunklineAdvanceDetailEntity.java +++ b/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/entity/TrunklineAdvanceDetailEntity.java @@ -15,110 +15,178 @@ import java.math.BigDecimal; @EqualsAndHashCode(callSuper = true) public class TrunklineAdvanceDetailEntity extends TenantEntity { - /** 预留1 */ - @ApiModelProperty(name = "预留1",notes = "") - private String reserve1 ; - /** 预留2 */ - @ApiModelProperty(name = "预留2",notes = "") - private String reserve2 ; - /** 预留3 */ - @ApiModelProperty(name = "预留3",notes = "") - private String reserve3 ; - /** 预留4 */ - @ApiModelProperty(name = "预留4",notes = "") - private String reserve4 ; - /** 预留5 */ - @ApiModelProperty(name = "预留5",notes = "") - private String reserve5 ; - /** 仓库id */ - @ApiModelProperty(name = "仓库id",notes = "") - private Long warehouseId ; - /** 仓库名称 */ - @ApiModelProperty(name = "仓库名称",notes = "") - private String warehouseName ; - /** 仓库id */ - @ApiModelProperty(name = "导入仓库id",notes = "") - private Long incomingWarehouseId ; - /** 仓库名称 */ - @ApiModelProperty(name = "导入仓库名称",notes = "") - private String incomingWarehouseName ; - /** 暂存单id */ - @ApiModelProperty(name = "暂存单id",notes = "") - private Long advanceId ; - /** 订单自编号 */ - @ApiModelProperty(name = "订单自编号",notes = "") - private String orderCode ; - /** 品牌 */ - @ApiModelProperty(name = "品牌",notes = "") - private String brand ; - /** 订单来源 */ - @ApiModelProperty(name = "订单来源",notes = "") - private String systemType ; - /** 一级品类名称 */ - @ApiModelProperty(name = "一级品类名称",notes = "") - private String firstPackName ; - /** 一级品类编码 */ - @ApiModelProperty(name = "一级品类编码",notes = "") - private String firstPackCode ; - /** 二级品类名称 */ - @ApiModelProperty(name = "二级品类名称",notes = "") - private String secondPackName ; - /** 二级品类编码 */ - @ApiModelProperty(name = "二级品类编码",notes = "") - private String secondPackCode ; - /** 三级品类名称 */ - @ApiModelProperty(name = "三级品类名称",notes = "") - private String thirdPackName ; - /** 三级品类编码 */ - @ApiModelProperty(name = "三级品类编码",notes = "") - private String thirdPackCode ; - /** 基地名称 */ - @ApiModelProperty(name = "基地名称",notes = "") - private String siteName ; - /** 基地编码 */ - @ApiModelProperty(name = "基地编码",notes = "") - private String siteCode ; - /** 数量 */ - @ApiModelProperty(name = "数量",notes = "") - private Integer quantity ; - /** 包件码 */ - @ApiModelProperty(name = "包件码",notes = "") - private String orderPackageCode ; - /** 车次号 */ - @ApiModelProperty(name = "车次号",notes = "") - private String trainNumber ; - /** 服务号 */ - @ApiModelProperty(name = "服务号",notes = "") - private String serviceNum ; - /** 运单id */ - @ApiModelProperty(name = "运单id",notes = "") - private Long waybillId ; - /** 运单号 */ - @ApiModelProperty(name = "运单号",notes = "") - private String waybillNo ; - /** 包件状态 */ - @ApiModelProperty(name = "包件状态 0未入库 1已入库",notes = "") - private String packageStatus ; + /** + * 预留1 金牌包条重复时设置为1 + */ + @ApiModelProperty(name = "预留1", notes = "") + private String reserve1; + /** + * 预留2 + */ + @ApiModelProperty(name = "预留2", notes = "") + private String reserve2; + /** + * 预留3 + */ + @ApiModelProperty(name = "预留3", notes = "") + private String reserve3; + /** + * 预留4 + */ + @ApiModelProperty(name = "预留4", notes = "") + private String reserve4; + /** + * 预留5 + */ + @ApiModelProperty(name = "预留5", notes = "") + private String reserve5; + /** + * 仓库id + */ + @ApiModelProperty(name = "仓库id", notes = "") + private Long warehouseId; + /** + * 仓库名称 + */ + @ApiModelProperty(name = "仓库名称", notes = "") + private String warehouseName; + /** + * 仓库id + */ + @ApiModelProperty(name = "导入仓库id", notes = "") + private Long incomingWarehouseId; + /** + * 仓库名称 + */ + @ApiModelProperty(name = "导入仓库名称", notes = "") + private String incomingWarehouseName; + /** + * 暂存单id + */ + @ApiModelProperty(name = "暂存单id", notes = "") + private Long advanceId; + /** + * 订单自编号 + */ + @ApiModelProperty(name = "订单自编号", notes = "") + private String orderCode; + /** + * 品牌 + */ + @ApiModelProperty(name = "品牌", notes = "") + private String brand; + /** + * 订单来源 + */ + @ApiModelProperty(name = "订单来源", notes = "") + private String systemType; + /** + * 一级品类名称 + */ + @ApiModelProperty(name = "一级品类名称", notes = "") + private String firstPackName; + /** + * 一级品类编码 + */ + @ApiModelProperty(name = "一级品类编码", notes = "") + private String firstPackCode; + /** + * 二级品类名称 + */ + @ApiModelProperty(name = "二级品类名称", notes = "") + private String secondPackName; + /** + * 二级品类编码 + */ + @ApiModelProperty(name = "二级品类编码", notes = "") + private String secondPackCode; + /** + * 三级品类名称 + */ + @ApiModelProperty(name = "三级品类名称", notes = "") + private String thirdPackName; + /** + * 三级品类编码 + */ + @ApiModelProperty(name = "三级品类编码", notes = "") + private String thirdPackCode; + /** + * 基地名称 + */ + @ApiModelProperty(name = "基地名称", notes = "") + private String siteName; + /** + * 基地编码 + */ + @ApiModelProperty(name = "基地编码", notes = "") + private String siteCode; + /** + * 数量 + */ + @ApiModelProperty(name = "数量", notes = "") + private Integer quantity; + /** + * 包件码 + */ + @ApiModelProperty(name = "包件码", notes = "") + private String orderPackageCode; + /** + * 车次号 + */ + @ApiModelProperty(name = "车次号", notes = "") + private String trainNumber; + /** + * 服务号 + */ + @ApiModelProperty(name = "服务号", notes = "") + private String serviceNum; + /** + * 运单id + */ + @ApiModelProperty(name = "运单id", notes = "") + private Long waybillId; + /** + * 运单号 + */ + @ApiModelProperty(name = "运单号", notes = "") + private String waybillNo; + /** + * 包件状态 + */ + @ApiModelProperty(name = "包件状态 0未入库 1已入库", notes = "") + private String packageStatus; - /** 物料id */ - @ApiModelProperty(name = "物料id",notes = "") - private Long materialId ; - /** 物料编码 */ - @ApiModelProperty(name = "物料编码",notes = "") - private String materialCode ; - /** 物料名称 */ - @ApiModelProperty(name = "物料名称",notes = "") - private String materialName ; - /** 重量 */ - @ApiModelProperty(name = "重量",notes = "") - private BigDecimal weight ; - /** 体积 */ - @ApiModelProperty(name = "体积",notes = "") - private BigDecimal volume ; - /** 计价方式 1件 2方 3公斤 */ - @ApiModelProperty(name = "计价方式 1件 2方 3公斤",notes = "") - private Integer chargeType ; - @ApiModelProperty(name = "例放补进",notes = "") + /** + * 物料id + */ + @ApiModelProperty(name = "物料id", notes = "") + private Long materialId; + /** + * 物料编码 + */ + @ApiModelProperty(name = "物料编码", notes = "") + private String materialCode; + /** + * 物料名称 + */ + @ApiModelProperty(name = "物料名称", notes = "") + private String materialName; + /** + * 重量 + */ + @ApiModelProperty(name = "重量", notes = "") + private BigDecimal weight; + /** + * 体积 + */ + @ApiModelProperty(name = "体积", notes = "") + private BigDecimal volume; + /** + * 计价方式 1件 2方 3公斤 + */ + @ApiModelProperty(name = "计价方式 1件 2方 3公斤", notes = "") + private Integer chargeType; + @ApiModelProperty(name = "例放补进", notes = "") private String supple; @ApiModelProperty(name = "货运清单号") private String manifest; diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mq/AdvanceOrderListener.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mq/AdvanceOrderListener.java index d03030a91..61a2b8a7b 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mq/AdvanceOrderListener.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mq/AdvanceOrderListener.java @@ -9,6 +9,7 @@ import cn.hutool.json.JSONObject; import cn.hutool.json.JSONUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.logpm.factorydata.enums.BrandEnums; import com.logpm.trunkline.entity.TrunklineAdvanceDetailEntity; import com.logpm.trunkline.entity.TrunklineAdvanceEntity; import com.logpm.trunkline.entity.TrunklineDetailProductEntity; @@ -124,7 +125,25 @@ public class AdvanceOrderListener { TrunklineAdvanceDetailEntity advanceDetailEntity = JSONUtil.toBean(detail, TrunklineAdvanceDetailEntity.class); if (ObjectUtil.isNotNull(advanceDetailEntity)) { if (CollUtil.isNotEmpty(packageCodeSet) && packageCodeSet.contains(advanceDetailEntity.getOrderPackageCode())) { - continue; + // 金牌如果是重复包条,则单独处理 + if (ObjectUtil.equal(advanceEntity.getBrand(), BrandEnums.JP.getValue())) { + // 金牌按DD单号+包条确定唯一值 + List list = advanceDetailService.list(Wrappers.lambdaQuery() + .eq(TrunklineAdvanceDetailEntity::getOrderPackageCode, advanceDetailEntity.getOrderPackageCode()) + .eq(TrunklineAdvanceDetailEntity::getOrderCode, advanceEntity.getOrderCode()) + ); + if (CollUtil.isNotEmpty(list)) { + // 订单+包件重复则不处理这条数据 + log.error("金牌,订单+包条码重复,订单:{},包条码:{}", advanceEntity.getOrderCode(), advanceDetailEntity.getOrderPackageCode()); + continue; + } else { + // 包件码重复,订单+包件不重复,设置预留字段1 为 1 + advanceDetailEntity.setReserve1("1"); + } + } else { + log.error("非金牌,包条码重复,包条码:{}", advanceDetailEntity.getOrderPackageCode()); + continue; + } } advanceDetailEntity.setAdvanceId(advanceEntity.getId()); // 设置发货时间为当前时间