Browse Source

Merge branch 'dev' into pre-production

master
汤建军 9 months ago
parent
commit
4e81ba4e53
  1. 6
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionBillOrderVO.java
  2. 88
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/excel/DistributionBillOrderExcel.java
  3. 16
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.xml
  4. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillStockMapper.java
  5. 79
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillStockMapper.xml
  6. 1
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillLadingServiceImpl.java
  7. 12
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillStockServiceImpl.java

6
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;
/**
* 签收时间
*/

88
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;

16
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,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,
@ -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
<where>
</where>
) AS c ON c.parcel_list_id = ldpl.id
<where>
ldpl.is_deleted = 0
ldpl.is_deleted = 0 AND m.is_deleted = 0 AND n.is_deleted = 0
<if test="param.warehouse !='' and param.warehouse != null">
and lww.name like concat('%',#{param.warehouse},'%')
</if>
<if test="param.pallet !='' and param.pallet != null">
and n.pallet_name like concat('%',#{param.warehouse},'%')
</if>
<if test="param.goodsAllocation !='' and param.goodsAllocation != null">
and m.qr_code like concat('%',#{param.warehouse},'%')
</if>
<if test="param.orderPackageGroundingStatus !='' and param.orderPackageGroundingStatus != null">
and ldpl.order_package_grounding_status = #{param.orderPackageGroundingStatus}
</if>

2
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillStockMapper.java

@ -70,7 +70,7 @@ public interface DistrilbutionBillStockMapper extends BaseMapper<DistrilbutionBi
List<DistributionStockPackageVO> listPackageSelf(@Param("reservationId")Long reservationId);
List<DistributionBillOrderExcel> distrilbutionBillStock(@Param("param")DistrilbutionBillStockEntity distrilbutionBillStock);
List<DistributionBillOrderExcel> getBillStockExcel(@Param("param")DistrilbutionBillStockEntity distrilbutionBillStock);
List<DistributionBillOrderPackExcel> billOrderPackExcel(@Param("param")DistrilbutionBillStockEntity billStock);
}

79
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillStockMapper.xml

@ -115,42 +115,48 @@
</select>
<select id="getBillOrderDetail" resultType="com.logpm.distribution.vo.DistributionBillOrderVO">
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} ) + (SELECT IFNULL(SUM(quantity),0) FROM logpm_distribution_reservation_zero_package WHERE stock_article_id = ldsa.id AND zero_package_status IN ( 1, 3 ) AND reservation_id = #{param.billLadingId}) handQuantity,
(select IFNULL(SUM(quantity),0) 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 ) = 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 ) ) &lt; 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 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) &lt; 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 ','), '')
from logpm_distribution_parcel_list ldpl
LEFT JOIN logpm_warehouse_tray_goods lwtg on lwtg.association_id = ldpl.id and lwtg.association_type = '3'
where ldpl.stock_article_id = ldbs.stock_article_id) pallet ,
(select COALESCE(GROUP_CONCAT(DISTINCT lwga.qr_code SEPARATOR ','), '')
(select COALESCE(GROUP_CONCAT(DISTINCT lwug.allocation_title SEPARATOR ','), '')
from logpm_distribution_parcel_list ldpl
LEFT JOIN logpm_warehouse_updown_goods lwug on lwug.association_id = ldpl.id and lwug.association_type = '3'
LEFT JOIN logpm_warehouse_goods_allocation AS lwga ON lwug.allocation_id = lwga.id
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,
t.scan_user AS scanUser,
t.aaa AS signingTime
from logpm_distrilbution_bill_stock ldbs
ldsa.service_number serviceNumber,ldsa.waybill_number waybillNumber,ldsa.train_number trainNumber,ldsa.send_warehouse_name sendWarehouseName
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
LEFT JOIN (SELECT ldbs.stock_article_id,GROUP_CONCAT(DISTINCT ldbls.scan_user) AS scan_user,MAX(ldbls.create_time) AS aaa FROM logpm_distrilbution_bill_stock AS ldbs LEFT JOIN logpm_distribution_bill_lading_scan AS ldbls ON ldbs.stock_article_id = ldbls.stock_article_id WHERE ldbs.order_status IN (
1,
3) AND ldbs.is_deleted = 0 AND ldbls.is_deleted = 0 GROUP BY ldbs.stock_article_id) AS t ON ldbs.stock_article_id = t.stock_article_id
<where>
ldbs.is_deleted = 0 and ldbs.bill_lading_id = #{param.billLadingId} and ldbs.order_status in (1,3)
</where>
@ -254,22 +260,33 @@
where ldbp.bill_lading_id = #{reservationId} and ldsa.is_zero = #{isZero} and ldbp.packet_bar_status in (1,3)
</select>
<select id="distrilbutionBillStock" resultType="com.logpm.distribution.excel.DistributionBillOrderExcel">
<select id="getBillStockExcel" resultType="com.logpm.distribution.excel.DistributionBillOrderExcel">
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)) &lt; 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) &lt; 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
<where>
ldbs.is_deleted = 0 and ldbs.bill_lading_id = #{param.billLadingId} and ldbs.order_status in (1,3)
</where>

