Commit eac10354 by hzc

规则级别去重

parent 8014ff75
...@@ -26,10 +26,7 @@ import org.springframework.data.domain.Page; ...@@ -26,10 +26,7 @@ import org.springframework.data.domain.Page;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.rmi.dgc.Lease; import java.rmi.dgc.Lease;
import java.util.ArrayList; import java.util.*;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
@Api(tags={"数据填报-任务规则管理(任务下发)"}) @Api(tags={"数据填报-任务规则管理(任务下发)"})
@RestController @RestController
...@@ -112,8 +109,9 @@ public class TaskRuleCtrl { ...@@ -112,8 +109,9 @@ public class TaskRuleCtrl {
} }
@ApiOperation("根据机构编号获取对应的规则名类别") @ApiOperation("根据机构编号获取对应的规则名类别")
@GetMapping("findRuleLevelsByOrgNo") @GetMapping("findRuleLevelsByOrgNo")
public List<String> findRuleLevelsByOrgNo(@RequestParam("orgNo") String orgNo,@RequestParam(value = "sysAdmin",required = false) Boolean sysAdmin){ public Set<String> findRuleLevelsByOrgNo(@RequestParam("orgNo") String orgNo,@RequestParam(value = "sysAdmin",required = false) Boolean sysAdmin){
List<String> levels = new ArrayList<>(); // List<String> levels = new ArrayList<>();
Set<String> levels = new HashSet<>();
String key = ""; String key = "";
if(BooleanUtils.isTrue(sysAdmin)){ if(BooleanUtils.isTrue(sysAdmin)){
// //省对应的规则级别 // //省对应的规则级别
...@@ -135,7 +133,10 @@ public class TaskRuleCtrl { ...@@ -135,7 +133,10 @@ public class TaskRuleCtrl {
} }
if(!value.toString().equals("")){ if(!value.toString().equals("")){
String[] split = value.toString().split(Constants.SEP_COMMA); String[] split = value.toString().split(Constants.SEP_COMMA);
levels = Arrays.asList(split); for (String s : split) {
levels.add(s);
}
// levels = Arrays.asList(split);
} }
}else if(StringUtils.isNotBlank(orgNo)){ }else if(StringUtils.isNotBlank(orgNo)){
// switch (orgNo.length()){ // switch (orgNo.length()){
...@@ -153,7 +154,9 @@ public class TaskRuleCtrl { ...@@ -153,7 +154,9 @@ public class TaskRuleCtrl {
if(configInfoById!=null){ if(configInfoById!=null){
String cfValue = configInfoById.getCfValue(); String cfValue = configInfoById.getCfValue();
String[] split = cfValue.split(Constants.SEP_COMMA); String[] split = cfValue.split(Constants.SEP_COMMA);
levels = Arrays.asList(split); for (String s : split) {
levels.add(s);
}
} }
} }
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
where id = #{id} where id = #{id}
</select> </select>
<select id="findConfigInfoByLikeKey" resultType="com.keymobile.indicators.model.entity.ConfigInfo"> <select id="findConfigInfoByLikeKey" resultType="com.keymobile.indicators.model.entity.ConfigInfo">
select * select distinct cf_value
from config_info from config_info
where id like concat(#{key},'%') where id like concat(#{key},'%')
</select> </select>
......
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