提交 941d2d55 authored 作者: liupengfei's avatar liupengfei

--no commit message

上级 171c0600
......@@ -173,7 +173,7 @@ public class EbookServiceImpl extends BaseServiceImpl<Ebook, String> implements
QrCode qrCode = new QrCode();
qrCode.setResourceId(book.getId());
qrCode.setResourceType(AllResourceTypeEnum.BOOK.getCode());
qrCode.setUploadTime(new Date());
qrCode.setCreateTime(new Date());
String path = "/opt/upload/hxwza/qr";
try {
QrCodeCreateUtil.createQrCode(path + "/" + book.getId() + ".jpg","/app/index.html#/book_details?id="+book.getId());
......
......@@ -7,7 +7,7 @@ import lombok.Data;
@Data
@ApiModel(value="FgQueryOtherEbookForm",description="同类图书排行")
public class FgQueryOtherEbookForm {
@ApiModelProperty(value = "图书id", required = true)
@ApiModelProperty(value = "图书id")
private String id;
@ApiModelProperty(value = "展示数量", required = true)
private Integer num;
......
......@@ -26,5 +26,5 @@ public class QrCode {
@ApiModelProperty("资源类型")
private Integer resourceType;
@ApiModelProperty("创建时间")
private Date uploadTime;
private Date createTime;
}
......@@ -19,6 +19,8 @@ public class FgVideoLibraryListVO {
private String id;
@ApiModelProperty("封面")
private String img;
@ApiModelProperty("售价")
private String realPrice;
@ApiModelProperty(value = "视频名称")
private String name;
@ApiModelProperty("浏览数量")
......
......@@ -40,7 +40,7 @@ public interface FgEbookDiyTypeMapper extends BaseMapper<EbookDiyType> {
@Select("<script>"
+ "select rdt.id, rdt.parentId, rdt.sort, rdt.showName, rdt.code "
+ "FROM res_Diy_Type rdt "
+ "left join res_ebook_diy_type redt on rdt.id = redt.diyTypeId "
+ "left join res_ebook_diy_type redt on rdt.id = redt.dtid "
+ "where redt.ebookId = #{oid}"
+ "</script>")
List<DiyType> selectDiyTypeList(String oid);
......
......@@ -167,7 +167,7 @@ public interface FgEbookMapper extends BaseMapper<Ebook>{
*/
@Select("<script>"
+ "select bb.id, bb.name, bb.authorId, bb.author, bb.translatorId, bb.translator, "
+ "bb.publishTime, bb.status, be.price, be.priceOption, be.realPrice, be.img, be.synopsis, be.bookStatus, be.browseNum, be.goodsType "
+ "bb.publishTime, bb.status, be.price, be.priceOption, be.realPrice, be.img, be.synopsis, be.bookStatus, be.browseNum, bb.resourceType "
+ "FROM res_book bb "
+ "LEFT JOIN res_ebook be ON bb.id = be.id "
+ "WHERE be.bookStatus = 4 "
......@@ -217,22 +217,21 @@ public interface FgEbookMapper extends BaseMapper<Ebook>{
*/
@Select("<script>"
+ "SELECT bb.id, bb.name, bb.authorId, bb.author, bb.translatorId, bb.translator, "
+ "bb.publishTime, bb.status, bb.resourceType, be.priceOption, be.realPrice,be.price,be.bookCover, be.bookStatus, be.browseNum,a.score,a.num "
+ "bb.publishTime, bb.status, bb.resourceType, be.priceOption, be.realPrice,be.price,be.img, be.bookStatus, be.browseNum,a.score,a.num "
+ ",qr.qrCode "
+ "FROM `hxwza-resource`.res_book bb "
+ "LEFT JOIN `hxwza-resource`.res_ebook be ON bb.id = be.id "
+ "FROM hxwza_resource.res_book bb "
+ "LEFT JOIN hxwza_resource.res_ebook be ON bb.id = be.id "
+ "LEFT JOIN hxwza_resource.res_qr_code qr ON be.id = qr.resourceId "
+ "LEFT JOIN (SELECT CEILING(AVG(score))score ,resourceId,resourceName,resourceType,COUNT(resourceId) num "
+ "LEFT JOIN res_qr_code qr ON be.id = qr.resourceId "
+ "FROM `hxwza-sysuser`.sys_comment c "
+ "WHERE STATUS = 1 AND mainId = 0 AND resourceType =1 GROUP BY resourceId ORDER BY score DESC )a ON bb.id = a.resourceIdwhere be.bookStatus = 4 "
+ "FROM hxwza_sysuser.sys_comment c "
+ "WHERE STATUS = 1 AND mainId = 0 AND resourceType =1 GROUP BY resourceId ORDER BY score DESC )a ON bb.id = a.resourceId "
+ "WHERE be.bookStatus = 4 "
+ "<if test='form.ids != null and form.ids.size > 0' >"
+ "and bb.id not in "
+ "and bb.id not in "
+ " <foreach collection=\"form.ids\" index=\"index\" item=\"id\" open=\"(\" separator=\",\" close=\")\">"
+ "#{id}"
+ "</foreach>"
+ "</if>"
+ ")a"
+ "</script>")
List<FgEbookListVO> getDiyTypeOtherRecommendList(@Param("form")FgQueryRecommedEbookForm form);
}
......@@ -66,7 +66,7 @@ public interface FgVideoLibraryMapper extends BaseMapper<VideoLibrary> {
* @return
*/
@Select("<script>"
+ "select a.id.a.name,a.resourceType,a.img,a.realPrice,a.browseNum "
+ "select a.id,a.name,a.resourceType,a.img,a.realPrice,a.browseNum,a.uploadTime "
+ "from res_video_Library a "
+ "where a.status = 1 "
+ "<if test='form.resourceType != null' >"
......@@ -79,7 +79,7 @@ public interface FgVideoLibraryMapper extends BaseMapper<VideoLibrary> {
+ "</foreach>"
+ "</if>"
+ "union "
+ "select a.id.a.name,a.resourceType,a.img,a.realPrice,a.browseNum "
+ "select a.id,a.name,a.resourceType,a.img,a.realPrice,a.browseNum,a.uploadTime "
+ "from res_audio_Library a "
+ "where a.status = 1 "
+ "<if test='form.resourceType != null' >"
......
......@@ -121,7 +121,11 @@ public class FgEbookServiceImpl extends BaseServiceImpl<Ebook, String> implement
queryCommentForm.setResourceType(li.getResourceType());
FgCommentNumAndScoreVo commentNumAndScoreVo = sysuserClient.getCommentNumAndScore(queryCommentForm).getData();
if(commentNumAndScoreVo != null){
li.setResourceScore(commentNumAndScoreVo.getResourceScore());
if(commentNumAndScoreVo.getResourceScore() == null) {
li.setResourceScore(5);
}else {
li.setResourceScore(commentNumAndScoreVo.getResourceScore());
}
li.setCommentNum(commentNumAndScoreVo.getCommentNum());
}
//查询分类
......@@ -707,7 +711,11 @@ public class FgEbookServiceImpl extends BaseServiceImpl<Ebook, String> implement
queryCommentForm.setResourceType(li.getResourceType());
FgCommentNumAndScoreVo commentNumAndScoreVo = sysuserClient.getCommentNumAndScore(queryCommentForm).getData();
if(commentNumAndScoreVo != null){
li.setResourceScore(commentNumAndScoreVo.getResourceScore());
if(commentNumAndScoreVo.getResourceScore() == null) {
li.setResourceScore(5);
}else {
li.setResourceScore(commentNumAndScoreVo.getResourceScore());
}
li.setCommentNum(commentNumAndScoreVo.getCommentNum());
}
//查询分类
......
......@@ -18,12 +18,15 @@ import org.springframework.stereotype.Service;
import com.github.pagehelper.PageHelper;
import com.zrqx.core.client.form.order.GoodsForm;
import com.zrqx.core.client.form.order.OrderInfo;
import com.zrqx.core.client.form.sysuser.FgQueryCommentForm;
import com.zrqx.core.client.live.fg.FgLiveClient;
import com.zrqx.core.client.member.fg.FgPersonalMemberClient;
import com.zrqx.core.client.member.fg.OrganClient;
import com.zrqx.core.client.order.fg.FgOrderClient;
import com.zrqx.core.client.sysuser.fg.FgSysuserClient;
import com.zrqx.core.client.vo.live.FgLiveInfoVo;
import com.zrqx.core.client.vo.member.MemberInfo;
import com.zrqx.core.client.vo.sysuser.FgCommentNumAndScoreVo;
import com.zrqx.core.commons.form.LoginMemberInfo;
import com.zrqx.core.commons.redis.Redis;
import com.zrqx.core.enums.BooleanStatusEnum;
......@@ -43,6 +46,7 @@ import com.zrqx.resource.commons.form.fg.courselibrary.FgRecommendCourseForm;
import com.zrqx.resource.commons.form.fg.videolibrary.FgQueryRecommedVideoForm;
import com.zrqx.resource.commons.model.courcelibrary.CourseLibrary;
import com.zrqx.resource.commons.model.courcelibrary.CourseLibraryDiyType;
import com.zrqx.resource.commons.model.diytype.DiyType;
import com.zrqx.resource.commons.model.videolibrary.ScheduleRecord;
import com.zrqx.resource.commons.model.videolibrary.TimeLengthRecord;
import com.zrqx.resource.commons.model.videolibrary.VideoLibrary;
......@@ -102,6 +106,8 @@ public class FgVideoLibrarySerivceImpl extends BaseServiceImpl<VideoLibrary, Str
private FgLiveClient liveClient;
@Autowired
private FgPersonalMemberClient personalMemberClient;
@Autowired
private FgSysuserClient sysuserClient;
@Override
public BaseMapper<VideoLibrary> getMapper() {
......@@ -159,6 +165,21 @@ public class FgVideoLibrarySerivceImpl extends BaseServiceImpl<VideoLibrary, Str
}
}
regEx(list);
list.forEach(li -> {
//查询评分
FgQueryCommentForm queryCommentForm = new FgQueryCommentForm();
queryCommentForm.setResourceId(li.getId());
queryCommentForm.setResourceType(li.getResourceType());
FgCommentNumAndScoreVo commentNumAndScoreVo = sysuserClient.getCommentNumAndScore(queryCommentForm).getData();
if(commentNumAndScoreVo != null){
if(commentNumAndScoreVo.getResourceScore() == null) {
li.setResourceScore(5);
}else {
li.setResourceScore(commentNumAndScoreVo.getResourceScore());
}
li.setCommentNum(commentNumAndScoreVo.getCommentNum());
}
});
PageInfo<FgVideoLibraryListVO> page = new PageInfo<FgVideoLibraryListVO>(list);
if(isComplete){
page.setSize(list.size());
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论