文件记录-问题修改

This commit is contained in:
YBP
2026-04-09 09:10:53 +08:00
parent 185179ed65
commit 279792e363
10 changed files with 73 additions and 196 deletions

View File

@@ -53,7 +53,7 @@ public class RecordConstants {
/** /**
* 查看申请 * 查看申请
*/ */
public static final String VIEW_APPLY = "文件查看"; public static final String VIEW_APPLY = "文件借阅";
/** /**
* 作废 * 作废
*/ */
@@ -67,7 +67,7 @@ public class RecordConstants {
* */ * */
public static final String RECORD_SUBMIT = "文件提交"; public static final String RECORD_SUBMIT = "文件提交";
/** /**
* 文件提交 * 文件更改
* */ * */
public static final String RECORD_UPDATE = "文件更改"; public static final String RECORD_UPDATE = "文件更改";

View File

@@ -42,7 +42,8 @@ public class RecordApplyPageReqVO extends PageParam {
private String applyDepartmentName; private String applyDepartmentName;
@Schema(description = "评审时间") @Schema(description = "评审时间")
private LocalDateTime reviewTime; @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] reviewTime;
@Schema(description = "评审范围") @Schema(description = "评审范围")
private String reviewRange; private String reviewRange;
@@ -92,4 +93,11 @@ public class RecordApplyPageReqVO extends PageParam {
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime; private LocalDateTime[] createTime;
} // ==============临时字段================
@Schema(description = "创建时间")
private String name;
@Schema(description = "创建时间")
private String code;
}

View File

@@ -55,9 +55,6 @@ public class RecordPermissionPageReqVO extends PageParam {
@Schema(description = "是否保留标志") @Schema(description = "是否保留标志")
private String saveFlag; private String saveFlag;
// @Schema(description = "保留结束日期")
// private LocalDateTime saveEndDate;
@Schema(description = "所属部门") @Schema(description = "所属部门")
private String systemDepartmentCode; private String systemDepartmentCode;
@@ -80,4 +77,8 @@ public class RecordPermissionPageReqVO extends PageParam {
private List<Long> userDeptIds; private List<Long> userDeptIds;
private String recordName;
private String recordCode;
} }

View File

@@ -165,5 +165,9 @@ public class RecordApplyDO extends BusinessBaseDO {
@TableField(exist = false) @TableField(exist = false)
private List<RecordAssignDO> assignList; private List<RecordAssignDO> assignList;
@TableField(exist = false)
private String name;
@TableField(exist = false)
private String code;
} }

View File

@@ -23,6 +23,7 @@ public interface RecordApplyMapper extends BaseMapperX<RecordApplyDO> {
.likeIfPresent(RecordApplyDO::getApplyUserName, reqVO.getApplyUserName()) .likeIfPresent(RecordApplyDO::getApplyUserName, reqVO.getApplyUserName())
.eqIfPresent(RecordApplyDO::getApplyDepartmentName, reqVO.getApplyDepartmentName()) .eqIfPresent(RecordApplyDO::getApplyDepartmentName, reqVO.getApplyDepartmentName())
.eqIfPresent(RecordApplyDO::getApplyDepartmentId, reqVO.getApplyDepartmentId()) .eqIfPresent(RecordApplyDO::getApplyDepartmentId, reqVO.getApplyDepartmentId())
.betweenIfPresent(RecordApplyDO::getReviewTime, reqVO.getReviewTime())
.eqIfPresent(RecordApplyDO::getReviewRange, reqVO.getReviewRange()) .eqIfPresent(RecordApplyDO::getReviewRange, reqVO.getReviewRange())
.likeIfPresent(RecordApplyDO::getTargetDepartmentIds, reqVO.getTargetDepartmentIds()) .likeIfPresent(RecordApplyDO::getTargetDepartmentIds, reqVO.getTargetDepartmentIds())
.eqIfPresent(RecordApplyDO::getTargetUserIds, reqVO.getTargetUserIds()) .eqIfPresent(RecordApplyDO::getTargetUserIds, reqVO.getTargetUserIds())
@@ -35,6 +36,8 @@ public interface RecordApplyMapper extends BaseMapperX<RecordApplyDO> {
.eqIfPresent(RecordApplyDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) .eqIfPresent(RecordApplyDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
.eqIfPresent(RecordApplyDO::getRemark, reqVO.getRemark()) .eqIfPresent(RecordApplyDO::getRemark, reqVO.getRemark())
.betweenIfPresent(RecordApplyDO::getCreateTime, reqVO.getCreateTime()) .betweenIfPresent(RecordApplyDO::getCreateTime, reqVO.getCreateTime())
.apply(reqVO.getName() != null && !reqVO.getName().isEmpty(), "JSON_VALUE(FORM_DAT, '$.name') = {0}", reqVO.getName())
.apply(reqVO.getCode() != null && !reqVO.getCode().isEmpty(), "JSON_VALUE(FORM_DAT, '$.code') = {0}", reqVO.getCode())
.orderByDesc(RecordApplyDO::getId)); .orderByDesc(RecordApplyDO::getId));
} }

