Commit ff863903 by 吴博

Merge branch 'feature/1007685' into 'release'

Feature/1007685

See merge request rays/pcloud-book!1648
parents afb49fe4 2c124464
......@@ -73,6 +73,7 @@ import com.pcloud.book.consumer.reader.ReaderConsr;
import com.pcloud.book.consumer.user.AdviserConsr;
import com.pcloud.book.consumer.user.AgentConsr;
import com.pcloud.book.consumer.user.ChannelConsr;
import com.pcloud.book.consumer.user.PartyConsr;
import com.pcloud.book.consumer.wechatgroup.WechatGroupConsr;
import com.pcloud.book.group.biz.WeixinQrcodeBiz;
import com.pcloud.book.group.dao.BookGroupClassifyDao;
......@@ -94,6 +95,7 @@ import com.pcloud.common.constant.UrlConstant;
import com.pcloud.common.core.aspect.ParamLog;
import com.pcloud.common.core.biz.ConvertQueueBiz;
import com.pcloud.common.core.constant.ConvertEnum;
import com.pcloud.common.core.constant.SystemCode;
import com.pcloud.common.core.dto.ConvertQueueDto;
import com.pcloud.common.exceptions.BizException;
import com.pcloud.common.page.PageBean;
......@@ -244,6 +246,8 @@ public class AdvertisingSpaceBizImpl implements AdvertisingSpaceBiz {
private AdvertisingCpaDao advertisingCpaDao;
@Autowired
private BmOptionDao bmOptionDao;
@Autowired
private PartyConsr partyConsr;
......@@ -3206,6 +3210,9 @@ public class AdvertisingSpaceBizImpl implements AdvertisingSpaceBiz {
@Override
public Long createCPAContent(AdvertisingCpa advertisingCpa) {
advertisingCheck.checkCPAParam(advertisingCpa);
advertisingCpa.setCreateUser(advertisingCpa.getUserId());
advertisingCpa.setUpdateUser(advertisingCpa.getUserId());
fillVideo(advertisingCpa);
advertisingCpaDao.insert(advertisingCpa);
Long cpaId = advertisingCpa.getId();
//配置试听试看参数
......@@ -3213,7 +3220,7 @@ public class AdvertisingSpaceBizImpl implements AdvertisingSpaceBiz {
//广告详情,报名表单选项新增
bmBiz.addOptionList(advertisingCpa.getAdvertisingBmOptionList(), cpaId);
//音视频保存
if (!AdDetailModeEnum.IMG_TEXT.code.equals(advertisingCpa.getDetailMode())) {
if (!(AdDetailModeEnum.IMG_TEXT.code.equals(advertisingCpa.getDetailMode()) || AdDetailModeEnum.DEDICATED_LINK.code.equals(advertisingCpa.getDetailMode()))) {
addAdvertisingDetailFile(cpaId, advertisingCpa.getAdvertisingDetailFileList());
}
//更新预览链接
......@@ -3226,6 +3233,22 @@ public class AdvertisingSpaceBizImpl implements AdvertisingSpaceBiz {
return cpaId;
}
private void fillVideo(AdvertisingCpa advertisingCpa) {
if (StrUtil.isNotBlank(advertisingCpa.getCoverVideoFileId())) {
//获取转码路径
FileUploadInfo fileUploadInfo = convertConsr.getByFileId(advertisingCpa.getCoverVideoFileId());
if (null == fileUploadInfo) {
throw new BookBizException(BookBizException.PARAM_IS_ERROR, "文件路径为空!");
}
advertisingCpa.setCoverVideo(fileUploadInfo.getUrl());
advertisingCpa.setFileConvertState(0);
if (null != fileUploadInfo.getIsConvert() && fileUploadInfo.getIsConvert()) {
advertisingCpa.setFileConvertState(1);
}
advertisingCpa.setCoverVideoFileName(fileUploadInfo.getName() + "." + fileUploadInfo.getExt());
}
}
@Override
public void updateCPAContent(AdvertisingCpa advertisingCpa) {
advertisingCpa = equipCPA(advertisingCpa);
......@@ -3234,10 +3257,19 @@ public class AdvertisingSpaceBizImpl implements AdvertisingSpaceBiz {
bmBiz.addOptionList(advertisingCpa.getAdvertisingBmOptionList(), cpaId);
//音视频保存
detailFileDao.deleteByCPAId(cpaId);
if (!AdDetailModeEnum.IMG_TEXT.code.equals(advertisingCpa.getDetailMode())) {
if (!(AdDetailModeEnum.IMG_TEXT.code.equals(advertisingCpa.getDetailMode()) || AdDetailModeEnum.DEDICATED_LINK.code.equals(advertisingCpa.getDetailMode()))) {
addAdvertisingDetailFile(cpaId, advertisingCpa.getAdvertisingDetailFileList());
}
advertisingCpa.setUpdateUser(advertisingCpa.getUserId());
fillVideo(advertisingCpa);
advertisingCpaDao.update(advertisingCpa);
if(StrUtil.isBlank(advertisingCpa.getCoverVideoFileId())){
advertisingCpa.setCoverVideo(null);
advertisingCpa.setFileConvertState(null);
advertisingCpa.setCoverVideoFileId(null);
advertisingCpa.setCoverVideoFileName(null);
advertisingCpaDao.updateVideo(advertisingCpa);
}
}
@Override
......@@ -3258,6 +3290,20 @@ public class AdvertisingSpaceBizImpl implements AdvertisingSpaceBiz {
if (null == advertisingCpaDTO) {
throw new BookBizException(BookBizException.ERROR, "CPA内容不存在");
}
if((StrUtil.isBlank(advertisingCpaDTO.getCoverVideo()) || null== advertisingCpaDTO.getFileConvertState() || 0==advertisingCpaDTO.getFileConvertState()) && StrUtil.isNotBlank(advertisingCpaDTO.getCoverVideoFileId())){
//获取转码路径
FileUploadInfo fileUploadInfo = convertConsr.getByFileId(advertisingCpaDTO.getCoverVideoFileId());
if (null == fileUploadInfo) {
throw new BookBizException(BookBizException.PARAM_IS_ERROR, "文件路径为空!");
}
advertisingCpaDTO.setCoverVideo(fileUploadInfo.getUrl());
advertisingCpaDTO.setFileConvertState(0);
if (null != fileUploadInfo.getIsConvert() && fileUploadInfo.getIsConvert()) {
advertisingCpaDTO.setFileConvertState(1);
}
advertisingCpaDTO.setCoverVideoFileName(fileUploadInfo.getName() + "." + fileUploadInfo.getExt());
advertisingCpaDao.updateVideo(advertisingCpaDTO);
}
BeanUtils.copyProperties(advertisingCpaDTO, cpaDTO);
//填充报名表单,多个上传文件
cpaDTO.setAdvertisingBmOptionList(bmBiz.getByCPAId(cpaId));
......@@ -3277,6 +3323,7 @@ public class AdvertisingSpaceBizImpl implements AdvertisingSpaceBiz {
if (pageBeanNew == null || ListUtils.isEmpty(pageBeanNew.getRecordList())) {
return new PageBeanNew<>(currentPage, numPerPage, new ArrayList<>());
}
Map<Long, String> userNamesMap = partyConsr.getAllUserLoginName(0L, SystemCode.pcloud.code);
for (AdvertisingCpaDTO cpaDTO : pageBeanNew.getRecordList()) {
Long cpaId = cpaDTO.getId();
//曝光量点击量点击率点击人数
......@@ -3301,6 +3348,10 @@ public class AdvertisingSpaceBizImpl implements AdvertisingSpaceBiz {
new BigDecimal(pilotFinishUserNum.doubleValue() / clickUserNum).setScale(4, BigDecimal.ROUND_HALF_UP);
cpaDTO.setPilotFinishUserNum(pilotFinishUserNum);
cpaDTO.setPilotFinishRate(pilotFinishRate);
cpaDTO.setPreviewLongLink(wechatGroupLinkPrefix + "/ad?cpa_id=" + cpaId);
if(CollUtil.isNotEmpty(userNamesMap) && null!=cpaDTO.getUpdateUser() && userNamesMap.containsKey(cpaDTO.getUpdateUser())){
cpaDTO.setUpdateUserName(userNamesMap.get(cpaDTO.getUpdateUser()));
}
}
return pageBeanNew;
}
......
package com.pcloud.book.advertising.biz.impl;
import com.pcloud.appcenter.base.exception.AppBizException;
import com.pcloud.book.advertising.biz.BmBiz;
import com.pcloud.book.advertising.dao.AdvertisingCpaDao;
import com.pcloud.book.advertising.dao.AdvertisingDistributionBookDao;
......@@ -26,6 +27,10 @@ import com.pcloud.book.consumer.user.ChannelConsr;
import com.pcloud.book.group.dao.BookGroupDao;
import com.pcloud.book.group.entity.BookGroup;
import com.pcloud.book.util.common.ExcelUtils;
import com.pcloud.common.core.aspect.ParamLog;
import com.pcloud.common.core.biz.MessageBiz;
import com.pcloud.common.core.constant.SMSTemplateConstant;
import com.pcloud.common.core.dto.SendMessageDto;
import com.pcloud.common.entity.UploadResultInfo;
import com.pcloud.common.exceptions.BizException;
import com.pcloud.common.exceptions.ExportException;
......@@ -95,6 +100,8 @@ public class BmBizImpl implements BmBiz {
private AdvertisingDistributionBookDao distributionBookDao;
@Autowired
private AdvertisingCpaDao advertisingCpaDao;
@Autowired
private MessageBiz messageBiz;
/**
* 获取报名商品选项类型
......@@ -322,11 +329,13 @@ public class BmBizImpl implements BmBiz {
if (ListUtils.isEmpty(items)) {
throw new BookBizException(BookBizException.PARAM_IS_ERROR, "请填写表单");
}
String phoneNum=null;
Long mobilePhoneOptionId = bmOptionDao.getMobilePhoneOptionIdByCPA(cpaId);
Optional<AdvertisingBmRegisterItem> itemOptional = items.stream().filter(s -> s != null && s.getOptionId() == mobilePhoneOptionId).findFirst();
Optional<AdvertisingBmRegisterItem> itemOptional = items.stream().filter(s -> s != null && s.getOptionId().equals(mobilePhoneOptionId)).findFirst();
if (itemOptional.isPresent()) {// 存在
AdvertisingBmRegisterItem registerItem = itemOptional.get();
if (null != registerItem && !StringUtil.isEmpty(registerItem.getOptionValue())) {
phoneNum=registerItem.getOptionValue();
Integer count = bmRegisterItemDao.checkMobilePhone4Cpa(cpaId, bmRegister.getFromType(), bmRegister.getFromId(), registerItem.getOptionValue());
if (count > 0) {
throw new BookBizException(BookBizException.PARAM_IS_ERROR, "手机号已存在");
......@@ -341,10 +350,37 @@ public class BmBizImpl implements BmBiz {
Long registerId = bmRegister.getId();
// 添加用户选项
addRegisterItem(items, null, wechatUserId, registerId,cpaId);
// 报名成功发送短信
//cpaId找到手机号
AdvertisingCpa advertisingCpa = advertisingCpaDao.getById(cpaId);
if(null!=advertisingCpa && null!=advertisingCpa.getSuccessEmail() && advertisingCpa.getSuccessEmail()==2){
sendSMS(phoneNum,null, SMSTemplateConstant.DEDICATED_LINK_CODE);
}
return registerId;
}
/**
* 发送手机消息
*/
@ParamLog("发送手机消息")
public void sendSMS(String phone, Map<String, String> paramMap, String templateCode) throws BizException {
if (StringUtil.isEmpty(phone)) {
throw new AppBizException(AppBizException.PARAM_IS_NULL, "手机消息参数为空");
}
// 组装参数
SendMessageDto smsParam = new SendMessageDto();
smsParam.setSmsTemplateCode(templateCode);
smsParam.setParamKeyMap(paramMap);
smsParam.setPhoneNumber(phone);
try {
messageBiz.sendSMS(smsParam);
} catch (Exception e) {
LOGGER.error("【短信消息(消)】发送手机消息.[sendSMS]:" + e.getMessage(), e);
throw new AppBizException(AppBizException.INVOKE_MESSAGE_ERROR, "发送手机消息失败");
}
}
/**
* 添加用户选项
* @param items
* @param adId
......
......@@ -72,7 +72,7 @@ public class AdvertisingCheck {
// throw new BookBizException(BookBizException.PARAM_IS_ERROR, "优惠展示图不能为空!");
// }
//1图文介绍
if (AdDetailModeEnum.IMG_TEXT.code.equals(advertisingCpa.getDetailMode())) {
if (AdDetailModeEnum.IMG_TEXT.code.equals(advertisingCpa.getDetailMode()) || AdDetailModeEnum.DEDICATED_LINK.code.equals(advertisingCpa.getDetailMode())) {
if (StringUtil.isEmpty(advertisingCpa.getCoverPic())) {
throw new BookBizException(BookBizException.PARAM_IS_ERROR, "封面不能为空!");
}
......@@ -109,14 +109,16 @@ public class AdvertisingCheck {
}
}
//报名设置
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, "按钮提示不能为空!");
if(!AdDetailModeEnum.DEDICATED_LINK.code.equals(advertisingCpa.getDetailMode())) {
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, "按钮提示不能为空!");
}
}
}
......
......@@ -17,4 +17,6 @@ public interface AdvertisingCpaDao extends BaseDao<AdvertisingCpa> {
* @return
*/
List<Long> getNoPreviewLinkCPAList();
void updateVideo(AdvertisingCpa advertisingCpa);
}
......@@ -20,4 +20,9 @@ public class AdvertisingCpaDaoImpl extends BaseDaoImpl<AdvertisingCpa> implement
public List<Long> getNoPreviewLinkCPAList() {
return getSessionTemplate().selectList(getStatement("getNoPreviewLinkCPAList"));
}
@Override
public void updateVideo(AdvertisingCpa advertisingCpa) {
getSessionTemplate().update(getStatement("updateVideo"),advertisingCpa);
}
}
......@@ -107,6 +107,258 @@ public class AdvertisingCpaDTO extends BaseDto {
*/
private BigDecimal pilotFinishRate;
/**
* 介绍视频
*/
private String coverVideo;
/**
* 背景色
*/
private String bgColor;
/**
* 成功提示,1-无提示,2-自定义内容
*/
private Integer successToastType;
/**
* 成功提示,自定义内容
*/
private String successToastContent;
/**
* 表单提交按钮类型,1-自定义内容,2-按钮图片
*/
private Integer commitButtonType;
/**
* 表单提交按钮类型,自定义内容
*/
private String commitButtonContent;
/**
* 表单提交按钮类型,按钮图片
*/
private String commitButtonImage;
/**
* 吸底提交按钮类型,1-自定义内容,2-按钮图片
*/
private Integer bottomButtonType;
/**
* 吸底提交按钮类型,自定义内容
*/
private String bottomButtonContent;
/**
* 吸底提交按钮类型,按钮图片
*/
private String bottomButtonImage;
/**
* 隐私协议,1-无,2-显示并勾选,3-显示未勾选
*/
private Integer privacyAgreement;
/**
* 成功短信,1-不发送,2-发送固定模板
*/
private Integer successEmail;
/**
* 跳转类型,1-统一跳转,2-自定义跳转
*/
private Integer jumpStyle;
private Long createUser;
private Long updateUser;
private String updateUserName;
/**
* 预览长链
*/
private String previewLongLink;
private String headPicture;
private String coverVideoFileId;
private Integer fileConvertState;
private String coverVideoFileName;
public String getCoverVideoFileId() {
return coverVideoFileId;
}
public void setCoverVideoFileId(String coverVideoFileId) {
this.coverVideoFileId = coverVideoFileId;
}
public Integer getFileConvertState() {
return fileConvertState;
}
public void setFileConvertState(Integer fileConvertState) {
this.fileConvertState = fileConvertState;
}
public String getCoverVideoFileName() {
return coverVideoFileName;
}
public void setCoverVideoFileName(String coverVideoFileName) {
this.coverVideoFileName = coverVideoFileName;
}
public String getHeadPicture() {
return headPicture;
}
public void setHeadPicture(String headPicture) {
this.headPicture = headPicture;
}
public String getPreviewLongLink() {
return previewLongLink;
}
public void setPreviewLongLink(String previewLongLink) {
this.previewLongLink = previewLongLink;
}
public String getUpdateUserName() {
return updateUserName;
}
public void setUpdateUserName(String updateUserName) {
this.updateUserName = updateUserName;
}
public Long getCreateUser() {
return createUser;
}
public void setCreateUser(Long createUser) {
this.createUser = createUser;
}
public Long getUpdateUser() {
return updateUser;
}
public void setUpdateUser(Long updateUser) {
this.updateUser = updateUser;
}
public String getCoverVideo() {
return coverVideo;
}
public void setCoverVideo(String coverVideo) {
this.coverVideo = coverVideo;
}
public String getBgColor() {
return bgColor;
}
public void setBgColor(String bgColor) {
this.bgColor = bgColor;
}
public Integer getSuccessToastType() {
return successToastType;
}
public void setSuccessToastType(Integer successToastType) {
this.successToastType = successToastType;
}
public String getSuccessToastContent() {
return successToastContent;
}
public void setSuccessToastContent(String successToastContent) {
this.successToastContent = successToastContent;
}
public Integer getCommitButtonType() {
return commitButtonType;
}
public void setCommitButtonType(Integer commitButtonType) {
this.commitButtonType = commitButtonType;
}
public String getCommitButtonContent() {
return commitButtonContent;
}
public void setCommitButtonContent(String commitButtonContent) {
this.commitButtonContent = commitButtonContent;
}
public String getCommitButtonImage() {
return commitButtonImage;
}
public void setCommitButtonImage(String commitButtonImage) {
this.commitButtonImage = commitButtonImage;
}
public Integer getBottomButtonType() {
return bottomButtonType;
}
public void setBottomButtonType(Integer bottomButtonType) {
this.bottomButtonType = bottomButtonType;
}
public String getBottomButtonContent() {
return bottomButtonContent;
}
public void setBottomButtonContent(String bottomButtonContent) {
this.bottomButtonContent = bottomButtonContent;
}
public String getBottomButtonImage() {
return bottomButtonImage;
}
public void setBottomButtonImage(String bottomButtonImage) {
this.bottomButtonImage = bottomButtonImage;
}
public Integer getPrivacyAgreement() {
return privacyAgreement;
}
public void setPrivacyAgreement(Integer privacyAgreement) {
this.privacyAgreement = privacyAgreement;
}
public Integer getSuccessEmail() {
return successEmail;
}
public void setSuccessEmail(Integer successEmail) {
this.successEmail = successEmail;
}
public Integer getJumpStyle() {
return jumpStyle;
}
public void setJumpStyle(Integer jumpStyle) {
this.jumpStyle = jumpStyle;
}
public Long getId() {
return id;
}
......
......@@ -43,6 +43,18 @@ public class AdvertisingBmOptionItem extends BaseEntity{
)
private Date updateTime;
/**
* 跳转链接
*/
private String jumpUrl;
public String getJumpUrl() {
return jumpUrl;
}
public void setJumpUrl(String jumpUrl) {
this.jumpUrl = jumpUrl;
}
public Long getOptionId() {
return optionId;
......
......@@ -72,6 +72,235 @@ public class AdvertisingCpa extends BaseEntity{
*/
private List<AdvertisingDetailFile> advertisingDetailFileList;
/**
* 介绍视频
*/
private String coverVideo;
/**
* 背景色
*/
private String bgColor;
/**
* 成功提示,1-无提示,2-自定义内容
*/
private Integer successToastType;
/**
* 成功提示,自定义内容
*/
private String successToastContent;
/**
* 表单提交按钮类型,1-自定义内容,2-按钮图片
*/
private Integer commitButtonType;
/**
* 表单提交按钮类型,自定义内容
*/
private String commitButtonContent;
/**
* 表单提交按钮类型,按钮图片
*/
private String commitButtonImage;
/**
* 吸底提交按钮类型,1-自定义内容,2-按钮图片
*/
private Integer bottomButtonType;
/**
* 吸底提交按钮类型,自定义内容
*/
private String bottomButtonContent;
/**
* 吸底提交按钮类型,按钮图片
*/
private String bottomButtonImage;
/**
* 隐私协议,1-无,2-显示并勾选,3-显示未勾选
*/
private Integer privacyAgreement;
/**
* 成功短信,1-不发送,2-发送固定模板
*/
private Integer successEmail;
/**
* 跳转类型,1-统一跳转,2-自定义跳转
*/
private Integer jumpStyle;
private Long createUser;
private Long updateUser;
private String headPicture;
private String coverVideoFileId;
private Integer fileConvertState;
private String coverVideoFileName;
public String getCoverVideoFileId() {
return coverVideoFileId;
}
public void setCoverVideoFileId(String coverVideoFileId) {
this.coverVideoFileId = coverVideoFileId;
}
public Integer getFileConvertState() {
return fileConvertState;
}
public void setFileConvertState(Integer fileConvertState) {
this.fileConvertState = fileConvertState;
}
public String getCoverVideoFileName() {
return coverVideoFileName;
}
public void setCoverVideoFileName(String coverVideoFileName) {
this.coverVideoFileName = coverVideoFileName;
}
public String getHeadPicture() {
return headPicture;
}
public void setHeadPicture(String headPicture) {
this.headPicture = headPicture;
}
public Long getCreateUser() {
return createUser;
}
public void setCreateUser(Long createUser) {
this.createUser = createUser;
}
public Long getUpdateUser() {
return updateUser;
}
public void setUpdateUser(Long updateUser) {
this.updateUser = updateUser;
}
public String getCoverVideo() {
return coverVideo;
}
public void setCoverVideo(String coverVideo) {
this.coverVideo = coverVideo;
}
public String getBgColor() {
return bgColor;
}
public void setBgColor(String bgColor) {
this.bgColor = bgColor;
}
public Integer getSuccessToastType() {
return successToastType;
}
public void setSuccessToastType(Integer successToastType) {
this.successToastType = successToastType;
}
public String getSuccessToastContent() {
return successToastContent;
}
public void setSuccessToastContent(String successToastContent) {
this.successToastContent = successToastContent;
}
public Integer getCommitButtonType() {
return commitButtonType;
}
public void setCommitButtonType(Integer commitButtonType) {
this.commitButtonType = commitButtonType;
}
public String getCommitButtonContent() {
return commitButtonContent;
}
public void setCommitButtonContent(String commitButtonContent) {
this.commitButtonContent = commitButtonContent;
}
public String getCommitButtonImage() {
return commitButtonImage;
}
public void setCommitButtonImage(String commitButtonImage) {
this.commitButtonImage = commitButtonImage;
}
public Integer getBottomButtonType() {
return bottomButtonType;
}
public void setBottomButtonType(Integer bottomButtonType) {
this.bottomButtonType = bottomButtonType;
}
public String getBottomButtonContent() {
return bottomButtonContent;
}
public void setBottomButtonContent(String bottomButtonContent) {
this.bottomButtonContent = bottomButtonContent;
}
public String getBottomButtonImage() {
return bottomButtonImage;
}
public void setBottomButtonImage(String bottomButtonImage) {
this.bottomButtonImage = bottomButtonImage;
}
public Integer getPrivacyAgreement() {
return privacyAgreement;
}
public void setPrivacyAgreement(Integer privacyAgreement) {
this.privacyAgreement = privacyAgreement;
}
public Integer getSuccessEmail() {
return successEmail;
}
public void setSuccessEmail(Integer successEmail) {
this.successEmail = successEmail;
}
public Integer getJumpStyle() {
return jumpStyle;
}
public void setJumpStyle(Integer jumpStyle) {
this.jumpStyle = jumpStyle;
}
public String getDetailName() {
return detailName;
}
......
......@@ -10,6 +10,7 @@ public enum AdDetailModeEnum {
IMG_TEXT("IMG_TEXT","图文介绍"),
AUDIO("AUDIO","音频试听"),
DEDICATED_LINK("DEDICATED_LINK","专链路"),
VIDEO("VIDEO","视频试看");
public final String code;
......
......@@ -1097,6 +1097,8 @@ public class AdvertisingSpaceFacadeImpl implements AdvertisingSpaceFacade {
throw new BookBizException(BookBizException.PARAM_IS_NULL, "参数有误!");
}
SessionUtil.getToken4Redis(token);
Long userId = (Long) SessionUtil.getVlaue(token, SessionUtil.USER_ID);
advertisingCpa.setUserId(userId);
Long cpaId = advertisingSpaceBiz.createCPAContent(advertisingCpa);
return new ResponseDto<>(cpaId);
}
......@@ -1108,6 +1110,8 @@ public class AdvertisingSpaceFacadeImpl implements AdvertisingSpaceFacade {
throw new BookBizException(BookBizException.PARAM_IS_NULL, "参数有误!");
}
SessionUtil.getToken4Redis(token);
Long userId = (Long) SessionUtil.getVlaue(token, SessionUtil.USER_ID);
advertisingCpa.setUserId(userId);
advertisingSpaceBiz.updateCPAContent(advertisingCpa);
return new ResponseDto<>();
}
......
......@@ -11,18 +11,19 @@
<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="jump_url" property="jumpUrl" jdbcType="VARCHAR" />
</resultMap>
<sql id="Base_Column_List" >
id, option_id, parent_id, text, img_url, create_user, create_time, update_user, update_time
id, option_id, parent_id, text, img_url, create_user, create_time, update_user, update_time,jump_url
</sql>
<insert id="insert" parameterType="com.pcloud.book.advertising.entity.AdvertisingBmOptionItem" useGeneratedKeys="true" keyProperty="id">
insert into advertising_bm_option_item (option_id, parent_id,
text, img_url, create_user, create_time
text, img_url, create_user, create_time,jump_url
)
values (#{optionId,jdbcType=BIGINT}, #{parentId,jdbcType=BIGINT},
#{text,jdbcType=VARCHAR}, #{imgUrl,jdbcType=VARCHAR}, #{createUser,jdbcType=BIGINT}, NOW()
#{text,jdbcType=VARCHAR}, #{imgUrl,jdbcType=VARCHAR}, #{createUser,jdbcType=BIGINT}, NOW(),#{jumpUrl}
)
</insert>
......
......@@ -15,6 +15,25 @@
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
<result column="detail_info" property="detailInfo" jdbcType="LONGVARCHAR" />
<result column="preview_link" property="previewLink" jdbcType="VARCHAR" />
<result column="cover_video" property="coverVideo" jdbcType="VARCHAR" />
<result column="bg_color" property="bgColor" jdbcType="VARCHAR" />
<result column="success_toast_type" property="successToastType" jdbcType="INTEGER" />
<result column="success_toast_content" property="successToastContent" jdbcType="VARCHAR" />
<result column="commit_button_type" property="commitButtonType" jdbcType="INTEGER" />
<result column="commit_button_content" property="commitButtonContent" jdbcType="VARCHAR" />
<result column="commit_button_image" property="commitButtonImage" jdbcType="VARCHAR" />
<result column="bottom_button_type" property="bottomButtonType" jdbcType="INTEGER" />
<result column="bottom_button_content" property="bottomButtonContent" jdbcType="VARCHAR" />
<result column="bottom_button_image" property="bottomButtonImage" jdbcType="VARCHAR" />
<result column="privacy_agreement" property="privacyAgreement" jdbcType="INTEGER" />
<result column="success_email" property="successEmail" jdbcType="INTEGER" />
<result column="jump_style" property="jumpStyle" jdbcType="INTEGER" />
<result column="create_user" property="createUser" jdbcType="BIGINT" />
<result column="update_user" property="updateUser" jdbcType="BIGINT" />
<result column="head_picture" property="headPicture" jdbcType="VARCHAR" />
<result column="cover_video_file_id" property="coverVideoFileId" jdbcType="VARCHAR" />
<result column="file_convert_state" property="fileConvertState" jdbcType="INTEGER" />
<result column="cover_video_file_name" property="coverVideoFileName" jdbcType="VARCHAR" />
</resultMap>
<resultMap id="AdvertisingCpaDTO" type="com.pcloud.book.advertising.dto.AdvertisingCpaDTO">
......@@ -30,11 +49,33 @@
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP"/>
<result column="detail_info" property="detailInfo" jdbcType="LONGVARCHAR"/>
<result column="preview_link" property="previewLink" jdbcType="VARCHAR" />
<result column="cover_video" property="coverVideo" jdbcType="VARCHAR" />
<result column="bg_color" property="bgColor" jdbcType="VARCHAR" />
<result column="success_toast_type" property="successToastType" jdbcType="INTEGER" />
<result column="success_toast_content" property="successToastContent" jdbcType="VARCHAR" />
<result column="commit_button_type" property="commitButtonType" jdbcType="INTEGER" />
<result column="commit_button_content" property="commitButtonContent" jdbcType="VARCHAR" />
<result column="commit_button_image" property="commitButtonImage" jdbcType="VARCHAR" />
<result column="bottom_button_type" property="bottomButtonType" jdbcType="INTEGER" />
<result column="bottom_button_content" property="bottomButtonContent" jdbcType="VARCHAR" />
<result column="bottom_button_image" property="bottomButtonImage" jdbcType="VARCHAR" />
<result column="privacy_agreement" property="privacyAgreement" jdbcType="INTEGER" />
<result column="success_email" property="successEmail" jdbcType="INTEGER" />
<result column="jump_style" property="jumpStyle" jdbcType="INTEGER" />
<result column="create_user" property="createUser" jdbcType="BIGINT" />
<result column="update_user" property="updateUser" jdbcType="BIGINT" />
<result column="head_picture" property="headPicture" jdbcType="VARCHAR" />
<result column="cover_video_file_id" property="coverVideoFileId" jdbcType="VARCHAR" />
<result column="file_convert_state" property="fileConvertState" jdbcType="INTEGER" />
<result column="cover_video_file_name" property="coverVideoFileName" 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
,cover_video,bg_color,success_toast_type,success_toast_content,commit_button_type,commit_button_content
,commit_button_image,bottom_button_type,bottom_button_content,bottom_button_image,privacy_agreement,success_email,jump_style,create_user,update_user
,head_picture,cover_video_file_id,file_convert_state,cover_video_file_name
</sql>
<select id="getById" resultMap="BaseResultMap" parameterType="java.lang.Long" >
......@@ -53,11 +94,17 @@
cover_pic, welfare_pic, form_mobile_check,
form_remark, form_button, form_link,
create_time, update_time, detail_info, preview_link
,cover_video,bg_color,success_toast_type,success_toast_content,commit_button_type,commit_button_content
,commit_button_image,bottom_button_type,bottom_button_content,bottom_button_image,privacy_agreement,success_email,jump_style
,create_user,update_user,head_picture,cover_video_file_id,file_convert_state,cover_video_file_name
)
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}
,#{coverVideo},#{bgColor},#{successToastType},#{successToastContent},#{commitButtonType},#{commitButtonContent},#{commitButtonImage}
,#{bottomButtonType},#{bottomButtonContent},#{bottomButtonImage},#{privacyAgreement},#{successEmail},#{jumpStyle},#{createUser},#{updateUser},#{headPicture}
,#{coverVideoFileId},#{fileConvertState},#{coverVideoFileName}
)
</insert>
......@@ -95,6 +142,63 @@
<if test="previewLink != null">
preview_link = #{previewLink,jdbcType=VARCHAR},
</if>
<if test="coverVideo != null">
cover_video = #{coverVideo,jdbcType=VARCHAR},
</if>
<if test="bgColor != null">
bg_color = #{bgColor},
</if>
<if test="successToastType != null">
success_toast_type = #{successToastType},
</if>
<if test="successToastContent != null">
success_toast_content = #{successToastContent},
</if>
<if test="commitButtonType != null">
commit_button_type = #{commitButtonType},
</if>
<if test="commitButtonContent != null">
commit_button_content = #{commitButtonContent},
</if>
<if test="commitButtonImage != null">
commit_button_image = #{commitButtonImage},
</if>
<if test="bottomButtonType != null">
bottom_button_type = #{bottomButtonType},
</if>
<if test="bottomButtonContent != null">
bottom_button_content = #{bottomButtonContent},
</if>
<if test="bottomButtonImage != null">
bottom_button_image = #{bottomButtonImage},
</if>
<if test="privacyAgreement != null">
privacy_agreement = #{privacyAgreement},
</if>
<if test="successEmail != null">
success_email = #{successEmail},
</if>
<if test="jumpStyle != null">
jump_style = #{jumpStyle},
</if>
<if test="createUser != null">
create_user = #{createUser},
</if>
<if test="updateUser != null">
update_user = #{updateUser},
</if>
<if test="headPicture != null">
head_picture = #{headPicture},
</if>
<if test="coverVideoFileId != null">
cover_video_file_id = #{coverVideoFileId},
</if>
<if test="fileConvertState != null">
file_convert_state = #{fileConvertState},
</if>
<if test="coverVideoFileName != null">
cover_video_file_name = #{coverVideoFileName},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
......@@ -125,4 +229,15 @@
AND detail_mode IS NOT NULL
</select>
<update id="updateVideo" parameterType="com.pcloud.book.advertising.entity.AdvertisingCpa" >
update advertising_cpa
set
cover_video = #{coverVideo,jdbcType=VARCHAR},
cover_video_file_id = #{coverVideoFileId},
file_convert_state = #{fileConvertState},
cover_video_file_name = #{coverVideoFileName},
update_time=now()
where id = #{id,jdbcType=BIGINT}
</update>
</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