GetUnitAndPriceRule.drl 1.9 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77
package cn.ibizlab.sample.logic.ibizorderdetaillogic.getunitandprice;

import java.util.Map;
import java.util.HashMap;
import com.alibaba.fastjson.JSONObject;
import org.springframework.util.StringUtils;
import org.springframework.util.ObjectUtils;
import cn.ibizlab.util.errors.BadRequestAlertException;

global cn.ibizlab.core.sample.domain.IBIZUNIProduct param_product;
global cn.ibizlab.core.sample.domain.IBIZOrderDetail param_default;
global cn.ibizlab.core.sample.service.IBIZUNIProductService ibizuniproductservice;
global cn.ibizlab.core.sample.service.IBIZOrderDetailService iBzSysIBIZOrderDetailDefaultService;
global cn.ibizlab.util.security.AuthenticationUser curuser;

no-loop

//逻辑处理节点[开始]
rule "begin"
ruleflow-group "begingroup"
  when
  then
    update(param_product);//更新fact中变量值
    update(param_default);//更新fact中变量值
  end

//逻辑处理节点[填充单位和单价]
rule "prepareparam2"
ruleflow-group "prepareparam2group"
  when
  then
    
    param_default.set("unitprice",param_product.get("unitprice"));
    
    
    
    
    
    
    
    param_default.set("unit",param_product.get("unit"));
    
    
    
    
    
    
    update(param_product);//更新fact中变量值
    update(param_default);//更新fact中变量值
  end

//逻辑处理节点[获取商品信息]
rule "deaction1"
ruleflow-group "deaction1group"
  when
  then
    cn.ibizlab.util.helper.CachedBeanCopier.copy(ibizuniproductservice.get(param_product.getIbizuniProductId()),param_product);
    update(param_product);//更新fact中变量值
    update(param_default);//更新fact中变量值
  end

//逻辑处理节点[获取商品ID]
rule "prepareparam1"
ruleflow-group "prepareparam1group"
  when
  then
    
    param_product.set("ibizuniproductid",param_default.get("ibizuniproductid"));
    
    
    
    
    
    
    update(param_product);//更新fact中变量值
    update(param_default);//更新fact中变量值
  end