|
@@ -20,6 +20,10 @@ import com.jeeplus.common.utils.StringUtils;
|
|
|
import com.jeeplus.common.utils.excel.ExportExcel;
|
|
import com.jeeplus.common.utils.excel.ExportExcel;
|
|
|
import com.jeeplus.common.utils.excel.ImportExcel;
|
|
import com.jeeplus.common.utils.excel.ImportExcel;
|
|
|
import com.jeeplus.common.web.BaseController;
|
|
import com.jeeplus.common.web.BaseController;
|
|
|
|
|
+import com.jeeplus.modules.WorkKnowledgeBase.entity.*;
|
|
|
|
|
+import com.jeeplus.modules.WorkKnowledgeBase.service.WorkKnowledgeBasePointRuleService;
|
|
|
|
|
+import com.jeeplus.modules.WorkKnowledgeBase.service.WorkKnowledgeBaseReadLikeService;
|
|
|
|
|
+import com.jeeplus.modules.WorkKnowledgeBase.service.WorkKnowledgeBaseShareService;
|
|
|
import com.jeeplus.modules.act.entity.Act;
|
|
import com.jeeplus.modules.act.entity.Act;
|
|
|
import com.jeeplus.modules.act.service.ActTaskService;
|
|
import com.jeeplus.modules.act.service.ActTaskService;
|
|
|
import com.jeeplus.modules.businessQuestions.entity.BusinessQuestions;
|
|
import com.jeeplus.modules.businessQuestions.entity.BusinessQuestions;
|
|
@@ -273,6 +277,7 @@ import org.activiti.engine.HistoryService;
|
|
|
import org.activiti.engine.history.HistoricProcessInstance;
|
|
import org.activiti.engine.history.HistoricProcessInstance;
|
|
|
import org.activiti.engine.runtime.ProcessInstance;
|
|
import org.activiti.engine.runtime.ProcessInstance;
|
|
|
import org.activiti.engine.task.Task;
|
|
import org.activiti.engine.task.Task;
|
|
|
|
|
+import org.checkerframework.checker.nullness.qual.NonNull;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Controller;
|
|
import org.springframework.stereotype.Controller;
|
|
|
import org.springframework.ui.Model;
|
|
import org.springframework.ui.Model;
|
|
@@ -628,6 +633,15 @@ public class WorkProjectNotifyController extends BaseController {
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private ForumService forumService;
|
|
private ForumService forumService;
|
|
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private WorkKnowledgeBaseShareService workKnowledgeBaseShareService;
|
|
|
|
|
+
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private WorkKnowledgeBasePointRuleService pointRuleService;
|
|
|
|
|
+
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private WorkKnowledgeBaseReadLikeService readLikeService;
|
|
|
|
|
+
|
|
|
|
|
|
|
|
@ModelAttribute
|
|
@ModelAttribute
|
|
|
public WorkProjectNotify get(@RequestParam(required = false) String id) {
|
|
public WorkProjectNotify get(@RequestParam(required = false) String id) {
|
|
@@ -7775,6 +7789,8 @@ public class WorkProjectNotifyController extends BaseController {
|
|
|
return this.saveAchiveModifyDirectly(workProjectNotify, model);
|
|
return this.saveAchiveModifyDirectly(workProjectNotify, model);
|
|
|
} else if ("187".equals(workProjectNotify.getType())) {
|
|
} else if ("187".equals(workProjectNotify.getType())) {
|
|
|
return this.sendMilitaryIndustryConfidentiality(workProjectNotify, model);
|
|
return this.sendMilitaryIndustryConfidentiality(workProjectNotify, model);
|
|
|
|
|
+ } else if ("199".equals(workProjectNotify.getType())) {
|
|
|
|
|
+ return this.sendWorkKnowBaseShareInfo(workProjectNotify, model);
|
|
|
} else if ("70".equals(workProjectNotify.getType())) { //部门调转
|
|
} else if ("70".equals(workProjectNotify.getType())) { //部门调转
|
|
|
WorkChangeJob workChangeJob = workChangeJobService.get(workProjectNotify.getNotifyId());
|
|
WorkChangeJob workChangeJob = workChangeJobService.get(workProjectNotify.getNotifyId());
|
|
|
Act act = getByAct(workChangeJob.getProcessInstanceId());
|
|
Act act = getByAct(workChangeJob.getProcessInstanceId());
|
|
@@ -11495,6 +11511,123 @@ public class WorkProjectNotifyController extends BaseController {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
|
|
+ * 业务用章申请
|
|
|
|
|
+ * @param workProjectNotify
|
|
|
|
|
+ * @param model
|
|
|
|
|
+ * @return
|
|
|
|
|
+ */
|
|
|
|
|
+ private @NonNull String sendWorkKnowBaseShareInfo(WorkProjectNotify workProjectNotify, Model model) throws Exception {
|
|
|
|
|
+ WorkKnowledgeBaseShareInfo shareInfo = workKnowledgeBaseShareService.get(workProjectNotify.getNotifyId());
|
|
|
|
|
+ shareInfo.setHome("home");
|
|
|
|
|
+ if (shareInfo == null) {
|
|
|
|
|
+ addMessage(model, "记录不存在!");
|
|
|
|
|
+ return "error";
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 验证是否为问题发起人
|
|
|
|
|
+ String currentUserId = UserUtils.getUser().getId();
|
|
|
|
|
+ if (!currentUserId.equals(shareInfo.getCreateBy().getId())) {
|
|
|
|
|
+ addMessage(model, "只有问题发起人可以确认答案!");
|
|
|
|
|
+
|
|
|
|
|
+ return showWorkKnowBaseShareInfo(shareInfo, model);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 检查问题是否已结束
|
|
|
|
|
+ if ("8".equals(shareInfo.getAuditStatus())) {
|
|
|
|
|
+ addMessage(model, "该问题已确认答案,无法重复操作!");
|
|
|
|
|
+
|
|
|
|
|
+ return showWorkKnowBaseShareInfo(shareInfo, model);
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ model.addAttribute("entity", shareInfo);
|
|
|
|
|
+ return "modules/WorkKnowledgeBase/workKnowledgeBaseConfirmAnswer";
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ private String showWorkKnowBaseShareInfo(WorkKnowledgeBaseShareInfo shareInfo, Model model) throws Exception {
|
|
|
|
|
+ String rootId = shareInfo.getRootId();
|
|
|
|
|
+ String treeNodeId = shareInfo.getTreeNodeId();
|
|
|
|
|
+
|
|
|
|
|
+ if (StringUtils.isBlank(rootId) && StringUtils.isNotBlank(treeNodeId)) {
|
|
|
|
|
+ rootId = workKnowledgeBaseShareService.getRootIdByNodeId(treeNodeId);
|
|
|
|
|
+ shareInfo.setRootId(rootId);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 查询动态字段配置
|
|
|
|
|
+ List<WorkKnowledgeBaseDynamicInfo> dynamicFields = new ArrayList<>();
|
|
|
|
|
+ if (StringUtils.isNotBlank(rootId)) {
|
|
|
|
|
+ dynamicFields = workKnowledgeBaseShareService.findDynamicFields(rootId);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 加载动态字段已有值
|
|
|
|
|
+ Map<String, String> dynValues = new HashMap<>();
|
|
|
|
|
+ if (StringUtils.isNotBlank(shareInfo.getId())) {
|
|
|
|
|
+ List<WorkKnowledgeBaseDynamicValueInfo> existValues =
|
|
|
|
|
+ workKnowledgeBaseShareService.findDynamicValuesByFileId(shareInfo.getId());
|
|
|
|
|
+ if (existValues != null) {
|
|
|
|
|
+ for (WorkKnowledgeBaseDynamicValueInfo val : existValues) {
|
|
|
|
|
+ dynValues.put(val.getDynamicFieldId(), val.getFieldValue());
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 加载附件列表
|
|
|
|
|
+ if (StringUtils.isNotBlank(shareInfo.getId())) {
|
|
|
|
|
+ shareInfo.setWorkAttachments(workKnowledgeBaseShareService.findAttachmentsByFileId(shareInfo.getId()));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ model.addAttribute("entity", shareInfo);
|
|
|
|
|
+ model.addAttribute("dynamicFields", dynamicFields);
|
|
|
|
|
+ model.addAttribute("rootId", rootId);
|
|
|
|
|
+ model.addAttribute("dynValues", dynValues);
|
|
|
|
|
+ // 传递只读标识
|
|
|
|
|
+ model.addAttribute("readOnly", true);
|
|
|
|
|
+
|
|
|
|
|
+ // 获取阅读量和点赞量
|
|
|
|
|
+ if (StringUtils.isNotBlank(shareInfo.getId())) {
|
|
|
|
|
+ model.addAttribute("readCount", readLikeService.getReadCount(shareInfo.getId()));
|
|
|
|
|
+ model.addAttribute("likeCount", readLikeService.getLikeCount(shareInfo.getId()));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 加载审核记录(审核中、审核通过、审核未通过状态时展示)
|
|
|
|
|
+ String auditStatus = shareInfo.getAuditStatus();
|
|
|
|
|
+ if (auditStatus != null && (auditStatus.equals("1") || auditStatus.equals("2") || auditStatus.equals("4") || auditStatus.equals("5"))) {
|
|
|
|
|
+ model.addAttribute("auditRecords", workKnowledgeBaseShareService.findAuditRecordsByFileId(shareInfo.getId()));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 查询treeName,判断是否为需要评分的特殊分类或问答答疑分类
|
|
|
|
|
+ // 注意:必须使用文件本身的treeNodeId,而不是请求参数中的(可能是父节点或空)
|
|
|
|
|
+ WorkKnowledgeBaseShareInfo workKnowledgeBaseShareInfo = workKnowledgeBaseShareService.get(shareInfo.getId());
|
|
|
|
|
+ if (StringUtils.isNotBlank(workKnowledgeBaseShareInfo.getTreeNodeId())) {
|
|
|
|
|
+ WorkKnowledgeBaseTreeInfo treeInfo = workKnowledgeBaseShareService.getTreeInfoById(workKnowledgeBaseShareInfo.getTreeNodeId());
|
|
|
|
|
+ if (treeInfo != null) {
|
|
|
|
|
+ String treeName = treeInfo.getTreeName();
|
|
|
|
|
+ model.addAttribute("treeName", treeName);
|
|
|
|
|
+
|
|
|
|
|
+ // 判断是否为问答答疑分类
|
|
|
|
|
+ boolean isQaCategory = "问答答疑".equals(treeName);
|
|
|
|
|
+ model.addAttribute("isQaCategory", isQaCategory);
|
|
|
|
|
+
|
|
|
|
|
+ // 如果是技术总结或培训心得,查询对应的积分规则
|
|
|
|
|
+ if ("技术总结".equals(treeName) || "培训心得".equals(treeName)) {
|
|
|
|
|
+ // 根据treeName查询work_knowledge_point_category表获取categoryId
|
|
|
|
|
+ List<WorkKnowledgePointCategory> categories = workKnowledgeBaseShareService.findCategoriesByName(treeName);
|
|
|
|
|
+ if (categories != null && !categories.isEmpty()) {
|
|
|
|
|
+ String categoryId = categories.get(0).getId();
|
|
|
|
|
+ // 查询该分类下rule_type=2(创建积分)的规则
|
|
|
|
|
+ WorkKnowledgeBasePointRule rule = pointRuleService.findByCategoryIdAndRuleType(categoryId, "1");
|
|
|
|
|
+ if (rule != null) {
|
|
|
|
|
+ model.addAttribute("pointRule", rule);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return "modules/WorkKnowledgeBase/workKnowledgeBaseShareDetail";
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
* 论坛加入申请
|
|
* 论坛加入申请
|
|
|
* @param workProjectNotify
|
|
* @param workProjectNotify
|
|
|
* @param model
|
|
* @param model
|