Эх сурвалжийг харах

项目计划变更、质量问题反馈流程修改,从配置里拉取审核角色

wangliang 1 жил өмнө
parent
commit
54685451a3
18 өөрчлөгдсөн 247 нэмэгдсэн , 33 устгасан
  1. 1 1
      sop-api/src/main/java/com/qmth/sop/server/api/SysController.java
  2. 0 8
      sop-api/src/main/java/com/qmth/sop/server/api/TBQualityProblemApplyController.java
  3. BIN
      sop-api/src/main/resources/cloudMarkSopFlow.zip
  4. BIN
      sop-api/src/main/resources/officeSopFlow.zip
  5. BIN
      sop-api/src/main/resources/qualityProblemFlow.zip
  6. 92 0
      sop-business/src/main/java/com/qmth/sop/business/entity/TFCustomFlowAllocation.java
  7. 3 2
      sop-business/src/main/java/com/qmth/sop/business/mapper/SysUserRoleMapper.java
  8. 16 0
      sop-business/src/main/java/com/qmth/sop/business/mapper/TFCustomFlowAllocationMapper.java
  9. 2 2
      sop-business/src/main/java/com/qmth/sop/business/service/SysUserRoleService.java
  10. 16 0
      sop-business/src/main/java/com/qmth/sop/business/service/TFCustomFlowAllocationService.java
  11. 3 3
      sop-business/src/main/java/com/qmth/sop/business/service/impl/SysUserRoleServiceImpl.java
  12. 20 7
      sop-business/src/main/java/com/qmth/sop/business/service/impl/TBProjectExchangeServiceImpl.java
  13. 19 7
      sop-business/src/main/java/com/qmth/sop/business/service/impl/TBQualityProblemApplyServiceImpl.java
  14. 20 0
      sop-business/src/main/java/com/qmth/sop/business/service/impl/TFCustomFlowAllocationServiceImpl.java
  15. 40 0
      sop-business/src/main/resources/db/log/wangliang_update_log.sql
  16. 6 3
      sop-business/src/main/resources/mapper/SysUserRoleMapper.xml
  17. 5 0
      sop-business/src/main/resources/mapper/TFCustomFlowAllocationMapper.xml
  18. 4 0
      sop-common/src/main/java/com/qmth/sop/common/enums/ExceptionResultEnum.java

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

@@ -332,7 +332,7 @@ public class SysController {
     @RequestMapping(value = "/get_user_list_by_role_type", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "返回信息", response = UserDto.class)})
     public Result getUserListByRoleType(@ApiParam(value = "角色类型", required = true) @RequestParam RoleTypeEnum roleTypeEnum) {
-        return ResultUtil.ok(sysUserRoleService.userListByRoleType(roleTypeEnum));
+        return ResultUtil.ok(sysUserRoleService.userListByRoleType(Arrays.asList(roleTypeEnum)));
     }
 
     @ApiOperation(value = "获取所有机构")

+ 0 - 8
sop-api/src/main/java/com/qmth/sop/server/api/TBQualityProblemApplyController.java

@@ -5,7 +5,6 @@ import com.qmth.boot.api.constant.ApiConstant;
 import com.qmth.sop.business.bean.params.FlowApproveParam;
 import com.qmth.sop.business.bean.result.TBQualityProblemApplyResult;
 import com.qmth.sop.business.entity.TBQualityProblemApply;
-import com.qmth.sop.business.service.SysUserService;
 import com.qmth.sop.business.service.TBQualityProblemApplyService;
 import com.qmth.sop.common.contant.SystemConstant;
 import com.qmth.sop.common.enums.InfluenceDegreeEnum;
@@ -14,7 +13,6 @@ import com.qmth.sop.common.enums.QualityProblemTypeEnum;
 import com.qmth.sop.common.util.Result;
 import com.qmth.sop.common.util.ResultUtil;
 import io.swagger.annotations.*;
-import org.activiti.engine.TaskService;
 import org.springframework.validation.BindingResult;
 import org.springframework.web.bind.annotation.*;
 
@@ -40,12 +38,6 @@ public class TBQualityProblemApplyController {
     @Resource
     TBQualityProblemApplyService tBQualityProblemApplyService;
 
-    @Resource
-    TaskService taskService;
-
-    @Resource
-    SysUserService sysUserService;
-
     @ApiOperation(value = "质量问题反馈表查询接口")
     @RequestMapping(value = "/query", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "质量问题反馈表查询结果", response = TBQualityProblemApplyResult.class)})

