Commit aa98d152 by 高鹏

Merge branch 'zhuyajie' into 'master'

广告投放-文本本链接

See merge request rays/pcloud-book!25
parents c13dde3a a841b4e6
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.AdvertisingAgentPermission;
import com.pcloud.book.advertising.entity.AdvertisingClickRecord;
......@@ -18,6 +10,16 @@ import com.pcloud.book.advertising.entity.AdvertisingSpace;
import com.pcloud.common.dto.ResponseDto;
import com.pcloud.common.exceptions.BizException;
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.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
......@@ -254,13 +256,19 @@ public interface AdvertisingSpaceFacade {
*/
@ApiOperation(value = "平台端获取社群书微信群列表", httpMethod = "GET")
@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 = "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)
ResponseDto<?> listGroupQrcode4Platform(@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)
ResponseDto<?> listGroupQrcode4Platform(
@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;
/**
......
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.dto.AdvertisingSpaceDTO;
import com.pcloud.book.advertising.entity.AdvertisingAdviserPermission;
......@@ -31,6 +19,20 @@ import com.pcloud.common.utils.SessionUtil;
import com.pcloud.common.utils.cookie.Cookie;
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 广告位接口层接口实现类
* @author PENG
......@@ -228,8 +230,11 @@ public class AdvertisingSpaceFacadeImpl implements AdvertisingSpaceFacade {
*/
@Override
@RequestMapping(value = "listGroupQrcode4Platform", method = RequestMethod.GET)
public ResponseDto<?> listGroupQrcode4Platform(@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)
public ResponseDto<?> listGroupQrcode4Platform(
@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 {
if (currentPage == null || numPerPage == null || currentPage < 0 || numPerPage < 0) {
throw BookBizException.PAGE_PARAM_DELETION;
......@@ -237,6 +242,9 @@ public class AdvertisingSpaceFacadeImpl implements AdvertisingSpaceFacade {
SessionUtil.getToken4Redis(token);
Map<String, Object> paramMap = new HashMap<>();
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)));
}
......
......@@ -48,6 +48,25 @@ public class GroupQrcodeVO implements Serializable {
@ApiModelProperty("是否已选")
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() {
return classifyId;
}
......@@ -136,6 +155,62 @@ public class GroupQrcodeVO implements Serializable {
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
public String toString() {
return "GroupQrcodeVO{" +
......@@ -150,6 +225,12 @@ public class GroupQrcodeVO implements Serializable {
", channelId=" + channelId +
", adviserId=" + adviserId +
", isSelect=" + isSelect +
", proLabelId=" + proLabelId +
", proLabelName='" + proLabelName + '\'' +
", depLabelId=" + depLabelId +
", depLabelName='" + depLabelName + '\'' +
", purLabelId=" + purLabelId +
", purLabelName='" + purLabelName + '\'' +
'}';
}
}
......@@ -415,13 +415,17 @@
c.classify,
c.book_group_id bookGroupId,
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
book_group_classify c
JOIN book_group_qrcode g ON c.id = g.classify_id
AND c.is_delete = 0
AND g.is_delete = 0
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 (
SELECT
db.id,
......@@ -446,8 +450,18 @@
AND (
book_name LIKE CONCAT('%', #{name},'%')
OR group_name LIKE CONCAT('%', #{name},'%')
OR classify LIKE CONCAT('%', #{name},'%')
)
</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
g.id
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