Commit d4aa5774 authored by wdy's avatar wdy

删除细则时删除对应状态为处理中的结果

parent 4517ea4e
...@@ -21,6 +21,7 @@ public interface ReviewEnterpriseArchiveMapper extends BaseMapper<ReviewEnterpri ...@@ -21,6 +21,7 @@ public interface ReviewEnterpriseArchiveMapper extends BaseMapper<ReviewEnterpri
List<ReviewEnterpriseArchive> findByTaskId(@Param("taskId") Long taskId); List<ReviewEnterpriseArchive> findByTaskId(@Param("taskId") Long taskId);
// 剔除细则被删除而结果保留的数据
List<ReviewEnterpriseArchiveViewItemVO> findViewItemVOByTaskId(@Param("taskId") Long taskId); List<ReviewEnterpriseArchiveViewItemVO> findViewItemVOByTaskId(@Param("taskId") Long taskId);
Long findFileName(@Param("taskId") Long taskId,@Param("fileName") String fileName); Long findFileName(@Param("taskId") Long taskId,@Param("fileName") String fileName);
......
...@@ -66,7 +66,7 @@ public class StrategyReviewSceneChangeDelete implements StrategyReviewSceneChang ...@@ -66,7 +66,7 @@ public class StrategyReviewSceneChangeDelete implements StrategyReviewSceneChang
reviewDetailsService.removeBatchByIds(reviewDetailsList); reviewDetailsService.removeBatchByIds(reviewDetailsList);
} }
// 删除细则对应的结果 // 删除细则对应的结果 (问卷是进行中的结果)
List<ReviewDetailsResult> resultList = reviewDetailsResultMapper.findByDetailsList(reviewDetailsList); List<ReviewDetailsResult> resultList = reviewDetailsResultMapper.findByDetailsList(reviewDetailsList);
if (resultList != null && resultList.size() != 0) { if (resultList != null && resultList.size() != 0) {
reviewDetailsResultMapper.deleteBatchIds(resultList); reviewDetailsResultMapper.deleteBatchIds(resultList);
...@@ -85,7 +85,7 @@ public class StrategyReviewSceneChangeDelete implements StrategyReviewSceneChang ...@@ -85,7 +85,7 @@ public class StrategyReviewSceneChangeDelete implements StrategyReviewSceneChang
// 删除细则 // 删除细则
reviewDetailsService.removeById(reviewSceneChangeTask.getDetailsId()); reviewDetailsService.removeById(reviewSceneChangeTask.getDetailsId());
// 删除细则对应的结果 // 删除细则对应的结果 (问卷是进行中的结果)
List<ReviewDetailsResult> resultList = reviewDetailsResultMapper.findByDetailsId(reviewSceneChangeTask.getDetailsId()); List<ReviewDetailsResult> resultList = reviewDetailsResultMapper.findByDetailsId(reviewSceneChangeTask.getDetailsId());
if (resultList != null && resultList.size() != 0) { if (resultList != null && resultList.size() != 0) {
reviewDetailsResultMapper.deleteBatchIds(resultList); reviewDetailsResultMapper.deleteBatchIds(resultList);
......
...@@ -39,8 +39,12 @@ ...@@ -39,8 +39,12 @@
WHERE passed = 0 AND task_id = #{taskId} WHERE passed = 0 AND task_id = #{taskId}
</select> </select>
<select id="findByDetailsList" resultType="com.ruoyi.domain.ReviewDetailsResult"> <select id="findByDetailsList" resultType="com.ruoyi.domain.ReviewDetailsResult">
SELECT id, passed, comment, images_url, review_details_id, task_id, user_id, user_name, last_modify_time, catalogue, review_enterprise_archive_id SELECT tr.id, tr.passed, tr.comment, tr.images_url, tr.review_details_id, tr.task_id, tr.user_id, tr.user_name, tr.last_modify_time, tr.catalogue, tr.review_enterprise_archive_id
FROM t_review_details_result WHERE review_details_id IN FROM t_review_details_result tr
LEFT JOIN t_system_review_task ts ON ts.id = tr.task_id
LEFT JOIN t_car_review_task tc ON tc.id = tr.task_id
WHERE (ts.task_status = 'PENDING' OR tc.task_status = 'PENDING')
AND tr.review_details_id IN
<foreach collection="reviewDetailsList" item="details" open="(" separator="," close=")"> <foreach collection="reviewDetailsList" item="details" open="(" separator="," close=")">
#{details.id} #{details.id}
</foreach> </foreach>
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
LEFT JOIN t_review_keypoint keypoint ON details.review_keypoint_id = keypoint.id LEFT JOIN t_review_keypoint keypoint ON details.review_keypoint_id = keypoint.id
LEFT JOIN t_review_standard standard ON keypoint.review_standard_id = standard.id LEFT JOIN t_review_standard standard ON keypoint.review_standard_id = standard.id
LEFT JOIN t_review_enterprise_archive archive ON result.review_enterprise_archive_id = archive.id LEFT JOIN t_review_enterprise_archive archive ON result.review_enterprise_archive_id = archive.id
WHERE result.task_id = #{taskId}; WHERE result.task_id = #{taskId} AND details.id IS NOT NULL;
</select> </select>
<select id="findFileName" resultType="java.lang.Long"> <select id="findFileName" resultType="java.lang.Long">
select COUNT(*) sum from t_review_enterprise_archive select COUNT(*) sum from t_review_enterprise_archive
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment