Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
leaf-hlcm
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hlcm
leaf-hlcm
Commits
9486d048
Commit
9486d048
authored
Oct 18, 2023
by
陆正友
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
合同信息发送失败job报错
parent
8ecff963
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
78 additions
and
34 deletions
+78
-34
reminder_sms_commit.lwm
...webapp/WEB-INF/classes/sys/SYS420/reminder_sms_commit.lwm
+13
-0
reminder_sms_list.lwm
...n/webapp/WEB-INF/classes/sys/SYS420/reminder_sms_list.lwm
+20
-5
sms_batch_send.lsc
src/main/webapp/modules/sys/SYS420/sms_batch_send.lsc
+45
-29
No files found.
src/main/webapp/WEB-INF/classes/sys/SYS420/reminder_sms_commit.lwm
0 → 100644
View file @
9486d048
<?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>
src/main/webapp/WEB-INF/classes/sys/SYS420/reminder_sms_list.lwm
View file @
9486d048
...
...
@@ -3,15 +3,30 @@
<bm:operations>
<bm:operation
name=
"update"
>
<bm:update-sql>
<![CDATA[
begin
contract_sign_message_pkg.send_mobile_remind_info(p_user_id =>
${/session/@user_id}, p_batch_id =>${@batch_id});
end;
]]>
</bm:update-sql>
begin
contract_sign_message_pkg.send_mobile_remind_info(p_user_id =>
${/session/@user_id}, p_batch_id
=>${@batch_id});
end;
]]>
</bm:update-sql>
<bm:parameters>
<bm:parameter
name=
"batch_id"
dataType=
"java.lang.Long"
input=
"true"
output=
"true"
outputPath=
"/parameter/@batch_id"
/>
</bm:parameters>
</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:fields>
<bm:field
name=
"num"
/>
</bm:fields>
</bm:model>
src/main/webapp/modules/sys/SYS420/sms_batch_send.lsc
View file @
9486d048
...
...
@@ -11,37 +11,53 @@
importPackage(Packages.com.hand.hap.system.dto);
//step2 发送短信
function sendsms() {
// 查询待发送短信表
var contract_collection = $bm('sys.SYS420.reminder_sms_list');
contract_collection.update();
var sms_list_bm = $bm('sys.SYS420.reminder_sms_loop');
println($ctx.parameter.batch_id);
var sms_list_result = sms_list_bm.queryAsMap({
"batch_id": $ctx.parameter.batch_id
});
var logger = $logger("server-script");
// 查询待发送短信表
var contract_collection = $bm('sys.SYS420.reminder_sms_list');
contract_collection.update();
var sms_list_bm = $bm('sys.SYS420.reminder_sms_loop');
println($ctx.parameter.batch_id);
var sms_list_result = sms_list_bm.queryAsMap({
"batch_id": $ctx.parameter.batch_id
});
var sms_list_records = sms_list_result.getChildren();
for (var i = 0; i < sms_list_records.length; i++) {
println(1);
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('sys.SYS420.reminder_sms_loop').update({
sms_id: sms_id,
result: req_response
});
}
var sms_list_records = sms_list_result.getChildren();
for (var i = 0; i < sms_list_records.length; i++) {
println(1);
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('sys.SYS420.reminder_sms_loop').update({
sms_id: sms_id,
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();
]]>
</s:server-script>
sendsms();
]]>
</s:server-script>
</a:init-procedure>
<a:service-output
output=
"/parameter"
/>
</a:service>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment