From 581f95c4e6ae8aafe8216df4f7970dad0d12dd65 Mon Sep 17 00:00:00 2001 From: liuy <37787198+LiuyCodes@users.noreply.github.com> Date: Fri, 8 Aug 2025 10:12:44 +0800 Subject: [PATCH] =?UTF-8?q?refactor(sales):=20=E9=87=8D=E6=9E=84=E5=94=AE?= =?UTF-8?q?=E5=90=8E=E8=AE=A2=E5=8D=95=E5=A4=84=E7=90=86=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 移除 TOB 和 TOC 售后订单中不必要的退款完成时间判断和设置 - 更新业务日期设置逻辑,使用交易成功时间作为业务日期 - 删除未使用的常量和方法 - 优化代码结构,提高可读性和维护性 --- .../plugin/lets/constant/OverallConstant.java | 12 ++++ .../sales/PassiveWarehouseReceiptToB.java | 63 ++++++++++--------- .../SoSaleReturnPluginInitializerToB.java | 8 ++- .../SoSaleReturnPluginInitializerToC.java | 16 ++--- 4 files changed, 59 insertions(+), 40 deletions(-) diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/constant/OverallConstant.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/constant/OverallConstant.java index f1a83daa..26d7a156 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/constant/OverallConstant.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/constant/OverallConstant.java @@ -152,6 +152,18 @@ public class OverallConstant { prodOverAll.put("u8c自定义项档案-单据红字标识-N主键", "0001A1100000000027LQ"); prodOverAll.put("u8c自定义项档案-单据红字标识-N名称", "N"); + prodOverAll.put("售后类型标识-TOC售后-主键", "0001A110000000ADSWMB"); + prodOverAll.put("售后类型标识-TOC售后-名称", "TOC售后"); + + prodOverAll.put("售后类型标识-TOC无源件-主键", "0001A110000000ADSWWJ"); + prodOverAll.put("售后类型标识-TOC无源件-名称", "TOC无源件"); + + prodOverAll.put("售后类型标识-TOB售后-主键", "0001A110000000AFFT7M"); + prodOverAll.put("售后类型标识-TOB售后-名称", "TOB售后"); + + prodOverAll.put("售后类型标识-TOB无源件-主键", "0001A110000000AFFT7R"); + prodOverAll.put("售后类型标识-TOB无源件-名称", "TOB无源件"); + //内网中台地址 prodOverAll.put("u8c_url", "http://127.0.0.1:8081/kangarooDataCenterV3/entranceController/externalCallInterface"); //外网中台地址 diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/sales/PassiveWarehouseReceiptToB.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/sales/PassiveWarehouseReceiptToB.java index 43cae188..b2c822be 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/sales/PassiveWarehouseReceiptToB.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/sales/PassiveWarehouseReceiptToB.java @@ -1320,9 +1320,12 @@ public class PassiveWarehouseReceiptToB extends PluginBaseEntity { Assert.notNull(ofsRertunOrder, "无法查询到OFS售后订单 单据编码:{}", header.getReturnOrderCode()); //2025-03-17 16:41:14 过滤掉不存在交易成功时间的无源入库单 // ofsRertunOrder.getHeader().setRefundedAt("2025-03-15 11:57:06"); - if (ofsRertunOrder.getHeader() == null || ofsRertunOrder.getHeader().getRefundedAt() == null || "".equals(ofsRertunOrder.getHeader().getRefundedAt().trim())) { - Assert.state(false, "当前无源入库单对应的售后订单没有退款完成时间!"); - } +// if (ofsRertunOrder.getHeader() == null || ofsRertunOrder.getHeader().getRefundedAt() == null || "".equals(ofsRertunOrder.getHeader().getRefundedAt().trim())) { +// Assert.state(false, "当前无源入库单对应的售后订单没有退款完成时间!"); +// } +// if (ofsRertunOrder.getHeader() == null) { +// Assert.state(false, "当前无源入库单对应的售后订单没有退款完成时间!"); +// } //查询OFS销售订单 SaleOrderMessageDto saleOrderMessageDto = null; @@ -2432,7 +2435,7 @@ public class PassiveWarehouseReceiptToB extends PluginBaseEntity { PassiveStorageResponse.Details details = sonDetailsDtoList.get(i); OfsPassiveorderDetailEntity ofsPassiveorderDetailEntity = new OfsPassiveorderDetailEntity(); ofsPassiveorderDetailEntity.setId(details.getId()); - ofsPassiveorderDetailEntity.setTransactionDate(details.getRefundedAt()); +// ofsPassiveorderDetailEntity.setTransactionDate(details.getRefundedAt()); ofsPassiveorderDetailEntity.setNewpushdate(getNewDateStr()); ofsPassiveorderDetailEntity.setNewtransmitinfo(finalNewTransmitInfo); ofsPassiveorderDetailEntity.setNewstate(newstate); @@ -2501,7 +2504,7 @@ public class PassiveWarehouseReceiptToB extends PluginBaseEntity { OfsPassiveorderDetailEntity ofsPassiveorderDetailEntity = new OfsPassiveorderDetailEntity(); ofsPassiveorderDetailEntity.setId(details.getId()); - ofsPassiveorderDetailEntity.setTransactionDate(details.getRefundedAt()); +// ofsPassiveorderDetailEntity.setTransactionDate(details.getRefundedAt()); ofsPassiveorderDetailEntity.setNewpushdate2(getNewDateStr()); ofsPassiveorderDetailEntity.setNewtransmitinfo2(finalNewTransmitInfo); ofsPassiveorderDetailEntity.setNewstate2(newstate); @@ -2575,7 +2578,7 @@ public class PassiveWarehouseReceiptToB extends PluginBaseEntity { OfsPassiveorderDetailEntity ofsPassiveorderDetailEntity = new OfsPassiveorderDetailEntity(); ofsPassiveorderDetailEntity.setId(details1.getId()); - ofsPassiveorderDetailEntity.setTransactionDate(details1.getRefundedAt()); +// ofsPassiveorderDetailEntity.setTransactionDate(details1.getRefundedAt()); if (sceneType.equals("stock")) { ofsPassiveorderDetailEntity.setNewpushdate(newPushDate); ofsPassiveorderDetailEntity.setNewtransmitinfo(newTransmitInfo); @@ -2863,28 +2866,28 @@ public class PassiveWarehouseReceiptToB extends PluginBaseEntity { * @param passiveStorageResponseDataList O无源件交易成功状态 * @throws Exception 跑出可能的异常 */ - private List filterAfterSalesOrder(List passiveStorageResponseDataList) throws Exception { - List filteredList = null; - if (passiveStorageResponseDataList != null && passiveStorageResponseDataList.size() > 0) { - filteredList = passiveStorageResponseDataList.stream().filter(stockinOrder -> { - PassiveStorageResponse.Header header = stockinOrder.getHeader(); - if (header == null) { - return false; - } - RerturnGoodsOrderSearchData returnData = header.getRerturnGoodsOrderSearchData(); - if (returnData == null) { - return false; - } - RerturnGoodsOrderSearchHeader header1 = returnData.getHeader(); - if (header1 == null) { - return false; - } - if (header1.getRefundedAt() == null) { - return false; - } - return true; - }).collect(Collectors.toList()); - } - return filteredList; - } +// private List filterAfterSalesOrder(List passiveStorageResponseDataList) throws Exception { +// List filteredList = null; +// if (passiveStorageResponseDataList != null && passiveStorageResponseDataList.size() > 0) { +// filteredList = passiveStorageResponseDataList.stream().filter(stockinOrder -> { +// PassiveStorageResponse.Header header = stockinOrder.getHeader(); +// if (header == null) { +// return false; +// } +// RerturnGoodsOrderSearchData returnData = header.getRerturnGoodsOrderSearchData(); +// if (returnData == null) { +// return false; +// } +// RerturnGoodsOrderSearchHeader header1 = returnData.getHeader(); +// if (header1 == null) { +// return false; +// } +// if (header1.getRefundedAt() == null) { +// return false; +// } +// return true; +// }).collect(Collectors.toList()); +// } +// return filteredList; +// } } \ No newline at end of file diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/sales/SoSaleReturnPluginInitializerToB.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/sales/SoSaleReturnPluginInitializerToB.java index fbbbf263..e04c5a26 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/sales/SoSaleReturnPluginInitializerToB.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/sales/SoSaleReturnPluginInitializerToB.java @@ -1816,9 +1816,9 @@ public class SoSaleReturnPluginInitializerToB extends PluginBaseEntity { tocofsReturngoodsDetailedEntity.setBusinessdate(returnGoodSearchHeaderDto.getClosedAt()); } //业务日期-退款完成时间 - if (returnGoodSearchHeaderDto.getRefundedAt() != null) { - tocofsReturngoodsDetailedEntity.setRefundedat(returnGoodSearchHeaderDto.getRefundedAt()); - } +// if (returnGoodSearchHeaderDto.getRefundedAt() != null) { +// tocofsReturngoodsDetailedEntity.setRefundedat(returnGoodSearchHeaderDto.getRefundedAt()); +// } //业务类型 tocofsReturngoodsDetailedEntity.setBusinesstype("TOB_RETURN"); } @@ -2051,6 +2051,8 @@ public class SoSaleReturnPluginInitializerToB extends PluginBaseEntity { /** * 2024年8月28日 17:17:33 * 生成业务日期,以交易成功时间作为业务日期 + * 2025年8月7日18:02:07 + * TOB退款完成生成发票业务已取消,这个方法实际不会被触发 * * @author liuyang */ diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/sales/SoSaleReturnPluginInitializerToC.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/sales/SoSaleReturnPluginInitializerToC.java index 5d50ce80..71c7839a 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/sales/SoSaleReturnPluginInitializerToC.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/sales/SoSaleReturnPluginInitializerToC.java @@ -396,14 +396,14 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity { } else if (ProfilesActiveConstant.PUSH_SCENE_TYPE_1.equals(pushScenarioType)) { TocofsReturngoodsDetailedEntity tocofsReturngoodsDetailedEntity = new TocofsReturngoodsDetailedEntity(); if (startTime.length() == 19) { - tocofsReturngoodsDetailedEntity.setRefundedAtStart(startTime); + tocofsReturngoodsDetailedEntity.setBusinessDateStart(startTime); } else { - tocofsReturngoodsDetailedEntity.setRefundedAtStart(startTime + " 00:00:00"); + tocofsReturngoodsDetailedEntity.setBusinessDateStart(startTime + " 00:00:00"); } if (endTime.length() == 19) { - tocofsReturngoodsDetailedEntity.setRefundedAtEnd(endTime); + tocofsReturngoodsDetailedEntity.setBusinessDateEnd(endTime); } else { - tocofsReturngoodsDetailedEntity.setRefundedAtEnd(endTime + " 23:59:59"); + tocofsReturngoodsDetailedEntity.setBusinessDateEnd(endTime + " 23:59:59"); } tocofsReturngoodsDetailedEntity.setBusinesstype("TOC_RETURN"); returnGoodHeaderDetailsDataDtoArrayList = queryTocofsReturngoodsDetailed(tocofsReturngoodsDetailedEntity); @@ -2234,9 +2234,11 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity { tocofsReturngoodsDetailedEntity.setBusinessdate(returnGoodSearchHeaderDto.getClosedAt()); } //业务日期-退款完成时间 - if (returnGoodSearchHeaderDto.getRefundedAt() != null) { - tocofsReturngoodsDetailedEntity.setRefundedat(returnGoodSearchHeaderDto.getRefundedAt()); - } + //2025年8月7日17:55:30 + //这个时间后续不需要了 +// if (returnGoodSearchHeaderDto.getRefundedAt() != null) { +// tocofsReturngoodsDetailedEntity.setRefundedat(returnGoodSearchHeaderDto.getRefundedAt()); +// } //业务类型 tocofsReturngoodsDetailedEntity.setBusinesstype("TOC_RETURN"); }