From 283872320e09024524364ded464649a08d9fad3a Mon Sep 17 00:00:00 2001 From: liuy <37787198+LiuyCodes@users.noreply.github.com> Date: Sun, 20 Oct 2024 15:39:37 +0800 Subject: [PATCH] =?UTF-8?q?feat(buildpackage):=20=E7=94=A8=20def1=20?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E4=BB=A3=E6=9B=BF=20custcode=20=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=E8=BF=9B=E8=A1=8C=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在 BdCubasdocEntity 和 BdCumandocEntity 中添加 def1s 字段用于查询 - 更新 XML 文件中的 SQL 查询条件,使用 def1 替代 custcode - 修改缓存工具类和插件初始化器中的相关逻辑,使用 def1 替代 custcode - 优化测试方法,使用订单代码进行查询 --- .../frame/plugin/lets/entity/BdCubasdocEntity.java | 5 +++++ .../hzya/frame/plugin/lets/entity/BdCubasdocEntity.xml | 3 +++ .../frame/plugin/lets/entity/BdCumandocEntity.java | 5 +++++ .../hzya/frame/plugin/lets/entity/BdCumandocEntity.xml | 4 ++-- .../plugin/sales/SoSaleOutPluginInitializerToC.java | 2 +- .../lets/util/TocOrderBasicArchivesCacheUtil.java | 8 +++++--- .../lets/util/TocReturnBasicArchivesCacheUtil.java | 10 ++++++---- .../sales/SoSaleOutPluginInitializerToCTest.java | 4 +++- 8 files changed, 30 insertions(+), 11 deletions(-) diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/entity/BdCubasdocEntity.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/entity/BdCubasdocEntity.java index acf864e4..a518e5ec 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/entity/BdCubasdocEntity.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/entity/BdCubasdocEntity.java @@ -120,5 +120,10 @@ public class BdCubasdocEntity extends BaseEntity { * 多个编码查询 */ private String custcodes; + + /** + * O店铺编码 + */ + private String def1s; } diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/entity/BdCubasdocEntity.xml b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/entity/BdCubasdocEntity.xml index 1f413919..e46c0e15 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/entity/BdCubasdocEntity.xml +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/entity/BdCubasdocEntity.xml @@ -236,6 +236,9 @@ and custcode in (${custcodes}) + + and def1 in (${def1s}) + order by sorts asc order by ${sort} ${order} diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/entity/BdCumandocEntity.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/entity/BdCumandocEntity.java index 2539a9d6..1bdc44f7 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/entity/BdCumandocEntity.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/entity/BdCumandocEntity.java @@ -116,5 +116,10 @@ public class BdCumandocEntity extends BaseEntity { * 根据多个编码进行查询 */ private String custcodes; + + /** + * 多个def1进行查询 + */ + private String def1s; } diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/entity/BdCumandocEntity.xml b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/entity/BdCumandocEntity.xml index 29660942..825313d3 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/entity/BdCumandocEntity.xml +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/entity/BdCumandocEntity.xml @@ -294,9 +294,9 @@ and testsalemoney = #{testsalemoney} and ts = #{ts} and custflag in (${custflags}) - + and pk_cubasdoc in ( - select pk_cubasdoc from bd_cubasdoc where custcode in (${custcodes}) + select pk_cubasdoc from bd_cubasdoc where def1 in (${def1s}) ) 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 b09b47dd..ddedb147 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 @@ -1162,7 +1162,7 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity { //存货基本档案 BdInvbasdocEntity bdInvbasdocEntity = cacheTocMapVo.getStringBdInvbasdocEntityMap().get(detailsDto.getSkuCode()); - Assert.notNull(bdInvbasdocEntity, "无法匹配到存货基本档案 存货管理主键:{} 公司:{}", detailsDto.getSkuCode(), bdCorpEntity.getPkCorp()); + Assert.notNull(bdInvbasdocEntity, "无法匹配到存货基本档案 存货编码:{} 公司:{}", detailsDto.getSkuCode(), bdCorpEntity.getPkCorp()); //存货管理档案,是发货公司的存货档案 BdInvmandocEntity bdInvmandocEntity = cacheTocMapVo.getStringBdInvmandocEntityMap().get(detailsDto.getSkuCode() + bdCorpEntity.getPkCorp()); Assert.notNull(bdInvmandocEntity, "无法匹配到存货管理档案 货品sku:{} 公司:{}", detailsDto.getSkuCode(), bdCorpEntity.getPkCorp()); diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/util/TocOrderBasicArchivesCacheUtil.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/util/TocOrderBasicArchivesCacheUtil.java index 1c3cf484..5c76b126 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/util/TocOrderBasicArchivesCacheUtil.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/util/TocOrderBasicArchivesCacheUtil.java @@ -233,7 +233,7 @@ public class TocOrderBasicArchivesCacheUtil { BdCubasdocEntity bdCubasdocEntity = new BdCubasdocEntity(); bdCubasdocEntity.setDataSourceCode("lets_u8c"); bdCubasdocEntity.setDr(0L); - bdCubasdocEntity.setCustcodes(codesStr); + bdCubasdocEntity.setDef1s(codesStr); List bdCumandocEntityList = iBdCubasdocDao.query(bdCubasdocEntity); allBdCumandocEntityList.addAll(bdCumandocEntityList); } @@ -242,7 +242,9 @@ public class TocOrderBasicArchivesCacheUtil { if (allBdCumandocEntityList.size() > 0) { for (int i = 0; i < allBdCumandocEntityList.size(); i++) { BdCubasdocEntity bdCubasdocEntity = allBdCumandocEntityList.get(i); - stringBdCubasdocEntityMap.put(bdCubasdocEntity.getCustcode(), bdCubasdocEntity); + if (bdCubasdocEntity.getDef1() != null) { + stringBdCubasdocEntityMap.put(bdCubasdocEntity.getDef1(), bdCubasdocEntity); + } } } return stringBdCubasdocEntityMap; @@ -292,7 +294,7 @@ public class TocOrderBasicArchivesCacheUtil { BdCumandocEntity bdCumandocEntity = new BdCumandocEntity(); bdCumandocEntity.setDataSourceCode("lets_u8c"); bdCumandocEntity.setDr(0L); - bdCumandocEntity.setCustcodes(codesStr); + bdCumandocEntity.setDef1s(codesStr); List bdCumandocEntityList = iBdCumandocDao.query(bdCumandocEntity); allBdCumandocEntityList.addAll(bdCumandocEntityList); } diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/util/TocReturnBasicArchivesCacheUtil.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/util/TocReturnBasicArchivesCacheUtil.java index 8e004cb6..7eb733bb 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/util/TocReturnBasicArchivesCacheUtil.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/util/TocReturnBasicArchivesCacheUtil.java @@ -213,7 +213,7 @@ public class TocReturnBasicArchivesCacheUtil { Map stringBdCubasdocEntityMap = new HashMap<>(); List allBdCumandocEntityList = new ArrayList<>(); if (headerDtoList != null && headerDtoList.size() > 0) { - List> lists = SplitListByCountUtil.splitListByCount(headerDtoList, 500); + List> lists = SplitListByCountUtil.splitListByCount(headerDtoList, 900); for (int i = 0; i < lists.size(); i++) { List stockinHList = lists.get(i); String codesStr = stockinHList.stream().map(StockinOrderSearchResponse.StockinOrder.StockinH::getStoreCode).map(id -> "'" + id + "'").collect(Collectors.joining(",")); @@ -221,7 +221,7 @@ public class TocReturnBasicArchivesCacheUtil { BdCubasdocEntity bdCubasdocEntity = new BdCubasdocEntity(); bdCubasdocEntity.setDataSourceCode("lets_u8c"); bdCubasdocEntity.setDr(0L); - bdCubasdocEntity.setCustcodes(codesStr); + bdCubasdocEntity.setDef1s(codesStr); List bdCumandocEntityList = iBdCubasdocDao.query(bdCubasdocEntity); allBdCumandocEntityList.addAll(bdCumandocEntityList); } @@ -229,7 +229,9 @@ public class TocReturnBasicArchivesCacheUtil { if (allBdCumandocEntityList.size() > 0) { for (int i = 0; i < allBdCumandocEntityList.size(); i++) { BdCubasdocEntity bdCubasdocEntity = allBdCumandocEntityList.get(i); - stringBdCubasdocEntityMap.put(bdCubasdocEntity.getCustcode(), bdCubasdocEntity); + if (bdCubasdocEntity.getDef1() != null) { + stringBdCubasdocEntityMap.put(bdCubasdocEntity.getDef1(), bdCubasdocEntity); + } } } return stringBdCubasdocEntityMap; @@ -276,7 +278,7 @@ public class TocReturnBasicArchivesCacheUtil { BdCumandocEntity bdCumandocEntity = new BdCumandocEntity(); bdCumandocEntity.setDataSourceCode("lets_u8c"); bdCumandocEntity.setDr(0L); - bdCumandocEntity.setCustcodes(codesStr); + bdCumandocEntity.setDef1s(codesStr); List bdCumandocEntityList = iBdCumandocDao.query(bdCumandocEntity); allBdCumandocEntityList.addAll(bdCumandocEntityList); } 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 baea17e2..cfd6890f 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 @@ -96,7 +96,9 @@ class SoSaleOutPluginInitializerToCTest { // soSaleOutPluginInitializerToC.startImplementStockByCode(s, "stock"); try { - soSaleOutPluginInitializerToC.startImplementStockByTime("2024-10-17 00:00:00", "2024-10-17 23:59:59"); +// soSaleOutPluginInitializerToC.startImplementStockByTime("2024-10-17 00:00:00", "2024-10-17 23:59:59"); + String code = "LETS-SH2024101600027243"; + soSaleOutPluginInitializerToC.startImplementStockByCode(code, "stock"); } catch (Exception e) { e.printStackTrace(); }