|
|
@ -130,9 +130,15 @@ public class RuleServiceImpl implements RuleService { |
|
|
|
} |
|
|
|
JSONArray conditionArray = JSONUtil.parseArray(condition); |
|
|
|
Map<String, String> params = new HashMap<>(); |
|
|
|
params.put("SupplierType", supplierType); |
|
|
|
params.put("SupplierCode", supplierCode); |
|
|
|
params.put("Weekday", weekday); |
|
|
|
if(supplierType != null && !supplierType.isEmpty()) { |
|
|
|
params.put("SupplierType", supplierType); |
|
|
|
} |
|
|
|
if(supplierCode != null && !supplierCode.isEmpty()) { |
|
|
|
params.put("SupplierCode", supplierCode); |
|
|
|
} |
|
|
|
if(weekday != null && !weekday.isEmpty()) { |
|
|
|
params.put("Weekday", weekday); |
|
|
|
} |
|
|
|
if(this.forEachParams(params, conditionArray)) { |
|
|
|
return RuleConvert.INSTANCE.convert(ruleDO); |
|
|
|
} |
|
|
@ -154,8 +160,12 @@ public class RuleServiceImpl implements RuleService { |
|
|
|
} |
|
|
|
JSONArray conditionArray = JSONUtil.parseArray(condition); |
|
|
|
Map<String, String> params = new HashMap<>(); |
|
|
|
params.put("SupplierType", supplierType); |
|
|
|
params.put("SupplierCode", supplierCode); |
|
|
|
if(supplierType != null && !supplierType.isEmpty()) { |
|
|
|
params.put("SupplierType", supplierType); |
|
|
|
} |
|
|
|
if(supplierCode != null && !supplierCode.isEmpty()) { |
|
|
|
params.put("SupplierCode", supplierCode); |
|
|
|
} |
|
|
|
if(this.forEachParams(params, conditionArray)) { |
|
|
|
return RuleConvert.INSTANCE.convert(ruleDO); |
|
|
|
} |
|
|
@ -177,7 +187,9 @@ public class RuleServiceImpl implements RuleService { |
|
|
|
JSONArray conditionArray = JSONUtil.parseArray(condition); |
|
|
|
Map<String, String> params = new HashMap<>(); |
|
|
|
params.put("SupplierCode", supplierCode); |
|
|
|
params.put("ItemCode", itemCode); |
|
|
|
if(itemCode != null && !itemCode.isEmpty()) { |
|
|
|
params.put("ItemCode", itemCode); |
|
|
|
} |
|
|
|
if(this.forEachParams(params, conditionArray)) { |
|
|
|
return RuleConvert.INSTANCE.convert(ruleDO); |
|
|
|
} |
|
|
@ -198,8 +210,12 @@ public class RuleServiceImpl implements RuleService { |
|
|
|
} |
|
|
|
JSONArray conditionArray = JSONUtil.parseArray(condition); |
|
|
|
Map<String, String> params = new HashMap<>(); |
|
|
|
params.put("SupplierType", supplierType); |
|
|
|
params.put("ItemCode", itemCode); |
|
|
|
if(supplierType != null && !supplierType.isEmpty()) { |
|
|
|
params.put("SupplierType", supplierType); |
|
|
|
} |
|
|
|
if(itemCode != null && !itemCode.isEmpty()) { |
|
|
|
params.put("ItemCode", itemCode); |
|
|
|
} |
|
|
|
if(this.forEachParams(params, conditionArray)) { |
|
|
|
return RuleConvert.INSTANCE.convert(ruleDO); |
|
|
|
} |
|
|
@ -220,19 +236,45 @@ public class RuleServiceImpl implements RuleService { |
|
|
|
} |
|
|
|
JSONArray conditionArray = JSONUtil.parseArray(condition); |
|
|
|
Map<String, String> params = new HashMap<>(); |
|
|
|
params.put("SupplierType", supplierCode); |
|
|
|
params.put("CustomerCode", customerCode); |
|
|
|
params.put("AbcClass", abcClass); |
|
|
|
params.put("ItemType", itemType); |
|
|
|
params.put("ItemGroup", itemGroup); |
|
|
|
params.put("Project", project); |
|
|
|
params.put("ItemCode", itemCode); |
|
|
|
params.put("InventoryStatus", inventoryStatus); |
|
|
|
params.put("StorageType", storageType); |
|
|
|
params.put("TransactionType", transactionType); |
|
|
|
params.put("Weight", weight); |
|
|
|
params.put("Area", area); |
|
|
|
params.put("Volume", volume); |
|
|
|
if(supplierCode != null && !supplierCode.isEmpty()) { |
|
|
|
params.put("SupplierType", supplierCode); |
|
|
|
} |
|
|
|
if(customerCode != null && !customerCode.isEmpty()) { |
|
|
|
params.put("CustomerCode", customerCode); |
|
|
|
} |
|
|
|
if(abcClass != null && !abcClass.isEmpty()) { |
|
|
|
params.put("AbcClass", abcClass); |
|
|
|
} |
|
|
|
if(itemType != null && !itemType.isEmpty()) { |
|
|
|
params.put("ItemType", itemType); |
|
|
|
} |
|
|
|
if(itemGroup != null && !itemGroup.isEmpty()) { |
|
|
|
params.put("ItemGroup", itemGroup); |
|
|
|
} |
|
|
|
if(project != null && !project.isEmpty()) { |
|
|
|
params.put("Project", project); |
|
|
|
} |
|
|
|
if(itemCode != null && !itemCode.isEmpty()) { |
|
|
|
params.put("ItemCode", itemCode); |
|
|
|
} |
|
|
|
if(inventoryStatus != null && !inventoryStatus.isEmpty()) { |
|
|
|
params.put("InventoryStatus", inventoryStatus); |
|
|
|
} |
|
|
|
if(storageType != null && !storageType.isEmpty()) { |
|
|
|
params.put("StorageType", storageType); |
|
|
|
} |
|
|
|
if(transactionType != null && !transactionType.isEmpty()) { |
|
|
|
params.put("TransactionType", transactionType); |
|
|
|
} |
|
|
|
if(weight != null && !weight.isEmpty()) { |
|
|
|
params.put("Weight", weight); |
|
|
|
} |
|
|
|
if(area != null && !area.isEmpty()) { |
|
|
|
params.put("Area", area); |
|
|
|
} |
|
|
|
if(volume != null && !volume.isEmpty()) { |
|
|
|
params.put("Volume", volume); |
|
|
|
} |
|
|
|
if(this.forEachParams(params, conditionArray)) { |
|
|
|
return RuleConvert.INSTANCE.convert(ruleDO); |
|
|
|
} |
|
|
@ -253,13 +295,27 @@ public class RuleServiceImpl implements RuleService { |
|
|
|
} |
|
|
|
JSONArray conditionArray = JSONUtil.parseArray(condition); |
|
|
|
Map<String, String> params = new HashMap<>(); |
|
|
|
params.put("ItemGroup", itemGroup); |
|
|
|
params.put("Project", project); |
|
|
|
params.put("ItemCode", itemCode); |
|
|
|
params.put("WarehouseCode", warehouseCode); |
|
|
|
params.put("AreaCode", areaCode); |
|
|
|
params.put("LocationGroupCode", locationGroupCode); |
|
|
|
params.put("LocationCode", locationCode); |
|
|
|
if(itemGroup != null && !itemGroup.isEmpty()) { |
|
|
|
params.put("ItemGroup", itemGroup); |
|
|
|
} |
|
|
|
if(project != null && !project.isEmpty()) { |
|
|
|
params.put("Project", project); |
|
|
|
} |
|
|
|
if(itemCode != null && !itemCode.isEmpty()) { |
|
|
|
params.put("ItemCode", itemCode); |
|
|
|
} |
|
|
|
if(warehouseCode != null && !warehouseCode.isEmpty()) { |
|
|
|
params.put("WarehouseCode", warehouseCode); |
|
|
|
} |
|
|
|
if(areaCode != null && !areaCode.isEmpty()) { |
|
|
|
params.put("AreaCode", areaCode); |
|
|
|
} |
|
|
|
if(locationGroupCode != null && !locationGroupCode.isEmpty()) { |
|
|
|
params.put("LocationGroupCode", locationGroupCode); |
|
|
|
} |
|
|
|
if(locationCode != null && !locationCode.isEmpty()) { |
|
|
|
params.put("LocationCode", locationCode); |
|
|
|
} |
|
|
|
if(this.forEachParams(params, conditionArray)) { |
|
|
|
return RuleConvert.INSTANCE.convert(ruleDO); |
|
|
|
} |
|
|
@ -280,16 +336,36 @@ public class RuleServiceImpl implements RuleService { |
|
|
|
} |
|
|
|
JSONArray conditionArray = JSONUtil.parseArray(condition); |
|
|
|
Map<String, String> params = new HashMap<>(); |
|
|
|
params.put("SupplierCode", supplierCode); |
|
|
|
params.put("CustomerCode", customerCode); |
|
|
|
params.put("AbcClass", abcClass); |
|
|
|
params.put("ItemType", itemType); |
|
|
|
params.put("ItemGroup", itemGroup); |
|
|
|
params.put("Project", project); |
|
|
|
params.put("ItemCode", itemCode); |
|
|
|
params.put("InventoryStatus", inventoryStatus); |
|
|
|
params.put("StorageType", storageType); |
|
|
|
params.put("TransactionType", transactionType); |
|
|
|
if(supplierCode != null && !supplierCode.isEmpty()) { |
|
|
|
params.put("SupplierCode", supplierCode); |
|
|
|
} |
|
|
|
if(customerCode != null && !customerCode.isEmpty()) { |
|
|
|
params.put("CustomerCode", customerCode); |
|
|
|
} |
|
|
|
if(abcClass != null && !abcClass.isEmpty()) { |
|
|
|
params.put("AbcClass", abcClass); |
|
|
|
} |
|
|
|
if(itemType != null && !itemType.isEmpty()) { |
|
|
|
params.put("ItemType", itemType); |
|
|
|
} |
|
|
|
if(itemGroup != null && !itemGroup.isEmpty()) { |
|
|
|
params.put("ItemGroup", itemGroup); |
|
|
|
} |
|
|
|
if(project != null && !project.isEmpty()) { |
|
|
|
params.put("Project", project); |
|
|
|
} |
|
|
|
if(itemCode != null && !itemCode.isEmpty()) { |
|
|
|
params.put("ItemCode", itemCode); |
|
|
|
} |
|
|
|
if(inventoryStatus != null && !inventoryStatus.isEmpty()) { |
|
|
|
params.put("InventoryStatus", inventoryStatus); |
|
|
|
} |
|
|
|
if(storageType != null && !storageType.isEmpty()) { |
|
|
|
params.put("StorageType", storageType); |
|
|
|
} |
|
|
|
if(transactionType != null && !transactionType.isEmpty()) { |
|
|
|
params.put("TransactionType", transactionType); |
|
|
|
} |
|
|
|
if(this.forEachParams(params, conditionArray)) { |
|
|
|
return RuleConvert.INSTANCE.convert(ruleDO); |
|
|
|
} |
|
|
@ -310,12 +386,24 @@ public class RuleServiceImpl implements RuleService { |
|
|
|
} |
|
|
|
JSONArray conditionArray = JSONUtil.parseArray(condition); |
|
|
|
Map<String, String> params = new HashMap<>(); |
|
|
|
params.put("Project", project); |
|
|
|
params.put("ItemCode", itemCode); |
|
|
|
params.put("WarehouseCode", warehouseCode); |
|
|
|
params.put("AreaCode", areaCode); |
|
|
|
params.put("LocationGroupCode", locationGroupCode); |
|
|
|
params.put("LocationCode", locationCode); |
|
|
|
if(project != null && !project.isEmpty()) { |
|
|
|
params.put("Project", project); |
|
|
|
} |
|
|
|
if(itemCode != null && !itemCode.isEmpty()) { |
|
|
|
params.put("ItemCode", itemCode); |
|
|
|
} |
|
|
|
if(warehouseCode != null && !warehouseCode.isEmpty()) { |
|
|
|
params.put("WarehouseCode", warehouseCode); |
|
|
|
} |
|
|
|
if(areaCode != null && !areaCode.isEmpty()) { |
|
|
|
params.put("AreaCode", areaCode); |
|
|
|
} |
|
|
|
if(locationGroupCode != null && !locationGroupCode.isEmpty()) { |
|
|
|
params.put("LocationGroupCode", locationGroupCode); |
|
|
|
} |
|
|
|
if(locationCode != null && !locationCode.isEmpty()) { |
|
|
|
params.put("LocationCode", locationCode); |
|
|
|
} |
|
|
|
if(this.forEachParams(params, conditionArray)) { |
|
|
|
return RuleConvert.INSTANCE.convert(ruleDO); |
|
|
|
} |
|
|
@ -336,19 +424,45 @@ public class RuleServiceImpl implements RuleService { |
|
|
|
} |
|
|
|
JSONArray conditionArray = JSONUtil.parseArray(condition); |
|
|
|
Map<String, String> params = new HashMap<>(); |
|
|
|
params.put("SupplierCode", supplierCode); |
|
|
|
params.put("CustomerCode", customerCode); |
|
|
|
params.put("AbcClass", abcClass); |
|
|
|
params.put("ItemType", itemType); |
|
|
|
params.put("ItemGroup", itemGroup); |
|
|
|
params.put("Project", project); |
|
|
|
params.put("ItemCode", itemCode); |
|
|
|
params.put("WarehouseCode", warehouseCode); |
|
|
|
params.put("AreaCode", areaCode); |
|
|
|
params.put("LocationGroupCode", locationGroupCode); |
|
|
|
params.put("LocationCode", locationCode); |
|
|
|
params.put("IgnoreListOfItem", ignoreListOfItem); |
|
|
|
params.put("IgnoreListOfLocation", ignoreListOfLocation); |
|
|
|
if(supplierCode != null && !supplierCode.isEmpty()) { |
|
|
|
params.put("SupplierCode", supplierCode); |
|
|
|
} |
|
|
|
if(customerCode != null && !customerCode.isEmpty()) { |
|
|
|
params.put("CustomerCode", customerCode); |
|
|
|
} |
|
|
|
if(abcClass != null && !abcClass.isEmpty()) { |
|
|
|
params.put("AbcClass", abcClass); |
|
|
|
} |
|
|
|
if(itemType != null && !itemType.isEmpty()) { |
|
|
|
params.put("ItemType", itemType); |
|
|
|
} |
|
|
|
if(itemGroup != null && !itemGroup.isEmpty()) { |
|
|
|
params.put("ItemGroup", itemGroup); |
|
|
|
} |
|
|
|
if(project != null && !project.isEmpty()) { |
|
|
|
params.put("Project", project); |
|
|
|
} |
|
|
|
if(itemCode != null && !itemCode.isEmpty()) { |
|
|
|
params.put("ItemCode", itemCode); |
|
|
|
} |
|
|
|
if(warehouseCode != null && !warehouseCode.isEmpty()) { |
|
|
|
params.put("WarehouseCode", warehouseCode); |
|
|
|
} |
|
|
|
if(areaCode != null && !areaCode.isEmpty()) { |
|
|
|
params.put("AreaCode", areaCode); |
|
|
|
} |
|
|
|
if(locationGroupCode != null && !locationGroupCode.isEmpty()) { |
|
|
|
params.put("LocationGroupCode", locationGroupCode); |
|
|
|
} |
|
|
|
if(locationCode != null && !locationCode.isEmpty()) { |
|
|
|
params.put("LocationCode", locationCode); |
|
|
|
} |
|
|
|
if(ignoreListOfItem != null && !ignoreListOfItem.isEmpty()) { |
|
|
|
params.put("IgnoreListOfItem", ignoreListOfItem); |
|
|
|
} |
|
|
|
if(ignoreListOfLocation != null && !ignoreListOfLocation.isEmpty()) { |
|
|
|
params.put("IgnoreListOfLocation", ignoreListOfLocation); |
|
|
|
} |
|
|
|
if(this.forEachParams(params, conditionArray)) { |
|
|
|
return RuleConvert.INSTANCE.convert(ruleDO); |
|
|
|
} |
|
|
@ -369,13 +483,27 @@ public class RuleServiceImpl implements RuleService { |
|
|
|
} |
|
|
|
JSONArray conditionArray = JSONUtil.parseArray(condition); |
|
|
|
Map<String, String> params = new HashMap<>(); |
|
|
|
params.put("SupplierCode", supplierCode); |
|
|
|
params.put("CustomerCode", customerCode); |
|
|
|
params.put("AbcClass", abcClass); |
|
|
|
params.put("ItemType", itemType); |
|
|
|
params.put("ItemGroup", itemGroup); |
|
|
|
params.put("Project", project); |
|
|
|
params.put("ItemCode", itemCode); |
|
|
|
if(supplierCode != null && !supplierCode.isEmpty()) { |
|
|
|
params.put("SupplierCode", supplierCode); |
|
|
|
} |
|
|
|
if(customerCode != null && !customerCode.isEmpty()) { |
|
|
|
params.put("CustomerCode", customerCode); |
|
|
|
} |
|
|
|
if(abcClass != null && !abcClass.isEmpty()) { |
|
|
|
params.put("AbcClass", abcClass); |
|
|
|
} |
|
|
|
if(itemType != null && !itemType.isEmpty()) { |
|
|
|
params.put("ItemType", itemType); |
|
|
|
} |
|
|
|
if(itemGroup != null && !itemGroup.isEmpty()) { |
|
|
|
params.put("ItemGroup", itemGroup); |
|
|
|
} |
|
|
|
if(project != null && !project.isEmpty()) { |
|
|
|
params.put("Project", project); |
|
|
|
} |
|
|
|
if(itemCode != null && !itemCode.isEmpty()) { |
|
|
|
params.put("ItemCode", itemCode); |
|
|
|
} |
|
|
|
if(this.forEachParams(params, conditionArray)) { |
|
|
|
return RuleConvert.INSTANCE.convert(ruleDO); |
|
|
|
} |
|
|
@ -396,10 +524,18 @@ public class RuleServiceImpl implements RuleService { |
|
|
|
} |
|
|
|
JSONArray conditionArray = JSONUtil.parseArray(condition); |
|
|
|
Map<String, String> params = new HashMap<>(); |
|
|
|
params.put("WarehouseCode", warehouseCode); |
|
|
|
params.put("AreaCode", areaCode); |
|
|
|
params.put("LocationGroupCode", locationGroupCode); |
|
|
|
params.put("LocationCode", locationCode); |
|
|
|
if(warehouseCode != null && !warehouseCode.isEmpty()) { |
|
|
|
params.put("WarehouseCode", warehouseCode); |
|
|
|
} |
|
|
|
if(areaCode != null && !areaCode.isEmpty()) { |
|
|
|
params.put("AreaCode", areaCode); |
|
|
|
} |
|
|
|
if(locationGroupCode != null && !locationGroupCode.isEmpty()) { |
|
|
|
params.put("LocationGroupCode", locationGroupCode); |
|
|
|
} |
|
|
|
if(locationCode != null && !locationCode.isEmpty()) { |
|
|
|
params.put("LocationCode", locationCode); |
|
|
|
} |
|
|
|
if(this.forEachParams(params, conditionArray)) { |
|
|
|
return RuleConvert.INSTANCE.convert(ruleDO); |
|
|
|
} |
|
|
@ -421,9 +557,15 @@ public class RuleServiceImpl implements RuleService { |
|
|
|
JSONArray conditionArray = JSONUtil.parseArray(condition); |
|
|
|
Map<String, String> params = new HashMap<>(); |
|
|
|
params.put("ContainerType", containerType); |
|
|
|
params.put("ItemGroup", itemGroup); |
|
|
|
params.put("ProjectCode", projectCode); |
|
|
|
params.put("ItemCode", itemCode); |
|
|
|
if(itemGroup != null && !itemGroup.isEmpty()) { |
|
|
|
params.put("ItemGroup", itemGroup); |
|
|
|
} |
|
|
|
if(projectCode != null && !projectCode.isEmpty()) { |
|
|
|
params.put("ProjectCode", projectCode); |
|
|
|
} |
|
|
|
if(itemCode != null && !itemCode.isEmpty()) { |
|
|
|
params.put("ItemCode", itemCode); |
|
|
|
} |
|
|
|
if(this.forEachParams(params, conditionArray)) { |
|
|
|
return RuleConvert.INSTANCE.convert(ruleDO); |
|
|
|
} |
|
|
@ -465,56 +607,56 @@ public class RuleServiceImpl implements RuleService { |
|
|
|
String value = conditionObject.get("Value").toString(); |
|
|
|
if(paramValue != null && paramValue.isEmpty()) { |
|
|
|
if(operator.equals("==")) { |
|
|
|
if(!value.equals(paramValue)) { |
|
|
|
return false; |
|
|
|
if(value.equals(paramValue)) { |
|
|
|
return true; |
|
|
|
} |
|
|
|
} else if(operator.equals("!=")) { |
|
|
|
if(value.equals(paramValue)) { |
|
|
|
return false; |
|
|
|
if(!value.equals(paramValue)) { |
|
|
|
return true; |
|
|
|
} |
|
|
|
} else if(operator.equals(">")) { |
|
|
|
BigDecimal value1 = new BigDecimal(paramValue); |
|
|
|
BigDecimal value2 = new BigDecimal(value); |
|
|
|
if(value1.compareTo(value2) <= 0) { |
|
|
|
return false; |
|
|
|
if(value1.compareTo(value2) > 0) { |
|
|
|
return true; |
|
|
|
} |
|
|
|
} else if(operator.equals("<")) { |
|
|
|
BigDecimal value1 = new BigDecimal(paramValue); |
|
|
|
BigDecimal value2 = new BigDecimal(value); |
|
|
|
if(value1.compareTo(value2) >= 0) { |
|
|
|
return false; |
|
|
|
if(value1.compareTo(value2) < 0) { |
|
|
|
return true; |
|
|
|
} |
|
|
|
} else if(operator.equals(">=")) { |
|
|
|
BigDecimal value1 = new BigDecimal(paramValue); |
|
|
|
BigDecimal value2 = new BigDecimal(value); |
|
|
|
if(value1.compareTo(value2) < 0) { |
|
|
|
return false; |
|
|
|
if(value1.compareTo(value2) >= 0) { |
|
|
|
return true; |
|
|
|
} |
|
|
|
} else if(operator.equals("<=")) { |
|
|
|
BigDecimal value1 = new BigDecimal(paramValue); |
|
|
|
BigDecimal value2 = new BigDecimal(value); |
|
|
|
if(value1.compareTo(value2) > 0) { |
|
|
|
return false; |
|
|
|
if(value1.compareTo(value2) <= 0) { |
|
|
|
return true; |
|
|
|
} |
|
|
|
} else if(operator.equals("IN")) { |
|
|
|
List<String> valueList = Arrays.asList(value.split(",")); |
|
|
|
if(!valueList.contains(paramValue)) { |
|
|
|
return false; |
|
|
|
if(valueList.contains(paramValue)) { |
|
|
|
return true; |
|
|
|
} |
|
|
|
} else if(operator.equals("NOT IN")) { |
|
|
|
List<String> valueList = Arrays.asList(value.split(",")); |
|
|
|
if(valueList.contains(paramValue)) { |
|
|
|
return false; |
|
|
|
if(!valueList.contains(paramValue)) { |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if(operator.equals("NULL")) { |
|
|
|
return paramValue == null || paramValue.isEmpty(); |
|
|
|
} else if(operator.equals("NOT NULL")) { |
|
|
|
return paramValue != null && !paramValue.isEmpty(); |
|
|
|
} |
|
|
|
//if(operator.equals("NULL")) {
|
|
|
|
// return paramValue == null || paramValue.isEmpty();
|
|
|
|
//} else if(operator.equals("NOT NULL")) {
|
|
|
|
// return paramValue != null && !paramValue.isEmpty();
|
|
|
|
//}
|
|
|
|
} |
|
|
|
return true; |
|
|
|
return false; |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|