diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/DistributionAppStockUpClientVO.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/DistributionAppStockUpClientVO.java index acbee6a43..a79cdacf9 100644 --- a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/DistributionAppStockUpClientVO.java +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/DistributionAppStockUpClientVO.java @@ -50,6 +50,7 @@ public class DistributionAppStockUpClientVO implements Serializable { private List stockUpZeroOrderDetailVOList; private List deliveryPackageDetailList; private List deliveryTrayList; + private List stockUpScanDetailVO; diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/DistributionAppStockUpScanDetailVO.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/DistributionAppStockUpScanDetailVO.java index 74e382788..6850d7645 100644 --- a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/DistributionAppStockUpScanDetailVO.java +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/DistributionAppStockUpScanDetailVO.java @@ -31,10 +31,11 @@ import java.util.List; public class DistributionAppStockUpScanDetailVO implements Serializable { private static final long serialVersionUID = 1L; - private String trayName; - private String trayCode; - private Integer planNum; - private Integer scanNum; - - + private Long stockId; + private Integer type; + private String orderPackageCode; + private String typeName; + private String goodsName; + private String orderCode; + private String stockupAllocation; } diff --git a/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/ExpenseDispatchTrainDetailEntity.java b/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/ExpenseDispatchTrainDetailEntity.java index 238494f66..568619b5b 100644 --- a/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/ExpenseDispatchTrainDetailEntity.java +++ b/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/ExpenseDispatchTrainDetailEntity.java @@ -75,6 +75,30 @@ public class ExpenseDispatchTrainDetailEntity extends TenantEntity { @ApiModelProperty(value = "配送日期") @ExcelProperty("车次号") private String deliveryDate; + /** + * 车次完成时间 + */ + @ApiModelProperty(value = "车次完成时间") + @ExcelProperty("车次完成时间") + private Date trainCompletionTime; + /** + * 车次完成时间-年 + */ + @ApiModelProperty(value = "车次完成时间-年") + @ExcelProperty("车次完成时间-年") + private int trainCompletionYear; + /** + * 车次完成时间-月 + */ + @ApiModelProperty(value = "车次完成时间-月") + @ExcelProperty("车次完成时间-月") + private int trainCompletionMonth; + /** + * 车次完成时间-日 + */ + @ApiModelProperty(value = "车次完成时间-日") + @ExcelProperty("车次完成时间-日") + private int trainCompletionDay; /** * 目的仓 */ diff --git a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/controller/AftersalesWorkOrderController.java b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/controller/AftersalesWorkOrderController.java index 84f8830c0..94c76b04d 100644 --- a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/controller/AftersalesWorkOrderController.java +++ b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/controller/AftersalesWorkOrderController.java @@ -140,7 +140,6 @@ public class AftersalesWorkOrderController extends BladeController { log.error("工单查询系统异常》》》{}", e.getMessage()); return R.fail("系统异常!"); } - } /** diff --git a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesWorkOrderMapper.xml b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesWorkOrderMapper.xml index 8973a9c22..4e6eff028 100644 --- a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesWorkOrderMapper.xml +++ b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesWorkOrderMapper.xml @@ -1250,9 +1250,10 @@ logpm_aftersales_processor AS lbp WHERE lbp.types_of != 3 - AND lbp.processing_status IN ( '1', '3' ) + AND lbp.processing_status = 1 AND lbp.is_deleted = 0 - AND DATEDIFF(DATE_FORMAT(lbp.create_time,'%y%m%d'), DATE_FORMAT(NOW(),'%y%m%d')) <= -3 + AND DATEDIFF(DATE_FORMAT(lbp.create_time,'%y%m%d'), DATE_FORMAT('2025-01-01','%y%m%d')) <= -3 + AND DATE_FORMAT(lbp.create_time,'%y%m%d') >= DATE_FORMAT( '2025-01-01', '%y%m%d' ) SELECT - lds.id, + lds.id AS stockId, + lds.type AS type, lds.coding AS orderPackageCode, CASE lds.type - WHEN 1 THEN '订制品' + WHEN 1 THEN '定制品' WHEN 2 THEN '库存品' WHEN 3 THEN '零担' ELSE diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupMapper.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupMapper.java index fd28d3904..f0dd71cb4 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupMapper.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupMapper.java @@ -373,7 +373,7 @@ public interface DistributionStockupMapper extends BaseMapper selectDeliveryPackageDetailList(@Param("reservationId")Long reservationId,@Param("orderId") Long orderId); + List selectDeliveryPackageDetailList(@Param("reservationId")Long reservationId); /** * 查询自提包件列表 @@ -381,7 +381,7 @@ public interface DistributionStockupMapper extends BaseMapper selectBillPackageDetailList(@Param("billId")Long billId,@Param("orderId") Long orderId); + List selectBillPackageDetailList(@Param("billId")Long billId); /** * 查询自提备货所有包件 diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.xml index 161e778cc..ad5cd26e0 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.xml @@ -1145,7 +1145,7 @@ LEFT JOIN logpm_distribution_parcel_list AS ldpl ON ldpl.id = ldbp.parce_list_id AND ldpl.is_deleted = 0 AND ldpl.is_transfer = 0 LEFT JOIN logpm_warehouse_tray AS lwt ON ldpl.pallet = lwt.pallet_name AND lwt.warehouse_id = ldpl.warehouse_id - LEFT JOIN logpm_distribution_stock AS lds ON lds.reservation_id = ldbp.bill_lading_id + LEFT JOIN logpm_distribution_stock AS lds ON lds.reservation_id = ldbp.bill_lading_id AND lds.coding = ldpl.order_package_code AND lds.type = 1 AND lds.outbound_type = 3 AND lds.cancel_status != 1 @@ -1155,7 +1155,7 @@ GROUP BY ldpl.pallet HAVING - IFNULL( sum( ldpl.quantity ), 0 ) > 0 + IFNULL( sum( ldpl.quantity ), 0 ) > 0 AND ldpl.pallet IS NOT NULL ) AS t LEFT JOIN logpm_warehouse_tray_goods AS lwtg ON lwtg.tray_code = t.trayCode AND lwtg.is_deleted = 0 diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockupService.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockupService.java index ab3aad485..995989d82 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockupService.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockupService.java @@ -365,18 +365,18 @@ public interface IDistributionStockupService extends BaseService>>>>>>>>>>>>>>>>>>>>>reservationId:{}",reservationId); return R.fail("查询计划信息错误"); } - List trayPackageIds = trayIdList.stream().map(WarehouseTrayGoodsEntity::getAssociationId).collect(Collectors.toList()); + boolean isAllStockUp = distributionParcelListEntities.stream().anyMatch(a -> OrderPackageStockupStatusConstant.daibeihuo.getValue().equals(a.getOrderPackageStockupStatus())); + if (isAllStockUp) { + List unStockUpPackageData = distributionParcelListEntities.stream().filter(f1 -> OrderPackageStockupStatusConstant.daibeihuo.getValue().equals(f1.getOrderPackageStockupStatus())).collect(Collectors.toList()); + if (unStockUpPackageData.isEmpty()) { + return Resp.scanFail("扫描已完成","扫描已完成"); + } + List trayPackageIds = trayIdList.stream().map(WarehouseTrayGoodsEntity::getAssociationId).collect(Collectors.toList()); + List packageData = unStockUpPackageData.stream().filter(f -> trayPackageIds.contains(f.getId())).collect(Collectors.toList()); + if (packageData.isEmpty()) { + return R.fail("当前托盘无此客户的货物"); + } + warehouseUpdownTypeClient.downTray(trayByTrayCode.getPalletCode(),myCurrentWarehouse.getId()); + //生成扫描数据 + List stockEntityList = generateDeliveryTrayPackageStockEntity(reservationEntity,packageData,myCurrentWarehouse,user,stockupDTO.getStockupId(),stockupEntity); + if (!stockEntityList.isEmpty()) { + // 备货作业节点 + distributionStockService.saveBatch(stockEntityList); + List updatePackageIds = stockEntityList.stream().map(DistributionStockEntity::getParcelListId).collect(Collectors.toList()); + distributionParcelListService.update(Wrappers.update().lambda() + .in(DistributionParcelListEntity::getId,updatePackageIds) + .set(DistributionParcelListEntity::getOrderPackageStockupStatus,OrderPackageStockupStatusConstant.yibeihu.getValue()) + ); + } - List packageData = distributionParcelListEntities.stream().filter(f -> trayPackageIds.contains(f.getId())).collect(Collectors.toList()); - if (packageData.isEmpty()) { - return R.fail("当前托盘无此客户的货物"); - } - warehouseUpdownTypeClient.downTray(trayByTrayCode.getPalletCode(),myCurrentWarehouse.getId()); - //生成扫描数据 - List stockEntityList = generateDeliveryTrayPackageStockEntity(reservationEntity,packageData,myCurrentWarehouse,user,stockupDTO.getStockupId()); - if (!stockEntityList.isEmpty()) { - distributionStockService.saveBatch(stockEntityList); + return Resp.scanSuccess("操作成功",""); + }else { + return Resp.scanFail("订制品备货已完成",""); } - return Resp.scanSuccess("操作成功"," "); } private List generateDeliveryTrayPackageStockEntity(DistributionReservationEntity reservationEntity, List packageData, BasicdataWarehouseEntity warehouse, BladeUser user, - Long stockUpId) { + Long stockUpId, + DistributionStockupEntity stockupEntity) { List list= new ArrayList<>(); for (DistributionParcelListEntity parcelListEntity : packageData) { DistributionStockEntity distributionStockEntity = new DistributionStockEntity(); @@ -4728,6 +4744,10 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl nodeFanoutMsg = buildStockUpNodeData(stockupEntity, distributionStockEntity, parcelListEntity); + if (ObjectUtils.isNotNull(nodeFanoutMsg)) { + distributionNodeWorkService.planStock(nodeFanoutMsg, AuthUtil.getUser()); + } } return list; } @@ -5071,7 +5091,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl deliveryPackageDetailList = baseMapper.selectDeliveryPackageDetailList(reservationId,orderId); + List deliveryPackageDetailList = baseMapper.selectDeliveryPackageDetailList(reservationId); if (!deliveryPackageDetailList.isEmpty()) { stockUpClientVO.setDeliveryPackageDetailList(deliveryPackageDetailList); } @@ -5674,12 +5694,12 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl billPackageDetailList = baseMapper.selectBillPackageDetailList(reservationId,orderId); + List billPackageDetailList = baseMapper.selectBillPackageDetailList(reservationId); if (!billPackageDetailList.isEmpty()) { stockUpClientVO.setDeliveryPackageDetailList(billPackageDetailList); } @@ -5827,14 +5847,15 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl stockUpScanDetailVO = distributionStockService.selectScanDetail(reservationId,stockupId); - return R.data(stockUpScanDetailVO); + if (!stockUpScanDetailVO.isEmpty()) { + stockUpClientVO.setStockUpScanDetailVO(stockUpScanDetailVO); + return R.data(stockUpClientVO); + } + return R.fail("无备货记录"); } @Override public R newStockupArea(StockupDTO stockupDTO) { - if (Objects.isNull(stockupDTO.getStockupId())){ - return R.fail("StockupId()参数缺失"); - } BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse(); if (Objects.isNull(myCurrentWarehouse)) { return Resp.scanFail("请选择备货作业仓库","请选择备货作业仓库"); @@ -5843,6 +5864,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl goodsAreaVOList = basicdataGoodsAreaClient.getDepartmentId(deptId); + BasicdataGoodsAllocationEntity entityByQrCode = basicdataGoodsAllocationClient.findEntityByQrCode(myCurrentWarehouse.getId(), allocationCode); + if (Objects.isNull(entityByQrCode)){ + return Resp.scanFail("请扫描库位码","请扫描库位码"); + } + List areaVOList = goodsAreaVOList.stream().filter(f -> "1".equals(f.getAreaType()) && entityByQrCode.getGoodsAreaId().equals(f.getId())).collect(Collectors.toList()); + if (!areaVOList.isEmpty()) { + return Resp.scanFail("当前库位不是备货库位","当前库位不是备货库位"); + } + return R.data(entityByQrCode); }else { return Resp.scanFail("当前操作人无此操作权限","当前操作人无此操作权限"); } @@ -6058,13 +6089,28 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl distributionAppStockUpTrayDetailVOS = distributionReservationMapper.deliveryTrayDetailList(reservationId); + if (!distributionAppStockUpTrayDetailVOS.isEmpty()) { + stockUpClientVO.setDeliveryTrayList(distributionAppStockUpTrayDetailVOS); + } + return R.data(stockUpClientVO); } @Override public R handleBillTrayDetailList(Long reservationId) { - return R.data(distrilbutionBillLadingMapper.billTrayDetailList(reservationId)); + DistributionAppStockUpClientVO stockUpClientVO = baseMapper.selectPlanClientDetailById(reservationId); + if (Objects.isNull(stockUpClientVO)){ + return R.fail("查询备货客户信息错误"); + } + List distributionAppStockUpTrayDetailVOS = distrilbutionBillLadingMapper.billTrayDetailList(reservationId); + if (!distributionAppStockUpTrayDetailVOS.isEmpty()) { + stockUpClientVO.setDeliveryTrayList(distributionAppStockUpTrayDetailVOS); + } + return R.data(stockUpClientVO); } /** diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/QualityDeliverServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/QualityDeliverServiceImpl.java index df0b5937e..0f8de634d 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/QualityDeliverServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/QualityDeliverServiceImpl.java @@ -116,6 +116,10 @@ public class QualityDeliverServiceImpl extends BaseServiceImpl entities = this.list(Wrappers.lambdaQuery().eq(QualityDeliverEntity::getSignTrainNumber, trainNumber)); - if(CollUtil.isNotEmpty(entities)){ + if (CollUtil.isNotEmpty(entities)) { buildCarExpenseReport(entities); } } diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/ExpenseDispatchTrainDetailMapper.xml b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/ExpenseDispatchTrainDetailMapper.xml index b4196e805..b2c8fb0b4 100644 --- a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/ExpenseDispatchTrainDetailMapper.xml +++ b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/ExpenseDispatchTrainDetailMapper.xml @@ -37,6 +37,12 @@ and delivery_date <= #{expenseDispatchTrainDetail.deliveryDateEnd} + + and train_completion_time >= #{expenseDispatchTrainDetail.trainCompletionTimeStart} + + + and train_completion_time <= #{expenseDispatchTrainDetail.trainCompletionTimeEnd} + and distribution_type = #{expenseDispatchTrainDetail.distributionType} diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/ExpenseDispatchWarehouseMonthMapper.xml b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/ExpenseDispatchWarehouseMonthMapper.xml index c105a65fd..f24947158 100644 --- a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/ExpenseDispatchWarehouseMonthMapper.xml +++ b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/ExpenseDispatchWarehouseMonthMapper.xml @@ -32,9 +32,9 @@ diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/query/ExpenseDispatchTrainDetailQuery.java b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/query/ExpenseDispatchTrainDetailQuery.java index 8080f6230..378193f4c 100644 --- a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/query/ExpenseDispatchTrainDetailQuery.java +++ b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/query/ExpenseDispatchTrainDetailQuery.java @@ -5,6 +5,8 @@ import lombok.Data; import lombok.EqualsAndHashCode; import org.springblade.core.mp.support.Query; +import java.util.Date; + @Data @EqualsAndHashCode(callSuper = true) public class ExpenseDispatchTrainDetailQuery extends Query { @@ -18,6 +20,16 @@ public class ExpenseDispatchTrainDetailQuery extends Query { */ @ApiModelProperty(value = "配送日期结束") private String deliveryDateEnd; + /** + * 车次完成时间开始 + */ + @ApiModelProperty(value = "车次完成时间开始") + private Date trainCompletionTimeStart; + /** + * 车次完成时间结束 + */ + @ApiModelProperty(value = "车次完成时间结束") + private Date trainCompletionTimeEnd; /** * 配送司机 */ diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/vo/ExpenseDispatchTrainDetailVO.java b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/vo/ExpenseDispatchTrainDetailVO.java index ab78ca7bf..16803ce32 100644 --- a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/vo/ExpenseDispatchTrainDetailVO.java +++ b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/vo/ExpenseDispatchTrainDetailVO.java @@ -64,8 +64,14 @@ public class ExpenseDispatchTrainDetailVO { * 配送日期 */ @ApiModelProperty(value = "配送日期") - @ExcelProperty("车次号") + @ExcelProperty("配送日期") private String deliveryDate; + /** + * 车次完成时间 + */ + @ApiModelProperty(value = "车次完成时间") + @ExcelProperty("车次完成时间") + private String trainCompletionTime; /** * 目的仓 */