Commit ece67a0f authored by zhkwei's avatar zhkwei

CIT数据处理及展示,CIT数据导入预览bug修改及优化

parent 132a0740
...@@ -39,26 +39,13 @@ public class CitDataPreviewController extends BaseController { ...@@ -39,26 +39,13 @@ public class CitDataPreviewController extends BaseController {
@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) {
response.setContentType("application/vnd.ms-excel;charset=utf-8"); int count = citDataPreviewService.exportJournalMergeData2(paras, response);
response.addHeader("Access-Control-Expose-Headers", "Content-Type,Content-Disposition,x-file-name"); if (count == 0) {
String fileName = paras.getPeriodStart() + "-" + paras.getPeriodEnd(); response.setStatus(SC_NO_CONTENT);
response.setCharacterEncoding("UTF-8"); } else {
OutputStream os = null; response.setStatus(SC_OK);
try {
response.addHeader("Content-Disposition", "attachment;filename="
+ UUID.randomUUID() + ".xls");
response.addHeader("x-file-name", fileName);
os = response.getOutputStream();
int count = citDataPreviewService.exportJournalMergeData(paras, os);
if (count == 0) {
response.setStatus(SC_NO_CONTENT);
} else {
response.setStatus(SC_OK);
}
} catch (IOException e) {
logger.error(String.format("下载科目余额表-生成文件异常:%s",e.getMessage()));
} }
} }
...@@ -70,25 +57,32 @@ public class CitDataPreviewController extends BaseController { ...@@ -70,25 +57,32 @@ public class CitDataPreviewController extends BaseController {
@RequestMapping(value = "exportTbGeneVerData", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE) @RequestMapping(value = "exportTbGeneVerData", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public void exportTbGeneVerData(@RequestBody CitTrialBalanceDto paras, HttpServletResponse response) { public void exportTbGeneVerData(@RequestBody CitTrialBalanceDto paras, HttpServletResponse response) {
response.setContentType("application/vnd.ms-excel;charset=utf-8"); // response.setContentType("application/vnd.ms-excel;charset=utf-8");
response.addHeader("Access-Control-Expose-Headers", "Content-Type,Content-Disposition,x-file-name"); // response.addHeader("Access-Control-Expose-Headers", "Content-Type,Content-Disposition,x-file-name");
String fileName = paras.getPeriodStart() + "-" + paras.getPeriodEnd(); // String fileName = paras.getPeriodStart() + "-" + paras.getPeriodEnd();
response.setCharacterEncoding("UTF-8"); // response.setCharacterEncoding("UTF-8");
OutputStream os = null; // OutputStream os = null;
try { // try {
response.addHeader("Content-Disposition", "attachment;filename=" // response.addHeader("Content-Disposition", "attachment;filename="
+ UUID.randomUUID() + ".xls"); // + UUID.randomUUID() + ".xls");
response.addHeader("x-file-name", fileName); // response.addHeader("x-file-name", fileName);
os = response.getOutputStream(); // os = response.getOutputStream();
int count = citDataPreviewService.exportTbGeneVerData(paras, os); // int count = citDataPreviewService.exportTbGeneVerData(paras, os);
//
if (count == 0) { // if (count == 0) {
response.setStatus(SC_NO_CONTENT); // response.setStatus(SC_NO_CONTENT);
} else { // } else {
response.setStatus(SC_OK); // response.setStatus(SC_OK);
} // }
} catch (IOException e) { // } catch (IOException e) {
logger.error(String.format("下载试算平衡表生成版-生成文件异常:%s",e.getMessage())); // logger.error(String.format("下载试算平衡表生成版-生成文件异常:%s",e.getMessage()));
// }
int count = citDataPreviewService.exportTbGeneVerData2(paras, response);
if (count == 0) {
response.setStatus(SC_NO_CONTENT);
} else {
response.setStatus(SC_OK);
} }
} }
...@@ -101,25 +95,12 @@ public class CitDataPreviewController extends BaseController { ...@@ -101,25 +95,12 @@ public class CitDataPreviewController extends BaseController {
@RequestMapping(value = "exportTbMappingVerData", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE) @RequestMapping(value = "exportTbMappingVerData", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public void exportTbMappingVerData(@RequestBody CitTrialBalanceDto paras, HttpServletResponse response) { public void exportTbMappingVerData(@RequestBody CitTrialBalanceDto paras, HttpServletResponse response) {
response.setContentType("application/vnd.ms-excel;charset=utf-8"); int count = citDataPreviewService.exportTbMappingVerData2(paras, response);
response.addHeader("Access-Control-Expose-Headers", "Content-Type,Content-Disposition,x-file-name");
String fileName = paras.getPeriodStart() + "-" + paras.getPeriodEnd(); if (count == 0) {
response.setCharacterEncoding("UTF-8"); response.setStatus(SC_NO_CONTENT);
OutputStream os = null; } else {
try { response.setStatus(SC_OK);
response.addHeader("Content-Disposition", "attachment;filename="
+ UUID.randomUUID() + ".xls");
response.addHeader("x-file-name", fileName);
os = response.getOutputStream();
int count = citDataPreviewService.exportTbMappingVerData(paras, os);
if (count == 0) {
response.setStatus(SC_NO_CONTENT);
} else {
response.setStatus(SC_OK);
}
} catch (IOException e) {
logger.error(String.format("下载科目余额表-生成文件异常:%s",e.getMessage()));
} }
} }
......
...@@ -28,14 +28,14 @@ public class CitReportController { ...@@ -28,14 +28,14 @@ public class CitReportController {
/** /**
* 获取CIT所有要生成的报表模板相关信息, * 获取CIT所有要生成的报表模板相关信息,
* 注意CIT不存在月份期间 * 注意CIT不存在月份期间,默认为0
* @param projectId * @param projectId
* @param serviceType * @param serviceType
* @return * @return
*/ */
@RequestMapping(value = "citTemplate/{projectId}/{serviceType}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE) @RequestMapping(value = "citTemplate/{projectId}/{serviceType}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public OperationResultDto<List<ReportDto>> getCitTemplate(@PathVariable String projectId, @PathVariable int serviceType) { public OperationResultDto<List<ReportDto>> getCitTemplate(@PathVariable String projectId, @PathVariable int serviceType) {
return citReportService.getReportTemplate(projectId, EnumServiceType.getEnumByCode(serviceType)); return citReportService.getReportTemplate(projectId, EnumServiceType.getEnumByCode(serviceType),0);
} }
/** /**
...@@ -52,4 +52,9 @@ public class CitReportController { ...@@ -52,4 +52,9 @@ public class CitReportController {
return ResponseEntity.ok(citReportService.generateCitData(projectId, EnumServiceType.CIT, mergeManual,0,null, generator)); return ResponseEntity.ok(citReportService.generateCitData(projectId, EnumServiceType.CIT, mergeManual,0,null, generator));
} }
@RequestMapping(value = "filterTemplate/{projectId}/{serviceType}/{period}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public OperationResultDto<List<ReportDto>> getFilterTemplate(@PathVariable String projectId, @PathVariable int serviceType, @PathVariable Integer period) {
return citReportService.getFilterReportTemplate(projectId, EnumServiceType.getEnumByCode(serviceType), period);
}
} }
\ No newline at end of file
...@@ -58,7 +58,7 @@ public class OperationLogController { ...@@ -58,7 +58,7 @@ public class OperationLogController {
public Boolean addOperationLog(VatOperationLog vatOperationLog) { public Boolean addOperationLog(VatOperationLog vatOperationLog) {
OperationLogDto operationLogDto = new OperationLogDto(); OperationLogDto operationLogDto = new OperationLogDto();
CommonUtils.copyProperties(vatOperationLog, operationLogDto); CommonUtils.copyProperties(vatOperationLog, operationLogDto);
operationLogService.addOperationLog(operationLogDto); // operationLogService.addOperationLog(operationLogDto);
return true; return true;
} }
} }
...@@ -113,7 +113,7 @@ public class CitReportServiceImpl extends BaseService { ...@@ -113,7 +113,7 @@ public class CitReportServiceImpl extends BaseService {
@Autowired @Autowired
private DataUtil dataUtil; private DataUtil dataUtil;
public OperationResultDto<List<ReportDto>> getReportTemplate(String projectId, EnumServiceType serviceType) { public OperationResultDto<List<ReportDto>> getReportTemplate(String projectId, EnumServiceType serviceType, Integer period) {
OperationResultDto<List<ReportDto>> operationResult = new OperationResultDto<>(); OperationResultDto<List<ReportDto>> operationResult = new OperationResultDto<>();
try { try {
Project project = projectMapper.selectByPrimaryKey(projectId); Project project = projectMapper.selectByPrimaryKey(projectId);
...@@ -661,4 +661,24 @@ public class CitReportServiceImpl extends BaseService { ...@@ -661,4 +661,24 @@ public class CitReportServiceImpl extends BaseService {
return job; return job;
} }
public OperationResultDto<List<ReportDto>> getFilterReportTemplate(String projectId, EnumServiceType serviceType, Integer periodParam) {
OperationResultDto<List<ReportDto>> result = new OperationResultDto<>();
CommonUtils.copyProperties(getReportTemplate(projectId,serviceType,periodParam),result);
if(!result.getResult() || CollectionUtils.isEmpty(result.getData())) {
return result;
}
int period = periodParam != null ? periodParam : 0;
PeriodTemplateExample periodTemplateExample = new PeriodTemplateExample();
periodTemplateExample.createCriteria().andProjectIdEqualTo(projectId)
.andPeriodEqualTo(period);
List<PeriodTemplate> periodTemplateList = periodTemplateMapper.selectByExample(periodTemplateExample);
List<String> ids = Lists.newArrayList();
periodTemplateList.stream().forEach(x -> ids.add(x.getTemplateId() + ""));
List<ReportDto> reportDtos = result.getData().stream().filter(x -> {
return x.getId() != null && ids.contains(x.getTemplateId());
}).collect(Collectors.toList());
result.setData(reportDtos);
return result;
}
} }
...@@ -7,7 +7,6 @@ import org.apache.ibatis.session.RowBounds; ...@@ -7,7 +7,6 @@ import org.apache.ibatis.session.RowBounds;
import pwc.taxtech.atms.MyMapper; import pwc.taxtech.atms.MyMapper;
import pwc.taxtech.atms.entity.CitEAMAssetsDisposal; import pwc.taxtech.atms.entity.CitEAMAssetsDisposal;
import pwc.taxtech.atms.entity.CitEAMAssetsDisposalExample; import pwc.taxtech.atms.entity.CitEAMAssetsDisposalExample;
import pwc.taxtech.atms.entity.CitSalaryAdvance;
@Mapper @Mapper
public interface CitEAMAssetsDisposalMapper extends MyMapper { public interface CitEAMAssetsDisposalMapper extends MyMapper {
......
...@@ -5,7 +5,6 @@ import org.apache.ibatis.annotations.Mapper; ...@@ -5,7 +5,6 @@ import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.session.RowBounds; import org.apache.ibatis.session.RowBounds;
import pwc.taxtech.atms.MyMapper; import pwc.taxtech.atms.MyMapper;
import pwc.taxtech.atms.entity.CitEAMAssetsDisposal;
import pwc.taxtech.atms.entity.CitSalaryAdvance; import pwc.taxtech.atms.entity.CitSalaryAdvance;
import pwc.taxtech.atms.entity.CitSalaryAdvanceExample; import pwc.taxtech.atms.entity.CitSalaryAdvanceExample;
......
...@@ -15,14 +15,14 @@ function ($scope, $q, $log, $translate, $location, loginContext, enums, vatSessi ...@@ -15,14 +15,14 @@ function ($scope, $q, $log, $translate, $location, loginContext, enums, vatSessi
$scope.nodeDicKey = constant.DictionaryDictKey.DataImport; $scope.nodeDicKey = constant.DictionaryDictKey.DataImport;
$scope.linkShort = enums.linkShort.PreviewData; $scope.linkShort = enums.linkShort.PreviewData;
$scope.menus = [ $scope.menus = [
{ // {
name: 'balanceSheet', permission: constant.citPermission.dataPreview.balanceSheet.queryCode, // name: 'balanceSheet', permission: constant.citPermission.dataPreview.balanceSheet.queryCode,
text: $translate.instant('balanceSheet'), icon: 'fa fa-bank' // text: $translate.instant('balanceSheet'), icon: 'fa fa-bank'
}, // },
{ // {
name: 'accountVoucher', permission: constant.citPermission.dataPreview.accountVoucher.queryCode, // name: 'accountVoucher', permission: constant.citPermission.dataPreview.accountVoucher.queryCode,
text: $translate.instant('accountVoucher'), icon: 'fa fa-columns' // text: $translate.instant('accountVoucher'), icon: 'fa fa-columns'
}, // },
{ {
name: 'journalMerge', permission: constant.citPermission.dataPreview.journalMerge.queryCode, name: 'journalMerge', permission: constant.citPermission.dataPreview.journalMerge.queryCode,
text: $translate.instant('journal'), icon: 'fa fa-bank' text: $translate.instant('journal'), icon: 'fa fa-bank'
......
...@@ -252,7 +252,7 @@ ...@@ -252,7 +252,7 @@
SweetAlert.warning("没有数据可以下载"); SweetAlert.warning("没有数据可以下载");
return; return;
} }
vatExportService.exportToExcel(data, status, headers, '日记账信息.xls'); vatExportService.exportToExcel(data, status, headers, '日记账信息.xlsx');
}).error(function () { }).error(function () {
SweetAlert.error($translate.instant('PleaseContactAdministrator')); SweetAlert.error($translate.instant('PleaseContactAdministrator'));
}); });
......
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