dzx преди 6 месеца
родител
ревизия
d4ca14dd28

+ 4 - 0
src/main/java/com/xjrsoft/module/student/service/IBaseStudentScholarshipReleaseService.java

@@ -6,6 +6,8 @@ import com.xjrsoft.module.student.dto.BaseStudentScholarshipReleasePageDto;
 import com.xjrsoft.module.student.entity.BaseStudentScholarshipRelease;
 import com.xjrsoft.module.student.vo.BaseStudentScholarshipReleasePageVo;
 
+import java.util.List;
+
 /**
 * @title: 奖学金发放记录表
 * @Author dzx
@@ -16,4 +18,6 @@ import com.xjrsoft.module.student.vo.BaseStudentScholarshipReleasePageVo;
 public interface IBaseStudentScholarshipReleaseService extends MPJBaseService<BaseStudentScholarshipRelease> {
 
     Page<BaseStudentScholarshipReleasePageVo> getPage(Page<BaseStudentScholarshipReleasePageVo> page, BaseStudentScholarshipReleasePageDto dto);
+
+    Boolean remove(List<Long> ids);
 }

+ 20 - 0
src/main/java/com/xjrsoft/module/student/service/impl/BaseStudentScholarshipReleaseServiceImpl.java

@@ -1,15 +1,21 @@
 package com.xjrsoft.module.student.service.impl;
 
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.github.yulichang.base.MPJBaseServiceImpl;
+import com.xjrsoft.module.room.entity.RoomBed;
 import com.xjrsoft.module.student.dto.BaseStudentScholarshipReleasePageDto;
+import com.xjrsoft.module.student.entity.BaseStudentScholarshipApplicant;
 import com.xjrsoft.module.student.entity.BaseStudentScholarshipRelease;
+import com.xjrsoft.module.student.mapper.BaseStudentScholarshipApplicantMapper;
 import com.xjrsoft.module.student.mapper.BaseStudentScholarshipReleaseMapper;
 import com.xjrsoft.module.student.service.IBaseStudentScholarshipReleaseService;
 import com.xjrsoft.module.student.vo.BaseStudentScholarshipReleasePageVo;
 import lombok.AllArgsConstructor;
 import org.springframework.stereotype.Service;
 
+import java.util.List;
+
 /**
 * @title: 奖学金发放记录表
 * @Author dzx
@@ -19,8 +25,22 @@ import org.springframework.stereotype.Service;
 @Service
 @AllArgsConstructor
 public class BaseStudentScholarshipReleaseServiceImpl extends MPJBaseServiceImpl<BaseStudentScholarshipReleaseMapper, BaseStudentScholarshipRelease> implements IBaseStudentScholarshipReleaseService {
+    private BaseStudentScholarshipApplicantMapper applicantMapper;
     @Override
     public Page<BaseStudentScholarshipReleasePageVo> getPage(Page<BaseStudentScholarshipReleasePageVo> page, BaseStudentScholarshipReleasePageDto dto) {
         return this.baseMapper.getPage(page, dto);
     }
+
+    @Override
+    public Boolean remove(List<Long> ids) {
+        List<BaseStudentScholarshipApplicant> applicantList = applicantMapper.selectBatchIds(ids);
+        for (BaseStudentScholarshipApplicant applicant : applicantList) {
+            UpdateWrapper<BaseStudentScholarshipApplicant> updateWrapper = new UpdateWrapper<>();
+            updateWrapper.eq("id", applicant.getId());
+            updateWrapper.setSql("review_status = null");
+            applicantMapper.update(applicant, updateWrapper);
+        }
+
+        return this.removeBatchByIds(ids);
+    }
 }