项目代码提交

This commit is contained in:
liang.chao 2025-11-05 16:53:56 +08:00
parent ee4ad7e831
commit 448fc7f78f
16 changed files with 414 additions and 2 deletions

View File

@ -0,0 +1,86 @@
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.AjaxResult;
import com.bonus.common.core.page.TableDataInfo;
import com.bonus.common.enums.OperaType;
import com.bonus.web.domain.ArchivedSettingDto;
import com.bonus.web.domain.FileIndexDto;
import com.bonus.web.domain.FilesClassifyMarkDto;
import com.bonus.web.service.FileIndexService;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
/**
* @Authorliang.chao
* @Date2025/10/30 - 16:20
*/
@RestController
@RequestMapping("/FileIndex")
@Slf4j
public class FileIndexController extends BaseController {
@Resource
private FileIndexService fileIndexService;
@ApiOperation(value = "档案索引列表")
@GetMapping("query")
@SysLog(title = "档案索引列表", module = "数据/档案移交->档案索引", businessType = OperaType.QUERY, details = "档案索引", logType = 1)
@RequiresPermissions("file:index:query")
public TableDataInfo getFileIndex(FileIndexDto dto) {
try {
startPage();
List<FileIndexDto> list = fileIndexService.getList(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("file:index:add")
public AjaxResult addFileIndex(@RequestBody @Validated FileIndexDto dto) {
try {
return fileIndexService.add(dto);
} catch (Exception e) {
log.error(e.toString(), e);
return AjaxResult.error("请求出错了");
}
}
@ApiOperation(value = "修改档案索引")
@PostMapping("update")
@SysLog(title = "修改档案索引", module = "数据/档案移交->修改档案索引", businessType = OperaType.UPDATE, details = "修改档案索引", logType = 1)
@RequiresPermissions("file:index:edit")
public AjaxResult updateFileIndex(@RequestBody @Validated FileIndexDto dto) {
try {
return fileIndexService.update(dto);
} catch (Exception e) {
log.error(e.toString(), e);
return AjaxResult.error("请求出错了");
}
}
@ApiOperation(value = "删除档案索引")
@PostMapping("del")
@SysLog(title = "删除档案索引", module = "数据/档案移交->删除档案索引", businessType = OperaType.DELETE, details = "删除档案索引", logType = 1)
@RequiresPermissions("file:index:del")
public AjaxResult delFileIndex(@RequestBody FileIndexDto dto) {
try {
return fileIndexService.del(dto);
} catch (Exception e) {
log.error(e.toString(), e);
return AjaxResult.error("请求出错了");
}
}
}

View File

@ -20,6 +20,8 @@ import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.List;
import static com.bonus.common.utils.SecurityUtils.getLoginUser;
/**
* @Authorliang.chao
* @Date2025/9/15 - 11:24
@ -39,6 +41,7 @@ public class TransferApplyController extends BaseController {
public TableDataInfo getTransferApplyList(TransferApplyDto dto) {
try {
startPage();
dto.setUserId(getLoginUser().getUserId().toString());
List<TransferApplyDto> list = transferApplyService.list(dto);
return getDataTable(list);
} catch (Exception e) {

View File

@ -62,4 +62,44 @@ public class SysEncryTypeController extends BaseController {
}
}
// 新增文件加密类型
@GetMapping("/listFile")
@SysLog(title = "档案文件加密类型列表", module = "数据档案移交->档案加密类型管理", businessType = OperaType.QUERY, details = "档案加密类型列表", logType = 1)
@RequiresPermissions("encry:type:list")
public TableDataInfo listFile(SysEncryType sysEncryType) {
startPage();
List<SysEncryType> list = encryTypeService.selectSysEncryTypeListFile(sysEncryType);
return getDataTable(list);
}
@PostMapping("addEncryTypeFile")
@SysLog(title = "新增档案文件加密类型", module = "数据档案移交->档案加密类型管理", businessType = OperaType.INSERT, details = "新增档案加密类型", logType = 1)
@RequiresPermissions("encry:type:add")
public R addEncryTypeFile(@RequestBody @Validated SysEncryType sysEncryType) {
return encryTypeService.addFile(sysEncryType);
}
@PostMapping("editEncryTypeFile")
@SysLog(title = "修改档案文件加密类型", module = "数据档案移交->档案加密类型管理", businessType = OperaType.UPDATE, details = "修改档案加密类型", logType = 1)
@RequiresPermissions("encry:type:edit")
public R editEncryTypeFile(@RequestBody @Validated SysEncryType sysEncryType) {
return encryTypeService.editFile(sysEncryType);
}
@PostMapping("delEncryTypeFile")
@SysLog(title = "删除档案文件加密类型", module = "数据档案移交->档案加密类型管理", businessType = OperaType.DELETE, details = "删除档案加密类型", logType = 1)
@RequiresPermissions("encry:type:del")
public R delEncryTypeFile(@RequestBody SysEncryType sysEncryType) {
Integer delNum = encryTypeService.delFile(sysEncryType);
if (delNum > 0) {
return R.ok();
} else {
return R.fail("删除失败");
}
}
}

View File

@ -38,7 +38,7 @@ public class FileShareController extends BaseController {
* @param kyDataClassify
* @return
*/
@RequiresPermissions("file:share:listAll")
@RequiresPermissions("file:share:list")
@GetMapping("/listAll")
public TableDataInfo listAll(KyDataClassify kyDataClassify)
{

View File

@ -0,0 +1,27 @@
package com.bonus.web.domain;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
/**
* @Authorliang.chao
* @Date2025/10/30 - 16:24
*/
@Data
public class FileIndexDto {
private String id;
@NotBlank(message = "文件名称不能为空")
@Length(max = 32, message = "文件名称不能超过32个字符")
private String fileName;
@NotBlank(message = "文件内容不能为空")
@Length(max = 200, message = "文件内容不能超过200个字符")
private String fileContent;
@NotBlank(message = "文件目录不能为空")
@Length(max = 200, message = "文件目录不能超过200个字符")
private String filePath;
@NotBlank
private String saveDate;
}

View File

@ -126,6 +126,7 @@ public class TransferApplyDto {
* 是否删除0.删除 1.未删除
*/
private String delFlag;
private String userId;
private List<TransferFileDto> transferFileDtos;
}

View File

@ -0,0 +1,23 @@
package com.bonus.web.mapper;
import com.bonus.common.core.domain.AjaxResult;
import com.bonus.web.domain.FileIndexDto;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* @Authorliang.chao
* @Date2025/10/30 - 16:30
*/
@Mapper
public interface FileIndexMapper {
List<FileIndexDto> getList(FileIndexDto dto);
Integer add(FileIndexDto dto);
Integer update(FileIndexDto dto);
Integer del(FileIndexDto dto);
}

View File

@ -0,0 +1,21 @@
package com.bonus.web.service;
import com.bonus.common.core.domain.AjaxResult;
import com.bonus.web.domain.FileIndexDto;
import java.util.List;
/**
* @Authorliang.chao
* @Date2025/10/30 - 16:21
*/
public interface FileIndexService {
List<FileIndexDto> getList(FileIndexDto dto);
AjaxResult add(FileIndexDto dto);
AjaxResult update(FileIndexDto dto);
AjaxResult del(FileIndexDto dto);
}

View File

@ -0,0 +1,43 @@
package com.bonus.web.service.impl;
import com.bonus.common.core.domain.AjaxResult;
import com.bonus.web.domain.FileIndexDto;
import com.bonus.web.mapper.FileIndexMapper;
import com.bonus.web.service.FileIndexService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
/**
* @Authorliang.chao
* @Date2025/10/30 - 16:21
*/
@Service
public class FileIndexServiceImpl implements FileIndexService {
@Resource
private FileIndexMapper mapper;
@Override
public List<FileIndexDto> getList(FileIndexDto dto) {
return mapper.getList(dto);
}
@Override
public AjaxResult add(FileIndexDto dto) {
Integer add = mapper.add(dto);
return add > 0 ? AjaxResult.success("添加成功") : AjaxResult.error("添加失败");
}
@Override
public AjaxResult update(FileIndexDto dto) {
Integer update = mapper.update(dto);
return update > 0 ? AjaxResult.success("修改成功") : AjaxResult.error("修改失败");
}
@Override
public AjaxResult del(FileIndexDto dto) {
Integer del = mapper.del(dto);
return del > 0 ? AjaxResult.success("删除成功") : AjaxResult.error("删除失败");
}
}

View File

@ -0,0 +1,44 @@
<?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.FileIndexMapper">
<insert id="add">
INSERT INTO da_ky_file_index
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="fileName != null and fileName != ''">file_name,</if>
<if test="fileContent != null and fileContent != ''">file_content,</if>
<if test="filePath != null and filePath != ''">file_path,</if>
<if test="saveDate != null">save_date,</if>
</trim>
VALUES
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="fileName != null and fileName != ''">#{fileName},</if>
<if test="fileContent != null and fileContent != ''">#{fileContent},</if>
<if test="filePath != null and filePath != ''">#{filePath},</if>
<if test="saveDate != null">#{saveDate},</if>
</trim>
</insert>
<update id="update">
UPDATE da_ky_file_index
<trim prefix="SET" suffixOverrides=",">
<if test="fileName != null and fileName != ''">file_name = #{fileName},</if>
<if test="fileContent != null and fileContent != ''">file_content = #{fileContent},</if>
<if test="filePath != null and filePath != ''">file_path = #{filePath},</if>
<if test="saveDate != null">save_date = #{saveDate},</if>
</trim>
WHERE id = #{id}
</update>
<delete id="del">
DELETE FROM da_ky_file_index WHERE id = #{id}
</delete>
<select id="getList" resultType="com.bonus.web.domain.FileIndexDto">
select id,file_name,file_content,file_path,save_date from da_ky_file_index
<where>
<if test="fileName != null and fileName != ''">
and file_name like concat('%',#{fileName},'%')
</if>
</where>
</select>
</mapper>

View File

@ -365,6 +365,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
left join da_ky_project dkp on dkta.pro_id = dkp.id
LEFT JOIN da_ky_sys_dept d ON dkta.dept_id = d.dept_id AND d.del_flag = '0'
where dkta.del_flag = '1'
<if test="userId != null and userId != ''">
and dkta.create_user_id = #{userId}
</if>
<if test="proName != null and proName != ''">
AND INSTR(dkta.pro_name, #{proName}) > 0
</if>

View File

@ -20,4 +20,16 @@ public interface ISysEncryTypeMapper {
Integer del(SysEncryType sysEncryType);
Integer selectSysEncryType(SysEncryType sysEncryType);
List<SysEncryType> selectSysEncryTypeListFile(SysEncryType sysEncryType);
Integer editFile(SysEncryType sysEncryType);
Integer addFile(SysEncryType sysEncryType);
Integer delFile(SysEncryType sysEncryType);
Integer selectSysEncryTypeFile(SysEncryType sysEncryType);
}

View File

@ -17,4 +17,14 @@ public interface ISysEncryTypeService {
R add(SysEncryType sysEncryType);
Integer del(SysEncryType sysEncryType);
List<SysEncryType> selectSysEncryTypeListFile(SysEncryType sysEncryType);
R addFile(SysEncryType sysEncryType);
R editFile(SysEncryType sysEncryType);
Integer delFile(SysEncryType sysEncryType);
}

View File

@ -55,4 +55,42 @@ public class SysEncryTypeServiceImpl implements ISysEncryTypeService {
public Integer del(SysEncryType sysEncryType) {
return sysEncryTypeMapper.del(sysEncryType);
}
@Override
public List<SysEncryType> selectSysEncryTypeListFile(SysEncryType sysEncryType) {
return sysEncryTypeMapper.selectSysEncryTypeListFile(sysEncryType);
}
@Override
public R editFile(SysEncryType sysEncryType) {
try {
Integer i = sysEncryTypeMapper.selectSysEncryTypeFile(sysEncryType);
if (i > 0) {
return R.fail("该加密名称已存在");
}
return R.ok(sysEncryTypeMapper.editFile(sysEncryType));
}catch (Exception e){
return R.fail("修改失败");
}
}
@Override
public R addFile(SysEncryType sysEncryType) {
try {
Integer i = sysEncryTypeMapper.selectSysEncryTypeFile(sysEncryType);
if (i > 0) {
return R.fail("该加密名称已存在");
}
return R.ok(sysEncryTypeMapper.addFile(sysEncryType));
}catch (Exception e){
return R.fail("新增失败");
}
}
@Override
public Integer delFile(SysEncryType sysEncryType) {
return sysEncryTypeMapper.delFile(sysEncryType);
}
}

View File

@ -61,4 +61,65 @@
and id != #{id}
</if>
</select>
<insert id="addFile">
INSERT INTO da_ky_sys_encrypt_file_set
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="encryptType != null and encryptType != ''">encrypt_type,</if>
<if test="encryptName != null and encryptName != ''">encrypt_name,</if>
<if test="encryptParams != null and encryptParams != ''">encrypt_params,</if>
<if test="status != null">status,</if>
</trim>
VALUES
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="encryptType != null and encryptType != ''">#{encryptType},</if>
<if test="encryptName != null and encryptName != ''">#{encryptName},</if>
<if test="encryptParams != null and encryptParams != ''">#{encryptParams},</if>
<if test="status != null">#{status},</if>
</trim>
</insert>
<update id="editFile">
update da_ky_sys_encrypt_file_set
<set>
<if test="encryptType != null and encryptType != ''">
encrypt_type = #{encryptType},
</if>
<if test="encryptName != null and encryptName != ''">
encrypt_name = #{encryptName},
</if>
<if test="encryptParams != null and encryptParams != ''">
encrypt_params = #{encryptParams},
</if>
<if test="status != null">
status = #{status},
</if>
</set>
WHERE id = #{id}
</update>
<delete id="delFile">
delete from da_ky_sys_encrypt_file_set where id = #{id}
</delete>
<select id="selectSysEncryTypeListFile" resultType="com.bonus.system.domain.SysEncryType">
select id,
encrypt_type as encryptType,
encrypt_name as encryptName,
encrypt_params as encryptParams,
status
from da_ky_sys_encrypt_file_set
where 1=1
<if test="encryptName != null and encryptName != ''">
AND INSTR(encrypt_name, #{encryptName}) > 0
</if>
</select>
<select id="selectSysEncryTypeFile" resultType="java.lang.Integer">
SELECT COUNT(*)
FROM da_ky_sys_encrypt_file_set
WHERE encrypt_name = #{encryptName}
<if test="id != null">
and id != #{id}
</if>
</select>
</mapper>

View File

@ -37,7 +37,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
AND r.role_id = #{roleId}
</if>
<if test="roleName != null and roleName != ''">
AND INSTR(r.role_name, #{roleName}) > 0
AND (INSTR(r.role_name, #{roleName}) > 0 or INSTR(r.role_key, #{roleName}) > 0)
</if>
<if test="status != null and status != ''">
AND r.status = #{status}