Commit ed183558 authored by sam.x.wang's avatar sam.x.wang

导出文件名和bug

parent 5a8bd89f
......@@ -23,6 +23,7 @@ import static javax.servlet.http.HttpServletResponse.SC_OK;
/**
* CIT数据预览功能模块Controller
*
* @author zhikai.z.wei
*/
@RestController
......@@ -34,6 +35,7 @@ public class CitDataPreviewController extends BaseController {
/**
* 日记账合并版数据的获取
*
* @param citJournalAdjustDto
* @return
*/
......@@ -45,12 +47,15 @@ public class CitDataPreviewController extends BaseController {
/**
* 日记账合并版导出
*
* @param paras
* @param response
*/
@RequestMapping(value = "exportJournalMergeData", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public void exportJournalMergeData(@RequestBody CitJournalAdjustDto paras, HttpServletResponse response) {
int count = citDataPreviewService.exportJournalMergeData2(paras, response);
if (count == 0) {
response.setStatus(SC_NO_CONTENT);
} else {
......@@ -61,6 +66,7 @@ public class CitDataPreviewController extends BaseController {
/**
* 试算平衡表生成版的数据获取
*
* @param citTrialBalanceDto
* @return
*/
......@@ -72,6 +78,7 @@ public class CitDataPreviewController extends BaseController {
/**
* 试算平衡表生成版的导出
*
* @param paras
* @param response
*/
......@@ -108,6 +115,7 @@ public class CitDataPreviewController extends BaseController {
/**
* 试算平衡表Mapping版的数据获取
*
* @param citTrialBalanceDto
* @return
*/
......@@ -120,6 +128,7 @@ public class CitDataPreviewController extends BaseController {
/**
* 试算平衡表Mapping版的导出
*
* @param paras
* @param response
*/
......
......@@ -185,6 +185,7 @@
withCredentials: true
}).then(function(resp) {
var ret = resp.data;
$scope.fileName='';
$('#busy-indicator-container').hide();
deferred.resolve();
if (ret.result) {
......
......@@ -171,6 +171,7 @@
__RequestVerificationToken: token,
withCredentials: true
}).then(function(data) {
$scope.fileName='';
$('#busy-indicator-container').hide();
var resp = data.data;
deferred.resolve();
......
......@@ -18,7 +18,7 @@
if (noExtendFileName) {
filename = defaultFileName+ "_" +vatSessionService.project.name+'.xls'
} else {
filename = defaultFileName+"_"+decodeURI(headers['x-file-name']+ "_" +vatSessionService.project.name+'.xls')
filename = defaultFileName+"_"+decodeURI(headers['x-file-name']).replace('???','').replace(',','')+ "_" +vatSessionService.project.name+'.xls'
}
......
......@@ -195,7 +195,7 @@
thisConfig.responseType = "arraybuffer";
return $http.post('/dataPreview/exportCFData/get', queryParm, thisConfig).then(function (response) {
var data = new Blob([response.data], {type: response.headers('Content-Type')});
FileSaver.saveAs(data,fileName + '_'+vatSessionService.year+queryParm.periodStart+'-'+vatSessionService.year+queryParm.periodEnd+'_'+vatSessionService.project.name+'.xlsx');
FileSaver.saveAs(data,fileName + '_'+queryParm.periodStart+'-'+queryParm.periodEnd+'_'+vatSessionService.project.name+'.xlsx');
});
},
getPLDataForDisplay: function (queryParams) {
......@@ -224,7 +224,7 @@
thisConfig.responseType = "arraybuffer";
return $http.post('/dataPreview/exportIRData/get', queryParm, thisConfig).then(function (response) {
var data = new Blob([response.data], {type: response.headers('Content-Type')});
FileSaver.saveAs(data,fileName + '_'+vatSessionService.year+queryParm.periodStart+'-'+vatSessionService.year+queryParm.periodEnd+'_'+vatSessionService.project.name+'.xlsx');
FileSaver.saveAs(data,fileName + '_'+vatSessionService.year+(queryParm.periodStart<10?'0'+queryParm.periodStart:queryParm.periodStart)+'-'+vatSessionService.year+(queryParm.periodEnd<10?'0'+queryParm.periodEnd:queryParm.periodEnd)+'_'+vatSessionService.project.name+'.xlsx');
});
},
getCPRDataForDisplay: function (queryParams) {
......@@ -235,7 +235,7 @@
thisConfig.responseType = "arraybuffer";
return $http.post('/dataPreview/exportCPRData/get', queryParm, thisConfig).then(function (response) {
var data = new Blob([response.data], {type: response.headers('Content-Type')});
FileSaver.saveAs(data,fileName + '_'+vatSessionService.year+queryParm.periodStart+'-'+vatSessionService.year+queryParm.periodEnd+'_'+vatSessionService.project.name+'.xlsx');
FileSaver.saveAs(data,fileName + '_'+queryParm.periodStart+'-'+queryParm.periodEnd+'_'+vatSessionService.project.name+'.xlsx');
});
},
getRLITDataForDisplay: function (queryParams) {
......@@ -246,7 +246,7 @@
thisConfig.responseType = "arraybuffer";
return $http.post('/dataPreview/exportRLITData/get', queryParm, thisConfig).then(function (response) {
var data = new Blob([response.data], {type: response.headers('Content-Type')});
FileSaver.saveAs(data,fileName + '_'+vatSessionService.year+queryParm.periodStart+'-'+vatSessionService.year+queryParm.periodEnd+'_'+vatSessionService.project.name+'.xlsx');
FileSaver.saveAs(data,fileName + '_'+queryParm.periodStart+'-'+queryParm.periodEnd+'_'+vatSessionService.project.name+'.xlsx');
});
},
getCILDataForDisplay: function (queryParams) {
......@@ -268,7 +268,7 @@
thisConfig.responseType = "arraybuffer";
return $http.post('/dataPreview/exportIDData/get', queryParm, thisConfig).then(function (response) {
var data = new Blob([response.data], {type: response.headers('Content-Type')});
FileSaver.saveAs(data,fileName + '_'+vatSessionService.year+queryParm.periodStart+'-'+vatSessionService.year+queryParm.periodEnd+'_'+vatSessionService.project.name+'.xlsx');
FileSaver.saveAs(data,fileName + '_'+queryParm.periodStart+'-'+queryParm.periodEnd+'_'+vatSessionService.project.name+'.xlsx');
});
}
};
......
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