Commit 041425fb by 朱亚洁

广告详情支持修改

parent ac8ea8c3
...@@ -360,17 +360,22 @@ public class AdvertisingSpaceBizImpl implements AdvertisingSpaceBiz { ...@@ -360,17 +360,22 @@ public class AdvertisingSpaceBizImpl implements AdvertisingSpaceBiz {
Map<String, Object> paramMap = new HashMap<>(); Map<String, Object> paramMap = new HashMap<>();
paramMap.put("adId", advertisingSpace.getId()); paramMap.put("adId", advertisingSpace.getId());
Integer bookNum = (Integer) advertisingDistributionBookDao.getBy(paramMap, "countByAdId"); Integer bookNum = (Integer) advertisingDistributionBookDao.getBy(paramMap, "countByAdId");
// 已投放 //CPA方式
if (null != bookNum && bookNum > 0) { Boolean isCPA = false;
if (SettlementMethodEnum.CPA.code.equals(advertisingSpace.getSettlementMethod())) {
isCPA = true;
}
// 已投放,不是cpa模式
if (null != bookNum && bookNum > 0 && !isCPA) {
throw new BookBizException(BookBizException.PARAM_IS_ERROR, "已投放书刊的广告位不能修改!"); throw new BookBizException(BookBizException.PARAM_IS_ERROR, "已投放书刊的广告位不能修改!");
} }
//CPA方式 //CPA方式
if (SettlementMethodEnum.CPA.code.equals(advertisingSpace.getSettlementMethod())) { if (isCPA) {
advertisingSpace = equipCPA(advertisingSpace); advertisingSpace = equipCPA(advertisingSpace);
} }
advertisingSpaceDao.update(advertisingSpace); advertisingSpaceDao.update(advertisingSpace);
//报名表单选项新增 //报名表单选项新增
if (SettlementMethodEnum.CPA.code.equals(advertisingSpace.getSettlementMethod())) { if (isCPA) {
bmBiz.addOptionList(advertisingSpace.getAdvertisingBmOptionList(), advertisingSpace.getId()); bmBiz.addOptionList(advertisingSpace.getAdvertisingBmOptionList(), advertisingSpace.getId());
} else {//删除可能有的报名信息 } else {//删除可能有的报名信息
bmBiz.deleteByAdId(advertisingSpace.getId()); bmBiz.deleteByAdId(advertisingSpace.getId());
...@@ -626,6 +631,9 @@ public class AdvertisingSpaceBizImpl implements AdvertisingSpaceBiz { ...@@ -626,6 +631,9 @@ public class AdvertisingSpaceBizImpl implements AdvertisingSpaceBiz {
adLink = advertisingSpace.getAdLink() + "?book_group_id=" + classifyDTO.getBookGroupId() + "&classify_id=" + group.getClassifyId() adLink = advertisingSpace.getAdLink() + "?book_group_id=" + classifyDTO.getBookGroupId() + "&classify_id=" + group.getClassifyId()
+ "&qrcode_id=" + group.getQrcodeId() + "&ad_id=" + advertisingSpace.getId(); + "&qrcode_id=" + group.getQrcodeId() + "&ad_id=" + advertisingSpace.getId();
} }
if (null != methodDTO) {
adLink = adLink + "&settlement_method=" + methodDTO.getSettlementMethod();
}
} }
sendArticleMessageVO.setLinkUrl(adLink); sendArticleMessageVO.setLinkUrl(adLink);
sendArticleMessageVO.setPicUrl(advertisingSpace.getAdPic()); sendArticleMessageVO.setPicUrl(advertisingSpace.getAdPic());
...@@ -1078,13 +1086,12 @@ public class AdvertisingSpaceBizImpl implements AdvertisingSpaceBiz { ...@@ -1078,13 +1086,12 @@ public class AdvertisingSpaceBizImpl implements AdvertisingSpaceBiz {
* 获取书刊广告位点击读者量(废弃,读者不走授权,读者信息全为空,没办法聚合,点击量就是读者量) * 获取书刊广告位点击读者量(废弃,读者不走授权,读者信息全为空,没办法聚合,点击量就是读者量)
*/ */
private Long getClickUserNumByGroupQrcodeId(Long qrcodeId, Long adId, String statisMonth) { private Long getClickUserNumByGroupQrcodeId(Long qrcodeId, Long adId, String statisMonth) {
/*Map<String, Object> paramMap = new HashMap<>(); Map<String, Object> paramMap = new HashMap<>();
paramMap.put("qrcodeId", qrcodeId); paramMap.put("qrcodeId", qrcodeId);
paramMap.put("adId", adId); paramMap.put("adId", adId);
paramMap.put("statisMonth", statisMonth); paramMap.put("statisMonth", statisMonth);
Long clickUserNum = (Long) advertisingClickRecordDao.getBy(paramMap, "getClickUserNumByGroupQrcodeId"); Long clickUserNum = (Long) advertisingClickRecordDao.getBy(paramMap, "getClickUserNumByGroupQrcodeId");
return null == clickUserNum ? 0L : clickUserNum;*/ return null == clickUserNum ? 0L : clickUserNum;
return 0L;
} }
/** /**
......
...@@ -138,7 +138,6 @@ public class BmBizImpl implements BmBiz { ...@@ -138,7 +138,6 @@ public class BmBizImpl implements BmBiz {
return; return;
} }
List<Long> optionIds = bmOptionDao.getOptionIdsByAdId(adId); List<Long> optionIds = bmOptionDao.getOptionIdsByAdId(adId);
List<Long> deleteOptionIds =new ArrayList<>();
for (AdvertisingBmOption bmOption : advertisingBmOptionList) { for (AdvertisingBmOption bmOption : advertisingBmOptionList) {
bmOption.setAdId(adId); bmOption.setAdId(adId);
if (!ListUtils.isEmpty(optionIds) && null != bmOption.getId()) {//修改选项 if (!ListUtils.isEmpty(optionIds) && null != bmOption.getId()) {//修改选项
...@@ -194,30 +193,12 @@ public class BmBizImpl implements BmBiz { ...@@ -194,30 +193,12 @@ public class BmBizImpl implements BmBiz {
AdvertisingBmOptionItem item = itemList.get(i); AdvertisingBmOptionItem item = itemList.get(i);
item.setOptionId(optionId); item.setOptionId(optionId);
item.setCreateUser(partyId); item.setCreateUser(partyId);
item.setParentId(parentId);
String text = item.getText(); String text = item.getText();
if (text != null && !text.trim().equals("")) { if (!StringUtil.isEmpty(text)) {
String txt = text.replace("#", ""); item.setText(text);
// 二级
if (text.indexOf("##") > -1) {
item.setParentId(parentId);
item.setText(txt);
bmOptionItemDao.insert(item);
}
// 一级
else if (text.indexOf("#") > -1) {
item.setParentId(0L);
item.setText(txt);
bmOptionItemDao.insert(item);
parentId = item.getId();
} else {
item.setParentId(0L);
item.setText(txt);
bmOptionItemDao.insert(item);
}
} else {
item.setParentId(0L);
bmOptionItemDao.insert(item);
} }
bmOptionItemDao.insert(item);
} }
} }
} }
......
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