diff --git a/blade-biz-common/src/main/java/org/springblade/common/constant/trayallocation/TrayAllocationConstants.java b/blade-biz-common/src/main/java/org/springblade/common/constant/trayallocation/TrayAllocationConstants.java new file mode 100644 index 000000000..ea3898809 --- /dev/null +++ b/blade-biz-common/src/main/java/org/springblade/common/constant/trayallocation/TrayAllocationConstants.java @@ -0,0 +1,25 @@ +package org.springblade.common.constant.trayallocation; + + +import org.springblade.common.constant.ModuleNameConstant; + +public class TrayAllocationConstants { + + + /** + * 清除包件上的托盘信息 + */ + public static final String WAREHOUSE_PRACL_CLEAR_TRAY_EXCHANGE = "warehouse.pracl.clear.tray.exchange" + ModuleNameConstant.DEVAUTH; + public static final String WAREHOUSE_PRACL_CLEAR_TRAY_QUEUE = "warehouse.pracl.clear.tray.queue" + ModuleNameConstant.DEVAUTH; + public static final String WAREHOUSE_PRACL_CLEAR_TRAY_ROUTINGKEY = "warehouse.pracl.clear.tray.key" + ModuleNameConstant.DEVAUTH; + + /** + * 清除包件上的库位信息 + */ + public static final String WAREHOUSE_PRACL_CLEAR_ALLOCATION_EXCHANGE = "warehouse.pracl.clear.allocation.exchange" + ModuleNameConstant.DEVAUTH; + public static final String WAREHOUSE_PRACL_CLEAR_ALLOCATION_QUEUE = "warehouse.pracl.clear.allocation.queue" + ModuleNameConstant.DEVAUTH; + public static final String WAREHOUSE_PRACL_CLEAR_ALLOCATION_ROUTINGKEY = "warehouse.pracl.clear.allocation.key" + ModuleNameConstant.DEVAUTH; + + + +} diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/warehouse/AllocationInfoListener.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/warehouse/AllocationInfoListener.java new file mode 100644 index 000000000..8215c82de --- /dev/null +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/warehouse/AllocationInfoListener.java @@ -0,0 +1,63 @@ +package com.logpm.distribution.receiver.warehouse; + + +import cn.hutool.json.JSONUtil; +import com.logpm.distribution.mapper.DistributionParcelListMapper; +import com.rabbitmq.client.Channel; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang.StringUtils; +import org.springblade.common.constant.trayallocation.TrayAllocationConstants; +import org.springframework.amqp.core.ExchangeTypes; +import org.springframework.amqp.rabbit.annotation.Exchange; +import org.springframework.amqp.rabbit.annotation.Queue; +import org.springframework.amqp.rabbit.annotation.QueueBinding; +import org.springframework.amqp.rabbit.annotation.RabbitListener; +import org.springframework.amqp.support.AmqpHeaders; +import org.springframework.messaging.handler.annotation.Header; +import org.springframework.stereotype.Component; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +@Slf4j +@Component +@AllArgsConstructor +public class AllocationInfoListener { + + private final DistributionParcelListMapper distributionParcelListMapper; + + @RabbitListener(bindings = @QueueBinding( + value = @Queue(name = TrayAllocationConstants.WAREHOUSE_PRACL_CLEAR_ALLOCATION_QUEUE, durable = "true"), + exchange = @Exchange(name = TrayAllocationConstants.WAREHOUSE_PRACL_CLEAR_ALLOCATION_EXCHANGE, type = ExchangeTypes.FANOUT) + ), ackMode = "MANUAL") + public void clearPraclAllocation(String msg, Channel channel, @Header(AmqpHeaders.DELIVERY_TAG) long tag) { + + if(StringUtils.isNotBlank(msg)){ + + List ids = JSONUtil.toList(msg, Long.class); + //把ids每200个分组 + List> partitions = new ArrayList<>(); + for (int i = 0; i < ids.size(); i += 200) { + partitions.add(ids.subList(i, Math.min(i + 200, ids.size()))); + } + + partitions.forEach(clearTrayList -> { + log.info("############clearPraclAllocation: 当前处理的ids {}",clearTrayList); + + distributionParcelListMapper.clearAllocationByIds(clearTrayList); + }); + + }else{ + log.warn("#########clearPraclAllocation: 消息数据为空 msg={}",msg); + } + + try { + channel.basicAck(tag, false); + } catch (IOException e) { + throw new RuntimeException(e); + } + } + +} diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/warehouse/TrayInfoListener.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/warehouse/TrayInfoListener.java new file mode 100644 index 000000000..eed093827 --- /dev/null +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/warehouse/TrayInfoListener.java @@ -0,0 +1,63 @@ +package com.logpm.distribution.receiver.warehouse; + + +import cn.hutool.json.JSONUtil; +import com.logpm.distribution.mapper.DistributionParcelListMapper; +import com.rabbitmq.client.Channel; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang.StringUtils; +import org.springblade.common.constant.trayallocation.TrayAllocationConstants; +import org.springframework.amqp.core.ExchangeTypes; +import org.springframework.amqp.rabbit.annotation.Exchange; +import org.springframework.amqp.rabbit.annotation.Queue; +import org.springframework.amqp.rabbit.annotation.QueueBinding; +import org.springframework.amqp.rabbit.annotation.RabbitListener; +import org.springframework.amqp.support.AmqpHeaders; +import org.springframework.messaging.handler.annotation.Header; +import org.springframework.stereotype.Component; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +@Slf4j +@Component +@AllArgsConstructor +public class TrayInfoListener { + + private final DistributionParcelListMapper distributionParcelListMapper; + + @RabbitListener(bindings = @QueueBinding( + value = @Queue(name = TrayAllocationConstants.WAREHOUSE_PRACL_CLEAR_TRAY_QUEUE, durable = "true"), + exchange = @Exchange(name = TrayAllocationConstants.WAREHOUSE_PRACL_CLEAR_TRAY_EXCHANGE, type = ExchangeTypes.FANOUT) + ), ackMode = "MANUAL") + public void clearPraclTray(String msg, Channel channel, @Header(AmqpHeaders.DELIVERY_TAG) long tag) { + + if(StringUtils.isNotBlank(msg)){ + + List ids = JSONUtil.toList(msg, Long.class); + //把ids每200个分组 + List> partitions = new ArrayList<>(); + for (int i = 0; i < ids.size(); i += 200) { + partitions.add(ids.subList(i, Math.min(i + 200, ids.size()))); + } + + partitions.forEach(clearTrayList -> { + log.info("############clearPraclTray: 当前处理的ids {}",clearTrayList); + + distributionParcelListMapper.clearPalletByIds(clearTrayList); + }); + + }else{ + log.warn("#########clearPraclTray: 消息数据为空 msg={}",msg); + } + + try { + channel.basicAck(tag, false); + } catch (IOException e) { + throw new RuntimeException(e); + } + } + +} diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java index 79e3114d9..32706b204 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java @@ -9319,8 +9319,10 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl selectDistributionParcelListPage(IPage page, DistributionParcelListVO distributionParcelList) { @@ -1332,7 +1340,18 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl clearTrayList) { - baseMapper.clearPalletByIds(clearTrayList); + try{ + baseMapper.clearPalletByIds(clearTrayList); + }catch (Exception e){ + log.error("清空包件托盘异常",e); + factoryDataClient.sendMessage(SendMsg.builder() + .exchange(TrayAllocationConstants.WAREHOUSE_PRACL_CLEAR_TRAY_EXCHANGE) + .routingKey(TrayAllocationConstants.WAREHOUSE_PRACL_CLEAR_TRAY_ROUTINGKEY) + .message(JSONUtil.toJsonStr(clearTrayList)) + .delay(10000) + .build()); + } + } @Override @@ -1342,7 +1361,20 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl clearTrayList) { - baseMapper.clearAllocationByIds(clearTrayList); + + try{ + baseMapper.clearAllocationByIds(clearTrayList); + }catch (Exception e){ + log.error("清空包件托盘异常",e); + factoryDataClient.sendMessage(SendMsg.builder() + .exchange(TrayAllocationConstants.WAREHOUSE_PRACL_CLEAR_ALLOCATION_EXCHANGE) + .routingKey(TrayAllocationConstants.WAREHOUSE_PRACL_CLEAR_ALLOCATION_ROUTINGKEY) + .message(JSONUtil.toJsonStr(clearTrayList)) + .delay(10000) + .build()); + } + + } @Override 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 9d8426064..fd5b1563c 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 @@ -872,7 +872,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl nodeFanoutMsg = buildDistributionSignforVOByStock(deliveryListEntity, pushList, OperatModeConstant.CLERK); + NodeFanoutMsg nodeFanoutMsg = buildDistributionSignforVOByStock(deliveryListEntity, pushList, OperatModeConstant.CLERK, signforTime); distributionNodeWorkService.signFor(nodeFanoutMsg, AuthUtil.getUser()); } @@ -1354,6 +1355,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl nodeFanoutMsg = buildDistributionSignforVOByZero(deliveryListEntity, pushList,OperatModeConstant.CLERK); + NodeFanoutMsg nodeFanoutMsg = buildDistributionSignforVOByZero(deliveryListEntity, pushList,OperatModeConstant.CLERK, signforTime); distributionNodeWorkService.signFor(nodeFanoutMsg, AuthUtil.getUser()); @@ -2885,7 +2887,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl nodeFanoutMsg = buildDistributionSignforVO(deliveryListEntity, distributionReservationEntity, pushList, OperatModeConstant.SCAN); + NodeFanoutMsg nodeFanoutMsg = buildDistributionSignforVO(deliveryListEntity, distributionReservationEntity, pushList, OperatModeConstant.SCAN, signforTime); distributionNodeWorkService.signFor(nodeFanoutMsg, AuthUtil.getUser()); @@ -3206,7 +3208,8 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl buildDistributionSignforVOByStock(DistributionDeliveryListEntity distributionDeliveryListEntity, List pushList, String operatMode) { + private NodeFanoutMsg buildDistributionSignforVOByStock(DistributionDeliveryListEntity distributionDeliveryListEntity, + List pushList, String operatMode,Date signforTime) { NodeFanoutMsg nodeFanoutMsg = new NodeFanoutMsg(); nodeFanoutMsg.setBizOperation(BizOperationEnums.ADD); @@ -3214,7 +3217,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl buildDistributionSignforVO(DistributionDeliveryListEntity distributionDeliveryListEntity, DistributionReservationEntity distributionReservationEntity, List pushList, String operatMode) { + private NodeFanoutMsg buildDistributionSignforVO(DistributionDeliveryListEntity distributionDeliveryListEntity, DistributionReservationEntity distributionReservationEntity, List pushList, String operatMode, Date signforTime) { NodeFanoutMsg nodeFanoutMsg = new NodeFanoutMsg(); nodeFanoutMsg.setBizOperation(BizOperationEnums.ADD); @@ -3281,7 +3284,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl nodeFanoutMsg = buildDistributionSignforVO(deliveryListEntity, distributionReservationEntity, pushDatas, OperatModeConstant.CLERK); + NodeFanoutMsg nodeFanoutMsg = buildDistributionSignforVO(deliveryListEntity, distributionReservationEntity, pushDatas, OperatModeConstant.CLERK, signforTime); distributionNodeWorkService.signFor(nodeFanoutMsg, AuthUtil.getUser()); @@ -3788,6 +3792,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl nodeFanoutMsg = buildDistributionSignforVO(distributionDeliveryListEntity, reservationEntity, pushList, OperatModeConstant.SCAN); + NodeFanoutMsg nodeFanoutMsg = buildDistributionSignforVO(distributionDeliveryListEntity, reservationEntity, pushList, OperatModeConstant.SCAN, signforTime); distributionNodeWorkService.signFor(nodeFanoutMsg, AuthUtil.getUser()); return Resp.scanSuccess("操作成功", s); @@ -4310,6 +4315,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl distributionLoadscanEntities = distributionLoadscanMapper.selectList(new QueryWrapper().lambda() @@ -4366,7 +4372,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl nodeFanoutMsg = buildDistributionSignforVOByStock(deliveryListEntity, pushList, OperatModeConstant.SCAN); + NodeFanoutMsg nodeFanoutMsg = buildDistributionSignforVOByStock(deliveryListEntity, pushList, OperatModeConstant.SCAN, signforTime); distributionNodeWorkService.signFor(nodeFanoutMsg, AuthUtil.getUser()); @@ -6945,6 +6951,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl nodeFanoutMsg = buildDistributionSignforVOByZero(deliveryListEntity, pushList, OperatModeConstant.SCAN); + NodeFanoutMsg nodeFanoutMsg = buildDistributionSignforVOByZero(deliveryListEntity, pushList, OperatModeConstant.SCAN, signforTime); distributionNodeWorkService.signFor(nodeFanoutMsg, AuthUtil.getUser()); @@ -7192,7 +7199,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl buildDistributionSignforVOByZero(DistributionDeliveryListEntity distributionDeliveryListEntity, List pushList,String operatMode) { + private NodeFanoutMsg buildDistributionSignforVOByZero(DistributionDeliveryListEntity distributionDeliveryListEntity, List pushList,String operatMode, Date signforTime) { NodeFanoutMsg nodeFanoutMsg = new NodeFanoutMsg(); nodeFanoutMsg.setBizOperation(BizOperationEnums.ADD); @@ -7200,7 +7207,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl nodeFanoutMsg = buildDistributionSignforVOByStock(deliveryListEntity, pushInventoryList, OperatModeConstant.SCAN); + NodeFanoutMsg nodeFanoutMsg = buildDistributionSignforVOByStock(deliveryListEntity, pushInventoryList, OperatModeConstant.SCAN, signforTime); distributionNodeWorkService.signFor(nodeFanoutMsg, AuthUtil.getUser()); } if (!pushList.isEmpty()) { // 构建新作业节点回传 - NodeFanoutMsg nodeFanoutMsg = buildDistributionSignforVO(deliveryListEntity, reservationEntity, pushList, OperatModeConstant.SCAN); + NodeFanoutMsg nodeFanoutMsg = buildDistributionSignforVO(deliveryListEntity, reservationEntity, pushList, OperatModeConstant.SCAN, signforTime); distributionNodeWorkService.signFor(nodeFanoutMsg, AuthUtil.getUser()); } if (!orderCodes.isEmpty()) { diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/dto/ReportTimeDTO.java b/blade-service/logpm-report/src/main/java/com/logpm/report/dto/ReportTimeDTO.java index 3fb02a2b7..cbc1181b1 100644 --- a/blade-service/logpm-report/src/main/java/com/logpm/report/dto/ReportTimeDTO.java +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/dto/ReportTimeDTO.java @@ -39,6 +39,8 @@ public class ReportTimeDTO implements Serializable { private String destinationWarehouseName; private String trainNumber; private String loadCode; + private String loadingLoadCode; + private String unloadLoadCode; private String openTimeStartStr; diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportTimeMapper.xml b/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportTimeMapper.xml index fe6929ba0..63c8ddc24 100644 --- a/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportTimeMapper.xml +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportTimeMapper.xml @@ -1112,6 +1112,7 @@ lww.departure_warehouse_name departureWarehouseName, lww.destination_warehouse_name destinationWarehouseName, lww.brand brand, + IFNULL(t.hours_time,#{param.hoursTime}) hoursTime, count(lww.id) waybillNum, sum(lww.total_count) openNum, sum(IFNULL(t.totalNum,0)) arriveNum, @@ -1138,28 +1139,29 @@ IFNULL(round(sum(IFNULL(t.sevenToTenNum,0))/sum(lww.total_count)*100,2),'0.00') sevenToTenArriveRate, sum(IFNULL(t.moreTenNum,0)) moreTenArriveNum, IFNULL(round(sum(IFNULL(t.moreTenNum,0))/sum(lww.total_count)*100,2),'0.00') moreTenArriveRate - from logpm_warehouse_waybill lww - left join logpm_warehouse_warehouse waw on waw.id = lww.departure_warehouse_id - left join (select ldpl.waybill_id, - sum(ldpn.quantity) totalNum, - sum(TIMESTAMPDIFF(SECOND,lw.create_time,ldpl.create_time )) timeSecond, - sum(if(ldpl.create_time <= DATE_ADD( lw.create_time, INTERVAL IFNULL(lrat.hours_time,0) HOUR ),ldpn.quantity,0)) onTimeNum, - sum(if(ldpl.create_time <= DATE_ADD( lw.create_time, INTERVAL 24 HOUR ),ldpn.quantity,0)) oneNum, - sum(if(DATE_ADD( lw.create_time, INTERVAL 24 HOUR )<ldpl.create_time and ldpl.create_time <= DATE_ADD( lw.create_time, INTERVAL 48 HOUR ),ldpn.quantity,0)) twoNum, - sum(if(DATE_ADD( lw.create_time, INTERVAL 48 HOUR )<ldpl.create_time and ldpl.create_time <= DATE_ADD( lw.create_time, INTERVAL 72 HOUR ),ldpn.quantity,0)) threeNum, - sum(if(DATE_ADD( lw.create_time, INTERVAL 72 HOUR )<ldpl.create_time and ldpl.create_time <= DATE_ADD( lw.create_time, INTERVAL 96 HOUR ),ldpn.quantity,0)) fourNum, - sum(if(DATE_ADD( lw.create_time, INTERVAL 96 HOUR )<ldpl.create_time and ldpl.create_time <= DATE_ADD( lw.create_time, INTERVAL 120 HOUR ),ldpn.quantity,0)) fiveNum, - sum(if(DATE_ADD( lw.create_time, INTERVAL 120 HOUR )<ldpl.create_time and ldpl.create_time <= DATE_ADD( lw.create_time, INTERVAL 144 HOUR ),ldpn.quantity,0)) sixNum, - sum(if(DATE_ADD( lw.create_time, INTERVAL 144 HOUR )<ldpl.create_time and ldpl.create_time <= DATE_ADD( lw.create_time, INTERVAL 168 HOUR ),ldpn.quantity,0)) sevenNum, - sum(if(DATE_ADD( lw.create_time, INTERVAL 168 HOUR )<ldpl.create_time and ldpl.create_time <= DATE_ADD( lw.create_time, INTERVAL 240 HOUR ),ldpn.quantity,0)) sevenToTenNum, - sum(if(DATE_ADD( lw.create_time, INTERVAL 240 HOUR )<ldpl.create_time,ldpn.quantity,0)) moreTenNum - from logpm_distribution_parcel_list ldpl - left join logpm_distribution_parcel_number ldpn on ldpn.parcel_list_id = ldpl.id - left join logpm_warehouse_waybill lw on lw.id = ldpl.waybill_id + from (select lw.id waybillId, + lrat.hours_time, + sum(ltcls.unload_num) totalNum, + sum(TIMESTAMPDIFF(SECOND,lw.create_time,ltcls.unload_time )) timeSecond, + sum(if(ltcls.unload_time <= DATE_ADD( lw.create_time, INTERVAL IFNULL(lrat.hours_time,#{param.hoursTime}) HOUR ),ltcls.unload_num,0)) onTimeNum, + sum(if(ltcls.unload_time <= DATE_ADD( lw.create_time, INTERVAL 24 HOUR ),ltcls.unload_num,0)) oneNum, + sum(if(DATE_ADD( lw.create_time, INTERVAL 24 HOUR )<ltcls.unload_time and ltcls.unload_time <= DATE_ADD( lw.create_time, INTERVAL 48 HOUR ),ltcls.unload_num,0)) twoNum, + sum(if(DATE_ADD( lw.create_time, INTERVAL 48 HOUR )<ltcls.unload_time and ltcls.unload_time <= DATE_ADD( lw.create_time, INTERVAL 72 HOUR ),ltcls.unload_num,0)) threeNum, + sum(if(DATE_ADD( lw.create_time, INTERVAL 72 HOUR )<ltcls.unload_time and ltcls.unload_time <= DATE_ADD( lw.create_time, INTERVAL 96 HOUR ),ltcls.unload_num,0)) fourNum, + sum(if(DATE_ADD( lw.create_time, INTERVAL 96 HOUR )<ltcls.unload_time and ltcls.unload_time <= DATE_ADD( lw.create_time, INTERVAL 120 HOUR ),ltcls.unload_num,0)) fiveNum, + sum(if(DATE_ADD( lw.create_time, INTERVAL 120 HOUR )<ltcls.unload_time and ltcls.unload_time <= DATE_ADD( lw.create_time, INTERVAL 144 HOUR ),ltcls.unload_num,0)) sixNum, + sum(if(DATE_ADD( lw.create_time, INTERVAL 144 HOUR )<ltcls.unload_time and ltcls.unload_time <= DATE_ADD( lw.create_time, INTERVAL 168 HOUR ),ltcls.unload_num,0)) sevenNum, + sum(if(DATE_ADD( lw.create_time, INTERVAL 168 HOUR )<ltcls.unload_time and ltcls.unload_time <= DATE_ADD( lw.create_time, INTERVAL 240 HOUR ),ltcls.unload_num,0)) sevenToTenNum, + sum(if(DATE_ADD( lw.create_time, INTERVAL 240 HOUR )<ltcls.unload_time,ltcls.unload_num,0)) moreTenNum + from logpm_trunkline_cars_load_scan ltcls + left join logpm_warehouse_waybill lw on lw.waybill_no = ltcls.waybill_no left join logpm_reportconfig_all_trunkline lrat on lrat.departure_warehouse_id = lw.departure_warehouse_id and lrat.destination_warehouse_id = lw.destination_warehouse_id and lrat.is_deleted=0 - where ldpl.conditions = 3 + where ltcls.type = 2 + and ltcls.scan_status = 2 + and ltcls.unload_check = 1 + and ltcls.unload_node_id = lw.destination_warehouse_id and lw.departure_warehouse_id != lw.destination_warehouse_id - and ldpl.create_time > '2024-10-22 00:00:00' + and lw.create_time > '2024-10-22 00:00:00' and lw.brand in @@ -1184,43 +1186,16 @@ and lw.create_time <= #{param.endTime} - and ldpl.warehouse_id = ldpl.accept_warehouse_id - and ldpl.warehouse_id != ldpl.send_warehouse_id - and ldpl.order_code = ldpl.waybill_number - -- and ldpl.waybill_id = 1853372208481284097 - group by ldpl.waybill_id) t on t.waybill_id = lww.id - where lww.waybill_type = 2 - and lww.departure_warehouse_id != lww.destination_warehouse_id + group by lw.id,lrat.hours_time) t + left join logpm_warehouse_waybill lww on lww.id = t.waybillId + left join logpm_warehouse_warehouse waw on waw.id = lww.departure_warehouse_id + where 1=1 and waw.business_line in #{item} - - and lww.brand in - - #{item} - - - - and lww.departure_warehouse_id in - - #{item} - - - - and lww.destination_warehouse_id in - - #{item} - - - - and lww.create_time >= #{param.startTime} - - - and lww.create_time <= #{param.endTime} - group by waw.business_line, lww.departure_warehouse_name, lww.destination_warehouse_name, @@ -1232,6 +1207,7 @@ lww.departure_warehouse_name departureWarehouseName, lww.destination_warehouse_name destinationWarehouseName, lww.brand brand, + IFNULL(t.hours_time,#{param.hoursTime}) hoursTime, count(lww.id) waybillNum, sum(lww.total_count) openNum, sum(IFNULL(t.totalNum,0)) arriveNum, @@ -1273,13 +1249,15 @@ sum(if(DATE_ADD( lw.create_time, INTERVAL 144 HOUR )<ldpl.create_time and ldpl.create_time <= DATE_ADD( lw.create_time, INTERVAL 168 HOUR ),ldpn.quantity,0)) sevenNum, sum(if(DATE_ADD( lw.create_time, INTERVAL 168 HOUR )<ldpl.create_time and ldpl.create_time <= DATE_ADD( lw.create_time, INTERVAL 240 HOUR ),ldpn.quantity,0)) sevenToTenNum, sum(if(DATE_ADD( lw.create_time, INTERVAL 240 HOUR )<ldpl.create_time,ldpn.quantity,0)) moreTenNum - from logpm_distribution_parcel_list ldpl - left join logpm_distribution_parcel_number ldpn on ldpn.parcel_list_id = ldpl.id - left join logpm_warehouse_waybill lw on lw.id = ldpl.waybill_id + from logpm_trunkline_cars_load_scan ltcls + left join logpm_warehouse_waybill lw on lw.waybill_no = ltcls.waybill_no left join logpm_reportconfig_all_trunkline lrat on lrat.departure_warehouse_id = lw.departure_warehouse_id and lrat.destination_warehouse_id = lw.destination_warehouse_id and lrat.is_deleted=0 - where ldpl.conditions = 3 + where ltcls.type = 2 + and ltcls.scan_status = 2 + and ltcls.unload_check = 1 + and ltcls.unload_node_id = lw.destination_warehouse_id and lw.departure_warehouse_id != lw.destination_warehouse_id - and ldpl.create_time > '2024-10-22 00:00:00' + and lw.create_time > '2024-10-22 00:00:00' and lw.brand in @@ -1304,43 +1282,16 @@ and lw.create_time <= #{param.endTime} - and ldpl.warehouse_id = ldpl.accept_warehouse_id - and ldpl.warehouse_id != ldpl.send_warehouse_id - and ldpl.order_code = ldpl.waybill_number - -- and ldpl.waybill_id = 1853372208481284097 - group by ldpl.waybill_id) t on t.waybill_id = lww.id - where lww.waybill_type = 2 - and lww.departure_warehouse_id != lww.destination_warehouse_id + group by lw.id,lrat.hours_time) t + left join logpm_warehouse_waybill lww on lww.id = t.waybillId + left join logpm_warehouse_warehouse waw on waw.id = lww.departure_warehouse_id + where 1=1 and waw.business_line in #{item} - - and lww.brand in - - #{item} - - - - and lww.departure_warehouse_id in - - #{item} - - - - and lww.destination_warehouse_id in - - #{item} - - - - and lww.create_time >= #{param.startTime} - - - and lww.create_time <= #{param.endTime} - group by waw.business_line, lww.departure_warehouse_name, lww.destination_warehouse_name, @@ -1356,7 +1307,8 @@ lww.departure_warehouse_name departureWarehouseName, lww.destination_warehouse_name destinationWarehouseName, GROUP_CONCAT(DISTINCT ltad.train_number) trainNumber, - GROUP_CONCAT(DISTINCT IFNULL(ltcls.load_code,ltclsm.load_code)) loadCode, + GROUP_CONCAT(DISTINCT ltcls.load_code) loadingLoadCode, + GROUP_CONCAT(DISTINCT ltclsm.load_code) unloadLoadCode, count(ltad.id) totalNum, min(ltad.create_time) createTime, min(ldpls.create_time) startIncomingTime, @@ -1387,7 +1339,7 @@ left join logpm_trunkline_cars_load_scan ltclsm on ltclsm.scan_code = ldplm.order_package_code and ltclsm.unload_node_id = ldplm.warehouse_id left join logpm_trunkline_cars_load_line ltcllm on ltcllm.load_id = ltclsm.load_id and ltcllm.node_id = ltclsm.unload_node_id left join logpm_quality_deliver lqd on lqd.order_package_code = ltad.order_package_code and lqd.retention_time is null - left join logpm_reportconfig_order_all oat on oat.departure_warehouse_id = lww.departure_warehouse_id and oat.destination_warehouse_id = lww.destination_warehouse_id and oat.brand = lww.brand + left join logpm_reportconfig_order_all oat on oat.departure_warehouse_id = lww.departure_warehouse_id and oat.destination_warehouse_id = lww.destination_warehouse_id where ltad.waybill_id is not null and ltad.create_time > '2024-10-22 00:00:00' and lww.departure_warehouse_id != lww.destination_warehouse_id @@ -1454,8 +1406,11 @@ and GROUP_CONCAT(DISTINCT ltad.train_number) like concat('%',#{param.trainNumber},'%') - - and GROUP_CONCAT(DISTINCT IFNULL(ltcls.load_code,ltclsm.load_code)) like concat('%',#{param.loadCode},'%') + + and GROUP_CONCAT(DISTINCT ltcls.load_code) like concat('%',#{param.loadingLoadCode},'%') + + + and GROUP_CONCAT(DISTINCT ltclsm.load_code) like concat('%',#{param.unloadLoadCode},'%') @@ -1470,7 +1425,8 @@ lww.departure_warehouse_name departureWarehouseName, lww.destination_warehouse_name destinationWarehouseName, GROUP_CONCAT(DISTINCT ltad.train_number) trainNumber, - GROUP_CONCAT(DISTINCT IFNULL(ltcls.load_code,ltclsm.load_code)) loadCode, + GROUP_CONCAT(DISTINCT ltcls.load_code) loadingLoadCode, + GROUP_CONCAT(DISTINCT ltclsm.load_code) unloadLoadCode, count(ltad.id) totalNum, min(ltad.create_time) createTime, min(ldpls.create_time) startIncomingTime, @@ -1501,7 +1457,7 @@ left join logpm_trunkline_cars_load_scan ltclsm on ltclsm.scan_code = ldplm.order_package_code and ltclsm.unload_node_id = ldplm.warehouse_id left join logpm_trunkline_cars_load_line ltcllm on ltcllm.load_id = ltclsm.load_id and ltcllm.node_id = ltclsm.unload_node_id left join logpm_quality_deliver lqd on lqd.order_package_code = ltad.order_package_code and lqd.retention_time is null - left join logpm_reportconfig_order_all oat on oat.departure_warehouse_id = lww.departure_warehouse_id and oat.destination_warehouse_id = lww.destination_warehouse_id and oat.brand = lww.brand + left join logpm_reportconfig_order_all oat on oat.departure_warehouse_id = lww.departure_warehouse_id and oat.destination_warehouse_id = lww.destination_warehouse_id where ltad.waybill_id is not null and ltad.create_time > '2024-10-22 00:00:00' and lww.departure_warehouse_id != lww.destination_warehouse_id @@ -1568,8 +1524,11 @@ and GROUP_CONCAT(DISTINCT ltad.train_number) like concat('%',#{param.trainNumber},'%') - - and GROUP_CONCAT(DISTINCT IFNULL(ltcls.load_code,ltclsm.load_code)) like concat('%',#{param.loadCode},'%') + + and GROUP_CONCAT(DISTINCT ltcls.load_code) like concat('%',#{param.loadingLoadCode},'%') + + + and GROUP_CONCAT(DISTINCT ltclsm.load_code) like concat('%',#{param.unloadLoadCode},'%') diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/vo/ReportPackgeAllTrunklineTimeVO.java b/blade-service/logpm-report/src/main/java/com/logpm/report/vo/ReportPackgeAllTrunklineTimeVO.java index fb9897c63..8e1472167 100644 --- a/blade-service/logpm-report/src/main/java/com/logpm/report/vo/ReportPackgeAllTrunklineTimeVO.java +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/vo/ReportPackgeAllTrunklineTimeVO.java @@ -17,6 +17,9 @@ public class ReportPackgeAllTrunklineTimeVO implements Serializable { @ExcelProperty(value = "品牌") private String brand; + @ExcelProperty(value = "标准时效") + private Integer hoursTime; + @ExcelProperty(value = "开单数") private Integer waybillNum; @ExcelProperty(value = "开单件数") diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java index 687a7fd47..c22259724 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java @@ -11707,14 +11707,17 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl