diff --git a/src/main/java/com/swustoj/mapper/StageScoreMapper.java b/src/main/java/com/swustoj/mapper/StageScoreMapper.java index 1ffa3e473038a90ce9607abf8ab3c78c959bfd6d..5caa721c316aa4638ed08a2c8779a2ddea25b4fc 100644 --- a/src/main/java/com/swustoj/mapper/StageScoreMapper.java +++ b/src/main/java/com/swustoj/mapper/StageScoreMapper.java @@ -31,4 +31,13 @@ public interface StageScoreMapper extends BaseMapper { * @return 进度条信息 */ List getStuStageInfo(StageScore stageScore); + + /** + * 删除错误的数据 + * @param enrollId + * @param stage + * @param stuArr + */ + void deleteIfExist(@Param("recruitmentId")Integer enrollId, @Param("stage") Integer stage, + @Param("stuArr") List stuArr); } diff --git a/src/main/java/com/swustoj/service/Impl/RecruitmentServiceImpl.java b/src/main/java/com/swustoj/service/Impl/RecruitmentServiceImpl.java index c1474c64b74195375d08a7482694eadaaba571df..c0dac2926b00a53fdda753956c627845bc7cdf61 100644 --- a/src/main/java/com/swustoj/service/Impl/RecruitmentServiceImpl.java +++ b/src/main/java/com/swustoj/service/Impl/RecruitmentServiceImpl.java @@ -77,6 +77,8 @@ public class RecruitmentServiceImpl implements RecruitmentService { stageScoreMapper.insert(new StageScore(null, student_id, studentDTO.getEnrollId(), null, studentDTO.getStage() + 1, 0, null)); } + }else{ + stageScoreMapper.deleteIfExist(studentDTO.getEnrollId(),studentDTO.getStage(),studentDTO.getStuArr()); } } // 发送相关通过或未通过的邮件 diff --git a/src/main/resources/com/swustoj/mapper/StageScoreMapper.xml b/src/main/resources/com/swustoj/mapper/StageScoreMapper.xml index 86f3492b8cc9d7e32d3630ef725f62e09079a542..438bbe4780144b4cae092610f78f321f3bf8dc2e 100644 --- a/src/main/resources/com/swustoj/mapper/StageScoreMapper.xml +++ b/src/main/resources/com/swustoj/mapper/StageScoreMapper.xml @@ -29,4 +29,20 @@ + + delete from + stage_score + where + recruitment_id = #{recruitmentId} + and + stage = #{stage} + and + student_id in + + + #{student_id} + + + + \ No newline at end of file