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