|
@@ -407,6 +407,7 @@ public class WorkKnowledgeBaseShareService extends CrudService<WorkKnowledgeBase
|
|
|
boolean isTypicalCase = false; // 是否为典型案例分类
|
|
boolean isTypicalCase = false; // 是否为典型案例分类
|
|
|
boolean isInternalDocRootNode = false; // 是否为"公司内部发文"根节点(parent_id=0)
|
|
boolean isInternalDocRootNode = false; // 是否为"公司内部发文"根节点(parent_id=0)
|
|
|
String treeNameForNotify = null; // 保存treeName,用于后续通知判断
|
|
String treeNameForNotify = null; // 保存treeName,用于后续通知判断
|
|
|
|
|
+ boolean isAdmin = UserUtils.getUser().isAdmin(); // 当前用户是否为管理员
|
|
|
|
|
|
|
|
if (StringUtils.isNotBlank(shareInfo.getTreeNodeId())) {
|
|
if (StringUtils.isNotBlank(shareInfo.getTreeNodeId())) {
|
|
|
WorkKnowledgeBaseTreeInfo treeInfo = getTreeInfoById(shareInfo.getTreeNodeId());
|
|
WorkKnowledgeBaseTreeInfo treeInfo = getTreeInfoById(shareInfo.getTreeNodeId());
|
|
@@ -456,13 +457,20 @@ public class WorkKnowledgeBaseShareService extends CrudService<WorkKnowledgeBase
|
|
|
} else {
|
|
} else {
|
|
|
// ========== 非问答分类:走原有审核流程 ==========
|
|
// ========== 非问答分类:走原有审核流程 ==========
|
|
|
// 典型案例分类也走正常审核流程,根据有无附件判断状态
|
|
// 典型案例分类也走正常审核流程,根据有无附件判断状态
|
|
|
|
|
+ // 管理员上传时,有附件直接审核通过(5),无需审核
|
|
|
if (isNew) {
|
|
if (isNew) {
|
|
|
- // 新增:无文件草稿0,有文件未审核 1
|
|
|
|
|
- shareInfo.setAuditStatus(hasValidAttachment ? AUDIT_STATUS_PENDING : AUDIT_STATUS_DRAFT);
|
|
|
|
|
|
|
+ // 新增:无文件草稿0,有文件未审核 1(管理员直接审核通过5)
|
|
|
|
|
+ String newAuditStatus;
|
|
|
|
|
+ if (hasValidAttachment) {
|
|
|
|
|
+ newAuditStatus = isAdmin ? AUDIT_STATUS_PASSED : AUDIT_STATUS_PENDING;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ newAuditStatus = AUDIT_STATUS_DRAFT;
|
|
|
|
|
+ }
|
|
|
|
|
+ shareInfo.setAuditStatus(newAuditStatus);
|
|
|
shareInfo.setAuditPassCount(0);
|
|
shareInfo.setAuditPassCount(0);
|
|
|
shareInfo.setAuditRejectCount(0);
|
|
shareInfo.setAuditRejectCount(0);
|
|
|
- // 有附件时记录提交审核人为当前登录人,同时初始化本轮审核起始时间
|
|
|
|
|
- if (hasValidAttachment) {
|
|
|
|
|
|
|
+ // 有附件且非管理员(走审核流程)时记录提交审核人为当前登录人,同时初始化本轮审核起始时间
|
|
|
|
|
+ if (hasValidAttachment && !isAdmin) {
|
|
|
shareInfo.setSubmitAuditUserId(UserUtils.getUser().getId());
|
|
shareInfo.setSubmitAuditUserId(UserUtils.getUser().getId());
|
|
|
shareInfo.setAuditStartDate(new Date());
|
|
shareInfo.setAuditStartDate(new Date());
|
|
|
}
|
|
}
|
|
@@ -476,15 +484,21 @@ public class WorkKnowledgeBaseShareService extends CrudService<WorkKnowledgeBase
|
|
|
currentStatus = dbRecord.getAuditStatus();
|
|
currentStatus = dbRecord.getAuditStatus();
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- logger.info("编辑模式 - currentStatus:'" + currentStatus + "', isQaCategory:" + isQaCategory + ", isInternalDocRootNode:" + isInternalDocRootNode);
|
|
|
|
|
|
|
+ logger.info("编辑模式 - currentStatus:'" + currentStatus + "', isQaCategory:" + isQaCategory + ", isInternalDocRootNode:" + isInternalDocRootNode + ", isAdmin:" + isAdmin);
|
|
|
// currentStatus为null时视为未初始化,允许重新判定;草稿(0)和审核未通过(4)也允许重新判定
|
|
// currentStatus为null时视为未初始化,允许重新判定;草稿(0)和审核未通过(4)也允许重新判定
|
|
|
if (currentStatus == null || currentStatus.equals(AUDIT_STATUS_DRAFT) || currentStatus.equals(AUDIT_STATUS_REJECTED)) {
|
|
if (currentStatus == null || currentStatus.equals(AUDIT_STATUS_DRAFT) || currentStatus.equals(AUDIT_STATUS_REJECTED)) {
|
|
|
- shareInfo.setAuditStatus(hasValidAttachment ? AUDIT_STATUS_PENDING : AUDIT_STATUS_DRAFT);
|
|
|
|
|
- logger.info("状态重新判定 - 新auditStatus:'" + shareInfo.getAuditStatus() + "'");
|
|
|
|
|
|
|
+ String editAuditStatus;
|
|
|
|
|
+ if (hasValidAttachment) {
|
|
|
|
|
+ editAuditStatus = isAdmin ? AUDIT_STATUS_PASSED : AUDIT_STATUS_PENDING;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ editAuditStatus = AUDIT_STATUS_DRAFT;
|
|
|
|
|
+ }
|
|
|
|
|
+ shareInfo.setAuditStatus(editAuditStatus);
|
|
|
|
|
+ logger.info("状态重新判定 - 新auditStatus:'" + shareInfo.getAuditStatus() + "', isAdmin:" + isAdmin);
|
|
|
shareInfo.setAuditPassCount(0);
|
|
shareInfo.setAuditPassCount(0);
|
|
|
shareInfo.setAuditRejectCount(0);
|
|
shareInfo.setAuditRejectCount(0);
|
|
|
- // 重新提交时更新提交审核人为当前登录人,并刷新本轮审核起始时间(历史审核记录依靠该时间隔离)
|
|
|
|
|
- if (hasValidAttachment) {
|
|
|
|
|
|
|
+ // 重新提交且非管理员(走审核流程)时更新提交审核人为当前登录人,并刷新本轮审核起始时间
|
|
|
|
|
+ if (hasValidAttachment && !isAdmin) {
|
|
|
shareInfo.setSubmitAuditUserId(UserUtils.getUser().getId());
|
|
shareInfo.setSubmitAuditUserId(UserUtils.getUser().getId());
|
|
|
shareInfo.setAuditStartDate(new Date());
|
|
shareInfo.setAuditStartDate(new Date());
|
|
|
}
|
|
}
|
|
@@ -543,9 +557,9 @@ public class WorkKnowledgeBaseShareService extends CrudService<WorkKnowledgeBase
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // ========== 仅针对典型案例(原创)、培训心得、技术总结 才发送代办/通知 ==========
|
|
|
|
|
- boolean needsNotify = "技术总结".equals(treeNameForNotify) || "培训心得".equals(treeNameForNotify)
|
|
|
|
|
- || ("典型案例".equals(treeNameForNotify) && "0".equals(shareInfo.getContentAttribute()));
|
|
|
|
|
|
|
+ // ========== 仅针对典型案例(原创)、培训心得、技术总结 才发送代办/通知(管理员上传无需审核,不发送) ==========
|
|
|
|
|
+ boolean needsNotify = !isAdmin && ("技术总结".equals(treeNameForNotify) || "培训心得".equals(treeNameForNotify)
|
|
|
|
|
+ || ("典型案例".equals(treeNameForNotify) && "0".equals(shareInfo.getContentAttribute())));
|
|
|
|
|
|
|
|
if (needsNotify) {
|
|
if (needsNotify) {
|
|
|
//在往work_project_notify表中添加代办或者通知数据之前 需要根据shareInfo.getId()(即WorkProjectNotify表中的notify_id字段)进行判断,如果已经存在数据,则需要全部删除之后重新添加,否则可能导致重复数据
|
|
//在往work_project_notify表中添加代办或者通知数据之前 需要根据shareInfo.getId()(即WorkProjectNotify表中的notify_id字段)进行判断,如果已经存在数据,则需要全部删除之后重新添加,否则可能导致重复数据
|