cuilei
20 小时以前 699295ce3e0e1116d1fc20f0fae89b66613bbacf
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamWeekMaintenanceOrderServiceImpl.java
@@ -153,7 +153,11 @@
                //更新设备保养状态
                eamEquipmentExtendService.updateEquipmentMaintenanceStatus(order.getEquipmentId(), EquipmentMaintenanceStatus.UNDER_MAINTENANCE.name());
                //推送企业微信消息
                sendQywxTemplateCardMessage(order, null);
                try {
                    sendQywxTemplateCardMessage(order, null);
                } catch (Exception e) {
                    log.error("推送企业微信消息失败:" + e.getMessage(), e);
                }
                return result.isSuccess();
            }
        }
@@ -345,7 +349,11 @@
            //更新设备保养状态
            eamEquipmentExtendService.updateEquipmentMaintenanceStatus(entity.getEquipmentId(), EquipmentMaintenanceStatus.UNDER_MAINTENANCE.name());
            //推送企业微信消息
            sendQywxTemplateCardMessage(entity, null);
            try {
                sendQywxTemplateCardMessage(entity, null);
            } catch (Exception e) {
                log.error("推送企业微信消息失败:" + e.getMessage(), e);
            }
            return result.isSuccess();
        }
        return true;
@@ -432,8 +440,12 @@
                //新增的工单(指定了保养人)、新领取的工单
                TemplateCardEntity.HorizontalContent content = new TemplateCardEntity.HorizontalContent();
                content.setKeyname("发起人");
                SysUser sysUser = sysUserService.getUserByName(order.getCreateBy());
                content.setValue(sysUser.getRealname());
                if (order.getCreateBy() == null) {
                    content.setValue("定时任务生成");
                } else {
                    SysUser  sysUser = sysUserService.getUserByName(order.getCreateBy());
                    content.setValue(sysUser.getRealname());
                }
                horizontalContentList.add(content);
            } else {
                //被驳回的工单
@@ -455,42 +467,23 @@
            SysUser sysUser = sysUserService.getUserByName(order.getOperator());
            content.setValue(sysUser.getRealname());
            horizontalContentList.add(content);
            //TemplateCardEntity.HorizontalContent content = new TemplateCardEntity.HorizontalContent();
            //List<String> nextAssignee = (List<String>) request.getValues().get("NextAssignee");
            //String realNameStr = sysUserService.getRealNameStrByUserNameList(nextAssignee);
            //content.setKeyname("确认人");
            //content.setValue(realNameStr);
            //horizontalContentList.add(content);
        }
        if (WeekMaintenanceStatusEnum.WAIT_INITIAL_ACCEPTANCE.name().equals(maintenanceStatus)) {
            TemplateCardEntity.HorizontalContent content3 = new TemplateCardEntity.HorizontalContent();
            //TemplateCardEntity.HorizontalContent content4 = new TemplateCardEntity.HorizontalContent();
            String confirmAssignee = request.getAssignee();
            SysUser confirmUser = sysUserService.getUserByName(confirmAssignee);
            content3.setKeyname("确认人");
            content3.setValue(confirmUser.getRealname());
            horizontalContentList.add(content3);
            //List<String> nextAssignee = (List<String>) request.getValues().get("NextAssignee");
            //String realNameStr = sysUserService.getRealNameStrByUserNameList(nextAssignee);
            //content4.setKeyname("初验人");
            //content4.setValue(realNameStr);
            //horizontalContentList.add(content4);
        }
        if (WeekMaintenanceStatusEnum.WAIT_FINAL_ACCEPTANCE.name().equals(maintenanceStatus)) {
            TemplateCardEntity.HorizontalContent content3 = new TemplateCardEntity.HorizontalContent();
            //TemplateCardEntity.HorizontalContent content4 = new TemplateCardEntity.HorizontalContent();
            String initialAssignee = request.getAssignee();
            SysUser initialUser = sysUserService.getUserByName(initialAssignee);
            content3.setKeyname("初验人");
            content3.setValue(initialUser.getRealname());
            horizontalContentList.add(content3);
            //List<String> nextAssignee = (List<String>) request.getValues().get("NextAssignee");
            //String realNameStr = sysUserService.getRealNameStrByUserNameList(nextAssignee);
            //content4.setKeyname("终验人");
            //content4.setValue(realNameStr);
            //horizontalContentList.add(content4);
        }
        templateCardEntity.setHorizontal_content_list(horizontalContentList);
        TemplateCardEntity.CardAction cardAction = new TemplateCardEntity.CardAction();
@@ -581,7 +574,7 @@
                }
                //班组长确认
                userApprovalList = new ArrayList<>();
                userApprovalList.add(equipment.getEquipmentManager().substring(2));//设备台账表维护的设备管理员工号是带 WK前缀的
                userApprovalList.add(equipment.getEquipmentManager());
                values.put("dataId", entity.getId());
                values.put("organization", request.getConfirmComment());
                values.put("comment", request.getConfirmComment());
@@ -673,7 +666,11 @@
        eamWeekMaintenanceOrderMapper.updateById(entity);
        //推送企业微信消息,工单完结不发送
        if (!WeekMaintenanceStatusEnum.COMPLETE.name().equals(entity.getMaintenanceStatus())) {
            sendQywxTemplateCardMessage(entity, request);
            try {
                sendQywxTemplateCardMessage(entity, request);
            } catch (Exception e) {
                log.error("推送企业微信消息失败:" + e.getMessage(), e);
            }
        }
        return entity;
    }