档案管理树结构修改

This commit is contained in:
liang.chao 2025-09-17 09:59:24 +08:00
parent e39d8049e5
commit a7b60a977a
5 changed files with 35 additions and 22 deletions

View File

@ -17,7 +17,7 @@ public class DaKyProFilesContentsDto {
/** /**
* id * id
*/ */
private Integer id; private String id;
/** /**
* 项目id * 项目id

View File

@ -17,7 +17,7 @@ public class DaKyProFilesContentsVo {
/** /**
* id * id
*/ */
private Integer id; private String id;
/** /**
* 项目id * 项目id

View File

@ -22,8 +22,10 @@ public interface FileManageMapper {
Integer saveFileSource(DaKyProFilesContentsVo dto); Integer saveFileSource(DaKyProFilesContentsVo dto);
Integer updateFileManage(DaKyProFilesContentsDto dto); Integer updateFileManage(DaKyProFilesContentsDto dto);
Integer updateFileManage(DaKyProFilesContentsVo dto);
Integer updateFileSource(DaKyProFilesContentsDto dto); Integer updateFileSource(DaKyProFilesContentsDto dto);
Integer updateFileSource(DaKyProFilesContentsVo dto);
Integer delFileSource(DaKyProFilesContentsDto dto); Integer delFileSource(DaKyProFilesContentsDto dto);
@ -36,7 +38,7 @@ public interface FileManageMapper {
Integer updateIntegrityStatus(DaKyProFilesContentsDto dto); Integer updateIntegrityStatus(DaKyProFilesContentsDto dto);
Integer getLevelById(Integer id); Integer getLevelById(String id);
Integer getMaxSort(DaKyProFilesContentsDto dto); Integer getMaxSort(DaKyProFilesContentsDto dto);

View File

@ -15,6 +15,7 @@ import org.springframework.stereotype.Service;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.UUID;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static com.bonus.common.utils.SecurityUtils.getLoginUser; import static com.bonus.common.utils.SecurityUtils.getLoginUser;
@ -54,6 +55,8 @@ public class FileManageServiceImpl implements FileManageService {
if (i > 0) { if (i > 0) {
return R.fail("档案名称重复"); return R.fail("档案名称重复");
} }
String uuid32 = UUID.randomUUID().toString().replace("-", "").toLowerCase();
dto.setId(uuid32);
return R.ok(fileManageMapper.saveFileManage(dto)); return R.ok(fileManageMapper.saveFileManage(dto));
} }
@ -78,7 +81,8 @@ public class FileManageServiceImpl implements FileManageService {
} }
fileManageMapper.saveFileSource(dto); fileManageMapper.saveFileSource(dto);
} }
String uuid32 = UUID.randomUUID().toString().replace("-", "").toLowerCase();
dto.setId(uuid32);
return R.ok(fileManageMapper.saveFileManage(dto)); return R.ok(fileManageMapper.saveFileManage(dto));
} }
@ -90,16 +94,22 @@ public class FileManageServiceImpl implements FileManageService {
if (i > 0) { if (i > 0) {
return R.fail("档案名称重复"); return R.fail("档案名称重复");
} }
fileManageMapper.updateFileSource(dto);
if (StringUtils.isBlank(dto.getFilePath())) {
dto.setId(null);
}
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 null; dto.setUpdateUserId(getLoginUser().getUserId());
dto.setUpdateUserName(getLoginUser().getUsername());
Integer i = fileManageMapper.selectFileManage(dto);
if (i > 0) {
return R.fail("档案名称重复");
}
fileManageMapper.updateFileSource(dto);
if (StringUtils.isBlank(dto.getFilePath())) {
dto.setId(null);
}
return R.ok(fileManageMapper.updateFileManage(dto));
} }
@Override @Override

View File

@ -76,7 +76,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<update id="updateFileManage"> <update id="updateFileManage">
UPDATE da_ky_pro_files_contents UPDATE da_ky_pro_files_contents
<set> <set>
id = #{id},
<if test="contentName != null and contentName != ''">content_name = #{contentName},</if> <if test="contentName != null and contentName != ''">content_name = #{contentName},</if>
<if test="parentId != null and parentId != ''">parent_id = #{parentId},</if> <if test="parentId != null and parentId != ''">parent_id = #{parentId},</if>
<if test="level != null and level != ''">`level` = #{level},</if> <if test="level != null and level != ''">`level` = #{level},</if>
@ -91,7 +90,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateUserName != null and updateUserName != ''">update_user_name = #{updateUserName},</if> <if test="updateUserName != null and updateUserName != ''">update_user_name = #{updateUserName},</if>
update_time = now() update_time = now()
</set> </set>
WHERE content_name = #{contentName} WHERE id = #{id} and pro_id = #{proId}
</update> </update>
<update id="updateFileSource"> <update id="updateFileSource">
UPDATE da_ky_sys_file_source UPDATE da_ky_sys_file_source
@ -104,7 +103,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
update_user_id = #{updateUserId}, update_user_id = #{updateUserId},
update_user_name = #{updateUserName}, update_user_name = #{updateUserName},
update_time = now() update_time = now()
WHERE id = #{id} WHERE business_id = #{id}
</update> </update>
<update id="updateIntegrityStatus"> <update id="updateIntegrityStatus">
UPDATE da_ky_pro_files_contents UPDATE da_ky_pro_files_contents
@ -114,7 +113,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</update> </update>
<delete id="delFileSource"> <delete id="delFileSource">
DELETE FROM da_ky_sys_file_source DELETE FROM da_ky_sys_file_source
WHERE id = #{id} WHERE business_id = #{id}
</delete> </delete>
<delete id="delFileManage"> <delete id="delFileManage">
DELETE FROM da_ky_pro_files_contents DELETE FROM da_ky_pro_files_contents
@ -145,7 +144,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
dkpfc.mark_code AS markCode, dkpfc.mark_code AS markCode,
dkpfc.term AS term, dkpfc.term AS term,
dkpfc.unit_name AS unitName, dkpfc.unit_name AS unitName,
dkpfc.data_source AS dataSource, case when dkpfc.data_source = '1' then '本系统上传'
when dkpfc.data_source = '2' then '智慧现场'
else '' end AS dataSource,
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,
@ -182,14 +183,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
WHERE WHERE
dkfcns.del_flag = '1' and standard_type = '1' dkfcns.del_flag = '1' and standard_type = '1'
</select> </select>
<select id="getLevelById" resultType="java.lang.Integer">
SELECT
dkp.level
FROM
da_ky_pro_files_contents dkp
WHERE
dkp.id = #{id}
</select>
<select id="getMaxSort" resultType="java.lang.Integer"> <select id="getMaxSort" resultType="java.lang.Integer">
SELECT SELECT
max(dkpfc.sort) max(dkpfc.sort)
@ -206,4 +199,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
WHERE WHERE
dkpfc.id = #{id} dkpfc.id = #{id}
</select> </select>
<select id="getLevelById" resultType="java.lang.Integer">
SELECT
dkp.level
FROM
da_ky_pro_files_contents dkp
WHERE
dkp.id = #{id}
</select>
</mapper> </mapper>