refactor(buildpackage): 移除公司代码替换逻辑

- 删除了多个文件中的公司代码替换逻辑- 直接使用原始公司代码进行查询和匹配
- 移除了不必要的注释和冗余代码
This commit is contained in:
liuy 2024-12-15 13:42:59 +08:00
parent c06610b90c
commit a3b5105729
9 changed files with 50 additions and 50 deletions

View File

@ -594,12 +594,12 @@ public class ConsignmachiningIn extends PluginBaseEntity {
//委外订单表头公司 //委外订单表头公司
String companyCode = header.getCompanyCode(); String companyCode = header.getCompanyCode();
Assert.notNull(companyCode, "O表头公司不能为空(物理货主)"); Assert.notNull(companyCode, "O表头公司不能为空(物理货主)");
String replaceCompanyCode = queryU8CEntityUtil.queryBdDefDocByPkDefDocList(companyCode.trim()); // String replaceCompanyCode = queryU8CEntityUtil.queryBdDefDocByPkDefDocList(companyCode.trim());
BdCorpEntity bdCorpEntity = new BdCorpEntity(); BdCorpEntity bdCorpEntity = new BdCorpEntity();
bdCorpEntity.setDr(0); bdCorpEntity.setDr(0);
bdCorpEntity.setDataSourceCode("lets_u8c"); bdCorpEntity.setDataSourceCode("lets_u8c");
bdCorpEntity.setUnitcode(replaceCompanyCode); bdCorpEntity.setUnitcode(companyCode);
List<BdCorpEntity> bdCorpEntityList = iBdCorpDao.query(bdCorpEntity); List<BdCorpEntity> bdCorpEntityList = iBdCorpDao.query(bdCorpEntity);
if (bdCorpEntityList.size() == 0) { if (bdCorpEntityList.size() == 0) {
Assert.state(false, "根据O货主编码{}无法匹配到U8C委外订单公司", companyCode); Assert.state(false, "根据O货主编码{}无法匹配到U8C委外订单公司", companyCode);

View File

@ -580,13 +580,13 @@ public class ConsignmachiningInReturn extends PluginBaseEntity {
//得到原始的公司编码 //得到原始的公司编码
BdCorpEntity bdCorpEntity1 = oldBdCorpEntityList.get(0); BdCorpEntity bdCorpEntity1 = oldBdCorpEntityList.get(0);
String unitcode = bdCorpEntity1.getUnitcode(); String unitcode = bdCorpEntity1.getUnitcode();
String replaceCompanyCode = queryU8CEntityUtil.queryBdDefDocByPkDefDocList(unitcode.trim()); // String replaceCompanyCode = queryU8CEntityUtil.queryBdDefDocByPkDefDocList(unitcode.trim());
Assert.notNull(replaceCompanyCode, "replaceCompanyCode不能为空"); // Assert.notNull(replaceCompanyCode, "replaceCompanyCode不能为空");
BdCorpEntity bdCorpEntity2 = new BdCorpEntity(); BdCorpEntity bdCorpEntity2 = new BdCorpEntity();
bdCorpEntity2.setDr(0); bdCorpEntity2.setDr(0);
bdCorpEntity2.setDataSourceCode("lets_u8c"); bdCorpEntity2.setDataSourceCode("lets_u8c");
bdCorpEntity2.setUnitcode(replaceCompanyCode); bdCorpEntity2.setUnitcode(unitcode);
List<BdCorpEntity> bdCorpEntityList = iBdCorpDao.query(bdCorpEntity2); List<BdCorpEntity> bdCorpEntityList = iBdCorpDao.query(bdCorpEntity2);
if (bdCorpEntityList.size() == 0) { if (bdCorpEntityList.size() == 0) {
Assert.state(false, "(原始公司替换之后)根据委外订单公司主键:{},无法匹配到对应的公司", scOrderEntity.getPkCorp()); Assert.state(false, "(原始公司替换之后)根据委外订单公司主键:{},无法匹配到对应的公司", scOrderEntity.getPkCorp());

View File

@ -630,18 +630,18 @@ public class ProxyPurchaseReturn extends PluginBaseEntity {
//采购公司 //采购公司
String companyCode = header.getCompanyCode(); String companyCode = header.getCompanyCode();
Assert.notNull(companyCode, "O表头公司不能为空"); Assert.notNull(companyCode, "O表头公司不能为空");
String replaceCompanyCode = queryU8CEntityUtil.queryBdDefDocByPkDefDocList(companyCode.trim()); // String replaceCompanyCode = queryU8CEntityUtil.queryBdDefDocByPkDefDocList(companyCode.trim());
Assert.notNull(replaceCompanyCode, "replaceCompanyCode不能为空"); // Assert.notNull(replaceCompanyCode, "replaceCompanyCode不能为空");
BdCorpEntity bdCorpEntity = new BdCorpEntity(); BdCorpEntity bdCorpEntity = new BdCorpEntity();
bdCorpEntity.setDr(0); bdCorpEntity.setDr(0);
bdCorpEntity.setDataSourceCode("lets_u8c"); bdCorpEntity.setDataSourceCode("lets_u8c");
bdCorpEntity.setUnitcode(replaceCompanyCode); bdCorpEntity.setUnitcode(companyCode);
List<BdCorpEntity> bdCorpEntityList = iBdCorpDao.query(bdCorpEntity); List<BdCorpEntity> bdCorpEntityList = iBdCorpDao.query(bdCorpEntity);
if (bdCorpEntityList.size() == 0) { if (bdCorpEntityList.size() == 0) {
Assert.state(false, "根据O货主编码{}无法匹配到U8C销售公司", replaceCompanyCode); Assert.state(false, "根据O货主编码{}无法匹配到U8C销售公司", companyCode);
} else if (bdCorpEntityList.size() >= 2) { } else if (bdCorpEntityList.size() >= 2) {
Assert.state(false, "根据O货主编码{}匹配到U8C销售公司{}个", replaceCompanyCode, bdCorpEntityList.size()); Assert.state(false, "根据O货主编码{}匹配到U8C销售公司{}个", companyCode, bdCorpEntityList.size());
} }
//采购部门业务部门 //采购部门业务部门

View File

@ -619,19 +619,19 @@ public class ProxyPurchaseWarehousOrder extends PluginBaseEntity {
//先完成采购公司编码的转换逻辑 //先完成采购公司编码的转换逻辑
String companyCode = header.getCompanyCode(); String companyCode = header.getCompanyCode();
Assert.notNull(companyCode, "O表头公司不能为空"); Assert.notNull(companyCode, "O表头公司不能为空");
String replaceCompanyCode = queryU8CEntityUtil.queryBdDefDocByPkDefDocList(companyCode.trim()); // String replaceCompanyCode = queryU8CEntityUtil.queryBdDefDocByPkDefDocList(companyCode.trim());
Assert.notNull(replaceCompanyCode, "replaceCompanyCode不能为空"); // Assert.notNull(replaceCompanyCode, "replaceCompanyCode不能为空");
//采购公司 //采购公司
BdCorpEntity bdCorpEntity = new BdCorpEntity(); BdCorpEntity bdCorpEntity = new BdCorpEntity();
bdCorpEntity.setDr(0); bdCorpEntity.setDr(0);
bdCorpEntity.setDataSourceCode("lets_u8c"); bdCorpEntity.setDataSourceCode("lets_u8c");
bdCorpEntity.setUnitcode(replaceCompanyCode); bdCorpEntity.setUnitcode(companyCode);
List<BdCorpEntity> bdCorpEntityList = iBdCorpDao.query(bdCorpEntity); List<BdCorpEntity> bdCorpEntityList = iBdCorpDao.query(bdCorpEntity);
if (bdCorpEntityList.size() == 0) { if (bdCorpEntityList.size() == 0) {
Assert.state(false, "根据O货主编码{}无法匹配到U8C销售公司", replaceCompanyCode); Assert.state(false, "根据O货主编码{}无法匹配到U8C销售公司", companyCode);
} else if (bdCorpEntityList.size() >= 2) { } else if (bdCorpEntityList.size() >= 2) {
Assert.state(false, "根据O货主编码{}匹配到U8C销售公司{}个", replaceCompanyCode, bdCorpEntityList.size()); Assert.state(false, "根据O货主编码{}匹配到U8C销售公司{}个", companyCode, bdCorpEntityList.size());
} }
//采购部门业务部门 //采购部门业务部门

View File

@ -634,18 +634,18 @@ public class ProxyPurchaseWarehousWarehouse extends PluginBaseEntity {
//采购公司 //采购公司
String companyCode = header.getCompanyCode(); String companyCode = header.getCompanyCode();
Assert.notNull(companyCode, "O表头公司不能为空"); Assert.notNull(companyCode, "O表头公司不能为空");
String replaceCompanyCode = queryU8CEntityUtil.queryBdDefDocByPkDefDocList(companyCode.trim()); // String replaceCompanyCode = queryU8CEntityUtil.queryBdDefDocByPkDefDocList(companyCode.trim());
Assert.notNull(replaceCompanyCode, "replaceCompanyCode不能为空"); // Assert.notNull(replaceCompanyCode, "replaceCompanyCode不能为空");
BdCorpEntity bdCorpEntity = new BdCorpEntity(); BdCorpEntity bdCorpEntity = new BdCorpEntity();
bdCorpEntity.setDr(0); bdCorpEntity.setDr(0);
bdCorpEntity.setDataSourceCode("lets_u8c"); bdCorpEntity.setDataSourceCode("lets_u8c");
bdCorpEntity.setUnitcode(replaceCompanyCode); bdCorpEntity.setUnitcode(companyCode);
List<BdCorpEntity> bdCorpEntityList = iBdCorpDao.query(bdCorpEntity); List<BdCorpEntity> bdCorpEntityList = iBdCorpDao.query(bdCorpEntity);
if (bdCorpEntityList.size() == 0) { if (bdCorpEntityList.size() == 0) {
Assert.state(false, "根据O货主编码{}无法匹配到U8C销售公司", replaceCompanyCode); Assert.state(false, "根据O货主编码{}无法匹配到U8C销售公司", companyCode);
} else if (bdCorpEntityList.size() >= 2) { } else if (bdCorpEntityList.size() >= 2) {
Assert.state(false, "根据O货主编码{}匹配到U8C销售公司{}个", replaceCompanyCode, bdCorpEntityList.size()); Assert.state(false, "根据O货主编码{}匹配到U8C销售公司{}个", companyCode, bdCorpEntityList.size());
} }
//采购部门业务部门 //采购部门业务部门

View File

@ -1067,18 +1067,18 @@ public class SoSaleOutPluginInitializerToB extends PluginBaseEntity {
// 销售公司发货公司 // 销售公司发货公司
String companyCode = header.getCompanyCode(); String companyCode = header.getCompanyCode();
Assert.notNull(companyCode, "O表头公司不能为空"); Assert.notNull(companyCode, "O表头公司不能为空");
String replaceCompanyCode = queryU8CEntityUtil.queryBdDefDocByPkDefDocList(companyCode.trim()); // String replaceCompanyCode = queryU8CEntityUtil.queryBdDefDocByPkDefDocList(companyCode.trim());
Assert.notNull(replaceCompanyCode, "replaceCompanyCode不能为空"); // Assert.notNull(replaceCompanyCode, "replaceCompanyCode不能为空");
BdCorpEntity bdCorpEntity = new BdCorpEntity(); BdCorpEntity bdCorpEntity = new BdCorpEntity();
bdCorpEntity.setDr(0); bdCorpEntity.setDr(0);
bdCorpEntity.setDataSourceCode("lets_u8c"); bdCorpEntity.setDataSourceCode("lets_u8c");
bdCorpEntity.setUnitcode(replaceCompanyCode); bdCorpEntity.setUnitcode(companyCode);
List<BdCorpEntity> bdCorpEntityList = iBdCorpDao.query(bdCorpEntity); List<BdCorpEntity> bdCorpEntityList = iBdCorpDao.query(bdCorpEntity);
if (bdCorpEntityList.size() == 0) { if (bdCorpEntityList.size() == 0) {
Assert.state(false, "根据O货主编码{}无法匹配到U8C销售公司", replaceCompanyCode); Assert.state(false, "根据O货主编码{}无法匹配到U8C销售公司", companyCode);
} else if (bdCorpEntityList.size() >= 2) { } else if (bdCorpEntityList.size() >= 2) {
Assert.state(false, "根据O货主编码{}匹配到U8C销售公司{}个", replaceCompanyCode, bdCorpEntityList.size()); Assert.state(false, "根据O货主编码{}匹配到U8C销售公司{}个", companyCode, bdCorpEntityList.size());
} }
// 发货库存组织 // 发货库存组织
@ -1630,18 +1630,18 @@ public class SoSaleOutPluginInitializerToB extends PluginBaseEntity {
// header.setCompanyCode("SHLZ"); // header.setCompanyCode("SHLZ");
String companyCode = header.getCompanyCode(); String companyCode = header.getCompanyCode();
Assert.notNull(companyCode, "O表头公司不能为空"); Assert.notNull(companyCode, "O表头公司不能为空");
String replaceCompanyCode = queryU8CEntityUtil.queryBdDefDocByPkDefDocList(companyCode.trim()); // String replaceCompanyCode = queryU8CEntityUtil.queryBdDefDocByPkDefDocList(companyCode.trim());
Assert.notNull(replaceCompanyCode, "replaceCompanyCode不能为空"); // Assert.notNull(replaceCompanyCode, "replaceCompanyCode不能为空");
BdCorpEntity bdCorpEntity = new BdCorpEntity(); BdCorpEntity bdCorpEntity = new BdCorpEntity();
bdCorpEntity.setDr(0); bdCorpEntity.setDr(0);
bdCorpEntity.setDataSourceCode("lets_u8c"); bdCorpEntity.setDataSourceCode("lets_u8c");
bdCorpEntity.setUnitcode(replaceCompanyCode); bdCorpEntity.setUnitcode(companyCode);
List<BdCorpEntity> bdCorpEntityList = iBdCorpDao.query(bdCorpEntity); List<BdCorpEntity> bdCorpEntityList = iBdCorpDao.query(bdCorpEntity);
if (bdCorpEntityList.size() == 0) { if (bdCorpEntityList.size() == 0) {
Assert.state(false, "根据O货主编码{}无法匹配到U8C销售公司", replaceCompanyCode); Assert.state(false, "根据O货主编码{}无法匹配到U8C销售公司", companyCode);
} else if (bdCorpEntityList.size() >= 2) { } else if (bdCorpEntityList.size() >= 2) {
Assert.state(false, "根据O货主编码{}匹配到U8C销售公司{}个", replaceCompanyCode, bdCorpEntityList.size()); Assert.state(false, "根据O货主编码{}匹配到U8C销售公司{}个", companyCode, bdCorpEntityList.size());
} }
// 发货库存组织 // 发货库存组织

View File

@ -1347,7 +1347,7 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
//计算OFS销售订单邮费分摊 //计算OFS销售订单邮费分摊
ofsOrderSalePostageFeeAllocationUtil.batchTocSalesPostageFeeAllocation(headerDetailsDtos); ofsOrderSalePostageFeeAllocationUtil.batchTocSalesPostageFeeAllocation(headerDetailsDtos);
//初始化公司档案对照关系 //初始化公司档案对照关系
Map<String, String> comparisonCompanyArchives = queryU8CEntityUtil.queryBdDefDocByPkDefDocAll(); // Map<String, String> comparisonCompanyArchives = queryU8CEntityUtil.queryBdDefDocByPkDefDocAll();
for (int i = 0; i < headerDetailsDtoList.size(); i++) { for (int i = 0; i < headerDetailsDtoList.size(); i++) {
HeaderDetailsDto headerDetailsDto = headerDetailsDtoList.get(i); HeaderDetailsDto headerDetailsDto = headerDetailsDtoList.get(i);
@ -1375,10 +1375,10 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
Assert.notNull(companyCode, "O出库单表头货主不能为空"); Assert.notNull(companyCode, "O出库单表头货主不能为空");
//查找是否替换公司 //查找是否替换公司
String targetCorp = comparisonCompanyArchives.get(companyCode); // String targetCorp = comparisonCompanyArchives.get(companyCode);
if (targetCorp != null) { // if (targetCorp != null) {
companyCode = targetCorp; // companyCode = targetCorp;
} // }
BdCorpEntity bdCorpEntity = cacheTocMapVo.getStringBdCorpEntityMap().get(companyCode.trim()); BdCorpEntity bdCorpEntity = cacheTocMapVo.getStringBdCorpEntityMap().get(companyCode.trim());
Assert.notNull(bdCorpEntity, "根据公司编码({})没有匹配到U8C公司档案(公司编码=O货主)", companyCode); Assert.notNull(bdCorpEntity, "根据公司编码({})没有匹配到U8C公司档案(公司编码=O货主)", companyCode);

View File

@ -1017,18 +1017,18 @@ public class SoSaleReturnPluginInitializerToB extends PluginBaseEntity {
String companyCode = header.getCompanyCode(); String companyCode = header.getCompanyCode();
Assert.notNull(companyCode, "O表头公司不能为空"); Assert.notNull(companyCode, "O表头公司不能为空");
String replaceCompanyCode = queryU8CEntityUtil.queryBdDefDocByPkDefDocList(companyCode.trim()); // String replaceCompanyCode = queryU8CEntityUtil.queryBdDefDocByPkDefDocList(companyCode.trim());
Assert.notNull(replaceCompanyCode, "replaceCompanyCode不能为空"); // Assert.notNull(replaceCompanyCode, "replaceCompanyCode不能为空");
BdCorpEntity bdCorpEntity = new BdCorpEntity(); BdCorpEntity bdCorpEntity = new BdCorpEntity();
bdCorpEntity.setDr(0); bdCorpEntity.setDr(0);
bdCorpEntity.setDataSourceCode("lets_u8c"); bdCorpEntity.setDataSourceCode("lets_u8c");
bdCorpEntity.setUnitcode(replaceCompanyCode); bdCorpEntity.setUnitcode(companyCode);
List<BdCorpEntity> bdCorpEntityList = iBdCorpDao.query(bdCorpEntity); List<BdCorpEntity> bdCorpEntityList = iBdCorpDao.query(bdCorpEntity);
if (bdCorpEntityList.size() == 0) { if (bdCorpEntityList.size() == 0) {
Assert.state(false, "根据O货主编码{}无法匹配到U8C销售公司", replaceCompanyCode); Assert.state(false, "根据O货主编码{}无法匹配到U8C销售公司", companyCode);
} else if (bdCorpEntityList.size() >= 2) { } else if (bdCorpEntityList.size() >= 2) {
Assert.state(false, "根据O货主编码{}匹配到U8C销售公司{}个", replaceCompanyCode, bdCorpEntityList.size()); Assert.state(false, "根据O货主编码{}匹配到U8C销售公司{}个", companyCode, bdCorpEntityList.size());
} }
// 发货库存组织 // 发货库存组织
@ -1334,18 +1334,18 @@ public class SoSaleReturnPluginInitializerToB extends PluginBaseEntity {
String companyCode = header.getCompanyCode(); String companyCode = header.getCompanyCode();
Assert.notNull(companyCode, "O表头公司不能为空"); Assert.notNull(companyCode, "O表头公司不能为空");
String replaceCompanyCode = queryU8CEntityUtil.queryBdDefDocByPkDefDocList(companyCode.trim()); // String replaceCompanyCode = queryU8CEntityUtil.queryBdDefDocByPkDefDocList(companyCode.trim());
Assert.notNull(replaceCompanyCode, "replaceCompanyCode不能为空"); // Assert.notNull(replaceCompanyCode, "replaceCompanyCode不能为空");
BdCorpEntity bdCorpEntity = new BdCorpEntity(); BdCorpEntity bdCorpEntity = new BdCorpEntity();
bdCorpEntity.setDr(0); bdCorpEntity.setDr(0);
bdCorpEntity.setDataSourceCode("lets_u8c"); bdCorpEntity.setDataSourceCode("lets_u8c");
bdCorpEntity.setUnitcode(replaceCompanyCode); bdCorpEntity.setUnitcode(companyCode);
List<BdCorpEntity> bdCorpEntityList = iBdCorpDao.query(bdCorpEntity); List<BdCorpEntity> bdCorpEntityList = iBdCorpDao.query(bdCorpEntity);
if (bdCorpEntityList.size() == 0) { if (bdCorpEntityList.size() == 0) {
Assert.state(false, "根据O货主编码{}无法匹配到U8C销售公司", replaceCompanyCode); Assert.state(false, "根据O货主编码{}无法匹配到U8C销售公司", companyCode);
} else if (bdCorpEntityList.size() >= 2) { } else if (bdCorpEntityList.size() >= 2) {
Assert.state(false, "根据O货主编码{}匹配到U8C销售公司{}个", replaceCompanyCode, bdCorpEntityList.size()); Assert.state(false, "根据O货主编码{}匹配到U8C销售公司{}个", companyCode, bdCorpEntityList.size());
} }
// 发货库存组织 // 发货库存组织

View File

@ -1294,7 +1294,7 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
//计算OFS销售订单优惠金额分摊到明细行 //计算OFS销售订单优惠金额分摊到明细行
// ofsOrderAfterSalesAmountAllocationUtil.batchTocSalesAmountAllocation(rerturnGoodsOrderSearchData); // ofsOrderAfterSalesAmountAllocationUtil.batchTocSalesAmountAllocation(rerturnGoodsOrderSearchData);
//初始化公司档案对照关系 //初始化公司档案对照关系
Map<String, String> comparisonCompanyArchives = queryU8CEntityUtil.queryBdDefDocByPkDefDocAll(); // Map<String, String> comparisonCompanyArchives = queryU8CEntityUtil.queryBdDefDocByPkDefDocAll();
//测试 //测试
// StockinOrderSearchResponse.StockinOrder stockinOrder1 = returnGoodHeaderDetailsDataDtoList1.get(0); // StockinOrderSearchResponse.StockinOrder stockinOrder1 = returnGoodHeaderDetailsDataDtoList1.get(0);
@ -1330,10 +1330,10 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
String companyCode = header.getCompanyCode(); String companyCode = header.getCompanyCode();
Assert.notNull(companyCode, "O货主编码不能为空"); Assert.notNull(companyCode, "O货主编码不能为空");
//查找是否替换公司 //查找是否替换公司
String targetCorp = comparisonCompanyArchives.get(companyCode); // String targetCorp = comparisonCompanyArchives.get(companyCode);
if (targetCorp != null) { // if (targetCorp != null) {
companyCode = targetCorp; // companyCode = targetCorp;
} // }
BdCorpEntity bdCorpEntity = cacheTocMapVoV2.getStringBdCorpEntityMap().get(companyCode.trim()); BdCorpEntity bdCorpEntity = cacheTocMapVoV2.getStringBdCorpEntityMap().get(companyCode.trim());
Assert.notNull(bdCorpEntity, "根据O公司编码(货主编码)({})没有匹配到U8C公司档案", header.getCompanyCode()); Assert.notNull(bdCorpEntity, "根据O公司编码(货主编码)({})没有匹配到U8C公司档案", header.getCompanyCode());