浏览代码

教务处sop修改

wangliang 1 年之前
父节点
当前提交
87e8707d96

+ 1 - 1
sop-api/install/mysql/init/init.sql

@@ -2106,7 +2106,7 @@ INSERT INTO `sys_privilege` (`id`, `name`, `url`, `type`, `parent_id`, `sequence
 INSERT INTO `sys_privilege` (`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `related`, `enable`, `default_auth`, `front_display`) VALUES (3039, '编辑', 'Edit', 'LINK', 42, 6, 'AUTH', '3047,3048', 1, 0, 1);
 INSERT INTO `sys_privilege` (`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `related`, `enable`, `default_auth`, `front_display`) VALUES (3040, '作废', 'Cancel', 'LINK', 42, 7, 'AUTH', '3045', 1, 0, 1);
 INSERT INTO `sys_privilege` (`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `related`, `enable`, `default_auth`, `front_display`) VALUES (3041, 'sop申请接口', '/api/admin/sop/apply', 'URL', 40, 6, 'AUTH', NULL, 1, 1, 0);
-INSERT INTO `sys_privilege` (`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `related`, `enable`, `default_auth`, `front_display`) VALUES (3042, 'sop填报接口', '/api/admin/sop/approve', 'URL', 40, 7, 'AUTH', NULL, 1, 1, 0);
+INSERT INTO `sys_privilege` (`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `related`, `enable`, `default_auth`, `front_display`) VALUES (3042, 'sop填报接口', '/api/admin/sop/approve', 'URL', 40, 7, 'SYS', NULL, 1, 1, 0);
 INSERT INTO `sys_privilege` (`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `related`, `enable`, `default_auth`, `front_display`) VALUES (3043, 'sop列表接口', '/api/admin/sop/list', 'URL', 40, 8, 'AUTH', NULL, 1, 1, 0);
 INSERT INTO `sys_privilege` (`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `related`, `enable`, `default_auth`, `front_display`) VALUES (3044, '质量问题反馈审核', '/api/admin/tb/quality/problem/apply/approve', 'URL', 21, 2, 'AUTH', NULL, 1, 1, 0);
 INSERT INTO `sys_privilege` (`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `related`, `enable`, `default_auth`, `front_display`) VALUES (3045, 'sop作废', '/api/admin/sop/cancel', 'URL', 40, 9, 'AUTH', NULL, 1, 1, 0);

+ 83 - 85
sop-business/src/main/java/com/qmth/sop/business/activiti/service/impl/ActivitiServiceImpl.java

@@ -971,91 +971,89 @@ public class ActivitiServiceImpl implements ActivitiService {
                 }
             }
         }
-        SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
-        if ((tfCustomFlow.getType() == TFCustomTypeEnum.OFFICE_SOP_FLOW
-                || tfCustomFlow.getType() == TFCustomTypeEnum.CLOUD_MARK_SOP_FLOW)) {
-            if (Objects.nonNull(currFlowTaskResult) && currFlowTaskResult.getSetup().intValue() == 3) {
-                List<Task> taskList = taskService.createTaskQuery().processInstanceId(String.valueOf(flowId)).list();
-                List<FlowFormWidgetResult> flowFormWidgetResultListNew = new ArrayList<>();
-                if (!CollectionUtils.isEmpty(taskList) && taskList.size() > 1) {
-                    SysRole sysRole = null;
-                    jump:
-                    for (Task task : taskList) {
-                        if (task.getAssignee().equals(sysUser.getId().toString())) {
-                            List<SysRole> sysRoleList = sysUserRoleService.listRoleByUserId(sysUser.getId());
-                            if (!CollectionUtils.isEmpty(sysRoleList)) {
-                                for (SysRole s : sysRoleList) {
-                                    if (s.getType() == RoleTypeEnum.REGION_MANAGER) {
-                                        sysRole = s;
-                                        break jump;
-                                    } else if (s.getType() == RoleTypeEnum.EFFECT_ENGINEER) {
-                                        sysRole = s;
-                                        break jump;
-                                    }
-                                }
-                            }
-                        }
-                    }
-                    List<FlowFormWidgetResult> flowFormWidgetResultList = currFlowTaskResult.getFormProperty();
-                    for (FlowFormWidgetResult f : flowFormWidgetResultList) {
-                        if (Objects.nonNull(sysRole)) {
-                            //TODO f.getRoleType()待修改
-                            //                            if (f.getRoleType() == sysRole.getType() && (
-                            //                                    sysRole.getType() == RoleTypeEnum.REGION_MANAGER
-                            //                                            || sysRole.getType() == RoleTypeEnum.EFFECT_ENGINEER)) {
-                            //                                flowFormWidgetResultListNew.add(f);
-                            //                            }
-                        } else {
-                            if (f.getFormId().contains(SystemConstant.APPROVE_RADIO_REGION) || f.getFormId()
-                                    .contains(SystemConstant.APPROVE_REMARK_REGION) || f.getFormId()
-                                    .contains(SystemConstant.SIGN_REGION)) {
-                                flowFormWidgetResultListNew.add(f);
-                            }
-                        }
-                    }
-                    currFlowTaskResult.setFormProperty(flowFormWidgetResultListNew);
-                } else if (!CollectionUtils.isEmpty(taskList) && taskList.size() == 1) {
-                    SysRole sysRole = null;
-                    jump:
-                    for (Task task : taskList) {
-                        if (task.getAssignee().equals(sysUser.getId().toString())) {
-                            List<SysRole> sysRoleList = sysUserRoleService.listRoleByUserId(sysUser.getId());
-                            if (!CollectionUtils.isEmpty(sysRoleList)) {
-                                for (SysRole s : sysRoleList) {
-                                    if (s.getType() == RoleTypeEnum.REGION_MANAGER) {
-                                        sysRole = s;
-                                        break jump;
-                                    } else if (s.getType() == RoleTypeEnum.EFFECT_ENGINEER) {
-                                        sysRole = s;
-                                        break jump;
-                                    }
-                                }
-                            }
-                        }
-                    }
-                    List<FlowFormWidgetResult> flowFormWidgetResultList = currFlowTaskResult.getFormProperty();
-                    for (FlowFormWidgetResult f : flowFormWidgetResultList) {
-                        //TODO f.getRoleType()待修改
-                        if (Objects.nonNull(sysRole)) {
-                            //                                && f.getRoleType() != sysRole.getType()) {
-                            f.setReadable(true);
-                            f.setWritable(false);
-                        } else {
-                            if (f.getFormId().contains(SystemConstant.APPROVE_RADIO_REGION) || f.getFormId()
-                                    .contains(SystemConstant.APPROVE_REMARK_REGION) || f.getFormId()
-                                    .contains(SystemConstant.SIGN_REGION)) {
-                                flowFormWidgetResultListNew.add(f);
-                            }
-                        }
-                    }
-                    if (Objects.isNull(sysRole) && Objects.nonNull(currFlowTaskResult)) {
-                        currFlowTaskResult.setFormProperty(flowFormWidgetResultListNew);
-                    }
-                }
-            }
-        } else if (tfCustomFlow.getType() == TFCustomTypeEnum.QUALITY_PROBLEM_FLOW && Objects.nonNull(
-                currFlowTaskResult) && (currFlowTaskResult.getSetup().intValue() == 3
-                || currFlowTaskResult.getSetup().intValue() == 4)) {
+        //        SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
+        //        if ((tfCustomFlow.getType() == TFCustomTypeEnum.OFFICE_SOP_FLOW
+        //                || tfCustomFlow.getType() == TFCustomTypeEnum.CLOUD_MARK_SOP_FLOW)) {
+        //            if (Objects.nonNull(currFlowTaskResult) && currFlowTaskResult.getSetup().intValue() == 3) {
+        //                List<Task> taskList = taskService.createTaskQuery().processInstanceId(String.valueOf(flowId)).list();
+        //                List<FlowFormWidgetResult> flowFormWidgetResultListNew = new ArrayList<>();
+        //                if (!CollectionUtils.isEmpty(taskList) && taskList.size() > 1) {
+        //                    SysRole sysRole = null;
+        //                    jump:
+        //                    for (Task task : taskList) {
+        //                        if (task.getAssignee().equals(sysUser.getId().toString())) {
+        //                            List<SysRole> sysRoleList = sysUserRoleService.listRoleByUserId(sysUser.getId());
+        //                            if (!CollectionUtils.isEmpty(sysRoleList)) {
+        //                                for (SysRole s : sysRoleList) {
+        //                                    if (s.getType() == RoleTypeEnum.REGION_MANAGER) {
+        //                                        sysRole = s;
+        //                                        break jump;
+        //                                    } else if (s.getType() == RoleTypeEnum.EFFECT_ENGINEER) {
+        //                                        sysRole = s;
+        //                                        break jump;
+        //                                    }
+        //                                }
+        //                            }
+        //                        }
+        //                    }
+        //                    List<FlowFormWidgetResult> flowFormWidgetResultList = currFlowTaskResult.getFormProperty();
+        //                    for (FlowFormWidgetResult f : flowFormWidgetResultList) {
+        //                        if (Objects.nonNull(sysRole)) {
+        //                            //                            if (f.getRoleType() == sysRole.getType() && (
+        //                            //                                    sysRole.getType() == RoleTypeEnum.REGION_MANAGER
+        //                            //                                            || sysRole.getType() == RoleTypeEnum.EFFECT_ENGINEER)) {
+        //                            //                                flowFormWidgetResultListNew.add(f);
+        //                            //                            }
+        //                        } else {
+        //                            if (f.getFormId().contains(SystemConstant.APPROVE_RADIO_REGION) || f.getFormId()
+        //                                    .contains(SystemConstant.APPROVE_REMARK_REGION) || f.getFormId()
+        //                                    .contains(SystemConstant.SIGN_REGION)) {
+        //                                flowFormWidgetResultListNew.add(f);
+        //                            }
+        //                        }
+        //                    }
+        //                    currFlowTaskResult.setFormProperty(flowFormWidgetResultListNew);
+        //                } else if (!CollectionUtils.isEmpty(taskList) && taskList.size() == 1) {
+        //                    SysRole sysRole = null;
+        //                    jump:
+        //                    for (Task task : taskList) {
+        //                        if (task.getAssignee().equals(sysUser.getId().toString())) {
+        //                            List<SysRole> sysRoleList = sysUserRoleService.listRoleByUserId(sysUser.getId());
+        //                            if (!CollectionUtils.isEmpty(sysRoleList)) {
+        //                                for (SysRole s : sysRoleList) {
+        //                                    if (s.getType() == RoleTypeEnum.REGION_MANAGER) {
+        //                                        sysRole = s;
+        //                                        break jump;
+        //                                    } else if (s.getType() == RoleTypeEnum.EFFECT_ENGINEER) {
+        //                                        sysRole = s;
+        //                                        break jump;
+        //                                    }
+        //                                }
+        //                            }
+        //                        }
+        //                    }
+        //                    List<FlowFormWidgetResult> flowFormWidgetResultList = currFlowTaskResult.getFormProperty();
+        //                    for (FlowFormWidgetResult f : flowFormWidgetResultList) {
+        //                        if (Objects.nonNull(sysRole)) {
+        //                            //                                && f.getRoleType() != sysRole.getType()) {
+        //                            f.setReadable(true);
+        //                            f.setWritable(false);
+        //                        } else {
+        //                            if (f.getFormId().contains(SystemConstant.APPROVE_RADIO_REGION) || f.getFormId()
+        //                                    .contains(SystemConstant.APPROVE_REMARK_REGION) || f.getFormId()
+        //                                    .contains(SystemConstant.SIGN_REGION)) {
+        //                                flowFormWidgetResultListNew.add(f);
+        //                            }
+        //                        }
+        //                    }
+        //                    if (Objects.isNull(sysRole) && Objects.nonNull(currFlowTaskResult)) {
+        //                        currFlowTaskResult.setFormProperty(flowFormWidgetResultListNew);
+        //                    }
+        //                }
+        //            }
+        //        } else
+        if (tfCustomFlow.getType() == TFCustomTypeEnum.QUALITY_PROBLEM_FLOW && Objects.nonNull(currFlowTaskResult) && (
+                currFlowTaskResult.getSetup().intValue() == 3 || currFlowTaskResult.getSetup().intValue() == 4)) {
             List<FlowFormWidgetResult> flowFormWidgetResultList = currFlowTaskResult.getFormProperty();
             for (FlowFormWidgetResult f : flowFormWidgetResultList) {
                 f.setValue(null);

+ 11 - 11
sop-business/src/main/java/com/qmth/sop/business/service/impl/TBCrmServiceImpl.java

@@ -533,17 +533,17 @@ public class TBCrmServiceImpl extends ServiceImpl<TBCrmMapper, TBCrm> implements
             break;
         case FINISH: // 完结
             tbCrm.setStatus(CrmStatusEnum.FINISH);
-            // crm完结 释放工程师资源
-            List<CrmArchivesAllocationResult> crmArchivesAllocationResultList = tbUserArchivesAllocationService.findAllocationByCrmNo(
-                    crmNo);
-            List<Long> engineerArchivesIdList = crmArchivesAllocationResultList.stream().filter(e -> !RoleTypeEnum.REGION_COORDINATOR.equals(e.getType()))
-                    .map(CrmArchivesAllocationResult::getArchivesId).distinct().collect(Collectors.toList());
-
-            if (CollectionUtils.isNotEmpty(engineerArchivesIdList)) {
-                UpdateWrapper<TBUserArchives> updateWrapper = new UpdateWrapper<>();
-                updateWrapper.lambda().set(TBUserArchives::getStatus, UserArchivesStatusEnum.FREE).in(TBUserArchives::getId, engineerArchivesIdList);
-                tbUserArchivesService.update(updateWrapper);
-            }
+//            // crm完结 释放工程师资源
+//            List<CrmArchivesAllocationResult> crmArchivesAllocationResultList = tbUserArchivesAllocationService.findAllocationByCrmNo(
+//                    crmNo);
+//            List<Long> engineerArchivesIdList = crmArchivesAllocationResultList.stream().filter(e -> !RoleTypeEnum.REGION_COORDINATOR.equals(e.getType()))
+//                    .map(CrmArchivesAllocationResult::getArchivesId).distinct().collect(Collectors.toList());
+
+            //            if (CollectionUtils.isNotEmpty(engineerArchivesIdList)) {
+            //                UpdateWrapper<TBUserArchives> updateWrapper = new UpdateWrapper<>();
+            //                updateWrapper.lambda().set(TBUserArchives::getStatus, UserArchivesStatusEnum.FREE).in(TBUserArchives::getId, engineerArchivesIdList);
+            //                tbUserArchivesService.update(updateWrapper);
+            //            }
             break;
         }
         this.updateById(tbCrm);

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

@@ -75,4 +75,9 @@ ALTER TABLE t_b_crm ADD process_var MEDIUMTEXT
     COMMENT '过程变量' NULL after publish_time;
 
 -- 2024-05-16
-DROP TABLE IF EXISTS `t_b_engineer_allocation`;
+DROP TABLE IF EXISTS `t_b_engineer_allocation`;
+
+-- 2024-05-18
+UPDATE sys_privilege
+SET name='sop填报接口', url='/api/admin/sop/approve', `type`='URL', parent_id=40, `sequence`=7, property='SYS', related=NULL, enable=1, default_auth=1, front_display=0
+WHERE id=3042;