Commit 696e4d08 by 吴博

feat: [none] changeMini

parent 6687380e
...@@ -15,6 +15,7 @@ import com.pcloud.book.rightsSetting.entity.RightsNowPopup; ...@@ -15,6 +15,7 @@ import com.pcloud.book.rightsSetting.entity.RightsNowPopup;
import com.pcloud.book.rightsSetting.entity.RightsSetting; import com.pcloud.book.rightsSetting.entity.RightsSetting;
import com.pcloud.book.rightsSetting.entity.RightsSettingClassify; import com.pcloud.book.rightsSetting.entity.RightsSettingClassify;
import com.pcloud.book.rightsSetting.entity.RightsSettingItem; import com.pcloud.book.rightsSetting.entity.RightsSettingItem;
import com.pcloud.book.rightsSetting.vo.QrcodeMessage4WechatVO;
import com.pcloud.book.skill.dto.GroupActivity4AppletDTO; import com.pcloud.book.skill.dto.GroupActivity4AppletDTO;
import com.pcloud.common.page.PageBeanNew; import com.pcloud.common.page.PageBeanNew;
...@@ -197,4 +198,6 @@ public interface RightsSettingBiz { ...@@ -197,4 +198,6 @@ public interface RightsSettingBiz {
void fillProductAndApp(List<RightsNowItem> nowItems); void fillProductAndApp(List<RightsNowItem> nowItems);
AppletNewsDTO getAppletNewsDTO4UserReadBook(AppletUserBookcase userReadBook); AppletNewsDTO getAppletNewsDTO4UserReadBook(AppletUserBookcase userReadBook);
QrcodeMessage4WechatVO getRightsItemGroupsByBookGroup(Long bookGroupId, Long wechatUserId);
} }
...@@ -49,6 +49,8 @@ import com.pcloud.book.custom.mapper.CustomPlanMapper; ...@@ -49,6 +49,8 @@ import com.pcloud.book.custom.mapper.CustomPlanMapper;
import com.pcloud.book.giftcoupon.dao.GiftReceiveDao; import com.pcloud.book.giftcoupon.dao.GiftReceiveDao;
import com.pcloud.book.group.biz.BookGroupBiz; import com.pcloud.book.group.biz.BookGroupBiz;
import com.pcloud.book.group.biz.GroupQrcodeBiz; import com.pcloud.book.group.biz.GroupQrcodeBiz;
import com.pcloud.book.group.dao.BookGroupDao;
import com.pcloud.book.group.dto.BookGroupDTO;
import com.pcloud.book.group.dto.BookServeDTO; import com.pcloud.book.group.dto.BookServeDTO;
import com.pcloud.book.group.enums.AppAndProductTypeEnum; import com.pcloud.book.group.enums.AppAndProductTypeEnum;
import com.pcloud.book.group.tools.SendWeixinRequestTools; import com.pcloud.book.group.tools.SendWeixinRequestTools;
...@@ -96,6 +98,8 @@ import com.pcloud.book.rightsSetting.enums.RightsWeekTypeEnum; ...@@ -96,6 +98,8 @@ import com.pcloud.book.rightsSetting.enums.RightsWeekTypeEnum;
import com.pcloud.book.rightsSetting.mapper.RightsReadTypeMapper; import com.pcloud.book.rightsSetting.mapper.RightsReadTypeMapper;
import com.pcloud.book.rightsSetting.mapper.RightsSettingBookRelationMapper; import com.pcloud.book.rightsSetting.mapper.RightsSettingBookRelationMapper;
import com.pcloud.book.rightsSetting.mapper.RightsSettingTitleMapper; import com.pcloud.book.rightsSetting.mapper.RightsSettingTitleMapper;
import com.pcloud.book.rightsSetting.vo.QrcodeMessage4WechatVO;
import com.pcloud.book.rightsSetting.vo.WechatMessageVO;
import com.pcloud.book.skill.biz.PcloudGroupActivityBiz; import com.pcloud.book.skill.biz.PcloudGroupActivityBiz;
import com.pcloud.book.skill.dao.PcloudGroupActivityDao; import com.pcloud.book.skill.dao.PcloudGroupActivityDao;
import com.pcloud.book.skill.dto.GroupActivity4AppletDTO; import com.pcloud.book.skill.dto.GroupActivity4AppletDTO;
...@@ -115,6 +119,7 @@ import com.pcloud.common.utils.cache.redis.JedisClusterUtils; ...@@ -115,6 +119,7 @@ import com.pcloud.common.utils.cache.redis.JedisClusterUtils;
import com.pcloud.common.utils.string.StringUtil; import com.pcloud.common.utils.string.StringUtil;
import com.pcloud.common.utils.string.StringUtilParent; import com.pcloud.common.utils.string.StringUtilParent;
import com.pcloud.resourcecenter.product.dto.ProductDto; import com.pcloud.resourcecenter.product.dto.ProductDto;
import com.pcloud.usercenter.party.adviser.dto.AdviserBaseInfoDto;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections.MapUtils; import org.apache.commons.collections.MapUtils;
...@@ -229,6 +234,8 @@ public class RightsSettingBizImpl implements RightsSettingBiz { ...@@ -229,6 +234,8 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
private RightsNowPopupDao rightsNowPopupDao; private RightsNowPopupDao rightsNowPopupDao;
@Autowired @Autowired
private AppletThirdResourcesDao appletThirdResourcesDao; private AppletThirdResourcesDao appletThirdResourcesDao;
@Autowired
private BookGroupDao bookGroupDao;
@Override @Override
@ParamLog("新增权益设置") @ParamLog("新增权益设置")
...@@ -1625,6 +1632,59 @@ public class RightsSettingBizImpl implements RightsSettingBiz { ...@@ -1625,6 +1632,59 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
return appletNewsDTO; return appletNewsDTO;
} }
@Override
@ParamLog("落地页获取本书配套资料")
public QrcodeMessage4WechatVO getRightsItemGroupsByBookGroup(Long bookGroupId, Long wechatUserId) {
QrcodeMessage4WechatVO qrcodeMessage4WechatVO = new QrcodeMessage4WechatVO();
if (null == bookGroupId) {
return qrcodeMessage4WechatVO;
}
BookGroupDTO bookGroupDTO = bookGroupDao.getDTOById(bookGroupId);
if (null == bookGroupDTO) {
return qrcodeMessage4WechatVO;
}
Long bookId = bookGroupDTO.getBookId();
Long channelId = bookGroupDTO.getChannelId();
Long adviserId = bookGroupDTO.getCreateUser();
//获取出版社名称
Map<Long, AdviserBaseInfoDto> adviserInfoDtoMap = adviserConsr.getAdviserId2AdviserInfoDtoMap(Lists.newArrayList(adviserId));
if (MapUtils.isNotEmpty(adviserInfoDtoMap) && null != adviserInfoDtoMap.get(adviserId)) {
qrcodeMessage4WechatVO.setAgentName(adviserInfoDtoMap.get(adviserId).getAgentName());
}
BookDto bookDto = bookBiz.getBaseById(bookId);
if (null == bookDto) {
return qrcodeMessage4WechatVO;
}
//设置图书基本信息
qrcodeMessage4WechatVO.setBookId(bookId);
qrcodeMessage4WechatVO.setBookName(bookDto.getBookName());
qrcodeMessage4WechatVO.setBookCoverImg(bookDto.getCoverImg());
qrcodeMessage4WechatVO.setReaderInfo(Lists.newArrayList());
List<WechatMessageVO> messages = new ArrayList<>();
List<BookServeDTO> bookServeVOS = bookGroupBiz.getBookAndBookGroupServeIds(adviserId, bookId, channelId);
//填充作品应用
bookGroupBiz.fillBookServe(bookServeVOS);
if (ListUtils.isEmpty(bookServeVOS)) {
return qrcodeMessage4WechatVO;
}
AccountSettingDto accountSettingDto = qrcodeSceneConsr.getWechatInfo(channelId);
if (null == accountSettingDto){
return qrcodeMessage4WechatVO;
}
//转换数据格式
bookServeVOS.stream().forEach(bookServeDTO -> {
WechatMessageVO wechatMessageVO = new WechatMessageVO();
wechatMessageVO.setUrl(SendWeixinRequestTools.splitUrl(accountSettingDto, bookServeDTO.getUrl()));
wechatMessageVO.setTitle(bookServeDTO.getServeName());
wechatMessageVO.setTypeCode(bookServeDTO.getServeType());
wechatMessageVO.setFromId(bookServeDTO.getServeId());
wechatMessageVO.setFromType(bookServeDTO.getFromType());
messages.add(wechatMessageVO);
});
qrcodeMessage4WechatVO.setMessages(messages);
return qrcodeMessage4WechatVO;
}
private void fillGiftCouponPack(RightsSetting rightsSetting, Integer readType) { private void fillGiftCouponPack(RightsSetting rightsSetting, Integer readType) {
RightsSettingTitle rightsSettingTitle = getRightsSettingTitle(rightsSetting, RightsNowItemTypeNew.GIFT_COUPON_PACKAGE, readType); RightsSettingTitle rightsSettingTitle = getRightsSettingTitle(rightsSetting, RightsNowItemTypeNew.GIFT_COUPON_PACKAGE, readType);
if (null != rightsSettingTitle){ if (null != rightsSettingTitle){
......
...@@ -364,4 +364,17 @@ public class RightsSettingFacede { ...@@ -364,4 +364,17 @@ public class RightsSettingFacede {
Long wechatUserId = Cookie.getId(userInfo, Cookie._WECHAT_USER_ID); Long wechatUserId = Cookie.getId(userInfo, Cookie._WECHAT_USER_ID);
return new ResponseDto<>(rightsSettingBiz.getResourceListByBook4Answer(wechatUserId,bookId,channelId,adviserId,sceneId)); return new ResponseDto<>(rightsSettingBiz.getResourceListByBook4Answer(wechatUserId,bookId,channelId,adviserId,sceneId));
} }
@ApiOperation("根据权益id获取即享权益配套资料分组集合")
@GetMapping("getRightsItemGroupsByBookGroup")
public ResponseDto<?> getRightsItemGroupsByBookGroup(
@CookieValue("userInfo")String userInfo,
@RequestParam("bookGroupId") Long bookGroupId
) throws PermissionException {
Long wechatUserId = Cookie.getId(userInfo, Cookie._WECHAT_USER_ID);
if (null == bookGroupId) {
throw new BookBizException(BookBizException.PARAM_IS_ERROR, "参数缺失!");
}
return new ResponseDto<>(rightsSettingBiz.getRightsItemGroupsByBookGroup(bookGroupId, wechatUserId));
}
} }
\ No newline at end of file
package com.pcloud.book.rightsSetting.vo;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
/**
* @author lily
* @date 2018/10/13 21:40
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
@ApiModel
public class QrcodeMessage4WechatVO implements Serializable {
private static final long serialVersionUID = -4087382700500198821L;
private Long bookId;
private String bookName;
private String bookCoverImg;
private String agentName;
private String author;
private Object readerNum;
private Object readerInfo;
private Integer serverNum;
private Long templetId;
private String templetName;
private Boolean isOpenAuth;
private BigDecimal originalCost;
private List<WechatMessageVO> messages;
@ApiModelProperty("公众号ID")
private Long officialAccountsId;
@ApiModelProperty("宣传语")
private String slogan;
@ApiModelProperty("总销售价")
private BigDecimal totalPrice;
@ApiModelProperty("折扣")
private Double sale;
@ApiModelProperty("折后价")
private BigDecimal salePrice;
@ApiModelProperty("短名称")
private String shortTitle;
@ApiModelProperty("是否开启活动")
private Integer isOpen;
@ApiModelProperty("授权状态")
private Boolean authStatus;
public Long getTempletId() {
return templetId;
}
public void setTempletId(Long templetId) {
this.templetId = templetId;
}
public String getTempletName() {
return templetName;
}
public void setTempletName(String templetName) {
this.templetName = templetName;
}
public String getBookName() {
return bookName;
}
public void setBookName(String bookName) {
this.bookName = bookName;
}
public String getAgentName() {
return agentName;
}
public void setAgentName(String agentName) {
this.agentName = agentName;
}
public String getAuthor() {
return author;
}
public void setAuthor(String author) {
this.author = author;
}
public String getBookCoverImg() {
return bookCoverImg;
}
public void setBookCoverImg(String bookCoverImg) {
this.bookCoverImg = bookCoverImg;
}
public Object getReaderNum() {
return readerNum;
}
public void setReaderNum(Object readerNum) {
this.readerNum = readerNum;
}
public Object getReaderInfo() {
return readerInfo;
}
public void setReaderInfo(Object readerInfo) {
this.readerInfo = readerInfo;
}
public Integer getServerNum() {
return serverNum;
}
public void setServerNum(Integer serverNum) {
this.serverNum = serverNum;
}
public List<WechatMessageVO> getMessages() {
return messages;
}
public void setMessages(List<WechatMessageVO> messages) {
this.messages = messages;
}
public Long getBookId() {
return bookId;
}
public void setBookId(Long bookId) {
this.bookId = bookId;
}
public Boolean getOpenAuth() {
return isOpenAuth;
}
public void setOpenAuth(Boolean openAuth) {
isOpenAuth = openAuth;
}
public BigDecimal getOriginalCost() {
return originalCost;
}
public void setOriginalCost(BigDecimal originalCost) {
this.originalCost = originalCost;
}
public Long getOfficialAccountsId() {
return officialAccountsId;
}
public void setOfficialAccountsId(Long officialAccountsId) {
this.officialAccountsId = officialAccountsId;
}
public String getSlogan() {
return slogan;
}
public void setSlogan(String slogan) {
this.slogan = slogan;
}
public BigDecimal getTotalPrice() {
return totalPrice;
}
public void setTotalPrice(BigDecimal totalPrice) {
this.totalPrice = totalPrice;
}
public Double getSale() {
return sale;
}
public void setSale(Double sale) {
this.sale = sale;
}
public BigDecimal getSalePrice() {
return salePrice;
}
public void setSalePrice(BigDecimal salePrice) {
this.salePrice = salePrice;
}
public String getShortTitle() {
return shortTitle;
}
public void setShortTitle(String shortTitle) {
this.shortTitle = shortTitle;
}
public Integer getIsOpen() {
return isOpen;
}
public void setIsOpen(Integer isOpen) {
this.isOpen = isOpen;
}
public Boolean getAuthStatus() {
return authStatus;
}
public void setAuthStatus(Boolean authStatus) {
this.authStatus = authStatus;
}
@Override
public String toString() {
return "QrcodeMessage4WechatVO{" +
"bookId=" + bookId +
", bookName='" + bookName + '\'' +
", bookCoverImg='" + bookCoverImg + '\'' +
", agentName='" + agentName + '\'' +
", readerNum=" + readerNum +
", readerInfo=" + readerInfo +
", serverNum=" + serverNum +
", templetId=" + templetId +
", templetName='" + templetName + '\'' +
", isOpenAuth=" + isOpenAuth +
", originalCost=" + originalCost +
", messages=" + messages +
", officialAccountsId=" + officialAccountsId +
", slogan='" + slogan + '\'' +
", totalPrice=" + totalPrice +
", sale=" + sale +
", salePrice=" + salePrice +
", shortTitle='" + shortTitle + '\'' +
", isOpen=" + isOpen +
", authStatus=" + authStatus +
'}';
}
}
package com.pcloud.book.rightsSetting.vo;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* @author lily
* @date 2018/10/13 21:46
*/
@ApiModel
@JsonInclude(JsonInclude.Include.NON_NULL)
public class WechatMessageVO implements Serializable {
@ApiModelProperty("标题")
private String title;
@ApiModelProperty("具体类型")
private String fromType;
@ApiModelProperty("来源标识")
private Long fromId;
@ApiModelProperty("封面图")
private String coverImg;
@ApiModelProperty("宣传图")
private String posterPicUrl;
@ApiModelProperty("跳转链接")
private String url;
@ApiModelProperty("短名称")
private String shortName;
@ApiModelProperty("服务引导语")
private String serviceLead;
@ApiModelProperty("类型(商品或应用)")
private String typeCode;
@ApiModelProperty("图片url")
private String picUrl;
@ApiModelProperty("价格")
private BigDecimal price;
@ApiModelProperty("是否开启授权")
private Boolean isOpen = false;
@ApiModelProperty("是否辅导")
private Boolean isParentCoach = false;
public Boolean getParentCoach() {
return isParentCoach;
}
public void setParentCoach(Boolean parentCoach) {
isParentCoach = parentCoach;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getFromType() {
return fromType;
}
public void setFromType(String fromType) {
this.fromType = fromType;
}
public Long getFromId() {
return fromId;
}
public void setFromId(Long fromId) {
this.fromId = fromId;
}
public String getCoverImg() {
return coverImg;
}
public void setCoverImg(String coverImg) {
this.coverImg = coverImg;
}
public String getPosterPicUrl() {
return posterPicUrl;
}
public void setPosterPicUrl(String posterPicUrl) {
this.posterPicUrl = posterPicUrl;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public String getShortName() {
return shortName;
}
public void setShortName(String shortName) {
this.shortName = shortName;
}
public String getTypeCode() {
return typeCode;
}
public void setTypeCode(String typeCode) {
this.typeCode = typeCode;
}
public String getPicUrl() {
return picUrl;
}
public void setPicUrl(String picUrl) {
this.picUrl = picUrl;
}
public BigDecimal getPrice() {
return price;
}
public void setPrice(BigDecimal price) {
this.price = price;
}
public Boolean getOpen() {
return isOpen;
}
public void setOpen(Boolean open) {
isOpen = open;
}
public String getServiceLead() {
return serviceLead;
}
public void setServiceLead(String serviceLead) {
this.serviceLead = serviceLead;
}
@Override
public String toString() {
return "WechatMessageVO{" +
"title='" + title + '\'' +
", fromType='" + fromType + '\'' +
", fromId=" + fromId +
", coverImg='" + coverImg + '\'' +
", posterPicUrl='" + posterPicUrl + '\'' +
", url='" + url + '\'' +
", shortName='" + shortName + '\'' +
", serviceLead='" + serviceLead + '\'' +
", typeCode='" + typeCode + '\'' +
", picUrl='" + picUrl + '\'' +
", isOpen=" + isOpen +
'}';
}
}
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