Quellcode durchsuchen

Merge branch 'master' of https://gitee.com/lingxinmeng/simulation-cloud

wangyaodong vor 2 Jahren
Ursprung
Commit
eee9aa2c3c

+ 2 - 1
simulation-resource-server/src/main/java/com/css/simulation/resource/project/impl/SimulationProjectServiceImpl.java

@@ -2639,7 +2639,8 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
                 File file = new File(param.getLocalPdfFilePath());
                 os = new BufferedOutputStream(Files.newOutputStream(file.toPath()));
             } else {
-                String fileName = vo.getProjectId() + "_" + vo.getProjectName();
+//                String fileName = vo.getProjectId() + "_" + vo.getProjectName();
+                String fileName = vo.getAlgorithmName() + "评价报告";
                 response.setContentType("application/x-download");
                 response.addHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(fileName, "UTF-8") + ".pdf");
                 os = new BufferedOutputStream(response.getOutputStream());

+ 3 - 0
simulation-resource-server/src/main/java/com/css/simulation/resource/scene/mapper/ScenePackageMapper.java

@@ -2,6 +2,7 @@ package com.css.simulation.resource.scene.mapper;
 
 import api.common.pojo.param.scene.ScenePackageParam;
 import api.common.pojo.po.scene.ScenePackagePO;
+import api.common.pojo.po.scene.ScoringRulesPO;
 import api.common.pojo.vo.scene.ScenePackageNewVO;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
@@ -57,4 +58,6 @@ public interface ScenePackageMapper {
             "where package_id in\n" +
             "      (select root_id from scene_package_sublist where scene_traffic_ids like concat('%', #{sceneId}, '%'))")
     void updateSceneNumAfterDeleteSceneByAccidentId(@Param("sceneId") String sceneId);
+    //删除打分规则时同步把测试包改变状态为禁用
+    void updateIsUnavailable3(ScoringRulesPO params);
 }

+ 5 - 1
simulation-resource-server/src/main/java/com/css/simulation/resource/scene/service/ScoringRulesService.java

@@ -6,6 +6,7 @@ import api.common.util.LogUtil;
 import api.common.util.StringUtil;
 import api.common.util.TimeUtil;
 import com.css.simulation.resource.common.utils.AuthUtil;
+import com.css.simulation.resource.scene.mapper.ScenePackageMapper;
 import com.css.simulation.resource.scene.mapper.ScoringRulesMapper;
 import lombok.SneakyThrows;
 import lombok.extern.slf4j.Slf4j;
@@ -19,7 +20,8 @@ public class ScoringRulesService {
 
     @Resource
     private ScoringRulesMapper scoringRulesMapper;
-
+    @Resource
+    ScenePackageMapper scenePackageMapper;
     /**
      * 打分规则数据录入:
      */
@@ -88,6 +90,8 @@ public class ScoringRulesService {
         params.setModifyTime(TimeUtil.getNowForMysql());
         params.setModifyUserId(AuthUtil.getCurrentUserId());
         scoringRulesMapper.updateScoringRules(params);
+        //同步把使用该评分规则的测试包设为禁用
+        scenePackageMapper.updateIsUnavailable3(params);
         LogUtil.delete();
     }
 

+ 1 - 1
simulation-resource-server/src/main/resources/mapper/project/SimulationProjectMapper.xml

@@ -746,7 +746,7 @@
     <select id="selectScenePackageBaseByIdGy" resultType="api.common.pojo.po.scene.ScenePackagePO">
 
         select package_id,package_name, scene_num,share,modify_time
-        from scene_package where share = '1' and is_deleted = '0'
+        from scene_package where share = '1' and is_deleted = '0'  and is_unavailable = '0'
          order by modify_time desc
     </select>
     <!--获取场景包基本信息-->

+ 7 - 0
simulation-resource-server/src/main/resources/mapper/scene/ScenePackageMapper.xml

@@ -237,4 +237,11 @@
         </set>
         where package_id = #{packageId}
     </update>
+    <update id="updateIsUnavailable3" parameterType="api.common.pojo.po.scene.ScoringRulesPO">
+        update simulation.scene_package
+        set is_unavailable = '1',
+                modify_user_id = #{modifyUserId},
+                modify_time = #{modifyTime}
+        where is_deleted = '0' and package_id in (select root_id from scene_package_sublist where package_and_rules=#{rulesId} and is_deleted = '0' GROUP BY root_id)
+    </update>
 </mapper>