Commit 556a96f3 by pansy

feat: [1003257] 编辑端二维码配置资源,已配置的服务排在最前面

parent 90113731
package com.pcloud.book.group.dto;
import com.pcloud.common.dto.BaseDto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* @Description
* @Author pansy
* @Date 2020/7/21 15:35
**/
@EqualsAndHashCode(callSuper = true)
@Data
public class BookGroupServeDTO extends BaseDto {
@ApiModelProperty("作品或应用id")
private Long serveId;
@ApiModelProperty("类型;APP应用,PRODUCT作品")
private String serveType;
@ApiModelProperty("链接")
private String serveUrl;
@ApiModelProperty("短链")
private String shortUrl;
@ApiModelProperty("社群书id")
private Long bookGroupId;
@ApiModelProperty("创建人")
private Long createUser;
@ApiModelProperty("应用或作品名称")
private String serveName;
@ApiModelProperty("类型")
private String fromType;
@ApiModelProperty("是否超级作者")
private Boolean isSuper;
@ApiModelProperty("销售价")
private Double retailPrice;
@ApiModelProperty("协议价")
private Double dealPrice;
@ApiModelProperty("浏览量")
private Integer browseCount;
@ApiModelProperty("浏览人数")
private Integer browserCount;
@ApiModelProperty("平均浏览时长")
private Long avgbrowseTimes;
@ApiModelProperty("购买次数")
private Integer saleCount;
@ApiModelProperty("图片地址")
private String picUrl;
@ApiModelProperty("描述信息")
private String description;
@ApiModelProperty("类型")
private String typeCode;
}
...@@ -7,6 +7,7 @@ import com.pcloud.book.group.dto.BookGroupCountDTO; ...@@ -7,6 +7,7 @@ import com.pcloud.book.group.dto.BookGroupCountDTO;
import com.pcloud.book.group.dto.BookGroupDTO; import com.pcloud.book.group.dto.BookGroupDTO;
import com.pcloud.book.group.dto.BookGroupKeywordResourceDTO; import com.pcloud.book.group.dto.BookGroupKeywordResourceDTO;
import com.pcloud.book.group.dto.BookGroupServeCountDTO; import com.pcloud.book.group.dto.BookGroupServeCountDTO;
import com.pcloud.book.group.dto.BookGroupServeDTO;
import com.pcloud.book.group.dto.ErpBookGroupDTO; import com.pcloud.book.group.dto.ErpBookGroupDTO;
import com.pcloud.book.group.dto.ErpGroupQrcodeDTO; import com.pcloud.book.group.dto.ErpGroupQrcodeDTO;
import com.pcloud.book.group.dto.GroupCipherDTO; import com.pcloud.book.group.dto.GroupCipherDTO;
...@@ -233,4 +234,8 @@ public interface BookGroupService { ...@@ -233,4 +234,8 @@ public interface BookGroupService {
@ApiOperation(value = "批量获取书的资源数",httpMethod = "POST") @ApiOperation(value = "批量获取书的资源数",httpMethod = "POST")
@RequestMapping(value = "/mapBookGroupServeCount", method = RequestMethod.POST) @RequestMapping(value = "/mapBookGroupServeCount", method = RequestMethod.POST)
ResponseEntity<ResponseDto<Map<String, BookGroupServeCountDTO>>> mapBookGroupServeCount(@RequestBody MapBookGroupServeCountDTO mapBookGroupServeCountDTO); ResponseEntity<ResponseDto<Map<String, BookGroupServeCountDTO>>> mapBookGroupServeCount(@RequestBody MapBookGroupServeCountDTO mapBookGroupServeCountDTO);
@ApiOperation(value = "获取资源配置集合",httpMethod = "POST")
@RequestMapping(value = "/getBookGroupServeList", method = RequestMethod.GET)
ResponseEntity<ResponseDto<List<BookGroupServeDTO>>> getBookGroupServeList(@RequestParam("bookGroupId") Long bookGroupId);
} }
...@@ -8,6 +8,7 @@ import com.pcloud.book.group.dto.BookGroupCountDTO; ...@@ -8,6 +8,7 @@ import com.pcloud.book.group.dto.BookGroupCountDTO;
import com.pcloud.book.group.dto.BookGroupDTO; import com.pcloud.book.group.dto.BookGroupDTO;
import com.pcloud.book.group.dto.BookGroupKeywordResourceDTO; import com.pcloud.book.group.dto.BookGroupKeywordResourceDTO;
import com.pcloud.book.group.dto.BookGroupServeCountDTO; import com.pcloud.book.group.dto.BookGroupServeCountDTO;
import com.pcloud.book.group.dto.BookGroupServeDTO;
import com.pcloud.book.group.dto.ErpBookGroupDTO; import com.pcloud.book.group.dto.ErpBookGroupDTO;
import com.pcloud.book.group.dto.ErpGroupQrcodeDTO; import com.pcloud.book.group.dto.ErpGroupQrcodeDTO;
import com.pcloud.book.group.dto.GroupCipherDTO; import com.pcloud.book.group.dto.GroupCipherDTO;
...@@ -20,6 +21,7 @@ import com.pcloud.book.group.dto.SelfRobotBookGroupDTO; ...@@ -20,6 +21,7 @@ import com.pcloud.book.group.dto.SelfRobotBookGroupDTO;
import com.pcloud.book.group.dto.SelfRobotUserDTO; import com.pcloud.book.group.dto.SelfRobotUserDTO;
import com.pcloud.book.group.dto.SelfRobtParamDTO; import com.pcloud.book.group.dto.SelfRobtParamDTO;
import com.pcloud.book.group.dto.UserBookBaseInfoDTO; import com.pcloud.book.group.dto.UserBookBaseInfoDTO;
import com.pcloud.book.group.entity.BookGroupServe;
import com.pcloud.book.group.service.BookGroupService; import com.pcloud.book.group.service.BookGroupService;
import com.pcloud.common.dto.ResponseDto; import com.pcloud.common.dto.ResponseDto;
import com.pcloud.common.dto.StoreFlowInfoDto; import com.pcloud.common.dto.StoreFlowInfoDto;
...@@ -30,6 +32,8 @@ import com.pcloud.common.utils.ResponseHandleUtil; ...@@ -30,6 +32,8 @@ import com.pcloud.common.utils.ResponseHandleUtil;
import com.pcloud.common.utils.cache.redis.JedisClusterUtils; import com.pcloud.common.utils.cache.redis.JedisClusterUtils;
import com.pcloud.common.utils.string.StringUtil; import com.pcloud.common.utils.string.StringUtil;
import java.lang.reflect.InvocationTargetException;
import org.apache.commons.beanutils.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
...@@ -397,4 +401,22 @@ public class BookGroupServiceImpl implements BookGroupService { ...@@ -397,4 +401,22 @@ public class BookGroupServiceImpl implements BookGroupService {
public ResponseEntity<ResponseDto<Map<String, BookGroupServeCountDTO>>> mapBookGroupServeCount(@RequestBody MapBookGroupServeCountDTO mapBookGroupServeCountDTO) { public ResponseEntity<ResponseDto<Map<String, BookGroupServeCountDTO>>> mapBookGroupServeCount(@RequestBody MapBookGroupServeCountDTO mapBookGroupServeCountDTO) {
return ResponseHandleUtil.toResponse(bookGroupBiz.mapBookGroupServeCount(mapBookGroupServeCountDTO.getAdviserIds(),mapBookGroupServeCountDTO.getBookIds(),mapBookGroupServeCountDTO.getChannelIds())); return ResponseHandleUtil.toResponse(bookGroupBiz.mapBookGroupServeCount(mapBookGroupServeCountDTO.getAdviserIds(),mapBookGroupServeCountDTO.getBookIds(),mapBookGroupServeCountDTO.getChannelIds()));
} }
@Override
public ResponseEntity<ResponseDto<List<BookGroupServeDTO>>> getBookGroupServeList(@RequestParam("bookGroupId") Long bookGroupId){
List<BookGroupServe> list =bookGroupBiz.getBookGroupServeList(bookGroupId);
List<BookGroupServeDTO> newList = new ArrayList<BookGroupServeDTO>();
list.forEach(item->{
BookGroupServeDTO newItme = new BookGroupServeDTO();
try {
BeanUtils.copyProperties(newItme,item);
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (InvocationTargetException e) {
e.printStackTrace();
}
newList.add(newItme);
});
return ResponseHandleUtil.toResponse(newList);
}
} }
...@@ -1045,7 +1045,7 @@ public class RightsSettingBizImpl implements RightsSettingBiz { ...@@ -1045,7 +1045,7 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
} }
Integer collage = 1; Integer collage = 1;
List<RightsNowItem> items = Lists.newArrayList(); List<RightsNowItem> items = Lists.newArrayList();
if (CollectionUtils.isEmpty(nowItems) && rightsSettingTitle.getCollageState().intValue() == collage.intValue()) { if (CollectionUtils.isEmpty(nowItems) && rightsSettingTitle.getCollageState()!= null && rightsSettingTitle.getCollageState().intValue() == collage.intValue()) {
// 填充咨询 // 填充咨询
supplementNews(rightsSettingId, wechatUserId, rightsClassifyId, top, items,bookId, itemType.value); supplementNews(rightsSettingId, wechatUserId, rightsClassifyId, top, items,bookId, itemType.value);
// 处理权益中的应用/作品 // 处理权益中的应用/作品
...@@ -1064,7 +1064,7 @@ public class RightsSettingBizImpl implements RightsSettingBiz { ...@@ -1064,7 +1064,7 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
} }
// 此处只有资讯才会补充资讯 // 此处只有资讯才会补充资讯
if (RightsServeTypeEnum.NEWS.name().equalsIgnoreCase(rightsSettingTitle.getServeType())){ if (RightsServeTypeEnum.NEWS.name().equalsIgnoreCase(rightsSettingTitle.getServeType())){
if (items.size() < top && rightsSettingTitle.getCollageState().intValue() == collage.intValue()){ if (items.size() < top && rightsSettingTitle.getCollageState()!= null && rightsSettingTitle.getCollageState().intValue() == collage.intValue()){
// 填充咨询 // 填充咨询
supplementNews(rightsSettingId, wechatUserId, rightsClassifyId, top - items.size(), items, bookId, itemType.value); supplementNews(rightsSettingId, wechatUserId, rightsClassifyId, top - items.size(), items, bookId, itemType.value);
} }
...@@ -1542,7 +1542,7 @@ public class RightsSettingBizImpl implements RightsSettingBiz { ...@@ -1542,7 +1542,7 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
List<RightsSettingItem> needFillAppletNews = Lists.newArrayList(); List<RightsSettingItem> needFillAppletNews = Lists.newArrayList();
for (RightsSettingItem rightsSettingItem : list) { for (RightsSettingItem rightsSettingItem : list) {
if (RightsServeTypeEnum.GROUP.name().equals(rightsSettingItem.getServeType()) && rightsSettingItem.getCollageState().intValue() == collage.intValue() && (ListUtils.isEmpty(rightsSettingItem.getGroupActivity4AppletList()) || rightsSettingItem.getGroupActivity4AppletList().size()<3)){ if (RightsServeTypeEnum.GROUP.name().equals(rightsSettingItem.getServeType()) && rightsSettingItem.getCollageState()!= null && rightsSettingItem.getCollageState().intValue() == collage.intValue() && (ListUtils.isEmpty(rightsSettingItem.getGroupActivity4AppletList()) || rightsSettingItem.getGroupActivity4AppletList().size()<3)){
Integer top = 3; Integer top = 3;
if (!ListUtils.isEmpty(rightsSettingItem.getGroupActivity4AppletList())){ if (!ListUtils.isEmpty(rightsSettingItem.getGroupActivity4AppletList())){
top = top - rightsSettingItem.getGroupActivity4AppletList().size(); top = top - rightsSettingItem.getGroupActivity4AppletList().size();
...@@ -1563,7 +1563,7 @@ public class RightsSettingBizImpl implements RightsSettingBiz { ...@@ -1563,7 +1563,7 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
|| RightsServeTypeEnum.GROUP.name().equalsIgnoreCase(rightsSettingItem.getServeType()) && ListUtils || RightsServeTypeEnum.GROUP.name().equalsIgnoreCase(rightsSettingItem.getServeType()) && ListUtils
.isEmpty(rightsSettingItem.getGroupActivity4AppletList()) .isEmpty(rightsSettingItem.getGroupActivity4AppletList())
|| RightsServeTypeEnum.NEWS.name().equalsIgnoreCase(rightsSettingItem.getServeType())) { || RightsServeTypeEnum.NEWS.name().equalsIgnoreCase(rightsSettingItem.getServeType())) {
if ((ListUtils.isEmpty(rightsSettingItem.getAppletNewsDTOS()) || rightsSettingItem.getAppletNewsDTOS().size() <3) && rightsSettingItem.getCollageState().intValue() == collage.intValue()){ if ((ListUtils.isEmpty(rightsSettingItem.getAppletNewsDTOS()) || rightsSettingItem.getAppletNewsDTOS().size() <3) && rightsSettingItem.getCollageState()!= null && rightsSettingItem.getCollageState().intValue() == collage.intValue()){
needFillAppletNews.add(rightsSettingItem); needFillAppletNews.add(rightsSettingItem);
} }
} }
...@@ -1827,7 +1827,7 @@ public class RightsSettingBizImpl implements RightsSettingBiz { ...@@ -1827,7 +1827,7 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
Integer collage = 1; //状态为拼群 Integer collage = 1; //状态为拼群
List<RightsNowItem> items = Lists.newArrayList(); List<RightsNowItem> items = Lists.newArrayList();
if (CollectionUtils.isEmpty(nowItems) && rightsSettingTitle.getCollageState().intValue() == collage.intValue()) { if (CollectionUtils.isEmpty(nowItems) && rightsSettingTitle.getCollageState()!= null && rightsSettingTitle.getCollageState().intValue() == collage.intValue()) {
// 填充群 // 填充群
supplementGroup(rightsSettingId, wechatUserId, rightsClassifyId, top, items,bookId,null); supplementGroup(rightsSettingId, wechatUserId, rightsClassifyId, top, items,bookId,null);
// 处理权益中的应用/作品 // 处理权益中的应用/作品
...@@ -1843,7 +1843,7 @@ public class RightsSettingBizImpl implements RightsSettingBiz { ...@@ -1843,7 +1843,7 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
} }
} }
if (items.size() < top && rightsSettingTitle.getCollageState().intValue() == collage.intValue()) { if (items.size() < top && rightsSettingTitle.getCollageState()!= null && rightsSettingTitle.getCollageState().intValue() == collage.intValue()) {
// 填充咨询 // 填充咨询
supplementGroup(rightsSettingId, wechatUserId, rightsClassifyId, top, items, bookId,null); supplementGroup(rightsSettingId, wechatUserId, rightsClassifyId, top, items, bookId,null);
} }
...@@ -1884,7 +1884,7 @@ public class RightsSettingBizImpl implements RightsSettingBiz { ...@@ -1884,7 +1884,7 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
Iterator<RightsSettingItem> it = rightsSettingItems.iterator(); Iterator<RightsSettingItem> it = rightsSettingItems.iterator();
while(it.hasNext()){ while(it.hasNext()){
RightsSettingItem item= it.next(); RightsSettingItem item= it.next();
if (item.getCollageState().intValue() == collage.intValue()){ if (item.getCollageState()!= null && item.getCollageState().intValue() == collage.intValue()){
isCollage = true; isCollage = true;
break; break;
} }
...@@ -1895,7 +1895,7 @@ public class RightsSettingBizImpl implements RightsSettingBiz { ...@@ -1895,7 +1895,7 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
// Iterator<RightsSettingTitle> it = rightsSettingTitles.iterator(); // Iterator<RightsSettingTitle> it = rightsSettingTitles.iterator();
// while(it.hasNext()){ // while(it.hasNext()){
// RightsSettingTitle item= it.next(); // RightsSettingTitle item= it.next();
if (rightsSettingTitle.getCollageState().intValue() == collage.intValue() && RightsServeTypeEnum.GROUP.name().equalsIgnoreCase(rightsSettingTitle.getServeType()) ){ if (rightsSettingTitle.getCollageState()!= null && rightsSettingTitle.getCollageState().intValue() == collage.intValue() && RightsServeTypeEnum.GROUP.name().equalsIgnoreCase(rightsSettingTitle.getServeType()) ){
isCollage = true; isCollage = true;
// break; // break;
} }
......
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