Browse Source

1.订单查询库存品

training
0.0 1 year ago
parent
commit
3c973cbd72
  1. 11
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionStockListVO.java
  2. 2
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/queryOrderVO.java
  3. 54
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataGoodsAreaMapper.xml
  4. 3
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.java
  5. 714
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.xml
  6. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java
  7. 7
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java
  8. 5
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/wrapper/WarehouseStockVOWrapper.java

11
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionStockListVO.java

@ -97,4 +97,15 @@ public class DistributionStockListVO extends DistributionStockListEntity {
private Integer stockupNum; private Integer stockupNum;
/**
* 托盘id
*/
@ApiModelProperty(value = "托盘id")
private String trayCode;
/**
* 货位信息
*/
@ApiModelProperty(value = "货位信息")
private String positionCode;
} }

2
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/queryOrderVO.java

@ -27,7 +27,7 @@ public class queryOrderVO extends DistributionStockArticleEntity {
* 库存品列表 * 库存品列表
*/ */
@ApiModelProperty(value = "库存品列表") @ApiModelProperty(value = "库存品列表")
private List<DistributionStockListInfoVO> stockList = new ArrayList<>(); private List<DistributionStockListVO> stockList = new ArrayList<>();
/** /**
* 定制品 * 定制品

54
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataGoodsAreaMapper.xml

@ -278,32 +278,44 @@
</select> </select>
<select id="exportWarehouseByCKStrip" resultType="com.logpm.basicdata.excel.BasicdatavisualizationKCSheetOne"> <select id="exportWarehouseByCKStrip" resultType="com.logpm.basicdata.excel.BasicdatavisualizationKCSheetOne">
SELECT SELECT
ldsl.incoming_batch incomingBatch, ldsl.id,
GROUP_CONCAT( ldsli.warehousing_time SEPARATOR '、' ) warehousingTime, ldsl.material_id,
GROUP_CONCAT( DISTINCT ldsli.order_code SEPARATOR '、' ) orderCode, ldsl.warehouse_id,
ldsl.market_name marketName, ldsl.market_id,
ldsl.service_type serviceType, ldsl.incoming_batch incomingBatch,
ldsl.service_number serviceNumber, ldsl.market_name marketName,
ldsl.description_goods descriptionGoods, ldsl.service_type serviceType,
ldsl.cargo_number cargoNumber, ldsl.service_number serviceNumber,
lwtg.tray_code trayCode, ldsl.description_goods descriptionGoods,
sum( lwug.num ) num, ldsl.cargo_number cargoNumber,
lwug.position_code positionCode, lwtg.tray_code trayCode,
GROUP_CONCAT( lwug.create_time SEPARATOR '、' ) upTime, lwug.position_code positionCode,
GROUP_CONCAT( lwug.create_user SEPARATOR '、' ) upUser SUM(lwug.num) num,
GROUP_CONCAT(lwug.create_time SEPARATOR '、') upTime,
GROUP_CONCAT(lwug.create_user SEPARATOR '、') upUser,
(SELECT ldsli.order_code FROM logpm_distribution_stock_list_info ldsli WHERE
ldsli.incoming_batch = ldsl.incoming_batch
AND ldsli.material_id = ldsl.material_id
AND ldsli.warehouse_id = ldsl.warehouse_id
AND ldsli.market_id = ldsl.market_id) orderCode,
(SELECT ldsli.warehousing_time FROM logpm_distribution_stock_list_info ldsli WHERE
ldsli.incoming_batch = ldsl.incoming_batch
AND ldsli.material_id = ldsl.material_id
AND ldsli.warehouse_id = ldsl.warehouse_id
AND ldsli.market_id = ldsl.market_id) warehousingTime
FROM FROM
logpm_distribution_stock_list ldsl logpm_distribution_stock_list ldsl
JOIN logpm_warehouse_updown_goods lwug ON ldsl.material_id = lwug.association_id JOIN logpm_warehouse_updown_goods lwug ON ldsl.material_id = lwug.association_id
JOIN logpm_distribution_stock_list_info ldsli ON ldsli.incoming_batch = ldsl.incoming_batch AND lwug.incoming_batch = ldsl.incoming_batch
AND ldsli.material_id = ldsl.material_id AND ldsl.market_id = lwug.market_id
AND ldsli.warehouse_id = ldsl.warehouse_id LEFT JOIN logpm_warehouse_tray_goods lwtg ON lwtg.association_id = ldsl.material_id
AND ldsli.market_id = ldsl.market_id AND lwtg.incoming_batch = ldsl.incoming_batch
LEFT JOIN logpm_warehouse_tray_goods lwtg ON lwtg.association_id = ldsl.material_id AND ldsl.market_id = lwtg.market_id
<where> <where>
ldsl.warehouse_id =#{warehouseId} and lwug.association_type ='4' ldsl.warehouse_id =#{warehouseId} and lwug.association_type ='4'
</where> </where>
GROUP BY GROUP BY
ldsl.id ldsl.id
</select> </select>
<select id="exportWarehouseByKCallocation" resultType="com.logpm.basicdata.excel.BasicdatavisualizationKCSheetTwo"> <select id="exportWarehouseByKCallocation" resultType="com.logpm.basicdata.excel.BasicdatavisualizationKCSheetTwo">
SELECT SELECT

3
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.java

@ -25,6 +25,7 @@ import com.logpm.distribution.entity.DistributionParcelListEntity;
import com.logpm.distribution.excel.DistributionParcelListExcel; import com.logpm.distribution.excel.DistributionParcelListExcel;
import com.logpm.distribution.vo.DistributionParcelListBaseVO; import com.logpm.distribution.vo.DistributionParcelListBaseVO;
import com.logpm.distribution.vo.DistributionParcelListVO; import com.logpm.distribution.vo.DistributionParcelListVO;
import com.logpm.distribution.vo.DistributionStockListVO;
import com.logpm.distribution.vo.PackageStockupVO; import com.logpm.distribution.vo.PackageStockupVO;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
@ -114,4 +115,6 @@ public interface DistributionParcelListMapper extends BaseMapper<DistributionPar
ArrayList<String> selectorderPackageCodeByLike(@Param("condition") String condition,@Param("collect") List<Long> collect); ArrayList<String> selectorderPackageCodeByLike(@Param("condition") String condition,@Param("collect") List<Long> collect);
ArrayList<String> selectorderCodeByLike(@Param("condition") String condition,@Param("collect") List<Long> collect); ArrayList<String> selectorderCodeByLike(@Param("condition") String condition,@Param("collect") List<Long> collect);
List<DistributionStockListVO> selectStockListByOderId(@Param("id")Long id,@Param("collect") List<Long> collect);
} }

714
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.xml

@ -35,7 +35,8 @@
</resultMap> </resultMap>
<select id="selectDistributionParcelListPage" resultType="com.logpm.distribution.entity.DistributionParcelListEntity"> <select id="selectDistributionParcelListPage"
resultType="com.logpm.distribution.entity.DistributionParcelListEntity">
SELECT SELECT
ldpl.warehouse_id warehouseId, ldpl.warehouse_id warehouseId,
ldpl.id id, ldpl.id id,
@ -71,7 +72,7 @@
<where> <where>
ldpl.is_deleted = 0 ldpl.is_deleted = 0
<if test="param.warehouse !='' and param.warehouse != null"> <if test="param.warehouse !='' and param.warehouse != null">
and lww.name like concat('%',#{param.warehouse},'%') and lww.name like concat('%',#{param.warehouse},'%')
</if> </if>
<if test="param.warehouseIdList != null and @org.apache.commons.collections4.CollectionUtils@isNotEmpty(param.warehouseIdList)"> <if test="param.warehouseIdList != null and @org.apache.commons.collections4.CollectionUtils@isNotEmpty(param.warehouseIdList)">
and ldpl.warehouse_id in and ldpl.warehouse_id in
@ -80,64 +81,79 @@
</foreach> </foreach>
</if> </if>
<if test="param.orderPackageCode !='' and param.orderPackageCode != null"> <if test="param.orderPackageCode !='' and param.orderPackageCode != null">
and ldpl.order_package_code like concat('%',#{param.orderPackageCode},'%') and ldpl.order_package_code like concat('%',#{param.orderPackageCode},'%')
</if> </if>
<if test="param.firsts !='' and param.firsts != null"> <if test="param.firsts !='' and param.firsts != null">
and ldpl.firsts = #{param.firsts} and ldpl.firsts = #{param.firsts}
</if> </if>
<if test="param.second !='' and param.second != null"> <if test="param.second !='' and param.second != null">
and ldpl.second = #{param.second} and ldpl.second = #{param.second}
</if> </if>
<if test="param.thirdProduct !='' and param.thirdProduct != null"> <if test="param.thirdProduct !='' and param.thirdProduct != null">
and ldpl.third_product = #{param.thirdProduct} and ldpl.third_product = #{param.thirdProduct}
</if> </if>
<if test="param.quantity !='' and param.quantity != null"> <if test="param.quantity !='' and param.quantity != null">
and ldpl.quantity = #{param.quantity} and ldpl.quantity = #{param.quantity}
</if> </if>
<if test="param.trainNumber !='' and param.trainNumber != null"> <if test="param.trainNumber !='' and param.trainNumber != null">
and ldpl.train_number = #{param.trainNumber} and ldpl.train_number = #{param.trainNumber}
</if> </if>
<if test="param.stockArticleId !='' and param.stockArticleId != null"> <if test="param.stockArticleId !='' and param.stockArticleId != null">
and ldpl.stock_article_id like concat('%',#{param.stockArticleId},'%') and ldpl.stock_article_id like concat('%',#{param.stockArticleId},'%')
</if> </if>
<if test="param.orderCode !='' and param.orderCode != null"> <if test="param.orderCode !='' and param.orderCode != null">
and ldpl.order_code like concat('%',#{param.orderCode},'%') and ldpl.order_code like concat('%',#{param.orderCode},'%')
</if> </if>
<if test="param.serviceNumber !='' and param.serviceNumber != null"> <if test="param.serviceNumber !='' and param.serviceNumber != null">
and ldpl.service_number like concat('%',#{param.serviceNumber},'%') and ldpl.service_number like concat('%',#{param.serviceNumber},'%')
</if> </if>
<if test="param.materialName !='' and param.materialName != null"> <if test="param.materialName !='' and param.materialName != null">
and ldpl.material_name like concat('%',#{param.materialName},'%') and ldpl.material_name like concat('%',#{param.materialName},'%')
</if> </if>
<if test="param.brandName !='' and param.brandName != null"> <if test="param.brandName !='' and param.brandName != null">
and ldpl.brand_name like concat('%',#{param.brandName},'%') and ldpl.brand_name like concat('%',#{param.brandName},'%')
</if> </if>
<if test="param.orderPackageFreezeStatus !='' and param.orderPackageFreezeStatus != null"> <if test="param.orderPackageFreezeStatus !='' and param.orderPackageFreezeStatus != null">
and ldpl.order_package_freeze_status = #{param.orderPackageFreezeStatus} and ldpl.order_package_freeze_status = #{param.orderPackageFreezeStatus}
</if> </if>
<if test="param.pallet !='' and param.pallet != null"> <if test="param.pallet !='' and param.pallet != null">
and lwtg.tray_code = #{param.pallet} and lwtg.tray_code = #{param.pallet}
</if> </if>
<if test="param.goodsAllocation !='' and param.goodsAllocation != null"> <if test="param.goodsAllocation !='' and param.goodsAllocation != null">
and lwtg.position_code = #{param.goodsAllocation} and lwtg.position_code = #{param.goodsAllocation}
</if> </if>
</where> </where>
</select> </select>
<select id="getStockDataBase" resultType="com.logpm.distribution.vo.DistributionParcelListBaseVO"> <select id="getStockDataBase" resultType="com.logpm.distribution.vo.DistributionParcelListBaseVO">
select ldsa.waybill_number waybillNumber,ldsa.service_number serviceNumber,ldsa.order_code orderCode,ldsa.mall_name mallName,ldsa.warehouse ,ldsa.brand , select ldsa.waybill_number waybillNumber,
ldsa.type_service typeService,ldsa.dealer_name dealerName,ldsa.dealer_code dealerCode,ldsa.train_number trainNumber, ldsa.service_number serviceNumber,
ldsa.factory_train factoryTrain,ldsa.send_warehouse_name sendWarehouseName,ldsa.hand_quantity handQuantity,ldsa.delivery_quantity deliveryQuantity, ldsa.order_code orderCode,
ldsa.signin_quantity signinQuantity,( ldsa.mall_name mallName,
ldsa.warehouse,
ldsa.brand,
ldsa.type_service typeService,
ldsa.dealer_name dealerName,
ldsa.dealer_code dealerCode,
ldsa.train_number trainNumber,
ldsa.factory_train factoryTrain,
ldsa.send_warehouse_name sendWarehouseName,
ldsa.hand_quantity handQuantity,
ldsa.delivery_quantity deliveryQuantity,
ldsa.signin_quantity signinQuantity,
(
select count(*) select count(*)
from logpm_distribution_parcel_list from logpm_distribution_parcel_list
where stock_article_id = #{param.stockArticleId} and order_package_freeze_status = '20' where stock_article_id = #{param.stockArticleId}
) frozenQuantity and order_package_freeze_status = '20'
) frozenQuantity
from logpm_distribution_stock_article ldsa from logpm_distribution_stock_article ldsa
where ldsa.is_deleted = '0' and ldsa.order_code in ( where ldsa.is_deleted = '0'
and ldsa.order_code in (
select DISTINCT ldpl.order_code select DISTINCT ldpl.order_code
from logpm_distribution_parcel_list ldpl from logpm_distribution_parcel_list ldpl
where ldpl.stock_article_id = #{param.stockArticleId} and ldpl.is_deleted = '0' where ldpl.stock_article_id = #{param.stockArticleId}
and ldpl.is_deleted = '0'
) )
</select> </select>
<select id="getOrderPackageCode" resultType="String"> <select id="getOrderPackageCode" resultType="String">
@ -146,25 +162,34 @@
where stock_article_id = #{id} where stock_article_id = #{id}
</select> </select>
<select id="selectOrderInfoAllocationList" resultType="com.logpm.distribution.vo.PackageStockupVO"> <select id="selectOrderInfoAllocationList" resultType="com.logpm.distribution.vo.PackageStockupVO">
select DISTINCT ldpl.order_code orderCode,ldpl.order_package_code packageBarCode,ldpl.conditions goodsType,ldpl.material_name materialName, select DISTINCT ldpl.order_code orderCode,ldpl.order_package_code packageBarCode,ldpl.conditions
CASE WHEN lds.id IS NULL THEN 0 ELSE 1 END AS isScan,ldpl.id parceListId,GROUP_CONCAT(lds.allocation_title) positionCode,lds.allocation_id allocationId goodsType,ldpl.material_name materialName,
CASE WHEN lds.id IS NULL THEN 0 ELSE 1 END AS isScan,ldpl.id parceListId,GROUP_CONCAT(lds.allocation_title)
positionCode,lds.allocation_id allocationId
from logpm_distribution_parcel_list ldpl from logpm_distribution_parcel_list ldpl
LEFT JOIN logpm_distribution_stock lds on lds.parcel_list_id = ldpl.id LEFT JOIN logpm_distribution_stock lds on lds.parcel_list_id = ldpl.id
<where> <where>
<if test="param.allocationId != null and param.allocationId != ''"> and lds.allocation_id = #{param.allocationId} </if> <if test="param.allocationId != null and param.allocationId != ''">and lds.allocation_id =
<if test="param.allocation != null and param.allocation != ''"> and lds.allocation_title = #{param.allocation} </if> #{param.allocationId}
<if test="param.stockArticleId != null and param.stockArticleId != ''">and ldpl.stock_article_id = #{param.stockArticleId} </if> </if>
<if test="param.allocation != null and param.allocation != ''">and lds.allocation_title =
#{param.allocation}
</if>
<if test="param.stockArticleId != null and param.stockArticleId != ''">and ldpl.stock_article_id =
#{param.stockArticleId}
</if>
<if test="param.stockArticleIdList != null "> <if test="param.stockArticleIdList != null ">
and ldpl.stock_article_id in and ldpl.stock_article_id in
<foreach collection="param.stockArticleIdList" item="a" open="(" separator="," close=")" > <foreach collection="param.stockArticleIdList" item="a" open="(" separator="," close=")">
#{a} #{a}
</foreach> </foreach>
</if> </if>
</where> </where>
GROUP BY ldpl.order_code ,ldpl.order_package_code ,ldpl.conditions ,ldpl.material_name,lds.id,ldpl.id GROUP BY ldpl.order_code ,ldpl.order_package_code ,ldpl.conditions ,ldpl.material_name,lds.id,ldpl.id
</select> </select>
<select id="selectOrderInfoSelfList" resultType="com.logpm.distribution.vo.PackageStockupVO"> <select id="selectOrderInfoSelfList" resultType="com.logpm.distribution.vo.PackageStockupVO">
select DISTINCT ldpl.order_code orderCode,ldpl.order_package_code packageBarCode,ldpl.conditions goodsType,ldpl.material_name materialName, select DISTINCT ldpl.order_code orderCode,ldpl.order_package_code packageBarCode,ldpl.conditions
goodsType,ldpl.material_name materialName,
CASE WHEN lds.id IS NULL THEN 0 ELSE 1 END AS isScan,ldpl.id parceListId,( CASE WHEN lds.id IS NULL THEN 0 ELSE 1 END AS isScan,ldpl.id parceListId,(
select GROUP_CONCAT( DISTINCT position_code) select GROUP_CONCAT( DISTINCT position_code)
from logpm_warehouse_updown_goods from logpm_warehouse_updown_goods
@ -175,18 +200,23 @@
<where> <where>
ldpl.conditions = '1' ldpl.conditions = '1'
<if test="param.allocationId != null and param.allocationId != ''"> and lds.allocation_id = #{param.allocationId} </if> <if test="param.allocationId != null and param.allocationId != ''">and lds.allocation_id =
<if test="param.stockArticleId != null and param.stockArticleId != ''"> and ldpl.stock_article_id = #{param.stockArticleId} </if> #{param.allocationId}
</if>
<if test="param.stockArticleId != null and param.stockArticleId != ''">and ldpl.stock_article_id =
#{param.stockArticleId}
</if>
<if test="param.stockArticleIdList != null "> <if test="param.stockArticleIdList != null ">
and ldpl.stock_article_id in and ldpl.stock_article_id in
<foreach collection="param.stockArticleIdList" separator="," open="(" close=")" item="a" > <foreach collection="param.stockArticleIdList" separator="," open="(" close=")" item="a">
#{a} #{a}
</foreach> </foreach>
</if> </if>
</where> </where>
</select> </select>
<select id="selectOrderInfoSelfAllocationList" resultType="com.logpm.distribution.vo.PackageStockupVO"> <select id="selectOrderInfoSelfAllocationList" resultType="com.logpm.distribution.vo.PackageStockupVO">
select DISTINCT ldpl.order_code orderCode,ldpl.order_package_code packageBarCode,ldpl.conditions goodsType,ldpl.material_name materialName, select DISTINCT ldpl.order_code orderCode,ldpl.order_package_code packageBarCode,ldpl.conditions
goodsType,ldpl.material_name materialName,
CASE WHEN lds.id IS NULL THEN 0 ELSE 1 END AS isScan,ldpl.id parceListId,( CASE WHEN lds.id IS NULL THEN 0 ELSE 1 END AS isScan,ldpl.id parceListId,(
select GROUP_CONCAT( DISTINCT position_code) select GROUP_CONCAT( DISTINCT position_code)
from logpm_warehouse_updown_goods from logpm_warehouse_updown_goods
@ -197,32 +227,37 @@
<where> <where>
<if test="param.allocationId != null and param.allocationId != ''"> and lds.allocation_id = #{param.allocationId} </if> <if test="param.allocationId != null and param.allocationId != ''">and lds.allocation_id =
<if test="param.stockArticleId != null and param.stockArticleId != ''"> and ldpl.stock_article_id = #{param.stockArticleId} </if> #{param.allocationId}
<if test="param.stockupId != null and param.stockupId != ''"> and lds.stockup_id = #{param.stockupId} </if> </if>
<if test="param.stockArticleId != null and param.stockArticleId != ''">and ldpl.stock_article_id =
#{param.stockArticleId}
</if>
<if test="param.stockupId != null and param.stockupId != ''">and lds.stockup_id = #{param.stockupId}</if>
<if test="param.stockArticleIdList != null "> <if test="param.stockArticleIdList != null ">
and ldpl.stock_article_id in and ldpl.stock_article_id in
<foreach collection="param.stockArticleIdList" separator="," open="(" close=")" item="a" > <foreach collection="param.stockArticleIdList" separator="," open="(" close=")" item="a">
#{a} #{a}
</foreach> </foreach>
</if> </if>
</where> </where>
</select> </select>
<select id="getParcelListOwnSelf" resultType="com.logpm.distribution.vo.DistributionParcelListVO"> <select id="getParcelListOwnSelf" resultType="com.logpm.distribution.vo.DistributionParcelListVO">
select ldpl.id id,ldpl.order_package_code orderPackageCode,ldpl.firsts,ldpl.second,ldpl.third_product thirdProduct,ldpl.material_name materialName, select ldpl.id id,ldpl.order_package_code orderPackageCode,ldpl.firsts,ldpl.second,ldpl.third_product
thirdProduct,ldpl.material_name materialName,
( (
select GROUP_CONCAT(DISTINCT position_code) select GROUP_CONCAT(DISTINCT position_code)
from logpm_warehouse_updown_goods from logpm_warehouse_updown_goods
WHERE ldpl.id = association_id WHERE ldpl.id = association_id
) AS goodsAllocation, ) AS goodsAllocation,
( (
select GROUP_CONCAT(tray_code) select GROUP_CONCAT(tray_code)
from logpm_warehouse_tray_goods from logpm_warehouse_tray_goods
where ldpl.id = association_id where ldpl.id = association_id
) AS pallet, ) AS pallet,
lds.coding stockupStatus,lds.create_time stockupDate ,lds.stockup_area stockupArea lds.coding stockupStatus,lds.create_time stockupDate ,lds.stockup_area stockupArea
from logpm_distribution_stockup_info ldsi from logpm_distribution_stockup_info ldsi
LEFT JOIN logpm_distrilbution_bill_stock ldbs on ldsi.reservation_id = ldbs.bill_lading_id LEFT JOIN logpm_distrilbution_bill_stock ldbs on ldsi.reservation_id = ldbs.bill_lading_id
LEFT JOIN logpm_distribution_parcel_list ldpl on ldbs.stock_article_id =ldpl.stock_article_id LEFT JOIN logpm_distribution_parcel_list ldpl on ldbs.stock_article_id =ldpl.stock_article_id
LEFT JOIN logpm_distribution_stock lds on ldpl.id = lds.parcel_list_id and lds.stockup_id = ldsi.stockup_id LEFT JOIN logpm_distribution_stock lds on ldpl.id = lds.parcel_list_id and lds.stockup_id = ldsi.stockup_id
@ -232,58 +267,67 @@
</select> </select>
<select id="exportDistributionParcelList" resultType="com.logpm.distribution.excel.DistributionParcelListExcel"> <select id="exportDistributionParcelList" resultType="com.logpm.distribution.excel.DistributionParcelListExcel">
SELECT * FROM logpm_distribution_parcel_list ${ew.customSqlSegment} SELECT *
FROM logpm_distribution_parcel_list ${ew.customSqlSegment}
</select> </select>
<update id="submitNumByOrderIdAndName"> <update id="submitNumByOrderIdAndName">
update logpm_distribution_parcel_list update logpm_distribution_parcel_list
set quantity = quantity - #{num} set quantity = quantity - #{num}
where stock_article_id = #{articleId} where stock_article_id = #{articleId}
and material_name = #{productName} and material_name = #{productName}
and quantity - #{num} >= 0 and quantity - #{num} >= 0
</update> </update>
<select id="selectOrderInfoList" resultType="com.logpm.distribution.vo.PackageStockupVO"> <select id="selectOrderInfoList" resultType="com.logpm.distribution.vo.PackageStockupVO">
<!-- select ldpl.order_code orderCode, <!-- select ldpl.order_code orderCode,
ldpl.order_package_code packageBarCode, ldpl.order_package_code packageBarCode,
1 goodsType, 1 goodsType,
IF(lds.id is null,0,1) isScan, IF(lds.id is null,0,1) isScan,
lds.id scanId lds.id scanId
from logpm_distribution_reservation ldr from logpm_distribution_reservation ldr
left join logpm_distribution_reservation_package ldrp on ldr.id = ldrp.reservation_id and ldrp.is_deleted = 0 left join logpm_distribution_reservation_package ldrp on ldr.id = ldrp.reservation_id and ldrp.is_deleted = 0
left join logpm_distribution_parcel_list ldpl on ldrp.parce_list_id = ldpl.id and ldpl.is_deleted = 0 left join logpm_distribution_parcel_list ldpl on ldrp.parce_list_id = ldpl.id and ldpl.is_deleted = 0
left join logpm_distribution_stock lds on lds.parcel_list_id = ldpl.id and lds.is_deleted = 0 left join logpm_distribution_stock lds on lds.parcel_list_id = ldpl.id and lds.is_deleted = 0
where ldpl.stock_article_id = #{stockArticleId} where ldpl.stock_article_id = #{stockArticleId}
and ldr.id = #{reservationId} and ldr.id = #{reservationId}
and CONCAT(ldpl.cargo_title,'-',ldpl.shelf_title,'-',ldpl.goods_allocation) = #{allocation} and CONCAT(ldpl.cargo_title,'-',ldpl.shelf_title,'-',ldpl.goods_allocation) = #{allocation}
and ldpl.pallet = #{pallet} and ldpl.pallet = #{pallet}
and ldr.is_deleted = 0 --> and ldr.is_deleted = 0 -->
select DISTINCT ldpl.order_code orderCode,ldpl.order_package_code packageBarCode, 1 goodsType,ldrp.parce_list_id parceListId,ldpl.material_name materialName, select DISTINCT ldpl.order_code orderCode,ldpl.order_package_code packageBarCode, 1 goodsType,ldrp.parce_list_id
lwug.allocation_title allocationTitle,lwtg.tray_code trayCode,lwug.position_code positionCode,lwug.allocation_id allocationId,lds.id stockId,lds.stockup_id stockupId, parceListId,ldpl.material_name materialName,
lwug.allocation_title allocationTitle,lwtg.tray_code trayCode,lwug.position_code positionCode,lwug.allocation_id
allocationId,lds.id stockId,lds.stockup_id stockupId,
lds.allocation_title allocationTitles lds.allocation_title allocationTitles
from logpm_distribution_reservation_package ldrp from logpm_distribution_reservation_package ldrp
LEFT JOIN logpm_distribution_parcel_list ldpl on ldrp.parce_list_id = ldpl.id LEFT JOIN logpm_distribution_parcel_list ldpl on ldrp.parce_list_id = ldpl.id
LEFT JOIN logpm_warehouse_tray_goods lwtg on lwtg.association_id =ldrp.parce_list_id and lwtg.association_type = '3' LEFT JOIN logpm_warehouse_tray_goods lwtg on lwtg.association_id =ldrp.parce_list_id and lwtg.association_type =
LEFT JOIN logpm_warehouse_updown_goods lwug on lwug.association_id =ldrp.parce_list_id and lwug.association_type = '3' '3'
LEFT JOIN logpm_distribution_stock lds on ldpl.id = lds.parcel_list_id and lds.reservation_id = ldrp.reservation_id LEFT JOIN logpm_warehouse_updown_goods lwug on lwug.association_id =ldrp.parce_list_id and lwug.association_type
= '3'
LEFT JOIN logpm_distribution_stock lds on ldpl.id = lds.parcel_list_id and lds.reservation_id =
ldrp.reservation_id
<where> <where>
ldrp.reservation_id = #{param.reservationId} and ldrp.packet_bar_status in (1,3) ldrp.reservation_id = #{param.reservationId} and ldrp.packet_bar_status in (1,3)
<if test="param.trayId != null and param.trayId != ''"> and lwtg.tray_id = #{param.trayId}</if> <if test="param.trayId != null and param.trayId != ''">and lwtg.tray_id = #{param.trayId}</if>
<if test="param.stockArticleId != null and param.stockArticleId != ''"> and ldrp.stock_article_id = #{param.stockArticleId}</if> <if test="param.stockArticleId != null and param.stockArticleId != ''">and ldrp.stock_article_id =
#{param.stockArticleId}
</if>
<if test="param.stockArticleIdList != null "> <if test="param.stockArticleIdList != null ">
and ldrp.stock_article_id in and ldrp.stock_article_id in
<foreach collection="param.stockArticleIdList" item="a" open="(" separator="," close=")"> <foreach collection="param.stockArticleIdList" item="a" open="(" separator="," close=")">
#{a} #{a}
</foreach> </foreach>
</if> </if>
</where> </where>
</select> </select>
<select id="selectWarehouseAreaByReservationId" resultType="String"> <select id="selectWarehouseAreaByReservationId" resultType="String">
select CONCAT(ldpl.cargo_title,'-',ldpl.shelf_title,'-',ldpl.goods_allocation) select CONCAT(ldpl.cargo_title, '-', ldpl.shelf_title, '-', ldpl.goods_allocation)
from logpm_distribution_reservation ldr from logpm_distribution_reservation ldr
left join logpm_distribution_reservation_package ldrp on ldrp.reservation_id = ldr.id and ldrp.is_deleted = 0 left join logpm_distribution_reservation_package ldrp
left join logpm_distribution_parcel_list ldpl on ldpl.id = ldrp.parce_list_id and ldpl.is_deleted = 0 on ldrp.reservation_id = ldr.id and ldrp.is_deleted = 0
left join logpm_distribution_parcel_list ldpl on ldpl.id = ldrp.parce_list_id and ldpl.is_deleted = 0
where ldr.id = #{reservationId} where ldr.id = #{reservationId}
and ldr.is_deleted = 0 and ldr.is_deleted = 0
group by ldpl.cargo_title, group by ldpl.cargo_title,
@ -294,250 +338,301 @@
<select id="selectPalletByReservationId" resultType="String"> <select id="selectPalletByReservationId" resultType="String">
select ldpl.pallet select ldpl.pallet
from logpm_distribution_reservation ldr from logpm_distribution_reservation ldr
left join logpm_distribution_reservation_package ldrp on ldrp.reservation_id = ldr.id and ldrp.is_deleted = 0 left join logpm_distribution_reservation_package ldrp
on ldrp.reservation_id = ldr.id and ldrp.is_deleted = 0
left join logpm_distribution_parcel_list ldpl on ldpl.id = ldrp.parce_list_id and ldpl.is_deleted = 0 left join logpm_distribution_parcel_list ldpl on ldpl.id = ldrp.parce_list_id and ldpl.is_deleted = 0
where ldr.id = #{reservationId} where ldr.id = #{reservationId}
and ldr.is_deleted = 0 and ldr.is_deleted = 0
group by ldpl.pallet group by ldpl.pallet
</select> </select>
<select id="getParcelListOwn" resultType="com.logpm.distribution.vo.DistributionParcelListVO"> <select id="getParcelListOwn" resultType="com.logpm.distribution.vo.DistributionParcelListVO">
<!-- select ldrp.parce_list_id id,ldrp.packet_bar_code orderPackageCode,ldsk.type stockupStatus, ldpl.firsts,ldpl.second,ldpl.third_product thirdProduct, <!-- select ldrp.parce_list_id id,ldrp.packet_bar_code orderPackageCode,ldsk.type stockupStatus, ldpl.firsts,ldpl.second,ldpl.third_product thirdProduct,
ldpl.material_name materialName,lds.stockup_date stockupDate,lds.stockup_area stockupArea,ldpl.goods_allocation goodsAllocation,ldpl.pallet ldpl.material_name materialName,lds.stockup_date stockupDate,lds.stockup_area stockupArea,ldpl.goods_allocation goodsAllocation,ldpl.pallet
from logpm_distribution_stockup lds from logpm_distribution_stockup lds
left join logpm_distribution_stockup_info ldsi on ldsi.stockup_id = lds.id left join logpm_distribution_stockup_info ldsi on ldsi.stockup_id = lds.id
INNER JOIN logpm_distribution_reservation_package ldrp on ldrp.reservation_id = ldsi.reservation_id INNER JOIN logpm_distribution_reservation_package ldrp on ldrp.reservation_id = ldsi.reservation_id
LEFT JOIN logpm_distribution_stock ldsk on ldsk.parcel_list_id = ldrp.parce_list_id LEFT JOIN logpm_distribution_stock ldsk on ldsk.parcel_list_id = ldrp.parce_list_id
LEFT JOIN logpm_distribution_parcel_list ldpl on ldpl.id = ldrp.parce_list_id LEFT JOIN logpm_distribution_parcel_list ldpl on ldpl.id = ldrp.parce_list_id
<where> <where>
lds.id =#{id} lds.id =#{id}
</where>--> </where>-->
select DISTINCT ldsi.stockup_id , ldpl.id id,ldpl.order_package_code orderPackageCode,lds.type stockupStatus,ldpl.firsts,ldpl.second,ldpl.third_product thirdProduct, select DISTINCT ldsi.stockup_id , ldpl.id id,ldpl.order_package_code orderPackageCode,lds.type
ldpl.material_name materialName,lds.create_time stockupDate,lds.stockup_area stockupArea,ldpl.goods_allocation goodsAllocation,lwtg.tray_code pallet stockupStatus,ldpl.firsts,ldpl.second,ldpl.third_product thirdProduct,
ldpl.material_name materialName,lds.create_time stockupDate,lds.stockup_area stockupArea,ldpl.goods_allocation
goodsAllocation,lwtg.tray_code pallet
from logpm_distribution_stockup_info ldsi from logpm_distribution_stockup_info ldsi
LEFT JOIN logpm_distribution_reservation_package ldrp on ldrp.reservation_id = ldsi.reservation_id LEFT JOIN logpm_distribution_reservation_package ldrp on ldrp.reservation_id = ldsi.reservation_id
LEFT JOIN logpm_distribution_parcel_list ldpl on ldpl.id = ldrp.parce_list_id LEFT JOIN logpm_distribution_parcel_list ldpl on ldpl.id = ldrp.parce_list_id
LEFT JOIN logpm_distribution_stock lds on ldpl.id = lds.parcel_list_id and lds.stockup_id = ldsi.stockup_id LEFT JOIN logpm_distribution_stock lds on ldpl.id = lds.parcel_list_id and lds.stockup_id = ldsi.stockup_id
LEFT JOIN logpm_warehouse_tray_goods lwtg on lwtg.association_id = ldpl.id and lwtg.association_type = '3' LEFT JOIN logpm_warehouse_tray_goods lwtg on lwtg.association_id = ldpl.id and lwtg.association_type = '3'
<where> <where>
ldsi.stockup_id =#{id} and ldpl.order_package_code is not null ldsi.stockup_id =#{id} and ldpl.order_package_code is not null
</where> </where>
</select> </select>
<select id="getPageVOList" resultType="com.logpm.distribution.entity.DistributionParcelListEntity"> <select id="getPageVOList" resultType="com.logpm.distribution.entity.DistributionParcelListEntity">
SELECT SELECT
id, id,
tenant_id, tenant_id,
create_user, create_user,
create_time, create_time,
update_user, update_user,
update_time, update_time,
status, status,
is_deleted, is_deleted,
create_dept, create_dept,
reserve1, reserve1,
reserve2, reserve2,
reserve3, reserve3,
reserve4, reserve4,
reserve5, reserve5,
warehouse_id, warehouse_id,
warehouse, warehouse,
conditions, conditions,
order_package_code, order_package_code,
cargo_title, cargo_title,
shelf_title, shelf_title,
goods_allocation, goods_allocation,
pallet, pallet,
firsts, firsts,
`second`, `second`,
third_product, third_product,
quantity, quantity,
train_number, train_number,
stock_article_id, stock_article_id,
order_code, order_code,
service_number, service_number,
material_id, material_id,
material_name, material_name,
material_code, material_code,
material_unit, material_unit,
brand_id, brand_id,
brand_name, brand_name,
order_package_status, order_package_status,
order_package_freeze_status, order_package_freeze_status,
order_package_grounding_status, order_package_grounding_status,
order_package_stockup_status, order_package_stockup_status,
order_package_reservation_status order_package_reservation_status
FROM FROM
logpm_distribution_parcel_list logpm_distribution_parcel_list
<where> <where>
<if test="id !='' and id != null"> <if test="id !='' and id != null">
stock_article_id = #{id} stock_article_id = #{id}
</if> </if>
</where> </where>
</select> </select>
<update id="updateOrderGroundingStatus" > <update id="updateOrderGroundingStatus">
update logpm_distribution_stock_article update logpm_distribution_stock_article
set grounding_status = #{groundingStatus} set grounding_status = #{groundingStatus}
where order_code = #{orderCode} where order_code = #{orderCode}
and warehouse_id = #{warehouseId} and warehouse_id = #{warehouseId}
</update> </update>
<select id="findALLNoUpShelfPackageByOrderCode" resultType="com.logpm.distribution.entity.DistributionParcelListEntity"> <select id="findALLNoUpShelfPackageByOrderCode"
resultType="com.logpm.distribution.entity.DistributionParcelListEntity">
select ldpl.* select ldpl.*
from logpm_distribution_parcel_list ldpl from logpm_distribution_parcel_list ldpl
left join logpm_warehouse_tray_goods lwtg on lwtg.association_value = ldpl.order_package_code left join logpm_warehouse_tray_goods lwtg on lwtg.association_value = ldpl.order_package_code
left join logpm_warehouse_updown_goods lwug on lwug.association_value = ldpl.order_package_code left join logpm_warehouse_updown_goods lwug on lwug.association_value = ldpl.order_package_code
where 1=1 where 1 = 1
and ldpl.order_code = #{orderCode} and ldpl.order_code = #{orderCode}
and ldpl.warehouse_id = #{warehouseId} and ldpl.warehouse_id = #{warehouseId}
and lwtg.id is null and lwtg.id is null
and lwug.id is null and lwug.id is null
</select> </select>
<select id="pageOweList" resultType="com.logpm.distribution.entity.DistributionParcelListEntity"> <select id="pageOweList" resultType="com.logpm.distribution.entity.DistributionParcelListEntity">
select DISTINCT ldpl.id, select DISTINCT ldpl.id,
ldpl.tenant_id, ldpl.tenant_id,
ldpl.create_user, ldpl.create_user,
ldpl.create_time, ldpl.create_time,
ldpl.update_user, ldpl.update_user,
ldpl.update_time, ldpl.update_time,
ldpl.status, ldpl.is_deleted, ldpl.create_dept, ldpl.status, ldpl.is_deleted, ldpl.create_dept,
ldpl.reserve1, ldpl.reserve2, ldpl.reserve3, ldpl.reserve4, ldpl.reserve5, ldpl.reserve1, ldpl.reserve2, ldpl.reserve3, ldpl.reserve4, ldpl.reserve5,
ldpl.warehouse_id, ldpl.warehouse, ldpl.conditions, ldpl.order_package_code, ldpl.warehouse_id, ldpl.warehouse, ldpl.conditions, ldpl.order_package_code,
ldpl.cargo_title, ldpl.shelf_title, ldpl.cargo_title, ldpl.shelf_title,
ldpl.firsts, ldpl.second, ldpl.third_product, ldpl.quantity, ldpl.firsts, ldpl.second, ldpl.third_product, ldpl.quantity,
ldpl.train_number, ldpl.stock_article_id, ldpl.order_code, ldpl.service_number, ldpl.train_number, ldpl.stock_article_id, ldpl.order_code, ldpl.service_number,
ldpl.material_id, ldpl.material_name, ldpl.material_code, ldpl.material_unit, ldpl.brand_id, ldpl.material_id, ldpl.material_name, ldpl.material_code, ldpl.material_unit, ldpl.brand_id,
ldpl.brand_name, ldpl.order_package_status, ldpl.order_package_freeze_status, ldpl.brand_name, ldpl.order_package_status, ldpl.order_package_freeze_status,
ldpl.order_package_grounding_status, ldpl.order_package_stockup_status, ldpl.order_package_grounding_status, ldpl.order_package_stockup_status,
ldpl.order_package_reservation_status, ldpl.order_package_loading_status, ldpl.order_package_reservation_status, ldpl.order_package_loading_status,
ldpl.waybill_number, ldpl.waybill_id, ldpl.warehouse_entry_time_end, ldpl.waybill_number, ldpl.waybill_id, ldpl.warehouse_entry_time_end,
ldpl.dealer_name, ldpl.dealer_code, ldpl.send_warehouse_id, ldpl.dealer_name, ldpl.dealer_code, ldpl.send_warehouse_id,
ldpl.send_warehouse_name, ldpl.accept_warehouse_id, ldpl.accept_warehouse_name, ldpl.order_package_delivery_status , ldpl.send_warehouse_name, ldpl.accept_warehouse_id, ldpl.accept_warehouse_name,
GROUP_CONCAT(DISTINCT lwtg.tray_code) pallet, ldpl.order_package_delivery_status ,
GROUP_CONCAT(DISTINCT lwug.position_code) goodsAllocation GROUP_CONCAT(DISTINCT lwtg.tray_code) pallet,
GROUP_CONCAT(DISTINCT lwug.position_code) goodsAllocation
From logpm_distribution_parcel_list ldpl From logpm_distribution_parcel_list ldpl
LEFT JOIN logpm_warehouse_tray_goods lwtg on lwtg.association_id = ldpl.id LEFT JOIN logpm_warehouse_tray_goods lwtg on lwtg.association_id = ldpl.id
LEFT JOIN logpm_warehouse_updown_goods lwug on lwug.association_id = ldpl.id LEFT JOIN logpm_warehouse_updown_goods lwug on lwug.association_id = ldpl.id
<where> <where>
<if test="param.serviceNumber != null and param.serviceNumber != ''" >and ldpl.service_number like concat('%',#{param.serviceNumber},'%') </if> <if test="param.serviceNumber != null and param.serviceNumber != ''">and ldpl.service_number like
<if test="param.waybillNumber != null and param.waybillNumber != ''" >and ldpl.waybill_number like concat('%',#{param.waybillNumber},'%') </if> concat('%',#{param.serviceNumber},'%')
<if test="param.orderCode != null and param.orderCode != ''" >and ldpl.order_code like concat('%',#{param.orderCode},'%') </if> </if>
<if test="param.warehouse != null and param.warehouse != ''" >and ldpl.warehouse like concat('%',#{param.warehouse},'%') </if> <if test="param.waybillNumber != null and param.waybillNumber != ''">and ldpl.waybill_number like
<if test="param.orderPackageReservationStatus != null and param.orderPackageReservationStatus != ''" >and ldpl.order_package_reservation_status = #{param.orderPackageReservationStatus}</if> concat('%',#{param.waybillNumber},'%')
<if test="param.orderPackageFreezeStatus != null and param.orderPackageFreezeStatus != ''" >and ldpl.order_package_freeze_status = #{param.orderPackageFreezeStatus}</if> </if>
<if test="param.orderPackageStatus != null and param.orderPackageStatus != ''" >and ldpl.order_package_status = #{param.orderPackageStatus}</if> <if test="param.orderCode != null and param.orderCode != ''">and ldpl.order_code like
<if test="param.orderPackageGroundingStatus != null and param.orderPackageGroundingStatus != ''" >and ldpl.order_package_grounding_status = #{param.orderPackageGroundingStatus}</if> concat('%',#{param.orderCode},'%')
<if test="param.orderPackageStockupStatus != null and param.orderPackageStockupStatus != ''" >and ldpl.order_package_stockup_status = #{param.orderPackageStockupStatus}</if> </if>
<if test="param.orderPackageReservationStatus != null and param.orderPackageReservationStatus != ''" >and ldpl.order_package_reservation_status = #{param.orderPackageReservationStatus}</if> <if test="param.warehouse != null and param.warehouse != ''">and ldpl.warehouse like
<if test="param.orderPackageCode != null and param.orderPackageCode != ''" >and ldpl.order_package_code like concat('%',#{param.orderPackageCode},'%') </if> concat('%',#{param.warehouse},'%')
<if test="param.pallet != null and param.pallet != ''" >and lwtg.tray_code like concat('%',#{param.pallet},'%') </if> </if>
<if test="param.goodsAllocation != null and param.goodsAllocation != ''" >and lwug.position_code like concat('%',#{param.goodsAllocation},'%') </if> <if test="param.orderPackageReservationStatus != null and param.orderPackageReservationStatus != ''">and
<if test="param.firsts != null and param.firsts != ''" >and ldpl.firsts like concat('%',#{param.firsts},'%') </if> ldpl.order_package_reservation_status = #{param.orderPackageReservationStatus}
<if test="param.second != null and param.second != ''" >and ldpl.second like concat('%',#{param.second},'%') </if> </if>
<if test="param.thirdProduct != null and param.thirdProduct != ''" >and ldpl.third_product like concat('%',#{param.thirdProduct},'%') </if> <if test="param.orderPackageFreezeStatus != null and param.orderPackageFreezeStatus != ''">and
<if test="param.materialName != null and param.materialName != ''" >and ldpl.material_name like concat('%',#{param.materialName},'%') </if> ldpl.order_package_freeze_status = #{param.orderPackageFreezeStatus}
<if test="param.warehouseEntryTimeEnd != null" >and DATE(ldpl.warehouse_entry_time_end) = #{param.warehouseEntryTimeEnd}</if> </if>
<if test="param.trainNumber != null and param.trainNumber != ''" >and ldpl.train_number = #{param.trainNumber}</if> <if test="param.orderPackageStatus != null and param.orderPackageStatus != ''">and ldpl.order_package_status
<if test="param.sendWarehouseName != null and param.sendWarehouseName != ''" >and ldpl.send_warehouse_name like concat('%',#{param.sendWarehouseName},'%') </if> = #{param.orderPackageStatus}
<if test="param.stockArticleIdsList != null " >and ldpl.stock_article_id in </if>
<foreach collection="param.stockArticleIdsList" separator="," close=")" item="a" open="("> <if test="param.orderPackageGroundingStatus != null and param.orderPackageGroundingStatus != ''">and
#{a} ldpl.order_package_grounding_status = #{param.orderPackageGroundingStatus}
</foreach> </if>
</if> <if test="param.orderPackageStockupStatus != null and param.orderPackageStockupStatus != ''">and
<if test="param.stockArticleIdsLike != null and param.stockArticleIdsLike != ''" >and ldpl.stock_article_id = #{param.stockArticleIdsLike} </if> ldpl.order_package_stockup_status = #{param.orderPackageStockupStatus}
<if test="param.stockArticleId != null and param.stockArticleId != ''" >and ldpl.stock_article_id = #{param.stockArticleId} </if> </if>
<if test="param.conditions != null and param.conditions != ''" >and ldpl.conditions = #{param.conditions} </if> <if test="param.orderPackageReservationStatus != null and param.orderPackageReservationStatus != ''">and
ldpl.order_package_reservation_status = #{param.orderPackageReservationStatus}
</if>
<if test="param.orderPackageCode != null and param.orderPackageCode != ''">and ldpl.order_package_code like
concat('%',#{param.orderPackageCode},'%')
</if>
<if test="param.pallet != null and param.pallet != ''">and lwtg.tray_code like
concat('%',#{param.pallet},'%')
</if>
<if test="param.goodsAllocation != null and param.goodsAllocation != ''">and lwug.position_code like
concat('%',#{param.goodsAllocation},'%')
</if>
<if test="param.firsts != null and param.firsts != ''">and ldpl.firsts like
concat('%',#{param.firsts},'%')
</if>
<if test="param.second != null and param.second != ''">and ldpl.second like
concat('%',#{param.second},'%')
</if>
<if test="param.thirdProduct != null and param.thirdProduct != ''">and ldpl.third_product like
concat('%',#{param.thirdProduct},'%')
</if>
<if test="param.materialName != null and param.materialName != ''">and ldpl.material_name like
concat('%',#{param.materialName},'%')
</if>
<if test="param.warehouseEntryTimeEnd != null">and DATE(ldpl.warehouse_entry_time_end) =
#{param.warehouseEntryTimeEnd}
</if>
<if test="param.trainNumber != null and param.trainNumber != ''">and ldpl.train_number =
#{param.trainNumber}
</if>
<if test="param.sendWarehouseName != null and param.sendWarehouseName != ''">and ldpl.send_warehouse_name
like concat('%',#{param.sendWarehouseName},'%')
</if>
<if test="param.stockArticleIdsList != null ">and ldpl.stock_article_id in
<foreach collection="param.stockArticleIdsList" separator="," close=")" item="a" open="(">
#{a}
</foreach>
</if>
<if test="param.stockArticleIdsLike != null and param.stockArticleIdsLike != ''">and ldpl.stock_article_id =
#{param.stockArticleIdsLike}
</if>
<if test="param.stockArticleId != null and param.stockArticleId != ''">and ldpl.stock_article_id =
#{param.stockArticleId}
</if>
<if test="param.conditions != null and param.conditions != ''">and ldpl.conditions = #{param.conditions}
</if>
</where> </where>
GROUP BY ldpl.id GROUP BY ldpl.id
</select> </select>
<select id="getPackageList" resultType="com.logpm.distribution.entity.DistributionParcelListEntity"> <select id="getPackageList" resultType="com.logpm.distribution.entity.DistributionParcelListEntity">
SELECT SELECT ldpl.id,
ldpl.id, ldpl.tenant_id,
ldpl.tenant_id, ldpl.create_user,
ldpl.create_user, ldpl.create_time,
ldpl.create_time, ldpl.update_user,
ldpl.update_user, ldpl.update_time,
ldpl.update_time, ldpl.status,
ldpl.status, ldpl.is_deleted,
ldpl.is_deleted, ldpl.create_dept,
ldpl.create_dept, ldpl.reserve1,
ldpl.reserve1, ldpl.reserve2,
ldpl.reserve2, ldpl.reserve3,
ldpl.reserve3, ldpl.reserve4,
ldpl.reserve4, ldpl.reserve5,
ldpl.reserve5, ldpl.warehouse_id,
ldpl.warehouse_id, ldpl.warehouse,
ldpl.warehouse, ldpl.conditions,
ldpl.conditions, ldpl.order_package_code,
ldpl.order_package_code, ldpl.cargo_title,
ldpl.cargo_title, ldpl.shelf_title,
ldpl.shelf_title, lwtg.tray_code AS pallet,
lwtg.tray_code AS pallet, lwug.allocation_title AS goodsAllocation,
lwug.allocation_title AS goodsAllocation, ldpl.firsts_code,
ldpl.firsts_code, ldpl.firsts,
ldpl.firsts, ldpl.second_code,
ldpl.second_code, ldpl.second,
ldpl.second, ldpl.third_code,
ldpl.third_code, ldpl.third_product,
ldpl.third_product, ldpl.quantity,
ldpl.quantity, ldpl.train_number,
ldpl.train_number, ldpl.stock_article_id,
ldpl.stock_article_id, ldpl.order_code,
ldpl.order_code, ldpl.service_number,
ldpl.service_number, ldpl.material_id,
ldpl.material_id, ldpl.material_name,
ldpl.material_name, ldpl.material_code,
ldpl.material_code, ldpl.material_unit,
ldpl.material_unit, ldpl.brand_id,
ldpl.brand_id, ldpl.brand_name,
ldpl.brand_name, ldpl.order_package_status,
ldpl.order_package_status, ldpl.order_package_freeze_status,
ldpl.order_package_freeze_status, ldpl.order_package_grounding_status,
ldpl.order_package_grounding_status, ldpl.order_package_stockup_status,
ldpl.order_package_stockup_status, ldpl.order_package_reservation_status,
ldpl.order_package_reservation_status, ldpl.order_package_loading_status,
ldpl.order_package_loading_status, ldpl.waybill_number,
ldpl.waybill_number, ldpl.waybill_id,
ldpl.waybill_id, ldpl.warehouse_entry_time_end,
ldpl.warehouse_entry_time_end, ldpl.dealer_name,
ldpl.dealer_name, ldpl.dealer_code,
ldpl.dealer_code, ldpl.send_warehouse_id,
ldpl.send_warehouse_id, ldpl.send_warehouse_name,
ldpl.send_warehouse_name, ldpl.accept_warehouse_id,
ldpl.accept_warehouse_id, ldpl.accept_warehouse_name,
ldpl.accept_warehouse_name, ldpl.order_package_delivery_status
ldpl.order_package_delivery_status FROM logpm_distribution_parcel_list AS ldpl
FROM LEFT JOIN logpm_warehouse_tray_goods AS lwtg
logpm_distribution_parcel_list AS ldpl ON ldpl.id = lwtg.association_id AND lwtg.association_type = 3
LEFT JOIN logpm_warehouse_tray_goods AS lwtg ON ldpl.id = lwtg.association_id AND lwtg.association_type = 3 LEFT JOIN logpm_warehouse_updown_goods AS lwug
LEFT JOIN logpm_warehouse_updown_goods AS lwug ON ldpl.id = lwtg.association_id AND lwtg.association_type = 3 ON ldpl.id = lwtg.association_id AND lwtg.association_type = 3
WHERE WHERE ldpl.stock_article_id = #{stockArticleId}
ldpl.stock_article_id = #{stockArticleId} and ldpl.order_package_reservation_status in ('10','20') and ldpl.order_package_reservation_status = '10' and ldpl.order_package_reservation_status in ('10', '20')
and ldpl.order_package_reservation_status = '10'
</select> </select>
<select id="selectListByOderId" resultType="com.logpm.distribution.entity.DistributionParcelListEntity"> <select id="selectListByOderId" resultType="com.logpm.distribution.entity.DistributionParcelListEntity">
SELECT SELECT
ldpl.id id, ldpl.id id,
ldpl.order_package_code orderPackageCode, ldpl.order_package_code orderPackageCode,
ldpl.warehouse warehouse, ldpl.warehouse warehouse,
ldpl.firsts firsts, ldpl.firsts firsts,
ldpl.second second , ldpl.second second ,
ldpl.third_product thirdProduct, ldpl.third_product thirdProduct,
ldpl.material_name materialName, ldpl.material_name materialName,
ldpl.order_package_status orderPackageStatus, ldpl.order_package_status orderPackageStatus,
lwug.position_code goodsAllocation, lwug.position_code goodsAllocation,
lwtg.tray_code pallet lwtg.tray_code pallet
FROM FROM
logpm_distribution_parcel_list ldpl logpm_distribution_parcel_list ldpl
JOIN logpm_distribution_stock_article ldsa ON ldpl.stock_article_id = ldsa.id JOIN logpm_distribution_stock_article ldsa ON ldpl.stock_article_id = ldsa.id
LEFT JOIN logpm_warehouse_updown_goods lwug ON lwug.association_id = ldpl.id LEFT JOIN logpm_warehouse_updown_goods lwug ON lwug.association_id = ldpl.id
left join logpm_warehouse_tray_goods lwtg on lwtg.association_id = ldpl.id left join logpm_warehouse_tray_goods lwtg on lwtg.association_id = ldpl.id
<where> <where>
ldsa.is_deleted = 0 ldsa.is_deleted = 0
AND ldpl.conditions =1 AND ldpl.conditions =1
<if test="id != null and id != ''" > and ldsa.id = #{id} </if> <if test="id != null and id != ''">and ldsa.id = #{id}</if>
<!-- <if test="condition != null and condition != ''" > and ldsa.order_code = #{condition} </if>--> <!-- <if test="condition != null and condition != ''" > and ldsa.order_code = #{condition} </if>-->
<if test="collect != null and @org.apache.commons.collections4.CollectionUtils@isNotEmpty(collect)"> <if test="collect != null and @org.apache.commons.collections4.CollectionUtils@isNotEmpty(collect)">
and ldpl.warehouse_id in and ldpl.warehouse_id in
<foreach collection="collect" item="item" open="(" close=")" separator=","> <foreach collection="collect" item="item" open="(" close=")" separator=",">
@ -570,5 +665,46 @@
</if> </if>
</where> </where>
</select> </select>
<select id="selectStockListByOderId" resultType="com.logpm.distribution.vo.DistributionStockListVO">
SELECT
ldsl.id id,
ldsl.incoming_batch incomingBatch,
ldsl.market_name marketName,
ldsl.service_type serviceType,
ldsl.service_number serviceNumber,
ldsl.description_goods descriptionGoods,
ldsl.cargo_number cargoNumber,
ldsl.quantity_stock quantityStock ,
lwtg.tray_code trayCode,
lwug.position_code positionCode
FROM
logpm_distribution_stock_list ldsl
JOIN logpm_distribution_parcel_list ldpl ON ldpl.id = ldsl.parcel_list_id
left JOIN logpm_warehouse_updown_goods lwug ON ldsl.material_id = lwug.association_id
AND lwug.incoming_batch = ldsl.incoming_batch
AND ldsl.market_id = lwug.market_id
LEFT JOIN logpm_warehouse_tray_goods lwtg ON lwtg.association_id = ldsl.material_id
AND lwtg.incoming_batch = ldsl.incoming_batch
AND ldsl.market_id = lwtg.market_id
<where>
ldpl.stock_article_id = #{id} and ldpl.conditions =2
<if test="collect != null and @org.apache.commons.collections4.CollectionUtils@isNotEmpty(collect)">
and ldpl.warehouse_id in
<foreach collection="collect" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
</where>
GROUP BY
ldsl.id,
ldsl.incoming_batch,
ldsl.market_name,
ldsl.service_type,
ldsl.service_number,
ldsl.description_goods,
ldsl.cargo_number,
lwtg.tray_code,
lwug.position_code;
</select>
</mapper> </mapper>

2
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java

@ -2912,7 +2912,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
List<DistributionReservationPackageEntity> distributionReservationPackageEntities = distributionReservationPackageMapper.selectList(new QueryWrapper<DistributionReservationPackageEntity>().lambda() List<DistributionReservationPackageEntity> distributionReservationPackageEntities = distributionReservationPackageMapper.selectList(new QueryWrapper<DistributionReservationPackageEntity>().lambda()
.eq(DistributionReservationPackageEntity::getReservationId, reservationEntity.getId()) .eq(DistributionReservationPackageEntity::getReservationId, reservationEntity.getId())
.eq(DistributionReservationPackageEntity::getStockArticleId, s.getId()) .eq(DistributionReservationPackageEntity::getStockArticleId, s.getId())
.ne(DistributionReservationPackageEntity::getPacketBarCode, "2") .ne(DistributionReservationPackageEntity::getPacketBarStatus, "2")
); );
// //
List<DistributionReservationPackageEntity> byReservationIdAndStockArticleId = distributionReservationPackageMapper.getByReservationIdAndStockArticleId(reservationEntity.getId(), s.getId()); List<DistributionReservationPackageEntity> byReservationIdAndStockArticleId = distributionReservationPackageMapper.getByReservationIdAndStockArticleId(reservationEntity.getId(), s.getId());

7
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java

@ -982,10 +982,11 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
//查询订单下的所有包条 //查询订单下的所有包条
List<DistributionParcelListEntity> distributionParcelListEntitys = distributionParcelListMapper.selectListByOderId(id,collect); List<DistributionParcelListEntity> distributionParcelListEntitys = distributionParcelListMapper.selectListByOderId(id,collect);
//查询订单下的所有库存品 //查询订单下的所有库存品
//List<DistributionStockListVO> distributionStockListVOS = distributionParcelListMapper.selectStockListByOderId(id,collect); List<DistributionStockListVO> distributionStockListVOS = distributionParcelListMapper.selectStockListByOderId(id,collect);
queryOrderVO.setWrapNum(distributionParcelListEntitys.size()); queryOrderVO.setWrapNum(distributionParcelListEntitys.size());
queryOrderVO.setInventoryNum(0); queryOrderVO.setInventoryNum(distributionStockListVOS.size());
queryOrderVO.setList(distributionParcelListEntitys); queryOrderVO.setList(distributionParcelListEntitys);
queryOrderVO.setStockList(distributionStockListVOS);
return queryOrderVO; return queryOrderVO;
} }

5
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/wrapper/WarehouseStockVOWrapper.java

@ -43,7 +43,10 @@ public class WarehouseStockVOWrapper extends BaseEntityWrapper<WarehouseScanReco
@Override @Override
public WarehouseScanRecordVO entityVO(WarehouseScanRecordVO WarehouseStock) { public WarehouseScanRecordVO entityVO(WarehouseScanRecordVO WarehouseStock) {
if (null != WarehouseStock.getOperatorId() && 0 !=WarehouseStock.getOperatorId()){ if (null != WarehouseStock.getOperatorId() && 0 !=WarehouseStock.getOperatorId()){
WarehouseStock.setOperatorName(userCliient.userInfoById(WarehouseStock.getOperatorId()).getData().getName()); String name = userCliient.userInfoById(WarehouseStock.getOperatorId()).getData().getName();
if (null != name) {
WarehouseStock.setOperatorName(name);
}
} }
WarehouseStock.setOrderPackageStatusName(DictBizCache.getValue(DictBizConstant.ORDER_PACKAGE_STATUS, WarehouseStock.getOrderPackageStatus())); WarehouseStock.setOrderPackageStatusName(DictBizCache.getValue(DictBizConstant.ORDER_PACKAGE_STATUS, WarehouseStock.getOrderPackageStatus()));
WarehouseStock.setOrderPackageFreezeStatusName(DictBizCache.getValue(DictBizConstant.ORDER_PACKAGE_FREEZE_STATUS, WarehouseStock.getOrderPackageFreezeStatus())); WarehouseStock.setOrderPackageFreezeStatusName(DictBizCache.getValue(DictBizConstant.ORDER_PACKAGE_FREEZE_STATUS, WarehouseStock.getOrderPackageFreezeStatus()));

Loading…
Cancel
Save