浏览代码

提交:BUG处理

yangdamao 3 年之前
父节点
当前提交
a67d8ec704

+ 2 - 0
zhongzheng-admin/src/main/resources/application-dev.yml

@@ -129,6 +129,8 @@ certificate:
 
 liveGotoURL: http://120.79.166.78:19014/
 
+enCodeVersion: develop
+
 officialPush:
     infoPath: http://jypt-dev.gdcic.net/organjxjy/ShangBaoMingdan
     periodPath: http://jypt-dev.gdcic.net/organjxjy/XueshiShenqing

+ 2 - 0
zhongzheng-admin/src/main/resources/application-pre.yml

@@ -129,6 +129,8 @@ certificate:
 
 liveGotoURL: http://120.79.166.78:19010/
 
+enCodeVersion: trial
+
 officialPush:
     infoPath: http://jypt-dev.gdcic.net/organjxjy/ShangBaoMingdan
     periodPath: http://jypt-dev.gdcic.net/organjxjy/XueshiShenqing

+ 2 - 0
zhongzheng-admin/src/main/resources/application-prod.yml

@@ -124,6 +124,8 @@ certificate:
 
 liveGotoURL: https://web.xyyxt.net/
 
+enCodeVersion: release
+
 officialPush:
     infoPath: http://jypt-dev.gdcic.net/organjxjy/ShangBaoMingdan
     periodPath: http://jypt-dev.gdcic.net/organjxjy/XueshiShenqing

+ 2 - 0
zhongzheng-api/src/main/resources/application-dev.yml

@@ -130,6 +130,8 @@ certificate:
 
 liveGotoURL: http://120.79.166.78:19014/
 
+enCodeVersion: develop
+
 officialPush:
     infoPath: http://jypt-dev.gdcic.net/organjxjy/ShangBaoMingdan
     periodPath: http://jypt-dev.gdcic.net/organjxjy/XueshiShenqing

+ 2 - 0
zhongzheng-api/src/main/resources/application-pre.yml

@@ -129,6 +129,8 @@ certificate:
 
 liveGotoURL: http://120.79.166.78:19010/
 
+enCodeVersion: trial
+
 officialPush:
     infoPath: http://jypt-dev.gdcic.net/organjxjy/ShangBaoMingdan
     periodPath: http://jypt-dev.gdcic.net/organjxjy/XueshiShenqing

+ 2 - 0
zhongzheng-api/src/main/resources/application-prod.yml

@@ -136,6 +136,8 @@ certificate:
 
 liveGotoURL: https://web.xyyxt.net/
 
+enCodeVersion: release
+
 officialPush:
     infoPath: http://jypt-dev.gdcic.net/organjxjy/ShangBaoMingdan
     periodPath: http://jypt-dev.gdcic.net/organjxjy/XueshiShenqing

+ 4 - 0
zhongzheng-framework/src/main/java/com/zhongzheng/framework/web/service/WxLoginService.java

@@ -110,6 +110,9 @@ public class WxLoginService implements IWxLoginService {
     @Value("${wx.gzh.qdyExamStatusTpId}")
     private String qdyExamStatusTpId;
 
+    @Value("${enCodeVersion}")
+    private String enCodeVersion;
+
     private String gzh_wxTokenUrl = "https://api.weixin.qq.com/cgi-bin/token";
 
     private String gzh_wxTokenParam = "grant_type=client_credential&appid=%s&secret=%s";
@@ -540,6 +543,7 @@ public class WxLoginService implements IWxLoginService {
         sceneParam.append("sid=").append(watchPer.getSectionId()).append("&");
         sceneParam.append("a=1");
         obj.put("scene",sceneParam.toString());
+        obj.put("env_version",enCodeVersion);
         String result = HttpUtils.sendPost(url, obj);
         return result;
     }

+ 18 - 8
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseSectionWatchPerServiceImpl.java

@@ -1,6 +1,8 @@
 package com.zhongzheng.modules.course.service.impl;
 
 import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.codec.Base64;
+import cn.hutool.core.codec.Base64Decoder;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.BeanUtils;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
@@ -21,10 +23,13 @@ import com.zhongzheng.modules.course.vo.CourseSectionWatchPerVo;
 import com.zhongzheng.modules.goods.domain.Goods;
 import com.zhongzheng.modules.goods.service.IGoodsService;
 import com.zhongzheng.modules.wx.service.IWxLoginService;
+import org.apache.commons.codec.digest.DigestUtils;
+import org.bouncycastle.pqc.math.linearalgebra.ByteUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 
+import java.security.MessageDigest;
 import java.util.Date;
 import java.util.List;
 
@@ -55,7 +60,12 @@ public class CourseSectionWatchPerServiceImpl extends ServiceImpl<CourseSectionW
 //        String url = "";
         String live = "living-room/";
         vo.setEnCode(wxLoginService.getLiveEnCode(bo));
-        String url = String.format("%s%s%s?a=1&cid=%s&gid=%s&sid=%s", liveGotoURL,live,section.getLiveUrl(), bo.getCourseId(), bo.getGoodsId(), bo.getSectionId());
+        String format = String.format("cid=%s&gid=%s&sid=%s", bo.getCourseId(), bo.getGoodsId(), bo.getSectionId());
+
+        String s = Base64.encode(format);
+//        String s = DigestUtils.md5Hex(format);
+//        String url = String.format("%s%s%s?a=1&cid=%s&gid=%s&sid=%s", liveGotoURL,live,section.getLiveUrl(), bo.getCourseId(), bo.getGoodsId(), bo.getSectionId());
+        String url = String.format("%s%s%s?a=1&%s", liveGotoURL,live,section.getLiveUrl(), s);
 //        //生成微信小程序码
 //        switch (bo.getSectionType()){
 //            case 2://直播 living-room/
@@ -100,13 +110,13 @@ public class CourseSectionWatchPerServiceImpl extends ServiceImpl<CourseSectionW
     public CheckSectionWatchVo checkSectionWatchPer(SectionWatchQueryBo bo) {
         //校验商品有效期
         Goods goods = goodsService.getById(bo.getGoodsId());
-        if (ObjectUtils.isNotNull(goods.getValidityStartTime()) && ObjectUtils.isNotNull(goods.getValidityEndTime())){
-            Long validityStartTime = goods.getValidityStartTime();
-            Long validityEndTime = goods.getValidityEndTime();
-            if (DateUtils.getNowTime() < validityStartTime || DateUtils.getNowTime() > validityEndTime){
-                throw new CustomException("该商品不在有效期");
-            }
-        }
+//        if (ObjectUtils.isNotNull(goods.getValidityStartTime()) && ObjectUtils.isNotNull(goods.getValidityEndTime())){
+//            Long validityStartTime = goods.getValidityStartTime();
+//            Long validityEndTime = goods.getValidityEndTime();
+//            if (DateUtils.getNowTime() < validityStartTime || DateUtils.getNowTime() > validityEndTime){
+//                throw new CustomException("该商品不在有效期");
+//            }
+//        }
         CheckSectionWatchVo watchVo = new CheckSectionWatchVo();
         watchVo.setGoodsId(bo.getGoodsId());
         watchVo.setCourseId(bo.getCourseId());