Commit e8b3b9b08ed451eaa87e2302d3f76f236051e263
1 parent
2e2a813027
Exists in
master
update
Showing 1 changed file with 15 additions and 6 deletions
talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/RegionsController.java
View file @
e8b3b9b
1 | 1 | package com.lyms.talkonlineweb.controller; |
2 | 2 | |
3 | 3 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
4 | +import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; | |
4 | 5 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
5 | 6 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
6 | 7 | import com.lyms.talkonlineweb.domain.LymsDict; |
7 | 8 | |
... | ... | @@ -123,13 +124,21 @@ |
123 | 124 | QueryWrapper<LymsDict> queryWrapper2=new QueryWrapper<>(); |
124 | 125 | queryWrapper2.eq("id", id); |
125 | 126 | LymsDict dict2=lymsDictService.getOne(queryWrapper2); |
126 | - LymsDict dict=lymsDictService.getOne(queryWrapper); | |
127 | - if(null!=dict){ | |
128 | - if(null!=code && dict2.getCode().equals(code)){ | |
129 | - map.put("code", false); | |
127 | + List<LymsDict> dictlist=lymsDictService.list(queryWrapper); | |
128 | + if(CollectionUtils.isNotEmpty(dictlist)){ | |
129 | + if(null!=code && !dict2.getCode().equals(code)){ | |
130 | + for (LymsDict dict : dictlist) { | |
131 | + if(dict.getCode().equals(code)){ | |
132 | + map.put("code", false); | |
133 | + } | |
134 | + } | |
130 | 135 | } |
131 | - if(StringUtil.isNotEmpty(value) && !value.equals(dict2.getValue())){ | |
132 | - map.put("value", false); | |
136 | + if(StringUtil.isNotEmpty(value) && !dict2.getValue().equals(value)){ | |
137 | + for (LymsDict dict : dictlist) { | |
138 | + if(dict.getValue().equals(value)){ | |
139 | + map.put("value", false); | |
140 | + } | |
141 | + } | |
133 | 142 | } |
134 | 143 | } |
135 | 144 | baseResponse.setObject(map); |