瀏覽代碼

直播代码增量更新

yuhongqi 5 天之前
父節點
當前提交
7c9b69c557
共有 37 個文件被更改,包括 494 次插入115 次删除
  1. 27 4
      fs-admin/src/main/java/com/fs/company/controller/CompanyController.java
  2. 11 4
      fs-admin/src/main/java/com/fs/live/controller/LiveAfterSalesController.java
  3. 2 2
      fs-admin/src/main/java/com/fs/live/controller/LiveAutoTaskController.java
  4. 12 0
      fs-admin/src/main/java/com/fs/live/controller/LiveCouponController.java
  5. 6 6
      fs-admin/src/main/java/com/fs/live/controller/LiveCouponIssueUserController.java
  6. 6 6
      fs-admin/src/main/java/com/fs/live/controller/LiveCouponUserController.java
  7. 9 4
      fs-admin/src/main/java/com/fs/live/controller/LiveOrderPaymentController.java
  8. 2 0
      fs-common/src/main/java/com/fs/common/constant/LiveKeysConstant.java
  9. 10 4
      fs-company/src/main/java/com/fs/company/controller/live/LiveAfterSalesController.java
  10. 1 1
      fs-company/src/main/java/com/fs/company/controller/live/LiveAutoTaskController.java
  11. 19 0
      fs-live-app/src/main/java/com/fs/live/controller/LiveController.java
  12. 21 1
      fs-live-app/src/main/java/com/fs/live/task/Task.java
  13. 34 2
      fs-live-app/src/main/java/com/fs/live/websocket/service/WebSocketServer.java
  14. 31 0
      fs-service/src/main/java/com/fs/company/mapper/CompanyMapper.java
  15. 15 0
      fs-service/src/main/java/com/fs/company/param/CompanyLiveShowParam.java
  16. 1 0
      fs-service/src/main/java/com/fs/company/param/CompanyParam.java
  17. 6 0
      fs-service/src/main/java/com/fs/company/service/ICompanyService.java
  18. 17 0
      fs-service/src/main/java/com/fs/company/service/impl/CompanyServiceImpl.java
  19. 2 0
      fs-service/src/main/java/com/fs/company/vo/CompanyVO.java
  20. 1 1
      fs-service/src/main/java/com/fs/hisStore/vo/FsStorePaymentVO.java
  21. 2 0
      fs-service/src/main/java/com/fs/live/domain/LiveVideo.java
  22. 3 0
      fs-service/src/main/java/com/fs/live/mapper/LiveCouponIssueMapper.java
  23. 18 0
      fs-service/src/main/java/com/fs/live/mapper/LiveCouponMapper.java
  24. 6 0
      fs-service/src/main/java/com/fs/live/mapper/LiveMapper.java
  25. 5 0
      fs-service/src/main/java/com/fs/live/mapper/LiveVideoMapper.java
  26. 2 0
      fs-service/src/main/java/com/fs/live/service/ILiveCouponIssueService.java
  27. 2 0
      fs-service/src/main/java/com/fs/live/service/ILiveCouponService.java
  28. 2 0
      fs-service/src/main/java/com/fs/live/service/ILiveVideoService.java
  29. 31 4
      fs-service/src/main/java/com/fs/live/service/impl/LiveAutoTaskServiceImpl.java
  30. 5 0
      fs-service/src/main/java/com/fs/live/service/impl/LiveCouponIssueServiceImpl.java
  31. 6 0
      fs-service/src/main/java/com/fs/live/service/impl/LiveCouponServiceImpl.java
  32. 9 2
      fs-service/src/main/java/com/fs/live/service/impl/LiveServiceImpl.java
  33. 1 0
      fs-service/src/main/java/com/fs/live/service/impl/LiveVideoServiceImpl.java
  34. 48 28
      fs-service/src/main/java/com/fs/live/vo/LiveAfterSalesVo.java
  35. 69 43
      fs-service/src/main/java/com/fs/live/vo/LiveOrderPaymentVo.java
  36. 44 0
      fs-service/src/main/resources/mapper/live/LiveMapper.xml
  37. 8 3
      fs-service/src/main/resources/mapper/live/LiveVideoMapper.xml

+ 27 - 4
fs-admin/src/main/java/com/fs/company/controller/CompanyController.java

@@ -10,16 +10,14 @@ import com.fs.common.core.domain.R;
 import com.fs.common.core.domain.model.LoginUser;
 import com.fs.common.core.page.TableDataInfo;
 import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.ParseUtils;
 import com.fs.common.utils.SecurityUtils;
 import com.fs.common.utils.ServletUtils;
 import com.fs.common.utils.StringUtils;
 import com.fs.common.utils.poi.ExcelUtil;
 import com.fs.common.utils.sign.Md5Utils;
 import com.fs.company.domain.*;
-import com.fs.company.param.CompanyDeductParam;
-import com.fs.company.param.CompanyParam;
-import com.fs.company.param.CompanyRechargeParam;
-import com.fs.company.param.CompanyVoiceCallerParam;
+import com.fs.company.param.*;
 import com.fs.company.service.*;
 import com.fs.company.vo.CompanyCrmVO;
 import com.fs.company.vo.CompanyVO;
@@ -34,6 +32,7 @@ import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.*;
 
+import java.text.ParseException;
 import java.util.List;
 
 /**
@@ -60,6 +59,30 @@ public class CompanyController extends BaseController
     private ICompanyVoiceCallerService callerService;
     @Autowired
     private ISysConfigService configService;
+
+    /**
+     * 查询企业列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveMiniLives:list')")
+    @GetMapping("/liveShowList")
+    public TableDataInfo liveShowList(CompanyParam param) throws ParseException {
+        startPage();
+        List<CompanyVO> list = companyService.liveShowList(param);
+        for (CompanyVO vo : list){
+            vo.setCompanyMobile(ParseUtils.parsePhone(vo.getCompanyMobile()));
+        }
+        return getDataTable(list);
+    }
+
+    @PostMapping(value = "/batchUpdateLiveShow")
+    public R batchUpdateLiveShow(@RequestBody CompanyLiveShowParam param) {
+        if (param.getIds().isEmpty()) {
+            return R.error("请选择要操作的记录");
+        }
+        companyService.batchUpdateLiveShow(param);
+        return R.ok();
+    }
+
     /**
      * 查询企业列表
      */

+ 11 - 4
fs-admin/src/main/java/com/fs/live/controller/LiveAfterSalesController.java

@@ -26,6 +26,7 @@ import com.fs.live.service.ILiveAfterSalesLogsService;
 import com.fs.live.service.ILiveAfterSalesService;
 import com.fs.live.service.ILiveOrderService;
 import com.fs.live.vo.LiveAfterSalesVo;
+import com.github.pagehelper.PageHelper;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
@@ -96,11 +97,17 @@ public class LiveAfterSalesController extends BaseController
     @PreAuthorize("@ss.hasPermi('live:liveAfteraSales:export')")
     @Log(title = "售后记录", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
-    public AjaxResult export(LiveAfterSales liveAfterSales)
+    public AjaxResult export(LiveAfterSalesVo liveAfterSales)
     {
-        List<LiveAfterSales> list = liveAfterSalesService.selectLiveAfterSalesList(liveAfterSales);
-        ExcelUtil<LiveAfterSales> util = new ExcelUtil<LiveAfterSales>(LiveAfterSales.class);
-        return util.exportExcel(list, "售后记录数据");
+        PageHelper.clearPage();
+        PageHelper.startPage(1, 10000, "");
+        List<LiveAfterSalesVo> list = liveAfterSalesService.selectLiveAfterSalesVoList(liveAfterSales);
+        for (LiveAfterSalesVo liveAfterSalesVo : list) {
+            liveAfterSalesVo.setUserPhone(liveAfterSalesVo.getUserPhone() == null ? "" : liveAfterSalesVo.getUserPhone().replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));
+            liveAfterSalesVo.setPhoneNumber(liveAfterSalesVo.getPhoneNumber() == null ? "" : liveAfterSalesVo.getPhoneNumber().replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));
+        }
+        ExcelUtil<LiveAfterSalesVo> util = new ExcelUtil<LiveAfterSalesVo>(LiveAfterSalesVo.class);
+        return util.exportExcel(list, "销售直播退款订单数据");
     }
 
 

