create_change_req.lwm 2.35 KB
Newer Older
Spencer Chang's avatar
Spencer Chang committed
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
<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
    <bm:operations>
        <bm:operation name="execute">
            <bm:parameters>
                <bm:parameter name="change_req_id" dataType="java.lang.Long" input="false" output="true"/>
            </bm:parameters>
            <bm:update-sql><![CDATA[
                DECLARE
                v_price_list VARCHAR2(200);
                v_change_req_id NUMBER;
                BEGIN
                CON_CHANGE_REQ_CALC_ITFC_PKG.CREATE_CHANGE_REQ ( p_contract_id=>${@contract_id},
                p_req_date=>to_date(${@req_date},'YYYY-MM-DD'), p_req_type=>${@req_type},
                p_description=>${@description}, p_user_id=>${/session/@user_id},
                p_simulation_flag=>${@simulation_flag},p_ref_v01=>${@ref_v01}, p_change_req_id=>v_change_req_id );
                ${@change_req_id}:=v_change_req_id;
                IF ${@req_type} ='CONEXTHAG' THEN
                --根据合同的报价来查找变更的报价
                SELECT 'DS_PRICE_CHANGE_10' INTO v_price_list FROM dual;--找到合同的报价
                ELSIF ${@req_type} ='PAY_CHAG' THEN
                --根据合同的报价来查找变更的报价
                SELECT 'DS_PRICE_CHANGE_21' INTO v_price_list FROM dual;--找到合同的报价
                ELSIF ${@req_type} ='PART_CHAG' THEN
                --根据合同的报价来查找变更的报价
                SELECT 'DS_PRICE_CHANGE_30' INTO v_price_list FROM dual;--找到合同的报价
                ELSIF ${@req_type} ='CUT_CHAG' THEN
                --根据合同的报价来查找变更的报价
                SELECT 'DS_PRICE_CHANGE_90' INTO v_price_list FROM dual;--找到合同的报价
                END IF;
                --将找到的变更报价更新到变更合同和变更表中
                UPDATE
                con_contract cc
                SET
                cc.price_list = v_price_list
                WHERE
                cc.contract_id = v_change_req_id;
                UPDATE
                con_contract_change_req cc
                SET
                cc.ccr_price_list = v_price_list
                WHERE
                cc.change_req_id = v_change_req_id;
                END;
                ]]>
            </bm:update-sql>
        </bm:operation>
    </bm:operations>
</bm:model>