diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/sales/SoSaleOutPluginInitializerToB.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/sales/SoSaleOutPluginInitializerToB.java index 20336621..bb03dcad 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/sales/SoSaleOutPluginInitializerToB.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/sales/SoSaleOutPluginInitializerToB.java @@ -236,39 +236,43 @@ public class SoSaleOutPluginInitializerToB extends PluginBaseEntity { * @author liuyang */ public void startImplementByStockTime(String startTime, String endTime) throws Exception { - long startMillis = System.currentTimeMillis(); - String threadNameStr = StrUtil.format("OFS销售出库(TOB)同步U8C销售订单开始 同步日期:{} 汇总维度:{}", startTime, endTime); - logger.info(threadNameStr); + try { + long startMillis = System.currentTimeMillis(); + String threadNameStr = StrUtil.format("OFS销售出库(TOB)同步U8C销售订单开始 同步日期:{} 汇总维度:{}", startTime, endTime); + logger.info(threadNameStr); - Assert.notNull(startTime, "出库开始时间不能为空"); - Assert.notNull(endTime, "出库结束时间不能为空"); + Assert.notNull(startTime, "出库开始时间不能为空"); + Assert.notNull(endTime, "出库结束时间不能为空"); // CalculateDateVo calculateDateVo = DateStrUtil.calculateCalculateEntireDayPeriod(dateStr); - String tobShop = shopTobOrToCUtil.getCommaShop("TOB"); + String tobShop = shopTobOrToCUtil.getCommaShop("TOB"); - List headerDetailsDtoList = new ArrayList<>(); - QueryOfsSoSaleOutVo queryOfsSoSaleOutVo = new QueryOfsSoSaleOutVo(); - queryOfsSoSaleOutVo.setShipAt_start(startTime); - queryOfsSoSaleOutVo.setShipAt_end(endTime); - queryOfsSoSaleOutVo.setClientCode("LETS"); - queryOfsSoSaleOutVo.setInternalInstructionType("SALES"); + List headerDetailsDtoList = new ArrayList<>(); + QueryOfsSoSaleOutVo queryOfsSoSaleOutVo = new QueryOfsSoSaleOutVo(); + queryOfsSoSaleOutVo.setShipAt_start(startTime); + queryOfsSoSaleOutVo.setShipAt_end(endTime); + queryOfsSoSaleOutVo.setClientCode("LETS"); + queryOfsSoSaleOutVo.setInternalInstructionType("SALES"); // queryOfsSoSaleOutVo.setCompanyCode("SHLZ"); - queryOfsSoSaleOutVo.setStatus(900L); - queryOfsSoSaleOutVo.setPageNo(1L); - queryOfsSoSaleOutVo.setPageSize(50L); - queryOfsSoSaleOutVo.setStoreCode(tobShop); + queryOfsSoSaleOutVo.setStatus(900L); + queryOfsSoSaleOutVo.setPageNo(1L); + queryOfsSoSaleOutVo.setPageSize(50L); + queryOfsSoSaleOutVo.setStoreCode(tobShop); // queryOfsSoSaleOutVo.setCode("LETS-SH2024010200000004"); - ofsStandardUtil.queryOfsSaleOrder(queryOfsSoSaleOutVo, headerDetailsDtoList, 1L, "ofs.shipment.search"); - logger.info("插件:{} (库存)O接口返回行数:{} 时间段:{} {}", getPluginName(), headerDetailsDtoList.size(), startTime, endTime); - if (headerDetailsDtoList.size() > 0) { - getSetStock(headerDetailsDtoList); - } else { - logger.info("没有查询到任何数据!不需要同步"); - } + ofsStandardUtil.queryOfsSaleOrder(queryOfsSoSaleOutVo, headerDetailsDtoList, 1L, "ofs.shipment.search"); + logger.info("插件:{} (库存)O接口返回行数:{} 时间段:{} {}", getPluginName(), headerDetailsDtoList.size(), startTime, endTime); + if (headerDetailsDtoList.size() > 0) { + getSetStock(headerDetailsDtoList); + } else { + logger.info("没有查询到任何数据!不需要同步"); + } - long endMillis = System.currentTimeMillis(); - String threadNameEnd = StrUtil.format("OFS销售出库(TOB)同步U8C销售订单结束 同步日期:{} 汇总维度:{} 耗时:{}", startTime, endTime, (endMillis - startMillis)); - logger.info(threadNameEnd); + long endMillis = System.currentTimeMillis(); + String threadNameEnd = StrUtil.format("OFS销售出库(TOB)同步U8C销售订单结束 同步日期:{} 汇总维度:{} 耗时:{}", startTime, endTime, (endMillis - startMillis)); + logger.info(threadNameEnd); + } catch (Exception e) { + logger.error("startImplementByStockTime方法抛出异常", e); + } } /** @@ -277,39 +281,43 @@ public class SoSaleOutPluginInitializerToB extends PluginBaseEntity { * @author liuyang */ public void startImplementByTranTime(String startTime, String endTime) throws Exception { - long startMillis = System.currentTimeMillis(); - String threadNameStrStart = StrUtil.format("OFS销售出库(TOB交易成功)同步U8C销售发票开始 开始时间:{} 结束时间:{}", startTime, endTime); - logger.info(threadNameStrStart); + try { + long startMillis = System.currentTimeMillis(); + String threadNameStrStart = StrUtil.format("OFS销售出库(TOB交易成功)同步U8C销售发票开始 开始时间:{} 结束时间:{}", startTime, endTime); + logger.info(threadNameStrStart); - Assert.notNull(startTime, "交易开始时间不能为空"); - Assert.notNull(endTime, "交易结束时间不能为空"); + Assert.notNull(startTime, "交易开始时间不能为空"); + Assert.notNull(endTime, "交易结束时间不能为空"); - String tobShop = shopTobOrToCUtil.getCommaShop("TOB"); + String tobShop = shopTobOrToCUtil.getCommaShop("TOB"); - List headerDetailsDtoList = new ArrayList<>(); - QueryOfsSoSaleOutVo queryOfsSoSaleOutVo = new QueryOfsSoSaleOutVo(); + List headerDetailsDtoList = new ArrayList<>(); + QueryOfsSoSaleOutVo queryOfsSoSaleOutVo = new QueryOfsSoSaleOutVo(); // queryOfsSoSaleOutVo.setShipAt_start(startTime); // queryOfsSoSaleOutVo.setShipAt_end(endTime); - queryOfsSoSaleOutVo.setTradeSuccessAt_start(startTime); - queryOfsSoSaleOutVo.setTradeSuccessAt_end(endTime); - queryOfsSoSaleOutVo.setClientCode("LETS"); - queryOfsSoSaleOutVo.setInternalInstructionType("SALES"); - queryOfsSoSaleOutVo.setSourceOrderStatus("TRADE_FINISHED");//交易成功状态 + queryOfsSoSaleOutVo.setTradeSuccessAt_start(startTime); + queryOfsSoSaleOutVo.setTradeSuccessAt_end(endTime); + queryOfsSoSaleOutVo.setClientCode("LETS"); + queryOfsSoSaleOutVo.setInternalInstructionType("SALES"); + queryOfsSoSaleOutVo.setSourceOrderStatus("TRADE_FINISHED");//交易成功状态 // queryOfsSoSaleOutVo.setStatus(900L); - queryOfsSoSaleOutVo.setPageNo(1L); - queryOfsSoSaleOutVo.setPageSize(50L); - queryOfsSoSaleOutVo.setStoreCode(tobShop); - ofsStandardUtil.queryOfsSaleOrder(queryOfsSoSaleOutVo, headerDetailsDtoList, 1L, "ofs.shipment.search"); - logger.info("插件:{} (确认收入)O接口返回行数:{} 时间段:{} {}", getPluginName(), headerDetailsDtoList.size(), startTime, endTime); - if (headerDetailsDtoList.size() > 0) { - getSetStockTran(headerDetailsDtoList); - } else { - logger.info("没有查询到任何数据!不需要同步"); - } + queryOfsSoSaleOutVo.setPageNo(1L); + queryOfsSoSaleOutVo.setPageSize(50L); + queryOfsSoSaleOutVo.setStoreCode(tobShop); + ofsStandardUtil.queryOfsSaleOrder(queryOfsSoSaleOutVo, headerDetailsDtoList, 1L, "ofs.shipment.search"); + logger.info("插件:{} (确认收入)O接口返回行数:{} 时间段:{} {}", getPluginName(), headerDetailsDtoList.size(), startTime, endTime); + if (headerDetailsDtoList.size() > 0) { + getSetStockTran(headerDetailsDtoList); + } else { + logger.info("没有查询到任何数据!不需要同步"); + } - long endMillis = System.currentTimeMillis(); - String threadNameStrEnd = StrUtil.format("OFS销售出库(TOB交易成功)同步U8C销售发票结束 开始时间:{} 结束时间:{} 耗时:{}", startTime, endTime, (endMillis - startMillis)); - logger.info(threadNameStrEnd); + long endMillis = System.currentTimeMillis(); + String threadNameStrEnd = StrUtil.format("OFS销售出库(TOB交易成功)同步U8C销售发票结束 开始时间:{} 结束时间:{} 耗时:{}", startTime, endTime, (endMillis - startMillis)); + logger.info(threadNameStrEnd); + } catch (Exception e) { + logger.error("startImplementByTranTime方法不能为空", e); + } } /** @@ -318,39 +326,43 @@ public class SoSaleOutPluginInitializerToB extends PluginBaseEntity { * @author liuyang */ public void startImplementByCode(String code, String sceneType) throws Exception { - long startMillis = System.currentTimeMillis(); - String threadNameStrStart = StrUtil.format("OFS销售出库(TOB)同步U8C销售订单开始 出库单单号:{}", code); - logger.info(threadNameStrStart); + try { + long startMillis = System.currentTimeMillis(); + String threadNameStrStart = StrUtil.format("OFS销售出库(TOB)同步U8C销售订单开始 出库单单号:{}", code); + logger.info(threadNameStrStart); - Assert.notNull(code, "出库单单不能为空"); - String tobShop = shopTobOrToCUtil.getCommaShop("TOB"); - logger.info("TOB-OFS店铺编码:{}", tobShop); + Assert.notNull(code, "出库单单不能为空"); + String tobShop = shopTobOrToCUtil.getCommaShop("TOB"); + logger.info("TOB-OFS店铺编码:{}", tobShop); - List headerDetailsDtoList = new ArrayList<>(); - QueryOfsSoSaleOutVo queryOfsSoSaleOutVo = new QueryOfsSoSaleOutVo(); - queryOfsSoSaleOutVo.setClientCode("LETS"); - queryOfsSoSaleOutVo.setInternalInstructionType("SALES"); - //2024年8月30日 10:41:55 如果按编码查询,是否应该考虑仅查询已发货的数据? - queryOfsSoSaleOutVo.setStatus(900L); - queryOfsSoSaleOutVo.setPageNo(1L); - queryOfsSoSaleOutVo.setPageSize(50L); - queryOfsSoSaleOutVo.setStoreCode(tobShop); - queryOfsSoSaleOutVo.setCode(code); - ofsStandardUtil.queryOfsSaleOrder(queryOfsSoSaleOutVo, headerDetailsDtoList, 1L, "ofs.shipment.search"); - logger.info("根据单据号查询:数据返回行数:{}", headerDetailsDtoList.size()); - if (headerDetailsDtoList.size() > 0) { - if (sceneType.equals("stock")) { - getSetStock(headerDetailsDtoList); - } else if (sceneType.equals("tran")) { - getSetStockTran(headerDetailsDtoList); + List headerDetailsDtoList = new ArrayList<>(); + QueryOfsSoSaleOutVo queryOfsSoSaleOutVo = new QueryOfsSoSaleOutVo(); + queryOfsSoSaleOutVo.setClientCode("LETS"); + queryOfsSoSaleOutVo.setInternalInstructionType("SALES"); + //2024年8月30日 10:41:55 如果按编码查询,是否应该考虑仅查询已发货的数据? + queryOfsSoSaleOutVo.setStatus(900L); + queryOfsSoSaleOutVo.setPageNo(1L); + queryOfsSoSaleOutVo.setPageSize(50L); + queryOfsSoSaleOutVo.setStoreCode(tobShop); + queryOfsSoSaleOutVo.setCode(code); + ofsStandardUtil.queryOfsSaleOrder(queryOfsSoSaleOutVo, headerDetailsDtoList, 1L, "ofs.shipment.search"); + logger.info("根据单据号查询:数据返回行数:{}", headerDetailsDtoList.size()); + if (headerDetailsDtoList.size() > 0) { + if (sceneType.equals("stock")) { + getSetStock(headerDetailsDtoList); + } else if (sceneType.equals("tran")) { + getSetStockTran(headerDetailsDtoList); + } + } else { + logger.info("没有查询到任何数据!不需要同步"); } - } else { - logger.info("没有查询到任何数据!不需要同步"); - } - long endMillis = System.currentTimeMillis(); - String threadNameStrEnd = StrUtil.format("OFS销售出库(TOB)同步U8C销售订单结束 出库单单号:{} 耗时:{}", code, (endMillis - startMillis)); - logger.info(threadNameStrEnd); + long endMillis = System.currentTimeMillis(); + String threadNameStrEnd = StrUtil.format("OFS销售出库(TOB)同步U8C销售订单结束 出库单单号:{} 耗时:{}", code, (endMillis - startMillis)); + logger.info(threadNameStrEnd); + } catch (Exception e) { + logger.error("startImplementByCode方法抛出异常", e); + } } /** diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/sales/SoSaleOutPluginInitializerToC.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/sales/SoSaleOutPluginInitializerToC.java index 3a6ddaed..f81829eb 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/sales/SoSaleOutPluginInitializerToC.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/sales/SoSaleOutPluginInitializerToC.java @@ -194,40 +194,44 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity { * @author liuyang */ public void startImplementStockByTime(String startTime, String endTime) throws Exception { - long startMillis = System.currentTimeMillis(); - String threadNameStrStart = StrUtil.format("开始 OFS销售出库(TOC)同步U8C销售订单 开始 开始时间:{} 结束时间:{}", startTime, endTime); - logger.info(threadNameStrStart); + try { + long startMillis = System.currentTimeMillis(); + String threadNameStrStart = StrUtil.format("开始 OFS销售出库(TOC)同步U8C销售订单 开始 开始时间:{} 结束时间:{}", startTime, endTime); + logger.info(threadNameStrStart); - Assert.notNull(startTime, "查询条件,开始时间不能为空!"); - Assert.notNull(endTime, "查询条件,结束时间不能为空!"); + Assert.notNull(startTime, "查询条件,开始时间不能为空!"); + Assert.notNull(endTime, "查询条件,结束时间不能为空!"); // CalculateDateVo calculateDateVo = DateStrUtil.calculateCalculateEntireDayPeriod(dateStr); - String tobShop = shopTobOrToCUtil.getCommaShop("TOC"); + String tobShop = shopTobOrToCUtil.getCommaShop("TOC"); - List headerDetailsDtoList = new ArrayList<>(); - QueryOfsSoSaleOutVo queryOfsSoSaleOutVo = new QueryOfsSoSaleOutVo(); + List headerDetailsDtoList = new ArrayList<>(); + QueryOfsSoSaleOutVo queryOfsSoSaleOutVo = new QueryOfsSoSaleOutVo(); // queryOfsSoSaleOutVo.setShipAt_start(calculateDateVo.getStart_time()); // queryOfsSoSaleOutVo.setShipAt_end(calculateDateVo.getEnd_time()); - queryOfsSoSaleOutVo.setShipAt_start(startTime); - queryOfsSoSaleOutVo.setShipAt_end(endTime); - queryOfsSoSaleOutVo.setClientCode("LETS"); - queryOfsSoSaleOutVo.setInternalInstructionType("SALES"); - queryOfsSoSaleOutVo.setStatus(900L); - queryOfsSoSaleOutVo.setPageNo(1L); - queryOfsSoSaleOutVo.setPageSize(100L); - queryOfsSoSaleOutVo.setStoreCode(tobShop); + queryOfsSoSaleOutVo.setShipAt_start(startTime); + queryOfsSoSaleOutVo.setShipAt_end(endTime); + queryOfsSoSaleOutVo.setClientCode("LETS"); + queryOfsSoSaleOutVo.setInternalInstructionType("SALES"); + queryOfsSoSaleOutVo.setStatus(900L); + queryOfsSoSaleOutVo.setPageNo(1L); + queryOfsSoSaleOutVo.setPageSize(100L); + queryOfsSoSaleOutVo.setStoreCode(tobShop); // queryOfsSoSaleOutVo.setCode("LETS-SH2024070500000003"); - ofsStandardUtil.queryOfsSaleOrder(queryOfsSoSaleOutVo, headerDetailsDtoList, 1L, "ofs.shipment.search"); - logger.info("数据返回行数:{}", headerDetailsDtoList.size()); - if (headerDetailsDtoList.size() > 0) { - getSetStock(headerDetailsDtoList); - } else { - logger.info("TOC没有查询到任何数据!不需要同步"); - } + ofsStandardUtil.queryOfsSaleOrder(queryOfsSoSaleOutVo, headerDetailsDtoList, 1L, "ofs.shipment.search"); + logger.info("数据返回行数:{}", headerDetailsDtoList.size()); + if (headerDetailsDtoList.size() > 0) { + getSetStock(headerDetailsDtoList); + } else { + logger.info("TOC没有查询到任何数据!不需要同步"); + } - long endMillis = System.currentTimeMillis(); - String threadNameStrEnd = StrUtil.format("结束 OFS销售出库(TOC)同步U8C销售订单 结束 开始时间:{} 结束时间:{} 耗时:{}", startTime, endTime, (endMillis - startMillis)); - logger.info(threadNameStrEnd); + long endMillis = System.currentTimeMillis(); + String threadNameStrEnd = StrUtil.format("结束 OFS销售出库(TOC)同步U8C销售订单 结束 开始时间:{} 结束时间:{} 耗时:{}", startTime, endTime, (endMillis - startMillis)); + logger.info(threadNameStrEnd); + } catch (Exception e) { + logger.error("startImplementStockByTime方法抛出异常", e); + } } /** @@ -237,38 +241,42 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity { * @author liuyang */ public void startImplementStockByCode(String code, String sceneType) throws Exception { - long startMillis = System.currentTimeMillis(); - String threadNameStrStart = StrUtil.format("OFS销售出库(TOC)同步U8C销售订单 开始 出库单单据号:{}", code); - logger.info(threadNameStrStart); + try { + long startMillis = System.currentTimeMillis(); + String threadNameStrStart = StrUtil.format("OFS销售出库(TOC)同步U8C销售订单 开始 出库单单据号:{}", code); + logger.info(threadNameStrStart); - Assert.notNull(code, "O出库单编码不能为空!code is null!"); - Assert.notNull(sceneType, "场景类型不能为空!"); + Assert.notNull(code, "O出库单编码不能为空!code is null!"); + Assert.notNull(sceneType, "场景类型不能为空!"); - String tobShop = shopTobOrToCUtil.getCommaShop("TOC"); - List headerDetailsDtoList = new ArrayList<>(); - QueryOfsSoSaleOutVo queryOfsSoSaleOutVo = new QueryOfsSoSaleOutVo(); - queryOfsSoSaleOutVo.setClientCode("LETS"); - queryOfsSoSaleOutVo.setInternalInstructionType("SALES"); + String tobShop = shopTobOrToCUtil.getCommaShop("TOC"); + List headerDetailsDtoList = new ArrayList<>(); + QueryOfsSoSaleOutVo queryOfsSoSaleOutVo = new QueryOfsSoSaleOutVo(); + queryOfsSoSaleOutVo.setClientCode("LETS"); + queryOfsSoSaleOutVo.setInternalInstructionType("SALES"); // queryOfsSoSaleOutVo.setStatus(900L); - queryOfsSoSaleOutVo.setPageNo(1L); - queryOfsSoSaleOutVo.setPageSize(100L); + queryOfsSoSaleOutVo.setPageNo(1L); + queryOfsSoSaleOutVo.setPageSize(100L); // queryOfsSoSaleOutVo.setStoreCode(tobShop); - queryOfsSoSaleOutVo.setCode(code); - ofsStandardUtil.queryOfsSaleOrder(queryOfsSoSaleOutVo, headerDetailsDtoList, 1L, "ofs.shipment.search"); - logger.info("数据返回行数:{}", headerDetailsDtoList.size()); - if (headerDetailsDtoList.size() > 0) { - if (sceneType.equals("stock")) { - getSetStock(headerDetailsDtoList); - } else if (sceneType.equals("tran")) { - getSetTran(headerDetailsDtoList); + queryOfsSoSaleOutVo.setCode(code); + ofsStandardUtil.queryOfsSaleOrder(queryOfsSoSaleOutVo, headerDetailsDtoList, 1L, "ofs.shipment.search"); + logger.info("数据返回行数:{}", headerDetailsDtoList.size()); + if (headerDetailsDtoList.size() > 0) { + if (sceneType.equals("stock")) { + getSetStock(headerDetailsDtoList); + } else if (sceneType.equals("tran")) { + getSetTran(headerDetailsDtoList); + } + } else { + logger.info("没有查询到任何数据!不需要同步"); } - } else { - logger.info("没有查询到任何数据!不需要同步"); - } - long endMillis = System.currentTimeMillis(); - String threadNameStrEnd = StrUtil.format("OFS销售出库(TOC)同步U8C销售订单 结束 出库单单据号:{} 耗时:{}", code, (endMillis - startMillis)); - logger.info(threadNameStrEnd); + long endMillis = System.currentTimeMillis(); + String threadNameStrEnd = StrUtil.format("OFS销售出库(TOC)同步U8C销售订单 结束 出库单单据号:{} 耗时:{}", code, (endMillis - startMillis)); + logger.info(threadNameStrEnd); + } catch (Exception e) { + logger.error("startImplementStockByCode不能为空", e); + } } /** @@ -279,41 +287,45 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity { * @author liuyang */ public void startImplementTranByTime(String startTime, String endTime) throws Exception { - long startMillis = System.currentTimeMillis(); - String threadNameStrStart = StrUtil.format("开始OFS销售出库(TOC)同步U8C销售订单 开始时间:{} 结束时间:{}", startTime, endTime); - logger.info(threadNameStrStart); + try { + long startMillis = System.currentTimeMillis(); + String threadNameStrStart = StrUtil.format("开始OFS销售出库(TOC)同步U8C销售订单 开始时间:{} 结束时间:{}", startTime, endTime); + logger.info(threadNameStrStart); - Assert.notNull(startTime, "查询条件,开始时间不能为空!"); - Assert.notNull(endTime, "查询条件,结束时间不能为空!"); + Assert.notNull(startTime, "查询条件,开始时间不能为空!"); + Assert.notNull(endTime, "查询条件,结束时间不能为空!"); // CalculateDateVo calculateDateVo = DateStrUtil.calculateCalculateEntireDayPeriod(dateStr); - String tocShop = shopTobOrToCUtil.getCommaShop("TOC"); + String tocShop = shopTobOrToCUtil.getCommaShop("TOC"); - List headerDetailsDtoList = new ArrayList<>(); - QueryOfsSoSaleOutVo queryOfsSoSaleOutVo = new QueryOfsSoSaleOutVo(); + List headerDetailsDtoList = new ArrayList<>(); + QueryOfsSoSaleOutVo queryOfsSoSaleOutVo = new QueryOfsSoSaleOutVo(); // queryOfsSoSaleOutVo.setShipAt_start(calculateDateVo.getStart_time()); // queryOfsSoSaleOutVo.setShipAt_end(calculateDateVo.getEnd_time()); - queryOfsSoSaleOutVo.setTradeSuccessAt_start(startTime); - queryOfsSoSaleOutVo.setTradeSuccessAt_end(endTime); - queryOfsSoSaleOutVo.setClientCode("LETS"); - queryOfsSoSaleOutVo.setInternalInstructionType("SALES"); - queryOfsSoSaleOutVo.setSourceOrderStatus("TRADE_FINISHED");//交易成功状态 + queryOfsSoSaleOutVo.setTradeSuccessAt_start(startTime); + queryOfsSoSaleOutVo.setTradeSuccessAt_end(endTime); + queryOfsSoSaleOutVo.setClientCode("LETS"); + queryOfsSoSaleOutVo.setInternalInstructionType("SALES"); + queryOfsSoSaleOutVo.setSourceOrderStatus("TRADE_FINISHED");//交易成功状态 // queryOfsSoSaleOutVo.setStatus(900L); - queryOfsSoSaleOutVo.setPageNo(1L); - queryOfsSoSaleOutVo.setPageSize(100L); - queryOfsSoSaleOutVo.setStoreCode(tocShop); + queryOfsSoSaleOutVo.setPageNo(1L); + queryOfsSoSaleOutVo.setPageSize(100L); + queryOfsSoSaleOutVo.setStoreCode(tocShop); // queryOfsSoSaleOutVo.setCode("LETS-SH2024070500000003"); - ofsStandardUtil.queryOfsSaleOrder(queryOfsSoSaleOutVo, headerDetailsDtoList, 1L, "ofs.shipment.search"); - logger.info("TOC数据返回行数:{}", headerDetailsDtoList.size()); - if (headerDetailsDtoList.size() > 0) { - getSetTran(headerDetailsDtoList); - } else { - logger.info("TOC没有查询到任何数据!不需要同步"); - } + ofsStandardUtil.queryOfsSaleOrder(queryOfsSoSaleOutVo, headerDetailsDtoList, 1L, "ofs.shipment.search"); + logger.info("TOC数据返回行数:{}", headerDetailsDtoList.size()); + if (headerDetailsDtoList.size() > 0) { + getSetTran(headerDetailsDtoList); + } else { + logger.info("TOC没有查询到任何数据!不需要同步"); + } - long endMillis = System.currentTimeMillis(); - String threadNameStrEnd = StrUtil.format("结束OFS销售出库(TOC)同步U8C销售订单 开始时间:{} 结束时间:{} 耗时:{}", startTime, endTime, (endMillis - startMillis)); - logger.info(threadNameStrEnd); + long endMillis = System.currentTimeMillis(); + String threadNameStrEnd = StrUtil.format("结束OFS销售出库(TOC)同步U8C销售订单 开始时间:{} 结束时间:{} 耗时:{}", startTime, endTime, (endMillis - startMillis)); + logger.info(threadNameStrEnd); + } catch (Exception e) { + logger.error("startImplementTranByTime方法抛出异常", e); + } } /** 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 20a557a6..288f4be2 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 @@ -237,38 +237,42 @@ public class SoSaleReturnPluginInitializerToB extends PluginBaseEntity { * @author liuyang */ public void startImplementByStockTime(String startTime, String endTime) throws Exception { - long startMillis = System.currentTimeMillis(); - String threadNameStrStart = StrUtil.format("OFS售后入库(TOB)同步U8C销售订单(库存同步) 开始时间:{} 结束时间:{}", startTime, endTime); - logger.info(threadNameStrStart); + try { + long startMillis = System.currentTimeMillis(); + String threadNameStrStart = StrUtil.format("OFS售后入库(TOB)同步U8C销售订单(库存同步) 开始时间:{} 结束时间:{}", startTime, endTime); + logger.info(threadNameStrStart); - Assert.notNull(startTime, "startTime不能为空"); - Assert.notNull(endTime, "endTime不能为空"); - //生成一个时间范围 + Assert.notNull(startTime, "startTime不能为空"); + Assert.notNull(endTime, "endTime不能为空"); + //生成一个时间范围 // StartAndEndVo startAndEndVo = offsetTimeTime.offsetTime(); - //2024年8月19日 15:47:51 查询出U8C里标记的店铺TOB属性 - String tobShop = shopTobOrToCUtil.getCommaShop("TOB"); + //2024年8月19日 15:47:51 查询出U8C里标记的店铺TOB属性 + String tobShop = shopTobOrToCUtil.getCommaShop("TOB"); - List returnGoodHeaderDetailsDataDtoArrayList = new ArrayList<>(); - QueryOfsSoSaleOutVo queryOfsSoSaleOutVo = new QueryOfsSoSaleOutVo(); - queryOfsSoSaleOutVo.setClosedAt_start(startTime); - queryOfsSoSaleOutVo.setClosedAt_end(endTime); - queryOfsSoSaleOutVo.setClientCode("LETS"); - queryOfsSoSaleOutVo.setPageNo(1L); - queryOfsSoSaleOutVo.setPageSize(50L); - queryOfsSoSaleOutVo.setStoreCode(tobShop); - queryOfsSoSaleOutVo.setInternalInstructionType("RETURN"); + List returnGoodHeaderDetailsDataDtoArrayList = new ArrayList<>(); + QueryOfsSoSaleOutVo queryOfsSoSaleOutVo = new QueryOfsSoSaleOutVo(); + queryOfsSoSaleOutVo.setClosedAt_start(startTime); + queryOfsSoSaleOutVo.setClosedAt_end(endTime); + queryOfsSoSaleOutVo.setClientCode("LETS"); + queryOfsSoSaleOutVo.setPageNo(1L); + queryOfsSoSaleOutVo.setPageSize(50L); + queryOfsSoSaleOutVo.setStoreCode(tobShop); + queryOfsSoSaleOutVo.setInternalInstructionType("RETURN"); // queryOfsSoSaleOutVo.setCode("LETS-RE2024081900000001"); - ofsStandardUtil.queryOfsReturnGoods(queryOfsSoSaleOutVo, returnGoodHeaderDetailsDataDtoArrayList, 1L, "ofs.receipt.search"); - logger.info("插件:{} (库存)O接口返回行数:{} 时间段:{} {}", getPluginName(), returnGoodHeaderDetailsDataDtoArrayList.size(), startTime, endTime); - if (returnGoodHeaderDetailsDataDtoArrayList.size() > 0) { - getSetStock(returnGoodHeaderDetailsDataDtoArrayList); - } else { - logger.info("没有查询到任何数据!不需要同步"); - } + ofsStandardUtil.queryOfsReturnGoods(queryOfsSoSaleOutVo, returnGoodHeaderDetailsDataDtoArrayList, 1L, "ofs.receipt.search"); + logger.info("插件:{} (库存)O接口返回行数:{} 时间段:{} {}", getPluginName(), returnGoodHeaderDetailsDataDtoArrayList.size(), startTime, endTime); + if (returnGoodHeaderDetailsDataDtoArrayList.size() > 0) { + getSetStock(returnGoodHeaderDetailsDataDtoArrayList); + } else { + logger.info("没有查询到任何数据!不需要同步"); + } - long endMillis = System.currentTimeMillis(); - String threadNameStrEnd = StrUtil.format("OFS售后入库(TOB)同步U8C销售订单(库存同步) 开始时间:{} 结束时间:{} 耗时:{}", startTime, endTime, (endMillis - startMillis)); - logger.info(threadNameStrEnd); + long endMillis = System.currentTimeMillis(); + String threadNameStrEnd = StrUtil.format("OFS售后入库(TOB)同步U8C销售订单(库存同步) 开始时间:{} 结束时间:{} 耗时:{}", startTime, endTime, (endMillis - startMillis)); + logger.info(threadNameStrEnd); + } catch (Exception e) { + logger.error("startImplementByStockTime方法抛出异常", e); + } } /** @@ -277,40 +281,44 @@ public class SoSaleReturnPluginInitializerToB extends PluginBaseEntity { * @author liuyang */ public void startImplementByTradeTime(String startTime, String endTime) throws Exception { - long startMillis = System.currentTimeMillis(); - String threadNameStrStart = StrUtil.format("OFS售后入库(TOB)同步U8C销售订单(库存同步) 开始时间:{} 结束时间:{}", startTime, endTime); - logger.info(threadNameStrStart); + try { + long startMillis = System.currentTimeMillis(); + String threadNameStrStart = StrUtil.format("OFS售后入库(TOB)同步U8C销售订单(库存同步) 开始时间:{} 结束时间:{}", startTime, endTime); + logger.info(threadNameStrStart); - Assert.notNull(startTime, "startTime不能为空"); - Assert.notNull(endTime, "endTime不能为空"); + Assert.notNull(startTime, "startTime不能为空"); + Assert.notNull(endTime, "endTime不能为空"); - //生成一个时间范围 + //生成一个时间范围 // StartAndEndVo startAndEndVo = offsetTimeTime.offsetTime(); - //2024年8月19日 15:47:51 查询出U8C里标记的店铺TOB属性 - String tobShop = shopTobOrToCUtil.getCommaShop("TOB"); + //2024年8月19日 15:47:51 查询出U8C里标记的店铺TOB属性 + String tobShop = shopTobOrToCUtil.getCommaShop("TOB"); - List returnGoodHeaderDetailsDataDtoArrayList = new ArrayList<>(); - QueryOfsSoSaleOutVo queryOfsSoSaleOutVo = new QueryOfsSoSaleOutVo(); - queryOfsSoSaleOutVo.setRefundedAt_start(startTime); - queryOfsSoSaleOutVo.setRefundedAt_end(endTime); - queryOfsSoSaleOutVo.setClientCode("LETS"); - queryOfsSoSaleOutVo.setPageNo(1L); - queryOfsSoSaleOutVo.setPageSize(50L); - queryOfsSoSaleOutVo.setStoreCode(tobShop); - queryOfsSoSaleOutVo.setInternalInstructionType("RETURN"); - queryOfsSoSaleOutVo.setRefundStatus("900"); + List returnGoodHeaderDetailsDataDtoArrayList = new ArrayList<>(); + QueryOfsSoSaleOutVo queryOfsSoSaleOutVo = new QueryOfsSoSaleOutVo(); + queryOfsSoSaleOutVo.setRefundedAt_start(startTime); + queryOfsSoSaleOutVo.setRefundedAt_end(endTime); + queryOfsSoSaleOutVo.setClientCode("LETS"); + queryOfsSoSaleOutVo.setPageNo(1L); + queryOfsSoSaleOutVo.setPageSize(50L); + queryOfsSoSaleOutVo.setStoreCode(tobShop); + queryOfsSoSaleOutVo.setInternalInstructionType("RETURN"); + queryOfsSoSaleOutVo.setRefundStatus("900"); // queryOfsSoSaleOutVo.setCode("LETS-RE2024081900000001"); - ofsStandardUtil.queryOfsReturnGoods(queryOfsSoSaleOutVo, returnGoodHeaderDetailsDataDtoArrayList, 1L, "ofs.receipt.search"); - logger.info("插件:{} (确认收入)O接口返回行数:{} 时间段:{} {}", getPluginName(), returnGoodHeaderDetailsDataDtoArrayList.size(), startTime, endTime); - if (returnGoodHeaderDetailsDataDtoArrayList.size() > 0) { - getSetTrade(returnGoodHeaderDetailsDataDtoArrayList); - } else { - logger.info("没有查询到任何数据!不需要同步"); - } + ofsStandardUtil.queryOfsReturnGoods(queryOfsSoSaleOutVo, returnGoodHeaderDetailsDataDtoArrayList, 1L, "ofs.receipt.search"); + logger.info("插件:{} (确认收入)O接口返回行数:{} 时间段:{} {}", getPluginName(), returnGoodHeaderDetailsDataDtoArrayList.size(), startTime, endTime); + if (returnGoodHeaderDetailsDataDtoArrayList.size() > 0) { + getSetTrade(returnGoodHeaderDetailsDataDtoArrayList); + } else { + logger.info("没有查询到任何数据!不需要同步"); + } - long endMillis = System.currentTimeMillis(); - String threadNameStrEnd = StrUtil.format("OFS售后入库(TOB)同步U8C销售订单(库存同步) 开始时间:{} 结束时间:{} 耗时:{}", startTime, endTime, (endMillis - startMillis)); - logger.info(threadNameStrEnd); + long endMillis = System.currentTimeMillis(); + String threadNameStrEnd = StrUtil.format("OFS售后入库(TOB)同步U8C销售订单(库存同步) 开始时间:{} 结束时间:{} 耗时:{}", startTime, endTime, (endMillis - startMillis)); + logger.info(threadNameStrEnd); + } catch (Exception e) { + logger.error("startImplementByTradeTime方法抛出异常", e); + } } /** @@ -319,42 +327,46 @@ public class SoSaleReturnPluginInitializerToB extends PluginBaseEntity { * @author liuyang */ public void startImplementByCode(String code, String sceneType) throws Exception { - long startMillis = System.currentTimeMillis(); - String threadNameStrStart = StrUtil.format("OFS售后入库(TOB)同步U8C销售订单(库存同步) 售后入库单号:{}", code); - logger.info(threadNameStrStart); + try { + long startMillis = System.currentTimeMillis(); + String threadNameStrStart = StrUtil.format("OFS售后入库(TOB)同步U8C销售订单(库存同步) 售后入库单号:{}", code); + logger.info(threadNameStrStart); - Assert.notNull(code, "code不能为空"); - //生成一个时间范围 + Assert.notNull(code, "code不能为空"); + //生成一个时间范围 // StartAndEndVo startAndEndVo = offsetTimeTime.offsetTime(); - //2024年8月19日 15:47:51 查询出U8C里标记的店铺TOB属性 - String tobShop = shopTobOrToCUtil.getCommaShop("TOB"); + //2024年8月19日 15:47:51 查询出U8C里标记的店铺TOB属性 + String tobShop = shopTobOrToCUtil.getCommaShop("TOB"); - List returnGoodHeaderDetailsDataDtoArrayList = new ArrayList<>(); - QueryOfsSoSaleOutVo queryOfsSoSaleOutVo = new QueryOfsSoSaleOutVo(); + List returnGoodHeaderDetailsDataDtoArrayList = new ArrayList<>(); + QueryOfsSoSaleOutVo queryOfsSoSaleOutVo = new QueryOfsSoSaleOutVo(); // queryOfsSoSaleOutVo.setClosedAt_start("2002-01-01 00:00:00");// 2024年8月19日 17:13:35 仅作为接口参数验证,O口头反馈根据单号查询,不会启用时间范围搜索 // queryOfsSoSaleOutVo.setClosedAt_end("2002-01-01 23:59:59"); - queryOfsSoSaleOutVo.setClientCode("LETS"); - queryOfsSoSaleOutVo.setPageNo(1L); - queryOfsSoSaleOutVo.setPageSize(50L); - //测试 - queryOfsSoSaleOutVo.setStoreCode(tobShop); - queryOfsSoSaleOutVo.setCode(code); - queryOfsSoSaleOutVo.setInternalInstructionType("RETURN"); - ofsStandardUtil.queryOfsReturnGoods(queryOfsSoSaleOutVo, returnGoodHeaderDetailsDataDtoArrayList, 1L, "ofs.receipt.search"); - logger.info("数据返回行数:{}", returnGoodHeaderDetailsDataDtoArrayList.size()); - if (returnGoodHeaderDetailsDataDtoArrayList.size() > 0) { - if (sceneType.equals("stock")) { - getSetStock(returnGoodHeaderDetailsDataDtoArrayList); - } else if (sceneType.equals("tran")) { - getSetTrade(returnGoodHeaderDetailsDataDtoArrayList); + queryOfsSoSaleOutVo.setClientCode("LETS"); + queryOfsSoSaleOutVo.setPageNo(1L); + queryOfsSoSaleOutVo.setPageSize(50L); + //测试 + queryOfsSoSaleOutVo.setStoreCode(tobShop); + queryOfsSoSaleOutVo.setCode(code); + queryOfsSoSaleOutVo.setInternalInstructionType("RETURN"); + ofsStandardUtil.queryOfsReturnGoods(queryOfsSoSaleOutVo, returnGoodHeaderDetailsDataDtoArrayList, 1L, "ofs.receipt.search"); + logger.info("数据返回行数:{}", returnGoodHeaderDetailsDataDtoArrayList.size()); + if (returnGoodHeaderDetailsDataDtoArrayList.size() > 0) { + if (sceneType.equals("stock")) { + getSetStock(returnGoodHeaderDetailsDataDtoArrayList); + } else if (sceneType.equals("tran")) { + getSetTrade(returnGoodHeaderDetailsDataDtoArrayList); + } + } else { + logger.info("没有查询到任何数据!不需要同步"); } - } else { - logger.info("没有查询到任何数据!不需要同步"); - } - long endMillis = System.currentTimeMillis(); - String threadNameStrEnd = StrUtil.format("OFS售后入库(TOB)同步U8C销售订单(库存同步) 售后入库单号:{} 耗时:{}", code, (endMillis - startMillis)); - logger.info(threadNameStrEnd); + long endMillis = System.currentTimeMillis(); + String threadNameStrEnd = StrUtil.format("OFS售后入库(TOB)同步U8C销售订单(库存同步) 售后入库单号:{} 耗时:{}", code, (endMillis - startMillis)); + logger.info(threadNameStrEnd); + } catch (Exception e) { + logger.error("startImplementByCode方法抛出异常", e); + } } /** 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 afd9ea12..86abf682 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 @@ -186,41 +186,45 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity { * @author liuyang */ public void startImplementStockByTime(String startTime, String endTime) throws Exception { - long startMillis = System.currentTimeMillis(); - String threadNameStrStart = StrUtil.format("开始-OFS销售出库(TOC)同步U8C销售订单 开始时间:{} 结束时间:{}", startTime, endTime); - logger.info(threadNameStrStart); + try { + long startMillis = System.currentTimeMillis(); + String threadNameStrStart = StrUtil.format("开始-OFS销售出库(TOC)同步U8C销售订单 开始时间:{} 结束时间:{}", startTime, endTime); + logger.info(threadNameStrStart); - Assert.notNull(startTime, "开始时间不能为空"); - Assert.notNull(endTime, "结束时间不能为空"); + Assert.notNull(startTime, "开始时间不能为空"); + Assert.notNull(endTime, "结束时间不能为空"); - String tocShop = shopTobOrToCUtil.getCommaShop("TOC"); + String tocShop = shopTobOrToCUtil.getCommaShop("TOC"); // CalculateDateVo calculateDateVo = DateStrUtil.calculateCalculateEntireDayPeriod(dateStr); - List returnGoodHeaderDetailsDataDtoArrayList = new ArrayList<>(); - QueryOfsSoSaleOutVo queryOfsSoSaleOutVo = new QueryOfsSoSaleOutVo(); - queryOfsSoSaleOutVo.setClosedAt_start(startTime); - queryOfsSoSaleOutVo.setClosedAt_end(endTime); - queryOfsSoSaleOutVo.setClientCode("LETS"); - queryOfsSoSaleOutVo.setInternalInstructionType("SALES"); - //2024年8月22日 14:02:13 已经和O确认,这个字段取消传递! + List returnGoodHeaderDetailsDataDtoArrayList = new ArrayList<>(); + QueryOfsSoSaleOutVo queryOfsSoSaleOutVo = new QueryOfsSoSaleOutVo(); + queryOfsSoSaleOutVo.setClosedAt_start(startTime); + queryOfsSoSaleOutVo.setClosedAt_end(endTime); + queryOfsSoSaleOutVo.setClientCode("LETS"); + queryOfsSoSaleOutVo.setInternalInstructionType("SALES"); + //2024年8月22日 14:02:13 已经和O确认,这个字段取消传递! // queryOfsSoSaleOutVo.setCompanyCode("SHLZ"); - queryOfsSoSaleOutVo.setStatus(900L); - queryOfsSoSaleOutVo.setPageNo(1L); - queryOfsSoSaleOutVo.setPageSize(50L); - queryOfsSoSaleOutVo.setStoreCode(tocShop); - queryOfsSoSaleOutVo.setInternalInstructionType("RETURN"); + queryOfsSoSaleOutVo.setStatus(900L); + queryOfsSoSaleOutVo.setPageNo(1L); + queryOfsSoSaleOutVo.setPageSize(50L); + queryOfsSoSaleOutVo.setStoreCode(tocShop); + queryOfsSoSaleOutVo.setInternalInstructionType("RETURN"); // queryOfsSoSaleOutVo.setCode("LETS-RE2024071600000001"); - ofsStandardUtil.queryOfsReturnGoods(queryOfsSoSaleOutVo, returnGoodHeaderDetailsDataDtoArrayList, 1L, "ofs.receipt.search"); - logger.info("TOC退货数据返回行数:{}", returnGoodHeaderDetailsDataDtoArrayList.size()); - if (returnGoodHeaderDetailsDataDtoArrayList.size() > 0) { - getSetStock(returnGoodHeaderDetailsDataDtoArrayList); - } else { - logger.info("没有查询到任何数据!不需要同步"); - } + ofsStandardUtil.queryOfsReturnGoods(queryOfsSoSaleOutVo, returnGoodHeaderDetailsDataDtoArrayList, 1L, "ofs.receipt.search"); + logger.info("TOC退货数据返回行数:{}", returnGoodHeaderDetailsDataDtoArrayList.size()); + if (returnGoodHeaderDetailsDataDtoArrayList.size() > 0) { + getSetStock(returnGoodHeaderDetailsDataDtoArrayList); + } else { + logger.info("没有查询到任何数据!不需要同步"); + } - long endMillis = System.currentTimeMillis(); - String threadNameStrEnd = StrUtil.format("结束-OFS销售出库(TOC)同步U8C销售订单 开始时间:{} 结束时间:{} 耗时:{}", startTime, endTime, (endMillis - startMillis)); - logger.info(threadNameStrEnd); + long endMillis = System.currentTimeMillis(); + String threadNameStrEnd = StrUtil.format("结束-OFS销售出库(TOC)同步U8C销售订单 开始时间:{} 结束时间:{} 耗时:{}", startTime, endTime, (endMillis - startMillis)); + logger.info(threadNameStrEnd); + } catch (Exception e) { + logger.error("startImplementStockByTime方法抛出异常", e); + } } /** @@ -273,39 +277,43 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity { * @author liuyang */ public void startImplementByTradeTime(String startTime, String endTime) throws Exception { - long startMillis = System.currentTimeMillis(); - String threadNameStrStart = StrUtil.format("OFS售后入库(TOB)同步U8C销售订单(库存同步) 开始时间:{} 结束时间:{}", startTime, endTime); - logger.info(threadNameStrStart); + try { + long startMillis = System.currentTimeMillis(); + String threadNameStrStart = StrUtil.format("OFS售后入库(TOB)同步U8C销售订单(库存同步) 开始时间:{} 结束时间:{}", startTime, endTime); + logger.info(threadNameStrStart); - Assert.notNull(startTime, "startTime不能为空"); - Assert.notNull(endTime, "endTime不能为空"); - //生成一个时间范围 + Assert.notNull(startTime, "startTime不能为空"); + Assert.notNull(endTime, "endTime不能为空"); + //生成一个时间范围 // StartAndEndVo startAndEndVo = offsetTimeTime.offsetTime(); - //2024年8月19日 15:47:51 查询出U8C里标记的店铺TOB属性 - String tocShop = shopTobOrToCUtil.getCommaShop("TOC"); + //2024年8月19日 15:47:51 查询出U8C里标记的店铺TOB属性 + String tocShop = shopTobOrToCUtil.getCommaShop("TOC"); - List returnGoodHeaderDetailsDataDtoArrayList = new ArrayList<>(); - QueryOfsSoSaleOutVo queryOfsSoSaleOutVo = new QueryOfsSoSaleOutVo(); - queryOfsSoSaleOutVo.setRefundedAt_start(startTime); - queryOfsSoSaleOutVo.setRefundedAt_end(endTime); - queryOfsSoSaleOutVo.setClientCode("LETS"); - queryOfsSoSaleOutVo.setPageNo(1L); - queryOfsSoSaleOutVo.setPageSize(50L); - queryOfsSoSaleOutVo.setStoreCode(tocShop); - queryOfsSoSaleOutVo.setInternalInstructionType("RETURN"); - queryOfsSoSaleOutVo.setRefundStatus("900"); + List returnGoodHeaderDetailsDataDtoArrayList = new ArrayList<>(); + QueryOfsSoSaleOutVo queryOfsSoSaleOutVo = new QueryOfsSoSaleOutVo(); + queryOfsSoSaleOutVo.setRefundedAt_start(startTime); + queryOfsSoSaleOutVo.setRefundedAt_end(endTime); + queryOfsSoSaleOutVo.setClientCode("LETS"); + queryOfsSoSaleOutVo.setPageNo(1L); + queryOfsSoSaleOutVo.setPageSize(50L); + queryOfsSoSaleOutVo.setStoreCode(tocShop); + queryOfsSoSaleOutVo.setInternalInstructionType("RETURN"); + queryOfsSoSaleOutVo.setRefundStatus("900"); // queryOfsSoSaleOutVo.setCode("LETS-RE2024081900000001"); - ofsStandardUtil.queryOfsReturnGoods(queryOfsSoSaleOutVo, returnGoodHeaderDetailsDataDtoArrayList, 1L, "ofs.receipt.search"); - logger.info("数据返回行数:{}", returnGoodHeaderDetailsDataDtoArrayList.size()); - if (returnGoodHeaderDetailsDataDtoArrayList.size() > 0) { - getSetTran(returnGoodHeaderDetailsDataDtoArrayList); - } else { - logger.info("没有查询到任何数据!不需要同步"); - } + ofsStandardUtil.queryOfsReturnGoods(queryOfsSoSaleOutVo, returnGoodHeaderDetailsDataDtoArrayList, 1L, "ofs.receipt.search"); + logger.info("数据返回行数:{}", returnGoodHeaderDetailsDataDtoArrayList.size()); + if (returnGoodHeaderDetailsDataDtoArrayList.size() > 0) { + getSetTran(returnGoodHeaderDetailsDataDtoArrayList); + } else { + logger.info("没有查询到任何数据!不需要同步"); + } - long endMillis = System.currentTimeMillis(); - String threadNameStrEnd = StrUtil.format("OFS售后入库(TOB)同步U8C销售订单(库存同步) 开始时间:{} 结束时间:{} 耗时:{}", startTime, endTime, (endMillis - startMillis)); - logger.info(threadNameStrEnd); + long endMillis = System.currentTimeMillis(); + String threadNameStrEnd = StrUtil.format("OFS售后入库(TOB)同步U8C销售订单(库存同步) 开始时间:{} 结束时间:{} 耗时:{}", startTime, endTime, (endMillis - startMillis)); + logger.info(threadNameStrEnd); + } catch (Exception e) { + logger.error("startImplementByTradeTime方法抛出异常", e); + } } /** diff --git a/buildpackage/src/test/java/com/hzya/frame/plugin/lets/plugin/sales/SoSaleOutPluginInitializerToCTest.java b/buildpackage/src/test/java/com/hzya/frame/plugin/lets/plugin/sales/SoSaleOutPluginInitializerToCTest.java index 7f911004..0209dbb5 100644 --- a/buildpackage/src/test/java/com/hzya/frame/plugin/lets/plugin/sales/SoSaleOutPluginInitializerToCTest.java +++ b/buildpackage/src/test/java/com/hzya/frame/plugin/lets/plugin/sales/SoSaleOutPluginInitializerToCTest.java @@ -5,6 +5,7 @@ import com.hzya.frame.plugin.lets.ofs.dao.ITocofsSaleoutDetailedDao; import com.hzya.frame.plugin.lets.ofs.entity.TocofsSaleoutDetailedEntity; import com.hzya.frame.plugin.lets.ofsvo.QueryOfsSoSaleOutVo; import com.hzya.frame.plugin.lets.u8cdto.ErrorHeaderDetailsDtoDto; +import com.hzya.frame.plugin.lets.util.OfsStandardUtil; import org.junit.jupiter.api.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; @@ -34,6 +35,9 @@ class SoSaleOutPluginInitializerToCTest { @Autowired private ITocofsSaleoutDetailedDao iTocofsSaleoutDetailedDao; + @Autowired + private OfsStandardUtil ofsStandardUtil; + @Test void startImplement() throws Exception { // soSaleOutPluginInitializerToC.startImplement(null, null); @@ -81,6 +85,12 @@ class SoSaleOutPluginInitializerToCTest { // String s = "LETS-SH2024073100000004"; // soSaleOutPluginInitializerToC.startImplementStockByCode(s, "stock"); - soSaleOutPluginInitializerToC.startImplementStockByTime("2024-09-24 16:35:43","2024-09-24 16:35:45"); +// soSaleOutPluginInitializerToC.startImplementStockByTime("2024-09-24 16:35:43","2024-09-24 16:35:45"); + + List headerDetailsDtoArrayList = new ArrayList<>(); + QueryOfsSoSaleOutVo queryOfsSoSaleOutVo = new QueryOfsSoSaleOutVo(); + queryOfsSoSaleOutVo.setCode("LETS-SO2024092500000018"); + ofsStandardUtil.getOfsSaleOrder(queryOfsSoSaleOutVo, headerDetailsDtoArrayList, 1L); + System.out.println(headerDetailsDtoArrayList.get(0).getHeader().getDepartmentType()); } } \ No newline at end of file