Browse Source

Merge remote-tracking branch 'origin/master'

zyp 6 days ago
parent
commit
5b170fea54
51 changed files with 1058 additions and 33 deletions
  1. 1 1
      fs-admin/src/main/java/com/fs/company/controller/CompanyController.java
  2. 148 0
      fs-admin/src/main/java/com/fs/company/controller/CompanyDeductController.java
  3. 143 0
      fs-admin/src/main/java/com/fs/company/controller/CompanyRechargeController.java
  4. 16 1
      fs-admin/src/main/java/com/fs/course/controller/FsCourseProductOrderController.java
  5. 8 1
      fs-admin/src/main/java/com/fs/course/controller/FsCourseQuestionBankController.java
  6. 1 1
      fs-admin/src/main/java/com/fs/course/controller/FsCourseRedPacketLogController.java
  7. 30 2
      fs-admin/src/main/java/com/fs/course/controller/FsUserCourseController.java
  8. 14 1
      fs-admin/src/main/java/com/fs/course/controller/FsUserCourseTrainingCampController.java
  9. 15 0
      fs-admin/src/main/java/com/fs/course/controller/FsUserCourseVideoController.java
  10. 18 1
      fs-admin/src/main/java/com/fs/course/controller/FsVideoResourceController.java
  11. 1 1
      fs-admin/src/main/java/com/fs/qw/controller/QwSopController.java
  12. 130 0
      fs-company/src/main/java/com/fs/company/controller/course/FsCourseTrafficLogController.java
  13. 1 1
      fs-company/src/main/java/com/fs/company/controller/course/FsUserCourseController.java
  14. 153 0
      fs-company/src/main/java/com/fs/company/controller/course/FsUserWatchCourseStatisticsController.java
  15. 106 0
      fs-company/src/main/java/com/fs/company/controller/course/FsUserWatchStatisticsController.java
  16. 16 0
      fs-company/src/main/java/com/fs/company/controller/qw/QwSopLogsController.java
  17. 1 0
      fs-company/src/main/java/com/fs/user/FsUserAdminController.java
  18. 2 0
      fs-service/src/main/java/com/fs/course/domain/FsCourseQuestionBank.java
  19. 2 0
      fs-service/src/main/java/com/fs/course/domain/FsUserCourse.java
  20. 2 0
      fs-service/src/main/java/com/fs/course/domain/FsUserCourseTrainingCamp.java
  21. 2 0
      fs-service/src/main/java/com/fs/course/domain/FsVideoResource.java
  22. 2 0
      fs-service/src/main/java/com/fs/course/mapper/FsCourseTrafficLogMapper.java
  23. 7 3
      fs-service/src/main/java/com/fs/course/mapper/FsUserCourseMapper.java
  24. 6 0
      fs-service/src/main/java/com/fs/course/mapper/FsUserCourseVideoMapper.java
  25. 2 0
      fs-service/src/main/java/com/fs/course/param/FsCourseAnswerLogsParam.java
  26. 24 2
      fs-service/src/main/java/com/fs/course/param/FsCourseTrafficLogParam.java
  27. 17 0
      fs-service/src/main/java/com/fs/course/param/InternetTrafficParam.java
  28. 1 1
      fs-service/src/main/java/com/fs/course/service/IFsCourseQuestionBankService.java
  29. 2 0
      fs-service/src/main/java/com/fs/course/service/IFsCourseTrafficLogService.java
  30. 2 2
      fs-service/src/main/java/com/fs/course/service/IFsUserCourseService.java
  31. 1 2
      fs-service/src/main/java/com/fs/course/service/IFsUserCourseTrainingCampService.java
  32. 3 1
      fs-service/src/main/java/com/fs/course/service/IFsUserCourseVideoService.java
  33. 7 0
      fs-service/src/main/java/com/fs/course/service/impl/FsCourseProductOrderServiceImpl.java
  34. 2 1
      fs-service/src/main/java/com/fs/course/service/impl/FsCourseQuestionBankServiceImpl.java
  35. 44 0
      fs-service/src/main/java/com/fs/course/service/impl/FsCourseTrafficLogServiceImpl.java
  36. 5 3
      fs-service/src/main/java/com/fs/course/service/impl/FsUserCourseServiceImpl.java
  37. 2 1
      fs-service/src/main/java/com/fs/course/service/impl/FsUserCourseTrainingCampServiceImpl.java
  38. 17 2
      fs-service/src/main/java/com/fs/course/service/impl/FsUserCourseVideoServiceImpl.java
  39. 5 0
      fs-service/src/main/java/com/fs/course/vo/FsCourseTrafficLogListVO.java
  40. 4 0
      fs-service/src/main/java/com/fs/course/vo/FsUserCoursePeriodVO.java
  41. 2 2
      fs-service/src/main/java/com/fs/his/service/impl/FsUserServiceImpl.java
  42. 4 0
      fs-service/src/main/java/com/fs/his/vo/FsUserVO.java
  43. 9 0
      fs-service/src/main/java/com/fs/qw/param/GenerateShortLinkParam.java
  44. 3 0
      fs-service/src/main/resources/application-druid-fby.yml
  45. 7 2
      fs-service/src/main/resources/mapper/course/FsCourseQuestionBankMapper.xml
  46. 34 0
      fs-service/src/main/resources/mapper/course/FsCourseTrafficLogMapper.xml
  47. 11 0
      fs-service/src/main/resources/mapper/course/FsUserCourseMapper.xml
  48. 10 1
      fs-service/src/main/resources/mapper/course/FsUserCoursePeriodMapper.xml
  49. 3 0
      fs-service/src/main/resources/mapper/course/FsUserCourseTrainingCampMapper.xml
  50. 9 0
      fs-service/src/main/resources/mapper/course/FsUserCourseVideoMapper.xml
  51. 3 0
      fs-service/src/main/resources/mapper/course/FsVideoResourceMapper.xml

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

@@ -174,7 +174,7 @@ public class CompanyController extends BaseController
     public AjaxResult resetPwd(@PathVariable Long companyId)
     {
         Company company=companyService.selectCompanyById(companyId);
-        return toAjax(userService.resetUserPwdByUserId(company.getUserId(),SecurityUtils.encryptPassword("123456")));
+        return toAjax(userService.resetUserPwdByUserId(company.getUserId(),SecurityUtils.encryptPassword("cq654321!!")));
     }
 
 //    @PreAuthorize("@ss.hasPermi('company:company:resetMoney')")

+ 148 - 0
fs-admin/src/main/java/com/fs/company/controller/CompanyDeductController.java

