Browse Source

修改自提备货查询数据

training
caoyizhong 1 year ago
parent
commit
b0e497b6e6
  1. 1
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionStockupAppController.java
  2. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupMapper.xml
  3. 5
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillStockMapper.xml
  4. 61
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAsyncServiceImpl.java
  5. 1
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java

1
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionStockupAppController.java

@ -579,6 +579,7 @@ public class DistributionStockupAppController extends BladeController {
// entity.setStockupArea(stockupArea);
entity.setStockupId(stockupId);
entity.setParcelListId(one.getId());
entity.setStockQuantity(1);
if (distributionStockupEntity.getTypeService().equals("3")) {
entity.setBillLadingId(reservationId);
DistributionStockupEntity byId = distributionStockupService.getById(stockupId);

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

@ -484,7 +484,7 @@
where parcel_list_id in (
select ldpl.id
from logpm_distrilbution_bill_stock ldbs
LEFT JOIN logpm_distribution_parcel_list ldpl on ldpl.stock_article_id = ldbs.stock_article_id
LEFT JOIN logpm_distribution_parcel_list ldpl on ldpl.stock_article_id = ldbs.stock_article_id and ldpl.order_package_code is not null
where ldbs.bill_lading_id = ldsi.reservation_id
) and bill_lading_id = ldsi.reservation_id
) scanNum

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

@ -97,9 +97,10 @@
) trays,ldbs.stock_article_id stockArticleId,ldpl.id parcelListId,lds.allocation_id allocationId
from logpm_distribution_stockup_info ldsi
LEFT JOIN logpm_distrilbution_bill_stock ldbs on ldsi.reservation_id = ldbs.bill_lading_id
LEFT JOIN logpm_distribution_parcel_list ldpl on ldpl.stock_article_id = ldbs.stock_article_id and ldpl.order_package_grounding_status = 10
LEFT JOIN logpm_distribution_stock_article ldsa on ldsa.id = ldbs.stock_article_id and ldsa.is_zero = '0'
LEFT JOIN logpm_distribution_parcel_list ldpl on ldpl.stock_article_id = ldsa.id and ldpl.order_package_grounding_status = 10
LEFT JOIN logpm_distribution_stock lds on ldpl.id = lds.parcel_list_id
where ldsi.stockup_id = #{stockupId} and ldsi.reservation_id = #{reservationId}
where ldsi.stockup_id = #{stockupId} and ldsi.reservation_id = #{reservationId} and ldsa.is_zero = '0'
</select>
<select id="exportDistrilbutionBillStock" resultType="com.logpm.distribution.excel.DistrilbutionBillStockExcel">

61
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAsyncServiceImpl.java

