From 896444c0bb4a57862ae556b2bb311eb10f5c83b8 Mon Sep 17 00:00:00 2001 From: "pref_mail@163.com" Date: Thu, 21 Mar 2024 01:04:28 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E4=BF=AE=E5=A4=8D=E5=BE=85=E7=AD=BE?= =?UTF-8?q?=E6=94=B6=E5=88=97=E8=A1=A8=E5=AF=BC=E5=87=BA=E6=89=80=E6=9C=89?= =?UTF-8?q?=E4=BB=93=E5=BA=93=E7=9A=84=E6=95=B0=E6=8D=AEbug-1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/DistributionSignforMapper.xml | 6 ++ .../impl/DistributionSignforServiceImpl.java | 79 +++++++++++++++---- 2 files changed, 71 insertions(+), 14 deletions(-) diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.xml index c8802a443..b2a2d98f4 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.xml @@ -353,6 +353,12 @@ and ldr.mall_name like concat('%',#{param.mallName},'%') + + and lds.id in + + #{a} + + and ldr.warehouse_id in diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java index e70d6c458..95556764e 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java @@ -1750,21 +1750,72 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl 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 myWatchWarehouse = basicdataWarehouseClient.getMyWatchWarehouse(); + //取出id + List collect = myWatchWarehouse.stream().map(BasicdataWarehouseEntity::getId).collect(Collectors.toList()); + distributionSignforVO.setWarehouseIdList(collect); + List 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 distributionParcelListEntities = distributionReservationMapper.selectPackageListByReservationId(d.getReservationId()); + //查询库存品信息 + List list = disStockListDetailService.list(Wrappers.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 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(",");