Browse Source

Merge branch 'dev' into pre-production

master
pref_mail@163.com 10 months ago
parent
commit
4de57e024b
  1. 6
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.xml
  2. 79
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java

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

@ -353,6 +353,12 @@
<if test="param.mallName != null and param.mallName!=''">
and ldr.mall_name like concat('%',#{param.mallName},'%')
</if>
<if test="param.ids != null" >and lds.id in
<foreach collection="param.ids" separator="," close=")" open="(" item="a" >
#{a}
</foreach>
</if>
<if test="param.warehouseIdList != null and @org.apache.commons.collections4.CollectionUtils@isNotEmpty(param.warehouseIdList)">
and ldr.warehouse_id in
<foreach collection="param.warehouseIdList" item="item" open="(" close=")" separator=",">

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

@ -1750,21 +1750,72 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
if (ObjectUtils.isNotNull(o)) {
distributionSignfor.remove("ids");
}
BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse();
if (Func.isNotEmpty(myCurrentWarehouse)) {
distributionSignfor.put("warehouseId", myCurrentWarehouse.getId());
}
// BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse();
// if(ObjectUtils.isNull()){
// throw new ServiceException("请选择仓库!");
// }
// QueryWrapper<DistributionSignforEntity> queryWrapper = Condition.getQueryWrapper(distributionSignfor, DistributionSignforEntity.class);
// queryWrapper.lambda().eq(DistributionSignforEntity::getIsDeleted, BladeConstant.DB_NOT_DELETED);
// if(ObjectUtils.isNotNull(o)){
// queryWrapper.in("id",String.valueOf(o).split(","));
// }
// queryWrapper.eq("warehouse_id",myCurrentWarehouse.getId());
DistributionSignforVO distributionSignforVO = JSON.parseObject(JSON.toJSONString(distributionSignfor), DistributionSignforVO.class);
//获取当前登录人仓库
List<BasicdataWarehouseEntity> myWatchWarehouse = basicdataWarehouseClient.getMyWatchWarehouse();
//取出id
List<Long> collect = myWatchWarehouse.stream().map(BasicdataWarehouseEntity::getId).collect(Collectors.toList());
distributionSignforVO.setWarehouseIdList(collect);
List<DistributionSignforVO> distributionSignforVOS = baseMapper.selectDistributionSignforPage(null, distributionSignforVO);
distributionSignforVOS.forEach(d -> {
if (d.getDeliveryType().equals(DistributionTypeConstant.shipie.getValue())) {
d.setDeliveryTypeName(DistributionTypeConstant.shipie.getName());
} else if (d.getDeliveryType().equals(DistributionTypeConstant.shangpei.getValue())) {
d.setDeliveryTypeName(DistributionTypeConstant.shangpei.getName());
} else {
d.setDeliveryTypeName("");
}
List<DistributionParcelListEntity> distributionParcelListEntities = distributionReservationMapper.selectPackageListByReservationId(d.getReservationId());
//查询库存品信息
List<DisStockListDetailEntity> list = disStockListDetailService.list(Wrappers.<DisStockListDetailEntity>query().lambda()
.eq(DisStockListDetailEntity::getReservationId, d.getReservationId())
);
int weizhuangchejianshu = 0;
int weiqianshoujianshu = 0;
int zhuangchejianshu = 0;
int qianshoujianshu = 0;
if (Func.isNotEmpty(list) && list.size() > 0) {
zhuangchejianshu += list.stream().filter(f -> f.getStockLockingStatus().equals(InventoryLoadingStatusConstant.yizhuangche.getValue())).mapToInt(DisStockListDetailEntity::getNum).sum();
// weizhuangchejianshu += list.stream().filter(f -> f.getStockLockingStatus().equals(InventoryLoadingStatusConstant.weizhuangche.getValue())).mapToInt(DisStockListDetailEntity::getNum).sum();
qianshoujianshu += list.stream().filter(f -> f.getStockSignfoStatus().equals(InventorySigningStatusConstant.yiqianshou.getValue())).mapToInt(DisStockListDetailEntity::getNum).sum();
// weiqianshoujianshu += list.stream().filter(f -> f.getStockSignfoStatus().equals(InventorySigningStatusConstant.weiqianshou.getValue())).mapToInt(DisStockListDetailEntity::getNum).sum();
}
if (Func.isNotEmpty(distributionParcelListEntities)) {
weizhuangchejianshu += distributionParcelListEntities.stream().filter(f -> f.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.weizhuancghe.getValue())).mapToInt(DistributionParcelListEntity::getQuantity).sum();
zhuangchejianshu += distributionParcelListEntities.stream().filter(f -> f.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.yizhuangche.getValue())).mapToInt(DistributionParcelListEntity::getQuantity).sum();
weiqianshoujianshu += distributionParcelListEntities.stream().filter(f -> !f.getOrderPackageStatus().equals(OrderPackageStatusConstant.yiqianshou.getValue())).mapToInt(DistributionParcelListEntity::getQuantity).sum();
qianshoujianshu += distributionParcelListEntities.stream().filter(f -> f.getOrderPackageStatus().equals(OrderPackageStatusConstant.yiqianshou.getValue())).mapToInt(DistributionParcelListEntity::getQuantity).sum();
}
//该客户的异常装车件数
Integer abnormalLoading = distributionLoadscanMapper.selectAbnormalLoadingByReservationId(d.getReservationId());
//该客户的异常签收件数
Integer abnormalSigning = distributionLoadscanMapper.selectAbnormalSigningByReservationId(d.getReservationId());
// DistributionLoadingNumDTO reservationSigningNum = distributionReservationMapper.selectReservationSigningNum(d.getReservationId());
if (d.getDeliveryType().equals(DistributionTypeConstant.shipie.getValue())) {
List<DisStockListDetailEntity> disStockListDetailEntities = distributionReservationMapper.selectInventoryListByReservation(d.getReservationId());
if (Func.isNotEmpty(disStockListDetailEntities)) {
//查询库存品未装车数
int inventoryuweizhuancghe = disStockListDetailEntities.stream().filter(f -> f.getStockLockingStatus().equals(OrderPackageLoadingStatusConstant.weizhuancghe.getValue())).mapToInt(DisStockListDetailEntity::getNum).sum();
weizhuangchejianshu += inventoryuweizhuancghe;
//查询库存品为签收数
int inventoryweiqianshou = disStockListDetailEntities.stream().filter(f -> f.getStockSignfoStatus().equals(OrderPackageLoadingStatusConstant.weizhuancghe.getValue())).mapToInt(DisStockListDetailEntity::getNum).sum();
weiqianshoujianshu += inventoryweiqianshou;
}
}
//设置计划未装车数
d.setUnloadedNumber(weizhuangchejianshu);
d.setAbnormalLoadedNumber(abnormalLoading);
d.setLoadedNumber(zhuangchejianshu);
d.setUnreceivedQuantity(weiqianshoujianshu);
d.setReceivedQuantity(qianshoujianshu);
d.setAbnormalReceivedQuantity(abnormalSigning);
});
if (ObjectUtils.isNotNull(o)) {
String id = (String) o;
String[] split = id.split(",");

Loading…
Cancel
Save