refactor(lets): 重构公司代码匹配逻辑

- 移除原有的简单字符串包含判断
- 新增 QueryU8CEntityUtil 类中的 companyMatch 方法进行精确匹配- 更新多个类中的公司代码过滤逻辑,使用新的匹配方法
- 优化测试用例,调整时间参数和订单编号
This commit is contained in:
liuy 2025-06-27 18:17:23 +08:00
parent aba3955046
commit 41f69e8c5e
18 changed files with 199 additions and 42 deletions

View File

@ -243,7 +243,11 @@ public class ConsignmachiningCinfurmIn extends PluginBaseEntity {
public boolean test(OFSReceiptConfirmSearchResponse.Order headerDetailsDto) { public boolean test(OFSReceiptConfirmSearchResponse.Order headerDetailsDto) {
OFSReceiptConfirmSearchResponse.Header header = headerDetailsDto.getHeader(); OFSReceiptConfirmSearchResponse.Header header = headerDetailsDto.getHeader();
if (header != null && header.getCompanyCode() != null) { if (header != null && header.getCompanyCode() != null) {
if (filter_company.contains(header.getCompanyCode().trim())) { // if (filter_company.contains(header.getCompanyCode().trim() + ",")) {
// return true;
// }
if (queryU8CEntityUtil.companyMatch(filter_company, header.getCompanyCode().trim())) {
//如果为true则返回true如果为false则移交给后续逻辑处理后续逻辑可能还有判断
return true; return true;
} }
} }
@ -306,7 +310,11 @@ public class ConsignmachiningCinfurmIn extends PluginBaseEntity {
public boolean test(OFSReceiptConfirmSearchResponse.Order headerDetailsDto) { public boolean test(OFSReceiptConfirmSearchResponse.Order headerDetailsDto) {
OFSReceiptConfirmSearchResponse.Header header = headerDetailsDto.getHeader(); OFSReceiptConfirmSearchResponse.Header header = headerDetailsDto.getHeader();
if (header != null && header.getCompanyCode() != null) { if (header != null && header.getCompanyCode() != null) {
if (filter_company.contains(header.getCompanyCode().trim())) { // if (filter_company.contains(header.getCompanyCode().trim() + ",")) {
// return true;
// }
if (queryU8CEntityUtil.companyMatch(filter_company, header.getCompanyCode().trim())) {
//如果为true则返回true如果为false则移交给后续逻辑处理后续逻辑可能还有判断
return true; return true;
} }
} }

View File

@ -247,7 +247,11 @@ public class ConsignmachiningIn extends PluginBaseEntity {
public boolean test(StockinOrderSearchResponse.StockinOrder headerDetailsDto) { public boolean test(StockinOrderSearchResponse.StockinOrder headerDetailsDto) {
StockinOrderSearchResponse.StockinOrder.StockinH header = headerDetailsDto.getHeader(); StockinOrderSearchResponse.StockinOrder.StockinH header = headerDetailsDto.getHeader();
if (header != null && header.getCompanyCode() != null) { if (header != null && header.getCompanyCode() != null) {
if (filter_company.contains(header.getCompanyCode().trim())) { // if (filter_company.contains(header.getCompanyCode().trim() + ",")) {
// return true;
// }
if (queryU8CEntityUtil.companyMatch(filter_company, header.getCompanyCode().trim())) {
//如果为true则返回true如果为false则移交给后续逻辑处理后续逻辑可能还有判断
return true; return true;
} }
} }
@ -306,7 +310,11 @@ public class ConsignmachiningIn extends PluginBaseEntity {
public boolean test(StockinOrderSearchResponse.StockinOrder headerDetailsDto) { public boolean test(StockinOrderSearchResponse.StockinOrder headerDetailsDto) {
StockinOrderSearchResponse.StockinOrder.StockinH header = headerDetailsDto.getHeader(); StockinOrderSearchResponse.StockinOrder.StockinH header = headerDetailsDto.getHeader();
if (header != null && header.getCompanyCode() != null) { if (header != null && header.getCompanyCode() != null) {
if (filter_company.contains(header.getCompanyCode().trim())) { // if (filter_company.contains(header.getCompanyCode().trim() + ",")) {
// return true;
// }
if (queryU8CEntityUtil.companyMatch(filter_company, header.getCompanyCode().trim())) {
//如果为true则返回true如果为false则移交给后续逻辑处理后续逻辑可能还有判断
return true; return true;
} }
} }

View File

@ -246,7 +246,11 @@ public class ConsignmachiningInReturn extends PluginBaseEntity {
public boolean test(HeaderDetailsDto headerDetailsDto) { public boolean test(HeaderDetailsDto headerDetailsDto) {
HeaderDto header = headerDetailsDto.getHeader(); HeaderDto header = headerDetailsDto.getHeader();
if (header != null && header.getCompanyCode() != null) { if (header != null && header.getCompanyCode() != null) {
if (filter_company.contains(header.getCompanyCode().trim())) { // if (filter_company.contains(header.getCompanyCode().trim() + ",")) {
// return true;
// }
if (queryU8CEntityUtil.companyMatch(filter_company, header.getCompanyCode().trim())) {
//如果为true则返回true如果为false则移交给后续逻辑处理后续逻辑可能还有判断
return true; return true;
} }
} }
@ -305,7 +309,11 @@ public class ConsignmachiningInReturn extends PluginBaseEntity {
public boolean test(HeaderDetailsDto headerDetailsDto) { public boolean test(HeaderDetailsDto headerDetailsDto) {
HeaderDto header = headerDetailsDto.getHeader(); HeaderDto header = headerDetailsDto.getHeader();
if (header != null && header.getCompanyCode() != null) { if (header != null && header.getCompanyCode() != null) {
if (filter_company.contains(header.getCompanyCode().trim())) { // if (filter_company.contains(header.getCompanyCode().trim() + ",")) {
// return true;
// }
if (queryU8CEntityUtil.companyMatch(filter_company, header.getCompanyCode().trim())) {
//如果为true则返回true如果为false则移交给后续逻辑处理后续逻辑可能还有判断
return true; return true;
} }
} }

View File

@ -236,7 +236,11 @@ public class ProxyPurchaseReturn extends PluginBaseEntity {
public boolean test(HeaderDetailsDto headerDetailsDto) { public boolean test(HeaderDetailsDto headerDetailsDto) {
HeaderDto header = headerDetailsDto.getHeader(); HeaderDto header = headerDetailsDto.getHeader();
if (header != null && header.getCompanyCode() != null) { if (header != null && header.getCompanyCode() != null) {
if (filter_company.contains(header.getCompanyCode().trim())) { // if (filter_company.contains(header.getCompanyCode().trim() + ",")) {
// return true;
// }
if (queryU8CEntityUtil.companyMatch(filter_company, header.getCompanyCode().trim())) {
//如果为true则返回true如果为false则移交给后续逻辑处理后续逻辑可能还有判断
return true; return true;
} }
} }
@ -294,7 +298,11 @@ public class ProxyPurchaseReturn extends PluginBaseEntity {
public boolean test(HeaderDetailsDto headerDetailsDto) { public boolean test(HeaderDetailsDto headerDetailsDto) {
HeaderDto header = headerDetailsDto.getHeader(); HeaderDto header = headerDetailsDto.getHeader();
if (header != null && header.getCompanyCode() != null) { if (header != null && header.getCompanyCode() != null) {
if (filter_company.contains(header.getCompanyCode().trim())) { // if (filter_company.contains(header.getCompanyCode().trim() + ",")) {
// return true;
// }
if (queryU8CEntityUtil.companyMatch(filter_company, header.getCompanyCode().trim())) {
//如果为true则返回true如果为false则移交给后续逻辑处理后续逻辑可能还有判断
return true; return true;
} }
} }

View File

@ -235,7 +235,11 @@ public class ProxyPurchaseWarehousOrder extends PluginBaseEntity {
public boolean test(OfsPoOrderData headerDetailsDto) { public boolean test(OfsPoOrderData headerDetailsDto) {
OfsPoOrderHeader header = headerDetailsDto.getHeader(); OfsPoOrderHeader header = headerDetailsDto.getHeader();
if (header != null && header.getCompanyCode() != null) { if (header != null && header.getCompanyCode() != null) {
if (filter_company.contains(header.getCompanyCode().trim())) { // if (filter_company.contains(header.getCompanyCode().trim() + ",")) {
// return true;
// }
if (queryU8CEntityUtil.companyMatch(filter_company, header.getCompanyCode().trim())) {
//如果为true则返回true如果为false则移交给后续逻辑处理后续逻辑可能还有判断
return true; return true;
} }
//2025年5月23日17:51:14 //2025年5月23日17:51:14
@ -299,7 +303,11 @@ public class ProxyPurchaseWarehousOrder extends PluginBaseEntity {
public boolean test(OfsPoOrderData headerDetailsDto) { public boolean test(OfsPoOrderData headerDetailsDto) {
OfsPoOrderHeader header = headerDetailsDto.getHeader(); OfsPoOrderHeader header = headerDetailsDto.getHeader();
if (header != null && header.getCompanyCode() != null) { if (header != null && header.getCompanyCode() != null) {
if (filter_company.contains(header.getCompanyCode().trim())) { // if (filter_company.contains(header.getCompanyCode().trim() + ",")) {
// return true;
// }
if (queryU8CEntityUtil.companyMatch(filter_company, header.getCompanyCode().trim())) {
//如果为true则返回true如果为false则移交给后续逻辑处理后续逻辑可能还有判断
return true; return true;
} }
} }

View File

@ -241,7 +241,11 @@ public class ProxyPurchaseWarehousWarehouse extends PluginBaseEntity {
public boolean test(OFSReceiptConfirmSearchResponse.Order headerDetailsDto) { public boolean test(OFSReceiptConfirmSearchResponse.Order headerDetailsDto) {
OFSReceiptConfirmSearchResponse.Header header = headerDetailsDto.getHeader(); OFSReceiptConfirmSearchResponse.Header header = headerDetailsDto.getHeader();
if (header != null && header.getCompanyCode() != null) { if (header != null && header.getCompanyCode() != null) {
if (filter_company.contains(header.getCompanyCode().trim())) { // if (filter_company.contains(header.getCompanyCode().trim() + ",")) {
// return true;
// }
if (queryU8CEntityUtil.companyMatch(filter_company, header.getCompanyCode().trim())) {
//如果为true则返回true如果为false则移交给后续逻辑处理后续逻辑可能还有判断
return true; return true;
} }
} }
@ -301,7 +305,11 @@ public class ProxyPurchaseWarehousWarehouse extends PluginBaseEntity {
public boolean test(OFSReceiptConfirmSearchResponse.Order headerDetailsDto) { public boolean test(OFSReceiptConfirmSearchResponse.Order headerDetailsDto) {
OFSReceiptConfirmSearchResponse.Header header = headerDetailsDto.getHeader(); OFSReceiptConfirmSearchResponse.Header header = headerDetailsDto.getHeader();
if (header != null && header.getCompanyCode() != null) { if (header != null && header.getCompanyCode() != null) {
if (filter_company.contains(header.getCompanyCode().trim())) { // if (filter_company.contains(header.getCompanyCode().trim() + ",")) {
// return true;
// }
if (queryU8CEntityUtil.companyMatch(filter_company, header.getCompanyCode().trim())) {
//如果为true则返回true如果为false则移交给后续逻辑处理后续逻辑可能还有判断
return true; return true;
} }
} }

View File

@ -287,7 +287,11 @@ public class PassiveWarehouseReceiptToB extends PluginBaseEntity {
public boolean test(PassiveStorageResponse.Data headerDetailsDto) { public boolean test(PassiveStorageResponse.Data headerDetailsDto) {
PassiveStorageResponse.Header header = headerDetailsDto.getHeader(); PassiveStorageResponse.Header header = headerDetailsDto.getHeader();
if (header != null && header.getCompanyCode() != null) { if (header != null && header.getCompanyCode() != null) {
if (filter_company.contains(header.getCompanyCode().trim())) { // if (filter_company.contains(header.getCompanyCode().trim() + ",")) {
// return true;
// }
if (queryU8CEntityUtil.companyMatch(filter_company, header.getCompanyCode().trim())) {
//如果为true则返回true如果为false则移交给后续逻辑处理后续逻辑可能还有判断
return true; return true;
} }
} }
@ -342,7 +346,11 @@ public class PassiveWarehouseReceiptToB extends PluginBaseEntity {
public boolean test(PassiveStorageResponse.Data headerDetailsDto) { public boolean test(PassiveStorageResponse.Data headerDetailsDto) {
PassiveStorageResponse.Header header = headerDetailsDto.getHeader(); PassiveStorageResponse.Header header = headerDetailsDto.getHeader();
if (header != null && header.getCompanyCode() != null) { if (header != null && header.getCompanyCode() != null) {
if (filter_company.contains(header.getCompanyCode().trim())) { // if (filter_company.contains(header.getCompanyCode().trim() + ",")) {
// return true;
// }
if (queryU8CEntityUtil.companyMatch(filter_company, header.getCompanyCode().trim())) {
//如果为true则返回true如果为false则移交给后续逻辑处理后续逻辑可能还有判断
return true; return true;
} }
} }
@ -395,7 +403,11 @@ public class PassiveWarehouseReceiptToB extends PluginBaseEntity {
public boolean test(PassiveStorageResponse.Data headerDetailsDto) { public boolean test(PassiveStorageResponse.Data headerDetailsDto) {
PassiveStorageResponse.Header header = headerDetailsDto.getHeader(); PassiveStorageResponse.Header header = headerDetailsDto.getHeader();
if (header != null && header.getCompanyCode() != null) { if (header != null && header.getCompanyCode() != null) {
if (filter_company.contains(header.getCompanyCode().trim())) { // if (filter_company.contains(header.getCompanyCode().trim() + ",")) {
// return true;
// }
if (queryU8CEntityUtil.companyMatch(filter_company, header.getCompanyCode().trim())) {
//如果为true则返回true如果为false则移交给后续逻辑处理后续逻辑可能还有判断
return true; return true;
} }
} }

View File

@ -268,7 +268,11 @@ public class PassiveWarehouseReceiptToC extends PluginBaseEntity {
public boolean test(PassiveStorageResponse.Data headerDetailsDto) { public boolean test(PassiveStorageResponse.Data headerDetailsDto) {
PassiveStorageResponse.Header header = headerDetailsDto.getHeader(); PassiveStorageResponse.Header header = headerDetailsDto.getHeader();
if (header != null && header.getCompanyCode() != null) { if (header != null && header.getCompanyCode() != null) {
if (filter_company.contains(header.getCompanyCode().trim())) { // if (filter_company.contains(header.getCompanyCode().trim() + ",")) {
// return true;
// }
if (queryU8CEntityUtil.companyMatch(filter_company, header.getCompanyCode().trim())) {
//如果为true则返回true如果为false则移交给后续逻辑处理后续逻辑可能还有判断
return true; return true;
} }
} }
@ -320,7 +324,11 @@ public class PassiveWarehouseReceiptToC extends PluginBaseEntity {
PassiveStorageResponse.Header header = headerDetailsDto.getHeader(); PassiveStorageResponse.Header header = headerDetailsDto.getHeader();
if (header != null && header.getCompanyCode() != null) { if (header != null && header.getCompanyCode() != null) {
//过滤掉业务上不需要的公司 //过滤掉业务上不需要的公司
if (filter_company.contains(header.getCompanyCode().trim())) { // if (filter_company.contains(header.getCompanyCode().trim() + ",")) {
// return true;
// }
if (queryU8CEntityUtil.companyMatch(filter_company, header.getCompanyCode().trim())) {
//如果为true则返回true如果为false则移交给后续逻辑处理后续逻辑可能还有判断
return true; return true;
} }
} }
@ -342,7 +350,7 @@ public class PassiveWarehouseReceiptToC extends PluginBaseEntity {
} }
/** /**
* 交易采购按指定时间拉取 * 交易成功按指定时间拉取
* *
* @author liuyang * @author liuyang
*/ */
@ -375,7 +383,11 @@ public class PassiveWarehouseReceiptToC extends PluginBaseEntity {
PassiveStorageResponse.Header header = headerDetailsDto.getHeader(); PassiveStorageResponse.Header header = headerDetailsDto.getHeader();
if (header != null && header.getCompanyCode() != null) { if (header != null && header.getCompanyCode() != null) {
//过滤掉不需要的公司 //过滤掉不需要的公司
if (filter_company.contains(header.getCompanyCode().trim())) { // if (filter_company.contains(header.getCompanyCode().trim() + ",")) {
// return true;
// }
if (queryU8CEntityUtil.companyMatch(filter_company, header.getCompanyCode().trim())) {
//如果为true则返回true如果为false则移交给后续逻辑处理后续逻辑可能还有判断
return true; return true;
} }
} }

View File

@ -293,7 +293,11 @@ public class SoSaleOutPluginInitializerToB extends PluginBaseEntity {
public boolean test(HeaderDetailsDto headerDetailsDto) { public boolean test(HeaderDetailsDto headerDetailsDto) {
HeaderDto header = headerDetailsDto.getHeader(); HeaderDto header = headerDetailsDto.getHeader();
if (header != null && header.getCompanyCode() != null) { if (header != null && header.getCompanyCode() != null) {
if (filter_company.contains(header.getCompanyCode().trim())) { // if (filter_company.contains(header.getCompanyCode().trim() + ",")) {
// return true;
// }
if (queryU8CEntityUtil.companyMatch(filter_company, header.getCompanyCode().trim())) {
//如果为true则返回true如果为false则移交给后续逻辑处理后续逻辑可能还有判断
return true; return true;
} }
} }
@ -354,7 +358,11 @@ public class SoSaleOutPluginInitializerToB extends PluginBaseEntity {
public boolean test(HeaderDetailsDto headerDetailsDto) { public boolean test(HeaderDetailsDto headerDetailsDto) {
HeaderDto header = headerDetailsDto.getHeader(); HeaderDto header = headerDetailsDto.getHeader();
if (header != null && header.getCompanyCode() != null) { if (header != null && header.getCompanyCode() != null) {
if (filter_company.contains(header.getCompanyCode().trim())) { // if (filter_company.contains(header.getCompanyCode().trim() + ",")) {
// return true;
// }
if (queryU8CEntityUtil.companyMatch(filter_company, header.getCompanyCode().trim())) {
//如果为true则返回true如果为false则移交给后续逻辑处理后续逻辑可能还有判断
return true; return true;
} }
} }
@ -409,7 +417,11 @@ public class SoSaleOutPluginInitializerToB extends PluginBaseEntity {
public boolean test(HeaderDetailsDto headerDetailsDto) { public boolean test(HeaderDetailsDto headerDetailsDto) {
HeaderDto header = headerDetailsDto.getHeader(); HeaderDto header = headerDetailsDto.getHeader();
if (header != null && header.getCompanyCode() != null) { if (header != null && header.getCompanyCode() != null) {
if (filter_company.contains(header.getCompanyCode().trim())) { // if (filter_company.contains(header.getCompanyCode().trim() + ",")) {
// return true;
// }
if (queryU8CEntityUtil.companyMatch(filter_company, header.getCompanyCode().trim())) {
//如果为true则返回true如果为false则移交给后续逻辑处理后续逻辑可能还有判断
return true; return true;
} }
} }

View File

@ -283,7 +283,11 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
public boolean test(HeaderDetailsDto headerDetailsDto) { public boolean test(HeaderDetailsDto headerDetailsDto) {
HeaderDto header = headerDetailsDto.getHeader(); HeaderDto header = headerDetailsDto.getHeader();
if (header != null && header.getCompanyCode() != null) { if (header != null && header.getCompanyCode() != null) {
if (filter_company.contains(header.getCompanyCode().trim())) { // if (filter_company.contains(header.getCompanyCode().trim() + ",")) {
// return true;
// }
if (queryU8CEntityUtil.companyMatch(filter_company, header.getCompanyCode().trim())) {
//如果为true则返回true如果为false则移交给后续逻辑处理后续逻辑可能还有判断
return true; return true;
} }
} }
@ -398,7 +402,11 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
public boolean test(HeaderDetailsDto headerDetailsDto) { public boolean test(HeaderDetailsDto headerDetailsDto) {
HeaderDto header = headerDetailsDto.getHeader(); HeaderDto header = headerDetailsDto.getHeader();
if (header != null && header.getCompanyCode() != null) { if (header != null && header.getCompanyCode() != null) {
if (filter_company.contains(header.getCompanyCode().trim())) { // if (filter_company.contains(header.getCompanyCode().trim() + ",")) {
// return true;
// }
if (queryU8CEntityUtil.companyMatch(filter_company, header.getCompanyCode().trim())) {
//如果为true则返回true如果为false则移交给后续逻辑处理后续逻辑可能还有判断
return true; return true;
} }
} }
@ -488,7 +496,11 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
public boolean test(HeaderDetailsDto headerDetailsDto) { public boolean test(HeaderDetailsDto headerDetailsDto) {
HeaderDto header = headerDetailsDto.getHeader(); HeaderDto header = headerDetailsDto.getHeader();
if (header != null && header.getCompanyCode() != null) { if (header != null && header.getCompanyCode() != null) {
if (filter_company.contains(header.getCompanyCode().trim())) { // if (filter_company.contains(header.getCompanyCode().trim() + ",")) {
// return true;
// }
if (queryU8CEntityUtil.companyMatch(filter_company, header.getCompanyCode().trim())) {
//如果为true则返回true如果为false则移交给后续逻辑处理后续逻辑可能还有判断
return true; return true;
} }
} }

View File

@ -286,7 +286,11 @@ public class SoSaleReturnPluginInitializerToB extends PluginBaseEntity {
public boolean test(StockinOrderSearchResponse.StockinOrder headerDetailsDto) { public boolean test(StockinOrderSearchResponse.StockinOrder headerDetailsDto) {
StockinOrderSearchResponse.StockinOrder.StockinH header = headerDetailsDto.getHeader(); StockinOrderSearchResponse.StockinOrder.StockinH header = headerDetailsDto.getHeader();
if (header != null && header.getCompanyCode() != null) { if (header != null && header.getCompanyCode() != null) {
if (filter_company.contains(header.getCompanyCode().trim())) { // if (filter_company.contains(header.getCompanyCode().trim() + ",")) {
// return true;
// }
if (queryU8CEntityUtil.companyMatch(filter_company, header.getCompanyCode().trim())) {
//如果为true则返回true如果为false则移交给后续逻辑处理后续逻辑可能还有判断
return true; return true;
} }
} }
@ -349,7 +353,11 @@ public class SoSaleReturnPluginInitializerToB extends PluginBaseEntity {
public boolean test(StockinOrderSearchResponse.StockinOrder headerDetailsDto) { public boolean test(StockinOrderSearchResponse.StockinOrder headerDetailsDto) {
StockinOrderSearchResponse.StockinOrder.StockinH header = headerDetailsDto.getHeader(); StockinOrderSearchResponse.StockinOrder.StockinH header = headerDetailsDto.getHeader();
if (header != null && header.getCompanyCode() != null) { if (header != null && header.getCompanyCode() != null) {
if (filter_company.contains(header.getCompanyCode().trim())) { // if (filter_company.contains(header.getCompanyCode().trim() + ",")) {
// return true;
// }
if (queryU8CEntityUtil.companyMatch(filter_company, header.getCompanyCode().trim())) {
//如果为true则返回true如果为false则移交给后续逻辑处理后续逻辑可能还有判断
return true; return true;
} }
} }
@ -408,7 +416,11 @@ public class SoSaleReturnPluginInitializerToB extends PluginBaseEntity {
public boolean test(StockinOrderSearchResponse.StockinOrder headerDetailsDto) { public boolean test(StockinOrderSearchResponse.StockinOrder headerDetailsDto) {
StockinOrderSearchResponse.StockinOrder.StockinH header = headerDetailsDto.getHeader(); StockinOrderSearchResponse.StockinOrder.StockinH header = headerDetailsDto.getHeader();
if (header != null && header.getCompanyCode() != null) { if (header != null && header.getCompanyCode() != null) {
if (filter_company.contains(header.getCompanyCode().trim())) { // if (filter_company.contains(header.getCompanyCode().trim() + ",")) {
// return true;
// }
if (queryU8CEntityUtil.companyMatch(filter_company, header.getCompanyCode().trim())) {
//如果为true则返回true如果为false则移交给后续逻辑处理后续逻辑可能还有判断
return true; return true;
} }
} }
@ -1648,7 +1660,7 @@ public class SoSaleReturnPluginInitializerToB extends PluginBaseEntity {
Assert.notNull(detailsDto, "sonDetailsDto不能为空"); Assert.notNull(detailsDto, "sonDetailsDto不能为空");
Assert.notNull(detailsDto.getSkuCode(), "O存货商家编码不能为空"); Assert.notNull(detailsDto.getSkuCode(), "O存货商家编码不能为空");
Assert.notNull(pkCorp, "发货公司主键不能为空"); Assert.notNull(pkCorp, "发货公司主键不能为空");
BdInvmandocEntity bdInvmandocEntity = new BdInvmandocEntity(); BdInvmandocEntity bdInvmandocEntity = new BdInvmandocEntity();
bdInvmandocEntity.setInvcode(detailsDto.getSkuCode().trim()); bdInvmandocEntity.setInvcode(detailsDto.getSkuCode().trim());
bdInvmandocEntity.setPkCorp(pkCorp); bdInvmandocEntity.setPkCorp(pkCorp);

View File

@ -263,7 +263,11 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
public boolean test(StockinOrderSearchResponse.StockinOrder headerDetailsDto) { public boolean test(StockinOrderSearchResponse.StockinOrder headerDetailsDto) {
StockinOrderSearchResponse.StockinOrder.StockinH header = headerDetailsDto.getHeader(); StockinOrderSearchResponse.StockinOrder.StockinH header = headerDetailsDto.getHeader();
if (header != null && header.getCompanyCode() != null) { if (header != null && header.getCompanyCode() != null) {
if (filter_company.contains(header.getCompanyCode().trim())) { // if (filter_company.contains(header.getCompanyCode().trim() + ",")) {
// return true;
// }
if (queryU8CEntityUtil.companyMatch(filter_company, header.getCompanyCode().trim())) {
//如果为true则返回true如果为false则移交给后续逻辑处理后续逻辑可能还有判断
return true; return true;
} }
} }
@ -317,7 +321,11 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
public boolean test(StockinOrderSearchResponse.StockinOrder headerDetailsDto) { public boolean test(StockinOrderSearchResponse.StockinOrder headerDetailsDto) {
StockinOrderSearchResponse.StockinOrder.StockinH header = headerDetailsDto.getHeader(); StockinOrderSearchResponse.StockinOrder.StockinH header = headerDetailsDto.getHeader();
if (header != null && header.getCompanyCode() != null) { if (header != null && header.getCompanyCode() != null) {
if (filter_company.contains(header.getCompanyCode().trim())) { // if (filter_company.contains(header.getCompanyCode().trim() + ",")) {
// return true;
// }
if (queryU8CEntityUtil.companyMatch(filter_company, header.getCompanyCode().trim())) {
//如果为true则返回true如果为false则移交给后续逻辑处理后续逻辑可能还有判断
return true; return true;
} }
//2025 3 20 18:25:25 改为生成红字应收单不过滤先退款后退款的场景 //2025 3 20 18:25:25 改为生成红字应收单不过滤先退款后退款的场景
@ -399,7 +407,11 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
StockinOrderSearchResponse.StockinOrder.StockinH header = headerDetailsDto.getHeader(); StockinOrderSearchResponse.StockinOrder.StockinH header = headerDetailsDto.getHeader();
if (header != null && header.getCompanyCode() != null) { if (header != null && header.getCompanyCode() != null) {
//过滤掉不需要的公司 //过滤掉不需要的公司
if (filter_company.contains(header.getCompanyCode().trim())) { // if (filter_company.contains(header.getCompanyCode().trim() + ",")) {
// return true;
// }
if (queryU8CEntityUtil.companyMatch(filter_company, header.getCompanyCode().trim())) {
//如果为true则返回true如果为false则移交给后续逻辑处理后续逻辑可能还有判断
return true; return true;
} }
//过滤掉入库日期为空的单据 //过滤掉入库日期为空的单据

View File

@ -734,4 +734,20 @@ public class QueryU8CEntityUtil {
.collect(Collectors.joining(",")); .collect(Collectors.joining(","));
} }
} }
/**
* 公司匹配逻辑
*/
public boolean companyMatch(String filterCompany, String targetCompany) {
if (filterCompany != null && !"".equals(filterCompany)) {
String[] split = filterCompany.split(",");
for (int i = 0; i < split.length; i++) {
String s = split[i];
if (s.equals(targetCompany)) {
return true;
}
}
}
return false;
}
} }

View File

@ -30,7 +30,7 @@ public class ConsignmachiningCinfurmInTest {
// consignmachiningCinfurmIn.startImplementByTime("2024-01-02 00:00:00", "2024-01-02 23:59:59"); // consignmachiningCinfurmIn.startImplementByTime("2024-01-02 00:00:00", "2024-01-02 23:59:59");
// String code = "LETS-RE2024111400002771-confirm"; // String code = "LETS-RE2024111400002771-confirm";
String code = "LETS-RE2025040700001976-confirm"; String code = "LETS-RE2025052600002368-confirm";
consignmachiningCinfurmIn.startImplementByCode(code); consignmachiningCinfurmIn.startImplementByCode(code);
// if ("HZYX,YD,NMNS,YX,KS,YNS,HJ".contains("121212")) { // if ("HZYX,YD,NMNS,YX,KS,YNS,HJ".contains("121212")) {

View File

@ -30,9 +30,9 @@ public class PassiveWarehouseReceiptToCTest {
//测试O无源件入库 //测试O无源件入库
// passiveWarehouseReceiptToC.startImplementStockByTime("2025-03-11 22:27:02", "2025-03-11 22:27:02"); // passiveWarehouseReceiptToC.startImplementStockByTime("2025-03-11 22:27:02", "2025-03-11 22:27:02");
//测试O无源生成红字应收 //测试O无源生成红字应收
passiveWarehouseReceiptToC.startImplementStockByTime("2025-04-07 13:10:01", "2025-04-07 13:10:01"); // passiveWarehouseReceiptToC.startImplementStockByTime("2025-04-07 13:10:01", "2025-04-07 13:10:01");
// passiveWarehouseReceiptToC.startImplementByCode("RH20250403000841", "stock"); passiveWarehouseReceiptToC.startImplementByCode("RH20250403000841", "stock");
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }

View File

@ -18,6 +18,7 @@ import com.hzya.frame.plugin.lets.u8cdto.ReusltStrDto;
import com.hzya.frame.plugin.lets.u8cdto.SoSaleResultRootDto; import com.hzya.frame.plugin.lets.u8cdto.SoSaleResultRootDto;
import com.hzya.frame.plugin.lets.util.OfsStandardUtil; import com.hzya.frame.plugin.lets.util.OfsStandardUtil;
import com.hzya.frame.plugin.lets.util.QueryBdBusitypeUtil; import com.hzya.frame.plugin.lets.util.QueryBdBusitypeUtil;
import com.hzya.frame.plugin.lets.util.ShopTobOrToCUtil;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -53,8 +54,13 @@ class SoSaleOutPluginInitializerToCTest {
@Autowired @Autowired
private QueryBdBusitypeUtil queryBdBusitypeUtil; private QueryBdBusitypeUtil queryBdBusitypeUtil;
@Autowired
private ShopTobOrToCUtil shopTobOrToCUtil;
@Test @Test
void startImplement() throws Exception { void startImplement() throws Exception {
// String tocShop = shopTobOrToCUtil.getCommaShop("TOC");
// System.out.println(tocShop);
// soSaleOutPluginInitializerToC.startImplement(null, null); // soSaleOutPluginInitializerToC.startImplement(null, null);
// soSaleOutPluginInitializerToC.queryOfsSaleOrder(); // soSaleOutPluginInitializerToC.queryOfsSaleOrder();
@ -74,8 +80,8 @@ class SoSaleOutPluginInitializerToCTest {
// errorHeaderDetailsDtoDto. // errorHeaderDetailsDtoDto.
String aaa = "LETS-SH2025032600025120"; String aaa = "LETS-SH2025061500020655";
soSaleOutPluginInitializerToC.startImplementStockByCode(aaa, "tran"); soSaleOutPluginInitializerToC.startImplementStockByCode(aaa, "stock");
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
@ -103,7 +109,7 @@ class SoSaleOutPluginInitializerToCTest {
// String s = "LETS-SH2025032200027982"; // String s = "LETS-SH2025032200027982";
// soSaleOutPluginInitializerToC.startImplementStockByCode(s, "stock"); // soSaleOutPluginInitializerToC.startImplementStockByCode(s, "stock");
// soSaleOutPluginInitializerToC.startImplementTranByTime("2025-05-08 00:00:00", "2025-05-08 23:59:59", "2"); // soSaleOutPluginInitializerToC.startImplementTranByTime("2025-05-08 00:00:00", "2025-05-08 23:59:59", "0");
// List<com.hzya.frame.ttxofs.dto.ofssalesordersearch.HeaderDetailsDto> headerDetailsDtoArrayList = new ArrayList<>(); // List<com.hzya.frame.ttxofs.dto.ofssalesordersearch.HeaderDetailsDto> headerDetailsDtoArrayList = new ArrayList<>();
// QueryOfsSoSaleOutVo queryOfsSoSaleOutVo = new QueryOfsSoSaleOutVo(); // QueryOfsSoSaleOutVo queryOfsSoSaleOutVo = new QueryOfsSoSaleOutVo();
@ -146,6 +152,12 @@ class SoSaleOutPluginInitializerToCTest {
// String processName = "TOC确认收入"; // String processName = "TOC确认收入";
// BdBusitypeEntity bdBusitypeEntity = queryBdBusitypeUtil.queryBdBusitype(processName); // BdBusitypeEntity bdBusitypeEntity = queryBdBusitypeUtil.queryBdBusitype(processName);
// System.out.println(bdBusitypeEntity.getPkBusitype()); // System.out.println(bdBusitypeEntity.getPkBusitype());
// List<com.hzya.frame.ttxofs.dto.ofssalesordersearch.HeaderDetailsDto> headerDetailsDtoArrayList = new ArrayList<>();
// QueryOfsSoSaleOutVo queryOfsSoSaleOutVo = new QueryOfsSoSaleOutVo();
// queryOfsSoSaleOutVo.setCode("LETS-SH2025061500020655");
// ofsStandardUtil.getOfsSaleOrder(queryOfsSoSaleOutVo, headerDetailsDtoArrayList, 1L);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
@ -173,6 +185,15 @@ class SoSaleOutPluginInitializerToCTest {
// while (true) { // while (true) {
// Thread.currentThread().sleep(1000); // Thread.currentThread().sleep(1000);
// System.out.println(thread.getName()); // System.out.println(thread.getName());
// }
// String filter_company = "aaaa,bbbb,";
// if (filter_company.contains("aa,")) {
// System.out.println("可以匹配 " + filter_company);
// } else {
// System.out.println("无法匹配");
// } // }
} }
} }

View File

@ -65,11 +65,11 @@ public class SoSaleReturnPluginInitializerToCTest {
// soSaleReturnPluginInitializerToC.startImplementStockByTime(startAndEndVos.get(0).getStart_time(), startAndEndVos.get(0).getEnd_time()); // soSaleReturnPluginInitializerToC.startImplementStockByTime(startAndEndVos.get(0).getStart_time(), startAndEndVos.get(0).getEnd_time());
try { try {
// soSaleReturnPluginInitializerToC.startImplementByTradeTime("2025-04-28 00:00:00", "2025-04-28 23:59:59", "2"); soSaleReturnPluginInitializerToC.startImplementByTradeTime("2025-04-28 00:00:00", "2025-04-28 23:59:59", "0");
// soSaleReturnPluginInitializerToC.startImplementByCode("LETS-RE2025010900002384", "tran"); // soSaleReturnPluginInitializerToC.startImplementByCode("LETS-RE2025010900002384", "tran");
// soSaleReturnPluginInitializerToC.startImplementStockByTime("2025-01-31 00:00:00", "2025-01-31 23:59:59", "1"); // soSaleReturnPluginInitializerToC.startImplementStockByTime("2025-01-31 00:00:00", "2025-01-31 23:59:59", "0");
// JSONObject jsonObject = new JSONObject(); // JSONObject jsonObject = new JSONObject();
// soSaleReturnPluginInitializerToC.executeBusiness(jsonObject); // soSaleReturnPluginInitializerToC.executeBusiness(jsonObject);

View File

@ -104,9 +104,9 @@ public class OfsOrderAfterSalesAmountAllocationUtilTest {
// header.setExpertDiscounts("4.22"); // header.setExpertDiscounts("4.22");
// header.setPayDiscounts("1.96"); // header.setPayDiscounts("1.96");
ofsOrderAfterSalesAmountAllocationUtil.tocSalesAmountAllocation(rerturnGoodsOrderSearchDataList.get(0)); // ofsOrderAfterSalesAmountAllocationUtil.tocSalesAmountAllocation(rerturnGoodsOrderSearchDataList.get(0));
//打印结果 //打印结果
ofsOrderAfterSalesAmountAllocationUtil.printAmountOfMoneyNum(rerturnGoodsOrderSearchDataList); // ofsOrderAfterSalesAmountAllocationUtil.printAmountOfMoneyNum(rerturnGoodsOrderSearchDataList);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }