Browse Source

拆包修改包件出库状态

fix-sign
汤建军 4 months ago
parent
commit
fa7d54a619
  1. 1
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml
  2. 30
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockListServiceImpl.java

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

@ -357,6 +357,7 @@
AND ldpl.conditions = 2
AND ldpl.warehouse_id = #{warehouseId}
AND ldsa.mall_name = #{mallName}
AND ldpl.order_package_loading_status = '10'
GROUP BY
ldpl.material_code
) AS t1 ON t.cargo_number = t1.material_code

30
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockListServiceImpl.java

@ -64,6 +64,8 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.logging.log4j.util.Strings;
import org.springblade.common.constant.DictBizConstant;
import org.springblade.common.constant.WorkNodeEnums;
import org.springblade.common.constant.orderpackage.OrderPackageLoadingStatusConstant;
import org.springblade.common.constant.orderpackage.OrderPackageStatusConstant;
import org.springblade.common.constant.orderpackage.OrderPackageStockupStatusConstant;
import org.springblade.common.constant.printTemplate.PrintTemplateStatusConstant;
import org.springblade.common.exception.CustomerException;
@ -567,7 +569,33 @@ public class DistributionStockListServiceImpl extends BaseServiceImpl<Distributi
one.setUnpackingQuantity(one.getUnpackingQuantity() + distributionStockListDTO.getUnpackingQuantity());
one.setUnpack(true);
one.setOutboundQuantity(one.getOutboundQuantity() + distributionStockListDTO.getUnpackingQuantity());
int num = one.getQuantityStock() - distributionStockListDTO.getUnpackingQuantity();
if (one.getSourceType().equals("1")){
List<DistributionParcelListEntity> parcelListEntities = distributionParcelListService.list(Wrappers.<DistributionParcelListEntity>query().lambda()
.eq(DistributionParcelListEntity::getWarehouseId, one.getWarehouseId())
.eq(DistributionParcelListEntity::getOrderCode, one.getIncomingBatch())
.eq(DistributionParcelListEntity::getConditions, 2)
.eq(DistributionParcelListEntity::getIsTransfer, 0)
.orderByDesc(DistributionParcelListEntity::getCreateTime)
);
if (!parcelListEntities.isEmpty()){
if (num>parcelListEntities.size()){
log.error("库存品包件数量不足拆包");
}else {
List<DistributionParcelListEntity> updateData = new ArrayList<>();
for (int i = 0; i < num; i++) {
DistributionParcelListEntity parcelListEntity = new DistributionParcelListEntity();
parcelListEntity.setId(parcelListEntities.get(i).getId());
parcelListEntity.setOrderPackageLoadingStatus(OrderPackageLoadingStatusConstant.yizhuangche.getValue());
parcelListEntity.setOrderPackageStatus(OrderPackageStatusConstant.yichuku.getValue());
updateData.add(parcelListEntity);
}
if (!updateData.isEmpty()) {
distributionParcelListService.updateBatchById(updateData);
}
}
}
}
this.updateById(one);
BladeUser user = AuthUtil.getUser();

Loading…
Cancel
Save