admin
2021-04-14 759f8df85ddb840682f91bad31e874fa0b58c075
src/main/java/com/yeshi/buwan/controller/api/VideoInfoController.java
@@ -5,6 +5,7 @@
import com.yeshi.buwan.domain.VideoInfo;
import com.yeshi.buwan.domain.user.LoginUser;
import com.yeshi.buwan.domain.vip.*;
import com.yeshi.buwan.dto.order.PPTVVideoPrice;
import com.yeshi.buwan.exception.goldcorn.GoldCornException;
import com.yeshi.buwan.exception.order.OrderException;
import com.yeshi.buwan.exception.order.PayException;
@@ -37,9 +38,7 @@
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.lang.reflect.Type;
import java.util.Date;
import java.util.List;
import java.util.UUID;
import java.util.*;
@Controller
@RequestMapping("api/v2/videoinfo")
@@ -62,6 +61,9 @@
    @Resource
    private GoldCornManager goldCornManager;
    @Resource
    private SystemConfigService systemConfigService;
    private String getDurationDesc(int duration) {
        int h = duration / (60 * 60);
@@ -94,11 +96,23 @@
            return JsonUtilV2.loadFalseJson("当前影片不能购买");
        }
        Set<String> typeSets = new HashSet<>();
        try {
            String[] sts = series.getProgramcategory().split(",");
            for (String st : sts) {
                typeSets.add(st.split("-")[0]);
            }
            typeSets.remove("好莱坞");
            typeSets.remove("院线");
        } catch (Exception e) {
        }
        PPTVSimpleVideoInfo videoInfo = new PPTVSimpleVideoInfo();
        videoInfo.setInfoId(series.getInfoID());
        videoInfo.setName(series.getName());
        videoInfo.setPicture(series.getCover());
        videoInfo.setCategory(series.getProgramcategory().replace("-电视剧", "").replace("-电影", "").replace("-动漫", "").replace("-少儿", ""));
        videoInfo.setCategory(com.yeshi.buwan.util.StringUtil.join(typeSets, " "));
        videoInfo.setActors(series.getActor());
        videoInfo.setDirectors(series.getDirector());
        if (series.getSeries() != null && series.getSeries().size() > 0 && !StringUtil.isNullOrEmpty(series.getSeries().get(0).getDuration()))
@@ -109,10 +123,12 @@
        JSONObject data = new JSONObject();
        data.put("video", gson.toJson(videoInfo));
        PPTVVideoPrice price = new Gson().fromJson(systemConfigService.getConfigValueByKeyCache("videoPrice"), PPTVVideoPrice.class);
        //加载价格信息
        JSONObject priceInfo=new JSONObject();
        priceInfo.put("discount","6折");
        priceInfo.put("actualPrice","3.9");
        priceInfo.put("discount", price.getTag());
        priceInfo.put("actualPrice",price.getActualPrice());
        data.put("price", priceInfo);
        if (!StringUtil.isNullOrEmpty(loginUid)) {