Commit ece67a0f authored by zhkwei's avatar zhkwei

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

parent 132a0740
......@@ -39,26 +39,13 @@ public class CitDataPreviewController extends BaseController {
@RequestMapping(value = "exportJournalMergeData", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public void exportJournalMergeData(@RequestBody CitJournalAdjustDto paras, HttpServletResponse response) {
response.setContentType("application/vnd.ms-excel;charset=utf-8");
response.addHeader("Access-Control-Expose-Headers", "Content-Type,Content-Disposition,x-file-name");
String fileName = paras.getPeriodStart() + "-" + paras.getPeriodEnd();
response.setCharacterEncoding("UTF-8");
OutputStream os = null;
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()));
int count = citDataPreviewService.exportJournalMergeData2(paras, response);
if (count == 0) {
response.setStatus(SC_NO_CONTENT);
} else {
response.setStatus(SC_OK);
}
}
......@@ -70,25 +57,32 @@ public class CitDataPreviewController extends BaseController {
@RequestMapping(value = "exportTbGeneVerData", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public void exportTbGeneVerData(@RequestBody CitTrialBalanceDto paras, HttpServletResponse response) {
response.setContentType("application/vnd.ms-excel;charset=utf-8");
response.addHeader("Access-Control-Expose-Headers", "Content-Type,Content-Disposition,x-file-name");
String fileName = paras.getPeriodStart() + "-" + paras.getPeriodEnd();
response.setCharacterEncoding("UTF-8");
OutputStream os = null;
try {
response.addHeader("Content-Disposition", "attachment;filename="
+ UUID.randomUUID() + ".xls");
response.addHeader("x-file-name", fileName);
os = response.getOutputStream();
int count = citDataPreviewService.exportTbGeneVerData(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()));
// response.setContentType("application/vnd.ms-excel;charset=utf-8");
// response.addHeader("Access-Control-Expose-Headers", "Content-Type,Content-Disposition,x-file-name");
// String fileName = paras.getPeriodStart() + "-" + paras.getPeriodEnd();
// response.setCharacterEncoding("UTF-8");
// OutputStream os = null;
// try {
// response.addHeader("Content-Disposition", "attachment;filename="
// + UUID.randomUUID() + ".xls");
// response.addHeader("x-file-name", fileName);
// os = response.getOutputStream();
// int count = citDataPreviewService.exportTbGeneVerData(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()));
// }
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 {
@RequestMapping(value = "exportTbMappingVerData", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public void exportTbMappingVerData(@RequestBody CitTrialBalanceDto paras, HttpServletResponse response) {
response.setContentType("application/vnd.ms-excel;charset=utf-8");
response.addHeader("Access-Control-Expose-Headers", "Content-Type,Content-Disposition,x-file-name");
String fileName = paras.getPeriodStart() + "-" + paras.getPeriodEnd();
response.setCharacterEncoding("UTF-8");
OutputStream os = null;
try {
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()));
int count = citDataPreviewService.exportTbMappingVerData2(paras, response);
if (count == 0) {
response.setStatus(SC_NO_CONTENT);
} else {
response.setStatus(SC_OK);
}
}
......
......@@ -28,14 +28,14 @@ public class CitReportController {
/**
* 获取CIT所有要生成的报表模板相关信息,
* 注意CIT不存在月份期间
* 注意CIT不存在月份期间,默认为0
* @param projectId
* @param serviceType
* @return
*/
@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) {
return citReportService.getReportTemplate(projectId, EnumServiceType.getEnumByCode(serviceType));
return citReportService.getReportTemplate(projectId, EnumServiceType.getEnumByCode(serviceType),0);
}
/**
......@@ -52,4 +52,9 @@ public class CitReportController {
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 {
public Boolean addOperationLog(VatOperationLog vatOperationLog) {
OperationLogDto operationLogDto = new OperationLogDto();
CommonUtils.copyProperties(vatOperationLog, operationLogDto);
operationLogService.addOperationLog(operationLogDto);
// operationLogService.addOperationLog(operationLogDto);
return true;
}
}
......@@ -113,7 +113,7 @@ public class CitReportServiceImpl extends BaseService {
@Autowired
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<>();
try {
Project project = projectMapper.selectByPrimaryKey(projectId);
......@@ -661,4 +661,24 @@ public class CitReportServiceImpl extends BaseService {
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;
import pwc.taxtech.atms.MyMapper;
import pwc.taxtech.atms.entity.CitEAMAssetsDisposal;
import pwc.taxtech.atms.entity.CitEAMAssetsDisposalExample;
import pwc.taxtech.atms.entity.CitSalaryAdvance;
@Mapper
public interface CitEAMAssetsDisposalMapper extends MyMapper {
......
......@@ -5,7 +5,6 @@ import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.session.RowBounds;
import pwc.taxtech.atms.MyMapper;
import pwc.taxtech.atms.entity.CitEAMAssetsDisposal;
import pwc.taxtech.atms.entity.CitSalaryAdvance;
import pwc.taxtech.atms.entity.CitSalaryAdvanceExample;
......
......@@ -15,14 +15,14 @@ function ($scope, $q, $log, $translate, $location, loginContext, enums, vatSessi
$scope.nodeDicKey = constant.DictionaryDictKey.DataImport;
$scope.linkShort = enums.linkShort.PreviewData;
$scope.menus = [
{
name: 'balanceSheet', permission: constant.citPermission.dataPreview.balanceSheet.queryCode,
text: $translate.instant('balanceSheet'), icon: 'fa fa-bank'
},
{
name: 'accountVoucher', permission: constant.citPermission.dataPreview.accountVoucher.queryCode,
text: $translate.instant('accountVoucher'), icon: 'fa fa-columns'
},
// {
// name: 'balanceSheet', permission: constant.citPermission.dataPreview.balanceSheet.queryCode,
// text: $translate.instant('balanceSheet'), icon: 'fa fa-bank'
// },
// {
// name: 'accountVoucher', permission: constant.citPermission.dataPreview.accountVoucher.queryCode,
// text: $translate.instant('accountVoucher'), icon: 'fa fa-columns'
// },
{
name: 'journalMerge', permission: constant.citPermission.dataPreview.journalMerge.queryCode,
text: $translate.instant('journal'), icon: 'fa fa-bank'
......
......@@ -252,7 +252,7 @@
SweetAlert.warning("没有数据可以下载");
return;
}
vatExportService.exportToExcel(data, status, headers, '日记账信息.xls');
vatExportService.exportToExcel(data, status, headers, '日记账信息.xlsx');
}).error(function () {
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