@ -1300,34 +1300,73 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
@Override
public void stockupSelfUpdateState(StockupDTO stockupDTO) {
//查询全部订单数据
List<DistrilbutionBillStockEntity> distrilbutionBillStockEntities = distrilbutionBillStockMapper.selectList(Wrappers.<DistrilbutionBillStockEntity>query().lambda()
.eq(DistrilbutionBillStockEntity::getBillLadingId, stockupDTO.getReservationId())
.apply("order_status in (1,2)")
);
//查询是否有零担信息
List<DistributionReservationZeroPackageEntity> listZero = reservationZeroPackageService.list(Wrappers.<DistributionReservationZeroPackageEntity>query().lambda()
.eq(DistributionReservationZeroPackageEntity::getReservationId, stockupDTO.getReservationId())
.eq(DistributionReservationZeroPackageEntity::getIsDeleted, 0)
.in(DistributionReservationZeroPackageEntity::getZeroPackageStatus, "1", "3")
);
// AtomicReference<Boolean> z = new AtomicReference<>(false);
// AtomicReference<Integer> zeroNum = new AtomicReference<>(0); //零担已备货的数量
AtomicReference<Integer> zeroYuNum = new AtomicReference<>(0); //零担预约的数量
if(!listZero.isEmpty()){
int sum = listZero.stream().mapToInt(DistributionReservationZeroPackageEntity::getQuantity).sum();
zeroYuNum.set(sum);
//有
// listZero.forEach( i ->{
// List<DistributionStockEntity> stockEntityList = distributionStockService.selectList(Wrappers.<DistributionStockEntity>query().lambda()
// .eq(DistributionStockEntity::getStockupId, stockupDTO.getStockupId())
// .eq(DistributionStockEntity::getStockArticle, i.getStockArticleId())
// .eq(DistributionStockEntity::getConditions, "2")
// .eq(DistributionStockEntity::getBillLadingId, stockupDTO.getReservationId())
// );
// if(!stockEntityList.isEmpty()){
// //没有备货
// int sum = stockEntityList.stream().mapToInt(DistributionStockEntity::getStockQuantity).sum();
// zeroNum.set(zeroNum.get() + sum);
// }
// zeroYuNum.set(zeroYuNum.get()+i.getQuantity());
// });
// z.set(true);
}
//查询包件数据
AtomicReference<Integer> nu = new AtomicReference<>(0); //全部包件数据
distrilbutionBillStockEntities.forEach(i -> {
List<DistributionParcelListEntity> distributionParcelListEntities = distributionParcelListMapper.selectList(Wrappers.<DistributionParcelListEntity>query().lambda()
.eq(DistributionParcelListEntity::getStockArticleId, i.getStockArticleId())
);
int size = distributionParcelListEntities.size();
nu.set(nu.get() + size);
});
//查询订单的非零担数据
List<DistributionStockPackageVO> distributionStockPackageVOS = distrilbutionBillStockService.listPackageSelf(stockupDTO.getReservationId());
//计算全部预约件数
if(!distributionStockPackageVOS.isEmpty()){
nu.set(distributionStockPackageVOS.size() + zeroYuNum.get());
}else{
nu.set(zeroYuNum.get());
}
// distrilbutionBillStockEntities.forEach(i -> {
//
// distrilbutionBillStockService.listPackageSelf(stockupDTO.getReservationId());
//
// List<DistributionParcelListEntity> distributionParcelListEntities = distributionParcelListMapper.selectList(Wrappers.<DistributionParcelListEntity>query().lambda()
// .eq(DistributionParcelListEntity::getStockArticleId, i.getStockArticleId())
// );
// int size = distributionParcelListEntities.size();
// nu.set(nu.get() + size);
// });
//以备数量
List<DistributionStockEntity> list = distributionStockService.selectList(Wrappers.<DistributionStockEntity>query().lambda()
.eq(DistributionStockEntity::getBillLadingId, stockupDTO.getReservationId())
);
int sum1 = list.stream().mapToInt(DistributionStockEntity::getStockQuantity).sum(); // 库存品的备货数量
//查询库存品数据
List<DistributionDeliveryDetailsEntity> detailsEntities = distributionDeliveryDetailsMapper.selectList(Wrappers.<DistributionDeliveryDetailsEntity>query().lambda()
.eq(DistributionDeliveryDetailsEntity::getBillLadingId, stockupDTO.getReservationId())
.apply("inventory_status in (1,2)")
);
int sum = detailsEntities.stream().mapToInt(DistributionDeliveryDetailsEntity::getQuantity).sum();
int i = (sum + nu.get()) - (list.size() + 1);
int sum = detailsEntities.stream().mapToInt(DistributionDeliveryDetailsEntity::getQuantity).sum(); //库存品数据
int i = (sum + nu.get()) - (sum1 + 1);
/* detailsEntities.forEach( r -> {
if(r.getConditions().equals("1") && Objects.equals(r.getQuantity(), r.getRealityQuantity())){
//修改当前备货状态已完成

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

@ -1851,6 +1851,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
}
/**
*查询备货信息
* @param reservationId
* @param isZero
*/

Loading…
Cancel
Save