+ 2 - 2
fs-admin/src/main/java/com/fs/live/controller/LiveAutoTaskController.java

@@ -46,7 +46,7 @@ public class LiveAutoTaskController extends BaseController
     /**
      * 查询直播间自动化任务配置列表
      */
-//    @PreAuthorize("@ss.hasPermi('shop:task:list')")
+//    @PreAuthorize("@ss.hasPermi('live:task:list')")
     @GetMapping("/list")
     public TableDataInfo list(LiveAutoTask liveAutoTask)
     {
@@ -92,7 +92,7 @@ public class LiveAutoTaskController extends BaseController
     /**
      * 获取直播间自动化任务配置详细信息
      */
-//    @PreAuthorize("@ss.hasPermi('shop:task:query')")
+//    @PreAuthorize("@ss.hasPermi('live:task:list')")
     @GetMapping(value = "/{id}")
     public AjaxResult getInfo(@PathVariable("id") Long id)
     {

+ 12 - 0
fs-admin/src/main/java/com/fs/live/controller/LiveCouponController.java

@@ -165,6 +165,18 @@ public class LiveCouponController extends BaseController
         return getDataTable(list);
     }
 
+    /**
+     * 查询优惠券列表
+     */
+    @PreAuthorize("@ss.hasPermi('live:liveCoupon:list')")
+    @GetMapping("/listOn")
+    public TableDataInfo listOn(@RequestParam("liveId") Long liveId)
+    {
+        startPage();
+        List<LiveCoupon> list = liveCouponService.listOn(liveId);
+        return getDataTable(list);
+    }
+
 
     @PreAuthorize("@ss.hasPermi('live:liveCoupon:add')")
     @Log(title = "直播优惠券", businessType = BusinessType.INSERT)

+ 6 - 6
fs-admin/src/main/java/com/fs/live/controller/LiveCouponIssueUserController.java

@@ -36,7 +36,7 @@ public class LiveCouponIssueUserController extends BaseController
     /**
      * 查询优惠券用户领取记录列表
      */
-    @PreAuthorize("@ss.hasPermi('live:user:list')")
+    @PreAuthorize("@ss.hasPermi('live:issue:list')")
     @GetMapping("/list")
     public TableDataInfo list(LiveCouponIssueUser liveCouponIssueUser)
     {
@@ -48,7 +48,7 @@ public class LiveCouponIssueUserController extends BaseController
     /**
      * 导出优惠券用户领取记录列表
      */
-    @PreAuthorize("@ss.hasPermi('live:user:export')")
+    @PreAuthorize("@ss.hasPermi('live:issue:export')")
     @Log(title = "优惠券用户领取记录", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
     public AjaxResult export(LiveCouponIssueUser liveCouponIssueUser)
@@ -61,7 +61,7 @@ public class LiveCouponIssueUserController extends BaseController
     /**
      * 获取优惠券用户领取记录详细信息
      */
-    @PreAuthorize("@ss.hasPermi('live:user:query')")
+    @PreAuthorize("@ss.hasPermi('live:issue:query')")
     @GetMapping(value = "/{id}")
     public AjaxResult getInfo(@PathVariable("id") Long id)
     {
@@ -71,7 +71,7 @@ public class LiveCouponIssueUserController extends BaseController
     /**
      * 新增优惠券用户领取记录
      */
-    @PreAuthorize("@ss.hasPermi('live:user:add')")
+    @PreAuthorize("@ss.hasPermi('live:issue:add')")
     @Log(title = "优惠券用户领取记录", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody LiveCouponIssueUser liveCouponIssueUser)
@@ -82,7 +82,7 @@ public class LiveCouponIssueUserController extends BaseController
     /**
      * 修改优惠券用户领取记录
      */
-    @PreAuthorize("@ss.hasPermi('live:user:edit')")
+    @PreAuthorize("@ss.hasPermi('live:issue:edit')")
     @Log(title = "优惠券用户领取记录", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@RequestBody LiveCouponIssueUser liveCouponIssueUser)
@@ -93,7 +93,7 @@ public class LiveCouponIssueUserController extends BaseController
     /**
      * 删除优惠券用户领取记录
      */
-    @PreAuthorize("@ss.hasPermi('live:user:remove')")
+    @PreAuthorize("@ss.hasPermi('live:issue:remove')")
     @Log(title = "优惠券用户领取记录", businessType = BusinessType.DELETE)
 	@DeleteMapping("/{ids}")
     public AjaxResult remove(@PathVariable Long[] ids)

+ 6 - 6
fs-admin/src/main/java/com/fs/live/controller/LiveCouponUserController.java

@@ -38,7 +38,7 @@ public class LiveCouponUserController extends BaseController
     /**
      * 查询优惠券发放记录列表
      */
-    @PreAuthorize("@ss.hasPermi('live:user:list')")
+    @PreAuthorize("@ss.hasPermi('live:issue:list')")
     @GetMapping("/list")
     public TableDataInfo list(LiveCouponUser liveCouponUser)
     {
@@ -50,7 +50,7 @@ public class LiveCouponUserController extends BaseController
     /**
      * 导出优惠券发放记录列表
      */
-    @PreAuthorize("@ss.hasPermi('live:user:export')")
+    @PreAuthorize("@ss.hasPermi('live:issue:export')")
     @Log(title = "优惠券发放记录", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
     public AjaxResult export(LiveCouponUser liveCouponUser)
@@ -63,7 +63,7 @@ public class LiveCouponUserController extends BaseController
     /**
      * 获取优惠券发放记录详细信息
      */
-    @PreAuthorize("@ss.hasPermi('live:user:query')")
+    @PreAuthorize("@ss.hasPermi('live:issue:query')")
     @GetMapping(value = "/{id}")
     public AjaxResult getInfo(@PathVariable("id") Long id)
     {
@@ -73,7 +73,7 @@ public class LiveCouponUserController extends BaseController
     /**
      * 新增优惠券发放记录
      */
-    @PreAuthorize("@ss.hasPermi('live:user:add')")
+    @PreAuthorize("@ss.hasPermi('live:issue:add')")
     @Log(title = "优惠券发放记录", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody LiveCouponUser liveCouponUser)
@@ -84,7 +84,7 @@ public class LiveCouponUserController extends BaseController
     /**
      * 修改优惠券发放记录
      */
-    @PreAuthorize("@ss.hasPermi('live:user:edit')")
+    @PreAuthorize("@ss.hasPermi('live:issue:edit')")
     @Log(title = "优惠券发放记录", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@RequestBody LiveCouponUser liveCouponUser)
@@ -95,7 +95,7 @@ public class LiveCouponUserController extends BaseController
     /**
      * 删除优惠券发放记录
      */
-    @PreAuthorize("@ss.hasPermi('live:user:remove')")
+    @PreAuthorize("@ss.hasPermi('live:issue:remove')")
     @Log(title = "优惠券发放记录", businessType = BusinessType.DELETE)
 	@DeleteMapping("/{ids}")
     public AjaxResult remove(@PathVariable Long[] ids)

+ 9 - 4
fs-admin/src/main/java/com/fs/live/controller/LiveOrderPaymentController.java

@@ -10,6 +10,7 @@ import com.fs.common.utils.poi.ExcelUtil;
 import com.fs.live.domain.LiveOrderPayment;
 import com.fs.live.service.ILiveOrderPaymentService;
 import com.fs.live.vo.LiveOrderPaymentVo;
+import com.github.pagehelper.PageHelper;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
@@ -61,11 +62,15 @@ public class LiveOrderPaymentController extends BaseController
     @PreAuthorize("@ss.hasPermi('live:order:payment:export')")
     @Log(title = "支付明细", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
-    public AjaxResult export(LiveOrderPayment liveOrderPayment)
+    public AjaxResult export(LiveOrderPaymentVo liveOrderPayment)
     {
-        List<LiveOrderPayment> list = liveOrderPaymentService.selectLiveOrderPaymentList(liveOrderPayment);
-        ExcelUtil<LiveOrderPayment> util = new ExcelUtil<LiveOrderPayment>(LiveOrderPayment.class);
-        return util.exportExcel(list, "支付明细数据");
+        PageHelper.startPage(1, 10000, "");
+        List<LiveOrderPaymentVo> list = liveOrderPaymentService.selectLiveOrderPaymentVoList(liveOrderPayment);
+        for (LiveOrderPaymentVo vo : list){
+            vo.setUserPhone(vo.getUserPhone() == null ? "" : vo.getUserPhone().replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));
+        }
+        ExcelUtil<LiveOrderPaymentVo> util = new ExcelUtil<LiveOrderPaymentVo>(LiveOrderPaymentVo.class);
+        return util.exportExcel(list, "直播订单支付记录");
     }
 
     /**

+ 2 - 0
fs-common/src/main/java/com/fs/common/constant/LiveKeysConstant.java

@@ -9,6 +9,8 @@ public class LiveKeysConstant {
     public static final String TOTAL_VIEWS_KEY = "live:total:views:";  //累计观看人次
     public static final String MAX_ONLINE_USERS_KEY = "live:max:online:"; //最大在线人数
     public static final String ONLINE_USERS_KEY = "live:online:users:";  //当前在线人数
+    public static final String ONLINE_USERS_SET_KEY = "live:online:users:set:";  //在线用户Set(用于统计最大同时在线人数)
+
 
     public static final String LIVE_HOME_PAGE_LIST = "live:homePage:list"; //直播列表数据
     public static final Integer LIVE_HOME_PAGE_LIST_EXPIRE = 300; //首页缓存过期时间

+ 10 - 4
fs-company/src/main/java/com/fs/company/controller/live/LiveAfterSalesController.java

@@ -19,6 +19,7 @@ import com.fs.live.service.ILiveAfterSalesLogsService;
 import com.fs.live.service.ILiveAfterSalesService;
 import com.fs.live.service.ILiveOrderService;
 import com.fs.live.vo.LiveAfterSalesVo;
+import com.github.pagehelper.PageHelper;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
@@ -67,11 +68,16 @@ public class LiveAfterSalesController extends BaseController
     @PreAuthorize("@ss.hasPermi('live:liveAfteraSales:export')")
     @Log(title = "售后记录", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
-    public AjaxResult export(LiveAfterSales liveAfterSales)
+    public AjaxResult export(LiveAfterSalesVo liveAfterSales)
     {
-        List<LiveAfterSales> list = liveAfterSalesService.selectLiveAfterSalesList(liveAfterSales);
-        ExcelUtil<LiveAfterSales> util = new ExcelUtil<LiveAfterSales>(LiveAfterSales.class);
-        return util.exportExcel(list, "售后记录数据");
+        PageHelper.startPage(1, 10000, "");
+        List<LiveAfterSalesVo> list = liveAfterSalesService.selectLiveAfterSalesVoList(liveAfterSales);
+        for (LiveAfterSalesVo liveAfterSalesVo : list) {
+            liveAfterSalesVo.setUserPhone(liveAfterSalesVo.getUserPhone() == null ? "" : liveAfterSalesVo.getUserPhone().replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));
+            liveAfterSalesVo.setPhoneNumber(liveAfterSalesVo.getPhoneNumber() == null ? "" : liveAfterSalesVo.getPhoneNumber().replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));
+        }
+        ExcelUtil<LiveAfterSalesVo> util = new ExcelUtil<LiveAfterSalesVo>(LiveAfterSalesVo.class);
+        return util.exportExcel(list, "销售直播退款订单数据");
     }
 
     /**

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

@@ -92,7 +92,7 @@ public class LiveAutoTaskController extends BaseController
     /**
      * 获取直播间自动化任务配置详细信息
      */
-    @PreAuthorize("@ss.hasPermi('live:task:query')")
+    @PreAuthorize("@ss.hasPermi('live:task:list')")
     @GetMapping(value = "/{id}")
     public AjaxResult getInfo(@PathVariable("id") Long id)
     {

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

@@ -118,6 +118,25 @@ public class LiveController {
 
 	}
 
+	@PostMapping("/videoUpload")
+	public R videoUpload(HttpServletRequest request, @RequestBody  Map<String, Object> params) {
+		log.info("请求参数:{}", params);
+		if(!params.containsKey("WorkflowExecution")) return R.error("参数错误");
+
+		LinkedHashMap<String,Object> result = (LinkedHashMap<String,Object>) params.get("WorkflowExecution");
+		String string = result.get("Object").toString();
+		videoService.updateFinishStatus("https://fs-1319721001.cos.ap-chongqing.myqcloud.com/" + string.replace(".mp4", ".m3u8"));
+
+		return R.ok();
+//		{app=200149.push.tlivecloud.com, appid=1319721001, appname=live, channel_id=673,
+//				errcode=1, errmsg=The push client actively stopped the push, event_time=1755571239,
+//				event_type=0, height=1080, idc_id=38, node=113.250.23.118, push_duration=1051237,
+//				sequence=721865018844564968, set_id=2, stream_id=673,
+//				stream_param=txSecret=A3EF362C9484D3D091C2E9B08C2C08CB&txTime=68A53145,
+//				user_ip=113.248.98.28, width=1920}
+
+	}
+
 
 
 }

+ 21 - 1
fs-live-app/src/main/java/com/fs/live/task/Task.java

@@ -495,8 +495,28 @@ public class Task {
                             .orElse(0L)*/
                     Math.max( liveData.getUniqueViewers(), Optional.ofNullable(redisCache.incr(UNIQUE_VIEWERS_KEY + liveData.getLiveId(),0)).orElse(0L))
             );
+            // 使用Set大小来获取最大同时在线人数
+            String onlineUsersSetKey = ONLINE_USERS_SET_KEY + liveData.getLiveId();
+            Long currentSetSize = redisCache.redisTemplate.opsForSet().size(onlineUsersSetKey);
+            Long maxOnlineFromRedis = Optional.ofNullable(redisCache.getCacheObject(MAX_ONLINE_USERS_KEY + liveData.getLiveId()))
+                    .map(obj -> {
+                        if (obj instanceof Number) {
+                            return ((Number) obj).longValue();
+                        }
+                        try {
+                            return Long.parseLong(obj.toString());
+                        } catch (NumberFormatException e) {
+                            return 0L;
+                        }
+                    })
+                    .orElse(0L);
+            // 取Set大小和Redis中记录的最大在线人数的较大值
+            Long maxOnlineCount = Math.max(
+                    currentSetSize != null ? currentSetSize : 0L,
+                    maxOnlineFromRedis
+            );
             liveData.setPeakConcurrentViewers(
-                    Math.max( liveData.getPeakConcurrentViewers(), Optional.ofNullable(redisCache.incr(MAX_ONLINE_USERS_KEY + liveData.getLiveId(),0)).orElse(0L))
+                    Math.max(liveData.getPeakConcurrentViewers(), maxOnlineCount)
             );
         });
         if(!liveDatas.isEmpty())

+ 34 - 2
fs-live-app/src/main/java/com/fs/live/websocket/service/WebSocketServer.java

@@ -8,6 +8,7 @@ import com.fs.common.exception.base.BaseException;
 import com.fs.his.domain.FsUser;
 import com.fs.his.service.IFsUserService;
 import com.fs.live.config.ProductionWordFilter;
+import com.fs.live.mapper.LiveCouponMapper;
 import com.fs.live.websocket.auth.WebSocketConfigurator;
 import com.fs.live.websocket.bean.SendMsgVo;
 import com.fs.common.core.domain.R;
@@ -57,6 +58,8 @@ public class WebSocketServer {
     private final ILiveGoodsService liveGoodsService =  SpringUtils.getBean(ILiveGoodsService.class);
     private final ILiveUserFirstEntryService liveUserFirstEntryService =  SpringUtils.getBean(ILiveUserFirstEntryService.class);
     private final ILiveCouponIssueService liveCouponIssueService =  SpringUtils.getBean(ILiveCouponIssueService.class);
+    private final LiveCouponMapper liveCouponMapper = SpringUtils.getBean(LiveCouponMapper.class);
+
     // 直播间在线用户缓存
 //    private static final ConcurrentHashMap<Long, Integer> liveOnlineUsers = new ConcurrentHashMap<>();
 
@@ -103,9 +106,14 @@ public class WebSocketServer {
 
             // 记录在线人数
             redisCache.incr(ONLINE_USERS_KEY + liveId, 1);
-            Integer currentOnline = redisCache.getCacheObject(ONLINE_USERS_KEY + liveId);
-            //最大同时在线人数
+            // 将用户ID添加到在线用户Set中
+            String onlineUsersSetKey = ONLINE_USERS_SET_KEY + liveId;
+            redisCache.redisTemplate.opsForSet().add(onlineUsersSetKey, String.valueOf(userId));
+            // 获取Set的大小作为当前在线人数
+            Long currentOnlineCount = redisCache.redisTemplate.opsForSet().size(onlineUsersSetKey);
+            //最大同时在线人数 - 使用Set大小来判断
             Integer maxOnline = redisCache.getCacheObject(MAX_ONLINE_USERS_KEY + liveId);
+            int currentOnline = currentOnlineCount != null ? currentOnlineCount.intValue() : 0;
             if (maxOnline == null || currentOnline > maxOnline) {
                 redisCache.setCacheObject(MAX_ONLINE_USERS_KEY + liveId, currentOnline);
             }
@@ -197,6 +205,10 @@ public class WebSocketServer {
 
             // 直播间在线人数 -1
             redisCache.incr(ONLINE_USERS_KEY + liveId, -1);
+            // 从在线用户Set中移除用户ID
+            String onlineUsersSetKey = ONLINE_USERS_SET_KEY + liveId;
+            redisCache.redisTemplate.opsForSet().remove(onlineUsersSetKey, String.valueOf(userId));
+
             SendMsgVo sendMsgVo = new SendMsgVo();
             sendMsgVo.setLiveId(liveId);
             sendMsgVo.setUserId(userId);
@@ -597,6 +609,26 @@ public class WebSocketServer {
                 liveMsg.setCreateTime(now);
                 liveMsg.setUpdateTime(now);
                 liveMsgService.insertLiveMsg(liveMsg);
+            } else if (task.getTaskType() == 5L) {
+                msg.setCmd("coupon");
+                LiveCoupon liveCoupon = JSON.parseObject(task.getContent(), LiveCoupon.class);
+                if(liveCoupon.getStatus() != 1 ){
+                    log.error("优惠券状态已经关闭");
+                    return;
+                }
+                LiveCouponIssue liveCouponIssue = liveCouponIssueService.selectLiveCouponIssueByCouponId(liveCoupon.getCouponId());
+                LiveCouponIssueRelation relation = liveCouponMapper.selectCouponRelation(task.getLiveId(), liveCouponIssue.getId());
+                HashMap<String, Object> data = new HashMap<>();
+                data.put("liveId", task.getLiveId());
+                data.put("couponIssueId", liveCouponIssue.getId());
+                data.put("status", 1);
+                data.put("goodsId", relation.getGoodsId());
+                data.put("couponName", liveCoupon.getTitle());
+                data.put("couponPrice", liveCoupon.getCouponPrice());
+                data.put("useMinPrice", liveCoupon.getUseMinPrice());
+                data.put("couponTime", liveCoupon.getCouponTime());
+                msg.setData(JSON.toJSONString(data));
+                liveCouponMapper.updateChangeShow(task.getLiveId(), liveCouponIssue.getId());
             }
             msg.setStatus(1);
             broadcastMessage(task.getLiveId(), JSONObject.toJSONString(R.ok().put("data", msg)));

+ 31 - 0
fs-service/src/main/java/com/fs/company/mapper/CompanyMapper.java

@@ -6,6 +6,7 @@ import java.util.Set;
 
 import com.fs.company.domain.Company;
 import com.fs.company.domain.CompanyUser;
+import com.fs.company.param.CompanyLiveShowParam;
 import com.fs.company.param.CompanyParam;
 import com.fs.company.vo.CompanyCrmVO;
 import com.fs.company.vo.CompanyNameVO;
@@ -203,4 +204,34 @@ public interface CompanyMapper
      * 查询企微主体管理公司列表
      */
     List<OptionsVO> getCompanyListByCorpId(@Param("corpId") String corpId);
+
+    @Select({"<script> " +
+            "select c.*,a.api_name as voice_api_name,u.user_name " +
+            "from company c left join company_voice_api a on a.api_id=c.voice_api_id left join company_user u on u.user_id=c.user_id " +
+            "where is_del=0 " +
+            "<if test = 'maps.liveShow != null  '> " +
+            "and c.live_show = #{maps.liveShow}" +
+            "</if>" +
+            "<if test = 'maps.companyName != null and  maps.companyName !=\"\"     '> " +
+            "and c.company_name like CONCAT('%',#{maps.companyName},'%') " +
+            "</if>" +
+
+            "<if test = 'maps.status != null   '> " +
+            "and c.status = #{maps.status}" +
+            "</if>" +
+            "order by c.company_id desc " +
+            "</script>"})
+    List<CompanyVO> liveShowList(@Param("maps")CompanyParam param);
+
+    @Update({"<script> " +
+            "update company set live_show = #{maps.liveShow} where " +
+            "company_id in " +
+            "<foreach collection='maps.ids' item='ids' open='(' separator=',' close=')'>",
+            " #{ids} ",
+            "</foreach> </script>"
+    })
+    void batchUpdateLiveShow(@Param("maps") CompanyLiveShowParam param);
+
+    @Select("select company_id from company where live_show=1")
+    List<Long> selectLiveShowCompanyId();
 }

+ 15 - 0
fs-service/src/main/java/com/fs/company/param/CompanyLiveShowParam.java

@@ -0,0 +1,15 @@
+package com.fs.company.param;
+
+
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+public class CompanyLiveShowParam
+{
+
+
+    private List<Long> ids;
+    private Integer liveShow;
+}

+ 1 - 0
fs-service/src/main/java/com/fs/company/param/CompanyParam.java

@@ -15,4 +15,5 @@ public class CompanyParam
     private Integer status;
     private String phonenumber;
     private Long deptId;
+    private Integer liveShow;
 }

+ 6 - 0
fs-service/src/main/java/com/fs/company/service/ICompanyService.java

@@ -7,6 +7,7 @@ import java.util.List;
 import com.fs.common.core.domain.R;
 import com.fs.company.domain.Company;
 import com.fs.company.domain.CompanyUser;
+import com.fs.company.param.CompanyLiveShowParam;
 import com.fs.company.param.CompanyParam;
 import com.fs.company.vo.CompanyCrmVO;
 import com.fs.company.vo.CompanyNameVO;
@@ -171,4 +172,9 @@ public interface ICompanyService
     List<OptionsVO> getCompanyListByCorpId(String corpId);
 
     void subtractCompanyMoneyHourse(BigDecimal money, Long companyId, LocalTime start, LocalTime end);
+
+
+    List<CompanyVO> liveShowList(CompanyParam param);
+
+    void batchUpdateLiveShow(CompanyLiveShowParam param);
 }

+ 17 - 0
fs-service/src/main/java/com/fs/company/service/impl/CompanyServiceImpl.java

@@ -14,6 +14,7 @@ import com.fs.common.utils.SecurityUtils;
 import com.fs.common.utils.StringUtils;
 import com.fs.company.domain.*;
 import com.fs.company.mapper.*;
+import com.fs.company.param.CompanyLiveShowParam;
 import com.fs.company.param.CompanyParam;
 import com.fs.company.service.ICompanyMiniappService;
 import com.fs.company.service.ICompanyProfitService;
@@ -33,6 +34,7 @@ import com.fs.hisStore.domain.FsStoreOrderScrm;
 import com.fs.hisStore.domain.FsStorePaymentScrm;
 import com.fs.hisStore.mapper.FsStoreOrderScrmMapper;
 import com.fs.live.domain.LiveOrder;
+import com.fs.live.service.ILiveService;
 import com.fs.store.config.CompanyMenuConfig;
 import com.fs.system.domain.SysConfig;
 import com.fs.system.mapper.SysConfigMapper;
@@ -99,6 +101,21 @@ public class CompanyServiceImpl implements ICompanyService
     @Autowired
     private CompanyUserMapper companyUserMapper;
 
+    @Autowired
+    private ILiveService liveService;
+
+
+    @Override
+    public List<CompanyVO> liveShowList(CompanyParam param) {
+        return companyMapper.liveShowList(param);
+    }
+
+    @Override
+    public void batchUpdateLiveShow(CompanyLiveShowParam param) {
+        companyMapper.batchUpdateLiveShow(param);
+        liveService.asyncToCache();
+    }
+
     @Override
     public List<OptionsVO> selectAllCompanyList(Long deptId) {
         return companyMapper.selectAllCompanyList(deptId);

+ 2 - 0
fs-service/src/main/java/com/fs/company/vo/CompanyVO.java

@@ -95,4 +95,6 @@ public class CompanyVO implements Serializable
     private Integer usedNum;
     /** 所属部门id */
     private Long deptId;
+
+    private Integer liveShow;
 }

+ 1 - 1
fs-service/src/main/java/com/fs/hisStore/vo/FsStorePaymentVO.java

@@ -58,7 +58,7 @@ public class FsStorePaymentVO implements Serializable
     private Integer status;
 
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    @Excel(name = "下单金额", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
+    @Excel(name = "下单时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
     private Date createTime;
     @Excel(name = "备注")
     private String remark;

+ 2 - 0
fs-service/src/main/java/com/fs/live/domain/LiveVideo.java

@@ -41,4 +41,6 @@ public class LiveVideo extends BaseEntity {
     /** 排序号 */
     @Excel(name = "排序号")
     private Long sort;
+    @Excel(name = "转码状态")
+    private Integer finishStatus;
 }

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

@@ -75,4 +75,7 @@ public interface LiveCouponIssueMapper
 
     @Insert("insert into live_coupon_issue_relation(live_id,coupon_issue_id,is_show,goods_id) values(#{liveId},#{couponIssueId},#{isShow},#{goodsId})")
     void insertLiveCouponIssueRelation(LiveCouponIssueRelation liveCouponIssueRelation);
+
+    @Select("select * from live_coupon_issue where coupon_id= #{couponId}")
+    LiveCouponIssue selectLiveCouponIssueByCouponId(@Param("couponId") Long couponId);
 }

+ 18 - 0
fs-service/src/main/java/com/fs/live/mapper/LiveCouponMapper.java

@@ -107,4 +107,22 @@ public interface LiveCouponMapper
 
     @Select("select lci.* from live_coupon_issue lci left join live_coupon_issue_relation lcir on lci.id=lcir.coupon_issue_id where lcir.live_id = #{liveId} and lci.id = #{couponId}")
     LiveCouponIssue selectLiveCouponIssueByLiveIdAndCouponId(@Param("liveId")Long liveId,@Param("couponId") Long couponId);
+
+    @Select("select lc.*,lci.id,lcir.is_show,lcir.goods_id,fsp.product_name,fsp.image " +
+            "from live_coupon_issue_relation lcir left join live_coupon_issue lci " +
+            "left join live_coupon lc on lc.coupon_id=lci.coupon_id on lci.id = lcir.coupon_issue_id  " +
+            "left join live_goods lg on lg.goods_id = lcir.goods_id " +
+            "left join fs_store_product fsp on lg.product_id = fsp.product_id " +
+            "where lcir.live_id = #{liveId} and lcir.goods_id is not null")
+    List<LiveCoupon> listOn(@Param("liveId") Long liveId);
+
+    @Update("update live_coupon_issue_relation set is_show = case WHEN coupon_issue_id = #{couponId} THEN 1 else 0 end where live_id = #{liveId}")
+    void updateChangeShow(@Param("liveId")Long liveId,@Param("couponId") Long couponId);
+
+    @Select("select * from live_coupon_issue_relation where live_id = #{liveId} and coupon_issue_id = #{couponId}")
+    LiveCouponIssueRelation selectCouponRelation(@Param("liveId")Long liveId,@Param("couponId") Long couponId);
+
+    @Select("select * from live_coupon_issue_relation where live_id = #{liveId}")
+    List<LiveCouponIssueRelation> selectCouponRelationByLiveId(@Param("liveId") Long liveId);
+
 }

+ 6 - 0
fs-service/src/main/java/com/fs/live/mapper/LiveMapper.java

@@ -138,4 +138,10 @@ public interface LiveMapper
 
     @Select("select count(1) from live where company_id = #{companyId} and live_type IN (1,2, 3) AND status IN (3, 4) AND is_del = 0 and is_audit=1")
     int listLiveDataCount(@Param("companyId") Long companyId);
+
+
+    List<Live> liveShowList(@Param("companyIds") List<Long> companyIds);
+
+    List<Live> selectLiveShowReadyStartLiveList(@Param("companyIds") List<Long> companyIds);
+
 }

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

@@ -4,6 +4,7 @@ package com.fs.live.mapper;
 import com.fs.live.domain.LiveVideo;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Select;
+import org.apache.ibatis.annotations.Update;
 
 import java.util.List;
 
@@ -89,4 +90,8 @@ public interface LiveVideoMapper
 
     @Select("select * from live_video")
     List<LiveVideo> selectByAll();
+
+
+    @Update("update live_video set finish_status = 1 where video_url = #{fileName}")
+    void updateFinishStatus(@Param("fileName") String fileName);
 }

+ 2 - 0
fs-service/src/main/java/com/fs/live/service/ILiveCouponIssueService.java

@@ -63,4 +63,6 @@ public interface ILiveCouponIssueService
     List<LiveCouponIssue> selectLiveCouponIssueUserByCouponPO(CouponPO coupon);
 
     List<LiveCouponIssue> curCoupon(CouponPO coupon);
+
+    LiveCouponIssue selectLiveCouponIssueByCouponId(Long id);
 }

+ 2 - 0
fs-service/src/main/java/com/fs/live/service/ILiveCouponService.java

@@ -86,4 +86,6 @@ public interface ILiveCouponService
     R userCouponList(CouponPO coupon);
 
     R curCoupon(CouponPO coupon);
+
+    List<LiveCoupon> listOn(Long liveId);
 }

+ 2 - 0
fs-service/src/main/java/com/fs/live/service/ILiveVideoService.java

@@ -84,4 +84,6 @@ public interface ILiveVideoService
     List<LiveVideo> selectLiveVideosByLiveId(Long existLiveId);
 
     LiveVideo selectLiveVideoByLiveIdAndType(Long id, int i);
+
+    void updateFinishStatus(String string);
 }

