Commit a9e36b1a by 宋祥

Merge branch 'zhuyajie' into 'master'

广告详情支持修改

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