Browse Source

Merge remote-tracking branch 'origin/dev' into dev

dist.1.3.0
zhaoqiaobo 10 months ago
parent
commit
c83d8f5da6
  1. 10
      blade-biz-common/src/main/java/org/springblade/common/constant/RabbitConstant.java
  2. 1
      blade-biz-common/src/main/java/org/springblade/common/constant/WorkNodeEnums.java
  3. 2
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/InComingDTO.java
  4. 1
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionBillLadingAppController.java
  5. 82
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionSignforAppController.java
  6. 12
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionDeliveryListController.java
  7. 3
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryDetailsMapper.xml
  8. 5
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryInfoMapper.xml
  9. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.xml
  10. 1
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillStockMapper.xml
  11. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryInfoServiceImpl.java
  12. 86
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java
  13. 47
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java
  14. 40
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java
  15. 202
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillLadingServiceImpl.java
  16. 155
      blade-service/logpm-patch/src/main/java/com/logpm/patch/config/CustomMessageConverter.java
  17. 1
      blade-service/logpm-patch/src/main/java/com/logpm/patch/config/RabbitMqConfiguration.java
  18. 23
      blade-service/logpm-patch/src/main/java/com/logpm/patch/jobhandle/SyncOldTrayTypeData.java
  19. 38
      blade-service/logpm-patch/src/main/java/com/logpm/patch/jobhandle/SyncOrderInfoToPlatform.java
  20. 12
      blade-service/logpm-patch/src/main/java/com/logpm/patch/mapper/WarehouseMappingDataMapper.java
  21. 43
      blade-service/logpm-patch/src/main/java/com/logpm/patch/mapper/WarehouseMappingDataMapper.xml
  22. 13
      blade-service/logpm-patch/src/main/java/com/logpm/patch/service/IWarehouseMappingDataService.java
  23. 30
      blade-service/logpm-patch/src/main/java/com/logpm/patch/service/impl/WarehouseMappingDataServiceImpl.java
  24. 4
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineBillladingMapper.xml
  25. 5
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineBillladingWaybillMapper.xml
  26. 10
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/InComingServiceImpl.java
  27. 112
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineBillladingPackageServiceImpl.java
  28. 3
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/OldSystemPushController.java
  29. 4
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseUpdownTypeMapper.java
  30. 12
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseUpdownTypeMapper.xml
  31. 82
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/receiver/OldTrayTypeListener.java
  32. 4
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseUpdownTypeService.java
  33. 10
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTrayTypeServiceImpl.java
  34. 44
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseUpdownTypeServiceImpl.java

10
blade-biz-common/src/main/java/org/springblade/common/constant/RabbitConstant.java

@ -216,4 +216,14 @@ public interface RabbitConstant {
/****************商家入库完结 end *************************/
/****************老系统推送打托数据 start *************************/
String OLD_TRAY_TYPE_QUEUE = "old_tray_type_queue" + ModuleNameConstant.DEVAUTH;
String OLD_TRAY_TYPE_EXCHANGE = "old_tray_type_exchange" + ModuleNameConstant.DEVAUTH;
String OLD_TRAY_TYPE_ROUTING = "old_tray_type_routing" + ModuleNameConstant.DEVAUTH;
/****************老系统推送打托数据 start *************************/
}

1
blade-biz-common/src/main/java/org/springblade/common/constant/WorkNodeEnums.java

