bug优化
This commit is contained in:
parent
3d28f3ebe1
commit
7b1f0f2291
|
|
@ -96,4 +96,11 @@ public interface ArchivesMapper {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<ArchivesDetails> selectDetails(@Param("list") List<Long> detailsIdList);
|
List<ArchivesDetails> selectDetails(@Param("list") List<Long> detailsIdList);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据名称查询电子档案右侧详情
|
||||||
|
* @param archivesDetails
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
ArchivesDetails selectDetailsUpdateName(ArchivesDetails archivesDetails);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -224,7 +224,8 @@ public class ArchivesServiceImpl implements ArchivesService {
|
||||||
@Override
|
@Override
|
||||||
public AjaxResult updateDetails(ArchivesDetails archivesDetails) {
|
public AjaxResult updateDetails(ArchivesDetails archivesDetails) {
|
||||||
// 根据类型名称和上级id查询,同级下名称不能重复
|
// 根据类型名称和上级id查询,同级下名称不能重复
|
||||||
if (isNameDuplicate(archivesDetails)) {
|
ArchivesDetails info = archivesMapper.selectDetailsUpdateName(archivesDetails);
|
||||||
|
if (info != null && !info.getDetailsId().equals(archivesDetails.getDetailsId())) {
|
||||||
return AjaxResult.error(HttpCodeEnum.NAME_DUPLICATE.getCode(), HttpCodeEnum.NAME_DUPLICATE.getMsg());
|
return AjaxResult.error(HttpCodeEnum.NAME_DUPLICATE.getCode(), HttpCodeEnum.NAME_DUPLICATE.getMsg());
|
||||||
}
|
}
|
||||||
archivesDetails.setUpdateBy(SecurityUtils.getUsername());
|
archivesDetails.setUpdateBy(SecurityUtils.getUsername());
|
||||||
|
|
|
||||||
|
|
@ -131,6 +131,30 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</foreach>
|
</foreach>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="selectDetailsUpdateName" resultType="com.bonus.material.archives.domain.ArchivesDetails">
|
||||||
|
select
|
||||||
|
details_id as detailsId,
|
||||||
|
info_id as infoId,
|
||||||
|
doc_name as docName,
|
||||||
|
doc_type as docType,
|
||||||
|
doc_url as docUrl,
|
||||||
|
doc_size as docSize,
|
||||||
|
type_id as typeId,
|
||||||
|
YEAR(create_time) as year,
|
||||||
|
create_by as createBy,
|
||||||
|
create_time as createTime,
|
||||||
|
update_by as updateBy,
|
||||||
|
update_time as updateTime
|
||||||
|
FROM
|
||||||
|
archives_record_details
|
||||||
|
WHERE
|
||||||
|
del_flag = '0'
|
||||||
|
and doc_name = #{docName}
|
||||||
|
<if test="parentId != null">
|
||||||
|
and parent_id = #{parentId}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
|
||||||
<insert id="insertInfo">
|
<insert id="insertInfo">
|
||||||
insert into archives_record_info
|
insert into archives_record_info
|
||||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
|
@ -197,7 +221,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<update id="updateDetails">
|
<update id="updateDetails">
|
||||||
update archives_record_details
|
update archives_record_details
|
||||||
<trim prefix="SET" suffixOverrides=",">
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
<if test="infoId != null">info_id = #{infoId},</if>
|
|
||||||
<if test="parentId != null">parent_id = #{parentId},</if>
|
<if test="parentId != null">parent_id = #{parentId},</if>
|
||||||
<if test="docName != null and docName != ''">doc_name = #{docName},</if>
|
<if test="docName != null and docName != ''">doc_name = #{docName},</if>
|
||||||
<if test="docType != null and docType != ''">doc_type = #{docType},</if>
|
<if test="docType != null and docType != ''">doc_type = #{docType},</if>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue