refactor(sales): 重构销售出库查询逻辑
- 移除了未使用的 CalculateDateVo 和 dateStr 相关代码 -优化了查询条件设置,直接使用 startTime 和 endTime 参数 -调整了查询方法参数,提高了代码可读性 - 注释掉了部分测试代码,增加了正式运行时的日志输出
This commit is contained in:
parent
3a95074487
commit
194afebd4a
|
@ -227,13 +227,9 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
|
||||||
Assert.notNull(startTime, "查询条件,开始时间不能为空!");
|
Assert.notNull(startTime, "查询条件,开始时间不能为空!");
|
||||||
Assert.notNull(endTime, "查询条件,结束时间不能为空!");
|
Assert.notNull(endTime, "查询条件,结束时间不能为空!");
|
||||||
|
|
||||||
// CalculateDateVo calculateDateVo = DateStrUtil.calculateCalculateEntireDayPeriod(dateStr);
|
|
||||||
String tocShop = shopTobOrToCUtil.getCommaShop("TOC");
|
String tocShop = shopTobOrToCUtil.getCommaShop("TOC");
|
||||||
|
|
||||||
List<com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.HeaderDetailsDto> headerDetailsDtoList = new ArrayList<>();
|
List<com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.HeaderDetailsDto> headerDetailsDtoList = new ArrayList<>();
|
||||||
QueryOfsSoSaleOutVo queryOfsSoSaleOutVo = new QueryOfsSoSaleOutVo();
|
QueryOfsSoSaleOutVo queryOfsSoSaleOutVo = new QueryOfsSoSaleOutVo();
|
||||||
// queryOfsSoSaleOutVo.setShipAt_start(calculateDateVo.getStart_time());
|
|
||||||
// queryOfsSoSaleOutVo.setShipAt_end(calculateDateVo.getEnd_time());
|
|
||||||
queryOfsSoSaleOutVo.setShipAt_start(startTime);
|
queryOfsSoSaleOutVo.setShipAt_start(startTime);
|
||||||
queryOfsSoSaleOutVo.setShipAt_end(endTime);
|
queryOfsSoSaleOutVo.setShipAt_end(endTime);
|
||||||
queryOfsSoSaleOutVo.setClientCode("LETS");
|
queryOfsSoSaleOutVo.setClientCode("LETS");
|
||||||
|
@ -242,7 +238,6 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
|
||||||
queryOfsSoSaleOutVo.setPageNo(1L);
|
queryOfsSoSaleOutVo.setPageNo(1L);
|
||||||
queryOfsSoSaleOutVo.setPageSize(100L);
|
queryOfsSoSaleOutVo.setPageSize(100L);
|
||||||
queryOfsSoSaleOutVo.setStoreCode(tocShop);
|
queryOfsSoSaleOutVo.setStoreCode(tocShop);
|
||||||
// queryOfsSoSaleOutVo.setCode("LETS-SH2024070500000003");
|
|
||||||
ofsStandardUtil.queryOfsSaleOrder(queryOfsSoSaleOutVo, headerDetailsDtoList, 1L, "ofs.shipment.search");
|
ofsStandardUtil.queryOfsSaleOrder(queryOfsSoSaleOutVo, headerDetailsDtoList, 1L, "ofs.shipment.search");
|
||||||
logger.info("数据返回行数:{}", headerDetailsDtoList.size());
|
logger.info("数据返回行数:{}", headerDetailsDtoList.size());
|
||||||
if (headerDetailsDtoList.size() > 0) {
|
if (headerDetailsDtoList.size() > 0) {
|
||||||
|
@ -369,24 +364,24 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
|
||||||
Assert.notNull(startTime, "查询条件,开始时间不能为空!");
|
Assert.notNull(startTime, "查询条件,开始时间不能为空!");
|
||||||
Assert.notNull(endTime, "查询条件,结束时间不能为空!");
|
Assert.notNull(endTime, "查询条件,结束时间不能为空!");
|
||||||
|
|
||||||
// CalculateDateVo calculateDateVo = DateStrUtil.calculateCalculateEntireDayPeriod(dateStr);
|
|
||||||
String tocShop = shopTobOrToCUtil.getCommaShop("TOC");
|
String tocShop = shopTobOrToCUtil.getCommaShop("TOC");
|
||||||
|
|
||||||
List<com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.HeaderDetailsDto> headerDetailsDtoList = new ArrayList<>();
|
List<com.hzya.frame.ttxofs.dto.ofssaleorderoutsearch.HeaderDetailsDto> headerDetailsDtoList = new ArrayList<>();
|
||||||
QueryOfsSoSaleOutVo queryOfsSoSaleOutVo = new QueryOfsSoSaleOutVo();
|
QueryOfsSoSaleOutVo queryOfsSoSaleOutVo = new QueryOfsSoSaleOutVo();
|
||||||
// queryOfsSoSaleOutVo.setShipAt_start(calculateDateVo.getStart_time());
|
|
||||||
// queryOfsSoSaleOutVo.setShipAt_end(calculateDateVo.getEnd_time());
|
|
||||||
queryOfsSoSaleOutVo.setTradeSuccessAt_start(startTime);
|
queryOfsSoSaleOutVo.setTradeSuccessAt_start(startTime);
|
||||||
queryOfsSoSaleOutVo.setTradeSuccessAt_end(endTime);
|
queryOfsSoSaleOutVo.setTradeSuccessAt_end(endTime);
|
||||||
queryOfsSoSaleOutVo.setClientCode("LETS");
|
queryOfsSoSaleOutVo.setClientCode("LETS");
|
||||||
queryOfsSoSaleOutVo.setInternalInstructionType("SALES,EXCHANGE,REISSUE,NEIBULINGYONG,INPURCHASE,HUOFAN");
|
queryOfsSoSaleOutVo.setInternalInstructionType("SALES,EXCHANGE,REISSUE,NEIBULINGYONG,INPURCHASE,HUOFAN");
|
||||||
queryOfsSoSaleOutVo.setSourceOrderStatus("TRADE_FINISHED");//交易成功状态
|
queryOfsSoSaleOutVo.setSourceOrderStatus("TRADE_FINISHED");//交易成功状态
|
||||||
// queryOfsSoSaleOutVo.setStatus(900L);
|
|
||||||
queryOfsSoSaleOutVo.setPageNo(1L);
|
queryOfsSoSaleOutVo.setPageNo(1L);
|
||||||
queryOfsSoSaleOutVo.setPageSize(100L);
|
queryOfsSoSaleOutVo.setPageSize(100L);
|
||||||
queryOfsSoSaleOutVo.setStoreCode(tocShop);
|
queryOfsSoSaleOutVo.setStoreCode(tocShop);
|
||||||
// queryOfsSoSaleOutVo.setCode("LETS-SH2024070500000003");
|
|
||||||
ofsStandardUtil.queryOfsSaleOrder(queryOfsSoSaleOutVo, headerDetailsDtoList, 1L, "ofs.shipment.search");
|
ofsStandardUtil.queryOfsSaleOrder(queryOfsSoSaleOutVo, headerDetailsDtoList, 1L, "ofs.shipment.search");
|
||||||
|
//测试
|
||||||
|
// for (int i = 0; i < headerDetailsDtoList.size(); i++) {
|
||||||
|
// HeaderDetailsDto headerDetailsDto = headerDetailsDtoList.get(i);
|
||||||
|
// HeaderDto header = headerDetailsDto.getHeader();
|
||||||
|
// logger.info("CODE:" + header.getCode());
|
||||||
|
// }
|
||||||
logger.info("TOC数据返回行数:{}", headerDetailsDtoList.size());
|
logger.info("TOC数据返回行数:{}", headerDetailsDtoList.size());
|
||||||
if (headerDetailsDtoList.size() > 0) {
|
if (headerDetailsDtoList.size() > 0) {
|
||||||
getSetTran(headerDetailsDtoList);
|
getSetTran(headerDetailsDtoList);
|
||||||
|
|
|
@ -88,7 +88,10 @@ public class SoSaleOutPluginInitializerToBTest {
|
||||||
|
|
||||||
// soSaleOutPluginInitializerToB.startImplementByStockTime("2024-10-31 14:48:41", "2024-10-31 14:48:41");
|
// soSaleOutPluginInitializerToB.startImplementByStockTime("2024-10-31 14:48:41", "2024-10-31 14:48:41");
|
||||||
|
|
||||||
soSaleOutPluginInitializerToB.startImplementByCode("LETS-SH2024110500037199", "stock");
|
// soSaleOutPluginInitializerToB.startImplementByCode("LETS-SH2024110700026623", "stock");
|
||||||
|
|
||||||
|
|
||||||
|
soSaleOutPluginInitializerToB.startImplementByStockTime("2024-11-07 00:00:00", "2024-11-07 23:59:59");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
|
@ -112,7 +112,7 @@ class SoSaleOutPluginInitializerToCTest {
|
||||||
// String aaa = "LETS-SH2024102900016893";
|
// String aaa = "LETS-SH2024102900016893";
|
||||||
// soSaleOutPluginInitializerToC.startImplementStockByCode(aaa, "tran");
|
// soSaleOutPluginInitializerToC.startImplementStockByCode(aaa, "tran");
|
||||||
|
|
||||||
// soSaleOutPluginInitializerToC.startImplementStockByTime("2024-10-31 14:48:41", "2024-10-31 14:48:41");
|
soSaleOutPluginInitializerToC.startImplementTranByTime("2024-11-05 09:40:20", "2024-11-05 09:40:20");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
@ -121,7 +121,7 @@ class SoSaleOutPluginInitializerToCTest {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// soSaleOutPluginInitializerToC.startImplementStockByCode("LETS-SH2024091900002878", "stock");
|
// soSaleOutPluginInitializerToC.startImplementStockByCode("LETS-SH2024091900002878", "stock");
|
||||||
soSaleOutPluginInitializerToC.startImplementStockByCode("LETS-SH2024110300036490", "tran");
|
// soSaleOutPluginInitializerToC.startImplementStockByCode("LETS-SH2024110500029917", "tran");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue