浏览代码

质量问题审核流程修改

wangliang 1 年之前
父节点
当前提交
d0b47e1701

+ 2 - 0
sop-business/src/main/java/com/qmth/sop/business/activiti/service/ActivitiService.java

@@ -50,6 +50,7 @@ public interface ActivitiService {
      *
      * @param flowDeploymentId
      * @param approve
+     * @param setup
      * @param taskId
      * @param formProperties
      * @param approveUserIds
@@ -59,6 +60,7 @@ public interface ActivitiService {
      */
     public Map<String, Object> taskApprove(String flowDeploymentId,
                                            FlowApprovePassEnum approve,
+                                           Integer setup,
                                            Long taskId,
                                            String formProperties,
                                            List<String> approveUserIds,

+ 24 - 4
sop-business/src/main/java/com/qmth/sop/business/activiti/service/impl/ActivitiServiceImpl.java

@@ -28,6 +28,7 @@ import org.activiti.engine.HistoryService;
 import org.activiti.engine.RepositoryService;
 import org.activiti.engine.RuntimeService;
 import org.activiti.engine.TaskService;
+import org.activiti.engine.history.HistoricIdentityLink;
 import org.activiti.engine.history.HistoricTaskInstance;
 import org.activiti.engine.impl.bpmn.behavior.MultiInstanceActivityBehavior;
 import org.activiti.engine.repository.DeploymentBuilder;
@@ -160,6 +161,7 @@ public class ActivitiServiceImpl implements ActivitiService {
      *
      * @param flowDeploymentId
      * @param approve
+     * @param setup
      * @param taskId
      * @param formProperties
      * @param approveUserIds
@@ -170,6 +172,7 @@ public class ActivitiServiceImpl implements ActivitiService {
     @Override
     public Map<String, Object> taskApprove(String flowDeploymentId,
                                            FlowApprovePassEnum approve,
+                                           Integer setup,
                                            Long taskId,
                                            String formProperties,
                                            List<String> approveUserIds,
@@ -253,7 +256,11 @@ public class ActivitiServiceImpl implements ActivitiService {
                             currFlowTaskResult.getSetup(), Long.parseLong(processFlowId),
                             Long.parseLong(task.getId()), tfCustomFlowEntity.getId(), approveUserIds.toString().replaceAll("\\[", "").replaceAll("\\]", ""));
                     if (approve == FlowApprovePassEnum.PASS || approve == FlowApprovePassEnum.DRAFT || approve == FlowApprovePassEnum.START) {
-                        currSetup = currSetup == setupMap.size() - 1 ? 0 : currSetup + 1;
+                        if (Objects.nonNull(setup)) {
+                            currSetup = setup;
+                        } else {
+                            currSetup = currSetup == setupMap.size() - 1 ? 0 : currSetup + 1;
+                        }
                         nextFlowTaskResult = this.getNextFlowTaskResult(nrOfCompletedInstances,
                                 nrOfInstances,
                                 currFlowTaskResult,
@@ -275,7 +282,12 @@ public class ActivitiServiceImpl implements ActivitiService {
                                 approveRemark);
                         map.put(SystemConstant.DEFAULT_ASSIGNEE_LIST + nextFlowTaskResult.getSetup(), approveUserIds);
                     } else if (approve == FlowApprovePassEnum.REJECT || approve == FlowApprovePassEnum.CANCEL) {
-                        currSetup = currSetup - 1;
+                        if (Objects.nonNull(setup)) {
+                            currSetup = setup;
+                        } else {
+                            currSetup = currSetup - 1;
+                        }
+
                         nextFlowTaskResult = this.getNextFlowTaskResult(nrOfCompletedInstances,
                                 nrOfInstances,
                                 currFlowTaskResult,
@@ -309,9 +321,17 @@ public class ActivitiServiceImpl implements ActivitiService {
                                 Set<String> approveIdSet = new LinkedHashSet<>();
                                 for (int i = historicTaskInstanceList.size() - 1; i >= 0; i--) {
                                     HistoricTaskInstance historicTaskInstance = historicTaskInstanceList.get(i);
-//                                    List<HistoricIdentityLink> historicIdentityLinkList = historyService.getHistoricIdentityLinksForTask(task.getId());
                                     if (Objects.equals(historicTaskInstance.getTaskDefinitionKey(), nextFlowTaskResult.getTaskKey())) {
-                                        approveIdSet.add(historicTaskInstance.getAssignee());
+                                        if (Objects.nonNull(historicTaskInstance.getAssignee())) {
+                                            approveIdSet.add(historicTaskInstance.getAssignee());
+                                        } else {
+                                            List<HistoricIdentityLink> historicIdentityLinkList = historyService.getHistoricIdentityLinksForTask(historicTaskInstance.getId());
+                                            if (!CollectionUtils.isEmpty(historicIdentityLinkList)) {
+                                                for (HistoricIdentityLink h : historicIdentityLinkList) {
+                                                    approveIdSet.add(h.getUserId());
+                                                }
+                                            }
+                                        }
                                     }
                                 }
                                 map.put(SystemConstant.DEFAULT_ASSIGNEE_LIST + nextFlowTaskResult.getSetup(), new ArrayList<>(approveIdSet));

+ 11 - 0
sop-business/src/main/java/com/qmth/sop/business/entity/TBQualityProblemApply.java

@@ -34,6 +34,9 @@ public class TBQualityProblemApply implements Serializable {
     @ApiModelProperty(value = "crm单号")
     private String crmNo;
 
+    @ApiModelProperty(value = "问题单号")
+    private String problemNo;
+
     @ApiModelProperty(value = "服务单元id")
     @JsonSerialize(using = ToStringSerializer.class)
     private Long serviceId;
@@ -66,6 +69,14 @@ public class TBQualityProblemApply implements Serializable {
     @ApiModelProperty(value = "创建时间")
     private Long createTime;
 
+    public String getProblemNo() {
+        return problemNo;
+    }
+
+    public void setProblemNo(String problemNo) {
+        this.problemNo = problemNo;
+    }
+
     public Long getId() {
         return id;
     }

+ 59 - 1
sop-business/src/main/resources/db/log/wangliang_update_log.sql

@@ -293,4 +293,62 @@ ALTER TABLE t_d_form_widget ADD sub_title varchar(1000) NULL COMMENT '子标题'
 ALTER TABLE t_d_form_widget CHANGE sub_title sub_title varchar(1000) NULL COMMENT '子标题' AFTER span;
 
 ALTER TABLE t_d_table_prop ADD sub_title varchar(1000) NULL COMMENT '子标题';
-ALTER TABLE t_d_table_prop CHANGE sub_title sub_title varchar(1000) NULL COMMENT '子标题' AFTER colspan;
+ALTER TABLE t_d_table_prop CHANGE sub_title sub_title varchar(1000) NULL COMMENT '子标题' AFTER colspan;
+
+--2023.8.11update
+UPDATE sys_privilege
+SET name='通知公告管理', url='noticeManage', `type`='MENU', parent_id=8, `sequence`=1, property=NULL, related=NULL, enable=1, default_auth=0, front_display=1
+WHERE id=9;
+
+INSERT INTO sys_privilege
+(id, name, url, `type`, parent_id, `sequence`, property, related, enable, default_auth, front_display)
+VALUES(3000, '修改密码', '/api/admin/common/update_password', 'URL', 64, 13, 'SYS', NULL, 1, 1, 0);
+INSERT INTO sys_privilege
+(id, name, url, `type`, parent_id, `sequence`, property, related, enable, default_auth, front_display)
+VALUES(3001, '流程审批接口', '/api/admin/flow/approve', 'URL', 64, 14, 'SYS', NULL, 1, 1, 0);
+INSERT INTO sys_privilege
+(id, name, url, `type`, parent_id, `sequence`, property, related, enable, default_auth, front_display)
+VALUES(3002, '创建流程接口', '/api/admin/flow/createDeployment', 'URL', 64, 15, 'SYS', NULL, 1, 1, 0);
+INSERT INTO sys_privilege
+(id, name, url, `type`, parent_id, `sequence`, property, related, enable, default_auth, front_display)
+VALUES(3003, '结束流程接口', '/api/admin/flow/delete', 'URL', 64, 16, 'SYS', NULL, 1, 1, 0);
+INSERT INTO sys_privilege
+(id, name, url, `type`, parent_id, `sequence`, property, related, enable, default_auth, front_display)
+VALUES(3004, '获取流程部署信息接口', '/api/admin/flow/deployment/data', 'URL', 64, 17, 'SYS', NULL, 1, 1, 0);
+INSERT INTO sys_privilege
+(id, name, url, `type`, parent_id, `sequence`, property, related, enable, default_auth, front_display)
+VALUES(3005, '获取流程表单属性接口', '/api/admin/flow/form_properties/get', 'URL', 64, 18, 'SYS', NULL, 1, 1, 0);
+INSERT INTO sys_privilege
+(id, name, url, `type`, parent_id, `sequence`, property, related, enable, default_auth, front_display)
+VALUES(3006, '获取流程待办接口', '/api/admin/flow/getTaskList', 'URL', 64, 19, 'SYS', NULL, 1, 1, 0);
+INSERT INTO sys_privilege
+(id, name, url, `type`, parent_id, `sequence`, property, related, enable, default_auth, front_display)
+VALUES(3007, '流程转办接口', '/api/admin/flow/task/approver/exchange', 'URL', 64, 20, 'SYS', NULL, 1, 1, 0);
+INSERT INTO sys_privilege
+(id, name, url, `type`, parent_id, `sequence`, property, related, enable, default_auth, front_display)
+VALUES(3008, '上传流程接口', '/api/admin/flow/upload', 'URL', 64, 21, 'SYS', NULL, 1, 1, 0);
+INSERT INTO sys_privilege
+(id, name, url, `type`, parent_id, `sequence`, property, related, enable, default_auth, front_display)
+VALUES(3009, '获取流程详细信息接口', '/api/admin/flow/view', 'URL', 64, 22, 'SYS', NULL, 1, 1, 0);
+INSERT INTO sys_privilege
+(id, name, url, `type`, parent_id, `sequence`, property, related, enable, default_auth, front_display)
+VALUES(3010, '清除缓存接口', '/api/admin/common/cache_clear', 'URL', 3012, 1, 'AUTH', NULL, 1, 1, 0);
+INSERT INTO sys_privilege
+(id, name, url, `type`, parent_id, `sequence`, property, related, enable, default_auth, front_display)
+VALUES(3011, '超管菜单', 'adminManage', 'MENU', NULL, 10, NULL, NULL, 1, 1, 0);
+INSERT INTO sys_privilege
+(id, name, url, `type`, parent_id, `sequence`, property, related, enable, default_auth, front_display)
+VALUES(3012, '清除缓存', 'cacheManage', 'MENU', 3011, 1, NULL, NULL, 1, 1, 0);
+INSERT INTO sys_privilege
+(id, name, url, `type`, parent_id, `sequence`, property, related, enable, default_auth, front_display)
+VALUES(3013, '消息提醒规则', 'messageRuleManage', 'MENU', 3011, 2, NULL, NULL, 1, 1, 0);
+INSERT INTO sys_privilege
+(id, name, url, `type`, parent_id, `sequence`, property, related, enable, default_auth, front_display)
+VALUES(3014, '清除缓存', 'Clear', 'BUTTON', 3012, 1, 'AUTH', '3010', 1, 1, 0);
+INSERT INTO sys_privilege
+(id, name, url, `type`, parent_id, `sequence`, property, related, enable, default_auth, front_display)
+VALUES(3015, '查询枚举接口', '/api/admin/common/query_enum', 'URL', 64, 23, 'SYS', NULL, 1, 1, 0);
+
+
+ALTER TABLE t_b_quality_problem_apply ADD problem_no VARCHAR(100)
+    COMMENT '问题编号' NOT NULL after crm_no;

+ 23 - 0
sop-common/src/main/java/com/qmth/sop/common/enums/EnumList.java

@@ -0,0 +1,23 @@
+package com.qmth.sop.common.enums;
+
+/**
+ * @Description: enum集合
+ * @Param:
+ * @return:
+ * @Author: wangliang
+ * @Date: 2022/1/24
+ */
+public enum EnumList {
+
+    QUALITY_PROBLEM_TYPE_ENUM(QualityProblemTypeEnum.class);
+
+    private Object obj;
+
+    private EnumList(Object obj) {
+        this.obj = obj;
+    }
+
+    public Object getObj() {
+        return obj;
+    }
+}

+ 50 - 3
sop-server/src/main/java/com/qmth/sop/server/api/SysController.java

@@ -9,6 +9,7 @@ import com.qmth.boot.api.annotation.Aac;
 import com.qmth.boot.api.annotation.BOOL;
 import com.qmth.boot.api.constant.ApiConstant;
 import com.qmth.boot.api.exception.ApiException;
+import com.qmth.boot.core.cache.service.CacheService;
 import com.qmth.sop.business.bean.dto.OrgDto;
 import com.qmth.sop.business.bean.dto.OrgDtoNotTree;
 import com.qmth.sop.business.bean.dto.RoleDto;
@@ -42,9 +43,7 @@ import java.io.File;
 import java.io.IOException;
 import java.io.InputStream;
 import java.security.NoSuchAlgorithmException;
-import java.util.List;
-import java.util.Objects;
-import java.util.Optional;
+import java.util.*;
 import java.util.stream.Collectors;
 import java.util.stream.Stream;
 
@@ -89,6 +88,9 @@ public class SysController {
     @Resource
     SysRoleService sysRoleService;
 
+    @Resource
+    CacheService cacheService;
+
     @ApiOperation(value = "登录")
     @RequestMapping(value = "/login", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "用户信息", response = LoginResult.class)})
@@ -339,4 +341,49 @@ public class SysController {
     public Result updatePassword(@RequestBody SysUser sysUser) throws NoSuchAlgorithmException {
         return ResultUtil.ok(sysUserService.updatePassword(sysUser));
     }
+
+    @ApiOperation(value = "清除缓存")
+    @RequestMapping(value = "/cache_clear", method = RequestMethod.POST)
+    @ApiResponses({@ApiResponse(code = 200, message = "返回信息", response = Object.class)})
+    public Result cacheClear(@ApiParam(value = "缓存值") @RequestParam(required = false) String endpoint,
+                             @ApiParam(value = "缓存key") @RequestParam(required = false) String key) {
+        if (Objects.nonNull(endpoint) && Objects.nonNull(key)) {
+            cacheService.evict(endpoint, key);
+        } else if (Objects.nonNull(endpoint)) {
+            cacheService.clear(endpoint);
+        } else {
+            cacheService.clear(SystemConstant.USER_ACCOUNT_CACHE);
+            cacheService.clear(SystemConstant.SYS_CONFIG_CACHE);
+            cacheService.clear(SystemConstant.USER_OAUTH_CACHE);
+            cacheService.clear(SystemConstant.ORG_CACHE);
+            cacheService.clear(SystemConstant.PRIVILEGE_URL_CACHE);
+            cacheService.clear(SystemConstant.ROLE_PRIVILEGE_CACHE);
+            cacheService.clear(SystemConstant.USER_ROLE_PRIVILEGE_CACHE);
+            cacheService.clear(SystemConstant.FORM_WIDGET_CACHE);
+            cacheService.clear(SystemConstant.TABLE_PROP_CACHE);
+            cacheService.clear(SystemConstant.ROLE_CACHE);
+            cacheService.clear(SystemConstant.USER_MENU_CACHE);
+            cacheService.clear(SystemConstant.SCHOOL_CACHE);
+            cacheService.clear(SystemConstant.SCHOOL_CODE_CACHE);
+        }
+        return ResultUtil.ok(true);
+    }
+
+    @ApiOperation(value = "查询枚举")
+    @RequestMapping(value = "/query_enum", method = RequestMethod.POST)
+    @ApiResponses({@ApiResponse(code = 200, message = "返回信息", response = Object.class)})
+    public Result queryEnum(@ApiParam(value = "枚举类型") @RequestParam(required = false) EnumList enumList) throws ClassNotFoundException {
+        Map<Enum, String> map = new LinkedHashMap<>();
+        switch (enumList) {
+            case QUALITY_PROBLEM_TYPE_ENUM:
+                QualityProblemTypeEnum[] qualityProblemTypeEnums = QualityProblemTypeEnum.values();
+                for (QualityProblemTypeEnum qualityProblemTypeEnum : qualityProblemTypeEnums) {
+                    map.put(qualityProblemTypeEnum, qualityProblemTypeEnum.getTitle());
+                }
+                break;
+            default:
+                break;
+        }
+        return ResultUtil.ok(map);
+    }
 }

+ 2 - 1
sop-server/src/main/java/com/qmth/sop/server/api/TFCustomFlowController.java

@@ -82,6 +82,7 @@ public class TFCustomFlowController {
     @ApiResponses({@ApiResponse(code = 200, message = "返回信息", response = Object.class)})
     public Result approve(@ApiParam(value = "流程部署id") @RequestParam(required = false) String flowDeploymentId,
                           @ApiParam(value = "流程操作", required = true) @RequestParam FlowApprovePassEnum approve,
+                          @ApiParam(value = "流程步骤") @RequestParam(required = false) Integer setup,
                           @ApiParam(value = "流程任务id") @RequestParam(required = false) Long taskId,
                           @ApiParam(value = "流程表单数据") @RequestParam(required = false) String formProperties,
                           @ApiParam(value = "流程审批人") @RequestParam(required = false) List<String> approveUserIds,
@@ -98,7 +99,7 @@ public class TFCustomFlowController {
             formDataMap.put(key, value[0]);
         }
         map.putAll(formDataMap);
-        activitiService.taskApprove(flowDeploymentId, approve, taskId, formProperties, approveUserIds, approveRemark, map);
+        activitiService.taskApprove(flowDeploymentId, approve, setup, taskId, formProperties, approveUserIds, approveRemark, map);
         return ResultUtil.ok(true);
     }
 

二进制
sop-server/src/main/resources/qualityProblemFlow.zip


+ 1 - 1
sop-server/src/main/resources/quality_problem_approve.form

@@ -1 +1 @@
-[{"id":"120","code":"TEXT","type":"FORM","formId":"verify_point","formName":"verify_point","title":"核实情况简要","inputType":"STRING","required":true,"readable":false,"writable":true,"visable":true,"length":50,"name":"文本","span":12},{"id":"121","code":"TEXTAREA","type":"FORM","formId":"verify_remark","formName":"verify_remark","title":"核实情况备注","inputType":"STRING","required":false,"readable":false,"writable":true,"visable":true,"length":500,"name":"文本域","span":12},{"id":"122","code":"POP_SELECT","type":"FORM","formId":"approve_users","formName":"approve_users","title":"责任人多选","inputType":"STRING","required":false,"readable":false,"writable":true,"visable":true,"dataGrid":"/api/admin/common/get_org_user_list","name":"弹出选择框","span":6},{"id":"123","code":"SELECT","type":"FORM","formId":"problem_type","formName":"problem_type","title":"问题类型","inputType":"STRING","required":true,"readable":false,"writable":true,"visable":true,"dataGrid":"/api/admin/common/get_problem_type_list","name":"下拉框","span":6},{"id":"124","code":"POP_SELECT","type":"FORM","formId":"approve_check_users","formName":"approve_check_users","title":"复核人多选","inputType":"STRING","required":true,"readable":false,"writable":true,"visable":true,"dataGrid":"/api/admin/common/get_org_user_list","name":"弹出选择框","span":6},{"id":"125","code":"FILE","type":"FORM","formId":"attachment","formName":"attachment","title":"附图","inputType":"FILE","required":false,"readable":false,"writable":true,"visable":true,"name":"文件","span":6}]
+[{"id":"120","code":"TEXT","type":"FORM","formId":"verify_point","formName":"verify_point","title":"核实情况简要","inputType":"STRING","required":true,"readable":false,"writable":true,"visable":true,"length":50,"name":"文本","span":12},{"id":"121","code":"TEXTAREA","type":"FORM","formId":"verify_remark","formName":"verify_remark","title":"核实情况备注","inputType":"STRING","required":false,"readable":false,"writable":true,"visable":true,"length":500,"name":"文本域","span":12},{"id":"122","code":"POP_SELECT","type":"FORM","formId":"approve_users","formName":"approve_users","title":"责任人多选","inputType":"STRING","required":false,"readable":false,"writable":true,"visable":true,"dataGrid":"/api/admin/common/get_org_user_list","name":"弹出选择框","span":6},{"id":"123","code":"SELECT","type":"FORM","formId":"problem_type","formName":"problem_type","title":"问题类型","inputType":"STRING","required":true,"readable":false,"writable":true,"visable":true,"dataGrid":"/api/admin/common/query_enum","name":"下拉框","span":6},{"id":"124","code":"POP_SELECT","type":"FORM","formId":"approve_check_users","formName":"approve_check_users","title":"复核人多选","inputType":"STRING","required":true,"readable":false,"writable":true,"visable":true,"dataGrid":"/api/admin/common/get_org_user_list","name":"弹出选择框","span":6},{"id":"125","code":"FILE","type":"FORM","formId":"attachment","formName":"attachment","title":"附图","inputType":"FILE","required":false,"readable":false,"writable":true,"visable":true,"name":"文件","span":6}]