@ -44,6 +44,7 @@ public enum WorkNodeEnums implements Serializable {
PLAN_BILLOFLADING(263, "计划自提"),
CANCEL_BILLOFLADING(264, "取消自提"),
PLAN_DISTRIBUTION(265, "计划配车"),
CANCEL_DISTRIBUTION(266, "取消配车"),
DISTRIBUTION_LOADING(270, "配送装车"),
DISTRIBUTION_ABNORMAL_LOADING(271, "异常装车"),
DISTRIBUTION_CANCEL_LOADING(272, "取消装车"),

2
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/InComingDTO.java

@ -32,4 +32,6 @@ public class InComingDTO implements Serializable {
private String tenantId;
private String nickName;
private String customerTrain;
}

1
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionBillLadingAppController.java

@ -141,6 +141,7 @@ public class DistributionBillLadingAppController extends BladeController {
if("2".equals(type)){
BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse();
String coding = distrilbutionBillLading.get("coding").toString();
warehouseUpdownTypeClient.downPackageOrDelTray(coding, myCurrentWarehouse.getId(),"签收下架解托");
}else if("1".equals(type)){
//todo 这里需要增加对备货库存品的下架逻辑 但是备货是会进行下架的

82
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionSignforAppController.java

@ -75,7 +75,7 @@ public class DistributionSignforAppController {
@ApiOperationSupport(order = 5)
@ApiOperation(value = "列表", notes = "DistributionAppDeliveryListDTO")
public R<List<DistributionAppSignforVO>> custom(DistributionAppDeliveryListDTO distributionDeliveryList) {
List<DistributionAppSignforVO> pages = distributionSignforService.getAppDeliveryreservationListPage( distributionDeliveryList);
List<DistributionAppSignforVO> pages = distributionSignforService.getAppDeliveryreservationListPage(distributionDeliveryList);
return R.data(pages);
}
@ -87,7 +87,7 @@ public class DistributionSignforAppController {
@ApiOperationSupport(order = 5)
@ApiOperation(value = "列表", notes = "DistributionAppDeliveryListDTO")
public R<List<DistributionAppStockArticleVO>> order(DistributionAppDeliveryListDTO distributionDeliveryList) {
List<DistributionAppStockArticleVO> pages = distributionSignforService.getAppDeliveryorderListPage( distributionDeliveryList);
List<DistributionAppStockArticleVO> pages = distributionSignforService.getAppDeliveryorderListPage(distributionDeliveryList);
return R.data(pages);
}
@ -141,30 +141,30 @@ public class DistributionSignforAppController {
@PostMapping("/signfor")
@ApiOperationSupport(order = 2)
public R signfor(@Valid @RequestBody DistrilbutionAppsignforDTO distrilbutionloadingscanDTO) {
R r = distributionSignforService.signfor(distrilbutionloadingscanDTO);
R r = distributionSignforService.signfor(distrilbutionloadingscanDTO);
long time = new Date().getTime();
try{
try {
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(Objects.isNull(myCurrentWarehouse)){
log.warn("#############signfor:"+time+" 下架仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse);
if (Objects.isNull(myCurrentWarehouse)) {
log.warn("#############signfor:" + time + " 下架仓库信息为空 myCurrentWarehouse={}", myCurrentWarehouse);
throw new CustomerException("下架仓库信息为空");
}
List<String> packageCodes = (List<String>) r.getData();
log.info("#############signfor:"+time+" 处理下架的包件 packageCodes={}",packageCodes);
log.info("#############signfor:" + time + " 处理下架的包件 packageCodes={}", packageCodes);
String orderPackageCodes = null;
if(packageCodes!=null){
if (packageCodes != null) {
for (String packageCode : packageCodes) {
if(StringUtils.isBlank(orderPackageCodes)){
if (StringUtils.isBlank(orderPackageCodes)) {
orderPackageCodes = packageCode;
}else{
} else {
orderPackageCodes = orderPackageCodes + "," + packageCode;
}
}
updownTypeClient.downPackageOrDelTray(orderPackageCodes,myCurrentWarehouse.getId(),"签收下架解托");
updownTypeClient.downPackageOrDelTray(orderPackageCodes, myCurrentWarehouse.getId(), "签收下架解托");
}
}catch (Exception e){
log.error("#############signfor:"+time+" 下架失败",e);
} catch (Exception e) {
log.error("#############signfor:" + time + " 下架失败", e);
}
return r;
}
@ -175,7 +175,7 @@ public class DistributionSignforAppController {
@PostMapping("/zeroSignfor")
@ApiOperationSupport(order = 2)
public R zeroSignfor(@Valid @RequestBody DistrilbutionAppsignforDTO distrilbutionloadingscanDTO) {
R msg = distributionSignforService.zeroSignfor(distrilbutionloadingscanDTO);
R msg = distributionSignforService.zeroSignfor(distrilbutionloadingscanDTO);
return msg;
}
@ -185,7 +185,7 @@ public class DistributionSignforAppController {
@PostMapping("/signforIn")
@ApiOperationSupport(order = 2)
public R signforIn(@Valid @RequestBody DistrilbutionAppsignforDTO distrilbutionloadingscanDTO) {
R msg = distributionSignforService.signforIn(distrilbutionloadingscanDTO);
R msg = distributionSignforService.signforIn(distrilbutionloadingscanDTO);
return msg;
}
@ -211,23 +211,23 @@ public class DistributionSignforAppController {
}
/**
* 司机扫描签收管理 不在配送单签收
*/
@PostMapping("/signforcontinue")
@ApiOperationSupport(order = 2)
public R signforcontinue(@Valid @RequestBody DistrilbutionAppsignforDTO distrilbutionloadingscanDTO) {
R msg = distributionSignforService.signforcontinue(distrilbutionloadingscanDTO);
R msg = distributionSignforService.signforcontinue(distrilbutionloadingscanDTO);
return msg;
}
/**
* 司机签收管理 确认签收
*/
@PostMapping("/signforack")
@ApiOperationSupport(order = 2)
public R signforack(@Valid @RequestBody DistributionSignforDTO distributionSignfor) {
R msg = distributionSignforService.signforack(distributionSignfor);
R msg = distributionSignforService.signforack(distributionSignfor);
return msg;
}
@ -239,21 +239,23 @@ public class DistributionSignforAppController {
@ApiOperation(value = "司机一键签收", notes = "传入distributionSignfor")
public R oneclick(@Valid @RequestBody DistributionSignforDTO distributionSignfor) {
distributionSignfor.setIsClerk(false);
R r = distributionSignforService.oneclickPDA(distributionSignfor);
List<String> packageCodes = (List<String>)r.getData();
try{
R r = distributionSignforService.oneclickPDA(distributionSignfor);
List<String> packageCodes = (List<String>) r.getData();
try {
String orderPackageCodes = null;
for (String packageCode : packageCodes) {
if(StringUtils.isBlank(orderPackageCodes)){
orderPackageCodes = packageCode+"";
}else{
if (StringUtils.isBlank(orderPackageCodes)) {
orderPackageCodes = packageCode + "";
} else {
orderPackageCodes = orderPackageCodes + "," + packageCode;
}
}
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
updownTypeClient.downPackageOrDelTray(orderPackageCodes,myCurrentWarehouse.getId(),"司机一键签收下架解托");
}catch (Exception e){
log.error("##############oneclick: 更新包件下架状态失败 packageCodes={}",packageCodes);
if(orderPackageCodes!=null){
updownTypeClient.downPackageOrDelTray(orderPackageCodes, myCurrentWarehouse.getId(), "司机一键签收下架解托");
}
} catch (Exception e) {
log.error("##############oneclick: 更新包件下架状态失败 packageCodes={}", packageCodes);
}
return r;
}
@ -265,9 +267,10 @@ public class DistributionSignforAppController {
@ApiOperationSupport(order = 4)
@ApiOperation(value = "离线签收", notes = "传入Json串")
public R offline(@Valid @RequestBody DistributionSignforDTO distributionSignfor) {
R msg = distributionSignforService.offline(distributionSignfor.getOfflineJson());
R msg = distributionSignforService.offline(distributionSignfor.getOfflineJson());
return msg;
}
/**
* 签收管理 回显照片信息
*/
@ -275,19 +278,19 @@ public class DistributionSignforAppController {
@ApiOperationSupport(order = 4)
@ApiOperation(value = "回显照片", notes = "回显照片")
public R prices(@Valid @RequestBody DistributionSignforDTO distributionSignfor) {
if(ObjectUtil.isNotEmpty(distributionSignfor.getReservationId())){
if (ObjectUtil.isNotEmpty(distributionSignfor.getReservationId())) {
Map<String, List<DistributionSignPrintEntity>> one = distributionSignforService.prices(distributionSignfor);
DistributionSignforEntity one1 = distributionSignforService.getOne(Wrappers.<DistributionSignforEntity>query().lambda()
.eq(DistributionSignforEntity::getReservationId, distributionSignfor.getReservationId())
);
Map<String,Object> map = new HashMap<>();
map.put("deliverySignPictures",one); //司机签收图片
map.put("driverRemarks",one1.getDriverRemarks()); //driverRemarks
Map<String, Object> map = new HashMap<>();
map.put("deliverySignPictures", one); //司机签收图片
map.put("driverRemarks", one1.getDriverRemarks()); //driverRemarks
return R.data(map);
}else {
return R.fail(3002,"参数不能为空不对!!");
} else {
return R.fail(3002, "参数不能为空不对!!");
}
}
@ -298,23 +301,24 @@ public class DistributionSignforAppController {
@ApiOperationSupport(order = 4)
@ApiOperation(value = "修改签收照片信息", notes = "修改签收照片信息")
public R updatePicture(@Valid @RequestBody DistributionSignforDTO distributionSignfor) {
if(ObjectUtil.isNotEmpty(distributionSignfor.getReservationId())){
if (ObjectUtil.isNotEmpty(distributionSignfor.getReservationId())) {
return R.data(distributionSignforService.updatePicture(distributionSignfor));
}else {
return R.fail(3002,"参数不能为空不对!!");
} else {
return R.fail(3002, "参数不能为空不对!!");
}
}
/**
* 查询签收包件列表
*
* @param reservationId
* @return
*/
@GetMapping("/signingPackageDetail")
@ApiOperationSupport(order = 4)
@ApiOperation(value = "查询签收包件列表" )
@ApiOperation(value = "查询签收包件列表")
public R signingPackageDetail(@RequestParam Long reservationId) {
return distributionSignforService.signingPackageDetail(reservationId);
return distributionSignforService.signingPackageDetail(reservationId);
}
}

12
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionDeliveryListController.java

@ -164,7 +164,6 @@ public class DistributionDeliveryListController extends BladeController {
@ApiOperation(value = "查看包件详情", notes = "传入distributionDeliveryList")
public R<IPage<DistributionParcelListVO>> packdetail(@RequestParam Map<String,Object> distributionDeliveryInfoDTO, Query query) throws ParseException {
IPage<DistributionParcelListVO> parcelListEntityList = distributionDeliveryListService.getPackageListByDeliverylistId(Condition.getPage(query), distributionDeliveryInfoDTO);
// IPage<DistributionDeliveryInfoVO> pages = distributionDeliveryInfoService.selectDistributionDeliveryInfopackdetail(Condition.getPage(query), distributionDeliveryInfoDTO);
return R.data(parcelListEntityList);
}
@ -234,17 +233,6 @@ public class DistributionDeliveryListController extends BladeController {
}
// /**
// * 配送管理 装车扫描(单件装车)
// */
// @GetMapping("/singleloading")
// @ApiOperationSupport(order = 2)
// public R singleloading(@Valid @RequestBody DistrilbutionloadingscanDTO distrilbutionloadingscanDTO) {
// R msg = distributionDeliveryListService.singleloading(distrilbutionloadingscanDTO);
// return msg;
// }
/**
* 配送管理 点击发车
*/

3
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryDetailsMapper.xml

@ -95,9 +95,8 @@
ldsl.tray_name trayName, lds.allocation_title allocation,
lddd.reality_quantity preparedQuantity,
lddd.stock_status,
(SELECT count(id) FROM logpm_distribution_bill_lading_scan ldbls WHERE ldbls.stock_list_id = lddd.stock_list_id and ldbls.material_type = 1) AS pick_up_quantity,
(SELECT count(id) FROM logpm_distribution_bill_lading_scan ldbls WHERE ldbls.bill_lading_id = lddd.bill_lading_id AND ldbls.stock_list_id = lddd.stock_list_id and ldbls.material_type = 1 and ldbls.scan_type=1 ) AS pickUpQuantity,
CASE
WHEN ( SELECT count( id ) FROM logpm_distribution_bill_lading_scan ldbls WHERE ldbls.stock_list_id = lddd.stock_list_id AND ldbls.material_type = 1 ) = 0 THEN
'待提货'
WHEN lddd.quantity - ( SELECT count( id ) FROM logpm_distribution_bill_lading_scan ldbls WHERE ldbls.stock_list_id = lddd.stock_list_id AND ldbls.material_type = 1 ) > 0 THEN

5
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryInfoMapper.xml

@ -121,6 +121,8 @@
FROM
logpm_distribution_stockup_info AS ldsi
LEFT JOIN logpm_distribution_stockup AS ldss ON ldsi.stockup_id = ldss.id
WHERE
ldsi.stock_status != 4
) AS t ON t.reservation_id = lds.reservation_id
<where>
lds.is_deleted = 0 and lds.delivery_id = #{id} and ldr.reservation_status != 40 AND (ldr.reservation_num + ldr.reservation_stock_list_num) > 0
@ -796,7 +798,8 @@ FROM
logpm_distribution_stockup_info AS ldsi
LEFT JOIN logpm_distribution_stockup AS ldss ON ldsi.stockup_id = ldss.id
WHERE
ldsi.reservation_id = lds.reservation_id
ldsi.reservation_id = lds.reservation_id and
AND ldsi.stock_status != '4'
) AS forkliftName,
CASE
WHEN ldr.stockup_status ='10' THEN '待指派'

4
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.xml

@ -365,7 +365,7 @@
ldsa.total_number totalNum,
count(ldpl.id) num
FROM logpm_distribution_stock_article ldsa
left join logpm_distribution_parcel_list ldpl on ldpl.order_code = ldsa.order_code
left join logpm_distribution_parcel_list ldpl on ldpl.stock_article_id = ldsa.id
left join logpm_warehouse_tray_goods lwtg
on ldpl.order_package_code = lwtg.association_value and lwtg.association_type = 3
left join logpm_warehouse_updown_goods lwug
@ -388,7 +388,7 @@
ldsa.total_number totalNum,
count(ldpl.id) num
FROM logpm_distribution_stock_article ldsa
left join logpm_distribution_parcel_list ldpl on ldpl.order_code = ldsa.order_code
left join logpm_distribution_parcel_list ldpl on ldpl.stock_article_id = ldsa.id
left join logpm_warehouse_tray_goods lwtg
on ldpl.order_package_code = lwtg.association_value and lwtg.association_type = 3
left join logpm_warehouse_updown_goods lwug

1
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillStockMapper.xml

@ -156,7 +156,6 @@
logpm_distrilbution_bill_lading AS ldbl
LEFT JOIN logpm_distrilbution_bill_stock ldbs ON ldbs.bill_lading_id = ldbl.id
LEFT JOIN logpm_distribution_stock_article ldsa on ldbs.stock_article_id = ldsa.id
<!-- LEFT JOIN logpm_distribution_stock lds on lds.stock_article = ldbs.stock_article_id-->
LEFT JOIN logpm_distribution_bill_lading_scan AS ldbls ON ldbl.id = ldbls.bill_lading_id
<where>
ldbs.is_deleted = 0 and ldbs.bill_lading_id = #{param.billLadingId} and ldbs.order_status in (1,3)

2
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryInfoServiceImpl.java

@ -554,7 +554,7 @@ public class DistributionDeliveryInfoServiceImpl extends BaseServiceImpl<Distrib
public List<DisStockListDetailVO> selectDistributionAppDeliveryInventory(DistributionAppDeliveryListDTO distributionAppDeliveryListDTO) {
List<DisStockListDetailEntity> inventoryList = distributionReservationMapper.selectInventoryListByReservation(Long.parseLong(distributionAppDeliveryListDTO.getReservationId()));
if (Func.isEmpty(inventoryList)) {
log.error("##########查询该客户库存品信息为null");
log.warn("##########查询该客户库存品信息为null");
return null;
}
List<Long> stockListIds = inventoryList.stream().map(DisStockListDetailEntity::getStockListId).distinct().collect(Collectors.toList());

86
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java

@ -322,13 +322,6 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
//转移数据到VO上
DistributionDeliveryListVO distributionDeliveryListVO = DistributionDeliveryListWrapper.build().entityVO(detail);
//查询包条数据
// List<DistributionDeliveryInfoVO> stripList = distributionDeliveryInfoMapper.selectStripList(detail.getId());
//distributionDeliveryListVO.setPackadeList(stripList);
//装车件数
//Integer sum = distributionSignforMapper.selectloadNub(distributionDeliveryListVO.getId());
// distributionDeliveryListVO.setLoadNub(sum);
// if (detail.getSource() == 1) {
//查询客户信息
List<DistributionDeliveryInfoVO> customList = distributionDeliveryInfoMapper.selectcustomList(detail.getId());
if (!customList.isEmpty()) {
@ -2815,16 +2808,8 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
if (Func.isEmpty(myCurrentWarehouse)) {
return R.fail("无仓库信息!!!");
}
// if (Func.isEmpty(deliveryListDTO.getIsDeliveryDriverUpdate())){
// return R.fail("服务器正忙!!!");
// }
//首先对配送任务进行修改
//查询出配送任务的基本信息
DistributionDeliveryListEntity deliveryListEntity = this.getById(deliveryListDTO.getId());
Long deliveryListEntityId = deliveryListEntity.getId();
// if (deliveryListEntity.getDeliveryStatus().equals(DeliveryStatusConstant.peisongzhong.getValue())) {
// return R.fail("正在配送中...");
// }
if (deliveryListEntity.getDeliveryStatus().equals(DeliveryStatusConstant.yiwancheng.getValue())) {
return R.fail("配送已完成...");
}
@ -2841,7 +2826,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
return R.fail("任务已装车联系司机滞留货物后进行司机切换...");
}
}
List<JSONObject> logs = new ArrayList<>();
//查询出原来配送信息的备货任务
DistributionStockupVO deliveryStockupInfo = distributionStockupMapper.getDeliveryStockupInfo(deliveryListEntity.getId());
//这里查询出该备货任务的执行情况,如果该任务处于已完成的状态需要创建新的备货任务,其他的备货状态则是进行备货任务的修改
@ -2862,13 +2847,6 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
deliveryStockupInfo.setStockupArea(stockupInfo.getGoodsAreaName());
}
// ---------------------------2023-09-06 取消班组职能字段维护------------------------------------
// if (Func.isNotEmpty(stockupInfo.getLoaderId())) {
// deliveryStockupInfo.setLoaderId(stockupInfo.getLoaderId());
// deliveryStockupInfo.setLoaderName(stockupInfo.getLoaderName());
// }
// if (Func.isNotEmpty(stockupInfo.getLoadAndUnload())) {
// deliveryStockupInfo.setTeamResponsibility(stockupInfo.getLoadAndUnload());
// }
if (Func.isNotEmpty(stockupInfo.getStockupDate())) {
deliveryStockupInfo.setStockupDate(stockupInfo.getStockupDate());
}
@ -2928,7 +2906,6 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
clientTotal.getAndIncrement();
if (Func.isEmpty(oldClient.get(k))) {
DistributionReservationEntity reservationEntity = new DistributionReservationEntity();
// reservationEntity.setWaybillNo(k);
reservationEntity.setReservationDate(reservationDate);
reservationEntity.setReservationStatus(ReservationStatusConstant.daipeisong.getValue());
reservationEntity.setDeliveryType(DistributionTypeConstant.shangpei.getValue());
@ -2987,9 +2964,6 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
if (Func.isNotEmpty(s.getOrderCode())) {
orderNumber.add(s.getOrderCode());
}
// if (Func.isNotEmpty(s.getWaybillNumber())){
// waybillNo.add(s.getWaybillNumber());
// }
if (Func.isNotEmpty(s.getWarehouse())) {
warehouseName.add(s.getWarehouse());
}
@ -3043,18 +3017,16 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
//此时订单下的所有包件都处于预约状态,可用数为0
orderPackageNum.getAndAdd(dp.getQuantity());
//修改订单下的包件状态
// p.setOrderPackageReservationStatus();
dp.setOrderPackageReservationStatus(OrderPackageReservationStatusConstant.yiyueyue.getValue());
distributionParcelListService.updateById(dp);
distributionAsyncService.checkStockArticleReservationStatus(dp);
packageLockIds.add(dp.getId());
String content = "包件在"+myCurrentWarehouse.getName()+"由"+AuthUtil.getUser().getNickName()+"商配计划配车,操作方式:新增订单勾选包件,预约任务号:"+reservationEntity.getReservationCode();
JSONObject js = handleLogJSONObject(myCurrentWarehouse, AuthUtil.getUser(), dp.getOrderPackageCode(),content , WorkNodeEnums.PLAN_DISTRIBUTION.getCode());
logs.add(js);
}
}
// stockArticleEntity.setReservationStatus(OrderReservationStatusConstant.yiyueyue.getValue());
});
// s.setReservationStatus(OrderReservationStatusConstant.yiyueyue.getValue());
// s.setAvailableQuantity(0);
// distributionStockArticleService.updateById(s);
} else {
packageListInfo.forEach(p -> {
orderPackageNum.getAndAdd(p.getQuantity());
@ -3069,7 +3041,9 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
distributionParcelListService.updateById(p);
packageLockIds.add(p.getId());
//这里根据包件进行订单状态的改变
// distributionAsyncService.checkStockArticleReservationStatus(p);
String content = "包件在"+myCurrentWarehouse.getName()+"由"+AuthUtil.getUser().getNickName()+"商配计划配车,操作方式:新增订单系统默认可用包件,预约任务号:"+reservationEntity.getReservationCode();
JSONObject js = handleLogJSONObject(myCurrentWarehouse, AuthUtil.getUser(), p.getOrderPackageCode(),content , WorkNodeEnums.PLAN_DISTRIBUTION.getCode());
logs.add(js);
});
}
//维护订单信息
@ -3158,8 +3132,6 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
reservationEntity.setDeliveryPhone(String.join(",", consigneeMobile));
reservationEntity.setDeliveryAddress(String.join(",", consigneeAddress));
reservationEntity.setReceivingUnit(String.join(",", consignee));
// reservationEntity.setWaybillId(String.join(",", waybillId));
// reservationEntity.setReservationDate(date);
// -----------------------预约信息完善----------------------------
reservationEntity.setDeliveryType(DistributionTypeConstant.shangpei.getValue());
reservationEntity.setStockupStatus(ReservationStockupStatusConstant.daibeihuo.getValue());
@ -3193,7 +3165,6 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
//根据配送计划和运单号查询出该预约
// DistributionReservationEntity reservationEntity = baseMapper.selectReservationByDeliveryListIdAndCustomer(deliveryListEntityId, k);
DistributionReservationEntity reservationEntity = baseMapper.selectReservationByDeliveryListIdAndCustomerUnit(deliveryListEntityId, k);
DistributionSignforEntity signforEntity = distributionSignforService.getOne(Wrappers.<DistributionSignforEntity>query().lambda()
.eq(DistributionSignforEntity::getReservationId, reservationEntity.getId())
@ -3217,9 +3188,6 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
if (Func.isNotEmpty(s.getOrderCode())) {
orderNumber.add(s.getOrderCode());
}
// if (Func.isNotEmpty(s.getWaybillNumber())){
// waybillNo.add(s.getWaybillNumber());
// }
if (Func.isNotEmpty(s.getWarehouse())) {
warehouseName.add(s.getWarehouse());
}
@ -3269,7 +3237,9 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
distributionParcelListService.updateById(p);
packageLockIds.add(p.getId());
//这里根据包件进行订单状态的改变
// distributionAsyncService.checkStockArticleReservationStatus(p);
String content = "包件在"+myCurrentWarehouse.getName()+"由"+AuthUtil.getUser().getNickName()+"商配计划配车,操作方式:操作已选订单包件,预约任务号:"+reservationEntity.getReservationCode();
JSONObject js = handleLogJSONObject(myCurrentWarehouse, AuthUtil.getUser(), p.getOrderPackageCode(),content , WorkNodeEnums.PLAN_DISTRIBUTION.getCode());
logs.add(js);
});
} else {
//查询该订单下的所有包件信息并插入该计划中
@ -3294,19 +3264,17 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
//此时订单下的所有包件都处于预约状态,可用数为0
orderPackageNum.getAndAdd(dp.getQuantity());
//修改订单下的包件状态
// p.setOrderPackageReservationStatus();
dp.setOrderPackageReservationStatus(OrderPackageReservationStatusConstant.yiyueyue.getValue());
distributionParcelListService.updateById(dp);
distributionAsyncService.checkStockArticleReservationStatus(dp);
packageLockIds.add(dp.getId());
String content = "包件在"+myCurrentWarehouse.getName()+"由"+AuthUtil.getUser().getNickName()+"商配计划配车,操作方式:操作已选订单包件,预约任务号:"+reservationEntity.getReservationCode();
JSONObject js = handleLogJSONObject(myCurrentWarehouse, AuthUtil.getUser(), dp.getOrderPackageCode(),content , WorkNodeEnums.PLAN_DISTRIBUTION.getCode());
logs.add(js);
}
}
// stockArticleEntity.setReservationStatus(OrderReservationStatusConstant.yiyueyue.getValue());
});
// s.setReservationStatus(OrderReservationStatusConstant.yiyueyue.getValue());
// s.setAvailableQuantity(0);
// distributionStockArticleService.updateById(s);
}
distributionStockArticleService.maintenanceOrderInfo(s.getOrderCode(), myCurrentWarehouse.getId());
} else {
@ -3381,10 +3349,6 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
.eq(DistributionReservationPackageEntity::getReservationId, reservationEntity.getId())
.eq(DistributionReservationPackageEntity::getStockArticleId, s.getId())
.ne(DistributionReservationPackageEntity::getPacketBarStatus, "2"));
// List<DistributionReservationPackageEntity> distributionReservationPackageEntities = distributionReservationPackageMapper.selectList(new QueryWrapper<DistributionReservationPackageEntity>().lambda()
// .eq(DistributionReservationPackageEntity::getReservationId, reservationEntity.getId())
// .eq(DistributionReservationPackageEntity::getStockArticleId, s.getId())
// );
if (Func.isEmpty(list)) {
log.error("###########################预约包件查询错误:{}", list);
log.error("###########################查询错误预约Id:{}", reservationEntity.getId());
@ -3513,13 +3477,10 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
}
}
}
//查询出这个订单下的包件信息
// List<DistributionReservationPackageEntity> oldPackageList = distributionReservationMapper.selectPackageByReservationAndStockArticle(reservationEntity.getId(), reservationStockarticleEntities.get(0).getStockArticleId());
//进行预约订单中间信息的修改
reservationStockarticleEntity.setReservationNum(packageNum.get());
distributionReservationStockarticleService.updateById(reservationStockarticleEntity);
// oldOrder.remove(s.getId());
//预约订单上的包件数量维护
packageTotal.getAndAdd(reservationStockarticleEntity.getReservationNum());
}
@ -3622,8 +3583,6 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
});
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleService.getById(e.getStockArticleId());
distributionStockArticleService.maintenanceOrderInfo(stockArticleEntity.getOrderCode(), myCurrentWarehouse.getId());
// stockArticleEntity.setReservationStatus(distributionReservationPackageService.judgmentStatus(Func.copy(stockArticleEntity, DistributionStockArticleDTO.class)));
// distributionStockArticleService.updateById(stockArticleEntity);
//修改预约状态和包件状态
} else if (e.getIsZero().equals(IsOrNoConstant.yes.getValue())) {
//零担
@ -4019,6 +3978,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
//客户数量
AtomicInteger clientTotal = new AtomicInteger();
List<Long> newIds = new ArrayList<>();
List<Long> oldIds = new ArrayList<>();
newReservation.forEach((k, v) -> {
clientTotal.getAndIncrement();
//统计配送包件总数量
@ -4051,6 +4011,9 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
.in(DistributionReservationEntity::getId,newIds)
.set(DistributionReservationEntity::getReservationStatus,ReservationStatusConstant.daipeisong.getValue())
);
String content = "包件在"+myCurrentWarehouse.getName()+"由"+ AuthUtil.getUser().getNickName()+"转车次任务,操作方式:车次添加预约计划,车次号:"+deliveryListEntity.getTrainNumber();
String ids = oldIds.stream().map(String::valueOf).collect(Collectors.joining(","));
distributionAsyncService.recordsReservationDeliveryLog(ids,myCurrentWarehouse,AuthUtil.getUser(),deliveryListEntity.getTrainNumber(),WorkNodeEnums.PLAN_DISTRIBUTION.getCode(),content);
}
oldReservation.forEach((m, n) -> {
@ -4068,7 +4031,14 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
.eq(DistributionStockupInfoEntity::getReservationId,reservationEntity.getId())
.set(DistributionStockupInfoEntity::getStockStatus,"4")
);
oldIds.add(reservationEntity.getId());
});
if (!oldIds.isEmpty()) {
String content = "包件在"+myCurrentWarehouse.getName()+"由"+ AuthUtil.getUser().getNickName()+"取消配车计划,操作方式:车次移除预约计划,车次号:"+deliveryListEntity.getTrainNumber();
String ids = oldIds.stream().map(String::valueOf).collect(Collectors.joining(","));
distributionAsyncService.recordsReservationDeliveryLog(ids,myCurrentWarehouse,AuthUtil.getUser(),deliveryListEntity.getTrainNumber(),WorkNodeEnums.CANCEL_DISTRIBUTION.getCode(),content);
}
//修改备货信息
String kind = deliveryListEntity.getKind();
switch (kind) {
@ -4151,14 +4121,6 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
}
deliveryListEntity.setDeliveryNumber(packageTotal.get());
deliveryListEntity.setInventoryNub(inventoryTotal.get());
// if (Func.isNotEmpty(stockupInfo.getUnloaderName()) && Func.isNotEmpty(stockupInfo.getUnloaderId())) {
// deliveryListEntity.setUnloadingTeamId(stockupInfo.getUnloaderId());
// deliveryListEntity.setUnloadingTeamName(stockupInfo.getUnloaderName());
// }
// if (Func.isNotEmpty(stockupInfo.getLoaderId()) && Func.isNotEmpty(stockupInfo.getLoaderName())) {
// deliveryListEntity.setUnloadingTeamId(stockupInfo.getLoaderId());
// deliveryListEntity.setUnloadingTeamName(stockupInfo.getLoaderName());
// }
deliveryListEntity.setCustomersNumber(clientTotal.get());
//对配送进行更改
this.updateById(deliveryListEntity);

47
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java

@ -2020,10 +2020,8 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
stockupEntity.setStockupUser(user.getUserName());
stockupEntity.setStockupUserId(user.getUserId());
stockupEntity.setWarehouseId(myCurrentWarehouse.getId());
// stockupEntity.setLoaderId(stockup.getLoaderId());
stockupEntity.setStockupArea(stockup.getGoodsAreaName());
stockupEntity.setOutboundDate(stockup.getOutboundDate());
// stockupEntity.setTeamResponsibility(stockup.getLoadAndUnload());
stockupEntity.setStockupDate(stockup.getStockupDate());
//编码生成规则 BH+仓库编码+年月日+序号00001
stockupEntity.setStockupCode(bianMa());
@ -2161,27 +2159,9 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
distributionParcelListService.updateById(p);
packageLockIds.add(p.getId());
//这里根据包件进行订单状态的改变
// distributionAsyncService.checkStockArticleReservationStatus(p);
String content = "包件在"+myCurrentWarehouse.getName()+"由"+ AuthUtil.getUser().getNickName()+"计划商配配送,操作方式:订单选择包件,预约任务号:"+reservation.getReservationCode()+",车次号:"+distributionDeliveryListEntity.getTrainNumber();
JSONObject trunklinePackageTrackLog= new JSONObject();
trunklinePackageTrackLog.put("tenantId",p.getTenantId());
trunklinePackageTrackLog.put("createTime",new Date());
trunklinePackageTrackLog.put("createUser",user.getUserId());
trunklinePackageTrackLog.put("updateUser",user.getUserId());
trunklinePackageTrackLog.put("updateTime",new Date());
trunklinePackageTrackLog.put("isDeleted",0);
trunklinePackageTrackLog.put("status",1);
trunklinePackageTrackLog.put("createDept",reservationPackageEntity.getCreateDept());
trunklinePackageTrackLog.put("orderPackageCode",reservationPackageEntity.getPacketBarCode());
trunklinePackageTrackLog.put("warehouseId",myCurrentWarehouse.getId());
trunklinePackageTrackLog.put("warehouseName",myCurrentWarehouse.getName());
trunklinePackageTrackLog.put("workNode",WorkNodeEnums.PLAN_DISTRIBUTION.getCode());
trunklinePackageTrackLog.put("content",content);
trunklinePackageTrackLog.put("operator",AuthUtil.getUser().getNickName());
aaa.add(trunklinePackageTrackLog);
String content = "包件在"+myCurrentWarehouse.getName()+"由"+ AuthUtil.getUser().getNickName()+"计划商配配车,操作方式:订单选择包件,车次号:"+distributionDeliveryListEntity.getTrainNumber()+",预约任务号:"+reservationEntity.getReservationCode();
JSONObject js = handleLogJSONObject(myCurrentWarehouse, AuthUtil.getUser(), p.getOrderPackageCode(), content, WorkNodeEnums.PLAN_DELIVERY.getCode());
aaa.add(js);
});
} else {
//没有进行包件选择 默认添加可配送的所有包件
@ -2209,28 +2189,13 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
//此时订单下的所有包件都处于预约状态,可用数为0
reservationOrderNum.getAndAdd(dp.getQuantity());
//修改订单下的包件状态
// p.setOrderPackageReservationStatus();
dp.setOrderPackageReservationStatus(OrderPackageReservationStatusConstant.yiyueyue.getValue());
distributionParcelListService.updateById(dp);
distributionAsyncService.checkStockArticleReservationStatus(dp);
packageLockIds.add(dp.getId());
String content = "包件在"+myCurrentWarehouse.getName()+"由"+ AuthUtil.getUser().getNickName()+"计划商配配送,操作方式:系统默认选择可用包件,预约任务号:"+reservation.getReservationCode()+",车次号:"+distributionDeliveryListEntity.getTrainNumber();
JSONObject trunklinePackageTrackLog= new JSONObject();
trunklinePackageTrackLog.put("tenantId",dp.getTenantId());
trunklinePackageTrackLog.put("createTime",new Date());
trunklinePackageTrackLog.put("createUser",user.getUserId());
trunklinePackageTrackLog.put("updateUser",user.getUserId());
trunklinePackageTrackLog.put("updateTime",new Date());
trunklinePackageTrackLog.put("isDeleted",0);
trunklinePackageTrackLog.put("status",1);
trunklinePackageTrackLog.put("createDept",distributionReservationPackageEntity.getCreateDept());
trunklinePackageTrackLog.put("orderPackageCode",distributionReservationPackageEntity.getPacketBarCode());
trunklinePackageTrackLog.put("warehouseId",myCurrentWarehouse.getId());
trunklinePackageTrackLog.put("warehouseName",myCurrentWarehouse.getName());
trunklinePackageTrackLog.put("workNode",WorkNodeEnums.PLAN_DISTRIBUTION.getCode());
trunklinePackageTrackLog.put("content",content);
trunklinePackageTrackLog.put("operator",AuthUtil.getUser().getNickName());
aaa.add(trunklinePackageTrackLog);
String content = "包件在"+myCurrentWarehouse.getName()+"由"+ AuthUtil.getUser().getNickName()+"计划商配配车,操作方式:系统默认选择可用包件,车次号:"+distributionDeliveryListEntity.getTrainNumber()+",预约任务号:"+reservationEntity.getReservationCode();
JSONObject js = handleLogJSONObject(myCurrentWarehouse, AuthUtil.getUser(), dp.getOrderPackageCode(), content, WorkNodeEnums.PLAN_DELIVERY.getCode());
aaa.add(js);
}
}

