diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/DistributionAppDetailVO.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/DistributionAppDetailVO.java index 8d10644c3..50c8fb47b 100644 --- a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/DistributionAppDetailVO.java +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/DistributionAppDetailVO.java @@ -57,7 +57,7 @@ public class DistributionAppDetailVO implements Serializable { private String typeName; - private List customList; + private List customList; private List distributionAppStockArticleVOS; diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/ReservationAppDetailVO.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/DistributionAppNewDeliveryListVO.java similarity index 67% rename from blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/ReservationAppDetailVO.java rename to blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/DistributionAppNewDeliveryListVO.java index 041d010f6..61c8d5f48 100644 --- a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/ReservationAppDetailVO.java +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/DistributionAppNewDeliveryListVO.java @@ -16,11 +16,9 @@ */ package com.logpm.distribution.vo.app; -import com.logpm.distribution.vo.DisStockListDetailVO; import lombok.Data; import java.io.Serializable; -import java.util.List; /** * 配送管理 App视图实体类 @@ -29,30 +27,41 @@ import java.util.List; * @since 2023-06-16 */ @Data -public class ReservationAppDetailVO implements Serializable { +public class DistributionAppNewDeliveryListVO implements Serializable { private static final long serialVersionUID = 1L; - private Long id; + private Long id ; - private String consignee; + private String trainNumber; + + private String vehicleName; + + private String driverName; + + private String deliveryStatusName; - private String isLoad; + private String typeName; + + private String isStartName; + + private String consignee; - private String isStock; + private String stockupArea; - private Integer loadingNub; + private String taskTime; - private Integer orderNum; + private Integer customersNumber; - private Integer planNum; + private Integer orderNumber; + private Integer deliveryNumber; - private List disStockListDetailVOS ; + private Integer inventoryNub; - private List distributionAppZeroStockArticleVOS ; + private Integer scannedNumber; + private Integer signforNumber; - private List distributionAppStockArticleVOS ; diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/DistributionAppNewReservationVO.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/DistributionAppNewReservationVO.java new file mode 100644 index 000000000..ac5b9717e --- /dev/null +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/DistributionAppNewReservationVO.java @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package com.logpm.distribution.vo.app; + +import com.logpm.distribution.entity.DisStockListDetailEntity; +import com.logpm.distribution.entity.DistributionReservationEntity; +import com.logpm.distribution.vo.DisStockListDetailVO; +import com.logpm.distribution.vo.DistributionParcelListVO; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * 预约列表 App视图实体类 + * + * @author TJJ + * @since 2023-06-12 + */ +@Data +public class DistributionAppNewReservationVO implements Serializable { + private static final long serialVersionUID = 1L; + + private Long id; + private String consignee; + private String phone; + private String address; + private String remarks; + private String stockupArea; + private String isStock; + private Integer planNumber; + private Integer orderNumber; + private Integer trayNumber; + private Integer loadingQuantity; + private Integer signforQuantity; + + + private List orderList = new ArrayList<>(); + private List zeroOrderList = new ArrayList<>(); + private List inventoryList = new ArrayList<>(); + + +} diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/api/DistributionDeliveryAppController.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/api/DistributionDeliveryAppController.java index 947068e07..15debdea5 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/api/DistributionDeliveryAppController.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/api/DistributionDeliveryAppController.java @@ -60,8 +60,8 @@ public class DistributionDeliveryAppController { @GetMapping("/newPage") @ApiOperationSupport(order = 1) @ApiOperation(value = "列表", notes = "DistributionAppDeliveryListDTO") - public R newPage(DistributionAppDeliveryListDTO distributionDeliveryList, Query query) { - R r= distributionDeliveryListService.selectDistributionAppDeliveryListNewPage(Condition.getPage(query), distributionDeliveryList); + public R newPage(DistributionAppDeliveryListDTO distributionDeliveryList) { + R r= distributionDeliveryListService.selectDistributionAppDeliveryListNewPage(distributionDeliveryList); return r; } @@ -94,7 +94,7 @@ public class DistributionDeliveryAppController { @ApiOperationSupport(order = 3) @ApiOperation(value = "详情", notes = "传入DistributionDeliveryListDTO") public R newDetail(DistributionAppDeliveryListDTO distributionDeliveryList) { - R r= distributionDeliveryListService.getNewAppDeliveryreservationListPage(distributionDeliveryList); + R r= distributionDeliveryListService.getNewAppDeliveryreservationList(distributionDeliveryList); return r; } @@ -147,10 +147,10 @@ public class DistributionDeliveryAppController { /** * 配送 查看订单 */ - @GetMapping("/newOrder") + @GetMapping("/newCustomDetail") @ApiOperationSupport(order = 4) @ApiOperation(value = "查看订单", notes = "DistributionAppDeliveryListDTO") - public R newOrder(DistributionAppDeliveryListDTO distributionAppDeliveryListDTO) { + public R newCustomDetail(DistributionAppDeliveryListDTO distributionAppDeliveryListDTO) { R r= distributionDeliveryInfoService.selectDistributionNewAppDeliveryorder(distributionAppDeliveryListDTO); return r; } @@ -308,9 +308,6 @@ public class DistributionDeliveryAppController { @ApiOperationSupport(order = 7) @ApiOperation(value = "取消发车", notes = "传入DistrilbutionloadingscanDTO") public R cancelStart(@Valid @RequestBody DistrilbutionloadingscanDTO distrilbutionloadingscanDTO) { - if (null == distrilbutionloadingscanDTO.getDeliveryId() || null == distrilbutionloadingscanDTO.getLoadingId()){ - return R.fail("参数不全"); - } return distributionDeliveryListService.cancelStart(distrilbutionloadingscanDTO); } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/api/DistributionSignforAppController.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/api/DistributionSignforAppController.java index 25c6af670..e23ca8d36 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/api/DistributionSignforAppController.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/api/DistributionSignforAppController.java @@ -64,6 +64,17 @@ public class DistributionSignforAppController { return R.data(pages); } + /** + * 签收管理 列表 + */ + @GetMapping("/newPage") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "列表", notes = "DistributionAppDeliveryListDTO") + public R newPage(DistributionAppDeliveryListDTO distributionDeliveryList) { + R r = distributionSignforService.selectDistributionNewAppDeliveryListPage(distributionDeliveryList); + return r; + } + /** * 签收管理 客户列表 */ @@ -75,6 +86,17 @@ public class DistributionSignforAppController { return R.data(pages); } + /** + * 签收管理 客户列表 + */ + @GetMapping("/newCustom") + @ApiOperationSupport(order = 5) + @ApiOperation(value = "列表", notes = "DistributionAppDeliveryListDTO") + public R newCustom(DistributionAppDeliveryListDTO distributionDeliveryList) { + R r = distributionSignforService.selectNewAppDeliveryCustom(distributionDeliveryList); + return r; + } + /** * 签收管理 订单列表 @@ -87,6 +109,17 @@ public class DistributionSignforAppController { return R.data(pages); } + /** + * 签收管理 客户列表 + */ + @GetMapping("/newCustomDetail") + @ApiOperationSupport(order = 5) + @ApiOperation(value = "列表", notes = "DistributionAppDeliveryListDTO") + public R newCustomDetail(DistributionAppDeliveryListDTO distributionAppDeliveryListDTO) { + R r = distributionSignforService.selectNewAppDeliveryCustomDetail(distributionAppDeliveryListDTO); + return r; + } + /** * 签收 客户查看库存品 */ diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryInfoMapper.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryInfoMapper.java index 26ca41c10..e3e2dd869 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryInfoMapper.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryInfoMapper.java @@ -27,9 +27,9 @@ import com.logpm.distribution.excel.DistributionDeliveryInfoExcel; import com.logpm.distribution.vo.DistributionDeliveryInfoVO; import com.logpm.distribution.vo.DistributionStockArticleVO; import com.logpm.distribution.vo.DistributionStockListVO; +import com.logpm.distribution.vo.app.DistributionAppNewReservationVO; import com.logpm.distribution.vo.app.DistributionAppReservationVO; import com.logpm.distribution.vo.app.DistributionAppStockArticleVO; -import com.logpm.distribution.vo.app.ReservationAppDetailVO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -189,11 +189,12 @@ public interface DistributionDeliveryInfoMapper extends BaseMapper selectNewAppcustomListPage(@Param("deliveryId")Long id); + List selectNewAppcustomList(@Param("deliveryId")Long id); /** - * 查询PDA客户装车详情 + * 查询单个客户详情 * @param reservationId + * @return */ - ReservationAppDetailVO selectAppReservationDistributionDetail(@Param("reservationId")Long reservationId); + DistributionAppNewReservationVO selectNewAppcustom(@Param("reservationId")Long reservationId); } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryInfoMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryInfoMapper.xml index cdc91314d..93e012001 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryInfoMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryInfoMapper.xml @@ -909,12 +909,15 @@ FROM lds.is_deleted = 0 and lds.delivery_id = #{id} and ldr.reservation_status != 40 AND (ldr.reservation_num + ldr.reservation_stock_list_num) > 0 - SELECT ldr.id id, GROUP_CONCAT( DISTINCT CONCAT( ldr.receiving_unit, '(', ldr.consignee ), ')' ) AS consignee, - COALESCE ( ldr.reservation_num + ldr.reservation_stock_list_num, 0 ) reservationNum, + ldr.delivery_phone AS phone, + ldr.delivery_address AS address, + ldr.remarks AS remarks, + COALESCE ( ldr.reservation_num + ldr.reservation_stock_list_num, 0 ) planNumber, ( SELECT COALESCE ( COUNT( 1 ), 0 ) @@ -923,84 +926,65 @@ FROM WHERE ldrs.reservation_id = ldr.id AND ldrs.stock_article_status IN ( 1, 3 ) - ) ordNub, - IFNULL(( SELECT SUM( loaded_nub ) FROM logpm_distribution_loadscan WHERE reservation_id = lds.reservation_id AND is_deleted = 0 AND scan_status != 1 ), 0 ) + IFNULL(( SELECT SUM( loaded_nub ) FROM logpm_distribution_loadscaninvn WHERE reservation_id = lds.reservation_id AND scan_status != 1 AND is_deleted = 0 ), 0 ) AS loadingNub, + ) orderNumber, + IFNULL(( SELECT SUM( loaded_nub ) FROM logpm_distribution_loadscan WHERE reservation_id = lds.reservation_id AND is_deleted = 0 AND scan_status != 1 ), 0 ) + IFNULL(( SELECT SUM( loaded_nub ) FROM logpm_distribution_loadscaninvn WHERE reservation_id = lds.reservation_id AND scan_status != 1 AND is_deleted = 0 ), 0 ) AS loadingQuantity, + IFNULL(( SELECT SUM( loaded_nub ) FROM logpm_distribution_loadscan WHERE reservation_id = lds.reservation_id AND is_deleted = 0 AND scan_status != 1 AND signfor_state = 2), 0 ) + IFNULL(( SELECT SUM( loaded_nub ) FROM logpm_distribution_loadscaninvn WHERE reservation_id = lds.reservation_id AND scan_status != 1 AND is_deleted = 0 AND signfor_state = 2 ), 0 ) AS signforQuantity, ( SELECT IFNULL( GROUP_CONCAT( stockup_area ), '无备货区' ) FROM logpm_distribution_stock WHERE reservation_id = ldr.id AND is_deleted = 0 ) AS stockupArea, IF (( ldr.reservation_num + ldr.reservation_stock_list_num - ) = IFNULL(( - SELECT - SUM( loaded_nub ) - FROM - logpm_distribution_loadscan - WHERE - reservation_id = lds.reservation_id - AND is_deleted = 0 - AND scan_status != 1 - AND is_abnormal_loading = 1 - ), - 0 - ) + IFNULL(( SELECT SUM( loaded_nub ) FROM logpm_distribution_loadscaninvn WHERE reservation_id = lds.reservation_id AND scan_status != 1 AND is_deleted = 0 ), 0 ), - '是', - '否' - ) AS Isload, - IF - (( - ldr.reservation_num + ldr.reservation_stock_list_num ) = (SELECT IFNULL(SUM(stock_quantity),0) FROM logpm_distribution_stock WHERE reservation_id = ldr.id), '是', '否' - ) AS Isstock + ) AS isStock FROM logpm_distribution_signfor AS lds LEFT JOIN logpm_distribution_reservation AS ldr ON lds.reservation_id = ldr.id WHERE - lds.delivery_id = #{deliveryId} + lds.delivery_id =#{deliveryId} + AND lds.is_deleted = 0 + AND ldr.is_deleted = 0 AND ldr.id IS NOT NULL - AND ldr.reservation_num + ldr.reservation_stock_list_num > 0 AND ldr.reservation_status != '40' GROUP BY ldr.id - SELECT - id, - CONCAT(ldr.receiving_unit,'(',ldr.consignee,')') AS consignee, - IF - (( - ldr.reservation_num + ldr.reservation_stock_list_num - ) = IFNULL(( - SELECT - SUM( loaded_nub ) + ldr.id id, + GROUP_CONCAT( DISTINCT CONCAT( ldr.receiving_unit, '(', ldr.consignee ), ')' ) AS consignee, + ldr.delivery_phone AS phone, + ldr.delivery_address AS address, + ldr.remarks AS remarks, + COALESCE ( ldr.reservation_num + ldr.reservation_stock_list_num, 0 ) planNumber, + ( + SELECT COALESCE + ( COUNT( 1 ), 0 ) FROM - logpm_distribution_loadscan + logpm_distribution_reservation_stockarticle ldrs WHERE - reservation_id = ldr.id - AND is_deleted = 0 - AND scan_status != 1 - AND is_abnormal_loading = 1 - ), - 0 - ) + IFNULL(( SELECT SUM( loaded_nub ) FROM logpm_distribution_loadscaninvn WHERE reservation_id = ldr.id AND scan_status != 1 AND is_deleted = 0 ), 0 ), - '是', - '否' - ) AS isLoad, + ldrs.reservation_id = ldr.id + AND ldrs.stock_article_status IN ( 1, 3 ) + ) orderNumber, + IFNULL(( SELECT SUM( loaded_nub ) FROM logpm_distribution_loadscan WHERE reservation_id = lds.reservation_id AND is_deleted = 0 AND scan_status != 1 ), 0 ) + IFNULL(( SELECT SUM( loaded_nub ) FROM logpm_distribution_loadscaninvn WHERE reservation_id = lds.reservation_id AND scan_status != 1 AND is_deleted = 0 ), 0 ) AS loadingQuantity, + IFNULL(( SELECT SUM( loaded_nub ) FROM logpm_distribution_loadscan WHERE reservation_id = lds.reservation_id AND is_deleted = 0 AND scan_status != 1 AND signfor_state = 2), 0 ) + IFNULL(( SELECT SUM( loaded_nub ) FROM logpm_distribution_loadscaninvn WHERE reservation_id = lds.reservation_id AND scan_status != 1 AND is_deleted = 0 AND signfor_state = 2 ), 0 ) AS signforQuantity, + ( SELECT IFNULL( GROUP_CONCAT( stockup_area ), '无备货区' ) FROM logpm_distribution_stock WHERE reservation_id = ldr.id AND is_deleted = 0 ) AS stockupArea, IF (( ldr.reservation_num + ldr.reservation_stock_list_num ) = (SELECT IFNULL(SUM(stock_quantity),0) FROM logpm_distribution_stock WHERE reservation_id = ldr.id), '是', '否' - ) AS isStock, - IFNULL(( SELECT SUM( loaded_nub ) FROM logpm_distribution_loadscan WHERE reservation_id = ldr.id AND is_deleted = 0 AND scan_status != 1 ), 0 ) + IFNULL(( SELECT SUM( loaded_nub ) FROM logpm_distribution_loadscaninvn WHERE reservation_id = ldr.id AND scan_status != 1 AND is_deleted = 0 ), 0 ) AS loadingNub, - (ldr.reservation_num + ldr.reservation_stock_list_num) AS planNum, - IFNULL((SELECT COUNT(1) FROM logpm_distribution_reservation_stockarticle WHERE reservation_id = ldr.id AND is_deleted = 0 AND stock_article_status != 2),0 ) AS orderNum + ) AS isStock FROM - logpm_distribution_reservation AS ldr + logpm_distribution_signfor AS lds + LEFT JOIN logpm_distribution_reservation AS ldr ON lds.reservation_id = ldr.id WHERE - ldr.id =#{reservationId} AND ldr.reservation_status != 40 AND ldr.is_deleted = 0 + ldr.id = #{reservationId} + AND lds.is_deleted = 0 + AND ldr.is_deleted = 0 + AND ldr.id IS NOT NULL + AND ldr.reservation_status != '40' diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.java index 0289096a9..48493d45d 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.java @@ -26,10 +26,7 @@ import com.logpm.distribution.dto.app.DistributionAppDeliveryListDTO; import com.logpm.distribution.entity.*; import com.logpm.distribution.excel.DistributionDeliveryListExcel; import com.logpm.distribution.vo.*; -import com.logpm.distribution.vo.app.DistributionAppDeliveryListVO; -import com.logpm.distribution.vo.app.DistributionAppDetailVO; -import com.logpm.distribution.vo.app.DistributionAppParcelListVO; -import com.logpm.distribution.vo.app.DistributionAppStockArticleVO; +import com.logpm.distribution.vo.app.*; import com.logpm.oldproject.dto.SignPushDataDTO; import org.apache.ibatis.annotations.Param; import org.springblade.common.model.PackageData; @@ -507,7 +504,7 @@ public interface DistributionDeliveryListMapper extends BaseMapper selectDistributionNewAppDeliveryListPage(@Param("param")DistributionAppDeliveryListDTO distributionDeliveryList,@Param("deliveryIds") List deliveryIds); + List selectDistributionNewAppDeliveryListPage(@Param("param")DistributionAppDeliveryListDTO distributionDeliveryList, @Param("deliveryIds") List deliveryIds); /** @@ -598,6 +595,6 @@ public interface DistributionDeliveryListMapper extends BaseMapper selectDeliveyId(DistributionAppDeliveryListDTO distributionDeliveryList); + List selectDeliveyId(@Param("param") DistributionAppDeliveryListDTO distributionDeliveryList); } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml index 799d9842f..5dd510863 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml @@ -2256,19 +2256,9 @@ SELECT DISTINCT lddl.id id, lddl.train_number trainNumber, - ldds.departure_time departureTime, - lddl.type type, - lddl.kind kind, lddl.vehicle_name vehicleName, lddl.driver_name driverName, - lddl.vehicle_id vehicleId, - lddl.driver_id driverId, - lddl.delivery_status deliveryStatus, - lddl.preparation_time preparationTime, - lddl.create_time createTime, lddl.customers_number customersNumber, - lddl.price price, - lddl.added_services_id addedServicesId, ( SELECT COALESCE ( COUNT(*), 0 ) @@ -2291,24 +2281,6 @@ lds.delivery_id = lddl.id AND ldr.reservation_status != '40' ) deliveryNumber, - lddl.loading_team_id loadingTeamId, - ( - SELECT - GROUP_CONCAT( DISTINCT ldsu.loader_name SEPARATOR ',' ) - FROM - logpm_distribution_signfor lds - INNER JOIN logpm_distribution_stockup_info AS ldsi ON lds.reservation_id = ldsi.reservation_id - INNER JOIN logpm_distribution_stockup AS ldsu ON ldsu.id = ldsi.stockup_id - WHERE - lds.delivery_id = lddl.id - ) loadingTeamName, - lddl.lead_time leadTime, - lddl.order_id orderId, - lddl.fee fee, - lddl.loading_time loadingTime, - lddl.note_number noteNumber, - lddl.source source, - lddl.task_time taskTime, ( SELECT COALESCE ( sum( ldr.reservation_stock_list_num ), 0 ) @@ -2354,13 +2326,20 @@ WHEN '2' THEN '配送中' ELSE '已完成' - END deliStatusName, + END deliveryStatusName, CASE lddl.type WHEN '1' THEN '商配' ELSE '市配' END typeName, - lddl.is_start + CASE lddl.is_start + WHEN '10' THEN '待发车' + WHEN '20' THEN '部分发车' + WHEN '30' THEN '已发车' + ELSE + '未知' + END isStartName, + lddl.task_time AS taskTime FROM logpm_distribution_delivery_list lddl LEFT JOIN logpm_distribution_delivery_self ldds ON lddl.id = ldds.delivery_id @@ -2697,8 +2676,7 @@ FROM logpm_distribution_delivery_list AS lddl WHERE - ldds.is_deleted = 0 - AND lddl.is_deleted = 0 + lddl.is_deleted = 0 AND lddl.train_number LIKE CONCAT('%', #{param.trainNumber}, '%') diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.java index d9500b3f7..7a6ec346e 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.java @@ -25,9 +25,7 @@ import com.logpm.distribution.dto.app.DistributionAppDeliveryListDTO; import com.logpm.distribution.entity.DistributionParcelListEntity; import com.logpm.distribution.entity.DistributionReservationEntity; import com.logpm.distribution.entity.DistributionSignforEntity; -import com.logpm.distribution.excel.DistributionSignforExcel; import com.logpm.distribution.excel.DistributionSignforInventoryExcel; -import com.logpm.distribution.excel.DistributionSignforOwnExcel; import com.logpm.distribution.vo.*; import com.logpm.distribution.vo.app.*; import com.logpm.oldproject.dto.SignPushDataUnitDTO; @@ -418,4 +416,47 @@ public interface DistributionSignforMapper extends BaseMapper getWaybillSignforData(@Param("reservationId")Long reservationId,@Param("userId")Long userId,@Param("userName")String userName); + + /** + * 查询PDA签收信息 + * @param distributionDeliveryList + * @param deliveryIds + * @return + */ + List selectDistributionNewAppDeliveryListPage(@Param("param")DistributionAppDeliveryListDTO distributionDeliveryList, @Param("deliveryIds") List deliveryIds); + + /** + * 查询 + * @param distributionDeliveryList + * @return + */ + List selectDeliveyId(@Param("param") DistributionAppDeliveryListDTO distributionDeliveryList); + + /** + * 查询签收PDA详情 + * @param id + * @return + */ + DistributionAppDetailVO selectNewAppDistributionDetail(@Param("deliveryId")Long id); + + /** + * 查询配送车次下客户信息 + * @param id + * @return + */ + List selectNewAppCustomList(@Param("deliveryId")Long id); + + /** + * 查询配送客户详情 + * @param id + * @return + */ + DistributionAppNewReservationVO selectNewAppCustom(@Param("reservationId")Long reservationId); + + /** + * 查询签收库存盘包件 + * @param reservationId + * @return + */ + List selectAppDeliveryInventoryPackage(@Param("reservationId")Long reservationId); } 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 262c1636d..058a7bfbc 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 @@ -901,7 +901,8 @@ LEFT JOIN logpm_basicdata_material lbm ON ldsl.material_id = lbm.id ldsld.is_deleted = 0 - AND ldsld.reservation_id = #{param.reservationId} + AND ldsld.reservation_id = #{reservationId} + AND ldsld.stock_package_status != 2 + + + + + + + diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryListService.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryListService.java index f52724ded..9d3723a7b 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryListService.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryListService.java @@ -141,7 +141,10 @@ public interface IDistributionDeliveryListService extends BaseService page, DistributionAppDeliveryListDTO distributionDeliveryList); + R selectDistributionAppDeliveryListNewPage(DistributionAppDeliveryListDTO distributionDeliveryList); + + Boolean judgeIsDriver(BladeUser user); + /** * App-配送管理 详情 */ @@ -502,7 +505,7 @@ public interface IDistributionDeliveryListService extends BaseService page, DistributionAppDeliveryListDTO distributionDeliveryList) { + public R selectDistributionAppDeliveryListNewPage(DistributionAppDeliveryListDTO distributionDeliveryList) { String method = "######################################DistributionDeliveryListServiceImpl.selectDistributionAppDeliveryListNewPage"; - List distributionAppDeliveryListVOS = new ArrayList<>(); + List distributionAppNewDeliveryListVOS = new ArrayList<>(); //参数校验 if (Objects.isNull(distributionDeliveryList.getType())) { @@ -2262,37 +2262,25 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl deliveryIds = distributionDeliverySelfMapper.selectNewDeliveryList(distributionDeliveryList); if (!deliveryIds.isEmpty()) { - distributionAppDeliveryListVOS = baseMapper.selectDistributionNewAppDeliveryListPage(distributionDeliveryList, deliveryIds); + distributionAppNewDeliveryListVOS = baseMapper.selectDistributionNewAppDeliveryListPage(distributionDeliveryList, deliveryIds); } else { return R.data(null); } } else { //查询当前时间范围内的配送ID List deliveryIds = baseMapper.selectDeliveyId(distributionDeliveryList); - distributionAppDeliveryListVOS = baseMapper.selectDistributionNewAppDeliveryListPage(distributionDeliveryList, deliveryIds); - } - -// for (DistributionAppDeliveryListVO distributionAppDeliveryListVO : distributionAppDeliveryListVOS) { -// //查询是否备货 -// distributionAppDeliveryListVO.setIsstock("备货未完成"); -// List stockEntityList = distributionStockMapper.selectList(new QueryWrapper().lambda() -// .eq(DistributionStockEntity::getReservationId, distributionAppDeliveryListVO.getReservationId())); -// if (Func.isNotEmpty(stockEntityList)) { -// //配送件数 -// Integer deliveryNumber = distributionAppDeliveryListVO.getDeliveryNumber(); -// int sum = stockEntityList.stream().mapToInt(DistributionStockEntity::getStockQuantity).sum(); -// if (sum == deliveryNumber) { -// distributionAppDeliveryListVO.setIsstock("备货完成"); -// } -// } -// } + if (!deliveryIds.isEmpty()) { + distributionAppNewDeliveryListVOS = baseMapper.selectDistributionNewAppDeliveryListPage(distributionDeliveryList, deliveryIds); + } + } } catch (Exception e) { throw new ServiceException(String.valueOf(e)); } - return R.data(distributionAppDeliveryListVOS); + return R.data(distributionAppNewDeliveryListVOS); } - private Boolean judgeIsDriver(BladeUser user) { + @Override + public Boolean judgeIsDriver(BladeUser user) { boolean delivery = false; String roleId = user.getRoleId(); String value1 = DictBizCache.getValue("role_class", "delivery_driver_new"); @@ -7983,7 +7971,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl customList = distributionDeliveryInfoMapper.selectNewAppcustomListPage(distributionDeliveryList.getId()); - for (DistributionAppReservationVO distributionAppReservationVO : customList) { + List customList = distributionDeliveryInfoMapper.selectNewAppcustomList(distributionDeliveryList.getId()); + for (DistributionAppNewReservationVO distributionAppReservationVO : customList) { int trayNum = 0; if (!Objects.isNull(myCurrentWarehouse)) { -// List trayList = new ArrayList<>(); //查询满足条件的托盘码 List distributionParcelListEntities = distributionReservationMapper.selectPackageListByReservationId(distributionAppReservationVO.getId()); if (Func.isNotEmpty(distributionParcelListEntities)) { @@ -8527,7 +8514,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl packageLockIds = new ArrayList<>(); List orderCodes = new ArrayList<>(); List pushList = new ArrayList<>(); + List pushInventoryList = new ArrayList<>(); //配置项 boolean isConfig = false; DistributionDeliverySelfEntity distributionDeliverySelfEntity = new DistributionDeliverySelfDTO(); @@ -7554,7 +7561,6 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl entityList = loadingMap.get(parcelNumberDTO.getParcelListId()); @@ -7579,11 +7585,11 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl detailEntities = distributionReservationMapper.selectInventoryListByReservation(distrilbutionloadingscanDTO.getReservationId()); if (detailEntities.isEmpty()) { @@ -7705,7 +7712,8 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl inventoryPakcgaeList = detailEntities.stream().filter(f -> barcode.equals(f.getStockPackageCode())).collect(Collectors.toList()); + String finalBarcode = distrilbutionloadingscanDTO.getBarcode(); + List inventoryPakcgaeList = detailEntities.stream().filter(f -> finalBarcode.equals(f.getStockPackageCode())).collect(Collectors.toList()); if (!inventoryPakcgaeList.isEmpty()) { if (inventoryPakcgaeList.size() == 1) { DisStockListDetailEntity disStockListDetailEntity = inventoryPakcgaeList.get(0); @@ -7714,15 +7722,96 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl jsonObjects = new ArrayList<>(); + JSONObject jsonObject = new JSONObject(); + jsonObject.put("code", distributionLoadscaninvnEntity.getOrderPackageCode()); + jsonObject.put("warehouseId", myCurrentWarehouse.getId()); + jsonObject.put("taskId", distributionLoadscaninvnEntity.getReservationId()); + jsonObject.put("type", 2); + jsonObject.put("num", 1); + jsonObject.put("remark", "签收下架"); + jsonObjects.add(jsonObject); + warehouseUpdownStockUpAreaClient.downStockUpShelf(jsonObjects); + } + //进行库存品包件状态维护 + disStockListDetailEntity.setStockLockingStatus(InventoryLoadingStatusConstant.yizhuangche.getValue()); + disStockListDetailEntity.setStockSignfoStatus(InventorySigningStatusConstant.yiqianshou.getValue()); + disStockListDetailService.updateById(disStockListDetailEntity); } } - - break; - } if (!packageLockIds.isEmpty()) { List a = bladeRedis.get("warehouseId:" + myCurrentWarehouse.getId() + "trainNumber:" + deliveryListEntity.getTrainNumber() + "orderPackageCode:" + packageLockIds); @@ -7739,6 +7828,17 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl nodeFanoutMsg = buildDistributionSignforVOByStock(deliveryListEntity, pushInventoryList); + iDistributionNodeWorkService.signFor(nodeFanoutMsg, AuthUtil.getUser()); + } + if (!pushList.isEmpty()) { + // 构建新作业节点回传 + NodeFanoutMsg nodeFanoutMsg = buildDistributionSignforVO(deliveryListEntity,reservationEntity, pushList); + iDistributionNodeWorkService.signFor(nodeFanoutMsg, AuthUtil.getUser()); + } if (!orderCodes.isEmpty()) { String collect = orderCodes.stream().distinct().collect(Collectors.joining(",")); distributionStockArticleService.maintenanceOrderInfo(collect, myCurrentWarehouse.getId()); @@ -7748,6 +7848,270 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl distributionAppSignforDeliveryListVOS = new ArrayList<>(); + //参数校验 + if (Objects.isNull(distributionDeliveryList.getType())) { + log.error(method + "type>>参数缺失"); + throw new ServiceException("参数缺失"); + } + if (Objects.isNull(distributionDeliveryList.getTaskTime_start())) { + log.error(method + "TaskTime_start>>参数缺失"); + throw new ServiceException("参数缺失"); + } + if (Objects.isNull(distributionDeliveryList.getTaskTime_end())) { + log.error(method + "TaskTime_start>>参数缺失"); + throw new ServiceException("参数缺失"); + } + + BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse(); + if (Objects.isNull(myCurrentWarehouse)) { + log.error(method + "TaskTime_start>>参数缺失"); + throw new ServiceException("参数缺失"); + } + YearMonth parse = YearMonth.parse(distributionDeliveryList.getTaskTime_start(), DateTimeFormatter.ISO_DATE); + YearMonth parse1 = YearMonth.parse(distributionDeliveryList.getTaskTime_end(), DateTimeFormatter.ISO_DATE); + long until = parse.until(parse1, ChronoUnit.MONTHS); + if (until != 0) { + log.error(method + "列表搜索时间范围大于一个月"); + return Resp.fail("最大区间为一个月,请缩小搜索范围"); + } + + distributionDeliveryList.setWarehouseId(myCurrentWarehouse.getId()); + //查询当前登录人满足的配送计划 + //获取当前登录人 + BladeUser user = AuthUtil.getUser(); + + //判断当前登录人是否为司机 + Boolean delivery = distributionDeliveryListService.judgeIsDriver(user); + + if (delivery) { + //查询当前登录人的配送任务 + BasicdataDriverArteryEntity driverArtery = iBasicdataDriverArteryClient.getDriverArtery(user.getUserId()); + if (null == driverArtery) { + log.error("没有司机的信息!!"); + throw new CustomerException("没有司机的信息"); + } + //查询司机的任务 + distributionDeliveryList.setDriverId(driverArtery.getId() + ""); + List deliveryIds = distributionDeliverySelfMapper.selectNewDeliveryList(distributionDeliveryList); + if (!deliveryIds.isEmpty()) { + distributionAppSignforDeliveryListVOS = baseMapper.selectDistributionNewAppDeliveryListPage(distributionDeliveryList, deliveryIds); + } else { + return R.data(null); + } + } else { + //查询当前时间范围内的配送ID + List deliveryIds = baseMapper.selectDeliveyId(distributionDeliveryList); + if (!deliveryIds.isEmpty()) { + distributionAppSignforDeliveryListVOS = baseMapper.selectDistributionNewAppDeliveryListPage(distributionDeliveryList, deliveryIds); + } + } + return R.data(distributionAppSignforDeliveryListVOS); + } + + @Override + public R selectNewAppDeliveryCustom(DistributionAppDeliveryListDTO distributionDeliveryList) { + String method = "######################DistributionDeliveryListServiceImpl.getNewAppDeliveryreservationListPage"; + if (Objects.isNull(distributionDeliveryList.getId())) { + log.error(method + "id参数缺失"); + return R.fail("请求错误,请联系管理员"); + } + DistributionAppDetailVO detailVO = baseMapper.selectNewAppDistributionDetail(distributionDeliveryList.getId()); + List customList = baseMapper.selectNewAppCustomList(distributionDeliveryList.getId()); + detailVO.setCustomList(customList); + return R.data(detailVO); + } + + @Override + public R selectNewAppDeliveryCustomDetail(DistributionAppDeliveryListDTO distributionAppDeliveryListDTO) { + String method = "#############################################DistributionDeliverySignforServiceImpl.selectDistributionNewAppDeliveryorder"; + if (Objects.isNull(distributionAppDeliveryListDTO.getReservationId())) { + log.error(method + "reservationId参数缺失"); + return R.fail("参数错误,联系管理员"); + } + //查询预约信息 + Long reservationId = Long.parseLong(distributionAppDeliveryListDTO.getReservationId()); + DistributionAppNewReservationVO reservationAppDetailVO = baseMapper.selectNewAppCustom(reservationId); + if (Objects.isNull(reservationAppDetailVO)) { + log.error(method + "查询预约计划失败:{}", distributionAppDeliveryListDTO.getReservationId()); + return R.fail("参数错误,联系管理员"); + } + + List orderList = new ArrayList<>(); + List zeroOrderList = new ArrayList<>(); + //查询该客户装车 + List distributionLoadscanEntities = distributionLoadscanService.list(Wrappers.query().lambda() + .eq(DistributionLoadscanEntity::getReservationId, reservationId) + .ne(DistributionLoadscanEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue())); + //查询计划 + List reservationStockarticleEntityList = distributionReservationStockarticleService.list(Wrappers.query().lambda() + .eq(DistributionReservationStockarticleEntity::getReservationId, reservationId) + .ne(DistributionReservationStockarticleEntity::getStockArticleStatus, ReservationOrderStatusConstant.quxiao.getValue())); + + List orderIds = new ArrayList<>(); + if (Func.isNotEmpty(distributionLoadscanEntities)) { + //进行订单分类 + List loadingOrderIds = distributionLoadscanEntities.stream().map(DistributionLoadscanEntity::getOrderId).collect(Collectors.toList()); + orderIds.addAll(loadingOrderIds); + } + + if (Func.isNotEmpty(reservationStockarticleEntityList)) { + //截取计划订单ID + List reservationOrderIds = reservationStockarticleEntityList.stream().map(DistributionReservationStockarticleEntity::getStockArticleId).collect(Collectors.toList()); + orderIds.addAll(reservationOrderIds); + } + Map> reservationOrderMap = reservationStockarticleEntityList.stream().collect(Collectors.groupingBy(DistributionReservationStockarticleEntity::getStockArticleId)); + Map> loadingOrderMap = distributionLoadscanEntities.stream().collect(Collectors.groupingBy(DistributionLoadscanEntity::getOrderId)); + + if (Func.isNotEmpty(orderIds)) { + orderIds = orderIds.stream().distinct().collect(Collectors.toList()); + List distributionStockArticleEntities = distributionStockArticleService.listByIds(orderIds); + List reservationOrders = distributionReservationStockarticleService.list(Wrappers.query().lambda() + .eq(DistributionReservationStockarticleEntity::getReservationId, reservationId) + .in(DistributionReservationStockarticleEntity::getStockArticleId, orderIds) + .ne(DistributionReservationStockarticleEntity::getStockArticleStatus, ReservationOrderStatusConstant.quxiao.getValue()) + ); + for (DistributionStockArticleEntity distributionStockArticleEntity : distributionStockArticleEntities) { + DistributionAppStockArticleVO distributionAppStockArticleVO = Func.copy(distributionStockArticleEntity, DistributionAppStockArticleVO.class); + assert distributionAppStockArticleVO != null; + distributionAppStockArticleVO.setLoadingNub(0); + distributionAppStockArticleVO.setSignforNub(0); + distributionAppStockArticleVO.setReservationNum(0); + //查询预约该订单计划数量 + DistributionReservationStockarticleEntity reservationOrder = findReservationOrders(reservationOrders, distributionStockArticleEntity.getId()); + if (Func.isNotEmpty(reservationOrder)) { + distributionAppStockArticleVO.setReservationNum(reservationOrder.getReservationNum()); + } + if (distributionStockArticleEntity.getIsZero().equals(IsOrNoConstant.no.getValue())) { + //判断此订单是是否是异常装车 + if (Func.isEmpty(reservationOrderMap.get(distributionStockArticleEntity.getId()))) { + //不存在计划之中的订单装车 + List loadscanEntityList = loadingOrderMap.get(distributionStockArticleEntity.getId()); + List abnormalPackageIds = loadscanEntityList.stream().map(DistributionLoadscanEntity::getPackageId).collect(Collectors.toList()); + List distributionParcelListEntities = distributionParcelListService.listByIds(abnormalPackageIds); + List distributionAppParcelListVOS = DistributionParcelListAppWrapper.build().listVO(distributionParcelListEntities); + distributionAppParcelListVOS.forEach(p -> { + p.setIsAbnormalLoading(1); + if (p.getOrderPackageStatus().equals(OrderPackageStatusConstant.yiqianshou.getValue())) { + p.setIsAbnnormalSigning(1); + } + }); + distributionAppStockArticleVO.setDistributionAppParcelListVOS(distributionAppParcelListVOS); + //统计装车数和签收数 + int abnormalLoadingNum = loadscanEntityList.stream().mapToInt(DistributionLoadscanEntity::getLoadedNub).sum(); + distributionAppStockArticleVO.setLoadingNub(abnormalLoadingNum); + int abnormalSigningNum = loadscanEntityList.stream().filter(f -> f.getSignforState().equals(LoadScanSigningStatusConstant.yiqianshou.getValue())).mapToInt(DistributionLoadscanEntity::getLoadedNub).sum(); + distributionAppStockArticleVO.setSignforNub(abnormalSigningNum); + distributionAppStockArticleVO.setCompletecode(5); + } else { + //存在计划需要结合计划包件进行异常包件判断 + //查询此预约该订单下的包件信息 + List reservationPackage = distributionReservationPackageService.list(Wrappers.query().lambda() + .eq(DistributionReservationPackageEntity::getReservationId, reservationId) + .eq(DistributionReservationPackageEntity::getStockArticleId, distributionStockArticleEntity.getId()) + .ne(DistributionReservationPackageEntity::getPacketBarStatus, ReservationPackageStatusConstant.quxiao.getValue()) + ); + List packageIds = new ArrayList<>(); + if (Func.isNotEmpty(reservationPackage)) { + List reservationPackageIds = reservationPackage.stream().map(DistributionReservationPackageEntity::getParceListId).collect(Collectors.toList()); + packageIds.addAll(reservationPackageIds); + } + + Map collect = null; + if (Func.isNotEmpty(loadingOrderMap.get(distributionStockArticleEntity.getId()))) { + List loadscanEntityList = loadingOrderMap.get(distributionStockArticleEntity.getId()); + List loadingPackageIds = loadscanEntityList.stream().map(DistributionLoadscanEntity::getPackageId).collect(Collectors.toList()); + packageIds.addAll(loadingPackageIds); + collect = loadscanEntityList.stream().collect(Collectors.toMap(DistributionLoadscanEntity::getPackageId, Function.identity(), (k1, k2) -> k2)); + int LoadingNum = loadscanEntityList.stream().mapToInt(DistributionLoadscanEntity::getLoadedNub).sum(); + distributionAppStockArticleVO.setLoadingNub(LoadingNum); + int SigningNum = loadscanEntityList.stream().filter(f -> f.getSignforState().equals(LoadScanSigningStatusConstant.yiqianshou.getValue())).mapToInt(DistributionLoadscanEntity::getLoadedNub).sum(); + distributionAppStockArticleVO.setSignforNub(SigningNum); + } + List packageVOS = new ArrayList<>(); + if (Func.isNotEmpty(packageIds)) { + packageIds = packageIds.stream().distinct().collect(Collectors.toList()); + + List parcelListEntitys = distributionParcelListService.listByIds(packageIds); + for (DistributionParcelListEntity parcelListEntity : parcelListEntitys) { +// DistributionParcelListEntity parcelListEntity = distributionParcelListService.getById(packageId); + DistributionAppParcelListVO distributionAppParcelListVO = DistributionParcelListAppWrapper.build().entityVO(parcelListEntity); + if (Func.isNotEmpty(collect)) { + DistributionLoadscanEntity distributionLoadscanEntity = collect.get(parcelListEntity.getId()); + if (Func.isNotEmpty(distributionLoadscanEntity)) { + distributionAppParcelListVO.setMaterialName(parcelListEntity.getMaterialName()); + if (distributionLoadscanEntity.getIsAbnormalLoading().equals(2)) { + //异常装车 + distributionAppParcelListVO.setIsAbnormalLoadingName("异常装车"); + distributionAppParcelListVO.setIsAbnormalLoading(1); + } + if (distributionLoadscanEntity.getSignforState().equals(LoadScanSigningStatusConstant.yiqianshou.getValue())) { + //签收 + if (distributionLoadscanEntity.getIsAbnormalSigning().equals(2)) { + //异常签收 + distributionAppParcelListVO.setIsAbnnormalSigningName("异常签收"); + distributionAppParcelListVO.setIsAbnnormalSigning(1); + } + } + } + } + packageVOS.add(distributionAppParcelListVO); + } + } + distributionAppStockArticleVO.setDistributionAppParcelListVOS(packageVOS); + } + orderList.add(distributionAppStockArticleVO); + } else { + List reservationZeroPackageEntityList = distributionReservationZeroPackageService.list(Wrappers.query().lambda() + .eq(DistributionReservationZeroPackageEntity::getReservationId, reservationId) + .eq(DistributionReservationZeroPackageEntity::getStockArticleId, distributionStockArticleEntity.getId()) + .ne(DistributionReservationZeroPackageEntity::getZeroPackageStatus, ReservationPackageStatusConstant.quxiao.getValue())); + if (Func.isNotEmpty(reservationZeroPackageEntityList)) { + int reservationTotal = reservationZeroPackageEntityList.stream().mapToInt(DistributionReservationZeroPackageEntity::getQuantity).sum(); + distributionAppStockArticleVO.setReservationNum(reservationTotal); + List parcelNumberVOS = distributionReservationMapper.selectReservationZeroOrderDetail(distributionStockArticleEntity.getId(), reservationId); + distributionAppStockArticleVO.setSignforNub(0); + if (Func.isNotEmpty(parcelNumberVOS)) { + parcelNumberVOS.forEach(p -> { + DistributionLoadscanEntity loadscanEntity = distributionLoadscanService.getOne(Wrappers.query().lambda().eq(DistributionLoadscanEntity::getReservationId, reservationId).eq(DistributionLoadscanEntity::getOrderId, distributionStockArticleEntity.getId()).eq(DistributionLoadscanEntity::getPackageId, p.getParcelListId()).ne(DistributionLoadscanEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue())); + p.setLoadingNum(0); + p.setSigningNum(0); + if (Func.isNotEmpty(loadscanEntity)) { + p.setLoadingNum(loadscanEntity.getLoadedNub()); + if (loadscanEntity.getSignforState().equals(LoadScanSigningStatusConstant.yiqianshou.getValue())) { + p.setSigningNum(loadscanEntity.getReceivedQuantity()); + } + } + }); + distributionAppStockArticleVO.setDistributionParcelNumberVOS(parcelNumberVOS); + distributionAppStockArticleVO.setSignforNub(parcelNumberVOS.stream().mapToInt(DistributionParcelNumberVO::getSigningNum).sum()); + + } + } + zeroOrderList.add(distributionAppStockArticleVO); + } + + } + + } + + List inventoryPackageList = baseMapper.selectAppDeliveryInventoryPackage(reservationId); + if (!orderList.isEmpty()) { + reservationAppDetailVO.setOrderList(orderList); + } + if (!zeroOrderList.isEmpty()) { + reservationAppDetailVO.setZeroOrderList(zeroOrderList); + } + if (!inventoryPackageList.isEmpty()) { + reservationAppDetailVO.setInventoryList(inventoryPackageList); + + } + return R.data(reservationAppDetailVO); + } + /** * 修改装车为签收数据 * @param loadscanEntity