Prechádzať zdrojové kódy

Merge remote-tracking branch 'origin/master'

kk 2 týždňov pred
rodič
commit
1d317bdc8e

+ 12 - 3
game-business/src/main/java/com/game/business/controller/AppUserController.java

@@ -181,6 +181,10 @@ public class AppUserController extends BaseController
         tran.setRemarks(remark);
 
         try {
+            /*if(null != userChargeDto.getChannelId() && userChargeDto.getChannelId() > 0){
+                AppChargeChannel channel = appChargeChannelService.selectAppChargeChannelById(userChargeDto.getChannelId());
+                userChargeDto.setRate(channel.getRate());
+            }*/
             appUserService.updateUserAmount(tran);
             BigDecimal rate = BigDecimal.ZERO;
             if(null != userChargeDto.getRate() && userChargeDto.getRate() > 0 && userChargeDto.getAmount() > 0){
@@ -253,6 +257,8 @@ public class AppUserController extends BaseController
             appUsersCharge.setOptUser(String.valueOf(SecurityUtils.getUserId()));
             // 操作类型 1:充值金币 2:扣减金币
             appUsersCharge.setOptType(userChargeDto.getAmount()<0?2L:1L);
+            //渠道
+            appUsersCharge.setChannelId(userChargeDto.getChannelId());
             //赠送金额
             appUsersCharge.setCoinGive(BigDecimal.valueOf(give));
             appUsersCharge.setAddtime(new Date());
@@ -315,7 +321,7 @@ public class AppUserController extends BaseController
     @ApiOperation(value = "开关播", notes = "开关播")
     public R<String> openLive(HttpServletResponse response, @RequestBody LiveLive liveLive)
     {
-        String url = sysConfigService.selectConfigByKey("sys_live_apiurl").concat("live/openCloseLive");
+        String url = sysConfigService.selectConfigByKey("sys_live_apiurl").concat("/api/live/httpOpenCloseLive");
         Map<String, String> map = new HashMap<>();
         map.put("roomId", String.valueOf(liveLive.getId()));
         map.put("liveType", "1");
@@ -323,10 +329,13 @@ public class AppUserController extends BaseController
         map.put("description", liveLive.getTitle());
 
         String res = HttpClientUtils.ajaxPost(url,map);
-        if(StringUtils.isBlank(res) || JSONObject.parseObject(res).getString("code") != "1"){
+        if(StringUtils.isBlank(res) || !JSONObject.parseObject(res).getString("code").equals("1")){
+            log.info("失败===============》》".concat(res));
             return R.fail(liveLive.getIslive().intValue()==1?"关播":"虚拟开播"+"失败");
         }
-        return R.ok(liveLive.getIslive().intValue()==1?"关播":"虚拟开播"+"成功");
+        String sign = TencentCloudImUtil.genUserSig(String.valueOf(liveLive.getUserId()), null);
+        String liveUrl = "rtmp://intl-rtmp.rtc.qq.com/push/"+liveLive.getId()+"?sdkappid="+TencentCloudImUtil.getSdkAppId()+"&userid="+liveLive.getUserId()+"&usersig="+sign;
+        return R.ok(liveLive.getIslive().intValue()==1?"关播":"虚拟开播"+"成功",liveUrl);
     }
 
     /**

+ 6 - 0
game-business/src/main/java/com/game/business/domain/AppUsersCharge.java

@@ -206,6 +206,12 @@ private static final long serialVersionUID=1L;
     @TableField(value = "uid")
     private Long uid;
 
+    /** 用户ID */
+    @ApiModelProperty(value = "充值渠道id")
+    @Excel(name = "充值渠道id")
+    @TableField(value = "channel_id")
+    private Long channelId;
+
     @JsonIgnore
     @TableField(exist = false)
     private Double todaySum;

+ 6 - 1
game-business/src/main/resources/mapper/business/AppUsersChargeMapper.xml

@@ -35,10 +35,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="tradeNo"    column="trade_no"    />
         <result property="type"    column="type"    />
         <result property="uid"    column="uid"    />
+        <result property="channelId"    column="channel_id"    />
     </resultMap>
 
     <sql id="selectAppUsersChargeVo">
-        select id, addtime,update_time, after_coin, agent_id, ambient, coin, coin_type, coin_give,platform_service_rate,platform_service, is_agent, is_delete, is_water, money, opt_type, opt_user, orderno, pid, pid_level1, pid_level2, pid_level3, pid_level4, remarks, rule_id, status, touid, trade_no, type, uid from app_users_charge
+        select id, addtime,update_time, after_coin, agent_id, ambient, coin, coin_type, coin_give,platform_service_rate,platform_service, is_agent, is_delete, is_water, money, opt_type, opt_user, orderno, pid, pid_level1, pid_level2, pid_level3, pid_level4, remarks, rule_id, status, touid, trade_no, type, uid,channel_id from app_users_charge
     </sql>
 
     <select id="selectAppUsersChargeList" parameterType="com.game.business.domain.AppUsersCharge" resultMap="AppUsersChargeResult">
@@ -73,6 +74,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="tradeNo != null  and tradeNo != ''"> and trade_no = #{tradeNo}</if>
             <if test="type != null "> and type = #{type}</if>
             <if test="uid != null "> and uid = #{uid}</if>
+            <if test="channelId != null "> and channel_id = #{channelId}</if>
         </where>
     </select>
     
@@ -114,6 +116,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="tradeNo != null">trade_no,</if>
             <if test="type != null">type,</if>
             <if test="uid != null">uid,</if>
+            <if test="channelId != null">channel_id,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="id != null">#{id},</if>
@@ -146,6 +149,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="tradeNo != null">#{tradeNo},</if>
             <if test="type != null">#{type},</if>
             <if test="uid != null">#{uid},</if>
+            <if test="channelId != null">#{channelId},</if>
          </trim>
     </insert>
 
@@ -181,6 +185,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="tradeNo != null">trade_no = #{tradeNo},</if>
             <if test="type != null">type = #{type},</if>
             <if test="uid != null">uid = #{uid},</if>
+            <if test="channelId != null">channel_id = #{channelId},</if>
         </trim>
         where id = #{id}
     </update>

+ 2 - 2
game-ui/src/views/business/channel/index.vue

@@ -180,12 +180,12 @@
 <!--      <el-table-column label="渠道key" align="center" prop="channelKey" />-->
       <el-table-column label="充值手续费" align="center" prop="rate">
         <template slot-scope="scope">
-          {{scope.row.rate * 100 + "%"}}
+          {{(scope.row.rate * 100).toFixed(2) + "%"}}
         </template>
       </el-table-column>
       <el-table-column label="提现手续费" align="center" prop="withdrawRate">
         <template slot-scope="scope">
-          {{scope.row.withdrawRate * 100 + "%"}}
+          {{(scope.row.withdrawRate * 100).toFixed(2) + "%"}}
         </template>
       </el-table-column>
       <el-table-column label="是否开启" align="center" prop="status">

+ 18 - 3
game-ui/src/views/business/user/index.vue

@@ -998,9 +998,24 @@ export default {
       var that =this;
       this.liveLive["title"] = this.closeMsg;
       openLive(this.liveLive).then(response => {
-        this.$modal.msgSuccess(this.liveLive.islive==1?"关播":"虚拟开播"+"成功");
-        this.liveOpen = false;
-        this.getList();
+        that.liveOpen = false;
+        setTimeout(function (){
+          that.getList();
+        },4000);
+        if(this.liveLive.islive!=1){
+          that.$alert(response["msg"], '开播成功', {
+            confirmButtonText: '确定',
+            callback: action => {
+              /*this.$message({
+                type: 'info',
+                message: `action: ${ action }`
+              });*/
+            }
+          });
+        }else{
+          that.$modal.msgSuccess(this.liveLive.islive==1?"关播":"虚拟开播"+"成功");
+        }
+
       });
     },
     /** 删除按钮操作 */