diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionStockupAppController.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionStockupAppController.java index ee6958b70..a39195c45 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionStockupAppController.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionStockupAppController.java @@ -1438,7 +1438,6 @@ public class DistributionStockupAppController extends BladeController { entity.setOutboundType(stockupEntity.getTypeService()); // entity.setStockupAreaId(stockupDTO.getStockupAllocationId()); // entity.setStockupArea(stockupDTO.getStockupAllocationName()); - distributionStockService.save(entity); // //修改备货时间 distributionAsyncService.updateStockupStockListDate(stockupDTO); // dataSourceTransactionManager.commit(transactionStatus);//提交 @@ -1469,7 +1468,9 @@ public class DistributionStockupAppController extends BladeController { jsonObject.put("type", 2); jsonObject.put("num", 1); warehouseUpdownStockUpAreaClient.upStockUpShelf(jsonObject); + entity.setStockupAreaId(stockupDTO.getStockupAllocationId()); } + distributionStockService.save(entity); //扫码成功 return Resp.scanSuccess(PdaAudioLingoStatus.saomiaochenggong.getName(), audioValue); @@ -1611,7 +1612,6 @@ public class DistributionStockupAppController extends BladeController { entity.setOutboundType(distributionStockupEntity.getTypeService()); // entity.setStockupArea(stockupDTO.getStockupAllocationName()); // entity.setStockupAreaId(stockupDTO.getStockupAllocationId()); - distributionStockService.save(entity); //修改订单备货状态 distributionAsyncService.updateStockArticleStock(one.getStockArticleId()); //修改备货时间 @@ -1659,7 +1659,10 @@ public class DistributionStockupAppController extends BladeController { jsonObject.put("num", 1); //进行了备货库位的选择才进行备货库位的上架 warehouseUpdownStockUpAreaClient.upStockUpShelf(jsonObject); + entity.setStockupAreaId(stockupDTO.getStockupAllocationId()); } + distributionStockService.save(entity); + //修改包件备货状态 DistributionParcelListEntity parcelListEntity = new DistributionParcelListEntity(); parcelListEntity.setId(entity.getParcelListId()); diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/bean/MyExcelUtil.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/bean/MyExcelUtil.java index c516be587..83d301966 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/bean/MyExcelUtil.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/bean/MyExcelUtil.java @@ -136,10 +136,9 @@ public class MyExcelUtil extends ExcelUtil { response.setCharacterEncoding("UTF-8"); outputStream = response.getOutputStream(); ExcelWriter build = EasyExcel.write(outputStream).build(); - WriteSheet orderList = EasyExcel.writerSheet("订单列表").head(DistributionBillOrderExcel.class).build(); - WriteSheet inventoryList = EasyExcel.writerSheet("库存品列表").head(DistributionBillOrderPackExcel.class).build(); - WriteSheet packageList = EasyExcel.writerSheet("包件列表").head(DistributionBillInventoryExcel.class).build(); + WriteSheet packageList = EasyExcel.writerSheet("包件列表").head(DistributionBillOrderPackExcel.class).build(); + WriteSheet inventoryList = EasyExcel.writerSheet("库存品列表").head(DistributionBillInventoryExcel.class).build(); if (Func.isNotEmpty(map.getBillOrderExcelList())){ build.write(map.getBillOrderExcelList(),orderList); } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionReservationController.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionReservationController.java index 2329a4284..cbca2c791 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionReservationController.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionReservationController.java @@ -113,9 +113,7 @@ public class DistributionReservationController extends BladeController { } IPage pages = reservationService.page(Condition.getPage(query),lambda ); pages.getRecords().forEach(i ->{ - log.info("查询用户》》》》》created_user:{}",i.getCreateUser()); R userR = userClient.userInfoById(i.getCreateUser()); - log.info("查询用户结果》》》》》data:{}",userR.getData().getName()); i.setOperator(userR.getData().getName()); }); diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistrilbutionBillLadingController.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistrilbutionBillLadingController.java index b6e3a32b9..2e67b2806 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistrilbutionBillLadingController.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistrilbutionBillLadingController.java @@ -362,9 +362,15 @@ public class DistrilbutionBillLadingController extends BladeController { return distrilbutionBillLadingService.batchSign(distrilbutionBillLading); } - - - + /** + * 查询自提单的包件ID列表 + */ + @GetMapping("/getBillLadingPackageIds") + @ApiOperationSupport(order = 7) + @ApiOperation(value = "查询自提单的包件ID列表", notes = "传入ids") + public R getBillLadingPackageIds( @RequestParam Long id,@RequestParam Long orderId) { + return distrilbutionBillLadingService.getBillLadingPackageIds(id,orderId); + } /** * 导出数据 diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryInfoMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryInfoMapper.xml index ab317cc83..1236af295 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryInfoMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryInfoMapper.xml @@ -573,10 +573,19 @@ AND ldrs.stock_article_status IN ( 1, 3 ) ) ordNub, COALESCE ( lds.received_quantity + lds.receivedin_quantity, 0 ) signNub, - ldsk.stockup_area stockupArea, (SELECT SUM(reservation_num) FROM logpm_distribution_reservation_stocklist WHERE reservation_id = ldr.id ) inventoryNub, IFNULL((SELECT SUM(loaded_nub) FROM logpm_distribution_loadscan WHERE reservation_id = lds.reservation_id AND is_abnormal_loading != 2 AND is_deleted = 0 ),0) + IFNULL((SELECT SUM(loaded_nub) FROM logpm_distribution_loadscaninvn WHERE reservation_id = lds.reservation_id AND scan_status != 1 AND is_deleted = 0 ),0) AS loadingNub, - IFNULL((SELECT SUM(stock_quantity) FROM logpm_distribution_stock WHERE reservation_id = lds.reservation_id AND is_deleted = 0 ),0) AS stockupNum + IFNULL((SELECT SUM(stock_quantity) FROM logpm_distribution_stock WHERE reservation_id = lds.reservation_id AND is_deleted = 0 ),0) AS stockupNum, + (SELECT + GROUP_CONCAT( DISTINCT lwga.qr_code ) stockupArea + FROM + logpm_distribution_signfor AS sign + LEFT JOIN logpm_distribution_stock AS lds ON lds.reservation_id = sign.reservation_id + LEFT JOIN logpm_warehouse_goods_allocation AS lwga ON lds.stockup_area_id = lwga.id + WHERE + sign.reservation_id = ldr.id + GROUP BY + sign.delivery_id) AS stockupArea FROM logpm_distribution_signfor lds LEFT JOIN logpm_distribution_reservation ldr ON ldr.id = lds.reservation_id diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml index d13af6896..ac52ceac1 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml @@ -1052,7 +1052,17 @@ (select lds.reservation_id from logpm_distribution_signfor lds where lds.delivery_id = lddl.id ) and ldr.reservation_status != '40' - ) consignee + ) consignee, + (SELECT + GROUP_CONCAT( DISTINCT lwga.qr_code ) stockupArea + FROM + logpm_distribution_signfor AS sign + LEFT JOIN logpm_distribution_stock AS lds ON lds.reservation_id = sign.reservation_id + LEFT JOIN logpm_warehouse_goods_allocation AS lwga ON lds.stockup_area_id = lwga.id + WHERE + sign.delivery_id = lddl.id + GROUP BY + sign.delivery_id) AS stockupArea FROM logpm_distribution_delivery_list lddl left join logpm_distribution_delivery_self ldds on lddl.id =ldds.delivery_id diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistrilbutionBillLadingService.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistrilbutionBillLadingService.java index adf36dd0c..e0c6eb3ff 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistrilbutionBillLadingService.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistrilbutionBillLadingService.java @@ -270,4 +270,11 @@ public interface IDistrilbutionBillLadingService extends BaseService>>>>>>>>>>>>>>>> distributionAppDeliveryListVOS 司机配送任务列表 {}", distributionAppDeliveryListVOS); //转换字典字段 for (DistributionAppDeliveryListVO distributionAppDeliveryListVO : distributionAppDeliveryListVOS) { - distributionAppDeliveryListVO.setScannedNumber(getCarLaodNum(distributionAppDeliveryListVO.getId())); // 调用下 查询装车件数的方法 //查询备货区 - if (StringUtils.isNotBlank(distributionAppDeliveryListVO.getReservationId())) { - List list = CommonUtil.stringNum(distributionAppDeliveryListVO.getReservationId()); - QueryWrapper queryWrapper = new QueryWrapper(); - - if (list.size() > 1) { - queryWrapper.in("reservation_id", list); - } else { - queryWrapper.eq("reservation_id", distributionAppDeliveryListVO.getReservationId()); - } - List list1 = distributionStockupInfoService.list(queryWrapper); - if (!list1.isEmpty()) { - DistributionStockupInfoEntity distributionStockupInfoEntity = list1.get(0); - DistributionStockupEntity distributionStockupEntity = distributionStockupMapper.selectById(distributionStockupInfoEntity.getStockupId()); - if (ObjectUtils.isNotNull(distributionStockupEntity)) { - distributionAppDeliveryListVO.setStockupArea(distributionStockupEntity.getStockupArea()); - } else { - distributionAppDeliveryListVO.setStockupArea("无数据"); - } - } else { - distributionAppDeliveryListVO.setStockupArea("无数据"); - } +// if (StringUtils.isNotBlank(distributionAppDeliveryListVO.getReservationId())) { +// List list = CommonUtil.stringNum(distributionAppDeliveryListVO.getReservationId()); +// QueryWrapper queryWrapper = new QueryWrapper(); +// +// if (list.size() > 1) { +// queryWrapper.in("reservation_id", list); +// } else { +// queryWrapper.eq("reservation_id", distributionAppDeliveryListVO.getReservationId()); +// } +// List list1 = distributionStockupInfoService.list(queryWrapper); +// if (!list1.isEmpty()) { +// DistributionStockupInfoEntity distributionStockupInfoEntity = list1.get(0); +// DistributionStockupEntity distributionStockupEntity = distributionStockupMapper.selectById(distributionStockupInfoEntity.getStockupId()); +// if (ObjectUtils.isNotNull(distributionStockupEntity)) { +// distributionAppDeliveryListVO.setStockupArea(distributionStockupEntity.getStockupArea()); +// } else { +// distributionAppDeliveryListVO.setStockupArea("无数据"); +// } +// } else { +// distributionAppDeliveryListVO.setStockupArea("无数据"); +// } +// } + if (StringUtils.isBlank(distributionAppDeliveryListVO.getStockupArea())){ + distributionAppDeliveryListVO.setStockupArea("无数据"); } //查询包件签收件数 Integer lad = distributionLoadscanMapper.selectCount(new QueryWrapper().lambda().eq(DistributionLoadscanEntity::getDeliveryId, distributionAppDeliveryListVO.getId()).eq(DistributionLoadscanEntity::getSignforState, 2)).intValue(); diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java index 1fc40a4e6..c975ac808 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java @@ -2701,6 +2701,23 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl ids = parcelListEntities.stream().map(DistributionParcelListEntity::getId).collect(Collectors.toList()); + List abnormalEntities = distributionLoadscanAbnormalService.list(Wrappers.query().lambda() + .in(DistributionLoadscanAbnormalEntity::getPackageId, ids) + ); + if (!abnormalEntities.isEmpty()) { + //判断此包件的异常是否是当前扫描车次和客户 + //首先判断存在异常是否不属于当前车次和客户 + boolean a = abnormalEntities.stream().allMatch(b -> !deliveryListEntity.getId().equals(b.getDeliveryListId()) || !distrilbutionloadingscanDTO.getReservationId().equals(b.getReservationId())); + if (a){ + //该异常属于其他车次 + String code = abnormalEntities.stream().filter(c -> !deliveryListEntity.getId().equals(c.getDeliveryListId()) || !distrilbutionloadingscanDTO.getReservationId().equals(c.getReservationId())).map(DistributionLoadscanAbnormalEntity::getPackageCode).collect(Collectors.joining(",")); + log.info("包件已在其他车次存在异常 >>>>包条码:{}",code); + log.info("包件已在其他车次存在异常 >>>>当前车次:{},异常车次:{}",deliveryListEntity.getTrainNumber(),abnormalEntities.stream().map(DistributionLoadscanAbnormalEntity::getTrainNumber).collect(Collectors.joining(","))); + return R.fail(code+"已在其他车次执行异常!!"); + } + //判断具体的装车信息 + } } List parcelListEntityList = distributionReservationMapper.selectPackageListByReservationId(distrilbutionloadingscanDTO.getReservationId()); //查询该客户是否存在该包件信息 diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java index 016e60c65..d4edfa1ff 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java @@ -2623,8 +2623,6 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl list = distrilbutionBillPackageService.list(Wrappers.query().lambda() + .eq(DistrilbutionBillPackageEntity::getBillLadingId, id) + .eq(DistrilbutionBillPackageEntity::getStockArticleId, orderId) + .ne(DistrilbutionBillPackageEntity::getPacketBarStatus, "2") + ); + if (list.isEmpty()) { + return null; + } + return R.data(list.stream().map(DistrilbutionBillPackageEntity::getParceListId).collect(Collectors.toList())); + } + /** * 转换老系统的ID * @@ -1702,6 +1715,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl list = distrilbutionBillPackageService.list(Wrappers.query().lambda() .eq(DistrilbutionBillPackageEntity::getBillLadingId, distrilbutionBillLading.getId()) .eq(DistrilbutionBillPackageEntity::getStockArticleId, k) + .ne(DistrilbutionBillPackageEntity::getPacketBarStatus, "2") ); //没有数据 if (list.isEmpty()) {