Commit 1a9f1f96 authored by stone's avatar stone

[feat] 完成excel收款导入功能

parent e235da85
...@@ -79,6 +79,10 @@ sys_prompt_pkg.sys_prompts_load(p_prompt_code => 'HLS.DOCUMENT_CONFIRMED_BY', ...@@ -79,6 +79,10 @@ sys_prompt_pkg.sys_prompts_load(p_prompt_code => 'HLS.DOCUMENT_CONFIRMED_BY',
p_language => 'ZHS', p_language => 'ZHS',
p_description => '确认人', p_description => '确认人',
p_created_by => 1); p_created_by => 1);
sys_message_pkg.delete_message('E_NO_THIS_ACCOUNT');
sys_message_pkg.insert_message('E_NO_THIS_ACCOUNT',
'错误',
'我方没有此银行账号!','ZHS');
end; end;
/ /
commit; commit;
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
<!-- <bm:query-field name="contract_bp_flag" queryExpression="(exists (select 1 from con_contract_bp b where b.contract_id in (${:@contract_id}) and b.bp_id = t1.bp_id and b.bp_category in (&apos;VENDER&apos;,&apos;TENANT&apos;,&apos;TENANT_SEC&apos;) )or nvl(${@contract_bp_flag},&apos;N&apos;) != &apos;Y&apos; )"/> --> <!-- <bm:query-field name="contract_bp_flag" queryExpression="(exists (select 1 from con_contract_bp b where b.contract_id in (${:@contract_id}) and b.bp_id = t1.bp_id and b.bp_category in (&apos;VENDER&apos;,&apos;TENANT&apos;,&apos;TENANT_SEC&apos;) )or nvl(${@contract_bp_flag},&apos;N&apos;) != &apos;Y&apos; )"/> -->
</bm:query-fields> </bm:query-fields>
<bm:data-filters> <bm:data-filters>
<!-- <bm:data-filter name="query" expression="(t1.company_id=${/session/@company_id})"/> --> <bm:data-filter name="query" expression="(t1.company_id=${/session/@company_id})"/>
<bm:data-filter name="query" expression="(t1.enabled_flag=&apos;Y&apos;)"/> <bm:data-filter name="query" expression="(t1.enabled_flag=&apos;Y&apos;)"/>
</bm:data-filters> </bm:data-filters>
</bm:model> </bm:model>
...@@ -75,7 +75,29 @@ ...@@ -75,7 +75,29 @@
end; end;
]]></bm:update-sql> ]]></bm:update-sql>
</bm:operation> </bm:operation>
<bm:operation name="execute">
<bm:update-sql><![CDATA[
begin
csh_transaction_pkg.get_bank_account_id(p_bank_account_num =>${@bank_account_num},
p_bp_bank_account_num =>${@bp_bank_account_num},
p_bank_account_id =>${@bank_account_id},
p_bp_category =>${@bp_category},
p_bp_id =>${@bp_id},
p_csh_bp_name =>${@csh_bp_name},
p_user_id =>${session/@user_id}
);
end;
]]></bm:update-sql>
<bm:parameters>
<bm:parameter name="bank_account_id" dataType="java.lang.Long" output="true" outputPath="@bank_account_id"/>
<bm:parameter name="bp_category" dataType="java.lang.String" output="true" outputPath="@bp_category"/>
<bm:parameter name="bp_id" dataType="java.lang.Long" output="true" outputPath="@bp_id"/>
<bm:parameter name="csh_bp_name" dataType="java.lang.String" output="true" outputPath="@csh_bp_name"/>
</bm:parameters>
</bm:operation>
</bm:operations> </bm:operations>
<bm:query-fields> <bm:query-fields>
<bm:query-field name="header_id" queryExpression="t1.header_id=${@header_id}"/> <bm:query-field name="header_id" queryExpression="t1.header_id=${@header_id}"/>
</bm:query-fields> </bm:query-fields>
......
...@@ -13,41 +13,102 @@ ...@@ -13,41 +13,102 @@
<a:model-update model="csh.CSH510N.csh_transaction_list_tmp"/> <a:model-update model="csh.CSH510N.csh_transaction_list_tmp"/>
</a:init-procedure> </a:init-procedure>
<a:view> <a:view>
<a:link id="import_csh_transaction_receipt_data_link_id" model="csh.CSH510N.csh_transaction_list_tmp" modelaction="insert"/> <a:link id="import_csh_transaction_receipt_data_link_id" model="csh.CSH510N.csh_transaction_list_tmp" modelaction="execute"/>
<a:link id="get_period_name_id" model="csh.CSH511.csh_transaction_get_period_name" modelaction="query"/>
<script type="text/javascript"><![CDATA[ <script type="text/javascript"><![CDATA[
function backBtn() { function backBtn() {
parent._input_window.close(); parent._input_window.close();
} }
var import_flag=0; var import_flag=0;
function import_btn() { function import_btn() {
var ds = $('tre_withdraw_subscriber_import_ds'); var ds = $('tre_withdraw_subscriber_import_ds');
var record = ds.getAll(); var records = ds.getAll();
var saveData=[];
if(import_flag==0){ if(import_flag==0){
for (var i = 0;i < record.length;i++) { for (var i = 0;i < records.length;i++) {
if (record[i].get('status') == 'ERROR') { var record=records[i];
if (record.get('status') == 'ERROR') {
Leaf.showMessage('${l:PROMPT}', '导入的数据存在错误,请查看错误信息!'); Leaf.showMessage('${l:PROMPT}', '导入的数据存在错误,请查看错误信息!');
return; return;
} }
//获得周期时间
var r_date = record.get('attribute_3');
r_date = Leaf.formatDate(r_date);
Leaf.request({
url: $('get_period_name_id').getUrl(),
para: {
p_date: r_date
},
success: function(res){
var period_name = res.result.record.period_name,
internal_period_num = res.result.record.internal_period_num;
if (period_name) {
record.set('period_name', period_name);
record.set('internal_period_num', internal_period_num);
} else {
record.set('period_name', '');
record.set('internal_period_num', '');
if (record.get('transaction_date')) {
record.set('transaction_date', '');
Leaf.showMessage('${l:PROMPT}', '${l:CSH511.PERIOD_ERROR}');
}
} }
Leaf.showConfirm('提示', '确定要导入信息吗?', function() { },
scope: this
});
//否则的话添加必要的字段
record.set('receipt_type','import');
record.set('transaction_date',record.get('attribute_3'));
record.set('bank_slip_num',record.get('attribute_5'));
record.set('currency_code', 'CNY');
record.set('transaction_amount',record.get('attribute_14'));
record.set('exchange_rate',1);
record.set('bp_bank_account_num',record.get('attribute_8'));
record.set('bp_bank_account_name',record.get('attribute_9'));
record.set('opposite_band_na',record.get('attribute_10'));
record.set('description',record.get('attribute_23'));
record.set('ref_v05',record.get('attribute_24'));
record.set('paid_byother_flag','F');
record.set('write_off_flag','DISABLED');
record.set('_status','insert');
//根据银行卡号设置我方的银行账号
Leaf.request({ Leaf.request({
url: $('import_csh_transaction_receipt_data_link_id').getUrl(), url: $('import_csh_transaction_receipt_data_link_id').getUrl(),
para: { para: {
batch_id: '${/parameter/@batch_id}', bank_account_num:record.get('attribute_1'),
header_id: '${/model/header/record/@header_id}' bp_bank_account_num:record.get('attribute_8')
},
success: function(res){
record.set('bank_account_id',res.result.bank_account_id);
//根据对方的银行卡号获取商业伙伴信息
record.set('bp_category',res.result.bp_category);
record.set('bp_id',res.result.bp_id);
record.set('csh_bp_name',res.result.csh_bp_name);
}, },
scope: this
});
saveData.push(record.data);
}
//开始导入数据
Leaf.showConfirm('提示', '确定要导入信息吗?', function() {
Leaf.request({
url: '${/request/@context_path}/autocrud/csh.CSH511.csh_transaction_receipt_save/batch_update',
para: saveData,
scope: this, scope: this,
success: function () { success: function () {
import_flag = import_flag + 1; import_flag = import_flag + 1;
$('tre_withdraw_subscriber_import_ds').query();
Leaf.SideBar.show({ Leaf.SideBar.show({
msg: '操作成功', msg: '操作成功',
duration: 2000 duration: 2000
}); });
backBtn(); // backBtn();
} }
}); });
}); });
...@@ -83,8 +144,10 @@ ...@@ -83,8 +144,10 @@
<a:column name="attribute_5" prompt="日志号" width="80"/> <a:column name="attribute_5" prompt="日志号" width="80"/>
<a:column name="attribute_8" prompt="对方账号" width="80"/> <a:column name="attribute_8" prompt="对方账号" width="80"/>
<a:column name="attribute_9" prompt="对方账号户名" width="80"/> <a:column name="attribute_9" prompt="对方账号户名" width="80"/>
<a:column name="attribute_24" prompt="摘要" width="80"/> <a:column name="attribute_10" prompt="对方银行名称" width="80"/>
<a:column name="attribute_25" prompt="附言" width="80"/> <a:column name="attribute_14" prompt="收款金额" width="80"/>
<a:column name="attribute_23" prompt="摘要" width="80"/>
<a:column name="attribute_24" prompt="附言" width="80"/>
</a:columns> </a:columns>
<a:editors> <a:editors>
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!-- <!--
$Author: gaoyang $Author: sf
$Date: 2013-5-9 下午03:19:57 $Date: 2019-9-16 下午03:19:57
$Revision: 1.0 $Revision: 1.0
$Purpose: $Purpose:
--> -->
...@@ -65,8 +65,6 @@ ...@@ -65,8 +65,6 @@
} }
record.set('_status', 'insert'); record.set('_status', 'insert');
saveData.push(record.data); saveData.push(record.data);
console.log(saveData);
return;
Leaf.request({ Leaf.request({
url: '${/request/@context_path}/autocrud/csh.CSH511.csh_transaction_receipt_save/batch_update', url: '${/request/@context_path}/autocrud/csh.CSH511.csh_transaction_receipt_save/batch_update',
para: saveData, para: saveData,
......
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