Commit 1ae73ad0 authored by gzj34291's avatar gzj34291

Merge remote-tracking branch 'origin/remote_dev' into remote_dev

parents 1cf870d6 e0699269
......@@ -50,8 +50,8 @@
where t.journal_header_imp_id = t1.journal_header_id
) post_gl_status
FROM hls_journal_header_imp t1
where 1=1
AND EXISTS (SELECT 1
where
EXISTS (SELECT 1
FROM exp_emp_assign_e_v t
WHERE t.user_id = ${/session/@user_id}
AND t.position_code IN ('014'))
......@@ -97,8 +97,8 @@
where t.journal_header_imp_id = t1.journal_header_id
) post_gl_status
FROM hls_journal_header_imp t1
where 1=1
AND EXISTS (SELECT 1
where
EXISTS (SELECT 1
FROM exp_emp_assign_e_v t
WHERE t.user_id = ${/session/@user_id}
AND t.position_code IN ('012'))
......@@ -144,8 +144,8 @@
where t.journal_header_imp_id = t1.journal_header_id
) post_gl_status
FROM hls_journal_header_imp t1
where 1=1
AND EXISTS (SELECT 1
where
EXISTS (SELECT 1
FROM exp_emp_assign_e_v t
WHERE t.user_id = ${/session/@user_id}
AND t.position_code IN ('026'))
......@@ -191,8 +191,8 @@
where t.journal_header_imp_id = t1.journal_header_id
) post_gl_status
FROM hls_journal_header_imp t1
where 1=1
AND EXISTS (SELECT 1
where
EXISTS (SELECT 1
FROM exp_emp_assign_e_v t
WHERE t.user_id = ${/session/@user_id}
AND t.position_code IN ('017') or ${/session/@user_id} = 10418
......
......@@ -6,7 +6,7 @@
BEGIN
hls_journal_import_pkg.insert_hls_journal_tmp(p_user_id => ${/session/@user_id},
p_header_id => ${/model/header/record/@header_id},
p_header_id => ${@header_id},
p_company_id => ${/session/@company_id},
p_template_type=>${@template_type}
);
......
......@@ -132,8 +132,8 @@
</a:screenTopToolbar>
<a:grid id="je_template_ds_id" bindTarget="je_template_ds" height="300" width="380" navBar="true">
<a:columns>
<a:column name="je_template_code" editor="voucherconBasicClauseParaDs_grid_lov" prompt="凭证模板代码" width="170"/>
<a:column name="je_template_name" editor="voucher_text_ed" prompt="凭证模板描述" width="170"/>
<a:column name="je_template_code" editor="voucherconBasicClauseParaDs_grid_lov" prompt="凭证事务代码" width="170"/>
<a:column name="je_template_name" editor="voucher_text_ed" prompt="凭证事务描述" width="170"/>
</a:columns>
<a:editors>
<a:textField id="voucher_text_ed"/>
......
......@@ -22,8 +22,13 @@
para.sql_content = sql_content;
}
//println(sql_content);
var dataSet_id='att_json_ds';
var obj = JSON.parse(sql_content).attachmentList;
var obj;
var dataSet_id='att_json_ds';
if(sql_content.length>2){
obj = JSON.parse(sql_content).attachmentList;
}else{
obj='';
}
var config = $config();
var dataSets = CompositeUtil.findChild(config, 'dataSets');
var dataSet = CompositeUtil.findChild(dataSets, 'dataSet', 'id', dataSet_id);
......@@ -42,19 +47,24 @@
// dataSets.addChild(dataSet.getData());
// var datas = newMap("datas");
// dataSet.addChild(datas.getData());
for (var k in obj) {
// if (obj[k] instanceof Object) {
var datasRecord = newMap("record");
datasRecord.code_value = obj[k].fileURL;
datasRecord.code_value_name = obj[k].fileName;
datasRecord.action_type = obj[k].attachTypeCode;
datas.addChild(datasRecord.getData());
if(obj.length>0){
for (var k in obj) {
// if (obj[k] instanceof Object) {
var datasRecord = newMap("record");
datasRecord.code_value = obj[k].fileURL;
datasRecord.code_value_name = obj[k].fileName;
datasRecord.action_type = obj[k].attachTypeCode;
datas.addChild(datasRecord.getData());
//println(datasRecord.code_value+":"+datasRecord.code_value_name);
//} else {
// println("2222"+obj[k].fieldCode);
//}
}
//println(datasRecord.code_value+":"+datasRecord.code_value_name);
//} else {
// println("2222"+obj[k].fieldCode);
//}
}
}else{
var datasRecord = newMap("record");
datas.addChild(datasRecord.getData());
}
......
......@@ -23,7 +23,11 @@
}
//println(sql_content);
var dataSet_id='post_stur_json_ds';
var obj = JSON.parse(sql_content).fieldValueList;
if(sql_content.length>2){
obj = JSON.parse(sql_content).fieldValueList;
}else{
obj='';
}
var config = $config();
var dataSets = CompositeUtil.findChild(config, 'dataSets');
var dataSet = CompositeUtil.findChild(dataSets, 'dataSet', 'id', dataSet_id);
......@@ -42,6 +46,7 @@
// dataSets.addChild(dataSet.getData());
// var datas = newMap("datas");
// dataSet.addChild(datas.getData());
if(obj.length>0){
for (var k in obj) {
// if (obj[k] instanceof Object) {
var datasRecord = newMap("record");
......@@ -54,6 +59,12 @@
//}
}
}else{
var datasRecord = newMap("record");
datas.addChild(datasRecord.getData());
}
]]></s:server-script>
......
......@@ -52,12 +52,22 @@
var fieldValueList_data = fieldValueList_bm.queryAsMap({
pool_id: batch_data[i].pool_id
});
var je_data_json_data = je_data_json_bm.queryAsMap({
e_archives_id: batch_data[i].e_archives_id,
document_id: batch_data[i].document_id,
workflow_id: batch_data[i].workflow_id
});
var je_data_json_data;
var je_json_data_result;
var je_json_data;
var je_json_data1;
var je_json_data2;
if(batch_data[i].je_check_flag=='Y'){
je_data_json_data = je_data_json_bm.queryAsMap({
e_archives_id: batch_data[i].e_archives_id,
document_id: batch_data[i].document_id,
workflow_id: batch_data[i].workflow_id
});
je_json_data=je_data_json_data.getChildren()[0].je_data_json;
je_json_data_result=JSON.parse(je_json_data);
je_json_data1=je_json_data_result[0];
je_json_data2=je_json_data_result[1];
}
var companyCode='HL';
var documentTypeCode=batch_data[i].base_archive_code;
......@@ -69,17 +79,20 @@
var securityLevelCode='';
var fieldValueList=fieldValueList_data.getChildren()[0].fieldValueList;
var je_json_data=je_data_json_data.getChildren()[0].je_data_json;
logger.info(je_json_data);
//var je_json_data='[{"fieldCode":"PREPROCESS_CODE","value":"111"},{"fieldCode":"GL_CODE_ARRAY","value":"222"}]';
var je_json_data_result=JSON.parse(je_json_data);
logger.info(je_json_data_result[0].fieldCode);
var je_json_data1=je_json_data_result[0];
var je_json_data2=je_json_data_result[1];
var attlist=[];
var filelist=[];
if(fieldValueList.length==8){
filelist='[]';
if(typeof(fieldValueList)=="undefined"){
fieldValueList=[];
if(batch_data[i].je_check_flag=='Y'){
fieldValueList.push(je_json_data1);
fieldValueList.push(je_json_data2);
fieldValueList=JSON.stringify(fieldValueList);
filelist.push(fieldValueList);
}else{
filelist='[]' ;
}
}else{
fieldValueList=fieldValueList.substring(17);
fieldValueList=JSON.parse(fieldValueList);
......@@ -93,8 +106,10 @@
var attachmentList = fieldValueList_data.getChildren()[0].attachmentList;
attachmentList=attachmentList.replace('\s+', '');
if(attachmentList.length==8){
if(typeof(attachmentList)!="undefined"){
attachmentList=attachmentList.replace('\s+', '');
}
if(typeof(attachmentList)=="undefined"){
var fils = '{'
+'"companyCode": "'+companyCode
+'",'
......@@ -149,13 +164,7 @@
}
if(doc_data.length==100||batch_data.length==i+1){
if(doc_data.length==100||doc_data.length==batch_data.length){
batch_num++;
if (is_valid == 'true') {
var SystokenQuery = token_savelogs_bm.queryAsMap();
......@@ -167,15 +176,50 @@
var json_data = JSON.parse(data);
var statusCode =json_data.statusCode;
var message =json_data.message;
var result=json_data.result;
var doc_import_return_bm = $bm('efile.EFILE1040.doc_import_return');
for(var i=0;i<result.length;i++){
doc_import_return_bm.insert({
'primary_field': result[i].primaryField,
'post_status': message,
'post_message': result[i].failedMessage,
'hly_req_number': batch_num
})
doc_data=JSON.parse(doc_data);
if(statusCode=='0000'){
for(var i=0;i<doc_data.length;i++){
doc_import_return_bm.insert({
'primary_field': doc_data[i].primaryField,
'post_status': message,
'post_message': '',
'hly_req_number': '1'
})
}
}else if(statusCode=='500000') {
var result = json_data.result;
for (var i = 0; i < result.length; i++) {
if (result[i].primaryField) {
doc_import_return_bm.insert({
'primary_field': result[i].primaryField,
'post_status': message,
'post_message': result[i].failedMessage,
'hly_req_number': '1'
})
}
}
}else if(statusCode=='500002'){
for(var i=0;i<doc_data.length;i++){
doc_import_return_bm.insert({
'primary_field': doc_data[i].primaryField,
'post_status': 'success',
'post_message': '',
'hly_req_number': '1'
})
}
var result = json_data.result;
for (var i = 0; i < result.length; i++) {
if (result[i].primaryField) {
doc_import_return_bm.insert({
'primary_field': result[i].primaryField,
'post_status': message,
'post_message': result[i].failedMessage,
'hly_req_number': '1'
})
}
}
}
logger.info(data);
......@@ -185,28 +229,58 @@
var json = JSON.parse(data);
var access_token = json.access_token;
var status = json.status;
logger.info(access_token);
var doc_data=JSON.stringify(doc_data);
doc_data=doc_data.replace(/[\'\\\\/\b\f\n\r\t]/g, '');
logger.info(doc_data);
var data_result = httpPostDocImport(docUrl,doc_data,access_token, token_type);
logger.info(data_result);
var json_data = JSON.parse(data_result);
logger.info(json_data);
var statusCode =json_data.statusCode;
var message =json_data.message;
var result=json_data.result;
var doc_import_return_bm = $bm('efile.EFILE1040.doc_import_return');
for(var i=0;i<result.length;i++){
if(result[i].primaryField){
doc_import_return_bm.insert({
'primary_field': result[i].primaryField,
'post_status': message,
'post_message': result[i].failedMessage,
'hly_req_number': batch_num
})
}
}
doc_data=JSON.parse(doc_data);
if(statusCode=='0000'){
for(var i=0;i<doc_data.length;i++){
doc_import_return_bm.insert({
'primary_field': doc_data[i].primaryField,
'post_status': message,
'post_message': '',
'hly_req_number': '1'
})
}
}else if(statusCode=='500000'){
var result=json_data.result;
for(var i=0;i<result.length;i++){
if(result[i].primaryField){
doc_import_return_bm.insert({
'primary_field': result[i].primaryField,
'post_status': message,
'post_message': result[i].failedMessage,
'hly_req_number': '1'
})
}
}
}else if(statusCode=='500002'){
for(var i=0;i<doc_data.length;i++){
doc_import_return_bm.insert({
'primary_field': doc_data[i].primary_field,
'post_status': 'success',
'post_message': '',
'hly_req_number': '1'
})
}
var result = json_data.result;
for (var i = 0; i < result.length; i++) {
if (result[i].primaryField) {
doc_import_return_bm.insert({
'primary_field': result[i].primaryField,
'post_status': message,
'post_message': result[i].failedMessage,
'hly_req_number': '1'
})
}
}
}
if (access_token) {
......@@ -245,11 +319,25 @@
});
var je_data_json_data = je_data_json_bm.queryAsMap({
e_archives_id: req_date[i].e_archives_id,
document_id: req_date[i].document_id,
workflow_id: req_date[i].workflow_id
});
var je_data_json_data;
var je_json_data_result;
var je_json_data;
var je_json_data1;
var je_json_data2;
if(req_date[i].je_check_flag=='Y'){
je_data_json_data = je_data_json_bm.queryAsMap({
e_archives_id: req_date[i].e_archives_id,
document_id: req_date[i].document_id,
workflow_id: req_date[i].workflow_id
});
je_json_data=je_data_json_data.getChildren()[0].je_data_json;
logger.info(je_json_data);
je_json_data_result=JSON.parse(je_json_data);
logger.info(je_json_data_result[0]);
je_json_data1=je_json_data_result[0];
logger.info(je_json_data_result[1]);
je_json_data2=je_json_data_result[1];
}
var companyCode='HL';
var documentTypeCode=req_date[i].base_archive_code;
......@@ -261,16 +349,19 @@
var securityLevelCode='';
var fieldValueList=fieldValueList_data.getChildren()[0].fieldValueList;
var je_json_data=je_data_json_data.getChildren()[0].je_data_json;
//var je_json_data='[{"fieldCode":"PREPROCESS_CODE","value":"111"},{"fieldCode":"GL_CODE_ARRAY","value":"222"}]';
var je_json_data_result=JSON.parse(je_json_data);
var je_json_data1=je_json_data_result[0];
var je_json_data2=je_json_data_result[1];
var attlist=[];
var filelist=[];
if(fieldValueList.length==8){
filelist='[]';
if(typeof(fieldValueList)=="undefined"){
fieldValueList=[];
if(req_date[i].je_check_flag=='Y'){
fieldValueList.push(je_json_data1);
fieldValueList.push(je_json_data2);
fieldValueList=JSON.stringify(fieldValueList);
filelist.push(fieldValueList);
}else{
filelist='[]' ;
}
}else{
fieldValueList=fieldValueList.substring(17);
fieldValueList=JSON.parse(fieldValueList);
......@@ -286,8 +377,11 @@
var attachmentList = fieldValueList_data.getChildren()[0].attachmentList;
attachmentList=attachmentList.replace('\s+', '');
if(attachmentList.length==8){
if(typeof(attachmentList)!="undefined"){
attachmentList=attachmentList.replace('\s+', '');
}
if(typeof(attachmentList)=="undefined"){
var fils = '{'
+'"companyCode": "'+companyCode
+'",'
......@@ -311,7 +405,6 @@
doc_data.push(fils);
}else{
attachmentList=attachmentList.substring(17);
logger.info(attachmentList);
attachmentList=JSON.parse(attachmentList);
attachmentList=JSON.stringify(attachmentList);
attlist.push(attachmentList);
......@@ -355,15 +448,49 @@
var json_data = JSON.parse(data);
var statusCode =json_data.statusCode;
var message =json_data.message;
var result=json_data.result;
var doc_import_return_bm = $bm('efile.EFILE1040.doc_import_return');
for(var i=0;i<result.length;i++){
doc_import_return_bm.insert({
'primary_field': result[i].primaryField,
'post_status': message,
'post_message': result[i].failedMessage,
'hly_req_number': "1"
})
if(statusCode=='0000'){
for(var i=0;i<req_date.length;i++){
doc_import_return_bm.insert({
'primary_field': req_date[i].primary_field,
'post_status': message,
'post_message': '',
'hly_req_number': '1'
})
}
}else if(statusCode=='500000'){
var result=json_data.result;
for(var i=0;i<result.length;i++){
if(result[i].primaryField){
doc_import_return_bm.insert({
'primary_field': result[i].primaryField,
'post_status': message,
'post_message': result[i].failedMessage,
'hly_req_number': '1'
})
}
}
}else if(statusCode=='500002'){
for(var i=0;i<req_date.length;i++){
doc_import_return_bm.insert({
'primary_field': req_date[i].primary_field,
'post_status': 'success',
'post_message': '',
'hly_req_number': '1'
})
}
var result = json_data.result;
for (var i = 0; i < result.length; i++) {
if (result[i].primaryField) {
doc_import_return_bm.insert({
'primary_field': result[i].primaryField,
'post_status': message,
'post_message': result[i].failedMessage,
'hly_req_number': '1'
})
}
}
}
logger.info(data);
......@@ -373,30 +500,63 @@
var json = JSON.parse(data);
var access_token = json.access_token;
var status = json.status;
logger.info(access_token);
var doc_data=JSON.stringify(doc_data);
doc_data=doc_data.replace(/[\'\\\\/\b\f\n\r\t]/g, '');
logger.info(doc_data);
var data_result = httpPostDocImport(docUrl,doc_data,access_token, token_type);
logger.info(data_result);
var json_data = JSON.parse(data_result);
logger.info(json_data);
var statusCode =json_data.statusCode;
var message =json_data.message;
var result=json_data.result;
logger.info(statusCode);
var doc_import_return_bm = $bm('efile.EFILE1040.doc_import_return');
for(var i=0;i<result.length;i++){
if(result[i].primaryField){
doc_import_return_bm.insert({
'primary_field': result[i].primaryField,
'post_status': message,
'post_message': result[i].failedMessage,
'hly_req_number': '1'
})
}
if(statusCode=='0000'){
for(var i=0;i<req_date.length;i++){
doc_import_return_bm.insert({
'primary_field': req_date[i].primary_field,
'post_status': message,
'post_message': '',
'hly_req_number': '1'
})
}
}else if(statusCode=='500000'){
var result=json_data.result;
for(var i=0;i<result.length;i++){
if(result[i].primaryField){
doc_import_return_bm.insert({
'primary_field': result[i].primaryField,
'post_status': message,
'post_message': result[i].failedMessage,
'hly_req_number': '1'
})
}
}
}else if(statusCode=='500002'){
for(var i=0;i<req_date.length;i++){
doc_import_return_bm.insert({
'primary_field': req_date[i].primary_field,
'post_status': 'success',
'post_message': '',
'hly_req_number': '1'
})
}
var result = json_data.result;
for (var i = 0; i < result.length; i++) {
if (result[i].primaryField) {
doc_import_return_bm.insert({
'primary_field': result[i].primaryField,
'post_status': message,
'post_message': result[i].failedMessage,
'hly_req_number': '1'
})
}
}
}
if (access_token) {
token_savelogs_bm.insert({
'json': data,
......
......@@ -177,7 +177,6 @@
//生成反冲数据,生成后数据可编辑
function hls536_journal_reverse(){
debugger;
var records = $('hls_journal_header_result_ds').getSelected();
if(records.length == 0){
Leaf.showMessage('${l:PROMPT}', '请至少选择一条记录!');
......
<?xml version="1.0" encoding="UTF-8"?>
<!--<a:service xmlns:a="http://www.leaf-framework.org/application" trace="true">-->
<a:service xmlns:a="http://www.leaf-framework.org/application" xmlns:p="uncertain.proc" trace="true">
<a:init-procedure>
<a:model-execute model="hls.HLS536.insert_hls_journal_tmp" trace="true"/>
</a:init-procedure>
<a:service-output output="/parameter"/>
</a:service>
<?xml version="1.0" encoding="UTF-8"?>
<!--<a:screen xmlns:a="http://www.leaf-framework.org/application" trace="true">-->
<a:screen xmlns:p="uncertain.proc" xmlns:a="http://www.leaf-framework.org/application" xmlns:s="leaf.plugin.script" trace="true">
<a:init-procedure >
<!--<a:model-execute model="hls.HLS536.delete_hls_journal_tmp"/>-->
<a:model-query model="hls.HLS536.hls_journal_import_head_id" rootPath="header"/>
<a:import-excel header_id="${/model/header/record/@header_id}" attribute5="D:\u01\hls_journal,fnd_interface_headers,${/model/header/record/@header_id}" separator="," status_field="/parameter/@ImportSuccess" template_code="HLS_JOURNAL_IMPORT" user_id="${/session/@user_id}" />
<!--<a:import-excel header_id="${/session/@session_id}" attribute5="D:\u01,fnd_interface_headers,${/session/@session_id}" separator="," status_field="/parameter/@ImportSuccess" template_code="HLS_JOURNAL_IMPORT" user_id="${/session/@user_id}" />-->
<a:model-execute model="hls.HLS536.insert_hls_journal_tmp"/>
<!--<a:model-execute model="hls.HLS536.insert_hls_journal_tmp"/>-->
</a:init-procedure>
<a:view>
<a:link id="hls_journal_entrance_import_link" url="${/request/@context_path}/modules/hls/HLS536/hls_journal_import_entrance.lview"/>
<a:link id="import_save_data_link" url="${/request/@context_path}/modules/hls/HLS536/hls_journal_import_save.lsc"/>
<script type="text/javascript"><![CDATA[
window.location.href = $('hls_journal_entrance_import_link').getUrl();
function loadComplete() {
var param = {};
param['template_type'] = '${/parameter/@template_type}';
param['header_id'] = '${/model/header/record/@header_id}';
Leaf.Masker.mask(Ext.getBody(), '${l:HLS.EXECUTING}');
Leaf.request({
url: $('import_save_data_link').getUrl(),
para: param,
success: function (res) {
Leaf.Masker.unmask(Ext.getBody());
Leaf.showInfoMessage('成功','导入成功!',function(){
window.location.href = $('hls_journal_entrance_import_link').getUrl();
});
},
failure: function (res) {
Leaf.Masker.unmask(Ext.getBody());
},
error: function (res) {
Leaf.Masker.unmask(Ext.getBody());
},
sync: true,
scope: this
});
}
loadComplete();
]]></script>
</a:view>
......
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