66890 系统中责任领域字段按照首字母顺序排序
This commit is contained in:
+12
@@ -33,6 +33,7 @@ import com.jero.modules.utils.HanYuPinYinUtil;
|
|||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.apache.commons.lang3.ObjectUtils;
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.apache.shiro.SecurityUtils;
|
import org.apache.shiro.SecurityUtils;
|
||||||
@@ -186,6 +187,17 @@ public class SysDictController {
|
|||||||
ls = sysDictService.queryDictItemsByCode(dictCode);
|
ls = sysDictService.queryDictItemsByCode(dictCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 将结果集进行排序
|
||||||
|
if (CollectionUtils.isNotEmpty(ls)) {
|
||||||
|
// 匿名比较器排序
|
||||||
|
Collections.sort(ls, new Comparator<DictModel>() {
|
||||||
|
@Override
|
||||||
|
public int compare(DictModel p1, DictModel p2) {
|
||||||
|
return p1.getText().compareTo(p2.getText());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
result.setSuccess(true);
|
result.setSuccess(true);
|
||||||
result.setResult(ls);
|
result.setResult(ls);
|
||||||
log.debug(result.toString());
|
log.debug(result.toString());
|
||||||
|
|||||||
Reference in New Issue
Block a user