Quellcode durchsuchen

1、查询直播间观看奖励配置的观看时长(后台 liveConfig / 观看奖励 中配置,单位:分钟)
2、调整原生支付处理
3、核销问题的处理

yys vor 1 Woche
Ursprung
Commit
a566c72ce1

+ 1 - 1
fs-company-app/src/main/java/com/fs/app/controller/UserController.java

@@ -210,7 +210,7 @@ public class UserController extends AppBaseController {
 
             //redisCache.setCacheObject("perms:"+companyUser.getUserId(), JSONUtil.toJsonStr(perms),2592000, TimeUnit.SECONDS);
             redisCache.setCacheObject("perms:" + companyUser.getUserId(), JSONUtil.toJsonStr(perms), 604800, TimeUnit.SECONDS);
-
+            redisCache.setCacheObject("company-user-token:"+Md5Utils.hash(companyUser.getUserId().toString()),companyUser.getUserId(),100, TimeUnit.DAYS);
             Map<String, Object> result = new HashMap<>();
             result.put("token", token);
             result.put("user", companyUser);

+ 1 - 1
fs-company-app/src/main/resources/application.yml

@@ -6,4 +6,4 @@ server:
 spring:
   profiles:
 #    active: druid-fcky-test
-    active: druid-jnmy-test
+    active: druid-tyt-test

+ 5 - 1
fs-service/src/main/java/com/fs/live/service/impl/LiveOrderServiceImpl.java

@@ -3852,7 +3852,11 @@ public class LiveOrderServiceImpl implements ILiveOrderService {
         if (StringUtils.isBlank(param.getAppId())) {
             throw new IllegalArgumentException("appId不能为空");
         }
-        FsCoursePlaySourceConfig fsCoursePlaySourceConfig = fsCoursePlaySourceConfigMapper.selectCoursePlaySourceConfigByAppId(param.getAppId());
+        String appIds = param.getAppId();
+        if (param.getPayType().equals("wx")){
+            appIds = "app" + param.getAppId();
+        }
+        FsCoursePlaySourceConfig fsCoursePlaySourceConfig = fsCoursePlaySourceConfigMapper.selectCoursePlaySourceConfigByAppId(appIds);
         if (fsCoursePlaySourceConfig == null) {
             throw new CustomException("未找到appId对应的配置: " + param.getAppId());
         }

+ 2 - 1
fs-service/src/main/resources/mapper/his/FsUserMapper.xml

@@ -42,6 +42,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="companyId" column="company_id"/>
         <result property="companyUserId" column="company_user_id"/>
         <result property="loginDevice"    column="login_device"    />
+        <result property="bindCompanyUserId"    column="bind_company_user_id"    />
         <result property="source"    column="source"    />
         <result property="isAddQw"    column="is_add_qw"    />
         <result property="parentId"    column="parent_id"    />
@@ -60,7 +61,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
     <sql id="selectFsUserVo">
-        select user_id,qw_ext_id,sex,is_buy,`level`,course_ma_open_id,is_push,is_add_qw,source,login_device,
+        select user_id,qw_ext_id,sex,is_buy,`level`,course_ma_open_id,is_push,is_add_qw,source,login_device,bind_company_user_id,
                is_individuation_push,store_open_id,password,jpush_id, is_vip,vip_start_date,vip_end_date,
                vip_level,vip_status,nick_name,integral_status, avatar, phone, integral,sign_num, status,
                tui_user_id, tui_time, tui_user_count, ma_open_id, mp_open_id, union_id, is_del, user_code,

+ 1 - 1
fs-user-app/src/main/java/com/fs/app/controller/AppPayController.java

@@ -66,7 +66,7 @@ public class AppPayController extends AppBaseController {
     @ApiOperation("获取支付配置")
     @GetMapping("/getPayConfig")
     public R getPayConfig(@RequestParam String appId){
-        return appPayService.getPayConfig(appId);
+        return appPayService.getPayConfig("app"+ appId);
     }
 
 

+ 25 - 0
fs-user-app/src/main/java/com/fs/app/controller/live/LiveController.java

@@ -32,6 +32,7 @@ import com.fs.live.mapper.LiveWatchUserMapper;
 import com.fs.live.param.FsLiveEncryptLinkParam;
 import com.fs.live.param.LiveNotifyParam;
 import com.fs.live.service.*;
+import com.fs.live.utils.LiveCompletionConfigUtils;
 import com.fs.live.vo.LiveVo;
 import com.fs.wx.miniapp.config.WxMaProperties;
 import com.github.pagehelper.PageHelper;
@@ -424,4 +425,28 @@ public class LiveController extends AppBaseController {
 		}
 	}
 
+	/**
+	 * 查询直播间观看奖励配置的观看时长(后台 liveConfig / 观看奖励 中配置,单位:分钟)
+	 *
+	 * @param liveId 直播间ID
+	 */
+	@Login
+	@ApiOperation("查询观看奖励配置的观看时长")
+	@GetMapping("/watchRewardDuration")
+	public R watchRewardDuration(@RequestParam Long liveId) {
+		Live live = liveService.selectLiveByLiveId(liveId);
+		if (live == null) {
+			return R.error("未找到直播");
+		}
+		String configJson = live.getConfigJson();
+		JSONObject config = LiveCompletionConfigUtils.parseConfig(configJson);
+		Long watchDuration = config != null ? config.getLong("watchDuration") : null;
+		Map<String, Object> data = new HashMap<>(4);
+		// 观看时长奖励是否实际开启(与完课奖励共用 enabled,需结合时长与实施动作判断)
+		data.put("enabled", LiveCompletionConfigUtils.isWatchDurationRewardMode(configJson));
+		data.put("watchDuration", watchDuration);
+		data.put("watchDurationSeconds", watchDuration != null && watchDuration > 0 ? watchDuration * 60L : null);
+		return R.ok().put("data", data);
+	}
+
 }