diff --git a/blade-biz-common/src/main/java/org/springblade/common/constant/IncomingTypeEnum.java b/blade-biz-common/src/main/java/org/springblade/common/constant/IncomingTypeEnum.java index 16fac4dd3..1958fdd47 100644 --- a/blade-biz-common/src/main/java/org/springblade/common/constant/IncomingTypeEnum.java +++ b/blade-biz-common/src/main/java/org/springblade/common/constant/IncomingTypeEnum.java @@ -10,7 +10,7 @@ public enum IncomingTypeEnum { LINE_INCOMING(3, "直接入库"), CARS_NO_INCOMING(4, "按车次号入库"), ORDER_CODE_INCOMING(5, "按订单号入库"), - PACKAGE_INCOMING(6, "按件入库"), + PACKAGE_INCOMING(6, "卸车入库"), BATCH_INCOMING(7, "批量卸车入库"), UNLOAD_TRAY_INCOMING(8, "托盘卸车入库"), UNLOAD_TRAY_ONE(9, "卸分一体"), diff --git a/blade-biz-common/src/main/java/org/springblade/common/constant/WorkNodeEnums.java b/blade-biz-common/src/main/java/org/springblade/common/constant/WorkNodeEnums.java index 270d49312..bbf747c33 100644 --- a/blade-biz-common/src/main/java/org/springblade/common/constant/WorkNodeEnums.java +++ b/blade-biz-common/src/main/java/org/springblade/common/constant/WorkNodeEnums.java @@ -16,6 +16,7 @@ public enum WorkNodeEnums implements Serializable { DELETE_DATA_ENTRY(100000, "删除数据"), INITIAL_DATA_ENTRY(101010, "数据入库"), INITIAL_WAREHOUSE_ENTRY(101020, "始发仓入库"), + UNLOAD_WAREHOUSE_ENTRY(101021, "卸车并入库"), OPEN_ORDER(102010, "开单"), CHANGE_ORDER(102020, "改单"), diff --git a/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/SignPackageVO.java b/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/SignPackageVO.java index eb27db6f5..a106bf01a 100644 --- a/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/SignPackageVO.java +++ b/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/SignPackageVO.java @@ -16,6 +16,9 @@ public class SignPackageVO implements Serializable { private String scanStatus; private String orderCode; private String waybillNo; + private String firstName; + private String secondName; + private String thirdName; private List scanZeroDetailList = new ArrayList<>(); diff --git a/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/TrunklineLoadSignOrderVO.java b/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/TrunklineLoadSignOrderVO.java index e3e827012..7b5af9180 100644 --- a/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/TrunklineLoadSignOrderVO.java +++ b/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/TrunklineLoadSignOrderVO.java @@ -15,6 +15,10 @@ public class TrunklineLoadSignOrderVO extends TrunklineLoadSignOrderEntity { private String carsLineName; private String carNumber; private String driverMobile; + private String mallName; + private String mallPerson; + private String mallMobile; + private String mallAddress; private List signPhotoList; diff --git a/blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/service/impl/DeliveryNoteServiceImpl.java b/blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/service/impl/DeliveryNoteServiceImpl.java index 6e04e5095..0e43375f4 100644 --- a/blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/service/impl/DeliveryNoteServiceImpl.java +++ b/blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/service/impl/DeliveryNoteServiceImpl.java @@ -194,7 +194,7 @@ public class DeliveryNoteServiceImpl extends BaseServiceImpl orderFullInfoEntities = new ArrayList<>(); + List mainOrderCodes = new ArrayList<>(); // 推送成功 JSONArray fullSetInfos = jsonObject.getJSONArray("fullSetInfo"); if (CollUtil.isNotEmpty(fullSetInfos)) { @@ -94,48 +95,57 @@ public class FactoryJob { JSONObject fullSetInfo = JSONUtil.parseObj(fullSetInfoObj); String mainOrderNo = fullSetInfo.getStr("mainOrderNo"); String fullSet = fullSetInfo.getStr("fullSet"); - // 家品数据取 orderDetail 衣柜取 paNos - if ("Z".equals(orderType)) { - JSONArray orderDetails = fullSetInfo.getJSONArray("orderDetail"); - if (CollUtil.isNotEmpty(orderDetails)) { - for (Object orderDetailObj : orderDetails) { - JSONObject orderDetail = JSONUtil.parseObj(orderDetailObj); - String orderNo = orderDetail.getStr("orderNo"); - String itemCode = orderDetail.getStr("itemCode"); - String itemName = orderDetail.getStr("itemName"); - String quantity = orderDetail.getStr("quantity"); - OrderFullInfoEntity entity = new OrderFullInfoEntity(); - entity.setMainOrderNo(mainOrderNo); - entity.setOrderNo(orderNo); - entity.setItemCode(itemCode); - entity.setItemName(itemName); - entity.setQuantity(quantity); - entity.setFullSet(fullSet); - entity.setOrderType(orderType); - entity.setTenantCode(tenantCode); - orderFullInfoEntities.add(entity); + if ("N".equals(fullSet)) { + // 家品数据取 orderDetail 衣柜取 paNos + if ("Z".equals(orderType)) { + JSONArray orderDetails = fullSetInfo.getJSONArray("orderDetail"); + if (CollUtil.isNotEmpty(orderDetails)) { + for (Object orderDetailObj : orderDetails) { + JSONObject orderDetail = JSONUtil.parseObj(orderDetailObj); + String orderNo = orderDetail.getStr("orderNo"); + String itemCode = orderDetail.getStr("itemCode"); + String itemName = orderDetail.getStr("itemName"); + String quantity = orderDetail.getStr("quantity"); + OrderFullInfoEntity entity = new OrderFullInfoEntity(); + entity.setMainOrderNo(mainOrderNo); + entity.setOrderNo(orderNo); + entity.setItemCode(itemCode); + entity.setItemName(itemName); + entity.setQuantity(quantity); + entity.setFullSet(fullSet); + entity.setOrderType(orderType); + entity.setTenantCode(tenantCode); + orderFullInfoEntities.add(entity); + } } - } - } else { - JSONArray paNos = fullSetInfo.getJSONArray("paNo"); - if (CollUtil.isNotEmpty(paNos)) { - for (Object paNo : paNos) { - String str = Convert.toStr(paNo); - OrderFullInfoEntity entity = new OrderFullInfoEntity(); - entity.setMainOrderNo(mainOrderNo); - entity.setPaNo(str); - entity.setFullSet(fullSet); - entity.setOrderType(orderType); - entity.setTenantCode(tenantCode); - orderFullInfoEntities.add(entity); + } else { + JSONArray paNos = fullSetInfo.getJSONArray("paNo"); + if (CollUtil.isNotEmpty(paNos)) { + for (Object paNo : paNos) { + String str = Convert.toStr(paNo); + OrderFullInfoEntity entity = new OrderFullInfoEntity(); + entity.setMainOrderNo(mainOrderNo); + entity.setPaNo(str); + entity.setFullSet(fullSet); + entity.setOrderType(orderType); + entity.setTenantCode(tenantCode); + entity.setQuantity("1"); + orderFullInfoEntities.add(entity); + } } } } + if ("Y".equals(fullSet)) { + mainOrderCodes.add(mainOrderNo); + } } } if (CollUtil.isNotEmpty(orderFullInfoEntities)) { orderFullInfoService.saveBatch(orderFullInfoEntities); } + if (CollUtil.isNotEmpty(mainOrderCodes)) { + orderInfoService.updateFullSetByMianOrderCode(mainOrderCodes); + } } } } diff --git a/blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/mapper/OrderInfoMapper.java b/blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/mapper/OrderInfoMapper.java index 90fd73ba4..64a1f7617 100644 --- a/blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/mapper/OrderInfoMapper.java +++ b/blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/mapper/OrderInfoMapper.java @@ -3,6 +3,7 @@ package com.logpm.factorydata.suofeiya.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.logpm.factorydata.suofeiya.entity.OrderInfoEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; import java.util.List; @@ -17,4 +18,5 @@ public interface OrderInfoMapper extends BaseMapper { List findNotFullOrder(); + void updateFullSetByMianOrderCode(@Param("mainOrderNo") List mainOrderNo); } diff --git a/blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/mapper/OrderInfoMapper.xml b/blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/mapper/OrderInfoMapper.xml index cede7e153..271cc87bd 100644 --- a/blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/mapper/OrderInfoMapper.xml +++ b/blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/mapper/OrderInfoMapper.xml @@ -3,8 +3,17 @@ + + + update sfy_order_info + set order_full = 'Y' + where main_order_no in + + #{item} + + diff --git a/blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/service/OrderInfoService.java b/blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/service/OrderInfoService.java index d44dc3fff..ac772fcb2 100644 --- a/blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/service/OrderInfoService.java +++ b/blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/service/OrderInfoService.java @@ -15,4 +15,6 @@ public interface OrderInfoService extends BaseService { List findNotFullOrder(); + + void updateFullSetByMianOrderCode(List mainOrderNo); } diff --git a/blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/service/impl/OrderInfoServiceImpl.java b/blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/service/impl/OrderInfoServiceImpl.java index 97defd371..61475ade5 100644 --- a/blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/service/impl/OrderInfoServiceImpl.java +++ b/blade-service/logpm-factory-data/logpm-factory-data-suofeiya/src/main/java/com/logpm/factorydata/suofeiya/service/impl/OrderInfoServiceImpl.java @@ -25,4 +25,9 @@ public class OrderInfoServiceImpl extends BaseServiceImpl findNotFullOrder() { return baseMapper.findNotFullOrder(); } + + @Override + public void updateFullSetByMianOrderCode(List mainOrderNo) { + baseMapper.updateFullSetByMianOrderCode(mainOrderNo); + } } 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..300d8d41c 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, @@ -1339,7 +1305,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 + 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.is_deleted = 0 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 @@ -1457,7 +1423,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 + 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.is_deleted = 0 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 diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadScanMapper.xml b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadScanMapper.xml index 765ae7926..a1431f19a 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadScanMapper.xml +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadScanMapper.xml @@ -1114,7 +1114,10 @@ unload_num unloadNum, scan_status scanStatus, order_code orderCode, - waybill_no waybillNo + waybill_no waybillNo, + firsts firstName, + senconds secondName, + thirds thirdName from logpm_trunkline_cars_load_scan where sign_order_id = #{signOrderId} diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineLoadSignOrderMapper.xml b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineLoadSignOrderMapper.xml index 7c3c47558..133440dcd 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineLoadSignOrderMapper.xml +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineLoadSignOrderMapper.xml @@ -66,6 +66,10 @@ ltlso.plan_num planNum, ltlso.load_sign_code loadSignCode, ltlso.sign_num signNum, + ltlso.mall_name mallName, + ltlso.mall_person mallPerson, + ltlso.mall_mobile mallMobile, + ltlso.mall_address mallAddress, ltcl.driver_name driverName, ltcl.driver_mobile driverMobile, ltcl.car_number carNumber, diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/InComingServiceImpl.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/InComingServiceImpl.java index 56275a692..55e2b65d3 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/InComingServiceImpl.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/InComingServiceImpl.java @@ -333,8 +333,15 @@ public class InComingServiceImpl implements IInComingService { // // List orderPackageCodes = new ArrayList<>(); // orderPackageCodes.add(orderPackageCode); + + Integer c = WorkNodeEnums.INITIAL_WAREHOUSE_ENTRY.getCode(); + + if(incomingType.equals(IncomingTypeEnum.PACKAGE_INCOMING.getCode())){ + c = WorkNodeEnums.UNLOAD_WAREHOUSE_ENTRY.getCode(); + } + //存入日志 - packageTrackLogAsyncService.addPackageTrackLog(AuthUtil.getTenantId(), AuthUtil.getUserId(), Func.firstLong(AuthUtil.getDeptId()), AuthUtil.getNickName(), orderPackageCodes, warehouseId, finalWarehouseName, WorkNodeEnums.INITIAL_WAREHOUSE_ENTRY.getCode(), "包件" + IncomingTypeEnum.getValue(incomingType)); + packageTrackLogAsyncService.addPackageTrackLog(AuthUtil.getTenantId(), AuthUtil.getUserId(), Func.firstLong(AuthUtil.getDeptId()), AuthUtil.getNickName(), orderPackageCodes, warehouseId, finalWarehouseName, c, "包件" + IncomingTypeEnum.getValue(incomingType)); //2.判断包件和订单是否已经存入在库订单 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..e92265440 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 @@ -691,9 +691,9 @@ public class OpenOrderServiceImpl implements IOpenOrderService { waybillEntity.setStockCount(advanceDetailStockNumVO.getStockNum()); waybillEntity.setStockWeight(advanceDetailStockNumVO.getStockWeight()); waybillEntity.setStockVolume(advanceDetailStockNumVO.getStockVolume()); - List billladingPackageList = advanceDetailService.findBillladingPackageByAdvanceIdsAnd(advanceIds); +// List billladingPackageList = advanceDetailService.findBillladingPackageByAdvanceIdsAnd(advanceIds); //把billladingPackageList中的所有num累加 - waybillEntity.setBillladingNum(billladingPackageList.stream().mapToInt(BillladingPackageVO::getNum).sum()); + waybillEntity.setBillladingNum(0); waybillEntity.setTotalFreight(openOrderDTO.getTotalFreight()); waybillEntity.setDeliveryFee(openOrderDTO.getDeliveryFee()); @@ -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); 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 c22259724..07a33090d 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 @@ -68,6 +68,9 @@ import org.springblade.system.cache.DictBizCache; import org.springblade.system.entity.DictBiz; import org.springframework.amqp.rabbit.connection.CorrelationData; import org.springframework.amqp.rabbit.core.RabbitTemplate; +import org.springframework.core.io.ClassPathResource; +import org.springframework.data.redis.core.script.DefaultRedisScript; +import org.springframework.scripting.support.ResourceScriptSource; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -11544,6 +11547,28 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl redisScript = new DefaultRedisScript<>(); + redisScript.setScriptSource(new ResourceScriptSource(new ClassPathResource("luascript/resubmit.lua"))); + redisScript.setResultType(Long.class); + + List keys = Collections.singletonList(key); + List args = Arrays.asList(value, expireTime); + + log.info("Keys: {}", keys); + log.info("Args: {}", args); + + Long result = bladeRedis.getRedisTemplate().execute(redisScript, keys, args.toArray()); + + if (result == 1) { + log.warn("#########orderScanOrderPackageCode: 包件正在卸车 orderPackageCode={} warehouseId={}", orderPackageCode, warehouseId); + return R.fail(405, "包件正在卸车,请重试"); + } + + BasicdataWarehouseEntity basicdataWarehouseEntity = basicdataWarehouseClient.getEntityWarehouseId(warehouseId); if (Objects.isNull(basicdataWarehouseEntity)) { log.warn("##############unloadPackage: 仓库信息不存在"); @@ -12357,6 +12382,9 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl redisScript = new DefaultRedisScript<>(); + redisScript.setScriptSource(new ResourceScriptSource(new ClassPathResource("luascript/resubmit.lua"))); + redisScript.setResultType(Long.class); + + List keys = Collections.singletonList(key); + List args = Arrays.asList(value, expireTime); + + log.info("Keys: {}", keys); + log.info("Args: {}", args); + + Long result = bladeRedis.getRedisTemplate().execute(redisScript, keys, args.toArray()); + + if (result == 1) { + log.warn("#########orderScanOrderPackageCode: 包件正在卸车 orderPackageCode={} warehouseId={}", orderPackageCode, warehouseId); + return R.fail(405, "包件正在卸车,请重试"); + } + + BasicdataWarehouseEntity basicdataWarehouseEntity = basicdataWarehouseClient.getEntityWarehouseId(warehouseId); if (Objects.isNull(basicdataWarehouseEntity)) { log.warn("##############unloadPackageNoXz: 仓库信息不存在"); @@ -13136,6 +13186,8 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl warehouseIds = warehouseClient.getWarehouseIds(); + waybillDTO.setWarehouseIds(warehouseIds); + + IPage pages = warehouseWaybillAbolishService.pageAbolishWaybillList(waybillDTO); + + return R.data(pages); + }catch (CustomerException e){ + log.error(e.message,e); + return R.fail(e.code,e.message); + }catch (Exception e){ + log.error("############sendOrders: 系统异常",e); + return R.fail(500,"############sendOrders: 系统异常"); + } + } + } diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWayBillDetailAbolishMapper.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWayBillDetailAbolishMapper.java index b9a46f90d..84684882e 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWayBillDetailAbolishMapper.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWayBillDetailAbolishMapper.java @@ -1,9 +1,16 @@ package com.logpm.warehouse.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.logpm.warehouse.entity.WarehouseWayBillDetail; import com.logpm.warehouse.entity.WarehouseWayBillDetailAbolish; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; @Mapper public interface WarehouseWayBillDetailAbolishMapper extends BaseMapper { + + List findByWaybillIds(@Param("ids") List ids); + } diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWaybillAbolishMapper.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWaybillAbolishMapper.java index 31689ae75..1d2adedcc 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWaybillAbolishMapper.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWaybillAbolishMapper.java @@ -1,9 +1,15 @@ package com.logpm.warehouse.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.logpm.warehouse.dto.WarehouseWaybillDTO; import com.logpm.warehouse.entity.WarehouseWaybillAbolishEntity; +import com.logpm.warehouse.vo.WarehouseWaybillVO; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; @Mapper public interface WarehouseWaybillAbolishMapper extends BaseMapper { + + IPage pageAbolishWaybillList(IPage page, @Param("param") WarehouseWaybillDTO waybillDTO); } diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWaybillAbolishMapper.xml b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWaybillAbolishMapper.xml new file mode 100644 index 000000000..7b1cfd0c8 --- /dev/null +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWaybillAbolishMapper.xml @@ -0,0 +1,226 @@ + + + + + + + diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWaybillDetailAbolishMapper.xml b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWaybillDetailAbolishMapper.xml new file mode 100644 index 000000000..68783a831 --- /dev/null +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWaybillDetailAbolishMapper.xml @@ -0,0 +1,15 @@ + + + + + + + diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWaybillMapper.xml b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWaybillMapper.xml index a7cd85678..0e6a0972d 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWaybillMapper.xml +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWaybillMapper.xml @@ -1290,4 +1290,246 @@ update logpm_warehouse_waybill set service_type = #{serviceType} where id = #{waybillId} + + + + + diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseWayBillDetailAbolishService.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseWayBillDetailAbolishService.java index 5e358351e..7522188ad 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseWayBillDetailAbolishService.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseWayBillDetailAbolishService.java @@ -1,8 +1,12 @@ package com.logpm.warehouse.service; +import com.logpm.warehouse.entity.WarehouseWayBillDetail; import com.logpm.warehouse.entity.WarehouseWayBillDetailAbolish; import org.springblade.core.mp.base.BaseService; +import java.util.List; + public interface IWarehouseWayBillDetailAbolishService extends BaseService { + List findByWaybillIds(List ids); } diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseWaybillAbolishService.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseWaybillAbolishService.java index 350de82a6..edcf44d41 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseWaybillAbolishService.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseWaybillAbolishService.java @@ -1,7 +1,13 @@ package com.logpm.warehouse.service; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.logpm.warehouse.dto.WarehouseWaybillDTO; import com.logpm.warehouse.entity.WarehouseWaybillAbolishEntity; +import com.logpm.warehouse.vo.WarehouseWaybillVO; import org.springblade.core.mp.base.BaseService; public interface IWarehouseWaybillAbolishService extends BaseService { + + IPage pageAbolishWaybillList(WarehouseWaybillDTO waybillDTO); + } diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseWaybillService.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseWaybillService.java index d741deee4..4423e9ce0 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseWaybillService.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseWaybillService.java @@ -97,4 +97,5 @@ public interface IWarehouseWaybillService extends BaseService findWaybillVOByOrderCode(String orderCode); R updateWaybillTypeService(WarehouseWaybillDTO waybillDTO); + } diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWayBillDetailAbolishServiceImpl.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWayBillDetailAbolishServiceImpl.java index c393a6bda..dec14375b 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWayBillDetailAbolishServiceImpl.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWayBillDetailAbolishServiceImpl.java @@ -1,5 +1,6 @@ package com.logpm.warehouse.service.impl; +import com.logpm.warehouse.entity.WarehouseWayBillDetail; import com.logpm.warehouse.entity.WarehouseWayBillDetailAbolish; import com.logpm.warehouse.mapper.WarehouseWayBillDetailAbolishMapper; import com.logpm.warehouse.service.IWarehouseWayBillDetailAbolishService; @@ -8,11 +9,16 @@ import lombok.extern.slf4j.Slf4j; import org.springblade.core.mp.base.BaseServiceImpl; import org.springframework.stereotype.Service; +import java.util.Collections; +import java.util.List; + @Slf4j @AllArgsConstructor @Service public class WarehouseWayBillDetailAbolishServiceImpl extends BaseServiceImpl implements IWarehouseWayBillDetailAbolishService { - - + @Override + public List findByWaybillIds(List ids) { + return baseMapper.findByWaybillIds(ids); + } } diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWaybillAbolishServiceImpl.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWaybillAbolishServiceImpl.java index 40f8fe035..fa3076eb7 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWaybillAbolishServiceImpl.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWaybillAbolishServiceImpl.java @@ -1,15 +1,85 @@ package com.logpm.warehouse.service.impl; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.logpm.warehouse.dto.WarehouseWaybillDTO; +import com.logpm.warehouse.entity.WarehouseWayBillDetail; import com.logpm.warehouse.entity.WarehouseWaybillAbolishEntity; import com.logpm.warehouse.mapper.WarehouseWaybillAbolishMapper; +import com.logpm.warehouse.service.IWarehouseWayBillDetailAbolishService; import com.logpm.warehouse.service.IWarehouseWaybillAbolishService; +import com.logpm.warehouse.vo.WarehouseWaybillVO; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.springblade.common.utils.CommonUtil; import org.springblade.core.mp.base.BaseServiceImpl; +import org.springblade.core.tool.utils.StringUtil; import org.springframework.stereotype.Service; +import java.math.BigDecimal; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.stream.Collectors; + @Service @AllArgsConstructor @Slf4j public class WarehouseWaybillAbolishServiceImpl extends BaseServiceImpl implements IWarehouseWaybillAbolishService { + + private final IWarehouseWayBillDetailAbolishService warehouseWayBillDetailAbolishService; + + @Override + public IPage pageAbolishWaybillList(WarehouseWaybillDTO waybillDTO) { + + IPage page = new Page<>(); + page.setCurrent(waybillDTO.getPageNum()); + page.setSize(waybillDTO.getPageSize()); + + waybillDTO.setDocumentMakingTimeStartDate(CommonUtil.getStartByDateStr(waybillDTO.getDocumentMakingTimeStartStr())); + waybillDTO.setDocumentMakingTimeEndDate(CommonUtil.getEndByDateStr(waybillDTO.getDocumentMakingTimeEndStr())); + waybillDTO.setCreateTimeStartDate(CommonUtil.getStartByDateStr(waybillDTO.getCreateTimeStartStr())); + waybillDTO.setCreateTimeEndDate(CommonUtil.getEndByDateStr(waybillDTO.getCreateTimeEndStr())); + waybillDTO.setAbolishTimeStartDate(CommonUtil.getStartByDateStr(waybillDTO.getAbolishTimeStartStr())); + waybillDTO.setAbolishTimeEndDate(CommonUtil.getEndByDateStr(waybillDTO.getAbolishTimeEndStr())); + waybillDTO.setFreezeTimeStartDate(CommonUtil.getStartByDateStr(waybillDTO.getFreezeTimeStartStr())); + waybillDTO.setFreezeTimeEndDate(CommonUtil.getEndByDateStr(waybillDTO.getFreezeTimeEndStr())); + + IPage pageList = baseMapper.pageAbolishWaybillList(page, waybillDTO); + + + List records = pageList.getRecords(); + + if (!records.isEmpty()) { + //把records中的id取出作为一个集合 + List ids = records.stream().map(WarehouseWaybillVO::getId).collect(Collectors.toList()); + List wayBillDetailList = warehouseWayBillDetailAbolishService.findByWaybillIds(ids); + //把wayBillDetailList通过waibillId分组 + Map> map = wayBillDetailList.stream().collect(Collectors.groupingBy(WarehouseWayBillDetail::getWaybillId)); + for (WarehouseWaybillVO record : records) { + Long waybillId = record.getId(); + if (!Objects.isNull(map.get(waybillId))){ + List warehouseWayBillDetails = map.get(waybillId); + // 将集合 warehouseWayBillDetails 中的productName 按照, 进行拼接 + String productNames = warehouseWayBillDetails.stream().filter(s -> StringUtil.isNotBlank(s.getProductName())).map(WarehouseWayBillDetail::getProductName).collect(Collectors.joining(",")); + record.setGoodsName(productNames); + String productNum = warehouseWayBillDetails.stream().filter(s -> !Objects.isNull(s.getNum())).map(s -> s.getNum().toString()).collect(Collectors.joining(",")); + record.setProductNum(productNum); + String productPrice = warehouseWayBillDetails.stream().filter(s -> !Objects.isNull(s.getPrice())).map(s -> s.getPrice().toString()).collect(Collectors.joining(",")); + record.setProductPrice(productPrice); + // 对集合中的weight 进行求和 + BigDecimal sumWeight = warehouseWayBillDetails.stream().filter(s -> !Objects.isNull(s.getWeight())).map(WarehouseWayBillDetail::getWeight).reduce(BigDecimal.ZERO, BigDecimal::add); + record.setTotalWeight(sumWeight); + BigDecimal productVolume = warehouseWayBillDetails.stream().filter(s -> !Objects.isNull(s.getVolume())).map(WarehouseWayBillDetail::getVolume).reduce(BigDecimal.ZERO, BigDecimal::add); + record.setTotalVolume(productVolume); + record.setDetailList(warehouseWayBillDetails); + } + + } + pageList.setRecords(records); + } + + return pageList; + + } } diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWaybillServiceImpl.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWaybillServiceImpl.java index ba9010796..b788aab1b 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWaybillServiceImpl.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWaybillServiceImpl.java @@ -37,6 +37,7 @@ import com.logpm.warehouse.entity.WarehouseWaybillEntity; import com.logpm.warehouse.excel.WarehouseWaybillExcel; import com.logpm.warehouse.mapper.WarehouseWaybillMapper; import com.logpm.warehouse.service.IWarehouseWayBillDetailService; +import com.logpm.warehouse.service.IWarehouseWaybillAbolishService; import com.logpm.warehouse.service.IWarehouseWaybillService; import com.logpm.warehouse.vo.ExportWarehouseWaybillVO; import com.logpm.warehouse.vo.FinanceWaybillExportVO; @@ -93,6 +94,9 @@ public class WarehouseWaybillServiceImpl extends BaseServiceImpl selectWarehouseWaybillPage(IPage page, WarehouseWaybillVO warehouseWaybill) { return page.setRecords(baseMapper.selectWarehouseWaybillPage(page, warehouseWaybill)); @@ -1256,4 +1260,5 @@ public class WarehouseWaybillServiceImpl extends BaseServiceImpl