package com.studio.express;
import com.ql.util.express.DefaultContext;
import com.ql.util.express.ExpressRunner;
import org.apache.commons.collections.map.HashedMap;
import org.apache.commons.lang.StringUtils;
import java.util.Map;
/**
* Created by zhangjian on 2019/2/28.
*/
public class QLExpresssTest {
public static void main(String[] args) {
String totalPrice = "50.00";
String expressStr = "value>=200-20;150<=value and value<=200-15;100<=value and value<=150-10";
String[] expressArray = expressStr.split(";");
for (String condition : expressArray) {
if (!StringUtils.isEmpty(condition)) {
String[] e = condition.split("-");
Map param = new HashedMap();
param.put("value", totalPrice);
String result = execute(e[0], param);
使用QLExpresss做满减规则
最新推荐文章于 2023-12-11 09:06:57 发布