Browse Source

Merge remote-tracking branch 'origin/dev' into dev

training
caoyizhong 1 year ago
parent
commit
d1bee153ce
  1. 4
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataGoodsAllocationMapper.xml
  2. 7
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.java
  3. 12
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml
  4. 1
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml
  5. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.xml
  6. 20
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java
  7. 51
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java

4
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataGoodsAllocationMapper.xml

@ -136,8 +136,8 @@
<select id="selectAllocationInfo" resultType="com.logpm.basicdata.vo.WarehouseAllocationInfoVO">
SELECT
lwga.id as allocationCode,
CONCAT(lwga1.headline,'-',lwgs.goods_shelf_name,'-',lwga.goods_allocation_name) as allocationName,
lwga.qr_code as allocationCode,
CONCAT(lwgs.goods_shelf_name,'-',lwga.goods_allocation_name) as allocationName,
lww.`name` as warehouseName,
lwga1.headline as areaName
from logpm_warehouse_goods_allocation lwga

7
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.java

@ -395,4 +395,11 @@ public interface DistributionDeliveryListMapper extends BaseMapper<DistributionD
* @return
*/
List<DistributionReservationStockarticleEntity> selectReservationStockByDeliveryId(@Param("delivaryListId") Long id);
/**
*
* @param deliveryId
* @return
*/
List<DistributionReservationStockarticleEntity> getReservationStockArticleByDeliveryId(@Param("delivaryListId") Long deliveryId);
}

12
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml

@ -1552,5 +1552,17 @@
INNER JOIN logpm_distribution_reservation_stockarticle As ldrs ON ldrs.reservation_id = ldr.id
WHERE lddl.id = #{delivaryListId}
</select>
<select id="getReservationStockArticleByDeliveryId"
resultType="com.logpm.distribution.entity.DistributionReservationStockarticleEntity">
SELECT
ldrs.*
FROM
logpm_distribution_delivery_list AS lddl
INNER JOIN logpm_distribution_signfor AS lds ON lds.delivery_id = lddl.id
INNER JOIN logpm_distribution_reservation AS ldr ON lds.reservation_id = ldr.id
INNER JOIN logpm_distribution_reservation_stockarticle AS ldrs ON ldrs.reservation_id = ldr.id
where
lddl.id = #{delivaryListId}
</select>
</mapper>

1
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml

@ -576,6 +576,7 @@
logpm_distribution_reservation_package AS ldrp
INNER JOIN logpm_distribution_parcel_list AS ldpl ON ldrp.parce_list_id = ldpl.id
<where>
ldrp.packet_bar_status in ('1','3')
<if test="reservationId !=null and reservationId!= ''">
and ldrp.reservation_id = #{reservationId}
</if>

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

@ -565,7 +565,7 @@
ldrs.reservation_num reservationNum,
ldrs.stock_article_id stockArticleId,
(SELECT COALESCE(COUNT(*), 0) from logpm_distribution_loadscan ldl WHERE ldl.order_id =ldsa.id and ldl.scan_status !=1 and ldl.signfor_state =2) signforNub,
(SELECT COALESCE(COUNT(*), 0) from logpm_distribution_loadscan ldl WHERE ldl.order_id =ldsa.id and ldl.scan_status !=1 ) loadingNub
(SELECT COALESCE(COUNT(*), 0) from logpm_distribution_loadscan ldl WHERE ldl.order_id =ldsa.id and ldl.scan_status !=1 and ldl.reservation_id = ldr.id) loadingNub
FROM
logpm_distribution_reservation ldr
join logpm_distribution_reservation_stockarticle ldrs on ldr.id = ldrs.reservation_id

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

