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

提交

parent 4d3fbe35
...@@ -138,6 +138,10 @@ public class FncSubjectTypeController extends BaseController { ...@@ -138,6 +138,10 @@ public class FncSubjectTypeController extends BaseController {
@Log(title = "科目类别", businessType = BusinessType.DELETE) @Log(title = "科目类别", businessType = BusinessType.DELETE)
@GetMapping("/remove/{subjectTypeIds}") @GetMapping("/remove/{subjectTypeIds}")
public AjaxResult remove(@PathVariable Long[] subjectTypeIds) { public AjaxResult remove(@PathVariable Long[] subjectTypeIds) {
if (fncSubjectTypeService.hasChildByIds(subjectTypeIds))
{
return warn("存在子科目类别,不允许删除");
}
return toAjax(fncSubjectTypeService.removeByIds(Arrays.asList(subjectTypeIds)) ? 1 : 0); return toAjax(fncSubjectTypeService.removeByIds(Arrays.asList(subjectTypeIds)) ? 1 : 0);
} }
} }
...@@ -6,16 +6,16 @@ spring: ...@@ -6,16 +6,16 @@ spring:
druid: druid:
# 主库数据源 # 主库数据源
master: 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 username: root
password: root password: root
# 从库数据源 # 从库数据源
slave: slave:
# 从数据源开关/默认关闭 # 从数据源开关/默认关闭
enabled: false enabled: false
url: url:
username: username:
password: password:
# 初始连接数 # 初始连接数
initialSize: 5 initialSize: 5
# 最小连接池数量 # 最小连接池数量
...@@ -35,7 +35,7 @@ spring: ...@@ -35,7 +35,7 @@ spring:
testWhileIdle: true testWhileIdle: true
testOnBorrow: false testOnBorrow: false
testOnReturn: false testOnReturn: false
webStatFilter: webStatFilter:
enabled: true enabled: true
statViewServlet: statViewServlet:
enabled: true enabled: true
...@@ -54,4 +54,4 @@ spring: ...@@ -54,4 +54,4 @@ spring:
merge-sql: true merge-sql: true
wall: wall:
config: config:
multi-statement-allow: true multi-statement-allow: true
\ No newline at end of file
...@@ -37,5 +37,13 @@ public interface IFncSubjectTypeService extends IService<FncSubjectType> { ...@@ -37,5 +37,13 @@ public interface IFncSubjectTypeService extends IService<FncSubjectType> {
* @param subjectTypeId * @param subjectTypeId
* @return * @return
*/ */
FncSubjectTypeVo queryById(Long subjectTypeId); FncSubjectTypeVo queryById(Long subjectTypeId);
/**
* 根据ID集合查询是存在子科目类别
*
* @param subjectTypeIds
* @return
*/
boolean hasChildByIds(Long[] subjectTypeIds);
} }
package com.ruoyi.system.service.impl; 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.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.utils.PageUtils; import com.ruoyi.common.utils.PageUtils;
...@@ -9,6 +11,7 @@ import com.ruoyi.system.mapper.FncSubjectTypeMapper; ...@@ -9,6 +11,7 @@ import com.ruoyi.system.mapper.FncSubjectTypeMapper;
import com.ruoyi.system.service.IFncSubjectTypeService; import com.ruoyi.system.service.IFncSubjectTypeService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.Arrays;
import java.util.List; import java.util.List;
/** /**
...@@ -34,4 +37,10 @@ public class FncSubjectTypeServiceImpl extends ServiceImpl<FncSubjectTypeMapper, ...@@ -34,4 +37,10 @@ public class FncSubjectTypeServiceImpl extends ServiceImpl<FncSubjectTypeMapper,
public FncSubjectTypeVo queryById(Long subjectTypeId) { public FncSubjectTypeVo queryById(Long subjectTypeId) {
return this.baseMapper.queryById(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 @@ ...@@ -65,6 +65,6 @@
</sql> </sql>
<sql id="search"> <sql id="search">
-- where A.delete_status = 1
</sql> </sql>
</mapper> </mapper>
...@@ -145,6 +145,6 @@ ...@@ -145,6 +145,6 @@
</sql> </sql>
<sql id="search"> <sql id="search">
-- where A.delete_status = 1
</sql> </sql>
</mapper> </mapper>
File added
...@@ -36,6 +36,7 @@ module.exports = { ...@@ -36,6 +36,7 @@ module.exports = {
// detail: https://cli.vuejs.org/config/#devserver-proxy // detail: https://cli.vuejs.org/config/#devserver-proxy
[process.env.VUE_APP_BASE_API]: { [process.env.VUE_APP_BASE_API]: {
target: `http://localhost:8080`, target: `http://localhost:8080`,
// target: `http://120.79.23.199:8080/`,
changeOrigin: true, changeOrigin: true,
pathRewrite: { pathRewrite: {
['^' + process.env.VUE_APP_BASE_API]: '' ['^' + 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