Commit cb1a43a5 authored by 蒋凌峰's avatar 蒋凌峰 😉

提交

parent 4d3fbe35
......@@ -138,6 +138,10 @@ public class FncSubjectTypeController extends BaseController {
@Log(title = "科目类别", businessType = BusinessType.DELETE)
@GetMapping("/remove/{subjectTypeIds}")
public AjaxResult remove(@PathVariable Long[] subjectTypeIds) {
if (fncSubjectTypeService.hasChildByIds(subjectTypeIds))
{
return warn("存在子科目类别,不允许删除");
}
return toAjax(fncSubjectTypeService.removeByIds(Arrays.asList(subjectTypeIds)) ? 1 : 0);
}
}
......@@ -6,16 +6,16 @@ spring:
druid:
# 主库数据源
master:
url: jdbc:mysql://192.168.182.130:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
url: jdbc:mysql://localhost:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: root
password: root
# 从库数据源
slave:
# 从数据源开关/默认关闭
enabled: false
url:
username:
password:
url:
username:
password:
# 初始连接数
initialSize: 5
# 最小连接池数量
......@@ -35,7 +35,7 @@ spring:
testWhileIdle: true
testOnBorrow: false
testOnReturn: false
webStatFilter:
webStatFilter:
enabled: true
statViewServlet:
enabled: true
......@@ -54,4 +54,4 @@ spring:
merge-sql: true
wall:
config:
multi-statement-allow: true
\ No newline at end of file
multi-statement-allow: true
......@@ -37,5 +37,13 @@ public interface IFncSubjectTypeService extends IService<FncSubjectType> {
* @param subjectTypeId
* @return
*/
FncSubjectTypeVo queryById(Long subjectTypeId);
FncSubjectTypeVo queryById(Long subjectTypeId);
/**
* 根据ID集合查询是存在子科目类别
*
* @param subjectTypeIds
* @return
*/
boolean hasChildByIds(Long[] subjectTypeIds);
}
package com.ruoyi.system.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.utils.PageUtils;
......@@ -9,6 +11,7 @@ import com.ruoyi.system.mapper.FncSubjectTypeMapper;
import com.ruoyi.system.service.IFncSubjectTypeService;
import org.springframework.stereotype.Service;
import java.util.Arrays;
import java.util.List;
/**
......@@ -34,4 +37,10 @@ public class FncSubjectTypeServiceImpl extends ServiceImpl<FncSubjectTypeMapper,
public FncSubjectTypeVo queryById(Long subjectTypeId) {
return this.baseMapper.queryById(subjectTypeId);
}
//根据ID集合查询是存在子科目类别
@Override
public boolean hasChildByIds(Long[] subjectTypeIds) {
return this.baseMapper.selectCount(new LambdaQueryWrapper<FncSubjectType>().in(FncSubjectType::getParentId, Arrays.asList(subjectTypeIds))) > 0;
}
}
......@@ -65,6 +65,6 @@
</sql>
<sql id="search">
-- where A.delete_status = 1
</sql>
</mapper>
......@@ -145,6 +145,6 @@
</sql>
<sql id="search">
-- where A.delete_status = 1
</sql>
</mapper>
File added
......@@ -36,6 +36,7 @@ module.exports = {
// detail: https://cli.vuejs.org/config/#devserver-proxy
[process.env.VUE_APP_BASE_API]: {
target: `http://localhost:8080`,
// target: `http://120.79.23.199:8080/`,
changeOrigin: true,
pathRewrite: {
['^' + process.env.VUE_APP_BASE_API]: ''
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment