Browse Source

修改自提签收数据查询不正确

single_db
caoyizhong 1 year ago
parent
commit
ef85f4f42c
  1. 13
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.xml
  2. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.java
  3. 8
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.xml
  4. 16
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java
  5. 14
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillLadingServiceImpl.java

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

@ -319,18 +319,17 @@
<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 select DISTINCT ldpl.order_code orderCode,ldpl.order_package_code packageBarCode,ldpl.conditions
goodsType,ldpl.material_name materialName, 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) lwug.position_code positionCode,
from logpm_warehouse_updown_goods lwug.allocation_id allocationId
where association_id = ldpl.id
) positionCode,lds.allocation_id allocationId
from logpm_distrilbution_bill_package ldbp from logpm_distrilbution_bill_package ldbp
LEFT JOIN logpm_distribution_parcel_list ldpl on ldbp.parce_list_id = ldpl.id and ldbp.packet_bar_status in (1,3) and ldbp.packet_bar_code is not null LEFT JOIN logpm_distribution_parcel_list ldpl on ldbp.parce_list_id = ldpl.id and ldbp.packet_bar_status in (1,3) and ldbp.packet_bar_code is not null
LEFT JOIN logpm_distribution_stock lds on lds.parcel_list_id = ldpl.id LEFT JOIN logpm_warehouse_updown_goods lwug on lwug.association_id = ldpl.id
LEFT JOIN logpm_distribution_stock lds ON lds.parcel_list_id = lwug.association_id
<where> <where>
ldpl.conditions = '1' ldpl.conditions = '1'
<if test="param.allocationId != null and param.allocationId != ''">and lds.allocation_id = <if test="param.allocationId != null and param.allocationId != ''">and lwug.allocation_id =
#{param.allocationId} #{param.allocationId}
</if> </if>
<if test="param.stockArticleId != null and param.stockArticleId != ''">and ldpl.stock_article_id = <if test="param.stockArticleId != null and param.stockArticleId != ''">and ldpl.stock_article_id =

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

@ -62,7 +62,7 @@ public interface DistrilbutionBillLadingMapper extends BaseMapper<DistrilbutionB
DistrilbutionBillLadingAppVO selectDataByBillLadingId(@Param("billLadingId") Long billLadingId); DistrilbutionBillLadingAppVO selectDataByBillLadingId(@Param("billLadingId") Long billLadingId);
List<DistrilbutionAppBillLadingDetailVO> selectDetailList(@Param("stockArticleId") Long stockArticleId, @Param("scanStatus") Integer scanStatus,@Param("orderCode") String orderSelfNumbering); List<DistrilbutionAppBillLadingDetailVO> selectDetailList(@Param("stockArticleId") Long stockArticleId, @Param("scanStatus") Integer scanStatus,@Param("orderCode") String orderSelfNumbering,@Param("billLadingId") Long billLadingId);
DistrilbutionBillLadingVO getOneOwn(@Param("id") Long id); DistrilbutionBillLadingVO getOneOwn(@Param("id") Long id);

8
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.xml

@ -278,10 +278,11 @@
else 2 else 2
end scanStatus, end scanStatus,
0 errorStatus 0 errorStatus
from logpm_distribution_parcel_list ldpl from logpm_distrilbution_bill_package ldbp
LEFT JOIN logpm_distribution_parcel_list ldpl on ldpl.id = ldbp.parce_list_id
left join logpm_distribution_bill_lading_scan ldbls on ldbls.parcel_list_id = ldpl.id and ldbls.is_deleted = 0 left join logpm_distribution_bill_lading_scan ldbls on ldbls.parcel_list_id = ldpl.id and ldbls.is_deleted = 0
<where> <where>
ldpl.is_deleted = 0 and ldpl.order_package_code is not null ldpl.is_deleted = 0 and ldpl.order_package_code is not null and ldbp.packet_bar_status in (1,3)
and ldpl.stock_article_id = #{stockArticleId} and ldpl.stock_article_id = #{stockArticleId}
<if test="orderCode != null and orderCode !=''"> <if test="orderCode != null and orderCode !=''">
and ldpl.order_code = ${orderCode} and ldpl.order_code = ${orderCode}
@ -292,6 +293,9 @@
<if test="scanStatus != null and scanStatus==2"> <if test="scanStatus != null and scanStatus==2">
and ldbls.id is not null and ldbls.id is not null
</if> </if>
<if test="billLadingId != null and billLadingId != ''">
and ldbp.bill_lading_id = #{ billLadingId }
</if>
</where> </where>
</select> </select>
<select id="getOneOwn" resultType="com.logpm.distribution.vo.DistrilbutionBillLadingVO"> <select id="getOneOwn" resultType="com.logpm.distribution.vo.DistrilbutionBillLadingVO">

