Commit bd88399b by zhangkb

添加单位计分计算接口

parent 8c23199a
......@@ -12,6 +12,7 @@ import org.springframework.web.bind.annotation.RestController;
import com.keymobile.indicators.model.entity.scorecard.IndScorecard;
import com.keymobile.indicators.service.hytobacco.IndScorecardService;
import com.keymobile.indicators.service.hytobacco.ScoreRuleService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
......@@ -22,6 +23,8 @@ import io.swagger.annotations.ApiOperation;
public class IndScorecardCtrl {
@Autowired
private IndScorecardService indScorecardService;
@Autowired
private ScoreRuleService scoreRuleService;
@ApiOperation(value = "新增/修改", notes = "新增/修改")
@PostMapping(value = "/saveOrUpdate")
......@@ -55,4 +58,13 @@ public class IndScorecardCtrl {
return indScorecardService.calculateIndiScore(indId, date, compareObj,
indScorecardId,compareId,compareObjs);
}
@ApiOperation(value = "根据单位评分规则计算单位评分", notes = "根据单位评分规则计算单位评分")
@PostMapping(value = "/calculateObjectScore")
public List<Map<String,String>> calculateObjectScore(@RequestParam String reportId,
@RequestParam String compareId,@RequestParam List<String> indIds,
@RequestParam List<String> compareObjs,@RequestParam int date,
@RequestParam String scoreRuleId){
return scoreRuleService.calObjScore(reportId, compareId, indIds, compareObjs, date, scoreRuleId);
};
}
......@@ -256,7 +256,7 @@ public class ScoreRuleService {
}
//根据单位评分规则计算单位分数
public void calObjScore(String reportId,String compareId,List<String> indIds,
public List<Map<String,String>> calObjScore(String reportId,String compareId,List<String> indIds,
List<String> compareObjs,int date,String scoreRuleId) {
List<Map<String,String>> results = new ArrayList<>();
//根据单位得分评分卡id获取评分卡详情
......@@ -284,6 +284,6 @@ public class ScoreRuleService {
}else {
logger.info("单位评分卡id:"+scoreRuleId+" 不存在");
}
System.out.println(results);
return results;
}
}
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