@@ -0,0 +1,148 @@
+package com.fs.company.controller;
+
+import com.fs.common.annotation.Log;
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.AjaxResult;
+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.ServletUtils;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.company.domain.Company;
+import com.fs.company.domain.CompanyDeduct;
+import com.fs.company.domain.CompanyMoneyLogs;
+import com.fs.company.service.ICompanyDeductService;
+import com.fs.company.service.ICompanyMoneyLogsService;
+import com.fs.company.service.ICompanyService;
+import com.fs.company.vo.CompanyDeductExportVO;
+import com.fs.company.vo.CompanyDeductVO;
+import com.fs.framework.web.service.TokenService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.bind.annotation.*;
+
+import java.math.BigDecimal;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 扣款Controller
+ *
+ * @author fs
+ * @date 2023-02-27
+ */
+@RestController
+@RequestMapping("/company/companyDeduct")
+public class CompanyDeductController extends BaseController
+{
+    @Autowired
+    private ICompanyDeductService companyDeductService;
+    @Autowired
+    private TokenService tokenService;
+    @Autowired
+    private ICompanyService companyService;
+    @Autowired
+    private ICompanyMoneyLogsService moneyLogsService;
+    /**
+     * 查询扣款列表
+     */
+    @PreAuthorize("@ss.hasPermi('company:companyDeduct:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(CompanyDeduct companyDeduct)
+    {
+        startPage();
+        List<CompanyDeductVO> list = companyDeductService.selectCompanyDeductVOList(companyDeduct);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出扣款列表
+     */
+    @PreAuthorize("@ss.hasPermi('company:companyDeduct:export')")
+    @Log(title = "扣款", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(CompanyDeduct companyDeduct)
+    {
+        List<CompanyDeductExportVO> list = companyDeductService.selectCompanyExportDeductList(companyDeduct);
+        ExcelUtil<CompanyDeductExportVO> util = new ExcelUtil<CompanyDeductExportVO>(CompanyDeductExportVO.class);
+        return util.exportExcel(list, "companyDeduct");
+    }
+
+    /**
+     * 获取扣款详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('company:companyDeduct:query')")
+    @GetMapping(value = "/{deductId}")
+    public AjaxResult getInfo(@PathVariable("deductId") Long deductId)
+    {
+        return AjaxResult.success(companyDeductService.selectCompanyDeductById(deductId));
+    }
+
+    /**
+     * 新增扣款
+     */
+    @PreAuthorize("@ss.hasPermi('company:companyDeduct:add')")
+    @Log(title = "扣款", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody CompanyDeduct companyDeduct)
+    {
+        return toAjax(companyDeductService.insertCompanyDeduct(companyDeduct));
+    }
+
+    /**
+     * 修改扣款
+     */
+    @PreAuthorize("@ss.hasPermi('company:companyDeduct:edit')")
+    @Log(title = "扣款", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody CompanyDeduct companyDeduct)
+    {
+        return toAjax(companyDeductService.updateCompanyDeduct(companyDeduct));
+    }
+
+    /**
+     * 删除扣款
+     */
+    @PreAuthorize("@ss.hasPermi('company:companyDeduct:remove')")
+    @Log(title = "扣款", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{deductIds}")
+    public AjaxResult remove(@PathVariable Long[] deductIds)
+    {
+        return toAjax(companyDeductService.deleteCompanyDeductByIds(deductIds));
+    }
+
+
+    @PreAuthorize("@ss.hasPermi('company:companyDeduct:audit')")
+    @PostMapping("/audit")
+    @Transactional
+    public R audit(@RequestBody CompanyDeduct param)
+    {
+        CompanyDeduct deduct=companyDeductService.selectCompanyDeductById(param.getDeductId());
+        if(deduct.getIsAudit()!=0){
+            return R.error("非法操作");
+        }
+        deduct.setIsAudit(param.getIsAudit());
+        deduct.setRemark(param.getRemark());
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        if(deduct.getIsAudit()==1){
+            Company company=companyService.selectCompanyByIdForUpdate(deduct.getCompanyId());
+            company.setMoney(company.getMoney().subtract(deduct.getMoney()));
+            companyService.updateCompany(company);
+            CompanyMoneyLogs log=new CompanyMoneyLogs();
+            log.setCompanyId(deduct.getCompanyId());
+            log.setMoney(deduct.getMoney().multiply(new BigDecimal(-1)));
+            log.setRemark(deduct.getRemark());
+            log.setLogsType(2);
+            log.setBalance(company.getMoney());
+            log.setCreateTime(new Date());
+            moneyLogsService.insertCompanyMoneyLogs(log);
+        }
+        deduct.setAuditTime(new Date());
+        deduct.setAuditUserId(loginUser.getUser().getUserId());
+        companyDeductService.updateCompanyDeduct(deduct);
+        return R.ok("操作成功");
+
+    }
+}

+ 143 - 0
fs-admin/src/main/java/com/fs/company/controller/CompanyRechargeController.java

@@ -0,0 +1,143 @@
+package com.fs.company.controller;
+
+import com.fs.common.annotation.Log;
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.AjaxResult;
+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.ServletUtils;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.company.domain.Company;
+import com.fs.company.domain.CompanyMoneyLogs;
+import com.fs.company.domain.CompanyRecharge;
+import com.fs.company.service.ICompanyMoneyLogsService;
+import com.fs.company.service.ICompanyRechargeService;
+import com.fs.company.service.ICompanyService;
+import com.fs.company.vo.CompanyRechargeExportVO;
+import com.fs.company.vo.CompanyRechargeVO;
+import com.fs.framework.web.service.TokenService;
+import lombok.Synchronized;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 充值Controller
+ *
+ * @author fs
+ * @date 2021-10-04
+ */
+@RestController
+@RequestMapping("/company/companyRecharge")
+public class CompanyRechargeController extends BaseController
+{
+    @Autowired
+    private TokenService tokenService;
+    @Autowired
+    private ICompanyRechargeService companyRechargeService;
+    @Autowired
+    private ICompanyService companyService;
+    @Autowired
+    private ICompanyMoneyLogsService moneyLogsService;
+    /**
+     * 查询充值列表
+     */
+    @PreAuthorize("@ss.hasPermi('company:companyRecharge:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(CompanyRecharge companyRecharge)
+    {
+        startPage();
+        List<CompanyRechargeVO> list = companyRechargeService.selectCompanyRechargeVOList(companyRecharge);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出充值列表
+     */
+    @PreAuthorize("@ss.hasPermi('company:companyRecharge:export')")
+    @Log(title = "充值", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(CompanyRecharge companyRecharge)
+    {
+        List<CompanyRechargeExportVO> list = companyRechargeService.selectCompanyRechargeExportList(companyRecharge);
+        ExcelUtil<CompanyRechargeExportVO> util = new ExcelUtil<CompanyRechargeExportVO>(CompanyRechargeExportVO.class);
+        return util.exportExcel(list, "公司充值明细");
+    }
+
+    /**
+     * 获取充值详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('company:companyRecharge:query')")
+    @GetMapping(value = "/{rechargeId}")
+    public AjaxResult getInfo(@PathVariable("rechargeId") Long rechargeId)
+    {
+        return AjaxResult.success(companyRechargeService.selectCompanyRechargeById(rechargeId));
+    }
+
+    /**
+     * 新增充值
+     */
+    @PreAuthorize("@ss.hasPermi('company:companyRecharge:add')")
+    @Log(title = "充值", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody CompanyRecharge companyRecharge)
+    {
+        return toAjax(companyRechargeService.insertCompanyRecharge(companyRecharge));
+    }
+
+
+
+    /**
+     * 删除充值
+     */
+    @PreAuthorize("@ss.hasPermi('company:companyRecharge:remove')")
+    @Log(title = "充值", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{rechargeIds}")
+    public AjaxResult remove(@PathVariable Long[] rechargeIds)
+    {
+        return toAjax(companyRechargeService.deleteCompanyRechargeByIds(rechargeIds));
+    }
+
+
+
+    @PreAuthorize("@ss.hasPermi('company:companyRecharge:audit')")
+    @PostMapping("/audit")
+    @Transactional
+    @Synchronized
+    public R audit(@RequestBody CompanyRecharge param)
+    {
+        CompanyRecharge companyRecharge=companyRechargeService.selectCompanyRechargeById(param.getRechargeId());
+        if(companyRecharge.getIsAudit()!=0){
+            return R.error("非法操作");
+        }
+        companyRecharge.setIsAudit(param.getIsAudit());
+        companyRecharge.setRemark(param.getRemark());
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        if(companyRecharge.getIsAudit()==1){
+            Company company=companyService.selectCompanyById(companyRecharge.getCompanyId());
+            company.setMoney(company.getMoney().add(companyRecharge.getMoney()));
+            companyService.updateCompany(company);
+            CompanyMoneyLogs log=new CompanyMoneyLogs();
+            log.setCompanyId(companyRecharge.getCompanyId());
+            log.setMoney(companyRecharge.getMoney());
+            log.setRemark(companyRecharge.getRemark());
+            log.setLogsType(1);
+            log.setBalance(company.getMoney());
+            log.setCreateTime(new Date());
+            moneyLogsService.insertCompanyMoneyLogs(log);
+            companyRecharge.setPayTime(new Date());
+            companyRecharge.setStatus(1);
+        }
+        companyRecharge.setAuditTime(new Date());
+        companyRecharge.setAuditUserId(loginUser.getUser().getUserId());
+        companyRechargeService.updateCompanyRecharge(companyRecharge);
+        return R.ok("操作成功");
+
+    }
+}

+ 16 - 1
fs-admin/src/main/java/com/fs/course/controller/FsCourseProductOrderController.java

@@ -7,7 +7,6 @@ import com.fs.common.core.domain.R;
 import com.fs.course.param.FsCourseProductOrderListParam;
 import com.fs.course.vo.FsCourseProductOrderVO;
 import com.fs.his.param.FsCourseProductOrderRefundParam;
-import com.fs.his.param.FsInquiryOrderRefundParam;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -30,6 +29,8 @@ import com.fs.course.service.IFsCourseProductOrderService;
 import com.fs.common.utils.poi.ExcelUtil;
 import com.fs.common.core.page.TableDataInfo;
 
+import static com.fs.his.utils.PhoneUtil.decryptPhone;
+
 /**
  * 拍单商品订单Controller
  * 
@@ -121,4 +122,18 @@ public class FsCourseProductOrderController extends BaseController
         logger.info("退款拍商品订单:"+param.getCourseOrderId()+":操作人:总后台:"+ getLoginUser().getUsername());
         return fsCourseProductOrderService.refund(param);
     }
+
+    @GetMapping(value = "/queryPhone/{courseOrderId}")
+    @Log(title = "查看电话", businessType = BusinessType.GRANT)
+    @PreAuthorize("@ss.hasPermi('course:fsCourseProductOrder:queryPhone')")
+    public R getPhone(@PathVariable("courseOrderId") Long courseOrderId)
+    {
+        FsCourseProductOrder courseProductOrder = fsCourseProductOrderService.selectFsCourseProductOrderByCourseOrderId(courseOrderId);
+        String userPhone = courseProductOrder.getUserPhone();
+
+        if (userPhone!=null&&userPhone.length()>11){
+            userPhone=decryptPhone(userPhone);
+        }
+        return R.ok().put("userPhone",userPhone);
+    }
 }

+ 8 - 1
fs-admin/src/main/java/com/fs/course/controller/FsCourseQuestionBankController.java

@@ -43,6 +43,9 @@ public class FsCourseQuestionBankController extends BaseController
     public TableDataInfo list(FsCourseQuestionBank fsCourseQuestionBank)
     {
         startPage();
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        Long userId = loginUser.getUser().getUserId();
+        fsCourseQuestionBank.setUserId(userId);
         List<FsCourseQuestionBank> list = fsCourseQuestionBankService.selectFsCourseQuestionBankList(fsCourseQuestionBank);
         return getDataTable(list);
     }
@@ -55,6 +58,9 @@ public class FsCourseQuestionBankController extends BaseController
     @GetMapping("/export")
     public AjaxResult export(FsCourseQuestionBank fsCourseQuestionBank)
     {
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        Long userId = loginUser.getUser().getUserId();
+        fsCourseQuestionBank.setUserId(userId);
         List<FsCourseQuestionBankImportDTO> list = fsCourseQuestionBankService.exportData(fsCourseQuestionBank);
         ExcelUtil<FsCourseQuestionBankImportDTO> util = new ExcelUtil<>(FsCourseQuestionBankImportDTO.class);
         return util.exportExcel(list, "题库数据");
@@ -81,6 +87,7 @@ public class FsCourseQuestionBankController extends BaseController
     {
         LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
         fsCourseQuestionBank.setCreateBy(loginUser.getUser().getNickName());
+        fsCourseQuestionBank.setUserId(loginUser.getUser().getUserId());
         return toAjax(fsCourseQuestionBankService.insertFsCourseQuestionBank(fsCourseQuestionBank));
     }
 
@@ -121,7 +128,7 @@ public class FsCourseQuestionBankController extends BaseController
         List<FsCourseQuestionBankImportDTO> list = util.importExcel(file.getInputStream());
 
         LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
-        String message = fsCourseQuestionBankService.importData(list, loginUser.getUser().getNickName());
+        String message = fsCourseQuestionBankService.importData(list, loginUser.getUser().getNickName(), loginUser.getUser().getUserId());
         return AjaxResult.success(message);
     }
 

+ 1 - 1
fs-admin/src/main/java/com/fs/course/controller/FsCourseRedPacketLogController.java

@@ -135,7 +135,7 @@ public class FsCourseRedPacketLogController extends BaseController
     @GetMapping("/courseList")
     public R courseList()
     {
-        List<OptionsVO> optionsVOS = fsUserCourseMapper.selectFsUserCourseAllList();
+        List<OptionsVO> optionsVOS = fsUserCourseMapper.selectFsUserCourseAllList(null);
         return R.ok().put("list", optionsVOS);
     }
 

+ 30 - 2
fs-admin/src/main/java/com/fs/course/controller/FsUserCourseController.java

@@ -3,7 +3,10 @@ package com.fs.course.controller;
 import java.util.List;
 
 import com.fs.common.core.domain.R;
+import com.fs.common.core.domain.model.LoginUser;
+import com.fs.common.utils.ServletUtils;
 import com.fs.course.vo.FsUserCourseListPVO;
+import com.fs.framework.web.service.TokenService;
 import com.fs.his.utils.RedisCacheUtil;
 import com.fs.his.vo.OptionsVO;
 import org.springframework.security.access.prepost.PreAuthorize;
@@ -40,6 +43,10 @@ public class FsUserCourseController extends BaseController
 
     @Autowired
     private RedisCacheUtil redisCacheUtil;
+
+    @Autowired
+    private TokenService tokenService;
+
     /**
      * 查询课程列表
      */
@@ -48,6 +55,9 @@ public class FsUserCourseController extends BaseController
     public TableDataInfo list(FsUserCourse fsUserCourse)
     {
         startPage();
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        Long userId = loginUser.getUser().getUserId();
+        fsUserCourse.setUserId(userId);
         List<FsUserCourseListPVO> list = fsUserCourseService.selectFsUserCourseListPVO(fsUserCourse);
         return getDataTable(list);
     }
@@ -60,6 +70,9 @@ public class FsUserCourseController extends BaseController
     public TableDataInfo publicList(FsUserCourse fsUserCourse)
     {
         startPage();
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        Long userId = loginUser.getUser().getUserId();
+        fsUserCourse.setUserId(userId);
         List<FsUserCourseListPVO> list = fsUserCourseService.selectFsUserCourseListPVO(fsUserCourse);
         return getDataTable(list);
     }
@@ -72,6 +85,9 @@ public class FsUserCourseController extends BaseController
     @GetMapping("/export")
     public AjaxResult export(FsUserCourse fsUserCourse)
     {
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        Long userId = loginUser.getUser().getUserId();
+        fsUserCourse.setUserId(userId);
         List<FsUserCourse> list = fsUserCourseService.selectFsUserCourseList(fsUserCourse);
         ExcelUtil<FsUserCourse> util = new ExcelUtil<FsUserCourse>(FsUserCourse.class);
         return util.exportExcel(list, "课程数据");
@@ -85,6 +101,9 @@ public class FsUserCourseController extends BaseController
     @GetMapping("/publicExport")
     public AjaxResult publicExport(FsUserCourse fsUserCourse)
     {
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        Long userId = loginUser.getUser().getUserId();
+        fsUserCourse.setUserId(userId);
         List<FsUserCourse> list = fsUserCourseService.selectFsUserCourseList(fsUserCourse);
         ExcelUtil<FsUserCourse> util = new ExcelUtil<FsUserCourse>(FsUserCourse.class);
         return util.exportExcel(list, "课程数据");
@@ -118,6 +137,9 @@ public class FsUserCourseController extends BaseController
     @PostMapping
     public AjaxResult add(@RequestBody FsUserCourse fsUserCourse)
     {
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        Long userId = loginUser.getUser().getUserId();
+        fsUserCourse.setUserId(userId);
         fsUserCourseService.insertFsUserCourse(fsUserCourse);
         redisCacheUtil.delRedisKey("getCourseList");
 
@@ -132,6 +154,9 @@ public class FsUserCourseController extends BaseController
     @PostMapping("/public")
     public AjaxResult publicAdd(@RequestBody FsUserCourse fsUserCourse)
     {
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        Long userId = loginUser.getUser().getUserId();
+        fsUserCourse.setUserId(userId);
         fsUserCourseService.insertFsUserCourse(fsUserCourse);
         redisCacheUtil.delRedisKey("getCourseList");
 
@@ -172,7 +197,9 @@ public class FsUserCourseController extends BaseController
     @GetMapping("/copy/{courseId}")
     public AjaxResult copy(@PathVariable Long courseId)
     {
-        int i = fsUserCourseService.copyFsUserCourse(courseId);
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        Long userId = loginUser.getUser().getUserId();
+        int i = fsUserCourseService.copyFsUserCourse(courseId, userId);
         return toAjax(i);
     }
 
@@ -205,7 +232,8 @@ public class FsUserCourseController extends BaseController
     @GetMapping("/getAllList")
     public R getAllList()
     {
-        List<OptionsVO> list = fsUserCourseService.selectFsUserCourseAllList();
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        List<OptionsVO> list = fsUserCourseService.selectFsUserCourseAllList(loginUser.getUser().getUserId());
         return R.ok().put("data", list);
     }
 

+ 14 - 1
fs-admin/src/main/java/com/fs/course/controller/FsUserCourseTrainingCampController.java

@@ -3,17 +3,23 @@ package com.fs.course.controller;
 import com.fs.common.annotation.Log;
 import com.fs.common.core.domain.AjaxResult;
 import com.fs.common.core.domain.R;
+import com.fs.common.core.domain.model.LoginUser;
 import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.ServletUtils;
 import com.fs.common.utils.SortUtils;
 import com.fs.course.domain.FsUserCourseTrainingCamp;
 import com.fs.course.dto.FsUserCourseTrainingCampDTO;
 import com.fs.course.dto.FsUserCourseTrainingCampUpdateDTO;
 import com.fs.course.service.IFsUserCourseTrainingCampService;
 import com.fs.course.vo.FsUserCourseTrainingCampVO;
+import com.fs.framework.web.service.TokenService;
 import com.fs.his.vo.OptionsVO;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import lombok.AllArgsConstructor;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 
@@ -28,8 +34,12 @@ import java.util.Objects;
 @AllArgsConstructor
 public class FsUserCourseTrainingCampController {
 
+    private static final Logger log = LoggerFactory.getLogger(FsUserCourseTrainingCampController.class);
     private final IFsUserCourseTrainingCampService fsUserCourseTrainingCampService;
 
+    @Autowired
+    private TokenService tokenService;
+
     /**
      * 查询训练营列表
      */
@@ -60,7 +70,10 @@ public class FsUserCourseTrainingCampController {
     @Log(title = "训练营", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@Valid @RequestBody FsUserCourseTrainingCampDTO params) {
-        fsUserCourseTrainingCampService.add(params);
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        Long userId = loginUser.getUser().getUserId();
+
+        fsUserCourseTrainingCampService.add(params, userId);
         return AjaxResult.success();
     }
 

+ 15 - 0
fs-admin/src/main/java/com/fs/course/controller/FsUserCourseVideoController.java

@@ -4,8 +4,10 @@ import com.fs.common.annotation.Log;
 import com.fs.common.core.controller.BaseController;
 import com.fs.common.core.domain.AjaxResult;
 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.ServletUtils;
 import com.fs.common.utils.poi.ExcelUtil;
 import com.fs.course.domain.FsUserCourse;
 import com.fs.course.domain.FsUserCourseVideo;
@@ -15,6 +17,7 @@ import com.fs.course.param.BatchVideoSvae;
 import com.fs.course.param.CourseVideoUpdates;
 import com.fs.course.service.IFsUserCourseService;
 import com.fs.course.service.IFsUserCourseVideoService;
+import com.fs.framework.web.service.TokenService;
 import com.fs.his.vo.OptionsVO;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
@@ -44,6 +47,9 @@ public class FsUserCourseVideoController extends BaseController
     @Autowired
     private IFsUserCourseService fsUserCourseService;
 
+    @Autowired
+    private TokenService tokenService;
+
     /**
      * 查询课堂视频列表
      */
@@ -64,6 +70,9 @@ public class FsUserCourseVideoController extends BaseController
     @GetMapping("/export")
     public AjaxResult export(FsUserCourseVideo fsUserCourseVideo)
     {
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        Long userId = loginUser.getUser().getUserId();
+        fsUserCourseVideo.setUserId(userId);
         List<FsUserCourseVideo> list = fsUserCourseVideoService.selectFsUserCourseVideoList(fsUserCourseVideo);
         ExcelUtil<FsUserCourseVideo> util = new ExcelUtil<FsUserCourseVideo>(FsUserCourseVideo.class);
         return util.exportExcel(list, "课堂视频数据");
@@ -91,6 +100,9 @@ public class FsUserCourseVideoController extends BaseController
         if (count>0){
             return AjaxResult.error("课程排序重复");
         }
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        Long userId = loginUser.getUser().getUserId();
+        fsUserCourseVideo.setUserId(userId);
 
         // 设置项目ID
         FsUserCourse fsUserCourse = fsUserCourseService.selectFsUserCourseByCourseId(fsUserCourseVideo.getCourseId());
@@ -125,6 +137,9 @@ public class FsUserCourseVideoController extends BaseController
     public TableDataInfo getVideoListByCourseId(FsUserCourseVideo fsUserCourseVideo)
     {
         startPage();
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        Long userId = loginUser.getUser().getUserId();
+        fsUserCourseVideo.setUserId(userId);
         List<FsUserCourseVideo> list = fsUserCourseVideoService.selectFsUserCourseVideoListByCourseId(fsUserCourseVideo);
         return getDataTable(list);
     }

+ 18 - 1
fs-admin/src/main/java/com/fs/course/controller/FsVideoResourceController.java

@@ -5,13 +5,17 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.fs.common.annotation.Log;
 import com.fs.common.core.controller.BaseController;
 import com.fs.common.core.domain.AjaxResult;
+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.ServletUtils;
 import com.fs.course.domain.FsVideoResource;
 import com.fs.course.service.IFsVideoResourceService;
 import com.fs.course.vo.FsVideoResourceVO;
+import com.fs.framework.web.service.TokenService;
 import com.github.pagehelper.PageHelper;
 import lombok.AllArgsConstructor;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 
@@ -29,6 +33,9 @@ public class FsVideoResourceController extends BaseController {
 
     private final IFsVideoResourceService fsVideoResourceService;
 
+    @Autowired
+    private TokenService tokenService;
+
     /**
      * 查询视频素材库列表
      */
@@ -46,6 +53,8 @@ public class FsVideoResourceController extends BaseController {
         params.put("fileName", fileName);
         params.put("typeId", typeId);
         params.put("typeSubId", typeSubId);
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        params.put("userId", loginUser.getUser().getUserId());
 
         PageHelper.startPage(pageNum, pageSize);
         List<FsVideoResourceVO> list = fsVideoResourceService.selectVideoResourceListByMap(params);
@@ -71,6 +80,9 @@ public class FsVideoResourceController extends BaseController {
     @PostMapping
     public AjaxResult add(@RequestBody FsVideoResource fsVideoResource)
     {
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        Long userId = loginUser.getUser().getUserId();
+        fsVideoResource.setUserId(userId);
         fsVideoResource.setCreateTime(LocalDateTime.now());
         fsVideoResourceService.save(fsVideoResource);
         return AjaxResult.success();
@@ -144,10 +156,15 @@ public class FsVideoResourceController extends BaseController {
     @Log(title = "视频素材库", businessType = BusinessType.INSERT)
     @PostMapping("/batchAddVideoResource")
     public AjaxResult batchAddVideoResource(@RequestBody List<FsVideoResource> list) {
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        Long userId = loginUser.getUser().getUserId();
         if (Objects.isNull(list) || list.isEmpty()) {
             return AjaxResult.error("数据不能为空");
         }
-        list.forEach(v -> v.setCreateTime(LocalDateTime.now()));
+        list.forEach(v -> {
+            v.setCreateTime(LocalDateTime.now());
+            v.setUserId(userId);
+        });
         fsVideoResourceService.saveBatch(list);
         return AjaxResult.success();
     }

+ 1 - 1
fs-admin/src/main/java/com/fs/qw/controller/QwSopController.java

@@ -77,7 +77,7 @@ public class QwSopController extends BaseController
     @GetMapping("/courseList")
     public R courseList()
     {
-        List<OptionsVO> optionsVOS = fsUserCourseMapper.selectFsUserCourseAllList();
+        List<OptionsVO> optionsVOS = fsUserCourseMapper.selectFsUserCourseAllList(null);
         return R.ok().put("list", optionsVOS);
     }
 

+ 130 - 0
fs-company/src/main/java/com/fs/company/controller/course/FsCourseTrafficLogController.java

@@ -0,0 +1,130 @@
+package com.fs.company.controller.course;
+
+import com.fs.common.annotation.Log;
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.core.domain.R;
+import com.fs.common.core.page.TableDataInfo;
+import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.course.domain.FsCourseTrafficLog;
+import com.fs.course.param.FsCourseTrafficLogParam;
+import com.fs.course.service.IFsCourseTrafficLogService;
+import com.fs.course.service.IFsUserCourseService;
+import com.fs.course.vo.FsCourseTrafficLogListVO;
+import com.fs.framework.service.TokenService;
+import com.fs.his.vo.OptionsVO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.time.LocalDateTime;
+import java.time.YearMonth;
+import java.time.format.DateTimeFormatter;
+import java.util.List;
+
+
+/**
+ * 短链课程流量记录Controller
+ *
+ * @author fs
+ * @date 2024-10-31
+ */
+@RestController
+@RequestMapping("/course/courseTrafficLog")
+public class FsCourseTrafficLogController extends BaseController
+{
+    @Autowired
+    private IFsCourseTrafficLogService fsCourseTrafficLogService;
+
+    @Autowired
+    private IFsUserCourseService fsUserCourseMapper;
+    @Autowired
+    private TokenService tokenService;
+
+    /**
+     * 查询短链课程流量记录列表
+     */
+    @PreAuthorize("@ss.hasPermi('course:courseTrafficLog:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(FsCourseTrafficLogParam param)
+    {
+        startPage();
+        List<FsCourseTrafficLogListVO> list = fsCourseTrafficLogService.selectTrafficNew(param);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出短链课程流量记录列表
+     */
+    @PreAuthorize("@ss.hasPermi('course:courseTrafficLog:export')")
+    @Log(title = "短链课程流量记录", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(FsCourseTrafficLogParam param)
+    {
+        if (param.getTime() != null) {
+            YearMonth yearMonth = param.getTime();
+            LocalDateTime startOfMonth = yearMonth.atDay(1).atStartOfDay();
+
+            LocalDateTime startOfNextMonth = yearMonth.plusMonths(1).atDay(1).atStartOfDay()
+                    .minusDays(1).withHour(23).withMinute(59).withSecond(59);
+            DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+
+            param.setStartDate(startOfMonth.format(formatter));
+            param.setEndDate(startOfNextMonth.format(formatter));
+        }
+        List<FsCourseTrafficLogListVO> list = fsCourseTrafficLogService.selectTrafficByCompany(param);
+        ExcelUtil<FsCourseTrafficLogListVO> util = new ExcelUtil<FsCourseTrafficLogListVO>(FsCourseTrafficLogListVO.class);
+        return util.exportExcel(list, "短链课程流量记录数据");
+    }
+
+    /**
+     * 获取短链课程流量记录详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('course:courseTrafficLog:query')")
+    @GetMapping(value = "/{logId}")
+    public AjaxResult getInfo(@PathVariable("logId") Long logId)
+    {
+        return AjaxResult.success(fsCourseTrafficLogService.selectFsCourseTrafficLogByLogId(logId));
+    }
+
+    /**
+     * 新增短链课程流量记录
+     */
+    @PreAuthorize("@ss.hasPermi('course:courseTrafficLog:add')")
+    @Log(title = "短链课程流量记录", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody FsCourseTrafficLog fsCourseTrafficLog)
+    {
+        return toAjax(fsCourseTrafficLogService.insertFsCourseTrafficLog(fsCourseTrafficLog));
+    }
+
+    /**
+     * 修改短链课程流量记录
+     */
+    @PreAuthorize("@ss.hasPermi('course:courseTrafficLog:edit')")
+    @Log(title = "短链课程流量记录", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody FsCourseTrafficLog fsCourseTrafficLog)
+    {
+        return toAjax(fsCourseTrafficLogService.updateFsCourseTrafficLog(fsCourseTrafficLog));
+    }
+
+    /**
+     * 删除短链课程流量记录
+     */
+    @PreAuthorize("@ss.hasPermi('course:courseTrafficLog:remove')")
+    @Log(title = "短链课程流量记录", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{logIds}")
+    public AjaxResult remove(@PathVariable Long[] logIds)
+    {
+        return toAjax(fsCourseTrafficLogService.deleteFsCourseTrafficLogByLogIds(logIds));
+    }
+
+    @GetMapping("/courseList")
+    public R courseList()
+    {
+        List<OptionsVO> optionsVOS = fsUserCourseMapper.selectFsUserCourseAllList(null);
+        return R.ok().put("list", optionsVOS);
+    }
+}

+ 1 - 1
fs-company/src/main/java/com/fs/company/controller/course/FsUserCourseController.java

@@ -78,7 +78,7 @@ public class FsUserCourseController extends BaseController
     @GetMapping("/getAllList")
     public R getAllList()
     {
-        List<OptionsVO> list = fsUserCourseService.selectFsUserCourseAllList();
+        List<OptionsVO> list = fsUserCourseService.selectFsUserCourseAllList(null);
         return R.ok().put("data", list);
     }
 

+ 153 - 0
fs-company/src/main/java/com/fs/company/controller/course/FsUserWatchCourseStatisticsController.java

@@ -0,0 +1,153 @@
+package com.fs.company.controller.course;
+
+import com.fs.common.annotation.Log;
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.core.page.TableDataInfo;
+import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.ServletUtils;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.course.domain.FsUserWatchCourseStatistics;
+import com.fs.course.service.IFsUserWatchCourseStatisticsService;
+import com.fs.course.vo.FsUserWatchCourseStatisticsExportVO;
+import com.fs.framework.security.LoginUser;
+import com.fs.framework.service.TokenService;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * 会员看课统计-按课程统计Controller
+ *
+ * @author fs
+ * @date 2025-06-16
+ */
+@RestController
+@RequestMapping("/course/userWatchCourseStatistics")
+public class FsUserWatchCourseStatisticsController extends BaseController
+{
+    @Autowired
+    private IFsUserWatchCourseStatisticsService fsUserWatchCourseStatisticsService;
+    @Autowired
+    private TokenService tokenService;
+    /**
+     * 查询会员看课统计-按课程统计列表
+     */
+    @PreAuthorize("@ss.hasPermi('course:userWatchCourseStatistics:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(FsUserWatchCourseStatistics fsUserWatchCourseStatistics)
+    {
+        startPage();
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        fsUserWatchCourseStatistics.setCompanyId( loginUser.getCompany().getCompanyId());
+        List<FsUserWatchCourseStatistics> list = fsUserWatchCourseStatisticsService.selectFsUserWatchCourseStatisticsList(fsUserWatchCourseStatistics);
+        return getDataTable(list);
+    }
+
+    @PreAuthorize("@ss.hasPermi('course:userWatchCourseStatistics:export')")
+    @Log(title = "会员看课统计-按课程统计", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(FsUserWatchCourseStatistics fsUserWatchCourseStatistics)
+    {
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        fsUserWatchCourseStatistics.setCompanyId( loginUser.getCompany().getCompanyId());
+        List<FsUserWatchCourseStatistics> list = fsUserWatchCourseStatisticsService.selectFsUserWatchCourseStatisticsList(fsUserWatchCourseStatistics);
+        ExcelUtil<FsUserWatchCourseStatistics> util = new ExcelUtil<FsUserWatchCourseStatistics>(FsUserWatchCourseStatistics.class);
+        return util.exportExcel(list, "会员观看数据明细");
+    }
+
+    /**
+     * 查询会员观看数据明细汇总
+     */
+    @PreAuthorize("@ss.hasPermi('course:userWatchCourseStatistics:listTotal')")
+    @GetMapping("/listTotal")
+    public TableDataInfo listTotal(FsUserWatchCourseStatistics fsUserWatchCourseStatistics)
+    {
+        startPage();
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        fsUserWatchCourseStatistics.setCompanyId( loginUser.getCompany().getCompanyId());
+        List<FsUserWatchCourseStatistics> list = fsUserWatchCourseStatisticsService.selectFsUserWatchCourseStatisticsListTotal(fsUserWatchCourseStatistics);
+        if(!list.isEmpty()){
+            for (FsUserWatchCourseStatistics userWatchCourseStatistics : list) {
+                userWatchCourseStatistics.setCompleteWatchRatePercent(userWatchCourseStatistics.getCompleteWatchRate() + "%");
+                userWatchCourseStatistics.setOnlineRatePercent(userWatchCourseStatistics.getOnlineRate() + "%");
+            }
+        }
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出会员看课统计-按课程汇总统计列表
+     */
+    @Log(title = "会员看课统计-按课程汇总统计", businessType = BusinessType.EXPORT)
+    @GetMapping("/exportTotal")
+    public AjaxResult exportTotal(FsUserWatchCourseStatistics fsUserWatchCourseStatistics)
+    {
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        fsUserWatchCourseStatistics.setCompanyId( loginUser.getCompany().getCompanyId());
+        List<FsUserWatchCourseStatistics> list = fsUserWatchCourseStatisticsService.selectFsUserWatchCourseStatisticsListTotal(fsUserWatchCourseStatistics);
+        List<FsUserWatchCourseStatisticsExportVO> listVO = list.stream().map(v -> {
+            FsUserWatchCourseStatisticsExportVO vo = new FsUserWatchCourseStatisticsExportVO();
+            BeanUtils.copyProperties(v, vo);
+            vo.setCompleteWatchRatePercent(v.getCompleteWatchRate() + "%");
+            vo.setOnlineRatePercent(v.getOnlineRate() + "%");
+            return vo;
+        }).collect(Collectors.toList());
+        ExcelUtil<FsUserWatchCourseStatisticsExportVO> util = new ExcelUtil<FsUserWatchCourseStatisticsExportVO>(FsUserWatchCourseStatisticsExportVO.class);
+        return util.exportExcel(listVO, "会员观看数据明细汇总");
+    }
+    /**
+     * 获取会员看课统计-按课程统计详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('course:userWatchCourseStatistics:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return AjaxResult.success(fsUserWatchCourseStatisticsService.selectFsUserWatchCourseStatisticsById(id));
+    }
+
+    /**
+     * 新增会员看课统计-按课程统计
+     */
+    @PreAuthorize("@ss.hasPermi('course:userWatchCourseStatistics:add')")
+    @Log(title = "会员看课统计-按课程统计", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody FsUserWatchCourseStatistics fsUserWatchCourseStatistics)
+    {
+        return toAjax(fsUserWatchCourseStatisticsService.insertFsUserWatchCourseStatistics(fsUserWatchCourseStatistics));
+    }
+
+    /**
+     * 修改会员看课统计-按课程统计
+     */
+    @PreAuthorize("@ss.hasPermi('course:userWatchCourseStatistics:edit')")
+    @Log(title = "会员看课统计-按课程统计", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody FsUserWatchCourseStatistics fsUserWatchCourseStatistics)
+    {
+        return toAjax(fsUserWatchCourseStatisticsService.updateFsUserWatchCourseStatistics(fsUserWatchCourseStatistics));
+    }
+
+    /**
+     * 删除会员看课统计-按课程统计
+     */
+    @PreAuthorize("@ss.hasPermi('course:userWatchCourseStatistics:remove')")
+    @Log(title = "会员看课统计-按课程统计", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(fsUserWatchCourseStatisticsService.deleteFsUserWatchCourseStatisticsByIds(ids));
+    }
+
+
+    @PostMapping("/test")
+    @ApiOperation("测试看课统计明细定时任务")
+    public void userCourseCountTask() {
+        fsUserWatchCourseStatisticsService.insertWatchCourseStatistics();
+    }
+}

+ 106 - 0
fs-company/src/main/java/com/fs/company/controller/course/FsUserWatchStatisticsController.java

@@ -0,0 +1,106 @@
+package com.fs.company.controller.course;
+
+import com.fs.common.annotation.Log;
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.core.page.TableDataInfo;
+import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.course.domain.FsUserWatchStatistics;
+import com.fs.course.service.IFsUserWatchStatisticsService;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 会员看课统计-按营期统计Controller
+ *
+ * @author fs
+ * @date 2025-06-16
+ */
+@RestController
+@RequestMapping("/course/userWatchStatistics")
+public class FsUserWatchStatisticsController extends BaseController
+{
+    @Autowired
+    private IFsUserWatchStatisticsService fsUserWatchStatisticsService;
+
+    /**
+     * 查询会员看课统计-按营期统计列表
+     */
+    @PreAuthorize("@ss.hasPermi('course:userWatchStatistics:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(FsUserWatchStatistics fsUserWatchStatistics)
+    {
+        startPage();
+        List<FsUserWatchStatistics> list = fsUserWatchStatisticsService.selectFsUserWatchStatisticsList(fsUserWatchStatistics);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出会员看课统计-按营期统计列表
+     */
+    @PreAuthorize("@ss.hasPermi('course:userWatchStatistics:export')")
+    @Log(title = "会员看课统计-按营期统计", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(FsUserWatchStatistics fsUserWatchStatistics)
+    {
+        List<FsUserWatchStatistics> list = fsUserWatchStatisticsService.selectFsUserWatchStatisticsList(fsUserWatchStatistics);
+        ExcelUtil<FsUserWatchStatistics> util = new ExcelUtil<FsUserWatchStatistics>(FsUserWatchStatistics.class);
+        return util.exportExcel(list, "会员看课统计-按营期统计数据");
+    }
+
+    /**
+     * 获取会员看课统计-按营期统计详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('course:userWatchStatistics:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return AjaxResult.success(fsUserWatchStatisticsService.selectFsUserWatchStatisticsById(id));
+    }
+
+    /**
+     * 新增会员看课统计-按营期统计
+     */
+    @PreAuthorize("@ss.hasPermi('course:userWatchStatistics:add')")
+    @Log(title = "会员看课统计-按营期统计", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody FsUserWatchStatistics fsUserWatchStatistics)
+    {
+        return toAjax(fsUserWatchStatisticsService.insertFsUserWatchStatistics(fsUserWatchStatistics));
+    }
+
+    /**
+     * 修改会员看课统计-按营期统计
+     */
+    @PreAuthorize("@ss.hasPermi('course:userWatchStatistics:edit')")
+    @Log(title = "会员看课统计-按营期统计", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody FsUserWatchStatistics fsUserWatchStatistics)
+    {
+        return toAjax(fsUserWatchStatisticsService.updateFsUserWatchStatistics(fsUserWatchStatistics));
+    }
+
+    /**
+     * 删除会员看课统计-按营期统计
+     */
+    @PreAuthorize("@ss.hasPermi('course:userWatchStatistics:remove')")
+    @Log(title = "会员看课统计-按营期统计", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(fsUserWatchStatisticsService.deleteFsUserWatchStatisticsByIds(ids));
+    }
+
+
+    @PostMapping("/test")
+    @ApiOperation("测试营期看课统计定时任务")
+    public void userCourseCountTask() {
+        fsUserWatchStatisticsService.insertStatistics();
+    }
+
+}

+ 16 - 0
fs-company/src/main/java/com/fs/company/controller/qw/QwSopLogsController.java

@@ -3,12 +3,15 @@ package com.fs.company.controller.qw;
 import com.fs.common.annotation.Log;
 import com.fs.common.core.controller.BaseController;
 import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.core.domain.R;
 import com.fs.common.core.page.TableDataInfo;
 import com.fs.common.enums.BusinessType;
 import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.course.service.IFsCourseLinkService;
 import com.fs.framework.service.TokenService;
 import com.fs.qw.domain.QwUser;
 import com.fs.qw.dto.QwUserKeyDTO;
+import com.fs.qw.param.GenerateShortLinkParam;
 import com.fs.qw.service.IQwUserService;
 import com.fs.sop.domain.QwSopLogs;
 import com.fs.sop.params.QwSopLogsParam;
@@ -44,6 +47,9 @@ public class QwSopLogsController extends BaseController
     @Autowired
     private IQwUserService iQwUserService;
 
+    @Autowired
+    private IFsCourseLinkService linkService;
+
     /**
      * 查询企业微信SOP  定时任务列表
      */
@@ -180,4 +186,14 @@ public class QwSopLogsController extends BaseController
     {
         return toAjax(iQwSopLogsService.deleteQwSopLogsByIds(ids));
     }
+
+    /**
+     * 获取企业微信SOP  定时任务详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('qw:sopLogs:generate')")
+    @PostMapping("/generateShortLink")
+    public R generateShortLink(@RequestBody GenerateShortLinkParam param)
+    {
+        return linkService.getWxaCodeGenerateScheme(param.getLinkStr(), param.getAppId());
+    }
 }

+ 1 - 0
fs-company/src/main/java/com/fs/user/FsUserAdminController.java

@@ -74,6 +74,7 @@ public class FsUserAdminController extends BaseController {
         LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
         param.setCompanyId(loginUser.getCompany().getCompanyId());
         param.setCompanyUserId(String.valueOf(loginUser.getUser().getUserId()));
+        param.setIsAdmin(loginUser.getUser().isAdmin());
 
         if(param.getCompanyUserId() == null) {
             throw new IllegalArgumentException("当前销售不存在!");

+ 2 - 0
fs-service/src/main/java/com/fs/course/domain/FsCourseQuestionBank.java

@@ -43,4 +43,6 @@ public class FsCourseQuestionBank extends BaseEntity
     private String answer;
     private Long questionType;
     private Long questionSubType;
+
+    private Long userId;
 }

+ 2 - 0
fs-service/src/main/java/com/fs/course/domain/FsUserCourse.java

@@ -135,6 +135,8 @@ public class FsUserCourse extends BaseEntity
     @Excel(name = "课程类型  1vip  2 积分")
     private Long courseType;
 
+    private Long userId;
+
     private Long talentId;
 
     private Integer isDel;

+ 2 - 0
fs-service/src/main/java/com/fs/course/domain/FsUserCourseTrainingCamp.java

@@ -41,4 +41,6 @@ public class FsUserCourseTrainingCamp
      * 删除状态0、正常,1、已删除
      */
     private Integer delFlag;
+
+    private Long userId;
 }

+ 2 - 0
fs-service/src/main/java/com/fs/course/domain/FsVideoResource.java

@@ -97,4 +97,6 @@ public class FsVideoResource {
     private String transcodeFileKey;//转码的文件key
 
     private Integer sort;
+
+    private Long userId;
 }

+ 2 - 0
fs-service/src/main/java/com/fs/course/mapper/FsCourseTrafficLogMapper.java

@@ -108,4 +108,6 @@ public interface FsCourseTrafficLogMapper
     List<FsCourseTrafficLog> selectCourseTrafficLogByTwoDaysLater(@Param("offset")Integer offset,@Param("limit")Integer limit);
     @DataSource(DataSourceType.CLICKHOUSE)
     void insertCourseTrafficLogByTwoDaysLaterBatch(@Param("list") List<FsCourseTrafficLog> redPacketLogs);
+
+    List<FsCourseTrafficLogListVO> selectTrafficNew(FsCourseTrafficLogParam param);
 }

+ 7 - 3
fs-service/src/main/java/com/fs/course/mapper/FsUserCourseMapper.java

@@ -137,6 +137,12 @@ public interface FsUserCourseMapper
             "<if test = ' maps.cateId !=null '> " +
             "and (cc.cate_id =#{maps.cateId} or cc.pid=#{maps.cateId} )" +
             "</if>" +
+            "<if test = ' maps.subCateId !=null '> " +
+            "and c.sub_cate_id =#{maps.subCateId}" +
+            "</if>" +
+            "<if test = ' maps.userId !=null '> " +
+            "and c.user_id =#{maps.userId}" +
+            "</if>" +
             "<if test = ' maps.courseName!=null and maps.courseName != \"\" '> " +
             "and c.course_name like concat('%', #{maps.courseName}, '%') " +
             "</if>" +
@@ -226,9 +232,7 @@ public interface FsUserCourseMapper
 
 
 
-    @Select("select course_id dict_value, course_name dict_label,img_url dict_imgUrl  from fs_user_course where is_del = 0 and is_private = 1 ")
-    List<OptionsVO> selectFsUserCourseAllList();
-
+    List<OptionsVO> selectFsUserCourseAllList(@Param("userId") Long userId);
 
     @Select("select course_id dict_value, course_name dict_label,img_url dict_imgUrl  from fs_user_course where is_del = 0 and is_private = 1" +
             " and find_in_set(#{companyId},company_ids) ")

+ 6 - 0
fs-service/src/main/java/com/fs/course/mapper/FsUserCourseVideoMapper.java

@@ -85,6 +85,9 @@ public interface FsUserCourseVideoMapper
             "<if test = ' maps.title!=null and maps.title != \"\" '> " +
             "and v.title = #{maps.title} " +
             "</if>" +
+            "<if test = ' maps.userId!=null and maps.userId != \"\" '> " +
+            "and v.user_id = #{maps.userId} " +
+            "</if>" +
             " order by v.course_sort  "+
             "</script>"})
     List<FsUserCourseVideo> selectFsUserCourseVideoListByCourseId(@Param("maps") FsUserCourseVideo fsUserCourseVideo);
@@ -216,4 +219,7 @@ public interface FsUserCourseVideoMapper
 
     @Select("select title from fs_user_course_video WHERE video_id=#{videoId}")
     String selectFsUserCourseVideoByVideoForTitle(@Param("videoId") Long videoId);
+
+    FsUserCourseVideo selectFsUserCourseVideoByVideoIdAndUserId(@Param("videoId") Long videoId,@Param("userId") Long userId);
+
 }

+ 2 - 0
fs-service/src/main/java/com/fs/course/param/FsCourseAnswerLogsParam.java

@@ -25,6 +25,8 @@ public class FsCourseAnswerLogsParam  extends BaseEntity  {
     private Long qwUserId;
     private Long userId;
     private String nickName;
+    private String project;
+
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     private Date eTime;
 

+ 24 - 2
fs-service/src/main/java/com/fs/course/param/FsCourseTrafficLogParam.java

@@ -2,15 +2,37 @@ package com.fs.course.param;
 
 import com.fasterxml.jackson.annotation.JsonFormat;
 import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
 
+import java.time.YearMonth;
 import java.util.Date;
 
 @Data
 public class FsCourseTrafficLogParam {
 
-    @JsonFormat(pattern = "yyyy-MM")
-    private Date time;
+    @DateTimeFormat(pattern = "yyyy-MM")
+    private YearMonth time;
+    /**
+     * 公司id
+     */
     private Long companyId;
     private Integer year;
     private Integer month;
+    /**
+     * 项目id
+     */
+    private Long project;
+    /**
+     * 课程id
+     */
+    private Long courseId;
+
+    private String startDate;
+    private String endDate;
+
+    /**
+     * tab类型
+     */
+    private String tabType;
+
 }

+ 17 - 0
fs-service/src/main/java/com/fs/course/param/InternetTrafficParam.java

@@ -0,0 +1,17 @@
+package com.fs.course.param;
+
+import lombok.Data;
+
+@Data
+public class InternetTrafficParam {
+
+  /**
+   * 充值金额
+   */
+  public String account;
+
+  /**
+   * 公司id
+   */
+  public Long companyId;
+}

+ 1 - 1
fs-service/src/main/java/com/fs/course/service/IFsCourseQuestionBankService.java

@@ -73,7 +73,7 @@ public interface IFsCourseQuestionBankService
      * @param nickName 昵称
      * @return String
      */
-    String importData(List<FsCourseQuestionBankImportDTO> list, @Size String nickName);
+    String importData(List<FsCourseQuestionBankImportDTO> list, String nickName, Long userId);
 
     /**
      * 根据ID查询题目

+ 2 - 0
fs-service/src/main/java/com/fs/course/service/IFsCourseTrafficLogService.java

@@ -68,4 +68,6 @@ public interface IFsCourseTrafficLogService
      * 存储课程流量日志
      */
     void saveCourseTrafficLog();
+
+    List<FsCourseTrafficLogListVO> selectTrafficNew(FsCourseTrafficLogParam param);
 }

+ 2 - 2
fs-service/src/main/java/com/fs/course/service/IFsUserCourseService.java

@@ -85,7 +85,7 @@ public interface IFsUserCourseService
 
     List<FsUserCourseListUVO> selectFsUserCourseListUVO(FsUserCourseListUParam param);
 
-    List<OptionsVO> selectFsUserCourseAllList();
+    List<OptionsVO> selectFsUserCourseAllList(Long userId);
 
     List<FsUserCourseListPVO> selectFsUserCourseListPVO(FsUserCourse param);
 
@@ -123,7 +123,7 @@ public interface IFsUserCourseService
 
     String createUserImageQR(@NotNull(message = "链接不能为空") String realLink, String backgroundImagePath, InputStream inputStream, String png, @NotNull(message = "销售id不能为空") Long companyUserId) throws Exception;
 
-    int copyFsUserCourse(Long courseId);
+    int copyFsUserCourse(Long courseId, Long userId);
 
     List<FsUserCourseVideoAppletVO> selectFsUserCourseVideoApplet();
 

+ 1 - 2
fs-service/src/main/java/com/fs/course/service/IFsUserCourseTrainingCampService.java

@@ -30,8 +30,7 @@ public interface IFsUserCourseTrainingCampService extends IService<FsUserCourseT
      * 新增训练营
      * @param params    参数
      */
-    void add(FsUserCourseTrainingCampDTO params);
-
+    void add(FsUserCourseTrainingCampDTO params,Long userId);
     /**
      * 删除训练营
      * @param ids   ids

+ 3 - 1
fs-service/src/main/java/com/fs/course/service/IFsUserCourseVideoService.java

@@ -36,7 +36,7 @@ public interface IFsUserCourseVideoService
      * @return 课堂视频
      */
     public FsUserCourseVideo selectFsUserCourseVideoByVideoId(Long videoId);
-    public FsUserCourseVideoQVO selectFsUserCourseVideoByVideoIdVO(Long videoId);
+    public FsUserCourseVideoQVO selectFsUserCourseVideoByVideoIdVO(Long videoId,Long userId);
 
     /**
      * 查询课堂视频列表
@@ -184,4 +184,6 @@ public interface IFsUserCourseVideoService
     R updateVideo();
 
     R checkUserInfo(Long userId);
+
+    FsUserCourseVideoQVO selectFsUserCourseVideoByVideoIdVO(Long videoId);
 }

+ 7 - 0
fs-service/src/main/java/com/fs/course/service/impl/FsCourseProductOrderServiceImpl.java

@@ -153,6 +153,13 @@ public class FsCourseProductOrderServiceImpl extends ServiceImpl<FsCourseProduct
                     FsCourseProduct courseProduct = JSONUtil.toBean(productOrderVO.getProductJson(), FsCourseProduct.class);
                     productOrderVO.setProductName(courseProduct.getProductName());
                 }
+                if (productOrderVO.getUserPhone() != null && productOrderVO.getUserPhone().length() > 11) {
+                    productOrderVO.setUserPhone(PhoneUtil.decryptPhoneMk(productOrderVO.getUserPhone()));
+                } else {
+                    if (productOrderVO.getUserPhone()!=null) {
+                        productOrderVO.setUserPhone(productOrderVO.getUserPhone().replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));
+                    }
+                }
             });
         }
         return productOrderVOS;

+ 2 - 1
fs-service/src/main/java/com/fs/course/service/impl/FsCourseQuestionBankServiceImpl.java

@@ -362,7 +362,7 @@ public class FsCourseQuestionBankServiceImpl implements IFsCourseQuestionBankSer
      * @return String
      */
     @Override
-    public String importData(List<FsCourseQuestionBankImportDTO> list, @Size String nickName) {
+    public String importData(List<FsCourseQuestionBankImportDTO> list, String nickName,Long userId) {
         if (Objects.isNull(list) || list.isEmpty()) {
             throw new ServiceException("导入数据不能为空");
         }
@@ -382,6 +382,7 @@ public class FsCourseQuestionBankServiceImpl implements IFsCourseQuestionBankSer
 
                 // 构建题目对象
                 FsCourseQuestionBank questionBank = buildQuestionBank(importDTO, categoryData, nickName);
+                questionBank.setUserId(userId);
                 importData.add(questionBank);
                 result.addSuccess(importDTO.getTitle());
 

+ 44 - 0
fs-service/src/main/java/com/fs/course/service/impl/FsCourseTrafficLogServiceImpl.java

@@ -4,9 +4,16 @@ import java.text.SimpleDateFormat;
 import java.util.Collections;
 import java.util.Date;
 import java.util.List;
+
+import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
+import com.fs.common.exception.CustomException;
 import com.fs.common.utils.DateUtils;
+import com.fs.common.utils.DictUtils;
+import com.fs.company.cache.ICompanyCacheService;
 import com.fs.course.param.FsCourseTrafficLogParam;
 import com.fs.course.vo.FsCourseTrafficLogListVO;
+import com.fs.store.service.cache.IFsUserCourseCacheService;
+import com.hc.openapi.tool.util.StringUtils;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -27,6 +34,12 @@ public class FsCourseTrafficLogServiceImpl implements IFsCourseTrafficLogService
     @Autowired
     private FsCourseTrafficLogMapper fsCourseTrafficLogMapper;
 
+    @Autowired
+    private ICompanyCacheService companyCacheService;
+
+    @Autowired
+    private IFsUserCourseCacheService fsUserCourseCacheService;
+
     /**
      * 查询短链课程流量记录
      *
@@ -158,6 +171,37 @@ public class FsCourseTrafficLogServiceImpl implements IFsCourseTrafficLogService
         log.info("总耗时: {}", formatDuration(endTime - startTime));
     }
 
+    @Override
+    public List<FsCourseTrafficLogListVO> selectTrafficNew(FsCourseTrafficLogParam param) {
+        if(StringUtils.isBlank(param.getStartDate()) && StringUtils.isBlank(param.getEndDate())){
+            throw new CustomException("搜索必须要一个时间范围!");
+        }
+        List<FsCourseTrafficLogListVO> fsCourseTrafficLogListVOS = fsCourseTrafficLogMapper.selectTrafficNew(param);
+        for (FsCourseTrafficLogListVO log : fsCourseTrafficLogListVOS) {
+            if (ObjectUtils.isNotNull(log.getProject())) {
+                String sysCourseProject = DictUtils.getDictLabel("sys_course_project", String.valueOf(log.getProject()));
+                if (StringUtils.isNotBlank(sysCourseProject)) {
+                    log.setProjectName(sysCourseProject);
+                }
+            }
+
+            if (ObjectUtils.isNotNull(log.getCompanyId())) {
+                String companyName = companyCacheService.selectCompanyNameById(log.getCompanyId());
+                if (StringUtils.isNotBlank(companyName)) {
+                    log.setCompanyName(companyName);
+                }
+            }
+
+            if (ObjectUtils.isNotNull(log.getCourseId())) {
+                String courseName = fsUserCourseCacheService.selectCourseNameByCourseId(log.getCourseId());
+                if (StringUtils.isNotBlank(courseName)) {
+                    log.setCourseName(courseName);
+                }
+            }
+        }
+        return fsCourseTrafficLogListVOS;
+    }
+
     private static String formatDuration(long millis) {
         long seconds = millis / 1000;
         long minutes = seconds / 60;

+ 5 - 3
fs-service/src/main/java/com/fs/course/service/impl/FsUserCourseServiceImpl.java

@@ -277,8 +277,8 @@ public class FsUserCourseServiceImpl implements IFsUserCourseService
     }
 
     @Override
-    public List<OptionsVO> selectFsUserCourseAllList() {
-        return fsUserCourseMapper.selectFsUserCourseAllList();
+    public List<OptionsVO> selectFsUserCourseAllList(Long userId) {
+        return fsUserCourseMapper.selectFsUserCourseAllList(userId);
     }
 
 
@@ -663,10 +663,11 @@ public class FsUserCourseServiceImpl implements IFsUserCourseService
 
     @Override
     @Transactional(rollbackFor = Exception.class) // 显式声明事务
-    public int copyFsUserCourse(Long courseId) {
+    public int copyFsUserCourse(Long courseId, Long userId) {
         FsUserCourse fsUserCourse = fsUserCourseService.selectFsUserCourseByCourseId(courseId);
         if(fsUserCourse != null){
             fsUserCourse.setCourseId(null);
+            fsUserCourse.setUserId(userId);
             fsUserCourseService.insertFsUserCourse(fsUserCourse);
             Long newCourseId = fsUserCourse.getCourseId();
 
@@ -676,6 +677,7 @@ public class FsUserCourseServiceImpl implements IFsUserCourseService
 
             FsUserCourseVideo fsUserCourseVideo = new FsUserCourseVideo();
             fsUserCourseVideo.setCourseId(courseId);
+            fsUserCourseVideo.setUserId(userId);
             List<FsUserCourseVideo> list = fsUserCourseVideoService.selectFsUserCourseVideoListByCourseId(fsUserCourseVideo);
             for (FsUserCourseVideo courseVideo : list) {
                 courseVideo.setVideoId(null);

+ 2 - 1
fs-service/src/main/java/com/fs/course/service/impl/FsUserCourseTrainingCampServiceImpl.java

@@ -62,11 +62,12 @@ public class FsUserCourseTrainingCampServiceImpl extends ServiceImpl<FsUserCours
      * @param params    参数
      */
     @Override
-    public void add(FsUserCourseTrainingCampDTO params) {
+    public void add(FsUserCourseTrainingCampDTO params,Long userId) {
         FsUserCourseTrainingCamp trainingCamp = new FsUserCourseTrainingCamp();
         trainingCamp.setTrainingCampName(params.getTrainingCampName());
         trainingCamp.setOrderNumber(baseMapper.getOrderNumber());
         trainingCamp.setCreateTime(LocalDateTime.now());
+        trainingCamp.setUserId(userId);
         baseMapper.insert(trainingCamp);
     }
 

+ 17 - 2
fs-service/src/main/java/com/fs/course/service/impl/FsUserCourseVideoServiceImpl.java

@@ -215,9 +215,9 @@ public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService
     }
 
     @Override
-    public FsUserCourseVideoQVO selectFsUserCourseVideoByVideoIdVO(Long videoId) {
+    public FsUserCourseVideoQVO selectFsUserCourseVideoByVideoIdVO(Long videoId,Long userId) {
         FsUserCourseVideoQVO fsUserCourseVideoQVO=new FsUserCourseVideoQVO();
-        FsUserCourseVideo courseVideo = fsUserCourseVideoMapper.selectFsUserCourseVideoByVideoId(videoId);
+        FsUserCourseVideo courseVideo = fsUserCourseVideoMapper.selectFsUserCourseVideoByVideoIdAndUserId(videoId,userId);
 
         BeanCopyUtils.copy(courseVideo,fsUserCourseVideoQVO);
         if (courseVideo.getRedPacketMoney()!=null){
@@ -2302,4 +2302,19 @@ public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService
         }
         return R.ok().put("user",user);
     }
+
+    @Override
+    public FsUserCourseVideoQVO selectFsUserCourseVideoByVideoIdVO(Long videoId) {
+        FsUserCourseVideoQVO fsUserCourseVideoQVO = new FsUserCourseVideoQVO();
+        FsUserCourseVideo courseVideo = fsUserCourseVideoMapper.selectFsUserCourseVideoByVideoId(videoId);
+
+        BeanCopyUtils.copy(courseVideo,fsUserCourseVideoQVO);
+
+        if (StringUtils.isNotEmpty(courseVideo.getQuestionBankId())){
+            List<FsCourseQuestionBank> fsCourseQuestionBanks = courseQuestionBankMapper.selectFsCourseQuestionBankByIdVO(courseVideo.getQuestionBankId().split(","));
+            fsUserCourseVideoQVO.setQuestionBankList(fsCourseQuestionBanks);
+        }
+        return fsUserCourseVideoQVO;
+    }
+
 }

+ 5 - 0
fs-service/src/main/java/com/fs/course/vo/FsCourseTrafficLogListVO.java

@@ -16,6 +16,11 @@ import java.io.Serializable;
 public class FsCourseTrafficLogListVO implements Serializable
 {
     private String companyName;
+    private Long companyId;
+    private String courseName;
+    private Long courseId;
+    private String projectName;
+    private Long project;
 
     private Long totalInternetTraffic;
 

+ 4 - 0
fs-service/src/main/java/com/fs/course/vo/FsUserCoursePeriodVO.java

@@ -85,4 +85,8 @@ public class FsUserCoursePeriodVO implements Serializable {
     @Excel(name = "营期状态")
     private Long periodStatus;
 
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "营期线", width = 31, dateFormat = "yyyy-MM-dd")
+    private Date periodLine;
+
 }

+ 2 - 2
fs-service/src/main/java/com/fs/his/service/impl/FsUserServiceImpl.java

@@ -606,11 +606,11 @@ public class FsUserServiceImpl implements IFsUserService
     public TableDataInfo selectFsUserPageListNew(FsUserPageListParam param) {
         // 找出下级销售
         String companyUserId = param.getCompanyUserId();
-        if(companyUserId != null) {
+        if(StringUtils.isNotBlank(companyUserId)) {
             Long companyUser = Long.parseLong(companyUserId);
             Set<Long> userIds = companyUserCacheService.selectUserAllCompanyUserId(companyUser);
             if (userIds != null || userIds.size() <= 1) {
-                if (param.getIsAdmin()) {
+                if (param.getIsAdmin() != null && param.getIsAdmin()) {
                     List<CompanyUser> companyUsers = companyUserMapper.selectCompanyUserByCompanyId(param.getCompanyId());
                     userIds = companyUsers.stream().map(CompanyUser::getUserId).collect(Collectors.toSet());
                 }

+ 4 - 0
fs-service/src/main/java/com/fs/his/vo/FsUserVO.java

@@ -18,6 +18,10 @@ public class FsUserVO extends FsUser implements Serializable
     @Excel(name = "所属销售", sort = 10)
     private String companyUserNickName;
 
+    @ApiModelProperty(value = "所属公司")
+    @Excel(name = "所属公司", sort = 9)
+    private String companyName;
+
     /** 创建时间 */
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     @Excel(name = "会员注册时间", dateFormat = "yyyy-MM-dd HH:mm:ss" , sort = 6)

+ 9 - 0
fs-service/src/main/java/com/fs/qw/param/GenerateShortLinkParam.java

@@ -0,0 +1,9 @@
+package com.fs.qw.param;
+
+import lombok.Data;
+
+@Data
+public class GenerateShortLinkParam {
+    private String linkStr;
+    private String appId;
+}

+ 3 - 0
fs-service/src/main/resources/application-druid-fby.yml

@@ -148,3 +148,6 @@ rocketmq:
         group: test-group
         access-key: ak1243b25nj17d4b2dc1a03 # 替换为实际的 accessKey
         secret-key: sk08a7ea1f9f4b0237 # 替换为实际的 secretKey
+openIM:
+    secret: openIM123
+    userID: imAdmin

+ 7 - 2
fs-service/src/main/resources/mapper/course/FsCourseQuestionBankMapper.xml

@@ -26,6 +26,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <where>
             <if test="title != null  and title != ''"> and title like concat('%', #{title}, '%') </if>
             <if test="sort != null "> and sort = #{sort}</if>
+            <if test="userId != null "> and user_id = #{userId}</if>
             <if test="type != null "> and type = #{type}</if>
             <if test="questionType != null "> and question_type = #{questionType}</if>
             <if test="questionSubType != null "> and question_sub_type = #{questionSubType}</if>
@@ -54,6 +55,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="createBy != null">create_by,</if>
             <if test="questionType != null">question_type,</if>
             <if test="questionSubType != null">question_sub_type,</if>
+            <if test="userId != null">user_id,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="title != null">#{title},</if>
@@ -66,6 +68,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="createBy != null">#{createBy},</if>
             <if test="questionType != null">#{questionType},</if>
             <if test="questionSubType != null">#{questionSubType},</if>
+            <if test="userId != null">#{userId},</if>
          </trim>
     </insert>
 
@@ -80,7 +83,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         answer,
         create_by,
         question_type,
-        question_sub_type
+        question_sub_type,
+        user_id
         )
         VALUES
         <foreach collection="list" item="item" separator=",">
@@ -94,7 +98,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             #{item.answer, jdbcType=CLOB},
             #{item.createBy, jdbcType=VARCHAR},
             #{item.questionType, jdbcType=VARCHAR},
-            #{item.questionSubType, jdbcType=VARCHAR}
+            #{item.questionSubType, jdbcType=VARCHAR},
+            #{item.userId, jdbcType=BIGINT}
             )
         </foreach>
     </insert>

+ 34 - 0
fs-service/src/main/resources/mapper/course/FsCourseTrafficLogMapper.xml

@@ -238,4 +238,38 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             ,#{item.companyUserId},#{item.companyId},#{item.courseId},#{item.uuId},#{item.project},#{item.periodId})
         </foreach>
     </insert>
+
+    <select id="selectTrafficNew" resultType="com.fs.course.vo.FsCourseTrafficLogListVO">
+        select company_id,project,course_id,SUM(internet_traffic) AS total_internet_traffic
+        ,DATE_FORMAT(create_time, '%Y-%m-%d') AS `month`  from fs_course_traffic_log
+        <where>
+            <if test="startDate != null and endDate != null">
+                and DATE_FORMAT(create_time, '%Y-%m-%d') between #{startDate} AND #{endDate}
+            </if>
+            <if test='companyId !=null'>
+                and company_id = #{companyId}
+            </if>
+            <if test="courseId != null">
+                and course_id = ${courseId}
+            </if>
+            <if test="project != null">
+                and project = ${project}
+            </if>
+        </where>
+
+        <if test="tabType==null or tabType==''">
+            group by company_id,`month`,course_id,project
+        </if>
+        <if test="tabType!=null and tabType=='project'">
+            group by project,`month`
+        </if>
+        <if test="tabType!=null and tabType=='course'">
+            group by course_id,`month`
+        </if>
+        <if test="tabType!=null and tabType=='company'">
+            group by company_id,`month`
+        </if>
+
+    </select>
+
 </mapper>

+ 11 - 0
fs-service/src/main/resources/mapper/course/FsUserCourseMapper.xml

@@ -85,6 +85,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="talentId != null "> and talent_id = #{talentId}</if>
             <if test="isNext != null "> and is_next = #{isNext}</if>
             <if test="isPrivate != null "> and is_private = #{isPrivate}</if>
+            <if test="userId != null "> and user_id = #{userId}</if>
         </where>
     </select>
 
@@ -193,6 +194,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="isPrivate != null">is_private,</if>
             <if test="secondImg != null">second_img,</if>
             <if test="companyIds != null">company_ids,</if>
+            <if test="userId != null">user_id,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="cateId != null">#{cateId},</if>
@@ -232,6 +234,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="isPrivate != null">#{isPrivate},</if>
             <if test="secondImg != null">#{secondImg},</if>
             <if test="companyIds != null">#{companyIds},</if>
+            <if test="userId != null">#{userId},</if>
          </trim>
     </insert>
 
@@ -309,4 +312,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 <!--        ORDER BY-->
 <!--        c.course_id-->
 <!--    </select>-->
+
+    <select id="selectFsUserCourseAllList" resultType="com.fs.his.vo.OptionsVO">
+        select course_id dict_value, course_name dict_label,img_url dict_imgUrl  from fs_user_course
+        where is_del = 0 and is_private = 1
+        <if test="userId != null">
+            and user_id = #{userId}
+        </if>
+    </select>
 </mapper>

+ 10 - 1
fs-service/src/main/resources/mapper/course/FsUserCoursePeriodMapper.xml

@@ -20,6 +20,7 @@
         <result property="maxViewNum"    column="max_view_num"    />
         <result property="courseLogo"    column="course_logo"    />
         <result property="openCommentStatus"    column="open_comment_status"    />
+        <result property="periodLine"    column="period_line"    />
     </resultMap>
 
     <sql id="selectFsUserCoursePeriodVo">
@@ -39,6 +40,7 @@
             <if test="periodType != null "> and period_type = #{periodType}</if>
             <if test="periodStartingTime != null "> and period_starting_time = #{periodStartingTime}</if>
             <if test="periodEndTime != null "> and period_end_time = #{periodEndTime}</if>
+            <if test="periodLine != null "> and period_line = #{periodLine}</if>
         </where>
     </select>
 
@@ -58,6 +60,7 @@
         period_type,
         period_end_time,
         period_starting_time,
+        period_line,
         fctc.training_camp_name AS trainingCampName,
         GROUP_CONCAT( company.company_name ) AS companyName
         FROM
@@ -77,6 +80,7 @@
             </if>
             <if test="periodStartingTime != null "> and period_starting_time &gt;= #{periodStartingTime}</if>
             <if test="periodEndTime != null "> and period_end_time &lt;= #{periodEndTime}</if>
+            <if test="periodLine != null "> and period_line = #{periodLine}</if>
         </where>
         group by fs_user_course_period.period_id
         order by create_time desc
@@ -109,6 +113,7 @@
             <if test="maxViewNum != null">max_view_num,</if>
             <if test="courseLogo != null">course_logo,</if>
             <if test="openCommentStatus != null">open_comment_status,</if>
+            <if test="periodLine != null">period_line,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="periodId != null">#{periodId},</if>
@@ -130,6 +135,7 @@
             <if test="maxViewNum != null">#{maxViewNum},</if>
             <if test="courseLogo != null">#{courseLogo},</if>
             <if test="openCommentStatus != null">#{openCommentStatus},</if>
+            <if test="periodLine != null">#{periodLine},</if>
         </trim>
     </insert>
 
@@ -154,6 +160,7 @@
             <if test="maxViewNum != null">max_view_num = #{maxViewNum},</if>
             <if test="courseLogo != null and courseLogo !=''">course_logo = #{courseLogo},</if>
             <if test="openCommentStatus != null">open_comment_status = #{openCommentStatus},</if>
+            <if test="periodLine != null">period_line = #{periodLine},</if>
         </trim>
         where period_id = #{periodId}
     </update>
@@ -218,6 +225,7 @@
                 AND fvrp.period_id = #{periodId}
                 AND fvrp.company_id = #{companyId}
                 AND fvrp.data_type = 2
+                and fvrp.del_flag = 0
         WHERE
             a.video_id IN (
                 SELECT
@@ -230,6 +238,7 @@
                     a.period_id = #{periodId}
             )
           and a.period_id = #{periodId}
+          and a.del_flag = 0
     </select>
 
     <select id="selectFsUserCoursePeriodsByIds" resultType="FsUserCoursePeriod">
@@ -249,7 +258,7 @@
             #{id}
         </foreach>
         <![CDATA[
-       and (ucp.period_starting_time <= #{params.date}
+        and (ucp.period_starting_time <= #{params.date}
         and ucp.period_end_time > #{params.date})
         ]]>
     </select>

+ 3 - 0
fs-service/src/main/resources/mapper/course/FsUserCourseTrainingCampMapper.xml

@@ -28,6 +28,9 @@
             <if test="params.userId != null and params.userId != ''">
                 and cu.user_id = #{params.userId}
             </if>
+            <if test="params.userId != null and params.userId != ''">
+                and ctc.user_id like concat('%',#{params.userId},'%')
+            </if>
         </where>
         group by ctc.training_camp_id, ctc.training_camp_name, ctc.order_number
         order by

+ 9 - 0
fs-service/src/main/resources/mapper/course/FsUserCourseVideoMapper.xml

@@ -59,6 +59,7 @@
             <if test="questionBankId != null "> and question_bank_id = #{questionBankId}</if>
             <if test="userId != null "> and user_id = #{userId}</if>
             <if test="projectId != null "> and project_id = #{projectId}</if>
+            <if test="userId != null "> and user_id = #{userId}</if>
         </where>
     </select>
 
@@ -362,6 +363,14 @@
         and fcpd.del_flag = 0 and video.is_del = 0 and fcp.del_flag = '0' and c.del_flag = '0'
     </select>
 
+    <select id="selectFsUserCourseVideoByVideoIdAndUserId" resultType="com.fs.course.domain.FsUserCourseVideo">
+        select *  from fs_user_course_video
+        where video_id=#{videoId} and is_del = 0
+        <if test="userId != null">
+            user_id = #{userId}
+        </if>
+    </select>
+
     <update id="updateRedPacketMoney">
         update fs_user_course_video set red_packet_money = #{redPacketMoney} where video_id = #{videoId}
     </update>

+ 3 - 0
fs-service/src/main/resources/mapper/course/FsVideoResourceMapper.xml

@@ -18,6 +18,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <if test="params.typeId != null">
             and rr.type_id = #{params.typeId}
         </if>
+        <if test="params.userId != null">
+            and rr.user_id = #{params.userId}
+        </if>
         <if test="params.typeSubId != null">
             and rr.type_sub_id = #{params.typeSubId}
         </if>