浏览代码

连接socket添加销售数据,直播数据解除限制,直播预告视频,直播订单返回销售数据

yuhongqi 1 月之前
父节点
当前提交
daa3511100

+ 1 - 0
fs-company/src/main/java/com/fs/company/controller/live/LiveController.java

@@ -61,6 +61,7 @@ public class LiveController extends BaseController
     {
         // 设置企业ID和企业用户ID
         setCompanyId(live);
+        live.setCompanyUserId(null);
 
         startPage();
         List<Live> list = liveService.selectLiveList(live);

+ 13 - 12
fs-company/src/main/java/com/fs/company/controller/live/LiveDataController.java

@@ -7,6 +7,7 @@ import com.fs.common.core.page.TableDataInfo;
 import com.fs.common.enums.BusinessType;
 import com.fs.common.utils.poi.ExcelUtil;
 import com.fs.core.security.LoginUser;
+import com.fs.core.security.SecurityUtils;
 import com.fs.core.web.service.TokenService;
 import com.fs.live.domain.LiveData;
 import com.fs.live.service.ILiveDataService;
@@ -37,7 +38,7 @@ public class LiveDataController extends BaseController
     /**
      * 查询直播数据列表
      */
-    @PreAuthorize("@ss.hasPermi('liveData:liveData:list')")
+//    @PreAuthorize("@ss.hasPermi('liveData:liveData:list')")
     @GetMapping("/list")
     public TableDataInfo list(LiveData liveData)
     {
@@ -49,7 +50,7 @@ public class LiveDataController extends BaseController
     /**
      * 导出直播数据列表
      */
-    @PreAuthorize("@ss.hasPermi('liveData:liveData:export')")
+//    @PreAuthorize("@ss.hasPermi('liveData:liveData:export')")
     @Log(title = "直播数据", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
     public AjaxResult export(LiveData liveData)
@@ -62,7 +63,7 @@ public class LiveDataController extends BaseController
     /**
      * 获取直播数据详细信息
      */
-    @PreAuthorize("@ss.hasPermi('liveData:liveData:query')")
+//    @PreAuthorize("@ss.hasPermi('liveData:liveData:query')")
     @GetMapping(value = "/{liveId}")
     public AjaxResult getInfo(@PathVariable("liveId") Long liveId)
     {
@@ -72,7 +73,7 @@ public class LiveDataController extends BaseController
     /**
      * 新增直播数据
      */
-    @PreAuthorize("@ss.hasPermi('liveData:liveData:add')")
+//    @PreAuthorize("@ss.hasPermi('liveData:liveData:add')")
     @Log(title = "直播数据", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody LiveData liveData)
@@ -83,7 +84,7 @@ public class LiveDataController extends BaseController
     /**
      * 修改直播数据
      */
-    @PreAuthorize("@ss.hasPermi('liveData:liveData:edit')")
+//    @PreAuthorize("@ss.hasPermi('liveData:liveData:edit')")
     @Log(title = "直播数据", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@RequestBody LiveData liveData)
@@ -94,7 +95,7 @@ public class LiveDataController extends BaseController
     /**
      * 删除直播数据
      */
-    @PreAuthorize("@ss.hasPermi('liveData:liveData:remove')")
+//    @PreAuthorize("@ss.hasPermi('liveData:liveData:remove')")
     @Log(title = "直播数据", businessType = BusinessType.DELETE)
 	@DeleteMapping("/{liveIds}")
     public AjaxResult remove(@PathVariable Long[] liveIds)
@@ -105,20 +106,20 @@ public class LiveDataController extends BaseController
     /**
      * 直播数据页面近期直播卡片数据
      */
-    @PreAuthorize("@ss.hasPermi('liveData:liveData:recentLive')")
+//    @PreAuthorize("@ss.hasPermi('liveData:liveData:recentLive')")
     @GetMapping("/recentLive")
     public AjaxResult recentLive(){
-        return AjaxResult.success(liveDataService.getRecentLive());
+        return AjaxResult.success(liveDataService.getCompanyRecentLive(SecurityUtils.getLoginUser().getCompany().getCompanyId()));
     }
 
     /**
      * 查询直播top榜数据
      */
-    @PreAuthorize("@ss.hasPermi('liveData:liveData:getLiveTop')")
+//    @PreAuthorize("@ss.hasPermi('liveData:liveData:getLiveTop')")
     @GetMapping("/getLiveTop")
     public AjaxResult getLiveTop(String rankType){
         System.out.println(rankType);
-        return AjaxResult.success(liveDataService.getLiveTop(rankType));
+        return AjaxResult.success(liveDataService.getCompanyLiveTop(rankType, SecurityUtils.getLoginUser().getCompany().getCompanyId()));
     }
     /**
      * 查询直播趋势数据
@@ -126,13 +127,13 @@ public class LiveDataController extends BaseController
      * @param
      * @return
      */
-    @PreAuthorize("@ss.hasPermi('liveData:liveData:getTrendData')")
+//    @PreAuthorize("@ss.hasPermi('liveData:liveData:getTrendData')")
     @PostMapping("/getTrendData")
     public AjaxResult getTrendData(@RequestBody Map<String,String> queryParams) {
         String type = queryParams.get("type");
         String date = queryParams.get("date");
         String category = queryParams.get("category");
-        return AjaxResult.success(liveDataService.getTrendData(type, date,category));
+        return AjaxResult.success(liveDataService.getCompanyTrendData(type, date,category, SecurityUtils.getLoginUser().getCompany().getCompanyId()));
     }
     /*@PreAuthorize("@ss.hasPermi('liveData:liveData:columns')")
     @GetMapping("/columns")

+ 2 - 0
fs-company/src/main/java/com/fs/company/controller/live/LiveOrderController.java

@@ -77,6 +77,8 @@ public class LiveOrderController extends BaseController
     public TableDataInfo list(LiveOrder liveOrder)
     {
         startPage();
+        Long companyId = SecurityUtils.getLoginUser().getCompany().getCompanyId();
+        liveOrder.setCompanyId(companyId);
         List<LiveOrder> list = liveOrderService.selectLiveOrderList(liveOrder);
         return getDataTable(list);
     }

+ 3 - 0
fs-service-system/src/main/java/com/fs/live/domain/LiveOrder.java

@@ -311,5 +311,8 @@ public class LiveOrder extends BaseEntity {
     /** 城市Id*/
     private Long cityId;
 
+    private String companyName;
+    private String companyUserName;
+
 
 }

+ 10 - 0
fs-service-system/src/main/java/com/fs/live/mapper/LiveDataMapper.java

@@ -114,4 +114,14 @@ public interface LiveDataMapper {
 
 
     void updateBatchLiveData(@Param("liveDatas") List<LiveData> liveDatas);
+
+    List<RecentLiveDataVo> getCompanyRecentLive(@Param("companyId") Long companyId);
+
+    List<RecentLiveDataVo> getCompanyLiveTop(@Param("rankType") String rankType,@Param("companyId") Long companyId);
+
+    TrendDataVO getCompanyCurrentData(@Param("startDate") String start,@Param("endDate") String end,@Param("companyId") Long companyId);
+
+    TrendDataVO getCompanyPreviousData(@Param("prevStartDate") String start,@Param("prevEndDate") String end,@Param("companyId") Long companyId);
+
+    List<Map<String, Object>> getCompanyChartData(@Param("chartStartDate") String chartStartDate,@Param("chartEndDate") String chartEndDate, @Param("format") String format,@Param("category") String category,@Param("companyId") Long companyId);
 }

+ 3 - 0
fs-service-system/src/main/java/com/fs/live/mapper/LiveVideoMapper.java

@@ -77,4 +77,7 @@ public interface LiveVideoMapper
 
     @Select("select * from live_video where live_id = #{liveId} limit 1")
     LiveVideo selectOne(@Param("liveId") Long liveId);
+
+    @Select("select * from live_video where live_id = #{liveId}")
+    List<LiveVideo> selectByLiveId(@Param("liveId")Long liveId);
 }

+ 6 - 0
fs-service-system/src/main/java/com/fs/live/service/ILiveDataService.java

@@ -121,4 +121,10 @@ public interface ILiveDataService {
     List<LiveData> getAllLiveDatas();
 
     void updateBatchById(List<LiveData> liveDatas);
+
+    List<RecentLiveDataVo> getCompanyRecentLive(Long companyId);
+
+    List<RecentLiveDataVo> getCompanyLiveTop(String rankType,Long companyId);
+
+    TrendDataVO getCompanyTrendData(String type, String date, String category, Long companyId);
 }

+ 66 - 0
fs-service-system/src/main/java/com/fs/live/service/impl/LiveDataServiceImpl.java

@@ -151,11 +151,77 @@ public class LiveDataServiceImpl implements ILiveDataService {
         baseMapper.updateBatchLiveData(liveDatas);
     }
 
+
     @Override
     public List<RecentLiveDataVo> getRecentLive() {
         return liveDataMapper.getRecentLive();
     }
 
+    @Override
+    public List<RecentLiveDataVo> getCompanyRecentLive(Long companyId) {
+        return liveDataMapper.getCompanyRecentLive(companyId);
+    }
+
+    @Override
+    public List<RecentLiveDataVo> getCompanyLiveTop(String rankType, Long companyId) {
+        return liveDataMapper.getCompanyLiveTop(rankType,companyId);
+    }
+
+    @Override
+    public TrendDataVO getCompanyTrendData(String type, String selectedDate, String category, Long companyId) {
+        //DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
+        LocalDate date = LocalDate.parse(selectedDate, DateTimeFormatter.ofPattern("yyyy-MM-dd"));
+        DateRange currentRange = getDateRange(type, date, 0);
+        DateRange previousRange = getDateRange(type, date, -1);
+        DateRange chartRange = getChartDateRange(type, date); // 天 / 10 周 / 12 月
+        // 查询当前周期数据
+        TrendDataVO currentData = liveDataMapper.getCompanyCurrentData(currentRange.getStart(), currentRange.getEnd(),companyId);
+        if (currentData == null) {
+            currentData = new TrendDataVO();
+        }
+        // 查询上一周期数据
+        TrendDataVO prevData = liveDataMapper.getCompanyPreviousData(previousRange.getStart(), previousRange.getEnd(),companyId);
+        if (prevData == null) {
+            prevData = new TrendDataVO();
+        }
+        List<Map<String, Object>> chartRawData = liveDataMapper.getCompanyChartData(chartRange.getStart(), chartRange.getEnd(), type,category.trim(),companyId);
+        List<String> dates = new ArrayList<>();
+        List<Integer> data = new ArrayList<>();
+
+        for (Map<String, Object> row : chartRawData) {
+            String dateRange = (String) row.get("date_range");
+            Integer views = ((Number) row.get("views")).intValue();
+
+            dates.add(dateRange);
+            data.add(views);
+        }
+
+        currentData.setDates(dates);
+        currentData.setData(data);
+        //计算和上一个周期相比的变化百分比
+        currentData.setViewsChange(calcChange(
+                currentData.getViews() != null ? currentData.getViews() : 0,
+                prevData.getPrevViews() != null ? prevData.getPrevViews() : 0));
+
+        currentData.setVisitorsChange(calcChange(
+                currentData.getVisitors() != null ? currentData.getVisitors() : 0,
+                prevData.getPrevVisitors() != null ? prevData.getPrevVisitors() : 0));
+
+        currentData.setStreamsChange(calcChange(
+                currentData.getStreams() != null ? currentData.getStreams() : 0,
+                prevData.getPrevStreams() != null ? prevData.getPrevStreams() : 0));
+
+        currentData.setPvChange(calcChange(
+                currentData.getPv() != null ? currentData.getPv() : 0,
+                prevData.getPrevPv() != null ? prevData.getPrevPv() : 0));
+
+        currentData.setUvChange(calcChange(
+                currentData.getUv() != null ? currentData.getUv() : 0,
+                prevData.getPrevUv() != null ? prevData.getPrevUv() : 0));
+
+        return currentData;
+    }
+
     @Override
     public List<RecentLiveDataVo> getLiveTop(String rankType) {
         return liveDataMapper.getLiveTop(rankType);

+ 16 - 2
fs-service-system/src/main/java/com/fs/live/service/impl/LiveVideoServiceImpl.java

@@ -7,6 +7,7 @@ import com.fs.live.service.ILiveVideoService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.Date;
 import java.util.List;
 
 /**
@@ -67,8 +68,21 @@ public class LiveVideoServiceImpl implements ILiveVideoService
     @Override
     public int insertLiveVideo(LiveVideo liveVideo)
     {
-        liveVideo.setCreateTime(DateUtils.getNowDate());
-        return liveVideoMapper.insertLiveVideo(liveVideo);
+        List<LiveVideo> liveVideos = liveVideoMapper.selectByLiveId(liveVideo.getLiveId());
+        if (liveVideos!=null && !liveVideos.isEmpty()) {
+            Date nowDate = DateUtils.getNowDate();
+            liveVideos.forEach(liveVideoEntity -> {
+                liveVideoEntity.setVideoType(liveVideo.getVideoType());
+                liveVideoEntity.setDuration(liveVideo.getDuration());
+                liveVideoEntity.setVideoUrl(liveVideo.getVideoUrl());
+                liveVideoEntity.setUpdateTime(nowDate);
+                liveVideoMapper.updateLiveVideo(liveVideoEntity);
+            });
+            return liveVideos.size();
+        } else {
+            liveVideo.setCreateTime(DateUtils.getNowDate());
+            return liveVideoMapper.insertLiveVideo(liveVideo);
+        }
     }
 
     /**

+ 91 - 0
fs-service-system/src/main/resources/mapper/live/LiveDataMapper.xml

@@ -56,6 +56,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         SELECT A.page_views AS pageViews,A.unique_visitors AS uniqueVisitors, B.live_id AS liveId,B.live_name AS liveName,B.`status` AS status,B.live_img_url AS liveImgUrl,B.start_time AS startTime
         FROM live_data A LEFT JOIN live B ON A.live_id = B.live_id ORDER BY B.start_time LIMIT 4
     </select>
+    <select id="getCompanyRecentLive" resultType="com.fs.live.vo.RecentLiveDataVo">
+        SELECT A.page_views AS pageViews,A.unique_visitors AS uniqueVisitors, B.live_id AS liveId,B.live_name AS liveName,B.`status` AS status,B.live_img_url AS liveImgUrl,B.start_time AS startTime
+        FROM live_data A LEFT JOIN live B ON A.live_id = B.live_id
+        <if test="companyId != null">
+        where b.company_id = #{companyId}
+        </if>
+        ORDER BY B.start_time LIMIT 4
+    </select>
     <select id="getLiveTop" resultType="com.fs.live.vo.RecentLiveDataVo">
         SELECT A.page_views AS pageViews,A.unique_visitors AS uniqueVisitors,A.total_views AS totalViews,A.unique_viewers AS uniqueViewers,A.peak_concurrent_viewers AS peakConcurrentViewers,
         B.live_name AS liveName,B.live_img_url AS liveImgUrl
@@ -79,6 +87,32 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </choose>
         LIMIT 10
     </select>
+    <select id="getCompanyLiveTop" resultType="com.fs.live.vo.RecentLiveDataVo">
+        SELECT A.page_views AS pageViews,A.unique_visitors AS uniqueVisitors,A.total_views AS totalViews,A.unique_viewers AS uniqueViewers,A.peak_concurrent_viewers AS peakConcurrentViewers,
+        B.live_name AS liveName,B.live_img_url AS liveImgUrl
+        FROM live_data A LEFT JOIN live B ON A.live_id = B.live_id
+        <if test="companyId != null">
+            where b.company_id = #{companyId}
+        </if>
+        <choose>
+            <when test="rankType == 'highFlow'">
+                ORDER BY A.page_views DESC
+            </when>
+            <when test="rankType == 'highView'">
+                ORDER BY A.total_views DESC
+            </when>
+            <when test="rankType == 'lowFlow'">
+                ORDER BY A.page_views ASC
+            </when>
+            <when test="rankType == 'lowView'">
+                ORDER BY A.total_views ASC
+            </when>
+            <otherwise>
+                ORDER BY A.page_views DESC
+            </otherwise>
+        </choose>
+        LIMIT 10
+    </select>
     <select id="getCurrentData" resultType="com.fs.live.vo.TrendDataVO">
         SELECT
             SUM(ld.page_views) AS views,
@@ -125,6 +159,63 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             LEFT JOIN live l ON ld.live_id = l.live_id
             WHERE DATE(l.start_time) BETWEEN #{prevStartDate} AND #{prevStartDate};
     </select>
+    <select id="getCompanyCurrentData" resultType="com.fs.live.vo.TrendDataVO">
+        SELECT
+            SUM(ld.page_views) AS views,
+            SUM(ld.unique_visitors) AS visitors,
+            COUNT(l.live_id) AS streams,
+            SUM(ld.total_views) AS pv,
+            SUM(ld.unique_viewers) AS uv
+            FROM live_data ld
+            JOIN live l ON ld.live_id = l.live_id
+            WHERE DATE(l.start_time) BETWEEN #{startDate} AND #{endDate}
+        <if test="companyId != null">
+          and l.company_id = #{companyId}
+        </if>
+        ;
+
+    </select>
+    <select id="getCompanyChartData" resultType="java.util.Map">
+        SELECT
+            CASE
+                WHEN #{format} = 'day' THEN DATE(l.start_time)
+                WHEN #{format} = 'week' THEN
+                CONCAT(
+                DATE_FORMAT(DATE_SUB(l.start_time, INTERVAL WEEKDAY(l.start_time) DAY), '%m/%d'),
+                '-',
+                DATE_FORMAT(DATE_ADD(l.start_time, INTERVAL (6 - WEEKDAY(l.start_time)) DAY), '%m/%d')
+                )
+                WHEN #{format} = 'month' THEN DATE_FORMAT(l.start_time, '%Y-%m')
+                END AS date_range,
+        <choose>
+            <when test="category == 'streams'"> COUNT(l.live_id) </when>
+            <otherwise> SUM(ld.${category}) </otherwise>
+        </choose>
+         AS views
+            FROM live_data ld
+            LEFT JOIN live l ON ld.live_id = l.live_id
+            WHERE DATE(l.start_time) BETWEEN #{chartStartDate} AND #{chartEndDate}
+            <if test="companyId != null">
+                and  l.company_id = #{companyId}
+            </if>
+            GROUP BY date_range
+            ORDER BY date_range;
+    </select>
+    <select id="getCompanyPreviousData" resultType="com.fs.live.vo.TrendDataVO">
+        SELECT
+            SUM(ld.page_views) AS prevViews,
+            SUM(ld.unique_visitors) AS prevVisitors,
+            COUNT(l.live_id) AS prevStreams,
+            SUM(ld.total_views) AS prevPv,
+            SUM(ld.unique_viewers) AS prevUv
+            FROM live_data ld
+            LEFT JOIN live l ON ld.live_id = l.live_id
+            WHERE DATE(l.start_time) BETWEEN #{prevStartDate} AND #{prevStartDate}
+        <if test="companyId != null">
+            and l.company_id = #{companyId}
+        </if>
+        ;
+    </select>
 
     <insert id="insertLiveData" parameterType="LiveData">
         insert into live_data

+ 19 - 2
fs-service-system/src/main/resources/mapper/live/LiveOrderMapper.xml

@@ -74,6 +74,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="isEditMoney"    column="is_edit_money"    />
         <result property="orderName"    column="order_name"    />
         <result property="productIntroduce"    column="product_introduce"    />
+        <result property="companyUserName"    column="company_user_name"    />
+        <result property="companyName"    column="company_name"    />
     </resultMap>
 
     <sql id="selectLiveOrderVo">
@@ -94,7 +96,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </sql>
 
     <select id="selectLiveOrderList" parameterType="LiveOrder" resultMap="LiveOrderResult">
-        <include refid="selectLiveOrderVo"/>
+        SELECT
+        c.company_name,cu.user_name as company_user_name,a.order_id,a.live_id,	a.product_id,	a.order_name,	a.store_id,	a.order_code,	a.user_id,	a.user_name,
+        a.user_phone,	a.user_address,	a.cart_id,	a.total_num,	a.total_price,	a.pay_price,	a.pay_money,	a.is_pay,
+        a.pay_time,	a.pay_type,	a.create_time,	a.update_time,	a.STATUS,	a.refund_status,	a.refund_img,	a.refund_explain,
+        a.refund_time,	a.refund_reason,	a.refund_money,	a.delivery_code,	a.delivery_name,	a.delivery_sn,
+        a.remark,	a.is_del,	a.cost_price,	a.verify_code,	a.shipping_type,	a.is_channel,	a.finish_time,
+        a.delivery_time,	a.tui_money,	a.tui_money_status,	a.tui_user_id,	a.item_json,	a.discount_money,
+        a.user_coupon_id,	a.company_id,	a.company_user_id,	a.store_house_code,	a.extend_order_id,	a.pay_delivery,
+        a.pay_remain,	a.delivery_status,	a.delivery_pay_status,	a.delivery_pay_time,	a.delivery_type,
+        a.delivery_pay_money,	a.delivery_import_time,	a.delivery_send_time,	a.is_after_sales,	a.dept_id,
+        a.channel,	a.source,	a.bill_price,	a.total_postage,	a.pay_postage,	a.gain_integral,
+        a.use_integral,	a.pay_integral,	a.back_integral,	a.is_edit_money,	b.product_info as product_introduce
+        FROM
+        live_order a LEFT JOIN fs_store_product b ON a.product_id = b.product_id
+        left join company_user cu on a.company_user_id = cu.user_id
+        left join company c on a.company_id = c.company_id
         <where>
             <if test="liveId != null "> and live_id = #{liveId}</if>
             <if test="storeId != null "> and store_id = #{storeId}</if>
@@ -134,7 +151,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="itemJson != null  and itemJson != ''"> and item_json = #{itemJson}</if>
             <if test="discountMoney != null "> and discount_money = #{discountMoney}</if>
             <if test="userCouponId != null "> and user_coupon_id = #{userCouponId}</if>
-            <if test="companyId != null "> and company_id = #{companyId}</if>
+            <if test="companyId != null "> and a.company_id = #{companyId}</if>
             <if test="companyUserId != null "> and company_user_id = #{companyUserId}</if>
             <if test="storeHouseCode != null  and storeHouseCode != ''"> and store_house_code = #{storeHouseCode}</if>
             <if test="extendOrderId != null  and extendOrderId != ''"> and extend_order_id = #{extendOrderId}</if>

+ 1 - 0
fs-service-system/src/main/resources/mapper/live/LiveVideoMapper.xml

@@ -72,6 +72,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="liveId != null">live_id = #{liveId},</if>
             <if test="videoUrl != null">video_url = #{videoUrl},</if>
             <if test="videoType != null">video_type = #{videoType},</if>
+            <if test="duration != null">duration = #{duration},</if>
             <if test="sort != null">sort = #{sort},</if>
             <if test="createTime != null">create_time = #{createTime},</if>
             <if test="createBy != null">create_by = #{createBy},</if>

+ 6 - 0
fs-user-app/src/main/java/com/fs/app/websocket/auth/WebSocketConfigurator.java

@@ -46,6 +46,12 @@ public class WebSocketConfigurator extends ServerEndpointConfig.Configurator {
         Map<String, Object> userProperties = sec.getUserProperties();
         userProperties.put(AttrConstant.LIVE_ID, liveId);
         userProperties.put(AttrConstant.USER_ID, userId);
+        if (parameterMap.containsKey(AttrConstant.COMPANY_ID)) {
+            userProperties.put(AttrConstant.COMPANY_ID, Long.valueOf(parameterMap.get(AttrConstant.COMPANY_ID).get(0)));
+        }
+        if (parameterMap.containsKey(AttrConstant.COMPANY_USER_ID)) {
+            userProperties.put(AttrConstant.COMPANY_USER_ID, Long.valueOf(parameterMap.get(AttrConstant.COMPANY_USER_ID).get(0)));
+        }
 
         // 验证token
         if (parameterMap.containsKey(tokenKey)) {

+ 2 - 0
fs-user-app/src/main/java/com/fs/app/websocket/constant/AttrConstant.java

@@ -10,6 +10,8 @@ public class AttrConstant {
     public static final String USER_TYPE = "userType";
     public static final String TIMESTAMP = "timestamp";
     public static final String SIGNATURE = "signature";
+    public static final String COMPANY_ID = "companyId";
+    public static final String COMPANY_USER_ID = "companyUserId";
 
     // 定义 AttributeKey 保存必要参数
     public static final AttributeKey<Long> ATTR_LIVE_ID = AttributeKey.valueOf(LIVE_ID);