From 759f8df85ddb840682f91bad31e874fa0b58c075 Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期三, 14 四月 2021 19:16:12 +0800 Subject: [PATCH] 订单系统修改 --- src/main/java/com/yeshi/buwan/controller/api/VideoInfoController.java | 30 +++++++++++++++++++++++------- 1 files changed, 23 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/yeshi/buwan/controller/api/VideoInfoController.java b/src/main/java/com/yeshi/buwan/controller/api/VideoInfoController.java index 4f17db3..7bb71cc 100644 --- a/src/main/java/com/yeshi/buwan/controller/api/VideoInfoController.java +++ b/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"); + JSONObject priceInfo = new JSONObject(); + priceInfo.put("discount", price.getTag()); + priceInfo.put("actualPrice",price.getActualPrice()); data.put("price", priceInfo); if (!StringUtil.isNullOrEmpty(loginUid)) { -- Gitblit v1.8.0