diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/outsourc/ConsignmachiningIn.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/outsourc/ConsignmachiningIn.java index 60b03825..3d30a070 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/outsourc/ConsignmachiningIn.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/outsourc/ConsignmachiningIn.java @@ -765,19 +765,19 @@ public class ConsignmachiningIn extends PluginBaseEntity { * @author liuyang */ private String createGenerateBusinessDateV2(StockinOrderSearchResponse.StockinOrder.StockinH header) { - if (header != null) { - String shipAt = header.getShipAt(); + if (header != null && header.getClosedAt() != null) { + String closedAt = header.getClosedAt(); String businessFormat = null; try { - Date dbill = DateUtil.parse(shipAt); + Date dbill = DateUtil.parse(closedAt); businessFormat = DateUtil.format(dbill, "yyyy-MM-dd"); } catch (Exception e) { logger.error("业务日期生成失败", e); } return businessFormat; } else { - logger.error("生成业务日期失败,或者shipAt为空! json:{}", JSON.toJSON(header)); - Assert.state(false, "生成业务日期失败,或者shipAt为空! json:{}", JSON.toJSON(header)); + logger.error("closedAt为空! json:{}", JSON.toJSON(header)); + Assert.state(false, "closedAt为空! json:{}", JSON.toJSON(header)); return null; } } diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/outsourc/ConsignmachiningInReturn.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/outsourc/ConsignmachiningInReturn.java index 76df8c8a..12a14091 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/outsourc/ConsignmachiningInReturn.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/outsourc/ConsignmachiningInReturn.java @@ -840,8 +840,8 @@ public class ConsignmachiningInReturn extends PluginBaseEntity { } return businessFormat; } else { - logger.error("生成采退出库日期失败,或者shipAt为空! json:{}", JSON.toJSON(returnOrderHeaderDto)); - Assert.state(false, "生成采退出库日期失败,或者shipAt为空! json:{}", JSON.toJSON(returnOrderHeaderDto)); + logger.error("shipAt为空! json:{}", JSON.toJSON(returnOrderHeaderDto)); + Assert.state(false, "shipAt为空! json:{}", JSON.toJSON(returnOrderHeaderDto)); return null; } } diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/purchase/ProxyPurchaseReturn.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/purchase/ProxyPurchaseReturn.java index 92829bc8..e0390b15 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/purchase/ProxyPurchaseReturn.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/purchase/ProxyPurchaseReturn.java @@ -734,8 +734,8 @@ public class ProxyPurchaseReturn extends PluginBaseEntity { } return businessFormat; } else { - logger.error("生成采退出库日期失败,或者shipAt为空! json:{}", JSON.toJSON(poOrderSonDto)); - Assert.state(false, "生成采退出库日期失败,或者shipAt为空! json:{}", JSON.toJSON(poOrderSonDto)); + logger.error("shipAt为空! json:{}", JSON.toJSON(poOrderSonDto)); + Assert.state(false, "shipAt为空! json:{}", JSON.toJSON(poOrderSonDto)); return null; } } diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/purchase/ProxyPurchaseWarehousWarehouse.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/purchase/ProxyPurchaseWarehousWarehouse.java index 10856c77..d98e336a 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/purchase/ProxyPurchaseWarehousWarehouse.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/purchase/ProxyPurchaseWarehousWarehouse.java @@ -231,8 +231,7 @@ public class ProxyPurchaseWarehousWarehouse extends PluginBaseEntity { queryOfsSoSaleOutVo.setPageSize(50L); queryOfsSoSaleOutVo.setCode(code); queryOfsSoSaleOutVo.setInternalInstructionType("PURCHASE"); - //TODO 测试 -// queryOfsSoSaleOutVo.setStatus(900L); + queryOfsSoSaleOutVo.setStatus(900L); ofsStandardUtil.queryOfsReturnGoods(queryOfsSoSaleOutVo, returnGoodHeaderDetailsDataDtoArrayList, 1L, "ofs.receipt.search"); logger.info("数据返回行数:{}", returnGoodHeaderDetailsDataDtoArrayList.size()); if (returnGoodHeaderDetailsDataDtoArrayList.size() > 0) { @@ -766,8 +765,8 @@ public class ProxyPurchaseWarehousWarehouse extends PluginBaseEntity { * @author liuyang */ private String createGenerateBusinessDate(PoOrderSonDto poOrderSonDto) { - if (poOrderSonDto != null && poOrderSonDto.getCheckInTo() != null) { - String checkInTo = poOrderSonDto.getCheckInTo(); + if (poOrderSonDto != null && poOrderSonDto.getClosedAt() != null) { + String checkInTo = poOrderSonDto.getClosedAt(); String businessFormat = null; try { Date dbill = DateUtil.parse(checkInTo); @@ -777,8 +776,8 @@ public class ProxyPurchaseWarehousWarehouse extends PluginBaseEntity { } return businessFormat; } else { - logger.error("生成采购订单入库日期失败,或者shipAt为空! json:{}", JSON.toJSON(poOrderSonDto)); - Assert.state(false, "生成采购订单入库日期失败,或者shipAt为空! json:{}", JSON.toJSON(poOrderSonDto)); + logger.error("closedAt为空! json:{}", JSON.toJSON(poOrderSonDto)); + Assert.state(false, "closedAt为空! json:{}", JSON.toJSON(poOrderSonDto)); return null; } } 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 4f04129e..ab66a1cd 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 @@ -854,20 +854,20 @@ public class SoSaleReturnPluginInitializerToB extends PluginBaseEntity { * @author liuyang */ private String createGenerateBusinessDate(OrderToBHeaderDto orderOutTobHeaderDto) { - if (orderOutTobHeaderDto != null && orderOutTobHeaderDto.getHeader() != null && orderOutTobHeaderDto.getHeader().getCheckInFrom() != null) { + if (orderOutTobHeaderDto != null && orderOutTobHeaderDto.getHeader() != null && orderOutTobHeaderDto.getHeader().getClosedAt() != null) { StockinOrderSearchResponse.StockinOrder.StockinH header = orderOutTobHeaderDto.getHeader(); - String checkInFrom = header.getCheckInFrom(); + String closedAt = header.getClosedAt(); String businessFormat = null; try { - Date dbill = DateUtil.parse(checkInFrom); + Date dbill = DateUtil.parse(closedAt); businessFormat = DateUtil.format(dbill, "yyyy-MM-dd"); } catch (Exception e) { logger.error("业务日期生成失败", e); } return businessFormat; } else { - logger.error("生成出库日期失败,或者checkInFrom为空! json:{}", JSON.toJSON(orderOutTobHeaderDto)); - Assert.state(false, "生成出库日期失败,或者checkInFrom为空! json:{}", JSON.toJSON(orderOutTobHeaderDto)); + logger.error("生成出库日期失败,或者closedAt为空! json:{}", JSON.toJSON(orderOutTobHeaderDto)); + Assert.state(false, "生成出库日期失败,或者closedAt为空! json:{}", JSON.toJSON(orderOutTobHeaderDto)); return null; } } @@ -1610,8 +1610,8 @@ public class SoSaleReturnPluginInitializerToB extends PluginBaseEntity { tocofsReturngoodsDetailedEntity.setMaintableid(returnGoodSearchHeaderDto.getId()); } //业务日期-入库时间 - if (returnGoodSearchHeaderDto.getCheckInFrom() != null) { - tocofsReturngoodsDetailedEntity.setBusinessdate(returnGoodSearchHeaderDto.getCheckInFrom()); + if (returnGoodSearchHeaderDto.getClosedAt() != null) { + tocofsReturngoodsDetailedEntity.setBusinessdate(returnGoodSearchHeaderDto.getClosedAt()); } //业务日期-退款完成时间 if (returnGoodSearchHeaderDto.getRefundedAt() != null) { 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 a1f25ab0..021780a8 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 @@ -785,7 +785,7 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity { try { // checkArchives(oldValue.get(0)); //生成业务日期 - String generateBusinessDate = createGenerateBusinessDate(header); + String generateBusinessDate = createSuccessFulTradeDate(header); SaleorderRequestDto saleorderRequestDto = new SaleorderRequestDto(); SaleorderRequestParentDto saleorderRequestParentDto = new SaleorderRequestParentDto(); @@ -927,12 +927,12 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity { * @author liuyang */ private String createGenerateBusinessDate(StockinOrderSearchResponse.StockinOrder.StockinH header) { - if (header != null && header.getCheckInTo() != null) { + if (header != null && header.getClosedAt() != null) { //TOC以出库日期作为业务日期 - String checkInTo = header.getCheckInTo(); + String closedAt = header.getClosedAt(); String businessFormat = null; try { - Date dbill = DateUtil.parse(checkInTo); + Date dbill = DateUtil.parse(closedAt); businessFormat = DateUtil.format(dbill, "yyyy-MM-dd"); } catch (Exception e) { e.printStackTrace(); @@ -940,8 +940,34 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity { } return businessFormat; } else { - logger.error("生成入库日期失败,或者checkInTo为空! json:{}", JSON.toJSON(header)); - Assert.state(false, "生成入库日期失败,或者checkInTo为空! json:{}", JSON.toJSON(header)); + logger.error("closedAt为空! json:{}", JSON.toJSON(header)); + Assert.state(false, "closedAt为空! json:{}", JSON.toJSON(header)); + return null; + } + } + + /** + * 2024年8月28日 17:17:33 + * 生成业务日期,以交易成功时间作为业务日期 + * + * @author liuyang + */ + private String createSuccessFulTradeDate(StockinOrderSearchResponse.StockinOrder.StockinH stockinH) { + if (stockinH != null && stockinH.getRefundedAt() != null) { +// StockinOrderSearchResponse.StockinOrder.StockinH header = orderOutTobHeaderDto.getHeader(); + String refundedAt = stockinH.getRefundedAt(); + String businessFormat = null; + try { + Date dbill = DateUtil.parse(refundedAt); + businessFormat = DateUtil.format(dbill, "yyyy-MM-dd"); + } catch (Exception e) { + logger.error("refundedAt业务日期生成失败", e); + Assert.state(false, "refundedAt业务日期生成失败不能为空"); + } + return businessFormat; + } else { + logger.error("生成出库日期失败,或者refundedAt为空! json:{}", JSON.toJSON(stockinH)); + Assert.state(false, "生成出库日期失败,或者refundedAt为空! json:{}", JSON.toJSON(stockinH)); return null; } } @@ -1451,8 +1477,8 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity { tocofsReturngoodsDetailedEntity.setMaintableid(returnGoodSearchHeaderDto.getId()); } //业务日期-入库时间 - if (returnGoodSearchHeaderDto.getCheckInFrom() != null) { - tocofsReturngoodsDetailedEntity.setBusinessdate(returnGoodSearchHeaderDto.getCheckInFrom()); + if (returnGoodSearchHeaderDto.getClosedAt() != null) { + tocofsReturngoodsDetailedEntity.setBusinessdate(returnGoodSearchHeaderDto.getClosedAt()); } //业务日期-退款完成时间 if (returnGoodSearchHeaderDto.getRefundedAt() != null) {