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 ibizorderdetailgetunitandpriceproduct;
                global cn.ibizlab.core.sample.domain.IBIZOrderDetail ibizorderdetailgetunitandpricedefault;
                global java.util.Map ibizorderdetailgetunitandpricelist;
                global cn.ibizlab.core.sample.domain.IBIZOrder ibizorderdetailgetunitandpriceorder;
                global java.util.Map ibizorderdetailgetunitandpricepage;
                global java.util.Map ibizorderdetailgetunitandpricefilter;
                    global cn.ibizlab.core.sample.service.IIBIZOrderDetailService ibizorderdetailservice;
                    global cn.ibizlab.core.sample.service.IIBIZUNIProductService ibizuniproductservice;
                    global cn.ibizlab.core.sample.service.IIBIZOrderService ibizorderservice;
                    global cn.ibizlab.core.sample.service.IIBIZBOOKService ibizbookservice;
        global cn.ibizlab.core.sample.service.IIBIZOrderDetailService iBzSysIbizorderdetailDefaultService;
        global cn.ibizlab.util.security.AuthenticationUser curuser;


    no-loop

            //逻辑处理节点[开始]
            rule "begin"
            ruleflow-group "ibizorderdetailgetunitandpricebegin"
            when
            then
            end

            //逻辑处理节点[统计金额]
            rule "delogic1"
            ruleflow-group "ibizorderdetailgetunitandpricedelogic1"
            when
            then
                        update(ibizorderdetailgetunitandpriceproduct);//更新fact中变量值
                        update(ibizorderdetailgetunitandpricedefault);//更新fact中变量值
                        update(ibizorderdetailgetunitandpricelist);//更新fact中变量值
                        update(ibizorderdetailgetunitandpriceorder);//更新fact中变量值
                        update(ibizorderdetailgetunitandpricepage);//更新fact中变量值
                        update(ibizorderdetailgetunitandpricefilter);//更新fact中变量值
            end

            //逻辑处理节点[大于200处理]
            rule "debugparam2"
            ruleflow-group "ibizorderdetailgetunitandpricedebugparam2"
            when
            then
                        update(ibizorderdetailgetunitandpriceproduct);//更新fact中变量值
                        update(ibizorderdetailgetunitandpricedefault);//更新fact中变量值
                        update(ibizorderdetailgetunitandpricelist);//更新fact中变量值
                        update(ibizorderdetailgetunitandpriceorder);//更新fact中变量值
                        update(ibizorderdetailgetunitandpricepage);//更新fact中变量值
                        update(ibizorderdetailgetunitandpricefilter);//更新fact中变量值
            end

            //逻辑处理节点[获取商品id]
            rule "prepareparam1"
            ruleflow-group "ibizorderdetailgetunitandpriceprepareparam1"
            when
            then
                            ibizorderdetailgetunitandpriceproduct.set("ibizuniproductid",ibizorderdetailgetunitandpricedefault.get("ibizuniproductid"));
                        update(ibizorderdetailgetunitandpriceproduct);//更新fact中变量值
                        update(ibizorderdetailgetunitandpricedefault);//更新fact中变量值
                        update(ibizorderdetailgetunitandpricelist);//更新fact中变量值
                        update(ibizorderdetailgetunitandpriceorder);//更新fact中变量值
                        update(ibizorderdetailgetunitandpricepage);//更新fact中变量值
                        update(ibizorderdetailgetunitandpricefilter);//更新fact中变量值
            end

            //逻辑处理节点[获取商品信息]
            rule "deaction1"
            ruleflow-group "ibizorderdetailgetunitandpricedeaction1"
            when
            then
                            cn.ibizlab.util.helper.CachedBeanCopier.copy(ibizuniproductservice.get(ibizorderdetailgetunitandpriceproduct.getIbizuniproductid()),ibizorderdetailgetunitandpriceproduct);
                        update(ibizorderdetailgetunitandpriceproduct);//更新fact中变量值
                        update(ibizorderdetailgetunitandpricedefault);//更新fact中变量值
                        update(ibizorderdetailgetunitandpricelist);//更新fact中变量值
                        update(ibizorderdetailgetunitandpriceorder);//更新fact中变量值
                        update(ibizorderdetailgetunitandpricepage);//更新fact中变量值
                        update(ibizorderdetailgetunitandpricefilter);//更新fact中变量值
            end

            //逻辑处理节点[获取订单信息]
            rule "deaction2"
            ruleflow-group "ibizorderdetailgetunitandpricedeaction2"
            when
            then
                            cn.ibizlab.util.helper.CachedBeanCopier.copy(ibizorderservice.get(ibizorderdetailgetunitandpriceorder.getIbizorderid()),ibizorderdetailgetunitandpriceorder);
                        update(ibizorderdetailgetunitandpriceproduct);//更新fact中变量值
                        update(ibizorderdetailgetunitandpricedefault);//更新fact中变量值
                        update(ibizorderdetailgetunitandpricelist);//更新fact中变量值
                        update(ibizorderdetailgetunitandpriceorder);//更新fact中变量值
                        update(ibizorderdetailgetunitandpricepage);//更新fact中变量值
                        update(ibizorderdetailgetunitandpricefilter);//更新fact中变量值
            end

            //逻辑处理节点[拷贝参数]
            rule "copyparam1"
            ruleflow-group "ibizorderdetailgetunitandpricecopyparam1"
            when
            then
                        update(ibizorderdetailgetunitandpriceproduct);//更新fact中变量值
                        update(ibizorderdetailgetunitandpricedefault);//更新fact中变量值
                        update(ibizorderdetailgetunitandpricelist);//更新fact中变量值
                        update(ibizorderdetailgetunitandpriceorder);//更新fact中变量值
                        update(ibizorderdetailgetunitandpricepage);//更新fact中变量值
                        update(ibizorderdetailgetunitandpricefilter);//更新fact中变量值
            end

            //逻辑处理节点[实体数据集]
            rule "dedataset1"
            ruleflow-group "ibizorderdetailgetunitandpricededataset1"
            when
            then
                        update(ibizorderdetailgetunitandpriceproduct);//更新fact中变量值
                        update(ibizorderdetailgetunitandpricedefault);//更新fact中变量值
                        update(ibizorderdetailgetunitandpricelist);//更新fact中变量值
                        update(ibizorderdetailgetunitandpriceorder);//更新fact中变量值
                        update(ibizorderdetailgetunitandpricepage);//更新fact中变量值
                        update(ibizorderdetailgetunitandpricefilter);//更新fact中变量值
            end

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

            //逻辑处理节点[大于100处理]
            rule "debugparam1"
            ruleflow-group "ibizorderdetailgetunitandpricedebugparam1"
            when
            then
                        update(ibizorderdetailgetunitandpriceproduct);//更新fact中变量值
                        update(ibizorderdetailgetunitandpricedefault);//更新fact中变量值
                        update(ibizorderdetailgetunitandpricelist);//更新fact中变量值
                        update(ibizorderdetailgetunitandpriceorder);//更新fact中变量值
                        update(ibizorderdetailgetunitandpricepage);//更新fact中变量值
                        update(ibizorderdetailgetunitandpricefilter);//更新fact中变量值
            end

            //逻辑处理节点[重置参数]
            rule "resetparam1"
            ruleflow-group "ibizorderdetailgetunitandpriceresetparam1"
            when
            then
                        update(ibizorderdetailgetunitandpriceproduct);//更新fact中变量值
                        update(ibizorderdetailgetunitandpricedefault);//更新fact中变量值
                        update(ibizorderdetailgetunitandpricelist);//更新fact中变量值
                        update(ibizorderdetailgetunitandpriceorder);//更新fact中变量值
                        update(ibizorderdetailgetunitandpricepage);//更新fact中变量值
                        update(ibizorderdetailgetunitandpricefilter);//更新fact中变量值
            end

            //逻辑处理节点[调试逻辑参数]
            rule "debugparam4"
            ruleflow-group "ibizorderdetailgetunitandpricedebugparam4"
            when
            then
                        update(ibizorderdetailgetunitandpriceproduct);//更新fact中变量值
                        update(ibizorderdetailgetunitandpricedefault);//更新fact中变量值
                        update(ibizorderdetailgetunitandpricelist);//更新fact中变量值
                        update(ibizorderdetailgetunitandpriceorder);//更新fact中变量值
                        update(ibizorderdetailgetunitandpricepage);//更新fact中变量值
                        update(ibizorderdetailgetunitandpricefilter);//更新fact中变量值
            end

            //逻辑处理节点[排序数组参数]
            rule "sortparam1"
            ruleflow-group "ibizorderdetailgetunitandpricesortparam1"
            when
            then
                        update(ibizorderdetailgetunitandpriceproduct);//更新fact中变量值
                        update(ibizorderdetailgetunitandpricedefault);//更新fact中变量值
                        update(ibizorderdetailgetunitandpricelist);//更新fact中变量值
                        update(ibizorderdetailgetunitandpriceorder);//更新fact中变量值
                        update(ibizorderdetailgetunitandpricepage);//更新fact中变量值
                        update(ibizorderdetailgetunitandpricefilter);//更新fact中变量值
            end

            //逻辑处理节点[调试逻辑参数]
            rule "debugparam5"
            ruleflow-group "ibizorderdetailgetunitandpricedebugparam5"
            when
            then
                        update(ibizorderdetailgetunitandpriceproduct);//更新fact中变量值
                        update(ibizorderdetailgetunitandpricedefault);//更新fact中变量值
                        update(ibizorderdetailgetunitandpricelist);//更新fact中变量值
                        update(ibizorderdetailgetunitandpriceorder);//更新fact中变量值
                        update(ibizorderdetailgetunitandpricepage);//更新fact中变量值
                        update(ibizorderdetailgetunitandpricefilter);//更新fact中变量值
            end

            //逻辑处理节点[获取订单信息异常]
            rule "throwexception2"
            ruleflow-group "ibizorderdetailgetunitandpricethrowexception2"
            when
            then
                        update(ibizorderdetailgetunitandpriceproduct);//更新fact中变量值
                        update(ibizorderdetailgetunitandpricedefault);//更新fact中变量值
                        update(ibizorderdetailgetunitandpricelist);//更新fact中变量值
                        update(ibizorderdetailgetunitandpriceorder);//更新fact中变量值
                        update(ibizorderdetailgetunitandpricepage);//更新fact中变量值
                        update(ibizorderdetailgetunitandpricefilter);//更新fact中变量值
            end

            //逻辑处理节点[实体行为]
            rule "deaction3"
            ruleflow-group "ibizorderdetailgetunitandpricedeaction3"
            when
            then
                        ibizorderdetailservice.countMoney(ibizorderdetailgetunitandpricedefault);
                        update(ibizorderdetailgetunitandpriceproduct);//更新fact中变量值
                        update(ibizorderdetailgetunitandpricedefault);//更新fact中变量值
                        update(ibizorderdetailgetunitandpricelist);//更新fact中变量值
                        update(ibizorderdetailgetunitandpriceorder);//更新fact中变量值
                        update(ibizorderdetailgetunitandpricepage);//更新fact中变量值
                        update(ibizorderdetailgetunitandpricefilter);//更新fact中变量值
            end

            //逻辑处理节点[绑定参数]
            rule "bindparam1"
            ruleflow-group "ibizorderdetailgetunitandpricebindparam1"
            when
            then
                        update(ibizorderdetailgetunitandpriceproduct);//更新fact中变量值
                        update(ibizorderdetailgetunitandpricedefault);//更新fact中变量值
                        update(ibizorderdetailgetunitandpricelist);//更新fact中变量值
                        update(ibizorderdetailgetunitandpriceorder);//更新fact中变量值
                        update(ibizorderdetailgetunitandpricepage);//更新fact中变量值
                        update(ibizorderdetailgetunitandpricefilter);//更新fact中变量值
            end

            //逻辑处理节点[调试逻辑参数]
            rule "debugparam3"
            ruleflow-group "ibizorderdetailgetunitandpricedebugparam3"
            when
            then
                        update(ibizorderdetailgetunitandpriceproduct);//更新fact中变量值
                        update(ibizorderdetailgetunitandpricedefault);//更新fact中变量值
                        update(ibizorderdetailgetunitandpricelist);//更新fact中变量值
                        update(ibizorderdetailgetunitandpriceorder);//更新fact中变量值
                        update(ibizorderdetailgetunitandpricepage);//更新fact中变量值
                        update(ibizorderdetailgetunitandpricefilter);//更新fact中变量值
            end

            //逻辑处理节点[设置orderid]
            rule "prepareparam3"
            ruleflow-group "ibizorderdetailgetunitandpriceprepareparam3"
            when
            then
                            ibizorderdetailgetunitandpriceorder.set("ibizorderid",ibizorderdetailgetunitandpricedefault.get("ibizorderid"));
                            ibizorderdetailgetunitandpriceorder.set("createman","111");
                        update(ibizorderdetailgetunitandpriceproduct);//更新fact中变量值
                        update(ibizorderdetailgetunitandpricedefault);//更新fact中变量值
                        update(ibizorderdetailgetunitandpricelist);//更新fact中变量值
                        update(ibizorderdetailgetunitandpriceorder);//更新fact中变量值
                        update(ibizorderdetailgetunitandpricepage);//更新fact中变量值
                        update(ibizorderdetailgetunitandpricefilter);//更新fact中变量值
            end

            //逻辑处理节点[实体数据查询]
            rule "dedataquery1"
            ruleflow-group "ibizorderdetailgetunitandpricededataquery1"
            when
            then
                        update(ibizorderdetailgetunitandpriceproduct);//更新fact中变量值
                        update(ibizorderdetailgetunitandpricedefault);//更新fact中变量值
                        update(ibizorderdetailgetunitandpricelist);//更新fact中变量值
                        update(ibizorderdetailgetunitandpriceorder);//更新fact中变量值
                        update(ibizorderdetailgetunitandpricepage);//更新fact中变量值
                        update(ibizorderdetailgetunitandpricefilter);//更新fact中变量值
            end

            //逻辑处理节点[重新建立参数]
            rule "renewparam1"
            ruleflow-group "ibizorderdetailgetunitandpricerenewparam1"
            when
            then
                        update(ibizorderdetailgetunitandpriceproduct);//更新fact中变量值
                        update(ibizorderdetailgetunitandpricedefault);//更新fact中变量值
                        update(ibizorderdetailgetunitandpricelist);//更新fact中变量值
                        update(ibizorderdetailgetunitandpriceorder);//更新fact中变量值
                        update(ibizorderdetailgetunitandpricepage);//更新fact中变量值
                        update(ibizorderdetailgetunitandpricefilter);//更新fact中变量值
            end

            //逻辑处理节点[附加到数组参数]
            rule "appendparam1"
            ruleflow-group "ibizorderdetailgetunitandpriceappendparam1"
            when
            then
                        update(ibizorderdetailgetunitandpriceproduct);//更新fact中变量值
                        update(ibizorderdetailgetunitandpricedefault);//更新fact中变量值
                        update(ibizorderdetailgetunitandpricelist);//更新fact中变量值
                        update(ibizorderdetailgetunitandpriceorder);//更新fact中变量值
                        update(ibizorderdetailgetunitandpricepage);//更新fact中变量值
                        update(ibizorderdetailgetunitandpricefilter);//更新fact中变量值
            end

            //逻辑处理节点[获取产品价格异常]
            rule "throwexception"
            ruleflow-group "ibizorderdetailgetunitandpricethrowexception"
            when
            then
                        update(ibizorderdetailgetunitandpriceproduct);//更新fact中变量值
                        update(ibizorderdetailgetunitandpricedefault);//更新fact中变量值
                        update(ibizorderdetailgetunitandpricelist);//更新fact中变量值
                        update(ibizorderdetailgetunitandpriceorder);//更新fact中变量值
                        update(ibizorderdetailgetunitandpricepage);//更新fact中变量值
                        update(ibizorderdetailgetunitandpricefilter);//更新fact中变量值
            end