文件记录-问题修改
This commit is contained in:
@@ -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_UPDATE = "文件更改";
|
||||
|
||||
|
||||
@@ -42,7 +42,8 @@ public class RecordApplyPageReqVO extends PageParam {
|
||||
private String applyDepartmentName;
|
||||
|
||||
@Schema(description = "评审时间")
|
||||
private LocalDateTime reviewTime;
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] reviewTime;
|
||||
|
||||
@Schema(description = "评审范围")
|
||||
private String reviewRange;
|
||||
@@ -92,4 +93,11 @@ public class RecordApplyPageReqVO extends PageParam {
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
||||
// ==============临时字段================
|
||||
@Schema(description = "创建时间")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
private String code;
|
||||
|
||||
}
|
||||
|
||||
@@ -55,9 +55,6 @@ public class RecordPermissionPageReqVO extends PageParam {
|
||||
@Schema(description = "是否保留标志")
|
||||
private String saveFlag;
|
||||
|
||||
// @Schema(description = "保留结束日期")
|
||||
// private LocalDateTime saveEndDate;
|
||||
|
||||
@Schema(description = "所属部门")
|
||||
private String systemDepartmentCode;
|
||||
|
||||
@@ -80,4 +77,8 @@ public class RecordPermissionPageReqVO extends PageParam {
|
||||
|
||||
private List<Long> userDeptIds;
|
||||
|
||||
private String recordName;
|
||||
|
||||
private String recordCode;
|
||||
|
||||
}
|
||||
@@ -165,5 +165,9 @@ public class RecordApplyDO extends BusinessBaseDO {
|
||||
@TableField(exist = false)
|
||||
private List<RecordAssignDO> assignList;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String name;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String code;
|
||||
}
|
||||
@@ -23,6 +23,7 @@ public interface RecordApplyMapper extends BaseMapperX<RecordApplyDO> {
|
||||
.likeIfPresent(RecordApplyDO::getApplyUserName, reqVO.getApplyUserName())
|
||||
.eqIfPresent(RecordApplyDO::getApplyDepartmentName, reqVO.getApplyDepartmentName())
|
||||
.eqIfPresent(RecordApplyDO::getApplyDepartmentId, reqVO.getApplyDepartmentId())
|
||||
.betweenIfPresent(RecordApplyDO::getReviewTime, reqVO.getReviewTime())
|
||||
.eqIfPresent(RecordApplyDO::getReviewRange, reqVO.getReviewRange())
|
||||
.likeIfPresent(RecordApplyDO::getTargetDepartmentIds, reqVO.getTargetDepartmentIds())
|
||||
.eqIfPresent(RecordApplyDO::getTargetUserIds, reqVO.getTargetUserIds())
|
||||
@@ -35,6 +36,8 @@ public interface RecordApplyMapper extends BaseMapperX<RecordApplyDO> {
|
||||
.eqIfPresent(RecordApplyDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
|
||||
.eqIfPresent(RecordApplyDO::getRemark, reqVO.getRemark())
|
||||
.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));
|
||||
}
|
||||
|
||||
|
||||
@@ -49,7 +49,4 @@ public interface RecordRecordMapper extends BaseMapperX<RecordRecordDO> {
|
||||
IPage<RecordRecordDO> getEffectRecordPage(Page<RecordRecordSaveReqVO> page,
|
||||
RecordRecordPageReqVO reqVO);
|
||||
|
||||
|
||||
// IPage<RecordRecordDO> getNotSubmitEffectRecordPage(Page<RecordRecordSaveReqVO> page, @Param("reqVO") RecordRecordPageReqVO reqVO);
|
||||
|
||||
}
|
||||
@@ -105,18 +105,9 @@ public class RecordApplyServiceImpl implements RecordApplyService, BMPCallbackIn
|
||||
List<Long> detailIds = detailList.stream().map(RecordApplyDetailSaveReqVO::getId).toList();
|
||||
recordApplyDetailService.deleteNotInDetailIdList(applyId, null, recordList); //先删除记录
|
||||
recordApplyDetailService.deleteNotInDetailIdList(applyId, detailIds, null); // 在删除不需要的明细数据
|
||||
CommonResult<RecordApplyRespVO> applyDetailData = 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 createApplyDetailData(updateReqVO, recordApplyDO);
|
||||
}
|
||||
return new CommonResult<RecordApplyRespVO>();
|
||||
return new CommonResult<>();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -149,15 +140,24 @@ public class RecordApplyServiceImpl implements RecordApplyService, BMPCallbackIn
|
||||
if (item.getId() != null) detailIds.add(item.getId()); // 有id的
|
||||
else {
|
||||
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)) {
|
||||
// List<Long> deleteDetailIds = deleteDetailAllList.stream().map(RecordApplyDetailDO::getId).toList();
|
||||
// recordApplyDetailService.deleteRecordApplyDetailListByIds(deleteDetailIds);
|
||||
// }
|
||||
// 更新
|
||||
|
||||
//删除明细id 不存在的数据
|
||||
recordApplyDetailService.deleteNotInDetailIdList(applyId, detailIds,null );
|
||||
|
||||
// 更新旧的明细数据
|
||||
List<RecordApplyDetailSaveReqVO> recordApplyDetailSaveReqVOList = BeanUtils.toBean(detailList, RecordApplyDetailSaveReqVO.class);
|
||||
recordApplyDetailService.updateRecordApplyDetailBatch(recordApplyDetailSaveReqVOList);
|
||||
|
||||
// 添加新数据
|
||||
if (!ObjectUtils.isEmpty(newDetailList)) {
|
||||
recordApplyDetailService.createRecordApplyDetailBatch(newDetailList);
|
||||
}
|
||||
@@ -188,8 +188,8 @@ public class RecordApplyServiceImpl implements RecordApplyService, BMPCallbackIn
|
||||
}
|
||||
// 删除ID 不存在的数据
|
||||
List<RecordApplyDetailSaveReqVO> detailList = updateReqVO.getDetailList();
|
||||
List<Long> list = detailList.stream().map(RecordApplyDetailSaveReqVO::getId).toList();
|
||||
recordApplyDetailService.deleteNotInDetailIdList(applyId, list, null);
|
||||
List<Long> detailIds = detailList.stream().map(RecordApplyDetailSaveReqVO::getId).toList();
|
||||
recordApplyDetailService.deleteNotInDetailIdList(applyId, detailIds, null);
|
||||
|
||||
createApplyDetailData(updateReqVO,recordApplyDO);
|
||||
return BeanUtils.toBean(updateReqVO, RecordApplyRespVO.class);
|
||||
@@ -290,8 +290,10 @@ public class RecordApplyServiceImpl implements RecordApplyService, BMPCallbackIn
|
||||
recordApply.setApplyDepartmentName(loginUser.getVisitDeptName());
|
||||
|
||||
//生成标题
|
||||
String title = nickName + "的" + businessType + "_" + new SimpleDateFormat("yyyy-MM-dd_HH:mm:ss").format(new Date());
|
||||
recordApply.setTitle(title);
|
||||
if (ObjectUtils.isEmpty(param.getTitle())) {
|
||||
String title = nickName + "的" + businessType + "_" + new SimpleDateFormat("yyyy-MM-dd_HH:mm:ss").format(new Date());
|
||||
recordApply.setTitle(title);
|
||||
}
|
||||
try {
|
||||
recordApplyMapper.insert(recordApply);
|
||||
} catch (Exception e) {
|
||||
@@ -592,7 +594,7 @@ public class RecordApplyServiceImpl implements RecordApplyService, BMPCallbackIn
|
||||
if (ObjectUtils.isEmpty(applyId)) throw exception0(RECORD_RECORD_NOT_EXISTS.getCode(), "申请记录不存在");
|
||||
RecordApplyDO recordApplyDO = recordApplyMapper.selectById(applyId);
|
||||
|
||||
// TODO // 提交,不需要走流程
|
||||
// TODO 提交,不需要走流程
|
||||
Integer isSubmit = param.getIsSubmit();
|
||||
if (!ObjectUtils.isEmpty(isSubmit) && isSubmit == 1) {
|
||||
RecordApplyDO applyDO = applySubmitStatus(recordApplyDO);
|
||||
@@ -691,6 +693,7 @@ public class RecordApplyServiceImpl implements RecordApplyService, BMPCallbackIn
|
||||
// 更新申请提交状态
|
||||
recordApplyDO.setIsSubmit(1);
|
||||
recordApplyDO.setBusinessStatus(QmsCommonConstant.SUBMITTED);
|
||||
recordApplyDO.setApplyEndDate(LocalDateTime.now());
|
||||
recordApplyMapper.updateById(recordApplyDO);
|
||||
return recordApplyDO;
|
||||
}
|
||||
@@ -957,7 +960,7 @@ public class RecordApplyServiceImpl implements RecordApplyService, BMPCallbackIn
|
||||
else permissionDO.setSaveFlag(saveFlag);
|
||||
if (businessType.equals(RecordConstants.BusinessType.VIEW_APPLY)) {
|
||||
targetType = RecordConstants.TargetType.USER;
|
||||
permissionDO.setSaveFlag("1"); // 文件查看使用
|
||||
// permissionDO.setSaveFlag("1"); // 文件查看使用
|
||||
}
|
||||
|
||||
if (ObjectUtils.isEmpty(targetType))
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -137,12 +137,13 @@
|
||||
<include refid="recordAndPermissionColumn"/>
|
||||
FROM T_RCD_PERM trp
|
||||
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">
|
||||
and trp.TGT_TP = '用户' AND trp.TGT_ID = #{recordP.userId}
|
||||
</if>
|
||||
<!-- 部门-->
|
||||
<!-- 部门-->
|
||||
<if test="recordP.userDeptIds != null and recordP.userDeptIds.size() > 0">
|
||||
and
|
||||
(trp.tgt_tp = '部门' AND trp.tgt_id IN
|
||||
@@ -151,6 +152,14 @@
|
||||
</foreach>
|
||||
)
|
||||
</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>
|
||||
|
||||
|
||||
|
||||
@@ -39,6 +39,10 @@
|
||||
FROM t_rcd_rcd trr
|
||||
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">
|
||||
and (trr.RCD_STS = 1 or (trr.APL_STS = 'completed' and trr.EFCT_DT > now()))
|
||||
@@ -68,35 +72,4 @@
|
||||
</if>
|
||||
</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-->
|
||||
<!-- <!– 长期有效 或者 没有过期的–>-->
|
||||
<!-- 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>
|
||||
Reference in New Issue
Block a user