Commit c8c1ef77 by 朱亚洁

1003002

parent 3ff255bd
......@@ -18,8 +18,8 @@ import com.pcloud.book.group.dto.BookServeDTO;
import com.pcloud.book.group.enums.JoinGroupTypeEnum;
import com.pcloud.book.rightsSetting.biz.RightsSettingBiz;
import com.pcloud.book.rightsSetting.dto.RightsSettingDto;
import com.pcloud.book.rightsSetting.entity.RightsReadType;
import com.pcloud.book.util.common.ThreadPoolUtils;
import com.pcloud.common.constant.CacheConstant;
import com.pcloud.common.core.aspect.ParamLog;
import com.pcloud.common.page.PageBeanNew;
import com.pcloud.common.page.PageParam;
......@@ -64,9 +64,20 @@ public class AppletUserBookcaseBizImpl implements AppletUserBookcaseBiz {
@Override
public void addUserBook(AppletUserBookcase appletUserBookcase) {
Long wechatUserId = appletUserBookcase.getWechatUserId();
if (null == appletUserBookcase.getReadType()) {//取书刊第一种阅读方式
RightsSettingDto rightsSettingDto = rightsSettingBiz.getReadType4Book(wechatUserId, appletUserBookcase.getBookId(), appletUserBookcase.getChannelId(), appletUserBookcase.getAdviserId());
if (null != rightsSettingDto && !ListUtils.isEmpty(rightsSettingDto.getRightsReadTypes())) {
for (RightsReadType rightsReadType : rightsSettingDto.getRightsReadTypes()) {
if (rightsReadType.getRightsCount() > 0) {
appletUserBookcase.setReadType(rightsReadType.getReadType());
break;
}
}
}
}
//数据库去重
appletUserBookcaseDao.insert(appletUserBookcase);
Long wechatUserId = appletUserBookcase.getWechatUserId();
JedisClusterUtils.del(AppletConstants.USER_BOOK_CASE + wechatUserId);
JedisClusterUtils.del(AppletConstants.USER_BOOK_CASE_COUNT + wechatUserId);
}
......
......@@ -4789,7 +4789,6 @@ public class BookGroupBizImpl implements BookGroupBiz {
appletUserBookcase.setAdviserId(bookGroupDTO.getCreateUser());
appletUserBookcase.setBookId(bookGroupDTO.getBookId());
appletUserBookcase.setChannelId(bookGroupDTO.getChannelId());
appletUserBookcase.setReadType(1);
appletUserBookcaseBiz.addUserBook(appletUserBookcase);
} else if (bookAppletScene.getSceneId() != null) {
QrcodeSceneDto byId = qrcodeSceneConsr.getById(bookAppletScene.getSceneId());
......@@ -4799,7 +4798,6 @@ public class BookGroupBizImpl implements BookGroupBiz {
appletUserBookcase.setAdviserId(byId.getCreatedByUserLogin());
appletUserBookcase.setBookId(byId.getAdviserBookId());
appletUserBookcase.setChannelId(byId.getChannelPartyId());
appletUserBookcase.setReadType(1);
appletUserBookcaseBiz.addUserBook(appletUserBookcase);
} else {
return;
......
......@@ -24,6 +24,7 @@
<include refid="Base_Column_List"/>
from rights_read_type
where rights_setting_id = #{rightsSettingId,jdbcType=BIGINT}
ORDER BY read_type ASC
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long" >
delete from rights_read_type
......
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