Commit dc7b674e authored by 25484's avatar 25484

Merge branch 'feature/hls_bp_master_create_entrance' into develop

parents 8ab4fa3d ff1dd171
......@@ -54,7 +54,8 @@
<bm:query-field field="contract_number" queryExpression="contract_number like upper(&apos;%&apos;||${@contract_number}||&apos;%&apos;)"/>
<bm:query-field field="owner_user_id" queryOperator="="/>
<bm:query-field field="bp_id_tenant" queryOperator="="/>
<bm:query-field field="lease_organization" queryOperator="="/>
<!-- <bm:query-field field="lease_organization" queryOperator="="/>-->
<bm:query-field field="contract_status" queryOperator="="/>
<bm:query-field field="bp_id_agent_desc" queryExpression="bp_id_agent_desc like upper(&apos;%&apos;||${@bp_id_agent_desc}||&apos;%&apos;)"/>
</bm:query-fields>
<bm:data-filters>
......
......@@ -4,72 +4,75 @@
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
SELECT t1.*
FROM (SELECT li.line_id,
li.error_message,
li.status,
li.header_id,
li.line_number,
hd.created_by,
li.source_table,
li.attribute_1,
li.attribute_2,
li.attribute_3,
li.attribute_4,
SELECT t1.*
FROM (SELECT li.line_id,
li.error_message,
li.status,
li.header_id,
li.line_number,
hd.created_by,
li.source_table,
li.attribute_1,
(select cc.contract_name
from con_contract cc
where cc.contract_number = li.attribute_1) contract_name,
li.attribute_2,
li.attribute_3,
li.attribute_4,
li.attribute_5,
li.attribute_6,
li.attribute_7,
li.attribute_8,
li.attribute_9,
li.attribute_10,
li.attribute_11,
li.attribute_12,
li.attribute_13,
li.attribute_14,
li.attribute_15,
li.attribute_16,
li.attribute_17,
li.attribute_18,
li.attribute_19,
li.attribute_20,
li.attribute_21,
li.attribute_22,
li.attribute_23,
li.attribute_24,
li.attribute_25,
li.attribute_26
FROM fnd_interface_headers hd,
fnd_interface_lines li
WHERE hd.header_id = li.header_id
AND hd.template_code = 'CSH_TRX_BANK'
AND li.line_number >0
AND HD.CREATED_BY = ${/session/@user_id}
) t1
#WHERE_CLAUSE#
order by t1.line_number
]]></bm:query-sql>
(select cc.lease_start_date
from con_contract cc
where cc.contract_number = li.attribute_1) lease_start_date,
li.attribute_6,
li.attribute_7,
trim(to_char(round(li.attribute_8,1),'999999999999990.99')) attribute_8,
trim(to_char(round(li.attribute_8 /
to_char(last_day(sysdate), 'dd'),
1),
'999999999999990.99')) average_hour,
li.attribute_9,
li.attribute_10,
li.attribute_11,
li.attribute_12
FROM fnd_interface_headers hd, fnd_interface_lines li
WHERE hd.header_id = li.header_id
AND hd.template_code = 'HLS_LEASE_ITEM_GPS_IMPORT'
AND li.line_number > 0
AND li.source_table = 'GPS'
AND HD.CREATED_BY = ${/session/@user_id}
AND hd.header_id=${/parameter/@header_id}) t1
order by t1.line_number
]]>
</bm:query-sql>
</bm:operation>
<bm:operation name="update">
<bm:update-sql><![CDATA[
begin
hls_lease_item_gps_import_pkg.gps_import_check(p_header_id => ${/model/header/record/@header_id},
p_user_id => ${/session/@user_id});
end;
]]></bm:update-sql>
begin
hls_lease_item_gps_import_pkg.gps_import_check(p_header_id => ${@header_id},
p_user_id => ${/session/@user_id});
end;
]]>
</bm:update-sql>
</bm:operation>
<bm:operation name="insert">
<bm:update-sql><![CDATA[
begin
hls_lease_item_gps_import_pkg.gps_import(
p_header_id =>${/parameter/@header_id},
p_user_id =>${/session/@user_id}
);
end;
]]></bm:update-sql>
BEGIN
hls_lease_item_gps_import_pkg.gps_import(
p_contract_number => ${@contract_number},
p_machine_model => ${@machine_model},
p_machine_number => ${@machine_number},
p_interval_date => ${@interval_date},
p_working_hours_latest=> ${@working_hours_latest},
p_working_hours_new_m => ${@working_hours_new_m},
p_working_hours_ave_m => ${@working_hours_ave_m},
p_machine_location => ${@machine_location},
p_note => ${@note},
p_attention => ${@attention},
p_machine_number_full=> ${@machine_number_full},
p_user_id => ${/session/@user_id});
END;
]]>
</bm:update-sql>
</bm:operation>
</bm:operations>
<bm:query-fields>
<bm:query-field name="header_id" queryExpression="t1.header_id=${@header_id}"/>
</bm:query-fields>
</bm:model>
......@@ -3,62 +3,111 @@
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true" trace="true">
<a:init-procedure outputPath="/parameter">
<a:model-query model="basic.hls_fnd_attribute_sequence" rootPath="header"/>
<a:import-excel header_id="${/model/header/record/@header_id}" separator="," status_field="/parameter/@ImportSuccess" template_code="CSH_TRX_BANK" user_id="${/session/@user_id}"/>
<a:model-query defaultWhereClause="header_id=${/model/header/record/@header_id} and TEMPLATE_CODE = &apos;CSH_TRX_BANK&apos;" model="basic.hls_fnd_attribute_status" rootPath="status"/>
<a:model-update model="hls.HLS204N.hls_lease_item_gps_list_tmp"/>
<a:import-excel header_id="${/model/header/record/@header_id}" separator=","
status_field="/parameter/@ImportSuccess" template_code="HLS_LEASE_ITEM_GPS_IMPORT"
user_id="${/session/@user_id}"/>
<a:model-query
defaultWhereClause="header_id=${/model/header/record/@header_id} and TEMPLATE_CODE = &apos;HLS_LEASE_ITEM_GPS_IMPORT&apos;"
model="basic.hls_fnd_attribute_status" rootPath="status"/>
</a:init-procedure>
<a:view>
<a:link id="import_other_contract_cf_link_id" model="hls.HLS204N.hls_lease_item_gps_list_tmp" modelaction="insert"/>
<a:link id="save_import_hls_lease_item_gps_check_link_id" model="hls.HLS204N.hls_lease_item_gps_list_tmp"
modelaction="update"/>
<a:link id="save_import_hls_lease_item_gps_data_link_id" model="hls.HLS204N.hls_lease_item_gps_list_tmp"
modelaction="batch_update"/>
<script type="text/javascript"><![CDATA[
function backBtn() {
parent._input_window.close();
}
function checkBtn() {
debugger;
var ds = $('hls_lease_item_gps_improt_ds');
var records = ds.getAll();
var header_id = records[0].get('header_id');
// alert(header_id);
Leaf.request({
url: $('save_import_hls_lease_item_gps_check_link_id').getUrl(),
para: {
header_id: header_id
},
scope: this,
success: function () {
$('hls_lease_item_gps_improt_ds').query();
Leaf.SideBar.show({
msg: '校验成功',
duration: 2000
});
}
})
}
var import_flag = 0;
var import_flag=0;
function import_btn() {
var ds = $('tre_withdraw_subscriber_improt_ds');
record = ds.getAll();
if(import_flag==0){
for (i = 0;i < record.length;i++) {
if (record[i].get('status') == 'ERROR') {
Leaf.showMessage('${l:PROMPT}', '导入的数据存在错误,请查看错误信息!');
return;
function importBtn() {debugger;
var ds = $('hls_lease_item_gps_improt_ds');
var records = ds.getAll();
var saveData = [];
if (import_flag == 0) {
for (var i = 0; i < records.length; i++) {
var record = records[i];
if (record.get('status') == 'ERROR') {
//不将这条数据传递到数组中
continue;
}
//否则的话添加必要的字段
record.set('contract_number', record.get('attribute_1'));
// record.set('bp_name', record.get('attribute_3'));
record.set('agent_name', record.get('attribute_3'));
record.set('machine_model', record.get('attribute_4'));
record.set('machine_number', record.get('attribute_5'));
record.set('interval_date', record.get('attribute_6'));
record.set('working_hours_latest', record.get('attribute_7'));
record.set('working_hours_new_m', record.get('attribute_8'));
record.set('working_hours_ave_m', record.get('average_hour'));
record.set('machine_location', record.get('attribute_9'));
record.set('note', record.get('attribute_10'));
record.set('attention', record.get('attribute_11'));
record.set('machine_number_full', record.get('attribute_12'));
record.set('_status', 'insert');
saveData.push(record.data);
}
Leaf.showConfirm('提示', '确定要导入信息吗?', function() {
//开始导入数据
Leaf.showConfirm('提示', '确定要导入信息吗,有错误信息的数据将不会被导入', function () {
// Leaf.Masker.mask(Ext.getBody(), '${l:HLS.EXECUTING}');
Leaf.request({
url: $('import_other_contract_cf_link_id').getUrl(),
para: {
batch_id: '${/parameter/@batch_id}',
header_id: '${/model/header/record/@header_id}'
},
url: $('save_import_hls_lease_item_gps_data_link_id').getUrl(),
para: saveData,
scope: this,
success: function () {
import_flag = import_flag + 1;
$('hls_lease_item_gps_improt_ds').query();
// Leaf.Masker.unmask(Ext.getBody());
Leaf.SideBar.show({
msg: '操作成功',
duration: 2000
});
//关闭该导入的界面
backBtn();
}
});
});
}else{
} else {
Leaf.showMessage('${l:PROMPT}', '数据已导入不能重复导入!');
return;
return false;
}
}
]]></script>
<a:dataSets>
<a:dataSet id="tre_withdraw_subscriber_improt_ds" autoQuery="true" fetchAll="true" model="hls.HLS204N.hls_lease_item_gps_list_tmp" queryUrl="${/request/@context_path}/autocrud/hls.HLS204N.hls_lease_item_gps_list_tmp/query?header_id=${/model/header/record/@header_id}">
<a:dataSet id="hls_lease_item_gps_improt_ds" autoQuery="true" fetchAll="true"
model="hls.HLS204N.hls_lease_item_gps_list_tmp"
queryUrl="${/request/@context_path}/autocrud/hls.HLS204N.hls_lease_item_gps_list_tmp/query?header_id=${/model/header/record/@header_id}">
<a:fields>
<a:field name="error_message" readOnly="true"/>
<a:field name="attribute_4" readOnly="true"/>
</a:fields>
</a:dataSet>
</a:dataSets>
......@@ -66,23 +115,28 @@
<a:form id="success_form" height="400" title="THE_IMPORTED_DATA" width="980">
<a:screenTopToolbar>
<a:gridButton click="backBtn" text="取消"/>
<a:gridButton click="import_btn" text="确认导入"/>
<a:gridButton click="checkBtn" text="数据校验"/>
<a:gridButton click="importBtn" text="确认导入"/>
</a:screenTopToolbar>
<a:grid id="grid_ds_id" bindTarget="tre_withdraw_subscriber_improt_ds" height="340" navBar="true" width="980">
<a:grid id="grid_ds_id" bindTarget="hls_lease_item_gps_improt_ds" height="340" navBar="true"
width="980">
<a:columns>
<a:column name="error_message" editor="textArea_e" prompt="错误信息" width="180"/>
<a:column name="attribute_1" prompt="合同编号" width="80"/>
<a:column name="attribute_2" prompt="合同名称" width="80"/>
<a:column name="attribute_3" prompt="客户名称" width="80"/>
<a:column name="attribute_4" prompt="代理店" width="80"/>
<a:column name="attribute_5" prompt="机型" width="80"/>
<a:column name="attribute_6" prompt="机号" width="80"/>
<a:column name="attribute_7" prompt="租赁开始日" width="80"/>
<a:column name="attribute_8" prompt="最新工作小时数" width="80"/>
<a:column name="attribute_9" prompt="机器位置(省市)" width="80"/>
<a:column name="error_message" editor="textArea_e" prompt="错误信息" width="150"/>
<a:column name="attribute_6" prompt="期间" width="130"/>
<a:column name="attribute_1" prompt="合同编号" width="130"/>
<a:column name="contract_name" prompt="合同名称" width="100"/>
<a:column name="attribute_2" prompt="客户名称" width="80"/>
<a:column name="attribute_3" prompt="代理店" width="80"/>
<a:column name="attribute_4" prompt="机型" width="80"/>
<a:column name="attribute_5" prompt="机号" width="80"/>
<a:column name="lease_start_date" prompt="租赁开始日" width="80"/>
<a:column name="attribute_7" prompt="最新工作小时数(总)" width="120"/>
<a:column name="attribute_8" prompt="本月工作小时数" width="120"/>
<a:column name="average_hour" prompt="本月平均工作小时数" width="120"/>
<a:column name="attribute_9" editor="textArea_e" prompt="机器位置(省市)" width="120"/>
<a:column name="attribute_10" prompt="备注" width="80"/>
<a:column name="attribute_11" prompt="要注意" width="80"/>
<a:column name="attribute_12" prompt="完整机号" width="80"/>
<a:column name="attribute_12" editor="textArea_e" prompt="完整机号" width="80"/>
</a:columns>
<a:editors>
<a:textArea id="textArea_e" height="50" width="240"/>
......
<?xml version="1.0" encoding="UTF-8"?>
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true" trace="true">
<a:init-procedure/>
<a:view>
<script type="text/javascript"><![CDATA[
function saveClick() {
if (document.getElementById('importFile').value) {
var fileName = document.getElementById('importFile').value;
var fileType = fileName.substr(fileName.lastIndexOf("."));
......@@ -19,13 +16,14 @@
}
}
}
var _input_window;
function doSubmit() {
function doSubmit() {debugger;
_input_window = new $L.Window({
title: '${l:HLS.IMPORT}',
width: 1050,
height: 500
width: 1100,
height: 400
});
new Ext.Template('<iframe id ="_input_window" name="_input_window" border="0" frameborder="0" height="100%" width="100%" style="border:none;padding:0px;margin:0px;"></iframe>').insertFirst(_input_window.body.dom, {}, true);
var form = document.getElementById('importForm');
......@@ -33,15 +31,17 @@
form.action = url;
form.submit();
$('${/parameter/@winid}').close();
_input_window.on('close', function() {
_input_window.on('close', function () {
// $('${/parameter/@parent_ds_id}').setQueryParameter('batch_id','${/parameter/@batch_id}');
$('${/parameter/@parent_ds_id}').query();
});
}
]]></script>
<a:dataSets>
<a:dataSet id="label_ds" autoCreate="true">
<a:fields>
<!--<a:field name="label1" defaultValue="注意:"/>-->
<a:field name="label2" defaultValue="${l:STRICT_IMPORTED_TEMPLATE_DATA}"/>
<a:field name="label3" defaultValue="${l:PRODUCT_MASTER_DATA_IMPORT}"/>
<a:field name="label4" defaultValue="${l:IMPORTER_ONLY_SUPPORTS}"/>
......@@ -55,15 +55,20 @@
<a:label name="label2" bindTarget="label_ds" style="margin-left:10px;" width="380"/>
<a:label name="label3" bindTarget="label_ds" style="margin-left:10px;" width="380"/>
<a:label name="label4" bindTarget="label_ds" style="margin-left:10px;" width="380"/>
<a:label name="label5" bindTarget="label_ds" style="color:#055A78;font-weight:bold;margin-left:10px;" width="380"/>
<a:label name="label6" bindTarget="label_ds" style="color:#055A78;font-weight:bold;margin-left:10px;" width="380"/>
<a:label name="label5" bindTarget="label_ds" style="color:#055A78;font-weight:bold;margin-left:10px;"
width="380"/>
<a:label name="label6" bindTarget="label_ds" style="color:#055A78;font-weight:bold;margin-left:10px;"
width="380"/>
</a:fieldSet>
<a:fieldSet style="margin-left:10px;margin-top:10px;" title="TMPLT_IMPORT_FILE" width="400">
<form name="upload" id="importForm" action="modules/prj/PRJ501N/prj_lease_item_trans_upload.lview?session_id=${/parameter/@session_id}&amp;project_id=${/parameter/@project_id}&amp;parent_ds_id=${/parameter/@parent_ds_id}&amp;type=${/parameter/@type}&amp;_csrf=${/session/@_csrf.token}" enctype="multipart/form-data" method="post" target="_input_window">
<form name="upload" id="importForm"
action="modules/hls/HLS204N/hls_lease_item_gps_excel_import.lview?session_id=${/parameter/@session_id}&amp;project_id=${/parameter/@project_id}&amp;parent_ds_id=${/parameter/@parent_ds_id}&amp;type=${/parameter/@type}&amp;_csrf=${/session/@_csrf.token}"
enctype="multipart/form-data" method="post" target="_input_window">
<label style="margin-left:10px;margin-top:10px;font-size:13px"><![CDATA[${l:PLEASE_SELECT_A_FILE}]]></label>
<input name="CONTENT" id="importFile" style="font-size:15px" type="file"/>
<!-- <input onclick="downloadFile()" style="margin-left:10px;margin-top:10px;width:60px;height:23px" type="button" value="模板下载"/> -->
<input onclick="saveClick()" style="margin-left:25px;margin-top:10px;width:60px;height:23px" type="button" value="${l:TMPLT_IMPORT}"/>
<input onclick="saveClick()" style="margin-left:25px;margin-top:10px;width:60px;height:23px"
type="button" value="${l:TMPLT_IMPORT}"/>
</form>
</a:fieldSet>
</a:view>
......
......@@ -12,22 +12,23 @@
<a:link id="hls_lease_item_gps_import_link" url="${/request/@context_path}/modules/hls/HLS204N/hls_lease_item_gps_import.lview"/>
<script><![CDATA[
//导入按钮
window['${/parameter/@layout_code}_user_button1_layout_dynamic_click'] = function () {
window['${/parameter/@layout_code}_user_button1_layout_dynamic_click'] = function () {debugger;
var url_l = $('hls_lease_item_gps_import_link').getUrl();
var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract_lease_item');
var win = new Leaf.Window({
id: 'hls_lease_item_gps_import_link_win',
url: url_l,
params: {
'winid': 'hls_lease_item_gps_import_link_win',
'session_id': '${/session/@session_id}',
'parent_ds_id': 'hls_lease_item_gps_modify_entrance_result_ds'
'parent_ds_id': ds_id
},
title: '导入',
width: 430,
width: 420,
height: 390
});
win.on('close', function () {
$('hls_lease_item_gps_modify_entrance_result_ds').query();
$(ds_id).query();
});
}
......
......@@ -207,8 +207,8 @@
<a:lov name="bp_code" bindTarget="bp_agent_query_ds" prompt="代理商编码"/>
<a:textField name="bp_name" bindTarget="bp_agent_query_ds" prompt="代理商名称"/>
<a:textField name="extra_nam" bindTarget="bp_agent_query_ds" prompt="代理商简称"/>
<a:textField name="re_kunnr" bindTarget="bp_agent_query_ds" prompt="SAP客户编码"/>
<a:textField name="re_lifnr" bindTarget="bp_agent_query_ds" prompt="SAP供应商编码"/>
<!-- <a:textField name="re_kunnr" bindTarget="bp_agent_query_ds" prompt="SAP客户编码"/>-->
<!-- <a:textField name="re_lifnr" bindTarget="bp_agent_query_ds" prompt="SAP供应商编码"/>-->
<!-- <a:comboBox name="bp_category_n" bindTarget="bp_agent_query_ds" prompt="商业伙伴类型"/>
<a:comboBox name="agent_type_n" bindTarget="bp_agent_query_ds" prompt="代理商类型"/>
<a:comboBox name="agent_instance_status_n" bindTarget="bp_agent_query_ds" prompt="工作流状态"/>-->
......@@ -233,8 +233,8 @@
<!-- <a:column name="enterprise_certification" align="center" prompt="企业认证"-->
<!-- renderer="enterprise_certification_render" width="80"/>-->
<!-- <a:column name="certification_status" align="center" prompt="认证状态" width="80"/>-->
<a:column name="re_kunnr" align="center" prompt="SAP客户编码" width="100"/>
<a:column name="re_lifnr" align="center" prompt="SAP供应商编码" width="100"/>
<!-- <a:column name="re_kunnr" align="center" prompt="SAP客户编码" width="100"/>-->
<!-- <a:column name="re_lifnr" align="center" prompt="SAP供应商编码" width="100"/>-->
<!--<a:column name="bp_class_n" align="center" prompt="商业伙伴类型" width="120"/>
<a:column name="bp_category_n" align="center" prompt="商业伙伴类别" width="150"/>
<a:column name="agent_type_n" align="center" prompt="代理商类型" width="150"/>
......
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