|
|
@@ -45,6 +45,44 @@ public class RemoteSystemServiceImpl implements RemoteSystemService {
|
|
|
@Autowired
|
|
|
private SysAreaService sysAreaService;
|
|
|
|
|
|
+ /**
|
|
|
+ * @param keys type#value,type#value
|
|
|
+ * @return Map<String, SysDictResDto>
|
|
|
+ * @desc: 根据类型id查字典,先查redis,没查到查数据库,查出来了存redis
|
|
|
+ * @author: czh
|
|
|
+ * @date: 2023/7/5
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public Map<String, SysDictResDto> queryDictMapByTypeValues(String keys) {
|
|
|
+ Map<String, SysDictResDto> map = new HashMap<>();
|
|
|
+ String[] typeValueArr = keys.split(Global.COMMA);
|
|
|
+ for (int i = 0; i < typeValueArr.length; i++) {
|
|
|
+ String typeValue = typeValueArr[i];
|
|
|
+ String[] split = typeValue.split(Global.POUND);
|
|
|
+ SysDictResDto sysDictResDto = queryDictByTypeAndValue(split[0], split[1]);
|
|
|
+ map.put(typeValue, sysDictResDto);
|
|
|
+ }
|
|
|
+
|
|
|
+ return map;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @param type 类型
|
|
|
+ * @return Map<String, SysDictResDto>
|
|
|
+ * @desc: 根据类型id查字典,先查redis,没查到查数据库,查出来了存redis
|
|
|
+ * @author: czh
|
|
|
+ * @date: 2023/7/5
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public Map<String, SysDictResDto> queryDictMapByType(String type) {
|
|
|
+ List<SysDictResDto> sysDictResDtos = queryDictByType(type);
|
|
|
+ if (CollectionUtils.isEmpty(sysDictResDtos)) {
|
|
|
+ return new HashMap<>();
|
|
|
+ }
|
|
|
+
|
|
|
+ return sysDictResDtos.stream().collect(Collectors.toMap(SysDictResDto::getValue, v->v));
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* @param type 类型
|
|
|
* @return SysDictResDto
|
|
|
@@ -127,7 +165,7 @@ public class RemoteSystemServiceImpl implements RemoteSystemService {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * @param type 字典类型,value key
|
|
|
+ * @param type 字典类型,value key
|
|
|
* @return SysDictGroupResDto
|
|
|
* @desc: 根据字典类型和key查字典组
|
|
|
* @author: czh
|
|
|
@@ -180,6 +218,7 @@ public class RemoteSystemServiceImpl implements RemoteSystemService {
|
|
|
BeanUtils.copyProperties(kwsEnterpriseResDto, entCacheResDto);
|
|
|
entCacheResDto.setDeptInfo(remoteBaseService.queryDeftInfoByEntId(entId));
|
|
|
entCacheResDto.setCertificateInfo(remoteBaseService.queryCertificateByEntId(entId));
|
|
|
+ remoteBaseService.fillRelate(entCacheResDto);
|
|
|
RedissonUtils.putString(key, JSON.toJSONString(entCacheResDto), Global.COMMON_EXPIRE);
|
|
|
return entCacheResDto;
|
|
|
}
|
|
|
@@ -211,12 +250,37 @@ public class RemoteSystemServiceImpl implements RemoteSystemService {
|
|
|
return list;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * @param entIdList 企业id集合
|
|
|
+ * @return Map<Long, EntCacheResDto>
|
|
|
+ * @desc: 查企业树
|
|
|
+ * @author: czh
|
|
|
+ * @date: 2023/7/17
|
|
|
+ */
|
|
|
@Override
|
|
|
- public Map<Long, EntCacheResDto> queryEntTreeByIds(List<Long> endIdList) {
|
|
|
- for (Long entId : endIdList) {
|
|
|
- queryEntCacheById(entId);
|
|
|
+ public Map<Long, EntCacheResDto> queryEntTreeByIds(List<Long> entIdList) {
|
|
|
+ Map<Long, EntCacheResDto> result = new HashMap<>();
|
|
|
+ for (Long entId : entIdList) {
|
|
|
+ EntCacheResDto entCacheResDto = queryEntCacheById(entId);
|
|
|
+
|
|
|
+ //有主体单位
|
|
|
+ String entDeptIds = entCacheResDto.getEntDeptIds();
|
|
|
+ if (StringUtils.isNotBlank(entDeptIds)) {
|
|
|
+ List<Long> entDeptIdList = Arrays.stream(entDeptIds.split(Global.COMMA)).map(Long::parseLong).toList();
|
|
|
+ List<EntCacheResDto> child = queryEntCacheByIds(entDeptIdList);
|
|
|
+ entCacheResDto.setChild(child);
|
|
|
+ result.put(entId, entCacheResDto);
|
|
|
+ }
|
|
|
+
|
|
|
+ //有父企业
|
|
|
+ Long parentId = entCacheResDto.getParentId();
|
|
|
+ if (Objects.nonNull(parentId)) {
|
|
|
+ EntCacheResDto parent = queryEntCacheById(parentId);
|
|
|
+ parent.setChild(Collections.singletonList(entCacheResDto));
|
|
|
+ result.put(entId, parent);
|
|
|
+ }
|
|
|
}
|
|
|
- return null;
|
|
|
+ return result;
|
|
|
}
|
|
|
|
|
|
@Override
|