Commit 85911d18 authored by neo's avatar neo

[fixbug] fixed bugs for missed projectid and period

parent 15731d2b
...@@ -197,12 +197,12 @@ public class ReportServiceImpl extends VatAbstractService implements ReportServi ...@@ -197,12 +197,12 @@ public class ReportServiceImpl extends VatAbstractService implements ReportServi
} }
List<Long> exceptTemplateIds = templateMapper.getIdsForExceptTemplate(); List<Long> exceptTemplateIds = templateMapper.getIdsForExceptTemplate();
String strExceptTemplateIds = StringUtils.EMPTY; // String strExceptTemplateIds = StringUtils.EMPTY;
if (exceptTemplateIds != null && exceptTemplateIds.size() > 0) { // if (exceptTemplateIds != null && exceptTemplateIds.size() > 0) {
strExceptTemplateIds = StringUtils.join(exceptTemplateIds, ","); // strExceptTemplateIds = StringUtils.join(exceptTemplateIds, ",");
} else { // } else {
strExceptTemplateIds = "''"; // strExceptTemplateIds = "''";
} // }
//todo: according to projectId get the templateGroupId //todo: according to projectId get the templateGroupId
Long templateGroupId = projectMapper.getTemplateGroupIdByProject(projectId, EnumServiceType.VAT.getCode()); Long templateGroupId = projectMapper.getTemplateGroupIdByProject(projectId, EnumServiceType.VAT.getCode());
...@@ -494,7 +494,7 @@ public class ReportServiceImpl extends VatAbstractService implements ReportServi ...@@ -494,7 +494,7 @@ public class ReportServiceImpl extends VatAbstractService implements ReportServi
List<CellCalcInfoDto> cellCfgList = reportGenerator.getCellCalcInfo(templateIds, report.getPeriod(), project.getId()); List<CellCalcInfoDto> cellCfgList = reportGenerator.getCellCalcInfo(templateIds, report.getPeriod(), project.getId());
PeriodCellDataExample cellDataExample = new PeriodCellDataExample(); PeriodCellDataExample cellDataExample = new PeriodCellDataExample();
cellDataExample.createCriteria().andReportIdEqualTo(reportId); cellDataExample.createCriteria().andPeriodEqualTo(report.getPeriod()).andProjectIdEqualTo(projectId).andReportIdEqualTo(reportId);
List<PeriodCellData> currentCellDataList = periodCellDataMapper.selectByExample(cellDataExample); List<PeriodCellData> currentCellDataList = periodCellDataMapper.selectByExample(cellDataExample);
...@@ -794,6 +794,7 @@ public class ReportServiceImpl extends VatAbstractService implements ReportServi ...@@ -794,6 +794,7 @@ public class ReportServiceImpl extends VatAbstractService implements ReportServi
cellData.setUpdateBy("admin"); cellData.setUpdateBy("admin");
cellData.setUpdateTime(new Date()); cellData.setUpdateTime(new Date());
cellData.setProjectId(projectId); cellData.setProjectId(projectId);
cellData.setPeriod(data.getPeriod());
periodCellDataMapper.insertSelective(cellData); periodCellDataMapper.insertSelective(cellData);
data.setCellId(cellData.getId()); data.setCellId(cellData.getId());
} else { } else {
...@@ -937,6 +938,8 @@ public class ReportServiceImpl extends VatAbstractService implements ReportServi ...@@ -937,6 +938,8 @@ public class ReportServiceImpl extends VatAbstractService implements ReportServi
dataSource.setUpdateTime(new Date()); dataSource.setUpdateTime(new Date());
dataSource.setUpdateBy(datasourceDto.getUpdater()); dataSource.setUpdateBy(datasourceDto.getUpdater());
dataSource.setCreateBy(datasourceDto.getCreator()); dataSource.setCreateBy(datasourceDto.getCreator());
dataSource.setPeriod(datasourceDto.getPeriod());
dataSource.setProjectId(datasourceDto.getProjectId());
} }
dataSource.setCreateTime(new Date()); dataSource.setCreateTime(new Date());
periodDataSourceMapper.insertSelective(dataSource); periodDataSourceMapper.insertSelective(dataSource);
......
...@@ -10,7 +10,9 @@ import org.slf4j.LoggerFactory; ...@@ -10,7 +10,9 @@ import org.slf4j.LoggerFactory;
import pwc.taxtech.atms.common.util.SpringContextUtil; import pwc.taxtech.atms.common.util.SpringContextUtil;
import pwc.taxtech.atms.constant.enums.FormulaDataSourceDetailType; import pwc.taxtech.atms.constant.enums.FormulaDataSourceDetailType;
import pwc.taxtech.atms.constant.enums.FormulaDataSourceType; import pwc.taxtech.atms.constant.enums.FormulaDataSourceType;
import pwc.taxtech.atms.vat.entity.*; import pwc.taxtech.atms.vat.entity.PeriodDataSource;
import pwc.taxtech.atms.vat.entity.PeriodDataSourceDetail;
import pwc.taxtech.atms.vat.entity.PeriodFormulaBlock;
import pwc.taxtech.atms.vat.service.impl.FormulaAgent; import pwc.taxtech.atms.vat.service.impl.FormulaAgent;
import java.math.BigDecimal; import java.math.BigDecimal;
...@@ -91,13 +93,13 @@ public class FunctionBase { ...@@ -91,13 +93,13 @@ public class FunctionBase {
} }
public Long saveDataSource(OperationEvaluationContext ec, List<Object> dataSourceList, public Long saveDataSource(OperationEvaluationContext ec, List<Object> dataSourceList,
FormulaDataSourceDetailType formulaDataSourceDetailType, BigDecimal val, int period, Long templateGroupId) { FormulaDataSourceDetailType formulaDataSourceDetailType, BigDecimal val, int period, Long templateGroupId, String projectId) {
return saveDataSource(ec, dataSourceList, formulaDataSourceDetailType, val, period, templateGroupId, null, null); return saveDataSource(ec, dataSourceList, formulaDataSourceDetailType, val, period, templateGroupId, null, null, projectId);
} }
public Long saveDataSource(OperationEvaluationContext ec, List<Object> dataSourceList, public Long saveDataSource(OperationEvaluationContext ec, List<Object> dataSourceList,
FormulaDataSourceDetailType formulaDataSourceDetailType, BigDecimal val, FormulaDataSourceDetailType formulaDataSourceDetailType, BigDecimal val,
int period, Long templateGroupId, Integer colNumP, Integer rowNumP) { int period, Long templateGroupId, Integer colNumP, Integer rowNumP, String projectId) {
String reportCode = ec.getWorkbook().getSheetName(ec.getSheetIndex()); String reportCode = ec.getWorkbook().getSheetName(ec.getSheetIndex());
int colNum = ec.getColumnIndex(); int colNum = ec.getColumnIndex();
int rowNum = ec.getRowIndex(); int rowNum = ec.getRowIndex();
...@@ -128,15 +130,18 @@ public class FunctionBase { ...@@ -128,15 +130,18 @@ public class FunctionBase {
dataSource.setColumnName("列名"); dataSource.setColumnName("列名");
dataSource.setCellTemplateId(periodCellTemplateId); dataSource.setCellTemplateId(periodCellTemplateId);
dataSource.setPeriod(period); dataSource.setPeriod(period);
dataSource.setProjectId(projectId);
SpringContextUtil.periodDataSourceMapper.insertSelective(dataSource); SpringContextUtil.periodDataSourceMapper.insertSelective(dataSource);
for (Object obj : dataSourceList) { for (Object obj : dataSourceList) {
if (obj.getClass()==java.util.ArrayList.class) { if (obj.getClass() == java.util.ArrayList.class) {
for (Object obj2 : (ArrayList<Object>)obj) { for (Object obj2 : (ArrayList<Object>) obj) {
PeriodDataSourceDetail dataSourceDetail = new PeriodDataSourceDetail(); PeriodDataSourceDetail dataSourceDetail = new PeriodDataSourceDetail();
dataSourceDetail.setId(SpringContextUtil.distributedIdService.nextId()); dataSourceDetail.setId(SpringContextUtil.distributedIdService.nextId());
dataSourceDetail.setDataSourceId(dataSourceId); dataSourceDetail.setDataSourceId(dataSourceId);
dataSourceDetail.setDataSourceType(formulaDataSourceDetailType.getCode()); dataSourceDetail.setDataSourceType(formulaDataSourceDetailType.getCode());
dataSourceDetail.setItemValue(JSON.toJSONString(obj2)); dataSourceDetail.setItemValue(JSON.toJSONString(obj2));
dataSourceDetail.setPeriod(period);
dataSourceDetail.setProjectId(projectId);
SpringContextUtil.periodDataSourceDetailMapper.insertSelective(dataSourceDetail); SpringContextUtil.periodDataSourceDetailMapper.insertSelective(dataSourceDetail);
} }
} else { } else {
...@@ -145,6 +150,8 @@ public class FunctionBase { ...@@ -145,6 +150,8 @@ public class FunctionBase {
dataSourceDetail.setDataSourceId(dataSourceId); dataSourceDetail.setDataSourceId(dataSourceId);
dataSourceDetail.setDataSourceType(formulaDataSourceDetailType.getCode()); dataSourceDetail.setDataSourceType(formulaDataSourceDetailType.getCode());
dataSourceDetail.setItemValue(JSON.toJSONString(obj)); dataSourceDetail.setItemValue(JSON.toJSONString(obj));
dataSourceDetail.setPeriod(period);
dataSourceDetail.setProjectId(projectId);
SpringContextUtil.periodDataSourceDetailMapper.insertSelective(dataSourceDetail); SpringContextUtil.periodDataSourceDetailMapper.insertSelective(dataSourceDetail);
} }
} }
......
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