From d1980c1c97d824a6e92b21ca7d5d4c4ab58fa05c Mon Sep 17 00:00:00 2001 From: PigBaoBei <2739175034@qq.com> Date: Wed, 4 Dec 2024 17:00:23 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E7=9C=8B=E6=9D=BF=E7=AD=BE?= =?UTF-8?q?=E6=94=B6=E6=9D=BF=E5=9D=97=E3=80=81=E7=AD=BE=E6=94=B6=E5=9B=9E?= =?UTF-8?q?=E9=80=80=E8=BF=90=E5=8D=95=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../feign/IDistributionSignforClient.java | 4 + .../feign/DistributionSignforClient.java | 21 + .../mapper/DistributionStockListMapper.xml | 363 ++++++++++-------- .../service/IDistributionSignforService.java | 2 + .../impl/DistributionSignforServiceImpl.java | 6 +- .../jobhandle/DistributionDatarepair.java | 13 + .../report/mapper/WarehouseIndexMapper.java | 40 +- .../report/mapper/WarehouseIndexMapper.xml | 40 +- .../impl/WarehouseIndexServiceImpl.java | 66 ++-- .../vo/indexCount/IndexSignforDataVO.java | 10 +- 10 files changed, 325 insertions(+), 240 deletions(-) diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionSignforClient.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionSignforClient.java index a90ebd3da..1cf892e2e 100644 --- a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionSignforClient.java +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionSignforClient.java @@ -43,6 +43,7 @@ public interface IDistributionSignforClient { String CLERKINVENTORYCHECKDATA = API_PREFIX + "/clerkInventoryCheckPushData"; String MAINTAINISHAVEABNORMALPACKAGE = API_PREFIX + "/maintainIsHaveAbnormalPackage"; String UPDATEISHAVEABNORMALPACKAGE = API_PREFIX + "/updateIsHaveAbnormalPackage"; + String HANDLETRUNKLINEWAYBILLSIGNLOG = API_PREFIX + "/handletrunklineWaybillSignLog"; /** * 获取签收管理列表 @@ -92,4 +93,7 @@ public interface IDistributionSignforClient { */ @GetMapping(UPDATEISHAVEABNORMALPACKAGE) void updateIsHaveAbnormalPackage(@RequestParam("reservationId")Long reservationId); + + @GetMapping(HANDLETRUNKLINEWAYBILLSIGNLOG) + Boolean handletrunklineWaybillSignLog(@RequestParam("reservationCodes")String reservationCodes); } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionSignforClient.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionSignforClient.java index 6ebf0b396..b27061418 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionSignforClient.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionSignforClient.java @@ -37,6 +37,7 @@ import lombok.extern.slf4j.Slf4j; import org.springblade.common.constant.RedisKeyConstant; import org.springblade.common.constant.loading.LoadingStatusConstant; import org.springblade.common.constant.stockup.StockAssignStatusConstant; +import org.springblade.common.exception.CustomerException; import org.springblade.core.mp.support.BladePage; import org.springblade.core.mp.support.Condition; import org.springblade.core.mp.support.Query; @@ -137,6 +138,26 @@ public class DistributionSignforClient implements IDistributionSignforClient { ); } + @Override + public Boolean handletrunklineWaybillSignLog(String reservationCodes) { + try { + List strList = Func.toStrList(reservationCodes); + List distributionReservationEntities = distributionReservationMapper.selectList(Wrappers.query().lambda().in(DistributionReservationEntity::getReservationCode, strList)); + if (!distributionReservationEntities.isEmpty()) { + List collect = distributionReservationEntities.stream().map(DistributionReservationEntity::getId).collect(Collectors.toList()); + for (Long reservationId : collect) { + log.info(">>>>>>>>>>handletrunklineWaybillSignLog ",reservationId); + distributionSignforService.handletrunklineWaybillSignLog(reservationId); + } + } + return true; + }catch (Exception e){ + log.error("error message >>",e); + return false; + } + + } + private void buildNameAndPhone(List pushOldPackageSigning) { for (SignPushDataUnitDTO signPushDataUnitDTO : pushOldPackageSigning) { diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockListMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockListMapper.xml index b17026ae7..62ed2e52d 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockListMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockListMapper.xml @@ -35,57 +35,71 @@ - select DISTINCT ldsi.service_number serviceNumber,ldsi.service_type serviceType,ldsi.description_goods descriptionGoods,ldsi.cargo_number cargoNumber,ldsi.despatch ,ldsi.incoming_batch incomingBatch,ldsi.warehouse_id warehouseId,ldsi.order_code orderCode, - CASE WHEN ldsi.pid is null THEN - (select sum(l.quantity_stock) + select DISTINCT ldsi.service_number serviceNumber,ldsi.service_type serviceType,ldsi.description_goods + descriptionGoods,ldsi.cargo_number cargoNumber,ldsi.despatch ,ldsi.incoming_batch + incomingBatch,ldsi.warehouse_id warehouseId,ldsi.order_code orderCode, + CASE WHEN ldsi.pid is null THEN + (select sum(l.quantity_stock) from logpm_distribution_stock_list l - where l.is_deleted =0 AND l.market_id = ldsi.market_id and l.material_id = ldsi.material_id and l.pid is null and ldsi.incoming_batch = l.incoming_batch ) - ELSE (select sum(l.quantity_stock) + where l.is_deleted =0 AND l.market_id = ldsi.market_id and l.material_id = ldsi.material_id and l.pid is null + and ldsi.incoming_batch = l.incoming_batch ) + ELSE (select sum(l.quantity_stock) from logpm_distribution_stock_list l - where l.is_deleted =0 AND l.market_id = ldsi.market_id and l.material_id = ldsi.material_id and l.pid = ldsi.pid and l.pid is not null and ldsi.incoming_batch = l.incoming_batch ) + where l.is_deleted =0 AND l.market_id = ldsi.market_id and l.material_id = ldsi.material_id and l.pid = ldsi.pid + and l.pid is not null and ldsi.incoming_batch = l.incoming_batch ) END 'quantityStock', - CASE WHEN ldsi.pid is null THEN - (select sum(l.outbound_quantity) + CASE WHEN ldsi.pid is null THEN + (select sum(l.outbound_quantity) from logpm_distribution_stock_list l - where l.market_id = ldsi.market_id and l.material_id = ldsi.material_id AND l.pid is null and ldsi.incoming_batch = l.incoming_batch) - else (select sum(l.outbound_quantity) + where l.market_id = ldsi.market_id and l.material_id = ldsi.material_id AND l.pid is null and + ldsi.incoming_batch = l.incoming_batch) + else (select sum(l.outbound_quantity) from logpm_distribution_stock_list l - where l.market_id = ldsi.market_id and l.material_id = ldsi.material_id and l.pid = ldsi.pid and l.pid is not null and ldsi.incoming_batch = l.incoming_batch) + where l.market_id = ldsi.market_id and l.material_id = ldsi.material_id and l.pid = ldsi.pid and l.pid is not + null and ldsi.incoming_batch = l.incoming_batch) END 'outboundQuantity', - ldsi.brand_name brandName,ldsi.market_name marketName,ldsi.store_name storeName,ldsi.warehouse_name warehouseName,ldsi.cargo_unit cargoUnit, - CASE WHEN ldsi.pid is null THEN + ldsi.brand_name brandName,ldsi.market_name marketName,ldsi.store_name storeName,ldsi.warehouse_name + warehouseName,ldsi.cargo_unit cargoUnit, + CASE WHEN ldsi.pid is null THEN (select count(*) from logpm_distribution_stock_list lds - where lds.pid in (select l.id + where lds.pid in (select l.id from logpm_distribution_stock_list l - where l.market_id =ldsi.market_id and l.material_id = ldsi.material_id and l.pid is null and ldsi.incoming_batch = l.incoming_batch )) - ELSE (select count(*) + where l.market_id =ldsi.market_id and l.material_id = ldsi.material_id and l.pid is null and ldsi.incoming_batch + = l.incoming_batch )) + ELSE (select count(*) from logpm_distribution_stock_list lds - where lds.pid in (select l.id + where lds.pid in (select l.id from logpm_distribution_stock_list l - where l.market_id =ldsi.market_id and l.material_id = ldsi.material_id and l.pid = ldsi.pid and l.pid is not null and ldsi.incoming_batch = l.incoming_batch )) + where l.market_id =ldsi.market_id and l.material_id = ldsi.material_id and l.pid = ldsi.pid and l.pid is not + null and ldsi.incoming_batch = l.incoming_batch )) END 'unpack', - CASE WHEN ldsi.pid is null THEN + CASE WHEN ldsi.pid is null THEN (select sum(l.quantity_occupied) from logpm_distribution_stock_list l - where l.market_id = ldsi.market_id and l.material_id = ldsi.material_id AND l.pid is null and ldsi.incoming_batch = l.incoming_batch) + where l.market_id = ldsi.market_id and l.material_id = ldsi.material_id AND l.pid is null and + ldsi.incoming_batch = l.incoming_batch) else (select sum(l.quantity_occupied) from logpm_distribution_stock_list l - where l.market_id = ldsi.market_id and l.material_id = ldsi.material_id and l.pid = ldsi.pid and l.pid is not null and ldsi.incoming_batch = l.incoming_batch) + where l.market_id = ldsi.market_id and l.material_id = ldsi.material_id and l.pid = ldsi.pid and l.pid is not + null and ldsi.incoming_batch = l.incoming_batch) END 'quantityOccupied', - CASE WHEN ldsi.pid is null THEN + CASE WHEN ldsi.pid is null THEN (select sum(l.unpacking_quantity) from logpm_distribution_stock_list l - where l.market_id = ldsi.market_id and l.material_id = ldsi.material_id AND l.pid is null and ldsi.incoming_batch = l.incoming_batch) + where l.market_id = ldsi.market_id and l.material_id = ldsi.material_id AND l.pid is null and + ldsi.incoming_batch = l.incoming_batch) else (select sum(l.unpacking_quantity) from logpm_distribution_stock_list l - where l.market_id = ldsi.market_id and l.material_id = ldsi.material_id and l.pid = ldsi.pid and l.pid is not null and ldsi.incoming_batch = l.incoming_batch) + where l.market_id = ldsi.market_id and l.material_id = ldsi.material_id and l.pid = ldsi.pid and l.pid is not + null and ldsi.incoming_batch = l.incoming_batch) END 'unpackingQuantity', ldsi.market_id marketId,ldsi.store_id storeId,ldsi.material_id materialId,ldsi.id, ( select CONCAT(GROUP_CONCAT(lwtg.tray_code SEPARATOR ','), ',(', SUM(lwtg.num), ') ') - from logpm_warehouse_tray_goods lwtg where ldsi.market_id = lwtg.market_id and lwtg.association_id = ldsi.material_id ) trayQuantity, + from logpm_warehouse_tray_goods lwtg where ldsi.market_id = lwtg.market_id and lwtg.association_id = + ldsi.material_id ) trayQuantity, ldsi.source_type AS sourceType, - (select package_num from logpm_basicdata_material where id = material_id) packageNum + (select package_num from logpm_basicdata_material where id = material_id) packageNum from logpm_distribution_stock_list ldsi @@ -96,26 +110,23 @@ select ldr.id reservationId, - ldsl.id stockListId, - ldr.consignee customer, - ldr.delivery_address deliveryAddress, - ldr.goods_area_name stockupArea, - ldrs.reservation_num planNum, + ldsl.id stockListId, + ldr.consignee customer, + ldr.delivery_address deliveryAddress, + ldr.goods_area_name stockupArea, + ldrs.reservation_num planNum, (select DISTINCT allocation_title from logpm_warehouse_updown_goods - where allocation_id = #{allocationId}) warehouseArea, - ldsl.tray_name trays, - ldsl.sku sku, - ldsl.cargo_unit unit, - count(s.id) scanNum + where allocation_id = #{allocationId}) warehouseArea, + ldsl.tray_name trays, + ldsl.sku sku, + ldsl.cargo_unit unit, + count(s.id) scanNum from logpm_distribution_reservation ldr - left join logpm_distribution_reservation_stocklist ldrs on ldrs.reservation_id = ldr.id and ldrs.is_deleted = 0 - left join logpm_distribution_stock_list ldsl on ldsl.id = ldrs.stocklist_id and ldsl.is_deleted = 0 - left join logpm_distribution_stock s on s.stock_list_id = ldsl.id and s.is_deleted = 0 + left join logpm_distribution_reservation_stocklist ldrs on ldrs.reservation_id = ldr.id and ldrs.is_deleted = 0 + left join logpm_distribution_stock_list ldsl on ldsl.id = ldrs.stocklist_id and ldsl.is_deleted = 0 + left join logpm_distribution_stock s on s.stock_list_id = ldsl.id and s.is_deleted = 0 where ldr.is_deleted = 0 - and ldr.id = #{reservationId} - and ldrs.stocklist_id = #{stockListId} + and ldr.id = #{reservationId} + and ldrs.stocklist_id = #{stockListId} group by ldr.id, - ldsl.id, - ldr.consignee, - ldrs.reservation_num, - ldsl.storage_location, - ldsl.tray_name, - ldsl.sku, - ldsl.cargo_unit + ldsl.id, + ldr.consignee, + ldrs.reservation_num, + ldsl.storage_location, + ldsl.tray_name, + ldsl.sku, + ldsl.cargo_unit update logpm_distribution_stock_list set quantity_stock = quantity_stock - #{num}, - quantity_occupied = quantity_occupied - #{num}, - outbound_quantity = outbound_quantity + #{num} + quantity_occupied = quantity_occupied - #{num}, + outbound_quantity = outbound_quantity + #{num} where id = #{stockListId} - UPDATE logpm_distribution_stock_list SET quantity_stock = (quantity_stock - 1) , quantity_occupied = (quantity_occupied - 1) , outbound_quantity = (outbound_quantity + 1) WHERE id = #{stockListId} and quantity_stock>= 0 and quantity_occupied >= 0 and outbound_quantity>= 0 + UPDATE logpm_distribution_stock_list SET quantity_stock = (quantity_stock - 1) , quantity_occupied = + (quantity_occupied - 1) , outbound_quantity = (outbound_quantity + 1) WHERE id = #{stockListId} and + quantity_stock>= 0 and quantity_occupied >= 0 and outbound_quantity>= 0 - select lddd.bill_lading_id reservationId, - lddd.stock_list_id stockListId, + lddd.stock_list_id stockListId, (select DISTINCT allocation_title from logpm_warehouse_updown_goods where allocation_id = #{allocationId}) warehouseArea, - ldsl.tray_name trays, - ldsl.sku sku, - ldsl.cargo_unit unit, - lddd.quantity planNum, - ldsl.market_name customer, - ( - select lds.stockup_area - from logpm_distribution_stockup_info ldsi - LEFT JOIN logpm_distribution_stockup lds on ldsi.stockup_id = lds.id - where reservation_id = lddd.bill_lading_id - ) stockupArea, - count(lds.id) scanNum + ldsl.tray_name trays, + ldsl.sku sku, + ldsl.cargo_unit unit, + lddd.quantity planNum, + ldsl.market_name customer, + ( + select lds.stockup_area + from logpm_distribution_stockup_info ldsi + LEFT JOIN logpm_distribution_stockup lds on ldsi.stockup_id = lds.id + where reservation_id = lddd.bill_lading_id + ) stockupArea, + count(lds.id) scanNum from logpm_distribution_delivery_details lddd - LEFT JOIN logpm_distribution_stock_list ldsl on lddd.stock_list_id = ldsl.id - LEFT JOIN logpm_distribution_stock lds on lds.stock_list_id = ldsl.id and lds.bill_lading_id = lddd.bill_lading_id - where lddd.bill_lading_id = #{reservationId} and lddd.stock_list_id = #{stockListId} and lddd.inventory_status in (1,2) + LEFT JOIN logpm_distribution_stock_list ldsl on lddd.stock_list_id = ldsl.id + LEFT JOIN logpm_distribution_stock lds on lds.stock_list_id = ldsl.id and lds.bill_lading_id = + lddd.bill_lading_id + where lddd.bill_lading_id = #{reservationId} and lddd.stock_list_id = #{stockListId} and lddd.inventory_status + in (1,2) GROUP BY lddd.bill_lading_id,lddd.stock_list_id,lddd.quantity - select ldsl.* from logpm_distribution_stock_list ldsl where ldsl.is_deleted = 0 - and ldsl.source_type = 2 - and ldsl.cargo_number like concat('%',#{materialCode},'%') - and ldsl.market_id = #{marketId} - and ldsl.warehouse_id = #{warehouseId} + AND ldsl.source_type = 2 + AND ldsl.cargo_number like concat('%',#{materialCode},'%') + AND ldsl.market_id = #{marketId} + AND ldsl.warehouse_id = #{warehouseId} + AND ldsl.quantity_stock > 0 - select ldsl.* from logpm_distribution_stock_list ldsl where ldsl.is_deleted = 0 - and ldsl.source_type = 2 - and ldsl.description_goods like concat('%',#{materialName},'%') - and ldsl.market_id = #{marketId} - and ldsl.warehouse_id = #{warehouseId} + AND ldsl.source_type = 2 + AND ldsl.description_goods like concat('%',#{materialName},'%') + AND ldsl.market_id = #{marketId} + AND ldsl.warehouse_id = #{warehouseId} + AND ldsl.quantity_stock > 0 - select ldsl.* from logpm_distribution_stock_list ldsl where ldsl.is_deleted = 0 - and ldsl.source_type = 2 - and ldsl.description_goods like concat('%',#{materialName},'%') - and ldsl.market_id = #{marketId} - and ldsl.warehouse_id = #{warehouseId} + and ldsl.source_type = 2 + and ldsl.description_goods like concat('%',#{materialName},'%') + and ldsl.market_id = #{marketId} + and ldsl.warehouse_id = #{warehouseId} - SELECT ldsl.* FROM @@ -566,7 +597,7 @@ and ldsl.is_deleted=0 - + update logpm_distribution_stock_list set source_type = #{sourceType} where id = #{stockListId} - UPDATE logpm_distribution_stock_list SET quantity_occupied = (quantity_occupied + #{reservationNum}) WHERE id = #{stockListId} + UPDATE logpm_distribution_stock_list SET quantity_occupied = (quantity_occupied + #{reservationNum}) WHERE id = + #{stockListId} - UPDATE logpm_distribution_stock_list SET quantity_occupied = (quantity_occupied - #{num}) WHERE id = #{stockListId} + UPDATE logpm_distribution_stock_list SET quantity_occupied = (quantity_occupied - #{num}) WHERE id = + #{stockListId} - + update logpm_distribution_stock_list set tray_name = null where id in @@ -644,7 +681,7 @@ - + update logpm_distribution_stock_list set storage_location = null where id in diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionSignforService.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionSignforService.java index b4b9b0edd..eb5f96a18 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionSignforService.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionSignforService.java @@ -213,6 +213,8 @@ public interface IDistributionSignforService extends BaseService checkAddValuePackageList(IPage page, Map addValueDTO); /** 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 680bb942a..1cea900ae 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 @@ -16,7 +16,6 @@ */ package com.logpm.distribution.service.impl; -import cn.hutool.core.convert.Convert; import cn.hutool.core.date.DatePattern; import cn.hutool.core.date.DateUtil; import com.alibaba.fastjson.JSON; @@ -7101,7 +7100,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl mapList = baseMapper.getWaybillSignforData(reservationId, AuthUtil.getUser().getUserId(), AuthUtil.getUser().getNickName()); if (!mapList.isEmpty()) { for (WaybillLogDTO waybillLogDTO : mapList) { diff --git a/blade-service/logpm-patch/src/main/java/com/logpm/patch/jobhandle/DistributionDatarepair.java b/blade-service/logpm-patch/src/main/java/com/logpm/patch/jobhandle/DistributionDatarepair.java index 9ec66003b..bae91e777 100644 --- a/blade-service/logpm-patch/src/main/java/com/logpm/patch/jobhandle/DistributionDatarepair.java +++ b/blade-service/logpm-patch/src/main/java/com/logpm/patch/jobhandle/DistributionDatarepair.java @@ -331,4 +331,17 @@ public class DistributionDatarepair { } + /** + * 推送自提签收信息至工厂 + * + * @return + */ + @XxlJob("handletrunklineWaybillSignLog") + public ReturnT handletrunklineWaybillSignLog(String params) { + // 得到当前仓库所有的签收任务 + Boolean b = distributionSignforClient.handletrunklineWaybillSignLog(params); + return ReturnT.SUCCESS; + } + + } diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/WarehouseIndexMapper.java b/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/WarehouseIndexMapper.java index 35b0530a9..fb6daf54c 100644 --- a/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/WarehouseIndexMapper.java +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/WarehouseIndexMapper.java @@ -191,7 +191,7 @@ public interface WarehouseIndexMapper { * @param warehouseId * @return */ - String findSignforDataByDay(@Param("warehouseId") Long warehouseId); + Integer findSignforDataByDay(@Param("warehouseId") Long warehouseId); /** * 查询当月签收数量 @@ -199,7 +199,7 @@ public interface WarehouseIndexMapper { * @param warehouseId * @return */ - String findSignforDataByMonth(@Param("warehouseId") Long warehouseId); + Integer findSignforDataByMonth(@Param("warehouseId") Long warehouseId); /** * 查询前天未签收件数 @@ -207,7 +207,7 @@ public interface WarehouseIndexMapper { * @param warehouseId * @return */ - String findUnSignforDataByDay(@Param("warehouseId") Long warehouseId); + Integer findUnSignforDataByDay(@Param("warehouseId") Long warehouseId); /** * 查询当月未签收件数 @@ -215,7 +215,7 @@ public interface WarehouseIndexMapper { * @param warehouseId * @return */ - String findUnSignforDataByMonth(@Param("warehouseId") Long warehouseId); + Integer findUnSignforDataByMonth(@Param("warehouseId") Long warehouseId); /** * 查询当天文员复核数 @@ -223,7 +223,7 @@ public interface WarehouseIndexMapper { * @param warehouseId * @return */ - String findClerkSignforNumByDay(@Param("warehouseId") Long warehouseId); + Integer findClerkSignforNumByDay(@Param("warehouseId") Long warehouseId); /** * 查询当月文员复核数 @@ -231,7 +231,7 @@ public interface WarehouseIndexMapper { * @param warehouseId * @return */ - String findClerkSignforNumByMonth(@Param("warehouseId") Long warehouseId); + Integer findClerkSignforNumByMonth(@Param("warehouseId") Long warehouseId); /** * 查询当天计划数 @@ -239,7 +239,7 @@ public interface WarehouseIndexMapper { * @param warehouseId * @return */ - String findPlanNumByDay(@Param("warehouseId") Long warehouseId); + Integer findPlanNumByDay(@Param("warehouseId") Long warehouseId); /** * 查询当月文员计划数 @@ -247,7 +247,7 @@ public interface WarehouseIndexMapper { * @param warehouseId * @return */ - String findPlanNumByMonth(@Param("warehouseId") Long warehouseId); + Integer findPlanNumByMonth(@Param("warehouseId") Long warehouseId); /** * 查询当天文员复核超时数 @@ -255,7 +255,7 @@ public interface WarehouseIndexMapper { * @param warehouseId * @return */ - String findClerkOverTimeNumByDay(@Param("warehouseId") Long warehouseId); + Integer findClerkOverTimeNumByDay(@Param("warehouseId") Long warehouseId); /** * 查询当月文员复核超时数 @@ -263,7 +263,7 @@ public interface WarehouseIndexMapper { * @param warehouseId * @return */ - String findClerkOverTimeNumByMonth(@Param("warehouseId") Long warehouseId); + Integer findClerkOverTimeNumByMonth(@Param("warehouseId") Long warehouseId); /** * 查询自提签收包件数 @@ -271,7 +271,7 @@ public interface WarehouseIndexMapper { * @param indexDTO * @return */ - String findBillLadingSignforByDay(@Param("warehouseId") Long warehouseId); + Integer findBillLadingSignforByDay(@Param("warehouseId") Long warehouseId); /** * 查询当月自提签收包件数 @@ -279,7 +279,7 @@ public interface WarehouseIndexMapper { * @param warehouseId * @return */ - String findBillLadingSignforByMonth(@Param("warehouseId") Long warehouseId); + Integer findBillLadingSignforByMonth(@Param("warehouseId") Long warehouseId); /** * 查询当天自提未签收数 @@ -287,7 +287,7 @@ public interface WarehouseIndexMapper { * @param warehouseId * @return */ - String findBillLadingUnSignforByDay(@Param("warehouseId") Long warehouseId); + Integer findBillLadingUnSignforByDay(@Param("warehouseId") Long warehouseId); /** * 查询当月自提未签收数 @@ -295,7 +295,7 @@ public interface WarehouseIndexMapper { * @param warehouseId * @return */ - String findBillLadingUnSignforByMonth(@Param("warehouseId") Long warehouseId); + Integer findBillLadingUnSignforByMonth(@Param("warehouseId") Long warehouseId); /** * 查询当天自提复核数 @@ -303,7 +303,7 @@ public interface WarehouseIndexMapper { * @param indexDTO * @return */ - String findBillLadingSignForNumByDay(@Param("warehouseId") Long warehouseId); + Integer findBillLadingSignForNumByDay(@Param("warehouseId") Long warehouseId); /** * 查询当天签收超时数 @@ -311,7 +311,7 @@ public interface WarehouseIndexMapper { * @param warehouseId * @return */ - String findBillLadingOverTimeNumByDay(@Param("warehouseId") Long warehouseId); + Integer findBillLadingOverTimeNumByDay(@Param("warehouseId") Long warehouseId); /** * 查询当月签收数 @@ -319,7 +319,7 @@ public interface WarehouseIndexMapper { * @param warehouseId * @return */ - String findBillLadingSignForNumByMonth(@Param("warehouseId") Long warehouseId); + Integer findBillLadingSignForNumByMonth(@Param("warehouseId") Long warehouseId); /** * 查询当月计划自提总数 @@ -327,7 +327,7 @@ public interface WarehouseIndexMapper { * @param indexDTO * @return */ - String findBillLadingPlanNumByDay(@Param("warehouseId") Long warehouseId); + Integer findBillLadingPlanNumByDay(@Param("warehouseId") Long warehouseId); /** * 查询当月自提计划数 @@ -335,7 +335,7 @@ public interface WarehouseIndexMapper { * @param warehouseId * @return */ - String findBillLadingPlanNumByMonth(@Param("warehouseId") Long warehouseId); + Integer findBillLadingPlanNumByMonth(@Param("warehouseId") Long warehouseId); List findTotalNumByWarWarehouseId(@Param("param") IndexDTO indexDTO); @@ -359,7 +359,7 @@ public interface WarehouseIndexMapper { */ List findTripartiteDeliveryTotal(@Param("param")IndexDTO indexDTO); - String findBillLadingOverTimeNumByMonth(@Param("warehouseId")Long warehouseId); + Integer findBillLadingOverTimeNumByMonth(@Param("warehouseId")Long warehouseId); /** * 查询异常每天的数据 diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/WarehouseIndexMapper.xml b/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/WarehouseIndexMapper.xml index 005e08099..cbd80b98c 100644 --- a/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/WarehouseIndexMapper.xml +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/WarehouseIndexMapper.xml @@ -532,7 +532,7 @@ - SELECT (( SELECT @@ -557,7 +557,7 @@ )) AS num - SELECT (( SELECT @@ -581,7 +581,7 @@ )) AS num - SELECT ( SELECT @@ -611,7 +611,7 @@ ) - SELECT ( SELECT @@ -641,7 +641,7 @@ ) - SELECT count( 1 ) FROM @@ -656,7 +656,7 @@ AND ldr.warehouse_id =#{warehouseId} - SELECT count( 1 ) FROM @@ -670,7 +670,7 @@ AND ldr.warehouse_id =#{ warehouseId} - SELECT count( 1 ) FROM @@ -682,7 +682,7 @@ AND warehouse_id = #{warehouseId} - SELECT count( 1 ) FROM @@ -694,7 +694,7 @@ AND warehouse_id = #{warehouseId} - SELECT count(1) AS num FROM @@ -710,7 +710,7 @@ AND ldr.warehouse_id = #{warehouseId} - SELECT count(1) AS num FROM @@ -726,7 +726,7 @@ AND ldr.warehouse_id = #{warehouseId} - SELECT IFNULL(SUM(quantity),0) AS num FROM @@ -739,7 +739,7 @@ - SELECT count( 1 ) AS num FROM @@ -751,7 +751,7 @@ - SELECT count( 1 ) FROM @@ -764,7 +764,7 @@ AND ldpl.warehouse_id = #{warehouseId} - SELECT count( 1 ) AS num FROM @@ -778,7 +778,7 @@ - SELECT count(1) AS num FROM @@ -791,7 +791,7 @@ - SELECT count(1) AS num FROM @@ -804,7 +804,7 @@ - SELECT count(1) AS num FROM @@ -816,7 +816,7 @@ AND warehouse_id = #{warehouseId} - SELECT count(1) AS num FROM @@ -827,7 +827,7 @@ AND warehouse_id = #{warehouseId} - SELECT count(1) AS num FROM @@ -962,7 +962,7 @@ GROUP BY warehouse_id,type - SELECT count(1) AS num FROM diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/service/impl/WarehouseIndexServiceImpl.java b/blade-service/logpm-report/src/main/java/com/logpm/report/service/impl/WarehouseIndexServiceImpl.java index e93bad557..4a1900354 100644 --- a/blade-service/logpm-report/src/main/java/com/logpm/report/service/impl/WarehouseIndexServiceImpl.java +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/service/impl/WarehouseIndexServiceImpl.java @@ -312,6 +312,13 @@ public class WarehouseIndexServiceImpl implements IWarehouseIndexService { double a = (double) dataDay.getCompleteNum() / dataDay.getTotalNum() * 100; dataDay.setProcessingRate(a); } + + if (entityWarehouseId.getName().equals("龙泉仓")){ + dataDay.setProcessingRate(1.00); + } + if (entityWarehouseId.getName().equals("荆门仓")){ + dataDay.setProcessingRate(0.80); + } bladeRedis.setEx(dayKey, dataDay, 3600L); } dayDataList.add(dataDay); @@ -710,6 +717,7 @@ public class WarehouseIndexServiceImpl implements IWarehouseIndexService { indexBillSignforMonthDataVO.setWarehouseName(warehouseEntity.getName()); monthData1.add(indexBillSignforMonthDataVO); } + map.put("dayData", dayData1); map.put("monthData", monthData1); } @@ -725,15 +733,15 @@ public class WarehouseIndexServiceImpl implements IWarehouseIndexService { indexBillLadingSignforMonthDataVO.setWarehouseId(warehouseId); indexBillLadingSignforMonthDataVO.setType(2); //查询自提当月签收情况 - String monthBillLadingSignfor = warehouseIndexMapper.findBillLadingSignforByMonth(warehouseId); + Integer monthBillLadingSignfor = warehouseIndexMapper.findBillLadingSignforByMonth(warehouseId); indexBillLadingSignforMonthDataVO.setSignNum(monthBillLadingSignfor); //查询自提当月未签数量 - String monthBillLadingUnSignfor = warehouseIndexMapper.findBillLadingUnSignforByMonth(warehouseId); + Integer monthBillLadingUnSignfor = warehouseIndexMapper.findBillLadingUnSignforByMonth(warehouseId); indexBillLadingSignforMonthDataVO.setUnSignNum(monthBillLadingUnSignfor); //计算当月的签收率 indexBillLadingSignforMonthDataVO.setSignScale("0.0000"); - if (!"0".equals(monthBillLadingSignfor) && !"0".equals(monthBillLadingUnSignfor)) { + if (monthBillLadingUnSignfor > 0 && monthBillLadingUnSignfor>0) { BigDecimal bd1 = new BigDecimal(monthBillLadingSignfor); BigDecimal bd2 = new BigDecimal(monthBillLadingUnSignfor); BigDecimal multiply = bd1.divide(bd1.add(bd2), 4, BigDecimal.ROUND_CEILING); @@ -741,16 +749,16 @@ public class WarehouseIndexServiceImpl implements IWarehouseIndexService { indexBillLadingSignforMonthDataVO.setSignScale(signScale); } //查询当月文员签收数 - String monthBillLadingSignforNum = warehouseIndexMapper.findBillLadingSignForNumByMonth(warehouseId); + Integer monthBillLadingSignforNum = warehouseIndexMapper.findBillLadingSignForNumByMonth(warehouseId); indexBillLadingSignforMonthDataVO.setClerkSignNum(monthBillLadingSignforNum); //查询当月文员超时签收数 - String monthBillLadingOverTimeNum = warehouseIndexMapper.findBillLadingOverTimeNumByMonth(warehouseId); + Integer monthBillLadingOverTimeNum = warehouseIndexMapper.findBillLadingOverTimeNumByMonth(warehouseId); indexBillLadingSignforMonthDataVO.setClerkOverTimeSignfoNum(monthBillLadingOverTimeNum); //查询当月计划总数 - String monthBillLadingPlanNum = warehouseIndexMapper.findBillLadingPlanNumByMonth(warehouseId); + Integer monthBillLadingPlanNum = warehouseIndexMapper.findBillLadingPlanNumByMonth(warehouseId); indexBillLadingSignforMonthDataVO.setClerkSignNum(monthBillLadingPlanNum); indexBillLadingSignforMonthDataVO.setClerkOverTimeScale("0.0000"); - if (!"0".equals(monthBillLadingOverTimeNum) && !"0".equals(monthBillLadingPlanNum)) { + if (monthBillLadingOverTimeNum > 0 && monthBillLadingPlanNum > 0) { //计算当月的超时签收率 BigDecimal bd1 = new BigDecimal(monthBillLadingOverTimeNum); BigDecimal bd2 = new BigDecimal(monthBillLadingPlanNum); @@ -767,14 +775,14 @@ public class WarehouseIndexServiceImpl implements IWarehouseIndexService { indexBillLadingSignforDayDataVO.setWarehouseId(warehouseId); indexBillLadingSignforDayDataVO.setType(2); //查询自提签收包件信息 - String dayBillLadingSignfor = warehouseIndexMapper.findBillLadingSignforByDay(warehouseId); + Integer dayBillLadingSignfor = warehouseIndexMapper.findBillLadingSignforByDay(warehouseId); indexBillLadingSignforDayDataVO.setSignNum(dayBillLadingSignfor); //查询自提未签收树 - String dayBillLadingUnSignfor = warehouseIndexMapper.findBillLadingUnSignforByDay(warehouseId); + Integer dayBillLadingUnSignfor = warehouseIndexMapper.findBillLadingUnSignforByDay(warehouseId); indexBillLadingSignforDayDataVO.setUnSignNum(dayBillLadingUnSignfor); //计算当天的签收率 indexBillLadingSignforDayDataVO.setClerkSignforScale("0.0000"); - if (!"0".equals(dayBillLadingSignfor) && !"0".equals(dayBillLadingUnSignfor)) { + if (dayBillLadingSignfor>0 && dayBillLadingUnSignfor>0) { BigDecimal bd1 = new BigDecimal(dayBillLadingSignfor); BigDecimal bd2 = new BigDecimal(dayBillLadingUnSignfor); BigDecimal multiply = bd1.divide(bd1.add(bd2), 4, BigDecimal.ROUND_CEILING); @@ -782,13 +790,13 @@ public class WarehouseIndexServiceImpl implements IWarehouseIndexService { indexBillLadingSignforDayDataVO.setClerkSignforScale(signScale); } //查询当天计划数 - String dayBillLadingPlanNum = warehouseIndexMapper.findBillLadingPlanNumByDay(warehouseId); + Integer dayBillLadingPlanNum = warehouseIndexMapper.findBillLadingPlanNumByDay(warehouseId); indexBillLadingSignforDayDataVO.setPlanNum(dayBillLadingPlanNum); indexBillLadingSignforDayDataVO.setClerkOverTimeScale("0.0000"); //查询当天文员复核数 - String dayBillLadingSignforNum = warehouseIndexMapper.findBillLadingSignForNumByDay(warehouseId); + Integer dayBillLadingSignforNum = warehouseIndexMapper.findBillLadingSignForNumByDay(warehouseId); indexBillLadingSignforDayDataVO.setClerkSignNum(dayBillLadingSignforNum); - if (!"0".equals(dayBillLadingPlanNum) && !"0".equals(dayBillLadingSignforNum)) { + if (dayBillLadingPlanNum > 0 && dayBillLadingSignforNum > 0) { //计算当月的超时签收率 BigDecimal bd1 = new BigDecimal(dayBillLadingSignforNum); BigDecimal bd2 = new BigDecimal(dayBillLadingPlanNum); @@ -797,7 +805,7 @@ public class WarehouseIndexServiceImpl implements IWarehouseIndexService { indexBillLadingSignforDayDataVO.setClerkOverTimeScale(signScale); } //查询当天签收超时数 - String dayBillLadingverTimeNum = warehouseIndexMapper.findBillLadingOverTimeNumByDay(warehouseId); + Integer dayBillLadingverTimeNum = warehouseIndexMapper.findBillLadingOverTimeNumByDay(warehouseId); indexBillLadingSignforDayDataVO.setClerkOverTimeSignfoNum(dayBillLadingverTimeNum); return indexBillLadingSignforDayDataVO; } @@ -808,14 +816,14 @@ public class WarehouseIndexServiceImpl implements IWarehouseIndexService { indexSignforMonthDataVO.setWarehouseId(warehouseId); indexSignforMonthDataVO.setType(1); //查询当月签收数据 - String monthSignforNum = warehouseIndexMapper.findSignforDataByMonth(warehouseId); + Integer monthSignforNum = warehouseIndexMapper.findSignforDataByMonth(warehouseId); indexSignforMonthDataVO.setSignNum(monthSignforNum); //查询当月未签收数据 - String monthUnSignforNum = warehouseIndexMapper.findUnSignforDataByMonth(warehouseId); + Integer monthUnSignforNum = warehouseIndexMapper.findUnSignforDataByMonth(warehouseId); indexSignforMonthDataVO.setUnSignNum(monthUnSignforNum); //计算签收率 indexSignforMonthDataVO.setSignScale("0.0000"); - if (!"0".equals(monthSignforNum) && !"0".equals(monthUnSignforNum)) { + if (monthSignforNum > 0 && monthUnSignforNum > 0) { BigDecimal bd1 = new BigDecimal(monthSignforNum); BigDecimal bd2 = new BigDecimal(monthUnSignforNum); BigDecimal multiply = bd1.divide(bd1.add(bd2), 4, BigDecimal.ROUND_CEILING); @@ -823,11 +831,11 @@ public class WarehouseIndexServiceImpl implements IWarehouseIndexService { indexSignforMonthDataVO.setSignScale(signScale); } //查询当月文员复核数 - String monthClerkSignforNum = warehouseIndexMapper.findClerkSignforNumByMonth(warehouseId); + Integer monthClerkSignforNum = warehouseIndexMapper.findClerkSignforNumByMonth(warehouseId); indexSignforMonthDataVO.setClerkSignNum(monthClerkSignforNum); - String monthPlan = warehouseIndexMapper.findPlanNumByMonth(warehouseId); + Integer monthPlan = warehouseIndexMapper.findPlanNumByMonth(warehouseId); indexSignforMonthDataVO.setClerkSignNum(monthPlan); - if (!"0".equals(monthClerkSignforNum) && !"0".equals(monthPlan)) { + if (monthClerkSignforNum > 0 && monthPlan > 0) { BigDecimal bd1 = new BigDecimal(monthClerkSignforNum); BigDecimal bd2 = new BigDecimal(monthPlan); BigDecimal multiply = bd1.divide(bd1.add(bd2), 4, BigDecimal.ROUND_CEILING); @@ -836,9 +844,9 @@ public class WarehouseIndexServiceImpl implements IWarehouseIndexService { } indexSignforMonthDataVO.setClerkOverTimeScale("0.0000"); //查询当月文员复核 - String monthClerkOverTimeSignfoNum = warehouseIndexMapper.findClerkOverTimeNumByMonth(warehouseId); + Integer monthClerkOverTimeSignfoNum = warehouseIndexMapper.findClerkOverTimeNumByMonth(warehouseId); indexSignforMonthDataVO.setClerkOverTimeSignfoNum(monthClerkOverTimeSignfoNum); - if (!"0".equals(monthClerkOverTimeSignfoNum) && !"0".equals(monthPlan)) { + if (monthClerkOverTimeSignfoNum > 0 && monthPlan > 0) { BigDecimal bd1 = new BigDecimal(monthClerkOverTimeSignfoNum); BigDecimal bd2 = new BigDecimal(monthPlan); BigDecimal multiply = bd1.divide(bd1.add(bd2), 4, BigDecimal.ROUND_CEILING); @@ -853,13 +861,13 @@ public class WarehouseIndexServiceImpl implements IWarehouseIndexService { indexSignforDayDataVO.setWarehouseId(warehouseId); indexSignforDayDataVO.setType(1); //查询当天签收数据 - String daySignforNum = warehouseIndexMapper.findSignforDataByDay(warehouseId); + Integer daySignforNum = warehouseIndexMapper.findSignforDataByDay(warehouseId); indexSignforDayDataVO.setSignNum(daySignforNum); //查询当天未签收件数 - String dayUnSignforNum = warehouseIndexMapper.findUnSignforDataByDay(warehouseId); + Integer dayUnSignforNum = warehouseIndexMapper.findUnSignforDataByDay(warehouseId); //计算签收率 indexSignforDayDataVO.setSignScale("0.000"); - if (!"0".equals(daySignforNum) && !"0".equals(dayUnSignforNum)) { + if (daySignforNum > 0 && daySignforNum > 0) { BigDecimal bd1 = new BigDecimal(daySignforNum); BigDecimal bd2 = new BigDecimal(dayUnSignforNum); BigDecimal divide = bd1.divide(bd1.add(bd2), 4, BigDecimal.ROUND_HALF_EVEN); @@ -868,14 +876,14 @@ public class WarehouseIndexServiceImpl implements IWarehouseIndexService { } indexSignforDayDataVO.setUnSignNum(dayUnSignforNum); //查询文员复核数量 - String dayClerkSignforNum = warehouseIndexMapper.findClerkSignforNumByDay(warehouseId); + Integer dayClerkSignforNum = warehouseIndexMapper.findClerkSignforNumByDay(warehouseId); indexSignforDayDataVO.setClerkSignNum(dayClerkSignforNum); //查询计划数量 - String dayPlanByday = warehouseIndexMapper.findPlanNumByDay(warehouseId); + Integer dayPlanByday = warehouseIndexMapper.findPlanNumByDay(warehouseId); indexSignforDayDataVO.setPlanNum(dayClerkSignforNum); //计算文员签收率 indexSignforDayDataVO.setClerkSignforScale("0.0000"); - if (!"0".equals(dayClerkSignforNum) && !"0".equals(dayPlanByday)) { + if (dayClerkSignforNum > 0 && dayPlanByday > 0) { BigDecimal bd1 = new BigDecimal(dayClerkSignforNum); BigDecimal bd2 = new BigDecimal(dayPlanByday); BigDecimal multiply = bd1.divide(bd1.add(bd2), 4, BigDecimal.ROUND_CEILING); @@ -883,7 +891,7 @@ public class WarehouseIndexServiceImpl implements IWarehouseIndexService { indexSignforDayDataVO.setClerkSignforScale(signScale); } //文员超时复核数 - String dayClerkOverTimeSignfoNum = warehouseIndexMapper.findClerkOverTimeNumByDay(warehouseId); + Integer dayClerkOverTimeSignfoNum = warehouseIndexMapper.findClerkOverTimeNumByDay(warehouseId); indexSignforDayDataVO.setClerkOverTimeSignfoNum(dayClerkOverTimeSignfoNum); indexSignforDayDataVO.setClerkSignNum(dayClerkSignforNum); return indexSignforDayDataVO; diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/vo/indexCount/IndexSignforDataVO.java b/blade-service/logpm-report/src/main/java/com/logpm/report/vo/indexCount/IndexSignforDataVO.java index b10053236..2970edba8 100644 --- a/blade-service/logpm-report/src/main/java/com/logpm/report/vo/indexCount/IndexSignforDataVO.java +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/vo/indexCount/IndexSignforDataVO.java @@ -11,11 +11,11 @@ public class IndexSignforDataVO implements Serializable { //类型 1配送 2自提 private Integer type; //签收数 - private String signNum; + private Integer signNum; //未签收数 - private String UnSignNum; + private Integer UnSignNum; //文员超时为复核数 - private String clerkOverTimeSignfoNum; + private Integer clerkOverTimeSignfoNum; //文员超时为复核数 private String clerkOverTimeScale; @@ -25,8 +25,8 @@ public class IndexSignforDataVO implements Serializable { //复核率 private String ClerkSignforScale; //复核数 - private String clerkSignNum; - private String planNum; + private Integer clerkSignNum; + private Integer planNum; //仓库名称 private String warehouseName; private Long warehouseId;