40
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java

@ -2568,7 +2568,6 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
warehouseUpdownTypeClient.downPackageOrDelTray(collect.get(0).getOrderPackageCode(), myCurrentWarehouse.getId(), "签收下架解托");
packageLockIds.add(distributionLoadscanEntity.getPackageId());
log.info("content 参数:>>>>>>>>>>Warehouse:{},ScanUser:{},TrainNumber:{},ReservationCode:{}",myCurrentWarehouse.getName(),distributionLoadscanEntity.getSigningUser(),deliveryListEntity.getTrainNumber(),distributionReservationEntity.getReservationCode());
String content = "包件在"+myCurrentWarehouse.getName()+"由"+distributionLoadscanEntity.getSigningUser()+"扫描签收,装车方式:补录装车,配送车次号:"+deliveryListEntity.getTrainNumber()+"预约任务号:"+distributionReservationEntity.getReservationCode();
JSONObject trunklinePackageTrackLog= handleLogJSONObject(myCurrentWarehouse,AuthUtil.getUser(),parcelListEntity.getOrderPackageCode(),content,WorkNodeEnums.DISTRIBUTION_SIGN_FOR.getCode());
aaa.add(trunklinePackageTrackLog);
@ -2784,20 +2783,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
warehouseUpdownTypeClient.downPackageOrDelTray(loadscanEntity.getOrderPackageCode(), myCurrentWarehouse.getId(), "签收下架解托");
content = "包件在"+myCurrentWarehouse.getName()+"由"+AuthUtil.getNickName()+"后台签收,装车方式:扫描装车,配送车次号:"+deliveryListEntity.getTrainNumber()+"预约任务号:"+distributionReservationEntity.getReservationCode();
try {
trunklinePackageTrackLog.put("tenantId",loadscanEntity.getTenantId());
trunklinePackageTrackLog.put("createTime",loadscanEntity.getCreateTime());
trunklinePackageTrackLog.put("createUser",loadscanEntity.getCreateUser());
trunklinePackageTrackLog.put("updateUser",loadscanEntity.getUpdateUser());
trunklinePackageTrackLog.put("updateTime",loadscanEntity.getUpdateTime());
trunklinePackageTrackLog.put("isDeleted",loadscanEntity.getIsDeleted());
trunklinePackageTrackLog.put("status",loadscanEntity.getStatus());
trunklinePackageTrackLog.put("createDept",loadscanEntity.getCreateDept());
trunklinePackageTrackLog.put("orderPackageCode",loadscanEntity.getOrderPackageCode());
trunklinePackageTrackLog.put("warehouseId",myCurrentWarehouse.getId());
trunklinePackageTrackLog.put("warehouseName",myCurrentWarehouse.getName());
trunklinePackageTrackLog.put("workNode",WorkNodeEnums.DISTRIBUTION_LOADING.getCode());
trunklinePackageTrackLog.put("content",content);
trunklinePackageTrackLog.put("operator",AuthUtil.getNickName());
trunklinePackageTrackLog =handleLogJSONObject(myCurrentWarehouse,AuthUtil.getUser(),loadscanEntity.getOrderPackageCode(),content,WorkNodeEnums.DISTRIBUTION_SIGN_FOR.getCode());
}catch (Exception e){
log.error("装车日志数据错误",e);
}
@ -2881,20 +2867,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
// 包件解托下架
content = "包件在"+myCurrentWarehouse.getName()+"由"+AuthUtil.getNickName()+"后台签收,装车方式:补录装车,配送车次号:"+deliveryListEntity.getTrainNumber()+"预约任务号:"+distributionReservationEntity.getReservationCode();
try {
trunklinePackageTrackLog.put("tenantId",loadscanEntity.getTenantId());
trunklinePackageTrackLog.put("createTime",loadscanEntity.getCreateTime());
trunklinePackageTrackLog.put("createUser",loadscanEntity.getCreateUser());
trunklinePackageTrackLog.put("updateUser",loadscanEntity.getUpdateUser());
trunklinePackageTrackLog.put("updateTime",loadscanEntity.getUpdateTime());
trunklinePackageTrackLog.put("isDeleted",loadscanEntity.getIsDeleted());
trunklinePackageTrackLog.put("status",loadscanEntity.getStatus());
trunklinePackageTrackLog.put("createDept",loadscanEntity.getCreateDept());
trunklinePackageTrackLog.put("orderPackageCode",loadscanEntity.getOrderPackageCode());
trunklinePackageTrackLog.put("warehouseId",myCurrentWarehouse.getId());
trunklinePackageTrackLog.put("warehouseName",myCurrentWarehouse.getName());
trunklinePackageTrackLog.put("workNode",WorkNodeEnums.DISTRIBUTION_LOADING.getCode());
trunklinePackageTrackLog.put("content",content);
trunklinePackageTrackLog.put("operator",AuthUtil.getNickName());
trunklinePackageTrackLog =handleLogJSONObject(myCurrentWarehouse,AuthUtil.getUser(),loadscanEntity.getOrderPackageCode(),content,WorkNodeEnums.DISTRIBUTION_SIGN_FOR.getCode());
}catch (Exception e){
log.error("装车日志数据错误",e);
}
@ -3076,7 +3049,6 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
return R.fail(403, "配送错误!!!");
}
List<Long> packageLockIds = new ArrayList<>();
List<String> orderPackageCodes = new ArrayList<>();
List<JSONObject> aaa = new ArrayList<>();
if (Func.isNotEmpty(parcelListEntityList) && parcelListEntityList.size() == 1) {
DistributionParcelListEntity parcelListEntity = parcelListEntityList.get(0);
@ -3109,8 +3081,6 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
//查询装车扫描表
List<DistributionLoadscanEntity> loadscanEntityList = distributionLoadscanService.list(Wrappers.<DistributionLoadscanEntity>query().lambda()
// .eq(DistributionLoadscanEntity::getDeliveryId, distrilbutionloadingscanDTO.getDeliveryId())
// .eq(DistributionLoadscanEntity::getReservationId, distrilbutionloadingscanDTO.getReservationId())
.eq(DistributionLoadscanEntity::getOrderPackageCode, distrilbutionloadingscanDTO.getBarcode())
.ne(DistributionLoadscanEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue()));
@ -3221,7 +3191,6 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
JSONObject trunklinePackageTrackLog= handleLogJSONObject(myCurrentWarehouse,AuthUtil.getUser(),parcelListEntity.getOrderPackageCode(),content,WorkNodeEnums.DISTRIBUTION_ABNORMAL_SIGN_FOR.getCode());
aaa.add(trunklinePackageTrackLog);
assert loadscanEntity != null;
orderPackageCodes.add(distributionLoadscanEntity.getOrderPackageCode());
} else {
return Resp.scanFail("操作失败", "不属于该客户");
@ -3294,7 +3263,6 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
packageLockIds.add(distributionLoadscanEntity.getPackageId());
JSONObject trunklinePackageTrackLog= handleLogJSONObject(myCurrentWarehouse,AuthUtil.getUser(),parcelListEntity.getOrderPackageCode(),content,WorkNodeEnums.DISTRIBUTION_ABNORMAL_SIGN_FOR.getCode());
aaa.add(trunklinePackageTrackLog);
orderPackageCodes.add(loadscanEntity.getOrderPackageCode());
} else {
return Resp.scanFail("操作失败", "不属于该客户");
@ -5110,7 +5078,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
jsonObject.put("num",1);
jsonObject.put("remark","批量签收下架");
jsonObjects.add(jsonObject);
content = "包件在"+myCurrentWarehouse.getName()+"由"+loadscanEntity.getSigningUser()+"司机一键签收,装车方式:扫描装车,配送车次号:"+distributionDeliveryListEntity.getTrainNumber()+"预约任务号:"+reservationEntity.getReservationCode();
content = "包件在"+myCurrentWarehouse.getName()+"由"+loadscanEntity.getSigningUser()+"司机司机批量签收,装车方式:扫描装车,配送车次号:"+distributionDeliveryListEntity.getTrainNumber()+"预约任务号:"+reservationEntity.getReservationCode();
trunklinePackageTrackLog= handleLogJSONObject(myCurrentWarehouse,AuthUtil.getUser(),parcelListEntity.getOrderPackageCode(),content,WorkNodeEnums.DISTRIBUTION_ABNORMAL_SIGN_FOR.getCode());
} else {
@ -5132,7 +5100,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
loadscanEntities.setSigningTime(signingTime);
distributionLoadscanService.updateById(loadscanEntities);
packageLockIds.add(loadscanEntities.getPackageId());
content = "包件在"+myCurrentWarehouse.getName()+"由"+loadscanEntities.getSigningUser()+"司机一键签收,装车方式:补录装车,配送车次号:"+distributionDeliveryListEntity.getTrainNumber()+"预约任务号:"+reservationEntity.getReservationCode();
content = "包件在"+myCurrentWarehouse.getName()+"由"+loadscanEntities.getSigningUser()+"司机批量签收,装车方式:补录装车,配送车次号:"+distributionDeliveryListEntity.getTrainNumber()+"预约任务号:"+reservationEntity.getReservationCode();
trunklinePackageTrackLog= handleLogJSONObject(myCurrentWarehouse,AuthUtil.getUser(),parcelListEntity.getOrderPackageCode(),content,WorkNodeEnums.DISTRIBUTION_ABNORMAL_SIGN_FOR.getCode());
}

