Commit 4d7c9711 authored by gary's avatar gary

1、科目余额表、资产负债表、利润表、日记账 数据预览、条件查询及导出

parent 3f5ea0b4
......@@ -41,7 +41,7 @@ public class DataImportController extends BaseController {
@PostMapping("queryGlBalance")
public ApiResultDto queryGlBalance(@RequestBody TrialBalanceParam param) {
ApiResultDto resultDto = new ApiResultDto();
lgGlBalanceService.queryGlBalance(param.getOrgId(), param.getFromPeriod(), param.getToPeriod());
lgGlBalanceService.queryGlBalance(param.getOrgId(), param.getPeriodStart(), param.getPeriodEnd());
return resultDto;
}
}
......@@ -3,14 +3,26 @@ package pwc.taxtech.atms.controller;
import com.alibaba.fastjson.JSON;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import pwc.taxtech.atms.dto.vatdto.BalanceSheetParam;
import pwc.taxtech.atms.dto.vatdto.JournalEntryParam;
import pwc.taxtech.atms.dto.vatdto.ProfitLossStatementParam;
import pwc.taxtech.atms.dto.vatdto.dd.BalanceSheetDto;
import pwc.taxtech.atms.dto.vatdto.dd.JournalEntryDto;
import pwc.taxtech.atms.dto.vatdto.dd.ProfitLossStatementDto;
import pwc.taxtech.atms.dto.vatdto.dd.TrialBalanceDto;
import pwc.taxtech.atms.dto.vatdto.TrialBalanceParam;
import pwc.taxtech.atms.service.impl.DataPreviewSerivceImpl;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.OutputStream;
import java.util.UUID;
import static javax.servlet.http.HttpServletResponse.SC_NO_CONTENT;
import static javax.servlet.http.HttpServletResponse.SC_OK;
@RestController
@RequestMapping("/api/v1/dataPreview/")
public class DataPreviewController extends BaseController {
......@@ -23,4 +35,118 @@ public class DataPreviewController extends BaseController {
logger.debug(String.format("科目余额查询 Condition:%s", JSON.toJSONString(param)));
return dataPreviewSerivceImpl.getTBDataForDisplay(param);
}
@PostMapping("getPLDataForDisplay")
public PageInfo<ProfitLossStatementDto> getPLDataForDisplay(@RequestBody ProfitLossStatementParam param) {
logger.debug(String.format("利润表查询 Condition:%s", JSON.toJSONString(param)));
return dataPreviewSerivceImpl.getPLDataForDisplay(param);
}
@PostMapping("getJEDataForDisplay")
public PageInfo<JournalEntryDto> getJEDataForDisplay(@RequestBody JournalEntryParam param) {
logger.debug(String.format("日记账查询 Condition:%s", JSON.toJSONString(param)));
return dataPreviewSerivceImpl.getJEDataForDisplay(param);
}
@PostMapping("getBSDataForDisplay")
public PageInfo<BalanceSheetDto> getBSDataForDisplay(@RequestBody BalanceSheetParam param) {
logger.debug(String.format("资产负债表查询 Condition:%s", JSON.toJSONString(param)));
return dataPreviewSerivceImpl.getBSDataForDisplay(param);
}
@RequestMapping(value = "exportTBData/get", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public void downloadTBQueryData(@RequestBody TrialBalanceParam 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 = dataPreviewSerivceImpl.getTBDownloadFilePath(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()));
}
}
@RequestMapping(value = "exportJEData/get", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public void downloadJEQueryData(@RequestBody JournalEntryParam 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 = dataPreviewSerivceImpl.getJEDownloadFilePath(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()));
}
}
@RequestMapping(value = "exportBSData/get", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public void downloadBSQueryData(@RequestBody BalanceSheetParam 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 = dataPreviewSerivceImpl.getBSDownloadFilePath(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()));
}
}
@RequestMapping(value = "exportPLData/get", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public void downloadPLQueryData(@RequestBody ProfitLossStatementParam 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 = dataPreviewSerivceImpl.getPLDownloadFilePath(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()));
}
}
}
package pwc.taxtech.atms.dto.vatdto;
import pwc.taxtech.atms.dpo.PagingDto;
public class BalanceSheetParam {
private PagingDto pageInfo;
private String orgId;
private Integer periodStart;
private Integer periodEnd;
public Integer getPeriodStart() {
return periodStart;
}
public void setPeriodStart(Integer periodStart) {
this.periodStart = periodStart;
}
public Integer getPeriodEnd() {
return periodEnd;
}
public void setPeriodEnd(Integer periodEnd) {
this.periodEnd = periodEnd;
}
public String getOrgId() {
return this.orgId;
}
public void setOrgId(String orgId) {
this.orgId = orgId;
}
public PagingDto getPageInfo() {
return pageInfo;
}
public void setPageInfo(PagingDto pageInfo) {
this.pageInfo = pageInfo;
}
}
package pwc.taxtech.atms.dto.vatdto;
import pwc.taxtech.atms.dpo.PagingDto;
public class JournalEntryParam {
private PagingDto pageInfo;
private String orgId;
private Integer periodStart;
private Integer periodEnd;
private String segment3;
private String segment3Name;
private String segment5;
private String segment5Name;
private String segment6;
private String segment6Name;
private String description;
private Boolean containsAdjustmentRecord;
public Integer getPeriodStart() {
return periodStart;
}
public void setPeriodStart(Integer periodStart) {
this.periodStart = periodStart;
}
public Integer getPeriodEnd() {
return periodEnd;
}
public void setPeriodEnd(Integer periodEnd) {
this.periodEnd = periodEnd;
}
public String getOrgId() {
return this.orgId;
}
public void setOrgId(String orgId) {
this.orgId = orgId;
}
public PagingDto getPageInfo() {
return pageInfo;
}
public void setPageInfo(PagingDto pageInfo) {
this.pageInfo = pageInfo;
}
public String getSegment3() {
return segment3;
}
public void setSegment3(String segment3) {
this.segment3 = segment3;
}
public String getSegment3Name() {
return segment3Name;
}
public void setSegment3Name(String segment3Name) {
this.segment3Name = segment3Name;
}
public String getSegment5() {
return segment5;
}
public void setSegment5(String segment5) {
this.segment5 = segment5;
}
public String getSegment5Name() {
return segment5Name;
}
public void setSegment5Name(String segment5Name) {
this.segment5Name = segment5Name;
}
public String getSegment6() {
return segment6;
}
public void setSegment6(String segment6) {
this.segment6 = segment6;
}
public String getSegment6Name() {
return segment6Name;
}
public void setSegment6Name(String segment6Name) {
this.segment6Name = segment6Name;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public Boolean getContainsAdjustmentRecord() {
return containsAdjustmentRecord;
}
public void setContainsAdjustmentRecord(Boolean containsAdjustmentRecord) {
this.containsAdjustmentRecord = containsAdjustmentRecord;
}
}
package pwc.taxtech.atms.dto.vatdto;
import pwc.taxtech.atms.dpo.PagingDto;
public class ProfitLossStatementParam {
private PagingDto pageInfo;
private String orgId;
private Integer periodStart;
private Integer periodEnd;
public Integer getPeriodStart() {
return periodStart;
}
public void setPeriodStart(Integer periodStart) {
this.periodStart = periodStart;
}
public Integer getPeriodEnd() {
return periodEnd;
}
public void setPeriodEnd(Integer periodEnd) {
this.periodEnd = periodEnd;
}
public String getOrgId() {
return this.orgId;
}
public void setOrgId(String orgId) {
this.orgId = orgId;
}
public PagingDto getPageInfo() {
return pageInfo;
}
public void setPageInfo(PagingDto pageInfo) {
this.pageInfo = pageInfo;
}
}
......@@ -8,24 +8,38 @@ public class TrialBalanceParam {
private String orgId;
private Integer fromPeriod;
private Integer periodStart;
private Integer toPeriod;
private Integer periodEnd;
public Integer getFromPeriod() {
return this.fromPeriod;
private String segment2;
private String segment2Name;
private String segment3;
private String segment3Name;
private String segment6;
private String segment6Name;
private Boolean containsAdjustmentTable;
public Integer getPeriodStart() {
return periodStart;
}
public void setFromPeriod(Integer fromPeriod) {
this.fromPeriod = fromPeriod;
public void setPeriodStart(Integer periodStart) {
this.periodStart = periodStart;
}
public Integer getToPeriod() {
return this.toPeriod;
public Integer getPeriodEnd() {
return periodEnd;
}
public void setToPeriod(Integer toPeriod) {
this.toPeriod = toPeriod;
public void setPeriodEnd(Integer periodEnd) {
this.periodEnd = periodEnd;
}
public String getOrgId() {
......@@ -43,4 +57,60 @@ public class TrialBalanceParam {
public void setPageInfo(PagingDto pageInfo) {
this.pageInfo = pageInfo;
}
public String getSegment2() {
return segment2;
}
public void setSegment2(String segment2) {
this.segment2 = segment2;
}
public String getSegment2Name() {
return segment2Name;
}
public void setSegment2Name(String segment2Name) {
this.segment2Name = segment2Name;
}
public String getSegment3() {
return segment3;
}
public void setSegment3(String segment3) {
this.segment3 = segment3;
}
public String getSegment3Name() {
return segment3Name;
}
public void setSegment3Name(String segment3Name) {
this.segment3Name = segment3Name;
}
public String getSegment6() {
return segment6;
}
public void setSegment6(String segment6) {
this.segment6 = segment6;
}
public String getSegment6Name() {
return segment6Name;
}
public void setSegment6Name(String segment6Name) {
this.segment6Name = segment6Name;
}
public Boolean getContainsAdjustmentTable() {
return containsAdjustmentTable;
}
public void setContainsAdjustmentTable(Boolean containsAdjustmentTable) {
this.containsAdjustmentTable = containsAdjustmentTable;
}
}
package pwc.taxtech.atms.dto.vatdto.dd;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import pwc.taxtech.atms.common.util.PwCIdSerialize;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
......@@ -13,6 +16,7 @@ import java.util.Date;
*/
public class TrialBalanceDto implements Serializable {
@JsonSerialize(using = PwCIdSerialize.class)
private Long id;
private String organizationId;
......
......@@ -46,7 +46,7 @@ public class DataImportService extends BaseService {
* @return List<TrialBalanceDto>
*/
public List<TrialBalanceDto> getBalanceDataForDisplay(TrialBalanceParam param) {
if (!ObjectUtils.allNotNull(param, param.getFromPeriod(), param.getToPeriod()) || StringUtils.isBlank(param.getOrgId())) {
if (!ObjectUtils.allNotNull(param, param.getPeriodStart(), param.getPeriodEnd()) || StringUtils.isBlank(param.getOrgId())) {
return Collections.emptyList();
}
Organization organization = organizationMapper.selectByPrimaryKey(param.getOrgId());
......@@ -69,7 +69,7 @@ public class DataImportService extends BaseService {
Calendar calendar = Calendar.getInstance();
SimpleDateFormat dateFormat = new SimpleDateFormat(Constant.DateFormat.YEAR_MONTH);
Map<String, TrialBalanceDto> resultStdMap = new HashMap<>();
for (int i = param.getFromPeriod(); i <= param.getToPeriod(); i++) {
for (int i = param.getPeriodStart(); i <= param.getPeriodEnd(); i++) {
calendar.set(Calendar.MONTH, i - 1);
GlBalanceExample example = new GlBalanceExample();
//科目段
......
......@@ -3159,8 +3159,8 @@ public class OrganizationServiceImpl {
header.put("IssuedShares","Issued shares");
header.put("Directors","Directors");
header.put("OtherFacts","其他情况说明");
header.put("LogoutTime","注销时间");
header.put("TaxRuleIntroduction","税制简介");
header.put("AuditRequirements","审计简介");
return header;
}
}
@import "~/app-resources/less/theme.less";
.vat-preview-income-statement {
.vat-preview-journal {
background-color: white;
height: 100%;
......
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