档案配置

This commit is contained in:
liang.chao 2025-09-12 09:56:03 +08:00
parent 0f0ef3b3f7
commit f44a17b573
4 changed files with 70 additions and 9 deletions

View File

@ -12,6 +12,10 @@ public class ProjectDto {
* id
*/
private String id;
/**
* id
*/
private String proId;
/**
* 项目名称

View File

@ -21,4 +21,6 @@ public interface ProjectMapper {
Integer updateContentsName(ProjectDto projectDto);
Integer insertDakyProFilesContents(DaKyProFilesContentsDto dakyProFilesContentsDto);
List<ArchivalCatalogueDto> getfilesContentsById(ProjectDto projectDto);
}

View File

@ -1,6 +1,7 @@
package com.bonus.web.service.impl;
import com.bonus.common.core.domain.AjaxResult;
import com.bonus.common.utils.bean.BeanUtils;
import com.bonus.web.domain.ArchivalCatalogueDto;
import com.bonus.web.domain.DaKyProFilesContentsDto;
import com.bonus.web.domain.ProjectDto;
@ -41,15 +42,18 @@ public class ProjectServiceImpl implements ProjectService {
try {
Integer num = projectMapper.updateContentsName(projectDto);
if (num > 0) {
// 档案管理中新增一条目录
DaKyProFilesContentsDto dakyProFilesContentsDto = new DaKyProFilesContentsDto();
dakyProFilesContentsDto.setProId(projectDto.getId());
dakyProFilesContentsDto.setContentName(projectDto.getContentsName());
dakyProFilesContentsDto.setLevel("1");
dakyProFilesContentsDto.setSort(0L);
dakyProFilesContentsDto.setCreateUserId(getLoginUser().getUserId());
dakyProFilesContentsDto.setCreateUserName(getLoginUser().getUsername());
projectMapper.insertDakyProFilesContents(dakyProFilesContentsDto);
// 档案管理中新增该工程下所有目录
List<ArchivalCatalogueDto> list = projectMapper.getfilesContentsById(projectDto);
for (ArchivalCatalogueDto archivalCatalogueDto : list) {
DaKyProFilesContentsDto dakyProFilesContentsDto = new DaKyProFilesContentsDto();
BeanUtils.copyProperties(archivalCatalogueDto, dakyProFilesContentsDto);
dakyProFilesContentsDto.setCreateUserId(getLoginUser().getUserId());
dakyProFilesContentsDto.setCreateUserName(getLoginUser().getUsername());
dakyProFilesContentsDto.setProId(projectDto.getProId());
dakyProFilesContentsDto.setDataSource("1");
dakyProFilesContentsDto.setIsUnique("0");
projectMapper.insertDakyProFilesContents(dakyProFilesContentsDto);
}
return AjaxResult.success("配置成功");
} else {
return AjaxResult.error("配置失败");

View File

@ -23,6 +23,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="sort != null">sort,</if>
<if test="createUserId != null">create_user_id,</if>
<if test="updateUserId != null">update_user_id,</if>
create_time,
</trim>
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
<if test="id != null and id != ''">#{id},</if>
@ -42,6 +43,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="sort != null">#{sort},</if>
<if test="createUserId != null">#{createUserId},</if>
<if test="updateUserId != null">#{updateUserId},</if>
now()
</trim>
</insert>
<update id="updateContentsName">
@ -88,4 +90,53 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
WHERE
del_flag = '1' and level = 1
</select>
<select id="getfilesContentsById" resultType="com.bonus.web.domain.ArchivalCatalogueDto">
WITH RECURSIVE child_nodes AS (
SELECT
id AS id,
content_name AS contentName,
parent_id AS parentId,
level AS level,
sort AS sort,
mark_code AS markCode,
term AS term,
unit_name AS unitName,
major AS major,
classify_mark AS classifyMark,
create_time AS createTime,
update_time AS updateTime,
create_user_id AS createUserId,
create_user_name AS createUserName,
update_user_id AS updateUserId,
update_user_name AS updateUserName,
del_flag AS delFlag
FROM da_ky_files_contents
WHERE id = #{id}
UNION ALL
SELECT
t.id AS id,
t.content_name AS contentName,
t.parent_id AS parentId,
t.level AS level,
t.sort AS sort,
t.mark_code AS markCode,
t.term AS term,
t.unit_name AS unitName,
t.major AS major,
t.classify_mark AS classifyMark,
t.create_time AS createTime,
t.update_time AS updateTime,
t.create_user_id AS createUserId,
t.create_user_name AS createUserName,
t.update_user_id AS updateUserId,
t.update_user_name AS updateUserName,
t.del_flag AS delFlag
FROM da_ky_files_contents t
INNER JOIN child_nodes c ON t.parent_id = c.id
WHERE t.del_flag = '1'
)
SELECT * FROM child_nodes
</select>
</mapper>