Commit 0b53f655 authored by 陆正友's avatar 陆正友

合同信息发送失败job报错

parent f05e7d9c
<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" needAccessControl="false">
<bm:operations>
<bm:operation name="update">
<bm:update-sql><![CDATA[
begin
commit;
end;
]]>
</bm:update-sql>
</bm:operation>
</bm:operations>
</bm:model>
...@@ -4,14 +4,29 @@ ...@@ -4,14 +4,29 @@
<bm:operation name="update"> <bm:operation name="update">
<bm:update-sql><![CDATA[ <bm:update-sql><![CDATA[
begin begin
contract_sign_message_pkg.send_mobile_remind_info(p_user_id =>${/session/@user_id}, p_batch_id =>${@batch_id}); contract_sign_message_pkg.send_mobile_remind_info(p_user_id =>${/session/@user_id}, p_batch_id
=>${@batch_id});
end; end;
]]></bm:update-sql> ]]>
</bm:update-sql>
<bm:parameters> <bm:parameters>
<bm:parameter name="batch_id" dataType="java.lang.Long" input="true" output="true" <bm:parameter name="batch_id" dataType="java.lang.Long" input="true" output="true"
outputPath="/parameter/@batch_id"/> outputPath="/parameter/@batch_id"/>
</bm:parameters> </bm:parameters>
</bm:operation> </bm:operation>
<bm:operation name="query">
<bm:query-sql><![CDATA[
SELECT *
FROM (SELECT count(*) num
FROM sys_sms_list a
WHERE a.batch_id = ${@batch_id}
and a.status = 'FAIL') t1
#WHERE_CLAUSE#
]]>
</bm:query-sql>
</bm:operation>
</bm:operations> </bm:operations>
<bm:fields>
<bm:field name="num"/>
</bm:fields>
</bm:model> </bm:model>
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
importPackage(Packages.com.hand.hap.system.dto); importPackage(Packages.com.hand.hap.system.dto);
//step2 发送短信 //step2 发送短信
function sendsms() { function sendsms() {
var logger = $logger("server-script");
// 查询待发送短信表 // 查询待发送短信表
var contract_collection = $bm('sys.SYS420.reminder_sms_list'); var contract_collection = $bm('sys.SYS420.reminder_sms_list');
contract_collection.update(); contract_collection.update();
...@@ -32,6 +33,7 @@ ...@@ -32,6 +33,7 @@
var req_response = result.toString(); var req_response = result.toString();
} catch (e) { } catch (e) {
println("抛出异常:" + e); println("抛出异常:" + e);
} }
//发送后请求更新 //发送后请求更新
$bm('sys.SYS420.reminder_sms_loop').update({ $bm('sys.SYS420.reminder_sms_loop').update({
...@@ -39,6 +41,20 @@ ...@@ -39,6 +41,20 @@
result: req_response result: req_response
}); });
} }
var sms_list_n_bm = $bm('sys.SYS420.reminder_sms_list');
println($ctx.parameter.batch_id);
var sms_list_n_result = sms_list_n_bm.queryAsMap({
"batch_id": $ctx.parameter.batch_id
});
logger.info('111111111111111');
var fail_num = sms_list_n_result.getChildren()[0].num;
logger.info(fail_num);
logger.info(fail_num > 0);
var sms_commit_bm = $bm('sys.SYS420.reminder_sms_commit');
sms_commit_bm.update();
if (fail_num > 0){
raise_app_error('本批发送失败的信息有' + fail_num + '条');
}
} }
sendsms(); sendsms();
]]></s:server-script> ]]></s:server-script>
......
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