日志优化与测试用例时间参数化

- 扩展日志信息,使其包含插件名称、O接口返回行数及时间范围。
- 将现有测试代码中的硬编码时间替换为参数,以便于灵活测试。
- 通过这些改动,提高了日志的可读性,并使测试用例更加通用。
This commit is contained in:
liuy 2024-09-24 14:11:05 +08:00
parent b7139d7c1d
commit 9d4447ae7a
10 changed files with 20 additions and 14 deletions

View File

@ -192,7 +192,7 @@ public class ConsignmachiningIn extends PluginBaseEntity {
queryOfsSoSaleOutVo.setInternalInstructionType("PURCHASE"); queryOfsSoSaleOutVo.setInternalInstructionType("PURCHASE");
queryOfsSoSaleOutVo.setStatus(900L); queryOfsSoSaleOutVo.setStatus(900L);
ofsStandardUtil.queryOfsReturnGoods(queryOfsSoSaleOutVo, returnGoodHeaderDetailsDataDtoArrayList, 1L, "ofs.receipt.search"); ofsStandardUtil.queryOfsReturnGoods(queryOfsSoSaleOutVo, returnGoodHeaderDetailsDataDtoArrayList, 1L, "ofs.receipt.search");
logger.info("数据返回行数:{}", returnGoodHeaderDetailsDataDtoArrayList.size()); logger.info("插件:{} O接口返回行数{} 时间段:{} {}", getPluginName(), returnGoodHeaderDetailsDataDtoArrayList.size(), startTime, endTime);
if (returnGoodHeaderDetailsDataDtoArrayList.size() > 0) { if (returnGoodHeaderDetailsDataDtoArrayList.size() > 0) {
getSet(returnGoodHeaderDetailsDataDtoArrayList); getSet(returnGoodHeaderDetailsDataDtoArrayList);
} else { } else {

View File

@ -195,7 +195,7 @@ public class ConsignmachiningInReturn extends PluginBaseEntity {
queryOfsSoSaleOutVo.setInternalInstructionType("PURCHASE_RETURN"); queryOfsSoSaleOutVo.setInternalInstructionType("PURCHASE_RETURN");
queryOfsSoSaleOutVo.setStatus(900L); queryOfsSoSaleOutVo.setStatus(900L);
ofsStandardUtil.queryOfsSaleOrder(queryOfsSoSaleOutVo, returnGoodHeaderDetailsDataDtoArrayList, 1L, "ofs.shipment.search"); ofsStandardUtil.queryOfsSaleOrder(queryOfsSoSaleOutVo, returnGoodHeaderDetailsDataDtoArrayList, 1L, "ofs.shipment.search");
logger.info("数据返回行数:{}", returnGoodHeaderDetailsDataDtoArrayList.size()); logger.info("插件:{} O接口返回行数{} 时间段:{} {}", getPluginName(), returnGoodHeaderDetailsDataDtoArrayList.size(), startTime, endTime);
if (returnGoodHeaderDetailsDataDtoArrayList.size() > 0) { if (returnGoodHeaderDetailsDataDtoArrayList.size() > 0) {
getSet(returnGoodHeaderDetailsDataDtoArrayList); getSet(returnGoodHeaderDetailsDataDtoArrayList);
} else { } else {

View File

@ -184,15 +184,15 @@ public class ProxyPurchaseReturn extends PluginBaseEntity {
//OFS采退出库 //OFS采退出库
List<HeaderDetailsDto> returnGoodHeaderDetailsDataDtoArrayList = new ArrayList<>(); List<HeaderDetailsDto> returnGoodHeaderDetailsDataDtoArrayList = new ArrayList<>();
QueryOfsSoSaleOutVo queryOfsSoSaleOutVo = new QueryOfsSoSaleOutVo(); QueryOfsSoSaleOutVo queryOfsSoSaleOutVo = new QueryOfsSoSaleOutVo();
queryOfsSoSaleOutVo.setAuditAt_start(startTime); queryOfsSoSaleOutVo.setShipAt_start(startTime);
queryOfsSoSaleOutVo.setAuditAt_end(endTime); queryOfsSoSaleOutVo.setShipAt_end(endTime);
queryOfsSoSaleOutVo.setClientCode("LETS"); queryOfsSoSaleOutVo.setClientCode("LETS");
queryOfsSoSaleOutVo.setPageNo(1L); queryOfsSoSaleOutVo.setPageNo(1L);
queryOfsSoSaleOutVo.setPageSize(50L); queryOfsSoSaleOutVo.setPageSize(50L);
queryOfsSoSaleOutVo.setInternalInstructionType("PURCHASE_RETURN"); queryOfsSoSaleOutVo.setInternalInstructionType("PURCHASE_RETURN");
queryOfsSoSaleOutVo.setStatus(900L); queryOfsSoSaleOutVo.setStatus(900L);
ofsStandardUtil.queryOfsSaleOrder(queryOfsSoSaleOutVo, returnGoodHeaderDetailsDataDtoArrayList, 1L, "ofs.shipment.search"); ofsStandardUtil.queryOfsSaleOrder(queryOfsSoSaleOutVo, returnGoodHeaderDetailsDataDtoArrayList, 1L, "ofs.shipment.search");
logger.info("数据返回行数:{}", returnGoodHeaderDetailsDataDtoArrayList.size()); logger.info("插件:{} O接口返回行数{} 时间段:{} {}", getPluginName(), returnGoodHeaderDetailsDataDtoArrayList.size(), startTime, endTime);
if (returnGoodHeaderDetailsDataDtoArrayList.size() > 0) { if (returnGoodHeaderDetailsDataDtoArrayList.size() > 0) {
getSet(returnGoodHeaderDetailsDataDtoArrayList); getSet(returnGoodHeaderDetailsDataDtoArrayList);
} else { } else {

View File

@ -188,7 +188,7 @@ public class ProxyPurchaseWarehousOrder extends PluginBaseEntity {
queryOfsSoSaleOutVo.setPageNo(1L); queryOfsSoSaleOutVo.setPageNo(1L);
queryOfsSoSaleOutVo.setStatus(900L); queryOfsSoSaleOutVo.setStatus(900L);
ofsStandardUtil.queryOfsPoOrder(queryOfsSoSaleOutVo, allOfsPoOrderList, 1L); ofsStandardUtil.queryOfsPoOrder(queryOfsSoSaleOutVo, allOfsPoOrderList, 1L);
logger.info("数据返回行数:{}", allOfsPoOrderList.size()); logger.info("插件:{} O接口返回行数{} 时间段:{} {}", getPluginName(), allOfsPoOrderList.size(), startTime, endTime);
if (allOfsPoOrderList.size() > 0) { if (allOfsPoOrderList.size() > 0) {
getSet(allOfsPoOrderList); getSet(allOfsPoOrderList);
} else { } else {

View File

@ -188,7 +188,7 @@ public class ProxyPurchaseWarehousWarehouse extends PluginBaseEntity {
queryOfsSoSaleOutVo.setInternalInstructionType("PURCHASE"); queryOfsSoSaleOutVo.setInternalInstructionType("PURCHASE");
queryOfsSoSaleOutVo.setStatus(900L); queryOfsSoSaleOutVo.setStatus(900L);
ofsStandardUtil.queryOfsReturnGoods(queryOfsSoSaleOutVo, returnGoodHeaderDetailsDataDtoArrayList, 1L, "ofs.receipt.search"); ofsStandardUtil.queryOfsReturnGoods(queryOfsSoSaleOutVo, returnGoodHeaderDetailsDataDtoArrayList, 1L, "ofs.receipt.search");
logger.info("数据返回行数:{}", returnGoodHeaderDetailsDataDtoArrayList.size()); logger.info("插件:{} O接口返回行数{} 时间段:{} {}", getPluginName(), returnGoodHeaderDetailsDataDtoArrayList.size(), startTime, endTime);
if (returnGoodHeaderDetailsDataDtoArrayList.size() > 0) { if (returnGoodHeaderDetailsDataDtoArrayList.size() > 0) {
getSet(returnGoodHeaderDetailsDataDtoArrayList); getSet(returnGoodHeaderDetailsDataDtoArrayList);
} else { } else {

View File

@ -243,7 +243,7 @@ public class SoSaleOutPluginInitializerToB extends PluginBaseEntity {
queryOfsSoSaleOutVo.setStoreCode(tobShop); queryOfsSoSaleOutVo.setStoreCode(tobShop);
// queryOfsSoSaleOutVo.setCode("LETS-SH2024010200000004"); // queryOfsSoSaleOutVo.setCode("LETS-SH2024010200000004");
ofsStandardUtil.queryOfsSaleOrder(queryOfsSoSaleOutVo, headerDetailsDtoList, 1L, "ofs.shipment.search"); ofsStandardUtil.queryOfsSaleOrder(queryOfsSoSaleOutVo, headerDetailsDtoList, 1L, "ofs.shipment.search");
logger.info("数据返回行数:{}", headerDetailsDtoList.size()); logger.info("插件:{} (库存)O接口返回行数{} 时间段:{} {}", getPluginName(), headerDetailsDtoList.size(), startTime, endTime);
if (headerDetailsDtoList.size() > 0) { if (headerDetailsDtoList.size() > 0) {
getSetStock(headerDetailsDtoList); getSetStock(headerDetailsDtoList);
} else { } else {
@ -298,7 +298,7 @@ public class SoSaleOutPluginInitializerToB extends PluginBaseEntity {
queryOfsSoSaleOutVo.setPageSize(50L); queryOfsSoSaleOutVo.setPageSize(50L);
queryOfsSoSaleOutVo.setStoreCode(tobShop); queryOfsSoSaleOutVo.setStoreCode(tobShop);
ofsStandardUtil.queryOfsSaleOrder(queryOfsSoSaleOutVo, headerDetailsDtoList, 1L, "ofs.shipment.search"); ofsStandardUtil.queryOfsSaleOrder(queryOfsSoSaleOutVo, headerDetailsDtoList, 1L, "ofs.shipment.search");
logger.info("数据返回行数:{}", headerDetailsDtoList.size()); logger.info("插件:{} (确认收入)O接口返回行数{} 时间段:{} {}", getPluginName(), headerDetailsDtoList.size(), startTime, endTime);
if (headerDetailsDtoList.size() > 0) { if (headerDetailsDtoList.size() > 0) {
getSetStockTran(headerDetailsDtoList); getSetStockTran(headerDetailsDtoList);
} else { } else {

View File

@ -247,7 +247,7 @@ public class SoSaleReturnPluginInitializerToB extends PluginBaseEntity {
queryOfsSoSaleOutVo.setInternalInstructionType("RETURN"); queryOfsSoSaleOutVo.setInternalInstructionType("RETURN");
// queryOfsSoSaleOutVo.setCode("LETS-RE2024081900000001"); // queryOfsSoSaleOutVo.setCode("LETS-RE2024081900000001");
ofsStandardUtil.queryOfsReturnGoods(queryOfsSoSaleOutVo, returnGoodHeaderDetailsDataDtoArrayList, 1L, "ofs.receipt.search"); ofsStandardUtil.queryOfsReturnGoods(queryOfsSoSaleOutVo, returnGoodHeaderDetailsDataDtoArrayList, 1L, "ofs.receipt.search");
logger.info("数据返回行数:{}", returnGoodHeaderDetailsDataDtoArrayList.size()); logger.info("插件:{} (库存)O接口返回行数{} 时间段:{} {}", getPluginName(), returnGoodHeaderDetailsDataDtoArrayList.size(), startTime, endTime);
if (returnGoodHeaderDetailsDataDtoArrayList.size() > 0) { if (returnGoodHeaderDetailsDataDtoArrayList.size() > 0) {
getSetStock(returnGoodHeaderDetailsDataDtoArrayList); getSetStock(returnGoodHeaderDetailsDataDtoArrayList);
} else { } else {
@ -303,7 +303,7 @@ public class SoSaleReturnPluginInitializerToB extends PluginBaseEntity {
queryOfsSoSaleOutVo.setRefundStatus("900"); queryOfsSoSaleOutVo.setRefundStatus("900");
// queryOfsSoSaleOutVo.setCode("LETS-RE2024081900000001"); // queryOfsSoSaleOutVo.setCode("LETS-RE2024081900000001");
ofsStandardUtil.queryOfsReturnGoods(queryOfsSoSaleOutVo, returnGoodHeaderDetailsDataDtoArrayList, 1L, "ofs.receipt.search"); ofsStandardUtil.queryOfsReturnGoods(queryOfsSoSaleOutVo, returnGoodHeaderDetailsDataDtoArrayList, 1L, "ofs.receipt.search");
logger.info("数据返回行数:{}", returnGoodHeaderDetailsDataDtoArrayList.size()); logger.info("插件:{} (确认收入)O接口返回行数{} 时间段:{} {}", getPluginName(), returnGoodHeaderDetailsDataDtoArrayList.size(), startTime, endTime);
if (returnGoodHeaderDetailsDataDtoArrayList.size() > 0) { if (returnGoodHeaderDetailsDataDtoArrayList.size() > 0) {
getSetTrade(returnGoodHeaderDetailsDataDtoArrayList); getSetTrade(returnGoodHeaderDetailsDataDtoArrayList);
} else { } else {

View File

@ -27,7 +27,9 @@ public class ConsignmachiningInTest {
@Test @Test
public void startImplement() { public void startImplement() {
// String code = "LETS-RE2024082300000007"; // String code = "LETS-RE2024082300000007";
String code = "LETS-RE2024090300000001"; // String code = "LETS-RE2024090300000001";
consignmachiningIn.startImplement(code); // consignmachiningIn.startImplement(code);
consignmachiningIn.startImplement("2024-09-24 13:49:15", "2024-09-24 13:49:17");
} }
} }

View File

@ -32,6 +32,8 @@ public class ProxyPurchaseReturnTest {
// proxyPurchaseReturn.u8cOperationFlow(); // proxyPurchaseReturn.u8cOperationFlow();
proxyPurchaseReturn.startImplement("2024-09-24 13:49:15", "2024-09-24 13:49:17");
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }

View File

@ -27,7 +27,9 @@ public class ProxyPurchaseWarehousOrderTest {
@Test @Test
public void startImplementByCode() { public void startImplementByCode() {
try { try {
proxyPurchaseWarehousOrder.startImplementByCode("LETS-PO2024091800000002"); // proxyPurchaseWarehousOrder.startImplementByCode("LETS-PO2024091800000002");
proxyPurchaseWarehousOrder.startImplementByTime("2024-09-24 13:49:15", "2024-09-24 13:49:17");
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }