|  |  |  | 
|---|
|  |  |  | bookings.setIsdeleted(MeetConstants.ZERO); | 
|---|
|  |  |  | bookings.setStatus(MeetConstants.ZERO); | 
|---|
|  |  |  | bookingsMapper.insert(bookings); | 
|---|
|  |  |  | bookings.setManagerInfo(user.getRealname()); | 
|---|
|  |  |  | //更新会议室预定时间段 | 
|---|
|  |  |  | updateBookingTimes(bookings, user); | 
|---|
|  |  |  | //添加管理人员 | 
|---|
|  |  |  | 
|---|
|  |  |  | //发送会议预约成功通知 | 
|---|
|  |  |  | 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(bookings.getUserId()); | 
|---|
|  |  |  | this.sendWxNotice(bookings,Objects.isNull(systemUser)||StringUtils.isBlank(systemUser.getOpenid())?null:systemUser.getOpenid(),Constants.ZERO); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | return bookings.getId(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | //发送会议通知 | 
|---|
|  |  |  | if(Constants.equalsInteger(bookings.getJoinNotice(),Constants.ZERO)){ | 
|---|
|  |  |  | this.sendNotice(bookings, MeetConstants.TWO); | 
|---|
|  |  |  | SystemUser systemUser = systemUserMapper.selectById(bookings.getUserId()); | 
|---|
|  |  |  | 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 | 
|---|
|  |  |  | 
|---|
|  |  |  | bookings.setEditDate(new Date()); | 
|---|
|  |  |  | bookings.setEditor(user.getId()); | 
|---|
|  |  |  | bookingsMapper.updateById(bookings); | 
|---|
|  |  |  | SystemUser systemUser = systemUserMapper.selectById(bookings.getCreator()); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | bookings.setManagerInfo(systemUser.getRealname()); | 
|---|
|  |  |  | //取消会议 发送取消通知 | 
|---|
|  |  |  | 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); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | SystemUser systemUser = systemUserMapper.selectById(bookings.getUserId()); | 
|---|
|  |  |  | this.sendWxNotice(bookings,Objects.isNull(systemUser)||StringUtils.isBlank(systemUser.getOpenid())?null:systemUser.getOpenid(),Constants.ONE); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | 
|---|
|  |  |  | bookings.setStatus(MeetConstants.ONE); | 
|---|
|  |  |  | bookings.setEditDate(new Date()); | 
|---|
|  |  |  | bookings.setEditor(businessOverDTO.getUserId()); | 
|---|
|  |  |  | Rooms rooms = roomsMapper.selectById(bookings.getRoomId()); | 
|---|
|  |  |  | if(Objects.nonNull(rooms)){ | 
|---|
|  |  |  | bookings.setRoomName(rooms.getName()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | bookingsMapper.updateById(bookings); | 
|---|
|  |  |  | //取消会议 发送取消通知 | 
|---|
|  |  |  | if(Constants.equalsInteger(bookings.getJoinNotice(),Constants.ZERO)){ | 
|---|
|  |  |  | this.sendNotice(bookings, 3); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | SystemUser systemUser = systemUserMapper.selectById(bookings.getUserId()); | 
|---|
|  |  |  | //        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); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | public void dealMeetingStatus(List<MeetingListResponse> meetingResponseList){ | 
|---|
|  |  |  | if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(meetingResponseList)){ | 
|---|
|  |  |  | String path = systemDictDataBiz.queryByCode(MeetConstants.FTP, MeetConstants.FTP_RESOURCE_PATH).getCode() + systemDictDataBiz.queryByCode(MeetConstants.FTP, MeetConstants.PROJECTS).getCode(); | 
|---|
|  |  |  | String configMinute = systemDictDataBiz.queryByCode(MeetConstants.SYSTEM, MeetConstants.SOON_START).getCode(); | 
|---|
|  |  |  | String configMinute = systemDictDataBiz.queryByCode(MeetConstants.SYSTEM, MeetConstants.EARLY_START).getCode(); | 
|---|
|  |  |  | Integer minute = StringUtils.isNotBlank(configMinute) ? Integer.valueOf(configMinute) : 120; | 
|---|
|  |  |  | for (MeetingListResponse m:meetingResponseList) { | 
|---|
|  |  |  | if(Constants.equalsInteger(m.getStatus(),Constants.ZERO)&&Constants.equalsInteger(m.getMeetingStatus(),Constants.ONE)){ | 
|---|
|  |  |  | //开始前120分钟 大于当前时间 则显示即将开始 | 
|---|
|  |  |  | if(DateUtil.afterMinutesDate(m.getStartTime(),-minute).getTime()>System.currentTimeMillis()){ | 
|---|
|  |  |  | if( | 
|---|
|  |  |  | DateUtil.afterMinutesDate(m.getStartTime(),-minute).getTime()<=System.currentTimeMillis() | 
|---|
|  |  |  | ){ | 
|---|
|  |  |  | m.setMeetingStatus(4); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | Constants.NoticeObjectType noticeObjectType = Constants.NoticeObjectType.MEETING_START; | 
|---|
|  |  |  | if (sendType.equals(MeetConstants.THREE)){ | 
|---|
|  |  |  | noticeObjectType = Constants.NoticeObjectType.MEETING_CACEL; | 
|---|
|  |  |  | smsConfig   = smsConfigMapper.selectOne(new QueryWrapper<SmsConfig>().lambda().eq(SmsConfig::getCode, | 
|---|
|  |  |  | SmsConstants.meetingContent.meetingBookCancel) | 
|---|
|  |  |  | .eq(SmsConfig::getIsdeleted,Constants.ZERO) | 
|---|
|  |  |  | .last(" limit 1 ")); | 
|---|
|  |  |  | }else   if (sendType.equals(MeetConstants.TWO)){ | 
|---|
|  |  |  | noticeObjectType = Constants.NoticeObjectType.MEETING_BOOK_SUCCESS; | 
|---|
|  |  |  | smsConfig   = smsConfigMapper.selectOne(new QueryWrapper<SmsConfig>().lambda().eq(SmsConfig::getCode, | 
|---|
|  |  |  | 
|---|
|  |  |  | .isNotNull(SystemUser::getOpenid) | 
|---|
|  |  |  | ); | 
|---|
|  |  |  | List<String> openIdList = userRelList.stream().map(i->i.getOpenid()).collect(Collectors.toList()); | 
|---|
|  |  |  | if(StringUtils.isNotBlank(openid)){ | 
|---|
|  |  |  | openIdList.add(openid); | 
|---|
|  |  |  | openIdList.add(openid); | 
|---|
|  |  |  | if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isEmpty(openIdList)){ | 
|---|
|  |  |  | return; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | Set<String> openIds = new HashSet<String>(openIdList); | 
|---|
|  |  |  | if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(openIds)){ | 
|---|
|  |  |  | WxPlatNotice wxPlatNotice = new WxPlatNotice(); | 
|---|
|  |  |  | if(Constants.equalsInteger(sendType,Constants.ZERO)){ | 
|---|
|  |  |  | wxPlatNotice.sendMeetingBookTemplateNotice(bookings,"CuoDoxOl6SFwi4NhNgOQgKSJVjDD4VCIaPYlnbv_zdY", | 
|---|
|  |  |  | wxPlatNotice.sendMeetingBookTemplateNotice(systemDictDataBiz,bookings,"CuoDoxOl6SFwi4NhNgOQgKSJVjDD4VCIaPYlnbv_zdY", | 
|---|
|  |  |  | systemDictDataBiz.queryByCode(Constants.WX_PLATFORM, Constants.WX_PLATFORM_ACCESS_TOKEN).getCode(),openIds); | 
|---|
|  |  |  | }else{ | 
|---|
|  |  |  |  | 
|---|
|  |  |  | wxPlatNotice.sendMeetingBookCancelTemplateNotice(bookings,"CiB6vCT2InovAoQfudY-lvzLSV0-3lfz3a5GsSFCzd8", | 
|---|
|  |  |  | }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); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | ) | 
|---|
|  |  |  | .eq("c.DELETED",0) | 
|---|
|  |  |  | .eq("c.status",0) | 
|---|
|  |  |  | .eq("m.WORK_STATUS",0) | 
|---|
|  |  |  | .orderByAsc("c.id") | 
|---|
|  |  |  | ); | 
|---|
|  |  |  | String path = systemDictDataBiz.queryByCode(Constants.FTP,Constants.FTP_RESOURCE_PATH).getCode() | 
|---|