Bladeren bron

评价模块调整

dzx 1 maand geleden
bovenliggende
commit
aeec7876d8

+ 2 - 2
src/main/java/com/xjrsoft/module/evaluate/service/impl/EvaluateObjectServiceImpl.java

@@ -163,7 +163,7 @@ public class EvaluateObjectServiceImpl extends MPJBaseServiceImpl<EvaluateObject
                 " SELECT id FROM evaluate_object WHERE evaluate_manage_id = #{dto.evaluateManageId}";
         if(dto.getObjectList() != null && !dto.getObjectList().isEmpty()){
             List<String> gradeIds = dto.getObjectList().stream().map(AddEvaluateObjectDto::getGradeId).collect(Collectors.toList());
-            delSql += " and base_grade_id = (" + gradeIds.toString().replace("[", "").replace("]", "") + ")";
+            delSql += " and base_grade_id in (" + gradeIds.toString().replace("[", "").replace("]", "") + ")";
         }
         delSql += ")";
         SqlRunnerAdapter.db().delete(delSql);
@@ -171,7 +171,7 @@ public class EvaluateObjectServiceImpl extends MPJBaseServiceImpl<EvaluateObject
         delSql = "DELETE FROM evaluate_object WHERE evaluate_manage_id = " + dto.getEvaluateManageId();
         if(dto.getObjectList() != null && !dto.getObjectList().isEmpty()){
             List<String> gradeIds = dto.getObjectList().stream().map(AddEvaluateObjectDto::getGradeId).collect(Collectors.toList());
-            delSql += " and base_grade_id = (" + gradeIds.toString().replace("[", "").replace("]", "") + ")";
+            delSql += " and base_grade_id in (" + gradeIds.toString().replace("[", "").replace("]", "") + ")";
         }
         SqlRunnerAdapter.db().delete(delSql);
 

+ 3 - 9
src/main/java/com/xjrsoft/module/evaluate/service/impl/EvaluateResultServiceImpl.java

@@ -11,6 +11,7 @@ import com.github.yulichang.wrapper.MPJLambdaWrapper;
 import com.xjrsoft.common.enums.DeleteMark;
 import com.xjrsoft.common.enums.EnabledMark;
 import com.xjrsoft.common.model.result.RT;
+import com.xjrsoft.common.mybatis.SqlRunnerAdapter;
 import com.xjrsoft.common.page.ConventPage;
 import com.xjrsoft.module.base.entity.BaseClass;
 import com.xjrsoft.module.evaluate.dto.AddEvaluateResultDto;
@@ -313,15 +314,8 @@ public class EvaluateResultServiceImpl extends MPJBaseServiceImpl<EvaluateResult
 
         if(dto.getSubmitType() != null && dto.getSubmitType() == 2){
             //评价结果保存
-            evaluateResultMapper.delete(
-                    new QueryWrapper<EvaluateResult>().lambda()
-                            .eq(EvaluateResult::getSubmitRecordId, mobileResultPageVo.getEvaluateSubmitRecordId())
-            );
-
-            evaluateSubmitRecordMapper.delete(
-                    new QueryWrapper<EvaluateSubmitRecord>().lambda()
-                            .eq(EvaluateSubmitRecord::getId, mobileResultPageVo.getEvaluateSubmitRecordId())
-            );
+            String delSql = "DELETE FROM evaluate_result WHERE submit_record_id = '" + mobileResultPageVo.getEvaluateSubmitRecordId() + "'";
+            SqlRunnerAdapter.db().delete(delSql);
         }
 
         List<AddEvaluateResultDto> resultList = dto.getResultList();