Commit 513f773d by zhangkb

修改指标关系接口

parent cd3d169f
package com.keymobile.indicators.api.hytobacco; package com.keymobile.indicators.api.hytobacco;
import java.util.Map; import java.util.List;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
...@@ -8,6 +8,7 @@ import org.springframework.web.bind.annotation.RequestMapping; ...@@ -8,6 +8,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import com.keymobile.indicators.model.entity.indicators.BaseIndDef;
import com.keymobile.indicators.service.hytobacco.IndicatorsRelService; import com.keymobile.indicators.service.hytobacco.IndicatorsRelService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
...@@ -22,7 +23,7 @@ public class IndicatorsRelCtrl { ...@@ -22,7 +23,7 @@ public class IndicatorsRelCtrl {
@ApiOperation(value = "根据指标id获取指标关系,type:0 基础指标 1考核指标", notes = "根据指标id获取指标关系,type:0 基础指标 1考核指标") @ApiOperation(value = "根据指标id获取指标关系,type:0 基础指标 1考核指标", notes = "根据指标id获取指标关系,type:0 基础指标 1考核指标")
@PostMapping(value = "/getRelByIndId") @PostMapping(value = "/getRelByIndId")
public Map<String,Object> getRelByIndId(@RequestParam String indId,@RequestParam String type){ public List<BaseIndDef> getRelByIndId(@RequestParam String indId,@RequestParam String type){
return indRelService.getRelByIndId(indId, type); return indRelService.getRelByIndId(indId, type);
} }
} }
package com.keymobile.indicators.service.hytobacco; package com.keymobile.indicators.service.hytobacco;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.regex.Matcher; import java.util.regex.Matcher;
import java.util.regex.Pattern; import java.util.regex.Pattern;
...@@ -34,8 +32,7 @@ public class IndicatorsRelService { ...@@ -34,8 +32,7 @@ public class IndicatorsRelService {
private IndicatorsRelMapper indicatorsRelMapper; private IndicatorsRelMapper indicatorsRelMapper;
//type:0 基础指标 1:考核指标 //type:0 基础指标 1:考核指标
public Map<String,Object> getRelByIndId(String indId,String type){ public List<BaseIndDef> getRelByIndId(String indId,String type){
Map<String,Object> resultMap = new HashMap<>();
List<BaseIndDef> resultList = new ArrayList<>(); List<BaseIndDef> resultList = new ArrayList<>();
//先从库里找,找不到再分析公式然后保存进库里 //先从库里找,找不到再分析公式然后保存进库里
List<IndicatorsRel> indRels = indicatorsRelMapper.findByIndId(indId); List<IndicatorsRel> indRels = indicatorsRelMapper.findByIndId(indId);
...@@ -64,8 +61,7 @@ public class IndicatorsRelService { ...@@ -64,8 +61,7 @@ public class IndicatorsRelService {
} }
} }
} }
resultMap.put("indList", resultList); return resultList;
return resultMap;
} }
public List<BaseIndDef> getRelFromFormula(String indId,String type){ public List<BaseIndDef> getRelFromFormula(String indId,String type){
......
...@@ -112,6 +112,7 @@ public class ShortboardRuleService { ...@@ -112,6 +112,7 @@ public class ShortboardRuleService {
map.put("driveId", driveId); map.put("driveId", driveId);
map.put("shortboardRuleId", shortboardRuleIdList); map.put("shortboardRuleId", shortboardRuleIdList);
map.put("compareCalResults", compareCalResults); map.put("compareCalResults", compareCalResults);
map.put("date", date);
result.add(map); result.add(map);
} }
} }
......
...@@ -71,7 +71,7 @@ public class ShortboardUnitService { ...@@ -71,7 +71,7 @@ public class ShortboardUnitService {
//根据短板规则单元获取 //根据短板规则单元获取
public List<Map<String,Object>> getShortboardObjFromUnit(Integer id) throws Exception{ public List<Map<String,Object>> getShortboardObjFromUnit(Integer id) throws Exception{
List<Map<String,Object>> result = new ArrayList<>(); List<Map<String,Object>> result = new ArrayList<>();
ShortboardUnit shortboardUnit = this.getById(id); ShortboardUnit shortboardUnit = this.getById(id);//根据短板单元id获取短板单元
if(shortboardUnit!=null) { if(shortboardUnit!=null) {
List<String> compareObjList = new ArrayList<>(); List<String> compareObjList = new ArrayList<>();
List<String> driveIndIdList = new ArrayList<>(); List<String> driveIndIdList = new ArrayList<>();
......
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