Commit f561e220 authored by Memorydoc's avatar Memorydoc

#

parent ad1615a4
...@@ -443,20 +443,30 @@ ...@@ -443,20 +443,30 @@
<profiles> <profiles>
<profile> <profile>
<id>dev</id> <id>dev</id>
<build>
<filters>
<filter>src/main/resources/conf/conf_profile_dev.properties</filter>
</filters>
</build>
<properties>
<env>dev</env>
</properties>
</profile>
<profile>
<id>local</id>
<activation> <activation>
<activeByDefault>true</activeByDefault> <activeByDefault>true</activeByDefault>
</activation> </activation>
<build> <build>
<filters> <filters>
<filter>src/main/resources/conf/conf_profile_dev.properties</filter> <filter>src/main/resources/conf/conf_profile_dev_local.properties</filter>
</filters> </filters>
</build> </build>
<properties> <properties>
<env>dev</env> <env>dev</env>
</properties> </properties>
</profile> </profile>
<profile> <profile>
<id>staging</id> <id>staging</id>
<build> <build>
...@@ -617,7 +627,7 @@ ...@@ -617,7 +627,7 @@
</dependencies> </dependencies>
</plugin> </plugin>
<!-- See: https://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner+for+Maven --> <!-- See: https://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner+for+Maven -->
<plugin> <plugin>ll
<groupId>org.sonarsource.scanner.maven</groupId> <groupId>org.sonarsource.scanner.maven</groupId>
<artifactId>sonar-maven-plugin</artifactId> <artifactId>sonar-maven-plugin</artifactId>
<version>3.4.0.905</version> <version>3.4.0.905</version>
......
...@@ -8,6 +8,7 @@ import com.fasterxml.jackson.databind.SerializerProvider; ...@@ -8,6 +8,7 @@ import com.fasterxml.jackson.databind.SerializerProvider;
import java.io.IOException; import java.io.IOException;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.RoundingMode;
import java.text.NumberFormat; import java.text.NumberFormat;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Date; import java.util.Date;
...@@ -19,11 +20,13 @@ import java.util.Locale; ...@@ -19,11 +20,13 @@ import java.util.Locale;
* version 1.0 * version 1.0
*/ */
public class ThousandConvert extends JsonSerializer<BigDecimal> { public class ThousandConvert extends JsonSerializer<BigDecimal> {
@Override @Override
public void serialize(BigDecimal value, JsonGenerator jgen, SerializerProvider arg2) public void serialize(BigDecimal value, JsonGenerator jgen, SerializerProvider arg2)
throws IOException { throws IOException {
jgen.writeString(NumberFormat.getIntegerInstance(Locale.getDefault()).format(value)); NumberFormat integerInstance = NumberFormat.getIntegerInstance(Locale.getDefault());
integerInstance.setMinimumFractionDigits(2);
integerInstance.setRoundingMode(RoundingMode.HALF_UP);
integerInstance.setGroupingUsed(true);
jgen.writeString(integerInstance.format(value));
} }
} }
package pwc.taxtech.atms.dto.analysis; package pwc.taxtech.atms.dto.analysis;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import pwc.taxtech.atms.common.ThousandConvert;
import java.math.BigDecimal; import java.math.BigDecimal;
/** /**
...@@ -10,15 +13,19 @@ import java.math.BigDecimal; ...@@ -10,15 +13,19 @@ import java.math.BigDecimal;
public class AnalysisActualTaxReturnDto { public class AnalysisActualTaxReturnDto {
private String companyName; private String companyName;
@JsonSerialize(using = ThousandConvert.class)
private BigDecimal segment1; private BigDecimal segment1;
@JsonSerialize(using = ThousandConvert.class)
private BigDecimal segment2; private BigDecimal segment2;
@JsonSerialize(using = ThousandConvert.class)
private BigDecimal segment3; private BigDecimal segment3;
@JsonSerialize(using = ThousandConvert.class)
private BigDecimal segment4; private BigDecimal segment4;
@JsonSerialize(using = ThousandConvert.class)
private BigDecimal segment5; private BigDecimal segment5;
public String getCompanyName() { public String getCompanyName() {
......
package pwc.taxtech.atms.dto.analysis; package pwc.taxtech.atms.dto.analysis;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import pwc.taxtech.atms.common.ThousandConvert;
import java.math.BigDecimal; import java.math.BigDecimal;
/** /**
...@@ -11,6 +14,7 @@ public class AnalysisDriverNumDto { ...@@ -11,6 +14,7 @@ public class AnalysisDriverNumDto {
private String driverType; private String driverType;
@JsonSerialize(using = ThousandConvert.class)
private BigDecimal driverNum; private BigDecimal driverNum;
public String getDriverType() { public String getDriverType() {
......
package pwc.taxtech.atms.dto.vatdto; package pwc.taxtech.atms.dto.vatdto;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import pwc.taxtech.atms.common.ThousandConvert;
import java.math.BigDecimal; import java.math.BigDecimal;
/** /**
...@@ -10,11 +13,16 @@ import java.math.BigDecimal; ...@@ -10,11 +13,16 @@ import java.math.BigDecimal;
* Version 1.0 * Version 1.0
**/ **/
public class EbitDataDto { public class EbitDataDto {
@JsonSerialize(using = ThousandConvert.class)
private BigDecimal ebitSubtraction; // 1. EBIT(考虑资产减值损失) private BigDecimal ebitSubtraction; // 1. EBIT(考虑资产减值损失)
@JsonSerialize(using = ThousandConvert.class)
private BigDecimal specialFactors; //考虑特殊因素 private BigDecimal specialFactors; //考虑特殊因素
private String ebitRate;// ebit比率 默认1%(可更改) private String ebitRate;// ebit比率 默认1%(可更改)
@JsonSerialize(using = ThousandConvert.class)
private BigDecimal transactionAmount; //关联交易金额 private BigDecimal transactionAmount; //关联交易金额
@JsonSerialize(using = ThousandConvert.class)
private BigDecimal sixAddTax; //6%增值税 private BigDecimal sixAddTax; //6%增值税
@JsonSerialize(using = ThousandConvert.class)
private BigDecimal totalAmountTax;// 价税合计金额 private BigDecimal totalAmountTax;// 价税合计金额
private String specialConsiderations;//特殊因素考虑 private String specialConsiderations;//特殊因素考虑
public String getSpecialConsiderations() { public String getSpecialConsiderations() {
...@@ -26,8 +34,6 @@ public class EbitDataDto { ...@@ -26,8 +34,6 @@ public class EbitDataDto {
} }
public BigDecimal getEbitSubtraction() { public BigDecimal getEbitSubtraction() {
return ebitSubtraction; return ebitSubtraction;
} }
......
...@@ -56,6 +56,7 @@ import javax.servlet.http.HttpServletRequest; ...@@ -56,6 +56,7 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.*; import java.io.*;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.text.NumberFormat;
import java.util.*; import java.util.*;
import java.util.concurrent.BlockingQueue; import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.LinkedBlockingQueue;
...@@ -1307,6 +1308,7 @@ public class ReportServiceImpl extends BaseService { ...@@ -1307,6 +1308,7 @@ public class ReportServiceImpl extends BaseService {
CellDataDto cellDataDto = null; CellDataDto cellDataDto = null;
CellDataDto cellDataDto1 = null; CellDataDto cellDataDto1 = null;
for (int i = 0; i < list.size(); i++) { for (int i = 0; i < list.size(); i++) {
if(i >=23) continue;//过滤掉多余数据
cellDataDto = new CellDataDto(); cellDataDto = new CellDataDto();
cellDataDto1 = new CellDataDto(); cellDataDto1 = new CellDataDto();
if (list.get(i).getItemName().equals("")) if (list.get(i).getItemName().equals(""))
...@@ -2517,38 +2519,6 @@ public class ReportServiceImpl extends BaseService { ...@@ -2517,38 +2519,6 @@ public class ReportServiceImpl extends BaseService {
} }
@Transactional
public void saveDatasource(String orgId, Integer period, Integer specialConsiderations, String ebitRate,
OperationResultDto<ReportDataDto> operationResultDto,
List<CellDataDto> cellDataList) {
EbitCellDataExample example = null;
List<EbitCellData> ebitCellDataList = new ArrayList<>();
for (int i = 37; i <= 43; i++) {
example = new EbitCellDataExample();
EbitCellDataExample.Criteria criteria = example.createCriteria();
criteria.andOrganizationIdEqualTo(orgId).andPeriodEqualTo(period).andColEqualTo(1).andRowEqualTo(i);
List<EbitCellData> ebitCellData = ebitCellDataMapper.selectByExample(example);
if (ebitCellData.size() == 0) {
for (CellDataDto cellDataDto : cellDataList) {
EbitCellData ebitCellData1 = new EbitCellData();
ebitCellData1.setId(idService.nextId());
ebitCellData1.setOrganizationId(orgId);
ebitCellData1.setPeriod(period);
ebitCellData1.setCreateTime(new Date());
ebitCellData1.setCol(cellDataDto.getColumnIndex());
ebitCellData1.setRow(cellDataDto.getRowIndex());
ebitCellData1.setData(cellDataDto.getCellValue());
ebitCellDataList.add(ebitCellData1);
}
ebitCellDataList.add(switchMeth(i, new EbitCellData(), operationResultDto, specialConsiderations, ebitRate, orgId, period));
ebitCellDataMapper.insertBatch(ebitCellDataList);
} else {
ebitCellDataMapper.updateByExampleSelective(switchMeth(i, new EbitCellData(), operationResultDto, specialConsiderations, ebitRate, orgId, period), example);
}
}
}
private EbitCellData switchMeth(Integer i, EbitCellData ebitCellData1, OperationResultDto<ReportDataDto> operationResultDto, Integer specialConsiderations, String ebitRate, String orgId, Integer period) { private EbitCellData switchMeth(Integer i, EbitCellData ebitCellData1, OperationResultDto<ReportDataDto> operationResultDto, Integer specialConsiderations, String ebitRate, String orgId, Integer period) {
switch (i) { switch (i) {
case 37: case 37:
...@@ -2668,6 +2638,7 @@ public class ReportServiceImpl extends BaseService { ...@@ -2668,6 +2638,7 @@ public class ReportServiceImpl extends BaseService {
@Autowired @Autowired
private JdbcTemplate jdbcTemplate; private JdbcTemplate jdbcTemplate;
private CellStyle cellStyle1 = null; private CellStyle cellStyle1 = null;
private static final String EBITTemplateCode = "VAT10086";
/** /**
* 批量导出Excel ebit利润表 * 批量导出Excel ebit利润表
...@@ -2682,7 +2653,7 @@ public class ReportServiceImpl extends BaseService { ...@@ -2682,7 +2653,7 @@ public class ReportServiceImpl extends BaseService {
File templateFile; File templateFile;
InputStream inputStream = null; InputStream inputStream = null;
TemplateExample templateExample = new TemplateExample(); TemplateExample templateExample = new TemplateExample();
templateExample.createCriteria().andCodeEqualTo("VAT10086").andNameEqualTo("VAT10086");//todo 这里是利润表模板的固定code,禁止重复 templateExample.createCriteria().andCodeEqualTo(EBITTemplateCode).andNameEqualTo(EBITTemplateCode);//todo 这里是利润表模板的固定code,禁止重复
List<Template> templates1 = templateMapper.selectByExample(templateExample); List<Template> templates1 = templateMapper.selectByExample(templateExample);
if (templates1.size() == 0) if (templates1.size() == 0)
throw new Exception("没有利润表模板,无法批量导出,请上传模板"); throw new Exception("没有利润表模板,无法批量导出,请上传模板");
...@@ -2882,7 +2853,9 @@ public class ReportServiceImpl extends BaseService { ...@@ -2882,7 +2853,9 @@ public class ReportServiceImpl extends BaseService {
sheetAt.getRow(row).getCell(col).setCellStyle(cellStyle1); sheetAt.getRow(row).getCell(col).setCellStyle(cellStyle1);
return sheetAt.getRow(row).getCell(col); return sheetAt.getRow(row).getCell(col);
} }
private static final String headerEbitTitle = "汇总利润表"; private static final String headerEbitTitle = "汇总利润表";
public void insertExcelOne(CellStyle headerCellType, XSSFWorkbook workbook1, Sheet sheetAt, Integer _index, RequestParameterDto requestParameterDto) { public void insertExcelOne(CellStyle headerCellType, XSSFWorkbook workbook1, Sheet sheetAt, Integer _index, RequestParameterDto requestParameterDto) {
headerCellType.setVerticalAlignment(VerticalAlignment.CENTER);// 垂直 headerCellType.setVerticalAlignment(VerticalAlignment.CENTER);// 垂直
headerCellType.setAlignment(HorizontalAlignment.CENTER);// 水平 headerCellType.setAlignment(HorizontalAlignment.CENTER);// 水平
...@@ -2946,7 +2919,7 @@ public class ReportServiceImpl extends BaseService { ...@@ -2946,7 +2919,7 @@ public class ReportServiceImpl extends BaseService {
//获取利润表模板Id 利润表固定模板VAT10086 //获取利润表模板Id 利润表固定模板VAT10086
public String getlxbId() throws Exception { public String getlxbId() throws Exception {
try { try {
String sql = "select * from template t where t.name = 'VAT10086' order by t.create_time desc "; String sql = "select * from template t where t.name = '" + EBITTemplateCode + "' order by t.create_time desc ";
Map<String, Object> stringObjectMap = new HashMap<>(); Map<String, Object> stringObjectMap = new HashMap<>();
stringObjectMap = jdbcTemplate.queryForList(sql).get(0); stringObjectMap = jdbcTemplate.queryForList(sql).get(0);
return stringObjectMap.get("id").toString(); return stringObjectMap.get("id").toString();
......
...@@ -3,6 +3,8 @@ package pwc.taxtech.atms.analysis.entity; ...@@ -3,6 +3,8 @@ package pwc.taxtech.atms.analysis.entity;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import pwc.taxtech.atms.entity.BaseEntity; import pwc.taxtech.atms.entity.BaseEntity;
/** /**
......
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