diff --git a/src/main/java/com/xdap/self_development/pojo/view/TodoAndTemplateView.java b/src/main/java/com/xdap/self_development/pojo/view/TodoAndTemplateView.java index d1fc089..a60ab53 100644 --- a/src/main/java/com/xdap/self_development/pojo/view/TodoAndTemplateView.java +++ b/src/main/java/com/xdap/self_development/pojo/view/TodoAndTemplateView.java @@ -13,7 +13,7 @@ import java.util.List; @SQL(view = "getAllApproval", sql = "SELECT af.id AS \"flowId\", t.id AS \"templateId\", t.template_name AS \"templateName\", t.version AS \"version\", af.flow_status AS \"status\" , af.create_by AS \"createBy\", xu.username AS \"username\", af.created_time AS \"createdTime\", ac.assignees AS current_users FROM yfsjglpt_model_approval_flow af JOIN approval_config ac ON af.id = ac.approval_id AND af.current_node = ac.node_order JOIN yfsjglpt_model_template t ON af.template_id = t.id LEFT JOIN xdap_users xu ON xu.id = af.create_by WHERE t.template_name LIKE CONCAT('%', #templateName, '%') AND af.flow_status LIKE CONCAT('%', #status, '%') AND af.created_time LIKE CONCAT('%', #createdTime, '%') AND xu.username LIKE CONCAT('%', #username, '%') AND af.flow_type = 1 ORDER BY CASE af.flow_status WHEN 'COMPLETE' THEN 1 WHEN 'APPROVING' THEN 2 WHEN 'DRAFT' THEN 3 WHEN 'REJECTED' THEN 4 ELSE 5 END ASC"), @SQL(view = "getApprovalByUserIdAndIds", - sql = "SELECT af.id AS \"flowId\", t.id AS \"templateId\", t.template_name AS \"templateName\", t.version AS \"version\", af.flow_status AS \"status\" , af.create_by AS \"createBy\", af.created_time AS \"createdTime\" , CASE WHEN current_node = 'PROOFREAD' THEN proofread_users WHEN current_node = 'REVIEW' THEN review_users WHEN current_node = 'COUNTERSIGN' THEN countersign_users WHEN current_node = 'APPROVE' THEN approve_users END AS current_users FROM yfsjglpt_model_approval_flow af JOIN yfsjglpt_model_template t ON af.template_id = t.id WHERE t.template_name like CONCAT('%',#templateName, '%') and af.flow_status like CONCAT('%',#status, '%') and af.flow_type = 1 and af.id NOT IN (#ids) AND af.create_by = #createBy"), + sql = "SELECT af.id AS \"flowId\", t.id AS \"templateId\", t.template_name AS \"templateName\", t.version AS \"version\", af.flow_status AS \"status\" , af.create_by AS \"createBy\", af.created_time AS \"createdTime\" , CASE WHEN current_node = 'PROOFREAD' THEN proofread_users WHEN current_node = 'REVIEW' THEN review_users WHEN current_node = 'COUNTERSIGN' THEN countersign_users WHEN current_node = 'APPROVE' THEN approve_users END AS current_users FROM yfsjglpt_model_approval_flow af JOIN yfsjglpt_model_template t ON af.template_id = t.id WHERE t.template_name like CONCAT('%',#templateName, '%') and af.flow_status like CONCAT('%',#status, '%') and af.flow_type = 1 and af.id NOT IN (#ids) AND af.create_by = #createBy"), @SQL(view = "getTodoAndTemplate", sql = "SELECT af.id AS \"flowId\", t.id AS \"templateId\", t.template_name AS \"templateName\", t.version AS \"version\", af.flow_status AS \"status\" , af.create_by AS \"createBy\" , xu.username AS \"username\", af.created_time AS \"createdTime\" , CASE WHEN current_node = 'PROOFREAD' THEN proofread_users WHEN current_node = 'REVIEW' THEN review_users WHEN current_node = 'COUNTERSIGN' THEN countersign_users WHEN current_node = 'APPROVE' THEN approve_users END AS current_users FROM yfsjglpt_model_approval_flow af JOIN yfsjglpt_model_template t ON af.template_id = t.id LEFT JOIN xdap_users xu ON xu.id = af.create_by WHERE t.template_name LIKE CONCAT('%', #templateName, '%') AND af.flow_status LIKE CONCAT('%', #status, '%') AND af.created_time LIKE CONCAT('%', #createdTime, '%') AND xu.username LIKE CONCAT('%', #username, '%') AND af.flow_type = 1 AND (af.id IN (#ids) OR af.create_by = #createBy) ORDER BY CASE af.flow_status WHEN 'COMPLETE' THEN 1 WHEN 'APPROVING' THEN 2 WHEN 'DRAFT' THEN 3 WHEN 'REJECTED' THEN 4 ELSE 5 END ASC") }) diff --git a/src/main/java/com/xdap/self_development/service/impl/BenchmarkingReportServiceImpl.java b/src/main/java/com/xdap/self_development/service/impl/BenchmarkingReportServiceImpl.java index f6d8d28..b3bbe1e 100644 --- a/src/main/java/com/xdap/self_development/service/impl/BenchmarkingReportServiceImpl.java +++ b/src/main/java/com/xdap/self_development/service/impl/BenchmarkingReportServiceImpl.java @@ -360,7 +360,7 @@ public class BenchmarkingReportServiceImpl implements BenchmarkingReportService // 待办环节修改 bd.getBusinessDatabase() .eq("document_no", flow.getId()) - .update("node", "已完成") + .update("current_node", "已完成") .doUpdate(TodoTaskPojo.class); } else { flow.setCurrentNode(1); @@ -406,7 +406,9 @@ public class BenchmarkingReportServiceImpl implements BenchmarkingReportService list.add(todoTask); } } - bd.getBusinessDatabase().doBatchInsert(list); + if (!list.isEmpty()) { + bd.getBusinessDatabase().doBatchInsert(list); + } } private void cancelProcess(ApprovalFlow flow, String status, String userId) { @@ -427,7 +429,7 @@ public class BenchmarkingReportServiceImpl implements BenchmarkingReportService bd.getBusinessDatabase() .eq("document_no", flow.getId()) - .update("node", "已拒绝") + .update("current_node", "已拒绝") .doUpdate(TodoTaskPojo.class); // 清除所有待办 clearAllTodo(flow, userId); diff --git a/src/main/java/com/xdap/self_development/service/impl/TemplateApprovalServiceImpl.java b/src/main/java/com/xdap/self_development/service/impl/TemplateApprovalServiceImpl.java index 3d2e9e6..323089a 100644 --- a/src/main/java/com/xdap/self_development/service/impl/TemplateApprovalServiceImpl.java +++ b/src/main/java/com/xdap/self_development/service/impl/TemplateApprovalServiceImpl.java @@ -299,7 +299,7 @@ public class TemplateApprovalServiceImpl implements TemplateApprovalService { bd.getBusinessDatabase() .eq("document_no", flow.getId()) - .update("node", "已拒绝") + .update("current_node", "已拒绝") .doUpdate(TodoTaskPojo.class); // 清除所有待办 clearAllTodo(flow); @@ -352,7 +352,7 @@ public class TemplateApprovalServiceImpl implements TemplateApprovalService { // 待办环节修改 bd.getBusinessDatabase() .eq("document_no", flow.getId()) - .update("node", "已完成") + .update("current_node", "已完成") .doUpdate(TodoTaskPojo.class); // 更新机型版本 // dataEntryEngineModelService.updateModelForNewVersion(); @@ -393,7 +393,7 @@ public class TemplateApprovalServiceImpl implements TemplateApprovalService { .eq("owner_id", person).doQueryFirst(TodoTaskPojo.class); if (todoTaskPojo != null) { todoTaskPojo.setCurrentNode(node.getNodeName()); - todoTaskPojo.setCurrentProcessor(JSON.toJSONString(node.getAssignees())); + todoTaskPojo.setCurrentProcessor(node.getAssignees()); bd.getBusinessDatabase().doUpdate(todoTaskPojo); } else { TodoTaskPojo todoTask = new TodoTaskPojo(); @@ -410,11 +410,13 @@ public class TemplateApprovalServiceImpl implements TemplateApprovalService { todoTask.setStatusCode(flow.getFlowStatus()); todoTask.setVersionNumber(template.getVersion()); todoTask.setOwnerId(person); - todoTask.setCurrentProcessor(JSON.toJSONString(node.getAssignees())); + todoTask.setCurrentProcessor(node.getAssignees()); list.add(todoTask); } } - bd.getBusinessDatabase().doBatchInsert(list); + if (!list.isEmpty()) { + bd.getBusinessDatabase().doBatchInsert(list); + } } @Override @@ -562,7 +564,7 @@ public class TemplateApprovalServiceImpl implements TemplateApprovalService { } ApprovalConfigPojo currentNode = bd.getBusinessDatabase() .eq("approval_id", request.getFlowId()) - .eq("current_node", Integer.valueOf(flow.getCurrentNode())) + .eq("current_node", flow.getCurrentNode()) .doQueryFirst(ApprovalConfigPojo.class); if ("RETURN".equals(request.getResult())) { ApprovalRecord record = new ApprovalRecord();