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

--no commit message

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