+ 31 - 4
fs-service/src/main/java/com/fs/live/service/impl/LiveAutoTaskServiceImpl.java

@@ -8,15 +8,13 @@ import java.util.Collections;
 import java.util.Date;
 import java.util.List;
 
+import cn.hutool.core.util.ObjectUtil;
 import com.alibaba.fastjson.JSON;
 
 import com.fs.common.core.domain.R;
 import com.fs.common.core.redis.RedisCache;
 import com.fs.common.utils.DateUtils;
-import com.fs.live.domain.Live;
-import com.fs.live.domain.LiveAutoTask;
-import com.fs.live.domain.LiveLotteryConf;
-import com.fs.live.domain.LiveRedConf;
+import com.fs.live.domain.*;
 import com.fs.live.mapper.*;
 import com.fs.live.param.LiveLotteryProduct;
 import com.fs.live.service.ILiveAutoTaskService;
@@ -52,6 +50,11 @@ public class LiveAutoTaskServiceImpl implements ILiveAutoTaskService {
     @Autowired
     private LiveLotteryProductConfMapper lotteryProductConfMapper;
 
+    @Autowired
+    private LiveCouponMapper liveCouponMapper;
+    @Autowired
+    private LiveCouponIssueMapper liveCouponIssueMapper;
+
     /**
      * 查询直播间自动化任务配置
      *
@@ -136,6 +139,18 @@ public class LiveAutoTaskServiceImpl implements ILiveAutoTaskService {
             }
             liveAutoTask.setContent(JSON.toJSONString(liveLotteryConf));
             baseMapper.insertLiveAutoTask(liveAutoTask);
+        } else if (liveAutoTask.getTaskType() == 5L) {
+            // 自动优惠券
+            LiveCoupon liveCoupon = liveCouponMapper.selectLiveCouponById(Long.valueOf(liveAutoTask.getContent()));
+            if(liveCoupon == null) return R.error("优惠券不存在");
+            LiveCouponIssue liveCouponIssue = liveCouponIssueMapper.selectLiveCouponIssueByCouponId(liveCoupon.getCouponId());
+            if(liveCouponIssue == null)return R.error("优惠券未发布");
+            LiveCouponIssueRelation liveCouponIssueRelation = liveCouponMapper.selectCouponRelation(liveAutoTask.getLiveId(),liveCouponIssue.getId());
+            if(liveCouponIssueRelation == null) return R.error("优惠券尚未添加在直播间");
+            if(ObjectUtil.isEmpty(liveCouponIssueRelation.getGoodsId())) return R.error("未绑定商品,无法制定自动化任务!");
+            liveCoupon.setGoodsId(liveCouponIssueRelation.getGoodsId());
+            liveAutoTask.setContent(JSON.toJSONString(liveCoupon));
+            baseMapper.insertLiveAutoTask(liveAutoTask);
         } else if(liveAutoTask.getTaskType() == 3L){
             baseMapper.insertLiveAutoTask(liveAutoTask);
 
@@ -240,6 +255,18 @@ public class LiveAutoTaskServiceImpl implements ILiveAutoTaskService {
             return baseMapper.updateLiveAutoTask(liveAutoTask);
         } else if(liveAutoTask.getTaskType() == 3L){
             return baseMapper.updateLiveAutoTask(liveAutoTask);
+        } else if( liveAutoTask.getTaskType() == 5L){
+            // 自动优惠券
+            LiveCoupon liveCoupon = liveCouponMapper.selectLiveCouponById(Long.valueOf(liveAutoTask.getContent()));
+            if(liveCoupon == null) return -1;
+            LiveCouponIssue liveCouponIssue = liveCouponIssueMapper.selectLiveCouponIssueByCouponId(liveCoupon.getCouponId());
+            if(liveCouponIssue == null)return -1;
+            LiveCouponIssueRelation liveCouponIssueRelation = liveCouponMapper.selectCouponRelation(liveAutoTask.getLiveId(),liveCouponIssue.getId());
+            if(liveCouponIssueRelation == null) return -1;
+            if(ObjectUtil.isEmpty(liveCouponIssueRelation.getGoodsId())) return -1;
+            liveCoupon.setGoodsId(liveCouponIssueRelation.getGoodsId());
+            liveAutoTask.setContent(JSON.toJSONString(liveCoupon));
+            return baseMapper.updateLiveAutoTask(liveAutoTask);
         } else {
             return -1;
         }

+ 5 - 0
fs-service/src/main/java/com/fs/live/service/impl/LiveCouponIssueServiceImpl.java

@@ -105,4 +105,9 @@ public class LiveCouponIssueServiceImpl implements ILiveCouponIssueService
     public List<LiveCouponIssue> curCoupon(CouponPO coupon) {
         return liveCouponIssueMapper.curCoupon(coupon);
     }
+
+    @Override
+    public LiveCouponIssue selectLiveCouponIssueByCouponId(Long couponId) {
+        return liveCouponIssueMapper.selectLiveCouponIssueByCouponId(couponId);
+    }
 }

+ 6 - 0
fs-service/src/main/java/com/fs/live/service/impl/LiveCouponServiceImpl.java

@@ -259,5 +259,11 @@ public class LiveCouponServiceImpl implements ILiveCouponService
         return R.ok().put("data", list);
     }
 
+    @Override
+    public List<LiveCoupon> listOn(Long liveId) {
+        return liveCouponMapper.listOn(liveId);
+    }
+
+
 
 }

+ 9 - 2
fs-service/src/main/java/com/fs/live/service/impl/LiveServiceImpl.java

@@ -6,6 +6,7 @@ import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 
 import com.fs.common.exception.base.BaseException;
+import com.fs.company.mapper.CompanyMapper;
 import com.fs.his.domain.FsStoreProduct;
 import com.fs.his.domain.FsUser;
 import com.fs.his.mapper.FsUserMapper;
@@ -95,6 +96,11 @@ public class LiveServiceImpl implements ILiveService
     private LiveCouponIssueMapper liveCouponIssueMapper;
     @Autowired
     private FsUserMapper fsUserMapper;
+    @Autowired
+    private CompanyMapper companyMapper;
+    @Autowired
+    private LiveCouponMapper liveCouponMapper;
+
 
 
     /**
@@ -424,10 +430,11 @@ public class LiveServiceImpl implements ILiveService
 
     @Override
     public List<Live> liveList() {
-        List<Live> livesList = baseMapper.liveList();
+        List<Long> companyIds = companyMapper.selectLiveShowCompanyId();
+        List<Live> livesList = baseMapper.liveShowList(companyIds);
         try {
             // 查询准备开播的直播间
-            livesList.addAll(baseMapper.selectReadyStartLiveList());
+            livesList.addAll(baseMapper.selectLiveShowReadyStartLiveList(companyIds));
         }catch (Exception e){
             log.error("查询准备开播的直播间异常", e);
         }

+ 1 - 0
fs-service/src/main/java/com/fs/live/service/impl/LiveVideoServiceImpl.java

@@ -77,6 +77,7 @@ public class LiveVideoServiceImpl implements ILiveVideoService
     public int insertLiveVideo(LiveVideo liveVideo)
     {
         // 直播ID为-1,则新增 直播视频库
+        liveVideo.setFinishStatus(0);
         if (liveVideo.getLiveId() == -1) {
             liveVideo.setCreateTime(DateUtils.getNowDate());
             return liveVideoMapper.insertLiveVideo(liveVideo);

+ 48 - 28
fs-service/src/main/java/com/fs/live/vo/LiveAfterSalesVo.java

@@ -20,15 +20,25 @@ public class LiveAfterSalesVo {
     private Long id;
 
     /** 直播ID */
-    @Excel(name = "直播ID")
     private Long liveId;
 
     /** 店铺ID */
-    @Excel(name = "店铺ID")
+//    @Excel(name = "店铺ID")
     private Long storeId;
 
+    @Excel(name = "公司名称")
+    private String companyName;
+    @Excel(name = "销售名称")
+    private String companyUserNickName;
+
+    @Excel(name = "订单单号")
+    private String orderCode;
+
+    @Excel(name = "会员手机号")
+    private String userPhone;
+
     /** 订单ID */
-    @Excel(name = "订单ID")
+//    @Excel(name = "订单ID")
     private Long orderId;
 
     /** 退款金额 */
@@ -36,7 +46,7 @@ public class LiveAfterSalesVo {
     private BigDecimal refundAmount;
 
     /** 服务类型0仅退款1退货退款 */
-    @Excel(name = "服务类型0仅退款1退货退款")
+    @Excel(name = "服务类型",readConverterExp = "0=仅退款,1=退货退款")
     private Integer refundType;
 
     /** 申请原因 */
@@ -48,40 +58,57 @@ public class LiveAfterSalesVo {
     private String explains;
 
     /** 说明图片-&gt;多个用逗号分割 */
-    @Excel(name = "说明图片-&gt;多个用逗号分割")
+    @Excel(name = "说明图片;多个用逗号分割")
     private String explainImg;
 
-    /** 物流公司编码 */
-    @Excel(name = "物流公司编码")
-    private String deliveryCode;
+
+    /** 售后状态 0售后中 1用户取消2商家拒绝 3已完成 */
+    @Excel(name = "售后状态", dictType = "store_after_sales_sales_status")
+    private Integer salesStatus;
+
+    /** 订单状态 */
+    @Excel(name = "订单状态",dictType = "store_order_status")
+    private Integer orderStatus;
+
+    /**
+     * 物流状态
+     */
+    @Excel(name = "物流状态",dictType = "store_order_delivery_status")
+    private String deliveryStatus;
+
 
     /** 物流单号 */
     @Excel(name = "物流单号")
     private String deliverySn;
 
+
+
+    /** 物流公司编码 */
+    @Excel(name = "物流公司编码")
+    private String deliveryCode;
+
+
     /** 物流名称 */
     @Excel(name = "物流名称")
     private String deliveryName;
 
+
+
     /** 状态 0已提交等待平台审核 1平台已审核 等待用户发货 2 用户已发货待仓库审核 3财务审核 4退款成功 */
-    @Excel(name = "状态 0已提交等待平台审核 1平台已审核 等待用户发货 2 用户已发货待仓库审核 3财务审核 4退款成功")
+    @Excel(name = "状态",dictType = "store_after_sales_status")
     private Integer status;
 
-    /** 售后状态 0售后中 1用户取消2商家拒绝 3已完成 */
-    @Excel(name = "售后状态 0售后中 1用户取消2商家拒绝 3已完成")
-    private Integer salesStatus;
 
-    /** 订单状态 */
-    @Excel(name = "订单状态")
-    private Integer orderStatus;
+
+
 
     /** 逻辑删除 */
-    @Excel(name = "逻辑删除")
     private Integer isDel;
 
     /** 用户id */
     @Excel(name = "用户id")
     private Long userId;
+    //    @Excel(name = "用户名称")
     private String userName;
 
     /** 商家收货人 */
@@ -97,30 +124,23 @@ public class LiveAfterSalesVo {
     private String address;
 
     /** $column.columnComment */
-    @Excel(name = "商家地址")
+//    @Excel(name = "公司ID")
     private Long companyId;
 
     /** $column.columnComment */
-    @Excel(name = "商家地址")
+//    @Excel(name = "销售ID")
     private Long companyUserId;
 
     /** 部门id */
-    @Excel(name = "部门id")
+//    @Excel(name = "部门id")
     private Long deptId;
 
     /** 创建时间 */
-    @Excel(name = "创建时间")
+    @Excel(name = "下单时间",dateFormat = "yyyy-MM-dd HH:mm:ss")
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     private Date createTime;
-    private String companyName;
-    private String companyUserNickName;
-    private String orderCode;
-    private String userPhone;
 
-    /**
-     * 物流状态
-     */
-    private String deliveryStatus;
+
 
     /**
      * 物流单号

+ 69 - 43
fs-service/src/main/java/com/fs/live/vo/LiveOrderPaymentVo.java

@@ -23,9 +23,21 @@ public class LiveOrderPaymentVo extends BaseEntity{
     private Long paymentId;
 
     /** 支付订单号 */
-    @Excel(name = "支付订单号")
+    @Excel(name = "付款单号")
     private String payCode;
 
+    //    @Excel(name = "付款单号")
+    private Integer orderCode;
+
+    /** 外部订单号 */
+    @Excel(name = "外部订单号")
+    private String tradeNo;
+
+
+
+    @Excel(name = "会员手机号")
+    private String userPhone;
+
     /** 支付类型 weixin alipay */
     @Excel(name = "支付类型 weixin alipay")
     private String payTypeCode;
@@ -34,93 +46,107 @@ public class LiveOrderPaymentVo extends BaseEntity{
     @Excel(name = "支付金额")
     private BigDecimal payMoney;
 
+    /** 退款金额 */
+    @Excel(name = "退款金额")
+    private BigDecimal refundMoney;
+
+    /** 交易单号 */
+    @Excel(name = "交易单号")
+    private String bankTransactionId;
+
+    /** 银行流水号 */
+    @Excel(name = "银行单号")
+    private String bankSerialNo;
+
+
+    @Excel(name = "所属公司")
+    private String companyName;
+
+    @Excel(name = "所属部门")
+    private String deptName;
+
+    @Excel(name = "员工")
+    private String companyUserNickName;
+
+    /** 状态 0未支付 1已支付 -1 已退款 */
+    @Excel(name = "状态",readConverterExp = "0=未支付,1=已支付,-1=已退款")
+    private Integer status;
+
+    /** 支付方式: zb tz wx */
+    @Excel(name = "支付方式",dictType = "sys_pay_mode")
+    private String payMode;
+
+
+
+
+
     /** 支付时间 */
     @JsonFormat(pattern = "yyyy-MM-dd")
-    @Excel(name = "支付时间", width = 30, dateFormat = "yyyy-MM-dd")
+    @Excel(name = "支付时间", width = 30, dateFormat = "yyyy-MM-dd  HH:mm:ss")
     private Date payTime;
 
-    /** 外部订单号 */
-    @Excel(name = "外部订单号")
-    private String tradeNo;
+
+    /** 退款时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "退款时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
+    private Date refundTime;
+
+
 
     /** 用户ID */
-    @Excel(name = "用户ID")
+//    @Excel(name = "用户ID")
     private Long userId;
 
     /** OPENID */
-    @Excel(name = "OPENID")
+//    @Excel(name = "OPENID")
     private String openId;
 
     /** 业务类型  */
-    @Excel(name = "业务类型 ")
+//    @Excel(name = "业务类型 ")
     private Integer businessType;
 
     /** 关联业务ID */
-    @Excel(name = "关联业务ID")
+//    @Excel(name = "关联业务ID")
     private String businessId;
 
-    /** 状态 0未支付 1已支付 -1 已退款 */
-    @Excel(name = "状态 0未支付 1已支付 -1 已退款")
-    private Integer status;
 
-    /** 交易单号 */
-    @Excel(name = "交易单号")
-    private String bankTransactionId;
 
-    /** 银行流水号 */
-    @Excel(name = "银行流水号")
-    private String bankSerialNo;
-
-    /** 退款金额 */
-    @Excel(name = "退款金额")
-    private BigDecimal refundMoney;
-
-    /** 退款时间 */
-    @JsonFormat(pattern = "yyyy-MM-dd")
-    @Excel(name = "退款时间", width = 30, dateFormat = "yyyy-MM-dd")
-    private Date refundTime;
 
     /** 店铺ID */
-    @Excel(name = "店铺ID")
+//    @Excel(name = "店铺ID")
     private Long storeId;
 
     /** 公司id */
-    @Excel(name = "公司id")
+//    @Excel(name = "公司id")
     private Long companyId;
 
     /** 员工id */
-    @Excel(name = "员工id")
+//    @Excel(name = "员工id")
     private Long companyUserId;
 
     /** 关联业务编号 */
-    @Excel(name = "关联业务编号")
+//    @Excel(name = "关联业务编号")
     private String businessCode;
 
-    /** 支付方式: zb tz wx */
-    @Excel(name = "支付方式: zb tz wx")
-    private String payMode;
+
 
     /** 分账状态 0未分账 1已分账 */
-    @Excel(name = "分账状态 0未分账 1已分账")
+//    @Excel(name = "分账状态 0未分账 1已分账",readConverterExp = "0=未分账,1=已分账")
     private Integer shareStatus;
 
     /** 分账单号 */
-    @Excel(name = "分账单号")
+//    @Excel(name = "分账单号")
     private String shareCode;
 
     /** 分账金额 */
-    @Excel(name = "分账金额")
+//    @Excel(name = "分账金额")
     private BigDecimal shareMoney;
 
     /** 是否分账 */
-    @Excel(name = "是否分账")
+//    @Excel(name = "是否分账")
     private Integer isShare;
 
-    private Integer orderCode;
-    private String userPhone;
-    private String companyName;
-    private String deptName;
-    private String companyUserNickName;
+
 
 
 }

+ 44 - 0
fs-service/src/main/resources/mapper/live/LiveMapper.xml

@@ -304,5 +304,49 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </foreach>
     </update>
 
+    <select id="liveShowList"  resultMap="LiveResult">
+        select a.live_id, a.company_id, a.company_user_id,talent_id, a.live_name, a.is_audit, a.live_desc, a.show_type, a.status, a.anchor_id,
+        a.live_type, a.start_time, a.finish_time, a.live_img_url, a.live_config, a.id_card_url, a.is_show, a.is_del, a.qw_qr_code, a.rtmp_url,
+        a.flv_hls_url, a.create_time, a.create_by, a.update_by, a.update_time, a.remark,config_json, b.video_url,c.company_name,b.file_size
+        from live
+        a
+        left join live_video b on a.live_id = b.live_id
+        left join company c on a.company_id = c.company_id
+        where 1=1 and a.is_del = 0 and a.is_audit = 1 and a.is_show = 1 and a.status in (2,4) and b.video_type in (1,2)
+        and (
+        <if test="companyIds != null and companyIds.size() > 0">
+            a.company_id in
+            <foreach collection="companyIds" item="id" open="(" separator="," close=")">
+                #{id}
+            </foreach>
+            or
+        </if>
+        a.company_id is null)
+        order by create_time desc
+    </select>
+
+    <select id="selectLiveShowReadyStartLiveList"  resultMap="LiveResult">
+        select a.live_id, a.company_id, a.company_user_id,talent_id, a.live_name, a.is_audit, a.live_desc, a.show_type, a.status, a.anchor_id,
+        a.live_type, a.start_time, a.finish_time, a.live_img_url, a.live_config, a.id_card_url, a.is_show, a.is_del, a.qw_qr_code, a.rtmp_url,
+        a.flv_hls_url, a.create_time, a.create_by, a.update_by, a.update_time, a.remark,config_json, b.video_url,c.company_name,b.file_size
+        from live
+        a
+        left join live_video b on a.live_id = b.live_id
+        left join company c on a.company_id = c.company_id
+        where 1=1 and a.is_del = 0 and a.is_audit = 1 and a.is_show = 1 and a.status in (1) and b.video_type in (1,2)
+        and a.start_time &lt;= NOW() + INTERVAL 5 MINUTE
+        and a.start_time >= NOW()
+        and (
+        <if test="companyIds != null and companyIds.size() > 0">
+            a.company_id in
+            <foreach collection="companyIds" item="id" open="(" separator="," close=")">
+                #{id}
+            </foreach>
+            or
+        </if>
+        a.company_id is null)
+        order by create_time desc
+    </select>
+
 
 </mapper>

+ 8 - 3
fs-service/src/main/resources/mapper/live/LiveVideoMapper.xml

@@ -17,10 +17,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="duration"    column="duration"    />
         <result property="remark"    column="remark"    />
         <result property="fileSize"    column="file_size"    />
+        <result property="finishStatus"    column="finish_status"    />
     </resultMap>
 
     <sql id="selectLiveVideoVo">
-        select video_id, live_id, video_url, video_type, sort, create_time, create_by, update_by, update_time, remark,duration,file_size from live_video
+        select video_id, live_id, video_url, video_type, sort, create_time, create_by, update_by, update_time, remark,duration,file_size,finish_status from live_video
     </sql>
 
     <select id="selectLiveVideoList" parameterType="LiveVideo" resultMap="LiveVideoResult">
@@ -31,6 +32,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="videoType != null "> and video_type = #{videoType}</if>
             <if test="sort != null "> and sort = #{sort}</if>
             <if test="remark != null "> and remark like CONCAT('%',#{remark},'%')</if>
+            <if test="finishStatus != null "> and finish_status  = #{finishStatus}</if>
         </where>
     </select>
 
@@ -57,7 +59,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="remark != null">remark,</if>
             <if test="duration != null">duration,</if>
             <if test="fileSize != null">file_size,</if>
-         </trim>
+            <if test="finishStatus != null">finish_status,</if>
+        </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="liveId != null">#{liveId},</if>
             <if test="videoUrl != null">#{videoUrl},</if>
@@ -70,7 +73,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="remark != null">#{remark},</if>
             <if test="duration != null">#{duration},</if>
             <if test="fileSize != null">#{fileSize},</if>
-         </trim>
+            <if test="finishStatus != null">#{finishStatus},</if>
+        </trim>
     </insert>
 
     <update id="updateLiveVideo" parameterType="LiveVideo">
@@ -87,6 +91,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updateTime != null">update_time = #{updateTime},</if>
             <if test="remark != null">remark = #{remark},</if>
             <if test="fileSize != null">file_size = #{fileSize},</if>
+            <if test="finishStatus != null">finish_status = #{finishStatus},</if>
         </trim>
         where video_id = #{videoId}
     </update>