代码提交
This commit is contained in:
parent
5804985a6d
commit
ab1a4e68a7
|
|
@ -280,6 +280,10 @@ public class FileManagementController extends BaseController {
|
|||
@RequiresPermissions("file:manage:update")
|
||||
public R updateFileManage(@RequestBody @Validated DaKyProFilesContentsDto dto) {
|
||||
try {
|
||||
Integer child = fileManageMapper.getchild(dto);
|
||||
if (child > 0){
|
||||
return R.fail("该节点下有子集,无法修改");
|
||||
}
|
||||
Integer num = fileManageService.getMaxSort(dto);
|
||||
if (num == null) {
|
||||
num = 0;
|
||||
|
|
@ -301,6 +305,10 @@ public class FileManagementController extends BaseController {
|
|||
@RequiresPermissions("file:manage:del")
|
||||
public R delFileManage(@RequestBody DaKyProFilesContentsDto dto) {
|
||||
try {
|
||||
Integer child = fileManageMapper.getchild(dto);
|
||||
if (child > 0){
|
||||
return R.fail("该节点下有子集,无法修改");
|
||||
}
|
||||
Integer i = fileManageService.delFileManage(dto);
|
||||
if (i > 0) {
|
||||
return R.ok();
|
||||
|
|
|
|||
|
|
@ -0,0 +1,52 @@
|
|||
package com.bonus.web.controller.system;
|
||||
|
||||
import com.bonus.common.annotation.RequiresPermissions;
|
||||
import com.bonus.common.core.controller.BaseController;
|
||||
import com.bonus.common.core.domain.AjaxResult;
|
||||
import com.bonus.common.core.page.TableDataInfo;
|
||||
import com.bonus.system.domain.SysConfig;
|
||||
import com.bonus.system.domain.SystemConfig;
|
||||
import com.bonus.system.service.ISystemConfigService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 参数配置 信息操作处理
|
||||
*
|
||||
* @author bonus
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/sys/config")
|
||||
public class SystemConfigController extends BaseController {
|
||||
@Autowired
|
||||
private ISystemConfigService configService;
|
||||
|
||||
/**
|
||||
* 获取参数配置列表
|
||||
*/
|
||||
@RequiresPermissions("sys:config:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(SystemConfig config) {
|
||||
startPage();
|
||||
List<SystemConfig> list = configService.list(config);
|
||||
return getDataTable(list);
|
||||
}
|
||||
@RequiresPermissions("sys:config:add")
|
||||
@PostMapping("/add")
|
||||
public AjaxResult add(@RequestBody SystemConfig config) {
|
||||
return configService.add(config);
|
||||
}
|
||||
@RequiresPermissions("sys:config:update")
|
||||
@PostMapping("/update")
|
||||
public AjaxResult update(@RequestBody SystemConfig config) {
|
||||
return configService.update(config);
|
||||
}
|
||||
@RequiresPermissions("sys:config:del")
|
||||
@PostMapping("/del")
|
||||
public AjaxResult del(@RequestBody SystemConfig config) {
|
||||
return configService.del(config);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -49,4 +49,6 @@ public interface FileManageMapper {
|
|||
DaKyProFilesContentsVo getFileById(Long id);
|
||||
|
||||
Integer getFilesNum(String proId);
|
||||
|
||||
Integer getchild(DaKyProFilesContentsDto dto);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -267,4 +267,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
left join da_ky_pro_files_contents dkpfc on dkfs.business_id = dkpfc.id
|
||||
WHERE dkfs.del_flag = '1' and dkpfc.level = 5 and dkpfc.pro_id = #{proId}
|
||||
</select>
|
||||
<select id="getchild" resultType="java.lang.Integer">
|
||||
SELECT
|
||||
count(dkpfc.id)
|
||||
FROM
|
||||
da_ky_pro_files_contents dkpfc
|
||||
left join da_ky_pro_files_contents dkpfc2 on dkpfc.parent_id = dkpfc2.id
|
||||
WHERE
|
||||
dkpfc.del_flag = '1' and dkpfc2.id = #{id}
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,26 @@
|
|||
package com.bonus.system.domain;
|
||||
|
||||
import com.bonus.common.annotation.Excel;
|
||||
import com.bonus.common.annotation.Excel.ColumnType;
|
||||
import com.bonus.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
/**
|
||||
* 参数配置表 sys_config
|
||||
*
|
||||
* @author bonus
|
||||
*/
|
||||
@Data
|
||||
public class SystemConfig extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Long configId;
|
||||
private String configName;
|
||||
private String configCode;
|
||||
private String useStatus;
|
||||
}
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
package com.bonus.system.mapper;
|
||||
|
||||
import com.bonus.common.core.domain.AjaxResult;
|
||||
import com.bonus.system.domain.SystemConfig;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author:liang.chao
|
||||
* @Date:2025/9/25 - 16:18
|
||||
*/
|
||||
@Mapper
|
||||
public interface ISystemConfigMapper {
|
||||
List<SystemConfig> list(SystemConfig config);
|
||||
|
||||
Integer add(SystemConfig config);
|
||||
|
||||
Integer update(SystemConfig config);
|
||||
|
||||
Integer del(SystemConfig config);
|
||||
}
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
package com.bonus.system.service;
|
||||
|
||||
import com.bonus.common.core.domain.AjaxResult;
|
||||
import com.bonus.system.domain.SysConfig;
|
||||
import com.bonus.system.domain.SystemConfig;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 参数配置 服务层
|
||||
*
|
||||
* @author bonus
|
||||
*/
|
||||
public interface ISystemConfigService {
|
||||
|
||||
List<SystemConfig> list(SystemConfig config);
|
||||
|
||||
AjaxResult add(SystemConfig config);
|
||||
|
||||
AjaxResult update(SystemConfig config);
|
||||
|
||||
AjaxResult del(SystemConfig config);
|
||||
}
|
||||
|
|
@ -0,0 +1,56 @@
|
|||
package com.bonus.system.service.impl;
|
||||
|
||||
import com.bonus.common.core.domain.AjaxResult;
|
||||
import com.bonus.system.domain.SysConfig;
|
||||
import com.bonus.system.domain.SystemConfig;
|
||||
import com.bonus.system.mapper.ISystemConfigMapper;
|
||||
import com.bonus.system.service.ISystemConfigService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author:liang.chao
|
||||
* @Date:2025/9/25 - 16:15
|
||||
*/
|
||||
@Service
|
||||
public class SystemConfigServiceImpl implements ISystemConfigService {
|
||||
@Autowired
|
||||
private ISystemConfigMapper systemConfigMapper;
|
||||
|
||||
@Override
|
||||
public List<SystemConfig> list(SystemConfig config) {
|
||||
return systemConfigMapper.list(config);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult add(SystemConfig config) {
|
||||
Integer add = systemConfigMapper.add(config);
|
||||
if (add > 0) {
|
||||
return AjaxResult.success("添加成功");
|
||||
} else {
|
||||
return AjaxResult.error("添加失败");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult update(SystemConfig config) {
|
||||
Integer update = systemConfigMapper.update(config);
|
||||
if (update > 0) {
|
||||
return AjaxResult.success("修改成功");
|
||||
} else {
|
||||
return AjaxResult.error("修改失败");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult del(SystemConfig config) {
|
||||
Integer del = systemConfigMapper.del(config);
|
||||
if (del > 0) {
|
||||
return AjaxResult.success("删除成功");
|
||||
} else {
|
||||
return AjaxResult.error("删除失败");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.bonus.system.mapper.ISystemConfigMapper">
|
||||
<insert id="add">
|
||||
insert into da_ky_system_config(config_name, config_code, use_status)
|
||||
values(#{configName}, #{configCode}, #{useStatus})
|
||||
</insert>
|
||||
|
||||
<update id="update">
|
||||
update da_ky_system_config
|
||||
<set>
|
||||
<if test="configName != null and configName !=''">
|
||||
config_name = #{configName},
|
||||
</if>
|
||||
<if test="configCode != null and configCode !=''">
|
||||
config_code = #{configCode},
|
||||
</if>
|
||||
<if test="useStatus != null and useStatus !=''">
|
||||
use_status = #{useStatus},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
<delete id="del">
|
||||
delete from da_ky_system_config where id = #{id}
|
||||
</delete>
|
||||
|
||||
<select id="list" resultType="com.bonus.system.domain.SystemConfig">
|
||||
select id,
|
||||
config_name as configName,
|
||||
config_code as configCode,
|
||||
use_status as useStatus
|
||||
from da_ky_system_config
|
||||
</select>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue