Commit 66f29aea by hzc

查询规则类别名称

parent 71c0d3fb
......@@ -100,6 +100,31 @@ public class TaskRuleCtrl {
}
return result;
}
@ApiOperation("根据机构编号获取对应的规则名类别")
@GetMapping("findRuleLevelsByOrgNo")
public List<String> findRuleLevelsByOrgNo(@RequestParam("orgNo") String orgNo){
List<String> levels = new ArrayList<>();
String key = "";
if(StringUtils.isNotBlank(orgNo)){
switch (orgNo.length()){
case 2: key="RULE_NAME_PRINVINCE";
break;
case 4: key = "RULE_NAME_CITY";
break;
case 6: key = "RULE_NAME_COUNTY";
break;
default: key=null;
}
if(key!=null){
ConfigInfo configInfoById = configInfoService.getConfigInfoById(key);
String cfValue = configInfoById.getCfValue();
String[] split = cfValue.split(Constants.SEP_COMMA);
levels = Arrays.asList(split);
}
}
return levels;
}
@ApiOperation("根据规则类型获取任务单位列表")
@GetMapping("findGroupObjs")
......
......@@ -9,6 +9,7 @@ import com.keymobile.indicators.model.mapper.indicators.TaskRuleMapper;
import com.keymobile.indicators.model.mapper.indicators.TaskRuleObjMapper;
import com.keymobile.indicators.service.dataenter.TaskRuleService;
import com.keymobile.indicators.service.dataenter.TaskService;
import com.keymobile.indicators.utils.SystemUserUtil;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.BooleanUtils;
import org.apache.commons.lang.StringUtils;
......@@ -102,21 +103,10 @@ public class TaskRuleServiceImpl implements TaskRuleService {
@Override
public Page<TaskRule> findRuleByPage(Integer ruleType, String ruleLevel, String keyword, int page, int pageSize,String orgNo,Boolean sysAdmin) {
// Integer oryType = null;
boolean tmp = true;
// if(!BooleanUtils.isTrue(sysAdmin)){
// if(StringUtils.isNotBlank(orgNo)){
// oryType = orgNo.length()/2;
// }else{
// //不是省市县任何一种类型且不是管理员
// tmp = false;
// }
// }
if(BooleanUtils.isTrue(sysAdmin)){
orgNo=null;
long total =0;
if(tmp){
total =taskRuleMapper.findRuleCount(ruleType, ruleLevel, keyword,orgNo);
}
long total = taskRuleMapper.findRuleCount(ruleType, ruleLevel, keyword,orgNo);
PageRequest request = PageRequest.of(page - 1, pageSize);
List<TaskRule> list = new ArrayList<>();
......
......@@ -44,7 +44,7 @@
and rule.name like concat('%', #{keyword}, '%')
</if>
<if test="orgNo != null and orgNo != ''">
and rule.orgNo = #{orgNo}
and rule.org_no = #{orgNo}
</if>
</sql>
<select id="findRuleCount" resultType="long">
......
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