Commit d311618a by 吴博

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

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