Commit 4d51b19e by 吴博

feat:[1005508] 手机号第三期

parent 86f2474b
......@@ -14,6 +14,8 @@ import com.pcloud.book.group.dto.BookServeDTO;
import com.pcloud.channelcenter.qrcode.vo.BookQrcodeVO;
import com.pcloud.common.exceptions.BizException;
import com.pcloud.common.page.PageBeanNew;
import com.pcloud.labelcenter.label.dto.LabelDto;
import com.pcloud.readercenter.userlabel.dto.UserGradeLabelIdDTO;
import java.util.Date;
import java.util.List;
......@@ -441,4 +443,13 @@ public interface BookAdviserBiz {
void updateBookWechatAuth(Long bookId, Long adviserId, Long channelId, Integer isWechatAuth);
Integer getBookWechatAuth(Long sceneId, Long bookId, Long adviserId, Long channelId);
/**
* 获取书刊的年级标签
* @param bookId
* @param adviserId
* @param channelId
* @return
*/
UserGradeLabelIdDTO getBookGradeLabel(Long bookId, Long adviserId, Long channelId);
}
......@@ -33,6 +33,7 @@ import com.pcloud.book.consumer.label.LabelConsr;
import com.pcloud.book.consumer.message.MessageConsr;
import com.pcloud.book.consumer.message.TemplateConsr;
import com.pcloud.book.consumer.raystask.MainLineConsr;
import com.pcloud.book.consumer.reader.ReaderConsr;
import com.pcloud.book.consumer.resource.ProductConsr;
import com.pcloud.book.consumer.settlement.BookConsr;
import com.pcloud.book.consumer.trade.TradeConsr;
......@@ -91,8 +92,10 @@ import com.pcloud.common.utils.ServeLinkUtils;
import com.pcloud.common.utils.cache.redis.JedisClusterUtils;
import com.pcloud.common.utils.string.StringUtil;
import com.pcloud.facade.tradecenter.dto.Amount4BookAdviserDto;
import com.pcloud.labelcenter.label.dto.LabelDto;
import com.pcloud.raystask.entity.AdviserDefault;
import com.pcloud.readercenter.common.enums.YesOrNoNumEnum;
import com.pcloud.readercenter.userlabel.dto.UserGradeLabelIdDTO;
import com.pcloud.resourcecenter.product.dto.ProductDto;
import com.pcloud.resourcecenter.product.dto.ProductLabelDto;
import com.pcloud.resourcecenter.product.dto.ProductTypeDto;
......@@ -214,6 +217,8 @@ public class BookAdviserBizImpl implements BookAdviserBiz {
private UpdateSuperSearchProducer searchProducer;
@Autowired
private ResourcePageItemDao resourcePageItemDao;
@Autowired
private ReaderConsr readerConsr;
@Override
public List<BookDto> listByAdviserId(Long adviserId) {
......@@ -3300,4 +3305,25 @@ public class BookAdviserBizImpl implements BookAdviserBiz {
return isWechatAuth;
}
@Override
public UserGradeLabelIdDTO getBookGradeLabel(Long bookId, Long adviserId, Long channelId) {
BookAdviserDto base = this.getBase(bookId, channelId, adviserId);
if (null == base) {
return new UserGradeLabelIdDTO();
}
Long gradeId = null;
if (null != base.getGraLabelId()) {
gradeId = resourcePageBiz.getGradeByGradeLabelId(base.getGraLabelId());
}
if (null != base.getDepLabelId()) {
gradeId = resourcePageBiz.getGradeByDepLabelId(base.getDepLabelId());
}
//书刊匹配不到且用户当前没有标签,取已工作年龄段
if (null == gradeId) {
gradeId = 29L;
}
UserGradeLabelIdDTO userGradeLabelIdDTO = readerConsr.getUserParentGradeId(gradeId);
return null != userGradeLabelIdDTO ? userGradeLabelIdDTO : new UserGradeLabelIdDTO();
}
}
......@@ -34,6 +34,8 @@ import com.pcloud.common.permission.PermissionException;
import com.pcloud.common.utils.ParamChecker;
import com.pcloud.common.utils.SessionUtil;
import com.pcloud.common.utils.cookie.Cookie;
import com.pcloud.labelcenter.label.dto.LabelDto;
import com.pcloud.readercenter.userlabel.dto.UserGradeLabelIdDTO;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiModelProperty;
......@@ -493,4 +495,15 @@ public class BookAdviserFacadeImpl implements BookAdviserFacade {
@RequestParam(value = "channelId", required = false) Long channelId) throws PermissionException {
return new ResponseDto<Integer>(bookAdviserBiz.getBookWechatAuth(sceneId,bookId, adviserId, channelId));
}
/**
* 获取书刊二维码进入是否需要授权用户信息
*/
@RequestMapping(value = "getBookGradeLabel", method = RequestMethod.GET)
public ResponseDto<?> getBookGradeLabel(
@RequestParam(value = "bookId" ) Long bookId,
@RequestParam(value = "adviserId" ) Long adviserId,
@RequestParam(value = "channelId" ) Long channelId) throws PermissionException {
return new ResponseDto<UserGradeLabelIdDTO>(bookAdviserBiz.getBookGradeLabel(bookId, adviserId, channelId));
}
}
......@@ -517,6 +517,16 @@ public class ReaderConsr {
LOGGER.info("【微信用户(消)】批量获取用户公众号,<END>");
return wechatUserOfficialAccountsMap;
}
public UserGradeLabelIdDTO getUserParentGradeId(Long gradeId) {
UserGradeLabelIdDTO userGradeLabelIdDTO = new UserGradeLabelIdDTO();
try {
userGradeLabelIdDTO = ResponseHandleUtil.parseResponse(userLabelService.getUserParentGradeId(gradeId), UserGradeLabelIdDTO.class);
} catch (Exception e) {
LOGGER.warn("调用readercenter.getUserParentGradeId失败");
}
return userGradeLabelIdDTO;
}
}
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