From 2d0e14c70c31fd1f2cd4b14839928a9e7a8f05a0 Mon Sep 17 00:00:00 2001 From: zhenghaoyu Date: Thu, 9 Jan 2025 18:45:24 +0800 Subject: [PATCH] =?UTF-8?q?1.=E8=AE=A2=E5=8D=95=E6=95=B4=E4=BD=93=E6=97=B6?= =?UTF-8?q?=E6=95=88=E9=80=BB=E8=BE=91=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../logpm/report/mapper/ReportTimeMapper.xml | 202 ++++++++---------- .../service/impl/OpenOrderServiceImpl.java | 18 +- 2 files changed, 94 insertions(+), 126 deletions(-) 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 63c8ddc24..743ca9bf2 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 @@ -803,51 +803,46 @@ lww.departure_warehouse_name departureWarehouseName, lww.destination_warehouse_name destinationWarehouseName, lww.brand brand, - count(lww.id) waybillNum, - sum(lww.total_count) openNum, - sum(IFNULL(t.totalNum,0)) arriveNum, - sum(lww.total_count)-sum(IFNULL(t.totalNum,0)) noArriveNum, - IFNULL(round(sum(IFNULL(t.totalNum,0))/sum(lww.total_count)*100,2),'0.00') arriveRate, - round(sum(t.timeSecond)/sum(IFNULL(t.totalNum,0))/3600/24,1) avgTime, - sum(IFNULL(t.onTimeNum,0)) onTimeArriveNum, - IFNULL(round(sum(IFNULL(t.onTimeNum,0))/sum(lww.total_count)*100,2),'0.00') onTimeArriveRate, - sum(IFNULL(t.oneNum,0)) oneArriveNum, - IFNULL(round(sum(IFNULL(t.oneNum,0))/sum(lww.total_count)*100,2),'0.00') oneArriveRate, - sum(IFNULL(t.twoNum,0)) twoArriveNum, - IFNULL(round(sum(IFNULL(t.twoNum,0))/sum(lww.total_count)*100,2),'0.00') twoArriveRate, - sum(IFNULL(t.threeNum,0)) threeArriveNum, - IFNULL(round(sum(IFNULL(t.threeNum,0))/sum(lww.total_count)*100,2),'0.00') threeArriveRate, - sum(IFNULL(t.fourNum,0)) fourArriveNum, - IFNULL(round(sum(IFNULL(t.fourNum,0))/sum(lww.total_count)*100,2),'0.00') fourArriveRate, - sum(IFNULL(t.fiveNum,0)) fiveArriveNum, - IFNULL(round(sum(IFNULL(t.fiveNum,0))/sum(lww.total_count)*100,2),'0.00') fiveArriveRate, - sum(IFNULL(t.sixNum,0)) sixArriveNum, - IFNULL(round(sum(IFNULL(t.sixNum,0))/sum(lww.total_count)*100,2),'0.00') sixArriveRate, - sum(IFNULL(t.sevenNum,0)) sevenArriveNum, - IFNULL(round(sum(IFNULL(t.sevenNum,0))/sum(lww.total_count)*100,2),'0.00') sevenArriveRate, - sum(IFNULL(t.sevenToTenNum,0)) sevenToTenArriveNum, - 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 (select ldpl.waybill_id, - sum(ldpl.quantity) totalNum, - sum(TIMESTAMPDIFF(SECOND,ltad.create_time,ldpl.create_time )) timeSecond, - sum(if(ldpl.create_time <= DATE_ADD( ltad.create_time, INTERVAL IFNULL(lrat.hours_time,#{param.hoursTime}) HOUR ),1,0)) onTimeNum, - sum(if(ldpl.create_time <= DATE_ADD( ltad.create_time, INTERVAL 24 HOUR ),1,0)) oneNum, - sum(if(DATE_ADD( ltad.create_time, INTERVAL 24 HOUR ) <ldpl.create_time and ldpl.create_time <= DATE_ADD( ltad.create_time, INTERVAL 48 HOUR ),1,0)) twoNum, - sum(if(DATE_ADD( ltad.create_time, INTERVAL 48 HOUR )<ldpl.create_time and ldpl.create_time <= DATE_ADD( ltad.create_time, INTERVAL 72 HOUR ),1,0)) threeNum, - sum(if(DATE_ADD( ltad.create_time, INTERVAL 72 HOUR )<ldpl.create_time and ldpl.create_time <= DATE_ADD( ltad.create_time, INTERVAL 96 HOUR ),1,0)) fourNum, - sum(if(DATE_ADD( ltad.create_time, INTERVAL 96 HOUR )<ldpl.create_time and ldpl.create_time <= DATE_ADD( ltad.create_time, INTERVAL 120 HOUR ),1,0)) fiveNum, - sum(if(DATE_ADD( ltad.create_time, INTERVAL 120 HOUR )<ldpl.create_time and ldpl.create_time <= DATE_ADD( ltad.create_time, INTERVAL 144 HOUR ),1,0)) sixNum, - sum(if(DATE_ADD( ltad.create_time, INTERVAL 144 HOUR )<ldpl.create_time and ldpl.create_time <= DATE_ADD( ltad.create_time, INTERVAL 168 HOUR ),1,0)) sevenNum, - sum(if(DATE_ADD( ltad.create_time, INTERVAL 168 HOUR )<ldpl.create_time and ldpl.create_time <= DATE_ADD( ltad.create_time, INTERVAL 240 HOUR ),1,0)) sevenToTenNum, - sum(if(DATE_ADD( ltad.create_time, INTERVAL 240 HOUR )<ldpl.create_time,1,0)) moreTenNum - from logpm_distribution_parcel_list ldpl - left join logpm_trunkline_advance_detail ltad on ltad.order_package_code = ldpl.order_package_code + IFNULL(lrat.hours_time,#{param.hoursTime}) hoursTime, + count(DISTINCT ltad.waybill_id) waybillNum, + count(ltad.id) openNum, + IFNULL(sum(ldpl.quantity),0) arriveNum, + count(ltad.id)-IFNULL(sum(ldpl.quantity),0) noArriveNum, + IFNULL(round(IFNULL(sum(ldpl.quantity),0)/count(ltad.id)*100,2),'0.00') arriveRate, + round(sum(TIMESTAMPDIFF(SECOND,ltad.create_time,ldpl.create_time ))/sum(ldpl.quantity)/3600/24,1) avgTime, + sum(if(ldpl.create_time <= DATE_ADD( ltad.create_time, INTERVAL IFNULL(lrat.hours_time,#{param.hoursTime}) HOUR ),1,0)) onTimeArriveNum, + IFNULL(round(sum(if(ldpl.create_time <= DATE_ADD( ltad.create_time, INTERVAL IFNULL(lrat.hours_time,0) HOUR ),1,0))/sum(ldpl.quantity)*100,2),'0.00') onTimeArriveRate, + sum(if(ldpl.create_time <= DATE_ADD( ltad.create_time, INTERVAL 24 HOUR ),1,0)) oneArriveNum, + IFNULL(round(sum(if(ldpl.create_time <= DATE_ADD( ltad.create_time, INTERVAL 24 HOUR ),1,0))/sum(ldpl.quantity)*100,2),'0.00') oneArriveRate, + sum(if(DATE_ADD( ltad.create_time, INTERVAL 24 HOUR ) <ldpl.create_time and ldpl.create_time <= DATE_ADD( ltad.create_time, INTERVAL 48 HOUR ),1,0)) twoArriveNum, + IFNULL(round(sum(if(DATE_ADD( ltad.create_time, INTERVAL 24 HOUR ) <ldpl.create_time and ldpl.create_time <= DATE_ADD( ltad.create_time, INTERVAL 48 HOUR ),1,0))/sum(ldpl.quantity)*100,2),'0.00') twoArriveRate, + sum(if(DATE_ADD( ltad.create_time, INTERVAL 48 HOUR )<ldpl.create_time and ldpl.create_time <= DATE_ADD( ltad.create_time, INTERVAL 72 HOUR ),1,0)) threeArriveNum, + IFNULL(round(sum(if(DATE_ADD( ltad.create_time, INTERVAL 48 HOUR ) <ldpl.create_time and ldpl.create_time <= DATE_ADD( ltad.create_time, INTERVAL 72 HOUR ),1,0))/sum(ldpl.quantity)*100,2),'0.00') threeArriveRate, + sum(if(DATE_ADD( ltad.create_time, INTERVAL 72 HOUR )<ldpl.create_time and ldpl.create_time <= DATE_ADD( ltad.create_time, INTERVAL 96 HOUR ),1,0)) fourArriveNum, + IFNULL(round(sum(if(DATE_ADD( ltad.create_time, INTERVAL 72 HOUR ) <ldpl.create_time and ldpl.create_time <= DATE_ADD( ltad.create_time, INTERVAL 96 HOUR ),1,0))/sum(ldpl.quantity)*100,2),'0.00') fourArriveRate, + sum(if(DATE_ADD( ltad.create_time, INTERVAL 96 HOUR )<ldpl.create_time and ldpl.create_time <= DATE_ADD( ltad.create_time, INTERVAL 120 HOUR ),1,0)) fiveArriveNum, + IFNULL(round(sum(if(DATE_ADD( ltad.create_time, INTERVAL 96 HOUR ) <ldpl.create_time and ldpl.create_time <= DATE_ADD( ltad.create_time, INTERVAL 120 HOUR ),1,0))/sum(ldpl.quantity)*100,2),'0.00') fiveArriveRate, + sum(if(DATE_ADD( ltad.create_time, INTERVAL 120 HOUR )<ldpl.create_time and ldpl.create_time <= DATE_ADD( ltad.create_time, INTERVAL 144 HOUR ),1,0)) sixArriveNum, + IFNULL(round(sum(if(DATE_ADD( ltad.create_time, INTERVAL 120 HOUR ) <ldpl.create_time and ldpl.create_time <= DATE_ADD( ltad.create_time, INTERVAL 144 HOUR ),1,0))/sum(ldpl.quantity)*100,2),'0.00') sixArriveRate, + sum(if(DATE_ADD( ltad.create_time, INTERVAL 144 HOUR )<ldpl.create_time and ldpl.create_time <= DATE_ADD( ltad.create_time, INTERVAL 168 HOUR ),1,0)) sevenArriveNum, + IFNULL(round(sum(if(DATE_ADD( ltad.create_time, INTERVAL 144 HOUR ) <ldpl.create_time and ldpl.create_time <= DATE_ADD( ltad.create_time, INTERVAL 168 HOUR ),1,0))/sum(ldpl.quantity)*100,2),'0.00') sevenArriveRate, + sum(if(DATE_ADD( ltad.create_time, INTERVAL 168 HOUR )<ldpl.create_time and ldpl.create_time <= DATE_ADD( ltad.create_time, INTERVAL 240 HOUR ),1,0)) sevenToTenArriveNum, + IFNULL(round(sum(if(DATE_ADD( ltad.create_time, INTERVAL 168 HOUR ) <ldpl.create_time and ldpl.create_time <= DATE_ADD( ltad.create_time, INTERVAL 240 HOUR ),1,0))/sum(ldpl.quantity)*100,2),'0.00') sevenToTenArriveRate, + sum(if(DATE_ADD( ltad.create_time, INTERVAL 240 HOUR )<ldpl.create_time,1,0)) moreTenArriveNum, + IFNULL(round(sum(if(DATE_ADD( ltad.create_time, INTERVAL 240 HOUR )<ldpl.create_time,1,0))/sum(ldpl.quantity)*100,2),'0.00') moreTenArriveRate + from logpm_trunkline_advance_detail ltad + left join logpm_warehouse_waybill lww on lww.id = ltad.waybill_id + left join logpm_warehouse_warehouse waw on waw.id = lww.departure_warehouse_id + left join logpm_distribution_parcel_list ldpl on ltad.order_package_code = ldpl.order_package_code and ldpl.warehouse_id = lww.destination_warehouse_id left join logpm_reportconfig_all_trunkline lrat on lrat.departure_warehouse_id = ldpl.send_warehouse_id and lrat.destination_warehouse_id = ldpl.accept_warehouse_id and lrat.is_deleted=0 - where ldpl.conditions != 3 - and ldpl.send_warehouse_id != ldpl.accept_warehouse_id - and ltad.create_time > '2024-10-22 00:00:00' + where 1=1 + and lww.departure_warehouse_id != lww.destination_warehouse_id + + and waw.business_line in + + #{item} + + and ltad.create_time >= #{param.startTime} @@ -855,35 +850,23 @@ and ltad.create_time <= #{param.endTime} - and ltad.brand in + and lww.brand in #{item} - and ldpl.send_warehouse_id in + and lww.departure_warehouse_id in #{item} - and ldpl.accept_warehouse_id in + and lww.destination_warehouse_id in #{item} - and ldpl.warehouse_id = ldpl.accept_warehouse_id - and ldpl.warehouse_id != ldpl.send_warehouse_id - group by ldpl.waybill_id) t - left join logpm_warehouse_waybill lww on lww.id = t.waybill_id - left join logpm_warehouse_warehouse waw on waw.id = lww.departure_warehouse_id - where 1=1 - - and waw.business_line in - - #{item} - - group by waw.business_line, lww.departure_warehouse_name, lww.destination_warehouse_name, @@ -896,51 +879,46 @@ lww.departure_warehouse_name departureWarehouseName, lww.destination_warehouse_name destinationWarehouseName, lww.brand brand, - count(lww.id) waybillNum, - sum(lww.total_count) openNum, - sum(IFNULL(t.totalNum,0)) arriveNum, - sum(lww.total_count)-sum(IFNULL(t.totalNum,0)) noArriveNum, - IFNULL(concat(round(sum(IFNULL(t.totalNum,0))/sum(lww.total_count)*100,2),'%'),'0.00%') arriveRate, - round(sum(t.timeSecond)/sum(IFNULL(t.totalNum,0))/3600/24,1) avgTime, - sum(IFNULL(t.onTimeNum,0)) onTimeArriveNum, - IFNULL(concat(round(sum(IFNULL(t.onTimeNum,0))/sum(lww.total_count)*100,2),'%'),'0.00%') onTimeArriveRate, - sum(IFNULL(t.oneNum,0)) oneArriveNum, - IFNULL(concat(round(sum(IFNULL(t.oneNum,0))/sum(lww.total_count)*100,2),'%'),'0.00%') oneArriveRate, - sum(IFNULL(t.twoNum,0)) twoArriveNum, - IFNULL(concat(round(sum(IFNULL(t.twoNum,0))/sum(lww.total_count)*100,2),'%'),'0.00%') twoArriveRate, - sum(IFNULL(t.threeNum,0)) threeArriveNum, - IFNULL(concat(round(sum(IFNULL(t.threeNum,0))/sum(lww.total_count)*100,2),'%'),'0.00%') threeArriveRate, - sum(IFNULL(t.fourNum,0)) fourArriveNum, - IFNULL(concat(round(sum(IFNULL(t.fourNum,0))/sum(lww.total_count)*100,2),'%'),'0.00%') fourArriveRate, - sum(IFNULL(t.fiveNum,0)) fiveArriveNum, - IFNULL(concat(round(sum(IFNULL(t.fiveNum,0))/sum(lww.total_count)*100,2),'%'),'0.00%') fiveArriveRate, - sum(IFNULL(t.sixNum,0)) sixArriveNum, - IFNULL(concat(round(sum(IFNULL(t.sixNum,0))/sum(lww.total_count)*100,2),'%'),'0.00%') sixArriveRate, - sum(IFNULL(t.sevenNum,0)) sevenArriveNum, - IFNULL(concat(round(sum(IFNULL(t.sevenNum,0))/sum(lww.total_count)*100,2),'%'),'0.00%') sevenArriveRate, - sum(IFNULL(t.sevenToTenNum,0)) sevenToTenArriveNum, - IFNULL(concat(round(sum(IFNULL(t.sevenToTenNum,0))/sum(lww.total_count)*100,2),'%'),'0.00%') sevenToTenArriveRate, - sum(IFNULL(t.moreTenNum,0)) moreTenArriveNum, - IFNULL(concat(round(sum(IFNULL(t.moreTenNum,0))/sum(lww.total_count)*100,2),'%'),'0.00%') moreTenArriveRate - from (select ldpl.waybill_id, - sum(ldpl.quantity) totalNum, - sum(TIMESTAMPDIFF(SECOND,ltad.create_time,ldpl.create_time )) timeSecond, - sum(if(ldpl.create_time <= DATE_ADD( ltad.create_time, INTERVAL IFNULL(lrat.hours_time,#{param.hoursTime}) HOUR ),1,0)) onTimeNum, - sum(if(ldpl.create_time <= DATE_ADD( ltad.create_time, INTERVAL 24 HOUR ),1,0)) oneNum, - sum(if(DATE_ADD( ltad.create_time, INTERVAL 24 HOUR ) <ldpl.create_time and ldpl.create_time <= DATE_ADD( ltad.create_time, INTERVAL 48 HOUR ),1,0)) twoNum, - sum(if(DATE_ADD( ltad.create_time, INTERVAL 48 HOUR )<ldpl.create_time and ldpl.create_time <= DATE_ADD( ltad.create_time, INTERVAL 72 HOUR ),1,0)) threeNum, - sum(if(DATE_ADD( ltad.create_time, INTERVAL 72 HOUR )<ldpl.create_time and ldpl.create_time <= DATE_ADD( ltad.create_time, INTERVAL 96 HOUR ),1,0)) fourNum, - sum(if(DATE_ADD( ltad.create_time, INTERVAL 96 HOUR )<ldpl.create_time and ldpl.create_time <= DATE_ADD( ltad.create_time, INTERVAL 120 HOUR ),1,0)) fiveNum, - sum(if(DATE_ADD( ltad.create_time, INTERVAL 120 HOUR )<ldpl.create_time and ldpl.create_time <= DATE_ADD( ltad.create_time, INTERVAL 144 HOUR ),1,0)) sixNum, - sum(if(DATE_ADD( ltad.create_time, INTERVAL 144 HOUR )<ldpl.create_time and ldpl.create_time <= DATE_ADD( ltad.create_time, INTERVAL 168 HOUR ),1,0)) sevenNum, - sum(if(DATE_ADD( ltad.create_time, INTERVAL 168 HOUR )<ldpl.create_time and ldpl.create_time <= DATE_ADD( ltad.create_time, INTERVAL 240 HOUR ),1,0)) sevenToTenNum, - sum(if(DATE_ADD( ltad.create_time, INTERVAL 240 HOUR )<ldpl.create_time,1,0)) moreTenNum - from logpm_distribution_parcel_list ldpl - left join logpm_trunkline_advance_detail ltad on ltad.order_package_code = ldpl.order_package_code + IFNULL(lrat.hours_time,#{param.hoursTime}) hoursTime, + count(DISTINCT ltad.waybill_id) waybillNum, + count(ltad.id) openNum, + IFNULL(sum(ldpl.quantity),0) arriveNum, + count(ltad.id)-IFNULL(sum(ldpl.quantity),0) noArriveNum, + IFNULL(concat(round(IFNULL(sum(ldpl.quantity),0)/count(ltad.id)*100,2),'%'),'0.00%') arriveRate, + round(sum(TIMESTAMPDIFF(SECOND,ltad.create_time,ldpl.create_time ))/sum(ldpl.quantity)/3600/24,1) avgTime, + sum(if(ldpl.create_time <= DATE_ADD( ltad.create_time, INTERVAL IFNULL(lrat.hours_time,#{param.hoursTime}) HOUR ),1,0)) onTimeArriveNum, + IFNULL(concat(round(sum(if(ldpl.create_time <= DATE_ADD( ltad.create_time, INTERVAL IFNULL(lrat.hours_time,0) HOUR ),1,0))/sum(ldpl.quantity)*100,2),'%'),'0.00%') onTimeArriveRate, + sum(if(ldpl.create_time <= DATE_ADD( ltad.create_time, INTERVAL 24 HOUR ),1,0)) oneArriveNum, + IFNULL(concat(round(sum(if(ldpl.create_time <= DATE_ADD( ltad.create_time, INTERVAL 24 HOUR ),1,0))/sum(ldpl.quantity)*100,2),'%'),'0.00%') oneArriveRate, + sum(if(DATE_ADD( ltad.create_time, INTERVAL 24 HOUR ) <ldpl.create_time and ldpl.create_time <= DATE_ADD( ltad.create_time, INTERVAL 48 HOUR ),1,0)) twoArriveNum, + IFNULL(concat(round(sum(if(DATE_ADD( ltad.create_time, INTERVAL 24 HOUR ) <ldpl.create_time and ldpl.create_time <= DATE_ADD( ltad.create_time, INTERVAL 48 HOUR ),1,0))/sum(ldpl.quantity)*100,2),'%'),'0.00%') twoArriveRate, + sum(if(DATE_ADD( ltad.create_time, INTERVAL 48 HOUR )<ldpl.create_time and ldpl.create_time <= DATE_ADD( ltad.create_time, INTERVAL 72 HOUR ),1,0)) threeArriveNum, + IFNULL(concat(round(sum(if(DATE_ADD( ltad.create_time, INTERVAL 48 HOUR ) <ldpl.create_time and ldpl.create_time <= DATE_ADD( ltad.create_time, INTERVAL 72 HOUR ),1,0))/sum(ldpl.quantity)*100,2),'%'),'0.00%') threeArriveRate, + sum(if(DATE_ADD( ltad.create_time, INTERVAL 72 HOUR )<ldpl.create_time and ldpl.create_time <= DATE_ADD( ltad.create_time, INTERVAL 96 HOUR ),1,0)) fourArriveNum, + IFNULL(concat(round(sum(if(DATE_ADD( ltad.create_time, INTERVAL 72 HOUR ) <ldpl.create_time and ldpl.create_time <= DATE_ADD( ltad.create_time, INTERVAL 96 HOUR ),1,0))/sum(ldpl.quantity)*100,2),'%'),'0.00%') fourArriveRate, + sum(if(DATE_ADD( ltad.create_time, INTERVAL 96 HOUR )<ldpl.create_time and ldpl.create_time <= DATE_ADD( ltad.create_time, INTERVAL 120 HOUR ),1,0)) fiveArriveNum, + IFNULL(concat(round(sum(if(DATE_ADD( ltad.create_time, INTERVAL 96 HOUR ) <ldpl.create_time and ldpl.create_time <= DATE_ADD( ltad.create_time, INTERVAL 120 HOUR ),1,0))/sum(ldpl.quantity)*100,2),'%'),'0.00%') fiveArriveRate, + sum(if(DATE_ADD( ltad.create_time, INTERVAL 120 HOUR )<ldpl.create_time and ldpl.create_time <= DATE_ADD( ltad.create_time, INTERVAL 144 HOUR ),1,0)) sixArriveNum, + IFNULL(concat(round(sum(if(DATE_ADD( ltad.create_time, INTERVAL 120 HOUR ) <ldpl.create_time and ldpl.create_time <= DATE_ADD( ltad.create_time, INTERVAL 144 HOUR ),1,0))/sum(ldpl.quantity)*100,2),'%'),'0.00%') sixArriveRate, + sum(if(DATE_ADD( ltad.create_time, INTERVAL 144 HOUR )<ldpl.create_time and ldpl.create_time <= DATE_ADD( ltad.create_time, INTERVAL 168 HOUR ),1,0)) sevenArriveNum, + IFNULL(concat(round(sum(if(DATE_ADD( ltad.create_time, INTERVAL 144 HOUR ) <ldpl.create_time and ldpl.create_time <= DATE_ADD( ltad.create_time, INTERVAL 168 HOUR ),1,0))/sum(ldpl.quantity)*100,2),'%'),'0.00%') sevenArriveRate, + sum(if(DATE_ADD( ltad.create_time, INTERVAL 168 HOUR )<ldpl.create_time and ldpl.create_time <= DATE_ADD( ltad.create_time, INTERVAL 240 HOUR ),1,0)) sevenToTenArriveNum, + IFNULL(concat(round(sum(if(DATE_ADD( ltad.create_time, INTERVAL 168 HOUR ) <ldpl.create_time and ldpl.create_time <= DATE_ADD( ltad.create_time, INTERVAL 240 HOUR ),1,0))/sum(ldpl.quantity)*100,2),'%'),'0.00%') sevenToTenArriveRate, + sum(if(DATE_ADD( ltad.create_time, INTERVAL 240 HOUR )<ldpl.create_time,1,0)) moreTenArriveNum, + IFNULL(concat(round(sum(if(DATE_ADD( ltad.create_time, INTERVAL 240 HOUR )<ldpl.create_time,1,0))/sum(ldpl.quantity)*100,2),'%'),'0.00%') moreTenArriveRate + from logpm_trunkline_advance_detail ltad + left join logpm_warehouse_waybill lww on lww.id = ltad.waybill_id + left join logpm_warehouse_warehouse waw on waw.id = lww.departure_warehouse_id + left join logpm_distribution_parcel_list ldpl on ltad.order_package_code = ldpl.order_package_code and ldpl.warehouse_id = lww.destination_warehouse_id left join logpm_reportconfig_all_trunkline lrat on lrat.departure_warehouse_id = ldpl.send_warehouse_id and lrat.destination_warehouse_id = ldpl.accept_warehouse_id and lrat.is_deleted=0 - where ldpl.conditions != 3 - and ldpl.send_warehouse_id != ldpl.accept_warehouse_id - and ltad.create_time > '2024-10-22 00:00:00' + where 1=1 + and lww.departure_warehouse_id != lww.destination_warehouse_id + + and waw.business_line in + + #{item} + + and ltad.create_time >= #{param.startTime} @@ -948,35 +926,23 @@ and ltad.create_time <= #{param.endTime} - and ltad.brand in + and lww.brand in #{item} - and ldpl.send_warehouse_id in + and lww.departure_warehouse_id in #{item} - and ldpl.accept_warehouse_id in + and lww.destination_warehouse_id in #{item} - and ldpl.warehouse_id = ldpl.accept_warehouse_id - and ldpl.warehouse_id != ldpl.send_warehouse_id - group by ldpl.waybill_id) t - left join logpm_warehouse_waybill lww on lww.id = t.waybill_id - left join logpm_warehouse_warehouse waw on waw.id = lww.departure_warehouse_id - where 1=1 - - and waw.business_line in - - #{item} - - group by waw.business_line, lww.departure_warehouse_name, lww.destination_warehouse_name, diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java index 9bc2b3f04..1fff09e8c 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java @@ -1127,14 +1127,16 @@ public class OpenOrderServiceImpl implements IOpenOrderService { String goodsName = waybillDetailDTO.getGoodsName(); if (Objects.isNull(goodsId)) { //如果品名id没有就先通过goodsName查寻,没有就新增 - BasicdataCategoryEntity basicdataCategoryEntity = basicdataCategoryClient.findByName(goodsName); - if (Objects.isNull(basicdataCategoryEntity)) { - basicdataCategoryEntity = new BasicdataCategoryEntity(); - basicdataCategoryEntity.setName(goodsName); - basicdataCategoryEntity.setType("1"); - goodsId = basicdataCategoryClient.addReturnId(basicdataCategoryEntity); - } else { - goodsId = basicdataCategoryEntity.getId(); + if(StringUtil.isNotBlank(goodsName)){ + BasicdataCategoryEntity basicdataCategoryEntity = basicdataCategoryClient.findByName(goodsName.trim()); + if (Objects.isNull(basicdataCategoryEntity)) { + basicdataCategoryEntity = new BasicdataCategoryEntity(); + basicdataCategoryEntity.setName(goodsName); + basicdataCategoryEntity.setType("1"); + goodsId = basicdataCategoryClient.addReturnId(basicdataCategoryEntity); + } else { + goodsId = basicdataCategoryEntity.getId(); + } } } warehouseWayBillDetail.setProductId(goodsId);