Commit a3d6b3c0 by tc

bug[none]优化首页接口

parent b770f792
...@@ -83,4 +83,6 @@ public interface ServeCollectBiz { ...@@ -83,4 +83,6 @@ public interface ServeCollectBiz {
* @return * @return
*/ */
List<ServeCollectDTO> getList4Collect(List<ServeCollectDTO> serveCollects); List<ServeCollectDTO> getList4Collect(List<ServeCollectDTO> serveCollects);
List<ServeCollect> getList4RightsSettingByWechatUserId(Long wechatUserId);
} }
\ No newline at end of file
...@@ -333,6 +333,11 @@ public class ServeCollectBizImpl implements ServeCollectBiz { ...@@ -333,6 +333,11 @@ public class ServeCollectBizImpl implements ServeCollectBiz {
} }
@Override @Override
public List<ServeCollect> getList4RightsSettingByWechatUserId(Long wechatUserId) {
return serveCollectDao.getList4RightsSettingByWechatUserId(wechatUserId);
}
@Override
public List<Long> getAllCollect(Long wechatUserId) { public List<Long> getAllCollect(Long wechatUserId) {
return serveCollectDao.getAllCollect(wechatUserId); return serveCollectDao.getAllCollect(wechatUserId);
} }
......
...@@ -23,4 +23,6 @@ public interface ServeCollectDao extends BaseDao<ServeCollect> { ...@@ -23,4 +23,6 @@ public interface ServeCollectDao extends BaseDao<ServeCollect> {
List<Long> getAllCollect(Long wechatUserId); List<Long> getAllCollect(Long wechatUserId);
List<ServeCollectDTO> getList4Collect(List<ServeCollectDTO> serveCollects); List<ServeCollectDTO> getList4Collect(List<ServeCollectDTO> serveCollects);
List<ServeCollect> getList4RightsSettingByWechatUserId(Long wechatUserId);
} }
\ No newline at end of file
...@@ -32,6 +32,12 @@ public class ServeCollectDaoImpl extends BaseDaoImpl<ServeCollect> implements Se ...@@ -32,6 +32,12 @@ public class ServeCollectDaoImpl extends BaseDaoImpl<ServeCollect> implements Se
return getSessionTemplate().selectList(getStatement("getList4RightsSetting"), serveCollects); return getSessionTemplate().selectList(getStatement("getList4RightsSetting"), serveCollects);
} }
@Override
public List<ServeCollect> getList4RightsSettingByWechatUserId(Long wechatUserId) {
return getSessionTemplate().selectList(getStatement("getList4RightsSettingByWechatUserId"), wechatUserId);
}
@Override @Override
public List<Long> getAllCollect(Long wechatUserId) { public List<Long> getAllCollect(Long wechatUserId) {
return getSessionTemplate().selectList(getStatement("getAllCollect"), wechatUserId); return getSessionTemplate().selectList(getStatement("getAllCollect"), wechatUserId);
......
...@@ -1006,4 +1006,6 @@ public interface BookGroupBiz { ...@@ -1006,4 +1006,6 @@ public interface BookGroupBiz {
*社群码下载选择样式 *社群码下载选择样式
*/ */
BackgroundGroupQrcodeDTO getBackgroundGroupQr(BackgroundGroupQrcodeDTO backgroundGroupQrcodeDTO); BackgroundGroupQrcodeDTO getBackgroundGroupQr(BackgroundGroupQrcodeDTO backgroundGroupQrcodeDTO);
List<BookServeDTO> getBookAndBookGroupServeIdsFive(Long adviserId, Long bookId, Long channelId);
} }
...@@ -5204,7 +5204,93 @@ public class BookGroupBizImpl implements BookGroupBiz { ...@@ -5204,7 +5204,93 @@ public class BookGroupBizImpl implements BookGroupBiz {
} }
@Override @Override
public List<BookServeDTO> getBookAndBookGroupServeIdsFive(Long adviserId, Long bookId, Long channelId) {
List<BookServeDTO> serveDTOList = new ArrayList<>();
BookGroupDTO bookGroupDTO = bookGroupDao.getDTOByBookId(bookId, channelId, adviserId);
List<Long> appIds = new ArrayList<>();
List<Long> productIds = new ArrayList<>();
AccountSettingDto accountSettingDto = qrcodeSceneConsr.getWechatInfo(channelId);
if (null == accountSettingDto){
return new ArrayList<>();
}
//先排纸书二维码资源,后排社群书资源,张文庆
//现代纸书二维码配置资源
BookServeParamVO serveParamVO = new BookServeParamVO();
serveParamVO.setAdviserId(adviserId);
serveParamVO.setBookId(bookId);
serveParamVO.setChannelId(channelId);
List<BookServeVO> bookServeVOS = qrcodeSceneConsr.listBookServeIds(serveParamVO);
if (!ListUtils.isEmpty(bookServeVOS)) {
for (BookServeVO bookServeVO : bookServeVOS) {
if(serveDTOList.size()>=5){
break;
}
Long serveId = bookServeVO.getServeId();
BookServeDTO bookServeDTO = new BookServeDTO();
bookServeDTO.setTypeCode(bookServeVO.getTypeCode());
bookServeDTO.setFromType(bookServeVO.getFromType());
bookServeDTO.setFromTypeName(bookServeVO.getFromTypeName());
String url = SendWeixinRequestTools.splitUrl(accountSettingDto, bookServeVO.getUrl());
if (AppAndProductTypeEnum.APP.value.equals(bookServeVO.getTypeCode()) && !appIds.contains(serveId)) {
bookServeDTO.setServeId(serveId);
bookServeDTO.setServeType(bookServeVO.getTypeCode());
bookServeDTO.setUrl(url);
serveDTOList.add(bookServeDTO);
appIds.add(serveId);
} else if (AppAndProductTypeEnum.PRODUCT.value.equals(bookServeVO.getTypeCode()) && !productIds.contains(serveId)) {
bookServeDTO.setServeId(serveId);
bookServeDTO.setServeType(bookServeVO.getTypeCode());
bookServeDTO.setUrl(url);
serveDTOList.add(bookServeDTO);
productIds.add(serveId);
}
}
}
if (null != bookGroupDTO && serveDTOList.size()<5) {//有社群书
//社群书配置资源
List<BookGroupServe> bookGroupServes = bookGroupServeDao.getListByBookGroupId(bookGroupDTO.getId());
if (!ListUtils.isEmpty(bookGroupServes)) {
for (BookGroupServe bookGroupServe : bookGroupServes) {
if(serveDTOList.size()>=5){
break;
}
BookServeDTO bookServeDTO = new BookServeDTO();
BeanUtils.copyProperties(bookGroupServe, bookServeDTO);
String url = SendWeixinRequestTools.splitUrl(accountSettingDto, bookGroupServe.getServeUrl());
bookServeDTO.setUrl(url);
bookServeDTO.setTypeCode(bookServeDTO.getServeType());
bookServeDTO.setFromType(bookGroupServe.getTypeCode());
bookServeDTO.setFromTypeName(bookGroupServe.getFromType());
Long serveId = bookGroupServe.getServeId();
if (AppAndProductTypeEnum.APP.value.equals(bookServeDTO.getServeType()) && !appIds.contains(serveId)) {
serveDTOList.add(bookServeDTO);
appIds.add(serveId);
} else if (AppAndProductTypeEnum.PRODUCT.value.equals(bookServeDTO.getServeType()) && !productIds.contains(serveId)){
serveDTOList.add(bookServeDTO);
productIds.add(serveId);
}
}
}
}
return serveDTOList;
}
@Override
public List<BookServeDTO> getBookAndBookGroupServeIds( Long adviserId, Long bookId, Long channelId ) { public List<BookServeDTO> getBookAndBookGroupServeIds( Long adviserId, Long bookId, Long channelId ) {
List<BookServeDTO> result = new ArrayList();
String key = "getBookAndBookGroupServeIds"+adviserId+"_"+bookId+"_"+channelId;
if(JedisClusterUtils.exists(key)){
result = JedisClusterUtils.getJsonList(key, BookServeDTO.class);
}else {
result = getBookServes(adviserId, bookId, channelId);
JedisClusterUtils.setJsonList(key,result,300);
}
return result;
}
private List<BookServeDTO> getBookServes( Long adviserId, Long bookId, Long channelId ) {
List<BookServeDTO> serveDTOList = new ArrayList<>(); List<BookServeDTO> serveDTOList = new ArrayList<>();
BookGroupDTO bookGroupDTO = bookGroupDao.getDTOByBookId(bookId, channelId, adviserId); BookGroupDTO bookGroupDTO = bookGroupDao.getDTOByBookId(bookId, channelId, adviserId);
List<Long> appIds = new ArrayList<>(); List<Long> appIds = new ArrayList<>();
......
...@@ -120,7 +120,7 @@ public interface RightsSettingBiz { ...@@ -120,7 +120,7 @@ public interface RightsSettingBiz {
FillRightsSettingAppletsDTO getFillRightsSettingApplets(Long rightsSettingId, Long wechatUserId, Long rightsClassifyId, FillRightsSettingAppletsDTO getFillRightsSettingApplets(Long rightsSettingId, Long wechatUserId, Long rightsClassifyId,
Integer top, Long bookId, Long officialAccountsId); Integer top, Long bookId, Long officialAccountsId);
List<RightsItemGroup> getRightsItemGroups(Long rightsSettingId, Long adviserId, Long bookId, Long channelId, Boolean removeCanNotBuy, Integer readType, Long wechatUserId); List<RightsItemGroup> getRightsItemGroups(Long rightsSettingId, Long adviserId, Long bookId, Long channelId, Boolean removeCanNotBuy, Integer readType, Long wechatUserId,boolean homePage);
RightsSettingDto getRightSettingByBookId(Long bookId, Long adviserId, Long channelId); RightsSettingDto getRightSettingByBookId(Long bookId, Long adviserId, Long channelId);
......
...@@ -5,6 +5,7 @@ import cn.hutool.core.collection.CollUtil; ...@@ -5,6 +5,7 @@ import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.math.MathUtil; import cn.hutool.core.math.MathUtil;
import cn.hutool.core.util.RandomUtil; import cn.hutool.core.util.RandomUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSON;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.pcloud.appcenter.app.dto.AppDto; import com.pcloud.appcenter.app.dto.AppDto;
import com.pcloud.appcenter.assist.dto.AssistTempletDTO; import com.pcloud.appcenter.assist.dto.AssistTempletDTO;
...@@ -141,6 +142,9 @@ import java.util.List; ...@@ -141,6 +142,9 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Objects; import java.util.Objects;
import java.util.Random; import java.util.Random;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.FutureTask;
import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicInteger;
import java.util.function.Function; import java.util.function.Function;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -149,6 +153,7 @@ import java.util.stream.Collectors; ...@@ -149,6 +153,7 @@ import java.util.stream.Collectors;
@Slf4j @Slf4j
public class RightsSettingBizImpl implements RightsSettingBiz { public class RightsSettingBizImpl implements RightsSettingBiz {
@Autowired @Autowired
private RightsSettingDAO rightsSettingDAO; private RightsSettingDAO rightsSettingDAO;
@Autowired @Autowired
...@@ -898,7 +903,7 @@ public class RightsSettingBizImpl implements RightsSettingBiz { ...@@ -898,7 +903,7 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
} }
} }
rightsSettingNow.setRightsSettingTitles(rightsSettingTitles); rightsSettingNow.setRightsSettingTitles(rightsSettingTitles);
rightsSettingNow.setRightsItemGroups(getRightsItemGroups(rightsSetting.getId(), null, null, null, false, null, null)); rightsSettingNow.setRightsItemGroups(getRightsItemGroups(rightsSetting.getId(), null, null, null, false, null, null,false));
rightsSettingNow.setServesTitle(servesTitle); rightsSettingNow.setServesTitle(servesTitle);
rightsSetting.setRightsSettingNow(rightsSettingNow); rightsSetting.setRightsSettingNow(rightsSettingNow);
List<RightsSettingTitle> newRightsSettingTitles = new ArrayList<> (rightsSettingTitles); List<RightsSettingTitle> newRightsSettingTitles = new ArrayList<> (rightsSettingTitles);
...@@ -1498,12 +1503,35 @@ public class RightsSettingBizImpl implements RightsSettingBiz { ...@@ -1498,12 +1503,35 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
Map<Long, GroupActivity4AppletDTO> groupDtoMap = new HashMap<>(); Map<Long, GroupActivity4AppletDTO> groupDtoMap = new HashMap<>();
Map<Long, AppletNewsDTO> newsDtoMap = new HashMap<>(); Map<Long, AppletNewsDTO> newsDtoMap = new HashMap<>();
List<RightsNowItem> list_remove = new ArrayList<>(); //存储已经删除群的群分类; 精选文章类型并且跳转链接包含qrcode.5rs.me List<RightsNowItem> list_remove = new ArrayList<>(); //存储已经删除群的群分类; 精选文章类型并且跳转链接包含qrcode.5rs.me
FutureTask<Map<Long, ProductDto>> task = null;
FutureTask<Map<Long, AppDto>> task2 = null;
if (!ListUtils.isEmpty(productIds)) { if (!ListUtils.isEmpty(productIds)) {
productDtoMap = productConsr.getProBasesByIds(productIds); Callable<Map<Long, ProductDto>> callable = () -> productConsr.getProBasesByIds(productIds);
task = new FutureTask<>(callable);
new Thread(task).start();
} }
if (!ListUtils.isEmpty(appIds)) { if (!ListUtils.isEmpty(appIds)) {
appDtoMap = appConsr.mapByIds4AuditPass(appIds); Callable<Map<Long, AppDto>> callable = () -> appConsr.mapByIds4AuditPass(appIds);
task2 = new FutureTask<>(callable);
new Thread(task2).start();
}
if (task!=null) {
try {
productDtoMap = task.get();
} catch (InterruptedException e) {
log.error("获取商品失败fillProductAndApp");
} catch (ExecutionException e) {
log.error("获取商品失败fillProductAndApp");
}
}
if (task2!=null) {
try {
appDtoMap = task2.get();
} catch (InterruptedException e) {
log.error("获取应用失败fillProductAndApp");
} catch (ExecutionException e) {
log.error("获取应用失败fillProductAndApp");
}
} }
if (!ListUtils.isEmpty(groupIds)) { if (!ListUtils.isEmpty(groupIds)) {
groupDtoMap = pcloudGroupActivityBiz.getByIds4Now(groupIds); groupDtoMap = pcloudGroupActivityBiz.getByIds4Now(groupIds);
...@@ -1511,6 +1539,7 @@ public class RightsSettingBizImpl implements RightsSettingBiz { ...@@ -1511,6 +1539,7 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
if (!ListUtils.isEmpty(appletNewsId)) { if (!ListUtils.isEmpty(appletNewsId)) {
newsDtoMap = appletNewsBiz.getByIds(appletNewsId); newsDtoMap = appletNewsBiz.getByIds(appletNewsId);
} }
Map<Long,AccountSettingDto>offMap = new HashMap<>();
for (RightsNowItem item : nowItems) { for (RightsNowItem item : nowItems) {
Integer type = item.getType(); Integer type = item.getType();
if (RightsNowItemTypeNew.ONLINE_COURSE.value.equals(type) if (RightsNowItemTypeNew.ONLINE_COURSE.value.equals(type)
...@@ -1542,7 +1571,12 @@ public class RightsSettingBizImpl implements RightsSettingBiz { ...@@ -1542,7 +1571,12 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
} }
} }
if (null != channelId) { if (null != channelId) {
accountSettingDto = qrcodeSceneConsr.getWechatInfo(channelId); accountSettingDto = offMap.get(channelId);
if(accountSettingDto==null){
accountSettingDto = qrcodeSceneConsr.getWechatInfo(channelId);
offMap.put(channelId,accountSettingDto);
}
// accountSettingDto = qrcodeSceneConsr.getWechatInfo(channelId);
if (null == accountSettingDto){ if (null == accountSettingDto){
throw new BookBizException(BookBizException.PARAM_IS_NULL, "运营平台未配置公众号"); throw new BookBizException(BookBizException.PARAM_IS_NULL, "运营平台未配置公众号");
} }
...@@ -1572,7 +1606,11 @@ public class RightsSettingBizImpl implements RightsSettingBiz { ...@@ -1572,7 +1606,11 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
item.setServeTypeCode(appDto.getTypeCode()); item.setServeTypeCode(appDto.getTypeCode());
item.setServeTypeName(appDto.getTypeName()); item.setServeTypeName(appDto.getTypeName());
item.setTransverseImg(appDto.getTransverseImg()); item.setTransverseImg(appDto.getTransverseImg());
accountSettingDto = qrcodeSceneConsr.getWechatInfo(appDto.getChannelId()); accountSettingDto = offMap.get(appDto.getChannelId());
if(accountSettingDto==null){
accountSettingDto = qrcodeSceneConsr.getWechatInfo(appDto.getChannelId());
offMap.put(appDto.getChannelId(),accountSettingDto);
}
if (null == accountSettingDto){ if (null == accountSettingDto){
throw new BookBizException(BookBizException.PARAM_IS_NULL, "运营平台未配置公众号"); throw new BookBizException(BookBizException.PARAM_IS_NULL, "运营平台未配置公众号");
} }
...@@ -2377,7 +2415,16 @@ public class RightsSettingBizImpl implements RightsSettingBiz { ...@@ -2377,7 +2415,16 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
} }
// 获取配套资料 // 获取配套资料
if (RightsNowItemTypeNew.SERVES.value.equals(type)) { if (RightsNowItemTypeNew.SERVES.value.equals(type)) {
RightsSetting rightsSetting4Serves = setServe(rightsSetting, adviserId, bookId, channelId, readType); String key = "SERVER_TYPE:"+rightsSettingId+"_"+adviserId+"_"+bookId+"_"+channelId+"_"+readType;
RightsSetting rightsSetting4Serves;
if(JedisClusterUtils.exists(key)){
String s = JedisClusterUtils.get(key);
rightsSetting4Serves = JSON.parseObject(s, RightsSetting.class);
}else {
rightsSetting4Serves = setServe(rightsSetting, adviserId, bookId, channelId, readType);
JedisClusterUtils.set(key,JSON.toJSONString(rightsSetting4Serves),10*60);
}
// rightsSetting4Serves = setServe(rightsSetting, adviserId, bookId, channelId, readType);
fillCollect(wechatUserId, rightsSetting4Serves, type); fillCollect(wechatUserId, rightsSetting4Serves, type);
} }
// 获取抽奖权益 // 获取抽奖权益
...@@ -2473,15 +2520,16 @@ public class RightsSettingBizImpl implements RightsSettingBiz { ...@@ -2473,15 +2520,16 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
if (ListUtils.isEmpty(rightsNowItems)) { if (ListUtils.isEmpty(rightsNowItems)) {
return true; return true;
} }
List<ServeCollect> serveCollects = new ArrayList<>(); // List<ServeCollect> serveCollects = new ArrayList<>();
rightsNowItems.forEach(e -> { // rightsNowItems.forEach(e -> {
ServeCollect serveCollect = new ServeCollect(); // ServeCollect serveCollect = new ServeCollect();
serveCollect.setWechatUserId(wechatUserId); // serveCollect.setWechatUserId(wechatUserId);
serveCollect.setServeId(e.getServeId()); // serveCollect.setServeId(e.getServeId());
serveCollect.setServeType(Objects.equals(e.getServeType(), AppAndProductTypeEnum.PRODUCT.value) ? AppletRecordTypeEnum.PRODUCT.value : AppletRecordTypeEnum.APP.value); // serveCollect.setServeType(Objects.equals(e.getServeType(), AppAndProductTypeEnum.PRODUCT.value) ? AppletRecordTypeEnum.PRODUCT.value : AppletRecordTypeEnum.APP.value);
serveCollects.add(serveCollect); // serveCollects.add(serveCollect);
}); // });
List<ServeCollect> serveCollectList = serveCollectBiz.getList4RightsSetting(serveCollects); // List<ServeCollect> serveCollectList = serveCollectBiz.getList4RightsSetting(serveCollects);
List<ServeCollect> serveCollectList = serveCollectBiz.getList4RightsSettingByWechatUserId(wechatUserId);
if (ListUtils.isEmpty(serveCollectList)) { if (ListUtils.isEmpty(serveCollectList)) {
return true; return true;
} }
...@@ -2527,7 +2575,8 @@ public class RightsSettingBizImpl implements RightsSettingBiz { ...@@ -2527,7 +2575,8 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
serveCollect.setServeType(Objects.equals(e.getServeType(), AppAndProductTypeEnum.PRODUCT.value) ? AppletRecordTypeEnum.PRODUCT.value : AppletRecordTypeEnum.APP.value); serveCollect.setServeType(Objects.equals(e.getServeType(), AppAndProductTypeEnum.PRODUCT.value) ? AppletRecordTypeEnum.PRODUCT.value : AppletRecordTypeEnum.APP.value);
serveCollects.add(serveCollect); serveCollects.add(serveCollect);
}); });
List<ServeCollect> serveCollectList = serveCollectBiz.getList4RightsSetting(serveCollects); // List<ServeCollect> serveCollectList = serveCollectBiz.getList4RightsSetting(serveCollects);
List<ServeCollect> serveCollectList = serveCollectBiz.getList4RightsSettingByWechatUserId(wechatUserId);
if (ListUtils.isEmpty(serveCollectList)) { if (ListUtils.isEmpty(serveCollectList)) {
return; return;
} }
...@@ -2710,7 +2759,7 @@ public class RightsSettingBizImpl implements RightsSettingBiz { ...@@ -2710,7 +2759,7 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
RightsSettingTitle rightsSettingTitle = rightsSettingTitleMapper RightsSettingTitle rightsSettingTitle = rightsSettingTitleMapper
.getByRightSettingIdAndType(rightsSetting.getId(), RightsNowItemTypeNew.SERVES.value, null); .getByRightSettingIdAndType(rightsSetting.getId(), RightsNowItemTypeNew.SERVES.value, null);
rightsSetting.setServesTitle(rightsSettingTitle != null ? rightsSettingTitle : new RightsSettingTitle()); rightsSetting.setServesTitle(rightsSettingTitle != null ? rightsSettingTitle : new RightsSettingTitle());
rightsSetting.setRightsItemGroups(getRightsItemGroups(rightsSetting.getId(), adviserId, bookId, channelId, true, readType, null)); rightsSetting.setRightsItemGroups(getRightsItemGroups(rightsSetting.getId(), adviserId, bookId, channelId, true, readType, null,true));
return rightsSetting; return rightsSetting;
} }
...@@ -2821,7 +2870,7 @@ public class RightsSettingBizImpl implements RightsSettingBiz { ...@@ -2821,7 +2870,7 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
@ParamLog("根据权益id获取即享权益配套资料分组集合") @ParamLog("根据权益id获取即享权益配套资料分组集合")
@Override @Override
public List<RightsItemGroup> getRightsItemGroups(Long rightsSettingId, Long adviserId, Long bookId, Long channelId, public List<RightsItemGroup> getRightsItemGroups(Long rightsSettingId, Long adviserId, Long bookId, Long channelId,
Boolean removeCanNotBuy, Integer readType, Long wechatUserId) { Boolean removeCanNotBuy, Integer readType, Long wechatUserId,boolean homePage) {
if (rightsSettingId == null) { if (rightsSettingId == null) {
throw new BookBizException(BookBizException.PARAM_IS_ERROR, "参数有误!"); throw new BookBizException(BookBizException.PARAM_IS_ERROR, "参数有误!");
} }
...@@ -2860,7 +2909,7 @@ public class RightsSettingBizImpl implements RightsSettingBiz { ...@@ -2860,7 +2909,7 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
if (!ListUtils.isEmpty(originals) && adviserId != null && bookId != null && channelId != null) { if (!ListUtils.isEmpty(originals) && adviserId != null && bookId != null && channelId != null) {
//获取原有的资源 //获取原有的资源
RightsItemGroup originalGroup = originals.get(0); RightsItemGroup originalGroup = originals.get(0);
List<RightsNowItem> originalItems = getOriginalItems(originalGroup.getId(), adviserId, bookId, channelId, rightsSettingId); List<RightsNowItem> originalItems = getOriginalItems(originalGroup.getId(), adviserId, bookId, channelId, rightsSettingId,homePage);
nowItems.addAll(originalItems); nowItems.addAll(originalItems);
} }
//填充应用和作品 //填充应用和作品
...@@ -3032,12 +3081,17 @@ public class RightsSettingBizImpl implements RightsSettingBiz { ...@@ -3032,12 +3081,17 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
} }
@ParamLog("获取原有配套资料") @ParamLog("获取原有配套资料")
private List<RightsNowItem> getOriginalItems(Long originalGroupId, Long adviserId, Long bookId, Long channelId, Long rightsSettingId) { private List<RightsNowItem> getOriginalItems(Long originalGroupId, Long adviserId, Long bookId, Long channelId, Long rightsSettingId,boolean homePage) {
List<RightsNowItem> nowItems = new ArrayList<>(); List<RightsNowItem> nowItems = new ArrayList<>();
if (originalGroupId == null || rightsSettingId == null) { if (originalGroupId == null || rightsSettingId == null) {
return nowItems; return nowItems;
} }
List<BookServeDTO> bookServeVOS = bookGroupBiz.getBookAndBookGroupServeIds(adviserId, bookId, channelId); List<BookServeDTO> bookServeVOS = new ArrayList<>();
if(homePage){
bookServeVOS = bookGroupBiz.getBookAndBookGroupServeIdsFive(adviserId, bookId, channelId);
}else{
bookServeVOS = bookGroupBiz.getBookAndBookGroupServeIds(adviserId, bookId, channelId);
}
if (!ListUtils.isEmpty(bookServeVOS)) { if (!ListUtils.isEmpty(bookServeVOS)) {
for (BookServeDTO vo : bookServeVOS) { for (BookServeDTO vo : bookServeVOS) {
RightsNowItem item = new RightsNowItem(); RightsNowItem item = new RightsNowItem();
...@@ -3449,7 +3503,8 @@ public class RightsSettingBizImpl implements RightsSettingBiz { ...@@ -3449,7 +3503,8 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
*/ */
private List<RightsNowItem> getOriginServeRightsNowItem(Long bookId, Long channelId, Long adviserId, Boolean fillCollect, Long wechatUserId){ private List<RightsNowItem> getOriginServeRightsNowItem(Long bookId, Long channelId, Long adviserId, Boolean fillCollect, Long wechatUserId){
List<RightsNowItem> itemList = new ArrayList<>(); List<RightsNowItem> itemList = new ArrayList<>();
List<BookServeDTO> bookServeVOS = bookGroupBiz.getBookAndBookGroupServeIds(adviserId, bookId, channelId); List<BookServeDTO> bookServeVOS = new ArrayList<>();
bookServeVOS = bookGroupBiz.getBookAndBookGroupServeIds(adviserId, bookId, channelId);
if (fillCollect && null != wechatUserId){ if (fillCollect && null != wechatUserId){
bookGroupBiz.fillCollect4Book(wechatUserId, bookServeVOS); bookGroupBiz.fillCollect4Book(wechatUserId, bookServeVOS);
} }
......
...@@ -233,7 +233,7 @@ public class RightsSettingFacede { ...@@ -233,7 +233,7 @@ public class RightsSettingFacede {
if (null==rightsSettingId){ if (null==rightsSettingId){
throw new BookBizException(BookBizException.PARAM_IS_ERROR, "参数缺失!"); throw new BookBizException(BookBizException.PARAM_IS_ERROR, "参数缺失!");
} }
return new ResponseDto<>(rightsSettingBiz.getRightsItemGroups(rightsSettingId, adviserId, bookId, channelId, true,readType, wechatUserId)); return new ResponseDto<>(rightsSettingBiz.getRightsItemGroups(rightsSettingId, adviserId, bookId, channelId, true,readType, wechatUserId,false));
} }
@ApiOperation("根据书刊的分类获取对应的分类权益信息") @ApiOperation("根据书刊的分类获取对应的分类权益信息")
......
...@@ -6,7 +6,7 @@ eureka: ...@@ -6,7 +6,7 @@ eureka:
instance: instance:
status-page-url-path: /book/v1.0/swagger-ui.html status-page-url-path: /book/v1.0/swagger-ui.html
client: client:
register-with-eureka: false #禁止自己当做服务注册 register-with-eureka: true #禁止自己当做服务注册
spring: spring:
application: application:
......
...@@ -342,7 +342,7 @@ ...@@ -342,7 +342,7 @@
n.pic1, n.pic1,
n.pic2, n.pic2,
n.pic3, n.pic3,
n.content, -- n.content,
n.show_state showState, n.show_state showState,
n.create_time createTime, n.create_time createTime,
n.first_classify firstClassify, n.first_classify firstClassify,
......
...@@ -183,6 +183,19 @@ ...@@ -183,6 +183,19 @@
and serve_type = 1 and serve_type = 1
</update> </update>
<select id="getList4RightsSettingByWechatUserId" parameterType="list" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from
serve_collect
where
is_delete = 0
and
wechat_user_id = #{wechatUserId}
</select>
<select id="getList4RightsSetting" parameterType="list" resultMap="BaseResultMap"> <select id="getList4RightsSetting" parameterType="list" resultMap="BaseResultMap">
select select
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
......
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