diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionBillOrderVO.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionBillOrderVO.java index 7f7b541e8..bb71ea973 100644 --- a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionBillOrderVO.java +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionBillOrderVO.java @@ -44,11 +44,15 @@ public class DistributionBillOrderVO { /** * 提货件数 */ - private String pickUpQuantity; + private Integer pickUpQuantity; /** * 提货状态 */ private String conditions; + /** + * 提货状态 + */ + private String conditionsName; /** * 签收时间 */ diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/excel/DistributionBillOrderExcel.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/excel/DistributionBillOrderExcel.java index 595f8db81..87fc8b29b 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/excel/DistributionBillOrderExcel.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/excel/DistributionBillOrderExcel.java @@ -20,49 +20,93 @@ public class DistributionBillOrderExcel { @ColumnWidth(20) @ExcelProperty("服务号") private String serviceNumber; + + @ColumnWidth(20) @ExcelProperty("运单号") private String waybillNumber; //运单号 -// @ColumnWidth(20) -// @ExcelProperty("客户车次号") -// private String trainNumber; //客户车次号 + + + @ColumnWidth(20) + @ExcelProperty("订单自编号") + private String orderCode; //客户车次号 + + @ColumnWidth(20) @ExcelProperty("始发仓") private String sendWarehouseName; //始发仓 - @ColumnWidth(20) - @ExcelProperty("订单总数") - private String totalNumber; - @ColumnWidth(20) - @ExcelProperty("应提货件数") - private String handQuantity; - @ColumnWidth(20) - @ExcelProperty("提货件数") - private String pickUpQuantity; - @ColumnWidth(20) - @ExcelProperty("提货状态") - private String conditions; - @ColumnWidth(20) - @ExcelProperty("提货状态") - private String conditionsName; + + @ColumnWidth(20) @ExcelProperty("货物名称") private String descriptionGoods; + + @ColumnWidth(20) @ExcelProperty("物料名称") private String materialName; + + + @ColumnWidth(20) + @ExcelProperty("订单总数") + private Integer totalNumber; + + + @ColumnWidth(20) + @ExcelProperty("计划件数") + private Integer handQuantity; + + + + @ColumnWidth(20) - @ExcelProperty("备货件数") //TODO 和应提货件数 值一样后期可能要改 - private String stockUpQuantity; + @ExcelProperty("备货件数") + private Integer preparedQuantity; + @ColumnWidth(20) - @ExcelProperty("已备数量") - private String preparedQuantity; + @ExcelProperty("实提件数") + private Integer pickUpQuantity; + + + + @ColumnWidth(20) @ExcelProperty("备货状态") private String stockupStatusName; + + + @ColumnWidth(20) + @ExcelProperty("提货状态") + private String conditionsName; + + +// +// @ColumnWidth(20) +// @ExcelProperty("备货件数") +// private String stockUpQuantity; + + +// @ColumnWidth(20) +// @ExcelProperty("已备数量") +// private String preparedQuantity; + +// +// @ColumnWidth(20) +// @ExcelProperty("备货状态") +// private String stockupStatusName; + + @ExcelIgnore private String stockupStatus; + + @ExcelIgnore + private String conditions; + + @ColumnWidth(20) @ExcelProperty("托盘码") private String pallet; + + @ColumnWidth(20) @ExcelProperty("货位信息") private String goodsAllocation; diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillStockMapper.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillStockMapper.java index 94b8fd26d..d36fbe8dc 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillStockMapper.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillStockMapper.java @@ -70,7 +70,7 @@ public interface DistrilbutionBillStockMapper extends BaseMapper listPackageSelf(@Param("reservationId")Long reservationId); - List distrilbutionBillStock(@Param("param")DistrilbutionBillStockEntity distrilbutionBillStock); + List getBillStockExcel(@Param("param")DistrilbutionBillStockEntity distrilbutionBillStock); List billOrderPackExcel(@Param("param")DistrilbutionBillStockEntity billStock); } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillStockMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillStockMapper.xml index d47383bf6..2cf138e8e 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillStockMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillStockMapper.xml @@ -115,42 +115,48 @@ - - select DISTINCT ldsa.order_code orderCode,ldsa.total_number,ldsa.description_goods descriptionGoods,ldsa.stockup_status stockupStatus, + select DISTINCT + ldsa.order_code orderCode, + ldsa.total_number, + ldsa.description_goods descriptionGoods, + ldsa.stockup_status stockupStatus, + (SELECT GROUP_CONCAT(material_name) FROM logpm_distribution_parcel_list WHERE is_deleted = 0 AND stock_article_id = ldsa.id GROUP BY stock_article_id) AS materialName, + CASE ldsa.is_zero + WHEN 0 THEN (select COUNT(id) from logpm_distrilbution_bill_package - where stock_article_id = ldsa.id and packet_bar_status in (1,3) and bill_lading_id = #{param.billLadingId} ) handQuantity, - (select COUNT(id) from logpm_distribution_bill_lading_scan - where stock_article_id = ldsa.id ) pick_up_quantity, + where stock_article_id = ldsa.id and packet_bar_status in (1,3) and bill_lading_id = #{param.billLadingId} AND is_deleted = 0 ) + ELSE + (select sum(quantity) from logpm_distribution_reservation_zero_package + where stock_article_id = ldsa.id and zero_package_status in (1,3) AND type =3 and reservation_id = #{param.billLadingId} AND is_deleted = 0 ) + END handQuantity, + (select IFNULL(sum(quantity) ,0) from logpm_distribution_bill_lading_scan + where stock_article_id = ldsa.id AND bill_lading_id = #{param.billLadingId} AND is_deleted = 0 ) pick_up_quantity, CASE - WHEN (SELECT COUNT(id) FROM logpm_distribution_bill_lading_scan WHERE stock_article_id = ldsa.id) - (SELECT COUNT(id) FROM logpm_distrilbution_bill_package WHERE stock_article_id = ldsa.id AND packet_bar_status IN (1,3)) = 0 THEN 20 - WHEN (SELECT COUNT(id) FROM logpm_distribution_bill_lading_scan WHERE stock_article_id = ldsa.id) - (SELECT COUNT(id) FROM logpm_distrilbution_bill_package WHERE stock_article_id = ldsa.id AND packet_bar_status IN (1,3)) > 0 THEN 10 - WHEN (SELECT COUNT(id) FROM logpm_distribution_bill_lading_scan WHERE stock_article_id = ldsa.id) - (SELECT COUNT(id) FROM logpm_distrilbution_bill_package WHERE stock_article_id = ldsa.id AND packet_bar_status IN (1,3)) < 0 THEN 30 + WHEN (SELECT COUNT(id) FROM logpm_distribution_bill_lading_scan WHERE stock_article_id = ldsa.id AND is_deleted = 0) - (SELECT COUNT(id) FROM logpm_distrilbution_bill_package WHERE stock_article_id = ldsa.id AND packet_bar_status IN (1,3) AND is_deleted = 0) = 0 THEN '20' + WHEN (SELECT COUNT(id) FROM logpm_distribution_bill_lading_scan WHERE stock_article_id = ldsa.id AND is_deleted = 0) - (SELECT COUNT(id) FROM logpm_distrilbution_bill_package WHERE stock_article_id = ldsa.id AND packet_bar_status IN (1,3) AND is_deleted = 0) > 0 THEN '10' + WHEN (SELECT COUNT(id) FROM logpm_distribution_bill_lading_scan WHERE stock_article_id = ldsa.id AND is_deleted = 0) - (SELECT COUNT(id) FROM logpm_distrilbution_bill_package WHERE stock_article_id = ldsa.id AND packet_bar_status IN (1,3) AND is_deleted = 0) < 0 THEN '30' END AS conditions, (select GROUP_CONCAT(DISTINCT ldpl.material_name ) from logpm_distribution_parcel_list ldpl where ldpl.material_name is not null and ldpl.stock_article_id = ldbs.stock_article_id) materialName, - (select count(lds.id) + (select IFNULL(sum(lds.stock_quantity),0) from logpm_distribution_stock lds where lds.stock_article = ldbs.stock_article_id ) preparedQuantity , (select COALESCE(GROUP_CONCAT(DISTINCT lwtg.tray_code SEPARATOR ','), '') @@ -281,11 +298,11 @@ LEFT JOIN logpm_warehouse_updown_goods lwug on lwug.association_id = ldpl.id and lwug.association_type = '3' where ldpl.stock_article_id = ldbs.stock_article_id) goodsAllocation, ldsa.service_number serviceNumber,ldsa.waybill_number waybillNumber,ldsa.train_number trainNumber,ldsa.send_warehouse_name sendWarehouseName - - from logpm_distrilbution_bill_stock ldbs + from + logpm_distrilbution_bill_lading AS ldbl + LEFT JOIN logpm_distrilbution_bill_stock ldbs ON ldbs.bill_lading_id = ldbl.id LEFT JOIN logpm_distribution_stock_article ldsa on ldbs.stock_article_id = ldsa.id LEFT JOIN logpm_distribution_stock lds on lds.stock_article = ldbs.stock_article_id - LEFT JOIN logpm_distrilbution_bill_lading ldbl ON lds.stock_article = ldbl.stock_article_id ldbs.is_deleted = 0 and ldbs.bill_lading_id = #{param.billLadingId} and ldbs.order_status in (1,3) diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillStockServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillStockServiceImpl.java index 27e1a1a62..70df8b7eb 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillStockServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillStockServiceImpl.java @@ -85,7 +85,9 @@ public class DistrilbutionBillStockServiceImpl extends BaseServiceImpl distributionBillOrderExcels = baseMapper.distrilbutionBillStock(billStock); + List distributionBillOrderExcels = baseMapper.getBillStockExcel(billStock); distributionBillOrderExcels.forEach( i ->{ if(StringUtils.isNotBlank(i.getStockupStatus())){ @@ -158,9 +160,9 @@ public class DistrilbutionBillStockServiceImpl extends BaseServiceImpl