Commit 4e5ddd72 by dengwei

修复第一次保存权重模板时删除旧数据出错的bug

parent f5ae0089
...@@ -175,9 +175,11 @@ public class ObjScoreIndWeightCfgServiceImpl implements ObjScoreIndWeightCfgServ ...@@ -175,9 +175,11 @@ public class ObjScoreIndWeightCfgServiceImpl implements ObjScoreIndWeightCfgServ
tempIds.add(template.getId()); tempIds.add(template.getId());
excelTemplateMapper.deleteByWeightId(weightId); excelTemplateMapper.deleteByWeightId(weightId);
} }
if (!tempIds.isEmpty()) {
excelIndicatorMapper.batchDeleteByTempIds(tempIds); excelIndicatorMapper.batchDeleteByTempIds(tempIds);
excelObjMapper.batchDeleteByTempIds(tempIds); excelObjMapper.batchDeleteByTempIds(tempIds);
} }
}
@Override @Override
public List<ObjScoreIndWeightCfg> findByIdList(List<Integer> ids) { public List<ObjScoreIndWeightCfg> findByIdList(List<Integer> ids) {
......
...@@ -83,9 +83,12 @@ public class WeightExcelTemplateServiceImpl implements WeightExcelTemplateServic ...@@ -83,9 +83,12 @@ public class WeightExcelTemplateServiceImpl implements WeightExcelTemplateServic
*/ */
private void deleteOldIndAndOldObj(WeightExcelTemplate template) { private void deleteOldIndAndOldObj(WeightExcelTemplate template) {
List<Integer> ids = excelTemplateMapper.selectAllIdByWeightId(template.getWeightId()); List<Integer> ids = excelTemplateMapper.selectAllIdByWeightId(template.getWeightId());
// 判断id集合是否有值
if (ids != null && !ids.isEmpty()) {
excelIndicatorMapper.batchDeleteByTempIds(ids); excelIndicatorMapper.batchDeleteByTempIds(ids);
excelObjMapper.batchDeleteByTempIds(ids); excelObjMapper.batchDeleteByTempIds(ids);
} }
}
/** /**
* 插入指标和对象信息 * 插入指标和对象信息
......
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