文件分类命名规范识别管理
This commit is contained in:
parent
9f32e36cae
commit
cc795dde63
|
|
@ -0,0 +1,85 @@
|
|||
package com.bonus.web.controller.archive;
|
||||
|
||||
import com.bonus.common.annotation.RequiresPermissions;
|
||||
import com.bonus.common.annotation.SysLog;
|
||||
import com.bonus.common.core.controller.BaseController;
|
||||
import com.bonus.common.core.domain.R;
|
||||
import com.bonus.common.core.page.TableDataInfo;
|
||||
import com.bonus.common.enums.OperaType;
|
||||
import com.bonus.web.domain.DaKyProFilesContentsDto;
|
||||
import com.bonus.web.domain.FilesClassifyNameStandardDto;
|
||||
import com.bonus.web.domain.ProjectDto;
|
||||
import com.bonus.web.service.FilesClassifyNameStandardService;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author:liang.chao
|
||||
* @Date:2025/9/12 - 10:38
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/classifyNameStandard")
|
||||
@Slf4j
|
||||
public class FilesClassifyNameStandardController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private FilesClassifyNameStandardService service;
|
||||
|
||||
@ApiOperation(value = "文件分类命名规范识别列表")
|
||||
@GetMapping("list")
|
||||
@SysLog(title = "文件分类命名规范识别列表", module = "档案分类管理->文件分类命名规范识别管理", businessType = OperaType.QUERY, details = "文件分类命名规范识别列表", logType = 1)
|
||||
@RequiresPermissions("classify:standard:list")
|
||||
public TableDataInfo getClassifyNameStandardList(FilesClassifyNameStandardDto dto) {
|
||||
try {
|
||||
startPage();
|
||||
List<FilesClassifyNameStandardDto> list = service.getClassifyNameStandardList(dto);
|
||||
return getDataTable(list);
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
return getDataTable(new ArrayList<>());
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation(value = "新增文件分类命名规范识别")
|
||||
@PostMapping("add")
|
||||
@SysLog(title = "新增文件分类命名规范识别", module = "档案分类管理->文件分类命名规范识别管理", businessType = OperaType.INSERT, details = "新增文件分类命名规范识别", logType = 1)
|
||||
@RequiresPermissions("classify:standard:add")
|
||||
public R saveClassifyNameStandard(@RequestBody FilesClassifyNameStandardDto dto) {
|
||||
try {
|
||||
return service.add(dto);
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
return R.fail("请求出错了");
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation(value = "新增文件分类命名规范识别")
|
||||
@PostMapping("edit")
|
||||
@SysLog(title = "新增文件分类命名规范识别", module = "档案分类管理->文件分类命名规范识别管理", businessType = OperaType.INSERT, details = "新增文件分类命名规范识别", logType = 1)
|
||||
@RequiresPermissions("classify:standard:edit")
|
||||
public R updateClassifyNameStandard(@RequestBody FilesClassifyNameStandardDto dto) {
|
||||
try {
|
||||
return service.edit(dto);
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
return R.fail("请求出错了");
|
||||
}
|
||||
}
|
||||
@ApiOperation(value = "删除文件分类命名规范识别")
|
||||
@PostMapping("del")
|
||||
@SysLog(title = "删除文件分类命名规范识别", module = "档案分类管理->文件分类命名规范识别管理", businessType = OperaType.INSERT, details = "删除文件分类命名规范识别", logType = 1)
|
||||
@RequiresPermissions("classify:standard:del")
|
||||
public R delClassifyNameStandard(@RequestBody FilesClassifyNameStandardDto dto) {
|
||||
try {
|
||||
return service.del(dto);
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
return R.fail("请求出错了");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
package com.bonus.web.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author:liang.chao
|
||||
* @Date:2025/9/12 - 10:37
|
||||
*/
|
||||
@Data
|
||||
public class FilesClassifyNameStandardDto {
|
||||
private Integer id;
|
||||
private String standardType;
|
||||
private String standardName;
|
||||
private String remark;
|
||||
private String createTime;
|
||||
private String updateTime;
|
||||
private Integer createUserId;
|
||||
private String createUserName;
|
||||
private Integer updateUserId;
|
||||
private String updateUserName;
|
||||
private String delFlag;
|
||||
}
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
package com.bonus.web.mapper;
|
||||
|
||||
import com.bonus.web.domain.FilesClassifyNameStandardDto;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author:liang.chao
|
||||
* @Date:2025/9/12 - 10:44
|
||||
*/
|
||||
@Mapper
|
||||
public interface FilesClassifyNameStandardMapper {
|
||||
List<FilesClassifyNameStandardDto> getClassifyNameStandardList(FilesClassifyNameStandardDto dto);
|
||||
|
||||
Integer selectClassifyNameStandard(FilesClassifyNameStandardDto dto);
|
||||
|
||||
Integer add(FilesClassifyNameStandardDto dto);
|
||||
|
||||
Integer edit(FilesClassifyNameStandardDto dto);
|
||||
|
||||
Integer del(FilesClassifyNameStandardDto dto);
|
||||
}
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
package com.bonus.web.service;
|
||||
|
||||
import com.bonus.common.core.domain.R;
|
||||
import com.bonus.web.domain.DaKyProFilesContentsDto;
|
||||
import com.bonus.web.domain.FilesClassifyNameStandardDto;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author:liang.chao
|
||||
* @Date:2025/9/12 - 10:43
|
||||
*/
|
||||
public interface FilesClassifyNameStandardService {
|
||||
List<FilesClassifyNameStandardDto> getClassifyNameStandardList(FilesClassifyNameStandardDto dto);
|
||||
|
||||
R add(FilesClassifyNameStandardDto dto);
|
||||
|
||||
R edit(FilesClassifyNameStandardDto dto);
|
||||
|
||||
R del(FilesClassifyNameStandardDto dto);
|
||||
}
|
||||
|
|
@ -0,0 +1,58 @@
|
|||
package com.bonus.web.service.impl;
|
||||
|
||||
import com.bonus.common.core.domain.R;
|
||||
import com.bonus.web.domain.DaKyProFilesContentsDto;
|
||||
import com.bonus.web.domain.FilesClassifyNameStandardDto;
|
||||
import com.bonus.web.mapper.FilesClassifyNameStandardMapper;
|
||||
import com.bonus.web.service.FilesClassifyNameStandardService;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static com.bonus.common.utils.SecurityUtils.getLoginUser;
|
||||
|
||||
/**
|
||||
* @Author:liang.chao
|
||||
* @Date:2025/9/12 - 10:43
|
||||
*/
|
||||
@Service
|
||||
public class FilesClassifyNameStandardServiceImpl implements FilesClassifyNameStandardService {
|
||||
|
||||
@Autowired
|
||||
private FilesClassifyNameStandardMapper filesClassifyNameStandardMapper;
|
||||
@Override
|
||||
public List<FilesClassifyNameStandardDto> getClassifyNameStandardList(FilesClassifyNameStandardDto dto) {
|
||||
return filesClassifyNameStandardMapper.getClassifyNameStandardList(dto);
|
||||
}
|
||||
|
||||
@Override
|
||||
public R add(FilesClassifyNameStandardDto dto) {
|
||||
dto.setCreateUserId(getLoginUser().getUserId().intValue());
|
||||
dto.setCreateUserName(getLoginUser().getUsername());
|
||||
// 查询档案名称是否重复
|
||||
Integer i = filesClassifyNameStandardMapper.selectClassifyNameStandard(dto);
|
||||
if (i > 0) {
|
||||
return R.fail("规范识别值已重复");
|
||||
}
|
||||
return R.ok(filesClassifyNameStandardMapper.add(dto));
|
||||
}
|
||||
|
||||
@Override
|
||||
public R edit(FilesClassifyNameStandardDto dto) {
|
||||
dto.setUpdateUserId(getLoginUser().getUserId().intValue());
|
||||
dto.setUpdateUserName(getLoginUser().getUsername());
|
||||
// 查询档案名称是否重复
|
||||
Integer i = filesClassifyNameStandardMapper.selectClassifyNameStandard(dto);
|
||||
if (i > 0) {
|
||||
return R.fail("规范识别值已重复");
|
||||
}
|
||||
return R.ok(filesClassifyNameStandardMapper.edit(dto));
|
||||
}
|
||||
|
||||
@Override
|
||||
public R del(FilesClassifyNameStandardDto dto) {
|
||||
return R.ok(filesClassifyNameStandardMapper.del(dto));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,71 @@
|
|||
<?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.web.mapper.FilesClassifyNameStandardMapper">
|
||||
<insert id="add">
|
||||
INSERT INTO da_ky_files_classify_name_standard
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="standardType != null and standardType != ''">standard_type,</if>
|
||||
<if test="standardName != null and standardName != ''">standard_name,</if>
|
||||
<if test="remark != null and remark != ''">remark,</if>
|
||||
<if test="createUserId != null">create_user_id,</if>
|
||||
<if test="createUserName != null and createUserName != ''">create_user_name,</if>
|
||||
<if test="delFlag != null and delFlag != ''">del_flag,</if>
|
||||
create_time
|
||||
</trim>
|
||||
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="standardType != null and standardType != ''">#{standardType},</if>
|
||||
<if test="standardName != null and standardName != ''">#{standardName},</if>
|
||||
<if test="remark != null and remark != ''">#{remark},</if>
|
||||
<if test="createUserId != null">#{createUserId},</if>
|
||||
<if test="createUserName != null and createUserName != ''">#{createUserName},</if>
|
||||
<if test="delFlag != null and delFlag != ''">#{delFlag},</if>
|
||||
now()
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="edit">
|
||||
UPDATE da_ky_files_classify_name_standard
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="standardType != null and standardType != ''">standard_type = #{standardType},</if>
|
||||
<if test="standardName != null and standardName != ''">standard_name = #{standardName},</if>
|
||||
<if test="remark != null and remark != ''">remark = #{remark},</if>
|
||||
<if test="updateUserId != null">update_user_id = #{updateUserId},</if>
|
||||
<if test="updateUserName != null and updateUserName != ''">update_user_name = #{updateUserName},</if>
|
||||
<if test="delFlag != null and delFlag != ''">del_flag = #{delFlag},</if>
|
||||
update_time = NOW()
|
||||
</trim>
|
||||
WHERE id = #{id} AND del_flag = '1'
|
||||
</update>
|
||||
<delete id="del">
|
||||
DELETE FROM da_ky_files_classify_name_standard
|
||||
WHERE id = #{id}
|
||||
</delete>
|
||||
|
||||
<select id="getClassifyNameStandardList" resultType="com.bonus.web.domain.FilesClassifyNameStandardDto">
|
||||
SELECT
|
||||
dkfcns.id,
|
||||
dkfcns.standard_type AS standardType,
|
||||
dkfcns.standard_name AS standardName,
|
||||
dkfcns.remark,
|
||||
dkfcns.create_time AS createTime,
|
||||
dkfcns.update_time AS updateTime,
|
||||
dkfcns.create_user_id AS createUserId,
|
||||
dkfcns.create_user_name AS createUserName,
|
||||
dkfcns.update_user_id AS updateUserId,
|
||||
dkfcns.update_user_name AS updateUserName,
|
||||
dkfcns.del_flag AS delFlag
|
||||
FROM da_ky_files_classify_name_standard dkfcns
|
||||
LEFT JOIN da_ky_sys_dict_data dksdd ON dkfcns.standard_type = dksdd.dict_value and dksdd.dict_type = 'files_classify_name_standard_type'
|
||||
WHERE dkfcns.del_flag = '1'
|
||||
ORDER BY dkfcns.create_time DESC
|
||||
</select>
|
||||
<select id="selectClassifyNameStandard" resultType="java.lang.Integer">
|
||||
select count(*) from da_ky_files_classify_name_standard where del_flag = '1' and standard_type = #{standardType} and standard_name = #{standardName}
|
||||
<if test="id != null">
|
||||
and id != #{id}
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue