档案配置
This commit is contained in:
parent
0f0ef3b3f7
commit
f44a17b573
|
|
@ -12,6 +12,10 @@ public class ProjectDto {
|
||||||
* id
|
* id
|
||||||
*/
|
*/
|
||||||
private String id;
|
private String id;
|
||||||
|
/**
|
||||||
|
* id
|
||||||
|
*/
|
||||||
|
private String proId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 项目名称
|
* 项目名称
|
||||||
|
|
|
||||||
|
|
@ -21,4 +21,6 @@ public interface ProjectMapper {
|
||||||
Integer updateContentsName(ProjectDto projectDto);
|
Integer updateContentsName(ProjectDto projectDto);
|
||||||
|
|
||||||
Integer insertDakyProFilesContents(DaKyProFilesContentsDto dakyProFilesContentsDto);
|
Integer insertDakyProFilesContents(DaKyProFilesContentsDto dakyProFilesContentsDto);
|
||||||
|
|
||||||
|
List<ArchivalCatalogueDto> getfilesContentsById(ProjectDto projectDto);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
package com.bonus.web.service.impl;
|
package com.bonus.web.service.impl;
|
||||||
|
|
||||||
import com.bonus.common.core.domain.AjaxResult;
|
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.ArchivalCatalogueDto;
|
||||||
import com.bonus.web.domain.DaKyProFilesContentsDto;
|
import com.bonus.web.domain.DaKyProFilesContentsDto;
|
||||||
import com.bonus.web.domain.ProjectDto;
|
import com.bonus.web.domain.ProjectDto;
|
||||||
|
|
@ -41,15 +42,18 @@ public class ProjectServiceImpl implements ProjectService {
|
||||||
try {
|
try {
|
||||||
Integer num = projectMapper.updateContentsName(projectDto);
|
Integer num = projectMapper.updateContentsName(projectDto);
|
||||||
if (num > 0) {
|
if (num > 0) {
|
||||||
// 档案管理中新增一条目录
|
// 档案管理中新增该工程下所有目录
|
||||||
DaKyProFilesContentsDto dakyProFilesContentsDto = new DaKyProFilesContentsDto();
|
List<ArchivalCatalogueDto> list = projectMapper.getfilesContentsById(projectDto);
|
||||||
dakyProFilesContentsDto.setProId(projectDto.getId());
|
for (ArchivalCatalogueDto archivalCatalogueDto : list) {
|
||||||
dakyProFilesContentsDto.setContentName(projectDto.getContentsName());
|
DaKyProFilesContentsDto dakyProFilesContentsDto = new DaKyProFilesContentsDto();
|
||||||
dakyProFilesContentsDto.setLevel("1");
|
BeanUtils.copyProperties(archivalCatalogueDto, dakyProFilesContentsDto);
|
||||||
dakyProFilesContentsDto.setSort(0L);
|
dakyProFilesContentsDto.setCreateUserId(getLoginUser().getUserId());
|
||||||
dakyProFilesContentsDto.setCreateUserId(getLoginUser().getUserId());
|
dakyProFilesContentsDto.setCreateUserName(getLoginUser().getUsername());
|
||||||
dakyProFilesContentsDto.setCreateUserName(getLoginUser().getUsername());
|
dakyProFilesContentsDto.setProId(projectDto.getProId());
|
||||||
projectMapper.insertDakyProFilesContents(dakyProFilesContentsDto);
|
dakyProFilesContentsDto.setDataSource("1");
|
||||||
|
dakyProFilesContentsDto.setIsUnique("0");
|
||||||
|
projectMapper.insertDakyProFilesContents(dakyProFilesContentsDto);
|
||||||
|
}
|
||||||
return AjaxResult.success("配置成功");
|
return AjaxResult.success("配置成功");
|
||||||
} else {
|
} else {
|
||||||
return AjaxResult.error("配置失败");
|
return AjaxResult.error("配置失败");
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="sort != null">sort,</if>
|
<if test="sort != null">sort,</if>
|
||||||
<if test="createUserId != null">create_user_id,</if>
|
<if test="createUserId != null">create_user_id,</if>
|
||||||
<if test="updateUserId != null">update_user_id,</if>
|
<if test="updateUserId != null">update_user_id,</if>
|
||||||
|
create_time,
|
||||||
</trim>
|
</trim>
|
||||||
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
|
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
|
||||||
<if test="id != null and id != ''">#{id},</if>
|
<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="sort != null">#{sort},</if>
|
||||||
<if test="createUserId != null">#{createUserId},</if>
|
<if test="createUserId != null">#{createUserId},</if>
|
||||||
<if test="updateUserId != null">#{updateUserId},</if>
|
<if test="updateUserId != null">#{updateUserId},</if>
|
||||||
|
now()
|
||||||
</trim>
|
</trim>
|
||||||
</insert>
|
</insert>
|
||||||
<update id="updateContentsName">
|
<update id="updateContentsName">
|
||||||
|
|
@ -88,4 +90,53 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
WHERE
|
WHERE
|
||||||
del_flag = '1' and level = 1
|
del_flag = '1' and level = 1
|
||||||
</select>
|
</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>
|
</mapper>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue