| | |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | |
| | | @Slf4j |
| | |
| | | // List<LiveStreaming> dtoResult = markOwnData(familyId, beanRecords); |
| | | |
| | | HashMap<String, Object> data = MapUtils.getResult(pageResult, beanRecords); |
| | | |
| | | |
| | | |
| | | return AjaxResult.success(data); |
| | | |
| | | } |
| | |
| | | return list; |
| | | } |
| | | |
| | | private Date getEndTime1(LiveStreaming liveStreaming) throws ParseException{ |
| | | System.out.println(liveStreaming.getStartTime()); |
| | | SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | Calendar nowTime = Calendar.getInstance(); |
| | | nowTime.setTime(liveStreaming.getStartTime()); |
| | | nowTime.add(Calendar.MINUTE, liveStreaming.getDuration()); |
| | | String currentTime = df.format(nowTime.getTime()); |
| | | System.out.println("30分钟后的时间" + currentTime); |
| | | return df.parse(currentTime); |
| | | } |
| | | |
| | | @Override |
| | | public AjaxResult addData(LiveStreaming liveStreaming) { |
| | | public AjaxResult addData(LiveStreaming liveStreaming) throws ParseException { |
| | | LambdaQueryWrapper<LiveStreaming> lqw = uniqueCondition(liveStreaming); |
| | | List<LiveStreaming> list = list(lqw); |
| | | |
| | |
| | | if (liveStreaming.getMaxPerson() > 120){ |
| | | throw new RuntimeException("可容纳人数暂时最多为120人"); |
| | | } |
| | | |
| | | liveStreaming.setEndTime(getEndTime1(liveStreaming)); |
| | | |
| | | if (save(liveStreaming)) { |
| | | EsModel esModel = new EsModel(); |
| | |
| | | esModel.setBy1(liveStreaming.getTitle()); |
| | | esModel.setBy2(liveStreaming.getApplyPerson()); |
| | | esModel.setBy3(liveStreaming.getRoomId()); |
| | | //取当前的时分-30 |
| | | |
| | | |
| | | |
| | | System.out.println(liveStreaming.getEndTime()); |
| | | // esModel.setBy4(liveStreaming.getEndTime()); |
| | | //这里存储查询详情的路径 |
| | | esModel.setBy5("/zLiveStreaming"); |
| | | // esModel.setFid(familyId); |