|
@@ -10,18 +10,19 @@ import api.common.pojo.po.algorithm.AlgorithmPO;
|
|
|
import api.common.pojo.vo.algorithm.AlgorithmVO;
|
|
|
import api.common.pojo.vo.algorithm.RunningProjectVO;
|
|
|
import api.common.util.*;
|
|
|
-import com.css.simulation.resource.server.infrastructure.mysql.mapper.AlgorithmExpandMapper;
|
|
|
-import com.css.simulation.resource.server.infrastructure.mysql.mapper.AlgorithmMapper;
|
|
|
-import com.css.simulation.resource.server.application.AlgorithmService;
|
|
|
-import com.css.simulation.resource.server.infrastructure.common.utils.AuthUtil;
|
|
|
-import com.css.simulation.resource.server.infrastructure.common.utils.PageUtil;
|
|
|
-import com.css.simulation.resource.server.infrastructure.common.utils.PoUtil;
|
|
|
-import com.css.simulation.resource.server.infrastructure.common.configuration.git.GitConfiguration;
|
|
|
import com.css.simulation.resource.server.acl.feign.AlgoPlatformService;
|
|
|
import com.css.simulation.resource.server.acl.feign.FileDownService;
|
|
|
import com.css.simulation.resource.server.acl.feign.SchedulerService;
|
|
|
-import com.css.simulation.resource.server.application.SimulationProjectService;
|
|
|
+import com.css.simulation.resource.server.application.AlgorithmService;
|
|
|
import com.css.simulation.resource.server.application.DictService;
|
|
|
+import com.css.simulation.resource.server.application.SimulationProjectService;
|
|
|
+import com.css.simulation.resource.server.infrastructure.common.configuration.git.GitConfiguration;
|
|
|
+import com.css.simulation.resource.server.infrastructure.common.utils.AuthUtil;
|
|
|
+import com.css.simulation.resource.server.infrastructure.common.utils.PageUtil;
|
|
|
+import com.css.simulation.resource.server.infrastructure.common.utils.PoUtil;
|
|
|
+import com.css.simulation.resource.server.infrastructure.mysql.mapper.AlgorithmExpandMapper;
|
|
|
+import com.css.simulation.resource.server.infrastructure.mysql.mapper.AlgorithmMapper;
|
|
|
+import com.github.pagehelper.PageHelper;
|
|
|
import com.github.pagehelper.PageInfo;
|
|
|
import lombok.SneakyThrows;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
@@ -147,17 +148,21 @@ public class AlgorithmServiceImpl implements AlgorithmService {
|
|
|
|
|
|
@Override
|
|
|
public ResponseBodyVO<Object> selectAlgoPlatformList(AlgorithmParameter param) {
|
|
|
- //获取参数
|
|
|
- String algorithmId = param.getAlgorithmCode();
|
|
|
- String algorithmName = param.getAlgorithmName();
|
|
|
- String description = param.getDescription();
|
|
|
+ //1 同步算法平台数据到仿真云
|
|
|
+// final String algorithmId = param.getAlgorithmCode();
|
|
|
+ final String algorithmName = param.getAlgorithmName();
|
|
|
+ final String description = param.getDescription();
|
|
|
+ final String algorithmVersion = param.getAlgorithmVersion();
|
|
|
+ final String team = param.getTeam();
|
|
|
+ final String topic = param.getTopic();
|
|
|
+ final String status = param.getStatus();
|
|
|
Integer page = param.getPageNum();
|
|
|
Integer size = param.getPageSize();
|
|
|
String sort = "algorithmId-desc";
|
|
|
String urlParam = "";
|
|
|
- if (StringUtil.isNotEmpty(algorithmId)) {
|
|
|
- urlParam = urlParam + "&algorithmId=" + algorithmId;
|
|
|
- }
|
|
|
+// if (StringUtil.isNotEmpty(algorithmId)) {
|
|
|
+// urlParam = urlParam + "&algorithmId=" + algorithmId;
|
|
|
+// }
|
|
|
if (StringUtil.isNotEmpty(algorithmName)) {
|
|
|
urlParam = urlParam + "&algorithmName=" + algorithmName;
|
|
|
}
|
|
@@ -171,44 +176,54 @@ public class AlgorithmServiceImpl implements AlgorithmService {
|
|
|
urlParam = urlParam + "&size=" + size;
|
|
|
}
|
|
|
urlParam = urlParam + "&sort=" + sort;
|
|
|
+ // 此接口在此处只作为同步更新数据到仿真云数据库,分页查询通过仿真云数据库来查
|
|
|
+ algoPlatformService.getAlgorithmList(urlParam);
|
|
|
+ //2 查询仿真数据库里的数据
|
|
|
+ PageHelper.startPage(page, size);
|
|
|
+ final List<AlgorithmVO> algorithmVOS = algorithmExpandMapper.select(param);
|
|
|
+ PageInfo<AlgorithmVO> objectPageInfo = new PageInfo<>(algorithmVOS);
|
|
|
+ return new ResponseBodyVO<>(ResponseBodyVO.Response.SUCCESS, objectPageInfo);
|
|
|
+// //解析数据
|
|
|
+// final String json = algorithmList.getInfo();
|
|
|
+// Map jsonMap = JsonUtil.jsonToMap(json);
|
|
|
+// if (CollectionUtil.isNotEmpty(jsonMap)) {
|
|
|
+// Map<String, Object> dataMap = (Map<String, Object>) jsonMap.get("data");
|
|
|
+// if (CollectionUtil.isNotEmpty(dataMap)) {
|
|
|
+// List<Map<String, String>> contentList = (List<Map<String, String>>) dataMap.get("content");
|
|
|
+// if (CollectionUtil.isNotEmpty(contentList)) {
|
|
|
+// totalElements = (Integer) dataMap.get("totalElements");
|
|
|
+// if (totalElements > 0) {
|
|
|
+// for (Map<String, String> content : contentList) {
|
|
|
+// AlgorithmVO vo = new AlgorithmVO();
|
|
|
+// String id0 = content.get("id");
|
|
|
+// String algorithmId0 = content.get("algorithmId");
|
|
|
+// String algorithmName0 = content.get("algorithmName");
|
|
|
+// String description0 = content.get("description");
|
|
|
+// String evaluationName0 = content.get("evaluationName");
|
|
|
+// String teamName0 = content.get("teamName");
|
|
|
+// String match0 = content.get("match");
|
|
|
+// vo.setId(id0);
|
|
|
+// vo.setAlgorithmCode(algorithmId0);
|
|
|
+// vo.setAlgorithmName(algorithmName0);
|
|
|
+// vo.setDescription(description0);
|
|
|
+// vo.setAlgorithmVersion(evaluationName0);
|
|
|
+// vo.setTeam(teamName0);
|
|
|
+// vo.setTopic(match0);
|
|
|
+// vo.setStatus(algorithmExpandMapper.selectStatusByAlgorithmId(algorithmId0));
|
|
|
+// vos.add(vo);
|
|
|
+// }
|
|
|
+// }
|
|
|
+// } else {
|
|
|
+// log.info("算法列表接口返回值中的 data.content 字段为空:" + contentList);
|
|
|
+// }
|
|
|
+// } else {
|
|
|
+// log.info("算法列表接口返回值中的 data 字段为空:" + dataMap);
|
|
|
+// }
|
|
|
+// } else {
|
|
|
+// log.info("算法列表接口返回值为空:" + json);
|
|
|
+// }
|
|
|
|
|
|
- ResponseBodyVO<String> algorithmList = algoPlatformService.getAlgorithmList(urlParam);
|
|
|
-
|
|
|
-
|
|
|
- List<AlgorithmVO> vos = new ArrayList<>();
|
|
|
- int totalElements = 0;
|
|
|
- //解析数据
|
|
|
- final String json = algorithmList.getInfo();
|
|
|
- Map jsonMap = JsonUtil.jsonToMap(json);
|
|
|
- if (CollectionUtil.isNotEmpty(jsonMap)) {
|
|
|
- Map<String, Object> dataMap = (Map<String, Object>) jsonMap.get("data");
|
|
|
- if (CollectionUtil.isNotEmpty(dataMap)) {
|
|
|
- List<Map<String, String>> contentList = (List<Map<String, String>>) dataMap.get("content");
|
|
|
- if (CollectionUtil.isNotEmpty(contentList)) {
|
|
|
- totalElements = (Integer) dataMap.get("totalElements");
|
|
|
- if (totalElements > 0) {
|
|
|
- for (Map<String, String> content : contentList) {
|
|
|
- AlgorithmVO vo = new AlgorithmVO();
|
|
|
- vo.setId(content.get("id"));
|
|
|
- vo.setAlgorithmCode(content.get("algorithmId"));
|
|
|
- vo.setAlgorithmName(content.get("algorithmName"));
|
|
|
- vo.setDescription(content.get("description"));
|
|
|
- vos.add(vo);
|
|
|
- }
|
|
|
- }
|
|
|
- } else {
|
|
|
- log.info("算法列表接口返回值中的 data.content 字段为空:" + contentList);
|
|
|
- }
|
|
|
- } else {
|
|
|
- log.info("算法列表接口返回值中的 data 字段为空:" + dataMap);
|
|
|
- }
|
|
|
- } else {
|
|
|
- log.info("算法列表接口返回值为空:" + json);
|
|
|
- }
|
|
|
|
|
|
- PageInfo<AlgorithmVO> objectPageInfo = new PageInfo<>(vos);
|
|
|
- objectPageInfo.setTotal(totalElements);
|
|
|
- return new ResponseBodyVO<>(ResponseBodyVO.Response.SUCCESS, objectPageInfo);
|
|
|
}
|
|
|
|
|
|
|