Browse Source

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

visual
zhenghaoyu 3 months ago
parent
commit
e2f2ba4f0f
  1. 79
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionParcelListServiceImpl.java

79
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionParcelListServiceImpl.java

@ -28,8 +28,10 @@ import com.google.zxing.WriterException;
import com.logpm.basic.entity.BasicMaterialEntity;
import com.logpm.basic.feign.IBasicMaterialClient;
import com.logpm.basicdata.entity.BasicdataClientEntity;
import com.logpm.basicdata.entity.BasicdataGoodsAllocationEntity;
import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
import com.logpm.basicdata.feign.IBasicdataClientClient;
import com.logpm.basicdata.feign.IBasicdataGoodsAllocationClient;
import com.logpm.basicdata.feign.IBasicdataWarehouseClient;
import com.logpm.distribution.dto.DistributionParcelListDTO;
import com.logpm.distribution.dto.app.StockupDTO;
@ -60,14 +62,14 @@ import com.logpm.distribution.vo.PackageStockupVO;
import com.logpm.distribution.service.*;
import com.logpm.distribution.vo.*;
import com.logpm.trunkline.feign.ITrunklinePackageTrackLogClient;
import com.logpm.warehouse.entity.WarehouseConfigEntity;
import com.logpm.warehouse.entity.WarehouseUpdownGoodsEntity;
import com.logpm.warehouse.entity.WarehouseWaybillEntity;
import com.logpm.warehouse.feign.IWarehouseTrayGoodsClient;
import com.logpm.warehouse.feign.IWarehouseUpdownGoodsClient;
import com.logpm.warehouse.feign.IWarehouseWaybillClient;
import com.logpm.warehouse.feign.*;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.constant.DictBizConstant;
import org.springblade.common.constant.WorkNodeEnums;
import org.springblade.common.constant.common.IsOrNoConstant;
import org.springblade.common.constant.order.OrderStockupStatusConstant;
import org.springblade.common.constant.orderpackage.OrderPackageLoadingStatusConstant;
import org.springblade.common.constant.orderpackage.OrderPackageReservationStatusConstant;
@ -126,6 +128,9 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
private IBasicdataWarehouseClient basicdataWarehouseClient;
@Autowired
private IWarehouseUpdownGoodsClient warehouseUpdownGoodsClient;
@Autowired
private IWarehouseUpdownTypeClient warehouseUpdownTypeClient;
@Autowired
private IWarehouseTrayGoodsClient warehouseTrayGoodsClient;
@Autowired
@ -163,6 +168,11 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
private IUserClient userClient;
@Autowired
private ITrunklinePackageTrackLogClient trunklinePackageTrackLogClient;
@Autowired
private IWarehouseConfigClient warehouseConfigClient;
@Autowired
private IBasicdataGoodsAllocationClient allocationClient;
// private final IDistributionStockArticleService distributionStockArticleService;
@Override
@ -511,6 +521,26 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
if (ObjectUtils.isNull(myCurrentWarehouse)) {
throw new ServiceException("请选择仓库!");
}
WarehouseConfigEntity warehouseConfig = warehouseConfigClient.getWarehouseConfig(myCurrentWarehouse.getId());
BasicdataGoodsAllocationEntity defaultGoodsAllocation;
Integer isAutoWarehouse;
if (!Objects.isNull(warehouseConfig)){
if (!Objects.isNull(warehouseConfig.getIsAutoWarehouse())){
//查询备货库位
isAutoWarehouse = warehouseConfig.getIsAutoWarehouse() != null ? warehouseConfig.getIsAutoWarehouse() : 0;
if (isAutoWarehouse == Integer.parseInt(IsOrNoConstant.yes.getValue())){
defaultGoodsAllocation = allocationClient.findDefaultGoodsAllocation(myCurrentWarehouse.getId());
} else {
defaultGoodsAllocation = null;
}
} else {
defaultGoodsAllocation = null;
isAutoWarehouse = 0;
}
} else {
defaultGoodsAllocation = null;
isAutoWarehouse = 0;
}
QueryWrapper<DistributionParcelListEntity> queryWrapper = new QueryWrapper<>();
String s = String.valueOf(o);
if (s.contains(",")) {
@ -541,33 +571,6 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
int sum = v.stream().mapToInt(DistributionParcelListEntity::getQuantity).sum();
List<Long> packageIds = new ArrayList<>();
v.forEach(i -> {
//查询有没有打托数据
// //查询包件有没有物料
// List<DistributionParcelDetailsEntity> list = distributionParcelDetailsService.list(Wrappers.<DistributionParcelDetailsEntity>query().lambda()
// .eq(DistributionParcelDetailsEntity::getParcelListId, i.getId())
// );
// if (!list.isEmpty()) {
// //有
// list.stream().collect(Collectors.groupingBy(DistributionParcelDetailsEntity::getEncoded))
// .forEach((kk, vv) -> {
// DistributionParcelListEntity parcelListEntity = new DistributionParcelListEntity();
// BeanUtil.copyProperties(vv.get(0), parcelListEntity);
// parcelListEntity.setQuantity(sum);
// parcelListEntity.setMaterialName(vv.get(0).getName());
// parcelListEntity.setMaterialCode(vv.get(0).getEncoded());
// parcelListEntity.setMaterialUnit(vv.get(0).getUnit());
// // 添加库存品信息
// //查询在库订单信息
// DistributionStockArticleEntity distributionStockArticleEntity = distributionStockArticleMapper.selectById(parcelListEntity.getStockArticleId());
// if (ObjectUtil.isEmpty(distributionStockArticleEntity.getMallId())) {
// throw new ServiceException("订单的客户数据异常,无法转换!!");
// }
// addStockList(distributionStockArticleEntity, parcelListEntity, 1);
// });
// }
DistributionParcelListEntity parcelListEntity = new DistributionParcelListEntity();
BeanUtil.copyProperties(i, parcelListEntity);
@ -594,6 +597,11 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
String content = "包件在"+myCurrentWarehouse.getName()+"由"+AuthUtil.getNickName()+"转库存品,"+"批次号:"+i.getOrderCode()+"物料名称:"+i.getMaterialName()+"物料编码:"+i.getMaterialCode();
JSONObject js = handleLogJSONObject(myCurrentWarehouse, AuthUtil.getUser(), i.getOrderPackageCode(), content, WorkNodeEnums.STOCK_TRANSFER.getCode());
aaa.add(js);
//查询当前仓是否存在有自动入库的配置
if (isAutoWarehouse == Integer.parseInt(IsOrNoConstant.yes.getValue()) && !Objects.isNull(defaultGoodsAllocation)){
//进行此包件的默认上架
warehouseUpdownTypeClient.upShelfPackage( i.getOrderPackageCode(),defaultGoodsAllocation.getId(),myCurrentWarehouse.getId(),"自动上架");
}
});
DistributionParcelListEntity parcelListEntity = new DistributionParcelListEntity();
BeanUtil.copyProperties(v.get(0), parcelListEntity);
@ -631,22 +639,11 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleMapper.selectById(oo); //修改
stockArticleEntity.setId(oo);
stockArticleEntity.setGenre(2);
// stockArticleEntity.setTotalNumber(stockArticleEntity.getTotalNumber() - list1.size());
stockArticleEntity.setHandQuantity(0);
distributionStockArticleMapper.updateById(stockArticleEntity);
} else {
DistributionStockArticleEntity distributionStockArticleEntity = distributionStockArticleMapper.selectById(oo);
distributionStockArticleEntity.setHandQuantity(distributionStockArticleEntity.getHandQuantity() - list1.size());
// distributionStockArticleEntity.setTotalNumber(distributionStockArticleEntity.getTotalNumber() - list1.size());
//统计订单在库数量
// List<DistributionParcelListEntity> parcelListEntities = this.list(Wrappers.<DistributionParcelListEntity>query().lambda()
// .eq(DistributionParcelListEntity::getStockArticleId, oo)
// .eq(DistributionParcelListEntity::getWarehouseId, myCurrentWarehouse.getId())
// );
// int sum = parcelListEntities.stream().filter(p -> "1".equals(p.getConditions())).mapToInt(DistributionParcelListEntity::getQuantity).sum();
// distributionStockArticleEntity.setHandQuantity(sum);
// distributionStockArticleEntity.setIncomingNum(sum);
distributionStockArticleMapper.updateById(distributionStockArticleEntity);
}
});

Loading…
Cancel
Save