Commit ebc495dd authored by zhkwei's avatar zhkwei

1、BB公式修改;2、CIT-固定资产导入部分性能优化;3、CIT-数据处理增加CIT的正则表达式

parent 428577c0
......@@ -254,9 +254,6 @@ public class AssetListServiceImpl extends BaseService {
}
//循环存储新的资产
int insertBatch = assetListMapper.insertBatch(citAssetsLists);
// for (CitAssetsList citAsset : citAssetsLists){
// assetListMapper.insertSelective(citAsset);
// }
//处理资产类别
//1、根据projectId查询数据库中已有的资产类别,并和新导入的资产类别进行比较
// for (CitAssetGroupResult groupResult : citAssetGroupResults) {
......@@ -428,6 +425,8 @@ public class AssetListServiceImpl extends BaseService {
List<CitAssetsList> citAssetsLists = selectAssetsList(projectId, assetGroupResult.getAssetName(),saveGroupType);
citAssetsLists.stream().forEach(citAsset -> {
setCitAssetTaxData(citAsset,assetGroupResult,assetDetailGroup);
//根据主键修改资产清单数据
assetListMapper.updateByPrimaryKeySelective(citAsset);
});
}
......@@ -494,7 +493,7 @@ public class AssetListServiceImpl extends BaseService {
//更改资产状态,已进行分类并有效
citAsset.setStatus(1);
//根据主键修改资产清单数据
assetListMapper.updateByPrimaryKeySelective(citAsset);
// assetListMapper.updateByPrimaryKeySelective(citAsset);
}
public ApiResultDto updateAssetResultList(List<CitAssetsList> assetsLists, String projectId){
......
......@@ -234,7 +234,7 @@ public class CitReportServiceImpl extends BaseService {
setStatus(genJob, STATUS_END);
periodJobMapper.updateByPrimaryKey(genJob);
reportGenerator.updateWorkbookCaclsValueToDb(projectId, periodParam, workbook, resources, isMergeManualData, genJob);
reportGenerator.citUpdateWorkbookCaclsValueToDb(projectId, periodParam, workbook, resources, isMergeManualData, genJob);
//===============================================start validation compute==========================================================
//todo: 1.get the data from workbook, then put the data into new workbook
......
......@@ -108,6 +108,21 @@ public class FormulaAgent {
}
/**
* 查询所有的数据源,来用作判断当前单元格是只有手工数据源还是还有别的数据源 create by zhikai.z.wei at 20190411 20:44
* @param templateId
* @param projectId
* @param period
* @return
*/
public List<PeriodDataSource> queryNoManualDataSource(Long templateId, String projectId, Integer period) {
PeriodDataSourceExample example = new PeriodDataSourceExample();
example.createCriteria().andProjectIdEqualTo(projectId).andPeriodEqualTo(period)
.andCellTemplateIdEqualTo(templateId);
return periodDataSourceMapper.selectByExample(example);
}
private PeriodReport getReportByTemplate(String templateId, Integer periodId, String projectId) {
PeriodReportExample example = new PeriodReportExample();
example.createCriteria().andProjectIdEqualTo(projectId).andTemplateIdEqualTo(Long.valueOf(templateId))
......
......@@ -125,8 +125,16 @@ public class BB extends FunctionBase implements FreeRefFunction {
cellValue = new BigDecimal(cellData.getData()).setScale(4,
BigDecimal.ROUND_HALF_DOWN);
} else if (cellData.getData() != null && !dss.isEmpty()) {
cellValue = dss.get(0).getAmount().add(new BigDecimal(cellData.getData()).setScale(4,
BigDecimal.ROUND_HALF_DOWN));
//查询所有的数据源,来用作判断当前单元格是只有手工数据源还是还有别的数据源 create by zhikai.z.wei at 20190411 20:44
List<PeriodDataSource> allDataSource = agent.queryNoManualDataSource(Long.parseLong(cellTemplateData.getCellTemplateId()),
project == null ? formulaContext.getProjectId() : project.getId(), curPeriod.getCurPeriod());
if(!allDataSource.isEmpty() && allDataSource.size()>1){
cellValue = dss.get(0).getAmount().add(new BigDecimal(cellData.getData()).setScale(4,
BigDecimal.ROUND_HALF_DOWN));
}else{
cellValue = new BigDecimal(cellData.getData()).setScale(4,
BigDecimal.ROUND_HALF_DOWN);
}
} else throw Exceptions.BB_CELL_DATA_NULL;
nullCellDto.setAmount(cellValue);
if (rootBo != null) {
......
......@@ -504,6 +504,7 @@
// 根据已有信息通过spreadJS计算各单元格的值
var setData = function () {
debugger;
var sheet = scope.spread.sheets[0];
var isExportData = false;
if (angular.isArray(scope.reportSource)) {
......
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