Lius
3 天以前 57945f688fd21076e36ab5332028c8b4a6dcf59c
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamThirdMaintenanceOrderServiceImpl.java
@@ -172,7 +172,7 @@
        //判断是否存在保养人 如果存在则启动流程
        if (StringUtils.isNotBlank(order.getOperator())) {
            //启动流程
            flowCommonService.initActBusiness("工单号:" + order.getOrderNum() + ";设备编号: " + equipment.getEquipmentCode() + ";进行设备三保",
            flowCommonService.initActBusiness("工单号:" + order.getOrderNum() + ";设备编号: " + equipment.getEquipmentCode() + ";安装位置" + equipment.getInstallationPosition(),
                    order.getId(), "IEamThirdMaintenanceOrderService", "third_maintenance_process", null);
            Map<String, Object> variables = new HashMap<>();
            variables.put("dataId", order.getId());
@@ -243,7 +243,7 @@
        //判断是否存在保养人 如果存在则启动流程
        if (StringUtils.isNotBlank(entity.getOperator())) {
            //启动流程
            flowCommonService.initActBusiness("工单号:" + entity.getOrderNum() + ";设备编号: " + equipment.getEquipmentCode() + ";进行设备三保",
            flowCommonService.initActBusiness("工单号:" + entity.getOrderNum() + ";设备编号: " + equipment.getEquipmentCode() + ";安装位置" + equipment.getInstallationPosition(),
                    entity.getId(), "IEamThirdMaintenanceOrderService", "third_maintenance_process", null);
            Map<String, Object> variables = new HashMap<>();
            variables.put("dataId", entity.getId());
@@ -283,9 +283,11 @@
        if (equipment == null) {
            throw new JeecgBootException("设备不存在,添加失败!");
        }
        if (StringUtils.isBlank(equipment.getEquipmentManager())) {
            throw new JeecgBootException("设备未分配设备管理员,无法进入下级审批!");
        List<UserSelector> userSelectors = sysUserService.selectOperatorList(equipment.getEquipmentCode(), equipment.getOrgId(), BusinessCodeConst.PCR0002);
        if (CollectionUtil.isEmpty(userSelectors)) {
            throw new JeecgBootException("设备未分配给维修工,无法进入下级审批!");
        }
        List<String> userApprovalList = userSelectors.stream().map(UserSelector::getUsername).collect(Collectors.toList());
        LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
        if (sysUser == null || !BusinessCodeConst.PCR0001.equals(sysUser.getPost())) {
            throw new JeecgBootException("不是操作工,无法领取此工单!");
@@ -296,7 +298,7 @@
        eamThirdMaintenanceOrderMapper.updateById(entity);
        //启动流程
        flowCommonService.initActBusiness("工单号:" + entity.getOrderNum() + ";设备编号: " + equipment.getEquipmentCode() + ";进行设备三保",
        flowCommonService.initActBusiness("工单号:" + entity.getOrderNum() + ";设备编号: " + equipment.getEquipmentCode() + ";安装位置" + equipment.getInstallationPosition(),
                entity.getId(), "IEamThirdMaintenanceOrderService", "third_maintenance_process", null);
        Map<String, Object> variables = new HashMap<>();
        boolean equipmentPrecisionFlag = precisionCheckDetailService.hasPrecisionCheckDetail(entity.getId());
@@ -311,8 +313,10 @@
        }
        variables.put("proofreading", true);
        //并行任务会签
        //操作工执行保养
        variables.put("maintenance_execution", Collections.singletonList(sysUser.getUsername()));
        variables.put("precision_check", Collections.singletonList(equipment.getEquipmentManager()));
        //维修工精度检验
        variables.put("precision_check", userApprovalList);
        Result result = flowDefinitionService.startProcessInstanceByKey("third_maintenance_process", variables);
        if (result != null) {
            //更新设备保养状态
@@ -370,7 +374,7 @@
                //执行完成
                userSelectors = sysUserService.selectOperatorList(equipment.getEquipmentCode(), equipment.getOrgId(), BusinessCodeConst.PCR0006);
                if (CollectionUtil.isEmpty(userSelectors)) {
                    throw new JeecgBootException("设备未分配给车间班组长,无法进入下级审批!");
                    throw new JeecgBootException("设备未分配给机动办,无法进入下级审批!");
                }
                userApprovalList = userSelectors.stream().map(UserSelector::getUsername).collect(Collectors.toList());
                values.put("dataId", entity.getId());
@@ -418,7 +422,7 @@
            case WAIT_CONFIRM:
                userSelectors = sysUserService.selectOperatorList(equipment.getEquipmentCode(), equipment.getOrgId(), BusinessCodeConst.PCR0003);
                if (CollectionUtil.isEmpty(userSelectors)) {
                    throw new JeecgBootException("设备未分配给车间班组长,无法进入下级审批!");
                    throw new JeecgBootException("设备未分配给维修主任,无法进入下级审批!");
                }
                //班组长确认
                userApprovalList = userSelectors.stream().map(UserSelector::getUsername).collect(Collectors.toList());