提交 236be874 authored 作者: renjiancai's avatar renjiancai

--no commit message

上级 5d8c6369
package com.zrqx.core.form.resource.bg.videolibrary;
import java.util.List;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@ApiModel(value="QueryVideoLibraryForm",description="视频库")
public class QueryVideoLibraryForm {
@ApiModelProperty(value = "资源名称")
private String name;
@ApiModelProperty("所属图书")
private String bookName;
@ApiModelProperty("状态:0待审核,1已上架,2已下架")
private String status;
@ApiModelProperty(value="上传时间-开始")
@ApiModelProperty(value="所属区域")
private String beginTime;
@ApiModelProperty(value="上传时间-结束")
private String endTime;
@ApiModelProperty(value = "自定义分类id")
private List<Integer> diyTypeId;
@ApiModelProperty("自定义分类code")
private String diyTypeCode;
@ApiModelProperty("主题id")
private String signLanguageId;
}
......@@ -54,5 +54,16 @@ public class VideoLibrary {
private String area_adminId;
@ApiModelProperty(value = "资源类型 2视频 3图片")
private Integer resourceType;
/**新添加字段**/
@ApiModelProperty(value = "推荐")
private Integer recommendNum;
@ApiModelProperty("视频说明")
private String videoText;
@ApiModelProperty("任务说明")
private String taskText;
@ApiModelProperty("点评")
private String commentary;
@ApiModelProperty("审核意见")
private String auditMind;
}
......@@ -64,14 +64,14 @@ public class ExcellentVideoController {
User user = userService.selectByPrimaryKey(video.getUserId());
vo.setImg(user.getImg());
vo.setName(user.getName());
/*//查询当前用户所属区域部门
//查询当前用户所属区域部门
Integer deptId = userService.getDeptIdByUserId(video.getUserId()).get(0);
if(deptId != null) {
DeptVO deptVO = departmentService.get(deptId);
if(deptVO != null) {
vo.setDepartment(deptVO.getDeptName());
}
}*/
}
return CallBack.success(vo);
}
@ApiOperation(value = "批量 上线/下线", notes = "批量 0下线、 1上线 ")
......
package com.zrqx.sysuser.bg.controller.resource;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import java.util.Date;
import java.util.List;
......@@ -17,9 +14,8 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import tk.mybatis.mapper.entity.Example;
import com.zrqx.core.constant.resource.ResourceRequestPath;
import com.zrqx.core.constant.sysuser.SysUserRequestPath;
import com.zrqx.core.enums.resource.LibraryStatusEnum;
import com.zrqx.core.enums.sysuser.SignStatusEnum;
import com.zrqx.core.enums.sysuser.UserTypeEnum;
......@@ -27,6 +23,7 @@ import com.zrqx.core.exception.BusinessValidateException;
import com.zrqx.core.exception.ParameterValidateException;
import com.zrqx.core.form.resource.bg.videolibrary.BatchUpdateVideoLibraryForm;
import com.zrqx.core.form.resource.bg.videolibrary.UpdateVideoLibraryForm;
import com.zrqx.core.model.community.ExcellentVideo;
import com.zrqx.core.model.resource.videolibrary.VideoLibrary;
import com.zrqx.core.model.sysuser.content.SignLanguage;
import com.zrqx.core.model.sysuser.content.SignLanguageRelation;
......@@ -37,12 +34,18 @@ import com.zrqx.core.util.response.CallBack;
import com.zrqx.core.vo.resource.videolibrary.VideoLibraryListVO;
import com.zrqx.core.vo.resource.videolibrary.VideoLibraryOneVO;
import com.zrqx.sysuser.bg.service.comment.CommentService;
import com.zrqx.sysuser.bg.service.community.ExcellentVideoService;
import com.zrqx.sysuser.bg.service.content.SignLanguageRelationService;
import com.zrqx.sysuser.bg.service.content.SignLanguageService;
import com.zrqx.sysuser.bg.service.content.SignLanguageUserRelationService;
import com.zrqx.sysuser.bg.service.resource.VideoLibraryService;
import com.zrqx.sysuser.bg.service.user.UserService;
import com.zrqx.sysuser.commons.redis.Redis;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import tk.mybatis.mapper.entity.Example;
/**
* 资源Controller
*/
......@@ -64,6 +67,10 @@ public class ResourceLibraryController {
private SignLanguageUserRelationService signLanguageUserRelationService;
@Autowired
private Redis redis;
@Autowired
private ExcellentVideoService excellentVideoService;
@Autowired
private UserService userService;
@ApiOperation(value = "查询", notes = "根据ID查询")
@GetMapping(value = ResourceRequestPath.GET_OID)
......@@ -314,6 +321,30 @@ public class ResourceLibraryController {
}
}
}
@ApiOperation(value = "添加推荐", notes = "添加推荐")
@PostMapping(value = SysUserRequestPath.UPDATE)
public CallBack<Boolean> save(@PathVariable String oid) {
VideoLibrary videoLibrary = service.selectByPrimaryKey(oid);
if(videoLibrary.getRecommendNum()<3) {
videoLibrary.setRecommendNum(videoLibrary.getRecommendNum()+1);
service.updateByPrimaryKeySelective(videoLibrary);
if(videoLibrary.getRecommendNum()>=3) {
User user = userService.selectByPrimaryKey(videoLibrary.getUserId());
ExcellentVideo excellentVideo = new ExcellentVideo();
excellentVideo.setTitle(videoLibrary.getName());
excellentVideo.setText(videoLibrary.getVideoText());
excellentVideo.setUserId(videoLibrary.getUserId());
excellentVideo.setUserName(user.getUserName());
excellentVideo.setVideo(videoLibrary.getVideo());
excellentVideo.setObjectId(videoLibrary.getId());
excellentVideo.setUploadTime(new Date());
excellentVideo.setSignId(videoLibrary.getSignLanguageId());
excellentVideo.setCommentary(videoLibrary.getCommentary());
excellentVideoService.insert(excellentVideo);
}
}
return CallBack.success(true);
}
}
......@@ -66,7 +66,8 @@ public interface VideoLibraryMapper extends BaseMapper<VideoLibrary> {
Integer getVideoCount();
@Select("<script>"
+ "SELECT v.id,de.departmentName,de.departmentId,count(v.id) as doneCount,COUNT(v.id) as videoCount ,count(ex.id) as excellentVideo FROM res_video_library v "
+ "LEFT JOIN sys_user_department ud on v.userId=ud.userid LEFT JOIN sys_department de on de.departmentid=ud.departmentid "
+ "LEFT JOIN sys_user_department ud on v.userId=ud.userid "
+ "LEFT JOIN sys_department de on de.departmentid=ud.departmentid "
+ "LEFT JOIN sys_excellent_video ex on ex.userid=ud.userid WHERE 1=1 and v.status=1"
+ "<if test = '" + NOTBLANK + "(form.beginTime)'>"
+ "and v.uploadTime &gt;= concat(#{form.beginTime}, ' 00:00:00' )"
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论