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

--no commit message

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