Commit 044616bd by 朱亚洁

广告cpa内容

parent 50d93b7e
package com.pcloud.book.advertising.biz;
import java.util.List;
import java.util.Map;
import com.pcloud.book.advertising.dto.AdvertisingCpaDTO;
import com.pcloud.book.advertising.dto.AdvertisingMasterDTO;
import com.pcloud.book.advertising.dto.AdvertisingSpaceDTO;
import com.pcloud.book.advertising.dto.AdvertisingWechatMsgDTO;
import com.pcloud.book.advertising.dto.QrcodeAdvertisingSpaceCountDTO;
import com.pcloud.book.advertising.entity.*;
import com.pcloud.book.advertising.entity.AdvertisingAdviserPermission;
import com.pcloud.book.advertising.entity.AdvertisingAgentPermission;
import com.pcloud.book.advertising.entity.AdvertisingBrowseRecord;
import com.pcloud.book.advertising.entity.AdvertisingClickRecord;
import com.pcloud.book.advertising.entity.AdvertisingCpa;
import com.pcloud.book.advertising.entity.AdvertisingDistributionBook;
import com.pcloud.book.advertising.entity.AdvertisingExposureRecord;
import com.pcloud.book.advertising.entity.AdvertisingMaster;
import com.pcloud.book.advertising.entity.AdvertisingPilotRecord;
import com.pcloud.book.advertising.entity.AdvertisingPlan;
import com.pcloud.book.advertising.entity.AdvertisingSpace;
import com.pcloud.book.advertising.entity.AdvertisingWechatMsg;
import com.pcloud.book.group.dto.AdGroupQrcodeDTO;
import com.pcloud.common.exceptions.BizException;
import com.pcloud.common.page.PageBean;
import com.pcloud.common.page.PageBeanNew;
import com.pcloud.common.page.PageParam;
import java.util.List;
import java.util.Map;
/**
* Description 广告位业务逻辑层接口
* @author PENG
......@@ -170,7 +184,7 @@ public interface AdvertisingSpaceBiz {
* @return
* @throws BizException
*/
PageBean list(String name, PageParam pageParam, Boolean filterClose, Boolean filterTest, String adPosition) throws BizException;
PageBean list(String name, PageParam pageParam, Boolean filterClose, Boolean filterTest, String adPosition, String type) throws BizException;
/**
* 书刊广告位明细
......@@ -471,4 +485,63 @@ public interface AdvertisingSpaceBiz {
* @param peopleCounts
*/
void updateExposureByQrcode(Long qrcodeId, Integer peopleCounts);
/**
* 创建多条微信群消息
* @param advertisingWechatMsgList
*/
void createWechatGroupMsg(List<AdvertisingWechatMsg> advertisingWechatMsgList);
/**
* 创建cpa内容
* @param advertisingCpa
* @return
*/
Long createCPAContent(AdvertisingCpa advertisingCpa);
/**
* 修改cpa内容
* @param advertisingCpa
*/
void updateCPAContent(AdvertisingCpa advertisingCpa);
/**
* 删除cpa内容
* @param cpaId
*/
void deleteCPAContent(Long cpaId);
/**
* 根据id查询cpa内容
* @param cpaId
* @return
*/
AdvertisingCpaDTO getCPAContentById(Long cpaId);
/**
* 分页查询cpa内容
* @param title
* @param detailMode
* @return
*/
PageBeanNew<AdvertisingCpaDTO> listPageCPAContent(String title, String detailMode, Integer currentPage, Integer numPerPage);
/**
* 分页查询cpalink
* @param title
* @param detailMode
* @return
*/
PageBeanNew<AdvertisingCpaDTO> listPageCPALink(String title, String detailMode, Integer currentPage, Integer numPerPage);
/**
* 根据广告id查询
* @param adId
* @return
*/
List<AdvertisingWechatMsgDTO> getWechatGroupMsgListByAdId(Long adId);
/**
* cpa内容旧数据处理
*/
void dealOldCPAContent();
}
......@@ -35,7 +35,7 @@ public interface BmBiz {
* 新增选项列表
* @param advertisingBmOptionList
*/
void addOptionList(List<AdvertisingBmOption> advertisingBmOptionList,Long adId);
void addOptionList(List<AdvertisingBmOption> advertisingBmOptionList, Long cpaId);
/**
* 新增选项配置
......@@ -45,12 +45,12 @@ public interface BmBiz {
*/
Long addOption(AdvertisingBmOption bmOption) throws BizException;
/**
* 根据应用ID获取选项列表信息
* @param adId 选项实体
* 根据cpaID获取选项列表信息
* @param cpaId 选项实体
* @return
* @throws BizException
*/
List<AdvertisingBmOption> getByAdId(Long adId);
List<AdvertisingBmOption> getByCPAId(Long cpaId);
/**
* 修改选项配置
......@@ -62,9 +62,9 @@ public interface BmBiz {
/**
* 删除选项
* @param adId
* @param cpaId
*/
void deleteByAdId(Long adId);
void deleteByCPAId(Long cpaId);
/**
* 用户提交表单
......
......@@ -104,12 +104,6 @@ public class BmBizImpl implements BmBiz {
list.add(optionType);
optionType = new OptionType("select", "选择(列表/菜单)");
list.add(optionType);
// optionType = new OptionType("levelselect", "2级选择(列表/菜单)");
// list.add(optionType);
optionType = new OptionType("file", "文件域");
list.add(optionType);
// optionType = new OptionType("areas", "省市区");
// list.add(optionType);
return list;
}
......@@ -137,8 +131,6 @@ public class BmBizImpl implements BmBiz {
list.add(optionType);
optionType = new OptionType("idcard", "身份证");
list.add(optionType);
// optionType = new OptionType("image", "图片");
// list.add(optionType);
return list;
}
......@@ -146,13 +138,13 @@ public class BmBizImpl implements BmBiz {
* 新增选项列表
*/
@Override
public void addOptionList(List<AdvertisingBmOption> advertisingBmOptionList, Long adId) {
if (ListUtils.isEmpty(advertisingBmOptionList) || null == adId) {
public void addOptionList(List<AdvertisingBmOption> advertisingBmOptionList, Long cpaId) {
if (ListUtils.isEmpty(advertisingBmOptionList) || null == cpaId) {
throw new BookBizException(BookBizException.PARAM_IS_ERROR, "参数有误!");
}
List<Long> optionIds = bmOptionDao.getOptionIdsByAdId(adId);
List<Long> optionIds = bmOptionDao.getOptionIdsByCPAId(cpaId);
for (AdvertisingBmOption bmOption : advertisingBmOptionList) {
bmOption.setAdId(adId);
bmOption.setCpaId(cpaId);
if (!ListUtils.isEmpty(optionIds) && null != bmOption.getId()) {//修改选项
modifyOption(bmOption);
optionIds.remove(bmOption.getId());
......@@ -175,7 +167,7 @@ public class BmBizImpl implements BmBiz {
@Override
@Transactional(rollbackFor = Exception.class)
public Long addOption(AdvertisingBmOption bmOption) throws BizException {
if (null == bmOption.getAdId() || StringUtil.isEmpty(bmOption.getItemInputType())
if (null == bmOption.getCpaId() || StringUtil.isEmpty(bmOption.getItemInputType())
|| StringUtil.isEmpty(bmOption.getItemDataType()) || StringUtil.isEmpty(bmOption.getItemTitle())) {
throw new BookBizException(BookBizException.PARAM_IS_ERROR, "参数有误!");
}
......@@ -219,11 +211,11 @@ public class BmBizImpl implements BmBiz {
* 根据广告ID获取选项列表信息
*/
@Override
public List<AdvertisingBmOption> getByAdId(Long adId) throws BizException {
if (null == adId){
public List<AdvertisingBmOption> getByCPAId(Long cpaId) throws BizException {
if (null == cpaId){
return new ArrayList<>();
}
List<AdvertisingBmOption> list = bmOptionDao.getByAdId(adId);
List<AdvertisingBmOption> list = bmOptionDao.getByCPAId(cpaId);
return list;
}
......@@ -235,7 +227,7 @@ public class BmBizImpl implements BmBiz {
public void modifyOption(AdvertisingBmOption bmOption) throws BizException {
Long optionId = bmOption.getId();
// 校验参数
if (null == bmOption.getAdId() || null == optionId || StringUtil.isEmpty(bmOption.getItemInputType())
if (null == bmOption.getCpaId() || null == optionId || StringUtil.isEmpty(bmOption.getItemInputType())
|| StringUtil.isEmpty(bmOption.getItemDataType()) || StringUtil.isEmpty(bmOption.getItemTitle())) {
throw new BookBizException(BookBizException.PARAM_IS_ERROR, "参数有误!");
}
......@@ -249,8 +241,8 @@ public class BmBizImpl implements BmBiz {
}
@Override
public void deleteByAdId(Long adId) {
List<Long> optionIds = bmOptionDao.getOptionIdsByAdId(adId);
public void deleteByCPAId(Long cpaId) {
List<Long> optionIds = bmOptionDao.getOptionIdsByCPAId(cpaId);
if (ListUtils.isEmpty(optionIds)) {
return;
}
......@@ -271,11 +263,12 @@ public class BmBizImpl implements BmBiz {
if (null == space) {
throw new BookBizException(BookBizException.PARAM_IS_ERROR, "广告位不存在或已删除!");
}
Long cpaId = space.getCpaId();
List<AdvertisingBmRegisterItem> items = bmRegister.getBmRegisterItemList();
if (ListUtils.isEmpty(items)) {
throw new BookBizException(BookBizException.PARAM_IS_ERROR, "请填写表单");
}
Long mobilePhoneOptionId = bmOptionDao.getMobilePhoneOptionIdByAd(adId);
Long mobilePhoneOptionId = bmOptionDao.getMobilePhoneOptionIdByCPA(cpaId);
Optional<AdvertisingBmRegisterItem> itemOptional = items.stream().filter(s -> s != null && s.getOptionId() == mobilePhoneOptionId).findFirst();
if (itemOptional.isPresent()) {// 存在
AdvertisingBmRegisterItem registerItem = itemOptional.get();
......@@ -398,7 +391,7 @@ public class BmBizImpl implements BmBiz {
Map<String, Object> result = new HashMap<>();
try {
String title = spaceDTO.getAdName() + "-客户信息";
List<AdvertisingBmOption> optionList = bmOptionDao.getByAdId(adId);
List<AdvertisingBmOption> optionList = bmOptionDao.getByCPAId(spaceDTO.getCpaId());
List<String> rowsNameList = new ArrayList<>();
rowsNameList.add("序号");
rowsNameList.add("报名人");
......
package com.pcloud.book.advertising.check;
import com.pcloud.book.advertising.entity.AdvertisingCpa;
import com.pcloud.book.advertising.entity.AdvertisingDetailFile;
import com.pcloud.book.advertising.entity.AdvertisingSpace;
import com.pcloud.book.advertising.enums.AdDetailModeEnum;
import com.pcloud.book.advertising.enums.AdPositionDetailEnum;
import com.pcloud.book.advertising.enums.AdPositionEnum;
import com.pcloud.book.advertising.enums.AdPositionModeEnum;
import com.pcloud.book.advertising.enums.SettlementMethodEnum;
import com.pcloud.book.base.exception.BookBizException;
import com.pcloud.common.utils.ListUtils;
import com.pcloud.common.utils.string.StringUtil;
import org.apache.commons.lang3.ArrayUtils;
import org.springframework.stereotype.Component;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* @描述:广告位参数校验
* @作者:zhuyajie
* @创建时间:11:15 2019/9/4
* @版本:1.0
*/
@Component("advertisingCheck")
public class AdvertisingCheck {
/**
* 新增广告位前校验参数
*/
public void checkParamBeforeCreate(AdvertisingSpace advertisingSpace) {
String adPosition = advertisingSpace.getAdPosition();
if (null == advertisingSpace.getAdName() || null == advertisingSpace.getMasterId() || null == advertisingSpace.getSettlementMethod()) {
throw new BookBizException(BookBizException.PARAM_IS_ERROR, "参数有误!");
}
/* if (!AdPositionEnum.checkCodeExist(adPosition)) {
throw new BookBizException(BookBizException.PARAM_IS_ERROR, "广告位置选择有误!");
}
if (!AdPositionModeEnum.checkCodeExist(adPosition, advertisingSpace.getAdPositionMode())) {
throw new BookBizException(BookBizException.PARAM_IS_ERROR, "广告位置选择有误!");
}
if (AdPositionEnum.BOOK_GROUP_PAGE.equals(adPosition)
&& !AdPositionDetailEnum.checkCodeExist(adPosition, advertisingSpace.getAdPositionDetail())) {
throw new BookBizException(BookBizException.PARAM_IS_ERROR, "广告位置选择有误!");
}*/
String settlementMethod = advertisingSpace.getSettlementMethod();
//按点击量结算、按曝光量结算、按实际行动结算价格不为空
if (ArrayUtils.contains(SettlementMethodEnum.SETTLEMENT_METHOD_NEED_PRICE_GATHER, settlementMethod)
&& null == advertisingSpace.getPriceEachTime()) {
throw new BookBizException(BookBizException.PARAM_IS_ERROR, "价格不能为空!");
}
}
/**
* CPA方式参数校验
* @param advertisingCpa
*/
public void checkCPAParam(AdvertisingCpa advertisingCpa) {
List<AdvertisingDetailFile> fileList = advertisingCpa.getAdvertisingDetailFileList();
if (StringUtil.isEmpty(advertisingCpa.getDetailMode())) {
throw new BookBizException(BookBizException.PARAM_IS_ERROR, "广告详情不能为空!");
}
if (ListUtils.isEmpty(advertisingCpa.getAdvertisingBmOptionList())) {
throw new BookBizException(BookBizException.PARAM_IS_ERROR, "报名表单不能为空!");
}
if (StringUtil.isEmpty(advertisingCpa.getDetailInfo())) {
throw new BookBizException(BookBizException.PARAM_IS_ERROR, "产品介绍不能为空!");
}
if (StringUtil.isEmpty(advertisingCpa.getWelfarePic())) {
throw new BookBizException(BookBizException.PARAM_IS_ERROR, "优惠展示图不能为空!");
}
//1图文介绍
if (AdDetailModeEnum.IMG_TEXT.code.equals(advertisingCpa.getDetailMode())) {
if (StringUtil.isEmpty(advertisingCpa.getCoverPic())) {
throw new BookBizException(BookBizException.PARAM_IS_ERROR, "封面不能为空!");
}
}
//2音频试听
else if (AdDetailModeEnum.AUDIO.code.equals(advertisingCpa.getDetailMode())) {
if (ListUtils.isEmpty(fileList)) {
throw new BookBizException(BookBizException.PARAM_IS_ERROR, "请上传音频资源!");
}
for (AdvertisingDetailFile file : fileList) {
if (StringUtil.isEmpty(file.getFileId())) {
throw new BookBizException(BookBizException.PARAM_IS_ERROR, "请上传音频资源!");
}
if (StringUtil.isEmpty(file.getTitle())) {
throw new BookBizException(BookBizException.PARAM_IS_ERROR, "标题不能为空!");
}
}
}
//3视频试看
else if (AdDetailModeEnum.VIDEO.code.equals(advertisingCpa.getDetailMode())) {
if (ListUtils.isEmpty(fileList)) {
throw new BookBizException(BookBizException.PARAM_IS_ERROR, "请上传视频资源!");
}
for (AdvertisingDetailFile file : fileList) {
if (StringUtil.isEmpty(file.getCoverPic())) {
throw new BookBizException(BookBizException.PARAM_IS_ERROR, "封面不能为空!");
}
if (StringUtil.isEmpty(file.getFileId())) {
throw new BookBizException(BookBizException.PARAM_IS_ERROR, "请上传视频资源!");
}
if (StringUtil.isEmpty(file.getTitle())) {
throw new BookBizException(BookBizException.PARAM_IS_ERROR, "标题不能为空!");
}
}
}
//报名设置
if (null == advertisingCpa.getFormMobileCheck()) {
throw new BookBizException(BookBizException.PARAM_IS_ERROR, "手机号校验不能为空!");
}
if (StringUtil.isEmpty(advertisingCpa.getFormRemark())) {
throw new BookBizException(BookBizException.PARAM_IS_ERROR, "报名表单备注不能为空!");
}
if (StringUtil.isEmpty(advertisingCpa.getFormButton())) {
throw new BookBizException(BookBizException.PARAM_IS_ERROR, "按钮提示不能为空!");
}
}
/**
* 判断链接文本长度
* @param adTitle
*/
/*public void checkLinkLength(String adTitle){
List<String> linkList = getLinkList(adTitle);
int linkLength = 0;//短链接长度
if (!ListUtils.isEmpty(linkList)) {
for (String link : linkList) {
adTitle = adTitle.replace(link, "");
linkLength = linkLength + 26;
}
}
int length = linkLength + adTitle.length();
if (length > 300) {
throw new BookBizException(BookBizException.PARAM_IS_ERROR, "文本长度超过300!");
}
}*/
/* private List<String> getLinkList(String title) {
List<String> list = new ArrayList<>();
Pattern pa = Pattern.compile("<link>.*?</link>");//标题正则表达式
Matcher ma = pa.matcher(title);
while (ma.find()) {
list.add(ma.group());
}
return list;
}*/
}
......@@ -57,4 +57,18 @@ public interface AdvertisingClickRecordDao extends BaseDao<AdvertisingClickRecor
* @return
*/
public Long getClickUserNumByBookId(Long adId, Long bookId, Long adviserId, Long channelId, String statisMonth);
/**
* 根据CPAID查点击次数
* @param cpaId
* @return
*/
public Long getClickNumByCPAId(Long cpaId);
/**
* 根据cpaid查点击人数
* @param cpaId
* @return
*/
public Long getClickUserNumByCPAId(Long cpaId);
}
package com.pcloud.book.advertising.dao;
import com.pcloud.book.advertising.entity.AdvertisingCpa;
import com.pcloud.common.core.dao.BaseDao;
/**
* @描述:cpa内容
* @作者:zhuyajie
* @创建时间:15:44 2019/9/3
* @版本:1.0
*/
public interface AdvertisingCpaDao extends BaseDao<AdvertisingCpa> {
}
......@@ -15,14 +15,21 @@ public interface AdvertisingDetailFileDao extends BaseDao<AdvertisingDetailFile>
/**
* 根据广告id查询
* @param adId
* @param cpaId
* @return
*/
public List<AdvertisingDetailFile> getByAdId(Long adId);
public List<AdvertisingDetailFile> getByCPAId(Long cpaId);
/**
* 删除文件
* @param cpaId
*/
void deleteByCPAId(Long cpaId);
/**
* 更新cpaId
* @param adId
* @param cpaId
*/
void deleteByAdId(Long adId);
void updateCPAId(Long adId, Long cpaId);
}
......@@ -24,4 +24,11 @@ public interface AdvertisingExposureRecordDao extends BaseDao<AdvertisingExposur
* @param peopleCounts
*/
void updateExposureByQrcode(Long qrcodeId, Integer peopleCounts);
/**
* 根据cpaid查曝光量
* @param cpaId
* @return
*/
public Long getExposureNumByCPAId(Long cpaId);
}
......@@ -52,4 +52,11 @@ public interface AdvertisingPilotRecordDao extends BaseDao<AdvertisingPilotRecor
* @return
*/
Long getPilotUserNumByBookId(Long bookId, Long adviserId, Long channelId, Long adId, String statisMonth);
/**
* cpa试听人数
* @param cpaId
* @return
*/
Long getPilotUserNumByCPAId(Long cpaId);
}
......@@ -79,4 +79,24 @@ public interface AdvertisingSpaceDao extends BaseDao<AdvertisingSpace> {
* @return
*/
List<Long> getAdIdsByMasterId(Long id);
/**
* 使用cpa的广告ids
* @param cpaId
* @return
*/
public List<Long> getAdIdsByCPAId(Long cpaId);
/**
* 更新cpaId
* @param adId
* @param cpaId
*/
void updateCPAId(Long adId, Long cpaId);
/**
* 查询cpa方式的广告位,没有cpaid
* @return
*/
public List<AdvertisingSpace> getCPASpaceList();
}
package com.pcloud.book.advertising.dao;
import com.pcloud.book.advertising.entity.AdvertisingWechatMsg;
import com.pcloud.common.core.dao.BaseDao;
import java.util.List;
/**
* @描述:微信群消息
* @作者:zhuyajie
* @创建时间:15:24 2019/9/2
* @版本:1.0
*/
public interface AdvertisingWechatMsgDao extends BaseDao<AdvertisingWechatMsg> {
/**
*根据广告位id查群消息
*/
public List<AdvertisingWechatMsg> getByAdId(Long adId);
/**
* 删除广告位下群消息
* @param adId
*/
public void deleteByAdId(Long adId);
}
......@@ -16,10 +16,10 @@ public interface BmOptionDao extends BaseDao<AdvertisingBmOption> {
/**
* 获取报名列表
* @param adId
* @param cpaId
* @return
*/
List<AdvertisingBmOption> getByAdId(Long adId);
List<AdvertisingBmOption> getByCPAId(Long cpaId);
/**
* 批量删除
......@@ -28,16 +28,22 @@ public interface BmOptionDao extends BaseDao<AdvertisingBmOption> {
void deleteByIds(List<Long> optionIds);
/**
* 根据广告id获取选项id列表
* @param adId
* 根据cpaid获取选项id列表
* @param cpaId
* @return
*/
List<Long> getOptionIdsByAdId(Long adId);
List<Long> getOptionIdsByCPAId(Long cpaId);
/**
* 查手机号选项id
* @param adId
* @return
*/
Long getMobilePhoneOptionIdByAd(Long adId);
Long getMobilePhoneOptionIdByCPA(Long adId);
/**
* 更新cpaId
* @param adId
* @param cpaId
*/
void updateCPAId(Long adId, Long cpaId);
}
......@@ -65,4 +65,14 @@ public class AdvertisingClickRecordDaoImpl extends BaseDaoImpl<AdvertisingClickR
paramMap.put("statisMonth", statisMonth);
return getSessionTemplate().selectOne(getStatement("getClickUserNumByBookId"), paramMap);
}
@Override
public Long getClickNumByCPAId(Long cpaId) {
return getSessionTemplate().selectOne(getStatement("getClickNumByCPAId"), cpaId);
}
@Override
public Long getClickUserNumByCPAId(Long cpaId) {
return getSessionTemplate().selectOne(getStatement("getClickUserNumByCPAId"), cpaId);
}
}
package com.pcloud.book.advertising.dao.impl;
import com.pcloud.book.advertising.dao.AdvertisingCpaDao;
import com.pcloud.book.advertising.entity.AdvertisingCpa;
import com.pcloud.common.core.dao.BaseDaoImpl;
import org.springframework.stereotype.Component;
/**
* @描述:cpa内容
* @作者:zhuyajie
* @创建时间:15:45 2019/9/3
* @版本:1.0
*/
@Component("advertisingCpaDao")
public class AdvertisingCpaDaoImpl extends BaseDaoImpl<AdvertisingCpa> implements AdvertisingCpaDao {
}
......@@ -6,7 +6,9 @@ import com.pcloud.common.core.dao.BaseDaoImpl;
import org.springframework.stereotype.Component;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @描述:广告详情上传文件
......@@ -18,12 +20,20 @@ import java.util.List;
public class AdvertisingDetailFileDaoImpl extends BaseDaoImpl<AdvertisingDetailFile> implements AdvertisingDetailFileDao {
@Override
public List<AdvertisingDetailFile> getByAdId(Long adId) {
return getSessionTemplate().selectList(getStatement("getByAdId"), adId);
public List<AdvertisingDetailFile> getByCPAId(Long cpaId) {
return getSessionTemplate().selectList(getStatement("getByCPAId"), cpaId);
}
@Override
public void deleteByAdId(Long adId) {
getSessionTemplate().delete(getStatement("deleteByAdId"), adId);
public void deleteByCPAId(Long cpaId) {
getSessionTemplate().delete(getStatement("deleteByCPAId"), cpaId);
}
@Override
public void updateCPAId(Long adId, Long cpaId) {
Map<String, Object> map = new HashMap<>();
map.put("adId", adId);
map.put("cpaId", cpaId);
getSessionTemplate().update(getStatement("updateCPAId"), map);
}
}
......@@ -34,4 +34,9 @@ public class AdvertisingExposureRecordDaoImpl extends BaseDaoImpl<AdvertisingExp
map.put("count", peopleCounts);
getSessionTemplate().update(getStatement("updateExposureByQrcode"), map);
}
@Override
public Long getExposureNumByCPAId(Long cpaId) {
return getSessionTemplate().selectOne(getStatement("getExposureNumByCPAId"), cpaId);
}
}
package com.pcloud.book.advertising.dao.impl;
import com.pcloud.book.advertising.dao.AdvertisingClickRecordDao;
import com.pcloud.book.advertising.dao.AdvertisingPilotRecordDao;
import com.pcloud.book.advertising.dto.WechatGroupClickUserDTO;
import com.pcloud.book.advertising.entity.AdvertisingClickRecord;
import com.pcloud.book.advertising.entity.AdvertisingPilotRecord;
import com.pcloud.common.core.dao.BaseDaoImpl;
import org.springframework.stereotype.Repository;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
......@@ -58,4 +54,9 @@ public class AdvertisingPilotRecordDaoImpl extends BaseDaoImpl<AdvertisingPilotR
paramMap.put("statisMonth", statisMonth);
return getSessionTemplate().selectOne(getStatement("getPilotUserNumByBookId"), paramMap);
}
@Override
public Long getPilotUserNumByCPAId(Long cpaId) {
return getSessionTemplate().selectOne(getStatement("getPilotUserNumByCPAId"), cpaId);
}
}
......@@ -88,4 +88,22 @@ public class AdvertisingSpaceDaoImpl extends BaseDaoImpl<AdvertisingSpace> imple
public List<Long> getAdIdsByMasterId(Long masterId) {
return getSessionTemplate().selectList(getStatement("getAdIdsByMasterId"),masterId);
}
@Override
public List<Long> getAdIdsByCPAId(Long cpaId) {
return getSessionTemplate().selectList(getStatement("getAdIdsByCPAId"), cpaId);
}
@Override
public void updateCPAId(Long adId, Long cpaId) {
Map<String, Object> map = new HashMap<>();
map.put("id", adId);
map.put("cpaId", cpaId);
getSessionTemplate().update(getStatement("updateCPAId"), map);
}
@Override
public List<AdvertisingSpace> getCPASpaceList() {
return getSessionTemplate().selectList(getStatement("getCPASpaceList"));
}
}
package com.pcloud.book.advertising.dao.impl;
import com.pcloud.book.advertising.dao.AdvertisingWechatMsgDao;
import com.pcloud.book.advertising.entity.AdvertisingWechatMsg;
import com.pcloud.common.core.dao.BaseDaoImpl;
import org.springframework.stereotype.Component;
import java.util.List;
/**
* @描述:微信群消息
* @作者:zhuyajie
* @创建时间:15:24 2019/9/2
* @版本:1.0
*/
@Component("advertisingWechatMsgDao")
public class AdvertisingWechatMsgDaoImpl extends BaseDaoImpl<AdvertisingWechatMsg> implements AdvertisingWechatMsgDao {
@Override
public List<AdvertisingWechatMsg> getByAdId(Long adId) {
return getSessionTemplate().selectList(getStatement("getByAdId"), adId);
}
@Override
public void deleteByAdId(Long adId) {
getSessionTemplate().delete(getStatement("deleteByAdId"), adId);
}
}
......@@ -6,7 +6,9 @@ import com.pcloud.common.core.dao.BaseDaoImpl;
import org.springframework.stereotype.Component;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @描述:报名选项
......@@ -17,8 +19,8 @@ import java.util.List;
@Component("bmOptionDao")
public class BmOptionDaoImpl extends BaseDaoImpl<AdvertisingBmOption> implements BmOptionDao {
@Override
public List<AdvertisingBmOption> getByAdId(Long adId) {
return getSessionTemplate().selectList(getStatement("getByAdId"), adId);
public List<AdvertisingBmOption> getByCPAId(Long cpaId) {
return getSessionTemplate().selectList(getStatement("getByCPAId"), cpaId);
}
@Override
......@@ -27,12 +29,20 @@ public class BmOptionDaoImpl extends BaseDaoImpl<AdvertisingBmOption> implements
}
@Override
public List<Long> getOptionIdsByAdId(Long adId) {
return getSessionTemplate().selectList(getStatement("getOptionIdsByAdId"), adId);
public List<Long> getOptionIdsByCPAId(Long cpaId) {
return getSessionTemplate().selectList(getStatement("getOptionIdsByCPAId"), cpaId);
}
@Override
public Long getMobilePhoneOptionIdByAd(Long adId) {
return getSessionTemplate().selectOne(getStatement("getMobilePhoneOptionIdByAd"),adId);
public Long getMobilePhoneOptionIdByCPA(Long cpaId) {
return getSessionTemplate().selectOne(getStatement("getMobilePhoneOptionIdByCPA"),cpaId);
}
@Override
public void updateCPAId(Long adId, Long cpaId) {
Map<String, Object> map = new HashMap<>();
map.put("adId", adId);
map.put("cpaId", cpaId);
getSessionTemplate().update(getStatement("updateCPAId"), map);
}
}
package com.pcloud.book.advertising.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.pcloud.book.advertising.entity.AdvertisingBmOption;
import com.pcloud.book.advertising.entity.AdvertisingDetailFile;
import com.pcloud.common.dto.BaseDto;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
/**
* @描述:CPA内容
* @作者:zhuyajie
* @创建时间:15:27 2019/9/4
* @版本:1.0
*/
public class AdvertisingCpaDTO extends BaseDto {
private Long id;
/**
*标题
*/
private String detailName;
/**
*广告详情方式
*/
private String detailMode;
/**
*广告详情封面
*/
private String coverPic;
/**
*广告详情优惠图
*/
private String welfarePic;
/**
* 广告详情介绍
*/
private String detailInfo;
/**
*广告报名表单是否校验手机号
*/
private Boolean formMobileCheck;
/**
*广告报名表单备注
*/
private String formRemark;
/**
*广告报名表单提交按钮
*/
private String formButton;
/**
*广告报名表单跳转链接
*/
private String formLink;
@JsonFormat(
pattern = "yyyy-MM-dd HH:mm:ss",
timezone = "GMT+8"
)
private Date updateTime;
/**
* 预览链接
*/
private String previewLink;
/**
* 报名选项设置
*/
private List<AdvertisingBmOption> advertisingBmOptionList;
/**
* 多个上传文件
*/
private List<AdvertisingDetailFile> advertisingDetailFileList;
/**
* 曝光量
*/
private Long exposureNum;
/**
* 点击量
*/
private Long clickNum;
/**
* 点击率
*/
private BigDecimal clickRate;
/**
* 点击用户数(独立访客数)
*/
private Long clickUserNum;
/**
* 报名量
*/
private Long registerNum;
/**
* 报名率
*/
private BigDecimal registerRate;
/**
* 试听完成人数(完课量)
*/
private Long pilotFinishUserNum;
/**
* 试听完成比率(完课率)
*/
private BigDecimal pilotFinishRate;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getDetailName() {
return detailName;
}
public void setDetailName(String detailName) {
this.detailName = detailName;
}
public String getDetailMode() {
return detailMode;
}
public void setDetailMode(String detailMode) {
this.detailMode = detailMode;
}
public String getCoverPic() {
return coverPic;
}
public void setCoverPic(String coverPic) {
this.coverPic = coverPic;
}
public String getWelfarePic() {
return welfarePic;
}
public void setWelfarePic(String welfarePic) {
this.welfarePic = welfarePic;
}
public String getDetailInfo() {
return detailInfo;
}
public void setDetailInfo(String detailInfo) {
this.detailInfo = detailInfo;
}
public Boolean getFormMobileCheck() {
return formMobileCheck;
}
public void setFormMobileCheck(Boolean formMobileCheck) {
this.formMobileCheck = formMobileCheck;
}
public String getFormRemark() {
return formRemark;
}
public void setFormRemark(String formRemark) {
this.formRemark = formRemark;
}
public String getFormButton() {
return formButton;
}
public void setFormButton(String formButton) {
this.formButton = formButton;
}
public String getFormLink() {
return formLink;
}
public void setFormLink(String formLink) {
this.formLink = formLink;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public List<AdvertisingBmOption> getAdvertisingBmOptionList() {
return advertisingBmOptionList;
}
public void setAdvertisingBmOptionList(List<AdvertisingBmOption> advertisingBmOptionList) {
this.advertisingBmOptionList = advertisingBmOptionList;
}
public List<AdvertisingDetailFile> getAdvertisingDetailFileList() {
return advertisingDetailFileList;
}
public void setAdvertisingDetailFileList(List<AdvertisingDetailFile> advertisingDetailFileList) {
this.advertisingDetailFileList = advertisingDetailFileList;
}
public String getPreviewLink() {
return previewLink;
}
public void setPreviewLink(String previewLink) {
this.previewLink = previewLink;
}
public Long getExposureNum() {
return exposureNum;
}
public void setExposureNum(Long exposureNum) {
this.exposureNum = exposureNum;
}
public Long getClickNum() {
return clickNum;
}
public void setClickNum(Long clickNum) {
this.clickNum = clickNum;
}
public BigDecimal getClickRate() {
return clickRate;
}
public void setClickRate(BigDecimal clickRate) {
this.clickRate = clickRate;
}
public Long getClickUserNum() {
return clickUserNum;
}
public void setClickUserNum(Long clickUserNum) {
this.clickUserNum = clickUserNum;
}
public Long getRegisterNum() {
return registerNum;
}
public void setRegisterNum(Long registerNum) {
this.registerNum = registerNum;
}
public BigDecimal getRegisterRate() {
return registerRate;
}
public void setRegisterRate(BigDecimal registerRate) {
this.registerRate = registerRate;
}
public Long getPilotFinishUserNum() {
return pilotFinishUserNum;
}
public void setPilotFinishUserNum(Long pilotFinishUserNum) {
this.pilotFinishUserNum = pilotFinishUserNum;
}
public BigDecimal getPilotFinishRate() {
return pilotFinishRate;
}
public void setPilotFinishRate(BigDecimal pilotFinishRate) {
this.pilotFinishRate = pilotFinishRate;
}
@Override
public String toString() {
return "AdvertisingCpaDTO{" +
"id=" + id +
", detailName='" + detailName + '\'' +
", detailMode='" + detailMode + '\'' +
", coverPic='" + coverPic + '\'' +
", welfarePic='" + welfarePic + '\'' +
", detailInfo='" + detailInfo + '\'' +
", formMobileCheck=" + formMobileCheck +
", formRemark='" + formRemark + '\'' +
", formButton='" + formButton + '\'' +
", formLink='" + formLink + '\'' +
", updateTime=" + updateTime +
", previewLink='" + previewLink + '\'' +
", advertisingBmOptionList=" + advertisingBmOptionList +
", advertisingDetailFileList=" + advertisingDetailFileList +
", exposureNum=" + exposureNum +
", clickNum=" + clickNum +
", clickRate=" + clickRate +
", clickUserNum=" + clickUserNum +
", registerNum=" + registerNum +
", registerRate=" + registerRate +
", pilotFinishUserNum=" + pilotFinishUserNum +
", pilotFinishRate=" + pilotFinishRate +
'}';
}
}
......@@ -316,7 +316,10 @@ public class AdvertisingSpaceDTO extends BaseDto {
* 多个上传文件
*/
private List<AdvertisingDetailFile> advertisingDetailFileList;
/**
* cp内容id
*/
private Long cpaId;
public Long getId() {
return id;
}
......@@ -832,6 +835,14 @@ public class AdvertisingSpaceDTO extends BaseDto {
this.advertisingDetailFileList = advertisingDetailFileList;
}
public Long getCpaId() {
return cpaId;
}
public void setCpaId(Long cpaId) {
this.cpaId = cpaId;
}
@Override
public String toString() {
return "AdvertisingSpaceDTO{" +
......@@ -899,6 +910,7 @@ public class AdvertisingSpaceDTO extends BaseDto {
", outRate=" + outRate +
", distributionNum=" + distributionNum +
", advertisingDetailFileList=" + advertisingDetailFileList +
", cpaId=" + cpaId +
'}';
}
}
\ No newline at end of file
package com.pcloud.book.advertising.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.pcloud.common.dto.BaseDto;
import com.pcloud.common.entity.BaseEntity;
import java.util.Date;
/**
* 微信群消息
*/
public class AdvertisingWechatMsgDTO extends BaseDto{
private Long id;
/**
* 广告id
*/
private Long adId;
/**
* 广告位置方式
*/
private String adPositionMode;
/**
* 广告位链接
*/
private String adLink;
/**
*广告位标题
*/
private String adTitle;
/**
*广告位文案
*/
private String adSlogan;
/**
*广告位图片
*/
private String adPic;
/**
* 序号
*/
private Integer seq;
/**
* cpaId
*/
private Long cpaId;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getAdId() {
return adId;
}
public void setAdId(Long adId) {
this.adId = adId;
}
public String getAdPositionMode() {
return adPositionMode;
}
public void setAdPositionMode(String adPositionMode) {
this.adPositionMode = adPositionMode == null ? null : adPositionMode.trim();
}
public String getAdLink() {
return adLink;
}
public void setAdLink(String adLink) {
this.adLink = adLink == null ? null : adLink.trim();
}
public String getAdTitle() {
return adTitle;
}
public void setAdTitle(String adTitle) {
this.adTitle = adTitle == null ? null : adTitle.trim();
}
public String getAdSlogan() {
return adSlogan;
}
public void setAdSlogan(String adSlogan) {
this.adSlogan = adSlogan == null ? null : adSlogan.trim();
}
public String getAdPic() {
return adPic;
}
public void setAdPic(String adPic) {
this.adPic = adPic == null ? null : adPic.trim();
}
public Integer getSeq() {
return seq;
}
public void setSeq(Integer seq) {
this.seq = seq;
}
public Long getCpaId() {
return cpaId;
}
public void setCpaId(Long cpaId) {
this.cpaId = cpaId;
}
@Override
public String toString() {
return "AdvertisingWechatMsgDTO{" +
"id=" + id +
", adId=" + adId +
", adPositionMode='" + adPositionMode + '\'' +
", adLink='" + adLink + '\'' +
", adTitle='" + adTitle + '\'' +
", adSlogan='" + adSlogan + '\'' +
", adPic='" + adPic + '\'' +
", seq=" + seq +
", cpaId=" + cpaId +
'}';
}
}
\ No newline at end of file
......@@ -61,6 +61,11 @@ public class AdvertisingBmOption extends BaseEntity{
*/
private List<AdvertisingBmOptionItem> optionItem;
/**
* cp内容id
*/
private Long cpaId;
public Long getAdId() {
return adId;
}
......@@ -157,6 +162,14 @@ public class AdvertisingBmOption extends BaseEntity{
this.optionItem = optionItem;
}
public Long getCpaId() {
return cpaId;
}
public void setCpaId(Long cpaId) {
this.cpaId = cpaId;
}
@Override
public String toString() {
return "AdvertisingBmOption{" +
......@@ -172,6 +185,7 @@ public class AdvertisingBmOption extends BaseEntity{
", updateUser=" + updateUser +
", updateTime=" + updateTime +
", optionItem=" + optionItem +
", cpaId=" + cpaId +
'}';
}
}
\ No newline at end of file
package com.pcloud.book.advertising.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.pcloud.common.entity.BaseEntity;
import java.util.Date;
import java.util.List;
/**
* cpa内容
*/
public class AdvertisingCpa extends BaseEntity{
/**
*标题
*/
private String detailName;
/**
*广告详情方式
*/
private String detailMode;
/**
*广告详情封面
*/
private String coverPic;
/**
*广告详情优惠图
*/
private String welfarePic;
/**
* 广告详情介绍
*/
private String detailInfo;
/**
*广告报名表单是否校验手机号
*/
private Boolean formMobileCheck;
/**
*广告报名表单备注
*/
private String formRemark;
/**
*广告报名表单提交按钮
*/
private String formButton;
/**
*广告报名表单跳转链接
*/
private String formLink;
@JsonFormat(
pattern = "yyyy-MM-dd HH:mm:ss",
timezone = "GMT+8"
)
private Date createTime;
@JsonFormat(
pattern = "yyyy-MM-dd HH:mm:ss",
timezone = "GMT+8"
)
private Date updateTime;
/**
* 预览链接
*/
private String previewLink;
/**
* 报名选项设置
*/
private List<AdvertisingBmOption> advertisingBmOptionList;
/**
* 多个上传文件
*/
private List<AdvertisingDetailFile> advertisingDetailFileList;
public String getDetailName() {
return detailName;
}
public void setDetailName(String detailName) {
this.detailName = detailName == null ? null : detailName.trim();
}
public String getDetailMode() {
return detailMode;
}
public void setDetailMode(String detailMode) {
this.detailMode = detailMode == null ? null : detailMode.trim();
}
public String getCoverPic() {
return coverPic;
}
public void setCoverPic(String coverPic) {
this.coverPic = coverPic == null ? null : coverPic.trim();
}
public String getWelfarePic() {
return welfarePic;
}
public void setWelfarePic(String welfarePic) {
this.welfarePic = welfarePic == null ? null : welfarePic.trim();
}
public Boolean getFormMobileCheck() {
return formMobileCheck;
}
public void setFormMobileCheck(Boolean formMobileCheck) {
this.formMobileCheck = formMobileCheck;
}
public String getFormRemark() {
return formRemark;
}
public void setFormRemark(String formRemark) {
this.formRemark = formRemark == null ? null : formRemark.trim();
}
public String getFormButton() {
return formButton;
}
public void setFormButton(String formButton) {
this.formButton = formButton == null ? null : formButton.trim();
}
public String getFormLink() {
return formLink;
}
public void setFormLink(String formLink) {
this.formLink = formLink == null ? null : formLink.trim();
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public String getDetailInfo() {
return detailInfo;
}
public void setDetailInfo(String detailInfo) {
this.detailInfo = detailInfo == null ? null : detailInfo.trim();
}
public List<AdvertisingBmOption> getAdvertisingBmOptionList() {
return advertisingBmOptionList;
}
public void setAdvertisingBmOptionList(List<AdvertisingBmOption> advertisingBmOptionList) {
this.advertisingBmOptionList = advertisingBmOptionList;
}
public List<AdvertisingDetailFile> getAdvertisingDetailFileList() {
return advertisingDetailFileList;
}
public void setAdvertisingDetailFileList(List<AdvertisingDetailFile> advertisingDetailFileList) {
this.advertisingDetailFileList = advertisingDetailFileList;
}
public String getPreviewLink() {
return previewLink;
}
public void setPreviewLink(String previewLink) {
this.previewLink = previewLink;
}
}
\ No newline at end of file
......@@ -72,6 +72,10 @@ public class AdvertisingDetailFile extends BaseEntity{
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date updateTime;
/**
* cpa内容id
*/
private Long cpaId;
public Long getAdId() {
return adId;
}
......@@ -186,6 +190,14 @@ public class AdvertisingDetailFile extends BaseEntity{
this.updateTime = updateTime;
}
public Long getCpaId() {
return cpaId;
}
public void setCpaId(Long cpaId) {
this.cpaId = cpaId;
}
@Override
public String toString() {
return "AdvertisingDetailFile{" +
......
......@@ -180,7 +180,10 @@ public class AdvertisingSpace extends BaseEntity {
* 多个上传文件
*/
private List<AdvertisingDetailFile> advertisingDetailFileList;
/**
* cp内容id
*/
private Long cpaId;
@Override
public Long getId() {
return id;
......@@ -483,6 +486,14 @@ public class AdvertisingSpace extends BaseEntity {
this.advertisingDetailFileList = advertisingDetailFileList;
}
public Long getCpaId() {
return cpaId;
}
public void setCpaId(Long cpaId) {
this.cpaId = cpaId;
}
@Override
public String toString() {
return "AdvertisingSpace{" +
......@@ -523,6 +534,7 @@ public class AdvertisingSpace extends BaseEntity {
", adDetailFileName='" + adDetailFileName + '\'' +
", adDetailFileDuration=" + adDetailFileDuration +
", advertisingDetailFileList=" + advertisingDetailFileList +
", cpaId=" + cpaId +
'}';
}
}
\ No newline at end of file
package com.pcloud.book.advertising.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.pcloud.common.entity.BaseEntity;
import java.util.Date;
public class AdvertisingWechatMsg extends BaseEntity{
/**
* 广告id
*/
private Long adId;
/**
* 广告位置方式
*/
private String adPositionMode;
/**
* 广告位链接
*/
private String adLink;
/**
*广告位标题
*/
private String adTitle;
/**
*广告位文案
*/
private String adSlogan;
/**
*广告位图片
*/
private String adPic;
/**
* 序号
*/
private Integer seq;
@JsonFormat(
pattern = "yyyy-MM-dd HH:mm:ss",
timezone = "GMT+8"
)
private Date createTime;
@JsonFormat(
pattern = "yyyy-MM-dd HH:mm:ss",
timezone = "GMT+8"
)
private Date updateTime;
/**
* cpaId
*/
private Long cpaId;
public Long getAdId() {
return adId;
}
public void setAdId(Long adId) {
this.adId = adId;
}
public String getAdPositionMode() {
return adPositionMode;
}
public void setAdPositionMode(String adPositionMode) {
this.adPositionMode = adPositionMode == null ? null : adPositionMode.trim();
}
public String getAdLink() {
return adLink;
}
public void setAdLink(String adLink) {
this.adLink = adLink == null ? null : adLink.trim();
}
public String getAdTitle() {
return adTitle;
}
public void setAdTitle(String adTitle) {
this.adTitle = adTitle == null ? null : adTitle.trim();
}
public String getAdSlogan() {
return adSlogan;
}
public void setAdSlogan(String adSlogan) {
this.adSlogan = adSlogan == null ? null : adSlogan.trim();
}
public String getAdPic() {
return adPic;
}
public void setAdPic(String adPic) {
this.adPic = adPic == null ? null : adPic.trim();
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public Integer getSeq() {
return seq;
}
public void setSeq(Integer seq) {
this.seq = seq;
}
public Long getCpaId() {
return cpaId;
}
public void setCpaId(Long cpaId) {
this.cpaId = cpaId;
}
@Override
public String toString() {
return "AdvertisingWechatMsg{" +
"adId=" + adId +
", adPositionMode='" + adPositionMode + '\'' +
", adLink='" + adLink + '\'' +
", adTitle='" + adTitle + '\'' +
", adSlogan='" + adSlogan + '\'' +
", adPic='" + adPic + '\'' +
", seq=" + seq +
", createTime=" + createTime +
", updateTime=" + updateTime +
", cpaId=" + cpaId +
'}';
}
}
\ No newline at end of file
package com.pcloud.book.advertising.facade;
import com.pcloud.book.advertising.dto.AdvertisingCpaDTO;
import com.pcloud.book.advertising.dto.AdvertisingBrandDTO;
import com.pcloud.book.advertising.dto.AdvertisingSpaceDTO;
import com.pcloud.book.advertising.dto.AdvertisingWechatMsgDTO;
import com.pcloud.book.advertising.dto.Book4AdvertisingTagDTO;
import com.pcloud.book.advertising.dto.GroupTagAddDTO;
import com.pcloud.book.advertising.dto.GroupTagDTO;
......@@ -11,12 +13,14 @@ import com.pcloud.book.advertising.entity.AdvertisingAgentPermission;
import com.pcloud.book.advertising.entity.AdvertisingBrand;
import com.pcloud.book.advertising.entity.AdvertisingBrowseRecord;
import com.pcloud.book.advertising.entity.AdvertisingClickRecord;
import com.pcloud.book.advertising.entity.AdvertisingCpa;
import com.pcloud.book.advertising.entity.AdvertisingDistributionBook;
import com.pcloud.book.advertising.entity.AdvertisingExposureRecord;
import com.pcloud.book.advertising.entity.AdvertisingMaster;
import com.pcloud.book.advertising.entity.AdvertisingPilotRecord;
import com.pcloud.book.advertising.entity.AdvertisingPlan;
import com.pcloud.book.advertising.entity.AdvertisingSpace;
import com.pcloud.book.advertising.entity.AdvertisingWechatMsg;
import com.pcloud.common.dto.ResponseDto;
import com.pcloud.common.exceptions.BizException;
import com.pcloud.common.page.PageBean;
......@@ -324,14 +328,16 @@ public interface AdvertisingSpaceFacade {
@ApiImplicitParam(name = "numPerPage", value = "每页条数", dataType = "int", paramType = "query"),
@ApiImplicitParam(name = "filterClose", value = "过滤已关闭", dataType = "int", paramType = "query"),
@ApiImplicitParam(name = "filterTest", value = "过滤测试数据", dataType = "int", paramType = "query"),
@ApiImplicitParam(name = "adPosition", value = "广告位位置", dataType = "string", paramType = "query")
@ApiImplicitParam(name = "adPosition", value = "广告位位置", dataType = "string", paramType = "query"),
@ApiImplicitParam(name = "type", value = "广告位类型(WECHAT_GROUP/BOOK)", dataType = "string", paramType = "query")
})
@RequestMapping(value = "list", method = RequestMethod.GET)
ResponseDto<?> list(@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 = "filterClose", required = false) Boolean filterClose,
@RequestParam(value = "filterTest", required = false) Boolean filterTest,
@RequestParam(value = "adPosition", required = false) String adPosition)
@RequestParam(value = "adPosition", required = false) String adPosition,
@RequestParam(value = "type", required = false) String type)
throws PermissionException, BizException, JsonParseException;
/**
......@@ -1212,4 +1218,64 @@ public interface AdvertisingSpaceFacade {
@ApiOperation(value = "获得品牌方登录信息", httpMethod = "GET")
@GetMapping("getBrandLoginInfo")
public ResponseDto<?> getBrandLoginInfo(@RequestHeader("token") String token) throws PermissionException;
@ApiOperation(value = "创建多条微信群消息", httpMethod = "POST")
@PostMapping("createWechatGroupMsg")
public ResponseDto<?> createWechatGroupMsg(@RequestHeader("token") String token, @RequestBody @ApiParam List<AdvertisingWechatMsg> advertisingWechatMsgList) throws PermissionException;
@ApiOperation(value = "创建cpa内容", httpMethod = "POST")
@PostMapping("createCPAContent")
public ResponseDto<?> createCPAContent(@RequestHeader("token") String token, @RequestBody @ApiParam AdvertisingCpa advertisingCpa) throws PermissionException;
@ApiOperation(value = "修改cpa内容", httpMethod = "POST")
@PostMapping("updateCPAContent")
public ResponseDto<?> updateCPAContent(@RequestHeader("token") String token, @RequestBody @ApiParam AdvertisingCpa advertisingCpa) throws PermissionException;
@ApiOperation(value = "删除cpa内容", httpMethod = "GET")
@ApiImplicitParam(name = "cpaId", value = "cpa内容id", dataType = "Long", paramType = "query")
@GetMapping("deleteCPAContent")
public ResponseDto<?> deleteCPAContent(@RequestHeader("token") String token, @RequestParam("cpaId") Long cpaId) throws PermissionException;
@ApiOperation(value = "根据id查询cpa内容", httpMethod = "GET")
@ApiImplicitParam(name = "cpaId", value = "cpa内容id", dataType = "Long", paramType = "query")
@GetMapping("getCPAContentById")
public ResponseDto<AdvertisingCpaDTO> getCPAContentById(@RequestHeader("token") String token, @RequestParam("cpaId") Long cpaId) throws PermissionException;
@ApiOperation(value = "分页查询cpa内容", httpMethod = "GET")
@ApiImplicitParams({
@ApiImplicitParam(name = "title", value = "标题", dataType = "string", required = false, paramType = "query"),
@ApiImplicitParam(name = "detailMode", value = "展示方式(AUDIO/VIDEO/IMG_TEXT)", dataType = "string", required = false, paramType = "query"),
@ApiImplicitParam(name = "currentPage", value = "当前页", dataType = "int", paramType = "query"),
@ApiImplicitParam(name = "numPerPage", value = "每页条数", dataType = "int", paramType = "query"),
})
@GetMapping("listPageCPAContent")
public ResponseDto<PageBeanNew<AdvertisingCpaDTO>> listPageCPAContent(
@RequestHeader("token") String token, @RequestParam(value = "title", required = false) String title,
@RequestParam(value = "detailMode", required = false) String detailMode,
@RequestParam(value = "currentPage", required = false) Integer currentPage,
@RequestParam(value = "numPerPage", required = false) Integer numPerPage) throws PermissionException;
@ApiOperation(value = "分页查询cpa链接", httpMethod = "GET")
@ApiImplicitParams({
@ApiImplicitParam(name = "title", value = "标题", dataType = "string", required = false, paramType = "query"),
@ApiImplicitParam(name = "detailMode", value = "展示方式(AUDIO/VIDEO/IMG_TEXT)", dataType = "string", required = false, paramType = "query"),
@ApiImplicitParam(name = "currentPage", value = "当前页", dataType = "int", paramType = "query"),
@ApiImplicitParam(name = "numPerPage", value = "每页条数", dataType = "int", paramType = "query"),
})
@GetMapping("listPageCPALink")
public ResponseDto<PageBeanNew<AdvertisingCpaDTO>> listPageCPALink(
@RequestHeader("token") String token, @RequestParam(value = "title", required = false) String title,
@RequestParam(value = "detailMode", required = false) String detailMode,
@RequestParam(value = "currentPage", required = false) Integer currentPage,
@RequestParam(value = "numPerPage", required = false) Integer numPerPage) throws PermissionException;
@ApiOperation(value = "根据广告位查询配置的微信群消息", httpMethod = "GET")
@ApiImplicitParam(name = "adId", value = "广告id", dataType = "long", paramType = "query")
@GetMapping("getWechatGroupMsgListByAdId")
public ResponseDto<List<AdvertisingWechatMsgDTO>> getWechatGroupMsgListByAdId(@RequestHeader("token") String token, @RequestParam("adId") Long adId) throws PermissionException;
@ApiOperation(value = "客户端-根据id查询cpa内容", httpMethod = "GET")
@ApiImplicitParam(name = "cpaId", value = "cpa内容id", dataType = "Long", paramType = "query")
@GetMapping("getCPAContentById4Wechat")
public ResponseDto<AdvertisingCpaDTO> getCPAContentById4Wechat(@CookieValue("userInfo") String userInfo, @RequestParam("cpaId") Long cpaId) throws PermissionException;
}
......@@ -3,22 +3,26 @@ package com.pcloud.book.advertising.facade.impl;
import com.pcloud.book.advertising.biz.AdvertisingSpaceBiz;
import com.pcloud.book.advertising.biz.GroupTagBiz;
import com.pcloud.book.advertising.dto.AdvertisingBrandDTO;
import com.pcloud.book.advertising.dto.AdvertisingCpaDTO;
import com.pcloud.book.advertising.dto.AdvertisingSpaceDTO;
import com.pcloud.book.advertising.dto.Book4AdvertisingTagDTO;
import com.pcloud.book.advertising.dto.GroupTagAddDTO;
import com.pcloud.book.advertising.dto.GroupTagDTO;
import com.pcloud.book.advertising.dto.AdvertisingWechatMsgDTO;
import com.pcloud.book.advertising.dto.TestParamDTO;
import com.pcloud.book.advertising.entity.AdvertisingAdviserPermission;
import com.pcloud.book.advertising.entity.AdvertisingAgentPermission;
import com.pcloud.book.advertising.entity.AdvertisingBrand;
import com.pcloud.book.advertising.entity.AdvertisingBrowseRecord;
import com.pcloud.book.advertising.entity.AdvertisingClickRecord;
import com.pcloud.book.advertising.entity.AdvertisingCpa;
import com.pcloud.book.advertising.entity.AdvertisingDistributionBook;
import com.pcloud.book.advertising.entity.AdvertisingExposureRecord;
import com.pcloud.book.advertising.entity.AdvertisingMaster;
import com.pcloud.book.advertising.entity.AdvertisingPilotRecord;
import com.pcloud.book.advertising.entity.AdvertisingPlan;
import com.pcloud.book.advertising.entity.AdvertisingSpace;
import com.pcloud.book.advertising.entity.AdvertisingWechatMsg;
import com.pcloud.book.advertising.facade.AdvertisingSpaceFacade;
import com.pcloud.book.base.exception.BookBizException;
import com.pcloud.common.dto.ResponseDto;
......@@ -292,7 +296,8 @@ public class AdvertisingSpaceFacadeImpl implements AdvertisingSpaceFacade {
@RequestParam(value = "currentPage", required = false) Integer currentPage, @RequestParam(value = "numPerPage", required = false) Integer numPerPage,
@RequestParam(value = "filterClose", required = false) Boolean filterClose,
@RequestParam(value = "filterTest", required = false) Boolean filterTest,
@RequestParam(value = "adPosition", required = false) String adPosition)
@RequestParam(value = "adPosition", required = false) String adPosition,
@RequestParam(value = "type", required = false) String type)
throws PermissionException, BizException, JsonParseException {
if (currentPage == null || numPerPage == null || currentPage < 0 || numPerPage < 0) {
throw BookBizException.PAGE_PARAM_DELETION;
......@@ -303,7 +308,7 @@ public class AdvertisingSpaceFacadeImpl implements AdvertisingSpaceFacade {
if (null == filterTest) {
filterTest = true;
}
return new ResponseDto<>(advertisingSpaceBiz.list(name, new PageParam(currentPage, numPerPage), filterClose, filterTest, adPosition));
return new ResponseDto<>(advertisingSpaceBiz.list(name, new PageParam(currentPage, numPerPage), filterClose, filterTest, adPosition, type));
}
/**
......@@ -1073,6 +1078,22 @@ public class AdvertisingSpaceFacadeImpl implements AdvertisingSpaceFacade {
List<Long> bookIds = groupTagBiz.getTagBookIds4AdBrand(brandId);
return new ResponseDto<>(bookIds);
}
@Override
@PostMapping("createWechatGroupMsg")
public ResponseDto<?> createWechatGroupMsg(@RequestHeader("token") String token, @RequestBody @ApiParam List<AdvertisingWechatMsg> advertisingWechatMsgList) throws PermissionException {
SessionUtil.getToken4Redis(token);
if (ListUtils.isEmpty(advertisingWechatMsgList)) {
throw new BookBizException(BookBizException.PARAM_IS_NULL, "参数为空");
}
if (advertisingWechatMsgList.size() > 1) {
throw new BookBizException(BookBizException.PARAM_IS_NULL, "最多1条消息");
}
if (null == advertisingWechatMsgList.get(0).getAdId()) {
throw new BookBizException(BookBizException.PARAM_IS_NULL, "广告id为空");
}
advertisingSpaceBiz.createWechatGroupMsg(advertisingWechatMsgList);
return new ResponseDto<>();
}
/**
* 创建品牌方账号
......@@ -1199,4 +1220,105 @@ public class AdvertisingSpaceFacadeImpl implements AdvertisingSpaceFacade {
return new ResponseDto<>(map);
}
@Override
@PostMapping("createCPAContent")
public ResponseDto<?> createCPAContent(@RequestHeader("token") String token, @RequestBody @ApiParam AdvertisingCpa advertisingCpa) throws PermissionException {
if (null == advertisingCpa) {
throw new BookBizException(BookBizException.PARAM_IS_NULL, "参数有误!");
}
SessionUtil.getToken4Redis(token);
Long cpaId = advertisingSpaceBiz.createCPAContent(advertisingCpa);
return new ResponseDto<>(cpaId);
}
@Override
@PostMapping("updateCPAContent")
public ResponseDto<?> updateCPAContent(@RequestHeader("token") String token, @RequestBody @ApiParam AdvertisingCpa advertisingCpa) throws PermissionException {
if (null == advertisingCpa || null == advertisingCpa.getId()) {
throw new BookBizException(BookBizException.PARAM_IS_NULL, "参数有误!");
}
SessionUtil.getToken4Redis(token);
advertisingSpaceBiz.updateCPAContent(advertisingCpa);
return new ResponseDto<>();
}
@Override
@GetMapping("deleteCPAContent")
public ResponseDto<?> deleteCPAContent(@RequestHeader("token") String token, @RequestParam("cpaId") Long cpaId) throws PermissionException {
if (null == cpaId) {
throw new BookBizException(BookBizException.PARAM_IS_NULL, "参数有误!");
}
SessionUtil.getToken4Redis(token);
advertisingSpaceBiz.deleteCPAContent(cpaId);
return new ResponseDto<>();
}
@Override
@GetMapping("getCPAContentById")
public ResponseDto<AdvertisingCpaDTO> getCPAContentById(@RequestHeader("token") String token, @RequestParam("cpaId") Long cpaId) throws PermissionException {
if (null == cpaId) {
throw new BookBizException(BookBizException.PARAM_IS_NULL, "参数有误!");
}
SessionUtil.getToken4Redis(token);
AdvertisingCpaDTO dto = advertisingSpaceBiz.getCPAContentById(cpaId);
return new ResponseDto<>(dto);
}
@Override
@GetMapping("listPageCPAContent")
public ResponseDto<PageBeanNew<AdvertisingCpaDTO>> listPageCPAContent(
@RequestHeader("token") String token, @RequestParam(value = "title", required = false) String title,
@RequestParam(value = "detailMode", required = false) String detailMode,
@RequestParam(value = "currentPage", required = false) Integer currentPage,
@RequestParam(value = "numPerPage", required = false) Integer numPerPage) throws PermissionException {
SessionUtil.getToken4Redis(token);
if (currentPage == null || numPerPage == null || currentPage < 0 || numPerPage < 0) {
throw BookBizException.PAGE_PARAM_DELETION;
}
PageBeanNew<AdvertisingCpaDTO> pageBeanNew = advertisingSpaceBiz.listPageCPAContent(title, detailMode, currentPage, numPerPage);
return new ResponseDto<>(pageBeanNew);
}
@Override
@GetMapping("listPageCPALink")
public ResponseDto<PageBeanNew<AdvertisingCpaDTO>> listPageCPALink(
@RequestHeader("token") String token, @RequestParam(value = "title", required = false) String title,
@RequestParam(value = "detailMode", required = false) String detailMode,
@RequestParam(value = "currentPage", required = false) Integer currentPage,
@RequestParam(value = "numPerPage", required = false) Integer numPerPage) throws PermissionException {
SessionUtil.getToken4Redis(token);
if (currentPage == null || numPerPage == null || currentPage < 0 || numPerPage < 0) {
throw BookBizException.PAGE_PARAM_DELETION;
}
PageBeanNew<AdvertisingCpaDTO> pageBeanNew = advertisingSpaceBiz.listPageCPALink(title, detailMode, currentPage, numPerPage);
return new ResponseDto<>(pageBeanNew);
}
@Override
@GetMapping("getWechatGroupMsgListByAdId")
public ResponseDto<List<AdvertisingWechatMsgDTO>> getWechatGroupMsgListByAdId(@RequestHeader("token") String token, @RequestParam("adId") Long adId) throws PermissionException {
SessionUtil.getToken4Redis(token);
if (null == adId){
throw new BookBizException(BookBizException.PARAM_IS_NULL,"广告id为空");
}
List<AdvertisingWechatMsgDTO> list = advertisingSpaceBiz.getWechatGroupMsgListByAdId(adId);
return new ResponseDto<>(list);
}
@ApiOperation(value = "cpa内容旧数据处理---内部使用!!",httpMethod = "GET")
@GetMapping("dealOldCPAContent")
public ResponseDto<?> dealOldCPAContent(){
advertisingSpaceBiz.dealOldCPAContent();
return new ResponseDto<>();
}
@Override
@GetMapping("getCPAContentById4Wechat")
public ResponseDto<AdvertisingCpaDTO> getCPAContentById4Wechat(@CookieValue("userInfo") String userInfo, @RequestParam("cpaId") Long cpaId) throws PermissionException {
if (null == cpaId) {
throw new BookBizException(BookBizException.PARAM_IS_NULL, "参数有误!");
}
AdvertisingCpaDTO dto = advertisingSpaceBiz.getCPAContentById(cpaId);
return new ResponseDto<>(dto);
}
}
......@@ -14,32 +14,33 @@
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
<result column="update_user" property="updateUser" jdbcType="BIGINT" />
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
<result column="cpa_id" property="cpaId" jdbcType="BIGINT" />
<collection property="optionItem" column="id"
select="com.pcloud.book.advertising.dao.impl.BmOptionItemDaoImpl.getByOptionId" />
</resultMap>
<sql id="Base_Column_List" >
id, ad_id, seq, item_title, item_desc, item_input_type, item_data_type, required,
create_user, create_time, update_user, update_time
create_user, create_time, update_user, update_time, cpa_id
</sql>
<insert id="insert" parameterType="com.pcloud.book.advertising.entity.AdvertisingBmOption" useGeneratedKeys="true" keyProperty="id">
insert into advertising_bm_option (ad_id, seq, item_title,
item_desc, item_input_type, item_data_type,
required, create_user, create_time
required, create_user, create_time, cpa_id
)
values (#{adId,jdbcType=BIGINT}, #{seq,jdbcType=BIGINT}, #{itemTitle,jdbcType=VARCHAR},
#{itemDesc,jdbcType=VARCHAR}, #{itemInputType,jdbcType=VARCHAR}, #{itemDataType,jdbcType=VARCHAR},
#{required,jdbcType=BIT}, #{createUser,jdbcType=BIGINT}, NOW()
#{required,jdbcType=BIT}, #{createUser,jdbcType=BIGINT}, NOW(), #{cpaId}
)
</insert>
<!-- 根据广告ID获取选项表单 -->
<select id="getByAdId" resultMap="BaseResultMap" parameterType="map" >
<select id="getByCPAId" resultMap="BaseResultMap" parameterType="map" >
select
<include refid="Base_Column_List" />
from advertising_bm_option
where ad_id = #{adId,jdbcType=BIGINT}
where cpa_id = #{cpaId,jdbcType=BIGINT}
order by seq asc, id asc
</select>
......@@ -79,19 +80,19 @@
</foreach>
</delete>
<select id="getOptionIdsByAdId" parameterType="Long" resultType="Long">
<select id="getOptionIdsByCPAId" parameterType="Long" resultType="Long">
SELECT id
FROM advertising_bm_option
WHERE ad_id = #{adId,jdbcType=BIGINT}
WHERE cpa_id = #{cpaId,jdbcType=BIGINT}
</select>
<select id="getMobilePhoneOptionIdByAd" parameterType="Long" resultType="Long">
<select id="getMobilePhoneOptionIdByCPA" parameterType="Long" resultType="Long">
SELECT
id
FROM
advertising_bm_option
WHERE
ad_id = #{adId,jdbcType=BIGINT}
cpa_id = #{cpaId,jdbcType=BIGINT}
AND item_title = '手机号'
AND item_input_type = 'input'
AND item_data_type = 'mobile'
......@@ -99,4 +100,11 @@
LIMIT 1
</select>
<update id="updateCPAId" parameterType="map">
UPDATE advertising_bm_option
SET cpa_id = #{cpaId,jdbcType=BIGINT}
WHERE
ad_id = #{adId,jdbcType=BIGINT}
</update>
</mapper>
\ No newline at end of file
......@@ -287,4 +287,24 @@
) AS a
</select>
<select id="getClickNumByCPAId" parameterType="map" resultType="Long">
SELECT
count(1)
FROM
advertising_click_record r
INNER JOIN advertising_space s ON r.ad_id = s.id
WHERE
s.cpa_id = #{cpaId}
</select>
<select id="getClickUserNumByCPAId" parameterType="map" resultType="Long">
SELECT
COUNT(DISTINCT wechat_user_id)
FROM
advertising_click_record r
INNER JOIN advertising_space s ON r.ad_id = s.id
WHERE
s.cpa_id = #{cpaId}
</select>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.pcloud.book.advertising.dao.impl.AdvertisingCpaDaoImpl" >
<resultMap id="BaseResultMap" type="com.pcloud.book.advertising.entity.AdvertisingCpa" >
<id column="id" property="id" jdbcType="BIGINT" />
<result column="detail_name" property="detailName" jdbcType="VARCHAR" />
<result column="detail_mode" property="detailMode" jdbcType="VARCHAR" />
<result column="cover_pic" property="coverPic" jdbcType="VARCHAR" />
<result column="welfare_pic" property="welfarePic" jdbcType="VARCHAR" />
<result column="form_mobile_check" property="formMobileCheck" jdbcType="BIT" />
<result column="form_remark" property="formRemark" jdbcType="VARCHAR" />
<result column="form_button" property="formButton" jdbcType="VARCHAR" />
<result column="form_link" property="formLink" jdbcType="VARCHAR" />
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
<result column="detail_info" property="detailInfo" jdbcType="LONGVARCHAR" />
<result column="preview_link" property="previewLink" jdbcType="VARCHAR" />
</resultMap>
<resultMap id="AdvertisingCpaDTO" type="com.pcloud.book.advertising.dto.AdvertisingCpaDTO">
<id column="id" property="id" jdbcType="BIGINT"/>
<result column="detail_name" property="detailName" jdbcType="VARCHAR"/>
<result column="detail_mode" property="detailMode" jdbcType="VARCHAR"/>
<result column="cover_pic" property="coverPic" jdbcType="VARCHAR"/>
<result column="welfare_pic" property="welfarePic" jdbcType="VARCHAR"/>
<result column="form_mobile_check" property="formMobileCheck" jdbcType="BIT"/>
<result column="form_remark" property="formRemark" jdbcType="VARCHAR"/>
<result column="form_button" property="formButton" jdbcType="VARCHAR"/>
<result column="form_link" property="formLink" jdbcType="VARCHAR"/>
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP"/>
<result column="detail_info" property="detailInfo" jdbcType="LONGVARCHAR"/>
<result column="preview_link" property="previewLink" jdbcType="VARCHAR" />
</resultMap>
<sql id="Base_Column_List" >
id, detail_name, detail_mode, cover_pic, welfare_pic, form_mobile_check, form_remark,
form_button, form_link, create_time, update_time, detail_info, preview_link
</sql>
<select id="getById" resultMap="BaseResultMap" parameterType="java.lang.Long" >
select
<include refid="Base_Column_List" />
from advertising_cpa
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteById" parameterType="java.lang.Long" >
delete from advertising_cpa
where id = #{id,jdbcType=BIGINT}
</delete>
<insert id="insert" parameterType="com.pcloud.book.advertising.entity.AdvertisingCpa" useGeneratedKeys="true" keyProperty="id">
insert into advertising_cpa (detail_name, detail_mode,
cover_pic, welfare_pic, form_mobile_check,
form_remark, form_button, form_link,
create_time, update_time, detail_info, preview_link
)
values (#{detailName,jdbcType=VARCHAR}, #{detailMode,jdbcType=VARCHAR},
#{coverPic,jdbcType=VARCHAR}, #{welfarePic,jdbcType=VARCHAR}, #{formMobileCheck,jdbcType=BIT},
#{formRemark,jdbcType=VARCHAR}, #{formButton,jdbcType=VARCHAR}, #{formLink,jdbcType=VARCHAR},
NOW(), NOW(), #{detailInfo,jdbcType=LONGVARCHAR}, #{previewLink,jdbcType=VARCHAR}
)
</insert>
<update id="update" parameterType="com.pcloud.book.advertising.entity.AdvertisingCpa" >
update advertising_cpa
<set >
<if test="detailName != null" >
detail_name = #{detailName,jdbcType=VARCHAR},
</if>
<if test="detailMode != null" >
detail_mode = #{detailMode,jdbcType=VARCHAR},
</if>
<if test="coverPic != null" >
cover_pic = #{coverPic,jdbcType=VARCHAR},
</if>
<if test="welfarePic != null" >
welfare_pic = #{welfarePic,jdbcType=VARCHAR},
</if>
<if test="formMobileCheck != null" >
form_mobile_check = #{formMobileCheck,jdbcType=BIT},
</if>
<if test="formRemark != null" >
form_remark = #{formRemark,jdbcType=VARCHAR},
</if>
<if test="formButton != null" >
form_button = #{formButton,jdbcType=VARCHAR},
</if>
<if test="formLink != null" >
form_link = #{formLink,jdbcType=VARCHAR},
</if>
update_time = NOW(),
<if test="detailInfo != null" >
detail_info = #{detailInfo,jdbcType=LONGVARCHAR},
</if>
<if test="previewLink != null">
preview_link = #{previewLink,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<select id="listPage" parameterType="map" resultMap="AdvertisingCpaDTO">
select
<include refid="Base_Column_List"/>
from advertising_cpa
WHERE
1 = 1
<if test="name != null ">
AND detail_name LIKE CONCAT( '%', #{name}, '%')
</if>
<if test="detailMode != null">
AND detail_mode = #{detailMode,jdbcType=VARCHAR}
</if>
ORDER BY
update_time DESC
</select>
</mapper>
\ No newline at end of file
......@@ -17,23 +17,24 @@
<result column="cover_pic" property="coverPic" jdbcType="VARCHAR" />
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
<result column="cpa_id" property="cpaId" jdbcType="BIGINT" />
</resultMap>
<sql id="Base_Column_List" >
id, ad_id, file_id, file_convert_state, file_size, file_name, file_duration, file_url,
file_pilot_second, file_pilot_url, file_pilot_finish_tip, title, cover_pic, create_time, update_time
file_pilot_second, file_pilot_url, file_pilot_finish_tip, title, cover_pic, create_time, update_time, cpa_id
</sql>
<select id="getByAdId" resultMap="BaseResultMap" parameterType="java.lang.Long" >
<select id="getByCPAId" resultMap="BaseResultMap" parameterType="java.lang.Long" >
select
<include refid="Base_Column_List" />
from advertising_detail_file
where ad_id = #{adId,jdbcType=BIGINT}
where cpa_id = #{cpaId,jdbcType=BIGINT}
</select>
<delete id="deleteByAdId" parameterType="Long">
<delete id="deleteByCPAId" parameterType="Long">
delete from advertising_detail_file
where ad_id = #{adId,jdbcType=BIGINT}
where cpa_id = #{cpaId,jdbcType=BIGINT}
</delete>
<insert id="batchInsert" useGeneratedKeys="true" parameterType="java.util.List" keyProperty="id">
......@@ -42,7 +43,7 @@
file_convert_state, file_size, file_name,
file_duration, file_url, file_pilot_second,
file_pilot_url, file_pilot_finish_tip, title,
cover_pic, create_time)
cover_pic, create_time, cpa_id)
values
<foreach collection="list" item="item" index="index" separator="," >
(
......@@ -50,50 +51,16 @@
#{item.fileConvertState,jdbcType=INTEGER}, #{item.fileSize,jdbcType=BIGINT}, #{item.fileName,jdbcType=VARCHAR},
#{item.fileDuration,jdbcType=BIGINT}, #{item.fileUrl,jdbcType=VARCHAR}, #{item.filePilotSecond,jdbcType=BIGINT},
#{item.filePilotUrl,jdbcType=VARCHAR}, #{item.filePilotFinishTip,jdbcType=VARCHAR}, #{item.title,jdbcType=VARCHAR},
#{item.coverPic,jdbcType=VARCHAR}, NOW()
#{item.coverPic,jdbcType=VARCHAR}, NOW(), #{item.cpaId}
)
</foreach>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.pcloud.book.advertising.entity.AdvertisingDetailFile" >
update advertising_detail_file
<set >
<if test="fileId != null" >
file_id = #{fileId,jdbcType=VARCHAR},
</if>
<if test="fileConvertState != null" >
file_convert_state = #{fileConvertState,jdbcType=INTEGER},
</if>
<if test="fileSize != null" >
file_size = #{fileSize,jdbcType=BIGINT},
</if>
<if test="fileName != null" >
file_name = #{fileName,jdbcType=VARCHAR},
</if>
<if test="fileDuration != null" >
file_duration = #{fileDuration,jdbcType=BIGINT},
</if>
<if test="fileUrl != null" >
file_url = #{fileUrl,jdbcType=VARCHAR},
</if>
<if test="filePilotSecond != null" >
file_pilot_second = #{filePilotSecond,jdbcType=BIGINT},
</if>
<if test="filePilotUrl != null" >
file_pilot_url = #{filePilotUrl,jdbcType=VARCHAR},
</if>
<if test="filePilotFinishTip != null" >
file_pilot_finish_tip = #{filePilotFinishTip,jdbcType=VARCHAR},
</if>
<if test="title != null" >
title = #{title,jdbcType=VARCHAR},
</if>
<if test="coverPic != null" >
cover_pic = #{coverPic,jdbcType=VARCHAR},
</if>
update_time = NOW(),
</set>
where id = #{id,jdbcType=BIGINT}
<update id="updateCPAId" parameterType="map">
UPDATE advertising_detail_file
SET cpa_id = #{cpaId,jdbcType=BIGINT}
WHERE
ad_id = #{adId}
</update>
</mapper>
\ No newline at end of file
......@@ -293,4 +293,14 @@
AND count = 0
</update>
<select id="getExposureNumByCPAId" parameterType="long" resultType="long">
SELECT
ifnull(sum(count), 0)
FROM
advertising_exposure_record r
INNER JOIN advertising_space s ON r.ad_id = s.id
WHERE
s.cpa_id = #{cpaId}
</select>
</mapper>
\ No newline at end of file
......@@ -169,4 +169,13 @@
</if>
</select>
<select id="getPilotUserNumByCPAId" parameterType="long" resultType="long">
SELECT
COUNT(DISTINCT wechat_user_id)
FROM
advertising_pilot_record r
INNER JOIN advertising_space s ON r.ad_id = s.id
WHERE
s.cpa_id = #{cpaId}
</select>
</mapper>
\ No newline at end of file
......@@ -35,6 +35,7 @@
<result column="ad_detail_file_size" property="adDetailFileSize" jdbcType="BIGINT" />
<result column="ad_detail_file_name" property="adDetailFileName" jdbcType="VARCHAR" />
<result column="ad_detail_file_duration" property="adDetailFileDuration" jdbcType="BIGINT" />
<result column="cpa_id" property="cpaId" jdbcType="BIGINT" />
</resultMap>
<resultMap id="AdvertisingSpaceDTO" type="com.pcloud.book.advertising.dto.AdvertisingSpaceDTO">
......@@ -72,6 +73,7 @@
<result column="ad_detail_file_name" property="adDetailFileName" jdbcType="VARCHAR" />
<result column="ad_detail_file_duration" property="adDetailFileDuration" jdbcType="BIGINT" />
<result column="settlement_method" property="settlementMethod" jdbcType="VARCHAR"/>
<result column="cpa_id" property="cpaId" jdbcType="BIGINT" />
</resultMap>
<sql id="Base_Column_List">
......@@ -80,7 +82,7 @@
ad_detail_cover_pic, ad_detail_welfare_pic, ad_detail_info, ad_detail_file_id, ad_detail_file_convert_state,
ad_detail_file_url, ad_detail_title, ad_detail_file_pilot_second, ad_detail_file_pilot_url,
ad_detail_file_pilot_finish_tip, ad_form_mobile_check, ad_form_remark, ad_form_button,
ad_form_link, ad_detail_file_size, ad_detail_file_name, ad_detail_file_duration
ad_form_link, ad_detail_file_size, ad_detail_file_name, ad_detail_file_duration,cpa_id
</sql>
<select id="getById" resultMap="BaseResultMap" parameterType="Long">
......@@ -127,7 +129,8 @@
s.ad_form_link,
s.ad_detail_file_size,
s.ad_detail_file_name,
s.ad_detail_file_duration
s.ad_detail_file_duration,
s.cpa_id
FROM
advertising_distribution_book b,
advertising_space s
......@@ -173,7 +176,8 @@
s.ad_form_link,
s.ad_detail_file_size,
s.ad_detail_file_name,
s.ad_detail_file_duration
s.ad_detail_file_duration,
s.cpa_id
FROM
advertising_distribution_book b,
advertising_space s
......@@ -211,9 +215,15 @@
<if test="filterTest == 1">
AND (is_test = 0 OR is_test IS NULL)
</if>
<if test="adPosition !=null">
<if test="adPosition != null">
AND ad_position = #{adPosition}
</if>
<if test="type != null and type == 'WECHAT_GROUP'.toString()">
AND ad_position = 'WECHAT_GROUP_MSG'
</if>
<if test="type != null and type == 'BOOK'.toString()">
AND ad_position != 'WECHAT_GROUP_MSG' OR ad_position IS NULL
</if>
order by
create_time desc
</select>
......@@ -332,7 +342,8 @@
ad_detail_file_pilot_url, ad_detail_file_pilot_finish_tip,
ad_form_mobile_check, ad_form_remark, ad_form_button,
ad_form_link,ad_detail_file_size, ad_detail_file_name,
ad_detail_file_duration
ad_detail_file_duration,
cpa_id
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
#{adName,jdbcType=VARCHAR},
......@@ -355,7 +366,8 @@
#{adDetailFilePilotUrl,jdbcType=VARCHAR}, #{adDetailFilePilotFinishTip,jdbcType=VARCHAR},
#{adFormMobileCheck,jdbcType=BIT}, #{adFormRemark,jdbcType=VARCHAR}, #{adFormButton,jdbcType=VARCHAR},
#{adFormLink,jdbcType=VARCHAR}, #{adDetailFileSize}, #{adDetailFileName},
#{adDetailFileDuration}
#{adDetailFileDuration},
#{cpaId}
</trim>
</insert>
......@@ -450,6 +462,9 @@
<if test="adDetailFileDuration != null">
ad_detail_file_duration = #{adDetailFileDuration},
</if>
<if test="cpaId != null">
cpa_id = #{cpaId},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
......@@ -500,4 +515,31 @@
WHERE
master_id = #{masterId}
</select>
<select id="getAdIdsByCPAId" resultType="long" parameterType="long">
select
id
from
advertising_space
WHERE
cpa_id = #{cpaId,jdbcType=BIGINT}
</select>
<update id="updateCPAId" parameterType="map">
UPDATE advertising_space
SET cpa_id = #{cpaId,jdbcType=BIGINT}
WHERE
id = #{id}
</update>
<select id="getCPASpaceList" resultMap="BaseResultMap">
SELECT
s.*
FROM
advertising_space s
LEFT JOIN advertising_settlement_method m ON s.id = m.ad_id
WHERE
m.settlement_method = 'CPA' AND cpa_id IS NULL
</select>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.pcloud.book.advertising.dao.impl.AdvertisingWechatMsgDaoImpl" >
<resultMap id="BaseResultMap" type="com.pcloud.book.advertising.entity.AdvertisingWechatMsg" >
<id column="id" property="id" jdbcType="BIGINT" />
<result column="ad_id" property="adId" jdbcType="BIGINT" />
<result column="ad_position_mode" property="adPositionMode" jdbcType="VARCHAR" />
<result column="ad_link" property="adLink" jdbcType="VARCHAR" />
<result column="ad_title" property="adTitle" jdbcType="VARCHAR" />
<result column="ad_slogan" property="adSlogan" jdbcType="VARCHAR" />
<result column="ad_pic" property="adPic" jdbcType="VARCHAR" />
<result column="seq" property="seq" jdbcType="INTEGER" />
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
</resultMap>
<sql id="Base_Column_List" >
id, ad_id, ad_position_mode, ad_link, ad_title, ad_slogan, ad_pic, seq, create_time, update_time
</sql>
<insert id="insert" parameterType="com.pcloud.book.advertising.entity.AdvertisingWechatMsg" useGeneratedKeys="true" keyProperty="id">
insert into advertising_wechat_msg (ad_id, ad_position_mode,
ad_link, ad_title, ad_slogan,
ad_pic, seq, create_time, update_time
)
values (#{adId,jdbcType=BIGINT}, #{adPositionMode,jdbcType=VARCHAR},
#{adLink,jdbcType=VARCHAR}, #{adTitle,jdbcType=VARCHAR}, #{adSlogan,jdbcType=VARCHAR},
#{adPic,jdbcType=VARCHAR},#{seq},NOW(), NOW()
)
</insert>
<delete id="deleteById" parameterType="java.lang.Long" >
delete from advertising_wechat_msg
where id = #{id,jdbcType=BIGINT}
</delete>
<update id="update" parameterType="com.pcloud.book.advertising.entity.AdvertisingWechatMsg" >
update advertising_wechat_msg
set
ad_id = #{adId,jdbcType=BIGINT},
ad_position_mode = #{adPositionMode,jdbcType=VARCHAR},
ad_link = #{adLink,jdbcType=VARCHAR},
ad_title = #{adTitle,jdbcType=VARCHAR},
ad_slogan = #{adSlogan,jdbcType=VARCHAR},
ad_pic = #{adPic,jdbcType=VARCHAR},
update_time = NOW()
where id = #{id,jdbcType=BIGINT}
</update>
<insert id="batchInsert" useGeneratedKeys="true" parameterType="java.util.List" keyProperty="id">
insert into advertising_wechat_msg (ad_id, ad_position_mode,
ad_link, ad_title, ad_slogan,
ad_pic, seq, create_time, update_time
)
values
<foreach collection="list" item="item" index="index" separator="," >
(#{item.adId,jdbcType=BIGINT}, #{item.adPositionMode,jdbcType=VARCHAR},
#{item.adLink,jdbcType=VARCHAR}, #{item.adTitle,jdbcType=VARCHAR}, #{item.adSlogan,jdbcType=VARCHAR},
#{item.adPic,jdbcType=VARCHAR}, #{item.seq}, NOW(), NOW()
)
</foreach>
</insert>
<select id="getByAdId" resultMap="BaseResultMap" parameterType="long">
SELECT <include refid="Base_Column_List"></include>
FROM advertising_wechat_msg WHERE ad_id = #{adId,jdbcType=BIGINT}
order by seq asc
</select>
<delete id="deleteByAdId" parameterType="java.lang.Long" >
delete from advertising_wechat_msg
where ad_id = #{adId,jdbcType=BIGINT}
</delete>
</mapper>
\ No newline at end of file
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