@ -3245,6 +3245,12 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
log.error("配送任务订单查询异常:{}", deliveryStockArticleInfo);
return null;
}
List<DistributionReservationStockarticleEntity> reservationStockarticleEntityList = baseMapper.getReservationStockArticleByDeliveryId(distributionDeliveryInfoDTO.getDeliveryId());
if (Func.isEmpty(reservationStockarticleEntityList)) {
log.error("配送任务订单查询异常:{}", reservationStockarticleEntityList);
return null;
}
List<DistributionLoadscanEntity> loadscanEntities = distributionLoadscanMapper.selectList(Wrappers.<DistributionLoadscanEntity>query().lambda()
.eq(DistributionLoadscanEntity::getDeliveryId, distributionDeliveryInfoDTO.getDeliveryId())
.ne(DistributionLoadscanEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue()));
@ -3253,9 +3259,9 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
loadingDataMap = loadscanEntities.stream().collect(Collectors.toMap(DistributionLoadscanEntity::getPackageId, Function.identity(), (k1, k2) -> k2));
}
ArrayList<DistributionParcelListVO> distributionParcelListVOS = new ArrayList<>();
for (DistributionStockArticleVO distributionStockArticleVO : deliveryStockArticleInfo) {
if (distributionStockArticleVO.getIsZero().equals(IsOrNoConstant.no.getValue())) {
List<DistributionParcelListEntity> parcelListEntityList = baseMapper.getPackageListByDeliveryId(distributionDeliveryInfoDTO.getDeliveryId(), distributionStockArticleVO.getId());
for (DistributionReservationStockarticleEntity reservationStockarticleEntity : reservationStockarticleEntityList) {
if (reservationStockarticleEntity.getIsZero().equals(IsOrNoConstant.no.getValue())) {
List<DistributionParcelListEntity> parcelListEntityList = distributionReservationMapper.getReservationPackage(reservationStockarticleEntity.getReservationId(), reservationStockarticleEntity.getStockArticleId());
List<DistributionParcelListVO> parcelListVOList = DistributionParcelListWrapper.build().listVO(parcelListEntityList);
for (DistributionParcelListVO distributionParcelListVO : parcelListVOList) {
if (Func.isNotEmpty(loadingDataMap)) {
@ -3277,9 +3283,9 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
}
distributionParcelListVOS.add(distributionParcelListVO);
}
} else if (distributionStockArticleVO.getIsZero().equals(IsOrNoConstant.yes.getValue())) {
List<DistributionParcelListEntity> parcelListEntityList = baseMapper.getPackageListByDeliveryId(distributionDeliveryInfoDTO.getDeliveryId(), distributionStockArticleVO.getId());
List<DistributionParcelListEntity> zeroParcelListEntityList = baseMapper.getZeroPackageListByDeliveryId(distributionDeliveryInfoDTO.getDeliveryId(), distributionStockArticleVO.getId());
} else if (reservationStockarticleEntity.getIsZero().equals(IsOrNoConstant.yes.getValue())) {
List<DistributionParcelListEntity> parcelListEntityList = distributionReservationMapper.getReservationPackage(reservationStockarticleEntity.getReservationId(), reservationStockarticleEntity.getStockArticleId());
List<DistributionParcelListEntity> zeroParcelListEntityList = baseMapper.getZeroPackageListByDeliveryId(distributionDeliveryInfoDTO.getDeliveryId(), reservationStockarticleEntity.getStockArticleId());
List<DistributionParcelListVO> zeroParcelListVOList = DistributionParcelListWrapper.build().listVO(zeroParcelListEntityList);
for (DistributionParcelListVO parcelListVO : zeroParcelListVOList) {
if (Func.isNotEmpty(loadingDataMap)) {
@ -3302,7 +3308,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
distributionParcelListVOS.add(parcelListVO);
}
} else {
log.error("###########订单数据isZero字段值错误,订单Id为:{}", distributionStockArticleVO.getId());
log.error("###########订单数据isZero字段值错误,订单Id为:{}", reservationStockarticleEntity.getId());
}
}

51
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java

@ -2666,21 +2666,24 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
.ne(DistributionParcelListEntity::getOrderPackageReservationStatus,OrderPackageReservationStatusConstant.yiyueyue.getValue())
.notIn(DistributionParcelListEntity::getOrderPackageStatus,new String[]{OrderPackageStatusConstant.yichuku.getValue(),OrderPackageStatusConstant.yiqianshou.getValue()}));
distributionParcelListEntities.forEach(p -> {
if (!Func.equals(p.getOrderPackageFreezeStatus(), OrderPackageFreezeStatusConstant.yidongjie.getValue()) && !Func.equals(p.getOrderPackageFreezeStatus(), OrderPackageReservationStatusConstant.yiyueyue.getValue())) {
DistributionReservationPackageEntity distributionReservationPackageEntity = new DistributionReservationPackageEntity();
distributionReservationPackageEntity.setReservationId(reservationId);
distributionReservationPackageEntity.setParceListId(p.getId());
distributionReservationPackageEntity.setStockArticleId(s.getId());
distributionReservationPackageEntity.setPacketBarCode(p.getOrderPackageCode());
//维护订单下包件信息
distributionReservationPackageService.save(distributionReservationPackageEntity);
//此时订单下的所有包件都处于预约状态,可用数为0
packageNum.getAndAdd(p.getQuantity());
//修改订单下的包件状态
if (p.getOrderPackageStatus().equals(OrderPackageStatusConstant.yiqianshou.getValue())){
if (!Func.equals(p.getOrderPackageFreezeStatus(), OrderPackageFreezeStatusConstant.yidongjie.getValue()) && !Func.equals(p.getOrderPackageReservationStatus(), OrderPackageReservationStatusConstant.yiyueyue.getValue())) {
DistributionReservationPackageEntity distributionReservationPackageEntity = new DistributionReservationPackageEntity();
distributionReservationPackageEntity.setReservationId(reservationId);
distributionReservationPackageEntity.setParceListId(p.getId());
distributionReservationPackageEntity.setStockArticleId(s.getId());
distributionReservationPackageEntity.setPacketBarCode(p.getOrderPackageCode());
//维护订单下包件信息
distributionReservationPackageService.save(distributionReservationPackageEntity);
//此时订单下的所有包件都处于预约状态,可用数为0
packageNum.getAndAdd(p.getQuantity());
//修改订单下的包件状态
// p.setOrderPackageReservationStatus();
p.setOrderPackageReservationStatus(OrderPackageReservationStatusConstant.yiyueyue.getValue());
distributionParcelListService.updateById(p);
p.setOrderPackageReservationStatus(OrderPackageReservationStatusConstant.yiyueyue.getValue());
distributionParcelListService.updateById(p);
}
}
// stockArticleEntity.setReservationStatus(OrderReservationStatusConstant.yiyueyue.getValue());
});
s.setReservationStatus(OrderReservationStatusConstant.yiyueyue.getValue());
@ -2688,16 +2691,20 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
} else {
//维护选中的包件信息
packageList.forEach(p -> {
DistributionReservationPackageEntity distributionReservationPackageEntity = new DistributionReservationPackageEntity();
distributionReservationPackageEntity.setReservationId(reservationId);
distributionReservationPackageEntity.setParceListId(p.getId());
distributionReservationPackageEntity.setStockArticleId(s.getId());
distributionReservationPackageEntity.setPacketBarCode(p.getOrderPackageCode());
distributionReservationPackageService.save(distributionReservationPackageEntity);
packageNum.getAndAdd(p.getQuantity());
p.setOrderPackageReservationStatus(OrderPackageReservationStatusConstant.yiyueyue.getValue());
if (!p.getOrderPackageStatus().equals(OrderPackageStatusConstant.yiqianshou.getValue())){
if (!Func.equals(p.getOrderPackageFreezeStatus(), OrderPackageFreezeStatusConstant.yidongjie.getValue()) && !Func.equals(p.getOrderPackageReservationStatus(), OrderPackageReservationStatusConstant.yiyueyue.getValue())){
DistributionReservationPackageEntity distributionReservationPackageEntity = new DistributionReservationPackageEntity();
distributionReservationPackageEntity.setReservationId(reservationId);
distributionReservationPackageEntity.setParceListId(p.getId());
distributionReservationPackageEntity.setStockArticleId(s.getId());
distributionReservationPackageEntity.setPacketBarCode(p.getOrderPackageCode());
distributionReservationPackageService.save(distributionReservationPackageEntity);
packageNum.getAndAdd(p.getQuantity());
p.setOrderPackageReservationStatus(OrderPackageReservationStatusConstant.yiyueyue.getValue());
// p.setBrandId(p.getBrandId());
distributionParcelListService.updateById(p);
distributionParcelListService.updateById(p);
}
}
});
// s.setReservationStatus(ServiceConstant.ORDER_RESERVATION_STATE_PART);
//设置订单可用数量为

Loading…
Cancel
Save