Эх сурвалжийг харах

Merge remote-tracking branch 'origin/master'

martin 3 жил өмнө
parent
commit
d6fafa0317

+ 12 - 0
simulation-resource-server/src/main/java/com/css/simulation/resource/algorithm/ctrl/AlgorithmCtrl.java

@@ -110,4 +110,16 @@ public class AlgorithmCtrl {
     public ResponseBodyVO testConnection(@RequestBody AlgorithmParameter param){
         return service.testConnection(param);
     }
+
+    /**
+     * 首页文件数量
+     * @param
+     * @return
+     */
+    @RequestMapping("selectDetailsBySy")
+    @ResponseBody
+    public ResponseBodyVO selectDetailsBySy(){
+        return service.selectDetailsBySy();
+    }
+
 }

+ 2 - 0
simulation-resource-server/src/main/java/com/css/simulation/resource/algorithm/mapper/AlgorithmMapper.java

@@ -31,4 +31,6 @@ public interface AlgorithmMapper {
     List<RunningProjectVO> selectRunningProject(@Param("id") String id);
 
     List<AlgorithmVO> selectSharedAlgorithmList(AlgorithmParameter param);
+
+    int  selectDetailsBySy(AlgorithmParameter param);
 }

+ 2 - 0
simulation-resource-server/src/main/java/com/css/simulation/resource/algorithm/service/AlgorithmService.java

@@ -24,4 +24,6 @@ public interface AlgorithmService {
     ResponseBodyVO shareAlgorithm(AlgorithmParameter param);
 
     ResponseBodyVO testConnection(AlgorithmParameter param);
+
+    ResponseBodyVO selectDetailsBySy();
 }

+ 16 - 0
simulation-resource-server/src/main/java/com/css/simulation/resource/algorithm/serviceImpl/AlgorithmServiceImpl.java

@@ -19,6 +19,7 @@ import com.github.pagehelper.PageInfo;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import java.io.IOException;
+import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
@@ -209,6 +210,7 @@ public class AlgorithmServiceImpl implements AlgorithmService {
             po.setIsDeleted("0");
             po.setCreateTime(TimeUtil.getNowForMysql());
             po.setCreateUserId(AuthUtil.getCurrentUserId());
+            po.setModifyTime(TimeUtil.getNowForMysql());
         }
         return po;
 
@@ -225,4 +227,18 @@ public class AlgorithmServiceImpl implements AlgorithmService {
         return "";
     }
 
+    @Override
+    public ResponseBodyVO selectDetailsBySy() {
+        AlgorithmParameter param=new AlgorithmParameter();
+        param.setUploadMode("1");
+        param.setShare("0");
+        int fileNum= algorithmMapper.selectDetailsBySy(param);
+        param.setUploadMode("2");
+        int pathNum= algorithmMapper.selectDetailsBySy(param);
+        Map map=new HashMap();
+        map.put("fileNum",fileNum);
+        map.put("pathNum",pathNum);
+        return new ResponseBodyVO<>(ResponseBodyVO.Response.SUCCESS,map);
+    }
+
 }

+ 6 - 7
simulation-resource-server/src/main/java/com/css/simulation/resource/scene/service/ScenePackageService.java

@@ -58,7 +58,7 @@ public class ScenePackageService {
         po.setCreateUserId(AuthUtil.getCurrentUserId());
 
         List<ScenePackageSublistPO> poList = new ArrayList<>();
-        List<ScenePackageSublistPO> treeList = instShareListTree(listSublictTree, uuId, uuId, poList, "0");
+        List<ScenePackageSublistPO> treeList = instShareListTree(listSublictTree, uuId, uuId, poList, "0",1);
         if (treeList == null || treeList.size() < 1) {
             return new ResponseBodyVO(ResponseBodyVO.Response.CLIENT_FAILURE, "指标数据为空,请检查");
         }
@@ -100,7 +100,7 @@ public class ScenePackageService {
         po.setIsDeleted("0");
         po.setShare("0");
         List<ScenePackageSublistPO> poList = new ArrayList<>();
-        List<ScenePackageSublistPO> treeList = instShareListTree(listSublictTree, po.getPackageId(), po.getPackageId(), poList, "0");
+        List<ScenePackageSublistPO> treeList = instShareListTree(listSublictTree, po.getPackageId(), po.getPackageId(), poList, "0",1);
         if (treeList == null || treeList.size() < 1) {
             return new ResponseBodyVO(ResponseBodyVO.Response.CLIENT_FAILURE, "指标数据为空,请检查");
         }
@@ -231,7 +231,7 @@ public class ScenePackageService {
         scenePackageMapper.saveScenePackage(po);
         List<ScenePackageSublistPO> poList = new ArrayList<>();
         List<ScenePackageSublistVO> listSublist = selectScenePackageSubListTree(null, true, params.getPackageId());
-        List<ScenePackageSublistPO> treeList = instShareListTree(listSublist, uuId, uuId, poList, "1");
+        List<ScenePackageSublistPO> treeList = instShareListTree(listSublist, uuId, uuId, poList, "1",1);
         scenePackageSublistMapper.saveScenePackageSublistAll(treeList);
         return new ResponseBodyVO(ResponseBodyVO.Response.SUCCESS);
     }
@@ -245,11 +245,11 @@ public class ScenePackageService {
      */
     public List<ScenePackageSublistPO> instShareListTree(List<ScenePackageSublistVO> parentVoList,
                                        String scenePackageId, String rootId, List<ScenePackageSublistPO> poList
-            , String share) {
+            , String share,Integer a) {
         {
             //获取子节点集合
-            int a = 1;
             for (int i = 0; i < parentVoList.size(); i++) {
+                a++;
                 ScenePackageSublistPO params = new ScenePackageSublistPO();
                 BeanUtils.copyProperties(parentVoList.get(i), params);
                 params.setParentId(scenePackageId);
@@ -267,11 +267,10 @@ public class ScenePackageService {
                 poList.add(params);
                 if (cvoList != null && cvoList.size() > 0) {
                     //继续查找下一节点
-                    instShareListTree(cvoList, uuId, rootId, poList, share);
+                    instShareListTree(cvoList, uuId, rootId, poList, share,a);
                 }
                 parentVoList.remove(parentVoList.get(i));
                 i--;
-                a++;
             }
         }
 

+ 17 - 0
simulation-resource-server/src/main/resources/mapper/algorithm/AlgorithmMapper.xml

@@ -158,4 +158,21 @@
         where id=#{id,jdbcType=VARCHAR}
     </update>
 
+    <!--查询算法数量首页-->
+    <select id="selectDetailsBySy" parameterType="api.common.pojo.param.algorithm.AlgorithmParameter" resultType="java.lang.Integer">
+        select count(id)
+        from algorithm
+        where
+        is_deleted = '0'
+        <if test="createUserId != null and createUserId != ''">
+            and create_user_id=#{createUserId,jdbcType=VARCHAR}
+        </if>
+        <if test="share != null and share != ''">
+            and share=#{share}
+        </if>
+        <if test="uploadMode != null and uploadMode != ''">
+            and upload_mode=#{uploadMode}
+        </if>
+
+    </select>
 </mapper>