Merge branch 'master' of http://121.40.234.130:8899/root/nl-sso-server
This commit is contained in:
@@ -20,7 +20,6 @@ import io.swagger.annotations.ApiOperation;
|
|||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.nl.modules.logging.annotation.Log;
|
import org.nl.modules.logging.annotation.Log;
|
||||||
import org.nl.modules.system.service.DictDetailService;
|
import org.nl.modules.system.service.DictDetailService;
|
||||||
import org.nl.modules.system.service.dto.DictDetailDto;
|
|
||||||
import org.nl.modules.system.service.dto.DictDetailQueryCriteria;
|
import org.nl.modules.system.service.dto.DictDetailQueryCriteria;
|
||||||
import org.nl.modules.system.service.dto.DictDto;
|
import org.nl.modules.system.service.dto.DictDto;
|
||||||
import org.springframework.data.domain.Pageable;
|
import org.springframework.data.domain.Pageable;
|
||||||
@@ -57,7 +56,7 @@ public class DictDetailController {
|
|||||||
@GetMapping(value = "/map")
|
@GetMapping(value = "/map")
|
||||||
public ResponseEntity<Object> getDictDetailMaps(@RequestParam String dictName){
|
public ResponseEntity<Object> getDictDetailMaps(@RequestParam String dictName){
|
||||||
String[] names = dictName.split("[,,]");
|
String[] names = dictName.split("[,,]");
|
||||||
Map<String, List<DictDetailDto>> dictMap = new HashMap<>(16);
|
Map<String, List<DictDto>> dictMap = new HashMap<>(16);
|
||||||
for (String name : names) {
|
for (String name : names) {
|
||||||
dictMap.put(name, dictDetailService.getDictByName(name));
|
dictMap.put(name, dictDetailService.getDictByName(name));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,8 +15,6 @@
|
|||||||
*/
|
*/
|
||||||
package org.nl.modules.system.service;
|
package org.nl.modules.system.service;
|
||||||
|
|
||||||
import org.nl.modules.system.domain.DictDetail;
|
|
||||||
import org.nl.modules.system.service.dto.DictDetailDto;
|
|
||||||
import org.nl.modules.system.service.dto.DictDetailQueryCriteria;
|
import org.nl.modules.system.service.dto.DictDetailQueryCriteria;
|
||||||
import org.nl.modules.system.service.dto.DictDto;
|
import org.nl.modules.system.service.dto.DictDto;
|
||||||
import org.springframework.data.domain.Pageable;
|
import org.springframework.data.domain.Pageable;
|
||||||
@@ -61,7 +59,7 @@ public interface DictDetailService {
|
|||||||
* @param name 字典名称
|
* @param name 字典名称
|
||||||
* @return /
|
* @return /
|
||||||
*/
|
*/
|
||||||
List<DictDetailDto> getDictByName(String name);
|
List<DictDto> getDictByName(String name);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据ID查询
|
* 根据ID查询
|
||||||
|
|||||||
@@ -19,13 +19,13 @@ import cn.hutool.core.date.DateUtil;
|
|||||||
import cn.hutool.core.util.IdUtil;
|
import cn.hutool.core.util.IdUtil;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.nl.modules.common.exception.BadRequestException;
|
import org.nl.modules.common.exception.BadRequestException;
|
||||||
import org.nl.modules.common.utils.RedisUtils;
|
import org.nl.modules.common.utils.RedisUtils;
|
||||||
import org.nl.modules.common.utils.SecurityUtils;
|
import org.nl.modules.common.utils.SecurityUtils;
|
||||||
import org.nl.modules.system.service.DictDetailService;
|
import org.nl.modules.system.service.DictDetailService;
|
||||||
import org.nl.modules.system.service.dto.DictDetailDto;
|
|
||||||
import org.nl.modules.system.service.dto.DictDetailQueryCriteria;
|
import org.nl.modules.system.service.dto.DictDetailQueryCriteria;
|
||||||
import org.nl.modules.system.service.dto.DictDto;
|
import org.nl.modules.system.service.dto.DictDto;
|
||||||
import org.nl.modules.wql.WQL;
|
import org.nl.modules.wql.WQL;
|
||||||
@@ -98,8 +98,16 @@ public class DictDetailServiceImpl implements DictDetailService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Cacheable(key = "'name:' + #p0")
|
@Cacheable(key = "'name:' + #p0")
|
||||||
public List<DictDetailDto> getDictByName(String name) {
|
public List<DictDto> getDictByName(String name) {
|
||||||
return null;
|
List<DictDto> dictDtos = this.findByDictName(name);
|
||||||
|
return dictDtos;
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<DictDto> findByDictName(String name) { // 前端的name就是code
|
||||||
|
WQLObject wo = WQLObject.getWQLObject("sys_dict");
|
||||||
|
JSONArray jsonArray = wo.query("code = '" + name + "' AND " +
|
||||||
|
"label IS NOT NULL AND label != '' ").getResultJSONArray(0);
|
||||||
|
return jsonArray.toJavaList(DictDto.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user