|
@@ -6,11 +6,15 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.ims.common.utils.StringUtils;
|
|
import com.ims.common.utils.StringUtils;
|
|
import com.ims.eval.cache.CacheContext;
|
|
import com.ims.eval.cache.CacheContext;
|
|
import com.ims.eval.config.CustomException;
|
|
import com.ims.eval.config.CustomException;
|
|
|
|
+import com.ims.eval.entity.EvaluateRule;
|
|
|
|
+import com.ims.eval.entity.IndicatorType;
|
|
import com.ims.eval.entity.OrganizationEvaluationRule;
|
|
import com.ims.eval.entity.OrganizationEvaluationRule;
|
|
import com.ims.eval.dao.OrganizationEvaluationRuleMapper;
|
|
import com.ims.eval.dao.OrganizationEvaluationRuleMapper;
|
|
import com.ims.eval.entity.dto.request.OrganizationEvaluationRuleDTO;
|
|
import com.ims.eval.entity.dto.request.OrganizationEvaluationRuleDTO;
|
|
|
|
+import com.ims.eval.service.IEvaluateRuleService;
|
|
import com.ims.eval.service.IOrganizationEvaluationRuleService;
|
|
import com.ims.eval.service.IOrganizationEvaluationRuleService;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
@@ -30,6 +34,11 @@ import java.util.List;
|
|
@Service
|
|
@Service
|
|
public class OrganizationEvaluationRuleServiceImpl extends ServiceImpl<OrganizationEvaluationRuleMapper, OrganizationEvaluationRule> implements IOrganizationEvaluationRuleService {
|
|
public class OrganizationEvaluationRuleServiceImpl extends ServiceImpl<OrganizationEvaluationRuleMapper, OrganizationEvaluationRule> implements IOrganizationEvaluationRuleService {
|
|
|
|
|
|
|
|
+
|
|
|
|
+ @Autowired
|
|
|
|
+ private IEvaluateRuleService evaluateRuleService;
|
|
|
|
+
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
public IPage<OrganizationEvaluationRule> list(Integer pageNum, Integer pageSize, String id, String organizationName, String organizationId, String organizationType, String binSection, String binStage, String evaluationCycle) {
|
|
public IPage<OrganizationEvaluationRule> list(Integer pageNum, Integer pageSize, String id, String organizationName, String organizationId, String organizationType, String binSection, String binStage, String evaluationCycle) {
|
|
QueryWrapper<OrganizationEvaluationRule> qw = new QueryWrapper<>();
|
|
QueryWrapper<OrganizationEvaluationRule> qw = new QueryWrapper<>();
|
|
@@ -67,6 +76,9 @@ public class OrganizationEvaluationRuleServiceImpl extends ServiceImpl<Organizat
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
+ qw.lambda().eq(OrganizationEvaluationRule::isDelFlag, false);
|
|
|
|
+
|
|
|
|
+
|
|
qw.lambda().orderByAsc(OrganizationEvaluationRule::getOrderNum);
|
|
qw.lambda().orderByAsc(OrganizationEvaluationRule::getOrderNum);
|
|
|
|
|
|
IPage<OrganizationEvaluationRule> list = baseMapper.selectPage(page, qw);
|
|
IPage<OrganizationEvaluationRule> list = baseMapper.selectPage(page, qw);
|
|
@@ -82,7 +94,7 @@ public class OrganizationEvaluationRuleServiceImpl extends ServiceImpl<Organizat
|
|
@Override
|
|
@Override
|
|
public List<OrganizationEvaluationRule> listAll(String id, String organizationName, String organizationId, String organizationType, String binSection, String binStage, String evaluationCycle) {
|
|
public List<OrganizationEvaluationRule> listAll(String id, String organizationName, String organizationId, String organizationType, String binSection, String binStage, String evaluationCycle) {
|
|
QueryWrapper<OrganizationEvaluationRule> qw = new QueryWrapper<>();
|
|
QueryWrapper<OrganizationEvaluationRule> qw = new QueryWrapper<>();
|
|
- //构造分页构造器
|
|
|
|
|
|
+
|
|
if (StringUtils.isNotEmpty(id)) {
|
|
if (StringUtils.isNotEmpty(id)) {
|
|
qw.lambda().eq(OrganizationEvaluationRule::getId, id);
|
|
qw.lambda().eq(OrganizationEvaluationRule::getId, id);
|
|
}
|
|
}
|
|
@@ -111,6 +123,7 @@ public class OrganizationEvaluationRuleServiceImpl extends ServiceImpl<Organizat
|
|
qw.lambda().eq(OrganizationEvaluationRule::getEvaluationCycle, evaluationCycle);
|
|
qw.lambda().eq(OrganizationEvaluationRule::getEvaluationCycle, evaluationCycle);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ qw.lambda().eq(OrganizationEvaluationRule::isDelFlag, false);
|
|
|
|
|
|
qw.lambda().orderByAsc(OrganizationEvaluationRule::getOrderNum);
|
|
qw.lambda().orderByAsc(OrganizationEvaluationRule::getOrderNum);
|
|
|
|
|
|
@@ -129,6 +142,20 @@ public class OrganizationEvaluationRuleServiceImpl extends ServiceImpl<Organizat
|
|
IPage<OrganizationEvaluationRule> list = baseMapper.list(page, id, organizationName, organizationId, organizationType, binSection, binStage, evaluationCycle);
|
|
IPage<OrganizationEvaluationRule> list = baseMapper.list(page, id, organizationName, organizationId, organizationType, binSection, binStage, evaluationCycle);
|
|
list.getRecords().stream().forEach(l->{
|
|
list.getRecords().stream().forEach(l->{
|
|
l.setBinSectionName(null == CacheContext.ddNameMap.get(l.getBinSection()) ? "" :CacheContext.ddNameMap.get(l.getBinSection()));
|
|
l.setBinSectionName(null == CacheContext.ddNameMap.get(l.getBinSection()) ? "" :CacheContext.ddNameMap.get(l.getBinSection()));
|
|
|
|
+
|
|
|
|
+ StringBuilder binStageName = new StringBuilder();
|
|
|
|
+ for (String stage : l.getBinStage().split(",")){
|
|
|
|
+ binStageName.append(null == CacheContext.ddNameMap.get(stage) ? "" :CacheContext.ddNameMap.get(stage)).append(",");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ l.setBinStageName(binStageName.toString().length()>0?binStageName.toString().substring(0,binStageName.toString().length()-1):"");
|
|
|
|
+
|
|
|
|
+ StringBuilder ruleName = new StringBuilder();
|
|
|
|
+ for (String ruleId :l.getEvaluateRuleId().split(",")){
|
|
|
|
+ ruleName.append(evaluateRuleService.getById(ruleId).getRuleName()).append(",");
|
|
|
|
+ }
|
|
|
|
+ l.setEvaluateRuleName(ruleName.toString().length()>0?ruleName.toString().substring(0,ruleName.toString().length()-1):"");
|
|
|
|
+
|
|
});
|
|
});
|
|
return list;
|
|
return list;
|
|
}
|
|
}
|
|
@@ -156,7 +183,19 @@ public class OrganizationEvaluationRuleServiceImpl extends ServiceImpl<Organizat
|
|
@Transactional
|
|
@Transactional
|
|
@Override
|
|
@Override
|
|
public boolean removeByIds(Collection<? extends Serializable> idList) {
|
|
public boolean removeByIds(Collection<? extends Serializable> idList) {
|
|
- super.removeByIds(idList);
|
|
|
|
- return false;
|
|
|
|
|
|
+
|
|
|
|
+ for (Serializable ids :idList){
|
|
|
|
+ OrganizationEvaluationRule rule = baseMapper.selectById(ids);
|
|
|
|
+ if(null == rule){
|
|
|
|
+ throw new CustomException("查无该记录");
|
|
|
|
+ }
|
|
|
|
+ rule.setDelFlag(true);
|
|
|
|
+ rule.setUpdateTime(new Date());
|
|
|
|
+ int num = baseMapper.updateById(rule);
|
|
|
|
+ if (num<=0){
|
|
|
|
+ throw new CustomException("删除失败");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return true;
|
|
}
|
|
}
|
|
}
|
|
}
|