|
@@ -1,18 +1,26 @@
|
|
|
package com.ims.eval.service.impl;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.ims.common.utils.StringUtils;
|
|
|
+import com.ims.eval.dao.IndicatorDictionaryMapper;
|
|
|
+import com.ims.eval.dao.IndicatorMapper;
|
|
|
import com.ims.eval.dao.IntervalScoringTableMapper;
|
|
|
import com.ims.eval.entity.EvaluationScoringRule;
|
|
|
import com.ims.eval.dao.EvaluationScoringRuleMapper;
|
|
|
+import com.ims.eval.entity.Indicator;
|
|
|
import com.ims.eval.entity.IndicatorDictionary;
|
|
|
-import com.ims.eval.entity.IntervalScoringTable;
|
|
|
import com.ims.eval.service.IEvaluationScoringRuleService;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* <p>
|
|
@@ -32,22 +40,52 @@ public class EvaluationScoringRuleServiceImpl extends ServiceImpl<EvaluationScor
|
|
|
@Autowired
|
|
|
private IntervalScoringTableMapper intervalScoringTableMapper;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private IndicatorMapper indicatorMapper;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private IndicatorDictionaryMapper indicatorDictionaryMapper;
|
|
|
+
|
|
|
|
|
|
@Override
|
|
|
- public List<EvaluationScoringRule> list(String indicatorUnit,String type,String businessPhase){
|
|
|
+ public IPage<EvaluationScoringRule> list(Integer pageNum, Integer pageSize,String describe){
|
|
|
|
|
|
QueryWrapper<EvaluationScoringRule> qw = new QueryWrapper<>();
|
|
|
|
|
|
- if (StringUtils.isNotEmpty(indicatorUnit)) {
|
|
|
- qw.lambda().eq(EvaluationScoringRule::getIndicatorUnit, indicatorUnit);
|
|
|
+ if (null == pageNum || null == pageSize) {
|
|
|
+ throw new RuntimeException("分页参数为空");
|
|
|
}
|
|
|
- if (StringUtils.isNotEmpty(businessPhase)) {
|
|
|
- qw.lambda().eq(EvaluationScoringRule::getBusinessPhase, businessPhase);
|
|
|
+
|
|
|
+ Page<EvaluationScoringRule> page = new Page<>(pageNum, pageSize);
|
|
|
+
|
|
|
+ if (StringUtils.isNotEmpty(describe)) {
|
|
|
+ qw.lambda().like(EvaluationScoringRule::getDescribe, describe);
|
|
|
}
|
|
|
- if (StringUtils.isNotEmpty(type)) {
|
|
|
- qw.lambda().eq(EvaluationScoringRule::getType, type);
|
|
|
+
|
|
|
+ IPage<EvaluationScoringRule> evaluationScoringRules = baseMapper.selectPage(page,qw);
|
|
|
+ //设置指标和指标项名称
|
|
|
+ List<EvaluationScoringRule> records = evaluationScoringRules.getRecords();
|
|
|
+ for (EvaluationScoringRule evaluationScoringRule : records){
|
|
|
+ //设置指标名称
|
|
|
+ List<String> list = new ArrayList<>();
|
|
|
+ List<String> indicatorIds = evaluationScoringRule.getIndicatorIds();
|
|
|
+ for (String code : indicatorIds){
|
|
|
+ Indicator indicator = indicatorMapper.selectByCode(code);
|
|
|
+ list.add(indicator.getIndicatorName());
|
|
|
+ }
|
|
|
+ evaluationScoringRule.setIndicatorNames(list);
|
|
|
+ //设置指标项名称
|
|
|
+ List<Map<String,String>> maps = new ArrayList<>();
|
|
|
+ List<String> indicatorItemIds = evaluationScoringRule.getIndicatorItemIds();
|
|
|
+ for (String code : indicatorItemIds){
|
|
|
+ Map<String,String> map = new HashMap<>();
|
|
|
+ IndicatorDictionary indicatorDictionary = indicatorDictionaryMapper.selectByCode(code);
|
|
|
+ map.put(indicatorDictionary.getOptionCode(),indicatorDictionary.getOptionName());
|
|
|
+ maps.add(map);
|
|
|
+ }
|
|
|
+ evaluationScoringRule.setIndicatorItemNames(maps);
|
|
|
}
|
|
|
- List<EvaluationScoringRule> evaluationScoringRules = evaluationScoringRuleMapper.selectList(qw);
|
|
|
+
|
|
|
return evaluationScoringRules;
|
|
|
}
|
|
|
|