View File

@@ -49,7 +49,4 @@ public interface RecordRecordMapper extends BaseMapperX<RecordRecordDO> {
IPage<RecordRecordDO> getEffectRecordPage(Page<RecordRecordSaveReqVO> page, IPage<RecordRecordDO> getEffectRecordPage(Page<RecordRecordSaveReqVO> page,
RecordRecordPageReqVO reqVO); RecordRecordPageReqVO reqVO);
// IPage<RecordRecordDO> getNotSubmitEffectRecordPage(Page<RecordRecordSaveReqVO> page, @Param("reqVO") RecordRecordPageReqVO reqVO);
} }

View File

@@ -105,18 +105,9 @@ public class RecordApplyServiceImpl implements RecordApplyService, BMPCallbackIn
List<Long> detailIds = detailList.stream().map(RecordApplyDetailSaveReqVO::getId).toList(); List<Long> detailIds = detailList.stream().map(RecordApplyDetailSaveReqVO::getId).toList();
recordApplyDetailService.deleteNotInDetailIdList(applyId, null, recordList); //先删除记录 recordApplyDetailService.deleteNotInDetailIdList(applyId, null, recordList); //先删除记录
recordApplyDetailService.deleteNotInDetailIdList(applyId, detailIds, null); // 在删除不需要的明细数据 recordApplyDetailService.deleteNotInDetailIdList(applyId, detailIds, null); // 在删除不需要的明细数据
CommonResult<RecordApplyRespVO> applyDetailData = createApplyDetailData(updateReqVO, recordApplyDO); return createApplyDetailData(updateReqVO, recordApplyDO);
// Long documentId = recordApplyDetailDOS.get(0).getDocumentId();
// 判断文件是否改变
// Long newDocumentId = detailList.get(0).getDocumentId();
// if (!documentId.equals(newDocumentId)) { // 删除重新添加
// List<Long> deleteFileIdList = recordApplyDetailDOS.stream().map(RecordApplyDetailDO::getId).toList();
// recordApplyDetailService.deleteRecordApplyDetailListByIds(deleteFileIdList);
// return true;
// }
return applyDetailData;
} }
return new CommonResult<RecordApplyRespVO>(); return new CommonResult<>();
} }
@Override @Override
@@ -149,15 +140,24 @@ public class RecordApplyServiceImpl implements RecordApplyService, BMPCallbackIn
if (item.getId() != null) detailIds.add(item.getId()); // 有id的 if (item.getId() != null) detailIds.add(item.getId()); // 有id的
else { else {
item.setApplyId(applyId); item.setApplyId(applyId);
newDetailList.add(item); // 新数据 // 新数据
if (RecordConstants.BusinessType.VIEW_APPLY.equals(businessType)){ // 查看申请,新增数据添加目标用户
item.setTargetId(SecurityFrameworkUtils.getLoginUserId());
item.setTargetType(RecordConstants.TargetType.USER);
item.setTargetName(SecurityFrameworkUtils.getLoginUserNickname());
}
newDetailList.add(item);
} }
}); });
recordApplyDetailService.deleteNotInDetailIdList(applyId, null, detailIds);
// if (!ObjectUtils.isEmpty(deleteDetailAllList)) { //删除明细id 不存在的数据
// List<Long> deleteDetailIds = deleteDetailAllList.stream().map(RecordApplyDetailDO::getId).toList(); recordApplyDetailService.deleteNotInDetailIdList(applyId, detailIds,null );
// recordApplyDetailService.deleteRecordApplyDetailListByIds(deleteDetailIds);
// } // 更新旧的明细数据
// 更新 List<RecordApplyDetailSaveReqVO> recordApplyDetailSaveReqVOList = BeanUtils.toBean(detailList, RecordApplyDetailSaveReqVO.class);
recordApplyDetailService.updateRecordApplyDetailBatch(recordApplyDetailSaveReqVOList);
// 添加新数据
if (!ObjectUtils.isEmpty(newDetailList)) { if (!ObjectUtils.isEmpty(newDetailList)) {
recordApplyDetailService.createRecordApplyDetailBatch(newDetailList); recordApplyDetailService.createRecordApplyDetailBatch(newDetailList);
} }
@@ -188,8 +188,8 @@ public class RecordApplyServiceImpl implements RecordApplyService, BMPCallbackIn
} }
// 删除ID 不存在的数据 // 删除ID 不存在的数据
List<RecordApplyDetailSaveReqVO> detailList = updateReqVO.getDetailList(); List<RecordApplyDetailSaveReqVO> detailList = updateReqVO.getDetailList();
List<Long> list = detailList.stream().map(RecordApplyDetailSaveReqVO::getId).toList(); List<Long> detailIds = detailList.stream().map(RecordApplyDetailSaveReqVO::getId).toList();
recordApplyDetailService.deleteNotInDetailIdList(applyId, list, null); recordApplyDetailService.deleteNotInDetailIdList(applyId, detailIds, null);
createApplyDetailData(updateReqVO,recordApplyDO); createApplyDetailData(updateReqVO,recordApplyDO);
return BeanUtils.toBean(updateReqVO, RecordApplyRespVO.class); return BeanUtils.toBean(updateReqVO, RecordApplyRespVO.class);
@@ -290,8 +290,10 @@ public class RecordApplyServiceImpl implements RecordApplyService, BMPCallbackIn
recordApply.setApplyDepartmentName(loginUser.getVisitDeptName()); recordApply.setApplyDepartmentName(loginUser.getVisitDeptName());
//生成标题 //生成标题
String title = nickName + "" + businessType + "_" + new SimpleDateFormat("yyyy-MM-dd_HH:mm:ss").format(new Date()); if (ObjectUtils.isEmpty(param.getTitle())) {
recordApply.setTitle(title); String title = nickName + "" + businessType + "_" + new SimpleDateFormat("yyyy-MM-dd_HH:mm:ss").format(new Date());
recordApply.setTitle(title);
}
try { try {
recordApplyMapper.insert(recordApply); recordApplyMapper.insert(recordApply);
} catch (Exception e) { } catch (Exception e) {
@@ -592,7 +594,7 @@ public class RecordApplyServiceImpl implements RecordApplyService, BMPCallbackIn
if (ObjectUtils.isEmpty(applyId)) throw exception0(RECORD_RECORD_NOT_EXISTS.getCode(), "申请记录不存在"); if (ObjectUtils.isEmpty(applyId)) throw exception0(RECORD_RECORD_NOT_EXISTS.getCode(), "申请记录不存在");
RecordApplyDO recordApplyDO = recordApplyMapper.selectById(applyId); RecordApplyDO recordApplyDO = recordApplyMapper.selectById(applyId);
// TODO // 提交,不需要走流程 // TODO 提交,不需要走流程
Integer isSubmit = param.getIsSubmit(); Integer isSubmit = param.getIsSubmit();
if (!ObjectUtils.isEmpty(isSubmit) && isSubmit == 1) { if (!ObjectUtils.isEmpty(isSubmit) && isSubmit == 1) {
RecordApplyDO applyDO = applySubmitStatus(recordApplyDO); RecordApplyDO applyDO = applySubmitStatus(recordApplyDO);
@@ -691,6 +693,7 @@ public class RecordApplyServiceImpl implements RecordApplyService, BMPCallbackIn
// 更新申请提交状态 // 更新申请提交状态
recordApplyDO.setIsSubmit(1); recordApplyDO.setIsSubmit(1);
recordApplyDO.setBusinessStatus(QmsCommonConstant.SUBMITTED); recordApplyDO.setBusinessStatus(QmsCommonConstant.SUBMITTED);
recordApplyDO.setApplyEndDate(LocalDateTime.now());
recordApplyMapper.updateById(recordApplyDO); recordApplyMapper.updateById(recordApplyDO);
return recordApplyDO; return recordApplyDO;
} }
@@ -957,7 +960,7 @@ public class RecordApplyServiceImpl implements RecordApplyService, BMPCallbackIn
else permissionDO.setSaveFlag(saveFlag); else permissionDO.setSaveFlag(saveFlag);
if (businessType.equals(RecordConstants.BusinessType.VIEW_APPLY)) { if (businessType.equals(RecordConstants.BusinessType.VIEW_APPLY)) {
targetType = RecordConstants.TargetType.USER; targetType = RecordConstants.TargetType.USER;
permissionDO.setSaveFlag("1"); // 文件查看使用 // permissionDO.setSaveFlag("1"); // 文件查看使用
} }
if (ObjectUtils.isEmpty(targetType)) if (ObjectUtils.isEmpty(targetType))

View File

@@ -137,12 +137,13 @@
<include refid="recordAndPermissionColumn"/> <include refid="recordAndPermissionColumn"/>
FROM T_RCD_PERM trp FROM T_RCD_PERM trp
INNER JOIN T_RCD_RCD trr ON trr.ID = trp.SRC_ID INNER JOIN T_RCD_RCD trr ON trr.ID = trp.SRC_ID
WHERE trp.deleted = 0 and trr.deleted = 0 and trp.CNL_FLG = '0' AND trp.EXPR_STS = '0' AND trp.SRC_TP=#{recordP.sourceType} WHERE trp.deleted = 0 and trr.deleted = 0 and trp.CNL_FLG = '0' AND trp.EXPR_STS = '0' AND
<!-- 查询用户--> trp.SRC_TP=#{recordP.sourceType}
<!-- 查询用户-->
<if test="recordP.userId != null"> <if test="recordP.userId != null">
and trp.TGT_TP = '用户' AND trp.TGT_ID = #{recordP.userId} and trp.TGT_TP = '用户' AND trp.TGT_ID = #{recordP.userId}
</if> </if>
<!-- 部门--> <!-- 部门-->
<if test="recordP.userDeptIds != null and recordP.userDeptIds.size() > 0"> <if test="recordP.userDeptIds != null and recordP.userDeptIds.size() > 0">
and and
(trp.tgt_tp = '部门' AND trp.tgt_id IN (trp.tgt_tp = '部门' AND trp.tgt_id IN
@@ -151,6 +152,14 @@
</foreach> </foreach>
) )
</if> </if>
<if test="recordP.recordName != null and recordP.recordName != ''">
and trr.name like CONCAT('%', #{recordP.recordName}, '%')
</if>
<if test="recordP.recordCode != null and recordP.recordCode != ''">
and trr.CD like CONCAT('%', #{recordP.recordCode}, '%')
</if>
</select> </select>

View File

@@ -39,6 +39,10 @@
FROM t_rcd_rcd trr FROM t_rcd_rcd trr
WHERE trr.deleted = 0 and trr.EXPR_STS = 0 and trr.CNL_FLG = 0 WHERE trr.deleted = 0 and trr.EXPR_STS = 0 and trr.CNL_FLG = 0
<if test="reqVO.currentFlag != null">
AND trr.CRNT_FLG = #{reqVO.currentFlag}
</if>
<!-- 需要提交,已生效 ,待生效(审批完成的)的--> <!-- 需要提交,已生效 ,待生效(审批完成的)的-->
<if test="reqVO.submitFlag != null and reqVO.submitFlag == 1"> <if test="reqVO.submitFlag != null and reqVO.submitFlag == 1">
and (trr.RCD_STS = 1 or (trr.APL_STS = 'completed' and trr.EFCT_DT > now())) and (trr.RCD_STS = 1 or (trr.APL_STS = 'completed' and trr.EFCT_DT > now()))
@@ -68,35 +72,4 @@
</if> </if>
</select> </select>
<!-- 查询不需要提交and 有效和将来生效的-->
<!-- <select id="getSubmitEffectRecordPage"-->
<!-- resultType="com.zt.plat.module.qms.resource.record.dal.dataobject.recordrecord.RecordRecordDO">-->
<!-- SELECT-->
<!-- <include refid="recordRecordColumns"/>-->
<!-- FROM t_rcd_rcd trr-->
<!-- WHERE-->
<!-- trr.deleted = 0 and trr.EXPR_STS = 0 and trr.CNL_FLG = 0-->
<!-- &lt;!&ndash; 长期有效 或者 没有过期的&ndash;&gt;-->
<!-- and (trr.PMNT = '1' or-->
<!-- trr.EXPR_DT > now()-->
<!-- )-->
<!-- <if test="categoryIds != null and categoryIds.size() > 0">-->
<!-- and-->
<!-- trr.CTGR_ID IN-->
<!-- <foreach collection="categoryIds" item="id" open="(" separator="," close=")">-->
<!-- #{id}-->
<!-- </foreach>-->
<!-- </if>-->
<!-- <if test="reqVO.code != null and reqVO.code != ''">-->
<!-- AND trr.CD = #{reqVO.code}-->
<!-- </if>-->
<!-- <if test="reqVO.name != null and reqVO.name != ''">-->
<!-- AND trr.NAME LIKE CONCAT('%', #{reqVO.name}, '%')-->
<!-- </if>-->
<!-- <if test="reqVO.version != null and reqVO.version != ''">-->
<!-- AND trr.VER = #{reqVO.version}-->
<!-- </if>-->
<!-- ORDER BY trr.CREATE_TIME ASC-->
<!-- </select>-->
</mapper> </mapper>