|  |  | 
 |  |  |         //发送会议预约成功通知 | 
 |  |  |         if(Constants.equalsInteger(bookings.getJoinNotice(),Constants.ZERO)){ | 
 |  |  |             this.sendNotice(bookings, MeetConstants.TWO); | 
 |  |  |             SystemUser systemUser = systemUserMapper.selectById(user.getId()); | 
 |  |  |             this.sendWxNotice(bookings,Objects.isNull(systemUser)||StringUtils.isBlank(systemUser.getOpenid())?null:systemUser.getOpenid(),Constants.ZERO); | 
 |  |  |         } | 
 |  |  |         SystemUser systemUser = systemUserMapper.selectById(user.getId()); | 
 |  |  |         this.sendWxNotice(bookings,Objects.isNull(systemUser)||StringUtils.isBlank(systemUser.getOpenid())?null:systemUser.getOpenid(),Constants.ZERO); | 
 |  |  |  | 
 |  |  |         return bookings.getId(); | 
 |  |  |     } | 
 |  |  | 
 |  |  |             /*  ||org.apache.commons.collections4.CollectionUtils.isEmpty(bookings.getSysList())*/ | 
 |  |  |         ) { | 
 |  |  |             throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), ResponseStatus.BAD_REQUEST.getMessage()); | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         if(Objects.nonNull(bookings.getId())){ | 
 |  |  |             return; | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | 
 |  |  | 
 |  |  |         if(dbBookings.getStatus().equals(MeetConstants.ONE)){ | 
 |  |  |             throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "本次操作失败,预约状态已流转"); | 
 |  |  |         } | 
 |  |  |         Rooms rooms = roomsMapper.selectById(dbBookings.getRoomId()); | 
 |  |  |         if(rooms==null ){ | 
 |  |  |             throw  new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"对不起,该会议室暂时无法预约"); | 
 |  |  |         } | 
 |  |  |         bookings.setRoomName(rooms.getName()); | 
 |  |  |         LoginUserInfo user = bookings.getLoginUserInfo(); | 
 |  |  |         isCreateParamValid(bookings, user); | 
 |  |  |         bookings.setEditDate(new Date()); | 
 |  |  |         bookings.setEditor(user.getId()); | 
 |  |  |         bookingsMapper.updateById(bookings); | 
 |  |  |         bookings.setManagerInfo(user.getRealname()); | 
 |  |  |         bookings.setCreator(dbBookings.getCreator()); | 
 |  |  |         //更新会议室预定时间段 | 
 |  |  |         updateBookingTimes(bookings, user); | 
 |  |  |         //添加管理人员 | 
 |  |  | 
 |  |  |         //发送会议通知 | 
 |  |  |         if(Constants.equalsInteger(bookings.getJoinNotice(),Constants.ZERO)){ | 
 |  |  |             this.sendNotice(bookings, MeetConstants.TWO); | 
 |  |  |             SystemUser systemUser = systemUserMapper.selectById(bookings.getCreator()); | 
 |  |  |             this.sendWxNotice(bookings,Objects.isNull(systemUser)||StringUtils.isBlank(systemUser.getOpenid())?null:systemUser.getOpenid(),Constants.ZERO); | 
 |  |  |         } | 
 |  |  |         SystemUser systemUser = systemUserMapper.selectById(bookings.getUserId()); | 
 |  |  |         this.sendWxNotice(bookings,Objects.isNull(systemUser)||StringUtils.isBlank(systemUser.getOpenid())?null:systemUser.getOpenid(),Constants.ZERO); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     @Override | 
 |  |  | 
 |  |  |         //取消会议 发送取消通知 | 
 |  |  |         if(Constants.equalsInteger(bookings.getJoinNotice(),Constants.ZERO)){ | 
 |  |  |             this.sendNotice(bookings, 3); | 
 |  |  |             this.sendWxNotice(bookings,Objects.isNull(systemUser)||StringUtils.isBlank(systemUser.getOpenid())?null:systemUser.getOpenid(),Constants.ONE); | 
 |  |  |         } | 
 |  |  |         this.sendWxNotice(bookings,Objects.isNull(systemUser)||StringUtils.isBlank(systemUser.getOpenid())?null:systemUser.getOpenid(),Constants.ONE); | 
 |  |  |  | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     @Override | 
 |  |  | 
 |  |  |         } | 
 |  |  |         bookingsMapper.updateById(bookings); | 
 |  |  |         //取消会议 发送取消通知 | 
 |  |  | //        if(Constants.equalsInteger(bookings.getJoinNotice(),Constants.ZERO)){ | 
 |  |  |         if(Constants.equalsInteger(bookings.getJoinNotice(),Constants.ZERO)){ | 
 |  |  | //            this.sendNotice(bookings, 3); | 
 |  |  | //        } | 
 |  |  |         SystemUser systemUser = systemUserMapper.selectById(bookings.getCreator()); | 
 |  |  |         bookings.setManagerInfo(systemUser.getRealname()); | 
 |  |  |         this.sendWxNotice(bookings,Objects.isNull(systemUser)||StringUtils.isBlank(systemUser.getOpenid())?null:systemUser.getOpenid(),Constants.ONE); | 
 |  |  |             SystemUser systemUser = systemUserMapper.selectById(bookings.getCreator()); | 
 |  |  |             bookings.setManagerInfo(systemUser.getRealname()); | 
 |  |  |             this.sendWxNotice(bookings,Objects.isNull(systemUser)||StringUtils.isBlank(systemUser.getOpenid())?null:systemUser.getOpenid(),Constants.ONE); | 
 |  |  |  | 
 |  |  |         } | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |  | 
 |  |  | 
 |  |  |                 } | 
 |  |  |             } | 
 |  |  |         } | 
 |  |  |         //给创建人发送短信信息 | 
 |  |  |         SystemUser systemUser = systemUserMapper.selectById(bookings.getCreator()); | 
 |  |  |         if(Objects.nonNull(systemUser)){ | 
 |  |  |             if(userRelList.stream().filter(i->Constants.equalsInteger(i.getUserId(),systemUser.getId())).collect(Collectors.toList()).size()==Constants.ZERO){ | 
 |  |  |                 if (smsConfig!=null && Constants.equalsInteger(smsConfig.getStatus(),Constants.ZERO)){ | 
 |  |  |                     SmsEmail smsEmail = new SmsEmail(); | 
 |  |  |                     //{参会人员姓名},您好!您有一个新的会议,会议主题:{会议主题},会议地点:{会议室名称},会议时间:{会议时间段},请按时参加 | 
 |  |  |                     String timeInfo =DateUtil.getFomartDate( bookings.getStartTime(),"MM/dd HH:mm")+"-" | 
 |  |  |                             +DateUtil.getFomartDate( bookings.getEndTime(),"HH:mm"); | 
 |  |  |                     smsEmail.setPhone(systemUser.getMobile()); | 
 |  |  |                     smsEmail.setRemark("等待发送"); | 
 |  |  |                     smsEmail.setStatus(Constants.TWO);// | 
 |  |  |                     smsEmail.setIsdeleted(Constants.ZERO); | 
 |  |  |                     smsEmail.setType(Constants.ZERO); | 
 |  |  |                     smsEmail.setObjId(bookings.getId()); | 
 |  |  |                     smsEmail.setCreateDate(new Date()); | 
 |  |  |                     smsEmail.setTitle("会议室申请参会通知"); | 
 |  |  |                     smsEmail.setContent(StringUtils.defaultString(smsConfig.getContent(),"") | 
 |  |  |                             .replace("{参会人员姓名}",StringUtils.defaultString(systemUser.getRealname(),"")) | 
 |  |  |                             .replace("{会议主题}",StringUtils.defaultString(bookings.getName(),"")) | 
 |  |  |                             .replace("{会议室名称}",StringUtils.defaultString(bookings.getRoomName(),"")) | 
 |  |  |                             .replace("{会议时间段}",StringUtils.defaultString(timeInfo,""))); | 
 |  |  |                     smsEmailList.add(smsEmail); | 
 |  |  |                 } | 
 |  |  |             } | 
 |  |  |         } | 
 |  |  |         //给参会人员插入 | 
 |  |  |         Notices notices = new Notices(noticeObjectType,bookings.getId(),noticeObjectType.getInfo(),bookings.getCreator(), Constants.ZERO); | 
 |  |  |         noticeList.add(notices); | 
 |  |  | 
 |  |  |                 if(Constants.equalsInteger(sendType,Constants.ZERO)){ | 
 |  |  |                     wxPlatNotice.sendMeetingBookTemplateNotice(systemDictDataBiz,bookings,"CuoDoxOl6SFwi4NhNgOQgKSJVjDD4VCIaPYlnbv_zdY", | 
 |  |  |                             systemDictDataBiz.queryByCode(Constants.WX_PLATFORM, Constants.WX_PLATFORM_ACCESS_TOKEN).getCode(),openIds); | 
 |  |  |                 }else{ | 
 |  |  |                 }else if(Constants.equalsInteger(sendType,Constants.ONE)){ | 
 |  |  |                     wxPlatNotice.sendMeetingBookCancelTemplateNotice(systemDictDataBiz,bookings,"CiB6vCT2InovAoQfudY-lvzLSV0-3lfz3a5GsSFCzd8", | 
 |  |  |                             systemDictDataBiz.queryByCode(Constants.WX_PLATFORM, Constants.WX_PLATFORM_ACCESS_TOKEN).getCode(),openIds); | 
 |  |  |                 } |