提交 2648754c 作者: dingtalk_nnkplh

修改学校的删除逻辑,当删除学校的时候会将学校相关的专业,图册,入学时间等所有信息都删除

上级 3cf1460a
...@@ -54,6 +54,7 @@ public interface TbEnrollmentTimeMapper ...@@ -54,6 +54,7 @@ public interface TbEnrollmentTimeMapper
* @return 结果 * @return 结果
*/ */
public int deleteTbEnrollmentTimeById(Long id); public int deleteTbEnrollmentTimeById(Long id);
public int deleteTbEnrollmentTimeBySchoolId(Long id);
/** /**
* 批量删除入学时间 * 批量删除入学时间
...@@ -62,4 +63,6 @@ public interface TbEnrollmentTimeMapper ...@@ -62,4 +63,6 @@ public interface TbEnrollmentTimeMapper
* @return 结果 * @return 结果
*/ */
public int deleteTbEnrollmentTimeByIds(String[] ids); public int deleteTbEnrollmentTimeByIds(String[] ids);
public int deleteTbEnrollmentTimeBySchoolIds(String[] ids);
} }
...@@ -53,6 +53,8 @@ public interface TbSchoolAtlasMapper ...@@ -53,6 +53,8 @@ public interface TbSchoolAtlasMapper
*/ */
public int deleteTbSchoolAtlasById(Long id); public int deleteTbSchoolAtlasById(Long id);
public int deleteTbSchoolAtlasBySchoolId(Long id);
/** /**
* 批量删除学校图册 * 批量删除学校图册
* *
...@@ -60,4 +62,6 @@ public interface TbSchoolAtlasMapper ...@@ -60,4 +62,6 @@ public interface TbSchoolAtlasMapper
* @return 结果 * @return 结果
*/ */
public int deleteTbSchoolAtlasByIds(String[] ids); public int deleteTbSchoolAtlasByIds(String[] ids);
public int deleteTbSchoolAtlasBySchoolIds(String[] ids);
} }
...@@ -65,6 +65,8 @@ public interface TbSchoolEntranceRequirementsMapper ...@@ -65,6 +65,8 @@ public interface TbSchoolEntranceRequirementsMapper
*/ */
public int deleteTbSchoolEntranceRequirementsById(Long id); public int deleteTbSchoolEntranceRequirementsById(Long id);
public int deleteTbSchoolEntranceRequirementsBySchoolId(Long id);
/** /**
* 批量删除入学要求 * 批量删除入学要求
* *
...@@ -72,4 +74,6 @@ public interface TbSchoolEntranceRequirementsMapper ...@@ -72,4 +74,6 @@ public interface TbSchoolEntranceRequirementsMapper
* @return 结果 * @return 结果
*/ */
public int deleteTbSchoolEntranceRequirementsByIds(String[] ids); public int deleteTbSchoolEntranceRequirementsByIds(String[] ids);
public int deleteTbSchoolEntranceRequirementsBySchoolIds(String[] ids);
} }
...@@ -53,6 +53,8 @@ public interface TbSchoolFacilitiesMapper ...@@ -53,6 +53,8 @@ public interface TbSchoolFacilitiesMapper
*/ */
public int deleteTbSchoolFacilitiesById(Long id); public int deleteTbSchoolFacilitiesById(Long id);
public int deleteTbSchoolFacilitiesBySchoolId(Long id);
/** /**
* 批量删除学校设施 * 批量删除学校设施
* *
...@@ -60,4 +62,6 @@ public interface TbSchoolFacilitiesMapper ...@@ -60,4 +62,6 @@ public interface TbSchoolFacilitiesMapper
* @return 结果 * @return 结果
*/ */
public int deleteTbSchoolFacilitiesByIds(String[] ids); public int deleteTbSchoolFacilitiesByIds(String[] ids);
public int deleteTbSchoolFacilitiesBySchoolIds(String[] ids);
} }
...@@ -63,6 +63,7 @@ public interface TbSchoolMajorMapper ...@@ -63,6 +63,7 @@ public interface TbSchoolMajorMapper
* @return 结果 * @return 结果
*/ */
public int deleteTbSchoolMajorById(Long id); public int deleteTbSchoolMajorById(Long id);
public int deleteTbSchoolMajorBySchoolId(Long id);
/** /**
* 批量删除学校专业 * 批量删除学校专业
...@@ -71,4 +72,6 @@ public interface TbSchoolMajorMapper ...@@ -71,4 +72,6 @@ public interface TbSchoolMajorMapper
* @return 结果 * @return 结果
*/ */
public int deleteTbSchoolMajorByIds(String[] ids); public int deleteTbSchoolMajorByIds(String[] ids);
public int deleteTbSchoolMajorBySchoolIds(String[] ids);
} }
...@@ -53,6 +53,8 @@ public interface TbSchoolPartnersMapper ...@@ -53,6 +53,8 @@ public interface TbSchoolPartnersMapper
*/ */
public int deleteTbSchoolPartnersById(Long id); public int deleteTbSchoolPartnersById(Long id);
public int deleteTbSchoolPartnersBySchoolId(Long id);
/** /**
* 批量删除合作院校 * 批量删除合作院校
* *
...@@ -60,4 +62,6 @@ public interface TbSchoolPartnersMapper ...@@ -60,4 +62,6 @@ public interface TbSchoolPartnersMapper
* @return 结果 * @return 结果
*/ */
public int deleteTbSchoolPartnersByIds(String[] ids); public int deleteTbSchoolPartnersByIds(String[] ids);
public int deleteTbSchoolPartnersBySchoolIds(String[] ids);
} }
...@@ -53,6 +53,8 @@ public interface TbSchoolUploadMaterialMapper ...@@ -53,6 +53,8 @@ public interface TbSchoolUploadMaterialMapper
*/ */
public int deleteTbSchoolUploadMaterialById(Long id); public int deleteTbSchoolUploadMaterialById(Long id);
public int deleteTbSchoolUploadMaterialBySchoolId(Long id);
/** /**
* 批量删除学校上传的材料 * 批量删除学校上传的材料
* *
...@@ -60,4 +62,6 @@ public interface TbSchoolUploadMaterialMapper ...@@ -60,4 +62,6 @@ public interface TbSchoolUploadMaterialMapper
* @return 结果 * @return 结果
*/ */
public int deleteTbSchoolUploadMaterialByIds(String[] ids); public int deleteTbSchoolUploadMaterialByIds(String[] ids);
public int deleteTbSchoolUploadMaterialBySchoolIds(String[] ids);
} }
...@@ -62,7 +62,6 @@ public class TbSchoolAtlasServiceImpl implements ITbSchoolAtlasService ...@@ -62,7 +62,6 @@ public class TbSchoolAtlasServiceImpl implements ITbSchoolAtlasService
{ {
List<TbSchoolAtlas> list=tbSchoolAtlasMapper.selectTbSchoolAtlasList(tbSchoolAtlas); List<TbSchoolAtlas> list=tbSchoolAtlasMapper.selectTbSchoolAtlasList(tbSchoolAtlas);
list.stream().filter(tbSchoolAtlas1 -> { list.stream().filter(tbSchoolAtlas1 -> {
// TbSchool ts=tbSchoolMapper.selectTbSchoolById(tbSchoolAtlas1.getSchoolId());
tbSchoolAtlas1.setSchoolName(commonService.getSchoolCnName(tbSchoolAtlas1.getSchoolId())); tbSchoolAtlas1.setSchoolName(commonService.getSchoolCnName(tbSchoolAtlas1.getSchoolId()));
convertUserIDToString(tbSchoolAtlas1); convertUserIDToString(tbSchoolAtlas1);
return true; return true;
......
...@@ -7,15 +7,14 @@ import com.ruoyi.common.constant.Constants; ...@@ -7,15 +7,14 @@ import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.core.domain.entity.SysDictData; import com.ruoyi.common.core.domain.entity.SysDictData;
import com.ruoyi.common.core.domain.entity.SysUser; import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.system.mapper.SysDictDataMapper; import com.ruoyi.system.mapper.*;
import com.ruoyi.system.mapper.SysUserMapper;
import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.TbSchoolMapper;
import com.ruoyi.system.domain.TbSchool; import com.ruoyi.system.domain.TbSchool;
import com.ruoyi.system.service.ITbSchoolService; import com.ruoyi.system.service.ITbSchoolService;
import com.ruoyi.common.core.text.Convert; import com.ruoyi.common.core.text.Convert;
import org.springframework.transaction.annotation.Transactional;
/** /**
* 学校信息Service业务层处理 * 学校信息Service业务层处理
...@@ -35,6 +34,27 @@ public class TbSchoolServiceImpl implements ITbSchoolService ...@@ -35,6 +34,27 @@ public class TbSchoolServiceImpl implements ITbSchoolService
@Autowired @Autowired
private SysUserMapper sysUserMapper; private SysUserMapper sysUserMapper;
@Autowired
private TbSchoolMajorMapper tbSchoolMajorMapper;
@Autowired
private TbSchoolEntranceRequirementsMapper tbSchoolEntranceRequirementsMapper;
@Autowired
private TbSchoolFacilitiesMapper tbSchoolFacilitiesMapper;
@Autowired
private TbSchoolPartnersMapper tbSchoolPartnersMapper;
@Autowired
private TbSchoolUploadMaterialMapper tbSchoolUploadMaterialMapper;
@Autowired
private TbSchoolAtlasMapper tbSchoolAtlasMapper;
@Autowired
private TbEnrollmentTimeMapper tbEnrollmentTimeMapper;
/** /**
* 查询学校信息 * 查询学校信息
* *
...@@ -202,8 +222,16 @@ public class TbSchoolServiceImpl implements ITbSchoolService ...@@ -202,8 +222,16 @@ public class TbSchoolServiceImpl implements ITbSchoolService
* @return 结果 * @return 结果
*/ */
@Override @Override
@Transactional
public int deleteTbSchoolByIds(String ids) public int deleteTbSchoolByIds(String ids)
{ {
tbSchoolMajorMapper.deleteTbSchoolMajorBySchoolIds(Convert.toStrArray(ids));
tbSchoolEntranceRequirementsMapper.deleteTbSchoolEntranceRequirementsBySchoolIds(Convert.toStrArray(ids));
tbSchoolFacilitiesMapper.deleteTbSchoolFacilitiesBySchoolIds(Convert.toStrArray(ids));
tbSchoolPartnersMapper.deleteTbSchoolPartnersBySchoolIds(Convert.toStrArray(ids));
tbSchoolUploadMaterialMapper.deleteTbSchoolUploadMaterialBySchoolIds(Convert.toStrArray(ids));
tbSchoolAtlasMapper.deleteTbSchoolAtlasBySchoolIds(Convert.toStrArray(ids));
tbEnrollmentTimeMapper.deleteTbEnrollmentTimeBySchoolIds(Convert.toStrArray(ids));
return tbSchoolMapper.deleteTbSchoolByIds(Convert.toStrArray(ids)); return tbSchoolMapper.deleteTbSchoolByIds(Convert.toStrArray(ids));
} }
...@@ -214,8 +242,16 @@ public class TbSchoolServiceImpl implements ITbSchoolService ...@@ -214,8 +242,16 @@ public class TbSchoolServiceImpl implements ITbSchoolService
* @return 结果 * @return 结果
*/ */
@Override @Override
@Transactional
public int deleteTbSchoolById(Long id) public int deleteTbSchoolById(Long id)
{ {
tbSchoolMajorMapper.deleteTbSchoolMajorBySchoolId(id);
tbSchoolEntranceRequirementsMapper.deleteTbSchoolEntranceRequirementsBySchoolId(id);
tbSchoolFacilitiesMapper.deleteTbSchoolFacilitiesBySchoolId(id);
tbSchoolPartnersMapper.deleteTbSchoolPartnersBySchoolId(id);
tbSchoolUploadMaterialMapper.deleteTbSchoolUploadMaterialBySchoolId(id);
tbSchoolAtlasMapper.deleteTbSchoolAtlasBySchoolId(id);
tbEnrollmentTimeMapper.deleteTbEnrollmentTimeBySchoolId(id);
return tbSchoolMapper.deleteTbSchoolById(id); return tbSchoolMapper.deleteTbSchoolById(id);
} }
} }
...@@ -126,4 +126,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -126,4 +126,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</foreach> </foreach>
</delete> </delete>
<delete id="deleteTbEnrollmentTimeBySchoolId" parameterType="Long">
delete from tb_enrollment_time where school_id = #{id}
</delete>
<delete id="deleteTbEnrollmentTimeBySchoolIds" parameterType="String">
delete from tb_enrollment_time where school_id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper> </mapper>
\ No newline at end of file
...@@ -76,4 +76,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -76,4 +76,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</foreach> </foreach>
</delete> </delete>
<delete id="deleteTbSchoolAtlasBySchoolId" parameterType="Long">
delete from tb_school_atlas where school_id = #{id}
</delete>
<delete id="deleteTbSchoolAtlasBySchoolIds" parameterType="String">
delete from tb_school_atlas where school_id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper> </mapper>
\ No newline at end of file
...@@ -93,4 +93,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -93,4 +93,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</foreach> </foreach>
</delete> </delete>
<delete id="deleteTbSchoolEntranceRequirementsBySchoolId" parameterType="Long">
delete from tb_school_entrance_requirements where school_id = #{id}
</delete>
<delete id="deleteTbSchoolEntranceRequirementsBySchoolIds" parameterType="String">
delete from tb_school_entrance_requirements where school_id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper> </mapper>
\ No newline at end of file
...@@ -55,4 +55,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -55,4 +55,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</foreach> </foreach>
</delete> </delete>
<delete id="deleteTbSchoolFacilitiesBySchoolId" parameterType="Long">
delete from tb_school_facilities where school_id = #{id}
</delete>
<delete id="deleteTbSchoolFacilitiesBySchoolIds" parameterType="String">
delete from tb_school_facilities where school_id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper> </mapper>
\ No newline at end of file
...@@ -167,6 +167,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -167,6 +167,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
delete from tb_school_major where id = #{id} delete from tb_school_major where id = #{id}
</delete> </delete>
<delete id="deleteTbSchoolMajorBySchoolId" parameterType="Long">
delete from tb_school_major where school_id = #{id}
</delete>
<delete id="deleteTbSchoolMajorByIds" parameterType="String"> <delete id="deleteTbSchoolMajorByIds" parameterType="String">
delete from tb_school_major where id in delete from tb_school_major where id in
<foreach item="id" collection="array" open="(" separator="," close=")"> <foreach item="id" collection="array" open="(" separator="," close=")">
...@@ -174,4 +178,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -174,4 +178,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</foreach> </foreach>
</delete> </delete>
<delete id="deleteTbSchoolMajorBySchoolIds" parameterType="String">
delete from tb_school_major where school_id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper> </mapper>
\ No newline at end of file
...@@ -82,4 +82,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -82,4 +82,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</foreach> </foreach>
</delete> </delete>
<delete id="deleteTbSchoolPartnersBySchoolId" parameterType="Long">
delete from tb_school_partners where school_id = #{id}
</delete>
<delete id="deleteTbSchoolPartnersBySchoolIds" parameterType="String">
delete from tb_school_partners where school_id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper> </mapper>
\ No newline at end of file
...@@ -77,4 +77,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -77,4 +77,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</foreach> </foreach>
</delete> </delete>
<delete id="deleteTbSchoolUploadMaterialSchoolById" parameterType="Long">
delete from tb_school_upload_material where school_id = #{id}
</delete>
<delete id="deleteTbSchoolUploadMaterialBySchoolIds" parameterType="String">
delete from tb_school_upload_material where school_id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper> </mapper>
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论