fix:优化业绩指标导入功能

This commit is contained in:
xxb 2025-04-07 15:29:23 +08:00
parent 3597a58b9e
commit 8e2a9316f3

View File

@ -112,14 +112,20 @@ public class ZhPerformanceIndicatorsServiceImpl extends ServiceImpl<ZhPerformanc
zhPerformanceIndicator.setProjectReviewSupportIndex(data.getColJ());
}
if (zhPerformanceIndicator.getIndex() == null || zhPerformanceIndicator.getIndex().isEmpty()) {
throw new RuntimeException("" + data.getRowNum() + "行【指标】不能为空!");
}
ZhPerformanceIndicators sqlPI = baseMapper.selectOne(new LambdaQueryWrapper<ZhPerformanceIndicators>()
.eq(ZhPerformanceIndicators::getUnit, unit)
.eq(ZhPerformanceIndicators::getIndex, data.getIndex())
.eq(ZhPerformanceIndicators::getUnit, zhPerformanceIndicator.getUnit())
.eq(ZhPerformanceIndicators::getIndex, zhPerformanceIndicator.getIndex())
.eq(ZhPerformanceIndicators::getDeleteFlag, 0)
);
if (sqlPI != null) {
String id = sqlPI.getId();
BeanUtil.copyProperties(zhPerformanceIndicator, sqlPI);
sqlPI.setUpdateTime(new Date());
sqlPI.setId(id);
updateNum.addAndGet(baseMapper.updateById(sqlPI));
} else {
zhPerformanceIndicator.setId(IdUtils.fastSimpleUUID());