提交 eb364cf0 authored 作者: liupengfei's avatar liupengfei

--no commit message

上级 553440c9
package com.zrqx.resource.bg.controller.videolibrary; package com.zrqx.resource.bg.controller.videolibrary;
import java.math.BigDecimal;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
...@@ -17,26 +17,21 @@ import org.springframework.web.bind.annotation.RequestMapping; ...@@ -17,26 +17,21 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import com.zrqx.core.enums.resource.LibraryStatusEnum; import com.zrqx.core.enums.resource.LibraryStatusEnum;
import com.zrqx.core.enums.resource.PriceOptionEnum;
import com.zrqx.core.exception.BaseException; import com.zrqx.core.exception.BaseException;
import com.zrqx.core.util.page.PageInfo; import com.zrqx.core.util.page.PageInfo;
import com.zrqx.core.util.page.PageParam; import com.zrqx.core.util.page.PageParam;
import com.zrqx.core.util.response.CallBack; import com.zrqx.core.util.response.CallBack;
import com.zrqx.resource.bg.service.ResourceRelationService;
import com.zrqx.resource.bg.service.marketing.PromotionContentService;
import com.zrqx.resource.bg.service.recommend.RecommendResourceService; import com.zrqx.resource.bg.service.recommend.RecommendResourceService;
import com.zrqx.resource.bg.service.videolibrary.VideoLibraryDiyTypeService; import com.zrqx.resource.bg.service.videolibrary.VideoLibraryDiyTypeService;
import com.zrqx.resource.bg.service.videolibrary.VideoLibraryLabelContentDiyTypeService;
import com.zrqx.resource.bg.service.videolibrary.VideoLibraryService; import com.zrqx.resource.bg.service.videolibrary.VideoLibraryService;
import com.zrqx.resource.commons.form.bg.QueryResourceForPoPForm;
import com.zrqx.resource.commons.form.bg.recommend.UpdateRecommendResourceForm; import com.zrqx.resource.commons.form.bg.recommend.UpdateRecommendResourceForm;
import com.zrqx.resource.commons.form.bg.videolibrary.BatchUpdateVideoLibraryForm; import com.zrqx.resource.commons.form.bg.videolibrary.BatchUpdateVideoLibraryForm;
import com.zrqx.resource.commons.form.bg.videolibrary.QueryVideoLibraryForm; import com.zrqx.resource.commons.form.bg.videolibrary.QueryVideoLibraryForm;
import com.zrqx.resource.commons.form.bg.videolibrary.SaveUpdateVideoLibraryForm; import com.zrqx.resource.commons.form.bg.videolibrary.SaveUpdateVideoLibraryForm;
import com.zrqx.resource.commons.form.bg.videolibrary.SaveVideoLibraryForm; import com.zrqx.resource.commons.form.bg.videolibrary.SaveVideoLibraryForm;
import com.zrqx.resource.commons.model.marketing.PromotionContent;
import com.zrqx.resource.commons.model.videolibrary.VideoLibrary; import com.zrqx.resource.commons.model.videolibrary.VideoLibrary;
import com.zrqx.resource.commons.model.videolibrary.VideoLibraryDiyType; import com.zrqx.resource.commons.model.videolibrary.VideoLibraryDiyType;
import com.zrqx.resource.commons.model.videolibrary.VideoLibraryLabelContentDiyType;
import com.zrqx.resource.commons.vo.bg.videolibrary.VideoLibraryListVO; import com.zrqx.resource.commons.vo.bg.videolibrary.VideoLibraryListVO;
import com.zrqx.resource.commons.vo.bg.videolibrary.VideoLibraryOneVO; import com.zrqx.resource.commons.vo.bg.videolibrary.VideoLibraryOneVO;
...@@ -56,58 +51,40 @@ public class VideoLibraryController { ...@@ -56,58 +51,40 @@ public class VideoLibraryController {
private VideoLibraryService service; private VideoLibraryService service;
@Autowired @Autowired
private VideoLibraryDiyTypeService vdrService; private VideoLibraryDiyTypeService vdrService;
@Autowired
private ResourceRelationService resourceRelationService;
/** 推荐位内容*/ /** 推荐位内容*/
@Autowired @Autowired
private RecommendResourceService recommendResourceService; private RecommendResourceService recommendResourceService;
/** 促销内容*/
@Autowired
private PromotionContentService promotionContentService;
@Autowired
private VideoLibraryLabelContentDiyTypeService alcdService;
@ApiOperation(value = "新增" , notes ="新增一个") @ApiOperation(value = "新增/修改 视频资源" , notes ="新增/修改 视频资源")
@PostMapping(value = "/save") @PostMapping(value = "/save")
public CallBack<Boolean> save(@RequestBody SaveUpdateVideoLibraryForm form){ public CallBack<Boolean> save(@RequestBody SaveUpdateVideoLibraryForm form){
if(!service.saveOrUpdate(form)){ if(!service.saveOrUpdate(form)){
throw new BaseException("操作失败"); throw new BaseException("操作失败");
} }
if(StringUtils.isNotBlank(form.getId())) {
VideoLibrary entity = service.selectByPrimaryKey(form.getId());
//推荐位内容修改
UpdateRecommendResourceForm res = new UpdateRecommendResourceForm();
res.setResId(form.getId());
res.setResType(entity.getResourceType());
res.setResImg(form.getImg());
res.setResName(form.getName());
recommendResourceService.updateResourceContent(res);
}
return CallBack.success(); return CallBack.success();
} }
@ApiOperation(value = "导入视频" , notes ="导入视频") @ApiOperation(value = "导入视频" , notes ="导入视频")
@PostMapping(value = "/import") @PostMapping(value = "/import")
public CallBack<Boolean> save(@RequestBody SaveVideoLibraryForm form){ public CallBack<Boolean> save(@RequestBody List<SaveVideoLibraryForm> form){
if(!service.batchInsert(form)){ if(!service.batchInsert(form)){
throw new BaseException("操作失败"); throw new BaseException("操作失败");
} }
return CallBack.success(); return CallBack.success();
} }
@ApiOperation(value = "更新" , notes ="根据ID更新")
@PostMapping(value = "/update")
public CallBack<Boolean> update(@RequestBody SaveUpdateVideoLibraryForm form){
if(!service.saveOrUpdate(form)){
throw new BaseException("操作失败");
}
VideoLibrary entity = service.selectByPrimaryKey(form.getId());
//促销活动内容修改
PromotionContent con = new PromotionContent();
con.setResourceId(form.getId());
con.setResourceType(entity.getResourceType());
con.setName(form.getName());
promotionContentService.updateContent(con);
//推荐位内容修改
UpdateRecommendResourceForm res = new UpdateRecommendResourceForm();
res.setResId(form.getId());
res.setResType(entity.getResourceType());
res.setResImg(form.getCover());
res.setResName(form.getName());
recommendResourceService.updateResourceContent(res);
return CallBack.success();
}
@ApiOperation(value = "批量修改分类", notes = "批量修改分类") @ApiOperation(value = "批量修改分类", notes = "批量修改分类")
@PostMapping(value = "/batch/update/diytype") @PostMapping(value = "/batch/update/diytype")
...@@ -129,13 +106,19 @@ public class VideoLibraryController { ...@@ -129,13 +106,19 @@ public class VideoLibraryController {
return CallBack.success(); return CallBack.success();
} }
@ApiOperation(value = "批量修改价格" , notes ="批量修改价格") @ApiOperation(value = "批量修改销售设置" , notes ="批量修改销售设置")
@PostMapping(value = "/batch/update/price") @PostMapping(value = "/batch/update/price")
public CallBack<Boolean> updatePrice(@RequestBody BatchUpdateVideoLibraryForm form){ public CallBack<Boolean> updatePrice(@RequestBody BatchUpdateVideoLibraryForm form){
Example example = service.createExample(); Example example = service.createExample();
example.createCriteria().andIn("id", form.getIds()); example.createCriteria().andIn("id", form.getIds());
VideoLibrary entity = new VideoLibrary(); VideoLibrary entity = new VideoLibrary();
if(PriceOptionEnum.STATUS_0.getCode().equals(form.getPriceOption())) {
form.setRealPrice(new BigDecimal(0));
}
entity.setRealPrice(form.getRealPrice()); entity.setRealPrice(form.getRealPrice());
entity.setPrice(form.getPrice());
entity.setPriceOption(form.getPriceOption());
entity.setSalesType(form.getSaleType());
entity.setUpdateTime(new Date()); entity.setUpdateTime(new Date());
if(!service.UpdateByExampleSelective(entity,example)){ if(!service.UpdateByExampleSelective(entity,example)){
throw new BaseException("操作失败"); throw new BaseException("操作失败");
...@@ -143,37 +126,20 @@ public class VideoLibraryController { ...@@ -143,37 +126,20 @@ public class VideoLibraryController {
return CallBack.success(); return CallBack.success();
} }
@ApiOperation(value = "批量审核", notes = "批量审核")
@PostMapping(value = "/batch/update/status")
public CallBack<Boolean> updateArray(@RequestBody List<String> ids) {
Example example = service.createExample();
example.createCriteria().andIn("id", ids);
VideoLibrary entity = new VideoLibrary();
entity.setUpdateTime(new Date());
entity.setStatus(LibraryStatusEnum.STATUS_1.getCode());
if (!service.UpdateByExampleSelective(entity,example)) {
throw new BaseException("操作失败");
}
return CallBack.success();
}
@ApiOperation(value = "批量 上架/下架" , notes ="批量 上架/下架") @ApiOperation(value = "批量 上架/下架" , notes ="批量 上架/下架")
@PostMapping(value = "/batch/update/updown") @PostMapping(value = "/batch/update/updown")
public CallBack<Boolean> updateShowState(@RequestBody BatchUpdateVideoLibraryForm form){ public CallBack<Boolean> updateShowState(@RequestBody BatchUpdateVideoLibraryForm form){
Example example = service.createExample(); Example example = service.createExample();
example.createCriteria().andIn("id", form.getIds()); example.createCriteria().andIn("id", form.getIds());
List<VideoLibrary> list = service.selectByExample(example); List<VideoLibrary> list = service.selectByExample(example);
for (VideoLibrary entity : list) { list.forEach(f -> {
if(entity.getStatus() == LibraryStatusEnum.STATUS_0.getCode()){ f.setStatus(form.getStatus());
throw new BaseException("待审核状态的文章不能直接操作上架状态需通过批量审核操作上架"); f.setUpdateTime(new Date());
} if(LibraryStatusEnum.STATUS_2.getCode().equals(form.getStatus())) {
} f.setCourseId(null);
VideoLibrary entity = new VideoLibrary();
entity.setStatus(form.getStatus());
entity.setUpdateTime(new Date());
if(!service.UpdateByExampleSelective(entity,example)){
throw new BaseException("操作失败");
} }
service.updateByPrimaryKey(f);
});
return CallBack.success(); return CallBack.success();
} }
...@@ -189,6 +155,7 @@ public class VideoLibraryController { ...@@ -189,6 +155,7 @@ public class VideoLibraryController {
} }
return CallBack.success(true); return CallBack.success(true);
} }
@ApiOperation(value = "批量删除", notes = "批量删除") @ApiOperation(value = "批量删除", notes = "批量删除")
@PostMapping(value = "/batch/delete") @PostMapping(value = "/batch/delete")
public CallBack<Boolean> deleteByIds(@RequestBody List<String> ids) { public CallBack<Boolean> deleteByIds(@RequestBody List<String> ids) {
...@@ -217,14 +184,6 @@ public class VideoLibraryController { ...@@ -217,14 +184,6 @@ public class VideoLibraryController {
List<VideoLibraryDiyType> list = vdrService.selectByExample(example); List<VideoLibraryDiyType> list = vdrService.selectByExample(example);
//组装自定义分类 //组装自定义分类
vo.setDiyType(list); vo.setDiyType(list);
//组装标签分类
example = alcdService.createExample();
example.createCriteria().andEqualTo("videoId", oid);
List<VideoLibraryLabelContentDiyType> vlcdList = alcdService.selectByExample(example);
vo.setLabel(vlcdList);
// 选中的LabelContentDiyTypeId
List<Integer> labelContentDiyTypeIds = vlcdList.stream().map(VideoLibraryLabelContentDiyType :: getLabelContentDiyTypeId).collect(Collectors.toList());
vo.setLabelContentDiyTypeIds(labelContentDiyTypeIds);
return CallBack.success(vo); return CallBack.success(vo);
} }
...@@ -234,22 +193,4 @@ public class VideoLibraryController { ...@@ -234,22 +193,4 @@ public class VideoLibraryController {
return CallBack.success(service.page(form, pageParam)); return CallBack.success(service.page(form, pageParam));
} }
@ApiOperation(value = "选择弹窗中的列表" , notes ="查询选择弹窗中的列表")
@GetMapping(value = "/relation-resource/pop-page")
public CallBack<PageInfo<VideoLibraryListVO>> page(QueryResourceForPoPForm form, PageParam pageParam){
return CallBack.success(service.pageByTitleAndDiyType(form, pageParam));
}
@ApiOperation(value = "批量修改阅读权限", notes = "批量修改阅读权限")
@PostMapping(value = "/batch/update/read")
public CallBack<Boolean> updateReadTextPower(@RequestBody BatchUpdateVideoLibraryForm form) {
Example example = service.createExample();
example.createCriteria().andIn("id", form.getIds());
VideoLibrary entity = new VideoLibrary();
entity.setReadTextPower(form.getReadTextPower());
if (!service.UpdateByExampleSelective(entity,example)) {
throw new BaseException("操作失败");
}
return CallBack.success();
}
} }
...@@ -8,16 +8,18 @@ import org.apache.ibatis.annotations.Select; ...@@ -8,16 +8,18 @@ import org.apache.ibatis.annotations.Select;
import com.zrqx.core.mapper.BaseMapper; import com.zrqx.core.mapper.BaseMapper;
import com.zrqx.resource.commons.form.bg.QueryResourceForPoPForm; import com.zrqx.resource.commons.form.bg.QueryResourceForPoPForm;
import com.zrqx.resource.commons.form.bg.courselibrary.QueryCourseAndVideoForm;
import com.zrqx.resource.commons.form.bg.courselibrary.QueryCourseLibraryForm; import com.zrqx.resource.commons.form.bg.courselibrary.QueryCourseLibraryForm;
import com.zrqx.resource.commons.model.courcelibrary.CourseLibrary; import com.zrqx.resource.commons.model.courcelibrary.CourseLibrary;
import com.zrqx.resource.commons.vo.bg.courselibrary.CourseLibraryListVO; import com.zrqx.resource.commons.vo.bg.courselibrary.CourseLibraryListVO;
import com.zrqx.resource.commons.vo.bg.videolibrary.VideoLibraryListVO;
/** /**
* 课程库 * 课程库
*/ */
public interface CourseLibraryMapper extends BaseMapper<CourseLibrary> { public interface CourseLibraryMapper extends BaseMapper<CourseLibrary> {
@Select("<script>" @Select("<script>"
+ "select a.id,a.name,a.author,a.source,a.cover,a.realPrice,DATE_FORMAT(a.authorizationTime,'%Y-%m-%d %H:%i:%s') authorizationTime, DATE_FORMAT(a.uploadTime,'%Y-%m-%d %H:%i:%s') uploadTime,a.status,a.resourceType " + "select a.id,a.name,a.author,a.img,a.realPrice, DATE_FORMAT(a.uploadTime,'%Y-%m-%d %H:%i') uploadTime,a.status,a.resourceType "
+ "from res_Course_Library a left join res_Course_Library_Diy_Type ad " + "from res_Course_Library a left join res_Course_Library_Diy_Type ad "
+ "on a.id = ad.CourseLibraryId " + "on a.id = ad.CourseLibraryId "
+ "where 1=1 " + "where 1=1 "
...@@ -54,4 +56,30 @@ public interface CourseLibraryMapper extends BaseMapper<CourseLibrary> { ...@@ -54,4 +56,30 @@ public interface CourseLibraryMapper extends BaseMapper<CourseLibrary> {
+ "</if>" + "</if>"
+ "</script>") + "</script>")
List<CourseLibraryListVO> queryByTileAndDiyType(@Param("form")QueryResourceForPoPForm form); List<CourseLibraryListVO> queryByTileAndDiyType(@Param("form")QueryResourceForPoPForm form);
/**
* 根据课程id查询关联视频
* @param courseId
* @return
*/
@Select("<script>"
+ "select id,name,timeLength,sort,status from res_video_library "
+ " where 1 = 1 and status = 1 and courseId = #{courseId}"
+ " order by sort asc,uploadTime desc "
+ "</script>")
List<VideoLibraryListVO> videoRelationPage(@Param("courseId")String courseId);
/**
* 查询未关联视频列表
* @param form
* @return
*/
@Select("<script>"
+ " select id,name,author,DATE_FORMAT(uploadTime,'%Y-%m-%d %H:%i') uploadTime,status from res_video_library "
+ " where 1 = 1 and status = 1 and courseId is null and salesType = 2 "
+ " like(name,form.name) "
+ " like(author,form.author) "
+ " order by uploadTime desc "
+ "</script>")
List<VideoLibraryListVO> popPage(@Param("form")QueryCourseAndVideoForm form);
} }
...@@ -16,12 +16,10 @@ import com.zrqx.resource.commons.vo.bg.videolibrary.VideoLibraryListVO; ...@@ -16,12 +16,10 @@ import com.zrqx.resource.commons.vo.bg.videolibrary.VideoLibraryListVO;
*/ */
public interface VideoLibraryMapper extends BaseMapper<VideoLibrary> { public interface VideoLibraryMapper extends BaseMapper<VideoLibrary> {
@Select("<script>" @Select("<script>"
+ "select a.id,a.name,a.source,a.bookName,a.realprice,a.timeLength,a.size,a.uploadTime,a.status " + "select a.id,a.name,a.realprice, DATE_FORMAT(a.uploadTime,'%Y-%m-%d %H:%i') uploadTime,a.status,a.img,a.defaultImg,a.author "
+ "from res_Video_Library a left join res_Video_Library_Diy_Type ad " + "from res_Video_Library a left join res_Video_Library_Diy_Type ad "
+ "on a.id = ad.vlid " + "on a.id = ad.vlid "
+ "where 1=1 " + "where 1=1 "
+ " eq(a.nationsType,form.nationsType) "
+ " like(ad.code,form.diyTypeCode) " + " like(ad.code,form.diyTypeCode) "
/*+ "<if test='form.diyTypeId != null and form.diyTypeId.size > 0'>" /*+ "<if test='form.diyTypeId != null and form.diyTypeId.size > 0'>"
...@@ -32,7 +30,6 @@ public interface VideoLibraryMapper extends BaseMapper<VideoLibrary> { ...@@ -32,7 +30,6 @@ public interface VideoLibraryMapper extends BaseMapper<VideoLibrary> {
+ "</if>" */ + "</if>" */
+ " like(a.name,form.name) " + " like(a.name,form.name) "
+ " like(a.bookName,form.bookName) "
+ " eq(a.status,form.status) " + " eq(a.status,form.status) "
//+ "<if test = '" + NOTBLANK + "(form.beginTime)'>" //+ "<if test = '" + NOTBLANK + "(form.beginTime)'>"
...@@ -47,15 +44,12 @@ public interface VideoLibraryMapper extends BaseMapper<VideoLibrary> { ...@@ -47,15 +44,12 @@ public interface VideoLibraryMapper extends BaseMapper<VideoLibrary> {
List<VideoLibraryListVO> query(@Param("form")QueryVideoLibraryForm form); List<VideoLibraryListVO> query(@Param("form")QueryVideoLibraryForm form);
@Select("<script>" @Select("<script>"
+ "select a.id,a.name,a.source,a.author,a.bookName,a.price,a.timeLength,a.size,a.uploadTime,a.status,a.cover " + "select a.id,a.name,a.source,a.author,a.bookName,a.price,a.timeLength,a.size,a.uploadTime,a.status,a.img,a.defautImg "
+ "from res_Video_Library a left join res_Video_Library_Diy_Type ad " + "from res_Video_Library a left join res_Video_Library_Diy_Type ad "
+ "on a.id = ad.vlid " + "on a.id = ad.vlid "
+ "where 1=1 and a.status = 1 " + "where 1=1 and a.status = 1 "
+ " eq(a.nationsType,form.nationsType) "
+ " like(ad.code,form.diyTypeCode) " + " like(ad.code,form.diyTypeCode) "
+ " like(a.name,form.name) " + " like(a.name,form.name) "
+ "<if test='form.ids != null and form.ids.size > 0'>" + "<if test='form.ids != null and form.ids.size > 0'>"
+ "and a.id not in " + "and a.id not in "
+ " <foreach collection=\"form.ids\" index=\"index\" item=\"id\" open=\"(\" separator=\",\" close=\")\">" + " <foreach collection=\"form.ids\" index=\"index\" item=\"id\" open=\"(\" separator=\",\" close=\")\">"
......
...@@ -3,7 +3,6 @@ package com.zrqx.resource.bg.service.courselibrary; ...@@ -3,7 +3,6 @@ package com.zrqx.resource.bg.service.courselibrary;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -27,7 +26,9 @@ import com.zrqx.resource.bg.mapper.membercollection.MemberCollectionMapper; ...@@ -27,7 +26,9 @@ import com.zrqx.resource.bg.mapper.membercollection.MemberCollectionMapper;
import com.zrqx.resource.bg.mapper.recommend.RecommendResourceMapper; import com.zrqx.resource.bg.mapper.recommend.RecommendResourceMapper;
import com.zrqx.resource.bg.mapper.record.RecordMapper; import com.zrqx.resource.bg.mapper.record.RecordMapper;
import com.zrqx.resource.bg.mapper.shoppingcart.ShoppingCartMapper; import com.zrqx.resource.bg.mapper.shoppingcart.ShoppingCartMapper;
import com.zrqx.resource.bg.mapper.videolibrary.VideoLibraryMapper;
import com.zrqx.resource.commons.form.bg.QueryResourceForPoPForm; import com.zrqx.resource.commons.form.bg.QueryResourceForPoPForm;
import com.zrqx.resource.commons.form.bg.courselibrary.QueryCourseAndVideoForm;
import com.zrqx.resource.commons.form.bg.courselibrary.QueryCourseLibraryForm; import com.zrqx.resource.commons.form.bg.courselibrary.QueryCourseLibraryForm;
import com.zrqx.resource.commons.form.bg.courselibrary.SaveUpdateCourseLibraryForm; import com.zrqx.resource.commons.form.bg.courselibrary.SaveUpdateCourseLibraryForm;
import com.zrqx.resource.commons.model.courcelibrary.CourseLibrary; import com.zrqx.resource.commons.model.courcelibrary.CourseLibrary;
...@@ -37,7 +38,9 @@ import com.zrqx.resource.commons.model.membercollection.MemberCollection; ...@@ -37,7 +38,9 @@ import com.zrqx.resource.commons.model.membercollection.MemberCollection;
import com.zrqx.resource.commons.model.record.Record; import com.zrqx.resource.commons.model.record.Record;
import com.zrqx.resource.commons.model.resourcerelation.ResourceRelation; import com.zrqx.resource.commons.model.resourcerelation.ResourceRelation;
import com.zrqx.resource.commons.model.shoppingcart.ShoppingCart; import com.zrqx.resource.commons.model.shoppingcart.ShoppingCart;
import com.zrqx.resource.commons.model.videolibrary.VideoLibrary;
import com.zrqx.resource.commons.vo.bg.courselibrary.CourseLibraryListVO; import com.zrqx.resource.commons.vo.bg.courselibrary.CourseLibraryListVO;
import com.zrqx.resource.commons.vo.bg.videolibrary.VideoLibraryListVO;
import tk.mybatis.mapper.entity.Example; import tk.mybatis.mapper.entity.Example;
...@@ -52,7 +55,7 @@ public class CourseLibrarySerivceImpl extends BaseServiceImpl<CourseLibrary,Stri ...@@ -52,7 +55,7 @@ public class CourseLibrarySerivceImpl extends BaseServiceImpl<CourseLibrary,Stri
@Autowired @Autowired
private CourseLibraryDiyTypeMapper courseLibraryDiyTypeMapper; private CourseLibraryDiyTypeMapper courseLibraryDiyTypeMapper;
@Autowired @Autowired
private CourseLibraryLabelContentDiyTypeMapper courseLibraryLabelContentDiyTypeMapper; private VideoLibraryMapper videoMapper;
@Autowired @Autowired
private RecommendResourceMapper recommendResourceMapper; private RecommendResourceMapper recommendResourceMapper;
@Autowired @Autowired
...@@ -89,10 +92,11 @@ public class CourseLibrarySerivceImpl extends BaseServiceImpl<CourseLibrary,Stri ...@@ -89,10 +92,11 @@ public class CourseLibrarySerivceImpl extends BaseServiceImpl<CourseLibrary,Stri
} }
if(entity.getId() == null){ if(entity.getId() == null){
//添加 //添加
entity.setStatus(LibraryStatusEnum.STATUS_0.getCode()); entity.setStatus(LibraryStatusEnum.STATUS_2.getCode());
entity.setUploadTime(new Date()); entity.setUploadTime(new Date());
entity.setResourceType(AllResourceTypeEnum.COURSE.getCode()); entity.setResourceType(AllResourceTypeEnum.COURSE.getCode());
entity.setBrowseNum(50); entity.setBrowseNum(0);
entity.setSalesNum(0);
mapper.insert(entity); mapper.insert(entity);
}else{ }else{
//修改 //修改
...@@ -102,9 +106,6 @@ public class CourseLibrarySerivceImpl extends BaseServiceImpl<CourseLibrary,Stri ...@@ -102,9 +106,6 @@ public class CourseLibrarySerivceImpl extends BaseServiceImpl<CourseLibrary,Stri
CourseLibraryDiyType old = new CourseLibraryDiyType(); CourseLibraryDiyType old = new CourseLibraryDiyType();
old.setCourseLibraryId(entity.getId()); old.setCourseLibraryId(entity.getId());
courseLibraryDiyTypeMapper.delete(old); courseLibraryDiyTypeMapper.delete(old);
CourseLibraryLabelContentDiyType alcdy = new CourseLibraryLabelContentDiyType();
alcdy.setCourseLibraryId(entity.getId());
courseLibraryLabelContentDiyTypeMapper.delete(alcdy);
} }
//添加当前对象与自定义分类的关系 //添加当前对象与自定义分类的关系
if(form.getDiyType() != null && form.getDiyType().size() > 0){ if(form.getDiyType() != null && form.getDiyType().size() > 0){
...@@ -112,14 +113,6 @@ public class CourseLibrarySerivceImpl extends BaseServiceImpl<CourseLibrary,Stri ...@@ -112,14 +113,6 @@ public class CourseLibrarySerivceImpl extends BaseServiceImpl<CourseLibrary,Stri
list.forEach(li -> li.setCourseLibraryId(entity.getId())); list.forEach(li -> li.setCourseLibraryId(entity.getId()));
courseLibraryDiyTypeMapper.insertList(list); courseLibraryDiyTypeMapper.insertList(list);
} }
//添加与标签的关系
if(form.getLabel() != null && form.getLabel().size() > 0){
List<CourseLibraryLabelContentDiyType> aldcdList = form.getLabel().stream().filter(f -> f.getLabelId() != null).collect(Collectors.toList());
aldcdList.stream().forEach(li -> li.setCourseLibraryId(entity.getId()));
if(!aldcdList.isEmpty()){
courseLibraryLabelContentDiyTypeMapper.insertList(aldcdList);
}
}
return true; return true;
} }
...@@ -148,9 +141,6 @@ public class CourseLibrarySerivceImpl extends BaseServiceImpl<CourseLibrary,Stri ...@@ -148,9 +141,6 @@ public class CourseLibrarySerivceImpl extends BaseServiceImpl<CourseLibrary,Stri
example = new Example(CourseLibraryDiyType.class); example = new Example(CourseLibraryDiyType.class);
example.createCriteria().andIn("courseLibraryId", ids); example.createCriteria().andIn("courseLibraryId", ids);
courseLibraryDiyTypeMapper.deleteByExample(example); courseLibraryDiyTypeMapper.deleteByExample(example);
example = new Example(CourseLibraryLabelContentDiyType.class);
example.createCriteria().andIn("courseLibraryId", ids);
courseLibraryLabelContentDiyTypeMapper.deleteByExample(example);
//这里需要级联删除其他接口关联资源 //这里需要级联删除其他接口关联资源
//----推荐位内容 //----推荐位内容
recommendResourceMapper.delectByResourceIds(ids, AllResourceTypeEnum.COURSE.getCode()); recommendResourceMapper.delectByResourceIds(ids, AllResourceTypeEnum.COURSE.getCode());
...@@ -183,13 +173,15 @@ public class CourseLibrarySerivceImpl extends BaseServiceImpl<CourseLibrary,Stri ...@@ -183,13 +173,15 @@ public class CourseLibrarySerivceImpl extends BaseServiceImpl<CourseLibrary,Stri
PageParam pageParam) { PageParam pageParam) {
startPage(pageParam); startPage(pageParam);
List<CourseLibraryListVO> list = mapper.query(form); List<CourseLibraryListVO> list = mapper.query(form);
ResourceRelation resourceRelation = new ResourceRelation(); VideoLibrary videoLibrary = new VideoLibrary();
list.forEach(f -> { list.forEach(f -> {
f.setStatus_zh(LibraryStatusEnum.getName(f.getStatus())); videoLibrary.setCourseId(f.getId());
// 视频数量 videoLibrary.setStatus(LibraryStatusEnum.STATUS_1.getCode());
resourceRelation.setObjectId(f.getId()); int videoNum = videoMapper.selectCount(videoLibrary);
int videoNum = resourceRelationMapper.selectCount(resourceRelation);
f.setVideoNum(videoNum); f.setVideoNum(videoNum);
if(f.getStatus() != null) {
f.setStatus_zh(LibraryStatusEnum.getName(f.getStatus()));
}
}); });
return new PageInfo<CourseLibraryListVO>(list); return new PageInfo<CourseLibraryListVO>(list);
} }
...@@ -209,4 +201,34 @@ public class CourseLibrarySerivceImpl extends BaseServiceImpl<CourseLibrary,Stri ...@@ -209,4 +201,34 @@ public class CourseLibrarySerivceImpl extends BaseServiceImpl<CourseLibrary,Stri
return new PageInfo<CourseLibraryListVO>(list); return new PageInfo<CourseLibraryListVO>(list);
} }
/**
* 根据课程id查询视频资源
*/
@Override
public PageInfo<VideoLibraryListVO> videoRelationPage(String courseId, PageParam pageParam) {
startPage(pageParam);
List<VideoLibraryListVO> list = mapper.videoRelationPage(courseId);
list.forEach(f -> {
if(f.getStatus() != null) {
f.setStatus_zh(LibraryStatusEnum.getName(f.getStatus()));
}
});
return new PageInfo<VideoLibraryListVO>(list);
}
/**
* 查询未关联视频资源
*/
@Override
public PageInfo<VideoLibraryListVO> popPage(QueryCourseAndVideoForm form, PageParam pageParam) {
startPage(pageParam);
List<VideoLibraryListVO> list = mapper.popPage(form);
list.forEach(f -> {
if(f.getStatus() != null) {
f.setStatus_zh(LibraryStatusEnum.getName(f.getStatus()));
}
});
return new PageInfo<VideoLibraryListVO>(list);
}
} }
...@@ -6,10 +6,12 @@ import com.zrqx.core.service.BaseService; ...@@ -6,10 +6,12 @@ import com.zrqx.core.service.BaseService;
import com.zrqx.core.util.page.PageInfo; import com.zrqx.core.util.page.PageInfo;
import com.zrqx.core.util.page.PageParam; import com.zrqx.core.util.page.PageParam;
import com.zrqx.resource.commons.form.bg.QueryResourceForPoPForm; import com.zrqx.resource.commons.form.bg.QueryResourceForPoPForm;
import com.zrqx.resource.commons.form.bg.courselibrary.QueryCourseAndVideoForm;
import com.zrqx.resource.commons.form.bg.courselibrary.QueryCourseLibraryForm; import com.zrqx.resource.commons.form.bg.courselibrary.QueryCourseLibraryForm;
import com.zrqx.resource.commons.form.bg.courselibrary.SaveUpdateCourseLibraryForm; import com.zrqx.resource.commons.form.bg.courselibrary.SaveUpdateCourseLibraryForm;
import com.zrqx.resource.commons.model.courcelibrary.CourseLibrary; import com.zrqx.resource.commons.model.courcelibrary.CourseLibrary;
import com.zrqx.resource.commons.vo.bg.courselibrary.CourseLibraryListVO; import com.zrqx.resource.commons.vo.bg.courselibrary.CourseLibraryListVO;
import com.zrqx.resource.commons.vo.bg.videolibrary.VideoLibraryListVO;
/** /**
* 专题库 * 专题库
*/ */
...@@ -48,4 +50,17 @@ public interface CourseLibraryService extends BaseService<CourseLibrary,String>{ ...@@ -48,4 +50,17 @@ public interface CourseLibraryService extends BaseService<CourseLibrary,String>{
* @date: 2019年1月3日 下午7:12:29 * @date: 2019年1月3日 下午7:12:29
*/ */
PageInfo<CourseLibraryListVO> pageByTitleAndDiyType(QueryResourceForPoPForm form, PageParam pageParam); PageInfo<CourseLibraryListVO> pageByTitleAndDiyType(QueryResourceForPoPForm form, PageParam pageParam);
/**
* 相关视频资源
* @param courseId
* @param pageParam
* @return
*/
PageInfo<VideoLibraryListVO> videoRelationPage(String courseId, PageParam pageParam);
/**
* 关联视频弹窗列表
*/
PageInfo<VideoLibraryListVO> popPage(QueryCourseAndVideoForm form, PageParam pageParam);
} }
...@@ -3,7 +3,6 @@ package com.zrqx.resource.bg.service.videolibrary; ...@@ -3,7 +3,6 @@ package com.zrqx.resource.bg.service.videolibrary;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -11,8 +10,11 @@ import org.springframework.stereotype.Service; ...@@ -11,8 +10,11 @@ import org.springframework.stereotype.Service;
import com.zrqx.core.client.order.bg.OrderClient; import com.zrqx.core.client.order.bg.OrderClient;
import com.zrqx.core.enums.AllResourceTypeEnum; import com.zrqx.core.enums.AllResourceTypeEnum;
import com.zrqx.core.enums.SaleResourceTypeEnum;
import com.zrqx.core.enums.StatusEnum;
import com.zrqx.core.enums.resource.LibraryStatusEnum; import com.zrqx.core.enums.resource.LibraryStatusEnum;
import com.zrqx.core.enums.resource.PriceOptionEnum; import com.zrqx.core.enums.resource.PriceOptionEnum;
import com.zrqx.core.enums.resource.SalsesTypeEnum;
import com.zrqx.core.exception.BaseException; import com.zrqx.core.exception.BaseException;
import com.zrqx.core.mapper.BaseMapper; import com.zrqx.core.mapper.BaseMapper;
import com.zrqx.core.service.BaseServiceImpl; import com.zrqx.core.service.BaseServiceImpl;
...@@ -91,17 +93,19 @@ public class VideoLibrarySerivceImpl extends BaseServiceImpl<VideoLibrary,String ...@@ -91,17 +93,19 @@ public class VideoLibrarySerivceImpl extends BaseServiceImpl<VideoLibrary,String
} }
} }
BeanUtils.copyProperties(form, entity); BeanUtils.copyProperties(form, entity);
if(StringUtils.isNotBlank(entity.getDefaultImg())) {
String defaultImg = entity.getDefaultImg() + "/" + entity.getVideo() +"/1.jpg";
entity.setDefaultImg(defaultImg);
}
if(PriceOptionEnum.STATUS_0.getCode() == form.getPriceOption()){ if(PriceOptionEnum.STATUS_0.getCode() == form.getPriceOption()){
entity.setRealPrice(new BigDecimal(0)); entity.setRealPrice(new BigDecimal(0));
} }
if(entity.getId() == null){ if(entity.getId() == null){
//添加 //添加
entity.setStatus(LibraryStatusEnum.STATUS_0.getCode()); entity.setStatus(LibraryStatusEnum.STATUS_2.getCode());
entity.setUploadTime(new Date()); entity.setUploadTime(new Date());
entity.setResourceType(AllResourceTypeEnum.VIDEO.getCode()); entity.setResourceType(AllResourceTypeEnum.VIDEO.getCode());
entity.setBrowseNum(50); entity.setBrowseNum(0);
entity.setReadTextPower(1);
entity.setClickNum(50);
entity.setSalesNum(0); entity.setSalesNum(0);
mapper.insert(entity); mapper.insert(entity);
}else{ }else{
...@@ -127,14 +131,6 @@ public class VideoLibrarySerivceImpl extends BaseServiceImpl<VideoLibrary,String ...@@ -127,14 +131,6 @@ public class VideoLibrarySerivceImpl extends BaseServiceImpl<VideoLibrary,String
list.forEach(li -> li.setVlId(entity.getId())); list.forEach(li -> li.setVlId(entity.getId()));
vdrMapper.insertList(list); vdrMapper.insertList(list);
} }
//添加与标签的关系
if(form.getLabel() != null && form.getLabel().size() > 0){
List<VideoLibraryLabelContentDiyType> aldcdList = form.getLabel().stream().filter(f -> f.getLabelId() != null).collect(Collectors.toList());
aldcdList.stream().forEach(li -> li.setVideoId(entity.getId()));
if(!aldcdList.isEmpty()){
alcdMapper.insertList(aldcdList);
}
}
return true; return true;
} }
/** /**
...@@ -145,38 +141,27 @@ public class VideoLibrarySerivceImpl extends BaseServiceImpl<VideoLibrary,String ...@@ -145,38 +141,27 @@ public class VideoLibrarySerivceImpl extends BaseServiceImpl<VideoLibrary,String
* @date: 2018年11月22日 下午2:39:13 * @date: 2018年11月22日 下午2:39:13
*/ */
@Override @Override
public boolean batchInsert(SaveVideoLibraryForm form) { public boolean batchInsert(List<SaveVideoLibraryForm> form) {
if(form.getNames().size() != form.getVideo().size()){ if(form.isEmpty()) {
throw new BaseException("视频数量错误"); throw new BaseException("请选择视频文件!");
} }
//循环创建视频对象 form.forEach(f -> {
for (int i = 0; i < form.getNames().size(); i++) { VideoLibrary videoLibrary = new VideoLibrary();
VideoLibrary obj = new VideoLibrary(); BeanUtils.copyProperties(f, videoLibrary);
BeanUtils.copyProperties(form, obj); videoLibrary.setBrowseNum(0);
obj.setName(form.getNames().get(i)); videoLibrary.setSalesType(SalsesTypeEnum.STATUS_1.getCode());
obj.setVideo(form.getVideo().get(i)); videoLibrary.setResourceType(AllResourceTypeEnum.VIDEO.getCode());
obj.setVideoName(form.getVideoName().get(i)); videoLibrary.setPriceOption(PriceOptionEnum.STATUS_0.getCode());
obj.setSize(form.getSize().get(i)); videoLibrary.setRealPrice(new BigDecimal(0));
obj.setFormats(form.getFormats().get(i)); videoLibrary.setSalesNum(0);
obj.setTimeLength(form.getTimeLength().get(i)); videoLibrary.setStatus(LibraryStatusEnum.STATUS_2.getCode());
obj.setUploadTime(new Date()); videoLibrary.setUploadTime(new Date());
obj.setStatus(LibraryStatusEnum.STATUS_0.getCode()); if(StringUtils.isNotBlank(f.getDefaultImg())) {
obj.setResourceType(AllResourceTypeEnum.VIDEO.getCode()); String defaultImg = f.getDefaultImg() + "/" + videoLibrary.getVideo() +"/1.jpg";
obj.setBrowseNum(50); videoLibrary.setDefaultImg(defaultImg);
obj.setReadTextPower(1);
obj.setClickNum(50);
obj.setSalesNum(0);
obj.setVideoName(form.getNames().get(i));
mapper.insert(obj);
if(form.getDiyType() != null){
VideoLibraryDiyType videoLibraryDiyType = new VideoLibraryDiyType();
videoLibraryDiyType.setCode(form.getDiyType().getCode());
videoLibraryDiyType.setDtId(form.getDiyType().getDtId());
videoLibraryDiyType.setVlId(obj.getId());
vdrMapper.insert(videoLibraryDiyType);
} }
} mapper.insert(videoLibrary);
});
return true; return true;
} }
/** /**
...@@ -246,6 +231,11 @@ public class VideoLibrarySerivceImpl extends BaseServiceImpl<VideoLibrary,String ...@@ -246,6 +231,11 @@ public class VideoLibrarySerivceImpl extends BaseServiceImpl<VideoLibrary,String
//暂不用自定义分类id 做in查询 //暂不用自定义分类id 做in查询
form.setDiyTypeId(null); form.setDiyTypeId(null);
List<VideoLibraryListVO> list = mapper.query(form); List<VideoLibraryListVO> list = mapper.query(form);
list.forEach(f -> {
if(f.getStatus() != null) {
f.setStatus_zh(LibraryStatusEnum.getName(f.getStatus()));
}
});
return new PageInfo<VideoLibraryListVO>(list); return new PageInfo<VideoLibraryListVO>(list);
} }
/** /**
...@@ -265,7 +255,7 @@ public class VideoLibrarySerivceImpl extends BaseServiceImpl<VideoLibrary,String ...@@ -265,7 +255,7 @@ public class VideoLibrarySerivceImpl extends BaseServiceImpl<VideoLibrary,String
List<VideoLibraryListVO> list = mapper.queryByTileAndDiyType(form); List<VideoLibraryListVO> list = mapper.queryByTileAndDiyType(form);
if(!list.isEmpty()){ if(!list.isEmpty()){
for(VideoLibraryListVO ebookListVO : list){ for(VideoLibraryListVO ebookListVO : list){
ebookListVO.setStatus_zh(LibraryStatusEnum.getName(Integer.parseInt(ebookListVO.getStatus()))); ebookListVO.setStatus_zh(LibraryStatusEnum.getName(ebookListVO.getStatus()));
} }
} }
return new PageInfo<VideoLibraryListVO>(list); return new PageInfo<VideoLibraryListVO>(list);
......
...@@ -30,7 +30,7 @@ public interface VideoLibraryService extends BaseService<VideoLibrary,String>{ ...@@ -30,7 +30,7 @@ public interface VideoLibraryService extends BaseService<VideoLibrary,String>{
* @author yzg * @author yzg
* @date: 2018年11月22日 下午2:39:13 * @date: 2018年11月22日 下午2:39:13
*/ */
boolean batchInsert(SaveVideoLibraryForm form); boolean batchInsert(List<SaveVideoLibraryForm> form);
/** /**
* 批量删除 * 批量删除
* @param ids * @param ids
......
...@@ -21,4 +21,6 @@ public class BatchUpdateCourseLibraryForm { ...@@ -21,4 +21,6 @@ public class BatchUpdateCourseLibraryForm {
private BigDecimal price; private BigDecimal price;
@ApiModelProperty("售价") @ApiModelProperty("售价")
private BigDecimal realPrice; private BigDecimal realPrice;
@ApiModelProperty("售价选项 0 免费,1收费")
private Integer priceOption;
} }
package com.zrqx.resource.commons.form.bg.courselibrary;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@ApiModel(value="QueryCourseAndVideoForm",description="课程库")
public class QueryCourseAndVideoForm {
@ApiModelProperty(value = "资源名称")
private String name;
@ApiModelProperty("作者")
private String author;
}
...@@ -11,8 +11,6 @@ import lombok.Data; ...@@ -11,8 +11,6 @@ import lombok.Data;
public class QueryCourseLibraryForm { public class QueryCourseLibraryForm {
@ApiModelProperty(value = "资源名称") @ApiModelProperty(value = "资源名称")
private String name; private String name;
@ApiModelProperty("来源")
private String source;
@ApiModelProperty("状态:0待审核,1已上架,2已下架") @ApiModelProperty("状态:0待审核,1已上架,2已下架")
private String status; private String status;
@ApiModelProperty(value="上传时间-开始") @ApiModelProperty(value="上传时间-开始")
......
...@@ -5,7 +5,6 @@ import java.util.Date; ...@@ -5,7 +5,6 @@ import java.util.Date;
import java.util.List; import java.util.List;
import com.zrqx.resource.commons.model.courcelibrary.CourseLibraryDiyType; import com.zrqx.resource.commons.model.courcelibrary.CourseLibraryDiyType;
import com.zrqx.resource.commons.model.courcelibrary.CourseLibraryLabelContentDiyType;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
...@@ -23,36 +22,27 @@ public class SaveUpdateCourseLibraryForm { ...@@ -23,36 +22,27 @@ public class SaveUpdateCourseLibraryForm {
private String authorId; private String authorId;
@ApiModelProperty(value = "讲师名称和id(用,隔开)") @ApiModelProperty(value = "讲师名称和id(用,隔开)")
private String authorNameAndId; private String authorNameAndId;
@ApiModelProperty("来源") @ApiModelProperty("总期数")
private String source; private Integer totalPeriods;
@ApiModelProperty("广告语")
private String adSlogan;
@ApiModelProperty(value = "分类")
private List<CourseLibraryDiyType> diyType;
@ApiModelProperty("封面") @ApiModelProperty("封面")
private String cover; private String img;
@ApiModelProperty("简介") @ApiModelProperty("简介")
private String synopsis; private String synopsis;
@ApiModelProperty("定价 元") @ApiModelProperty("定价 元")
private BigDecimal price; private BigDecimal price;
@ApiModelProperty("售价 元") @ApiModelProperty("售价 元")
private BigDecimal realPrice; private BigDecimal realPrice;
@ApiModelProperty("关键词") @ApiModelProperty("售价选项 0 免费,1收费")
private String keywords; private Integer priceOption;
@ApiModelProperty("状态:0待审核,1已上架,2已下架") @ApiModelProperty("状态:0待审核,1已上架,2已下架")
private Integer status; private Integer status;
@ApiModelProperty("资源类型") @ApiModelProperty("资源类型")
private Integer resourceType; private Integer resourceType;
@ApiModelProperty("授权时间")
private Date authorizationTime;
@ApiModelProperty("上传时间")
private Date uploadTime;
@ApiModelProperty("更新时间")
private Date updateTime;
@ApiModelProperty("播放次数")
private Integer clickNum;
@ApiModelProperty("浏览数量") @ApiModelProperty("浏览数量")
private Integer browseNum; private Integer browseNum;
@ApiModelProperty("售价选项 0 免费,1收费")
private Integer priceOption;
@ApiModelProperty(value = "分类id")
private List<CourseLibraryDiyType> diyType;
@ApiModelProperty(value = "标签id")
private List<CourseLibraryLabelContentDiyType> label;
} }
...@@ -21,6 +21,11 @@ public class BatchUpdateVideoLibraryForm { ...@@ -21,6 +21,11 @@ public class BatchUpdateVideoLibraryForm {
private BigDecimal price; private BigDecimal price;
@ApiModelProperty("售价") @ApiModelProperty("售价")
private BigDecimal realPrice; private BigDecimal realPrice;
@ApiModelProperty("全文阅读权限 0 游客可见 1会员可见") @ApiModelProperty("销售方式")
private Integer readTextPower; private Integer saleType;
@ApiModelProperty("售价选项 0 免费,1收费")
private Integer priceOption;
@ApiModelProperty("阅读权限")
private Integer ReadTextPower;
} }
...@@ -10,8 +10,6 @@ import lombok.Data; ...@@ -10,8 +10,6 @@ import lombok.Data;
public class QueryVideoLibraryForm { public class QueryVideoLibraryForm {
@ApiModelProperty(value = "资源名称") @ApiModelProperty(value = "资源名称")
private String name; private String name;
@ApiModelProperty("所属图书")
private String bookName;
@ApiModelProperty("状态:0待审核,1已上架,2已下架") @ApiModelProperty("状态:0待审核,1已上架,2已下架")
private String status; private String status;
@ApiModelProperty(value="上传时间-开始") @ApiModelProperty(value="上传时间-开始")
...@@ -22,6 +20,4 @@ public class QueryVideoLibraryForm { ...@@ -22,6 +20,4 @@ public class QueryVideoLibraryForm {
private List<Integer> diyTypeId; private List<Integer> diyTypeId;
@ApiModelProperty("自定义分类code") @ApiModelProperty("自定义分类code")
private String diyTypeCode; private String diyTypeCode;
@ApiModelProperty("民族 1蒙古族 2侗族 3藏族 4朝鲜族 5土家族 6回族 7满族 8汉族")
private Integer nationsType;
} }
...@@ -4,7 +4,6 @@ import java.math.BigDecimal; ...@@ -4,7 +4,6 @@ import java.math.BigDecimal;
import java.util.List; import java.util.List;
import com.zrqx.resource.commons.model.videolibrary.VideoLibraryDiyType; import com.zrqx.resource.commons.model.videolibrary.VideoLibraryDiyType;
import com.zrqx.resource.commons.model.videolibrary.VideoLibraryLabelContentDiyType;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
...@@ -16,40 +15,39 @@ public class SaveUpdateVideoLibraryForm { ...@@ -16,40 +15,39 @@ public class SaveUpdateVideoLibraryForm {
private String id; private String id;
@ApiModelProperty(value = "视频名称") @ApiModelProperty(value = "视频名称")
private String name; private String name;
@ApiModelProperty("来源") @ApiModelProperty(value = "作者名称和id(用,隔开)")
private String source; private String authorNameAndId;
@ApiModelProperty("关键词")
private String keywords;
@ApiModelProperty("定价")
private BigDecimal price;
@ApiModelProperty("售价")
private BigDecimal realPrice;
@ApiModelProperty("作者id") @ApiModelProperty("作者id")
private String authorId; private String authorId;
@ApiModelProperty("作者") @ApiModelProperty("作者")
private String author; private String author;
@ApiModelProperty("时长") @ApiModelProperty("广告语")
private String timeLength; private String adSlogan;
@ApiModelProperty("文件大小") @ApiModelProperty(value = "分类id")
private String size; private List<VideoLibraryDiyType> diyType;
@ApiModelProperty("封面")
private String img;
@ApiModelProperty("默认封面")
private String defaultImg;
@ApiModelProperty("简介") @ApiModelProperty("简介")
private String synopsis; private String synopsis;
@ApiModelProperty("文本")
private String text;
@ApiModelProperty("video") @ApiModelProperty("video")
private String video; private String video;
@ApiModelProperty("封面")
private String cover;
@ApiModelProperty(value = "分类id")
private List<VideoLibraryDiyType> diyType;
@ApiModelProperty(value = "标签id")
private List<VideoLibraryLabelContentDiyType> label;
@ApiModelProperty("民族 1蒙古族 2侗族 3藏族 4朝鲜族 5土家族 6回族 7满族 8汉族")
private Integer nationsType;
@ApiModelProperty("售价选项 0 免费,1收费")
private Integer priceOption;
@ApiModelProperty("全文阅读权限 0 游客可见 1会员可见")
private Integer readTextPower;
@ApiModelProperty("video名称") @ApiModelProperty("video名称")
private String videoName; private String videoName;
@ApiModelProperty(value = "作者名称和id(用,隔开)") @ApiModelProperty("时长")
private String authorNameAndId; private String timeLength;
@ApiModelProperty("文件大小")
private String size;
@ApiModelProperty("销售方式")
private Integer salesType;
@ApiModelProperty("售价选项 0 免费,1收费")
private Integer priceOption;
@ApiModelProperty("定价")
private BigDecimal price;
@ApiModelProperty("售价")
private BigDecimal realPrice;
} }
package com.zrqx.resource.commons.form.bg.videolibrary; package com.zrqx.resource.commons.form.bg.videolibrary;
import java.math.BigDecimal;
import java.util.List;
import com.zrqx.resource.commons.model.videolibrary.VideoLibraryDiyType;
import com.zrqx.resource.commons.model.videolibrary.VideoLibraryLabelContentDiyType;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
...@@ -13,34 +7,16 @@ import lombok.Data; ...@@ -13,34 +7,16 @@ import lombok.Data;
@ApiModel(value="SaveVideoLibraryForm",description="添加视频库") @ApiModel(value="SaveVideoLibraryForm",description="添加视频库")
public class SaveVideoLibraryForm { public class SaveVideoLibraryForm {
@ApiModelProperty(value = "视频名称集合") @ApiModelProperty(value = "视频名称集合")
private List<String> names; private String name;
@ApiModelProperty("来源")
private String source;
@ApiModelProperty("关键词")
private String keywords;
@ApiModelProperty("定价")
private BigDecimal price;
@ApiModelProperty("售价")
private BigDecimal realPrice;
@ApiModelProperty("简介")
private String synopsis;
@ApiModelProperty("video") @ApiModelProperty("video")
private List<String> video; private String video;
@ApiModelProperty("封面")
private String cover;
@ApiModelProperty(value = "分类id")
private VideoLibraryDiyType diyType;
@ApiModelProperty(value = "标签id")
private VideoLibraryLabelContentDiyType label;
@ApiModelProperty("民族 1蒙古族 2侗族 3藏族 4朝鲜族 5土家族 6回族 7满族 8汉族")
private Integer nationsType;
@ApiModelProperty("格式")
private List<String> formats;
@ApiModelProperty("文件大小") @ApiModelProperty("文件大小")
private List<String> size; private String size;
@ApiModelProperty("时长") @ApiModelProperty("时长")
private List<String> timeLength; private String timeLength;
@ApiModelProperty("video名称") @ApiModelProperty("video名称")
private List<String> videoName; private String videoName;
@ApiModelProperty("默认封面")
private String defaultImg;
} }
package com.zrqx.resource.commons.model.courcelibrary; package com.zrqx.resource.commons.model.courcelibrary;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
import java.util.List;
import javax.persistence.GeneratedValue; import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType; import javax.persistence.GenerationType;
import javax.persistence.Id; import javax.persistence.Id;
import javax.persistence.Table; import javax.persistence.Table;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
@Data @Data
@ApiModel(value="CourseLibrary",description="微课库") @ApiModel(value="CourseLibrary",description="微课库")
...@@ -26,35 +26,31 @@ public class CourseLibrary { ...@@ -26,35 +26,31 @@ public class CourseLibrary {
private String author; private String author;
@ApiModelProperty("讲师id") @ApiModelProperty("讲师id")
private String authorId; private String authorId;
@ApiModelProperty("来源") @ApiModelProperty("总期数")
private String source; private Integer totalPeriods;
@ApiModelProperty("广告语")
private String adSlogan;
@ApiModelProperty("封面") @ApiModelProperty("封面")
private String cover; private String img;
@ApiModelProperty("简介") @ApiModelProperty("简介")
private String synopsis; private String synopsis;
@ApiModelProperty("定价 元") @ApiModelProperty("定价 元")
private BigDecimal price; private BigDecimal price;
@ApiModelProperty("售价 元") @ApiModelProperty("售价 元")
private BigDecimal realPrice; private BigDecimal realPrice;
@ApiModelProperty("关键词") @ApiModelProperty("售价选项 0 免费,1收费")
private String keywords; private Integer priceOption;
@ApiModelProperty("状态:0待审核,1已上架,2已下架") @ApiModelProperty("状态:0待审核,1已上架,2已下架")
private Integer status; private Integer status;
@ApiModelProperty("资源类型")
private Integer resourceType;
@ApiModelProperty("授权时间")
private Date authorizationTime;
@ApiModelProperty("上传时间") @ApiModelProperty("上传时间")
private Date uploadTime; private Date uploadTime;
@ApiModelProperty("更新时间") @ApiModelProperty("更新时间")
private Date updateTime; private Date updateTime;
@ApiModelProperty("播放次数")
private Integer clickNum;
@ApiModelProperty("浏览数量") @ApiModelProperty("浏览数量")
private Integer browseNum; private Integer browseNum;
@ApiModelProperty("销量") @ApiModelProperty("销量")
private Integer salesNum; private Integer salesNum;
@ApiModelProperty("售价选项 0 免费,1收费") @ApiModelProperty("资源类型")
private Integer priceOption; private Integer resourceType;
} }
...@@ -23,58 +23,50 @@ public class VideoLibrary { ...@@ -23,58 +23,50 @@ public class VideoLibrary {
private String id; private String id;
@ApiModelProperty(value = "视频名称") @ApiModelProperty(value = "视频名称")
private String name; private String name;
@ApiModelProperty("来源") @ApiModelProperty("作者id")
private String source; private String authorId;
@ApiModelProperty("关键词") @ApiModelProperty("作者")
private String keywords; private String author;
@ApiModelProperty("定价") @ApiModelProperty("广告语")
private BigDecimal price; private String adSlogan;
@ApiModelProperty("售价") @ApiModelProperty("封面")
private BigDecimal realPrice; private String img;
@ApiModelProperty("时长") @ApiModelProperty("默认封面")
private String timeLength; private String defaultImg;
@ApiModelProperty("文件大小")
private String size;
@ApiModelProperty("简介") @ApiModelProperty("简介")
private String synopsis; private String synopsis;
@ApiModelProperty("文本")
private String text;
@ApiModelProperty("video") @ApiModelProperty("video")
private String video; private String video;
@ApiModelProperty("正文") @ApiModelProperty("video名称")
private String text; private String videoName;
@ApiModelProperty("图书id") @ApiModelProperty("时长")
private Integer bookId; private String timeLength;
@ApiModelProperty("资源类型") @ApiModelProperty("文件大小")
private Integer resourceType; private String size;
@ApiModelProperty("图书名称") @ApiModelProperty("销售方式")
private String bookName; private Integer salesType;
@ApiModelProperty("状态:0已录入,1已上架,2已下架") @ApiModelProperty("售价选项 0 免费,1收费")
private Integer priceOption;
@ApiModelProperty("定价")
private BigDecimal price;
@ApiModelProperty("售价")
private BigDecimal realPrice;
@ApiModelProperty("状态:1已上架,2已下架")
private Integer status; private Integer status;
@ApiModelProperty("上传时间") @ApiModelProperty("上传时间")
private Date uploadTime; private Date uploadTime;
@ApiModelProperty("更新时间") @ApiModelProperty("更新时间")
private Date updateTime; private Date updateTime;
@ApiModelProperty("民族 1蒙古族 2侗族 3藏族 4朝鲜族 5土家族 6回族 7满族 8汉族")
private Integer nationsType;
@ApiModelProperty("课程Id") @ApiModelProperty("课程Id")
private Integer courseId; private String courseId;
@ApiModelProperty("播放数")
private Integer clickNum;
@ApiModelProperty(value = "销量")
private Integer salesNum;
@ApiModelProperty("封面")
private String cover;
@ApiModelProperty("浏览数量") @ApiModelProperty("浏览数量")
private Integer browseNum; private Integer browseNum;
@ApiModelProperty("作者id") @ApiModelProperty("销量")
private String authorId; private Integer salesNum;
@ApiModelProperty("作者") @ApiModelProperty("排序")
private String author; private Integer sort;
@ApiModelProperty("全文阅读权限 0 游客可见 1会员可见") @ApiModelProperty("资源类型")
private Integer readTextPower; private Integer resourceType;
@ApiModelProperty("格式")
private String formats;
@ApiModelProperty("售价选项 0 免费,1收费")
private Integer priceOption;
@ApiModelProperty("video名称")
private String videoName;
} }
...@@ -16,37 +16,19 @@ public class CourseLibraryListVO { ...@@ -16,37 +16,19 @@ public class CourseLibraryListVO {
private String id; private String id;
@ApiModelProperty("资源名称") @ApiModelProperty("资源名称")
private String name; private String name;
@ApiModelProperty("讲师")
private String author;
@ApiModelProperty("讲师id")
private String authorId;
@ApiModelProperty("来源")
private String source;
@ApiModelProperty("封面") @ApiModelProperty("封面")
private String cover; private String img;
@ApiModelProperty("简介")
private String synopsis;
@ApiModelProperty("定价 元")
private String price;
@ApiModelProperty("售价 元") @ApiModelProperty("售价 元")
private String realPrice; private String realPrice;
@ApiModelProperty("视频数量")
private Integer videoNum;
@ApiModelProperty("上传时间")
private String uploadTime;
@ApiModelProperty("状态:0已录入,1已上架,2已下架") @ApiModelProperty("状态:0已录入,1已上架,2已下架")
private Integer status; private Integer status;
@ApiModelProperty("状态:0已录入,1已上架,2已下架") @ApiModelProperty("状态:0已录入,1已上架,2已下架")
private String status_zh; private String status_zh;
@ApiModelProperty("资源类型") @ApiModelProperty("资源类型")
private Integer resourceType; private Integer resourceType;
@ApiModelProperty("授权时间")
private Date authorizationTime;
@ApiModelProperty("上传时间")
private Date uploadTime;
@ApiModelProperty("更新时间")
private Date updateTime;
@ApiModelProperty("播放次数")
private Integer clickNum;
@ApiModelProperty("浏览数量")
private Integer browseNum;
@ApiModelProperty("视频数量")
private Integer videoNum;
} }
package com.zrqx.resource.commons.vo.bg.courselibrary; package com.zrqx.resource.commons.vo.bg.courselibrary;
import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import org.springframework.format.annotation.DateTimeFormat;
import com.zrqx.resource.commons.model.courcelibrary.CourseLibraryDiyType; import com.zrqx.resource.commons.model.courcelibrary.CourseLibraryDiyType;
import com.zrqx.resource.commons.model.courcelibrary.CourseLibraryLabelContentDiyType;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
...@@ -16,41 +14,35 @@ import lombok.Data; ...@@ -16,41 +14,35 @@ import lombok.Data;
public class CourseLibraryVO { public class CourseLibraryVO {
@ApiModelProperty("课程id,新增时不需要填写") @ApiModelProperty("课程id,新增时不需要填写")
private String id; private String id;
@ApiModelProperty("课程名称") @ApiModelProperty("资源名称")
private String name; private String name;
@ApiModelProperty("封面") @ApiModelProperty("讲师")
private String cover;
@ApiModelProperty("课程简介")
private String synopsis;
@ApiModelProperty("状态 0下线,1上线")
private Integer status;
@ApiModelProperty("授权时间")
private Date authorizationTime;
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty("创建时间")
private Date uploadTime;
@ApiModelProperty("作者")
private String author; private String author;
@ApiModelProperty("作者id") @ApiModelProperty("讲师id")
private String authorId; private String authorId;
@ApiModelProperty(value = "作者名称和id(用,隔开)") @ApiModelProperty(value = "讲师名称和id(用,隔开)")
private String authorNameAndId; private String authorNameAndId;
@ApiModelProperty("浏览数量") @ApiModelProperty("总期数")
private Integer browseNum; private Integer totalPeriods;
@ApiModelProperty("广告语")
private String adSlogan;
@ApiModelProperty(value = "分类")
private List<CourseLibraryDiyType> diyType;
@ApiModelProperty("封面")
private String img;
@ApiModelProperty("简介")
private String synopsis;
@ApiModelProperty("定价 元") @ApiModelProperty("定价 元")
private String price; private String price;
@ApiModelProperty("售价 元") @ApiModelProperty("售价 元")
private String realPrice; private String realPrice;
@ApiModelProperty("售价选项 0 免费,1收费") @ApiModelProperty("售价选项 0 免费,1收费")
private Integer priceOption; private Integer priceOption;
@ApiModelProperty("关键词") @ApiModelProperty("状态:0待审核,1已上架,2已下架")
private String keywords; private Integer status;
@ApiModelProperty("来源") @ApiModelProperty("资源类型")
private String source; private Integer resourceType;
@ApiModelProperty(value = "分类id") @ApiModelProperty("浏览数量")
private List<CourseLibraryDiyType> diyType; private Integer browseNum;
@ApiModelProperty(value = "标签id")
private List<CourseLibraryLabelContentDiyType> label;
@ApiModelProperty(value = "标签内容id")
private List<Integer> labelContentDiyTypeIds;
} }
...@@ -13,22 +13,22 @@ public class VideoLibraryListVO { ...@@ -13,22 +13,22 @@ public class VideoLibraryListVO {
private String id; private String id;
@ApiModelProperty(value = "资源名称") @ApiModelProperty(value = "资源名称")
private String name; private String name;
@ApiModelProperty("来源") @ApiModelProperty(value = "讲师")
private String source; private String author;
@ApiModelProperty("售价") @ApiModelProperty("售价")
private String realPrice; private String realPrice;
@ApiModelProperty("上传时间") @ApiModelProperty("上传时间")
private Date uploadTime; private String uploadTime;
@ApiModelProperty("时长") @ApiModelProperty("状态:1已上架,2已下架")
private String timeLength; private Integer status;
@ApiModelProperty("大小") @ApiModelProperty("状态:1已上架,2已下架")
private String size;
@ApiModelProperty("状态:0待审核,1已上架,2已下架")
private String status;
@ApiModelProperty("状态:0待审核,1已上架,2已下架")
private String status_zh; private String status_zh;
@ApiModelProperty("作者")
private String author;
@ApiModelProperty("封面图片") @ApiModelProperty("封面图片")
private String cover; private String img;
@ApiModelProperty("默认封面")
private String defautImg;
@ApiModelProperty(value = "时长")
private String timeLength;
@ApiModelProperty(value = "排序")
private Integer sort;
} }
package com.zrqx.resource.commons.vo.bg.videolibrary; package com.zrqx.resource.commons.vo.bg.videolibrary;
import java.math.BigDecimal;
import java.util.List; import java.util.List;
import com.zrqx.resource.commons.model.videolibrary.VideoLibraryDiyType; import com.zrqx.resource.commons.model.videolibrary.VideoLibraryDiyType;
import com.zrqx.resource.commons.model.videolibrary.VideoLibraryLabelContentDiyType;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
...@@ -11,42 +11,41 @@ import lombok.Data; ...@@ -11,42 +11,41 @@ import lombok.Data;
@Data @Data
@ApiModel(value="VideoLibraryOneVO",description="单个查询视频返回的实体") @ApiModel(value="VideoLibraryOneVO",description="单个查询视频返回的实体")
public class VideoLibraryOneVO { public class VideoLibraryOneVO {
@ApiModelProperty("视频id") @ApiModelProperty("视频id,新增时不需要填写")
private String id; private String id;
@ApiModelProperty(value = "视频标题") @ApiModelProperty(value = "视频名称")
private String name; private String name;
@ApiModelProperty("来源") @ApiModelProperty(value = "作者名称和id(用,隔开)")
private String source; private String authorNameAndId;
@ApiModelProperty("关键词")
private String keywords;
@ApiModelProperty("定价")
private String price;
@ApiModelProperty("售价")
private String realPrice;
@ApiModelProperty("简介")
private String synopsis;
@ApiModelProperty("正文")
private String text;
@ApiModelProperty("video")
private String video;
@ApiModelProperty("封面")
private String cover;
@ApiModelProperty("作者id") @ApiModelProperty("作者id")
private String authorId; private String authorId;
@ApiModelProperty("作者") @ApiModelProperty("作者")
private String author; private String author;
@ApiModelProperty("广告语")
private String adSlogan;
@ApiModelProperty(value = "分类id") @ApiModelProperty(value = "分类id")
private List<VideoLibraryDiyType> diyType; private List<VideoLibraryDiyType> diyType;
@ApiModelProperty(value = "标签id") @ApiModelProperty("封面")
private List<VideoLibraryLabelContentDiyType> label; private String cover;
@ApiModelProperty(value = "标签内容id") @ApiModelProperty("简介")
private List<Integer> labelContentDiyTypeIds; private String synopsis;
@ApiModelProperty("售价选项 0 免费,1收费") @ApiModelProperty("文本")
private Integer priceOption; private String text;
@ApiModelProperty("全文阅读权限 0 游客可见 1会员可见") @ApiModelProperty("video")
private Integer readTextPower; private String video;
@ApiModelProperty("video名称") @ApiModelProperty("video名称")
private String videoName; private String videoName;
@ApiModelProperty(value = "作者名称和id(用,隔开)") @ApiModelProperty("时长")
private String authorNameAndId; private String timeLength;
@ApiModelProperty("文件大小")
private String size;
@ApiModelProperty("销售方式")
private Integer salesType;
@ApiModelProperty("售价选项 0 免费,1收费")
private Integer priceOption;
@ApiModelProperty("定价")
private String price;
@ApiModelProperty("售价")
private String realPrice;
} }
...@@ -671,7 +671,7 @@ public class FgResourceLibraryController { ...@@ -671,7 +671,7 @@ public class FgResourceLibraryController {
orderInfo.setPrice(entity.getPrice()); orderInfo.setPrice(entity.getPrice());
} }
orderInfo.setSalePrice(entity.getRealPrice()); orderInfo.setSalePrice(entity.getRealPrice());
orderInfo.setCover(entity.getCover()); orderInfo.setCover(entity.getImg());
//获取分类编号 //获取分类编号
VideoLibraryDiyType alrt = new VideoLibraryDiyType(); VideoLibraryDiyType alrt = new VideoLibraryDiyType();
alrt.setVlId(entity.getId()); alrt.setVlId(entity.getId());
...@@ -707,7 +707,7 @@ public class FgResourceLibraryController { ...@@ -707,7 +707,7 @@ public class FgResourceLibraryController {
orderInfo.setPrice(entity.getPrice()); orderInfo.setPrice(entity.getPrice());
} }
orderInfo.setSalePrice(entity.getRealPrice()); orderInfo.setSalePrice(entity.getRealPrice());
orderInfo.setCover(entity.getCover()); orderInfo.setCover(entity.getImg());
//获取分类编号 //获取分类编号
CourseLibraryDiyType alrt = new CourseLibraryDiyType(); CourseLibraryDiyType alrt = new CourseLibraryDiyType();
alrt.setCourseLibraryId(entity.getId()); alrt.setCourseLibraryId(entity.getId());
...@@ -801,8 +801,8 @@ public class FgResourceLibraryController { ...@@ -801,8 +801,8 @@ public class FgResourceLibraryController {
VideoLibrary entity = videoLibraryService.selectByPrimaryKey(id); VideoLibrary entity = videoLibraryService.selectByPrimaryKey(id);
vo.setAuthor(entity.getAuthor()); vo.setAuthor(entity.getAuthor());
vo.setAuthorId(entity.getAuthorId()); vo.setAuthorId(entity.getAuthorId());
vo.setCover(entity.getCover()); vo.setCover(entity.getImg());
vo.setSource(entity.getSource()); //vo.setSource(entity.getSource());
vo.setSummary(removeLabel(entity.getSynopsis())); vo.setSummary(removeLabel(entity.getSynopsis()));
return CallBack.success(vo); return CallBack.success(vo);
} }
...@@ -811,8 +811,8 @@ public class FgResourceLibraryController { ...@@ -811,8 +811,8 @@ public class FgResourceLibraryController {
CourseLibrary entity = courseLibraryService.selectByPrimaryKey(id); CourseLibrary entity = courseLibraryService.selectByPrimaryKey(id);
vo.setAuthor(entity.getAuthor()); vo.setAuthor(entity.getAuthor());
vo.setAuthorId(entity.getAuthorId()); vo.setAuthorId(entity.getAuthorId());
vo.setCover(entity.getCover()); vo.setCover(entity.getImg());
vo.setSource(entity.getSource()); //vo.setSource(entity.getSource());
vo.setSummary(removeLabel(entity.getSynopsis())); vo.setSummary(removeLabel(entity.getSynopsis()));
return CallBack.success(vo); return CallBack.success(vo);
} }
......
...@@ -155,26 +155,6 @@ public class FgVideoLibraryController { ...@@ -155,26 +155,6 @@ public class FgVideoLibraryController {
return input; return input;
} }
@ApiOperation("更新播放数")
@PostMapping("/update/video-library")
public CallBack<Boolean> updateDownloadNum(@RequestBody String fileName) {
boolean b = false;
VideoLibrary videoLibraryOne = new VideoLibrary();
videoLibraryOne.setVideo(fileName);
List<VideoLibrary> video = service.select(videoLibraryOne);
if(!video.isEmpty()){
for (VideoLibrary videoLibrary : video) {
if(videoLibrary.getClickNum() == null){
videoLibrary.setClickNum(1);
}else{
videoLibrary.setClickNum(videoLibrary.getClickNum() + 1);
}
b = service.updateByPrimaryKeySelective(videoLibrary);
}
}
return CallBack.success(b);
}
@ApiOperation(value = "查询视频全部信息(跨服务调用)", notes = "根据ID查询") @ApiOperation(value = "查询视频全部信息(跨服务调用)", notes = "根据ID查询")
@GetMapping(value = "/{oid}") @GetMapping(value = "/{oid}")
public CallBack<VideoLibrary> getOneById(@PathVariable String oid) { public CallBack<VideoLibrary> getOneById(@PathVariable String oid) {
......
...@@ -204,7 +204,7 @@ public class FgResourceManageImpl implements FgResourceManage{ ...@@ -204,7 +204,7 @@ public class FgResourceManageImpl implements FgResourceManage{
infoVo.setPrice(entity.getPrice()); infoVo.setPrice(entity.getPrice());
} }
infoVo.setSalePrice(entity.getRealPrice()); infoVo.setSalePrice(entity.getRealPrice());
infoVo.setCover(entity.getCover()); infoVo.setCover(entity.getImg());
if(entity.getStatus().equals(LibraryStatusEnum.STATUS_1.getCode())){ if(entity.getStatus().equals(LibraryStatusEnum.STATUS_1.getCode())){
infoVo.setBookStatus(Integer.parseInt(BooleanStatusEnum.YES.getCode())); infoVo.setBookStatus(Integer.parseInt(BooleanStatusEnum.YES.getCode()));
infoVo.setBookStatusZh(LibraryStatusEnum.STATUS_1.getName()); infoVo.setBookStatusZh(LibraryStatusEnum.STATUS_1.getName());
......
...@@ -151,7 +151,7 @@ public class FgResourceRelationServiceImpl extends BaseServiceImpl<ResourceRelat ...@@ -151,7 +151,7 @@ public class FgResourceRelationServiceImpl extends BaseServiceImpl<ResourceRelat
VideoLibrary sc = videoLibraryMapper.selectByPrimaryKey(e.getResourceId()); VideoLibrary sc = videoLibraryMapper.selectByPrimaryKey(e.getResourceId());
if (sc != null) { if (sc != null) {
e.setName(sc.getName()); e.setName(sc.getName());
e.setCover(sc.getCover()); e.setCover(sc.getImg());
e.setAuthor(sc.getAuthor()); e.setAuthor(sc.getAuthor());
e.setRealPrice(sc.getRealPrice() + ""); e.setRealPrice(sc.getRealPrice() + "");
e.setTimeLength(sc.getTimeLength()); e.setTimeLength(sc.getTimeLength());
...@@ -178,7 +178,7 @@ public class FgResourceRelationServiceImpl extends BaseServiceImpl<ResourceRelat ...@@ -178,7 +178,7 @@ public class FgResourceRelationServiceImpl extends BaseServiceImpl<ResourceRelat
CourseLibrary sc = courseLibraryMapper.selectByPrimaryKey(e.getResourceId()); CourseLibrary sc = courseLibraryMapper.selectByPrimaryKey(e.getResourceId());
if (sc != null) { if (sc != null) {
e.setName(sc.getName()); e.setName(sc.getName());
e.setCover(sc.getCover()); e.setCover(sc.getImg());
e.setAuthor(sc.getAuthor()); e.setAuthor(sc.getAuthor());
e.setRealPrice(sc.getRealPrice() + ""); e.setRealPrice(sc.getRealPrice() + "");
/*if(StringUtils.isNotBlank(sc.getSynopsis())){ /*if(StringUtils.isNotBlank(sc.getSynopsis())){
......
...@@ -120,12 +120,12 @@ public class FgCourseLibrarySerivceImpl extends ...@@ -120,12 +120,12 @@ public class FgCourseLibrarySerivceImpl extends
Integer num = CourseLibrary.getBrowseNum(); Integer num = CourseLibrary.getBrowseNum();
num += 1; num += 1;
CourseLibrary.setBrowseNum(num); CourseLibrary.setBrowseNum(num);
if(CourseLibrary.getClickNum() == null ){ if(CourseLibrary.getBrowseNum() == null ){
CourseLibrary.setClickNum(50); CourseLibrary.setBrowseNum(0);
} }
Integer clickNum = CourseLibrary.getClickNum(); Integer clickNum = CourseLibrary.getBrowseNum();
clickNum += 1; clickNum += 1;
CourseLibrary.setClickNum(clickNum); CourseLibrary.setBrowseNum(clickNum);
mapper.updateByPrimaryKeySelective(CourseLibrary); mapper.updateByPrimaryKeySelective(CourseLibrary);
return true; return true;
} }
......
...@@ -171,9 +171,8 @@ public class FgRecordServiceImpl extends BaseServiceImpl<Record, Integer> ...@@ -171,9 +171,8 @@ public class FgRecordServiceImpl extends BaseServiceImpl<Record, Integer>
VideoLibrary videoLibrary = videoLibraryMapper.selectByPrimaryKey(vo.getGoodsId()); VideoLibrary videoLibrary = videoLibraryMapper.selectByPrimaryKey(vo.getGoodsId());
if(videoLibrary != null){ if(videoLibrary != null){
vo.setName(videoLibrary.getName()); vo.setName(videoLibrary.getName());
vo.setImg(videoLibrary.getCover()); vo.setImg(videoLibrary.getImg());
vo.setText(videoLibrary.getSynopsis()); vo.setText(videoLibrary.getSynopsis());
vo.setSource(videoLibrary.getSource());
} }
} }
//音频 //音频
...@@ -204,9 +203,8 @@ public class FgRecordServiceImpl extends BaseServiceImpl<Record, Integer> ...@@ -204,9 +203,8 @@ public class FgRecordServiceImpl extends BaseServiceImpl<Record, Integer>
CourseLibrary courseLibrary = courseLibraryMapper.selectByPrimaryKey(vo.getGoodsId()); CourseLibrary courseLibrary = courseLibraryMapper.selectByPrimaryKey(vo.getGoodsId());
if(courseLibrary != null){ if(courseLibrary != null){
vo.setName(courseLibrary.getName()); vo.setName(courseLibrary.getName());
vo.setImg(courseLibrary.getCover()); vo.setImg(courseLibrary.getImg());
vo.setText(courseLibrary.getSynopsis()); vo.setText(courseLibrary.getSynopsis());
vo.setSource(courseLibrary.getSource());
vo.setAuthor(courseLibrary.getAuthor()); vo.setAuthor(courseLibrary.getAuthor());
} }
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论