diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/queryOrderVO.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/queryOrderVO.java index c5141e58a..528f4c602 100644 --- a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/queryOrderVO.java +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/queryOrderVO.java @@ -1,9 +1,8 @@ package com.logpm.distribution.vo.app; +import com.alibaba.fastjson.JSONObject; import com.logpm.distribution.entity.DistributionParcelListEntity; import com.logpm.distribution.entity.DistributionStockArticleEntity; -import com.logpm.distribution.vo.DistributionParcelListVO; -import com.logpm.distribution.vo.DistributionStockListInfoVO; import com.logpm.distribution.vo.DistributionStockListVO; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -42,4 +41,11 @@ public class queryOrderVO extends DistributionStockArticleEntity { private Integer inventoryNum; + /** + * 未入库包件列表 + */ + @ApiModelProperty(value = "未入库包件列表") + private List noIncomingList; + + } diff --git a/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/feign/ITrunklineAdvanceDetailClient.java b/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/feign/ITrunklineAdvanceDetailClient.java index ac642dcee..473b63039 100644 --- a/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/feign/ITrunklineAdvanceDetailClient.java +++ b/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/feign/ITrunklineAdvanceDetailClient.java @@ -1,7 +1,6 @@ package com.logpm.trunkline.feign; import com.logpm.trunkline.entity.TrunklineAdvanceDetailEntity; -import com.logpm.trunkline.vo.TrunklineAdvanceDetailVO; import org.springblade.common.constant.ModuleNameConstant; import org.springblade.core.tool.api.R; import org.springframework.cloud.openfeign.FeignClient; @@ -48,4 +47,7 @@ public interface ITrunklineAdvanceDetailClient { @PostMapping(API_PREFIX + "/maintainMaterial") R maintainMaterial(@RequestBody Map map); + + @GetMapping(API_PREFIX+"/findListByStockArticleId") + List findListByStockArticleId(@RequestParam Long stockArticleId, @RequestParam Long warehouseId); } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java index 10a3bc900..7bb62fb18 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java @@ -1189,10 +1189,16 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl myWarehouseList = warehouseClient.getMyWatchWarehouse(); - List collect = myWarehouseList.stream() - .map(BasicdataWarehouseEntity::getId) - .collect(Collectors.toList()); +// List myWarehouseList = warehouseClient.getMyWatchWarehouse(); +// List collect = myWarehouseList.stream() +// .map(BasicdataWarehouseEntity::getId) +// .collect(Collectors.toList()); + List collect = new ArrayList<>(); + + BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); + Long warehouseId = myCurrentWarehouse.getId(); + collect.add(warehouseId); + //查询包条(库存品)所在订单 queryOrderVO queryOrderVO; if (i == 1) { @@ -1207,12 +1213,21 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl distributionParcelListEntitys = distributionParcelListMapper.selectListByOderId(id, collect); + //查询订单下的所有库存品 List distributionStockListVOS = distributionParcelListMapper.selectStockListByOderId(id, collect); + //查询订单下所有未入库的包件 + List advanceDetailEntities = trunklineAdvanceDetailClient.findListByStockArticleId(id,warehouseId); + List noIncomingPackage = new ArrayList<>(); + advanceDetailEntities.forEach(advanceDetailEntity -> { + noIncomingPackage.add(JSONObject.parseObject(JSONObject.toJSONString(advanceDetailEntity))); + }); + queryOrderVO.setWrapNum(distributionParcelListEntitys.size()); queryOrderVO.setInventoryNum(distributionStockListVOS.size()); queryOrderVO.setList(distributionParcelListEntitys); queryOrderVO.setStockList(distributionStockListVOS); + queryOrderVO.setNoIncomingList(noIncomingPackage); return queryOrderVO; } 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 1ca670eb3..976703731 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 @@ -238,14 +238,20 @@ count(lta.waybill_id) openNum, sum( IF(ltcls.id IS NOT NULL AND ltcll.start_date is not null,1,0) ) startNum, count(lta.id)-sum( IF(ltcls.id IS NOT NULL AND ltcll.start_date is not null,1,0) ) noOutNum, - sum(if( ltcls.id is null and now() > DATE_ADD( lta.create_time, INTERVAL #{param.hoursTime} HOUR ),1,0)) noOutOverNum, + sum(if( (ltcls.id IS NULL OR ltcll.start_date IS NULL) and now() > DATE_ADD( lta.create_time, INTERVAL #{param.hoursTime} HOUR ),1,0)) noOutOverNum, sum(if(ltcll.start_date <= DATE_ADD( lta.create_time, INTERVAL #{param.hoursTime} HOUR ),1,0)) onTimeNum, IFNULL(round(sum(if(ltcll.start_date <= DATE_ADD( lta.create_time, INTERVAL #{param.hoursTime} HOUR ),1,0))/count(lta.id)*100,2),'0.00') onTimeRate, round(sum(TIMESTAMPDIFF(SECOND, lta.create_time, ltcll.start_date))/count(ltcls.id)/3600,1) avgTime from logpm_trunkline_advance_detail lta left join logpm_warehouse_waybill lww on lww.id = lta.waybill_id left join logpm_warehouse_warehouse waw on waw.id = lta.warehouse_id - left join logpm_trunkline_cars_load_scan ltcls on ltcls.scan_code = lta.order_package_code and ltcls.warehouse_id = lta.warehouse_id and ltcls.type = 1 and ltcls.scan_status != 4 + left join ( + SELECT + t1.* + FROM logpm_trunkline_cars_load_scan t1 + LEFT JOIN logpm_trunkline_cars_load_scan t2 ON t1.scan_code = t2.scan_code AND t1.create_time < t2.create_time + WHERE t2.scan_code IS NULL + ) ltcls on ltcls.scan_code = lta.order_package_code and ltcls.warehouse_id = lta.warehouse_id and ltcls.type = 1 and ltcls.scan_status != 4 left join logpm_trunkline_cars_load_line ltcll on ltcll.load_id = ltcls.load_id and ltcll.node_id = ltcls.warehouse_id where lta.create_time > '2024-10-22 00:00:00' and lww.document_making_time > '2024-10-22 00:00:00' @@ -299,14 +305,20 @@ count(lta.waybill_id) openNum, sum( IF(ltcls.id IS NOT NULL AND ltcll.start_date is not null,1,0) ) startNum, count(lta.id)-sum( IF(ltcls.id IS NOT NULL AND ltcll.start_date is not null,1,0) ) noOutNum, - sum(if( ltcls.id is null and now() > DATE_ADD( lta.create_time, INTERVAL #{param.hoursTime} HOUR ),1,0)) noOutOverNum, + sum(if( (ltcls.id IS NULL OR ltcll.start_date IS NULL) and now() > DATE_ADD( lta.create_time, INTERVAL #{param.hoursTime} HOUR ),1,0)) noOutOverNum, sum(if(ltcll.start_date <= DATE_ADD( lta.create_time, INTERVAL #{param.hoursTime} HOUR ),1,0)) onTimeNum, - IFNULL(concat(round(sum(if(ltcll.start_date <= DATE_ADD( lta.create_time, INTERVAL #{param.hoursTime} HOUR ),1,0))/count(ltcls.id)*100,2),'%'),'0.00%') onTimeRate, + IFNULL(concat(round(sum(if(ltcll.start_date <= DATE_ADD( lta.create_time, INTERVAL #{param.hoursTime} HOUR ),1,0))/count(lta.id)*100,2),'%'),'0.00%') onTimeRate, round(sum(TIMESTAMPDIFF(SECOND, lta.create_time, ltcll.start_date))/count(ltcls.id)/3600,1) avgTime from logpm_trunkline_advance_detail lta left join logpm_warehouse_waybill lww on lww.id = lta.waybill_id left join logpm_warehouse_warehouse waw on waw.id = lta.warehouse_id - left join logpm_trunkline_cars_load_scan ltcls on ltcls.scan_code = lta.order_package_code and ltcls.warehouse_id = lta.warehouse_id and ltcls.type = 1 and ltcls.scan_status != 4 + left join ( + SELECT + t1.* + FROM logpm_trunkline_cars_load_scan t1 + LEFT JOIN logpm_trunkline_cars_load_scan t2 ON t1.scan_code = t2.scan_code AND t1.create_time < t2.create_time + WHERE t2.scan_code IS NULL + ) ltcls on ltcls.scan_code = lta.order_package_code and ltcls.warehouse_id = lta.warehouse_id and ltcls.type = 1 and ltcls.scan_status != 4 left join logpm_trunkline_cars_load_line ltcll on ltcll.load_id = ltcls.load_id and ltcll.node_id = ltcls.warehouse_id where lta.create_time > '2024-10-22 00:00:00' and lww.document_making_time > '2024-10-22 00:00:00' @@ -2826,7 +2838,7 @@ and ltcls.id is null - and now() <= DATE_ADD( ltad.create_time, INTERVAL #{param.hoursTime} HOUR ) + and now() > DATE_ADD( ltad.create_time, INTERVAL #{param.hoursTime} HOUR ) group by ltad.id @@ -2928,7 +2940,7 @@ and ltcls.id is null - and now() <= DATE_ADD( ltad.create_time, INTERVAL #{param.hoursTime} HOUR ) + and now() > DATE_ADD( ltad.create_time, INTERVAL #{param.hoursTime} HOUR ) group by ltad.id diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/feign/TrunklineAdvanceDetailClient.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/feign/TrunklineAdvanceDetailClient.java index 870e7df29..bff5ed14a 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/feign/TrunklineAdvanceDetailClient.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/feign/TrunklineAdvanceDetailClient.java @@ -5,13 +5,13 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.logpm.trunkline.entity.TrunklineAdvanceDetailEntity; import com.logpm.trunkline.service.ITrunklineAdvanceDetailService; -import com.logpm.trunkline.vo.TrunklineAdvanceDetailVO; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springblade.core.tool.api.R; import org.springframework.web.bind.annotation.RestController; import springfox.documentation.annotations.ApiIgnore; +import java.util.Collections; import java.util.List; import java.util.Map; @@ -72,4 +72,9 @@ public class TrunklineAdvanceDetailClient implements ITrunklineAdvanceDetailClie return advanceDetailService.maintainMaterial(map); } + + @Override + public List findListByStockArticleId(Long stockArticleId, Long warehouseId) { + return advanceDetailService.findListByStockArticleId(stockArticleId,warehouseId); + } } diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceDetailMapper.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceDetailMapper.java index 185a5b37b..a716d1717 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceDetailMapper.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceDetailMapper.java @@ -107,4 +107,5 @@ public interface TrunklineAdvanceDetailMapper extends BaseMapper advanceDetailIdList); + List findListByStockArticleId(@Param("stockArticleId") Long stockArticleId, @Param("warehouseId") Long warehouseId); } diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceDetailMapper.xml b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceDetailMapper.xml index fd3e6fe5d..49d7a0b35 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceDetailMapper.xml +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceDetailMapper.xml @@ -748,4 +748,15 @@ + + diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineAdvanceDetailService.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineAdvanceDetailService.java index 9be8e14e1..500c555fc 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineAdvanceDetailService.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineAdvanceDetailService.java @@ -129,4 +129,6 @@ public interface ITrunklineAdvanceDetailService extends BaseService map); + + List findListByStockArticleId(Long stockArticleId, Long warehouseId); } diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceDetailServiceImpl.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceDetailServiceImpl.java index 9b807483e..32b9fc63f 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceDetailServiceImpl.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceDetailServiceImpl.java @@ -974,4 +974,9 @@ public class TrunklineAdvanceDetailServiceImpl extends BaseServiceImpl findListByStockArticleId(Long stockArticleId, Long warehouseId) { + return baseMapper.findListByStockArticleId(stockArticleId,warehouseId); + } } 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 42a9e2c92..8aa67349c 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 @@ -2267,39 +2267,39 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl qualityList = carsLoadLinePhotoService.findListByLoadIdAndWarehouseId(loadId, warehouseId, 30, null); //把qualityList通过position=2进行过滤生成新的list List qualityListHou = qualityList.stream().filter(item -> item.getPosition().equals(2)).collect(Collectors.toList()); if(qualityListHou.size() == 0){ - updateEntity.setIsUnloadPhoto(0); - trunklineCarsLoadLineService.updateById(updateEntity); + carsLoadLine.setIsUnloadPhoto(0); + trunklineCarsLoadLineService.updateById(carsLoadLine); return R.success("上传成功"); } List qualityListZuo = qualityList.stream().filter(item -> item.getPosition().equals(3)).collect(Collectors.toList()); if(qualityListZuo.size() == 0){ - updateEntity.setIsUnloadPhoto(0); - trunklineCarsLoadLineService.updateById(updateEntity); + carsLoadLine.setIsUnloadPhoto(0); + trunklineCarsLoadLineService.updateById(carsLoadLine); return R.success("上传成功"); } List qualityListYou = qualityList.stream().filter(item -> item.getPosition().equals(4)).collect(Collectors.toList()); if(qualityListYou.size() == 0){ - updateEntity.setIsUnloadPhoto(0); - trunklineCarsLoadLineService.updateById(updateEntity); + carsLoadLine.setIsUnloadPhoto(0); + trunklineCarsLoadLineService.updateById(carsLoadLine); return R.success("上传成功"); } List protectionList = carsLoadLinePhotoService.findListByLoadIdAndWarehouseId(loadId, warehouseId, 31, 2); if(protectionList.size() == 0){ - updateEntity.setIsUnloadPhoto(0); - trunklineCarsLoadLineService.updateById(updateEntity); + carsLoadLine.setIsUnloadPhoto(0); + trunklineCarsLoadLineService.updateById(carsLoadLine); return R.success("上传成功"); } - updateEntity.setIsUnloadPhoto(1); - trunklineCarsLoadLineService.updateById(updateEntity); + carsLoadLine.setIsUnloadPhoto(1); + trunklineCarsLoadLineService.updateById(carsLoadLine); return R.success("上传成功"); } @@ -12582,7 +12582,11 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl orderPackageCodes = new ArrayList<>(); orderPackageCodes.add(orderPackageCode); + String content = "包件在 " + warehouseName + "卸车,车次号:"+carsLoadEntity.getCarsNo()+" 卸车方式:" + IncomingTypeEnum.getValue(incomingType)+ (StringUtil.isNotBlank(unloadTrayName)?"托盘:"+unloadTrayName:""); + if(NumberUtil.equals(isData,0)){ + content = "包件在 " + warehouseName + "卸车,车次号:"+carsLoadEntity.getCarsNo()+" 卸车方式:系统无编码 卸车(只记录未入库)"; + } packageTrackLogAsyncService.addPackageTrackLog(AuthUtil.getTenantId(), AuthUtil.getUserId(), Func.firstLong(AuthUtil.getDeptId()), AuthUtil.getNickName(), orderPackageCodes, warehouseId, warehouseName, WorkNodeEnums.UNLOAD_INCOMING_WAREHOUSE.getCode(), content); carsLoadAsyncService.sendFactoryData(orderCode,orderPackageCode,warehouseId,warehouseName); @@ -13802,6 +13806,19 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl