Commit ca9ef959 authored by congzhao's avatar congzhao

电子签约-签约短信发送开发

parent cf4bcc92
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
<bm:field name="sent_date_str" forInsert="false" forQuery="true" forUpdate="false"/> <bm:field name="sent_date_str" forInsert="false" forQuery="true" forUpdate="false"/>
<bm:field name="send_date" databaseType="VARCHAR2" datatype="java.lang.String"/> <bm:field name="send_date" databaseType="VARCHAR2" datatype="java.lang.String"/>
<bm:field name="contract_number" databaseType="VARCHAR2" datatype="java.lang.String"/> <bm:field name="contract_number" databaseType="VARCHAR2" datatype="java.lang.String"/>
<bm:field name="contract_id" databaseType="NUMBER" datatype="java.lang.Long"/>
</bm:fields> </bm:fields>
<bm:operations> <bm:operations>
<bm:operation name="query"> <bm:operation name="query">
...@@ -60,7 +61,8 @@ ...@@ -60,7 +61,8 @@
v.code_value = t1.status v.code_value = t1.status
) AS status_desc, ) AS status_desc,
t1.send_date, t1.send_date,
t1.contract_number t1.contract_number,
t1.contract_id
FROM FROM
sys_sms_list t1 #WHERE_CLAUSE# sys_sms_list t1 #WHERE_CLAUSE#
ORDER BY ORDER BY
...@@ -112,5 +114,6 @@ ...@@ -112,5 +114,6 @@
<!--<bm:query-field name="sent_date_t" queryExpression="to_date(send_date,&apos;yyyy-mm-dd&apos;) &lt;= to_date(${@sent_date_t},&apos;yyyy-mm-dd&apos;)"/>--> <!--<bm:query-field name="sent_date_t" queryExpression="to_date(send_date,&apos;yyyy-mm-dd&apos;) &lt;= to_date(${@sent_date_t},&apos;yyyy-mm-dd&apos;)"/>-->
<bm:query-field name="sms_id" queryExpression="sms_id = ${@sms_id}"/> <bm:query-field name="sms_id" queryExpression="sms_id = ${@sms_id}"/>
<bm:query-field name="error_count_check" queryExpression="(${@error_count_check} = &apos;Y&apos; and nvl(error_count,0) &lt; 5)"/> <bm:query-field name="error_count_check" queryExpression="(${@error_count_check} = &apos;Y&apos; and nvl(error_count,0) &lt; 5)"/>
<bm:query-field name="contract_id" queryExpression="contract_id = ${@contract_id} and status=&apos;NEW&apos;"/>
</bm:query-fields> </bm:query-fields>
</bm:model> </bm:model>
...@@ -50,5 +50,13 @@ ...@@ -50,5 +50,13 @@
end; end;
]]></bm:update-sql> ]]></bm:update-sql>
</bm:operation> </bm:operation>
<bm:operation name="insert">
<bm:update-sql><![CDATA[
begin
hl_sms_send_pkg.send_mobile_remind_info(p_contract_id => ${@contract_id},
p_user_id => nvl(${/session/@user_id},1));
end;
]]></bm:update-sql>
</bm:operation>
</bm:operations> </bm:operations>
</bm:model> </bm:model>
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
importPackage(Packages.leaf.plugin.word2pdf); importPackage(Packages.leaf.plugin.word2pdf);
importPackage(Packages.org.apache.commons.io); importPackage(Packages.org.apache.commons.io);
importPackage(Packages.com.hand.elecon.httpost); importPackage(Packages.com.hand.elecon.httpost);
importPackage(Packages.com.hand.hls.hlcm.emay);
var up_file_token_url = info_query('UP_FILE_TOKEN_URL').code_value; var up_file_token_url = info_query('UP_FILE_TOKEN_URL').code_value;
...@@ -83,6 +84,30 @@ ...@@ -83,6 +84,30 @@
return info; return info;
} }
function send_sms(contract_id) {
var sms_list_bm = $bm('sys.SYS401.sys_sms_list');
var sms_list_result = sms_list_bm.queryAsMap({
contract_id: contract_id
});
var sms_list_records = sms_list_result.getChildren();
for (var i = 0; i < sms_list_records.length; i++) {
var Phones = sms_list_records[i].phone_number;
var content = sms_list_records[i].text;
var sms_id = sms_list_records[i].sms_id;
try {
var example = new Example();
var result = example.setSingleSms(content, Phones);
var req_response = result.toString();
} catch (e) {
println("抛出异常:" + e);
}
// 发送短信后,逻辑处理
$bm('nt.sys_sms_list').update({
sms_id: sms_id,
req_response: req_response
});
}
}
//依据合同文本签署人定义存储签署人信息 //依据合同文本签署人定义存储签署人信息
var ele_contract_signer_bm = $bm('wx.WX100.con_ele_contract_signer_save'); var ele_contract_signer_bm = $bm('wx.WX100.con_ele_contract_signer_save');
/* ele_contract_signer_bm.update({ /* ele_contract_signer_bm.update({
...@@ -255,6 +280,11 @@ ...@@ -255,6 +280,11 @@
flow_update_bm.execute({ flow_update_bm.execute({
contract_id: $ctx.parameter.contract_id contract_id: $ctx.parameter.contract_id
}) })
//发送签约短消息提醒 24976
flow_update_bm.insert({
contract_id: $ctx.parameter.contract_id
})
send_sms($ctx.parameter.contract_id);
} }
]]></s:server-script> ]]></s:server-script>
</a:init-procedure> </a:init-procedure>
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
importPackage(Packages.leaf.plugin.word2pdf); importPackage(Packages.leaf.plugin.word2pdf);
importPackage(Packages.org.apache.commons.io); importPackage(Packages.org.apache.commons.io);
importPackage(Packages.com.hand.elecon.httpost); importPackage(Packages.com.hand.elecon.httpost);
importPackage(Packages.com.hand.hls.hlcm.emay);
var up_file_token_url = info_query('UP_FILE_TOKEN_URL').code_value; var up_file_token_url = info_query('UP_FILE_TOKEN_URL').code_value;
...@@ -83,6 +84,31 @@ ...@@ -83,6 +84,31 @@
return info; return info;
} }
function send_sms(contract_id) {
var sms_list_bm = $bm('sys.SYS401.sys_sms_list');
var sms_list_result = sms_list_bm.queryAsMap({
contract_id: contract_id
});
var sms_list_records = sms_list_result.getChildren();
for (var i = 0; i < sms_list_records.length; i++) {
var Phones = sms_list_records[i].phone_number;
var content = sms_list_records[i].text;
var sms_id = sms_list_records[i].sms_id;
try {
var example = new Example();
var result = example.setSingleSms(content, Phones);
var req_response = result.toString();
} catch (e) {
println("抛出异常:" + e);
}
// 发送短信后,逻辑处理
$bm('nt.sys_sms_list').update({
sms_id: sms_id,
req_response: req_response
});
}
}
//依据合同文本签署人定义存储签署人信息 //依据合同文本签署人定义存储签署人信息
var ele_contract_signer_bm = $bm('wx.WX100.con_et_contract_signer_save'); var ele_contract_signer_bm = $bm('wx.WX100.con_et_contract_signer_save');
ele_contract_signer_bm.update({ ele_contract_signer_bm.update({
...@@ -322,6 +348,11 @@ ...@@ -322,6 +348,11 @@
flow_update_bm.execute({ flow_update_bm.execute({
contract_id: $ctx.parameter.contract_id contract_id: $ctx.parameter.contract_id
}) })
//发送签约短消息提醒 24976
flow_update_bm.insert({
contract_id: $ctx.parameter.contract_id
})
send_sms($ctx.parameter.contract_id);
var sign_url_list = result_ob.signUrlList; var sign_url_list = result_ob.signUrlList;
var ele_con_info_bm = $bm('wx.WX100.con_ele_con_info_update'); var ele_con_info_bm = $bm('wx.WX100.con_ele_con_info_update');
for(var i = 0 ; i < sign_url_list.length; i++){ for(var i = 0 ; i < sign_url_list.length; i++){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment