From a5195e83bde97f25051606c9d1361902ae29d38f Mon Sep 17 00:00:00 2001 From: PigBaoBei <2739175034@qq.com> Date: Mon, 29 Apr 2024 16:08:43 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E8=87=AA=E6=8F=90=E8=AF=A6=E6=83=85?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E8=AE=A2=E5=8D=95=E3=80=81=E5=8C=85=E4=BB=B6?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E5=AD=97=E6=AE=B5=E8=B0=83=E6=95=B4,?= =?UTF-8?q?=E8=AE=A2=E5=8D=95=E3=80=81=E5=8C=85=E4=BB=B6=E5=AF=BC=E5=87=BA?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../vo/DistributionBillOrderVO.java | 6 +- .../excel/DistributionBillOrderExcel.java | 88 ++++++++++++++----- .../mapper/DistrilbutionBillStockMapper.java | 2 +- .../mapper/DistrilbutionBillStockMapper.xml | 79 ++++++++++------- .../DistrilbutionBillStockServiceImpl.java | 12 +-- 5 files changed, 127 insertions(+), 60 deletions(-) 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 Date: Mon, 29 Apr 2024 16:53:10 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E8=87=AA=E6=8F=90=E5=88=9B=E5=BB=BA?= =?UTF-8?q?=E7=BB=B4=E6=8A=A4=E8=87=AA=E6=8F=90=E5=8C=85=E4=BB=B6=E4=B8=AD?= =?UTF-8?q?=E9=97=B4=E5=8C=85=E6=9D=A1=E7=A0=81=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/DistrilbutionBillLadingServiceImpl.java | 1 + 1 file changed, 1 insertion(+) diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillLadingServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillLadingServiceImpl.java index ce4b7182e..aed8a0541 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillLadingServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillLadingServiceImpl.java @@ -659,6 +659,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl Date: Mon, 29 Apr 2024 17:19:18 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E5=8C=85=E4=BB=B6=E6=98=8E=E7=BB=86?= =?UTF-8?q?=E7=BB=B4=E6=8A=A4=E6=89=98=E7=9B=98=E3=80=81=E5=BA=93=E4=BD=8D?= =?UTF-8?q?=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/DistributionParcelListMapper.xml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.xml index 0325a9237..1fe1a2524 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.xml @@ -96,13 +96,17 @@ IF(c.scan_user is not null,c.scan_user,IF(b.scan_user is not null,b.scan_user,a.scan_user)) AS scanUser, IF(c.signing_user is not null,c.signing_user,IF(b.signing_user is not null,b.signing_user,a.signing_user)) AS signingUser, IF(c.scan_time is not null,c.scan_time,IF(b.scan_time is not null,b.scan_time,a.scan_time)) AS loadingTime, - IF(c.signing_time is not null,c.signing_time,IF(b.signing_time is not null,b.signing_time,a.signing_time)) AS signingTime + IF(c.signing_time is not null,c.signing_time,IF(b.signing_time is not null,b.signing_time,a.signing_time)) AS signingTime, + m.qr_code AS goodsAllocation, + n.pallet_name AS pallet FROM logpm_distribution_parcel_list AS ldpl LEFT JOIN logpm_warehouse_updown_goods lwug ON ldpl.id = lwug.association_id LEFT JOIN logpm_warehouse_tray_goods lwtg ON ldpl.id = lwtg.association_id LEFT join logpm_distribution_stock_article ldsa on ldsa.id = ldpl.stock_article_id LEFT join logpm_warehouse_warehouse lww on lww.id = ldpl.warehouse_id + LEFT JOIN (SELECT lwug.association_id,lwga.qr_code,lwug.is_deleted FROM logpm_warehouse_updown_goods AS lwug LEFT JOIN logpm_warehouse_goods_allocation AS lwga ON lwug.allocation_id = lwga.id ) AS m ON m.association_id = ldpl.id + LEFT JOIN (SELECT lwtg.association_id,lwt.pallet_name,lwug.is_deleted.is_deleted FROM logpm_warehouse_tray_goods AS lwtg LEFT JOIN logpm_warehouse_tray AS lwt ON lwtg.tray_id = lwt.id) AS n ON n.association_id = ldpl.id LEFT JOIN (SELECT ldrp.parce_list_id, @@ -211,14 +215,18 @@ LEFT JOIN logpm_distribution_delivery_list lddl on lds.delivery_id =lddl.id LEFT JOIN logpm_distrilbution_bill_lading ldbl ON ldrzp.reservation_id = ldbl.id LEFT JOIN logpm_distribution_bill_lading_scan ldbls ON ldbls.parcel_list_id = ldrzp.parcel_list_id - - ) AS c ON c.parcel_list_id = ldpl.id - ldpl.is_deleted = 0 + ldpl.is_deleted = 0 AND m.is_deleted = 0 AND n.is_deleted = 0 and lww.name like concat('%',#{param.warehouse},'%') + + and n.pallet_name like concat('%',#{param.warehouse},'%') + + + and m.qr_code like concat('%',#{param.warehouse},'%') + and ldpl.order_package_grounding_status = #{param.orderPackageGroundingStatus} From 15473d1ba8dd8f261987ee67f5b3a416551da71a Mon Sep 17 00:00:00 2001 From: PigBaoBei <2739175034@qq.com> Date: Mon, 29 Apr 2024 17:22:47 +0800 Subject: [PATCH 4/4] =?UTF-8?q?BUG=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../logpm/distribution/mapper/DistributionParcelListMapper.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.xml index 1fe1a2524..2babcf5ce 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.xml @@ -106,7 +106,7 @@ LEFT join logpm_distribution_stock_article ldsa on ldsa.id = ldpl.stock_article_id LEFT join logpm_warehouse_warehouse lww on lww.id = ldpl.warehouse_id LEFT JOIN (SELECT lwug.association_id,lwga.qr_code,lwug.is_deleted FROM logpm_warehouse_updown_goods AS lwug LEFT JOIN logpm_warehouse_goods_allocation AS lwga ON lwug.allocation_id = lwga.id ) AS m ON m.association_id = ldpl.id - LEFT JOIN (SELECT lwtg.association_id,lwt.pallet_name,lwug.is_deleted.is_deleted FROM logpm_warehouse_tray_goods AS lwtg LEFT JOIN logpm_warehouse_tray AS lwt ON lwtg.tray_id = lwt.id) AS n ON n.association_id = ldpl.id + LEFT JOIN (SELECT lwtg.association_id,lwt.pallet_name,lwtg.is_deleted FROM logpm_warehouse_tray_goods AS lwtg LEFT JOIN logpm_warehouse_tray AS lwt ON lwtg.tray_id = lwt.id) AS n ON n.association_id = ldpl.id LEFT JOIN (SELECT ldrp.parce_list_id,