|
@@ -3,9 +3,11 @@ package com.persagy.bdtp.adm.service.impl;
|
|
import cn.hutool.core.collection.CollUtil;
|
|
import cn.hutool.core.collection.CollUtil;
|
|
import cn.hutool.core.date.DatePattern;
|
|
import cn.hutool.core.date.DatePattern;
|
|
import cn.hutool.core.date.DateUtil;
|
|
import cn.hutool.core.date.DateUtil;
|
|
|
|
+import cn.hutool.core.util.IdUtil;
|
|
import cn.hutool.core.util.StrUtil;
|
|
import cn.hutool.core.util.StrUtil;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
|
|
+import com.fasterxml.jackson.core.type.TypeReference;
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
import com.persagy.bdtp.adm.client.DicClient;
|
|
import com.persagy.bdtp.adm.client.DicClient;
|
|
import com.persagy.bdtp.adm.client.RwdClient;
|
|
import com.persagy.bdtp.adm.client.RwdClient;
|
|
@@ -25,6 +27,8 @@ import com.persagy.dmp.common.lang.PsDateTime;
|
|
import com.persagy.dmp.common.model.response.CommonResult;
|
|
import com.persagy.dmp.common.model.response.CommonResult;
|
|
import com.persagy.dmp.define.entity.RelationDefine;
|
|
import com.persagy.dmp.define.entity.RelationDefine;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
+import org.springframework.core.io.Resource;
|
|
|
|
+import org.springframework.core.io.ResourceLoader;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
@@ -77,6 +81,9 @@ public class SyncAppImpl implements ISyncApp {
|
|
@Autowired
|
|
@Autowired
|
|
private ISyncModel syncModel;
|
|
private ISyncModel syncModel;
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ ResourceLoader resourceLoader;
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
public Map<String, Object> downloadDictAndConfig(String groupCode, String projectId, String userId) {
|
|
public Map<String, Object> downloadDictAndConfig(String groupCode, String projectId, String userId) {
|
|
Map<String, Object> dict = queryDict(groupCode, projectId, userId);
|
|
Map<String, Object> dict = queryDict(groupCode, projectId, userId);
|
|
@@ -126,6 +133,15 @@ public class SyncAppImpl implements ISyncApp {
|
|
equipList.add(def);
|
|
equipList.add(def);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ //加载新增的自定义设备类
|
|
|
|
+ try{
|
|
|
|
+ Resource resource = resourceLoader.getResource("classpath:equip.json");
|
|
|
|
+ List<TypeDef> types = objectMapper.readValue(resource.getInputStream(), new TypeReference<List<TypeDef>>(){});
|
|
|
|
+ equipList.addAll(types);
|
|
|
|
+ }catch (Exception e) {
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
//组织树形结构
|
|
//组织树形结构
|
|
// for(Map<String, Object> major : majorList){
|
|
// for(Map<String, Object> major : majorList){
|
|
// ArrayList<TypeDef> childrenSys = new ArrayList<>();
|
|
// ArrayList<TypeDef> childrenSys = new ArrayList<>();
|