16
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java

@ -1322,6 +1322,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
*/ */
@Override @Override
public DistributionStockupOrderInfoVO selectOrderInfoSelf(StockupDTO stockupDTO) { public DistributionStockupOrderInfoVO selectOrderInfoSelf(StockupDTO stockupDTO) {
Long allocationId = stockupDTO.getAllocationId();
DistributionStockArticleEntity byId = distributionStockArticleService.getById(stockupDTO.getStockArticleId()); DistributionStockArticleEntity byId = distributionStockArticleService.getById(stockupDTO.getStockArticleId());
if (stockupDTO.getStatus().equals(1)) { if (stockupDTO.getStatus().equals(1)) {
//已备货 //已备货
@ -1330,7 +1331,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
DistributionStockupSelfVO distributionStockupSelfVO = new DistributionStockupSelfVO(); DistributionStockupSelfVO distributionStockupSelfVO = new DistributionStockupSelfVO();
AtomicReference<Integer> j = new AtomicReference<>(0); AtomicReference<Integer> j = new AtomicReference<>(0);
AtomicReference<Integer> y = new AtomicReference<>(0); AtomicReference<Integer> y = new AtomicReference<>(0);
if (ObjectUtils.isNotNull(stockupDTO.getAllocationId())) { if (ObjectUtils.isNotNull(allocationId)) {
distributionStockupSelf.forEach(i -> { distributionStockupSelf.forEach(i -> {
if (ObjectUtils.isNotNull(i.getLwugId())) { if (ObjectUtils.isNotNull(i.getLwugId())) {
j.updateAndGet(v -> v + i.getPlanNum()); j.updateAndGet(v -> v + i.getPlanNum());
@ -1387,10 +1388,10 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
List<PackageStockupVO> list = distributionParcelListService.selectOrderInfoSelfAllocationList(stockupDTO); List<PackageStockupVO> list = distributionParcelListService.selectOrderInfoSelfAllocationList(stockupDTO);
Iterator<PackageStockupVO> iterator = list.iterator(); Iterator<PackageStockupVO> iterator = list.iterator();
List<PackageStockupVO> listPack = new ArrayList<>(); List<PackageStockupVO> listPack = new ArrayList<>();
if (ObjectUtils.isNotNull(stockupDTO.getAllocationId())) { if (ObjectUtils.isNotNull(allocationId)) {
while (iterator.hasNext()) { while (iterator.hasNext()) {
PackageStockupVO next = iterator.next(); PackageStockupVO next = iterator.next();
if (stockupDTO.getAllocationId().equals(next.getAllocationId())) { if (allocationId.equals(next.getAllocationId())) {
next.setIsScanStr("已备货"); next.setIsScanStr("已备货");
next.setIsScan(2); next.setIsScan(2);
listPack.add(next); listPack.add(next);
@ -1425,7 +1426,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
} else { } else {
DistributionStockupSelfVO distributionStockupSelfVO = new DistributionStockupSelfVO(); DistributionStockupSelfVO distributionStockupSelfVO = new DistributionStockupSelfVO();
if (ObjectUtils.isNotNull(stockupDTO.getAllocationId())) { if (ObjectUtils.isNotNull(allocationId)) {
//查询订单数量 有库位 //查询订单数量 有库位
List<DistributionStockupSelfVO> distributionStockupSelfVOS = distrilbutionBillStockService.selectDistrilbutionBillPackSelf(stockupDTO); List<DistributionStockupSelfVO> distributionStockupSelfVOS = distrilbutionBillStockService.selectDistrilbutionBillPackSelf(stockupDTO);
List<DistributionStockupSelfVO> collect = distributionStockupSelfVOS.stream().filter(i -> ObjectUtils.isNotNull(i.getWarehouseArea())).collect(Collectors.toList()); List<DistributionStockupSelfVO> collect = distributionStockupSelfVOS.stream().filter(i -> ObjectUtils.isNotNull(i.getWarehouseArea())).collect(Collectors.toList());
@ -1504,10 +1505,9 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
List<PackageStockupVO> list = distributionParcelListService.selectOrderInfoSelfList(stockupDTO); List<PackageStockupVO> list = distributionParcelListService.selectOrderInfoSelfList(stockupDTO);
Iterator<PackageStockupVO> iterator = list.iterator(); Iterator<PackageStockupVO> iterator = list.iterator();
AtomicReference<Integer> j = new AtomicReference<>(0); AtomicReference<Integer> j = new AtomicReference<>(0);
if (Objects.isNull(stockupDTO.getAllocationId())) { if (Objects.isNull(allocationId)) {
while (iterator.hasNext()) { while (iterator.hasNext()) {
j.updateAndGet(v -> v + 1);
PackageStockupVO next = iterator.next(); PackageStockupVO next = iterator.next();
if (ObjectUtils.isNotNull(next.getAllocationId())) { if (ObjectUtils.isNotNull(next.getAllocationId())) {
iterator.remove(); iterator.remove();
@ -1520,10 +1520,11 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
next.setIsScanStr("未备货"); next.setIsScanStr("未备货");
next.setIsScan(1); next.setIsScan(1);
} }
j.updateAndGet(v -> v + 1);
} }
} else { } else {
while (iterator.hasNext()) { while (iterator.hasNext()) {
j.updateAndGet(v -> v + 1);
PackageStockupVO next = iterator.next(); PackageStockupVO next = iterator.next();
if (ObjectUtils.isNull(next.getPositionCode())) { if (ObjectUtils.isNull(next.getPositionCode())) {
iterator.remove(); iterator.remove();
@ -1536,6 +1537,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
next.setIsScanStr("未备货"); next.setIsScanStr("未备货");
next.setIsScan(1); next.setIsScan(1);
} }
j.updateAndGet(v -> v + 1);
} }
} }
distributionStockupSelfVO.setPlanNum(j.get()); distributionStockupSelfVO.setPlanNum(j.get());

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

@ -900,7 +900,11 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
queryWrapper.eq("stock_article_id", Long.parseLong(s)) queryWrapper.eq("stock_article_id", Long.parseLong(s))
.eq("is_deleted", 0); .eq("is_deleted", 0);
queryWrapper.isNotNull("order_package_code"); queryWrapper.isNotNull("order_package_code");
List<DistributionParcelListEntity> list = distributionParcelListService.list(queryWrapper); // List<DistributionParcelListEntity> list = distributionParcelListService.list(queryWrapper);
List<DistrilbutionBillPackageEntity> list = distrilbutionBillPackageService.list(Wrappers.<DistrilbutionBillPackageEntity>query().lambda()
.eq(DistrilbutionBillPackageEntity::getBillLadingId,vo.getBillLadingId())
.apply("packet_bar_status in (1,3)")
);
int pn = list.size(); //包件数量 int pn = list.size(); //包件数量
planNum = planNum + pn; planNum = planNum + pn;
//通过订单id查询扫描表中有多少数据 //通过订单id查询扫描表中有多少数据
@ -1104,7 +1108,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
} }
//查询所有的包件列表并且附带状态 //查询所有的包件列表并且附带状态
List<DistrilbutionAppBillLadingDetailVO> details = baseMapper.selectDetailList(Long.parseLong(s), scanStatus, orderSelfNumbering); List<DistrilbutionAppBillLadingDetailVO> details = baseMapper.selectDetailList(Long.parseLong(s), scanStatus, orderSelfNumbering,billLadingId);
for (DistrilbutionAppBillLadingDetailVO detailVO : details) { for (DistrilbutionAppBillLadingDetailVO detailVO : details) {
Integer ss = detailVO.getScanStatus(); Integer ss = detailVO.getScanStatus();
Integer errorStatus = detailVO.getErrorStatus(); Integer errorStatus = detailVO.getErrorStatus();
@ -1126,7 +1130,11 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
queryWrapper.eq("stock_article_id", Long.parseLong(s)) queryWrapper.eq("stock_article_id", Long.parseLong(s))
.eq("is_deleted", 0); .eq("is_deleted", 0);
queryWrapper.isNotNull("order_package_code"); queryWrapper.isNotNull("order_package_code");
List<DistributionParcelListEntity> list = distributionParcelListService.list(queryWrapper); // List<DistributionParcelListEntity> list = distributionParcelListService.list(queryWrapper);
List<DistrilbutionBillPackageEntity> list = distrilbutionBillPackageService.list(Wrappers.<DistrilbutionBillPackageEntity>query().lambda()
.eq(DistrilbutionBillPackageEntity::getBillLadingId,billLadingId)
.apply("packet_bar_status in (1,3)")
);
int pn = list.size(); int pn = list.size();
planNum = planNum + pn; planNum = planNum + pn;
//通过订单id查询扫描表中有多少数据 //通过订单id查询扫描表中有多少数据

Loading…
Cancel
Save