Commit 72af8cf9 authored by sherlock's avatar sherlock

Merge branch 'dev_oracle_sherlock' into 'dev_oracle'

添加报表未取到公式

See merge request root/atms!174
parents 656b3165 c28f4dd6
......@@ -137,7 +137,7 @@ public class TemplateController extends BaseController {
@RequestMapping(value = "getTemplateUniqList", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public @ResponseBody
List<TemplateUniqDto> getTemplateUniqList(String serviceTypeId, Integer payTaxType, Integer reportType, String industryIds) {
List<TemplateUniqDto> getTemplateUniqList(@RequestParam(value = "serviceTypeID") String serviceTypeId, Integer payTaxType, Integer reportType, @RequestParam(value = "industryIDs") String industryIds) {
return templateService.getTemplateUniqList(serviceTypeId, payTaxType, reportType, industryIds);
}
......
......@@ -356,16 +356,19 @@ public class TemplateGroupServiceImpl extends AbstractService {
cellTemplate.setIsReadOnly(cell.getCellStyle().getLocked() ? true : false);
cellTemplateList.add(cellTemplate);
//todo: 这里没有Config数据只有在上传模板以后,在界面里面可以配置公式
// CellTemplateConfig config = new CellTemplateConfig();
// config.setId(distributedIdService.nextId());
// config.setCellTemplateId(cellTemplate.getId());
// config.setReportTemplateId(template.getId());
// config.setDataSourceType(1);//todo 枚举
// config.setFormula(POIUtil.getCellFormulaString(cell));
//// config.setFormulaDataSource(); //todo KV相关
// config.setUpdateTime(now);
// config.setUpdateBy(authUserHelper.getCurrentUserId());
// cellTemplateConfigList.add(config);
if(!cell.getCellStyle().getLocked() && StringUtils.isNotBlank(POIUtil.getCellFormulaString(cell))) {
CellTemplateConfig config = new CellTemplateConfig();
config.setId(distributedIdService.nextId());
config.setCellTemplateId(cellTemplate.getId());
config.setReportTemplateId(template.getId());
config.setDataSourceType(1);//todo 枚举
config.setFormula(POIUtil.getCellFormulaString(cell));
// config.setFormula(cell.getCellFormula());
// config.setFormulaDataSource(); //todo KV相关
config.setUpdateTime(now);
config.setUpdateBy(authUserHelper.getCurrentUserId());
cellTemplateConfigList.add(config);
}
}
}
List<List<CellTemplate>> tmpList = CommonUtils.subListWithLen(cellTemplateList, CommonUtils.BATCH_NUM);
......
......@@ -85,7 +85,7 @@ public class TemplateServiceImpl extends AbstractService {
map.put("serviceTypeId", serviceTypeId);
map.put("payTaxType", payTaxType);
map.put("reportType", reportType);
map.put("industryIds", industryIds);
map.put("industryID", industryIds);
List<TemplateUniqDto> templatedbList = templateMapper.getTemplateUniqDtosByTemplateAndTemplateGroup(map);
Map<Long, Map<String, List<TemplateUniqDto>>> groupList = templatedbList.stream()
......
......@@ -222,30 +222,30 @@ public class ReportGeneratorImpl {
.collect(Collectors.toList());
//todo: add manual datasource here,in order to disaplay the manual datasource we need add it first at here.
// for (PeriodCellTemplateConfig keyInCellTemplateConfig : keyInCellTemplateConfigs) {
// PeriodCellTemplateExample periodCellTemplateExample1 = new PeriodCellTemplateExample();
// periodCellTemplateExample1.createCriteria().andCellTemplateIdEqualTo(keyInCellTemplateConfig.getCellTemplateId());
// Optional<PeriodCellTemplate> periodCellTemplate = periodCellTemplateMapper.selectByExample(periodCellTemplateExample1).stream().findFirst();
//
//
// DataSource dataSource = new DataSource();
// dataSource.setId(distributedIdService.nextId());
// if (periodCellTemplate.isPresent()) {
// dataSource.setColumnIndex(periodCellTemplate.get().getColumnIndex());
// dataSource.setRowIndex(periodCellTemplate.get().getRowIndex());
// }
// dataSource.setAmount(new BigDecimal("0"));
// dataSource.setName("ManualDataSource");
// dataSource.setDescription("ManualDataSource");
// dataSource.setCreateTime(createTime);
// dataSource.setUpdateTime(createTime);
// dataSource.setCreateBy("Admin");
// dataSource.setUpdateBy("Admin");
// dataSource.setPeriod(period);
// dataSource.setCellTemplateId(keyInCellTemplateConfig.getCellTemplateId());
// dataSource.setType(FormulaDataSourceType.KeyInSource.getCode());
// dataSourceMapper.insertSelective(dataSource);
// }
for (PeriodCellTemplateConfig keyInCellTemplateConfig : keyInCellTemplateConfigs) {
PeriodCellTemplateExample periodCellTemplateExample1 = new PeriodCellTemplateExample();
periodCellTemplateExample1.createCriteria().andCellTemplateIdEqualTo(keyInCellTemplateConfig.getCellTemplateId());
Optional<PeriodCellTemplate> periodCellTemplate = periodCellTemplateMapper.selectByExample(periodCellTemplateExample1).stream().findFirst();
PeriodDataSource dataSource = new PeriodDataSource();
dataSource.setId(distributedIdService.nextId());
if (periodCellTemplate.isPresent()) {
dataSource.setColumnIndex(periodCellTemplate.get().getColumnIndex());
dataSource.setRowIndex(periodCellTemplate.get().getRowIndex());
}
dataSource.setAmount(new BigDecimal("0"));
dataSource.setName("ManualDataSource");
dataSource.setDescription("ManualDataSource");
dataSource.setCreateTime(createTime);
dataSource.setUpdateTime(createTime);
dataSource.setCreateBy("Admin");
dataSource.setUpdateBy("Admin");
dataSource.setPeriod(period);
dataSource.setCellTemplateId(keyInCellTemplateConfig.getCellTemplateId());
dataSource.setType(FormulaDataSourceType.KeyInSource.getCode());
periodDataSourceMapper.insertSelective(dataSource);
}
//update formulablock table reportid field
List<Long> cellTemplateConfigIds = periodCellTemplateConfigs.stream()
......
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