From f039da029ab83e9c7d8ac674dd40058675f684e6 Mon Sep 17 00:00:00 2001 From: zhaoqiaobo Date: Thu, 23 May 2024 15:23:29 +0800 Subject: [PATCH] =?UTF-8?q?feat(all):=20=E5=9B=9E=E9=80=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/AsyncDataServiceImpl.java | 147 +----------------- .../factory/jobhandler/FactoryXxlJob.java | 4 +- .../controller/MtFactoryDataController.java | 4 +- .../service/impl/OuPaiFactoryServiceImpl.java | 2 +- .../controller/PanFactoryDataController.java | 4 +- 5 files changed, 9 insertions(+), 152 deletions(-) diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/impl/AsyncDataServiceImpl.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/impl/AsyncDataServiceImpl.java index cf9c34ecd..75ec8e9f7 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/impl/AsyncDataServiceImpl.java +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/impl/AsyncDataServiceImpl.java @@ -770,9 +770,9 @@ public class AsyncDataServiceImpl implements IAsyncDataService { List factoryOrderEntities = factoryOrderService.lambdaQuery().eq(FactoryOrderEntity::getReceivingId, receivingOrderEntity.getId()).eq(FactoryOrderEntity::getTurnStatus, 0).list(); log.info(">>>>>>>>>>>>>>>>>>>>>handlerOuPaiDataToHt 派车单 {} 派车单下面订单集合长度 {}", receivingOrderEntity.getCode(), factoryOrderEntities.size()); -// addAdvanceEntityBtOuPai(receivingOrderEntity, factoryOrderEntities); + addAdvanceEntityBtOuPai(receivingOrderEntity, factoryOrderEntities); // TODO 走新系统暂存单,暂时不写后面再写 - addAdvanceEntityBtOuPaiNew(receivingOrderEntity, factoryOrderEntities); +// addAdvanceEntityBtOuPaiNew(receivingOrderEntity, factoryOrderEntities); receivingOrderEntity.setTurnStatus(1); log.info(">>>>>>>>>>>>>>>>>>>>>handlerOuPaiDataToHt 更新收货单状态 收货单号 {}", receivingOrderEntity.getCode()); receivingOrderService.updateById(receivingOrderEntity); @@ -881,149 +881,6 @@ public class AsyncDataServiceImpl implements IAsyncDataService { } - private void addAdvanceEntityBtOuPaiNew(ReceivingOrderEntity receivingOrderEntity, List factoryOrderEntities) { - log.info(">>>>>>>>>>>>>>>>>>>>>>>>>>> addAdvanceEntityBtOuPai 派车单数据推送到新系统,更新物料信息 单号{}", receivingOrderEntity.getCode()); - String carNumber = receivingOrderEntity.getCarNumber(); - // 欧派只更新物料信息 不管暂存单信息 - String fromWarehouseName = receivingOrderEntity.getFromWarehouseName(); - // 只处理 已配置的基地的数据 其他基地无法确认,暂时不处理 - Long startWarehouseId = null; - String startWarehouseName = null; - String tenantId = null; - // 获取工厂基地绑定的始发仓信息 - R warehouseByBrandAndSiteName = factoryDataBaseClient.getWarehouseByBrandAndSiteName(BrandEnums.OP.getValue(), fromWarehouseName); - if (cn.hutool.core.util.ObjectUtil.equal(HttpConstants.HTTP.HTTP_RESOURCE_CODE.SUCCESS_CODE, warehouseByBrandAndSiteName.getCode())) { - FactoryWarehouseBindVO data = warehouseByBrandAndSiteName.getData(); - if (cn.hutool.core.util.ObjectUtil.isNotNull(data)) { - startWarehouseId = data.getWarehouseId(); - startWarehouseName = data.getWarehouseName(); - tenantId = data.getTenantId(); - } - } - if (cn.hutool.core.util.ObjectUtil.isAllNotEmpty(startWarehouseId, startWarehouseName, tenantId)) { - // 订单 - List advances = new ArrayList<>(); - for (FactoryOrderEntity factoryOrderEntity : factoryOrderEntities) { - factoryOrderEntity.setTurnStatus(1); - - TrunklineAdvanceEntity advanceEntity = new TrunklineAdvanceEntity(); - advanceEntity.setTenantId(tenantId); - advanceEntity.setStatus(0); - advanceEntity.setIsDeleted(0); - advanceEntity.setOrderType(factoryOrderEntity.getOrderType()); - advanceEntity.setBrand(BrandEnums.OP.getValue()); - advanceEntity.setSiteName(fromWarehouseName); - advanceEntity.setArea(""); - advanceEntity.setPackName(""); - advanceEntity.setPackCode(""); - advanceEntity.setWarehouseId(startWarehouseId); - advanceEntity.setWarehouseName(startWarehouseName); - advanceEntity.setIsGcp(0); - advanceEntity.setCarrierName("汇通物流"); - advanceEntity.setSystemType("线上"); - advanceEntity.setMatingType("1"); - advanceEntity.setWaybillStatus("0"); - advanceEntity.setWaybillNo(""); - advanceEntity.setTrainNumber(receivingOrderEntity.getCarNumber()); - advanceEntity.setFreezeStatus("0"); - - advanceEntity.setSenderFactory(""); - advanceEntity.setOrderCode(factoryOrderEntity.getSelfCode()); - advanceEntity.setDealerCode(factoryOrderEntity.getShopCode()); - advanceEntity.setDealerName(factoryOrderEntity.getShopName()); - advanceEntity.setStoreCode(factoryOrderEntity.getShopCode()); - advanceEntity.setStoreName(factoryOrderEntity.getShopName()); - advanceEntity.setServiceNum(factoryOrderEntity.getServiceNumber()); - advanceEntity.setCustomerName(factoryOrderEntity.getCustomer()); - advanceEntity.setCustomerPhone(factoryOrderEntity.getCustomerPhone()); - advanceEntity.setCustomerAddress(factoryOrderEntity.getCustomerAddress()); - advanceEntity.setConsigneePerson(factoryOrderEntity.getShopReceiver()); - // 处理订单下面的包件数据 - List list = factoryPackageService.lambdaQuery() - .eq(FactoryPackageEntity::getOrderId, factoryOrderEntity.getId()).eq(FactoryPackageEntity::getTurnStatus, 0).list(); - advanceEntity.setHasPackage(CollUtil.isNotEmpty(list) ? 1 : 0); - advanceEntity.setTotalNum(CollUtil.isNotEmpty(list) ? list.size() : 0); - List packageList = new ArrayList<>(); - for (FactoryPackageEntity factoryPackageEntity : list) { - TrunklineAdvanceDetailEntity advanceDetailEntity = new TrunklineAdvanceDetailEntity(); - advanceDetailEntity.setWarehouseId(startWarehouseId); - advanceDetailEntity.setWarehouseName(startWarehouseName); - advanceDetailEntity.setOrderCode(factoryOrderEntity.getSelfCode()); - advanceDetailEntity.setBrand(BrandEnums.OP.getValue()); - advanceDetailEntity.setSystemType("线上"); - advanceDetailEntity.setFirstPackName(factoryPackageEntity.getFirstClassName()); - advanceDetailEntity.setFirstPackCode(factoryPackageEntity.getFirstClassCode()); - advanceDetailEntity.setSecondPackName(factoryPackageEntity.getSecondClassName());//二级品类名称 - advanceDetailEntity.setSecondPackCode(factoryPackageEntity.getSecondClassCode());//二级品类 - advanceDetailEntity.setThirdPackName(factoryPackageEntity.getThirdClassName());//三级品类名称 - advanceDetailEntity.setThirdPackCode(factoryPackageEntity.getThirdClassCode());//三级品类 - advanceDetailEntity.setMaterialName(factoryPackageEntity.getPackageDetailNames()); - advanceDetailEntity.setSiteName(fromWarehouseName); - advanceDetailEntity.setSiteCode(""); - advanceDetailEntity.setQuantity(1); - advanceDetailEntity.setOrderPackageCode(factoryPackageEntity.getCode()); - advanceDetailEntity.setTrainNumber(receivingOrderEntity.getCarNumber()); - advanceDetailEntity.setServiceNum(factoryOrderEntity.getServiceNumber()); - advanceDetailEntity.setWaybillNo(""); - advanceDetailEntity.setPackageStatus("0"); - advanceDetailEntity.setWeight(factoryPackageEntity.getWeight()); - if (cn.hutool.core.util.ObjectUtil.isAllNotEmpty(factoryPackageEntity.getHeight(), factoryPackageEntity.getWidth(), factoryPackageEntity.getLength())) { - advanceDetailEntity.setVolume(factoryPackageEntity.getHeight().multiply(factoryPackageEntity.getWidth()).multiply(factoryPackageEntity.getLength())); - } - advanceDetailEntity.setSupple(""); - advanceDetailEntity.setManifest(""); - advanceDetailEntity.setReturnNum(""); - advanceDetailEntity.setSendDateStr(DateUtil.formatLocalDateTime(LocalDateTime.now())); - advanceDetailEntity.setCarNumber(""); - advanceDetailEntity.setGoodsMan(""); - advanceDetailEntity.setTenantId(tenantId); - advanceDetailEntity.setStatus(0); - advanceDetailEntity.setIsDeleted(0); - // 物料 - List factoryPackageDetailEntities = factoryPackageDetailService.lambdaQuery() - .eq(FactoryPackageDetailEntity::getPackageId, factoryPackageEntity.getId()).list(); - List itemJsons = new ArrayList<>(); - if (CollUtil.isNotEmpty(factoryPackageDetailEntities)) { - for (FactoryPackageDetailEntity factoryPackageDetailEntity : factoryPackageDetailEntities) { - if(cn.hutool.core.util.ObjectUtil.equal(factoryPackageEntity.getPackageDetailNames(),factoryPackageDetailEntity.getName())){ - advanceDetailEntity.setMaterialCode(factoryPackageDetailEntity.getCode()); - } - TrunklineDetailProductEntity detailProductEntity = new TrunklineDetailProductEntity(); - detailProductEntity.setTenantId(tenantId); - detailProductEntity.setWarehouseId(startWarehouseId); - detailProductEntity.setWarehouseName(startWarehouseName); - detailProductEntity.setUnitNo(factoryPackageEntity.getCode()); - detailProductEntity.setProductCode(factoryPackageDetailEntity.getCode()); - detailProductEntity.setProductName(factoryPackageDetailEntity.getName()); - detailProductEntity.setReserve1(factoryPackageDetailEntity.getType()); - detailProductEntity.setReserve2(factoryPackageDetailEntity.getUnit()); - detailProductEntity.setQuantity(1); - detailProductEntity.setStatus(0); - detailProductEntity.setIsDeleted(0); - itemJsons.add(JSONUtil.parseObj(detailProductEntity)); - } - } - JSONObject entries = JSONUtil.parseObj(advanceDetailEntity); - entries.set("items", itemJsons); - packageList.add(entries); - } - JSONObject entries = JSONUtil.parseObj(advanceEntity); - entries.set("details", JSONUtil.toJsonStr(packageList)); - advances.add(entries); - } - factoryOrderService.updateBatchById(factoryOrderEntities); - // 发送消息 - if (CollUtil.isNotEmpty(advances)) { - for (JSONObject advance : advances) { - SendMsg sendMsg = SendMsg.builder().exchange(FactoryDataConstants.Mq.Exchanges.ADVANCE_ORDER_OUPAI) - .routingKey(FactoryDataConstants.Mq.RoutingKeys.ADVANCE_ORDER).message(JSONUtil.toJsonStr(advance)).build(); - factoryDataClient.sendMessage(sendMsg); - } - } - } - - } - /** * 保存包件数据-- 欧派 * diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/jobhandler/FactoryXxlJob.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/jobhandler/FactoryXxlJob.java index c4bc88834..a3b5ed937 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/jobhandler/FactoryXxlJob.java +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/jobhandler/FactoryXxlJob.java @@ -194,9 +194,9 @@ public class FactoryXxlJob { }); // 调用接口写入到老系统的数据库 -// resoveFactoryData(); + resoveFactoryData(); // 走新系统暂存单 - resoveFactoryDataNew(); +// resoveFactoryDataNew(); return ReturnT.SUCCESS; } diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/controller/MtFactoryDataController.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/controller/MtFactoryDataController.java index 9f7f16d41..24963ea7c 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/controller/MtFactoryDataController.java +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/controller/MtFactoryDataController.java @@ -91,9 +91,9 @@ public class MtFactoryDataController extends BladeController { orderStatusLog.setStatus(0); //开启异步线程处理数据 if (!Objects.isNull(mainId)) { -// asyncDataService.handlerMtDataToHt(map.get("mainId")); + asyncDataService.handlerMtDataToHt(map.get("mainId")); // 走新系统暂存单 - asyncDataService.handlerMtDataToHtNew(map.get("mainId")); +// asyncDataService.handlerMtDataToHtNew(map.get("mainId")); } } else { orderStatusLog.setStatus(2); diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/service/impl/OuPaiFactoryServiceImpl.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/service/impl/OuPaiFactoryServiceImpl.java index 6da9a880d..674a74f4a 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/service/impl/OuPaiFactoryServiceImpl.java +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/service/impl/OuPaiFactoryServiceImpl.java @@ -111,7 +111,7 @@ public class OuPaiFactoryServiceImpl implements IOuPaiFactoryService { handleData(code); if (ObjectUtils.isNotNull(code)) { // 暂停推送 - asyncDataService.handlerOuPaiDataToHt(code); +// asyncDataService.handlerOuPaiDataToHt(code); } return code; diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/controller/PanFactoryDataController.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/controller/PanFactoryDataController.java index 510f5f9df..0839dad5c 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/controller/PanFactoryDataController.java +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/controller/PanFactoryDataController.java @@ -124,9 +124,9 @@ public class PanFactoryDataController extends BladeController { //开启异步线程处理数据 if(!Objects.isNull(orderId)){ -// syncDataService.handlerPanDataToHt(orderId); + syncDataService.handlerPanDataToHt(orderId); // 走新系统暂存单 - syncDataService.handlerPanDataToHtNew(orderId); +// syncDataService.handlerPanDataToHtNew(orderId); }