Commit aa1a4474 authored by eddie.woo's avatar eddie.woo

Merge branch 'dev_mysql' of http://code.tech.tax.asia.pwcinternal.com/root/atms into dev_mysql

parents 23275658 86e861e2
package pwc.taxtech.atms.common;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.ss.util.CellRangeAddress;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.Iterator;
import java.util.List;
import java.util.Optional;
public class POIUtil {
......@@ -88,6 +91,13 @@ public class POIUtil {
}
public static void cloneSheetAndStyle(Sheet sheet, Sheet targetSheet,Workbook tWorkbook) {
//设置合并单元格
List<CellRangeAddress> merges = sheet.getMergedRegions();
if(CollectionUtils.isNotEmpty(merges)){
for(CellRangeAddress merge : merges){
targetSheet.addMergedRegion(merge);
}
}
for (int r = sheet.getFirstRowNum(); r <= sheet.getLastRowNum(); r++) {
Row row = sheet.getRow(r);
if (null == row) {
......
......@@ -1808,10 +1808,11 @@ public class ReportServiceImpl extends BaseService {
cellData.setFormulaExp(data.getKeyinData());
periodCellDataMapper.updateByPrimaryKeySelective(cellData);
} else if (data.getAmount() != null && cellData.getData() != data.getAmount().toString()) {
cellData.setData(data.getAmount().toString());
if (StringUtils.isEmpty(cellData.getFormulaExp()))
cellData.setFormulaExp(data.getAmount().toString());
periodCellDataMapper.updateByPrimaryKeySelective(cellData);
//TODO Eddie确认逻辑
// cellData.setData(data.getAmount().toString());
// if (StringUtils.isEmpty(cellData.getFormulaExp()))
// cellData.setFormulaExp(data.getAmount().toString());
// periodCellDataMapper.updateByPrimaryKeySelective(cellData);
}
}
......
......@@ -113,7 +113,7 @@
<select id = "selectReportData" resultType="pwc.taxtech.atms.dpo.AnalysisSalesValueDto">
select cell_template.row_index as rowIndex,
cell_template.column_index as columnIndex,
concat(CONVERT(cell_data.data, decimal(18, 4)) + if(data_source.amount is null, 0, data_source.amount)) as data
concat(CONVERT(cell_data.data, decimal(18, 2)) + if(data_source.amount is null, 0, data_source.amount)) as data
from period_cell_data cell_data
left join period_cell_template cell_template
on cell_data.cell_template_id = cell_template.cell_template_id
......
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