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
*/
......
......@@ -6,34 +6,22 @@ import com.github.pagehelper.PageInfo;
import com.google.common.collect.Lists;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import pwc.taxtech.atms.common.message.ErrorMessage;
import pwc.taxtech.atms.common.util.JxlsUtils;
import pwc.taxtech.atms.constant.Constant;
import pwc.taxtech.atms.constant.CountTypeConstant;
import pwc.taxtech.atms.constant.ExportTemplatePathConstant;
import pwc.taxtech.atms.dao.*;
import pwc.taxtech.atms.dto.CitJournalAdjustDto;
import pwc.taxtech.atms.dpo.CitTrialBalanceDto;
import pwc.taxtech.atms.dto.CitJournalAdjustDto;
import pwc.taxtech.atms.dto.CitTrialBalanceExportDto;
import pwc.taxtech.atms.dto.JournalMergeExportDto;
import pwc.taxtech.atms.dto.export.ExportDto;
import pwc.taxtech.atms.dto.vatdto.*;
import pwc.taxtech.atms.dto.vatdto.dd.TrialBalanceDto;
import pwc.taxtech.atms.dto.vatdto.dd.*;
import pwc.taxtech.atms.dto.vatdto.excelheader.CashFlowHeader;
import pwc.taxtech.atms.dto.vatdto.excelheader.CertifiedInvoicesListHeader;
import pwc.taxtech.atms.entity.*;
import pwc.taxtech.atms.exception.ServiceException;
import pwc.taxtech.atms.thirdparty.ExcelUtil;
import pwc.taxtech.atms.vat.dao.*;
import pwc.taxtech.atms.vat.dpo.TrialBalanceCondition;
import pwc.taxtech.atms.vat.dpo.*;
import pwc.taxtech.atms.vat.entity.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.io.OutputStream;
import java.math.BigDecimal;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
......@@ -41,6 +29,7 @@ import java.util.Map;
/**
* CIT数据预览功能模块
*
* @author zhikai.z.wei
* @Date: 02/03/2019
* @Description:
......@@ -61,17 +50,18 @@ public class CitDataPreviewServiceImpl extends BaseService {
/**
* 获取日记账合并版
*
* @param citJournalAdjustDto
* @return
*/
public PageInfo<CitJournalAdjustDto> getJournalMergeData(CitJournalAdjustDto citJournalAdjustDto) {
CitJournalEntryAdjust citJournalEntryAdjust = beanUtil.copyProperties(citJournalAdjustDto, new CitJournalEntryAdjust());
List<String> orgList = getOrgList(citJournalAdjustDto.getProjectId());
if(citJournalEntryAdjust.getPeriodEnd()!=null && citJournalEntryAdjust.getPeriodEnd()%100 ==12){
citJournalEntryAdjust.setPeriodEnd(citJournalEntryAdjust.getPeriodEnd()/100*100+13);
if (citJournalEntryAdjust.getPeriodEnd() != null && citJournalEntryAdjust.getPeriodEnd() % 100 == 12) {
citJournalEntryAdjust.setPeriodEnd(citJournalEntryAdjust.getPeriodEnd() / 100 * 100 + 13);
}
Page page = PageHelper.startPage(citJournalAdjustDto.getPageInfo().getPageIndex(), citJournalAdjustDto.getPageInfo().getPageSize());
List<CitJournalEntryAdjust> journalMerges = citJournalMapper.getJournalMergeByOrgList(citJournalEntryAdjust,orgList);
List<CitJournalEntryAdjust> journalMerges = citJournalMapper.getJournalMergeByOrgList(citJournalEntryAdjust, orgList);
List<CitJournalAdjustDto> journalAdjustDtos = Lists.newArrayList();
journalMerges.forEach(journal -> {
CitJournalAdjustDto citJournalDto = new CitJournalAdjustDto();
......@@ -79,7 +69,7 @@ public class CitDataPreviewServiceImpl extends BaseService {
journalAdjustDtos.add(citJournalDto);
});
PageInfo<CitJournalAdjustDto> pageInfo =new PageInfo<>(journalAdjustDtos);
PageInfo<CitJournalAdjustDto> pageInfo = new PageInfo<>(journalAdjustDtos);
pageInfo.setTotal(page.getTotal());
pageInfo.setPageNum(citJournalAdjustDto.getPageInfo().getPageIndex());
return pageInfo;
......@@ -87,19 +77,20 @@ public class CitDataPreviewServiceImpl extends BaseService {
/**
* 根据卡片主键获取隶属的机构及子机构,若本身就是子机构那么只获取本身
*
* @param projectId
* @return
*/
public List<String> getOrgList(String projectId){
public List<String> getOrgList(String projectId) {
Project project = projectMapper.selectByPrimaryKey(projectId);
Organization organization = organizationMapper.selectByPrimaryKey(project.getOrganizationId());
List<String> orgList = new ArrayList<>();
orgList.add(project.getOrganizationId());
if(StringUtils.isBlank(organization.getParentId())){
if (StringUtils.isBlank(organization.getParentId())) {
OrganizationExample organizationExample = new OrganizationExample();
organizationExample.createCriteria().andParentIdEqualTo(project.getOrganizationId());
List<Organization> organizations = organizationMapper.selectByExample(organizationExample);
for (Organization org:organizations) {
for (Organization org : organizations) {
orgList.add(org.getId());
}
}
......@@ -108,6 +99,7 @@ public class CitDataPreviewServiceImpl extends BaseService {
/**
* 日记账导出(第一种方式)--暂时不使用
*
* @param citJournalAdjustDto
* @param os
* @return
......@@ -134,23 +126,29 @@ public class CitDataPreviewServiceImpl extends BaseService {
/**
* 日记账导出(第二种方式)--正在使用
*
* @param citJournalAdjustDto
* @param response
* @return
*/
public int exportJournalMergeData2(CitJournalAdjustDto citJournalAdjustDto, HttpServletResponse response){
public int exportJournalMergeData2(CitJournalAdjustDto citJournalAdjustDto, HttpServletResponse response) {
String fileName = citJournalAdjustDto.getPeriodStart() + "-" + citJournalAdjustDto.getPeriodEnd();
response.setContentType("application/vnd.ms-excel;charset=utf-8");
response.setCharacterEncoding("UTF-8");
response.addHeader("Access-Control-Expose-Headers", "Content-Type,Content-Disposition,x-file-name");
response.addHeader("x-file-name", fileName);
CitJournalEntryAdjust citJournalEntryAdjust = beanUtil.copyProperties(citJournalAdjustDto, new CitJournalEntryAdjust());
List<String> orgList = getOrgList(citJournalAdjustDto.getProjectId());
if(citJournalEntryAdjust.getPeriodEnd()!=null && citJournalEntryAdjust.getPeriodEnd()%100 ==12){
citJournalEntryAdjust.setPeriodEnd(citJournalEntryAdjust.getPeriodEnd()/100*100+13);
if (citJournalEntryAdjust.getPeriodEnd() != null && citJournalEntryAdjust.getPeriodEnd() % 100 == 12) {
citJournalEntryAdjust.setPeriodEnd(citJournalEntryAdjust.getPeriodEnd() / 100 * 100 + 13);
}
List<CitJournalEntryAdjust> journalMerges = citJournalMapper.getJournalMergeByOrgList(citJournalEntryAdjust,orgList);
if(journalMerges.size()==0){
return 0;
List<CitJournalEntryAdjust> journalMerges = citJournalMapper.getJournalMergeByOrgList(citJournalEntryAdjust, orgList);
if (journalMerges.size() == 0) {
return 0;
}
ExportDto exportDto = new ExportDto();
exportDto.setFileName("日记账");
exportDto.setTemplateUrl(Constant.citTemplateUrl + "/citJournalEntryAdjust.xlsx");
exportDto.setTemplateUrl(Constant.citTemplateUrl + "/citJournalEntryAdjust.xlsx");
exportDto.setResponse(response);
exportDto.setList(journalMerges);
exportDto.setRelation(null);
......@@ -161,37 +159,39 @@ public class CitDataPreviewServiceImpl extends BaseService {
/**
* 日记账导出(第一种方式)所用到的获取Excel表头
*
* @return
*/
private Map<String, String> generalJMHeader() {
Map<String, String> header = new LinkedHashMap<>();
header.put("ApprovalStatus","审批状态");
header.put("PostedStatus","过账");
header.put("ApprovalStatus", "审批状态");
header.put("PostedStatus", "过账");
header.put("AccountingPeriod","会计期间");
header.put("AccountingDate","凭证日期");
header.put("JournalSource","日记账来源");
header.put("Category","日记账类别");
header.put("Name","日记账名称");
header.put("VoucherNum","凭证编号");
header.put("Description","摘要");
header.put("OrgCode","主体代码");
header.put("SubjectCode","科目代码");
header.put("OrgName","主体代码");
header.put("SubjectName","科目代码");
header.put("AccountingPeriod", "会计期间");
header.put("AccountingDate", "凭证日期");
header.put("JournalSource", "日记账来源");
header.put("Category", "日记账类别");
header.put("Name", "日记账名称");
header.put("VoucherNum", "凭证编号");
header.put("Description", "摘要");
header.put("OrgCode", "主体代码");
header.put("SubjectCode", "科目代码");
header.put("OrgName", "主体代码");
header.put("SubjectName", "科目代码");
header.put("AccountedDr","借方金额");
header.put("AccountedCr","贷方金额");
header.put("CreatedBy","创建人");
header.put("CreatedDate","创建日期");
header.put("LateUpdatedBy","最后更新人");
header.put("LateUpdatedDate","最后更新日期");
header.put("Period","税务系统期间");
header.put("AccountedDr", "借方金额");
header.put("AccountedCr", "贷方金额");
header.put("CreatedBy", "创建人");
header.put("CreatedDate", "创建日期");
header.put("LateUpdatedBy", "最后更新人");
header.put("LateUpdatedDate", "最后更新日期");
header.put("Period", "税务系统期间");
return header;
}
/**
* 获取自动生成的试算平衡表数据
*
* @param citTrialBalanceDto
* @return
*/
......@@ -200,11 +200,11 @@ public class CitDataPreviewServiceImpl extends BaseService {
CitTrialBalanceExample citTbExample = new CitTrialBalanceExample();
CitTrialBalanceExample.Criteria citTbExampleCriteria = citTbExample.createCriteria();
citTbExampleCriteria.andProjectIdEqualTo(citTrialBalanceDto.getProjectId());
if(citTrialBalanceDto.getAccountCode() != null && !"".equals(citTrialBalanceDto.getAccountCode())){
citTbExampleCriteria.andAccountCodeLike("%"+citTrialBalanceDto.getAccountCode()+"%");
if (citTrialBalanceDto.getAccountCode() != null && !"".equals(citTrialBalanceDto.getAccountCode())) {
citTbExampleCriteria.andAccountCodeLike("%" + citTrialBalanceDto.getAccountCode() + "%");
}
if(citTrialBalanceDto.getAccountDescription() != null && !"".equals(citTrialBalanceDto.getAccountDescription())){
citTbExampleCriteria.andAccountDescriptionLike("%"+citTrialBalanceDto.getAccountDescription()+"%");
if (citTrialBalanceDto.getAccountDescription() != null && !"".equals(citTrialBalanceDto.getAccountDescription())) {
citTbExampleCriteria.andAccountDescriptionLike("%" + citTrialBalanceDto.getAccountDescription() + "%");
}
List<CitTrialBalance> citTbList = citTbMapper.selectByExample(citTbExample);
......@@ -215,7 +215,7 @@ public class CitDataPreviewServiceImpl extends BaseService {
citTbDtos.add(citTrialBalanceDtoTemp);
});
PageInfo<CitTrialBalanceDto> pageInfo =new PageInfo<>(citTbDtos);
PageInfo<CitTrialBalanceDto> pageInfo = new PageInfo<>(citTbDtos);
pageInfo.setTotal(page.getTotal());
pageInfo.setPageNum(citTrialBalanceDto.getPageInfo().getPageIndex());
return pageInfo;
......@@ -223,6 +223,7 @@ public class CitDataPreviewServiceImpl extends BaseService {
/**
* 试算平衡表生成版的导出(第一种方式)
*
* @param citTrialBalanceDto
* @param os
* @return
......@@ -251,27 +252,28 @@ public class CitDataPreviewServiceImpl extends BaseService {
/**
* 试算平衡表生成版的导出(第二种导出方式)
*
* @param citTrialBalanceDto
* @param response
* @return
*/
public int exportTbGeneVerData2(CitTrialBalanceDto citTrialBalanceDto, HttpServletResponse response){
public int exportTbGeneVerData2(CitTrialBalanceDto citTrialBalanceDto, HttpServletResponse response) {
CitTrialBalanceExample citTbExample = new CitTrialBalanceExample();
CitTrialBalanceExample.Criteria citTbExampleCriteria = citTbExample.createCriteria();
citTbExampleCriteria.andProjectIdEqualTo(citTrialBalanceDto.getProjectId());
if(citTrialBalanceDto.getAccountCode() != null && !"".equals(citTrialBalanceDto.getAccountCode())){
citTbExampleCriteria.andAccountCodeLike("%"+citTrialBalanceDto.getAccountCode()+"%");
if (citTrialBalanceDto.getAccountCode() != null && !"".equals(citTrialBalanceDto.getAccountCode())) {
citTbExampleCriteria.andAccountCodeLike("%" + citTrialBalanceDto.getAccountCode() + "%");
}
if(citTrialBalanceDto.getAccountDescription() != null && !"".equals(citTrialBalanceDto.getAccountDescription())){
citTbExampleCriteria.andAccountDescriptionLike("%"+citTrialBalanceDto.getAccountDescription()+"%");
if (citTrialBalanceDto.getAccountDescription() != null && !"".equals(citTrialBalanceDto.getAccountDescription())) {
citTbExampleCriteria.andAccountDescriptionLike("%" + citTrialBalanceDto.getAccountDescription() + "%");
}
List<CitTrialBalance> citTbList = citTbMapper.selectByExample(citTbExample);
if(citTbList.size()==0){
return 0;
if (citTbList.size() == 0) {
return 0;
}
ExportDto exportDto = new ExportDto();
exportDto.setFileName("试算平衡表生成版");
exportDto.setTemplateUrl(Constant.citTemplateUrl + "/citTrialBalanceGene.xlsx");
exportDto.setTemplateUrl(Constant.citTemplateUrl + "/citTrialBalanceGene.xlsx");
exportDto.setResponse(response);
exportDto.setList(citTbList);
exportDto.setRelation(null);
......@@ -282,23 +284,25 @@ public class CitDataPreviewServiceImpl extends BaseService {
/**
* 试算平衡表生成版的导出(第一种方式)所用到的生成Excel的表头
*
* @return
*/
private Map<String, String> generalTbGeneVerHeader() {
Map<String, String> header = new LinkedHashMap<>();
header.put("AccountCode","科目代码");
header.put("AccountDescription","科目说明");
header.put("AccountCode", "科目代码");
header.put("AccountDescription", "科目说明");
header.put("AccountingPeriod","期间");
header.put("DebitAmount","借方发生额");
header.put("CreditAmount","贷方发生额");
header.put("BeginningBalance","期初余额");
header.put("EndingBalance","期末余额");
header.put("AccountingPeriod", "期间");
header.put("DebitAmount", "借方发生额");
header.put("CreditAmount", "贷方发生额");
header.put("BeginningBalance", "期初余额");
header.put("EndingBalance", "期末余额");
return header;
}
/**
* 获取试算平衡表Mapping版的数据
*
* @param citTrialBalanceDto
* @return
*/
......@@ -307,14 +311,14 @@ public class CitDataPreviewServiceImpl extends BaseService {
CitTbamExample citTbamExample = new CitTbamExample();
CitTbamExample.Criteria criteria = citTbamExample.createCriteria();
criteria.andProjectIdEqualTo(citTrialBalanceDto.getProjectId());
if(citTrialBalanceDto.getAccountCode() != null && !"".equals(citTrialBalanceDto.getAccountCode())){
criteria.andAccountCodeLike("%"+citTrialBalanceDto.getAccountCode()+"%");
if (citTrialBalanceDto.getAccountCode() != null && !"".equals(citTrialBalanceDto.getAccountCode())) {
criteria.andAccountCodeLike("%" + citTrialBalanceDto.getAccountCode() + "%");
}
if(citTrialBalanceDto.getAccountDescription() != null && !"".equals(citTrialBalanceDto.getAccountDescription())){
criteria.andAccountDescriptionLike("%"+citTrialBalanceDto.getAccountDescription()+"%");
if (citTrialBalanceDto.getAccountDescription() != null && !"".equals(citTrialBalanceDto.getAccountDescription())) {
criteria.andAccountDescriptionLike("%" + citTrialBalanceDto.getAccountDescription() + "%");
}
if(citTrialBalanceDto.getAttribute() != null && !"".equals(citTrialBalanceDto.getAttribute())){
criteria.andAttributeLike("%"+citTrialBalanceDto.getAttribute()+"%");
if (citTrialBalanceDto.getAttribute() != null && !"".equals(citTrialBalanceDto.getAttribute())) {
criteria.andAttributeLike("%" + citTrialBalanceDto.getAttribute() + "%");
}
List<CitTrialBalanceDto> citTbList = Lists.newArrayList();
List<CitTbam> citTbams = citTbamMapper.selectByExample(citTbamExample);
......@@ -325,8 +329,8 @@ public class CitDataPreviewServiceImpl extends BaseService {
}
// List<CitTrialBalanceDto> citTbList = citTbMapper.getTbMappingData(citTrialBalanceDto);
PageInfo<CitTrialBalanceDto> pageInfo =new PageInfo<>(citTbList);
PageInfo<CitTrialBalanceDto> pageInfo = new PageInfo<>(citTbList);
pageInfo.setTotal(page.getTotal());
pageInfo.setPageNum(citTrialBalanceDto.getPageInfo().getPageIndex());
return pageInfo;
......@@ -334,6 +338,7 @@ public class CitDataPreviewServiceImpl extends BaseService {
/**
* 试算平衡表Mapping版的导出(第一种方式)
*
* @param citTrialBalanceDto
* @param os
* @return
......@@ -343,7 +348,7 @@ public class CitDataPreviewServiceImpl extends BaseService {
List<CitTrialBalanceDto> citTbList = citTbMapper.getTbMappingData(citTrialBalanceDto);
Map<String, String> header = generalTbGeneVerHeader();
header.put("Attribute","小类");
header.put("Attribute", "小类");
List<CitTrialBalanceExportDto> cellList = new ArrayList<>();
citTbList.forEach(tb -> {
CitTrialBalanceExportDto d = new CitTrialBalanceExportDto();
......@@ -360,22 +365,23 @@ public class CitDataPreviewServiceImpl extends BaseService {
/**
* 试算平衡表Mapping版的导出(第二种导出方式)
*
* @param citTrialBalanceDto
* @param response
* @return
*/
public int exportTbMappingVerData2(CitTrialBalanceDto citTrialBalanceDto, HttpServletResponse response){
public int exportTbMappingVerData2(CitTrialBalanceDto citTrialBalanceDto, HttpServletResponse response) {
CitTbamExample citTbamExample = new CitTbamExample();
CitTbamExample.Criteria criteria = citTbamExample.createCriteria();
criteria.andProjectIdEqualTo(citTrialBalanceDto.getProjectId());
if(citTrialBalanceDto.getAccountCode() != null && !"".equals(citTrialBalanceDto.getAccountCode())){
criteria.andAccountCodeLike("%"+citTrialBalanceDto.getAccountCode()+"%");
if (citTrialBalanceDto.getAccountCode() != null && !"".equals(citTrialBalanceDto.getAccountCode())) {
criteria.andAccountCodeLike("%" + citTrialBalanceDto.getAccountCode() + "%");
}
if(citTrialBalanceDto.getAccountDescription() != null && !"".equals(citTrialBalanceDto.getAccountDescription())){
criteria.andAccountDescriptionLike("%"+citTrialBalanceDto.getAccountDescription()+"%");
if (citTrialBalanceDto.getAccountDescription() != null && !"".equals(citTrialBalanceDto.getAccountDescription())) {
criteria.andAccountDescriptionLike("%" + citTrialBalanceDto.getAccountDescription() + "%");
}
if(citTrialBalanceDto.getAttribute() != null && !"".equals(citTrialBalanceDto.getAttribute())){
criteria.andAttributeLike("%"+citTrialBalanceDto.getAttribute()+"%");
if (citTrialBalanceDto.getAttribute() != null && !"".equals(citTrialBalanceDto.getAttribute())) {
criteria.andAttributeLike("%" + citTrialBalanceDto.getAttribute() + "%");
}
List<CitTrialBalanceDto> citTbList = Lists.newArrayList();
List<CitTbam> citTbams = citTbamMapper.selectByExample(citTbamExample);
......@@ -384,12 +390,12 @@ public class CitDataPreviewServiceImpl extends BaseService {
beanUtil.copyProperties(citTbam, citTrialBalanceDtoTemp);
citTbList.add(citTrialBalanceDtoTemp);
}
if(citTbList.size()==0){
return 0;
if (citTbList.size() == 0) {
return 0;
}
ExportDto exportDto = new ExportDto();
exportDto.setFileName("试算平衡表Mapping版");
exportDto.setTemplateUrl(Constant.citTemplateUrl + "/citTrialBalanceMapping.xlsx");
exportDto.setTemplateUrl(Constant.citTemplateUrl + "/citTrialBalanceMapping.xlsx");
exportDto.setResponse(response);
exportDto.setList(citTbList);
exportDto.setRelation(citTbList.get(0));
......
......@@ -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