Commit d311618a by 吴博

feat: [1007270] 【优化】落地页不区分是否开启小睿

parent 7434221a
......@@ -48,7 +48,7 @@ public interface AppletUserBookcaseBiz {
Map<String,Object> getUserClickStatistic(Long wechatUserId, Long bookId, Long channelId, Long adviserId);
UserLastBookReDTO getUserLastBookRe(Long wechatUserId, Long officialAccountsId);
UserLastBookReDTO getUserLastBookRe(Long wechatUserId, Long officialAccountsId, Integer isAllBook);
/**
* 批量删除
......
......@@ -417,7 +417,7 @@ public class AppletUserBookcaseBizImpl implements AppletUserBookcaseBiz {
@ParamLog("获取用户最后一次点击的书")
@Override
public UserLastBookReDTO getUserLastBookRe(Long wechatUserId, Long officialAccountsId) {
public UserLastBookReDTO getUserLastBookRe(Long wechatUserId, Long officialAccountsId, Integer isAllBook) {
if (wechatUserId == null) {
throw new BookBizException(BookBizException.PARAM_IS_ERROR, "参数有误!");
}
......@@ -434,7 +434,7 @@ public class AppletUserBookcaseBizImpl implements AppletUserBookcaseBiz {
bookId = 5210703L;
}
List<Long> allDlBookIds = functionConsr.getAllDlBookId();
lastBookRe = appletUserBookcaseDao.getUserLastRe(wechatUserIdList, adviserId, bookId,allDlBookIds);
lastBookRe = appletUserBookcaseDao.getUserLastRe(wechatUserIdList, adviserId, bookId, isAllBook,allDlBookIds);
if (Objects.nonNull(lastBookRe)) {
lastBookRe.setHasBook(true);
//判断是否是馆配图书
......
......@@ -8,6 +8,7 @@ import com.pcloud.book.applet.entity.AppletUserClickRecord;
import com.pcloud.book.book.dto.BookDto;
import com.pcloud.book.rightsSetting.entity.BaseTempletClassify;
import com.pcloud.common.core.dao.BaseDao;
import io.swagger.models.auth.In;
import java.util.List;
......@@ -56,7 +57,7 @@ public interface AppletUserBookcaseDao extends BaseDao<AppletUserBookcase> {
* @date:2021/6/3 9:32
* * @param null
*/
UserLastBookReDTO getUserLastRe(List<Long> wechatUserIdList, Long adviserId, Long bookId, List<Long> allDlBookIds);
UserLastBookReDTO getUserLastRe(List<Long> wechatUserIdList, Long adviserId, Long bookId, Integer isAllBook, List<Long> allDlBookIds);
/**
* 批量删除
......
......@@ -63,11 +63,12 @@ public class AppletUserBookcaseDaoImpl extends BaseDaoImpl<AppletUserBookcase> i
}
@Override
public UserLastBookReDTO getUserLastRe(List<Long> wechatUserIdList, Long adviserId, Long bookId, List<Long> allDlBookIds) {
public UserLastBookReDTO getUserLastRe(List<Long> wechatUserIdList, Long adviserId, Long bookId, Integer isAllBook, List<Long> allDlBookIds) {
Map<String,Object>map = new HashMap<>();
map.put("wechatUserIdList", wechatUserIdList);
map.put("adviserId", adviserId);
map.put("bookId", bookId);
map.put("isAllBook", isAllBook);
map.put("allDlBookIds", allDlBookIds);
return getSessionTemplate().selectOne(getStatement("getUserLastRe"), map);
}
......
......@@ -740,11 +740,12 @@ public class AppletHomeFacade {
@ApiOperation("获取用户最后一次点击的书(有社群书的取最后一次社群书,没有的取现代纸书)")
@GetMapping("getUserLastBookRe")
public ResponseDto<?> getUserLastBookRe(
@CookieValue("userInfo") String userInfo
@CookieValue("userInfo") String userInfo,
@RequestParam(value = "isAllBook",required = false) Integer isAllBook
) throws PermissionException{
Long wechatUserId = Cookie.getId(userInfo,Cookie._WECHAT_USER_ID);
Long officialAccountsId = Cookie.getId(userInfo,Cookie._OFFICIAL_ACCOUNTS_ID);
return new ResponseDto<>(appletUserBookcaseBiz.getUserLastBookRe(wechatUserId, officialAccountsId));
return new ResponseDto<>(appletUserBookcaseBiz.getUserLastBookRe(wechatUserId, officialAccountsId, isAllBook));
}
@ApiOperation("获取社群共读")
......
......@@ -172,23 +172,26 @@
SELECT
t.book_id bookId,
t.adviser_id adviserId,
t.channel_id channelId,
p.open_rays openRays
t.channel_id channelId
,ifnull(p.open_rays, false) openRays
FROM
applet_user_bookcase t
INNER JOIN resource_page p ON t.book_id = p.book_id
AND p.channel_id = t.channel_id
INNER JOIN resource_page p ON t.book_id = p.book_id
AND p.channel_id = t.channel_id
AND p.create_user = t.adviser_id
WHERE
t.channel_id >= 1
AND t.adviser_id >= 1
AND (
p.open_rays = 1
<if test="isAllBook == null or isAllBook == ''">
p.open_rays = 1 and
</if>
1=1
<if test="bookId != null">
OR t.book_id = #{bookId}
or t.book_id = #{bookId}
</if>
<if test="adviserId != null">
OR t.adviser_id = #{adviserId}
or t.adviser_id = #{adviserId}
</if>
)
AND t.wechat_user_id IN
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment