src/main/java/com/yeshi/buwan/controller/parser/HomeParser.java
@@ -7,8 +7,9 @@
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import com.xxl.rpc.util.ThreadPoolUtil;
import com.yeshi.buwan.domain.*;
import com.yeshi.buwan.domain.system.DetailSystemConfig;
import com.yeshi.buwan.domain.system.DetailSystem;
import com.yeshi.buwan.domain.video.VideoWatchHistory;
import com.yeshi.buwan.pptv.PPTVUtil;
import com.yeshi.buwan.pptv.entity.PPTVSeries;
@@ -17,10 +18,13 @@
import com.yeshi.buwan.service.inter.video.VideoWatchHistoryService;
import com.yeshi.buwan.util.*;
import com.yeshi.buwan.util.annotation.RequireUid;
import com.yeshi.buwan.util.log.VideoLogFactory;
import com.yeshi.buwan.vo.AcceptData;
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.HttpException;
import org.apache.commons.httpclient.methods.GetMethod;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import com.yeshi.buwan.domain.entity.PlayUrl;
@@ -40,7 +44,7 @@
    @Resource
    private HomeTypeService homeTypeService;
    @Resource
    private ConfigService configService;
    private DetailSystemConfigService configService;
    @Resource
    private AdService adService;
    @Resource
@@ -74,6 +78,8 @@
    @Resource
    private VideoWatchHistoryService videoWatchHistoryService;
    private final Logger playLogger = LoggerFactory.getLogger("videoPlay");
    @RequireUid
    public void getHomeAd(AcceptData acceptData, HttpServletRequest request, PrintWriter out) {
@@ -153,6 +159,7 @@
        if (StringUtil.isNullOrEmpty(vtid)) {
            vtid = "309"; // 为了兼容以前的推荐
        }
        DetailSystem detailSystem = systemService.getDetailSystemByPackage(acceptData.getPackageName());
        JSONObject object = new JSONObject();
@@ -323,6 +330,7 @@
        String thirdType = request.getParameter("Type");
        String loginUid = request.getParameter("LoginUid");
        String position = request.getParameter("Position");
        String from = request.getParameter("From");
        if (StringUtil.isNullOrEmpty(videoId)) {
            out.print(JsonUtil.loadFalseJson("请上传VideoId"));
@@ -364,6 +372,8 @@
            }
        });
        playLogger.info(VideoLogFactory.createUserVideoDetailLog(acceptData.getDevice(), loginUid, acceptData.getDetailSystem().getId(), videoId, resourceId, from));
        //PPTV网页播放
        if (resourceId != null && Integer.parseInt(resourceId) == PPTVUtil.RESOURCE_ID) {
@@ -372,6 +382,12 @@
            int p = 0;
            if (!StringUtil.isNullOrEmpty(position)) {
                p = Integer.parseInt(position);
            } else {
                //取播放记录
                VideoWatchHistory history = videoWatchHistoryService.getWatchHistory(acceptData.getDevice(), videoId);
                if (history != null && history.getPosition() != null) {
                    p = history.getPosition();
                }
            }
            p = p >= series.getSeries().size() ? 0 : p;
@@ -577,7 +593,7 @@
    public void isPraise(AcceptData acceptData, HttpServletRequest request, PrintWriter out) {
        DetailSystem detailSystem = systemService.getDetailSystemByPackage(acceptData.getPackageName());
        Config config = configService.getConfigByKey("banner_praise", detailSystem, acceptData.getVersion());
        DetailSystemConfig config = configService.getConfigByKey("banner_praise", detailSystem, acceptData.getVersion());
        if ("是".equals(config.getValue())) {
            out.print(JsonUtil.loadTrueJson("1"));
        } else {