Commit 446f72be authored by 18083's avatar 18083

邮件发送优化

parent c6a5977b
<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
select case when v.job_count>=2 then 'Y' else 'N' end as existsFlag
from (select count(1) job_count
from sch_concurrent_job t1
where task_code = 'SYS_SEND_MAIL_BY_JAVA'
and job_status in ('RUNNING')) v
]]></bm:query-sql>
</bm:operation>
</bm:operations>
<bm:fields>
<bm:field name="existsFlag"/>
</bm:fields>
</bm:model>
...@@ -23,12 +23,13 @@ ...@@ -23,12 +23,13 @@
zj_sys_mailing_list zj_sys_mailing_list
WHERE WHERE
sent_flag = 'N' AND sent_flag = 'N' AND
mail_to is not null AND
error_times <= 3 AND error_times <= 3 AND
( (
sysdate - creation_date sysdate - creation_date
) )
< 3 < 3
and rownum<=30 and rownum<=15
]]></bm:query-sql> ]]></bm:query-sql>
</bm:operation> </bm:operation>
<bm:operation name="update"> <bm:operation name="update">
......
...@@ -9,6 +9,12 @@ ...@@ -9,6 +9,12 @@
importPackage(Packages.com.hand.hls.hlcm.util); importPackage(Packages.com.hand.hls.hlcm.util);
try { try {
var existsFlag_query = $bm('sys.SYS405.sys_mail_sent');
existsFlag_map = existsFlag_query.queryAsMap({
});
var existsFlag_details = existsFlag_map.getChildren();
existsFlag = existsFlag_details[0].existsFlag;
if(existsFlag=='N'){
var mail_server_bm = $bm('sys.SYS405.sys_get_mail_server'); var mail_server_bm = $bm('sys.SYS405.sys_get_mail_server');
var mail_server_result = mail_server_bm.queryAsMap().getChildren(); var mail_server_result = mail_server_bm.queryAsMap().getChildren();
var mail_list_bm = $bm('sys.SYS405.zj_sys_mailing_list'); var mail_list_bm = $bm('sys.SYS405.zj_sys_mailing_list');
...@@ -44,6 +50,7 @@ ...@@ -44,6 +50,7 @@
}); });
} }
} }
}
} catch (e) { } catch (e) {
raise_app_error(e); raise_app_error(e);
} }
......
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