refactor(sales): 优化时间处理逻辑
- 在 SoSaleOutPluginInitializerToC 和 SoSaleReturnPluginInitializerToC 类中,增加了对时间格式的判断和处理- 当时间格式为 yyyy-MM-dd 时,自动补全时分秒,确保时间查询的准确性- 修复了因时间格式不统一导致的查询问题,提高了系统的健壮性和准确性
This commit is contained in:
parent
159800a716
commit
13580eac7a
|
@ -257,8 +257,16 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
|
||||||
//满足以下两个场景时:触发Mysql还原O销售出库的对象
|
//满足以下两个场景时:触发Mysql还原O销售出库的对象
|
||||||
//1:中台->u8c
|
//1:中台->u8c
|
||||||
TocofsSaleoutDetailedEntity tocofsSaleoutDetailedEntity = new TocofsSaleoutDetailedEntity();
|
TocofsSaleoutDetailedEntity tocofsSaleoutDetailedEntity = new TocofsSaleoutDetailedEntity();
|
||||||
tocofsSaleoutDetailedEntity.setBusinessDateStart(startTime);
|
if (startTime.length() == 19) {
|
||||||
tocofsSaleoutDetailedEntity.setBusinessDateEnd(endTime);
|
tocofsSaleoutDetailedEntity.setBusinessDateStart(startTime);
|
||||||
|
} else {
|
||||||
|
tocofsSaleoutDetailedEntity.setBusinessDateStart(startTime + " 00:00:00");
|
||||||
|
}
|
||||||
|
if (endTime.length() == 19) {
|
||||||
|
tocofsSaleoutDetailedEntity.setBusinessDateEnd(endTime);
|
||||||
|
} else {
|
||||||
|
tocofsSaleoutDetailedEntity.setBusinessDateEnd(endTime + " 23:59:59");
|
||||||
|
}
|
||||||
tocofsSaleoutDetailedEntity.setBusinesstype("TOC_ORDER");
|
tocofsSaleoutDetailedEntity.setBusinesstype("TOC_ORDER");
|
||||||
headerDetailsDtoList = queryTocOfsSaleoutDetailed(tocofsSaleoutDetailedEntity);
|
headerDetailsDtoList = queryTocOfsSaleoutDetailed(tocofsSaleoutDetailedEntity);
|
||||||
} else {
|
} else {
|
||||||
|
@ -449,8 +457,16 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
|
||||||
//满足以下两个场景时:触发Mysql还原O销售出库的对象
|
//满足以下两个场景时:触发Mysql还原O销售出库的对象
|
||||||
//1:中台->u8c
|
//1:中台->u8c
|
||||||
TocofsSaleoutDetailedEntity tocofsSaleoutDetailedEntity = new TocofsSaleoutDetailedEntity();
|
TocofsSaleoutDetailedEntity tocofsSaleoutDetailedEntity = new TocofsSaleoutDetailedEntity();
|
||||||
tocofsSaleoutDetailedEntity.setSuccessfultradedateStart(startTime);
|
if (startTime.length() == 19) {
|
||||||
tocofsSaleoutDetailedEntity.setSuccessfultradedateEnd(endTime);
|
tocofsSaleoutDetailedEntity.setSuccessfultradedateStart(startTime);
|
||||||
|
} else {
|
||||||
|
tocofsSaleoutDetailedEntity.setSuccessfultradedateStart(startTime + " 00:00:00");
|
||||||
|
}
|
||||||
|
if (endTime.length() == 19) {
|
||||||
|
tocofsSaleoutDetailedEntity.setSuccessfultradedateEnd(endTime);
|
||||||
|
} else {
|
||||||
|
tocofsSaleoutDetailedEntity.setSuccessfultradedateEnd(endTime + " 23:59:59");
|
||||||
|
}
|
||||||
tocofsSaleoutDetailedEntity.setBusinesstype("TOC_ORDER");
|
tocofsSaleoutDetailedEntity.setBusinesstype("TOC_ORDER");
|
||||||
headerDetailsDtoList = queryTocOfsSaleoutDetailed(tocofsSaleoutDetailedEntity);
|
headerDetailsDtoList = queryTocOfsSaleoutDetailed(tocofsSaleoutDetailedEntity);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -235,8 +235,16 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
|
||||||
ofsStandardUtil.queryOfsReturnGoods(queryOfsSoSaleOutVo, returnGoodHeaderDetailsDataDtoArrayList, 1L, "ofs.receipt.search");
|
ofsStandardUtil.queryOfsReturnGoods(queryOfsSoSaleOutVo, returnGoodHeaderDetailsDataDtoArrayList, 1L, "ofs.receipt.search");
|
||||||
} else if (ProfilesActiveConstant.PUSH_SCENE_TYPE_1.equals(pushScenarioType)) {
|
} else if (ProfilesActiveConstant.PUSH_SCENE_TYPE_1.equals(pushScenarioType)) {
|
||||||
TocofsReturngoodsDetailedEntity tocofsReturngoodsDetailedEntity = new TocofsReturngoodsDetailedEntity();
|
TocofsReturngoodsDetailedEntity tocofsReturngoodsDetailedEntity = new TocofsReturngoodsDetailedEntity();
|
||||||
tocofsReturngoodsDetailedEntity.setBusinessDateStart(startTime);
|
if (startTime.length() == 19) {
|
||||||
tocofsReturngoodsDetailedEntity.setBusinessDateEnd(endTime);
|
tocofsReturngoodsDetailedEntity.setBusinessDateStart(startTime);
|
||||||
|
} else {
|
||||||
|
tocofsReturngoodsDetailedEntity.setBusinessDateStart(startTime + " 00:00:00");
|
||||||
|
}
|
||||||
|
if (endTime.length() == 19) {
|
||||||
|
tocofsReturngoodsDetailedEntity.setBusinessDateEnd(endTime);
|
||||||
|
} else {
|
||||||
|
tocofsReturngoodsDetailedEntity.setBusinessDateEnd(endTime + " 23:59:59");
|
||||||
|
}
|
||||||
tocofsReturngoodsDetailedEntity.setBusinesstype("TOC_RETURN");
|
tocofsReturngoodsDetailedEntity.setBusinesstype("TOC_RETURN");
|
||||||
returnGoodHeaderDetailsDataDtoArrayList = queryTocofsReturngoodsDetailed(tocofsReturngoodsDetailedEntity);
|
returnGoodHeaderDetailsDataDtoArrayList = queryTocofsReturngoodsDetailed(tocofsReturngoodsDetailedEntity);
|
||||||
} else {
|
} else {
|
||||||
|
@ -356,8 +364,16 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
|
||||||
ofsStandardUtil.queryOfsReturnGoods(queryOfsSoSaleOutVo, returnGoodHeaderDetailsDataDtoArrayList, 1L, "ofs.receipt.search");
|
ofsStandardUtil.queryOfsReturnGoods(queryOfsSoSaleOutVo, returnGoodHeaderDetailsDataDtoArrayList, 1L, "ofs.receipt.search");
|
||||||
} else if (ProfilesActiveConstant.PUSH_SCENE_TYPE_1.equals(pushScenarioType)) {
|
} else if (ProfilesActiveConstant.PUSH_SCENE_TYPE_1.equals(pushScenarioType)) {
|
||||||
TocofsReturngoodsDetailedEntity tocofsReturngoodsDetailedEntity = new TocofsReturngoodsDetailedEntity();
|
TocofsReturngoodsDetailedEntity tocofsReturngoodsDetailedEntity = new TocofsReturngoodsDetailedEntity();
|
||||||
tocofsReturngoodsDetailedEntity.setRefundedAtStart(startTime);
|
if (startTime.length() == 19) {
|
||||||
tocofsReturngoodsDetailedEntity.setRefundedAtEnd(endTime);
|
tocofsReturngoodsDetailedEntity.setRefundedAtStart(startTime);
|
||||||
|
} else {
|
||||||
|
tocofsReturngoodsDetailedEntity.setRefundedAtStart(startTime + " 00:00:00");
|
||||||
|
}
|
||||||
|
if (endTime.length() == 19) {
|
||||||
|
tocofsReturngoodsDetailedEntity.setRefundedAtEnd(endTime);
|
||||||
|
} else {
|
||||||
|
tocofsReturngoodsDetailedEntity.setRefundedAtEnd(endTime + " 23:59:59");
|
||||||
|
}
|
||||||
tocofsReturngoodsDetailedEntity.setBusinesstype("TOC_RETURN");
|
tocofsReturngoodsDetailedEntity.setBusinesstype("TOC_RETURN");
|
||||||
returnGoodHeaderDetailsDataDtoArrayList = queryTocofsReturngoodsDetailed(tocofsReturngoodsDetailedEntity);
|
returnGoodHeaderDetailsDataDtoArrayList = queryTocofsReturngoodsDetailed(tocofsReturngoodsDetailedEntity);
|
||||||
} else {
|
} else {
|
||||||
|
@ -3083,7 +3099,7 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
|
||||||
List<TocofsReturngoodsDetailedEntity> tocofsReturngoodsDetailedEntityList1 = new ArrayList<>();
|
List<TocofsReturngoodsDetailedEntity> tocofsReturngoodsDetailedEntityList1 = new ArrayList<>();
|
||||||
for (int j = 0; j < tocofsReturngoodsDetailedEntityList.size(); j++) {
|
for (int j = 0; j < tocofsReturngoodsDetailedEntityList.size(); j++) {
|
||||||
TocofsReturngoodsDetailedEntity tocofsReturngoodsDetailedEntity1 = tocofsReturngoodsDetailedEntityList.get(j);
|
TocofsReturngoodsDetailedEntity tocofsReturngoodsDetailedEntity1 = tocofsReturngoodsDetailedEntityList.get(j);
|
||||||
if (tocofsReturngoodsDetailedEntity.getMaintableid().equals(tocofsReturngoodsEntity.getId())) {
|
if (tocofsReturngoodsDetailedEntity1.getMaintableid().equals(tocofsReturngoodsEntity.getId())) {
|
||||||
tocofsReturngoodsDetailedEntityList1.add(tocofsReturngoodsDetailedEntity1);
|
tocofsReturngoodsDetailedEntityList1.add(tocofsReturngoodsDetailedEntity1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,7 +46,7 @@ public class SoSaleReturnPluginInitializerToCTest {
|
||||||
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
soSaleReturnPluginInitializerToC.startImplementStockByTime("2024-12-24 16:02:17", "2024-12-24 16:02:17","0");
|
soSaleReturnPluginInitializerToC.startImplementStockByTime("2024-12-24 16:02:17", "2024-12-24 16:02:17", "2");
|
||||||
|
|
||||||
// JSONObject jsonObject = new JSONObject();
|
// JSONObject jsonObject = new JSONObject();
|
||||||
// soSaleReturnPluginInitializerToC.executeBusiness(jsonObject);
|
// soSaleReturnPluginInitializerToC.executeBusiness(jsonObject);
|
||||||
|
|
Loading…
Reference in New Issue