BIN
sop-api/src/main/resources/cloudMarkSopFlow.zip


BIN
sop-api/src/main/resources/officeSopFlow.zip


BIN
sop-api/src/main/resources/qualityProblemFlow.zip


+ 92 - 0
sop-business/src/main/java/com/qmth/sop/business/entity/TFCustomFlowAllocation.java

@@ -0,0 +1,92 @@
+package com.qmth.sop.business.entity;
+
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
+import com.qmth.sop.common.enums.TFCustomTypeEnum;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.io.Serializable;
+
+/**
+ * <p>
+ * 流程角色分配表
+ * </p>
+ *
+ * @author wangliang
+ * @since 2023-10-18
+ */
+@ApiModel(value = "TFCustomFlowAllocation对象", description = "流程角色分配表")
+public class TFCustomFlowAllocation implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @ApiModelProperty(value = "主键")
+    @JsonSerialize(using = ToStringSerializer.class)
+    private Long id;
+
+    @ApiModelProperty(value = "流程类型,OFFICE_SOP_FLOW:教务处SOP,CLOUD_MARK_SOP_FLOW:研究生SOP,DING_EXCEPTION_FLOW:考勤异常审核流程,PROJECT_EXCHANGE_FLOW:项目计划变更流程,QUALITY_PROBLEM_FLOW:质量问题反馈流程")
+    private TFCustomTypeEnum type;
+
+    @ApiModelProperty(value = "自定义流程id")
+    @JsonSerialize(using = ToStringSerializer.class)
+    private Long tFCustomFlowId;
+
+    @ApiModelProperty(value = "流程实体id")
+    @JsonSerialize(using = ToStringSerializer.class)
+    private Long tFCustomFlowEntityId;
+
+    @ApiModelProperty(value = "角色分配")
+    private String roleAllocation;
+
+    @ApiModelProperty(value = "版本号")
+    private Integer version;
+
+    public TFCustomTypeEnum getType() {
+        return type;
+    }
+
+    public void setType(TFCustomTypeEnum type) {
+        this.type = type;
+    }
+
+    public Integer getVersion() {
+        return version;
+    }
+
+    public void setVersion(Integer version) {
+        this.version = version;
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long gettFCustomFlowId() {
+        return tFCustomFlowId;
+    }
+
+    public void settFCustomFlowId(Long tFCustomFlowId) {
+        this.tFCustomFlowId = tFCustomFlowId;
+    }
+
+    public Long gettFCustomFlowEntityId() {
+        return tFCustomFlowEntityId;
+    }
+
+    public void settFCustomFlowEntityId(Long tFCustomFlowEntityId) {
+        this.tFCustomFlowEntityId = tFCustomFlowEntityId;
+    }
+
+    public String getRoleAllocation() {
+        return roleAllocation;
+    }
+
+    public void setRoleAllocation(String roleAllocation) {
+        this.roleAllocation = roleAllocation;
+    }
+}

+ 3 - 2
sop-business/src/main/java/com/qmth/sop/business/mapper/SysUserRoleMapper.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.qmth.sop.business.bean.dto.UserDto;
 import com.qmth.sop.business.entity.SysRole;
 import com.qmth.sop.business.entity.SysUserRole;
+import com.qmth.sop.common.enums.RoleTypeEnum;
 import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
@@ -36,8 +37,8 @@ public interface SysUserRoleMapper extends BaseMapper<SysUserRole> {
     /**
      * 根据角色类型查询用户信息
      *
-     * @param roleType
+     * @param roleTypes
      * @return
      */
-    List<UserDto> userListByRoleType(@Param("roleType") String roleType);
+    List<UserDto> userListByRoleType(@Param("roleTypes") List<RoleTypeEnum> roleTypes);
 }

+ 16 - 0
sop-business/src/main/java/com/qmth/sop/business/mapper/TFCustomFlowAllocationMapper.java

@@ -0,0 +1,16 @@
+package com.qmth.sop.business.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.qmth.sop.business.entity.TFCustomFlowAllocation;
+
+/**
+ * <p>
+ * 流程角色分配表 Mapper 接口
+ * </p>
+ *
+ * @author wangliang
+ * @since 2023-10-18
+ */
+public interface TFCustomFlowAllocationMapper extends BaseMapper<TFCustomFlowAllocation> {
+
+}

