|
|
@@ -25,6 +25,7 @@ import org.springframework.web.bind.annotation.GetMapping;
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
+import vip.xiaonuo.auth.core.util.StpLoginUserUtil;
|
|
|
import vip.xiaonuo.common.annotation.CommonLog;
|
|
|
import vip.xiaonuo.common.pojo.CommonResult;
|
|
|
import vip.xiaonuo.common.pojo.CommonValidList;
|
|
|
@@ -47,12 +48,12 @@ import javax.validation.constraints.NotEmpty;
|
|
|
import java.util.*;
|
|
|
|
|
|
/**
|
|
|
- * 课程审核记录表控制器
|
|
|
+ * 资源管理控制器
|
|
|
*
|
|
|
* @author honorfire
|
|
|
* @date 2025/06/20 14:58
|
|
|
*/
|
|
|
-@Api(tags = "课程审核记录表控制器")
|
|
|
+@Api(tags = "资源管理控制器")
|
|
|
@ApiSupport(author = "SNOWY_TEAM", order = 1)
|
|
|
@RestController
|
|
|
@Validated
|
|
|
@@ -72,13 +73,13 @@ public class CourseAuditRecordController {
|
|
|
|
|
|
|
|
|
/**
|
|
|
- * 获取课程审核记录表分页
|
|
|
+ * 资源管理-分页列表
|
|
|
*
|
|
|
* @author honorfire
|
|
|
* @date 2025/06/20 14:58
|
|
|
*/
|
|
|
@ApiOperationSupport(order = 1)
|
|
|
- @ApiOperation("获取课程审核记录表分页")
|
|
|
+ @ApiOperation("资源管理-分页列表")
|
|
|
@SaCheckPermission("/disk/courseauditrecord/page")
|
|
|
@GetMapping("/disk/courseauditrecord/page")
|
|
|
public CommonResult<Page<Map<String,Object>>> page(CourseAuditRecordPageParam courseAuditRecordPageParam, HttpServletRequest req) {
|
|
|
@@ -99,15 +100,64 @@ public class CourseAuditRecordController {
|
|
|
return CommonResult.data(list);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 资源中心-分页列表
|
|
|
+ *
|
|
|
+ * @author honorfire
|
|
|
+ * @date 2025/06/20 14:58
|
|
|
+ */
|
|
|
+ @ApiOperationSupport(order = 1)
|
|
|
+ @ApiOperation("资源中心-分页列表")
|
|
|
+ @SaCheckPermission("/disk/resourcecentre/page")
|
|
|
+ @GetMapping("/disk/resourcecentre/page")
|
|
|
+ public CommonResult<Page<Map<String,Object>>> resourcecentrePage(CourseAuditRecordPageParam courseAuditRecordPageParam, HttpServletRequest req) {
|
|
|
+ Map param =new HashMap();
|
|
|
+ //资源中心排序标识,0最新,1热门,默认为0
|
|
|
+ String sortflag="0";
|
|
|
+ if(StringUtils.isNotEmpty(req.getParameter("queryFlag")))sortflag=req.getParameter("sortflag");
|
|
|
+ param.put("sortflag", sortflag);
|
|
|
+ //资源中心功能标识,0默认,1资源推荐,2相关资源
|
|
|
+ String funcType="0";
|
|
|
+ if(StringUtils.isNotEmpty(req.getParameter("funcType")))funcType=req.getParameter("funcType");
|
|
|
+ param.put("funcType", funcType);
|
|
|
+ if("2".equals(funcType))
|
|
|
+ {
|
|
|
+ String userId=StpLoginUserUtil.getLoginUser().getId();
|
|
|
+ }
|
|
|
+
|
|
|
+ //资源中心必须全部是审核通过已发布的
|
|
|
+ String verifyStatus="2";
|
|
|
+ param.put("verifyStatus", verifyStatus);
|
|
|
+ //检索信息
|
|
|
+ if(StringUtils.isNotEmpty(req.getParameter("queryInfo")))
|
|
|
+ {
|
|
|
+ //信息检索会从多个方面触发,用or连接,分别检索资源名称,资源名称,资源拼音,关键词,关键词拼音,老师名称
|
|
|
+ String queryInfo=req.getParameter("queryInfo");
|
|
|
+ param.put("queryInfo", queryInfo);
|
|
|
+ String queryInfoPinyin=StringUtils.deleteWhitespace(pinyinUtils.toPinyin(queryInfo));
|
|
|
+ param.put("queryInfoPinyin", queryInfoPinyin);
|
|
|
+ }
|
|
|
+
|
|
|
+ param.put("collegeId", req.getParameter("collegeId"));
|
|
|
+ param.put("collegeTwoId", req.getParameter("collegeTwoId"));
|
|
|
+ param.put("collegeThreeId", req.getParameter("collegeThreeId"));
|
|
|
+ param.put("majorId", req.getParameter("majorId"));
|
|
|
+ param.put("courseType", req.getParameter("courseType"));
|
|
|
+ param.put("suffix", req.getParameter("suffix"));
|
|
|
+ Page<Map<String,Object>> list=courseAuditRecordService.queryList(param);
|
|
|
+ return CommonResult.data(list);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
- * 课程审核记录表-添加
|
|
|
+ * 资源管理-添加
|
|
|
*
|
|
|
* @author honorfire
|
|
|
* @date 2025/06/20 14:58
|
|
|
*/
|
|
|
@ApiOperationSupport(order = 2)
|
|
|
- @ApiOperation("课程审核记录表-添加")
|
|
|
- @CommonLog("课程审核记录表-添加")
|
|
|
+ @ApiOperation("资源管理-添加")
|
|
|
+ @CommonLog("资源管理-添加")
|
|
|
@SaCheckPermission("/disk/courseauditrecord/add")
|
|
|
@PostMapping("/disk/courseauditrecord/add")
|
|
|
public CommonResult<String> add(@RequestBody @Valid CourseAuditRecordAddParam courseAuditRecordAddParam) {
|
|
|
@@ -131,14 +181,14 @@ public class CourseAuditRecordController {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 课程审核记录-编辑
|
|
|
+ * 资源管理-编辑
|
|
|
*
|
|
|
* @author honorfire
|
|
|
* @date 2025/06/20 14:58
|
|
|
*/
|
|
|
@ApiOperationSupport(order = 3)
|
|
|
- @ApiOperation("课程审核记录-编辑")
|
|
|
- @CommonLog("编辑课程审核记录表")
|
|
|
+ @ApiOperation("资源管理-编辑")
|
|
|
+ @CommonLog("资源管理-编辑")
|
|
|
@SaCheckPermission("/disk/courseauditrecord/edit")
|
|
|
@PostMapping("/disk/courseauditrecord/edit")
|
|
|
public CommonResult<String> edit(@RequestBody @Valid CourseAuditRecordEditParam courseAuditRecordEditParam) {
|
|
|
@@ -149,14 +199,14 @@ public class CourseAuditRecordController {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 课程审核记录-修改状态
|
|
|
+ * 资源管理-修改状态
|
|
|
*
|
|
|
* @author honorfire
|
|
|
* @date 2025/06/20 14:58
|
|
|
*/
|
|
|
@ApiOperationSupport(order = 3)
|
|
|
- @ApiOperation("课程审核记录-修改状态")
|
|
|
- @CommonLog("课程审核记录-修改状态")
|
|
|
+ @ApiOperation("资源管理-修改状态")
|
|
|
+ @CommonLog("资源管理-修改状态")
|
|
|
@SaCheckPermission("/disk/courseauditrecord/updateStatus")
|
|
|
@PostMapping("/disk/courseauditrecord/updateStatus")
|
|
|
public CommonResult<String> updateStatus(@RequestBody @Valid CourseAuditRecordEditParam courseAuditRecordEditParam) {
|
|
|
@@ -172,16 +222,26 @@ public class CourseAuditRecordController {
|
|
|
}
|
|
|
|
|
|
//修改审核状态需要同步改变课程状态(2025.6.26废弃)
|
|
|
- //1.查回课程审核记录设置审核状态
|
|
|
- CourseAuditRecord courseAuditRecord=courseAuditRecordService.queryEntity(courseAuditRecordEditParam.getId());
|
|
|
- courseAuditRecord.setVerifyStatus(courseAuditRecordEditParam.getVerifyStatus());
|
|
|
- courseAuditRecordService.editOne(courseAuditRecord);
|
|
|
- //2.查回对应课程信息
|
|
|
- CourseInfo courseInfo=courseInfoService.queryEntity(courseAuditRecord.getCourseId());
|
|
|
+ //批量处理资源管理击状态
|
|
|
+ String idsStr=courseAuditRecordEditParam.getIds();
|
|
|
+ String[] idList = idsStr.split(",");
|
|
|
+ List<CourseAuditRecord> courseAuditRecordList = new ArrayList<>();
|
|
|
+ for (String id : idList) {
|
|
|
+ //1.查回课程审核记录(资源管理)设置审核状态以及相关信息
|
|
|
+ CourseAuditRecord courseAuditRecord=courseAuditRecordService.queryEntity(id);
|
|
|
+ if("1".equals(courseAuditRecordEditParam.getVerifyStatus()))courseAuditRecord.setResourceDesc(courseAuditRecordEditParam.getResourceDesc());
|
|
|
+ if("1".equals(courseAuditRecordEditParam.getVerifyStatus()))courseAuditRecord.setCoverImage(courseAuditRecordEditParam.getCoverImage());
|
|
|
+ courseAuditRecord.setVerifyStatus(courseAuditRecordEditParam.getVerifyStatus());
|
|
|
+ courseAuditRecordList.add(courseAuditRecord);
|
|
|
+ }
|
|
|
+ courseAuditRecordService.editBatch(courseAuditRecordList);
|
|
|
+
|
|
|
+ //2.查回对应课程信息(2025.6.27废弃,课程和资源解耦,不在强绑定)
|
|
|
+// CourseInfo courseInfo=courseInfoService.queryEntity(courseAuditRecord.getCourseId());
|
|
|
//设置审核状态(2025.6.26废弃)
|
|
|
// courseInfo.setVerifyStatus(courseAuditRecord.getVerifyStatus());
|
|
|
// if("2".equals(courseAuditRecordEditParam.getVerifyStatus()))courseInfo.setPublishTime(new Date());
|
|
|
- //查看是否课程有关联资源(2025.6.27废弃,课程和资源解耦,不在强绑定)
|
|
|
+ //查看是否课程有关联资源
|
|
|
// Map queryRelateParam = new HashMap();
|
|
|
// queryRelateParam.put("courseId", courseInfo.getCourseId());
|
|
|
// queryRelateParam.put("verifyStatus", "2");
|
|
|
@@ -200,14 +260,31 @@ public class CourseAuditRecordController {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 删除课程审核记录表
|
|
|
+ * 资源中心-添加浏览次数
|
|
|
+ *
|
|
|
+ * @author honorfire
|
|
|
+ * @date 2025/06/20 14:58
|
|
|
+ */
|
|
|
+ @ApiOperationSupport(order = 3)
|
|
|
+ @ApiOperation("资源中心-添加浏览次数")
|
|
|
+ @CommonLog("资源中心-添加浏览次数")
|
|
|
+ @SaCheckPermission("/disk/courseauditrecord/addViewCount")
|
|
|
+ @PostMapping("/disk/courseauditrecord/addViewCount")
|
|
|
+ public CommonResult<String> addViewCount(@RequestBody @Valid CourseAuditRecordEditParam courseAuditRecordEditParam) {
|
|
|
+ CourseAuditRecord courseAuditRecord=courseAuditRecordService.queryEntity(courseAuditRecordEditParam.getId());
|
|
|
+ courseAuditRecord.setViewCount(String.valueOf(Integer.valueOf(courseAuditRecord.getViewCount())+1));
|
|
|
+ return CommonResult.ok();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 资源管理-删除
|
|
|
*
|
|
|
* @author honorfire
|
|
|
* @date 2025/06/20 14:58
|
|
|
*/
|
|
|
@ApiOperationSupport(order = 4)
|
|
|
- @ApiOperation("删除课程审核记录表")
|
|
|
- @CommonLog("删除课程审核记录表")
|
|
|
+ @ApiOperation("资源管理-删除")
|
|
|
+ @CommonLog("资源管理-删除")
|
|
|
@SaCheckPermission("/disk/courseauditrecord/delete")
|
|
|
@PostMapping("/disk/courseauditrecord/delete")
|
|
|
public CommonResult<String> delete(@RequestBody @Valid @NotEmpty(message = "集合不能为空")
|
|
|
@@ -217,13 +294,13 @@ public class CourseAuditRecordController {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 获取课程审核记录表详情
|
|
|
+ * 资源管理-详情
|
|
|
*
|
|
|
* @author honorfire
|
|
|
* @date 2025/06/20 14:58
|
|
|
*/
|
|
|
@ApiOperationSupport(order = 5)
|
|
|
- @ApiOperation("获取课程审核记录表详情")
|
|
|
+ @ApiOperation("资源管理-详情")
|
|
|
@SaCheckPermission("/disk/courseauditrecord/detail")
|
|
|
@GetMapping("/disk/courseauditrecord/detail")
|
|
|
public CommonResult<Map<String,Object>> detail(@Valid CourseAuditRecordIdParam courseAuditRecordIdParam, HttpServletRequest req) {
|
|
|
@@ -233,4 +310,20 @@ public class CourseAuditRecordController {
|
|
|
return CommonResult.data(result);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 资源中心-详情
|
|
|
+ *
|
|
|
+ * @author honorfire
|
|
|
+ * @date 2025/06/20 14:58
|
|
|
+ */
|
|
|
+ @ApiOperationSupport(order = 5)
|
|
|
+ @ApiOperation("资源中心-详情")
|
|
|
+ @SaCheckPermission("/disk/resourcecentre/detail")
|
|
|
+ @GetMapping("/disk/resourcecentre/detail")
|
|
|
+ public CommonResult<Map<String,Object>> resourcecentreDetail(@Valid CourseAuditRecordIdParam courseAuditRecordIdParam, HttpServletRequest req) {
|
|
|
+ Map param =new HashMap();
|
|
|
+ param.put("id", req.getParameter("id"));
|
|
|
+ Map<String,Object> result=courseAuditRecordService.queryInfo(param);
|
|
|
+ return CommonResult.data(result);
|
|
|
+ }
|
|
|
}
|