Commit 034819e0 authored by stone's avatar stone

Merge branch 'develop' of https://hel.hand-china.com/hlcm/leaf-hlcm into develop

parents 1db71361 5b510f70
package com.hand.hls.hlcm.util;
import net.sf.json.JSONObject;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.mail.*;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeMessage;
import java.util.Properties;
public class MailSend {
private static final Logger logger = LoggerFactory.getLogger(MailSend.class);
public static boolean isEmpty(String str) {
return str == null || "".equals(str.trim());
}
public static boolean isNotEmpty(String str) {
return !isEmpty(str);
}
public String sendMain(String jsonData) {
JSONObject jsonObject = JSONObject.fromObject(jsonData);
JSONObject js=new JSONObject();
// 发件人电子邮箱
String from = jsonObject.optString("serverAddress");
//获取系统属性,主要用于设置邮件相关的参数。
Properties properties = System.getProperties();
//smtp协议地址
properties.setProperty("mail.smtp.host", jsonObject.optString("serverHost"));
//端口号
properties.setProperty("mail.smtp.port", jsonObject.optString("serverPort"));
properties.setProperty("mail.smtp.starttls.enable", "true");
properties.setProperty("mail.smtp.socketFactory.fallback", "true");
properties.setProperty("mail.smtp.auth", "true");
//发送者账号密码
Session session = Session.getDefaultInstance(properties, new Authenticator() {
@Override
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(jsonObject.optString("serverName"), jsonObject.optString("serverPassWord"));
}
});
//创建MimeMessage消息对象,消息头配置了收发邮箱的地址,消息体包含了邮件标题和邮件内容。接收者类型:TO代表直接发送,CC代表抄送,BCC代表秘密抄送。
try {
MimeMessage message = new MimeMessage(session);
message.addHeader("X-Mailer", "Microsoft Outlook Express 6.00.2900.2869");
message.setFrom(new InternetAddress(from));
message.addRecipient(Message.RecipientType.TO, new InternetAddress(jsonObject.optString("toAddress")));
if (isNotEmpty(jsonObject.optString("toCcAddress"))){
String[] params = jsonObject.optString("toCcAddress").split(";");
if (params.length > 0) {
InternetAddress[] sendCc = new InternetAddress[params.length];
for (int i = 0; i < params.length; i++) {
sendCc[i] = new InternetAddress(params[i]);
}
message.addRecipients(MimeMessage.RecipientType.CC, sendCc);
}}
message.setSubject(jsonObject.optString("toSubject"));
message.setText(jsonObject.optString("toBody"));
Transport.send(message);
logger.info("send Success!");
js.put("status",'S');
} catch (MessagingException e) {
logger.error("send Error!", e);
js.put("status",'E');
js.put("errorMsg",e.getMessage());
}
return js.toString();
}
// 做测试用
@Test
public void test() {
MailSend mailSend=new MailSend();
//MailSend.sendMain("790553035@qq.com");
}
}
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
from (select c.contract_id, c.contract_number, c.contract_name from (select c.contract_id, c.contract_number, c.contract_name
from con_contract c from con_contract c
where c.data_class = 'NORMAL' where c.data_class = 'NORMAL'
and c.contract_status IN ('REPURING','ETING','INCEPT','PENDING')
and not exists (select 1 from acp_invoice_ln an where an.contract_id=c.contract_id and an.confirmation_status='APPROVING') and not exists (select 1 from acp_invoice_ln an where an.contract_id=c.contract_id and an.confirmation_status='APPROVING')
) V ) V
#WHERE_CLAUSE# #WHERE_CLAUSE#
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
$Revision: 1.0 $Revision: 1.0
$Purpose: $Purpose:
--> -->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm"> <bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" needAccessControl="false">
<bm:operations> <bm:operations>
<bm:operation name="update"> <bm:operation name="update">
<bm:update-sql><![CDATA[ <bm:update-sql><![CDATA[
......
...@@ -5,8 +5,13 @@ ...@@ -5,8 +5,13 @@
$Revision: 1.0 $Revision: 1.0
$Purpose: $Purpose:
--> -->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm"> <bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" needAccessControl="false">
<bm:operations> <bm:operations>
<bm:operation name="execute">
<bm:update-sql><![CDATA[
update hls_fin_calculator_hd hd set hd.other_payment2=${@other_payment2} where hd.calc_session_id=${@calc_session_id}
]]></bm:update-sql>
</bm:operation>
<bm:operation name="query"> <bm:operation name="query">
<bm:query-sql><![CDATA[ <bm:query-sql><![CDATA[
SELECT SELECT
......
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
return; return;
} }
var tempa=records[i].get('total_amount')||0; var tempa=records[i].get('total_amount')||0;
var tempb=records[i].get('net_amount')||0+records[i].get('tax_amount')||0; var tempb=((records[i].get('net_amount')||0)+(records[i].get('tax_amount')||0));
if(tempa!=tempb){ if(tempa!=tempb){
Leaf.showMessage('提示', '发票明细行存在价税合计不等于不含税金额和税额之和!'); Leaf.showMessage('提示', '发票明细行存在价税合计不等于不含税金额和税额之和!');
return; return;
...@@ -109,7 +109,7 @@ ...@@ -109,7 +109,7 @@
var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract'); var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract');
var acp_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'acp_invoice_ln'); var acp_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'acp_invoice_ln');
var record = $(ds_id).getAt(0); var record = $(ds_id).getAt(0);
if(name == 'invoice'&&value) { if(name == 'invoice'&&value&&record.get('contract_id')) {
var contract_id = record.get('contract_id'); var contract_id = record.get('contract_id');
var strs = value.split(','); var strs = value.split(',');
var invoice_type = strs[1]; var invoice_type = strs[1];
......
...@@ -24,20 +24,21 @@ ...@@ -24,20 +24,21 @@
<a:link id="con_doc_batch_create_link_id" url="${/request/@context_path}/modules/cont/CON500/con_doc_batch_create.lsc"/> <a:link id="con_doc_batch_create_link_id" url="${/request/@context_path}/modules/cont/CON500/con_doc_batch_create.lsc"/>
<script><![CDATA[ <script><![CDATA[
function con_print_detail_print(){ function con_print_detail_print(){
lock_current_window(); //lock_current_window();
Leaf.Masker.mask($('${/parameter/@winid}').wrap, '正在生成并打印合同文本,请稍等。。。');
var result_ds = $('con_contract_update_print_detail_line_ds'); var result_ds = $('con_contract_update_print_detail_line_ds');
var records = result_ds.getAll(); // var records = result_ds.getAll();
var total_count = 0; // var total_count = 0;
if ($('con_contract_update_print_detail_line_ds').getAll().length <= 0) { // if ($('con_contract_update_print_detail_line_ds').getAll().length <= 0) {
Leaf.showMessage('提示', '请先生成合同文本!'); // Leaf.showMessage('提示', '请先生成合同文本!');
unlock_current_window(); // unlock_current_window();
return; // return;
} // }
for (var m = 0;m < records.length;m++) { // for (var m = 0;m < records.length;m++) {
if (records[m].get('file_exists_flag') != 'Y') { // if (records[m].get('file_exists_flag') != 'Y') {
total_count = total_count + 1; // total_count = total_count + 1;
} // }
} // }
// alert('${/parameter/@file_path}'); // alert('${/parameter/@file_path}');
var file_path = $('contract_file_path_ds').getAt(0).get('contract_file_path'); var file_path = $('contract_file_path_ds').getAt(0).get('contract_file_path');
Leaf.request({ Leaf.request({
...@@ -70,7 +71,7 @@ ...@@ -70,7 +71,7 @@
} }
function con_print_detail_create() { function con_print_detail_create() {
lock_current_window(); Leaf.Masker.mask($('${/parameter/@winid}').wrap, '${l:HLS.EXECUTING}');
Leaf.request({ Leaf.request({
url: $('con_contract_create_content_link_id').getUrl(), url: $('con_contract_create_content_link_id').getUrl(),
para: { para: {
...@@ -197,7 +198,7 @@ ...@@ -197,7 +198,7 @@
</a:dataSets> </a:dataSets>
<a:screenBody> <a:screenBody>
<a:screenTopToolbar style="width:848px"> <a:screenTopToolbar style="width:848px">
<a:gridButton click="con_print_detail_create" text="CON505.CON_CONTENT_CREATE"/> <!--<a:gridButton click="con_print_detail_create" text="CON505.CON_CONTENT_CREATE"/>-->
<a:gridButton id="con500_print_btn" click="con_print_detail_print" text="生成文本"/> <a:gridButton id="con500_print_btn" click="con_print_detail_print" text="生成文本"/>
<!-- <a:gridButton click="con_download_zip" text="PRJ702.THE_FILE_DOWNLOAD"/> --> <!-- <a:gridButton click="con_download_zip" text="PRJ702.THE_FILE_DOWNLOAD"/> -->
<a:gridButton click="con500_delete_print" text="HLS.REMOVE"/> <a:gridButton click="con500_delete_print" text="HLS.REMOVE"/>
......
...@@ -76,7 +76,7 @@ ...@@ -76,7 +76,7 @@
}); });
} }
win.on('close', function () { win.on('close', function () {
debugger;
if(list_ds=='acp522_acp_invoice_import_detail_ds'){ if(list_ds=='acp522_acp_invoice_import_detail_ds'){
location.reload(); location.reload();
}else{ }else{
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<a:service xmlns:a="http://www.leaf-framework.org/application" xmlns:s="leaf.plugin.script" trace="true"> <a:service xmlns:a="http://www.leaf-framework.org/application" xmlns:s="leaf.plugin.script" trace="true">
<a:init-procedure> <a:init-procedure>
<a:model-query fetchAll="true" model="cont.CON500.con_contract_get_guid_file_name" rootPath="guid_file_name_path"/> <a:model-query fetchAll="true" model="cont.CON500.con_contract_get_guid_file_name" rootPath="guid_file_name_path"/>
<a:model-query fetchAll="true" model="cont.CON500.con_doc_file_templet_get_atm" rootPath="file_templet_get_atm_path"/> <!--<a:model-query fetchAll="true" model="cont.CON500.con_doc_file_templet_get_atm" rootPath="file_templet_get_atm_path"/>-->
<s:server-script><![CDATA[ <s:server-script><![CDATA[
importPackage(Packages.hls.plugin.docx4j); importPackage(Packages.hls.plugin.docx4j);
importPackage(java.io); importPackage(java.io);
...@@ -18,7 +18,17 @@ ...@@ -18,7 +18,17 @@
fis.close(); fis.close();
fos.close(); fos.close();
} }
var from_file_data = $ctx.get('/model/file_templet_get_atm_path').getChildren(); //第一步生成合同文本
$bm('cont.CON505.con_contract_create_content').update({
contract_id: $ctx.parameter.contract_id,
content_type:'NORMAL'
});
//var from_file_data = $ctx.get('/model/file_templet_get_atm_path').getChildren();
var from_file_data_map=$bm('cont.CON500.con_doc_file_templet_get_atm').queryAsMap({
contract_id:$ctx.parameter.contract_id,
batch_flag:$ctx.parameter.batch_flag,
});
var from_file_data = from_file_data_map.getChildren();
for (var i = 0;i < from_file_data.length;i++) { for (var i = 0;i < from_file_data.length;i++) {
var to_file_path = $ctx.parameter.file_path; var to_file_path = $ctx.parameter.file_path;
var record_data = from_file_data[i]; var record_data = from_file_data[i];
...@@ -40,9 +50,9 @@ ...@@ -40,9 +50,9 @@
}); });
try { try {
println(111); // println(111);
var brwt = new BookmarksReplaceWithText($instance('leaf.database.service.IDatabaseServiceFactory'), $instance('uncertain.ocm.IObjectRegistry'), $ctx.getData()); var brwt = new BookmarksReplaceWithText($instance('leaf.database.service.IDatabaseServiceFactory'), $instance('uncertain.ocm.IObjectRegistry'), $ctx.getData());
println($ctx.getData()); // println($ctx.getData());
brwt.replaceBookmarkFromContent(to_file_path.toString(), record_data.content_id); brwt.replaceBookmarkFromContent(to_file_path.toString(), record_data.content_id);
} catch (e) { } catch (e) {
raise_app_error(e); raise_app_error(e);
......
...@@ -140,7 +140,9 @@ ...@@ -140,7 +140,9 @@
} }
} }
if (name == "division_n") { if (name == "division_n") {
return '<div align="right">合计:</div>'; //return '<div align="right">合计:</div>';
//return '合计:<font color="red"></font>';
return '<font color="red">' + '合计:' + '</font>';
} }
if (name == "account_due_amount") { if (name == "account_due_amount") {
return '<font color="red">' + Leaf.formatNumber(sum, 2) + '</font>'; return '<font color="red">' + Leaf.formatNumber(sum, 2) + '</font>';
...@@ -159,13 +161,35 @@ ...@@ -159,13 +161,35 @@
// } // }
function ds_query(ds) { function ds_query(ds) {
var grid_id = $('CON601_con_contract_grid_ds'); // var grid_id = $('CON601_con_contract_grid_ds');
// if("${/model/role_info/record/@role_code}"=="0018"||"${/model/role_info/record/@role_code}"=="0019"){
// grid_id.hideColumn('account_due_times');
// grid_id.hideColumn('account_due_days');
// grid_id.hideColumn('account_due_amount');
//
//
// }
}
Leaf.onReady(function() {
if("${/model/role_info/record/@role_code}"=="0018"||"${/model/role_info/record/@role_code}"=="0019"){ if("${/model/role_info/record/@role_code}"=="0018"||"${/model/role_info/record/@role_code}"=="0019"){
grid_id.hideColumn('account_due_times'); document.getElementById('account_due_times_from_id').style.display = "none";
grid_id.hideColumn('account_due_days'); document.getElementById('account_due_times_from_id_prompt').style.display = "none";
grid_id.hideColumn('account_due_amount'); document.getElementById('account_due_times_to_id').style.display = "none";
document.getElementById('account_due_times_to_id_prompt').style.display = "none";
document.getElementById('account_due_days_from_id').style.display = "none";
document.getElementById('account_due_days_from_id_prompt').style.display = "none";
document.getElementById('account_due_days_to_id').style.display = "none";
document.getElementById('account_due_days_to_id_prompt').style.display = "none";
document.getElementById('account_due_amount_from_id').style.display = "none";
document.getElementById('account_due_amount_from_id_prompt').style.display = "none";
document.getElementById('account_due_amount_to_id').style.display = "none";
document.getElementById('account_due_amount_to_id_prompt').style.display = "none";
var grid_id = $('CON601_con_contract_grid_ds');
grid_id.hideColumn('account_due_times');
grid_id.hideColumn('account_due_days');
grid_id.hideColumn('account_due_amount');
} }
} });
]]></script> ]]></script>
<a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/> <a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
...@@ -235,18 +259,18 @@ ...@@ -235,18 +259,18 @@
<a:textField name="bp_id_agent_desc" bindTarget="CON620_contract_query_ds" prompt="代理店"/> <a:textField name="bp_id_agent_desc" bindTarget="CON620_contract_query_ds" prompt="代理店"/>
<a:comboBox name="business_type_n" bindTarget="CON620_contract_query_ds" prompt="业务类型"/> <a:comboBox name="business_type_n" bindTarget="CON620_contract_query_ds" prompt="业务类型"/>
<a:comboBox name="division_n" bindTarget="CON620_contract_query_ds" prompt="租赁物"/> <a:comboBox name="division_n" bindTarget="CON620_contract_query_ds" prompt="租赁物"/>
<a:numberField name="account_due_times_from" bindTarget="CON620_contract_query_ds" prompt="会计逾期总期数从" allowDecimals="false"/>
<a:numberField name="account_due_times_to" bindTarget="CON620_contract_query_ds" prompt="会计逾期总期数到" allowDecimals="false"/>
<a:numberField name="account_due_days_from" bindTarget="CON620_contract_query_ds" prompt="会计逾期总天数从" allowDecimals="false"/>
<a:numberField name="account_due_days_to" bindTarget="CON620_contract_query_ds" prompt="会计逾期总天数到" allowDecimals="false"/>
<a:numberField name="account_due_amount_from" bindTarget="CON620_contract_query_ds" prompt="会计逾期总金额从"/>
<a:numberField name="account_due_amount_to" bindTarget="CON620_contract_query_ds" prompt="会计逾期总金额到"/>
<a:numberField name="business_due_times_from" bindTarget="CON620_contract_query_ds" prompt="营业逾期总期数从" allowDecimals="false"/> <a:numberField name="business_due_times_from" bindTarget="CON620_contract_query_ds" prompt="营业逾期总期数从" allowDecimals="false"/>
<a:numberField name="business_due_times_to" bindTarget="CON620_contract_query_ds" prompt="营业逾期总期数到" allowDecimals="false"/> <a:numberField name="business_due_times_to" bindTarget="CON620_contract_query_ds" prompt="营业逾期总期数到" allowDecimals="false"/>
<a:numberField name="business_due_days_from" bindTarget="CON620_contract_query_ds" prompt="营业逾期总天数从" allowDecimals="false"/> <a:numberField name="business_due_days_from" bindTarget="CON620_contract_query_ds" prompt="营业逾期总天数从" allowDecimals="false"/>
<a:numberField name="business_due_days_to" bindTarget="CON620_contract_query_ds" prompt="营业逾期总天数到" allowDecimals="false"/> <a:numberField name="business_due_days_to" bindTarget="CON620_contract_query_ds" prompt="营业逾期总天数到" allowDecimals="false"/>
<a:numberField name="business_due_amount_from" bindTarget="CON620_contract_query_ds" prompt="营业逾期总金额从"/> <a:numberField name="business_due_amount_from" bindTarget="CON620_contract_query_ds" prompt="营业逾期总金额从"/>
<a:numberField name="business_due_amount_to" bindTarget="CON620_contract_query_ds" prompt="营业逾期总金额到"/> <a:numberField name="business_due_amount_to" bindTarget="CON620_contract_query_ds" prompt="营业逾期总金额到"/>
<a:numberField id="account_due_times_from_id" name="account_due_times_from" bindTarget="CON620_contract_query_ds" prompt="会计逾期总期数从" allowDecimals="false"/>
<a:numberField id="account_due_times_to_id" name="account_due_times_to" bindTarget="CON620_contract_query_ds" prompt="会计逾期总期数到" allowDecimals="false"/>
<a:numberField id="account_due_days_from_id" name="account_due_days_from" bindTarget="CON620_contract_query_ds" prompt="会计逾期总天数从" allowDecimals="false"/>
<a:numberField id="account_due_days_to_id" name="account_due_days_to" bindTarget="CON620_contract_query_ds" prompt="会计逾期总天数到" allowDecimals="false"/>
<a:numberField id="account_due_amount_from_id" name="account_due_amount_from" bindTarget="CON620_contract_query_ds" prompt="会计逾期总金额从"/>
<a:numberField id="account_due_amount_to_id" name="account_due_amount_to" bindTarget="CON620_contract_query_ds" prompt="会计逾期总金额到"/>
</a:form> </a:form>
<a:grid id="CON601_con_contract_grid_ds" bindTarget="CON620_contract_result_ds" marginHeight="240" <a:grid id="CON601_con_contract_grid_ds" bindTarget="CON620_contract_result_ds" marginHeight="240"
marginWidth="30" navBar="true"> marginWidth="30" navBar="true">
...@@ -259,7 +283,7 @@ ...@@ -259,7 +283,7 @@
align="center"/> align="center"/>
<a:column name="bp_id_agent_desc" align="center" prompt="代理店" width="200"/> <a:column name="bp_id_agent_desc" align="center" prompt="代理店" width="200"/>
<a:column name="business_type_n" align="center" prompt="业务类型" width="60"/> <a:column name="business_type_n" align="center" prompt="业务类型" width="60"/>
<a:column name="division_n" align="center" prompt="租赁物" width="60" renderer="Leaf.formatMoney" footerRenderer="summaryRenderer"/> <a:column name="division_n" align="center" prompt="租赁物" width="60" footerRenderer="summaryRenderer"/>
<a:column name="account_due_times" align="center" prompt="会计逾期总期数" <a:column name="account_due_times" align="center" prompt="会计逾期总期数"
width="100"/> width="100"/>
<a:column name="account_due_days" align="center" prompt="会计逾期总天数" <a:column name="account_due_days" align="center" prompt="会计逾期总天数"
......
<?xml version="1.0" encoding="UTF-8"?>
<a:service xmlns:a="http://www.leaf-framework.org/application" xmlns:p="uncertain.proc" trace="true">
<a:init-procedure>
<batch-apply sourcePath="/parameter/details">
<a:model-update model="hls.HLS361N.hls_bp_master_credit_confirmed" trace="true"/>
</batch-apply>
</a:init-procedure>
<a:service-output output="/parameter"/>
</a:service>
...@@ -15,7 +15,7 @@ $Purpose: 商业伙伴授信维护 ...@@ -15,7 +15,7 @@ $Purpose: 商业伙伴授信维护
<a:link id="hn1150_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code" modelaction="update"/> <a:link id="hn1150_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code" modelaction="update"/>
<a:link id="hls361_hls_bp_master_credit_tenant_detail_link" url="${/request/@context_path}/modules/hls/HLS361N/credit_entrance_detail.lview"/> <a:link id="hls361_hls_bp_master_credit_tenant_detail_link" url="${/request/@context_path}/modules/hls/HLS361N/credit_entrance_detail.lview"/>
<a:link id="hls361_hls_bp_master_credit_agent_detail_link" url="${/request/@context_path}/modules/hls/HLS362N/credit_entrance_detail_confirm.lview"/> <a:link id="hls361_hls_bp_master_credit_agent_detail_link" url="${/request/@context_path}/modules/hls/HLS362N/credit_entrance_detail_confirm.lview"/>
<a:link id="hls362N_update_credit_confirmed_link_id" model="hls.HLS361N.hls_bp_master_credit_confirmed" modelaction="update"/> <a:link id="hls362N_update_credit_confirmed_link_id" url="${/request/@context_path}/modules/hls/HLS362N/hls_bp_master_batch_update.lsc"/>
<a:link id="con_contract_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code" modelaction="update"/> <a:link id="con_contract_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code" modelaction="update"/>
<a:link id="check_create_record_link_id" model="hls.HLS361N.hls_bp_master_create_record" <a:link id="check_create_record_link_id" model="hls.HLS361N.hls_bp_master_create_record"
modelaction="update"/> modelaction="update"/>
...@@ -50,30 +50,39 @@ $Purpose: 商业伙伴授信维护 ...@@ -50,30 +50,39 @@ $Purpose: 商业伙伴授信维护
//授信额度变更 //授信额度变更
var credit_ds=get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'hls_bp_master_credit_hd'); var credit_ds=get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'hls_bp_master_credit_hd');
var datas=$(credit_ds).selected; var datas=$(credit_ds).selected;
if(datas.length!=1){ var param = {};
$L.showInfoMessage("提示",'请选择一条数据',null,null) var saveData = [];
return;
}
//审批冻结判断
var credit_status=datas[0].data.credit_status;
if(credit_status!='APPROVING'){
$L.showInfoMessage("提示",'请选择状态为审批中的数据!',null,null)
return;
}
//角色判断 //角色判断
//002 营业本部长 //002 营业本部长
if(user_code==''||user_code==undefined){ if(user_code==''||user_code==undefined){
$L.showInfoMessage("提示",'只有营业本部长才能操作数据!'); $L.showInfoMessage("提示",'只有营业本部长才能操作数据!');
return; return;
} }
$L.showConfirm("提示",'确认该条记录的相关信息?',function(){ if(datas.length<1){
$L.showInfoMessage("提示",'请选择数据',null,null)
return;
}
for (var i = 0; i < datas.length; i++) {
//审批冻结判断
var credit_status=datas[i].data.credit_status;
if(credit_status!='APPROVING'){
$L.showInfoMessage("提示",'请选择状态为审批中的数据!',null,null)
return;
}
var data_record;
data_record = datas[i];
data_record.set('_status', 'update');
data_record.set('bp_credit_hd_id', datas[i].data.bp_credit_hd_id);
data_record.set('wanted_status', 'APPROVED');
saveData.push(data_record.data);
}
param['details'] = saveData;
$L.showConfirm("提示",'确认进行授信确认?',function(){
window['${/parameter/@layout_code}_lock_layout_dynamic_window'](); window['${/parameter/@layout_code}_lock_layout_dynamic_window']();
Leaf.request({ Leaf.request({
url: $('hls362N_update_credit_confirmed_link_id').getUrl(), url: $('hls362N_update_credit_confirmed_link_id').getUrl(),
para: { para: param,
bp_credit_hd_id : datas[0].data.bp_credit_hd_id,
wanted_status : 'APPROVED',
},
success: function () { success: function () {
Leaf.SideBar.show({ Leaf.SideBar.show({
msg: '操作成功', msg: '操作成功',
...@@ -96,32 +105,40 @@ $Purpose: 商业伙伴授信维护 ...@@ -96,32 +105,40 @@ $Purpose: 商业伙伴授信维护
window['${/parameter/@layout_code}_user_button2_layout_dynamic_click'] = function() { window['${/parameter/@layout_code}_user_button2_layout_dynamic_click'] = function() {
var credit_ds=get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'hls_bp_master_credit_hd'); var credit_ds=get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'hls_bp_master_credit_hd');
var datas=$(credit_ds).selected; var datas=$(credit_ds).selected;
if(datas.length!=1){ var param = {};
$L.showInfoMessage("提示",'请选择一条数据',null,null) var saveData = [];
return;
}
//审批冻结判断
var credit_status=datas[0].data.credit_status;
if(credit_status!='APPROVING'){
$L.showInfoMessage("提示",'请选择状态为审批中的数据!',null,null)
return;
}
//角色判断 //角色判断
// 002 营业本部长 // 002 营业本部长
if(user_code==''||user_code==undefined){ if(user_code==''||user_code==undefined){
$L.showInfoMessage("提示",'只有营业本部长才能操作数据!'); $L.showInfoMessage("提示",'只有营业本部长才能操作数据!');
return; return;
} }
if(datas.length<1){
$L.showInfoMessage("提示",'请选择一条数据',null,null)
return;
}
for (var i = 0; i < datas.length; i++) {
//审批冻结判断
var credit_status=datas[i].data.credit_status;
if(credit_status!='APPROVING'){
$L.showInfoMessage("提示",'请选择状态为审批中的数据!',null,null)
return;
}
var data_record;
data_record = datas[i];
data_record.set('_status', 'update');
data_record.set('bp_credit_hd_id', datas[i].data.bp_credit_hd_id);
data_record.set('wanted_status', 'REJECT');
saveData.push(data_record.data);
}
param['details'] = saveData;
$L.showConfirm("提示",'确认该条记录的相关信息?',function(){ $L.showConfirm("提示",'确认进行授信退回?',function(){
// window['${/parameter/@layout_code}_lock_layout_dynamic_window'](); // window['${/parameter/@layout_code}_lock_layout_dynamic_window']();
Leaf.request({ Leaf.request({
url: $('hls362N_update_credit_confirmed_link_id').getUrl(), url: $('hls362N_update_credit_confirmed_link_id').getUrl(),
para: { para: param,
bp_credit_hd_id : datas[0].data.bp_credit_hd_id,
wanted_status : 'REJECT'
},
success: function () { success: function () {
Leaf.SideBar.show({ Leaf.SideBar.show({
msg: '操作成功', msg: '操作成功',
......
...@@ -49,6 +49,8 @@ ...@@ -49,6 +49,8 @@
<!-- <a:link id="prj_project_create_con_id" model="prj.PRJ513N.prj_peoject_create_con" modelaction="update"/> --> <!-- <a:link id="prj_project_create_con_id" model="prj.PRJ513N.prj_peoject_create_con" modelaction="update"/> -->
<a:link id="${/parameter/@layout_code}_prj_project_create_contract_link_id" <a:link id="${/parameter/@layout_code}_prj_project_create_contract_link_id"
model="prj.PRJ505.prj_project_create_contract" modelaction="update"/> model="prj.PRJ505.prj_project_create_contract" modelaction="update"/>
<a:link id="${/parameter/@layout_code}_prj_project_update_status_link_id"
model="prj.PRJ505.prj_project_create_contract" modelaction="execute"/>
<a:link id="prj_approval_link_id" model="prj.PRJ501N.project_approval" modelaction="update"/> <a:link id="prj_approval_link_id" model="prj.PRJ501N.project_approval" modelaction="update"/>
<a:link id="check_prj_lease_item_link_id" model="prj.PRJ501N.project_approval" modelaction="execute"/> <a:link id="check_prj_lease_item_link_id" model="prj.PRJ501N.project_approval" modelaction="execute"/>
...@@ -498,6 +500,39 @@ function prj501n_contract_number_renderer(id, name, query_only){ ...@@ -498,6 +500,39 @@ function prj501n_contract_number_renderer(id, name, query_only){
record.getField('bank_account_id_n').setRequired(true); record.getField('bank_account_id_n').setRequired(true);
} }
}
if(name=='payment_deduction') {
var quoation_ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'F_QUOTATION_N', 'prj_quotation');
var quoation_record = $(quoation_ds_id).getCurrentRecord();
var down_payment = quoation_record.get('down_payment') || 0;
var calc_session_id= quoation_record.get('calc_session_id');
var other_payment2;
if (old_value && value &&calc_session_id&& value == 'NO_DEDUCTION') {
other_payment2 = 0;
} else if (old_value && value &&calc_session_id&& value != 'NO_DEDUCTION'){
other_payment2=down_payment;
}
window['${/parameter/@layout_code}_lock_layout_dynamic_window']();
Leaf.request({
url: $('${/parameter/@layout_code}_prj_project_update_status_link_id').getUrl(),
para: {
other_payment2: other_payment2,
calc_session_id: calc_session_id
},
success: function (arg) {
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
failure: function () {
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
error: function () {
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
scope: this
});
} }
}; };
......
...@@ -49,6 +49,8 @@ ...@@ -49,6 +49,8 @@
<!-- <a:link id="prj_project_create_con_id" model="prj.PRJ513N.prj_peoject_create_con" modelaction="update"/> --> <!-- <a:link id="prj_project_create_con_id" model="prj.PRJ513N.prj_peoject_create_con" modelaction="update"/> -->
<a:link id="${/parameter/@layout_code}_prj_project_create_contract_link_id" <a:link id="${/parameter/@layout_code}_prj_project_create_contract_link_id"
model="prj.PRJ505.prj_project_create_contract" modelaction="update"/> model="prj.PRJ505.prj_project_create_contract" modelaction="update"/>
<a:link id="${/parameter/@layout_code}_prj_project_update_status_link_id"
model="prj.PRJ505.prj_project_create_contract" modelaction="execute"/>
<a:link id="prj_approval_link_id" model="prj.PRJ501N.project_approval" modelaction="update"/> <a:link id="prj_approval_link_id" model="prj.PRJ501N.project_approval" modelaction="update"/>
<!--<link href="${/request/@context_path}/css/lightbox.css" rel="stylesheet" type="text/css"/> <!--<link href="${/request/@context_path}/css/lightbox.css" rel="stylesheet" type="text/css"/>
...@@ -462,10 +464,6 @@ function prj501n_contract_number_renderer(id, name, query_only){ ...@@ -462,10 +464,6 @@ function prj501n_contract_number_renderer(id, name, query_only){
} }
} }
}; };
//更新时调用
window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_update'] = function(ds, record, name, value, old_value, bp_seq) {
};
//加载时调用(grid,table,gridBox) //加载时调用(grid,table,gridBox)
window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_grid_load'] = function(ds, record, config_records, bp_seq) { window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_grid_load'] = function(ds, record, config_records, bp_seq) {
...@@ -611,6 +609,39 @@ function prj501n_contract_number_renderer(id, name, query_only){ ...@@ -611,6 +609,39 @@ function prj501n_contract_number_renderer(id, name, query_only){
record.getField('bank_account_id_n').setRequired(true); record.getField('bank_account_id_n').setRequired(true);
} }
}
if(name=='payment_deduction') {
var quoation_ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'F_QUOTATION_N', 'prj_quotation');
var quoation_record = $(quoation_ds_id).getCurrentRecord();
var down_payment = quoation_record.get('down_payment') || 0;
var calc_session_id= quoation_record.get('calc_session_id');
var other_payment2;
if (old_value && value &&calc_session_id&& value == 'NO_DEDUCTION') {
other_payment2 = 0;
} else if (old_value && value &&calc_session_id&& value != 'NO_DEDUCTION'){
other_payment2=down_payment;
}
window['${/parameter/@layout_code}_lock_layout_dynamic_window']();
Leaf.request({
url: $('${/parameter/@layout_code}_prj_project_update_status_link_id').getUrl(),
para: {
other_payment2: other_payment2,
calc_session_id: calc_session_id
},
success: function (arg) {
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
failure: function () {
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
error: function () {
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
scope: this
});
} }
}; };
......
...@@ -6,45 +6,29 @@ ...@@ -6,45 +6,29 @@
<a:init-procedure> <a:init-procedure>
<s:server-script><![CDATA[ <s:server-script><![CDATA[
importPackage(java.io); importPackage(java.io);
importPackage(Packages.hl.mail); importPackage(Packages.com.hand.hls.hlcm.util);
try { try {
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');
var mail_list_result = mail_list_bm.queryAsMap().getChildren(); var mail_list_result = mail_list_bm.queryAsMap().getChildren();
println('###############' + mail_list_result.length + '###############');
for (var i = 0; i < mail_list_result.length; i++) { for (var i = 0; i < mail_list_result.length; i++) {
var mb = new HlMailBean(); var jsonString ={
mb.setHost(mail_server_result[0].mail_smtp_host); // 设置SMTP主机(163),若用126,则设为:smtp.126.com serverHost:mail_server_result[0].mail_smtp_host, // 设置SMTP主机(163),若用126,则设为:smtp.126.com
mb.setPort(mail_server_result[0].mail_port_number); //设置端口号 serverPort:mail_server_result[0].mail_port_number, //设置端口号
println(mail_server_result[0].mail_port_number); serverName:mail_server_result[0].mail_username, // 设置发件人邮箱的用户名
mb.setUsername(mail_server_result[0].mail_username); // 设置发件人邮箱的用户名 serverPassWord:mail_server_result[0].mail_password,// 设置发件人邮箱的密码
mb.setPassword(mail_server_result[0].mail_password); // 设置发件人邮箱的密码,需将*号改成正确的密码 serverAddress:mail_server_result[0].mail_address,// 设置发件人的邮箱
mb.setFrom(mail_server_result[0].mail_address); // 设置发件人的邮箱 toAddress:mail_list_result[i].mail_to,// 设置收件人的邮箱
mb.setTo(mail_list_result[i].mail_to); // 设置收件人的邮箱 toCcAddress:mail_list_result[i].mail_cc,//设置抄送人的邮箱
println(mail_list_result[i].mail_to); toSubject:mail_list_result[i].subject,// 设置邮件的主题
if (mail_list_result[i].mail_cc) { toBody:mail_list_result[i].body // 设置邮件的正文
mb.setCc(mail_list_result[i].mail_cc); // 设置抄送人的邮箱 };
} else { var sm = new MailSend();
mb.setCc(mail_list_result[i].mail_to); var stringResult = sm.sendMain(JSON.stringify(jsonString));//调用接口
} var ob = JSON.parse(stringResult);//将接口返回的string字符串解析成对象
mb.setSubject(mail_list_result[i].subject); // 设置邮件的主题 if (ob.status=='S') {
mb.setContent(mail_list_result[i].body); // 设置邮件的正文
//mb.setContent(mail_list_result[i].content_type); // 设置邮件的格式 text/html为html,text/plain为纯文本
//设置附件
//mb.attachFile("D:\\abc.xlsx"); // 往邮件中添加附件
var mail_file_bm = $bm('sys.SYS405.zj_sys_mailing_file');
var mail_file_result = mail_file_bm.queryAsMap({
mailing_list_id: mail_list_result[i].mailing_list_id
}).getChildren();
for (var j = 0; j < mail_file_result.length; j++) {
mb.attachFile(mail_file_result[j].file_path);
}
var sm = new HlSendMail();
if (mail_list_result[i].content_type == "text/html") {
println(mail_list_result[i].mailing_list_id);
if (sm.sendHtmlMail(mb)) {
$bm('sys.SYS405.zj_sys_mailing_list').update({ $bm('sys.SYS405.zj_sys_mailing_list').update({
mailing_list_id: mail_list_result[i].mailing_list_id mailing_list_id: mail_list_result[i].mailing_list_id
}); });
...@@ -53,17 +37,6 @@ ...@@ -53,17 +37,6 @@
mailing_list_id: mail_list_result[i].mailing_list_id mailing_list_id: mail_list_result[i].mailing_list_id
}); });
} }
} else {
if (sm.sendMail(mb)) {
$bm('sys.SYS405.zj_sys_mailing_list').update({
mailing_list_id: mail_list_result[i].mailing_list_id
});
} else {
$bm('sys.SYS405.zj_sys_mailing_list').execute({
mailing_list_id: mail_list_result[i].mailing_list_id
});
}
}
} }
} 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