Commit b25d36ad authored by 陆正友's avatar 陆正友

修复短信问题

parent 9fbc9711
...@@ -11,12 +11,37 @@ ...@@ -11,12 +11,37 @@
importPackage(Packages.com.hand.hap.system.dto); importPackage(Packages.com.hand.hap.system.dto);
//step2 发送短信 //step2 发送短信
function sendsms() { function sendsms() {
// 查询待发送短信表 // 查询待发送短信表
var contract_collection = $bm('sys.SYS420.reminder_sms_list'); var contract_collection = $bm('sys.SYS420.reminder_sms_list');
contract_collection.update(); contract_collection.update();
} var sms_list_bm = $bm('sys.SYS420.reminder_sms_loop');
sendsms(); println($ctx.parameter.batch_id);
]]></s:server-script> 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
});
}
}
sendsms();
]]></s:server-script>
</a:init-procedure> </a:init-procedure>
<a:service-output output="/parameter"/> <a:service-output output="/parameter"/>
</a:service> </a:service>
\ No newline at end of file
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