From 16128204068544c619582dabd4eb2c1a3f7962b9 Mon Sep 17 00:00:00 2001 From: PigBaoBei <2739175034@qq.com> Date: Mon, 1 Apr 2024 18:43:16 +0800 Subject: [PATCH] =?UTF-8?q?=E8=87=AA=E6=8F=90BUG=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E3=80=81=E5=B7=B2=E7=AD=BE=E8=AE=A2=E5=8D=95=E5=AE=8C=E5=96=84?= =?UTF-8?q?=E3=80=81=E8=87=AA=E6=8F=90=E7=AD=BE=E6=94=B6=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E3=80=81=E5=A4=87=E8=B4=A7=E5=BA=93=E5=AD=98=E5=93=81=E6=98=8E?= =?UTF-8?q?=E7=BB=86=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DistributionStockupInventoryDetailVO.java | 22 ++++++ ...DistrilbutionAppBillLadingOrderMainVO.java | 3 + .../DistributionBillLadingAppController.java | 4 +- .../DistributionStockupController.java | 10 +++ .../dto/DistributionStockArticleOweDTO.java | 1 + .../mapper/DistributionStockArticleMapper.xml | 10 ++- .../mapper/DistributionStockupMapper.java | 8 +++ .../mapper/DistributionStockupMapper.xml | 22 ++++++ .../mapper/DistrilbutionBillLadingMapper.java | 14 +++- .../mapper/DistrilbutionBillLadingMapper.xml | 39 ++++++++++- .../service/IDistributionStockupService.java | 8 +++ .../IDistrilbutionBillLadingService.java | 2 +- .../DistributionReservationServiceImpl.java | 1 + .../impl/DistributionStockupServiceImpl.java | 19 +++++ .../DistrilbutionBillLadingServiceImpl.java | 69 +++++++++++++++---- 15 files changed, 209 insertions(+), 23 deletions(-) create mode 100644 blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionStockupInventoryDetailVO.java diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionStockupInventoryDetailVO.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionStockupInventoryDetailVO.java new file mode 100644 index 000000000..0cf269a54 --- /dev/null +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionStockupInventoryDetailVO.java @@ -0,0 +1,22 @@ +package com.logpm.distribution.vo; + +import lombok.Data; + +import java.util.Date; + +/** + * + */ +@Data +public class DistributionStockupInventoryDetailVO { + + private Long id; //id + private String pickupBatch; //自提批次号 + private Date reservationTime; //明细创建时间 + private Date codeCreatedTime; //订单自编号 + private Date stockScanTime; //备货扫描时间 + private String descriptionGoods; //物料名称 + private String stockPackageCode; //包条码 + private String qrCode; //下架库位 + +} diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/DistrilbutionAppBillLadingOrderMainVO.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/DistrilbutionAppBillLadingOrderMainVO.java index b73e87ba8..76c8f9986 100644 --- a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/DistrilbutionAppBillLadingOrderMainVO.java +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/DistrilbutionAppBillLadingOrderMainVO.java @@ -16,6 +16,7 @@ */ package com.logpm.distribution.vo.app; +import com.logpm.distribution.vo.DistrilbutionBillLadingAppVO; import lombok.Data; import java.io.Serializable; @@ -39,5 +40,7 @@ public class DistrilbutionAppBillLadingOrderMainVO implements Serializable { private Integer signedNum;//签收总数 private List list = new ArrayList<>(); + private List inventoryList = new ArrayList<>(); + private List billLadingZeroOrderVOS = new ArrayList<>(); } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionBillLadingAppController.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionBillLadingAppController.java index ec7aadedd..90ff4ac32 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionBillLadingAppController.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionBillLadingAppController.java @@ -105,8 +105,8 @@ public class DistributionBillLadingAppController extends BladeController { @GetMapping("/getInventory") @ApiOperationSupport(order = 1) @ApiImplicitParam(name = "id",value ="自提单ID") - public R> getInventory(@ApiIgnore @RequestParam Map distrilbutionBillLading, Query query){ - IPage ladingAppVOIPage = distrilbutionBillLadingService.getInventory(Condition.getPage(query),distrilbutionBillLading); + public R getInventory(@ApiIgnore @RequestParam Map distrilbutionBillLading){ + DistrilbutionAppBillLadingOrderMainVO ladingAppVOIPage = distrilbutionBillLadingService.getInventory(distrilbutionBillLading); return R.data(ladingAppVOIPage); } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockupController.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockupController.java index e124a2a36..b8aa51926 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockupController.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockupController.java @@ -100,6 +100,16 @@ public class DistributionStockupController extends BladeController { return R.data(detail); } + /** + * 备货信息表 提货 详情 + */ + @GetMapping("/detailOwnSelfInventoryDetail") + @ApiOperation(value = "自提库存品备货详情", notes = "传入distributionStockup") + public R detailOwnSelfInventoryDetail(@RequestParam Long billLadingId,@RequestParam Long stockListId ) { + R r = distributionStockupService.detailOwnSelfInventoryDetail(billLadingId,stockListId); + return r; + } + diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistributionStockArticleOweDTO.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistributionStockArticleOweDTO.java index e496dd7da..344e2c74b 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistributionStockArticleOweDTO.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistributionStockArticleOweDTO.java @@ -27,6 +27,7 @@ public class DistributionStockArticleOweDTO extends DistributionStockArticleEnti private String driverName; private String examineUserNames; private String reservationInfo; + private String earliestWarehouseEntryTime; private String ids; private List idsList; private String idsLike; diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.xml index f09140be1..0a3a2d76f 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.xml @@ -1158,7 +1158,7 @@ GROUP_CONCAT(DISTINCT IFNULL( m.driverName,'')) AS driverName, GROUP_CONCAT(DISTINCT IFNULL( m.vehicleName,'')) AS vehicleName, GROUP_CONCAT(DISTINCT IFNULL( m.examine_user_name,'')) AS examineUserNames, - (SELECT MIN(create_time) FROM logpm_distribution_parcel_list WHERE stock_article_id = ldsa.id) AS earliestWarehouseEntryTime + k.earliestWarehouseEntryTime AS earliestWarehouseEntryTime FROM logpm_distribution_stock_article AS ldsa LEFT JOIN ( @@ -1198,13 +1198,14 @@ logpm_distribution_signfor As lds ON lds.reservation_id = ldr.id LEFT JOIN logpm_distribution_delivery_list AS lddl ON lds.delivery_id = lddl.id ) AS m ON ldsa.id = m.stock_article_id AND t.reservation_id = m.reservation_id + LEFT JOIN ( SELECT stock_article_id, min( create_time ) AS earliestWarehouseEntryTime FROM logpm_distribution_parcel_list) AS k ON k.stock_article_id = ldsa.id ldsa.order_status in ('70','80') AND ldsa.waybill_number like concat("%",#{param.waybillNumber},"%") - AND ldsa.service_umber like concat("%",#{param.serviceNumber},"%") + AND ldsa.service_number like concat("%",#{param.serviceNumber},"%") AND ldsa.order_code like concat("%",#{param.orderCode},"%") @@ -1213,7 +1214,7 @@ AND ldsa.warehouse like concat("%",#{param.warehouseName},"%") - AND ldsa.mall_mame like concat("%",#{param.mallName},"%") + AND ldsa.mall_name like concat("%",#{param.mallName},"%") AND ldsa.brand like concat("%",#{param.brand},"%") @@ -1270,6 +1271,9 @@ and DATE(m.signing_time) = #{param.signinTime} + and DATE(k.earliestWarehouseEntryTime) = + #{param.earliestWarehouseEntryTime} + diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupMapper.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupMapper.java index f529a23f2..2d4115baa 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupMapper.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupMapper.java @@ -270,4 +270,12 @@ public interface DistributionStockupMapper extends BaseMapper selectInventoryDetailByBillLadingIdAndStockListId(@Param("billLadingId") Long billLadingId,@Param("stockListId") Long stockListId); } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupMapper.xml index 971747011..c13e38725 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupMapper.xml @@ -1253,5 +1253,27 @@ END num FROM logpm_distribution_stockup WHERE id = #{stockUpId} + diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.java index cddea5d78..60f87d051 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.java @@ -19,6 +19,7 @@ package com.logpm.distribution.mapper; import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.logpm.distribution.dto.DistributionDeliveryDetailsDTO; import com.logpm.distribution.dto.DistrilbutionBillLadingDTO; import com.logpm.distribution.dto.app.BillLadingAppDTO; @@ -29,6 +30,7 @@ import com.logpm.distribution.entity.DistrilbutionBillLadingEntity; import com.logpm.distribution.excel.DistrilbutionBillLadingExcel; import com.logpm.distribution.vo.*; import com.logpm.distribution.vo.app.DistrilbutionAppBillLadingDetailVO; +import com.logpm.distribution.vo.app.DistrilbutionAppBillLadingOrderMainVO; import org.apache.ibatis.annotations.Param; import java.util.List; @@ -85,7 +87,7 @@ public interface DistrilbutionBillLadingMapper extends BaseMapper getInventory(IPage page,@Param("param") DistrilbutionBillLadingEntity distrilbutionBillLadingEntity); + List getInventory(@Param("param") DistrilbutionBillLadingEntity distrilbutionBillLadingEntity); DistrilbutionBillLadingVO getBillLadingNum(@Param("param") DistrilbutionBillLadingDTO billLadingEntity); @@ -141,4 +143,14 @@ public interface DistrilbutionBillLadingMapper extends BaseMapper getCompleteNum(@Param("billLadingId")Long billLadingId); + + + Page getInventoryPage(IPage page,@Param("param") DistrilbutionBillLadingEntity distrilbutionBillLadingEntity); + +// Page getInventoryPage(IPage page, DistrilbutionBillLadingEntity distrilbutionBillLadingEntity); + } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.xml index 11d87c9a2..dd690c438 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.xml @@ -458,7 +458,7 @@ dsa.warehouse, dsa.warehouse_entry_time warehouseEntryTime, dsa.storage_fee storageFee, - COUNT(ldbp.id) totalNumber, + (COUNT(ldbp.id) + IFNULL((SELECT sum(quantity) FROM logpm_distribution_delivery_details WHERE bill_lading_id = dbl.id),0)) totalNumber, COUNT(lds.id) handQuantity, GROUP_CONCAT(DISTINCT lds.goods_name) productInformation, dbl.certificate_type certificateType, @@ -511,6 +511,43 @@ SELECT IF((SELECT sum(packet_number) FROM logpm_distrilbution_bill_package WHERE bill_lading_id = #{billLadingId} AND packet_bar_status != 2) IS NULL,0,(SELECT sum(packet_number) FROM logpm_distrilbution_bill_package WHERE bill_lading_id = #{billLadingId} AND packet_bar_status != 2)) + + + diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockupService.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockupService.java index 5be9b48f0..4483bff64 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockupService.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockupService.java @@ -292,4 +292,12 @@ public interface IDistributionStockupService extends BaseService getInventory(IPage page, Map distrilbutionBillLading); + DistrilbutionAppBillLadingOrderMainVO getInventory( Map distrilbutionBillLading); /** * pda扫描操作 diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java index 4c105c829..a51bcc1d2 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java @@ -2736,6 +2736,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl selectDistributionStockupPage(IPage page, DistributionStockupVO distributionStockup) { return page.setRecords(baseMapper.selectDistributionStockupPage(page, distributionStockup)); @@ -3341,4 +3343,21 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl detailVOS = baseMapper.selectInventoryDetailByBillLadingIdAndStockListId(billLadingId,stockListId); + return R.data(detailVOS); + } } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillLadingServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillLadingServiceImpl.java index 7498368d4..95f26f4d0 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillLadingServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillLadingServiceImpl.java @@ -1282,6 +1282,13 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl qw = new QueryWrapper<>(); + qw.eq("bill_lading_id", vo.getBillLadingId()); + List ls = distributionBillLadingScanService.list(qw); + if (!ls.isEmpty()) { + int sum = ls.stream().mapToInt(DistributionBillLadingScanEntity::getQuantity).sum(); + signedNum = signedNum + sum; + } for (String s : split) { @@ -1302,14 +1309,18 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl qw = new QueryWrapper<>(); - qw.eq("stock_article_id", Long.parseLong(s)) - .eq("is_deleted", 0); - List ls = distributionBillLadingScanService.list(qw); - if (!ls.isEmpty()) { - int sum = ls.stream().mapToInt(DistributionBillLadingScanEntity::getQuantity).sum(); - signedNum = signedNum + sum; - } +// QueryWrapper qw = new QueryWrapper<>(); +// qw.eq("stock_article_id", Long.parseLong(s)) +// .eq("is_deleted", 0); +// List ls = distributionBillLadingScanService.list(qw); +// QueryWrapper qw = new QueryWrapper<>(); +// qw.eq("bill_lading_id", Long.parseLong(s)) +// .eq("is_deleted", 0); +// List ls = distributionBillLadingScanService.list(qw); +// if (!ls.isEmpty()) { +// int sum = ls.stream().mapToInt(DistributionBillLadingScanEntity::getQuantity).sum(); +// signedNum = signedNum + sum; +// } } //查询库存品的件数量 @@ -1724,15 +1735,32 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl getInventory(IPage page, Map distrilbutionBillLading) { + public DistrilbutionAppBillLadingOrderMainVO getInventory( Map distrilbutionBillLading) { + String method = "##################DistributionBillLadingServiceImpl.getInventory"; + if (Func.isEmpty(distrilbutionBillLading.get("id"))){ + log.error(method+"自提Id缺失"); + return null; + } + String id = (String) distrilbutionBillLading.get("id"); + DistrilbutionAppBillLadingOrderMainVO mainVO =baseMapper.getBillLadingOrderMainVO(Long.parseLong(id)); + //查询订单数量, + //查询齐套数 + //查询字体件数 + //查询签收件数 + //查询库存品数 +// 查询签收完成订单数 + List num = baseMapper.getCompleteNum(Long.parseLong(id)); + if (Func.isNotEmpty(num)){ + int size = num.stream().filter(f -> f.equals(true)).collect(Collectors.toList()).size(); + mainVO.setCompleteNum(size); + } DistrilbutionBillLadingEntity distrilbutionBillLadingEntity = JSONObject.parseObject(JSONObject.toJSONString(distrilbutionBillLading), DistrilbutionBillLadingEntity.class); - IPage inventory = baseMapper.getInventory(page, distrilbutionBillLadingEntity); - inventory.getRecords().forEach(i -> { + List inventory = baseMapper.getInventory(distrilbutionBillLadingEntity); + inventory.forEach(i -> { List listed = disStockListDetailService.list(Wrappers.query().lambda() .eq(DisStockListDetailEntity::getReservationId, i.getId()) .eq(DisStockListDetailEntity::getStockListId, i.getStockListId()) @@ -1765,7 +1793,8 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl getInventoryNum(IPage page, Map distrilbutionBillLading) { DistrilbutionBillLadingEntity distrilbutionBillLadingEntity = JSONObject.parseObject(JSONObject.toJSONString(distrilbutionBillLading), DistrilbutionBillLadingEntity.class); - IPage inventory = baseMapper.getInventory(page, distrilbutionBillLadingEntity); +// List inventory = baseMapper.getInventory(distrilbutionBillLadingEntity); + Page inventory = baseMapper.getInventoryPage(page,distrilbutionBillLadingEntity); inventory.getRecords().forEach(i -> { if (i.getQuantity().equals(i.getDeliveryNum())) { //已备货 @@ -2534,6 +2564,14 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl completeNum = baseMapper.getCompleteNum(billLadingAppDTO.getBillLadingId()); + if (Func.isNotEmpty(completeNum)){ + int size = completeNum.stream().filter(f -> f.equals(true)).collect(Collectors.toList()).size(); + billLadingOrderMainVO.setCompleteNum(size); + }else { + billLadingOrderMainVO.setCompleteNum(0); + } //查询订单 List list = distributionZeroPackageService.list(Wrappers.query().lambda() .eq(DistributionReservationZeroPackageEntity::getReservationId, billLadingAppDTO.getBillLadingId()) @@ -2563,8 +2601,9 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl