代码提交

This commit is contained in:
liang.chao 2025-12-02 16:34:56 +08:00
parent 91eea6f6d0
commit 03cac72a88
7 changed files with 203 additions and 99 deletions

View File

@ -21,6 +21,7 @@ import org.springblade.common.enums.OperaType;
import org.springblade.common.utils.bean.FileDto; import org.springblade.common.utils.bean.FileDto;
import org.springblade.core.tenant.annotation.NonDS; import org.springblade.core.tenant.annotation.NonDS;
import org.springblade.system.domain.DaKyProFilesContentsDto; import org.springblade.system.domain.DaKyProFilesContentsDto;
import org.springblade.system.domain.RectificationDto;
import org.springblade.system.domain.vo.DaKyProFilesContentsVo; import org.springblade.system.domain.vo.DaKyProFilesContentsVo;
import org.springblade.system.mapper.FileManageMapper; import org.springblade.system.mapper.FileManageMapper;
import org.springblade.system.service.FileManageService; import org.springblade.system.service.FileManageService;
@ -139,6 +140,23 @@ public class FileManagementController extends BaseController {
public AjaxResult getFileManageById(@RequestBody DaKyProFilesContentsDto dto) { public AjaxResult getFileManageById(@RequestBody DaKyProFilesContentsDto dto) {
return AjaxResult.success(fileManageService.getFileManageById(dto)); return AjaxResult.success(fileManageService.getFileManageById(dto));
} }
@PostMapping("addRectification")
@SysLog(title = "加入整改清单", module = "档案管理->档案右侧列表", businessType = OperaType.QUERY, details = "加入整改清单", logType = 1)
@RequiresPermissions("file:manage:rectification")
public AjaxResult addRectification(@RequestBody @Validated RectificationDto dto) {
return fileManageService.addRectification(dto);
}
@PostMapping("selectRectificationList")
@SysLog(title = "加入整改清单", module = "档案管理->档案右侧列表", businessType = OperaType.QUERY, details = "加入整改清单", logType = 1)
@RequiresPermissions("file:manage:rectification")
public TableDataInfo selectRectificationList(@RequestBody RectificationDto dto) {
// 直接使用 dto 中的分页参数
PageHelper.startPage(dto.getPageNum() != null ? dto.getPageNum() : 1,
dto.getPageSize() != null ? dto.getPageSize() : 10,
SqlUtil.escapeOrderBySql(dto.getOrderBy()))
.setReasonable(dto.getReasonable() != null ? dto.getReasonable() : true);
return getDataTable(fileManageService.selectRectificationList(dto));
}
@PostMapping("addFileManageRight") @PostMapping("addFileManageRight")
@SysLog(title = "新增右侧档案树", module = "档案管理->档案目录管理", businessType = OperaType.INSERT, details = "新增右侧档案树", logType = 1) @SysLog(title = "新增右侧档案树", module = "档案管理->档案目录管理", businessType = OperaType.INSERT, details = "新增右侧档案树", logType = 1)
@ -347,10 +365,10 @@ public class FileManagementController extends BaseController {
} }
/** /**
* 档案抽取(这里先不做返回确认即可) * 档案同步(这里先不做返回确认即可)
*/ */
@PostMapping("fileExtract") @PostMapping("fileExtract")
@SysLog(title = "档案抽取", module = "档案管理->档案目录管理", businessType = OperaType.DELETE, details = "档案抽取", logType = 1) @SysLog(title = "档案同步", module = "档案管理->档案目录管理", businessType = OperaType.DELETE, details = "档案抽取", logType = 1)
@RequiresPermissions("file:manage:extract") @RequiresPermissions("file:manage:extract")
public R fileExtract(@RequestBody DaKyProFilesContentsDto dto) { public R fileExtract(@RequestBody DaKyProFilesContentsDto dto) {
return R.ok(); return R.ok();

View File

@ -166,6 +166,7 @@ public class DaKyProFilesContentsDto extends PageDomain {
private String uploadTime; private String uploadTime;
private String proName; private String proName;
private String singleProName; private String singleProName;
private String isRectification;
private List<DaKyProFilesContentsDto> children = new ArrayList<>(); private List<DaKyProFilesContentsDto> children = new ArrayList<>();
} }

View File

@ -0,0 +1,27 @@
package org.springblade.system.domain;
import jakarta.validation.constraints.NotBlank;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import org.springblade.common.core.page.PageDomain;
/**
* @Authorliang.chao
* @Date2025/12/2 - 13:41
*/
@Data
public class RectificationDto extends PageDomain {
private String fileId;
private String proId;
@NotBlank(message = "不能为空")
@Length(max = 64, message = "整改描述不能超过64个字符")
private String description;
private String proName;
private String singleProName;
private String contentName;
private Long createUserId;
private String createTime;
private Long updateUserId;
private String updateTime;
}

View File

@ -2,6 +2,7 @@ package org.springblade.system.mapper;
import org.springblade.system.domain.DaKyProFilesContentsDto; import org.springblade.system.domain.DaKyProFilesContentsDto;
import org.springblade.system.domain.FilesClassifyNameStandardDto; import org.springblade.system.domain.FilesClassifyNameStandardDto;
import org.springblade.system.domain.RectificationDto;
import org.springblade.system.domain.vo.DaKyProFilesContentsVo; import org.springblade.system.domain.vo.DaKyProFilesContentsVo;
import java.util.List; import java.util.List;
@ -49,4 +50,10 @@ public interface FileManageMapper {
Integer getFilesNum(String proId); Integer getFilesNum(String proId);
Integer getchild(DaKyProFilesContentsDto dto); Integer getchild(DaKyProFilesContentsDto dto);
Integer addRectification(RectificationDto dto);
Integer updateisRectification(String fileId);
List<RectificationDto> selectRectificationList(RectificationDto dto);
} }

View File

@ -81,7 +81,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
now() now()
</trim> </trim>
</insert> </insert>
<update id="updateFileManage"> <insert id="addRectification">
insert into record_rectification_list (file_id,pro_id,description,create_user_id,create_time)
values (#{fileId}, #{proId}, #{description}, #{createUserId}, now())
</insert>
<update id="updateFileManage">
UPDATE da_ky_pro_files_contents UPDATE da_ky_pro_files_contents
<set> <set>
<if test="contentName != null and contentName != ''">content_name = #{contentName},</if> <if test="contentName != null and contentName != ''">content_name = #{contentName},</if>
@ -123,7 +127,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
integrity_status = '1' integrity_status = '1'
WHERE pro_id = #{proId} WHERE pro_id = #{proId}
</update> </update>
<delete id="delFileSource"> <update id="updateisRectification">
UPDATE da_ky_sys_file_source
set
is_rectification = '1'
WHERE id = #{fileId}
</update>
<delete id="delFileSource">
DELETE FROM da_ky_sys_file_source DELETE FROM da_ky_sys_file_source
WHERE business_id = #{id} WHERE business_id = #{id}
</delete> </delete>
@ -169,6 +179,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
dkpfc.is_unique AS isUnique, dkpfc.is_unique AS isUnique,
dkpfc.integrity_status AS integrityStatus, dkpfc.integrity_status AS integrityStatus,
dkfs.id AS fileId, dkfs.id AS fileId,
dkfs.is_rectification AS isRectification,
dkfs.file_name AS fileName, dkfs.file_name AS fileName,
dkfs.create_time AS createTime, dkfs.create_time AS createTime,
dkfs.source_file_name AS sourceFileName, dkfs.source_file_name AS sourceFileName,
@ -276,4 +287,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
WHERE WHERE
dkpfc.del_flag = '1' and dkpfc2.id = #{id} dkpfc.del_flag = '1' and dkpfc2.id = #{id}
</select> </select>
<select id="selectRectificationList" resultType="org.springblade.system.domain.RectificationDto">
SELECT
dkp.pro_name AS proName,
dkp.single_pro_name AS singleProName,
concat( dkpfc4.content_name, ' / ', dkpfc3.content_name, ' / ', dkpfc2.content_name, ' / ', dkpfc.content_name, ' / ', dksfs.file_name ) AS contentName,
rrl.description
from record_rectification_list rrl
left join da_ky_project dkp on rrl.pro_id = dkp.id
left join da_ky_sys_file_source dksfs on rrl.file_id = dksfs.id
left join da_ky_pro_files_contents dkpfc on dkpfc.id = dksfs.business_id
left join da_ky_pro_files_contents dkpfc2 on dkpfc.parent_id = dkpfc2.id
left join da_ky_pro_files_contents dkpfc3 on dkpfc2.parent_id = dkpfc3.id
left join da_ky_pro_files_contents dkpfc4 on dkpfc3.parent_id = dkpfc4.id
WHERE rrl.pro_id = #{proId}
</select>
</mapper> </mapper>

View File

@ -1,7 +1,9 @@
package org.springblade.system.service; package org.springblade.system.service;
import org.springblade.common.core.domain.AjaxResult;
import org.springblade.common.core.domain.R; import org.springblade.common.core.domain.R;
import org.springblade.system.domain.DaKyProFilesContentsDto; import org.springblade.system.domain.DaKyProFilesContentsDto;
import org.springblade.system.domain.RectificationDto;
import org.springblade.system.domain.vo.DaKyProFilesContentsVo; import org.springblade.system.domain.vo.DaKyProFilesContentsVo;
import java.util.List; import java.util.List;
@ -34,4 +36,8 @@ public interface FileManageService {
DaKyProFilesContentsDto getFileManageById(DaKyProFilesContentsDto dto); DaKyProFilesContentsDto getFileManageById(DaKyProFilesContentsDto dto);
DaKyProFilesContentsVo getFileById(Long id); DaKyProFilesContentsVo getFileById(Long id);
AjaxResult addRectification(RectificationDto dto);
List<RectificationDto> selectRectificationList(RectificationDto dto);
} }

View File

@ -1,9 +1,11 @@
package org.springblade.system.service.impl; package org.springblade.system.service.impl;
import jakarta.annotation.Resource; import jakarta.annotation.Resource;
import org.springblade.common.core.domain.AjaxResult;
import org.springblade.common.core.domain.R; import org.springblade.common.core.domain.R;
import org.springblade.core.secure.utils.AuthUtil; import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.system.domain.DaKyProFilesContentsDto; import org.springblade.system.domain.DaKyProFilesContentsDto;
import org.springblade.system.domain.RectificationDto;
import org.springblade.system.domain.vo.DaKyProFilesContentsVo; import org.springblade.system.domain.vo.DaKyProFilesContentsVo;
import org.springblade.system.mapper.FileManageMapper; import org.springblade.system.mapper.FileManageMapper;
import org.springblade.system.mapper.ProjectMapper; import org.springblade.system.mapper.ProjectMapper;
@ -23,113 +25,130 @@ import java.util.UUID;
*/ */
@Service @Service
public class FileManageServiceImpl implements FileManageService { public class FileManageServiceImpl implements FileManageService {
@Resource @Resource
private FileManageMapper fileManageMapper; private FileManageMapper fileManageMapper;
@Resource @Resource
private ProjectMapper projectMapper; private ProjectMapper projectMapper;
@Override @Override
public List<DaKyProFilesContentsDto> list(DaKyProFilesContentsDto daKyProFilesContentsDto) { public List<DaKyProFilesContentsDto> list(DaKyProFilesContentsDto daKyProFilesContentsDto) {
List<DaKyProFilesContentsDto> list = fileManageMapper.list(daKyProFilesContentsDto); List<DaKyProFilesContentsDto> list = fileManageMapper.list(daKyProFilesContentsDto);
List<DaKyProFilesContentsDto> tree = TreeBuilder.buildTreeDaKyProFilesContents(list); List<DaKyProFilesContentsDto> tree = TreeBuilder.buildTreeDaKyProFilesContents(list);
return tree; return tree;
} }
@Override @Override
public List<DaKyProFilesContentsDto> FileManage(DaKyProFilesContentsDto dto) { public List<DaKyProFilesContentsDto> FileManage(DaKyProFilesContentsDto dto) {
return fileManageMapper.FileManage(dto); return fileManageMapper.FileManage(dto);
} }
@Override @Override
public R saveFileManage(DaKyProFilesContentsDto dto) { public R saveFileManage(DaKyProFilesContentsDto dto) {
dto.setCreateUserId(AuthUtil.getUser().getUserId()); dto.setCreateUserId(AuthUtil.getUser().getUserId());
dto.setCreateUserName(AuthUtil.getUser().getUserName()); dto.setCreateUserName(AuthUtil.getUser().getUserName());
dto.setUpdateUserId(AuthUtil.getUser().getUserId()); dto.setUpdateUserId(AuthUtil.getUser().getUserId());
dto.setUpdateUserName(AuthUtil.getUser().getUserName()); dto.setUpdateUserName(AuthUtil.getUser().getUserName());
// 查询档案名称是否重复 // 查询档案名称是否重复
Integer i = fileManageMapper.selectFileManage(dto); Integer i = fileManageMapper.selectFileManage(dto);
if (i > 0) { if (i > 0) {
return R.fail("档案名称重复"); return R.fail("档案名称重复");
} }
String uuid32 = UUID.randomUUID().toString().replace("-", "").toLowerCase(); String uuid32 = UUID.randomUUID().toString().replace("-", "").toLowerCase();
dto.setId(uuid32); dto.setId(uuid32);
dto.setDataSource("1"); dto.setDataSource("1");
dto.setIsUnique("1"); dto.setIsUnique("1");
return R.ok(fileManageMapper.saveFileManage(dto)); return R.ok(fileManageMapper.saveFileManage(dto));
} }
@Override @Override
public R saveFileManage(DaKyProFilesContentsVo dto) { public R saveFileManage(DaKyProFilesContentsVo dto) {
String uuid32 = UUID.randomUUID().toString().replace("-", "").toLowerCase(); String uuid32 = UUID.randomUUID().toString().replace("-", "").toLowerCase();
dto.setId(uuid32); dto.setId(uuid32);
return R.ok(fileManageMapper.saveFileManage(dto)); return R.ok(fileManageMapper.saveFileManage(dto));
} }
@Override @Override
public R updateFileManage(DaKyProFilesContentsDto dto) { public R updateFileManage(DaKyProFilesContentsDto dto) {
dto.setUpdateUserId(AuthUtil.getUser().getUserId()); dto.setUpdateUserId(AuthUtil.getUser().getUserId());
dto.setUpdateUserName(AuthUtil.getUser().getUserName()); dto.setUpdateUserName(AuthUtil.getUser().getUserName());
Integer i = fileManageMapper.selectFileManage(dto); Integer i = fileManageMapper.selectFileManage(dto);
if (i > 0) { if (i > 0) {
return R.fail("档案名称重复"); return R.fail("档案名称重复");
} }
return R.ok(fileManageMapper.updateFileManage(dto)); return R.ok(fileManageMapper.updateFileManage(dto));
} }
@Override @Override
public R updateFileManage(DaKyProFilesContentsVo dto) { public R updateFileManage(DaKyProFilesContentsVo dto) {
return R.ok(fileManageMapper.updateFileManage(dto)); return R.ok(fileManageMapper.updateFileManage(dto));
} }
@Override @Override
public Integer delFileManage(DaKyProFilesContentsDto dto) { public Integer delFileManage(DaKyProFilesContentsDto dto) {
fileManageMapper.delFileSource(dto); fileManageMapper.delFileSource(dto);
return fileManageMapper.delFileManage(dto); return fileManageMapper.delFileManage(dto);
} }
@Override @Override
public Integer updateIntegrityStatus(DaKyProFilesContentsDto dto) { public Integer updateIntegrityStatus(DaKyProFilesContentsDto dto) {
fileManageMapper.updateIntegrityStatus(dto); fileManageMapper.updateIntegrityStatus(dto);
return projectMapper.updateFileStatus(dto); return projectMapper.updateFileStatus(dto);
} }
@Override @Override
public Integer getMaxSort(DaKyProFilesContentsDto dto) { public Integer getMaxSort(DaKyProFilesContentsDto dto) {
return fileManageMapper.getMaxSort(dto); return fileManageMapper.getMaxSort(dto);
} }
@Override @Override
public Integer getSortById(String id) { public Integer getSortById(String id) {
return fileManageMapper.getSortById(id); return fileManageMapper.getSortById(id);
} }
@Override @Override
public List<DaKyProFilesContentsDto> getFileManageTree(DaKyProFilesContentsDto daKyProFilesContentsDto) { public List<DaKyProFilesContentsDto> getFileManageTree(DaKyProFilesContentsDto daKyProFilesContentsDto) {
List<DaKyProFilesContentsDto> list = fileManageMapper.list(daKyProFilesContentsDto); List<DaKyProFilesContentsDto> list = fileManageMapper.list(daKyProFilesContentsDto);
list.removeIf(dto -> "0".equals(dto.getIsUnique()) && dto.getLevel() != 1); list.removeIf(dto -> "0".equals(dto.getIsUnique()) && dto.getLevel() != 1);
if (daKyProFilesContentsDto.getId() != null) { if (daKyProFilesContentsDto.getId() != null) {
daKyProFilesContentsDto.setParentId(daKyProFilesContentsDto.getId()); daKyProFilesContentsDto.setParentId(daKyProFilesContentsDto.getId());
Integer level = fileManageMapper.getLevelById(daKyProFilesContentsDto); Integer level = fileManageMapper.getLevelById(daKyProFilesContentsDto);
for (Iterator<DaKyProFilesContentsDto> it = list.iterator(); it.hasNext(); ) { for (Iterator<DaKyProFilesContentsDto> it = list.iterator(); it.hasNext(); ) {
DaKyProFilesContentsDto item = it.next(); DaKyProFilesContentsDto item = it.next();
if (level <= item.getLevel()) { if (level <= item.getLevel()) {
it.remove(); it.remove();
} }
} }
} }
// 构建树 // 构建树
List<DaKyProFilesContentsDto> tree = TreeBuilder.buildTreeDaKyProFilesContents(list); List<DaKyProFilesContentsDto> tree = TreeBuilder.buildTreeDaKyProFilesContents(list);
return tree; return tree;
} }
@Override @Override
public DaKyProFilesContentsDto getFileManageById(DaKyProFilesContentsDto dto) { public DaKyProFilesContentsDto getFileManageById(DaKyProFilesContentsDto dto) {
return fileManageMapper.getFileManageById(dto); return fileManageMapper.getFileManageById(dto);
} }
@Override @Override
public DaKyProFilesContentsVo getFileById(Long id) { public DaKyProFilesContentsVo getFileById(Long id) {
return fileManageMapper.getFileById(id); return fileManageMapper.getFileById(id);
} }
@Override
public AjaxResult addRectification(RectificationDto dto) {
dto.setCreateUserId(AuthUtil.getUser().getUserId());
fileManageMapper.updateisRectification(dto.getFileId());
Integer i = fileManageMapper.addRectification(dto);
if (i > 0) {
return AjaxResult.success("添加整改成功");
} else {
return AjaxResult.error("添加整改失败");
}
}
@Override
public List<RectificationDto> selectRectificationList(RectificationDto dto) {
return fileManageMapper.selectRectificationList(dto);
}
} }