|
@@ -52,6 +52,25 @@ public class EvaluateRuleInfoServiceImpl extends ServiceImpl<EvaluateRuleInfoMap
|
|
|
|
|
|
|
|
|
@Override
|
|
|
+ public boolean updateDeleteTime(List<String> ids) {
|
|
|
+ int i = 0;
|
|
|
+ for (String id : ids) {
|
|
|
+ EvaluateRuleInfo info = baseMapper.selectById(id);
|
|
|
+ if (null != info) {
|
|
|
+ info.setDeleteTime(new Date());
|
|
|
+ i = baseMapper.updateById(info);
|
|
|
+
|
|
|
+ if (i == 0) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @Override
|
|
|
public boolean saveOrUpdate(EvaluateRuleInfo entity) {
|
|
|
|
|
|
if (null != entity && (null == entity.getId() || "".equals(entity.getId().trim()))) {
|
|
@@ -59,8 +78,23 @@ public class EvaluateRuleInfoServiceImpl extends ServiceImpl<EvaluateRuleInfoMap
|
|
|
qw.lambda().eq(EvaluateRuleInfo::getEvaluateRuleId, entity.getEvaluateRuleId());
|
|
|
qw.lambda().eq(EvaluateRuleInfo::getIndicatorId, entity.getIndicatorId());
|
|
|
List<EvaluateRuleInfo> list = baseMapper.selectList(qw);
|
|
|
+
|
|
|
if (null != list && list.size() > 0) {
|
|
|
- throw new CustomException("该指标已存在");
|
|
|
+ for(EvaluateRuleInfo upinfo:list){
|
|
|
+ if(null != upinfo.getDeleteTime()){
|
|
|
+ upinfo.setDeleteTime(null);
|
|
|
+ int i = baseMapper.updateById(upinfo);
|
|
|
+ if(i<=0){
|
|
|
+ return false;
|
|
|
+ }else {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ throw new CustomException("该指标已存在");
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
}
|
|
|
entity.setCreateTime(new Date());
|
|
|
} else {
|