202
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillLadingServiceImpl.java

@ -2973,7 +2973,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
try{
Object billLadingId = distrilbutionBillLading.get("id"); //提货ID
Object coding = distrilbutionBillLading.get("coding"); //包条码
Object type = distrilbutionBillLading.get("type"); //类型 2 订 1 库存品
Object type = distrilbutionBillLading.get("type"); //类型 2 订制品包件 1 库存品
if (Func.isNull(billLadingId) || ObjectUtil.isEmpty(coding) || Func.isNull(type)) {
return Resp.scanFail("3000", "参数不完整!!");
} else {
@ -3117,6 +3117,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
//查询订单存在吗
List<DistrilbutionBillStockEntity> list = distrilbutionBillStockService.list(Wrappers.<DistrilbutionBillStockEntity>query().lambda()
.eq(DistrilbutionBillStockEntity::getBillLadingId, billLadingId)
.ne(DistrilbutionBillStockEntity::getOrderStatus, "2")
);
if (list.isEmpty()) {
return Resp.scanFail("当前提货任务,订单不存在!", "当前提货任务,订单不存在!");
@ -3130,11 +3131,14 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
.collect(Collectors.toList()); // 收集到新的List<String>
List<DistributionStockArticleEntity> distributionStockArticleEntityList = distributionStockArticleService.list(Wrappers.<DistributionStockArticleEntity>query().lambda()
.in(DistributionStockArticleEntity::getId, ls));
List<DistributionStockArticleEntity> distributionStockArticleEntityList = distributionStockArticleService.list(Wrappers.<DistributionStockArticleEntity>query().lambda()
.in(DistributionStockArticleEntity::getId, ls)
.ne(DistributionStockArticleEntity::getIsZero, "1")
);
List<DistributionParcelListEntity> list1 = distributionParcelListService.list(Wrappers.<DistributionParcelListEntity>query().lambda()
.in(DistributionParcelListEntity::getStockArticleId, ls)
.eq(DistributionParcelListEntity::getConditions, 1)
);
@ -3150,8 +3154,12 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
DistributionParcelListEntity distributionParcelListEntity = null;
for (DistributionParcelListEntity parcelListEntity : list1) {
log.debug("getScan parcelListEntity >>>> {}", parcelListEntity);
log.debug("getScan so >>>> {}", so);
log.debug("getScan coding >>>> {}", coding);
if (parcelListEntity.getStockArticleId().equals(so.getStockArticleId()) && parcelListEntity.getOrderPackageCode().equals(coding)) {
distributionParcelListEntity = parcelListEntity;
break;
}
}
@ -3194,7 +3202,6 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
int i2 = ObjectUtils.isNull(one.getSigninQuantity()) ? 1 : one.getSigninQuantity() + 1;
one.setHandQuantity(i);
one.setSigninQuantity(i2);
}
// 修改订单状态
@ -3224,7 +3231,6 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
String a = String.valueOf(billLadingId);
distributionAsyncService.getStockUPstate(Long.parseLong(a));
log.info(coding + " > > 签收成功!!");
return Resp.scanSuccess("签收成功", "签收成功");
}
@ -3298,81 +3304,90 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
return false;
}
Set<Long> parcelListIds = new HashSet<>();
for (int i = 0; i < split.length; i++) {
String s = split[i];
//查询是不是上传图片
List<DistributionPrintEntity> list1 = distributionPrintService.list(Wrappers.<DistributionPrintEntity>query().lambda()
.eq(DistributionPrintEntity::getBillLadingId, s)
);
if (list1.isEmpty()) {
throw new ServiceException("请上传签收图片!!");
}
int count = (int) list1.stream().filter(ii -> "1".equals(ii.getGenre().toString())).count();
int count1 = (int) list1.stream().filter(ii -> "2".equals(ii.getGenre().toString())).count();
int count2 = (int) list1.stream().filter(ii -> "3".equals(ii.getGenre().toString())).count();
if (count1 < 1 || count < 1 || count2 < 1) {
throw new ServiceException("请上传完整签收图片!!");
}
//修改提货状态
DistrilbutionBillLadingEntity billLadingEntity = new DistrilbutionBillLadingEntity();
billLadingEntity.setConditions(BillLadingStatusConstant.yiqianshou.getValue());
billLadingEntity.setId(Long.parseLong(s));
this.updateById(billLadingEntity);
//完成备货状态
distributionStockupInfoService.maintenanceStockUp(Long.parseLong(s), 2);
//查询自提单是否完成扫描
Integer integer = this.selectBillLadingPlanNum(Long.parseLong(s));
List<DistributionBillLadingScanEntity> ladingScanEntities = distributionBillLadingScanService.list(Wrappers.<DistributionBillLadingScanEntity>query().lambda().eq(DistributionBillLadingScanEntity::getBillLadingId, Long.parseLong(s)));
if (Func.isNotEmpty(ladingScanEntities)) {
int sum = ladingScanEntities.stream().mapToInt(DistributionBillLadingScanEntity::getQuantity).sum();
if (integer != sum) {
//存在资源释放操作
distributionAsyncService.releaseBillLadingResource(Long.parseLong(s), myCurrentWarehouse.getId());
try{
for (int i = 0; i < split.length; i++) {
String s = split[i];
//查询是不是上传图片
List<DistributionPrintEntity> list1 = distributionPrintService.list(Wrappers.<DistributionPrintEntity>query().lambda()
.eq(DistributionPrintEntity::getBillLadingId, s)
);
if (list1.isEmpty()) {
throw new ServiceException("请上传签收图片!!");
}
parcelListIds.addAll(ladingScanEntities.stream().map(DistributionBillLadingScanEntity::getParcelListId).collect(Collectors.toSet()));
for (DistributionBillLadingScanEntity ladingScanEntity : ladingScanEntities) {
// 签收发送消息到工厂
pushFactoryOrderData(myCurrentWarehouse.getId(), ladingScanEntity.getParcelListId().toString(), ladingScanEntity.getOrderSelfNumbering());
int count = (int) list1.stream().filter(ii -> "1".equals(ii.getGenre().toString())).count();
int count1 = (int) list1.stream().filter(ii -> "2".equals(ii.getGenre().toString())).count();
int count2 = (int) list1.stream().filter(ii -> "3".equals(ii.getGenre().toString())).count();
if (count1 < 1 || count < 1 || count2 < 1) {
throw new ServiceException("请上传完整签收图片!!");
}
//修改提货状态
DistrilbutionBillLadingEntity billLadingEntity = new DistrilbutionBillLadingEntity();
billLadingEntity.setConditions(BillLadingStatusConstant.yiqianshou.getValue());
billLadingEntity.setId(Long.parseLong(s));
this.updateById(billLadingEntity);
//完成备货状态
distributionStockupInfoService.maintenanceStockUp(Long.parseLong(s), 2);
//查询自提单是否完成扫描
Integer integer = this.selectBillLadingPlanNum(Long.parseLong(s));
List<DistributionBillLadingScanEntity> ladingScanEntities = distributionBillLadingScanService.list(Wrappers.<DistributionBillLadingScanEntity>query().lambda()
.eq(DistributionBillLadingScanEntity::getBillLadingId, Long.parseLong(s))
.eq(DistributionBillLadingScanEntity::getMaterialType, "2")
);
if (Func.isNotEmpty(ladingScanEntities)) {
int sum = ladingScanEntities.stream().mapToInt(DistributionBillLadingScanEntity::getQuantity).sum();
if (integer != sum) {
//存在资源释放操作
distributionAsyncService.releaseBillLadingResource(Long.parseLong(s), myCurrentWarehouse.getId());
}
parcelListIds.addAll(ladingScanEntities.stream().map(DistributionBillLadingScanEntity::getParcelListId).collect(Collectors.toSet()));
for (DistributionBillLadingScanEntity ladingScanEntity : ladingScanEntities) {
// 签收发送消息到工厂
pushFactoryOrderData(myCurrentWarehouse.getId(), ladingScanEntity.getParcelListId().toString(), ladingScanEntity.getOrderSelfNumbering());
}
} else {
distributionAsyncService.releaseBillLadingResource(Long.parseLong(s), myCurrentWarehouse.getId());
}
} else {
distributionAsyncService.releaseBillLadingResource(Long.parseLong(s), myCurrentWarehouse.getId());
}
//修改订单状态
List<DistrilbutionBillStockEntity> list = distrilbutionBillStockService.list(Wrappers.<DistrilbutionBillStockEntity>query().lambda()
.eq(DistrilbutionBillStockEntity::getBillLadingId, s)
.apply("order_status in ( '1' , '3')")
//修改订单状态
List<DistrilbutionBillStockEntity> list = distrilbutionBillStockService.list(Wrappers.<DistrilbutionBillStockEntity>query().lambda()
.eq(DistrilbutionBillStockEntity::getBillLadingId, s)
.apply("order_status in ( '1' , '3')")
// .or(ew -> ew.eq(DistrilbutionBillStockEntity::getBillLadingId, s).apply(DistrilbutionBillStockEntity::getOrderStatus, "2"))
);
if (!list.isEmpty()) {
list.forEach(li -> {
DistributionStockArticleEntity stockArticleEntity = new DistributionStockArticleEntity();
stockArticleEntity.setId(li.getStockArticleId());
);
if (!list.isEmpty()) {
list.forEach(li -> {
DistributionStockArticleEntity stockArticleEntity = new DistributionStockArticleEntity();
stockArticleEntity.setId(li.getStockArticleId());
List<DistributionParcelListEntity> list2 = distributionParcelListService.list(Wrappers.<DistributionParcelListEntity>query().lambda()
.eq(DistributionParcelListEntity::getStockArticleId, li.getStockArticleId())
.apply("order_package_status != 70 ")
);
if (list2.isEmpty()) {
stockArticleEntity.setOrderStatus(OrderStatusConstant.qianshou.getValue());
} else {
stockArticleEntity.setOrderStatus(OrderStatusConstant.bufenqianshou.getValue());
}
//回退包件数据
Integer i1 = updatePack(li.getStockArticleId(), Long.valueOf(s));
if (i1 > 0) {
stockArticleEntity.setOrderStatus(OrderStatusConstant.bufenqianshou.getValue());
}
distributionStockArticleService.updateById(stockArticleEntity);
});
}
//处理库存品签收数据
updateStock(s);
List<DistributionParcelListEntity> list2 = distributionParcelListService.list(Wrappers.<DistributionParcelListEntity>query().lambda()
.eq(DistributionParcelListEntity::getStockArticleId, li.getStockArticleId())
.apply("order_package_status != 70 ")
);
if (list2.isEmpty()) {
stockArticleEntity.setOrderStatus(OrderStatusConstant.qianshou.getValue());
} else {
stockArticleEntity.setOrderStatus(OrderStatusConstant.bufenqianshou.getValue());
}
//回退包件数据
Integer i1 = updatePack(li.getStockArticleId(), Long.valueOf(s));
if (i1 > 0) {
stockArticleEntity.setOrderStatus(OrderStatusConstant.bufenqianshou.getValue());
}
distributionStockArticleService.updateById(stockArticleEntity);
});
}
//处理库存品签收数据
updateStock(s);
// 回传老系统自提数据
sendOldSystem(Long.parseLong(s));
// 回传老系统自提数据
sendOldSystem(Long.parseLong(s));
}
}catch (Exception e){
log.error(">>>>>",e);
return false;
}
// 回传工厂数据
sendFactory(myCurrentWarehouse, parcelListIds);
@ -3457,7 +3472,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
map.put("messageData", JSONUtil.toJsonStr(orderStatusDTO));
rabbitTemplate.convertAndSend(RabbitConstant.HWY_ORDER_STATUS_EXCHANGE, RabbitConstant.HWY_ORDER_STATUS_ROUTING, map);
} catch (Exception e) {
log.error("入库推送失败:{}", e);
log.error("入库推送失败:", e);
}
}
@ -3502,7 +3517,6 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
.eq(DistrilbutionBillPackageEntity::getBillLadingId, billId)
.eq(DistrilbutionBillPackageEntity::getStockArticleId, ids)
);
List<DistributionBillLadingScanEntity> scanEntityList = new ArrayList<>();
AtomicReference<Integer> num = new AtomicReference<>(0);
if (ObjectUtils.isNotNull(list) && !list.isEmpty()) {
//签收记录
@ -3513,41 +3527,29 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
Iterator<DistrilbutionBillPackageEntity> iterator = list.iterator();
while (iterator.hasNext()) {
DistrilbutionBillPackageEntity next = iterator.next();
boolean b = list1.stream().anyMatch(q -> q.getParcelListId().equals(next.getParceListId()));
if (b) {
//删除包件
iterator.remove();
if(ObjectUtils.isNotNull(next.getParceListId())){
boolean b = list1.stream().anyMatch(q -> {
if(ObjectUtils.isNotNull(q.getParcelListId())){
return q.getParcelListId().equals(next.getParceListId());
}
return false;
});
if (b) {
//删除包件
iterator.remove();
}
}
}
//添加包件签收记录
// list.stream().forEach(i ->{
// distributionParcelListService.lambdaUpdate()
// .set(DistributionParcelListEntity::getOrderPackageStatus, OrderPackageStatusConstant.yiqianshou.getValue())
// .eq(DistributionParcelListEntity::getId, i);
// DistributionBillLadingScanEntity billLadingScan = new DistributionBillLadingScanEntity();
// billLadingScan.setMaterialType("2");
// billLadingScan.setScanType(2);
// billLadingScan.setParcelListId(i.getParceListId());
// billLadingScan.setStockArticleId(i.getStockArticleId());
// billLadingScan.setBillLadingId(billId);
// billLadingScan.setPacketBarCode( i.getPacketBarCode());
// billLadingScan.setQuantity(i.getPacketNumber());
// scanEntityList.add(billLadingScan);
// });
}
//回退包件信息
list.stream().forEach(i -> {
list.forEach(i -> {
DistributionParcelListEntity parcelListEntity = new DistributionParcelListEntity();
parcelListEntity.setId(i.getParceListId());
parcelListEntity.setOrderPackageReservationStatus(OrderPackageReservationStatusConstant.daiyuyue.getValue());
distributionParcelListService.updateById(parcelListEntity);
num.getAndSet(num.get() + 1);
});
// if(!scanEntityList.isEmpty()){
// distributionBillLadingScanService.saveBatch(scanEntityList);
// }
}
return num.get();
}

155
blade-service/logpm-patch/src/main/java/com/logpm/patch/config/CustomMessageConverter.java

@ -0,0 +1,155 @@
package com.logpm.patch.config;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONUtil;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.utils.ThreadLocalUtil;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.core.MessageProperties;
import org.springframework.amqp.support.converter.AllowedListDeserializingMessageConverter;
import org.springframework.amqp.support.converter.MessageConversionException;
import org.springframework.amqp.utils.SerializationUtils;
import org.springframework.beans.factory.BeanClassLoaderAware;
import org.springframework.http.HttpHeaders;
import org.springframework.mock.web.MockHttpServletRequest;
import org.springframework.remoting.rmi.CodebaseAwareObjectInputStream;
import org.springframework.stereotype.Component;
import org.springframework.util.ClassUtils;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import java.io.*;
import java.util.List;
import java.util.Map;
/**
* @author zhaoqiaobo
* @create 2024-05-08
*/
@Component
public class CustomMessageConverter extends AllowedListDeserializingMessageConverter implements BeanClassLoaderAware {
private volatile String defaultCharset = "UTF-8";
private ClassLoader beanClassLoader = ClassUtils.getDefaultClassLoader();
private String codebaseUrl;
@Deprecated
public void setCodebaseUrl(String codebaseUrl) {
this.codebaseUrl = codebaseUrl;
}
@Override
public Object fromMessage(Message message) throws MessageConversionException {
Object content = null;
MessageProperties properties = message.getMessageProperties();
if (properties != null) {
String contentType = properties.getContentType();
if (contentType != null && contentType.startsWith("text")) {
String encoding = properties.getContentEncoding();
if (encoding == null) {
encoding = "UTF-8";
}
try {
content = new String(message.getBody(), encoding);
} catch (UnsupportedEncodingException var8) {
throw new MessageConversionException("failed to convert text-based Message content", var8);
}
} else if (contentType != null && contentType.equals("application/x-java-serialized-object")) {
try {
content = SerializationUtils.deserialize(this.createObjectInputStream(new ByteArrayInputStream(message.getBody()), this.codebaseUrl));
} catch (IllegalArgumentException | IllegalStateException | IOException var7) {
throw new MessageConversionException("failed to convert serialized Message content", var7);
}
}
}
Map<String, Object> headers = properties.getHeaders();
HttpHeaders httpHeaders = new HttpHeaders();
for (Map.Entry<String, Object> entry : headers.entrySet()) {
if (StrUtil.equals("Blade-Auth", entry.getKey())
|| StrUtil.equals("Authorization", entry.getKey())
|| StrUtil.equals("blade-auth", entry.getKey())
|| StrUtil.equals("authorization", entry.getKey())) {
List value = (List) entry.getValue();
for (Object o : value) {
httpHeaders.add(entry.getKey(), String.valueOf(o));
}
}
}
ThreadLocalUtil.put("bladeContext", httpHeaders);
Object bladeUser = headers.get("bladeUser");
MockHttpServletRequest request = new MockHttpServletRequest();
BladeUser bladeUser1 = JSONUtil.toBean(bladeUser.toString(), BladeUser.class);
request.setAttribute("_BLADE_USER_REQUEST_ATTR_", bladeUser1);
RequestContextHolder.setRequestAttributes(new ServletRequestAttributes(request));
if (content == null) {
content = message.getBody();
}
return content;
}
@Override
protected Message createMessage(Object object, MessageProperties messageProperties) throws MessageConversionException {
byte[] bytes = null;
if (object instanceof byte[]) {
bytes = (byte[]) object;
messageProperties.setContentType("application/octet-stream");
} else if (object instanceof String) {
try {
bytes = ((String) object).getBytes(this.defaultCharset);
} catch (UnsupportedEncodingException var6) {
throw new MessageConversionException("failed to convert to Message content", var6);
}
messageProperties.setContentType("text/plain");
messageProperties.setContentEncoding(this.defaultCharset);
} else if (object instanceof Serializable) {
try {
bytes = SerializationUtils.serialize(object);
} catch (IllegalArgumentException var5) {
throw new MessageConversionException("failed to convert to serialized Message content", var5);
}
messageProperties.setContentType("application/x-java-serialized-object");
}
HttpHeaders headers = (HttpHeaders) ThreadLocalUtil.get("bladeContext");
if (headers != null && !headers.isEmpty()) {
headers.forEach((key, values) -> {
values.forEach((value) -> {
messageProperties.setHeader(key, new String[]{value});
});
});
}
BladeUser user = AuthUtil.getUser();
BladeUser bladeUser = new BladeUser();
bladeUser.setTenantId(user.getTenantId());
bladeUser.setUserId(user.getUserId());
bladeUser.setAccount(user.getAccount());
bladeUser.setRoleId(user.getRoleId());
messageProperties.setHeader("bladeUser", JSONUtil.toJsonStr(bladeUser));
if (bytes != null) {
messageProperties.setContentLength((long) bytes.length);
return new Message(bytes, messageProperties);
} else {
throw new IllegalArgumentException(this.getClass().getSimpleName() + " only supports String, byte[] and Serializable payloads, received: " + object.getClass().getName());
}
}
@Override
public void setBeanClassLoader(ClassLoader classLoader) {
this.beanClassLoader = beanClassLoader;
}
protected ObjectInputStream createObjectInputStream(InputStream is, String codebaseUrl) throws IOException {
return new CodebaseAwareObjectInputStream(is, this.beanClassLoader, codebaseUrl) {
@Override
protected Class<?> resolveClass(ObjectStreamClass classDesc) throws IOException, ClassNotFoundException {
Class<?> clazz = super.resolveClass(classDesc);
CustomMessageConverter.this.checkAllowedList(clazz);
return clazz;
}
};
}
}

1
blade-service/logpm-patch/src/main/java/com/logpm/patch/config/RabbitMqConfiguration.java

@ -26,6 +26,7 @@ public class RabbitMqConfiguration {
RabbitTemplate template = new RabbitTemplate();
template.setConnectionFactory(connectionFactory);
template.setMandatory(true);
template.setMessageConverter(new CustomMessageConverter());
template.setConfirmCallback(new RabbitTemplate.ConfirmCallback() {
@Override
public void confirm(CorrelationData correlationData, boolean b, String s) {

23
blade-service/logpm-patch/src/main/java/com/logpm/patch/jobhandle/SyncOldTrayTypeData.java

@ -8,7 +8,8 @@ import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.tool.api.R;
import org.springblade.common.constant.RabbitConstant;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.stereotype.Component;
import java.util.List;
@ -21,7 +22,7 @@ public class SyncOldTrayTypeData {
private final IOldTrayTypeService oldTrayTypeService;
private final ISyncOldTrayTypeClient syncOldTrayTypeClient;
private final RabbitTemplate rabbitTemplate;
@XxlJob("syncOldTrayTypeInfo")
public ReturnT<String> syncOldTrayTypeInfo(String param) {
@ -43,13 +44,17 @@ public class SyncOldTrayTypeData {
Integer trayId = jsonObject.getInteger("trayId");
Integer oldWarehouseId = jsonObject.getInteger("warehouseId");
R r = syncOldTrayTypeClient.budaOldTrayTypeData(orderPackageCode, trayId, type, oldWarehouseId);
int code = r.getCode();
if(200 == code){
oldTrayTypeService.updateSyncStatus(id,1);
}else{
oldTrayTypeService.updateSyncNum(id,syncNum+1);
}
jsonObject.put("oldTrayTypeId",id);
rabbitTemplate.convertAndSend(RabbitConstant.OLD_TRAY_TYPE_EXCHANGE,RabbitConstant.OLD_TRAY_TYPE_ROUTING, jsonObject.toJSONString());
// R r = syncOldTrayTypeClient.budaOldTrayTypeData(orderPackageCode, trayId, type, oldWarehouseId);
// int code = r.getCode();
// if(200 == code){
// oldTrayTypeService.updateSyncStatus(id,1);
// }else{
// oldTrayTypeService.updateSyncNum(id,syncNum+1);
// }
}
return ReturnT.SUCCESS;

38
blade-service/logpm-patch/src/main/java/com/logpm/patch/jobhandle/SyncOrderInfoToPlatform.java

@ -795,4 +795,42 @@ public class SyncOrderInfoToPlatform {
}
@XxlJob("clearTrayTypeInfo")
public ReturnT<String> clearTrayTypeInfo(String param) {
log.info("############clearTrayTypeInfo: 处理托盘重复数据 开始");
List<String> trayCodes = new ArrayList<>();
if(StringUtil.isBlank(param)){
trayCodes = warehouseMappingDataService.findExceptionTrayType();
}else{
if(param.contains(",")){
String[] split = param.split(",");
trayCodes.addAll(Arrays.asList(split));
}else{
trayCodes.add(param);
}
}
trayCodes.forEach(trayCode -> {
List<Long> trayTypeIds = warehouseMappingDataService.findMoreTrayTypeIds(trayCode);
Long aLong = trayTypeIds.get(0);
trayTypeIds.remove(aLong);
warehouseMappingDataService.updateTrayTypeId(aLong,trayCode);
warehouseMappingDataService.updateTrayTypeDeleted(trayTypeIds);
Integer num = warehouseMappingDataService.findTrayTypeNum(trayCode);
warehouseMappingDataService.updateTrayTypeNum(num,aLong);
});
log.info("############clearTrayTypeInfo: 处理托盘重复数据 完成");
return ReturnT.SUCCESS;
}
}

12
blade-service/logpm-patch/src/main/java/com/logpm/patch/mapper/WarehouseMappingDataMapper.java

@ -97,5 +97,17 @@ public interface WarehouseMappingDataMapper {
void updateClearBillSignforStatus(@Param("singnforId") Long singnforId, @Param("warehouseId") Long warehouseId, @Param("dealStatus") Integer dealStatus);
List<JSONObject> findAllBillSign(@Param("id") Integer id);
List<String> findExceptionTrayType();
List<Long> findMoreTrayTypeIds(@Param("trayCode") String trayCode);
void updateTrayTypeId(@Param("trayTypeId") Long aLong, @Param("trayCode") String trayCode);
void updateTrayTypeDeleted(@Param("trayTypeIds") List<Long> trayTypeIds);
Integer findTrayTypeNum(@Param("trayCode") String trayCode);
void updateTrayTypeNum(@Param("num") Integer num, @Param("aLong") Long aLong);
}

43
blade-service/logpm-patch/src/main/java/com/logpm/patch/mapper/WarehouseMappingDataMapper.xml

@ -306,4 +306,47 @@
and warehouse_id = #{warehouseId}
</update>
<select id="findExceptionTrayType" resultType="String">
select tray_code
from logpm_warehouse_tray_type
where is_deleted = 0
group by tray_code
HAVING count(id) > 1
</select>
<select id="findMoreTrayTypeIds" resultType="Long">
select id
from logpm_warehouse_tray_type
where tray_code = #{trayCode}
and is_deleted = 0
</select>
<update id="updateTrayTypeId" >
update logpm_warehouse_tray_goods
set tray_type_id = #{trayTypeId}
where tray_code = #{trayCode}
and is_deleted = 0
</update>
<update id="updateTrayTypeDeleted" >
update logpm_warehouse_tray_type
set is_deleted = 1
where id in
<foreach collection="trayTypeIds" item="item" index="index" open="(" separator="," close=")">
#{item}
</foreach>
</update>
<select id="findTrayTypeNum" resultType="int">
select count(id)
from logpm_warehouse_tray_goods
where tray_code = #{trayCode}
</select>
<update id="updateTrayTypeNum" >
update logpm_warehouse_tray_type
set total_num = #{num}
where id = #{aLong}
</update>
</mapper>

13
blade-service/logpm-patch/src/main/java/com/logpm/patch/service/IWarehouseMappingDataService.java

@ -87,4 +87,17 @@ public interface IWarehouseMappingDataService {
List<JSONObject> findPackageUpdownData();
void updatePackageUpdownStatus(Integer id, Integer syncStatus);
List<String> findExceptionTrayType();
List<Long> findMoreTrayTypeIds(String trayCode);
void updateTrayTypeId(Long aLong,String trayCode);
void updateTrayTypeDeleted(List<Long> trayTypeIds);
Integer findTrayTypeNum(String trayCode);
void updateTrayTypeNum(Integer num, Long aLong);
}

30
blade-service/logpm-patch/src/main/java/com/logpm/patch/service/impl/WarehouseMappingDataServiceImpl.java

@ -205,4 +205,34 @@ public class WarehouseMappingDataServiceImpl implements IWarehouseMappingDataSer
public void updatePackageUpdownStatus(Integer id, Integer syncStatus) {
warehouseMappingDataMapper.updatePackageUpdownStatus(id,syncStatus);
}
@Override
public List<String> findExceptionTrayType() {
return warehouseMappingDataMapper.findExceptionTrayType();
}
@Override
public List<Long> findMoreTrayTypeIds(String trayCode) {
return warehouseMappingDataMapper.findMoreTrayTypeIds(trayCode);
}
@Override
public void updateTrayTypeId(Long aLong,String trayCode) {
warehouseMappingDataMapper.updateTrayTypeId(aLong,trayCode);
}
@Override
public void updateTrayTypeDeleted(List<Long> trayTypeIds) {
warehouseMappingDataMapper.updateTrayTypeDeleted(trayTypeIds);
}
@Override
public Integer findTrayTypeNum(String trayCode) {
return warehouseMappingDataMapper.findTrayTypeNum(trayCode);
}
@Override
public void updateTrayTypeNum(Integer num, Long aLong) {
warehouseMappingDataMapper.updateTrayTypeNum(num,aLong);
}
}

4
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineBillladingMapper.xml

@ -158,7 +158,7 @@
and ltad.incoming_time &lt;= #{endByDateStr}
and ltad.incoming_warehouse_id = #{warehouseId}
<if test="customerTrain != null and customerTrain != ''">
and ltad.customer_train = #{customerTrain}
and ltad.train_number = #{customerTrain}
</if>
group by ltad.advance_id) t
left join logpm_trunkline_advance lta on lta.id = t.advanceId
@ -183,7 +183,7 @@
and ltad.incoming_time &lt;= #{endByDateStr}
and ltad.incoming_warehouse_id = #{warehouseId}
<if test="customerTrain != null and customerTrain != ''">
and ltad.customer_train = #{customerTrain}
and ltad.train_number = #{customerTrain}
</if>
group by ltad.advance_id) t
left join logpm_trunkline_advance lta on lta.id = t.advanceId

5
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineBillladingWaybillMapper.xml

@ -41,14 +41,17 @@
lww.consignee_address consigneeAddress,
lww.remark remark,
lww.total_count totalCount,
lww.stock_count stockCount,
sum(ltbw2.real_num) stockCount,
ltbw.billlading_fee billladingFee,
lww.collect_pay collectPay
from logpm_trunkline_billlading_waybill ltbw
left join logpm_trunkline_billlading_waybill ltbw2 on ltbw2.waybill_id = ltbw.waybill_id
left join logpm_trunkline_billlading ltb on ltb.id = ltbw.billlading_id
left join logpm_warehouse_waybill lww on lww.waybill_no = ltbw.waybill_no
where ltbw.billlading_id = #{billladingId}
and ltbw.is_deleted = 0
group by ltb.billlading_code,
ltbw.waybill_id
</select>
<update id="updateDataByBillladingWaybillId" >

10
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/InComingServiceImpl.java

@ -197,6 +197,7 @@ public class InComingServiceImpl implements IInComingService {
Integer incomingType = inComingDTO.getIncomingType();//入库类型 1码板打托 2扫码入库 3直接入库 4 按车次号入库 5按订单入库 6扫描入库 7 批量卸车入库 8卸车托盘 9卸分一体 10补录数据入库
String trayCode = inComingDTO.getTrayCode();//托盘码
String trayType = inComingDTO.getTrayType();//打托方式
String customerTrain = inComingDTO.getCustomerTrain();//车次号
List<String> packageCodes = Arrays.asList(orderPackageCode.split(","));
log.info("############incomingPackage: 包件入库开始 packageCodes={} billladingId={} warehouseId={}", packageCodes, billladingId, warehouseId);
@ -209,6 +210,15 @@ public class InComingServiceImpl implements IInComingService {
log.warn("############incomingPackage: 包件不存在 packageCodes={} warehouseId={}", packageCodes, warehouseId);
return Resp.scanFail(405, "包件无数据", "包件无数据");
}
if(StringUtil.isNotBlank(customerTrain)){
for (TrunklineAdvanceDetailEntity advanceDetailEntity : advanceDetailEntityList) {
String trainNumber = advanceDetailEntity.getTrainNumber();
if(!trainNumber.equals(customerTrain)){
log.warn("############incomingPackage: 包件车次号不一致 packageCodes={} trainNumber={} trainNumber={}", packageCodes, trainNumber, customerTrain);
return Resp.scanFail(405, "包件车次号不一致", "包件车次号不一致");
}
}
}
//把advanceDetailEntityList通过packageStatus分组
Map<String, List<TrunklineAdvanceDetailEntity>> advanceDetailEntityMap = advanceDetailEntityList.stream().collect(Collectors.groupingBy(TrunklineAdvanceDetailEntity::getPackageStatus));

112
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineBillladingPackageServiceImpl.java

@ -281,60 +281,60 @@ public class TrunklineBillladingPackageServiceImpl extends BaseServiceImpl<Trunk
}
});
QueryWrapper<TrunklineBillladingWaybillEntity> billladingWaybillEntityQueryWrapper = new QueryWrapper<>();
billladingWaybillEntityQueryWrapper.in("waybill_no",waybillNoSet)
.eq("billlading_id",billladingId)
.eq("is_deleted",0);
List<TrunklineBillladingWaybillEntity> billladingWaybillEntityList = trunklineBillladingWaybillService.list(billladingWaybillEntityQueryWrapper);
//把billladingWaybillEntityList转化成waybillNo为key的Map
Map<String, TrunklineBillladingWaybillEntity> billladingWaybillEntityMap = billladingWaybillEntityList.stream().collect(Collectors.toMap(TrunklineBillladingWaybillEntity::getWaybillNo, Function.identity()));
List<TrunklineBillladingWaybillEntity> addList = new ArrayList<>();
List<TrunklineBillladingWaybillEntity> updateList = new ArrayList<>();
final TrunklineBillladingWaybillEntity[] noWaybillData = {trunklineBillladingWaybillService.findNoWaybillNoData(billladingId)};
waybillNoSet.forEach(waybillNo -> {
Integer integer = waybillNoMNumMap.get(waybillNo);
TrunklineBillladingWaybillEntity billladingWaybillEntity = billladingWaybillEntityMap.get(waybillNo);
if(Objects.isNull(billladingWaybillEntity)){
//查询是否有一条无运单的数据
if(Objects.isNull(noWaybillData[0])){
noWaybillData[0] = new TrunklineBillladingWaybillEntity();
noWaybillData[0].setWarehouseId(warehouseId);
noWaybillData[0].setWarehouseName(warehouseEntity.getName());
noWaybillData[0].setBillladingId(billladingId);
noWaybillData[0].setBilladingCode(trunklineBillladingEntity.getBillladingCode());
noWaybillData[0].setWaybillNo("————");
noWaybillData[0].setRealNum(integer);
noWaybillData[0].setRealWeight(BigDecimal.ZERO);
noWaybillData[0].setRealVolume(BigDecimal.ZERO);
}else{
Integer realNum = noWaybillData[0].getRealNum();
noWaybillData[0].setRealNum(realNum+integer);
}
}else{
Integer realNum = billladingWaybillEntity.getRealNum();
billladingWaybillEntity.setRealNum(realNum + integer);
updateList.add(billladingWaybillEntity);
}
});
addList.add(noWaybillData[0]);
trunklineBillladingWaybillService.saveBatch(addList);
trunklineBillladingWaybillService.updateBatchById(updateList);
TrunklineBillladingEntity billladingEntity = trunklineBillladingService.getById(billladingId);
if(!Objects.isNull(billladingEntity)){
int realNum = billladingEntity.getRealNum();
Integer all = waybillNoMNumMap.values().stream().reduce(Integer::sum).get();
billladingEntity.setRealNum(realNum+all);
trunklineBillladingService.updateById(billladingEntity);
}
// QueryWrapper<TrunklineBillladingWaybillEntity> billladingWaybillEntityQueryWrapper = new QueryWrapper<>();
// billladingWaybillEntityQueryWrapper.in("waybill_no",waybillNoSet)
// .eq("billlading_id",billladingId)
// .eq("is_deleted",0);
//
// List<TrunklineBillladingWaybillEntity> billladingWaybillEntityList = trunklineBillladingWaybillService.list(billladingWaybillEntityQueryWrapper);
//
// //把billladingWaybillEntityList转化成waybillNo为key的Map
// Map<String, TrunklineBillladingWaybillEntity> billladingWaybillEntityMap = billladingWaybillEntityList.stream().collect(Collectors.toMap(TrunklineBillladingWaybillEntity::getWaybillNo, Function.identity()));
//
// List<TrunklineBillladingWaybillEntity> addList = new ArrayList<>();
// List<TrunklineBillladingWaybillEntity> updateList = new ArrayList<>();
//
// final TrunklineBillladingWaybillEntity[] noWaybillData = {trunklineBillladingWaybillService.findNoWaybillNoData(billladingId)};
//
//
// waybillNoSet.forEach(waybillNo -> {
// Integer integer = waybillNoMNumMap.get(waybillNo);
// TrunklineBillladingWaybillEntity billladingWaybillEntity = billladingWaybillEntityMap.get(waybillNo);
// if(Objects.isNull(billladingWaybillEntity)){
// //查询是否有一条无运单的数据
// if(Objects.isNull(noWaybillData[0])){
// noWaybillData[0] = new TrunklineBillladingWaybillEntity();
// noWaybillData[0].setWarehouseId(warehouseId);
// noWaybillData[0].setWarehouseName(warehouseEntity.getName());
// noWaybillData[0].setBillladingId(billladingId);
// noWaybillData[0].setBilladingCode(trunklineBillladingEntity.getBillladingCode());
// noWaybillData[0].setWaybillNo("————");
// noWaybillData[0].setRealNum(integer);
// noWaybillData[0].setRealWeight(BigDecimal.ZERO);
// noWaybillData[0].setRealVolume(BigDecimal.ZERO);
// }else{
// Integer realNum = noWaybillData[0].getRealNum();
// noWaybillData[0].setRealNum(realNum+integer);
// }
// }else{
// Integer realNum = billladingWaybillEntity.getRealNum();
// billladingWaybillEntity.setRealNum(realNum + integer);
// updateList.add(billladingWaybillEntity);
// }
// });
//
// addList.add(noWaybillData[0]);
//
// trunklineBillladingWaybillService.saveBatch(addList);
// trunklineBillladingWaybillService.updateBatchById(updateList);
//
// TrunklineBillladingEntity billladingEntity = trunklineBillladingService.getById(billladingId);
// if(!Objects.isNull(billladingEntity)){
// int realNum = billladingEntity.getRealNum();
// Integer all = waybillNoMNumMap.values().stream().reduce(Integer::sum).get();
// billladingEntity.setRealNum(realNum+all);
// trunklineBillladingService.updateById(billladingEntity);
// }
waybillEntityMap.keySet().forEach(waybillNo -> {
@ -367,8 +367,10 @@ public class TrunklineBillladingPackageServiceImpl extends BaseServiceImpl<Trunk
warehouseWaybillClient.updateList(warehouseWaybillEntities);
//根据提货单id重新计算每个运单的费用
trunklineBillladingWaybillService.updateBillladingFeeByBillladingId(trunklineBillladingEntity);
// trunklineBillladingWaybillService.updateBillladingFeeByBillladingId(trunklineBillladingEntity);
//--------------------------------------分割线------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
// QueryWrapper<TrunklineBillladingPackageEntity> queryWrapper = new QueryWrapper<>();
// queryWrapper.eq("order_package_code",orderPackageCode);

3
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/OldSystemPushController.java

@ -185,7 +185,8 @@ public class OldSystemPushController {
warehouseLog.setType(3);
warehouseLogService.save(warehouseLog);
asyncDataService.sendTrayInfoByOrderPackageCode(trayInfoDTO);
rabbitTemplate.convertAndSend(RabbitConstant.OLD_TRAY_TYPE_EXCHANGE,RabbitConstant.OLD_TRAY_TYPE_ROUTING, JSONObject.toJSONString(trayInfoDTO));
// asyncDataService.sendTrayInfoByOrderPackageCode(trayInfoDTO);
warehouseLog.setStatus(1);
warehouseLogService.updateById(warehouseLog);

4
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseUpdownTypeMapper.java

@ -25,4 +25,8 @@ public interface WarehouseUpdownTypeMapper extends BaseMapper<WarehouseUpdownTyp
void updateStockByUpdownTypeId(@Param("orderTotalNum") Integer orderTotalNum, @Param("enterNum") Integer enterNum, @Param("updownTypeId") Long updownTypeId);
List<GoodsVO> selectStockListByUpdownTypeId(@Param("updownTypeId") Long updownTypeId);
void updateOldTrayTypeInfo(@Param("oldTrayTypeId") Long oldTrayTypeId, @Param("status") int status);
void updateOldTrayTypeInfoNum(@Param("oldTrayTypeId") Long oldTrayTypeId);
}

12
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseUpdownTypeMapper.xml

@ -78,4 +78,16 @@
</update>
<update id="updateOldTrayTypeInfo" >
update sync_old_tray_type_log
set sync_status = #{status}
where id = #{oldTrayTypeId}
</update>
<update id="updateOldTrayTypeInfoNum" >
update sync_old_tray_type_log
set sync_num = sync_num + 1
where id = #{oldTrayTypeId}
</update>
</mapper>

82
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/receiver/OldTrayTypeListener.java

@ -0,0 +1,82 @@
package com.logpm.warehouse.receiver;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import com.logpm.warehouse.dto.TrayInfoDTO;
import com.logpm.warehouse.entity.SyncOldTrayTypeLogEntity;
import com.logpm.warehouse.service.ISyncOldTrayTypeLogService;
import com.logpm.warehouse.service.IWarehouseUpdownTypeService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.constant.RabbitConstant;
import org.springblade.common.constant.TenantNum;
import org.springframework.amqp.core.ExchangeTypes;
import org.springframework.amqp.rabbit.annotation.Exchange;
import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.QueueBinding;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import java.util.Date;
import java.util.Objects;
@Slf4j
@Component
@AllArgsConstructor
public class OldTrayTypeListener {
private final IWarehouseUpdownTypeService warehouseUpdownTypeService;
private final ISyncOldTrayTypeLogService syncOldTrayTypeLogService;
@RabbitListener(bindings = @QueueBinding(
value = @Queue(name = RabbitConstant.OLD_TRAY_TYPE_QUEUE),
exchange = @Exchange(name = RabbitConstant.OLD_TRAY_TYPE_EXCHANGE, type = ExchangeTypes.DIRECT),
key = RabbitConstant.OLD_TRAY_TYPE_ROUTING
))
@Transactional(rollbackFor = Exception.class)
public void oldTrayTypeInfo(String msg) {
JSONObject jsonObject = JSONUtil.parseObj(msg);
String orderPackageCode = jsonObject.getStr("orderPackageCode");
Integer type = jsonObject.getInt("type");
Integer trayId = jsonObject.getInt("trayId");
Integer oldWarehouseId = jsonObject.getInt("warehouseId");
Long oldTrayTypeId = jsonObject.getLong("oldTrayTypeId");
TrayInfoDTO trayInfoDTO = new TrayInfoDTO();
trayInfoDTO.setTrayId(trayId);
trayInfoDTO.setType(type);
trayInfoDTO.setWarehouseId(oldWarehouseId);
trayInfoDTO.setOrderPackageCode(orderPackageCode);
try{
warehouseUpdownTypeService.sendTrayInfoByOrderPackageCode(trayInfoDTO);
if(!Objects.isNull(oldTrayTypeId)){
warehouseUpdownTypeService.updateOldTrayTypeInfo(oldTrayTypeId,1);
}
}catch (Exception e){
if(!Objects.isNull(oldTrayTypeId)){
warehouseUpdownTypeService.updateOldTrayTypeInfoNum(oldTrayTypeId);
}else{
SyncOldTrayTypeLogEntity syncOldTrayTypeLogEntity = new SyncOldTrayTypeLogEntity();
syncOldTrayTypeLogEntity.setCreateUser(1714696768639311873L);
syncOldTrayTypeLogEntity.setUpdateUser(1714696768639311873L);
syncOldTrayTypeLogEntity.setCreateDept(1649331096241836033L);
syncOldTrayTypeLogEntity.setTenantId(TenantNum.HUITONGCODE);
syncOldTrayTypeLogEntity.setCreateTime(new Date());
syncOldTrayTypeLogEntity.setUpdateTime(new Date());
syncOldTrayTypeLogEntity.setArgs(com.alibaba.fastjson.JSONObject.toJSONString(trayInfoDTO));
syncOldTrayTypeLogEntity.setSyncStatus(0);
syncOldTrayTypeLogEntity.setSyncNum(0);
syncOldTrayTypeLogService.save(syncOldTrayTypeLogEntity);
}
}
}
}

4
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseUpdownTypeService.java

@ -91,4 +91,8 @@ public interface IWarehouseUpdownTypeService extends BaseService<WarehouseUpdown
String findStockListAllocations(Long warehouseId, Long mallId, String sku);
void sendTrayInfoByOrderPackageCode(TrayInfoDTO trayInfoDTO);
void updateOldTrayTypeInfo(Long oldTrayTypeId, int status);
void updateOldTrayTypeInfoNum(Long oldTrayTypeId);
}

10
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTrayTypeServiceImpl.java

@ -1352,8 +1352,13 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
}
}
}
save(trayTypeEntity);
//修改托盘的状态
basicdataTrayClient.updateTrayStatus(trayId,2);
@ -2412,7 +2417,10 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
//空置的托盘打托id
removeByIds(toNullTrayTypeIds);
//更新托盘状态
basicdataTrayClient.updateTrayStatusByTrayIds(updateTrayIds,1);
if(!updateTrayIds.isEmpty()){
basicdataTrayClient.updateTrayStatusByTrayIds(updateTrayIds,1);
}
//添加下托日志
warehouseTrayGoodsLogService.saveBatch(addTrayGoodsLogEntities);
updateTrayTypeIds.forEach(trayTypeId -> {

44
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseUpdownTypeServiceImpl.java

@ -312,6 +312,16 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
}
}
@Override
public void updateOldTrayTypeInfo(Long oldTrayTypeId, int status) {
baseMapper.updateOldTrayTypeInfo(oldTrayTypeId,status);
}
@Override
public void updateOldTrayTypeInfoNum(Long oldTrayTypeId) {
baseMapper.updateOldTrayTypeInfoNum(oldTrayTypeId);
}
private void packageChangeStockByAllocaton(WarehouseUpdownGoodsEntity one) {
//当前登录人选择的仓库
@ -886,9 +896,9 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
findParamterDTO.setWarehouseId(warehouseId);
List<DistributionParcelListEntity> parcelListList = distributionParcelListClient.findALLNoUpShelfPackageByOrderCodeList(findParamterDTO);
if(parcelListList.isEmpty()){
if (parcelListList.isEmpty()) {
log.warn("############upShelfOrder: 没有可上架的包件");
return R.fail(405,"没有可上架的包件");
return R.fail(405, "没有可上架的包件");
}
List<UpShelfPackageDTO> upShelfPackageList = new ArrayList<>();
@ -974,10 +984,10 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
QueryWrapper<WarehouseTrayGoodsEntity> trayGoodsQueryWrapper = new QueryWrapper<>();
trayGoodsQueryWrapper.in("association_value", orderPackageCodeList);
List<WarehouseTrayGoodsEntity> trayGoodsEntityList = warehouseTrayGoodsService.list(trayGoodsQueryWrapper);
if(!trayGoodsEntityList.isEmpty()){
if (!trayGoodsEntityList.isEmpty()) {
//把trayGoodsEntityList中的association_value提取出来存入一个List<String>
List<String> orderPackageCodes = trayGoodsEntityList.stream().map(WarehouseTrayGoodsEntity::getAssociationValue).collect(Collectors.toList());
warehouseTrayTypeService.downPackageByOrderPackageCodeList(orderPackageCodes,"同步处理:包件解托",warehouseId);
warehouseTrayTypeService.downPackageByOrderPackageCodeList(orderPackageCodes, "同步处理:包件解托", warehouseId);
}
FindParamterDTO findParamterDTO = new FindParamterDTO();
@ -1474,7 +1484,7 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
WarehouseTaryAllocationEntity taryAllocationEntity = warehouseTaryAllocationService.getOne(taryAllocationEntityQueryWrapper);
List<WarehouseUpdownGoodsEntity> updownGoodsEntities1 = map.get(allocationId);
List<String> orderPackageCodes = updownGoodsEntities1.stream().map(WarehouseUpdownGoodsEntity::getAssociationValue).collect(Collectors.toList());
if(!Objects.isNull(taryAllocationEntity)){
if (!Objects.isNull(taryAllocationEntity)) {
warehouseTrayTypeService.downPackageByOrderPackageCodeList(orderPackageCodes, remark, warehouseId);
}
WarehouseUpdownTypeEntity updownTypeEntity = updownTypeMap.get(allocationId);
@ -1494,14 +1504,14 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
deleteTrayAllocationList.add(taryAllocationEntity);
// warehouseTaryAllocationService.deleteById(taryAllocationEntity);
}
}else{
} else {
updateUpdownTypeList.add(updownTypeEntity);
}
List<DistributionParcelListEntity> parcelListEntities = new ArrayList<>();
orderPackageCodes.forEach(orderPackageCode -> {
DistributionParcelListEntity parcelListEntity = parcelListEntityMap.get(orderPackageCode);
if(!Objects.isNull(parcelListEntity)){
if (!Objects.isNull(parcelListEntity)) {
parcelListEntities.add(parcelListEntity);
}
});
@ -1540,8 +1550,12 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
});
removeByIds(toNullUpdownTypeIds);
basicdataGoodsAllocationClient.updateListAllocationStatus(updateAllocationIds,"1");
warehouseTaryAllocationService.removeBatchByIds(deleteTrayAllocationList);
if (!updateAllocationIds.isEmpty()) {
basicdataGoodsAllocationClient.updateListAllocationStatus(updateAllocationIds, "1");
}
if (!deleteTrayAllocationList.isEmpty()) {
warehouseTaryAllocationService.removeBatchByIds(deleteTrayAllocationList);
}
updateUpdownTypeList.forEach(this::updateUpdownTypeNum);
@ -1727,14 +1741,14 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
//有托盘,托盘下托
warehouseTrayTypeService.downPackageByOrderPackageCode(orderPackageCode, remark, warehouseId);
}
}else{
} else {
// 托盘存在上架
DistributionParcelListEntity parcelListEntity =parcelListEntitys.stream()
DistributionParcelListEntity parcelListEntity = parcelListEntitys.stream()
.filter(t -> t.getOrderPackageCode().equals(orderPackageCode))
.findFirst()
.orElse(null);
if(parcelListEntity==null){
log.info(">>>>>>>>>>>>>> 包条找不到 {} ",orderPackageCode);
if (parcelListEntity == null) {
log.info(">>>>>>>>>>>>>> 包条找不到 {} ", orderPackageCode);
continue;
}
@ -1780,7 +1794,7 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
// distributionStockArticleClient.updateOrderInfo(orderCode, warehouseId);
// }
List<String> orders = new ArrayList<>(orderSet);
if(orders.isEmpty()){
if (orders.isEmpty()) {
return Resp.scanSuccess("下架成功", "成功下架" + num + "件");
}
@ -1794,7 +1808,6 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
}
@Override
public R downZeroOrder(List<UpShelfZeroOrderDTO> upShelfPackageList, Long warehouseId, String remark) {
StringBuffer stringBuffer = new StringBuffer("下架零担订单成功");
@ -3092,7 +3105,6 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
}
private void updateUpdownTypeNum(WarehouseUpdownTypeEntity updownTypeEntity) {
Long updownTypeId = updownTypeEntity.getId();
Long warehouseId = updownTypeEntity.getWarehouseId();

Loading…
Cancel
Save