|
|
@@ -11,10 +11,12 @@ 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.vo.RedPacketMoneyVO;
|
|
|
import com.fs.course.config.CourseConfig;
|
|
|
import com.fs.course.domain.FsCourseRedPacketLog;
|
|
|
import com.fs.course.mapper.FsUserCourseMapper;
|
|
|
import com.fs.course.mapper.FsUserCourseVideoMapper;
|
|
|
+import com.fs.course.param.CourseRedPacketStatisticsParam;
|
|
|
import com.fs.course.param.FsCourseRedPacketLogParam;
|
|
|
import com.fs.course.service.IFsCourseRedPacketLogService;
|
|
|
import com.fs.course.vo.FsCourseRedPacketLogListPVO;
|
|
|
@@ -39,8 +41,7 @@ import static com.fs.his.utils.PhoneUtil.encryptPhone;
|
|
|
*/
|
|
|
@RestController
|
|
|
@RequestMapping("/course/courseRedPacketLog")
|
|
|
-public class FsCourseRedPacketLogController extends BaseController
|
|
|
-{
|
|
|
+public class FsCourseRedPacketLogController extends BaseController {
|
|
|
@Autowired
|
|
|
private IFsCourseRedPacketLogService fsCourseRedPacketLogService;
|
|
|
@Autowired
|
|
|
@@ -51,13 +52,13 @@ public class FsCourseRedPacketLogController extends BaseController
|
|
|
private TokenService tokenService;
|
|
|
@Autowired
|
|
|
private ISysConfigService configService;
|
|
|
+
|
|
|
/**
|
|
|
* 查询短链课程看课记录列表
|
|
|
*/
|
|
|
@PreAuthorize("@ss.hasPermi('course:courseRedPacketLog:list')")
|
|
|
@GetMapping("/list")
|
|
|
- public TableDataInfo list(FsCourseRedPacketLogParam fsCourseRedPacketLog)
|
|
|
- {
|
|
|
+ public TableDataInfo list(FsCourseRedPacketLogParam fsCourseRedPacketLog) {
|
|
|
startPage();
|
|
|
if (fsCourseRedPacketLog.getPhoneMk() != null && fsCourseRedPacketLog.getPhoneMk() != "") {
|
|
|
fsCourseRedPacketLog.setPhone(encryptPhone(fsCourseRedPacketLog.getPhoneMk()));
|
|
|
@@ -67,8 +68,8 @@ public class FsCourseRedPacketLogController extends BaseController
|
|
|
Long userId = loginUser.getUser().getUserId();
|
|
|
String json = configService.selectConfigByKey("course.config");
|
|
|
CourseConfig config = JSONUtil.toBean(json, CourseConfig.class);
|
|
|
- if (ObjectUtil.isNotEmpty(config.getIsBound())&&config.getIsBound()){
|
|
|
- fsCourseRedPacketLog.setCompanyId( loginUser.getCompany().getCompanyId());
|
|
|
+ if (ObjectUtil.isNotEmpty(config.getIsBound()) && config.getIsBound()) {
|
|
|
+ fsCourseRedPacketLog.setCompanyId(loginUser.getCompany().getCompanyId());
|
|
|
}
|
|
|
|
|
|
List<FsCourseRedPacketLogListPVO> list = fsCourseRedPacketLogService.selectFsCourseRedPacketLogListVO(fsCourseRedPacketLog);
|
|
|
@@ -84,11 +85,10 @@ public class FsCourseRedPacketLogController extends BaseController
|
|
|
*/
|
|
|
@PreAuthorize("@ss.hasPermi('course:courseRedPacketLog:myList')")
|
|
|
@GetMapping("/myList")
|
|
|
- public TableDataInfo myList(FsCourseRedPacketLogParam fsCourseRedPacketLog)
|
|
|
- {
|
|
|
+ public TableDataInfo myList(FsCourseRedPacketLogParam fsCourseRedPacketLog) {
|
|
|
startPage();
|
|
|
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
- fsCourseRedPacketLog.setCompanyId( loginUser.getCompany().getCompanyId());
|
|
|
+ fsCourseRedPacketLog.setCompanyId(loginUser.getCompany().getCompanyId());
|
|
|
//fsCourseRedPacketLog.setCompanyUserId(loginUser.getUser().getUserId());
|
|
|
if (fsCourseRedPacketLog.getPhoneMk() != null && fsCourseRedPacketLog.getPhoneMk() != "") {
|
|
|
fsCourseRedPacketLog.setPhone(encryptPhone(fsCourseRedPacketLog.getPhoneMk()));
|
|
|
@@ -103,11 +103,10 @@ public class FsCourseRedPacketLogController extends BaseController
|
|
|
|
|
|
@PreAuthorize("@ss.hasPermi('course:courseRedPacketLog:myList')")
|
|
|
@GetMapping("/myListNew")
|
|
|
- public TableDataInfo myListNew(FsCourseRedPacketLogParam fsCourseRedPacketLog)
|
|
|
- {
|
|
|
+ public TableDataInfo myListNew(FsCourseRedPacketLogParam fsCourseRedPacketLog) {
|
|
|
startPage();
|
|
|
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
- fsCourseRedPacketLog.setCompanyId( loginUser.getCompany().getCompanyId());
|
|
|
+ fsCourseRedPacketLog.setCompanyId(loginUser.getCompany().getCompanyId());
|
|
|
|
|
|
if (fsCourseRedPacketLog.getPhoneMk() != null && fsCourseRedPacketLog.getPhoneMk() != "") {
|
|
|
fsCourseRedPacketLog.setPhone(encryptPhone(fsCourseRedPacketLog.getPhoneMk()));
|
|
|
@@ -126,12 +125,11 @@ public class FsCourseRedPacketLogController extends BaseController
|
|
|
@PreAuthorize("@ss.hasPermi('course:courseRedPacketLog:export')")
|
|
|
@Log(title = "短链课程看课记录", businessType = BusinessType.EXPORT)
|
|
|
@GetMapping("/export")
|
|
|
- public AjaxResult export(FsCourseRedPacketLogParam fsCourseRedPacketLog)
|
|
|
- {
|
|
|
+ public AjaxResult export(FsCourseRedPacketLogParam fsCourseRedPacketLog) {
|
|
|
// LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
// fsCourseRedPacketLog.setCompanyId( loginUser.getCompany().getCompanyId());
|
|
|
|
|
|
- if (fsCourseRedPacketLog.getPhoneMk()!=null&&fsCourseRedPacketLog.getPhoneMk()!=""){
|
|
|
+ if (fsCourseRedPacketLog.getPhoneMk() != null && fsCourseRedPacketLog.getPhoneMk() != "") {
|
|
|
fsCourseRedPacketLog.setPhone(encryptPhone(fsCourseRedPacketLog.getPhoneMk()));
|
|
|
}
|
|
|
List<FsCourseRedPacketLogListPVO> list = fsCourseRedPacketLogService.selectFsCourseRedPacketLogListVO(fsCourseRedPacketLog);
|
|
|
@@ -142,18 +140,18 @@ public class FsCourseRedPacketLogController extends BaseController
|
|
|
ExcelUtil<FsCourseRedPacketLogListPVO> util = new ExcelUtil<FsCourseRedPacketLogListPVO>(FsCourseRedPacketLogListPVO.class);
|
|
|
return util.exportExcel(list, "短链课程看课记录数据");
|
|
|
}
|
|
|
+
|
|
|
/**
|
|
|
* 导出短链课程看课记录列表
|
|
|
*/
|
|
|
@PreAuthorize("@ss.hasPermi('course:courseRedPacketLog:myExport')")
|
|
|
@Log(title = "短链课程看课记录", businessType = BusinessType.EXPORT)
|
|
|
@GetMapping("/myExport")
|
|
|
- public AjaxResult myExport(FsCourseRedPacketLogParam fsCourseRedPacketLog)
|
|
|
- {
|
|
|
+ public AjaxResult myExport(FsCourseRedPacketLogParam fsCourseRedPacketLog) {
|
|
|
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
- fsCourseRedPacketLog.setCompanyId( loginUser.getCompany().getCompanyId());
|
|
|
+ fsCourseRedPacketLog.setCompanyId(loginUser.getCompany().getCompanyId());
|
|
|
|
|
|
- if (fsCourseRedPacketLog.getPhoneMk()!=null&&fsCourseRedPacketLog.getPhoneMk()!=""){
|
|
|
+ if (fsCourseRedPacketLog.getPhoneMk() != null && fsCourseRedPacketLog.getPhoneMk() != "") {
|
|
|
fsCourseRedPacketLog.setPhone(encryptPhone(fsCourseRedPacketLog.getPhoneMk()));
|
|
|
}
|
|
|
List<FsCourseRedPacketLogListPVO> list = fsCourseRedPacketLogService.selectFsCourseRedPacketLogListVO(fsCourseRedPacketLog);
|
|
|
@@ -170,8 +168,7 @@ public class FsCourseRedPacketLogController extends BaseController
|
|
|
*/
|
|
|
@PreAuthorize("@ss.hasPermi('course:courseRedPacketLog:query')")
|
|
|
@GetMapping(value = "/{logId}")
|
|
|
- public AjaxResult getInfo(@PathVariable("logId") Long logId)
|
|
|
- {
|
|
|
+ public AjaxResult getInfo(@PathVariable("logId") Long logId) {
|
|
|
return AjaxResult.success(fsCourseRedPacketLogService.selectFsCourseRedPacketLogByLogId(logId));
|
|
|
}
|
|
|
|
|
|
@@ -181,8 +178,7 @@ public class FsCourseRedPacketLogController extends BaseController
|
|
|
@PreAuthorize("@ss.hasPermi('course:courseRedPacketLog:add')")
|
|
|
@Log(title = "短链课程看课记录", businessType = BusinessType.INSERT)
|
|
|
@PostMapping
|
|
|
- public AjaxResult add(@RequestBody FsCourseRedPacketLog fsCourseRedPacketLog)
|
|
|
- {
|
|
|
+ public AjaxResult add(@RequestBody FsCourseRedPacketLog fsCourseRedPacketLog) {
|
|
|
return toAjax(fsCourseRedPacketLogService.insertFsCourseRedPacketLog(fsCourseRedPacketLog));
|
|
|
}
|
|
|
|
|
|
@@ -192,8 +188,7 @@ public class FsCourseRedPacketLogController extends BaseController
|
|
|
@PreAuthorize("@ss.hasPermi('course:courseRedPacketLog:edit')")
|
|
|
@Log(title = "短链课程看课记录", businessType = BusinessType.UPDATE)
|
|
|
@PutMapping
|
|
|
- public AjaxResult edit(@RequestBody FsCourseRedPacketLog fsCourseRedPacketLog)
|
|
|
- {
|
|
|
+ public AjaxResult edit(@RequestBody FsCourseRedPacketLog fsCourseRedPacketLog) {
|
|
|
return toAjax(fsCourseRedPacketLogService.updateFsCourseRedPacketLog(fsCourseRedPacketLog));
|
|
|
}
|
|
|
|
|
|
@@ -202,9 +197,8 @@ public class FsCourseRedPacketLogController extends BaseController
|
|
|
*/
|
|
|
@PreAuthorize("@ss.hasPermi('course:courseRedPacketLog:remove')")
|
|
|
@Log(title = "短链课程看课记录", businessType = BusinessType.DELETE)
|
|
|
- @DeleteMapping("/{logIds}")
|
|
|
- public AjaxResult remove(@PathVariable Long[] logIds)
|
|
|
- {
|
|
|
+ @DeleteMapping("/{logIds}")
|
|
|
+ public AjaxResult remove(@PathVariable Long[] logIds) {
|
|
|
return toAjax(fsCourseRedPacketLogService.deleteFsCourseRedPacketLogByLogIds(logIds));
|
|
|
}
|
|
|
|
|
|
@@ -216,14 +210,12 @@ public class FsCourseRedPacketLogController extends BaseController
|
|
|
@Log(title = "短链课程看课记录", businessType = BusinessType.DELETE)
|
|
|
@PutMapping("/retryCourseRedPacketLog/{logIds}")
|
|
|
@RepeatSubmit
|
|
|
- public R retryCourseRedPacketLog(@PathVariable Long[] logIds)
|
|
|
- {
|
|
|
+ public R retryCourseRedPacketLog(@PathVariable Long[] logIds) {
|
|
|
return fsCourseRedPacketLogService.retryCourseRedPacketLog(logIds);
|
|
|
}
|
|
|
|
|
|
@GetMapping("/courseList")
|
|
|
- public R courseList()
|
|
|
- {
|
|
|
+ public R courseList() {
|
|
|
|
|
|
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
List<OptionsVO> optionsVOS = fsUserCourseMapper.selectFsUserCourseByCompany(loginUser.getCompany().getCompanyId());
|
|
|
@@ -231,9 +223,36 @@ public class FsCourseRedPacketLogController extends BaseController
|
|
|
}
|
|
|
|
|
|
@GetMapping(value = "/videoList/{id}")
|
|
|
- public R videoList(@PathVariable("id") Long id)
|
|
|
- {
|
|
|
+ public R videoList(@PathVariable("id") Long id) {
|
|
|
List<OptionsVO> optionsVOS = fsUserCourseVideoMapper.selectFsUserCourseVodeAllList(id);
|
|
|
return R.ok().put("list", optionsVOS);
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 项目红包消耗统计列表
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('course:courseRedPacketLog:moneyList')")
|
|
|
+ @GetMapping("/getProjectRedPacketMoney")
|
|
|
+ public TableDataInfo getProjectRedPacketMoney(CourseRedPacketStatisticsParam param) {
|
|
|
+ startPage();
|
|
|
+ LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
+ param.setCompanyId(loginUser.getCompany().getCompanyId());
|
|
|
+ List<RedPacketMoneyVO> list = fsCourseRedPacketLogService.getProjectRedPacketMoney(param);
|
|
|
+ return getDataTable(list);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 导出项目红包消耗统计列表
|
|
|
+ *
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('course:courseRedPacketLog:exportMoneyList')")
|
|
|
+ @GetMapping("/exportMoneyList")
|
|
|
+ public AjaxResult exportMoneyList(CourseRedPacketStatisticsParam param) {
|
|
|
+ LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
+ param.setCompanyId(loginUser.getCompany().getCompanyId());
|
|
|
+ List<RedPacketMoneyVO> list = fsCourseRedPacketLogService.getProjectRedPacketMoney(param);
|
|
|
+ ExcelUtil<RedPacketMoneyVO> util = new ExcelUtil<RedPacketMoneyVO>(RedPacketMoneyVO.class);
|
|
|
+ return util.exportExcel(list, "项目红包消耗统计数据");
|
|
|
+ }
|
|
|
+
|
|
|
}
|