1
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillLadingServiceImpl.java

@ -659,6 +659,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
aaa.setStockArticleId(distrilbutionBillPackageEntity.getStockArticleId());
aaa.setParceListId(distrilbutionBillPackageEntity.getId());
aaa.setPacketBarStatus(1);
aaa.setPacketBarCode(distrilbutionBillPackageEntity.getOrderPackageCode());
aaa.setBillType("1");
aaa.setPacketNumber(distrilbutionBillPackageEntity.getQuantity());
//进行包件的预约状态修改

12
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillStockServiceImpl.java

@ -85,7 +85,9 @@ public class DistrilbutionBillStockServiceImpl extends BaseServiceImpl<Distrilbu
i.setStockupStatusName(DictBizCache.getValue(DictBizConstant.STOCKUP_STATUS,i.getStockupStatus()));
}
if(ObjectUtils.isNotNull(i.getConditions())){
i.setConditions(DictBizCache.getValue(DictBizConstant.BILL_CONDITIONS_STATUS,i.getConditions()));
i.setConditionsName(DictBizCache.getValue(DictBizConstant.BILL_CONDITIONS_STATUS,i.getConditions()));
}else {
i.setConditionsName("待提货");
}
});
return billOrderDetail;
@ -149,7 +151,7 @@ public class DistrilbutionBillStockServiceImpl extends BaseServiceImpl<Distrilbu
DistrilbutionBillStockEntity billStock = JSON.parseObject(JSON.toJSONString(distrilbutionBillStock), DistrilbutionBillStockEntity.class);
List<DistributionBillOrderExcel> distributionBillOrderExcels = baseMapper.distrilbutionBillStock(billStock);
List<DistributionBillOrderExcel> distributionBillOrderExcels = baseMapper.getBillStockExcel(billStock);
distributionBillOrderExcels.forEach( i ->{
if(StringUtils.isNotBlank(i.getStockupStatus())){
@ -158,9 +160,9 @@ public class DistrilbutionBillStockServiceImpl extends BaseServiceImpl<Distrilbu
if(ObjectUtils.isNotNull(i.getConditions())){
i.setConditionsName(DictBizCache.getValue(DictBizConstant.BILL_CONDITIONS_STATUS,i.getConditions()));
}
if (StringUtils.isNotBlank(i.getHandQuantity())){
i.setStockUpQuantity(i.getHandQuantity()); //TODO 和应提货件数 值一样后期可能要改
}
// if (StringUtils.isNotBlank(i.getHandQuantity())){
// i.setStockUpQuantity(i.getHandQuantity());
// }
});
return distributionBillOrderExcels;
}

Loading…
Cancel
Save