|
@@ -4,21 +4,25 @@ import api.common.pojo.param.algorithm.AlgorithmParameter;
|
|
|
import api.common.pojo.param.system.DictParam;
|
|
|
import api.common.pojo.po.algorithm.AlgorithmPO;
|
|
|
import api.common.pojo.constants.DictConstants;
|
|
|
-import api.common.util.JgitUtil;
|
|
|
-import api.common.util.StringUtil;
|
|
|
+import api.common.util.*;
|
|
|
import api.common.pojo.vo.algorithm.AlgorithmVO;
|
|
|
import api.common.pojo.vo.algorithm.RunningProjectVO;
|
|
|
-import api.common.util.TimeUtil;
|
|
|
import com.css.simulation.resource.common.utils.AuthUtil;
|
|
|
import com.css.simulation.resource.common.utils.PageUtil;
|
|
|
import com.css.simulation.resource.algorithm.mapper.AlgorithmMapper;
|
|
|
import com.css.simulation.resource.algorithm.service.AlgorithmService;
|
|
|
+import com.css.simulation.resource.feign.AlgoPlatformService;
|
|
|
import com.css.simulation.resource.system.service.DictService;
|
|
|
import com.github.pagehelper.PageInfo;
|
|
|
+import org.apache.http.client.config.RequestConfig;
|
|
|
+import org.apache.http.impl.client.CloseableHttpClient;
|
|
|
import org.eclipse.jgit.lib.Ref;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
+import javax.annotation.Resource;
|
|
|
+import java.io.IOException;
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
@@ -26,6 +30,9 @@ import java.util.Map;
|
|
|
@Service
|
|
|
public class AlgorithmServiceImpl implements AlgorithmService {
|
|
|
|
|
|
+ @Resource
|
|
|
+ AlgoPlatformService algoPlatformService;
|
|
|
+
|
|
|
@Autowired
|
|
|
private AlgorithmMapper algorithmMapper;
|
|
|
|
|
@@ -68,7 +75,7 @@ public class AlgorithmServiceImpl implements AlgorithmService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public ResponseBodyVO selectAlgorithmList(AlgorithmParameter param) {
|
|
|
+ public ResponseBodyVO selectAlgorithmList(AlgorithmParameter param){
|
|
|
param.setIsDeleted("0");
|
|
|
param.setCreateUserId(AuthUtil.getCurrentUserId());
|
|
|
PageUtil.setPageInfo(param);
|
|
@@ -79,6 +86,58 @@ public class AlgorithmServiceImpl implements AlgorithmService {
|
|
|
return new ResponseBodyVO<>(ResponseBodyVO.Response.SUCCESS,new PageInfo<>(vos));
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public ResponseBodyVO selectAlgoPlatformList(AlgorithmParameter param){
|
|
|
+ //获取参数
|
|
|
+ String algorithmId = param.getAlgorithmCode();
|
|
|
+ String algorithmName = param.getAlgorithmName();
|
|
|
+ String description = param.getDescription();
|
|
|
+ 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(algorithmName)){
|
|
|
+ urlParam = urlParam + "&algorithmName=" + algorithmName;
|
|
|
+ }
|
|
|
+ if (StringUtil.isNotEmpty(description)){
|
|
|
+ urlParam = urlParam + "&description=" + description;
|
|
|
+ }
|
|
|
+ if (StringUtil.isNotEmpty(page)){
|
|
|
+ urlParam = urlParam + "&page=" + page;
|
|
|
+ }
|
|
|
+ if (StringUtil.isNotEmpty(size)){
|
|
|
+ urlParam = urlParam + "&size=" + size;
|
|
|
+ }
|
|
|
+ urlParam = urlParam + "&sort=" + sort;
|
|
|
+
|
|
|
+ ResponseBodyVO algorithmList = algoPlatformService.getAlgorithmList(urlParam);
|
|
|
+
|
|
|
+ //解析数据
|
|
|
+ Map jsonMap = JsonUtil.jsonToMap((String) algorithmList.getInfo());
|
|
|
+ Map<String, Object> dataMap = (Map<String, Object>) jsonMap.get("data");
|
|
|
+ List<Map<String, String>> contentList = (List<Map<String, String>>) dataMap.get("content");
|
|
|
+ Integer totalElements = (Integer) dataMap.get("totalElements");
|
|
|
+ List<AlgorithmVO> vos = new ArrayList<>();
|
|
|
+ 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);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ PageInfo<AlgorithmVO> objectPageInfo = new PageInfo<>(vos);
|
|
|
+ objectPageInfo.setTotal(totalElements);
|
|
|
+
|
|
|
+ return new ResponseBodyVO<>(ResponseBodyVO.Response.SUCCESS,objectPageInfo);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
@Override
|
|
|
public ResponseBodyVO selectSharedAlgorithmList(AlgorithmParameter param) {
|
|
|
param.setShare("1");
|