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

--no commit message

上级 df999379
......@@ -24,11 +24,9 @@ import org.springframework.web.bind.annotation.RestController;
import com.github.pagehelper.PageHelper;
import com.zrqx.core.client.member.bg.ExpertMemberClient;
import com.zrqx.core.client.vo.member.EMemberVO;
import com.zrqx.core.enums.AllResourceTypeEnum;
import com.zrqx.core.enums.resource.author.DepartmentTypeEnum;
import com.zrqx.core.enums.resource.LibraryStatusEnum;
import com.zrqx.core.enums.resource.author.EducationTypeEnum;
import com.zrqx.core.enums.resource.author.TitleTypeEnum;
import com.zrqx.core.exception.BaseException;
import com.zrqx.core.util.page.PageInfo;
import com.zrqx.core.util.page.PageParam;
......@@ -39,7 +37,6 @@ import com.zrqx.resource.bg.service.authorLibrary.AuthorLibraryLabelContentDiyTy
import com.zrqx.resource.bg.service.authorLibrary.AuthorLibraryService;
import com.zrqx.resource.bg.service.marketing.PromotionContentService;
import com.zrqx.resource.bg.service.recommend.RecommendResourceService;
import com.zrqx.resource.commons.form.bg.QueryResourceForPoPForm;
import com.zrqx.resource.commons.form.bg.authorLibrary.QueryAuthorLibraryForm;
import com.zrqx.resource.commons.form.bg.authorLibrary.SaveUpdateAuthorForm;
import com.zrqx.resource.commons.form.bg.authorLibrary.StatusForm;
......@@ -54,7 +51,6 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import tk.mybatis.mapper.entity.Example;
import tk.mybatis.mapper.entity.Example.Criteria;
@RestController
@RequestMapping("/bg/authorLibrary")
......@@ -95,8 +91,8 @@ public class AuthorLibraryController {
throw new BaseException(1, "作者不能为空");
}
Example example = authorLibraryService.createExample();
example.createCriteria().andLike("name", name+"%");
PageHelper.startPage(1, 20);
example.createCriteria().andLike("name", "%" + name + "%");
//PageHelper.startPage(1, 20);
return CallBack.success(authorLibraryService.selectByExample(example));
}
......@@ -107,7 +103,7 @@ public class AuthorLibraryController {
return CallBack.success(authorLibraryService.selectAll());
}
@ApiOperation(value = "按照作者名模糊查询-会员添加", notes = "1:作者不能为空")
/*@ApiOperation(value = "按照作者名模糊查询-会员添加", notes = "1:作者不能为空")
@GetMapping("/other/{name}")
public CallBack<List<AuthorLibrary>> getList(@ApiParam(value = "作者名", required = true) @PathVariable String name) {
if(StringUtils.isBlank(name)){
......@@ -127,7 +123,7 @@ public class AuthorLibraryController {
}
PageHelper.startPage(1, 20);
return CallBack.success(authorLibraryService.selectByExample(example));
}
}*/
@ApiOperation(value = "查询", notes = "根据ID查询")
@GetMapping(value = "/{oid}")
......@@ -149,16 +145,27 @@ public class AuthorLibraryController {
return CallBack.success(vo);
}
@ApiOperation(value = "新增作者", notes = "新增一个作者")
@ApiOperation(value = "保存作者", notes = "保存一个作者")
@PostMapping("/save")
public CallBack<Boolean> save(@RequestBody SaveUpdateAuthorForm entity) {
if (!authorLibraryService.saveOrUpdate(entity)) {
throw new BaseException("操作失败");
}
if(StringUtils.isNotBlank(entity.getId())){
//推荐位内容修改
UpdateRecommendResourceForm res = new UpdateRecommendResourceForm();
res.setResId(entity.getId());
res.setResType(AllResourceTypeEnum.AUTHOR.getCode());
if(StringUtils.isNotBlank(entity.getImg())){
res.setResImg(entity.getImg());
}
res.setResName(entity.getName());
recommendResourceService.updateResourceContent(res);
}
return CallBack.success();
}
@ApiOperation(value = "更新作者", notes = "根据ID更新一个作者,空值默认不更新")
/*@ApiOperation(value = "更新作者", notes = "根据ID更新一个作者,空值默认不更新")
@PostMapping("/update")
public CallBack<Boolean> update(@RequestBody SaveUpdateAuthorForm entity) {
if (entity.getId() == null ) {
......@@ -175,12 +182,13 @@ public class AuthorLibraryController {
res.setResName(entity.getName());
recommendResourceService.updateResourceContent(res);
return CallBack.success();
}
}*/
@ApiOperation(value = "批量设置作者状态", notes = "批量设置作者状态")
@PostMapping(value = "/batch/update/status")
public CallBack<Boolean> updateStatus( @RequestBody StatusForm entity) {
if (entity.getStatus() == null ) {
if (entity.getStatus() == null || (!entity.getStatus().equals(LibraryStatusEnum.STATUS_1.getCode())
&& !entity.getStatus().equals(LibraryStatusEnum.STATUS_2.getCode()))) {
throw new BaseException("状态参数不正确!");
}
Example example = authorLibraryService.createExample();
......@@ -212,12 +220,6 @@ public class AuthorLibraryController {
resourceRelationService.deleteByExample(example);
return CallBack.success();
}
//@ApiOperation(value = "选择弹窗中的列表", notes = "查询选择弹窗中的列表")
//@GetMapping(value = ResourceRequestPath.RELATION_RESOURCE + ResourceRequestPath.POPPAGE)
public CallBack<PageInfo<AuthorLibraryListVO>> page(QueryResourceForPoPForm form, PageParam pageParam) {
return CallBack.success(authorLibraryService.pageByTitleAndDiyType(form, pageParam));
}
@ApiOperation(value = "学历列表", notes = "学历列表")
@GetMapping(value = "/education/list")
......@@ -227,21 +229,21 @@ public class AuthorLibraryController {
return CallBack.success(map);
}
@ApiOperation(value = "科室列表", notes = "科室列表")
/*@ApiOperation(value = "科室列表", notes = "科室列表")
@GetMapping(value = "/department/list")
public CallBack<Map<String, String>> getDepartmentList() {
Map<String, String> map = DepartmentTypeEnum.getAllEnumMap();
sortList(map);
return CallBack.success(map);
}
}*/
@ApiOperation(value = "职称列表", notes = "职称列表")
/*@ApiOperation(value = "职称列表", notes = "职称列表")
@GetMapping(value = "/title/list")
public CallBack<Map<String, String>> getTitleList() {
Map<String, String> map = TitleTypeEnum.getAllEnumMap();
sortList(map);
return CallBack.success(map);
}
}*/
public Map<String, String> sortList(Map<String, String> map){
List<Map.Entry<String,String>> list = new ArrayList<Map.Entry<String,String>>(map.entrySet());
......@@ -259,62 +261,4 @@ public class AuthorLibraryController {
return map;
}
/*@ApiOperation("相关资源列表")
@GetMapping(value = ResourceRequestPath.RELATION_RESOURCE + ResourceRequestPath.PAGE)
public CallBack<PageInfo<ResourceRelationVo>> reousrceRelationPage(QueryResourceRelationForm entity,
PageParam pageParam) {
if (entity == null || entity.getId() == null) {
throw new BaseException(ResponseCodeEnum.MISS_EXCEPTION.getCode(), "资源id不能为空!");
}
List<ResourceRelationVo> list = resourceService.queryByIdAndResourceType(entity, pageParam);
if (list == null || list.size() == 0) {
return CallBack.success(new PageInfo<ResourceRelationVo>(list));
}
return CallBack.success(new PageInfo<ResourceRelationVo>(resourceRelationService.queryRelationList(list)));
}
@ApiOperation(value = "保存相关资源" , notes ="保存相关资源")
@PostMapping(value = ResourceRequestPath.RELATION_RESOURCE + ResourceRequestPath.SAVE)
public CallBack<Boolean> saveRelation(@RequestBody SaveResourceRelationForm entity){
if(entity.getId() == null || entity.getResourceIds() == null || entity.getResourceType() == null || entity.getResourceIds().length == 0){
throw new BaseException(ResponseCodeEnum.MISS_EXCEPTION.getCode(), "必须指定id、被关联的resourceId、资源类型");
}
List<AuthorResource> recordList = new ArrayList<AuthorResource>();
Arrays.asList(entity.getResourceIds()).forEach(resourceId -> {
AuthorResource e = new AuthorResource();
e.setAuthorId(entity.getId());
e.setResourceId(resourceId);
e.setCreateTime(new Date());
e.setResourceType(entity.getResourceType());
recordList.add(e);
});
return CallBack.success(resourceService.insertList(recordList));
}
@ApiOperation(value = "批量删除关联资源", notes = "批量删除")
@PostMapping(value = ResourceRequestPath.RES_BATCH_DELETE)
public CallBack<Boolean> deleteByResourceIds(@RequestBody List<Integer> ids) {
if (ids.size() == 0) {
throw new BaseException(-7,"没有选中任何数据,请重新选择");
}
Example example = resourceService.createExample();
example.createCriteria().andIn("id", ids);
List<AuthorResource> list = resourceService.selectByExample(example);
for (AuthorResource entity : list) {
resourceService.deleteByPrimaryKey(entity);
}
return CallBack.success();
}
@ApiOperation(value = "修改排序号", notes = "修改排序号")
@PostMapping(value = ResourceRequestPath.UPDATE + ResourceRequestPath.SORT)
public CallBack<Boolean> updateSort(@RequestBody UpdateEbookRelationForm form) {
if (form.getId() == null) {
throw new BaseException("分类不能为空");
}
AuthorResource resource = resourceService.selectByPrimaryKey(form.getId());
resource.setSort(form.getSort());
resourceService.updateByPrimaryKeySelective(resource);
return CallBack.success();
}*/
}
......@@ -8,9 +8,11 @@ import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import com.zrqx.core.mapper.BaseMapper;
import com.zrqx.resource.commons.form.bg.QueryResourceForPoPForm;
import com.zrqx.resource.commons.form.bg.QueryResourceRelationForm;
import com.zrqx.resource.commons.model.resourcerelation.ResourceRelation;
import com.zrqx.resource.commons.vo.bg.ResourceRelationVo;
import com.zrqx.resource.commons.vo.bg.live.LiveVO;
@Mapper
public interface ResourceRelationMapper extends BaseMapper<ResourceRelation> {
......@@ -57,6 +59,49 @@ public interface ResourceRelationMapper extends BaseMapper<ResourceRelation> {
* 获取关联资源排序
* @return
*/
@Select("SELECT MAX(sort) FROM res_annex_resource where objectType = #{resourceType}")
Integer getMaxSort(@Param("resourceType")Integer resourceType);
@Select("SELECT MAX(sort) FROM res_resource_relation where objectId = #{objectId}")
Integer getMaxSort(@Param("resourceType")String objectId);
/**
* 根据直播id查询直播信息
* @param id
* @return
* @author ycw
* @date: 2020年4月22日 下午5:10:45
*/
@Select("<script>"
+ "SELECT b.id, b.name, b.img, b.author, b.status, b.createTime "
+ "FROM `hxkf-live`.l_live b "
+ "WHERE a.objectId = #{id} "
+ "</script>")
LiveVO queryLiveByLiveId(String id);
/*@Select("<script>"
+ "SELECT b.id, b.name, b.img, b.author, b.status, b.createTime "
+ "FROM `hxkf-resource`.res_resource_relation a "
+ "LEFT JOIN `hxkf-live`.l_live b ON a.resourceId = b.id "
+ "WHERE a.objectId = #{id} "
+ "<if test='resourceType != null'> "
+ " and resourceType = #{resourceType} "
+ "</if>"
+ "</script>")
LiveVO queryLiveById(String id);*/
// TODO 直播分类表
@Select("<script>"
+ "select DISTINCT a.id,a.name,a.author,a.img,a.status, DATE_FORMAT(a.createTime,'%Y-%m-%d %H:%i:%s') uploadTime "
+ "FROM `hxkf-live`.l_live a "
//+ "on a.id = t.courselibraryid "
+ " where 1 = 1 and a.status = 1 "
+ " like(a.name,form.name) "
//+ " like(t.code,form.diyTypeCode) "
+ "<if test='form.ids != null and form.ids.size > 0'>"
+ "and a.id not in "
+ " <foreach collection=\"form.ids\" index=\"index\" item=\"id\" open=\"(\" separator=\",\" close=\")\">"
+ "#{id}"
+ "</foreach>"
+ "</if>"
+ "</script>")
List<LiveVO> queryLiveByTileAndDiyType(@Param("form")QueryResourceForPoPForm form);
}
......@@ -45,9 +45,8 @@ public interface AnnexLibraryMapper extends BaseMapper<AnnexLibrary> {
+ "on a.id = ad.annexid "
+ "where 1=1 and a.status = 1 "
+ " eq(a.nationsType,form.nationsType) "
+ " like(ad.code,form.diyTypeCode) "
+ " like(a.name,form.title) "
+ " like(a.name,form.name) "
+ "<if test='form.ids != null and form.ids.size > 0'>"
+ "and a.id not in "
......
......@@ -45,14 +45,13 @@ public interface ArticleLibraryMapper extends BaseMapper<ArticleLibrary> {
@Select("<script>"
+ " select a.id,a.name,a.author,a.source,a.bookName,a.price,a.realPrice,a.uploadTime,a.status,a.img,a.nationsType,a.resourceType "
+ " select a.id,a.name,a.author,a.source,a.bookName,a.price,a.realPrice,a.uploadTime,a.status,a.img,a.resourceType "
+ " from res_Article_Library a left join res_Article_Library_Diy_Type ad "
+ " on a.id = ad.alid "
+ " where 1=1 and a.status = 1 "
+ " eq(a.nationsType,form.nationsType) "
+ " like(ad.code,form.diyTypeCode) "
+ " like(a.name,form.title) "
+ " like(a.name,form.name) "
+ " eq(a.resourceType,form.resourceType) "
+ "<if test='form.ids != null and form.ids.size > 0'>"
......
......@@ -13,7 +13,7 @@ import com.zrqx.resource.commons.vo.bg.authorlibrary.AuthorLibraryListVO;
public interface AuthorLibraryMapper extends BaseMapper<AuthorLibrary> {
@Select("<script>"
+ "select a.id,a.name,a.institutionName,a.sex,a.education,a.department,a.title,a.post,a.synopsis,a.img,a.status,a.uploadTime "
+ "select a.id,a.name,a.institutionName,a.sex,a.education,a.department,a.title,a.post,a.expertise,a.synopsis,a.img,a.status,a.uploadTime "
+ "FROM res_author_library a left join res_author_library_diy_type t "
+ "on a.id = t.authorlibraryid where 1 = 1 "
......
......@@ -40,13 +40,13 @@ public interface CourseLibraryMapper extends BaseMapper<CourseLibrary> {
List<CourseLibraryListVO> query(@Param("form")QueryCourseLibraryForm form);
@Select("<script>"
+ "select DISTINCT a.id,a.name,a.author,a.source,a.cover,a.status,DATE_FORMAT(a.authorizationTime,'%Y-%m-%d %H:%i:%s') authorizationTime, DATE_FORMAT(a.uploadTime,'%Y-%m-%d %H:%i:%s') uploadTime,a.resourceType "
+ "select DISTINCT a.id,a.name,a.author,a.img,a.status,DATE_FORMAT(a.authorizationTime,'%Y-%m-%d %H:%i:%s') authorizationTime, DATE_FORMAT(a.uploadTime,'%Y-%m-%d %H:%i:%s') uploadTime,a.resourceType "
+ "FROM res_course_library a left join res_course_library_diy_type t "
+ "on a.id = t.courselibraryid "
+ " where 1 = 1 and a.status = 1 "
+ " like(a.name,form.title) "
+ " like(t.diytypeCode,form.diyTypeCode) "
+ " like(a.name,form.name) "
+ " like(t.code,form.diyTypeCode) "
+ "<if test='form.ids != null and form.ids.size > 0'>"
+ "and a.id not in "
......
......@@ -83,15 +83,15 @@ public interface EbookMapper extends BaseMapper<Ebook>{
@Select("<script>"
+ "SELECT "
+ " bb.id,bb.name,bb.author,bb.isbn, "
+ " be.bookCover,be.price,be.realPrice,be.uploadTime,be.updateTime,be.bookStatus "
+ " be.img,be.price,be.realPrice,be.uploadTime,be.updateTime,be.bookStatus "
+ " FROM res_book bb "
+ " LEFT JOIN res_ebook be ON bb.id = be.id "
+ " LEFT JOIN res_ebook_diy_type bdt ON be.id = bdt.ebookid"
+ " WHERE 1 = 1 and be.bookStatus = 4 and be.realPrice IS NOT NULL "
+ " like(bdt.Code,form.diyTypeCode) "
+ " like(bb.name,form.title) "
+ " like(bdt.code,form.diyTypeCode) "
+ " like(bb.name,form.name) "
+ "<if test='form.ids != null and form.ids.size > 0'>"
+ "and bb.id not in "
......
......@@ -44,7 +44,8 @@ public interface VideoLibraryMapper extends BaseMapper<VideoLibrary> {
List<VideoLibraryListVO> query(@Param("form")QueryVideoLibraryForm form);
@Select("<script>"
+ "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 "
+ "select a.id,a.name,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 "
+ "on a.id = ad.vlid "
+ "where 1=1 and a.status = 1 "
......
......@@ -3,10 +3,13 @@ package com.zrqx.resource.bg.service;
import java.util.List;
import com.zrqx.core.service.BaseService;
import com.zrqx.core.util.page.PageInfo;
import com.zrqx.core.util.page.PageParam;
import com.zrqx.resource.commons.form.bg.QueryResourceForPoPForm;
import com.zrqx.resource.commons.form.bg.QueryResourceRelationForm;
import com.zrqx.resource.commons.model.resourcerelation.ResourceRelation;
import com.zrqx.resource.commons.vo.bg.ResourceRelationVo;
import com.zrqx.resource.commons.vo.bg.live.LiveVO;
public interface ResourceRelationService extends BaseService<ResourceRelation, Integer> {
......@@ -22,8 +25,18 @@ public interface ResourceRelationService extends BaseService<ResourceRelation, I
/**
* 获取排序
* @param resourceType
* @param objectId
* @return
*/
Integer getMaxSort(Integer resourceType);
Integer getMaxSort(String objectId);
/**
* 查询直播
* @param form
* @param pageParam
* @return
* @author ycw
* @date: 2020年4月22日 下午6:20:43
*/
PageInfo<LiveVO> pageLiveByTitleAndDiyType(QueryResourceForPoPForm form, PageParam pageParam);
}
......@@ -8,8 +8,10 @@ import org.springframework.stereotype.Service;
import com.github.pagehelper.PageHelper;
import com.zrqx.core.enums.AllResourceTypeEnum;
import com.zrqx.core.enums.resource.LibraryStatusEnum;
import com.zrqx.core.mapper.BaseMapper;
import com.zrqx.core.service.BaseServiceImpl;
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.annexlibrary.AnnexLibraryMapper;
......@@ -21,6 +23,7 @@ import com.zrqx.resource.bg.mapper.ebook.BookMapper;
import com.zrqx.resource.bg.mapper.imagelibrary.ImageLibraryMapper;
import com.zrqx.resource.bg.mapper.projectlibrary.ProjectLibraryMapper;
import com.zrqx.resource.bg.mapper.videolibrary.VideoLibraryMapper;
import com.zrqx.resource.commons.form.bg.QueryResourceForPoPForm;
import com.zrqx.resource.commons.form.bg.QueryResourceRelationForm;
import com.zrqx.resource.commons.model.annexlibrary.AnnexLibrary;
import com.zrqx.resource.commons.model.articlelibrary.ArticleLibrary;
......@@ -32,6 +35,7 @@ import com.zrqx.resource.commons.model.imagelibrary.ImageLibrary;
import com.zrqx.resource.commons.model.resourcerelation.ResourceRelation;
import com.zrqx.resource.commons.model.videolibrary.VideoLibrary;
import com.zrqx.resource.commons.vo.bg.ResourceRelationVo;
import com.zrqx.resource.commons.vo.bg.live.LiveVO;
@Service
public class ResourceRelationServiceImpl extends BaseServiceImpl<ResourceRelation,Integer> implements ResourceRelationService {
......@@ -68,6 +72,7 @@ public class ResourceRelationServiceImpl extends BaseServiceImpl<ResourceRelatio
Book vl = bookMapper.selectByPrimaryKey(e.getResourceId());
if (vl != null) {
e.setName(vl.getName());
e.setAuthor(vl.getAuthor());
e.setResType_zh(AllResourceTypeEnum.BOOK.getName());
}
}
......@@ -75,6 +80,7 @@ public class ResourceRelationServiceImpl extends BaseServiceImpl<ResourceRelatio
VideoLibrary vl = videoLibraryMapper.selectByPrimaryKey(e.getResourceId());
if (vl != null) {
e.setName(vl.getName());
e.setAuthor(vl.getAuthor());
e.setResType_zh(AllResourceTypeEnum.VIDEO.getName());
}
}
......@@ -117,9 +123,19 @@ public class ResourceRelationServiceImpl extends BaseServiceImpl<ResourceRelatio
CourseLibrary cl = courseLibraryMapper.selectByPrimaryKey(e.getResourceId());
if (cl != null) {
e.setName(cl.getName());
e.setAuthor(cl.getAuthor());
e.setResType_zh(AllResourceTypeEnum.COURSE.getName());
}
}
// 直播
if (e.getResourceType().equals(AllResourceTypeEnum.LIVE.getCode())) {
LiveVO vo = mapper.queryLiveByLiveId(e.getResourceId());
if (vo != null) {
e.setName(vo.getName());
e.setAuthor(vo.getAuthor());
e.setResType_zh(AllResourceTypeEnum.LIVE.getName());
}
}
}
});
return list;
......@@ -138,8 +154,8 @@ public class ResourceRelationServiceImpl extends BaseServiceImpl<ResourceRelatio
}
@Override
public Integer getMaxSort(Integer resourceType) {
Integer sort = mapper.getMaxSort(resourceType);
public Integer getMaxSort(String objectId) {
Integer sort = mapper.getMaxSort(objectId);
if(sort == null){
sort = 1;
}else{
......@@ -147,4 +163,15 @@ public class ResourceRelationServiceImpl extends BaseServiceImpl<ResourceRelatio
}
return sort;
}
@Override
public PageInfo<LiveVO> pageLiveByTitleAndDiyType(QueryResourceForPoPForm form, PageParam pageParam){
if(pageParam != null && StringUtils.isBlank(pageParam.getOrderBy())){
pageParam.setOrderBy("uploadTime desc,id desc");
}
startPage(pageParam);
List<LiveVO> list = mapper.queryLiveByTileAndDiyType(form);
list.forEach( li -> li.setStatus_zh(LibraryStatusEnum.getName(li.getStatus())));
return new PageInfo<LiveVO>(list);
}
}
......@@ -266,7 +266,7 @@ public class AnnexLibrarySerivceImpl extends BaseServiceImpl<AnnexLibrary,String
List<AnnexLibraryListVO> list = mapper.queryByTileAndDiyType(form);
if(!list.isEmpty()){
for(AnnexLibraryListVO ebookListVO : list){
ebookListVO.setStatus_zh(LibraryStatusEnum.getName(Integer.parseInt(ebookListVO.getStatus())));
ebookListVO.setStatus_zh(LibraryStatusEnum.getName(ebookListVO.getStatus()));
}
}
return new PageInfo<AnnexLibraryListVO>(list);
......
......@@ -179,11 +179,14 @@ public class ArticleLibrarySerivceImpl extends BaseServiceImpl<ArticleLibrary,St
}
@Override
public PageInfo<ArticleLibraryListVO> pageByTitleAndDiyType(QueryResourceForPoPForm form, PageParam pageParam) {
if(pageParam != null && StringUtils.isBlank(pageParam.getOrderBy())){
pageParam.setOrderBy("uploadTime desc,id desc");
}
startPage(pageParam);
List<ArticleLibraryListVO> list = mapper.queryByTileAndDiyType(form);
if(!list.isEmpty()){
for(ArticleLibraryListVO ebookListVO : list){
ebookListVO.setStatus_zh(LibraryStatusEnum.getName(Integer.parseInt(ebookListVO.getStatus())));
ebookListVO.setStatus_zh(LibraryStatusEnum.getName(ebookListVO.getStatus()));
}
}
return new PageInfo<ArticleLibraryListVO>(list);
......
......@@ -109,7 +109,7 @@ public class AuthorLibraryServiceImpl extends BaseServiceImpl<AuthorLibrary, Str
List<AuthorLibraryListVO> list = authorLibraryMapper.queryByTileAndDiyType(form);
if(!list.isEmpty()){
for(AuthorLibraryListVO ebookListVO : list){
ebookListVO.setStatus_zh(LibraryStatusEnum.getName(Integer.parseInt(ebookListVO.getStatus())));
ebookListVO.setStatus_zh(LibraryStatusEnum.getName(ebookListVO.getStatus()));
}
}
return new PageInfo<AuthorLibraryListVO>(list);
......
......@@ -191,11 +191,14 @@ public class CourseLibrarySerivceImpl extends BaseServiceImpl<CourseLibrary,Stri
*/
@Override
public PageInfo<CourseLibraryListVO> pageByTitleAndDiyType(QueryResourceForPoPForm form, PageParam pageParam){
if(pageParam != null && StringUtils.isBlank(pageParam.getOrderBy())){
pageParam.setOrderBy("uploadTime desc");
}
startPage(pageParam);
List<CourseLibraryListVO> list = mapper.queryByTileAndDiyType(form);
if(!list.isEmpty()){
for(CourseLibraryListVO ebookListVO : list){
ebookListVO.setStatus_zh(LibraryStatusEnum.getName(ebookListVO.getStatus()));
for(CourseLibraryListVO li : list){
li.setStatus_zh(LibraryStatusEnum.getName(li.getStatus()));
}
}
return new PageInfo<CourseLibraryListVO>(list);
......
......@@ -262,20 +262,20 @@ public class EbookServiceImpl extends BaseServiceImpl<Ebook, String> implements
}
startPage(pageParam);
List<EbookListVO> list = ebookMapper.page(form);
list.stream().forEach( li -> li.setStatus_zh(EbookStatusEnum.getName(Integer.parseInt(li.getBookStatus()))));
list.stream().forEach( li -> li.setStatus_zh(EbookStatusEnum.getName(li.getBookStatus())));
return new PageInfo<EbookListVO>(list);
}
@Override
public PageInfo<EbookListVO> pageByTitleAndDiyType(QueryResourceForPoPForm form, PageParam pageParam) {
if(pageParam != null && StringUtils.isBlank(pageParam.getOrderBy())){
pageParam.setOrderBy("uploadTime desc,id desc");
pageParam.setOrderBy("uploadTime desc");
}
startPage(pageParam);
List<EbookListVO> list = ebookMapper.queryByTileAndDiyType(form);
if(!list.isEmpty()){
for(EbookListVO ebookListVO : list){
ebookListVO.setStatus_zh(EbookStatusEnum.getName(Integer.parseInt(ebookListVO.getBookStatus())));
ebookListVO.setStatus_zh(EbookStatusEnum.getName(ebookListVO.getBookStatus()));
}
}
return new PageInfo<EbookListVO>(list);
......
......@@ -254,8 +254,8 @@ public class VideoLibrarySerivceImpl extends BaseServiceImpl<VideoLibrary,String
startPage(pageParam);
List<VideoLibraryListVO> list = mapper.queryByTileAndDiyType(form);
if(!list.isEmpty()){
for(VideoLibraryListVO ebookListVO : list){
ebookListVO.setStatus_zh(LibraryStatusEnum.getName(ebookListVO.getStatus()));
for(VideoLibraryListVO li : list){
li.setStatus_zh(LibraryStatusEnum.getName(li.getStatus()));
}
}
return new PageInfo<VideoLibraryListVO>(list);
......
......@@ -14,11 +14,9 @@ public class QueryResourceForPoPForm {
@ApiModelProperty(value = "资源id集合")
private List<String> ids;
@ApiModelProperty(value = "资源名称")
private String title;
private String name;
@ApiModelProperty("自定义分类code")
private String diyTypeCode;
@ApiModelProperty("民族 1蒙古族 2侗族 3藏族 4朝鲜族 5土家族 6回族 7满族 8汉族")
private Integer nationsType;
@ApiModelProperty("(只在添加文章时需传入)文章类型 31理论32药物33方剂 34临床 35医案36文化 37机构38医论48其他 49未分类 50蒙文")
private Integer resourceType;
......
......@@ -8,8 +8,8 @@ import lombok.Data;
public class QueryResourceRelationForm {
@ApiModelProperty(value = "当前资源id",required = true)
private String id;
@ApiModelProperty(value = "当前资源类型 1图书、2医家、3文章、4图片、5视频、6音频、7附件",required = true)
@ApiModelProperty(value = "当前资源类型 1图书、2文献、3文章、4专家、5视频、6系列课、7直播、8文件",required = true)
private Integer type;
@ApiModelProperty("资源类型 1图书、2医家、3文章、4图片、5视频、6音频、7附件")
@ApiModelProperty("资源类型 1图书、2文献、3文章、4专家、5视频、6系列课、7直播、8文件")
private Integer resourceType;
}
......@@ -7,11 +7,11 @@ import lombok.Data;
public class SaveResourceRelationForm {
@ApiModelProperty("当前资源id")
private String id;
@ApiModelProperty("资源类型 1图书、2医家、3文章、4图片、5视频、6音频、7附件、8专题、9课程")
@ApiModelProperty("当前资源类型 ")
private Integer type;
@ApiModelProperty("被关联资源id")
private String[] resourceIds;
@ApiModelProperty("资源类型 1图书、2医家、3文章、4图片、5视频、6音频、7附件、8专题、9课程")
@ApiModelProperty("被关联资源类型 ")
private Integer resourceType;
}
package com.zrqx.resource.commons.form.bg.ebook;
import io.swagger.annotations.ApiModelProperty;
package com.zrqx.resource.commons.form.bg;
import java.util.List;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class UpdateEbookRelationForm {
public class UpdateRelationForm {
@ApiModelProperty("id")
private List<Integer> id;
/**排序号**/
......
......@@ -29,6 +29,8 @@ public class SaveUpdateAuthorForm {
private String title;
@ApiModelProperty("职务")
private String post;
@ApiModelProperty("擅长领域")
private String expertise;
@ApiModelProperty("简介")
private String synopsis;
@ApiModelProperty("头像")
......
......@@ -8,12 +8,10 @@ import lombok.Data;
@ApiModel(value="QueryLibraryForm",description="查询资源")
public class QueryLibraryForm {
@ApiModelProperty(value = "标题")
private String title;
private String name;
@ApiModelProperty("自定义分类code")
private String diyTypeCode;
@ApiModelProperty("民族 1蒙古族 2侗族 3藏族 4朝鲜族 5土家族 6回族 7满族 8汉族")
private Integer nationsType;
@ApiModelProperty("资源类型 1图书、2医家、3文章、4图片、5视频、6音频、7附件")
@ApiModelProperty("资源类型 ")
private Integer resourceType;
@ApiModelProperty("推荐位id")
......
......@@ -36,6 +36,8 @@ public class AuthorLibrary {
private String title;
@ApiModelProperty("职务")
private String post;
@ApiModelProperty("擅长领域")
private String expertise;
@ApiModelProperty("简介")
private String synopsis;
@ApiModelProperty("头像")
......@@ -46,8 +48,6 @@ public class AuthorLibrary {
private Date uploadTime;
@ApiModelProperty("修改时间")
private Date updateTime;
@ApiModelProperty("民族 1蒙古族 2侗族 3藏族 4朝鲜族 5土家族 6回族 7满族 8汉族")
private Integer nationsType;
@ApiModelProperty("浏览次数")
private Integer browseNum;
@ApiModelProperty("资源类型")
......
......@@ -13,9 +13,11 @@ public class ResourceRelationVo {
private String resourceId;
@ApiModelProperty("资源名")
private String name;
@ApiModelProperty("资源类型1图书、2医家、3文章、4图片、5视频、6音频、7附件")
@ApiModelProperty("讲师")
private String author;
@ApiModelProperty("资源类型 ")
private Integer resourceType;
@ApiModelProperty("1图书、2医家、3文章、4图片、5视频、6音频、7附件")
@ApiModelProperty("资源类型")
private String resType_zh;
@ApiModelProperty("创建时间")
private Date createTime;
......
......@@ -26,7 +26,7 @@ public class AnnexLibraryListVO {
@ApiModelProperty("大小")
private String size;
@ApiModelProperty("状态:0待审核,1已上架,2已下架")
private String status;
private Integer status;
@ApiModelProperty("状态:0待审核,1已上架,2已下架")
private String status_zh;
@ApiModelProperty("作者")
......
......@@ -26,13 +26,11 @@ public class ArticleLibraryListVO {
@ApiModelProperty("上传时间")
private Date uploadTime;
@ApiModelProperty("状态:0待审核,1已上架,2已下架")
private String status;
private Integer status;
@ApiModelProperty("状态:0待审核,1已上架,2已下架")
private String status_zh;
@ApiModelProperty("封面图片")
private String img;
@ApiModelProperty("民族 1蒙古族 2侗族 3藏族 4朝鲜族 5土家族 6回族 7满族 8汉族")
private Integer nationsType;
@ApiModelProperty("1图书、2医家、3文章、4图片、5视频、6音频、7附件")
private Integer resourceType;
}
......@@ -24,16 +24,22 @@ public class AuthorLibraryListVO {
private String institutionName;
@ApiModelProperty("性别0女 1男")
private Integer sex;
@ApiModelProperty("学历 0:大专 1:本科 2:硕士 3:博士")
private Integer education;
@ApiModelProperty("科室 0:骨科 1:内科 2:外科")
private String department;
@ApiModelProperty("职称")
private String title;
@ApiModelProperty("职务")
private String post;
@ApiModelProperty("擅长领域")
private String expertise;
@ApiModelProperty("简介")
private String synopsis;
@ApiModelProperty("头像")
private String img;
@ApiModelProperty("状态 0已录入 1上架 2下架 ")
private String status;
private Integer status;
@ApiModelProperty("状态 0已录入 1上架 2下架 ")
private String status_zh;
@ApiModelProperty("创建时间")
......
......@@ -33,6 +33,8 @@ public class AuthorLibraryOneVO {
private String title;
@ApiModelProperty("职务")
private String post;
@ApiModelProperty("擅长领域")
private String expertise;
@ApiModelProperty("简介")
private String synopsis;
@ApiModelProperty("头像")
......
package com.zrqx.resource.commons.vo.bg.courselibrary;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.math.BigDecimal;
import java.util.Date;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
......@@ -16,8 +14,16 @@ public class CourseLibraryListVO {
private String id;
@ApiModelProperty("资源名称")
private String name;
@ApiModelProperty("讲师")
private String author;
@ApiModelProperty("讲师id")
private String authorId;
@ApiModelProperty("封面")
private String img;
@ApiModelProperty("简介")
private String synopsis;
@ApiModelProperty("定价 元")
private String price;
@ApiModelProperty("售价 元")
private String realPrice;
@ApiModelProperty("视频数量")
......
......@@ -26,7 +26,7 @@ public class EbookListVO {
@ApiModelProperty("更新时间")
private Date updateTime;
@ApiModelProperty("电子书状态 0:录入中 1:待审核 2:审核中 3:审核不通过 4:已上架 5:已下架")
private String bookStatus;
private Integer bookStatus;
@ApiModelProperty("电子书状态 0:录入中 1:待审核 2:审核中 3:审核不通过 4:已上架 5:已下架")
private String status_zh;
}
package com.zrqx.resource.commons.vo.bg.live;
import java.util.Date;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class LiveVO {
@ApiModelProperty("直播id")
private String id;
@ApiModelProperty("直播标题")
private String name;
@ApiModelProperty("讲师")
private String author;
@ApiModelProperty("封面")
private String img;
@ApiModelProperty("状态 0上架 1下架")
private Integer status;
@ApiModelProperty("状态 0上架 1下架")
private String status_zh;
@ApiModelProperty("创建时间")
private Date createTime;
}
......@@ -2,9 +2,6 @@ package com.zrqx.resource.commons.vo.bg.videolibrary;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.Date;
import lombok.Data;
@Data
@ApiModel(value="VideoLibraryListVO",description="查询附件集合返回的实体")
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论