fhx
2023-12-08 1c1cdff2c35f93adab954a6f8413f8cfd79c444d
phi_platform_user/src/main/java/com/hx/phip/util/api/TreatUtil.java
@@ -609,18 +609,170 @@
        }
    }
    /**
     * 修改治疗通知单之前将被修改的医生、护士、mic发送企业微信通知
     * 未获取到医生id时 拿到访单中的分诊医生id 若为空则拿预约单中的医生id 以上都为空时直接不发短信
     *
     */
    public static void editTreatNotice1(CommonService commonService, VisitOrder visitOrder,TreatSingle treatSingle
            , String noticeType, String corpMpAppId, String corpAgentId, String mpToken, String corpMpToken
            , String doctorName, String projectName) {
//    /**
//     * 修改治疗通知单之前将被修改的医生、护士、mic发送企业微信通知
//     * 未获取到医生id时 拿到访单中的分诊医生id 若为空则拿预约单中的医生id 以上都为空时直接不发短信
//     *
//     */
//    public static void editTreatNotice1(CommonService commonService, VisitOrder visitOrder,TreatSingle treatSingle
//            , String noticeType, String corpMpAppId, String corpAgentId, String mpToken, String corpMpToken
//            , String doctorName, String projectName) {
//
//        sendTreatNoticeShopMic(commonService, visitOrder, noticeType, corpAgentId, mpToken, corpMpToken, doctorName, projectName);
//
//        //---------------------------------------------------------------------------------------------------------------
//
//        SqlSentence sqlSentence = new SqlSentence();
//        Map<String, Object> map = new HashMap<>();
//        sqlSentence.setM(map);
//
//        //获取治疗通知单关联医生信息
//        map.put("treatSingleId", treatSingle.getId());
//        sqlSentence.setSqlSentence("SELECT * from treat_project_doctor WHERE isDel=0 and treatSingleId=#{m.treatSingleId} GROUP BY commonId ");
//        List<TreatProjectDoctor> treatProjectDoctors = commonService.selectList(TreatProjectDoctorMapper.class, sqlSentence);
//
//        //查看医生、护士、项目信息
//        Map<String, String> dataMap = selectProjectDoctorNurse(visitOrder.getAppointmentId(), visitOrder.getMicId() == null ? null : visitOrder.getMicId(), treatSingle, commonService);
//
//        //获取用户
//        User user = commonService.selectOneByKey(UserMapper.class, visitOrder.getUserId());
//        if (user == null) {
//            throw new PlatTipsException(PlatformCode.ERROR_PARAMETER_TYPE, "治疗通知单:发送企业微信通知:根据导医预约单用户标识找不到该用户");
//        }
//        //获取门店
//        Shop shop = commonService.selectOneByKey(ShopMapper.class, visitOrder.getShopId());
//        if (shop == null) {
//            throw new PlatTipsException(PlatformCode.ERROR_PARAMETER_TYPE, "治疗通知单:发送企业微信通知:根据该导医预约单门店标识找不到该门店信息");
//        }
//        //获取预约
//        Appointment appointment = commonService.selectOneByKeyBlob(AppointmentMapper.class, visitOrder.getAppointmentId());
//        if (appointment == null) {
//            throw new PlatTipsException(PlatformCode.ERROR_PARAMETER_TYPE, "治疗通知单:发送企业微信通知:根据该导医预约单预约标识查询不到预约单");
//        }
//
//        //定义常量
//        String sendDate;
//
//        //判断治疗单医生信息不为空时
//        if (treatProjectDoctors != null && treatProjectDoctors.size() > 0) {
//            //发送企业微信通知医生或者护士
//            for (TreatProjectDoctor treatProjectDoctor : treatProjectDoctors) {
//                if (StringUtils.noNull(treatProjectDoctor.getCommonId())) {
//                    //判断角色
//                    switch (treatProjectDoctor.getType()) {
//                        case RoleType.UNIQUE_STR_DOCTOR:
//                            //查询医生
//                            Employee doctorEmployee = commonService.selectOneByKey(EmployeeMapper.class, treatProjectDoctor.getCommonId());
//                            if (doctorEmployee != null) {
//                                sendDate = MessageContent.treatDoctor(doctorEmployee.getUserId(), corpMpAppId, visitOrder.getVisitNo(), user.getName(), shop.getName(), dataMap.get("projectName"), dataMap.get("num"), dataMap.get("relatedName"), dataMap.get("remarkInfo"));
//                                SendMessageTool.sendMessge(sendDate, corpMpToken);
//
//
//                                //生成日志(最近记录)
//                                doctorEmployee.setRoleStr(RoleType.UNIQUE_STR_DOCTOR);
//                                addLatelyLogToEmployee(VisitOrderLogConstants.LOG_TYPE_NOTICE, visitOrder.getStatus(), visitOrder.getStatus(), "修改治疗通知单发送通知", "修改治疗通知单:已成功发送给医生", doctorEmployee, visitOrder.getId(), visitOrder.getShopId(), visitOrder.getUserId(), commonService);
//                                //导医记录
//                                addVGuideLogToEmployee(VisitOrderLogConstants.LOG_TYPE_NOTICE, visitOrder.getStatus(), visitOrder.getStatus(), visitOrder.getPreStartTime(), new Date(), 0, "修改治疗通知单发送通知医生", doctorEmployee, visitOrder.getId(), visitOrder.getShopId(), visitOrder.getUserId(), commonService);
//
//                            }
//                            break;
//                        case RoleType.UNIQUE_STR_NURSE:
//                            //查询护士
//                            Employee nurseEmployee = commonService.selectOneByKey(EmployeeMapper.class, treatProjectDoctor.getCommonId());
//                            if (nurseEmployee != null) {
//                                sendDate = MessageContent.treatNurse(nurseEmployee.getUserId(), corpMpAppId, visitOrder.getVisitNo(), user.getName(), shop.getName(), dataMap.get("projectName"), dataMap.get("num"), dataMap.get("relatedName"), dataMap.get("remarkInfo"));
//                                SendMessageTool.sendMessge(sendDate, corpMpToken);
//
//                                //生成日志(最近记录)
//                                nurseEmployee.setRoleStr(RoleType.UNIQUE_STR_NURSE);
//                                addLatelyLogToEmployee(VisitOrderLogConstants.LOG_TYPE_NOTICE, visitOrder.getStatus(), visitOrder.getStatus(), "修改治疗通知单发送通知", "修改治疗通知单:已成功发送给护士", nurseEmployee, visitOrder.getId(), visitOrder.getShopId(), visitOrder.getUserId(), commonService);
//                                //导医记录
//                                addVGuideLogToEmployee(VisitOrderLogConstants.LOG_TYPE_NOTICE, visitOrder.getStatus(), visitOrder.getStatus(), visitOrder.getPreStartTime(), new Date(), 0, "修改治疗通知单发送通知护士", nurseEmployee, visitOrder.getId(), visitOrder.getShopId(), visitOrder.getUserId(), commonService);
//                            }
//                            break;
//                    }
//                }
//            }
//        }
//        //判断 治疗单关联医生信息为空时
//        else {
//
//            ///-----发送企业微信通知给医生  优先获取分诊时的医生id,如果分诊医生id为空时则获取预约单中的医生id,若两个都为空,则为null
//            String doctorId = null;
//            if (!StringUtils.isEmpty(visitOrder.geteDoctorId())) {
//                doctorId = visitOrder.geteDoctorId();
//            } else if (!StringUtils.isEmpty(visitOrder.gettDoctorId())) {
//                doctorId = visitOrder.gettDoctorId();
//            } else if (!StringUtils.isEmpty(appointment.getDoctorId())) {
//                doctorId = appointment.getDoctorId();
//            }
//
//            logger.info("修改治疗通知单发送企业微信通知获取医生id:---" + doctorId);
//
//            //判断是否为空
//            if (!StringUtils.isEmpty(doctorId)) {
//                //获取医生信息
//                Employee docEmployee = commonService.selectOneByKey(EmployeeMapper.class, doctorId);
//                if (docEmployee != null) {
//                    sendDate = MessageContent.treatDoctor(docEmployee.getUserId(), corpMpAppId, visitOrder.getVisitNo(), user.getName(), shop.getName(), dataMap.get("projectName"), dataMap.get("num"), docEmployee.getCnName(), dataMap.get("remarkInfo"));
//                    SendMessageTool.sendMessge(sendDate, corpMpToken);
//
//                    //生成日志(最近记录)
//                    docEmployee.setRoleStr(RoleType.UNIQUE_STR_DOCTOR);
//                    addLatelyLogToEmployee(VisitOrderLogConstants.LOG_TYPE_NOTICE, visitOrder.getStatus(), visitOrder.getStatus(), "修改治疗通知单发送通知", "修改治疗通知单:已成功发送给医生", docEmployee, visitOrder.getId(), visitOrder.getShopId(), visitOrder.getUserId(), commonService);
//                    //导医记录
//                    addVGuideLogToEmployee(VisitOrderLogConstants.LOG_TYPE_NOTICE, visitOrder.getStatus(), visitOrder.getStatus(), visitOrder.getPreStartTime(), new Date(), 0, "修改治疗通知单,发送企业通知给医生", docEmployee, visitOrder.getId(), visitOrder.getShopId(), visitOrder.getUserId(), commonService);
//                }
//            }
//
//            ///-----发送企业微信通知给护士  优先获取分诊时的护士id,如果分诊护士id为空时则获取预约单中的护士id,若两个都为空,则为null
//            String nurseId = null;
//            if (!StringUtils.isEmpty(visitOrder.geteNurseId())) {
//                nurseId = visitOrder.geteNurseId();
//            } else if (!StringUtils.isEmpty(visitOrder.gettNurseId())) {
//                nurseId = visitOrder.gettNurseId();
//            } else if (!StringUtils.isEmpty(appointment.getNurseId())) {
//                nurseId = appointment.getNurseId();
//            }
//            logger.info("修改治疗通知单发送企业微信通知获取护士id:---" + nurseId);
//
//            if (!StringUtils.isEmpty(nurseId)) {
//                Employee nurEmployee = commonService.selectOneByKey(EmployeeMapper.class, nurseId);
//                if (nurEmployee != null) {
//                    sendDate = MessageContent.treatNurse(nurEmployee.getUserId(), corpMpAppId, visitOrder.getVisitNo(), user.getName(), shop.getName(), dataMap.get("projectName"), dataMap.get("num"), nurEmployee.getCnName(), dataMap.get("remarkInfo"));
//                    SendMessageTool.sendMessge(sendDate, corpMpToken);
//
//                    //生成日志(最近记录)
//                    nurEmployee.setRoleStr(RoleType.UNIQUE_STR_NURSE);
//                    addLatelyLogToEmployee(VisitOrderLogConstants.LOG_TYPE_NOTICE, visitOrder.getStatus(), visitOrder.getStatus(), "发送企业通知", "修改治疗通知单:发送企业通知给护士,已成功发送给护士", nurEmployee, visitOrder.getId(), visitOrder.getShopId(), visitOrder.getUserId(), commonService);
//                    //导医记录
//                    addVGuideLogToEmployee(VisitOrderLogConstants.LOG_TYPE_NOTICE, visitOrder.getStatus(), visitOrder.getStatus(), visitOrder.getPreStartTime(), new Date(), 0, "修改治疗通知单:发送企业通知给护士", nurEmployee, visitOrder.getId(), visitOrder.getShopId(), visitOrder.getUserId(), commonService);
//
//                }
//            }
//        }
//
//
//        // 发送企业微信通知给顾问  优先获取分诊时的顾问id,如果分诊顾问id为空时则获取预约单中的顾问id,若两个都为空,则为null
//        if (!StringUtils.isEmpty(visitOrder.getAdviserId())) {
//            Employee adviseEmployee = commonService.selectOneByKey(EmployeeMapper.class, visitOrder.getAdviserId());
//            if (adviseEmployee != null) {
//                sendDate = treatAdviser(adviseEmployee.getUserId(), corpMpAppId, visitOrder.getVisitNo(), user.getName(), shop.getName(), dataMap.get("projectName"), dataMap.get("num"), adviseEmployee.getCnName(), dataMap.get("remarkInfo"));
//                SendMessageTool.sendMessge(sendDate, corpMpToken);
//
//                //生成日志(最近记录)
//                adviseEmployee.setRoleStr(RoleType.UNIQUE_STR_ADVISER_LEADER);
//                addLatelyLogToEmployee(VisitOrderLogConstants.LOG_TYPE_NOTICE, visitOrder.getStatus(), visitOrder.getStatus(), "发送企业通知", "修改治疗通知单:发送企业通知给顾问,已成功发送给顾问", adviseEmployee, visitOrder.getId(), visitOrder.getShopId(), visitOrder.getUserId(), commonService);
//                //导医记录
//                addVGuideLogToEmployee(VisitOrderLogConstants.LOG_TYPE_NOTICE, visitOrder.getStatus(), visitOrder.getStatus(), visitOrder.getPreStartTime(), new Date(), 0, "修改治疗通知单:发送企业通知给顾问", adviseEmployee, visitOrder.getId(), visitOrder.getShopId(), visitOrder.getUserId(), commonService);
//            }
//        }
//
//    }
        sendTreatNoticeShopMic(commonService, visitOrder, noticeType, corpAgentId, mpToken, corpMpToken, doctorName, projectName);
    public static void editTreatNotice2(CommonService commonService, VisitOrder visitOrder,TreatSingle treatSingle
            , String corpMpAppId, String corpMpToken) {
        //---------------------------------------------------------------------------------------------------------------
        SqlSentence sqlSentence = new SqlSentence();
        Map<String, Object> map = new HashMap<>();
@@ -652,119 +804,57 @@
        //定义常量
        String sendDate;
        Employee employee;
        //判断治疗单医生信息不为空时
        if (treatProjectDoctors != null && treatProjectDoctors.size() > 0) {
            //发送企业微信通知医生或者护士
            //发送企业微信通知医生或
            for (TreatProjectDoctor treatProjectDoctor : treatProjectDoctors) {
                if (StringUtils.noNull(treatProjectDoctor.getCommonId())) {
                    //判断角色
                    switch (treatProjectDoctor.getType()) {
                        case RoleType.UNIQUE_STR_DOCTOR:
                            //查询医生
                            Employee doctorEmployee = commonService.selectOneByKey(EmployeeMapper.class, treatProjectDoctor.getCommonId());
                            if (doctorEmployee != null) {
                                sendDate = MessageContent.treatDoctor(doctorEmployee.getUserId(), corpMpAppId, visitOrder.getVisitNo(), user.getName(), shop.getName(), dataMap.get("projectName"), dataMap.get("num"), dataMap.get("relatedName"), dataMap.get("remarkInfo"));
                                SendMessageTool.sendMessge(sendDate, corpMpToken);
                if (StringUtils.noNull(treatProjectDoctor.getCommonId()) && RoleType.UNIQUE_STR_DOCTOR.equals(treatProjectDoctor.getType())) {
                    //查询医生
                    employee = commonService.selectOneByKey(EmployeeMapper.class, treatProjectDoctor.getCommonId());
                    if (employee != null) {
                        sendDate = MessageContent.treatDoctor(employee.getUserId(), corpMpAppId, visitOrder.getVisitNo(), user.getName(), shop.getName(), dataMap.get("projectName"), dataMap.get("num"), dataMap.get("relatedName"), dataMap.get("remarkInfo"));
                        SendMessageTool.sendMessge(sendDate, corpMpToken);
                        //生成日志(最近记录)
                        employee.setRoleStr(RoleType.UNIQUE_STR_DOCTOR);
                        addLatelyLogToEmployee(VisitOrderLogConstants.LOG_TYPE_NOTICE, visitOrder.getStatus(), visitOrder.getStatus(), "修改治疗通知单发送通知", "修改治疗通知单:已成功发送给医生", employee, visitOrder.getId(), visitOrder.getShopId(), visitOrder.getUserId(), commonService);
                        //导医记录
                        addVGuideLogToEmployee(VisitOrderLogConstants.LOG_TYPE_NOTICE, visitOrder.getStatus(), visitOrder.getStatus(), visitOrder.getPreStartTime(), new Date(), 0, "修改治疗通知单发送通知医生", employee, visitOrder.getId(), visitOrder.getShopId(), visitOrder.getUserId(), commonService);
                                //生成日志(最近记录)
                                doctorEmployee.setRoleStr(RoleType.UNIQUE_STR_DOCTOR);
                                addLatelyLogToEmployee(VisitOrderLogConstants.LOG_TYPE_NOTICE, visitOrder.getStatus(), visitOrder.getStatus(), "修改治疗通知单发送通知", "修改治疗通知单:已成功发送给医生", doctorEmployee, visitOrder.getId(), visitOrder.getShopId(), visitOrder.getUserId(), commonService);
                                //导医记录
                                addVGuideLogToEmployee(VisitOrderLogConstants.LOG_TYPE_NOTICE, visitOrder.getStatus(), visitOrder.getStatus(), visitOrder.getPreStartTime(), new Date(), 0, "修改治疗通知单发送通知医生", doctorEmployee, visitOrder.getId(), visitOrder.getShopId(), visitOrder.getUserId(), commonService);
                            }
                            break;
                        case RoleType.UNIQUE_STR_NURSE:
                            //查询护士
                            Employee nurseEmployee = commonService.selectOneByKey(EmployeeMapper.class, treatProjectDoctor.getCommonId());
                            if (nurseEmployee != null) {
                                sendDate = MessageContent.treatNurse(nurseEmployee.getUserId(), corpMpAppId, visitOrder.getVisitNo(), user.getName(), shop.getName(), dataMap.get("projectName"), dataMap.get("num"), dataMap.get("relatedName"), dataMap.get("remarkInfo"));
                                SendMessageTool.sendMessge(sendDate, corpMpToken);
                                //生成日志(最近记录)
                                nurseEmployee.setRoleStr(RoleType.UNIQUE_STR_NURSE);
                                addLatelyLogToEmployee(VisitOrderLogConstants.LOG_TYPE_NOTICE, visitOrder.getStatus(), visitOrder.getStatus(), "修改治疗通知单发送通知", "修改治疗通知单:已成功发送给护士", nurseEmployee, visitOrder.getId(), visitOrder.getShopId(), visitOrder.getUserId(), commonService);
                                //导医记录
                                addVGuideLogToEmployee(VisitOrderLogConstants.LOG_TYPE_NOTICE, visitOrder.getStatus(), visitOrder.getStatus(), visitOrder.getPreStartTime(), new Date(), 0, "修改治疗通知单发送通知护士", nurseEmployee, visitOrder.getId(), visitOrder.getShopId(), visitOrder.getUserId(), commonService);
                            }
                            break;
                    }
                }
            }
        }
        //判断 治疗单关联医生信息为空时
        else {
            ///-----发送企业微信通知给医生  优先获取分诊时的医生id,如果分诊医生id为空时则获取预约单中的医生id,若两个都为空,则为null
            String doctorId = null;
            if (!StringUtils.isEmpty(visitOrder.geteDoctorId())) {
                doctorId = visitOrder.geteDoctorId();
            } else if (!StringUtils.isEmpty(visitOrder.gettDoctorId())) {
                doctorId = visitOrder.gettDoctorId();
            } else if (!StringUtils.isEmpty(appointment.getDoctorId())) {
                doctorId = appointment.getDoctorId();
            }
            logger.info("修改治疗通知单发送企业微信通知获取医生id:---" + doctorId);
            //判断是否为空
            if (!StringUtils.isEmpty(doctorId)) {
                //获取医生信息
                Employee docEmployee = commonService.selectOneByKey(EmployeeMapper.class, doctorId);
                if (docEmployee != null) {
                    sendDate = MessageContent.treatDoctor(docEmployee.getUserId(), corpMpAppId, visitOrder.getVisitNo(), user.getName(), shop.getName(), dataMap.get("projectName"), dataMap.get("num"), docEmployee.getCnName(), dataMap.get("remarkInfo"));
                    SendMessageTool.sendMessge(sendDate, corpMpToken);
                    //生成日志(最近记录)
                    docEmployee.setRoleStr(RoleType.UNIQUE_STR_DOCTOR);
                    addLatelyLogToEmployee(VisitOrderLogConstants.LOG_TYPE_NOTICE, visitOrder.getStatus(), visitOrder.getStatus(), "修改治疗通知单发送通知", "修改治疗通知单:已成功发送给医生", docEmployee, visitOrder.getId(), visitOrder.getShopId(), visitOrder.getUserId(), commonService);
                    //导医记录
                    addVGuideLogToEmployee(VisitOrderLogConstants.LOG_TYPE_NOTICE, visitOrder.getStatus(), visitOrder.getStatus(), visitOrder.getPreStartTime(), new Date(), 0, "修改治疗通知单,发送企业通知给医生", docEmployee, visitOrder.getId(), visitOrder.getShopId(), visitOrder.getUserId(), commonService);
                }
            }
            ///-----发送企业微信通知给护士  优先获取分诊时的护士id,如果分诊护士id为空时则获取预约单中的护士id,若两个都为空,则为null
            String nurseId = null;
            if (!StringUtils.isEmpty(visitOrder.geteNurseId())) {
                nurseId = visitOrder.geteNurseId();
            } else if (!StringUtils.isEmpty(visitOrder.gettNurseId())) {
                nurseId = visitOrder.gettNurseId();
            } else if (!StringUtils.isEmpty(appointment.getNurseId())) {
                nurseId = appointment.getNurseId();
            }
            logger.info("修改治疗通知单发送企业微信通知获取护士id:---" + nurseId);
            if (!StringUtils.isEmpty(nurseId)) {
                Employee nurEmployee = commonService.selectOneByKey(EmployeeMapper.class, nurseId);
                if (nurEmployee != null) {
                    sendDate = MessageContent.treatNurse(nurEmployee.getUserId(), corpMpAppId, visitOrder.getVisitNo(), user.getName(), shop.getName(), dataMap.get("projectName"), dataMap.get("num"), nurEmployee.getCnName(), dataMap.get("remarkInfo"));
                    SendMessageTool.sendMessge(sendDate, corpMpToken);
                    //生成日志(最近记录)
                    nurEmployee.setRoleStr(RoleType.UNIQUE_STR_NURSE);
                    addLatelyLogToEmployee(VisitOrderLogConstants.LOG_TYPE_NOTICE, visitOrder.getStatus(), visitOrder.getStatus(), "发送企业通知", "修改治疗通知单:发送企业通知给护士,已成功发送给护士", nurEmployee, visitOrder.getId(), visitOrder.getShopId(), visitOrder.getUserId(), commonService);
                    //导医记录
                    addVGuideLogToEmployee(VisitOrderLogConstants.LOG_TYPE_NOTICE, visitOrder.getStatus(), visitOrder.getStatus(), visitOrder.getPreStartTime(), new Date(), 0, "修改治疗通知单:发送企业通知给护士", nurEmployee, visitOrder.getId(), visitOrder.getShopId(), visitOrder.getUserId(), commonService);
                }
            }
        }
        // 发送企业微信通知给顾问  优先获取分诊时的顾问id,如果分诊顾问id为空时则获取预约单中的顾问id,若两个都为空,则为null
        if (!StringUtils.isEmpty(visitOrder.getAdviserId())) {
            Employee adviseEmployee = commonService.selectOneByKey(EmployeeMapper.class, visitOrder.getAdviserId());
            if (adviseEmployee != null) {
                sendDate = treatAdviser(adviseEmployee.getUserId(), corpMpAppId, visitOrder.getVisitNo(), user.getName(), shop.getName(), dataMap.get("projectName"), dataMap.get("num"), adviseEmployee.getCnName(), dataMap.get("remarkInfo"));
        // 发送企业微信通知给分配治疗护士
        if (!StringUtils.isEmpty(treatSingle.getaNurseId())) {
            employee = commonService.selectOneByKey(EmployeeMapper.class, treatSingle.getaNurseId());
            if (employee != null) {
                sendDate = MessageContent.treatNurse(employee.getUserId(), corpMpAppId, visitOrder.getVisitNo(), user.getName(), shop.getName(), dataMap.get("projectName"), dataMap.get("num"), dataMap.get("relatedName"), dataMap.get("remarkInfo"));
                SendMessageTool.sendMessge(sendDate, corpMpToken);
                //生成日志(最近记录)
                adviseEmployee.setRoleStr(RoleType.UNIQUE_STR_ADVISER_LEADER);
                addLatelyLogToEmployee(VisitOrderLogConstants.LOG_TYPE_NOTICE, visitOrder.getStatus(), visitOrder.getStatus(), "发送企业通知", "修改治疗通知单:发送企业通知给顾问,已成功发送给顾问", adviseEmployee, visitOrder.getId(), visitOrder.getShopId(), visitOrder.getUserId(), commonService);
                employee.setRoleStr(RoleType.UNIQUE_STR_NURSE);
                addLatelyLogToEmployee(VisitOrderLogConstants.LOG_TYPE_NOTICE, visitOrder.getStatus(), visitOrder.getStatus(), "修改治疗通知单发送通知", "修改治疗通知单:已成功发送给护士", employee, visitOrder.getId(), visitOrder.getShopId(), visitOrder.getUserId(), commonService);
                //导医记录
                addVGuideLogToEmployee(VisitOrderLogConstants.LOG_TYPE_NOTICE, visitOrder.getStatus(), visitOrder.getStatus(), visitOrder.getPreStartTime(), new Date(), 0, "修改治疗通知单:发送企业通知给顾问", adviseEmployee, visitOrder.getId(), visitOrder.getShopId(), visitOrder.getUserId(), commonService);
                addVGuideLogToEmployee(VisitOrderLogConstants.LOG_TYPE_NOTICE, visitOrder.getStatus(), visitOrder.getStatus(), visitOrder.getPreStartTime(), new Date(), 0, "修改治疗通知单发送通知护士", employee, visitOrder.getId(), visitOrder.getShopId(), visitOrder.getUserId(), commonService);
            }
        }
        // 发送企业微信通知给顾问  优先获取分诊时的顾问id,如果分诊顾问id为空时则获取预约单中的顾问id,若两个都为空,则为null
        if (!StringUtils.isEmpty(visitOrder.getAdviserId())) {
            employee = commonService.selectOneByKey(EmployeeMapper.class, visitOrder.getAdviserId());
            if (employee != null) {
                sendDate = treatAdviser(employee.getUserId(), corpMpAppId, visitOrder.getVisitNo(), user.getName(), shop.getName(), dataMap.get("projectName"), dataMap.get("num"), employee.getCnName(), dataMap.get("remarkInfo"));
                SendMessageTool.sendMessge(sendDate, corpMpToken);
                //生成日志(最近记录)
                employee.setRoleStr(RoleType.UNIQUE_STR_ADVISER_LEADER);
                addLatelyLogToEmployee(VisitOrderLogConstants.LOG_TYPE_NOTICE, visitOrder.getStatus(), visitOrder.getStatus(), "发送企业通知", "修改治疗通知单:发送企业通知给顾问,已成功发送给顾问", employee, visitOrder.getId(), visitOrder.getShopId(), visitOrder.getUserId(), commonService);
                //导医记录
                addVGuideLogToEmployee(VisitOrderLogConstants.LOG_TYPE_NOTICE, visitOrder.getStatus(), visitOrder.getStatus(), visitOrder.getPreStartTime(), new Date(), 0, "修改治疗通知单:发送企业通知给顾问", employee, visitOrder.getId(), visitOrder.getShopId(), visitOrder.getUserId(), commonService);
            }
        }