feat(buildpackage): 用 def1 字段代替 custcode 字段进行查询

- 在 BdCubasdocEntity 和 BdCumandocEntity 中添加 def1s 字段用于查询
- 更新 XML 文件中的 SQL 查询条件,使用 def1 替代 custcode
- 修改缓存工具类和插件初始化器中的相关逻辑,使用 def1 替代 custcode
- 优化测试方法,使用订单代码进行查询
This commit is contained in:
liuy 2024-10-20 15:39:37 +08:00
parent 1979075bcb
commit 283872320e
8 changed files with 30 additions and 11 deletions

View File

@ -120,5 +120,10 @@ public class BdCubasdocEntity extends BaseEntity {
* 多个编码查询
*/
private String custcodes;
/**
* O店铺编码
*/
private String def1s;
}

View File

@ -236,6 +236,9 @@
<if test="custcodes!=null and custcodes!=''">
and custcode in (${custcodes})
</if>
<if test="def1s!=null and def1s!=''">
and def1 in (${def1s})
</if>
</trim>
<if test=" sort == ''.toString() "> order by sorts asc</if>
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>

View File

@ -116,5 +116,10 @@ public class BdCumandocEntity extends BaseEntity {
* 根据多个编码进行查询
*/
private String custcodes;
/**
* 多个def1进行查询
*/
private String def1s;
}

View File

@ -294,9 +294,9 @@
<if test="testsalemoney != null and testsalemoney != ''"> and testsalemoney = #{testsalemoney} </if>
<if test="ts != null and ts != ''"> and ts = #{ts} </if>
<if test="custflags!=null and custflags!=''">and custflag in (${custflags})</if>
<if test="custcodes!=null and custcodes!=''">
<if test="def1s!=null and def1s!=''">
and pk_cubasdoc in (
select pk_cubasdoc from bd_cubasdoc where custcode in (${custcodes})
select pk_cubasdoc from bd_cubasdoc where def1 in (${def1s})
)
</if>
</trim>

View File

@ -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());

View File

@ -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<BdCubasdocEntity> 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<BdCumandocEntity> bdCumandocEntityList = iBdCumandocDao.query(bdCumandocEntity);
allBdCumandocEntityList.addAll(bdCumandocEntityList);
}

View File

@ -213,7 +213,7 @@ public class TocReturnBasicArchivesCacheUtil {
Map<String, BdCubasdocEntity> stringBdCubasdocEntityMap = new HashMap<>();
List<BdCubasdocEntity> allBdCumandocEntityList = new ArrayList<>();
if (headerDtoList != null && headerDtoList.size() > 0) {
List<List<StockinOrderSearchResponse.StockinOrder.StockinH>> lists = SplitListByCountUtil.splitListByCount(headerDtoList, 500);
List<List<StockinOrderSearchResponse.StockinOrder.StockinH>> lists = SplitListByCountUtil.splitListByCount(headerDtoList, 900);
for (int i = 0; i < lists.size(); i++) {
List<StockinOrderSearchResponse.StockinOrder.StockinH> 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<BdCubasdocEntity> 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<BdCumandocEntity> bdCumandocEntityList = iBdCumandocDao.query(bdCumandocEntity);
allBdCumandocEntityList.addAll(bdCumandocEntityList);
}

View File

@ -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();
}