提交 8481cbe6 authored 作者: renjiancai's avatar renjiancai

--no commit message

上级 c575687e
...@@ -231,7 +231,7 @@ public class VideoLibraryController { ...@@ -231,7 +231,7 @@ public class VideoLibraryController {
public CallBack<PageInfo<VideoLibraryListVO>> livePage(QueryVideoLibraryForm form, PageParam pageParam){ public CallBack<PageInfo<VideoLibraryListVO>> livePage(QueryVideoLibraryForm form, PageParam pageParam){
return CallBack.success(service.livePage(form, pageParam)); return CallBack.success(service.livePage(form, pageParam));
} }
@ApiOperation("导入元数据") @ApiOperation("导入元数据Excel")
@PostMapping(value = "/importExcel") @PostMapping(value = "/importExcel")
public CallBack<?> importVideo(@RequestParam("file") MultipartFile file) throws Exception { public CallBack<?> importVideo(@RequestParam("file") MultipartFile file) throws Exception {
ImportLabelVo vo = service.importLabelExcel(file); ImportLabelVo vo = service.importLabelExcel(file);
......
...@@ -23,7 +23,7 @@ public interface PublishMapper extends BaseMapper<Publish> { ...@@ -23,7 +23,7 @@ public interface PublishMapper extends BaseMapper<Publish> {
@Select("<script>" @Select("<script>"
+ "select * FROM res_publish where 1 = 1 " + "select * FROM res_publish where 1 = 1 "
+ "<if test='"+ NOTBLANK +"(form.name)'>" + "<if test='"+ NOTBLANK +"(form.name)'>"
+ "and (name like concat('%',#{form.name}) or school like concat('%',#{form.name}) or materialName like concat('%',#{form.name}))" + "and (name like concat('%',#{form.name},'%') or school like concat('%',#{form.name}) or materialName like concat('%',#{form.name},'%'))"
+ "</if>" + "</if>"
+ "</script>") + "</script>")
List<Publish> page(@Param("form")PublishForm form); List<Publish> page(@Param("form")PublishForm form);
......
...@@ -14,13 +14,11 @@ import org.springframework.web.multipart.MultipartFile; ...@@ -14,13 +14,11 @@ import org.springframework.web.multipart.MultipartFile;
import com.zrqx.core.client.order.bg.OrderClient; import com.zrqx.core.client.order.bg.OrderClient;
import com.zrqx.core.client.statistics.bg.StatisticsClient; import com.zrqx.core.client.statistics.bg.StatisticsClient;
import com.zrqx.core.client.vo.ImportLabelVo; import com.zrqx.core.client.vo.ImportLabelVo;
import com.zrqx.core.client.vo.resource.StatisticsResourceExprotVo;
import com.zrqx.core.client.vo.resource.StatisticsResourceVo; import com.zrqx.core.client.vo.resource.StatisticsResourceVo;
import com.zrqx.core.enums.AllResourceTypeEnum; import com.zrqx.core.enums.AllResourceTypeEnum;
import com.zrqx.core.enums.GoodsTypeEnum; import com.zrqx.core.enums.GoodsTypeEnum;
import com.zrqx.core.enums.resource.EbookStatusEnum; import com.zrqx.core.enums.resource.EbookStatusEnum;
import com.zrqx.core.enums.resource.PriceOptionEnum; import com.zrqx.core.enums.resource.PriceOptionEnum;
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;
import com.zrqx.core.util.bean.BeanUtils; import com.zrqx.core.util.bean.BeanUtils;
......
...@@ -29,6 +29,8 @@ import com.zrqx.core.util.page.PageInfo; ...@@ -29,6 +29,8 @@ 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.bg.mapper.ResourceRelationMapper; import com.zrqx.resource.bg.mapper.ResourceRelationMapper;
import com.zrqx.resource.bg.mapper.diytype.DiyTypeMapper; import com.zrqx.resource.bg.mapper.diytype.DiyTypeMapper;
import com.zrqx.resource.bg.mapper.ebook.BookMapper;
import com.zrqx.resource.bg.mapper.ebook.EbookMapper;
import com.zrqx.resource.bg.mapper.marketing.PromotionContentMapper; import com.zrqx.resource.bg.mapper.marketing.PromotionContentMapper;
import com.zrqx.resource.bg.mapper.membercollection.MemberCollectionMapper; import com.zrqx.resource.bg.mapper.membercollection.MemberCollectionMapper;
import com.zrqx.resource.bg.mapper.recommend.RecommendResourceMapper; import com.zrqx.resource.bg.mapper.recommend.RecommendResourceMapper;
...@@ -42,6 +44,7 @@ import com.zrqx.resource.commons.form.bg.videolibrary.QueryVideoLibraryForm; ...@@ -42,6 +44,7 @@ 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.diytype.DiyType; import com.zrqx.resource.commons.model.diytype.DiyType;
import com.zrqx.resource.commons.model.ebook.Book;
import com.zrqx.resource.commons.model.ebook.Ebook; import com.zrqx.resource.commons.model.ebook.Ebook;
import com.zrqx.resource.commons.model.ebook.EbookDiyType; import com.zrqx.resource.commons.model.ebook.EbookDiyType;
import com.zrqx.resource.commons.model.membercollection.MemberCollection; import com.zrqx.resource.commons.model.membercollection.MemberCollection;
...@@ -70,6 +73,10 @@ public class VideoLibrarySerivceImpl extends BaseServiceImpl<VideoLibrary,String ...@@ -70,6 +73,10 @@ public class VideoLibrarySerivceImpl extends BaseServiceImpl<VideoLibrary,String
private VideoLibraryDiyTypeMapper vdrMapper; private VideoLibraryDiyTypeMapper vdrMapper;
@Autowired @Autowired
private OrderClient orderClient; private OrderClient orderClient;
@Autowired
private BookMapper bookMapper;
@Autowired
private EbookMapper ebookMapper;
@Autowired @Autowired
private StatisticsClient statisticsClient; private StatisticsClient statisticsClient;
...@@ -394,6 +401,13 @@ public class VideoLibrarySerivceImpl extends BaseServiceImpl<VideoLibrary,String ...@@ -394,6 +401,13 @@ public class VideoLibrarySerivceImpl extends BaseServiceImpl<VideoLibrary,String
VideoLibrary b = new VideoLibrary(); VideoLibrary b = new VideoLibrary();
BeanUtils.copyProperties(excelVideoImportVo, b); BeanUtils.copyProperties(excelVideoImportVo, b);
b.setUploadTime(new Date()); b.setUploadTime(new Date());
Book book = bookMapper.getIsbn(excelVideoImportVo.getISBN());
if(book!=null) {
Ebook ebook = ebookMapper.selectByPrimaryKey(book.getId());
if(ebook!=null) {
b.setImg(ebook.getImg());
}
}
mapper.insert(b); mapper.insert(b);
//查询所属一级分类 //查询所属一级分类
DiyType diyType = new DiyType(); DiyType diyType = new DiyType();
...@@ -411,6 +425,15 @@ public class VideoLibrarySerivceImpl extends BaseServiceImpl<VideoLibrary,String ...@@ -411,6 +425,15 @@ public class VideoLibrarySerivceImpl extends BaseServiceImpl<VideoLibrary,String
vdrMapper.insert(edt); vdrMapper.insert(edt);
}else { }else {
BeanUtils.copyPropertiesIgnoreNotNull(excelVideoImportVo, video,video); BeanUtils.copyPropertiesIgnoreNotNull(excelVideoImportVo, video,video);
if(video.getImg()==null) {
Book book = bookMapper.getIsbn(excelVideoImportVo.getISBN());
if(book!=null) {
Ebook ebook = ebookMapper.selectByPrimaryKey(book.getId());
if(ebook!=null) {
video.setImg(ebook.getImg());
}
}
}
mapper.updateByPrimaryKeySelective(video); mapper.updateByPrimaryKeySelective(video);
//查询所属一级分类 //查询所属一级分类
DiyType diyType = new DiyType(); DiyType diyType = new DiyType();
......
...@@ -54,5 +54,9 @@ public class CourseLibrary { ...@@ -54,5 +54,9 @@ public class CourseLibrary {
private Integer resourceType; private Integer resourceType;
@ApiModelProperty("播放次数") @ApiModelProperty("播放次数")
private Integer clickNum; private Integer clickNum;
@ApiModelProperty("置顶")
private Integer top;
@ApiModelProperty("排序")
private Integer sort;
} }
package com.zrqx.resource.commons.model.ebook; package com.zrqx.resource.commons.model.ebook;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.Date;
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;
/** /**
......
...@@ -11,6 +11,7 @@ import javax.persistence.Table; ...@@ -11,6 +11,7 @@ import javax.persistence.Table;
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;
import scala.collection.generic.BitOperations.Int;
@Data @Data
@ApiModel(value="VideoLibrary",description="视频库") @ApiModel(value="VideoLibrary",description="视频库")
@Table(name = "res_Video_Library") @Table(name = "res_Video_Library")
...@@ -72,4 +73,6 @@ public class VideoLibrary { ...@@ -72,4 +73,6 @@ public class VideoLibrary {
private Integer resourceType; private Integer resourceType;
@ApiModelProperty("播放次数") @ApiModelProperty("播放次数")
private Integer clickNum; private Integer clickNum;
@ApiModelProperty("置顶")
private Integer top;
} }
...@@ -22,8 +22,8 @@ public class ExcelVideoImportVo { ...@@ -22,8 +22,8 @@ public class ExcelVideoImportVo {
@ExcelResources(title="讲师") @ExcelResources(title="讲师")
private String author; private String author;
@ExcelResources(title="广告语") @ExcelResources(title="对应图书的ISBN")
private String adSlogan; private String ISBN;
@ExcelResources(title="课程一级分类") @ExcelResources(title="课程一级分类")
private String diyTypeName_1; private String diyTypeName_1;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论