+ 2 - 2
sop-business/src/main/java/com/qmth/sop/business/service/SysUserRoleService.java

@@ -63,10 +63,10 @@ public interface SysUserRoleService extends IService<SysUserRole> {
     /**
      * 根据角色类型查询用户信息
      *
-     * @param roleTypeEnum
+     * @param roleTypeEnums
      * @return
      */
-    List<UserDto> userListByRoleType(RoleTypeEnum roleTypeEnum);
+    List<UserDto> userListByRoleType(List<RoleTypeEnum> roleTypeEnums);
 
     /**
      * 根据服务单元查找用户

+ 16 - 0
sop-business/src/main/java/com/qmth/sop/business/service/TFCustomFlowAllocationService.java

@@ -0,0 +1,16 @@
+package com.qmth.sop.business.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.qmth.sop.business.entity.TFCustomFlowAllocation;
+
+/**
+ * <p>
+ * 流程角色分配表 服务类
+ * </p>
+ *
+ * @author wangliang
+ * @since 2023-10-18
+ */
+public interface TFCustomFlowAllocationService extends IService<TFCustomFlowAllocation> {
+
+}

+ 3 - 3
sop-business/src/main/java/com/qmth/sop/business/service/impl/SysUserRoleServiceImpl.java

@@ -102,12 +102,12 @@ public class SysUserRoleServiceImpl extends ServiceImpl<SysUserRoleMapper, SysUs
     /**
      * 根据角色类型查询用户信息
      *
-     * @param roleTypeEnum
+     * @param roleTypeEnums
      * @return
      */
     @Override
-    public List<UserDto> userListByRoleType(RoleTypeEnum roleTypeEnum) {
-        return this.baseMapper.userListByRoleType(Objects.nonNull(roleTypeEnum) ? roleTypeEnum.name() : null);
+    public List<UserDto> userListByRoleType(List<RoleTypeEnum> roleTypeEnums) {
+        return this.baseMapper.userListByRoleType(roleTypeEnums);
     }
 
     /**

+ 20 - 7
sop-business/src/main/java/com/qmth/sop/business/service/impl/TBProjectExchangeServiceImpl.java

@@ -1,5 +1,6 @@
 package com.qmth.sop.business.service.impl;
 
+import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -10,10 +11,7 @@ import com.qmth.sop.business.bean.dto.DataPermissionDto;
 import com.qmth.sop.business.bean.dto.UserDto;
 import com.qmth.sop.business.bean.params.FlowApproveParam;
 import com.qmth.sop.business.bean.result.*;
-import com.qmth.sop.business.entity.SysUser;
-import com.qmth.sop.business.entity.TBProjectExchange;
-import com.qmth.sop.business.entity.TFCustomFlowEntity;
-import com.qmth.sop.business.entity.TFFlowApprove;
+import com.qmth.sop.business.entity.*;
 import com.qmth.sop.business.mapper.TBProjectExchangeMapper;
 import com.qmth.sop.business.service.*;
 import com.qmth.sop.common.contant.SystemConstant;
@@ -69,6 +67,9 @@ public class TBProjectExchangeServiceImpl extends ServiceImpl<TBProjectExchangeM
     @Resource
     TFFlowApproveService tfFlowApproveService;
 
+    @Resource
+    TFCustomFlowAllocationService tfCustomFlowAllocationService;
+
     /**
      * 新增项目变更计划申请
      *
@@ -83,10 +84,22 @@ public class TBProjectExchangeServiceImpl extends ServiceImpl<TBProjectExchangeM
             throw ExceptionResultEnum.PARAMS_ERROR.exception("项目计划变更申请只能为提交或草稿");
         }
         SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
-        //查询所有QA角色
-        List<UserDto> userDtoList = sysUserRoleService.userListByRoleType(RoleTypeEnum.QA);
+
+        TFCustomFlowAllocation tfCustomFlowAllocation = tfCustomFlowAllocationService.getOne(new QueryWrapper<TFCustomFlowAllocation>().lambda().eq(TFCustomFlowAllocation::getType, TFCustomTypeEnum.PROJECT_EXCHANGE_FLOW));
+        Optional.ofNullable(tfCustomFlowAllocation).orElseThrow(() -> ExceptionResultEnum.FLOW_ALLOCATION_NO_DATA.exception());
+        Optional.ofNullable(tfCustomFlowAllocation.getRoleAllocation()).orElseThrow(() -> ExceptionResultEnum.FLOW_ALLOCATION_NO_DATA.exception());
+
+        JSONObject jsonObject = JSONObject.parseObject(tfCustomFlowAllocation.getRoleAllocation());
+        JSONArray jsonArray = jsonObject.getJSONArray("roleTypes");
+        List<RoleTypeEnum> roleTypeEnumList = new ArrayList<>(jsonArray.size());
+        for (int i = 0; i < jsonArray.size(); i++) {
+            JSONObject object = jsonArray.getJSONObject(i);
+            roleTypeEnumList.add(RoleTypeEnum.valueOf(object.getString("role")));
+        }
+        //查询所有审核角色
+        List<UserDto> userDtoList = sysUserRoleService.userListByRoleType(roleTypeEnumList);
         if (CollectionUtils.isEmpty(userDtoList)) {
-            throw ExceptionResultEnum.ERROR.exception("系统中没有QA角色的用户");
+            throw ExceptionResultEnum.ERROR.exception("系统中没有" + roleTypeEnumList + "角色的用户");
         }
         List<String> approveUserIds = userDtoList.stream().map(s -> String.valueOf(s.getId())).collect(Collectors.toList());
         FlowApproveParam flowApproveParam = new FlowApproveParam(tbProjectExchange.getFlowDeploymentId(), tbProjectExchange.getFlowApprove(), approveUserIds, tbProjectExchange.getCrmNo());

+ 19 - 7
sop-business/src/main/java/com/qmth/sop/business/service/impl/TBQualityProblemApplyServiceImpl.java

@@ -15,12 +15,10 @@ import com.qmth.sop.business.bean.result.FlowTaskResult;
 import com.qmth.sop.business.bean.result.TBQualityProblemApplyResult;
 import com.qmth.sop.business.entity.SysUser;
 import com.qmth.sop.business.entity.TBQualityProblemApply;
+import com.qmth.sop.business.entity.TFCustomFlowAllocation;
 import com.qmth.sop.business.entity.TFCustomFlowEntity;
 import com.qmth.sop.business.mapper.TBQualityProblemApplyMapper;
-import com.qmth.sop.business.service.SysUserRoleService;
-import com.qmth.sop.business.service.SysUserService;
-import com.qmth.sop.business.service.TBQualityProblemApplyService;
-import com.qmth.sop.business.service.TFCustomFlowEntityService;
+import com.qmth.sop.business.service.*;
 import com.qmth.sop.common.contant.SystemConstant;
 import com.qmth.sop.common.enums.*;
 import com.qmth.sop.common.util.GsonUtil;
@@ -66,6 +64,9 @@ public class TBQualityProblemApplyServiceImpl extends ServiceImpl<TBQualityProbl
     @Resource
     SysUserService sysUserService;
 
+    @Resource
+    TFCustomFlowAllocationService tfCustomFlowAllocationService;
+
     /**
      * 查询列表
      *
@@ -113,10 +114,21 @@ public class TBQualityProblemApplyServiceImpl extends ServiceImpl<TBQualityProbl
         FlowTaskResult currFlowTaskResult = JSONObject.parseObject(tbQualityProblemApply.getFormProperties(), FlowTaskResult.class);
         tbQualityProblemApply = this.updateFieldValue(currFlowTaskResult, tbQualityProblemApply);
 
-        //查询所有QA角色
-        List<UserDto> userDtoList = sysUserRoleService.userListByRoleType(RoleTypeEnum.QA);
+        TFCustomFlowAllocation tfCustomFlowAllocation = tfCustomFlowAllocationService.getOne(new QueryWrapper<TFCustomFlowAllocation>().lambda().eq(TFCustomFlowAllocation::getType, TFCustomTypeEnum.QUALITY_PROBLEM_FLOW));
+        Optional.ofNullable(tfCustomFlowAllocation).orElseThrow(() -> ExceptionResultEnum.FLOW_ALLOCATION_NO_DATA.exception());
+        Optional.ofNullable(tfCustomFlowAllocation.getRoleAllocation()).orElseThrow(() -> ExceptionResultEnum.FLOW_ALLOCATION_NO_DATA.exception());
+
+        JSONObject jsonObject = JSONObject.parseObject(tfCustomFlowAllocation.getRoleAllocation());
+        JSONArray jsonArray = jsonObject.getJSONArray("roleTypes");
+        List<RoleTypeEnum> roleTypeEnumList = new ArrayList<>(jsonArray.size());
+        for (int i = 0; i < jsonArray.size(); i++) {
+            JSONObject object = jsonArray.getJSONObject(i);
+            roleTypeEnumList.add(RoleTypeEnum.valueOf(object.getString("role")));
+        }
+        //查询所有审核角色
+        List<UserDto> userDtoList = sysUserRoleService.userListByRoleType(roleTypeEnumList);
         if (CollectionUtils.isEmpty(userDtoList)) {
-            throw ExceptionResultEnum.ERROR.exception("系统中没有QA角色的用户");
+            throw ExceptionResultEnum.ERROR.exception("系统中没有" + roleTypeEnumList + "角色的用户");
         }
         List<String> approveUserIds = userDtoList.stream().map(s -> String.valueOf(s.getId())).collect(Collectors.toList());
         FlowApproveParam flowApproveParam = new FlowApproveParam(tbQualityProblemApply.getFlowDeploymentId(), tbQualityProblemApply.getFlowApprove(), tbQualityProblemApply.getFormProperties(), approveUserIds, tbQualityProblemApply.getCrmNo());

+ 20 - 0
sop-business/src/main/java/com/qmth/sop/business/service/impl/TFCustomFlowAllocationServiceImpl.java

@@ -0,0 +1,20 @@
+package com.qmth.sop.business.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.qmth.sop.business.entity.TFCustomFlowAllocation;
+import com.qmth.sop.business.mapper.TFCustomFlowAllocationMapper;
+import com.qmth.sop.business.service.TFCustomFlowAllocationService;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ * 流程角色分配表 服务实现类
+ * </p>
+ *
+ * @author wangliang
+ * @since 2023-10-18
+ */
+@Service
+public class TFCustomFlowAllocationServiceImpl extends ServiceImpl<TFCustomFlowAllocationMapper, TFCustomFlowAllocation> implements TFCustomFlowAllocationService {
+
+}

+ 40 - 0
sop-business/src/main/resources/db/log/wangliang_update_log.sql

@@ -1903,3 +1903,43 @@ ALTER TABLE t_s_job_remind CHANGE crm_no crm_no varchar(100) NULL COMMENT 'crm
 
 --2023.10.17update
 INSERT INTO `t_d_form_widget` VALUES (188, 'FILE', 'FORM', 'upload_device_version_photos', 'upload_device_version_photos', '上传扫描仪固件版本号拍照', 'ARRAY', 1, 0, 1, 1, NULL, 5, NULL, NULL, NULL, NULL, 12, NULL, NULL, 'CLOUD_MARK_SOP_FLOW', 4, 0, NULL, NULL, 1, 1);
+
+--2023.10.18update
+UPDATE t_d_form_widget
+SET code='FILE', `type`='FORM', form_id='attachments_info', form_name='attachments_info', title='附件说明', input_type='FILE', required=0, readable=0, writable=1, visable=1, `scale`=NULL, `length`=5, binding=NULL, data_grid=NULL, tips=NULL, format=NULL, span=12, sub_title=NULL, `options`=NULL, flow_type='QUALITY_PROBLEM_FLOW', form_setup=1, handle=0, form_group=NULL, role_type=NULL, create_id=1, create_time=1
+WHERE id=3;
+UPDATE t_d_form_widget
+SET code='FILE', `type`='FORM', form_id='project_info_photos', form_name='project_info_photos', title='上传项目关键信息表(纸质)拍照', input_type='ARRAY', required=1, readable=0, writable=1, visable=1, `scale`=NULL, `length`=5, binding=NULL, data_grid=NULL, tips=NULL, format=NULL, span=12, sub_title=NULL, `options`=NULL, flow_type='CLOUD_MARK_SOP_FLOW', form_setup=2, handle=0, form_group=NULL, role_type=NULL, create_id=1, create_time=1
+WHERE id=132;
+UPDATE t_d_form_widget
+SET code='FILE', `type`='FORM', form_id='paper_form_photos', form_name='paper_form_photos', title='上传关键节点检查表(纸质)拍照', input_type='ARRAY', required=1, readable=0, writable=1, visable=1, `scale`=NULL, `length`=5, binding=NULL, data_grid=NULL, tips=NULL, format=NULL, span=12, sub_title=NULL, `options`=NULL, flow_type='CLOUD_MARK_SOP_FLOW', form_setup=7, handle=0, form_group=NULL, role_type=NULL, create_id=1, create_time=1
+WHERE id=166;
+UPDATE t_d_form_widget
+SET code='FILE', `type`='FORM', form_id='paper_form_photos', form_name='paper_form_photos', title='上传关键节点检查表(纸质)拍照', input_type='ARRAY', required=1, readable=0, writable=1, visable=1, `scale`=NULL, `length`=5, binding=NULL, data_grid=NULL, tips=NULL, format=NULL, span=12, sub_title=NULL, `options`=NULL, flow_type='CLOUD_MARK_SOP_FLOW', form_setup=8, handle=0, form_group=NULL, role_type=NULL, create_id=1, create_time=1
+WHERE id=170;
+UPDATE t_d_form_widget
+SET code='FILE', `type`='FORM', form_id='paper_form_photos', form_name='paper_form_photos', title='上传关键节点检查表(纸质)拍照', input_type='ARRAY', required=1, readable=0, writable=1, visable=1, `scale`=NULL, `length`=5, binding=NULL, data_grid=NULL, tips=NULL, format=NULL, span=12, sub_title=NULL, `options`=NULL, flow_type='CLOUD_MARK_SOP_FLOW', form_setup=9, handle=0, form_group=NULL, role_type=NULL, create_id=1, create_time=1
+WHERE id=176;
+
+CREATE TABLE t_f_custom_flow_allocation
+(
+    id BIGINT
+        COMMENT '主键' NOT NULL,
+    type VARCHAR(100)
+        COMMENT '流程类型,OFFICE_SOP_FLOW:教务处SOP,CLOUD_MARK_SOP_FLOW:研究生SOP,DING_EXCEPTION_FLOW:考勤异常审核流程,PROJECT_EXCHANGE_FLOW:项目计划变更流程,QUALITY_PROBLEM_FLOW:质量问题反馈流程' NOT NULL,
+    t_f_custom_flow_id BIGINT
+        COMMENT '自定义流程id' NULL,
+    t_f_custom_flow_entity_id BIGINT
+        COMMENT '流程实体id' NULL,
+    role_allocation MEDIUMTEXT
+        COMMENT '角色分配' NOT NULL,
+    version INTEGER
+        COMMENT '版本号' NULL
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='流程角色分配表';
+
+/* Add Primary Key */
+ALTER TABLE t_f_custom_flow_allocation ADD CONSTRAINT pkt_f_custom_flow_allocation
+    PRIMARY KEY (id);
+
+/* Add Comments */
+ALTER TABLE t_f_custom_flow_allocation COMMENT = '流程角色分配表';

+ 6 - 3
sop-business/src/main/resources/mapper/SysUserRoleMapper.xml

@@ -22,9 +22,12 @@
         join sys_user_role sur on su.id = sur.user_id
         join sys_org so on so.id = su.org_id
         join sys_role sr on sr.id = sur.role_id
-        <where>
-            <if test="roleType != null and roleType != ''">
-                and sr.type = #{roleType}
+        <where> 1 = 1
+            <if test="roleTypes != null and roleTypes != '' and roleTypes.size() > 0">
+                and sr.type IN
+                <foreach collection="roleTypes" item="item" index="index" open="(" separator="," close=")">
+                    #{item}
+                </foreach>
             </if>
         </where>
     </select>

+ 5 - 0
sop-business/src/main/resources/mapper/TFCustomFlowAllocationMapper.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.qmth.sop.business.mapper.TFCustomFlowAllocationMapper">
+
+</mapper>

+ 4 - 0
sop-common/src/main/java/com/qmth/sop/common/enums/ExceptionResultEnum.java

@@ -107,6 +107,10 @@ public enum ExceptionResultEnum {
 
     SERVICE_DING_APPROVE_USER_NO_DATA(HttpStatus.INTERNAL_SERVER_ERROR, 5000040, "服务单元未找到审核角色用户"),
 
+    FLOW_ALLOCATION_NO_DATA(HttpStatus.INTERNAL_SERVER_ERROR, 5000041, "流程审核角色数据未找到"),
+
+    FLOW_ROLE_ALLOCATION_NO_DATA(HttpStatus.INTERNAL_SERVER_ERROR, 5000042, "流程未配置审核角色数据"),
+
     /**
      * 401
      */