|
|
@@ -52,6 +52,9 @@ public class RemoteSystemServiceImpl implements RemoteSystemService {
|
|
|
*/
|
|
|
@Override
|
|
|
public Map<String, SysDictResDto> queryDictMapByTypeValues(String keys) {
|
|
|
+ if (StringUtils.isBlank(keys)) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
Map<String, SysDictResDto> map = new HashMap<>();
|
|
|
String[] typeValueArr = keys.split(Global.COMMA);
|
|
|
for (String typeValue : typeValueArr) {
|
|
|
@@ -74,6 +77,9 @@ public class RemoteSystemServiceImpl implements RemoteSystemService {
|
|
|
*/
|
|
|
@Override
|
|
|
public Map<String, SysDictResDto> queryDictMapByType(String type) {
|
|
|
+ if (StringUtils.isBlank(type)) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
List<SysDictResDto> sysDictResDtos = queryDictByType(type);
|
|
|
if (CollectionUtils.isEmpty(sysDictResDtos)) {
|
|
|
return Collections.emptyMap();
|
|
|
@@ -91,6 +97,9 @@ public class RemoteSystemServiceImpl implements RemoteSystemService {
|
|
|
*/
|
|
|
@Override
|
|
|
public List<SysDictResDto> queryDictByType(String type) {
|
|
|
+ if (StringUtils.isBlank(type)) {
|
|
|
+ return Collections.emptyList();
|
|
|
+ }
|
|
|
String key = Global.REDIS_SYS_DICT_TYPE_PREFIX + type;
|
|
|
String dictCache = RedissonUtils.getString(key);
|
|
|
//从redis查,查不到从数据库查,并写入redis
|
|
|
@@ -116,6 +125,9 @@ public class RemoteSystemServiceImpl implements RemoteSystemService {
|
|
|
*/
|
|
|
@Override
|
|
|
public SysDictResDto queryDictByTypeAndValue(String type, String value) {
|
|
|
+ if (StringUtils.isBlank(type) || StringUtils.isBlank(value)) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
String key = Global.REDIS_SYS_DICT_PREFIX + type + Global.POUND + value;
|
|
|
String dictCache = RedissonUtils.getString(key);
|
|
|
//从redis查,查不到从数据库查,并写入redis
|
|
|
@@ -142,6 +154,9 @@ public class RemoteSystemServiceImpl implements RemoteSystemService {
|
|
|
*/
|
|
|
@Override
|
|
|
public List<SysDictGroupResDto> queryDictGroupByType(String type) {
|
|
|
+ if (StringUtils.isBlank(type)) {
|
|
|
+ return Collections.emptyList();
|
|
|
+ }
|
|
|
List<SysDict> sysDicts = sysDictDao.queryByType(type);
|
|
|
if (CollectionUtils.isEmpty(sysDicts)) {
|
|
|
return Collections.emptyList();
|
|
|
@@ -174,6 +189,9 @@ public class RemoteSystemServiceImpl implements RemoteSystemService {
|
|
|
*/
|
|
|
@Override
|
|
|
public List<SysDictResDto> queryDictBottom(String type, String value) {
|
|
|
+ if (StringUtils.isBlank(type) || StringUtils.isBlank(value)) {
|
|
|
+ return Collections.emptyList();
|
|
|
+ }
|
|
|
SysDictGroupResDto sysDictGroupResDto = queryDictGroupByTypeAndValue(type, value);
|
|
|
if (Objects.isNull(sysDictGroupResDto)) {
|
|
|
return Collections.emptyList();
|
|
|
@@ -188,6 +206,9 @@ public class RemoteSystemServiceImpl implements RemoteSystemService {
|
|
|
}
|
|
|
|
|
|
private List<SysDictGroupResDto> checkNextLevelDict(List<SysDictGroupResDto> list) {
|
|
|
+ if (CollectionUtils.isEmpty(list)) {
|
|
|
+ return Collections.emptyList();
|
|
|
+ }
|
|
|
List<SysDictGroupResDto> sysDictGroupResDtos = list.stream().filter(item -> CollectionUtils.isNotEmpty(item.getChild())).toList();
|
|
|
if (CollectionUtils.isEmpty(sysDictGroupResDtos)) {
|
|
|
return list;
|
|
|
@@ -209,6 +230,9 @@ public class RemoteSystemServiceImpl implements RemoteSystemService {
|
|
|
*/
|
|
|
@Override
|
|
|
public SysDictGroupResDto queryDictGroupByTypeAndValue(String type, String value) {
|
|
|
+ if (StringUtils.isBlank(type) || StringUtils.isBlank(value)) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
String key = Global.REDIS_SYS_DICT_GROUP_PREFIX + type + Global.POUND + value;
|
|
|
String dictCache = RedissonUtils.getString(key);
|
|
|
//从redis查,查不到从数据库查,并写入redis
|
|
|
@@ -242,6 +266,9 @@ public class RemoteSystemServiceImpl implements RemoteSystemService {
|
|
|
*/
|
|
|
@Override
|
|
|
public EntCacheResDto queryEntCacheById(Long entId) {
|
|
|
+ if (Objects.isNull(entId)) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
String key = Global.REDIS_ENTERPRISE_PREFIX + entId;
|
|
|
String dictCache = RedissonUtils.getString(key);
|
|
|
//从redis查,查不到从数据库查,并写入redis
|
|
|
@@ -275,6 +302,9 @@ public class RemoteSystemServiceImpl implements RemoteSystemService {
|
|
|
*/
|
|
|
@Override
|
|
|
public List<EntCacheResDto> queryEntCacheByName(String entName) {
|
|
|
+ if (StringUtils.isBlank(entName)) {
|
|
|
+ return Collections.emptyList();
|
|
|
+ }
|
|
|
List<KwsEnterprise> kwsEnterprises = remoteBaseService.queryEntByName(entName);
|
|
|
if (CollectionUtils.isEmpty(kwsEnterprises)) {
|
|
|
return Collections.emptyList();
|
|
|
@@ -299,6 +329,9 @@ public class RemoteSystemServiceImpl implements RemoteSystemService {
|
|
|
*/
|
|
|
@Override
|
|
|
public Map<Long, EntCacheResDto> queryEntTreeByIds(List<Long> entIdList) {
|
|
|
+ if (CollectionUtils.isEmpty(entIdList)) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
Map<Long, EntCacheResDto> result = new HashMap<>(4);
|
|
|
for (Long entId : entIdList) {
|
|
|
EntCacheResDto entCacheResDto = queryEntCacheById(entId);
|
|
|
@@ -334,6 +367,9 @@ public class RemoteSystemServiceImpl implements RemoteSystemService {
|
|
|
|
|
|
@Override
|
|
|
public EntCacheResDto queryEntTreeById(Long entId) {
|
|
|
+ if (Objects.isNull(entId)) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
Map<Long, EntCacheResDto> longEntCacheResDtoMap = queryEntTreeByIds(Collections.singletonList(entId));
|
|
|
if (longEntCacheResDtoMap.isEmpty()) {
|
|
|
return null;
|
|
|
@@ -358,6 +394,9 @@ public class RemoteSystemServiceImpl implements RemoteSystemService {
|
|
|
|
|
|
@Override
|
|
|
public Map<Long, List<EntCacheResDto>> queryEntDeptCacheByIds(List<Long> entIds) {
|
|
|
+ if (CollectionUtils.isEmpty(entIds)) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
List<KwsEntDept> kwsEntDepts = remoteBaseService.queryEntDeptCacheByIds(entIds);
|
|
|
if (CollectionUtils.isEmpty(kwsEntDepts)) {
|
|
|
return Collections.emptyMap();
|
|
|
@@ -376,6 +415,9 @@ public class RemoteSystemServiceImpl implements RemoteSystemService {
|
|
|
|
|
|
@Override
|
|
|
public Map<Long, EntCacheResDto> queryEntCacheMapByIds(List<Long> entIds) {
|
|
|
+ if (CollectionUtils.isEmpty(entIds)) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
List<EntCacheResDto> entCacheResDtos = queryEntCacheByIds(entIds);
|
|
|
if (CollectionUtils.isEmpty(entCacheResDtos)) {
|
|
|
return Collections.emptyMap();
|
|
|
@@ -385,6 +427,9 @@ public class RemoteSystemServiceImpl implements RemoteSystemService {
|
|
|
|
|
|
@Override
|
|
|
public UserCacheResDto queryUserCacheById(Long userId) {
|
|
|
+ if (Objects.isNull(userId)) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
String key = Global.REDIS_USER_PREFIX + userId;
|
|
|
String dictCache = RedissonUtils.getString(key);
|
|
|
//从redis查,查不到从数据库查,并写入redis
|
|
|
@@ -444,6 +489,9 @@ public class RemoteSystemServiceImpl implements RemoteSystemService {
|
|
|
|
|
|
@Override
|
|
|
public Map<Long, UserCacheResDto> queryUserCacheMapByIds(List<Long> userIds) {
|
|
|
+ if (CollectionUtils.isEmpty(userIds)) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
List<UserCacheResDto> userCacheResDtos = queryUserCacheByIds(userIds);
|
|
|
if (CollectionUtils.isEmpty(userCacheResDtos)) {
|
|
|
return Collections.emptyMap();
|
|
|
@@ -453,6 +501,9 @@ public class RemoteSystemServiceImpl implements RemoteSystemService {
|
|
|
|
|
|
@Override
|
|
|
public SysAreaCacheResDto queryAreaCacheById(Integer code) {
|
|
|
+ if (Objects.isNull(code)) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
String key = Global.REDIS_AREA_PREFIX + code;
|
|
|
String areaCache = RedissonUtils.getString(key);
|
|
|
//从redis查,查不到从数据库查,并写入redis
|
|
|
@@ -472,6 +523,9 @@ public class RemoteSystemServiceImpl implements RemoteSystemService {
|
|
|
|
|
|
@Override
|
|
|
public List<AreaTreeFrontResDto> queryAreaTreeFrontByCodeList(List<Integer> list) {
|
|
|
+ if (CollectionUtils.isEmpty(list)) {
|
|
|
+ return Collections.emptyList();
|
|
|
+ }
|
|
|
List<SysArea> sysAreas = sysAreaService.selectByIds(list);
|
|
|
if (CollectionUtils.isEmpty(sysAreas)) {
|
|
|
return Collections.emptyList();
|
|
|
@@ -509,6 +563,9 @@ public class RemoteSystemServiceImpl implements RemoteSystemService {
|
|
|
|
|
|
@Override
|
|
|
public UserCacheResDto queryManagerInfoByEntId(Long entId) {
|
|
|
+ if (Objects.isNull(entId)) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
KwsEnterpriseResDto kwsEnterpriseResDto = remoteBaseService.queryEnterpriseById(entId);
|
|
|
if (Objects.isNull(kwsEnterpriseResDto) || Objects.isNull(kwsEnterpriseResDto.getManager())) {
|
|
|
return null;
|
|
|
@@ -525,6 +582,9 @@ public class RemoteSystemServiceImpl implements RemoteSystemService {
|
|
|
* @date: 2023/7/7
|
|
|
*/
|
|
|
private List<SysDictGroupResDto> getChild(Long id, List<SysDict> list) {
|
|
|
+ if (Objects.isNull(id) || CollectionUtils.isEmpty(list)) {
|
|
|
+ return Collections.emptyList();
|
|
|
+ }
|
|
|
List<SysDictGroupResDto> child = new ArrayList<>();
|
|
|
for (SysDict sysDict : list) {
|
|
|
if (sysDict.getParentId().equals(String.valueOf(id))) {
|
|
|
@@ -551,6 +611,9 @@ public class RemoteSystemServiceImpl implements RemoteSystemService {
|
|
|
* @date: 2023/7/31
|
|
|
*/
|
|
|
public List<FindAreaTreeResVo> queryAreaTree(Integer code) {
|
|
|
+ if (Objects.isNull(code)) {
|
|
|
+ return Collections.emptyList();
|
|
|
+ }
|
|
|
String key = Global.REDIS_GROUP_AREA_PREFIX + code;
|
|
|
String areaCache = RedissonUtils.getString(key);
|
|
|
if (StringUtils.isBlank(areaCache)) {
|
|
|
@@ -570,6 +633,9 @@ public class RemoteSystemServiceImpl implements RemoteSystemService {
|
|
|
* @date: 2023/7/31
|
|
|
*/
|
|
|
private List<FindAreaTreeResVo> queryAreaGroup(Integer code) {
|
|
|
+ if (Objects.isNull(code)) {
|
|
|
+ return Collections.emptyList();
|
|
|
+ }
|
|
|
Map<String, Object> params = new HashMap<>(1);
|
|
|
params.put("pcode", code);
|
|
|
List<Map<String, Object>> list = sysAreaService.findList(params);
|
|
|
@@ -592,6 +658,9 @@ public class RemoteSystemServiceImpl implements RemoteSystemService {
|
|
|
*
|
|
|
* @return*/
|
|
|
public REnterpriseVo queryEntDetails(Long entId) {
|
|
|
+ if (Objects.isNull(entId)) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
return remoteBaseService.queryEntDetails(entId);
|
|
|
}
|
|
|
|
|
|
@@ -602,7 +671,10 @@ public class RemoteSystemServiceImpl implements RemoteSystemService {
|
|
|
* @author zk
|
|
|
* @date 2023/8/10
|
|
|
**/
|
|
|
- public KwsUserResDto queryUserDetails(String account, int systemType) {
|
|
|
+ public KwsUserResDto queryUserDetails(String account, Integer systemType) {
|
|
|
+ if (Objects.isNull(systemType) || StringUtils.isBlank(account)) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
KwsUser params = new KwsUser();
|
|
|
params.setAccount(account);
|
|
|
params.setSystemType(systemType);
|