| | |
| | | |
| | | import com.yeshi.buwan.dao.VideoInfoDao; |
| | | import com.yeshi.buwan.dao.VideoResourceMapExtraInfoDao; |
| | | import com.yeshi.buwan.dao.VideoTypeDao; |
| | | import com.yeshi.buwan.dao.juhe.pptv.PPTVProgramDao; |
| | | import com.yeshi.buwan.dao.juhe.pptv.PPTVSeriesDao; |
| | | import com.yeshi.buwan.dao.juhe.pptv.PPTVSeriesProgramMapDao; |
| | |
| | | import com.yeshi.buwan.dao.video.AlbumVideoMapDao; |
| | | import com.yeshi.buwan.domain.VideoInfo; |
| | | import com.yeshi.buwan.domain.VideoResourceMapExtraInfo; |
| | | import com.yeshi.buwan.domain.VideoType; |
| | | import com.yeshi.buwan.domain.video.AlbumVideoMap; |
| | | import com.yeshi.buwan.dto.mq.PPTVMQMsg; |
| | | import com.yeshi.buwan.pptv.PPTVQuery; |
| | |
| | | import com.yeshi.buwan.service.imp.CategoryVideoService; |
| | | import com.yeshi.buwan.service.imp.ResourceVideoService; |
| | | import com.yeshi.buwan.service.imp.VideoInfoService; |
| | | import com.yeshi.buwan.service.imp.VideoTypeService; |
| | | import com.yeshi.buwan.service.inter.juhe.PPTVService; |
| | | import com.yeshi.buwan.util.mq.CMQManager; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | private CategoryVideoService categoryVideoService; |
| | | |
| | | @Resource |
| | | private VideoTypeService videoTypeService; |
| | | |
| | | @Resource |
| | | private VideoResourceMapExtraInfoDao videoResourceMapExtraInfoDao; |
| | | |
| | | |
| | |
| | | return; |
| | | |
| | | VideoInfo newVideoInfo = PPTVUtil.convertToVideoInfo(series); |
| | | if (newVideoInfo == null) |
| | | return; |
| | | |
| | | VideoType videoType = videoTypeService.getVideoType(newVideoInfo.getVideoType().getId()); |
| | | if (videoType.getParent() != null) |
| | | newVideoInfo.setVideoType(videoType.getParent()); |
| | | |
| | | VideoPPTVMap videoPPTV = videoPPTVMapDao.selectByInfoId(series.getInfoID()); |
| | | if (videoPPTV != null) {//渠道视频已经存在 |
| | | VideoInfo videoInfo = videoInfoService.getVideoInfo(videoPPTV.getVideoId() + ""); |
| | |
| | | |
| | | //加入专辑视频映射 |
| | | AlbumVideoMap map = new AlbumVideoMap(); |
| | | map.setId(newVideoInfo.getId()); |
| | | map.setCreateTime(new Date()); |
| | | map.setVideoId(newVideoInfo.getId()); |
| | | map.setRootVideoType(newVideoInfo.getVideoType().getId()); |
| | |
| | | //添加视频来源映射 |
| | | resourceVideoService.addVideoResource(newVideoInfo.getId(), PPTVUtil.RESOURCE_ID + ""); |
| | | //添加视频分类映射 |
| | | categoryVideoService.addCategoryVideo(newVideoInfo.getId(), newVideoInfo.getVideoType().getId()); |
| | | categoryVideoService.addCategoryVideo(newVideoInfo.getId(), videoType.getId()); |
| | | CMQManager.getInstance().addSolrMsg(newVideoInfo.getId()); |
| | | } |
| | | |
| | |
| | | @Override |
| | | public void save(List<PPTVSeries> seriesList) { |
| | | for (PPTVSeries series : seriesList) { |
| | | save(series); |
| | | try { |
| | | save(series); |
| | | } catch (Exception e) { |
| | | |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | CMQManager.getInstance().addPPTVSeriesUpdateMsg(new PPTVMQMsg(series.getInfoID(), PPTVMQMsg.TYPE_ADD_OR_UPDATE)); |
| | | } |
| | | |
| | | System.out.println("addorupdate:"+series.getName()); |
| | | |
| | | break; |
| | | //删除 |
| | | case "del": |
| | | System.out.println("delete:"+series.getName()); |
| | | deleteSeries(series); |
| | | infoIds.add(series.getInfoID()); |
| | | break; |
| | |
| | | PPTVQuery query = new PPTVQuery(); |
| | | query.seriesCode = series.getSeriesCode(); |
| | | Set<String> seriesCodeSet = deleteMap(query); |
| | | pptvSeriesDao.delete(series.getInfoID()); |
| | | pptvSeriesDao.deleteByPrimaryKey(series.getInfoID()); |
| | | } |
| | | |
| | | |
| | |
| | | PPTVQuery query = new PPTVQuery(); |
| | | query.programCode = program.getProgramCode(); |
| | | Set<String> infoIdSet = deleteMap(query); |
| | | pptvProgramDao.delete(program.getProgramCode()); |
| | | pptvProgramDao.deleteByPrimaryKey(program.getProgramCode()); |
| | | return infoIdSet; |
| | | } |
| | | |