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