Commit 4e5ddd72 by dengwei

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

parent f5ae0089
...@@ -175,8 +175,10 @@ public class ObjScoreIndWeightCfgServiceImpl implements ObjScoreIndWeightCfgServ ...@@ -175,8 +175,10 @@ public class ObjScoreIndWeightCfgServiceImpl implements ObjScoreIndWeightCfgServ
tempIds.add(template.getId()); tempIds.add(template.getId());
excelTemplateMapper.deleteByWeightId(weightId); excelTemplateMapper.deleteByWeightId(weightId);
} }
excelIndicatorMapper.batchDeleteByTempIds(tempIds); if (!tempIds.isEmpty()) {
excelObjMapper.batchDeleteByTempIds(tempIds); excelIndicatorMapper.batchDeleteByTempIds(tempIds);
excelObjMapper.batchDeleteByTempIds(tempIds);
}
} }
@Override @Override
......
...@@ -83,8 +83,11 @@ public class WeightExcelTemplateServiceImpl implements WeightExcelTemplateServic ...@@ -83,8 +83,11 @@ 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());
excelIndicatorMapper.batchDeleteByTempIds(ids); // 判断id集合是否有值
excelObjMapper.batchDeleteByTempIds(ids); if (ids != null && !ids.isEmpty()) {
excelIndicatorMapper.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