Commit a841b4e6 by 朱亚洁

广告投放-文本本链接

parent 26e17da5
package com.pcloud.book.advertising.facade; package com.pcloud.book.advertising.facade;
import org.codehaus.jackson.JsonParseException;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.CookieValue;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import com.pcloud.book.advertising.entity.AdvertisingAdviserPermission; import com.pcloud.book.advertising.entity.AdvertisingAdviserPermission;
import com.pcloud.book.advertising.entity.AdvertisingAgentPermission; import com.pcloud.book.advertising.entity.AdvertisingAgentPermission;
import com.pcloud.book.advertising.entity.AdvertisingClickRecord; import com.pcloud.book.advertising.entity.AdvertisingClickRecord;
...@@ -18,6 +10,16 @@ import com.pcloud.book.advertising.entity.AdvertisingSpace; ...@@ -18,6 +10,16 @@ import com.pcloud.book.advertising.entity.AdvertisingSpace;
import com.pcloud.common.dto.ResponseDto; import com.pcloud.common.dto.ResponseDto;
import com.pcloud.common.exceptions.BizException; import com.pcloud.common.exceptions.BizException;
import com.pcloud.common.permission.PermissionException; import com.pcloud.common.permission.PermissionException;
import org.codehaus.jackson.JsonParseException;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.CookieValue;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiImplicitParams;
...@@ -254,13 +256,19 @@ public interface AdvertisingSpaceFacade { ...@@ -254,13 +256,19 @@ public interface AdvertisingSpaceFacade {
*/ */
@ApiOperation(value = "平台端获取社群书微信群列表", httpMethod = "GET") @ApiOperation(value = "平台端获取社群书微信群列表", httpMethod = "GET")
@ApiImplicitParams({@ApiImplicitParam(name = "token", value = "token", dataType = "string", paramType = "header"), @ApiImplicitParams({@ApiImplicitParam(name = "token", value = "token", dataType = "string", paramType = "header"),
@ApiImplicitParam(name = "name", value = "书籍名称", dataType = "string", paramType = "query"), @ApiImplicitParam(name = "name", value = "书籍名称", dataType = "string",required = false, paramType = "query"),
@ApiImplicitParam(name = "currentPage", value = "当前页", dataType = "int", paramType = "query"), @ApiImplicitParam(name = "currentPage", value = "当前页", dataType = "int", paramType = "query"),
@ApiImplicitParam(name = "numPerPage", value = "每页条数", dataType = "int", paramType = "query") @ApiImplicitParam(name = "numPerPage", value = "每页条数", dataType = "int", paramType = "query"),
@ApiImplicitParam(name = "proLabelId", value = "专业标签id", dataType = "long",required = false, paramType = "query"),
@ApiImplicitParam(name = "depLabelId", value = "深度标签id", dataType = "long",required = false, paramType = "query"),
@ApiImplicitParam(name = "purLabelId", value = "目的标签id", dataType = "string",required = false, paramType = "query")
}) })
@RequestMapping(value = "listGroupQrcode4Platform", method = RequestMethod.GET) @RequestMapping(value = "listGroupQrcode4Platform", method = RequestMethod.GET)
ResponseDto<?> listGroupQrcode4Platform(@RequestHeader("token") String token, @RequestParam(value = "name", required = false) String name, ResponseDto<?> listGroupQrcode4Platform(
@RequestParam(value = "currentPage", required = false) Integer currentPage, @RequestParam(value = "numPerPage", required = false) Integer numPerPage) @RequestHeader("token") String token, @RequestParam(value = "name", required = false) String name,
@RequestParam(value = "currentPage", required = false) Integer currentPage, @RequestParam(value = "numPerPage", required = false) Integer numPerPage,
@RequestParam(value = "proLabelId", required = false) Long proLabelId, @RequestParam(value = "depLabelId", required = false) Long depLabelId,
@RequestParam(value = "purLabelId", required = false) Long purLabelId)
throws PermissionException, BizException, JsonParseException; throws PermissionException, BizException, JsonParseException;
/** /**
......
package com.pcloud.book.advertising.facade.impl; package com.pcloud.book.advertising.facade.impl;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import org.codehaus.jackson.JsonParseException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CookieValue;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.pcloud.book.advertising.biz.AdvertisingSpaceBiz; import com.pcloud.book.advertising.biz.AdvertisingSpaceBiz;
import com.pcloud.book.advertising.dto.AdvertisingSpaceDTO; import com.pcloud.book.advertising.dto.AdvertisingSpaceDTO;
import com.pcloud.book.advertising.entity.AdvertisingAdviserPermission; import com.pcloud.book.advertising.entity.AdvertisingAdviserPermission;
...@@ -31,6 +19,20 @@ import com.pcloud.common.utils.SessionUtil; ...@@ -31,6 +19,20 @@ import com.pcloud.common.utils.SessionUtil;
import com.pcloud.common.utils.cookie.Cookie; import com.pcloud.common.utils.cookie.Cookie;
import com.pcloud.common.utils.string.StringUtil; import com.pcloud.common.utils.string.StringUtil;
import org.codehaus.jackson.JsonParseException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CookieValue;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
/** /**
* Description 广告位接口层接口实现类 * Description 广告位接口层接口实现类
* @author PENG * @author PENG
...@@ -228,8 +230,11 @@ public class AdvertisingSpaceFacadeImpl implements AdvertisingSpaceFacade { ...@@ -228,8 +230,11 @@ public class AdvertisingSpaceFacadeImpl implements AdvertisingSpaceFacade {
*/ */
@Override @Override
@RequestMapping(value = "listGroupQrcode4Platform", method = RequestMethod.GET) @RequestMapping(value = "listGroupQrcode4Platform", method = RequestMethod.GET)
public ResponseDto<?> listGroupQrcode4Platform(@RequestHeader("token") String token, @RequestParam(value = "name", required = false) String name, public ResponseDto<?> listGroupQrcode4Platform(
@RequestParam(value = "currentPage", required = false) Integer currentPage, @RequestParam(value = "numPerPage", required = false) Integer numPerPage) @RequestHeader("token") String token, @RequestParam(value = "name", required = false) String name,
@RequestParam(value = "currentPage", required = false) Integer currentPage, @RequestParam(value = "numPerPage", required = false) Integer numPerPage,
@RequestParam(value = "proLabelId", required = false) Long proLabelId, @RequestParam(value = "depLabelId", required = false) Long depLabelId,
@RequestParam(value = "purLabelId", required = false) Long purLabelId)
throws PermissionException, BizException, JsonParseException { throws PermissionException, BizException, JsonParseException {
if (currentPage == null || numPerPage == null || currentPage < 0 || numPerPage < 0) { if (currentPage == null || numPerPage == null || currentPage < 0 || numPerPage < 0) {
throw BookBizException.PAGE_PARAM_DELETION; throw BookBizException.PAGE_PARAM_DELETION;
...@@ -237,6 +242,9 @@ public class AdvertisingSpaceFacadeImpl implements AdvertisingSpaceFacade { ...@@ -237,6 +242,9 @@ public class AdvertisingSpaceFacadeImpl implements AdvertisingSpaceFacade {
SessionUtil.getToken4Redis(token); SessionUtil.getToken4Redis(token);
Map<String, Object> paramMap = new HashMap<>(); Map<String, Object> paramMap = new HashMap<>();
paramMap.put("name", StringUtil.isEmpty(name) ? null : name); paramMap.put("name", StringUtil.isEmpty(name) ? null : name);
paramMap.put("proLabelId",proLabelId);
paramMap.put("depLabelId",depLabelId);
paramMap.put("purLabelId",purLabelId);
return new ResponseDto<>(advertisingSpaceBiz.listGroupQrcode4Platform(paramMap, new PageParam(currentPage, numPerPage))); return new ResponseDto<>(advertisingSpaceBiz.listGroupQrcode4Platform(paramMap, new PageParam(currentPage, numPerPage)));
} }
......
/**
*
*/
package com.pcloud.book.consumer.label;
import com.pcloud.common.core.biz.LabelUsedQueueBiz;
import com.pcloud.common.core.dto.LabelUsedMessageDto;
import com.pcloud.common.exceptions.BizException;
import com.pcloud.common.utils.ListUtils;
import com.pcloud.common.utils.ResponseHandleUtil;
import com.pcloud.labelcenter.label.service.LabelService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.List;
import java.util.Map;
import lombok.extern.slf4j.Slf4j;
/**
* @描述:标签中间件
* @作者:songx
* @创建时间:2016年12月21日,下午3:04:17 @版本:1.0
*/
@Slf4j
@Component("labelConsr")
public class LabelConsr {
@Autowired
private LabelService labelService;
@Autowired
private LabelUsedQueueBiz labelUsedQueueBiz;
/**
* 标签使用量
*/
public void sendLabelUsed(Long partyId, Long proLabelId, Long depLabelId, Long purLabelId) throws BizException {
log.info("【标签中心(消)】标签使用量,<START>.[partyId]=" + partyId + ",[proLabelId]=" + proLabelId + ",[depLabelId]="
+ depLabelId + ",[purLabelId]=" + purLabelId);
if (proLabelId == null && depLabelId == null && purLabelId == null) {
return;
}
LabelUsedMessageDto labelUsedMessageDto = new LabelUsedMessageDto(partyId, proLabelId, depLabelId, purLabelId);
try {
labelUsedQueueBiz.sendMessageQueue(labelUsedMessageDto);
} catch (Exception e) {
log.error("【标签中心(消)】标签使用量.[sendMessageQueue]:" + e.getMessage(), e);
}
log.info("【标签中心(消)】标签使用量,<END>");
}
/**
* 获取标签的名称
*/
public Map<Long, String> getLabelName(List<Long> labelIds) throws BizException {
log.info("【标签中心(消)】获取标签的名称,<START>.[labelIds]=" + labelIds.toString());
if (ListUtils.isEmpty(labelIds)) {
return null;
}
Map<Long, String> labelNameMap = null;
try {
labelNameMap = ResponseHandleUtil.parseMap(labelService.getLabelName(labelIds), Long.class, String.class);
} catch (Exception e) {
log.error("【标签中心(消)】获取标签的名称.[getLabelName]:" + e.getMessage(), e);
}
log.info("【标签中心(消)】获取标签的名称,<END>.[labelNameMap]=" + (labelNameMap == null ? null : labelNameMap.toString()));
return labelNameMap;
}
/**
* 根据标签名称获取标签id
*/
public Long getLabelIdByName(Long partyId, String code, String labelName, Long parentLabelId) {
log.info("【标签中心(消)】根据标签名称获取标签id,<START>.[partyId]=" + partyId + ",[code]=" + code + ",[labelName]="
+ labelName + ",[parentLabelId]=" + parentLabelId);
if (parentLabelId == null) {
return null;
}
Long labelId = null;
try {
labelId = ResponseHandleUtil
.parseResponse(labelService.getLableIdByName(partyId, code, labelName, parentLabelId), Long.class);
} catch (Exception e) {
log.error("【标签中心(消)】根据标签名称获取标签id.[getLableIdByName]:" + e.getMessage(), e);
}
log.info("【标签中心(消)】根据标签名称获取标签id,<START>.[labelId]=" + labelId);
return labelId;
}
}
...@@ -48,6 +48,25 @@ public class GroupQrcodeVO implements Serializable { ...@@ -48,6 +48,25 @@ public class GroupQrcodeVO implements Serializable {
@ApiModelProperty("是否已选") @ApiModelProperty("是否已选")
private Boolean isSelect; private Boolean isSelect;
@ApiModelProperty("专业标签ID")
private Long proLabelId;
@ApiModelProperty("专业标签名称")
private String proLabelName;
@ApiModelProperty("深度标签ID")
private Long depLabelId;
@ApiModelProperty("深度标签名称")
private String depLabelName;
@ApiModelProperty("目的标签ID")
private Long purLabelId;
@ApiModelProperty("目的标签名称")
private String purLabelName;
public Long getClassifyId() { public Long getClassifyId() {
return classifyId; return classifyId;
} }
...@@ -136,6 +155,62 @@ public class GroupQrcodeVO implements Serializable { ...@@ -136,6 +155,62 @@ public class GroupQrcodeVO implements Serializable {
this.isSelect = isSelect; this.isSelect = isSelect;
} }
public Boolean getSelect() {
return isSelect;
}
public void setSelect(Boolean select) {
isSelect = select;
}
public Long getProLabelId() {
return proLabelId;
}
public void setProLabelId(Long proLabelId) {
this.proLabelId = proLabelId;
}
public String getProLabelName() {
return proLabelName;
}
public void setProLabelName(String proLabelName) {
this.proLabelName = proLabelName;
}
public Long getDepLabelId() {
return depLabelId;
}
public void setDepLabelId(Long depLabelId) {
this.depLabelId = depLabelId;
}
public String getDepLabelName() {
return depLabelName;
}
public void setDepLabelName(String depLabelName) {
this.depLabelName = depLabelName;
}
public Long getPurLabelId() {
return purLabelId;
}
public void setPurLabelId(Long purLabelId) {
this.purLabelId = purLabelId;
}
public String getPurLabelName() {
return purLabelName;
}
public void setPurLabelName(String purLabelName) {
this.purLabelName = purLabelName;
}
@Override @Override
public String toString() { public String toString() {
return "GroupQrcodeVO{" + return "GroupQrcodeVO{" +
...@@ -150,6 +225,12 @@ public class GroupQrcodeVO implements Serializable { ...@@ -150,6 +225,12 @@ public class GroupQrcodeVO implements Serializable {
", channelId=" + channelId + ", channelId=" + channelId +
", adviserId=" + adviserId + ", adviserId=" + adviserId +
", isSelect=" + isSelect + ", isSelect=" + isSelect +
", proLabelId=" + proLabelId +
", proLabelName='" + proLabelName + '\'' +
", depLabelId=" + depLabelId +
", depLabelName='" + depLabelName + '\'' +
", purLabelId=" + purLabelId +
", purLabelName='" + purLabelName + '\'' +
'}'; '}';
} }
} }
...@@ -408,13 +408,17 @@ ...@@ -408,13 +408,17 @@
c.classify, c.classify,
c.book_group_id bookGroupId, c.book_group_id bookGroupId,
g.group_name groupQrcodeName, g.group_name groupQrcodeName,
IF (t.id IS NOT NULL, 1, 0) isSelect IF (t.id IS NOT NULL, 1, 0) isSelect,
bg.dep_label_id depLabelId,
bg.pro_label_id proLabelId,
bg.pur_label_id purLabelId
FROM FROM
book_group_classify c book_group_classify c
JOIN book_group_qrcode g ON c.id = g.classify_id JOIN book_group_qrcode g ON c.id = g.classify_id
AND c.is_delete = 0 AND c.is_delete = 0
AND g.is_delete = 0 AND g.is_delete = 0
LEFT JOIN book b ON c.book_id = b.book_id LEFT JOIN book b ON c.book_id = b.book_id
LEFT JOIN book_group bg ON c.book_group_id = bg.id
LEFT JOIN ( LEFT JOIN (
SELECT SELECT
db.id, db.id,
...@@ -439,8 +443,18 @@ ...@@ -439,8 +443,18 @@
AND ( AND (
book_name LIKE CONCAT('%', #{name},'%') book_name LIKE CONCAT('%', #{name},'%')
OR group_name LIKE CONCAT('%', #{name},'%') OR group_name LIKE CONCAT('%', #{name},'%')
OR classify LIKE CONCAT('%', #{name},'%')
) )
</if> </if>
<if test="depLabelId != null">
AND bg.dep_label_id = #{depLabelId}
</if>
<if test="proLabelId != null">
AND bg.pro_label_id = #{proLabelId}
</if>
<if test="purLabelId != null">
AND bg.pur_label_id = #{purLabelId}
</if>
GROUP BY GROUP BY
g.id g.id
ORDER BY ORDER BY
......
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