|
@@ -2,10 +2,9 @@ package com.fs.company.controller.live;
|
|
|
|
|
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
|
|
|
-import com.fs.common.core.domain.R;
|
|
|
|
|
-import com.fs.common.utils.ServletUtils;
|
|
|
|
|
|
|
+import com.fs.company.domain.CompanyUser;
|
|
|
import com.fs.framework.security.LoginUser;
|
|
import com.fs.framework.security.LoginUser;
|
|
|
-import com.fs.framework.service.TokenService;
|
|
|
|
|
|
|
+import com.fs.framework.security.SecurityUtils;
|
|
|
import com.fs.live.vo.LiveWatchLogListVO;
|
|
import com.fs.live.vo.LiveWatchLogListVO;
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -38,39 +37,47 @@ public class LiveWatchLogController extends BaseController
|
|
|
{
|
|
{
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private ILiveWatchLogService liveWatchLogService;
|
|
private ILiveWatchLogService liveWatchLogService;
|
|
|
- @Autowired
|
|
|
|
|
- private TokenService tokenService;
|
|
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
- * 查询直播看课记录列表
|
|
|
|
|
|
|
+ * 查询直播看课记录列表(仅当前销售)
|
|
|
*/
|
|
*/
|
|
|
@PreAuthorize("@ss.hasPermi('live:liveWatchLog:list')")
|
|
@PreAuthorize("@ss.hasPermi('live:liveWatchLog:list')")
|
|
|
@GetMapping("/list")
|
|
@GetMapping("/list")
|
|
|
public TableDataInfo list(LiveWatchLog liveWatchLog)
|
|
public TableDataInfo list(LiveWatchLog liveWatchLog)
|
|
|
{
|
|
{
|
|
|
|
|
+ applyCurrentSalesScope(liveWatchLog);
|
|
|
startPage();
|
|
startPage();
|
|
|
- LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
|
|
- if(null == loginUser) {
|
|
|
|
|
- throw new RuntimeException("用户信息错误");
|
|
|
|
|
- }
|
|
|
|
|
- Long companyId = loginUser.getCompany().getCompanyId();
|
|
|
|
|
- liveWatchLog.setCompanyId(companyId);
|
|
|
|
|
List<LiveWatchLogListVO> list = liveWatchLogService.selectLiveWatchLogListInfo(liveWatchLog);
|
|
List<LiveWatchLogListVO> list = liveWatchLogService.selectLiveWatchLogListInfo(liveWatchLog);
|
|
|
return getDataTable(list);
|
|
return getDataTable(list);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * 导出直播看课记录列表
|
|
|
|
|
|
|
+ * 导出直播看课记录列表(仅当前销售)
|
|
|
*/
|
|
*/
|
|
|
@PreAuthorize("@ss.hasPermi('live:liveWatchLog:export')")
|
|
@PreAuthorize("@ss.hasPermi('live:liveWatchLog:export')")
|
|
|
@Log(title = "直播看课记录", businessType = BusinessType.EXPORT)
|
|
@Log(title = "直播看课记录", businessType = BusinessType.EXPORT)
|
|
|
@GetMapping("/export")
|
|
@GetMapping("/export")
|
|
|
public AjaxResult export(LiveWatchLog liveWatchLog)
|
|
public AjaxResult export(LiveWatchLog liveWatchLog)
|
|
|
{
|
|
{
|
|
|
- List<LiveWatchLog> list = liveWatchLogService.selectLiveWatchLogList(liveWatchLog);
|
|
|
|
|
- ExcelUtil<LiveWatchLog> util = new ExcelUtil<LiveWatchLog>(LiveWatchLog.class);
|
|
|
|
|
|
|
+ applyCurrentSalesScope(liveWatchLog);
|
|
|
|
|
+ List<LiveWatchLogListVO> list = liveWatchLogService.selectLiveWatchLogListInfo(liveWatchLog);
|
|
|
|
|
+ ExcelUtil<LiveWatchLogListVO> util = new ExcelUtil<LiveWatchLogListVO>(LiveWatchLogListVO.class);
|
|
|
return util.exportExcel(list, "直播看课记录数据");
|
|
return util.exportExcel(list, "直播看课记录数据");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 公司端仅展示当前登录销售数据
|
|
|
|
|
+ */
|
|
|
|
|
+ private void applyCurrentSalesScope(LiveWatchLog liveWatchLog) {
|
|
|
|
|
+ LoginUser loginUser = SecurityUtils.getLoginUser();
|
|
|
|
|
+ if (loginUser == null || loginUser.getUser() == null || loginUser.getCompany() == null) {
|
|
|
|
|
+ throw new RuntimeException("用户信息错误");
|
|
|
|
|
+ }
|
|
|
|
|
+ CompanyUser user = loginUser.getUser();
|
|
|
|
|
+ liveWatchLog.setCompanyId(loginUser.getCompany().getCompanyId());
|
|
|
|
|
+ liveWatchLog.setCompanyUserId(user.getUserId());
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 获取直播看课记录详细信息
|
|
* 获取直播看课记录详细信息
|
|
|
*/
|
|
*/
|