|
|
@@ -19,8 +19,12 @@ import org.jeecg.common.util.ImportExcelUtil;
|
|
|
import org.jeecg.common.util.RedisUtil;
|
|
|
import org.jeecg.common.util.oConvertUtils;
|
|
|
import org.jeecg.config.mybatis.MybatisPlusSaasConfig;
|
|
|
+import org.jeecg.modules.system.app.entity.AppCourses;
|
|
|
import org.jeecg.modules.system.app.entity.AppSite;
|
|
|
+import org.jeecg.modules.system.app.entity.AppSitePlace;
|
|
|
+import org.jeecg.modules.system.app.mapper.AppCoursesMapper;
|
|
|
import org.jeecg.modules.system.app.mapper.AppSiteMapper;
|
|
|
+import org.jeecg.modules.system.app.mapper.AppSitePlaceMapper;
|
|
|
import org.jeecg.modules.system.entity.SysDepart;
|
|
|
import org.jeecg.modules.system.entity.SysUser;
|
|
|
import org.jeecg.modules.system.entity.SysUserDepart;
|
|
|
@@ -80,6 +84,10 @@ public class SysDepartController {
|
|
|
private AppSiteMapper appSiteMapper;
|
|
|
@Resource
|
|
|
private SysUserDepartMapper sysUserDepartMapper;
|
|
|
+ @Resource
|
|
|
+ private AppCoursesMapper appCoursesMapper;
|
|
|
+ @Resource
|
|
|
+ private AppSitePlaceMapper appSitePlaceMapper;
|
|
|
/**
|
|
|
* 查询数据 查出我的部门,并以树结构数据格式响应给前端
|
|
|
*
|
|
|
@@ -263,6 +271,12 @@ public class SysDepartController {
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
+ if(!appCoursesMapper.selectList(Wrappers.<AppCourses>lambdaQuery().eq(AppCourses::getOrgCode, sysDepart.getOrgCode())).isEmpty()){
|
|
|
+ throw new JeecgBootException("存在课程请先下架课程!");
|
|
|
+ }
|
|
|
+ if(!appSitePlaceMapper.selectList(Wrappers.<AppSitePlace>lambdaQuery().eq(AppSitePlace::getOrgCode, sysDepart.getOrgCode())).isEmpty()){
|
|
|
+ throw new JeecgBootException("存在场地请先下架场地!");
|
|
|
+ }
|
|
|
if(sysDepart==null) {
|
|
|
result.error500("未找到对应实体");
|
|
|
}else {
|
|
|
@@ -305,6 +319,14 @@ public class SysDepartController {
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
+ if(!appCoursesMapper.selectList(Wrappers.<AppCourses>lambdaQuery()
|
|
|
+ .eq(AppCourses::getOrgCode, sysDepartMapper.getDepartById(sysDepart).getOrgCode())).isEmpty()){
|
|
|
+ throw new JeecgBootException("存在课程请先下架课程!");
|
|
|
+ }
|
|
|
+ if(!appSitePlaceMapper.selectList(Wrappers.<AppSitePlace>lambdaQuery()
|
|
|
+ .eq(AppSitePlace::getOrgCode, sysDepartMapper.getDepartById(sysDepart).getOrgCode())).isEmpty()){
|
|
|
+ throw new JeecgBootException("存在场地请先下架场地!");
|
|
|
+ }
|
|
|
appSiteMapper.delete(Wrappers.<AppSite>lambdaQuery()
|
|
|
.eq(AppSite::getOrgCode, sysDepartMapper.getDepartById(sysDepart).getOrgCode()));
|
|
|
});
|