Commit d84bcc7e by 朱亚洁

1001653品牌方登录

parent 451823fa
...@@ -39,4 +39,9 @@ public interface AdvertisingSpaceService { ...@@ -39,4 +39,9 @@ public interface AdvertisingSpaceService {
@ApiImplicitParam(name = "userId", value = "用户登录id", dataType = "long", required = true, paramType = "query") @ApiImplicitParam(name = "userId", value = "用户登录id", dataType = "long", required = true, paramType = "query")
@GetMapping("getTagWxGroupIdsByUserId") @GetMapping("getTagWxGroupIdsByUserId")
ResponseEntity<ResponseDto<List<String>>> getTagWxGroupIdsByUserId(@RequestParam("userId") Long userId); ResponseEntity<ResponseDto<List<String>>> getTagWxGroupIdsByUserId(@RequestParam("userId") Long userId);
@ApiOperation(value = "查微信群标记的品牌方id", httpMethod = "GET")
@ApiImplicitParam(name = "wxGroupId", value = "微信群id", dataType = "string", required = true, paramType = "query")
@GetMapping("getBrandIdsByWxGroupId")
ResponseEntity<ResponseDto<List<Long>>> getBrandIdsByWxGroupId(@RequestParam("wxGroupId") String wxGroupId);
} }
package com.pcloud.book.advertising.biz; package com.pcloud.book.advertising.biz;
import com.pcloud.book.advertising.dto.AdvertisingMasterDTO; import com.pcloud.book.advertising.dto.AdvertisingBrandDTO;
import com.pcloud.book.advertising.dto.Book4AdvertisingMasterDTO; import com.pcloud.book.advertising.dto.Book4AdvertisingTagDTO;
import com.pcloud.book.advertising.dto.GroupMasterAddDTO; import com.pcloud.book.advertising.dto.GroupTagAddDTO;
import com.pcloud.book.advertising.dto.GroupMasterDTO; import com.pcloud.book.advertising.dto.GroupTagDTO;
import com.pcloud.book.advertising.entity.AdvertisingBrand;
import com.pcloud.common.exceptions.BizException; import com.pcloud.common.exceptions.BizException;
import com.pcloud.common.page.PageBean;
import com.pcloud.common.page.PageBeanNew; import com.pcloud.common.page.PageBeanNew;
import java.util.List; import java.util.List;
...@@ -16,65 +18,65 @@ import java.util.Map; ...@@ -16,65 +18,65 @@ import java.util.Map;
* @创建时间:18:47 2019/8/22 * @创建时间:18:47 2019/8/22
* @版本:1.0 * @版本:1.0
*/ */
public interface GroupMasterTagBiz { public interface GroupTagBiz {
/** /**
* 微信群广告主标记列表 * 微信群品牌标记列表
* @param currentPage * @param currentPage
* @param numPerPage * @param numPerPage
* @param paramMap * @param paramMap
* @return * @return
*/ */
PageBeanNew<GroupMasterDTO> listPageGroupMaster(Integer currentPage, Integer numPerPage, Map<String, Object> paramMap); PageBeanNew<GroupTagDTO> listPageGroup4Brand(Integer currentPage, Integer numPerPage, Map<String, Object> paramMap);
/** /**
* 获取品牌方广告主 * 获取品牌方
* @return * @return
* @throws BizException * @throws BizException
*/ */
List<AdvertisingMasterDTO> getBrandMaster() throws BizException; List<AdvertisingBrandDTO> getAllBrand() throws BizException;
/** /**
* 微信群标记广告主 * 微信群标记品牌方
* @param groupMasterAddDTO * @param groupTagAddDTO
*/ */
void setGroupMaster(GroupMasterAddDTO groupMasterAddDTO); void setGroupBrand(GroupTagAddDTO groupTagAddDTO);
/** /**
* 广告主标记-图书列表 * 品牌标记-图书列表
* @param currentPage * @param currentPage
* @param numPerPage * @param numPerPage
* @param name * @param name
* @return * @return
*/ */
PageBeanNew<Book4AdvertisingMasterDTO> listPageBook4AdMaster(Integer currentPage, Integer numPerPage, String name); PageBeanNew<Book4AdvertisingTagDTO> listPageBook4AdBrand(Integer currentPage, Integer numPerPage, String name);
/** /**
* 品牌方广告主-微信群列表 * 品牌方-微信群列表
* @param userId * @param userId
* @param currentPage * @param currentPage
* @param numPerPage * @param numPerPage
* @param paramMap * @param paramMap
* @return * @return
*/ */
PageBeanNew<GroupMasterDTO> listPageGroupList4Master(Long userId, Integer currentPage, Integer numPerPage, Map<String, Object> paramMap); PageBeanNew<GroupTagDTO> listPageGroupList4Brand(Long userId, Integer currentPage, Integer numPerPage, Map<String, Object> paramMap);
/** /**
* 微信群广告主标记列表-导出 * 微信群品牌方标记列表-导出
* @param name * @param name
* @param proLabelId * @param proLabelId
* @param depLabelId * @param depLabelId
* @param purLabelId * @param purLabelId
* @param masterId * @param brandId
*/ */
void exportGroupMaster(String name, Long proLabelId, Long depLabelId, Long purLabelId, Long masterId, Long partyId); void exportGroupBrand(String name, Long proLabelId, Long depLabelId, Long purLabelId, Long brandId, Long partyId);
/** /**
* 品牌方广告主-微信群导出 * 品牌方-微信群导出
* @param partyId * @param userId
* @param paramMap * @param paramMap
*/ */
void exportGroupList4Master(Long partyId, Map<String, Object> paramMap, Long userId); Map<String,Object> exportGroupList4Brand(Map<String, Object> paramMap, Long userId);
/** /**
* 根据登录用户获取标记的微信群列表 * 根据登录用户获取标记的微信群列表
...@@ -84,28 +86,21 @@ public interface GroupMasterTagBiz { ...@@ -84,28 +86,21 @@ public interface GroupMasterTagBiz {
List<String> getTagWxGroupIdsByUserId(Long userId); List<String> getTagWxGroupIdsByUserId(Long userId);
/** /**
* 品牌方广告主-微信群基本信息列表 * 品牌方-微信群基本信息列表
* @param currentPage * @param currentPage
* @param numPerPage * @param numPerPage
* @param name * @param name
* @param userId * @param userId
* @return * @return
*/ */
PageBeanNew<GroupMasterDTO> listPageGroupBaseInfo4Master(Integer currentPage, Integer numPerPage, String name, Long userId); PageBeanNew<GroupTagDTO> listPageGroupBaseInfo4Brand(Integer currentPage, Integer numPerPage, String name, Long userId);
/** /**
* 修改广告主的登录id * 品牌方已标记的书刊id
* @param masterId * @param brandId
* @param loginId
*/
void updateMasterLoginId(Long masterId, Long loginId);
/**
* 广告主已标记的书刊id
* @param masterId
* @return * @return
*/ */
List<Long> getTagBookIds4AdMatser(Long masterId); List<Long> getTagBookIds4AdBrand(Long brandId);
/** /**
* 已标记的书标记新的群 * 已标记的书标记新的群
...@@ -113,4 +108,63 @@ public interface GroupMasterTagBiz { ...@@ -113,4 +108,63 @@ public interface GroupMasterTagBiz {
* @param qrcodeId * @param qrcodeId
*/ */
public void addTagByBookGroup(Long classifyId, Long qrcodeId); public void addTagByBookGroup(Long classifyId, Long qrcodeId);
/**
* 创建品牌方账号
* @param advertisingBrand
* @return
*/
Long createBrand(AdvertisingBrand advertisingBrand);
/**
* 根据id查品牌方信息(明文密码)
* @param brandId
* @return
*/
AdvertisingBrandDTO getBrandById(Long brandId);
/**
* 修改品牌方密码
* @param advertisingBrand
*/
void updateBrandPassword(AdvertisingBrand advertisingBrand);
/**
* 根据id删除品牌方
* @param brandId
*/
void deleteBrandById(Long brandId);
/**
* 分页查询品牌方
* @param currentPage
* @param numPerPage
* @param name
* @return
*/
PageBean listPageBrand(Integer currentPage, Integer numPerPage, String name);
/**
* 品牌方登录
* @param advertisingBrandDTO
* @return
*/
Map<String,Object> brandLogin(AdvertisingBrandDTO advertisingBrandDTO);
/**
* 查微信群标记的品牌方id
* @param wxGroupId
* @return
*/
List<Long> getBrandIdsByWxGroupId(String wxGroupId);
/**
* 品牌方旧数据处理
*/
void dealOldBrandStatistic();
/**
* 获取品牌方登录信息
* @param userId
* @return
*/
Map<String,Object> getBrandLoginInfo(Long userId);
} }
...@@ -12,7 +12,6 @@ import com.pcloud.book.advertising.dao.AdvertisingClickRecordDao; ...@@ -12,7 +12,6 @@ import com.pcloud.book.advertising.dao.AdvertisingClickRecordDao;
import com.pcloud.book.advertising.dao.AdvertisingDetailFileDao; import com.pcloud.book.advertising.dao.AdvertisingDetailFileDao;
import com.pcloud.book.advertising.dao.AdvertisingDistributionBookDao; import com.pcloud.book.advertising.dao.AdvertisingDistributionBookDao;
import com.pcloud.book.advertising.dao.AdvertisingExposureRecordDao; import com.pcloud.book.advertising.dao.AdvertisingExposureRecordDao;
import com.pcloud.book.advertising.dao.AdvertisingGroupTagDao;
import com.pcloud.book.advertising.dao.AdvertisingIncomeDailyDao; import com.pcloud.book.advertising.dao.AdvertisingIncomeDailyDao;
import com.pcloud.book.advertising.dao.AdvertisingMasterDao; import com.pcloud.book.advertising.dao.AdvertisingMasterDao;
import com.pcloud.book.advertising.dao.AdvertisingPilotRecordDao; import com.pcloud.book.advertising.dao.AdvertisingPilotRecordDao;
...@@ -59,7 +58,6 @@ import com.pcloud.book.consumer.resource.ProductConsr; ...@@ -59,7 +58,6 @@ import com.pcloud.book.consumer.resource.ProductConsr;
import com.pcloud.book.consumer.user.AdviserConsr; import com.pcloud.book.consumer.user.AdviserConsr;
import com.pcloud.book.consumer.user.AgentConsr; import com.pcloud.book.consumer.user.AgentConsr;
import com.pcloud.book.consumer.user.ChannelConsr; 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.consumer.wechatgroup.WechatGroupConsr;
import com.pcloud.book.group.biz.WeixinQrcodeBiz; import com.pcloud.book.group.biz.WeixinQrcodeBiz;
import com.pcloud.book.group.dao.BookGroupClassifyDao; import com.pcloud.book.group.dao.BookGroupClassifyDao;
...@@ -96,7 +94,6 @@ import com.pcloud.facade.quartz.entity.ScheduleJob; ...@@ -96,7 +94,6 @@ import com.pcloud.facade.quartz.entity.ScheduleJob;
import com.pcloud.facade.quartz.service.ScheduleService; import com.pcloud.facade.quartz.service.ScheduleService;
import com.pcloud.readercenter.wechat.entity.WechatUser; import com.pcloud.readercenter.wechat.entity.WechatUser;
import com.pcloud.resourcecenter.product.service.ProductService; import com.pcloud.resourcecenter.product.service.ProductService;
import com.pcloud.usercenter.user.entity.UserLogin;
import com.pcloud.wechatgroup.message.dto.GroupChatCountDTO; import com.pcloud.wechatgroup.message.dto.GroupChatCountDTO;
import com.sdk.wxgroup.SendArticleMessageVO; import com.sdk.wxgroup.SendArticleMessageVO;
import com.sdk.wxgroup.SendPicMessageVO; import com.sdk.wxgroup.SendPicMessageVO;
...@@ -222,10 +219,6 @@ public class AdvertisingSpaceBizImpl implements AdvertisingSpaceBiz { ...@@ -222,10 +219,6 @@ public class AdvertisingSpaceBizImpl implements AdvertisingSpaceBiz {
private ConvertConsr convertConsr; private ConvertConsr convertConsr;
@Autowired @Autowired
private AdvertisingDetailFileDao detailFileDao; private AdvertisingDetailFileDao detailFileDao;
@Autowired
private PartyConsr partyConsr;
@Autowired
private AdvertisingGroupTagDao advertisingGroupTagDao;
private static final String ADVERTISING_PUT_PLAN_SCHEDULE_PRE = "ADVERTISING_PUT_PALN_"; private static final String ADVERTISING_PUT_PLAN_SCHEDULE_PRE = "ADVERTISING_PUT_PALN_";
...@@ -2321,18 +2314,6 @@ public class AdvertisingSpaceBizImpl implements AdvertisingSpaceBiz { ...@@ -2321,18 +2314,6 @@ public class AdvertisingSpaceBizImpl implements AdvertisingSpaceBiz {
if (null != nameExist && nameExist) { if (null != nameExist && nameExist) {
throw new BookBizException(BookBizException.PARAM_IS_ERROR, "广告主已存在!"); throw new BookBizException(BookBizException.PARAM_IS_ERROR, "广告主已存在!");
} }
//包含品牌方结算方式
List<String> methods = advertisingMaster.getSettlementMethodList().stream().filter(s -> s.getSettlementMethod() != null).map(AdvertisingSettlementMethod::getSettlementMethod).collect(Collectors.toList());
if (methods.contains(SettlementMethodEnum.Brand.code)) {
/*if (StringUtil.isEmpty(advertisingMaster.getLoginName())) {
throw new BookBizException(BookBizException.PARAM_IS_ERROR, "登录名为空!");
} else {
Long loginUserId = partyConsr.addLoginAccount(advertisingMaster.getLoginName(), advertisingMaster.getPassword());
advertisingMaster.setLoginId(loginUserId);
}*/
//创建子账号,通过更新数据库与广告主关联,登录账号不在这里创建,返回默认的loginUserId
advertisingMaster.setLoginId(123l);
}
advertisingMasterDao.insert(advertisingMaster); advertisingMasterDao.insert(advertisingMaster);
Long masterId = advertisingMaster.getId(); Long masterId = advertisingMaster.getId();
advertisingMaster.getSettlementMethodList().forEach(method -> method.setMasterId(masterId)); advertisingMaster.getSettlementMethodList().forEach(method -> method.setMasterId(masterId));
...@@ -2366,30 +2347,6 @@ public class AdvertisingSpaceBizImpl implements AdvertisingSpaceBiz { ...@@ -2366,30 +2347,6 @@ public class AdvertisingSpaceBizImpl implements AdvertisingSpaceBiz {
if (null == master) { if (null == master) {
throw new BookBizException(BookBizException.PARAM_IS_ERROR, "广告主不存在!"); throw new BookBizException(BookBizException.PARAM_IS_ERROR, "广告主不存在!");
} }
//包含品牌方结算方式
List<String> methods = advertisingMaster.getSettlementMethodList().stream().filter(s -> s.getSettlementMethod() != null).map(AdvertisingSettlementMethod::getSettlementMethod).collect(Collectors.toList());
if (methods.contains(SettlementMethodEnum.Brand.code)) {
Long loginId = master.getLoginId();
/*if (StringUtil.isEmpty(advertisingMaster.getLoginName()) || StringUtil.isEmpty(advertisingMaster.getPassword())) {
throw new BookBizException(BookBizException.PARAM_IS_ERROR, "登录名或密码为空!");
}
if (null == loginId) {//新增账号
loginId = partyConsr.addLoginAccount(advertisingMaster.getLoginName(), advertisingMaster.getPassword());
advertisingMaster.setLoginId(loginId);
} else {//修改账号
partyConsr.updateLoginAccount(advertisingMaster.getLoginName(), advertisingMaster.getPassword(), loginId);
}*/
//账号修改通过子账号完成
// if (null == loginId) {
// LOGGER.error("广告主" + masterId + "是品牌方结算,子账号为空");
// }
} else {
if (null != master.getLoginId()) {//删除账号,标记记录
partyConsr.deleteLoginAccount(master.getLoginId());
advertisingMaster.setLoginId(123l);
advertisingGroupTagDao.deleteByMasterId(masterId);
}
}
advertisingMasterDao.update(advertisingMaster); advertisingMasterDao.update(advertisingMaster);
// 删除广告主之前配置的结算方式 // 删除广告主之前配置的结算方式
advertisingSettlementMethodDao.deleteByMasterId(masterId); advertisingSettlementMethodDao.deleteByMasterId(masterId);
...@@ -2439,15 +2396,6 @@ public class AdvertisingSpaceBizImpl implements AdvertisingSpaceBiz { ...@@ -2439,15 +2396,6 @@ public class AdvertisingSpaceBizImpl implements AdvertisingSpaceBiz {
new BigDecimal(pilotFinishUserNum.doubleValue() / clickUserNum).setScale(4, BigDecimal.ROUND_HALF_UP); new BigDecimal(pilotFinishUserNum.doubleValue() / clickUserNum).setScale(4, BigDecimal.ROUND_HALF_UP);
masterDTO.setPilotFinishUserNum(pilotFinishUserNum); masterDTO.setPilotFinishUserNum(pilotFinishUserNum);
masterDTO.setPilotFinishRate(pilotFinishRate); masterDTO.setPilotFinishRate(pilotFinishRate);
//广告主登录名
AdvertisingMaster master = advertisingMasterDao.getById(masterDTO.getId());
if (null != master && null != master.getLoginId()) {
UserLogin userLogin = partyConsr.getUserLoginInfo(master.getLoginId());
if (null != userLogin) {
masterDTO.setLoginName(userLogin.getUserName());
masterDTO.setPassword(userLogin.getCurrentPassword());
}
}
} }
return pageBean; return pageBean;
} }
......
...@@ -2,20 +2,23 @@ package com.pcloud.book.advertising.biz.impl; ...@@ -2,20 +2,23 @@ package com.pcloud.book.advertising.biz.impl;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.pcloud.book.advertising.biz.AdvertisingSpaceBiz; import com.pcloud.book.advertising.biz.AdvertisingSpaceBiz;
import com.pcloud.book.advertising.biz.GroupMasterTagBiz; import com.pcloud.book.advertising.biz.GroupTagBiz;
import com.pcloud.book.advertising.dao.AdvertisingBrandDao;
import com.pcloud.book.advertising.dao.AdvertisingGroupTagDao; import com.pcloud.book.advertising.dao.AdvertisingGroupTagDao;
import com.pcloud.book.advertising.dao.AdvertisingMasterDao; import com.pcloud.book.advertising.dao.AdvertisingMasterDao;
import com.pcloud.book.advertising.dto.AdvertisingMasterDTO; import com.pcloud.book.advertising.dto.AdvertisingBrandDTO;
import com.pcloud.book.advertising.dto.Book4AdvertisingMasterDTO; import com.pcloud.book.advertising.dto.Book4AdvertisingTagDTO;
import com.pcloud.book.advertising.dto.GroupMasterAddDTO; import com.pcloud.book.advertising.dto.GroupTagAddDTO;
import com.pcloud.book.advertising.dto.GroupMasterDTO; import com.pcloud.book.advertising.dto.GroupTagDTO;
import com.pcloud.book.advertising.dto.OldBrandMasterDTO;
import com.pcloud.book.advertising.dto.QrcodeAdvertisingSpaceCountDTO; import com.pcloud.book.advertising.dto.QrcodeAdvertisingSpaceCountDTO;
import com.pcloud.book.advertising.entity.AdvertisingBrand;
import com.pcloud.book.advertising.entity.AdvertisingGroupTag; import com.pcloud.book.advertising.entity.AdvertisingGroupTag;
import com.pcloud.book.advertising.entity.AdvertisingMaster;
import com.pcloud.book.base.exception.BookBizException; import com.pcloud.book.base.exception.BookBizException;
import com.pcloud.book.consumer.common.ExportConsr; import com.pcloud.book.consumer.common.ExportConsr;
import com.pcloud.book.consumer.label.LabelConsr; import com.pcloud.book.consumer.label.LabelConsr;
import com.pcloud.book.consumer.user.AdviserConsr; import com.pcloud.book.consumer.user.AdviserConsr;
import com.pcloud.book.consumer.user.PartyConsr;
import com.pcloud.book.consumer.wechatgroup.WechatGroupConsr; import com.pcloud.book.consumer.wechatgroup.WechatGroupConsr;
import com.pcloud.book.group.biz.BookGroupClassifyBiz; import com.pcloud.book.group.biz.BookGroupClassifyBiz;
import com.pcloud.book.group.dao.BookGroupDao; import com.pcloud.book.group.dao.BookGroupDao;
...@@ -27,13 +30,16 @@ import com.pcloud.common.core.dto.SendNotifyDto; ...@@ -27,13 +30,16 @@ import com.pcloud.common.core.dto.SendNotifyDto;
import com.pcloud.common.core.enums.NotifyOriginTypeEnum; import com.pcloud.common.core.enums.NotifyOriginTypeEnum;
import com.pcloud.common.entity.UploadResultInfo; import com.pcloud.common.entity.UploadResultInfo;
import com.pcloud.common.exceptions.BizException; import com.pcloud.common.exceptions.BizException;
import com.pcloud.common.page.PageBean;
import com.pcloud.common.page.PageBeanNew; import com.pcloud.common.page.PageBeanNew;
import com.pcloud.common.page.PageParam; import com.pcloud.common.page.PageParam;
import com.pcloud.common.utils.DateUtils; import com.pcloud.common.utils.DateUtils;
import com.pcloud.common.utils.ListUtils; import com.pcloud.common.utils.ListUtils;
import com.pcloud.common.utils.SessionUtil;
import com.pcloud.common.utils.string.StringUtil; import com.pcloud.common.utils.string.StringUtil;
import com.pcloud.common.utils.zip.CompressUtils; import com.pcloud.common.utils.zip.CompressUtils;
import com.pcloud.usercenter.party.adviser.dto.AdviserBaseInfoDto; import com.pcloud.usercenter.party.adviser.dto.AdviserBaseInfoDto;
import com.pcloud.usercenter.user.entity.UserLogin;
import org.apache.commons.collections.MapUtils; import org.apache.commons.collections.MapUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -51,14 +57,14 @@ import java.util.stream.Collectors; ...@@ -51,14 +57,14 @@ import java.util.stream.Collectors;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
/** /**
* @描述:微信群标记广告主 * @描述:微信群标记品牌方
* @作者:zhuyajie * @作者:zhuyajie
* @创建时间:18:48 2019/8/22 * @创建时间:18:48 2019/8/22
* @版本:1.0 * @版本:1.0
*/ */
@Slf4j @Slf4j
@Component("groupMasterBiz") @Component("groupTagBiz")
public class GroupMasterTagBizImpl implements GroupMasterTagBiz { public class GroupTagBizImpl implements GroupTagBiz {
private static final ExecutorService EXECUTOR_SINGLE_SERVICE = Executors.newSingleThreadExecutor(); private static final ExecutorService EXECUTOR_SINGLE_SERVICE = Executors.newSingleThreadExecutor();
@Autowired @Autowired
...@@ -72,8 +78,6 @@ public class GroupMasterTagBizImpl implements GroupMasterTagBiz { ...@@ -72,8 +78,6 @@ public class GroupMasterTagBizImpl implements GroupMasterTagBiz {
@Autowired @Autowired
private LabelConsr labelConsr; private LabelConsr labelConsr;
@Autowired @Autowired
private AdvertisingMasterDao advertisingMasterDao;
@Autowired
private AdvertisingGroupTagDao advertisingGroupTagDao; private AdvertisingGroupTagDao advertisingGroupTagDao;
@Autowired @Autowired
private BookGroupDao bookGroupDao; private BookGroupDao bookGroupDao;
...@@ -83,29 +87,35 @@ public class GroupMasterTagBizImpl implements GroupMasterTagBiz { ...@@ -83,29 +87,35 @@ public class GroupMasterTagBizImpl implements GroupMasterTagBiz {
private MessageBiz messageBiz; private MessageBiz messageBiz;
@Autowired @Autowired
private BookGroupClassifyBiz bookGroupClassifyBiz; private BookGroupClassifyBiz bookGroupClassifyBiz;
@Autowired
private AdvertisingBrandDao advertisingBrandDao;
@Autowired
private AdvertisingMasterDao advertisingMasterDao;
@Autowired
private PartyConsr partyConsr;
@Override @Override
public PageBeanNew<GroupMasterDTO> listPageGroupMaster(Integer currentPage, Integer numPerPage, Map<String, Object> paramMap) { public PageBeanNew<GroupTagDTO> listPageGroup4Brand(Integer currentPage, Integer numPerPage, Map<String, Object> paramMap) {
PageBeanNew<GroupMasterDTO> pageBeanNew = groupQrcodeDao.listPageNew(new PageParam(currentPage, numPerPage), paramMap, "listPageGroupMaster"); PageBeanNew<GroupTagDTO> pageBeanNew = groupQrcodeDao.listPageNew(new PageParam(currentPage, numPerPage), paramMap, "listPageGroup4Brand");
if (null == pageBeanNew || ListUtils.isEmpty(pageBeanNew.getRecordList())) { if (null == pageBeanNew || ListUtils.isEmpty(pageBeanNew.getRecordList())) {
return new PageBeanNew<>(currentPage, numPerPage, 0, new ArrayList<>()); return new PageBeanNew<>(currentPage, numPerPage, 0, new ArrayList<>());
} }
List<GroupMasterDTO> groupMasterDTOS = pageBeanNew.getRecordList(); List<GroupTagDTO> groupTagDTOS = pageBeanNew.getRecordList();
setGroupInfo(groupMasterDTOS); setGroupInfo(groupTagDTOS);
return pageBeanNew; return pageBeanNew;
} }
/** /**
* 填充群信息 * 填充群信息
* @param groupMasterDTOS * @param groupTagDTOS
*/ */
private void setGroupInfo(List<GroupMasterDTO> groupMasterDTOS) { private void setGroupInfo(List<GroupTagDTO> groupTagDTOS) {
List<Long> adviserIds = groupMasterDTOS.stream().filter(s -> s.getAdviserId() != null).map(GroupMasterDTO::getAdviserId).distinct().collect(Collectors.toList()); List<Long> adviserIds = groupTagDTOS.stream().filter(s -> s.getAdviserId() != null).map(GroupTagDTO::getAdviserId).distinct().collect(Collectors.toList());
List<Long> qrcodeIds = groupMasterDTOS.stream().filter(s -> s.getGroupQrcodeId() != null).map(GroupMasterDTO::getGroupQrcodeId).distinct().collect(Collectors.toList()); List<Long> qrcodeIds = groupTagDTOS.stream().filter(s -> s.getGroupQrcodeId() != null).map(GroupTagDTO::getGroupQrcodeId).distinct().collect(Collectors.toList());
List<Long> labelIds = new ArrayList<>(); List<Long> labelIds = new ArrayList<>();
List<Long> proLabels = groupMasterDTOS.stream().filter(s -> s.getProLabelId() != null).map(GroupMasterDTO::getProLabelId).distinct().collect(Collectors.toList()); List<Long> proLabels = groupTagDTOS.stream().filter(s -> s.getProLabelId() != null).map(GroupTagDTO::getProLabelId).distinct().collect(Collectors.toList());
List<Long> depLabels = groupMasterDTOS.stream().filter(s -> s.getDepLabelId() != null).map(GroupMasterDTO::getDepLabelId).distinct().collect(Collectors.toList()); List<Long> depLabels = groupTagDTOS.stream().filter(s -> s.getDepLabelId() != null).map(GroupTagDTO::getDepLabelId).distinct().collect(Collectors.toList());
List<Long> purLabels = groupMasterDTOS.stream().filter(s -> s.getPurLabelId() != null).map(GroupMasterDTO::getPurLabelId).distinct().collect(Collectors.toList()); List<Long> purLabels = groupTagDTOS.stream().filter(s -> s.getPurLabelId() != null).map(GroupTagDTO::getPurLabelId).distinct().collect(Collectors.toList());
if (!ListUtils.isEmpty(proLabels)) { if (!ListUtils.isEmpty(proLabels)) {
labelIds.addAll(proLabels); labelIds.addAll(proLabels);
} }
...@@ -131,72 +141,72 @@ public class GroupMasterTagBizImpl implements GroupMasterTagBiz { ...@@ -131,72 +141,72 @@ public class GroupMasterTagBizImpl implements GroupMasterTagBiz {
if (!ListUtils.isEmpty(labelIds)) { if (!ListUtils.isEmpty(labelIds)) {
labelMap = labelConsr.getLabelName(labelIds); labelMap = labelConsr.getLabelName(labelIds);
} }
for (GroupMasterDTO groupMasterDTO : groupMasterDTOS) { for (GroupTagDTO groupTagDTO : groupTagDTOS) {
//出版社信息 //出版社信息
if (!MapUtils.isEmpty(baseInfoDtoMap) && null != groupMasterDTO.getAdviserId()) { if (!MapUtils.isEmpty(baseInfoDtoMap) && null != groupTagDTO.getAdviserId()) {
AdviserBaseInfoDto adviserBaseInfoDto = baseInfoDtoMap.get(groupMasterDTO.getAdviserId()); AdviserBaseInfoDto adviserBaseInfoDto = baseInfoDtoMap.get(groupTagDTO.getAdviserId());
if (null != adviserBaseInfoDto) { if (null != adviserBaseInfoDto) {
groupMasterDTO.setAgentName(adviserBaseInfoDto.getAgentName()); groupTagDTO.setAgentName(adviserBaseInfoDto.getAgentName());
} }
} }
//编辑名称 //编辑名称
if (!MapUtils.isEmpty(adviserNameMap) && null != groupMasterDTO.getAdviserId()) { if (!MapUtils.isEmpty(adviserNameMap) && null != groupTagDTO.getAdviserId()) {
groupMasterDTO.setAdviserName(adviserNameMap.get(groupMasterDTO.getAdviserId())); groupTagDTO.setAdviserName(adviserNameMap.get(groupTagDTO.getAdviserId()));
} }
//获取广告位数量 //获取广告位数量
Integer spaceNum = 0; Integer spaceNum = 0;
if (!MapUtils.isEmpty(advertisingSpaceNumMap) && null != groupMasterDTO.getGroupQrcodeId()) { if (!MapUtils.isEmpty(advertisingSpaceNumMap) && null != groupTagDTO.getGroupQrcodeId()) {
QrcodeAdvertisingSpaceCountDTO dto = advertisingSpaceNumMap.get(groupMasterDTO.getGroupQrcodeId()); QrcodeAdvertisingSpaceCountDTO dto = advertisingSpaceNumMap.get(groupTagDTO.getGroupQrcodeId());
if (null != dto) { if (null != dto) {
spaceNum = dto.getAdvertisingSpaceNum(); spaceNum = dto.getAdvertisingSpaceNum();
} }
} }
groupMasterDTO.setAdvertisingSpaceNum(spaceNum); groupTagDTO.setAdvertisingSpaceNum(spaceNum);
//标签名称 //标签名称
if (!MapUtils.isEmpty(labelMap)) { if (!MapUtils.isEmpty(labelMap)) {
if (null != groupMasterDTO.getProLabelId() && labelMap.containsKey(groupMasterDTO.getProLabelId())) { if (null != groupTagDTO.getProLabelId() && labelMap.containsKey(groupTagDTO.getProLabelId())) {
groupMasterDTO.setProLabelName(labelMap.get(groupMasterDTO.getProLabelId())); groupTagDTO.setProLabelName(labelMap.get(groupTagDTO.getProLabelId()));
} }
if (null != groupMasterDTO.getDepLabelId() && labelMap.containsKey(groupMasterDTO.getDepLabelId())) { if (null != groupTagDTO.getDepLabelId() && labelMap.containsKey(groupTagDTO.getDepLabelId())) {
groupMasterDTO.setDepLabelName(labelMap.get(groupMasterDTO.getDepLabelId())); groupTagDTO.setDepLabelName(labelMap.get(groupTagDTO.getDepLabelId()));
} }
if (null != groupMasterDTO.getPurLabelId() && labelMap.containsKey(groupMasterDTO.getPurLabelId())) { if (null != groupTagDTO.getPurLabelId() && labelMap.containsKey(groupTagDTO.getPurLabelId())) {
groupMasterDTO.setPurLabelName(labelMap.get(groupMasterDTO.getPurLabelId())); groupTagDTO.setPurLabelName(labelMap.get(groupTagDTO.getPurLabelId()));
} }
} }
//群活跃度 //群活跃度
Integer activeCount = 0; Integer activeCount = 0;
if (!MapUtils.isEmpty(activeCountMap) && null != groupMasterDTO.getGroupQrcodeId()) { if (!MapUtils.isEmpty(activeCountMap) && null != groupTagDTO.getGroupQrcodeId()) {
activeCount = activeCountMap.get(groupMasterDTO.getGroupQrcodeId()); activeCount = activeCountMap.get(groupTagDTO.getGroupQrcodeId());
} }
groupMasterDTO.setActiveCount(activeCount); groupTagDTO.setActiveCount(activeCount);
//广告主名称 //品牌方名称
List<AdvertisingMaster> masterList = advertisingMasterDao.getByGroup(groupMasterDTO.getGroupQrcodeId()); List<AdvertisingBrandDTO> brandList = advertisingBrandDao.getByGroupQrcodeId(groupTagDTO.getGroupQrcodeId());
if (!ListUtils.isEmpty(masterList)) { if (!ListUtils.isEmpty(brandList)) {
groupMasterDTO.setMasterList(masterList); groupTagDTO.setBrandList(brandList);
} }
} }
} }
@Override @Override
public List<AdvertisingMasterDTO> getBrandMaster() throws BizException { public List<AdvertisingBrandDTO> getAllBrand() throws BizException {
List<AdvertisingMasterDTO> list = advertisingMasterDao.getBrandMaster(); List<AdvertisingBrandDTO> list = advertisingBrandDao.getAllBrand();
return list; return list;
} }
@Override @Override
public void setGroupMaster(GroupMasterAddDTO groupMasterAddDTO) { public void setGroupBrand(GroupTagAddDTO groupTagAddDTO) {
//多个微信群标记多个广告主 //多个微信群标记多个品牌方
if (!ListUtils.isEmpty(groupMasterAddDTO.getGroupQrcodeIdList())) { if (!ListUtils.isEmpty(groupTagAddDTO.getGroupQrcodeIdList())) {
for (Long groupQrcodeId : groupMasterAddDTO.getGroupQrcodeIdList()) { for (Long groupQrcodeId : groupTagAddDTO.getGroupQrcodeIdList()) {
advertisingGroupTagDao.deleteByGroupQrcodeId(groupQrcodeId); advertisingGroupTagDao.deleteByGroupQrcodeId(groupQrcodeId);
if (!ListUtils.isEmpty(groupMasterAddDTO.getMasterIdList())) { if (!ListUtils.isEmpty(groupTagAddDTO.getBrandIdList())) {
List<AdvertisingGroupTag> tagList = new ArrayList<>(); List<AdvertisingGroupTag> tagList = new ArrayList<>();
Long bookId = groupQrcodeDao.getBookIdByGroupQrcodeId(groupQrcodeId); Long bookId = groupQrcodeDao.getBookIdByGroupQrcodeId(groupQrcodeId);
for (Long masterId : groupMasterAddDTO.getMasterIdList()) { for (Long brandId : groupTagAddDTO.getBrandIdList()) {
AdvertisingGroupTag groupTag = new AdvertisingGroupTag(); AdvertisingGroupTag groupTag = new AdvertisingGroupTag();
groupTag.setGroupQrcodeId(groupQrcodeId); groupTag.setGroupQrcodeId(groupQrcodeId);
groupTag.setMasterId(masterId); groupTag.setBrandId(brandId);
groupTag.setTagBookId(bookId); groupTag.setTagBookId(bookId);
tagList.add(groupTag); tagList.add(groupTag);
} }
...@@ -205,25 +215,25 @@ public class GroupMasterTagBizImpl implements GroupMasterTagBiz { ...@@ -205,25 +215,25 @@ public class GroupMasterTagBizImpl implements GroupMasterTagBiz {
} }
return; return;
} }
//一个广告主标记多本书下的微信群 //一个品牌方标记多本书下的微信群
if (null != groupMasterAddDTO.getMasterId()) { if (null != groupTagAddDTO.getBrandId()) {
//已标记的 //已标记的
List<Long> beforeBookIds = advertisingGroupTagDao.getBookIdsByMasterId(groupMasterAddDTO.getMasterId()); List<Long> beforeBookIds = advertisingGroupTagDao.getBookIdsByBrandId(groupTagAddDTO.getBrandId());
if (!ListUtils.isEmpty(groupMasterAddDTO.getBookIdList())) { if (!ListUtils.isEmpty(groupTagAddDTO.getBookIdList())) {
List<Long> addIds = new ArrayList<>(); List<Long> addIds = new ArrayList<>();
List<Long> deleteIds = new ArrayList<>(); List<Long> deleteIds = new ArrayList<>();
if (ListUtils.isEmpty(beforeBookIds)) { if (ListUtils.isEmpty(beforeBookIds)) {
addIds.addAll(groupMasterAddDTO.getBookIdList()); addIds.addAll(groupTagAddDTO.getBookIdList());
} else { } else {
addIds.addAll(groupMasterAddDTO.getBookIdList()); addIds.addAll(groupTagAddDTO.getBookIdList());
addIds.removeAll(beforeBookIds); addIds.removeAll(beforeBookIds);
deleteIds.addAll(beforeBookIds); deleteIds.addAll(beforeBookIds);
deleteIds.removeAll(groupMasterAddDTO.getBookIdList()); deleteIds.removeAll(groupTagAddDTO.getBookIdList());
} }
this.addBookTag(addIds, groupMasterAddDTO.getMasterId()); this.addBookTag(addIds, groupTagAddDTO.getBrandId());
this.deleteBookTag(deleteIds, groupMasterAddDTO.getMasterId()); this.deleteBookTag(deleteIds, groupTagAddDTO.getBrandId());
} else { } else {
this.deleteBookTag(beforeBookIds, groupMasterAddDTO.getMasterId()); this.deleteBookTag(beforeBookIds, groupTagAddDTO.getBrandId());
} }
} }
} }
...@@ -231,7 +241,7 @@ public class GroupMasterTagBizImpl implements GroupMasterTagBiz { ...@@ -231,7 +241,7 @@ public class GroupMasterTagBizImpl implements GroupMasterTagBiz {
/** /**
* 添加图书标记 * 添加图书标记
*/ */
private void addBookTag(List<Long> bookIds, Long masterId) { private void addBookTag(List<Long> bookIds, Long brandId) {
if (ListUtils.isEmpty(bookIds)) { if (ListUtils.isEmpty(bookIds)) {
return; return;
} }
...@@ -239,14 +249,14 @@ public class GroupMasterTagBizImpl implements GroupMasterTagBiz { ...@@ -239,14 +249,14 @@ public class GroupMasterTagBizImpl implements GroupMasterTagBiz {
for (Long bookId : bookIds) { for (Long bookId : bookIds) {
AdvertisingGroupTag groupTag = new AdvertisingGroupTag(); AdvertisingGroupTag groupTag = new AdvertisingGroupTag();
groupTag.setTagBookId(bookId); groupTag.setTagBookId(bookId);
groupTag.setMasterId(masterId); groupTag.setBrandId(brandId);
groupTag.setGroupQrcodeId(0L); groupTag.setGroupQrcodeId(0L);
tagList.add(groupTag); tagList.add(groupTag);
} }
advertisingGroupTagDao.insert(tagList); advertisingGroupTagDao.insert(tagList);
//书下每个群添加记录 //书下每个群添加记录
EXECUTOR_SINGLE_SERVICE.execute(() -> { EXECUTOR_SINGLE_SERVICE.execute(() -> {
List<Long> beforeQrcodeIds = advertisingGroupTagDao.getGroupQrcodeIdsByMasterId(masterId); List<Long> beforeQrcodeIds = advertisingGroupTagDao.getGroupQrcodeIdsByBrandId(brandId);
for (Long bookId : bookIds) { for (Long bookId : bookIds) {
List<AdvertisingGroupTag> addList = new ArrayList<>(); List<AdvertisingGroupTag> addList = new ArrayList<>();
List<Long> qrcodeIds = groupQrcodeDao.getIdsByBookId(bookId); List<Long> qrcodeIds = groupQrcodeDao.getIdsByBookId(bookId);
...@@ -263,7 +273,7 @@ public class GroupMasterTagBizImpl implements GroupMasterTagBiz { ...@@ -263,7 +273,7 @@ public class GroupMasterTagBizImpl implements GroupMasterTagBiz {
AdvertisingGroupTag tag = new AdvertisingGroupTag(); AdvertisingGroupTag tag = new AdvertisingGroupTag();
tag.setGroupQrcodeId(qrcodeId); tag.setGroupQrcodeId(qrcodeId);
tag.setTagBookId(bookId); tag.setTagBookId(bookId);
tag.setMasterId(masterId); tag.setBrandId(brandId);
addList.add(tag); addList.add(tag);
} }
advertisingGroupTagDao.insert(addList); advertisingGroupTagDao.insert(addList);
...@@ -274,22 +284,22 @@ public class GroupMasterTagBizImpl implements GroupMasterTagBiz { ...@@ -274,22 +284,22 @@ public class GroupMasterTagBizImpl implements GroupMasterTagBiz {
/** /**
* 删除图书标记 * 删除图书标记
*/ */
private void deleteBookTag(List<Long> bookIds, Long masterId) { private void deleteBookTag(List<Long> bookIds, Long brandId) {
if (ListUtils.isEmpty(bookIds)) { if (ListUtils.isEmpty(bookIds)) {
return; return;
} }
advertisingGroupTagDao.deleteByBook(bookIds, masterId); advertisingGroupTagDao.deleteByBook(bookIds, brandId);
} }
@Override @Override
public PageBeanNew<Book4AdvertisingMasterDTO> listPageBook4AdMaster(Integer currentPage, Integer numPerPage, String name) { public PageBeanNew<Book4AdvertisingTagDTO> listPageBook4AdBrand(Integer currentPage, Integer numPerPage, String name) {
Map<String, Object> paramMap = new HashMap<>(); Map<String, Object> paramMap = new HashMap<>();
paramMap.put("name", StringUtil.isEmpty(name) ? null : name); paramMap.put("name", StringUtil.isEmpty(name) ? null : name);
PageBeanNew<Book4AdvertisingMasterDTO> pageBeanNew = bookGroupDao.listPageNew(new PageParam(currentPage, numPerPage), paramMap, "listPageBook4AdMaster"); PageBeanNew<Book4AdvertisingTagDTO> pageBeanNew = bookGroupDao.listPageNew(new PageParam(currentPage, numPerPage), paramMap, "listPageBook4AdBrand");
if (null == pageBeanNew || ListUtils.isEmpty(pageBeanNew.getRecordList())) { if (null == pageBeanNew || ListUtils.isEmpty(pageBeanNew.getRecordList())) {
return new PageBeanNew<>(currentPage, numPerPage, 0, new ArrayList<>()); return new PageBeanNew<>(currentPage, numPerPage, 0, new ArrayList<>());
} }
for (Book4AdvertisingMasterDTO dto : pageBeanNew.getRecordList()) { for (Book4AdvertisingTagDTO dto : pageBeanNew.getRecordList()) {
Map<String, Object> map = groupQrcodeDao.getGroupCountUserCountByBookId(dto.getBookId()); Map<String, Object> map = groupQrcodeDao.getGroupCountUserCountByBookId(dto.getBookId());
Integer groupCount = 0; Integer groupCount = 0;
Integer userNum = 0; Integer userNum = 0;
...@@ -304,30 +314,31 @@ public class GroupMasterTagBizImpl implements GroupMasterTagBiz { ...@@ -304,30 +314,31 @@ public class GroupMasterTagBizImpl implements GroupMasterTagBiz {
} }
@Override @Override
public PageBeanNew<GroupMasterDTO> listPageGroupList4Master(Long userId, Integer currentPage, Integer numPerPage, Map<String, Object> paramMap) { public PageBeanNew<GroupTagDTO> listPageGroupList4Brand(Long userId, Integer currentPage, Integer numPerPage, Map<String, Object> paramMap) {
Long masterId = advertisingMasterDao.getIdByUserLoginId(userId); Long brandId = advertisingBrandDao.getBrandIdByUserLoginId(userId);
if (null == masterId) { AdvertisingBrandDTO brand = advertisingBrandDao.getBrandById(brandId);
throw new BookBizException(BookBizException.ERROR, "广告主不存在"); if (null == brand) {
} throw new BookBizException(BookBizException.ERROR, "品牌方不存在");
paramMap.put("masterId", masterId); }
PageBeanNew<GroupMasterDTO> pageBeanNew = groupQrcodeDao.listPageNew(new PageParam(currentPage, numPerPage), paramMap, "listPageGroupMaster"); paramMap.put("brandId", brandId);
PageBeanNew<GroupTagDTO> pageBeanNew = groupQrcodeDao.listPageNew(new PageParam(currentPage, numPerPage), paramMap, "listPageGroup4Brand");
if (null == pageBeanNew || ListUtils.isEmpty(pageBeanNew.getRecordList())) { if (null == pageBeanNew || ListUtils.isEmpty(pageBeanNew.getRecordList())) {
return new PageBeanNew<>(currentPage, numPerPage, 0, new ArrayList<>()); return new PageBeanNew<>(currentPage, numPerPage, 0, new ArrayList<>());
} }
List<GroupMasterDTO> groupMasterDTOS = pageBeanNew.getRecordList(); List<GroupTagDTO> groupTagDTOS = pageBeanNew.getRecordList();
setLabelName(groupMasterDTOS); setLabelName(groupTagDTOS);
return pageBeanNew; return pageBeanNew;
} }
/** /**
* 填充标签名称 * 填充标签名称
* @param groupMasterDTOS * @param groupTagDTOS
*/ */
private void setLabelName(List<GroupMasterDTO> groupMasterDTOS) { private void setLabelName(List<GroupTagDTO> groupTagDTOS) {
List<Long> labelIds = new ArrayList<>(); List<Long> labelIds = new ArrayList<>();
List<Long> proLabels = groupMasterDTOS.stream().filter(s -> s.getProLabelId() != null).map(GroupMasterDTO::getProLabelId).distinct().collect(Collectors.toList()); List<Long> proLabels = groupTagDTOS.stream().filter(s -> s.getProLabelId() != null).map(GroupTagDTO::getProLabelId).distinct().collect(Collectors.toList());
List<Long> depLabels = groupMasterDTOS.stream().filter(s -> s.getDepLabelId() != null).map(GroupMasterDTO::getDepLabelId).distinct().collect(Collectors.toList()); List<Long> depLabels = groupTagDTOS.stream().filter(s -> s.getDepLabelId() != null).map(GroupTagDTO::getDepLabelId).distinct().collect(Collectors.toList());
List<Long> purLabels = groupMasterDTOS.stream().filter(s -> s.getPurLabelId() != null).map(GroupMasterDTO::getPurLabelId).distinct().collect(Collectors.toList()); List<Long> purLabels = groupTagDTOS.stream().filter(s -> s.getPurLabelId() != null).map(GroupTagDTO::getPurLabelId).distinct().collect(Collectors.toList());
if (!ListUtils.isEmpty(proLabels)) { if (!ListUtils.isEmpty(proLabels)) {
labelIds.addAll(proLabels); labelIds.addAll(proLabels);
} }
...@@ -341,31 +352,31 @@ public class GroupMasterTagBizImpl implements GroupMasterTagBiz { ...@@ -341,31 +352,31 @@ public class GroupMasterTagBizImpl implements GroupMasterTagBiz {
if (!ListUtils.isEmpty(labelIds)) { if (!ListUtils.isEmpty(labelIds)) {
labelMap = labelConsr.getLabelName(labelIds); labelMap = labelConsr.getLabelName(labelIds);
} }
for (GroupMasterDTO groupMasterDTO : groupMasterDTOS) { for (GroupTagDTO groupTagDTO : groupTagDTOS) {
//标签名称 //标签名称
if (!MapUtils.isEmpty(labelMap)) { if (!MapUtils.isEmpty(labelMap)) {
if (null != groupMasterDTO.getProLabelId() && labelMap.containsKey(groupMasterDTO.getProLabelId())) { if (null != groupTagDTO.getProLabelId() && labelMap.containsKey(groupTagDTO.getProLabelId())) {
groupMasterDTO.setProLabelName(labelMap.get(groupMasterDTO.getProLabelId())); groupTagDTO.setProLabelName(labelMap.get(groupTagDTO.getProLabelId()));
} }
if (null != groupMasterDTO.getDepLabelId() && labelMap.containsKey(groupMasterDTO.getDepLabelId())) { if (null != groupTagDTO.getDepLabelId() && labelMap.containsKey(groupTagDTO.getDepLabelId())) {
groupMasterDTO.setDepLabelName(labelMap.get(groupMasterDTO.getDepLabelId())); groupTagDTO.setDepLabelName(labelMap.get(groupTagDTO.getDepLabelId()));
} }
if (null != groupMasterDTO.getPurLabelId() && labelMap.containsKey(groupMasterDTO.getPurLabelId())) { if (null != groupTagDTO.getPurLabelId() && labelMap.containsKey(groupTagDTO.getPurLabelId())) {
groupMasterDTO.setPurLabelName(labelMap.get(groupMasterDTO.getPurLabelId())); groupTagDTO.setPurLabelName(labelMap.get(groupTagDTO.getPurLabelId()));
} }
} }
} }
} }
@Override @Override
public void exportGroupMaster(String name, Long proLabelId, Long depLabelId, Long purLabelId, Long masterId, Long partyId) { public void exportGroupBrand(String name, Long proLabelId, Long depLabelId, Long purLabelId, Long brandId, Long partyId) {
Map<String, Object> paramMap = new HashMap<>(); Map<String, Object> paramMap = new HashMap<>();
paramMap.put("name", StringUtil.isEmpty(name) ? null : name); paramMap.put("name", StringUtil.isEmpty(name) ? null : name);
paramMap.put("proLabelId", proLabelId); paramMap.put("proLabelId", proLabelId);
paramMap.put("depLabelId", depLabelId); paramMap.put("depLabelId", depLabelId);
paramMap.put("purLabelId", purLabelId); paramMap.put("purLabelId", purLabelId);
paramMap.put("masterId", masterId); paramMap.put("brandId", brandId);
List<GroupMasterDTO> list = groupQrcodeDao.listPageGroupMaster(paramMap); List<GroupTagDTO> list = groupQrcodeDao.listPageGroup4Brand(paramMap);
if (ListUtils.isEmpty(list)) { if (ListUtils.isEmpty(list)) {
return; return;
} }
...@@ -375,7 +386,7 @@ public class GroupMasterTagBizImpl implements GroupMasterTagBiz { ...@@ -375,7 +386,7 @@ public class GroupMasterTagBizImpl implements GroupMasterTagBiz {
String fileUrl = ""; String fileUrl = "";
try { try {
setGroupInfo(list); setGroupInfo(list);
fileUrl = exportGroupMastefile(list, fileName); fileUrl = exportGroupBrandfile(list, fileName);
} catch (Exception e) { } catch (Exception e) {
log.error("生成导出文件失败" + e.getMessage(), e); log.error("生成导出文件失败" + e.getMessage(), e);
isSuccess = false; isSuccess = false;
...@@ -388,64 +399,59 @@ public class GroupMasterTagBizImpl implements GroupMasterTagBiz { ...@@ -388,64 +399,59 @@ public class GroupMasterTagBizImpl implements GroupMasterTagBiz {
} }
@Override @Override
public void exportGroupList4Master(Long partyId, Map<String, Object> paramMap, Long userId) { public Map<String,Object> exportGroupList4Brand(Map<String, Object> paramMap, Long userId) {
Long masterId = advertisingMasterDao.getIdByUserLoginId(userId); Long brandId = advertisingBrandDao.getBrandIdByUserLoginId(userId);
if (null == masterId) { AdvertisingBrandDTO brand = advertisingBrandDao.getBrandById(brandId);
throw new BookBizException(BookBizException.ERROR, "广告主不存在"); if (null == brand) {
} throw new BookBizException(BookBizException.ERROR, "品牌方不存在");
paramMap.put("masterId", masterId); }
List<GroupMasterDTO> list = groupQrcodeDao.listPageGroupMaster(paramMap); paramMap.put("brandId", brandId);
List<GroupTagDTO> list = groupQrcodeDao.listPageGroup4Brand(paramMap);
if (ListUtils.isEmpty(list)) { if (ListUtils.isEmpty(list)) {
return; return new HashMap<>();
} }
EXECUTOR_SINGLE_SERVICE.execute(() -> { Map<String, Object> map = new HashMap<>();
String fileName = "微信群二维码导出_" + DateUtils.getShortDateStr(); String fileName = "微信群二维码导出_" + DateUtils.getShortDateStr();
Boolean isSuccess = true; String fileUrl = "";
String fileUrl = ""; try {
try { //导出二维码
// setLabelName(list); Map<String, List<String[]>> zipFileMap = new HashMap<>();
// fileUrl = exportGroupList4Master(list, fileName); List<String[]> qrcodePicUrls = new ArrayList<String[]>();
//导出二维码 Integer noName = 0;
Map<String, List<String[]>> zipFileMap = new HashMap<>(); for (GroupTagDTO tagDTO : list) {
List<String[]> qrcodePicUrls = new ArrayList<String[]>(); String qrcodeUrl = tagDTO.getQrcodeUrl() == null ? null : tagDTO.getQrcodeUrl().replace("oss.5rs.me", "file.5rs.me");
Integer noName = 0; String qrcodeName;//二维码命名
for (GroupMasterDTO masterDTO : list) { if (!StringUtil.isEmpty(tagDTO.getGroupName())) {
String qrcodeUrl = masterDTO.getQrcodeUrl() == null ? null : masterDTO.getQrcodeUrl().replace("oss.5rs.me", "file.5rs.me"); qrcodeName = tagDTO.getGroupName();
String qrcodeName;//二维码命名 } else {
if (!StringUtil.isEmpty(masterDTO.getGroupName())) { noName = noName + 1;
qrcodeName = masterDTO.getGroupName(); qrcodeName = "未命名" + noName;
} else {
noName = noName + 1;
qrcodeName = "未命名" + noName;
}
String[] qrcodePicurl = {qrcodeName, qrcodeUrl};
qrcodePicUrls.add(qrcodePicurl);
} }
zipFileMap.put(fileName, qrcodePicUrls); String[] qrcodePicurl = {qrcodeName, qrcodeUrl};
UploadResultInfo zipUrlInfo = CompressUtils.zipByCatalog(zipFileMap, fileName); qrcodePicUrls.add(qrcodePicurl);
fileUrl = zipUrlInfo != null ? zipUrlInfo.getUrl() : null;
} catch (Exception e) {
log.error("生成导出文件失败" + e.getMessage(), e);
isSuccess = false;
}
// 发送消息
if (isSuccess) {
sendNotify(partyId, fileUrl, fileName);
} }
}); zipFileMap.put(fileName, qrcodePicUrls);
UploadResultInfo zipUrlInfo = CompressUtils.zipByCatalog(zipFileMap, fileName);
fileUrl = zipUrlInfo != null ? zipUrlInfo.getUrl() : null;
} catch (Exception e) {
log.error("导出文件失败" + e.getMessage(), e);
}
map.put("fileName", fileName);
map.put("fileUrl", fileUrl);
return map;
} }
/** /**
* 广告主分配微信群导出 * 品牌方分配微信群导出
*/ */
private String exportGroupMastefile(List<GroupMasterDTO> list, String fileName) { private String exportGroupBrandfile(List<GroupTagDTO> list, String fileName) {
// 字段名 // 字段名
String[] rowsName = {"序号", "群名称", "群分类名称", "社群标签(专业)", "社群标签(深度)", "社群标签(目的)", "社群书", "所属出版社", String[] rowsName = {"序号", "群名称", "群分类名称", "社群标签(专业)", "社群标签(深度)", "社群标签(目的)", "社群书", "所属出版社",
"创建编辑", "近7天活跃度", "当前群人数", "广告位数量", "群二维码", "标签", "群创建时间"}; "创建编辑", "近7天活跃度", "当前群人数", "广告位数量", "群二维码", "标签", "群创建时间"};
List<Object[]> dataList = new ArrayList<>(); List<Object[]> dataList = new ArrayList<>();
Object[] objs; Object[] objs;
for (int i = 0; i < list.size(); i++) { for (int i = 0; i < list.size(); i++) {
GroupMasterDTO dto = list.get(i); GroupTagDTO dto = list.get(i);
objs = new Object[rowsName.length]; objs = new Object[rowsName.length];
objs[0] = i + 1; objs[0] = i + 1;
objs[1] = dto.getGroupName(); objs[1] = dto.getGroupName();
...@@ -464,18 +470,18 @@ public class GroupMasterTagBizImpl implements GroupMasterTagBiz { ...@@ -464,18 +470,18 @@ public class GroupMasterTagBizImpl implements GroupMasterTagBiz {
qrcodeUrl = dto.getQrcodeUrl().replace("oss.5rs.me", "file.5rs.me"); qrcodeUrl = dto.getQrcodeUrl().replace("oss.5rs.me", "file.5rs.me");
} }
objs[12] = qrcodeUrl; objs[12] = qrcodeUrl;
String masterName = ""; String brandName = "";
List<AdvertisingMaster> masterList = dto.getMasterList(); List<AdvertisingBrandDTO> brandList = dto.getBrandList();
if (!ListUtils.isEmpty(masterList)) { if (!ListUtils.isEmpty(brandList)) {
for (AdvertisingMaster master : masterList) { for (AdvertisingBrandDTO brandDTO : brandList) {
if (StringUtil.isEmpty(masterName)) { if (StringUtil.isEmpty(brandName)) {
masterName = master.getMasterName(); brandName = brandDTO.getBrandName();
} else { } else {
masterName = masterName + "; " + master.getMasterName(); brandName = brandName + "; " + brandDTO.getBrandName();
} }
} }
} }
objs[13] = masterName; objs[13] = brandName;
objs[14] = DateUtils.formatDate(dto.getCreateTime(), DateUtils.DATE_FORMAT_DATEONLY); objs[14] = DateUtils.formatDate(dto.getCreateTime(), DateUtils.DATE_FORMAT_DATEONLY);
dataList.add(objs); dataList.add(objs);
} }
...@@ -483,16 +489,16 @@ public class GroupMasterTagBizImpl implements GroupMasterTagBiz { ...@@ -483,16 +489,16 @@ public class GroupMasterTagBizImpl implements GroupMasterTagBiz {
} }
/** /**
* 广告主-微信群导出 * 品牌方-微信群导出
*/ */
private String exportGroupList4Master(List<GroupMasterDTO> list, String fileName) { private String exportGroupList4Brand(List<GroupTagDTO> list, String fileName) {
// 字段名 // 字段名
String[] rowsName = {"序号", "群名称", "群分类名称", "社群书", "社群标签(专业)", "社群标签(深度)", "社群标签(目的)", String[] rowsName = {"序号", "群名称", "群分类名称", "社群书", "社群标签(专业)", "社群标签(深度)", "社群标签(目的)",
"当前群人数", "群二维码", "群创建时间", "分配时间"}; "当前群人数", "群二维码", "群创建时间", "分配时间"};
List<Object[]> dataList = new ArrayList<>(); List<Object[]> dataList = new ArrayList<>();
Object[] objs; Object[] objs;
for (int i = 0; i < list.size(); i++) { for (int i = 0; i < list.size(); i++) {
GroupMasterDTO dto = list.get(i); GroupTagDTO dto = list.get(i);
objs = new Object[rowsName.length]; objs = new Object[rowsName.length];
objs[0] = i + 1; objs[0] = i + 1;
objs[1] = dto.getGroupName(); objs[1] = dto.getGroupName();
...@@ -539,24 +545,26 @@ public class GroupMasterTagBizImpl implements GroupMasterTagBiz { ...@@ -539,24 +545,26 @@ public class GroupMasterTagBizImpl implements GroupMasterTagBiz {
} }
@Override @Override
public List<String> getTagWxGroupIdsByUserId(Long userId) { public List<String> getTagWxGroupIdsByUserId(Long userId) {
Long masterId = advertisingMasterDao.getIdByUserLoginId(userId); Long brandId = advertisingBrandDao.getBrandIdByUserLoginId(userId);
if (null == masterId) { AdvertisingBrandDTO brand = advertisingBrandDao.getBrandById(brandId);
if (null == brand) {
return new ArrayList<>(); return new ArrayList<>();
} }
List<String> groupIds = advertisingGroupTagDao.getTagWxGroupIdsByMasterId(masterId); List<String> groupIds = advertisingGroupTagDao.getTagWxGroupIdsByBrandId(brandId);
return groupIds; return groupIds;
} }
@Override @Override
public PageBeanNew<GroupMasterDTO> listPageGroupBaseInfo4Master(Integer currentPage, Integer numPerPage, String name, Long userId) { public PageBeanNew<GroupTagDTO> listPageGroupBaseInfo4Brand(Integer currentPage, Integer numPerPage, String name, Long userId) {
Long masterId = advertisingMasterDao.getIdByUserLoginId(userId); Long brandId = advertisingBrandDao.getBrandIdByUserLoginId(userId);
if (null == masterId) { AdvertisingBrandDTO brand = advertisingBrandDao.getBrandById(brandId);
throw new BookBizException(BookBizException.ERROR, "广告主不存在"); if (null == brand) {
throw new BookBizException(BookBizException.ERROR, "品牌方不存在");
} }
Map<String, Object> paramMap = new HashMap<>(); Map<String, Object> paramMap = new HashMap<>();
paramMap.put("query", name); paramMap.put("query", name);
paramMap.put("masterId", masterId); paramMap.put("brandId", brandId);
PageBeanNew<GroupMasterDTO> pageBeanNew = groupQrcodeDao.listPageNew(new PageParam(currentPage, numPerPage), paramMap, "listPageGroupMaster"); PageBeanNew<GroupTagDTO> pageBeanNew = groupQrcodeDao.listPageNew(new PageParam(currentPage, numPerPage), paramMap, "listPageGroup4Brand");
if (null == pageBeanNew || ListUtils.isEmpty(pageBeanNew.getRecordList())) { if (null == pageBeanNew || ListUtils.isEmpty(pageBeanNew.getRecordList())) {
return new PageBeanNew<>(currentPage, numPerPage, 0, new ArrayList<>()); return new PageBeanNew<>(currentPage, numPerPage, 0, new ArrayList<>());
} }
...@@ -564,13 +572,8 @@ public class GroupMasterTagBizImpl implements GroupMasterTagBiz { ...@@ -564,13 +572,8 @@ public class GroupMasterTagBizImpl implements GroupMasterTagBiz {
} }
@Override @Override
public void updateMasterLoginId(Long masterId, Long loginId) { public List<Long> getTagBookIds4AdBrand(Long brandId) {
advertisingMasterDao.updateMasterLoginId(masterId, loginId); List<Long> bookIds = advertisingGroupTagDao.getBookIdsByBrandId(brandId);
}
@Override
public List<Long> getTagBookIds4AdMatser(Long masterId) {
List<Long> bookIds = advertisingGroupTagDao.getBookIdsByMasterId(masterId);
return bookIds; return bookIds;
} }
...@@ -581,18 +584,128 @@ public class GroupMasterTagBizImpl implements GroupMasterTagBiz { ...@@ -581,18 +584,128 @@ public class GroupMasterTagBizImpl implements GroupMasterTagBiz {
return; return;
} }
Long bookId = classifyVO.getBookId(); Long bookId = classifyVO.getBookId();
List<Long> masterIds = advertisingGroupTagDao.getMasterIdsByBookId(bookId); List<Long> brandIds = advertisingGroupTagDao.getBrandIdsByBookId(bookId);
if (ListUtils.isEmpty(masterIds)) { if (ListUtils.isEmpty(brandIds)) {
return; return;
} }
List<AdvertisingGroupTag> list = new ArrayList<>(); List<AdvertisingGroupTag> list = new ArrayList<>();
for (Long masterId : masterIds) { for (Long brandId : brandIds) {
AdvertisingGroupTag tag = new AdvertisingGroupTag(); AdvertisingGroupTag tag = new AdvertisingGroupTag();
tag.setGroupQrcodeId(qrcodeId); tag.setGroupQrcodeId(qrcodeId);
tag.setTagBookId(bookId); tag.setTagBookId(bookId);
tag.setMasterId(masterId); tag.setBrandId(brandId);
list.add(tag); list.add(tag);
} }
advertisingGroupTagDao.insert(list); advertisingGroupTagDao.insert(list);
} }
@Override
public Long createBrand(AdvertisingBrand advertisingBrand) {
//用户名登录名是否重复
Boolean brandCheck = advertisingBrandDao.checkBrandNameRepeat(advertisingBrand.getBrandName());
if (brandCheck) {
throw new BookBizException(BookBizException.ERROR, "品牌方名称已存在");
}
Boolean loginNameCheck = advertisingBrandDao.checkLoginNameRepeat(advertisingBrand.getLoginName());
if (loginNameCheck) {
throw new BookBizException(BookBizException.ERROR, "登录名已存在");
}
advertisingBrand.setIsDelete(false);
advertisingBrandDao.insert(advertisingBrand);
return advertisingBrand.getId();
}
@Override
public AdvertisingBrandDTO getBrandById(Long brandId) {
AdvertisingBrandDTO dto = advertisingBrandDao.getBrandById(brandId);
return dto;
}
@Override
public void updateBrandPassword(AdvertisingBrand advertisingBrand) {
advertisingBrandDao.update(advertisingBrand);
}
@Override
public void deleteBrandById(Long brandId) {
advertisingBrandDao.deleteBrand(brandId);
//删除标记的微信群
advertisingGroupTagDao.deleteByBrandId(brandId);
}
@Override
public PageBean listPageBrand(Integer currentPage, Integer numPerPage, String name) {
Map<String, Object> paramMap = new HashMap<>();
paramMap.put("name", name);
PageBean pageBean = advertisingBrandDao.listPage(new PageParam(currentPage, numPerPage), paramMap, "listPageBrand");
return pageBean;
}
@Override
public Map<String, Object> brandLogin(AdvertisingBrandDTO advertisingBrandDTO) {
AdvertisingBrand brand = advertisingBrandDao.getLoginInfo(advertisingBrandDTO.getLoginName());
if (null == brand) {
throw new BookBizException(BookBizException.ERROR, "账号不存在");
}
if (brand.getIsDelete()) {
throw new BookBizException(BookBizException.ERROR, "账号已删除");
}
if (!advertisingBrandDTO.getPassword().equals(brand.getPassword())) {
throw new BookBizException(BookBizException.ERROR, "密码错误");
}
// 登录成功,将用户的相关信息保存至redis中
Map<String, Object> map = new HashMap<>();
map.put(SessionUtil.USER_ID, brand.getId());
map.put(SessionUtil.PARTY_ID, 0);
String token = SessionUtil.writeToken2Redis(map);
//返回登录信息
Map<String, Object> resultMap = new HashMap<>();
resultMap.put("token", token);
return resultMap;
}
@Override
public List<Long> getBrandIdsByWxGroupId(String wxGroupId) {
return advertisingGroupTagDao.getBrandIdsByWxGroupId(wxGroupId);
}
@Override
public void dealOldBrandStatistic() {
List<OldBrandMasterDTO> masterList = advertisingMasterDao.getMasterBrand();
if (ListUtils.isEmpty(masterList)) {
return;
}
for (OldBrandMasterDTO master : masterList) {
UserLogin userLogin = partyConsr.getUserLoginInfo(master.getLoginId());
if (null == userLogin) {
continue;
}
AdvertisingBrand brand = new AdvertisingBrand();
brand.setBrandName(master.getMasterName());
brand.setLoginName(userLogin.getUserName());
brand.setPassword(userLogin.getCurrentPassword());
brand.setIsDelete(false);
brand.setCreateUser(0l);
advertisingBrandDao.insert(brand);
Long brandId = brand.getId();
//更新广告主登录id为空
advertisingMasterDao.updateLoginId(master.getMasterName());
//更新标记列表的品牌id
Long masterId = master.getId();
advertisingGroupTagDao.updateId(masterId, brandId);
}
}
@Override
public Map<String, Object> getBrandLoginInfo(Long userId) {
Map<String, Object> map = new HashMap<>();
Long brandId = advertisingBrandDao.getBrandIdByUserLoginId(userId);
AdvertisingBrandDTO brandDTO = advertisingBrandDao.getBrandById(brandId);
if (null != brandDTO) {
map.put("brandName", brandDTO.getBrandName());
map.put("loginName", brandDTO.getLoginName());
}
return map;
}
} }
package com.pcloud.book.advertising.dao;
import com.pcloud.book.advertising.dto.AdvertisingBrandDTO;
import com.pcloud.book.advertising.entity.AdvertisingBrand;
import com.pcloud.common.core.dao.BaseDao;
import java.util.List;
/**
* @描述:广告品牌方
* @作者:zhuyajie
* @创建时间:15:25 2019/9/9
* @版本:1.0
*/
public interface AdvertisingBrandDao extends BaseDao<AdvertisingBrand> {
/**
* 根据群id查标记的品牌方
* @param groupQrcodeId
* @return
*/
List<AdvertisingBrandDTO> getByGroupQrcodeId(Long groupQrcodeId);
/**
* 所有品牌方列表
* @return
*/
List<AdvertisingBrandDTO> getAllBrand();
/**
* 根据登录id查品牌方id
* @param userId
* @return
*/
Long getBrandIdByUserLoginId(Long userId);
/**
* 删除品牌方(假删除)
* @param brandId
*/
void deleteBrand(Long brandId);
/**
* 根据id查询
* @param brandId
* @return
*/
AdvertisingBrandDTO getBrandById(Long brandId);
/**
* 品牌名称是否重复
* @param brandName
* @return
*/
Boolean checkBrandNameRepeat(String brandName);
/**
* 登录名是否重复
* @param loginName
* @return
*/
Boolean checkLoginNameRepeat(String loginName);
/**
* 查询登录信息
* @param loginName
* @return
*/
AdvertisingBrand getLoginInfo(String loginName);
}
...@@ -14,17 +14,17 @@ import java.util.List; ...@@ -14,17 +14,17 @@ import java.util.List;
public interface AdvertisingGroupTagDao extends BaseDao<AdvertisingGroupTag> { public interface AdvertisingGroupTagDao extends BaseDao<AdvertisingGroupTag> {
/** /**
* 根据广告主删除 * 根据品牌方删除
* @param masterId * @param brandId
*/ */
public void deleteByMasterId(Long masterId); public void deleteByBrandId(Long brandId);
/** /**
* 已标记的书 * 已标记的书
* @param masterId * @param brandId
* @return * @return
*/ */
public List<Long> getBookIdsByMasterId(Long masterId); public List<Long> getBookIdsByBrandId(Long brandId);
/** /**
* 根据群删除标记 * 根据群删除标记
...@@ -34,29 +34,43 @@ public interface AdvertisingGroupTagDao extends BaseDao<AdvertisingGroupTag> { ...@@ -34,29 +34,43 @@ public interface AdvertisingGroupTagDao extends BaseDao<AdvertisingGroupTag> {
/** /**
* 已标记的群 * 已标记的群
* @param masterId * @param brandId
* @return * @return
*/ */
public List<Long> getGroupQrcodeIdsByMasterId(Long masterId); public List<Long> getGroupQrcodeIdsByBrandId(Long brandId);
/** /**
* 根据图书删除标记 * 根据图书删除标记
* @param bookIds * @param bookIds
* @param masterId * @param brandId
*/ */
void deleteByBook(List<Long> bookIds, Long masterId); void deleteByBook(List<Long> bookIds, Long brandId);
/** /**
* 查已标记的微信群id * 查已标记的微信群id
* @param masterId * @param brandId
* @return * @return
*/ */
List<String> getTagWxGroupIdsByMasterId(Long masterId); List<String> getTagWxGroupIdsByBrandId(Long brandId);
/** /**
* 根据书查标记的广告主 * 根据书查标记的品牌方
* @param bookId * @param bookId
* @return * @return
*/ */
List<Long> getMasterIdsByBookId(Long bookId); List<Long> getBrandIdsByBookId(Long bookId);
/**
* 查微信群标记的品牌方id
* @param wxGroupId
* @return
*/
List<Long> getBrandIdsByWxGroupId(String wxGroupId);
/**
* 更新旧数据品牌id
* @param masterId
* @param brandId
*/
void updateId(Long masterId, Long brandId);
} }
package com.pcloud.book.advertising.dao; package com.pcloud.book.advertising.dao;
import com.pcloud.book.advertising.dto.AdvertisingMasterDTO; import com.pcloud.book.advertising.dto.AdvertisingMasterDTO;
import com.pcloud.book.advertising.dto.OldBrandMasterDTO;
import com.pcloud.book.advertising.entity.AdvertisingMaster; import com.pcloud.book.advertising.entity.AdvertisingMaster;
import com.pcloud.common.core.dao.BaseDao; import com.pcloud.common.core.dao.BaseDao;
...@@ -26,29 +27,14 @@ public interface AdvertisingMasterDao extends BaseDao<AdvertisingMaster> { ...@@ -26,29 +27,14 @@ public interface AdvertisingMasterDao extends BaseDao<AdvertisingMaster> {
AdvertisingMasterDTO getDTOById(Long masterId); AdvertisingMasterDTO getDTOById(Long masterId);
/** /**
* 查微信群标记的广告主 * 获取广告主品牌方
* @param groupQrcodeId
* @return * @return
*/ */
List<AdvertisingMaster> getByGroup(Long groupQrcodeId); public List<OldBrandMasterDTO> getMasterBrand();
/** /**
* 获取品牌方广告主 * 更新登录id为空
* @return * @param masterName
*/
List<AdvertisingMasterDTO> getBrandMaster();
/**
* 根据登录id查广告主id
* @param loginId
* @return
*/
public Long getIdByUserLoginId(Long loginId);
/**
* 修改广告主登录id
* @param masterId
* @param loginId
*/ */
public void updateMasterLoginId(Long masterId, Long loginId); public void updateLoginId(String masterName);
} }
package com.pcloud.book.advertising.dao.impl;
import com.pcloud.book.advertising.dao.AdvertisingBrandDao;
import com.pcloud.book.advertising.dto.AdvertisingBrandDTO;
import com.pcloud.book.advertising.entity.AdvertisingBrand;
import com.pcloud.common.core.dao.BaseDaoImpl;
import org.springframework.stereotype.Component;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @描述:广告品牌方
* @作者:zhuyajie
* @创建时间:15:26 2019/9/9
* @版本:1.0
*/
@Component("advertisingBrandDao")
public class AdvertisingBrandDaoImpl extends BaseDaoImpl<AdvertisingBrand> implements AdvertisingBrandDao{
@Override
public List<AdvertisingBrandDTO> getByGroupQrcodeId(Long groupQrcodeId) {
return getSessionTemplate().selectList(getStatement("getByGroupQrcodeId"), groupQrcodeId);
}
@Override
public List<AdvertisingBrandDTO> getAllBrand() {
return getSessionTemplate().selectList(getStatement("getAllBrand"));
}
@Override
public Long getBrandIdByUserLoginId(Long userId) {
//品牌方登录,userId=brandId
return userId;
}
@Override
public void deleteBrand(Long brandId) {
getSessionTemplate().update(getStatement("deleteBrand"), brandId);
}
@Override
public AdvertisingBrandDTO getBrandById(Long brandId) {
return getSessionTemplate().selectOne(getStatement("getBrandById"), brandId);
}
@Override
public Boolean checkBrandNameRepeat(String brandName) {
return getSessionTemplate().selectOne(getStatement("checkBrandNameRepeat"), brandName);
}
@Override
public Boolean checkLoginNameRepeat(String loginName) {
return getSessionTemplate().selectOne(getStatement("checkLoginNameRepeat"), loginName);
}
@Override
public AdvertisingBrand getLoginInfo(String loginName) {
Map<String, Object> map = new HashMap<>();
map.put("loginName", loginName);
return getSessionTemplate().selectOne(getStatement("getLoginInfo"), map);
}
}
...@@ -20,13 +20,13 @@ import java.util.Map; ...@@ -20,13 +20,13 @@ import java.util.Map;
public class AdvertisingGroupTagDaoImpl extends BaseDaoImpl<AdvertisingGroupTag> implements AdvertisingGroupTagDao { public class AdvertisingGroupTagDaoImpl extends BaseDaoImpl<AdvertisingGroupTag> implements AdvertisingGroupTagDao {
@Override @Override
public void deleteByMasterId(Long masterId) { public void deleteByBrandId(Long brandId) {
getSessionTemplate().delete(getStatement("deleteByMasterId"), masterId); getSessionTemplate().delete(getStatement("deleteByBrandId"), brandId);
} }
@Override @Override
public List<Long> getBookIdsByMasterId(Long masterId) { public List<Long> getBookIdsByBrandId(Long brandId) {
return getSessionTemplate().selectList(getStatement("getBookIdsByMasterId"), masterId); return getSessionTemplate().selectList(getStatement("getBookIdsByBrandId"), brandId);
} }
@Override @Override
...@@ -35,25 +35,38 @@ public class AdvertisingGroupTagDaoImpl extends BaseDaoImpl<AdvertisingGroupTag> ...@@ -35,25 +35,38 @@ public class AdvertisingGroupTagDaoImpl extends BaseDaoImpl<AdvertisingGroupTag>
} }
@Override @Override
public List<Long> getGroupQrcodeIdsByMasterId(Long masterId) { public List<Long> getGroupQrcodeIdsByBrandId(Long brandId) {
return getSessionTemplate().selectList(getStatement("getGroupQrcodeIdsByMasterId"), masterId); return getSessionTemplate().selectList(getStatement("getGroupQrcodeIdsByBrandId"), brandId);
} }
@Override @Override
public void deleteByBook(List<Long> bookIds, Long masterId) { public void deleteByBook(List<Long> bookIds, Long brandId) {
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
map.put("bookIds", bookIds); map.put("bookIds", bookIds);
map.put("masterId", masterId); map.put("brandId", brandId);
getSessionTemplate().delete(getStatement("deleteByBook"), map); getSessionTemplate().delete(getStatement("deleteByBook"), map);
} }
@Override @Override
public List<String> getTagWxGroupIdsByMasterId(Long masterId) { public List<String> getTagWxGroupIdsByBrandId(Long brandId) {
return getSessionTemplate().selectList(getStatement("getTagWxGroupIdsByMasterId"), masterId); return getSessionTemplate().selectList(getStatement("getTagWxGroupIdsByBrandId"), brandId);
} }
@Override @Override
public List<Long> getMasterIdsByBookId(Long bookId) { public List<Long> getBrandIdsByBookId(Long bookId) {
return getSessionTemplate().selectList(getStatement("getMasterIdsByBookId"), bookId); return getSessionTemplate().selectList(getStatement("getBrandIdsByBookId"), bookId);
}
@Override
public List<Long> getBrandIdsByWxGroupId(String wxGroupId) {
return getSessionTemplate().selectList(getStatement("getBrandIdsByWxGroupId"), wxGroupId);
}
@Override
public void updateId(Long masterId, Long brandId) {
Map<String, Object> map = new HashMap<>();
map.put("masterId", masterId);
map.put("brandId", brandId);
getSessionTemplate().update(getStatement("updateId"), map);
} }
} }
...@@ -2,14 +2,13 @@ package com.pcloud.book.advertising.dao.impl; ...@@ -2,14 +2,13 @@ package com.pcloud.book.advertising.dao.impl;
import com.pcloud.book.advertising.dao.AdvertisingMasterDao; import com.pcloud.book.advertising.dao.AdvertisingMasterDao;
import com.pcloud.book.advertising.dto.AdvertisingMasterDTO; import com.pcloud.book.advertising.dto.AdvertisingMasterDTO;
import com.pcloud.book.advertising.dto.OldBrandMasterDTO;
import com.pcloud.book.advertising.entity.AdvertisingMaster; import com.pcloud.book.advertising.entity.AdvertisingMaster;
import com.pcloud.common.core.dao.BaseDaoImpl; import com.pcloud.common.core.dao.BaseDaoImpl;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* Description 广告主数据访问层接口实现类 * Description 广告主数据访问层接口实现类
...@@ -35,25 +34,13 @@ public class AdvertisingMasterDaoImpl extends BaseDaoImpl<AdvertisingMaster> imp ...@@ -35,25 +34,13 @@ public class AdvertisingMasterDaoImpl extends BaseDaoImpl<AdvertisingMaster> imp
} }
@Override @Override
public List<AdvertisingMaster> getByGroup(Long groupQrcodeId) { public List<OldBrandMasterDTO> getMasterBrand() {
return getSessionTemplate().selectList(getStatement("getByGroup"), groupQrcodeId); return getSessionTemplate().selectList(getStatement("getMasterBrand"));
} }
@Override @Override
public List<AdvertisingMasterDTO> getBrandMaster() { public void updateLoginId(String masterName) {
return getSessionTemplate().selectList(getStatement("getBrandMaster")); getSessionTemplate().update(getStatement("updateLoginId"), masterName);
} }
@Override
public Long getIdByUserLoginId(Long loginId) {
return getSessionTemplate().selectOne(getStatement("getIdByUserLoginId"), loginId);
}
@Override
public void updateMasterLoginId(Long masterId, Long loginId) {
Map<String, Object> map = new HashMap<>();
map.put("masterId", masterId);
map.put("loginId", loginId);
getSessionTemplate().update(getStatement("updateMasterLoginId"), map);
}
} }
package com.pcloud.book.advertising.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.pcloud.common.dto.BaseDto;
import java.util.Date;
/**
* 品牌方
*/
public class AdvertisingBrandDTO extends BaseDto {
/**
* 品牌方id
*/
private Long id;
/**
* 品牌名称
*/
private String brandName;
/**
* 登录名
*/
private String loginName;
/**
* 密码
*/
private String password;
@JsonFormat(
pattern = "yyyy-MM-dd HH:mm:ss",
timezone = "GMT+8"
)
private Date createTime;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getBrandName() {
return brandName;
}
public void setBrandName(String brandName) {
this.brandName = brandName == null ? null : brandName.trim();
}
public String getLoginName() {
return loginName;
}
public void setLoginName(String loginName) {
this.loginName = loginName == null ? null : loginName.trim();
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password == null ? null : password.trim();
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
}
\ No newline at end of file
...@@ -6,12 +6,12 @@ import com.pcloud.common.dto.BaseDto; ...@@ -6,12 +6,12 @@ import com.pcloud.common.dto.BaseDto;
import java.util.Date; import java.util.Date;
/** /**
* @描述:广告主标记书刊列表 * @描述:品牌方标记书刊列表
* @作者:zhuyajie * @作者:zhuyajie
* @创建时间:11:51 2019/8/22 * @创建时间:11:51 2019/8/22
* @版本:1.0 * @版本:1.0
*/ */
public class Book4AdvertisingMasterDTO extends BaseDto { public class Book4AdvertisingTagDTO extends BaseDto {
/** /**
* 书籍标识 * 书籍标识
......
...@@ -10,7 +10,7 @@ import java.util.List; ...@@ -10,7 +10,7 @@ import java.util.List;
* @创建时间:17:19 2019/8/21 * @创建时间:17:19 2019/8/21
* @版本:1.0 * @版本:1.0
*/ */
public class GroupMasterAddDTO extends BaseDto{ public class GroupTagAddDTO extends BaseDto{
//按微信群标记 //按微信群标记
/** /**
...@@ -18,16 +18,16 @@ public class GroupMasterAddDTO extends BaseDto{ ...@@ -18,16 +18,16 @@ public class GroupMasterAddDTO extends BaseDto{
*/ */
private List<Long> groupQrcodeIdList; private List<Long> groupQrcodeIdList;
/** /**
* 广告主id列表 * 品牌方id列表
*/ */
private List<Long> masterIdList; private List<Long> brandIdList;
//按图书标记 //按图书标记
/** /**
* 广告主id * 品牌方id
*/ */
private Long masterId; private Long brandId;
/** /**
* 图书id列表 * 图书id列表
*/ */
...@@ -41,20 +41,20 @@ public class GroupMasterAddDTO extends BaseDto{ ...@@ -41,20 +41,20 @@ public class GroupMasterAddDTO extends BaseDto{
this.groupQrcodeIdList = groupQrcodeIdList; this.groupQrcodeIdList = groupQrcodeIdList;
} }
public List<Long> getMasterIdList() { public List<Long> getBrandIdList() {
return masterIdList; return brandIdList;
} }
public void setMasterIdList(List<Long> masterIdList) { public void setBrandIdList(List<Long> brandIdList) {
this.masterIdList = masterIdList; this.brandIdList = brandIdList;
} }
public Long getMasterId() { public Long getBrandId() {
return masterId; return brandId;
} }
public void setMasterId(Long masterId) { public void setBrandId(Long brandId) {
this.masterId = masterId; this.brandId = brandId;
} }
public List<Long> getBookIdList() { public List<Long> getBookIdList() {
......
...@@ -8,12 +8,12 @@ import java.util.Date; ...@@ -8,12 +8,12 @@ import java.util.Date;
import java.util.List; import java.util.List;
/** /**
* @描述:群广告主标记列表 * @描述:微信群品牌标记列表
* @作者:zhuyajie * @作者:zhuyajie
* @创建时间:15:00 2019/8/21 * @创建时间:15:00 2019/8/21
* @版本:1.0 * @版本:1.0
*/ */
public class GroupMasterDTO extends BaseDto{ public class GroupTagDTO extends BaseDto{
/** /**
* 微信群id * 微信群id
*/ */
...@@ -96,9 +96,9 @@ public class GroupMasterDTO extends BaseDto{ ...@@ -96,9 +96,9 @@ public class GroupMasterDTO extends BaseDto{
) )
private Date createTime; private Date createTime;
/** /**
* 标记的广告主列表 * 标记的品牌方列表
*/ */
List<AdvertisingMaster> masterList; List<AdvertisingBrandDTO> brandList;
/** /**
* 标记时间 * 标记时间
*/ */
...@@ -261,12 +261,12 @@ public class GroupMasterDTO extends BaseDto{ ...@@ -261,12 +261,12 @@ public class GroupMasterDTO extends BaseDto{
this.createTime = createTime; this.createTime = createTime;
} }
public List<AdvertisingMaster> getMasterList() { public List<AdvertisingBrandDTO> getBrandList() {
return masterList; return brandList;
} }
public void setMasterList(List<AdvertisingMaster> masterList) { public void setBrandList(List<AdvertisingBrandDTO> brandList) {
this.masterList = masterList; this.brandList = brandList;
} }
public Date getTagTime() { public Date getTagTime() {
...@@ -287,7 +287,7 @@ public class GroupMasterDTO extends BaseDto{ ...@@ -287,7 +287,7 @@ public class GroupMasterDTO extends BaseDto{
@Override @Override
public String toString() { public String toString() {
return "GroupMasterDTO{" + return "GroupTagDTO{" +
"wxGroupId='" + wxGroupId + '\'' + "wxGroupId='" + wxGroupId + '\'' +
", groupQrcodeId=" + groupQrcodeId + ", groupQrcodeId=" + groupQrcodeId +
", groupName='" + groupName + '\'' + ", groupName='" + groupName + '\'' +
...@@ -307,7 +307,7 @@ public class GroupMasterDTO extends BaseDto{ ...@@ -307,7 +307,7 @@ public class GroupMasterDTO extends BaseDto{
", advertisingSpaceNum=" + advertisingSpaceNum + ", advertisingSpaceNum=" + advertisingSpaceNum +
", qrcodeUrl='" + qrcodeUrl + '\'' + ", qrcodeUrl='" + qrcodeUrl + '\'' +
", createTime=" + createTime + ", createTime=" + createTime +
", masterList=" + masterList + ", brandList=" + brandList +
", tagTime=" + tagTime + ", tagTime=" + tagTime +
", isbn='" + isbn + '\'' + ", isbn='" + isbn + '\'' +
'}'; '}';
......
package com.pcloud.book.advertising.dto;
/**
* @描述:广告主品牌方旧数据
* @作者:zhuyajie
* @创建时间:11:20 2019/9/11
* @版本:1.0
*/
public class OldBrandMasterDTO {
private Long id;
/**
* 品牌方名称
*/
private String masterName;
/**
* 登录id
*/
private Long loginId;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getMasterName() {
return masterName;
}
public void setMasterName(String masterName) {
this.masterName = masterName;
}
public Long getLoginId() {
return loginId;
}
public void setLoginId(Long loginId) {
this.loginId = loginId;
}
}
package com.pcloud.book.advertising.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.pcloud.common.entity.BaseEntity;
import java.util.Date;
/**
* 品牌方
*/
public class AdvertisingBrand extends BaseEntity {
/**
* 品牌名称
*/
private String brandName;
/**
* 登录名
*/
private String loginName;
/**
* 密码
*/
private String password;
/**
* 是否删除
*/
private Boolean isDelete;
@JsonFormat(
pattern = "yyyy-MM-dd HH:mm:ss",
timezone = "GMT+8"
)
private Date createTime;
private Long createUser;
@JsonFormat(
pattern = "yyyy-MM-dd HH:mm:ss",
timezone = "GMT+8"
)
private Date updateTime;
private Long updateUser;
public String getBrandName() {
return brandName;
}
public void setBrandName(String brandName) {
this.brandName = brandName == null ? null : brandName.trim();
}
public String getLoginName() {
return loginName;
}
public void setLoginName(String loginName) {
this.loginName = loginName == null ? null : loginName.trim();
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password == null ? null : password.trim();
}
public Boolean getIsDelete() {
return isDelete;
}
public void setIsDelete(Boolean isDelete) {
this.isDelete = isDelete;
}
public java.util.Date getCreateTime() {
return createTime;
}
public void setCreateTime(java.util.Date createTime) {
this.createTime = createTime;
}
public Long getCreateUser() {
return createUser;
}
public void setCreateUser(Long createUser) {
this.createUser = createUser;
}
public java.util.Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(java.util.Date updateTime) {
this.updateTime = updateTime;
}
public Long getUpdateUser() {
return updateUser;
}
public void setUpdateUser(Long updateUser) {
this.updateUser = updateUser;
}
}
\ No newline at end of file
...@@ -21,9 +21,9 @@ public class AdvertisingGroupTag extends BaseEntity{ ...@@ -21,9 +21,9 @@ public class AdvertisingGroupTag extends BaseEntity{
private Long groupQrcodeId; private Long groupQrcodeId;
/** /**
* 广告主id * 品牌方id
*/ */
private Long masterId; private Long brandId;
@JsonFormat( @JsonFormat(
pattern = "yyyy-MM-dd HH:mm:ss", pattern = "yyyy-MM-dd HH:mm:ss",
timezone = "GMT+8" timezone = "GMT+8"
...@@ -46,12 +46,12 @@ public class AdvertisingGroupTag extends BaseEntity{ ...@@ -46,12 +46,12 @@ public class AdvertisingGroupTag extends BaseEntity{
this.groupQrcodeId = groupQrcodeId; this.groupQrcodeId = groupQrcodeId;
} }
public Long getMasterId() { public Long getBrandId() {
return masterId; return brandId;
} }
public void setMasterId(Long masterId) { public void setBrandId(Long brandId) {
this.masterId = masterId; this.brandId = brandId;
} }
public Date getCreateTime() { public Date getCreateTime() {
...@@ -67,7 +67,7 @@ public class AdvertisingGroupTag extends BaseEntity{ ...@@ -67,7 +67,7 @@ public class AdvertisingGroupTag extends BaseEntity{
return "AdvertisingGroupTag{" + return "AdvertisingGroupTag{" +
"tagBookId=" + tagBookId + "tagBookId=" + tagBookId +
", groupQrcodeId=" + groupQrcodeId + ", groupQrcodeId=" + groupQrcodeId +
", masterId=" + masterId + ", brandId=" + brandId +
", createTime=" + createTime + ", createTime=" + createTime +
'}'; '}';
} }
......
...@@ -42,10 +42,7 @@ public class AdvertisingMaster extends BaseEntity { ...@@ -42,10 +42,7 @@ public class AdvertisingMaster extends BaseEntity {
*/ */
private String password; private String password;
/**
* 登录账号id
*/
private Long loginId;
@Override @Override
public Long getId() { public Long getId() {
return id; return id;
...@@ -100,13 +97,6 @@ public class AdvertisingMaster extends BaseEntity { ...@@ -100,13 +97,6 @@ public class AdvertisingMaster extends BaseEntity {
this.loginName = loginName; this.loginName = loginName;
} }
public Long getLoginId() {
return loginId;
}
public void setLoginId(Long loginId) {
this.loginId = loginId;
}
public String getPassword() { public String getPassword() {
return password; return password;
...@@ -126,7 +116,6 @@ public class AdvertisingMaster extends BaseEntity { ...@@ -126,7 +116,6 @@ public class AdvertisingMaster extends BaseEntity {
", settlementMethodList=" + settlementMethodList + ", settlementMethodList=" + settlementMethodList +
", loginName='" + loginName + '\'' + ", loginName='" + loginName + '\'' +
", password='" + password + '\'' + ", password='" + password + '\'' +
", loginId=" + loginId +
'}'; '}';
} }
......
...@@ -9,8 +9,7 @@ public enum SettlementMethodEnum { ...@@ -9,8 +9,7 @@ public enum SettlementMethodEnum {
CPC("CPC", "按点击量"), CPC("CPC", "按点击量"),
CPM("CPM", "按曝光量"), CPM("CPM", "按曝光量"),
CPA("CPA", "按实际行动"), CPA("CPA", "按实际行动"),
CPS("CPS", "按实际销售"), CPS("CPS", "按实际销售");
Brand("Brand","品牌方,线下结算");
public final String code; public final String code;
...@@ -33,7 +32,7 @@ public enum SettlementMethodEnum { ...@@ -33,7 +32,7 @@ public enum SettlementMethodEnum {
return null; return null;
} }
public static final String[] SETTLEMENT_METHOD_GATHER = {CPC.code, CPM.code, CPA.code, CPS.code, Brand.code}; public static final String[] SETTLEMENT_METHOD_GATHER = {CPC.code, CPM.code, CPA.code, CPS.code};
public static final String[] SETTLEMENT_METHOD_NEED_PRICE_GATHER = {CPC.code, CPM.code, CPA.code}; public static final String[] SETTLEMENT_METHOD_NEED_PRICE_GATHER = {CPC.code, CPM.code, CPA.code};
} }
package com.pcloud.book.advertising.facade; package com.pcloud.book.advertising.facade;
import com.pcloud.book.advertising.dto.AdvertisingBrandDTO;
import com.pcloud.book.advertising.dto.AdvertisingSpaceDTO; import com.pcloud.book.advertising.dto.AdvertisingSpaceDTO;
import com.pcloud.book.advertising.dto.Book4AdvertisingMasterDTO; import com.pcloud.book.advertising.dto.Book4AdvertisingTagDTO;
import com.pcloud.book.advertising.dto.GroupMasterAddDTO; import com.pcloud.book.advertising.dto.GroupTagAddDTO;
import com.pcloud.book.advertising.dto.GroupMasterDTO; import com.pcloud.book.advertising.dto.GroupTagDTO;
import com.pcloud.book.advertising.dto.TestParamDTO; import com.pcloud.book.advertising.dto.TestParamDTO;
import com.pcloud.book.advertising.entity.AdvertisingAdviserPermission; import com.pcloud.book.advertising.entity.AdvertisingAdviserPermission;
import com.pcloud.book.advertising.entity.AdvertisingAgentPermission; 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.AdvertisingBrowseRecord;
import com.pcloud.book.advertising.entity.AdvertisingClickRecord; import com.pcloud.book.advertising.entity.AdvertisingClickRecord;
import com.pcloud.book.advertising.entity.AdvertisingDistributionBook; import com.pcloud.book.advertising.entity.AdvertisingDistributionBook;
...@@ -17,6 +19,7 @@ import com.pcloud.book.advertising.entity.AdvertisingPlan; ...@@ -17,6 +19,7 @@ import com.pcloud.book.advertising.entity.AdvertisingPlan;
import com.pcloud.book.advertising.entity.AdvertisingSpace; import com.pcloud.book.advertising.entity.AdvertisingSpace;
import com.pcloud.common.dto.ResponseDto; import com.pcloud.common.dto.ResponseDto;
import com.pcloud.common.exceptions.BizException; import com.pcloud.common.exceptions.BizException;
import com.pcloud.common.page.PageBean;
import com.pcloud.common.page.PageBeanNew; import com.pcloud.common.page.PageBeanNew;
import com.pcloud.common.permission.PermissionException; import com.pcloud.common.permission.PermissionException;
...@@ -32,6 +35,7 @@ import org.springframework.web.bind.annotation.RequestMethod; ...@@ -32,6 +35,7 @@ import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import java.util.List; import java.util.List;
import java.util.Map;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
...@@ -979,7 +983,7 @@ public interface AdvertisingSpaceFacade { ...@@ -979,7 +983,7 @@ public interface AdvertisingSpaceFacade {
/** /**
* 微信群广告主标记列表 * 微信群品牌方标记列表
* @param token * @param token
* @param currentPage * @param currentPage
* @param numPerPage * @param numPerPage
...@@ -987,11 +991,11 @@ public interface AdvertisingSpaceFacade { ...@@ -987,11 +991,11 @@ public interface AdvertisingSpaceFacade {
* @param proLabelId * @param proLabelId
* @param depLabelId * @param depLabelId
* @param purLabelId * @param purLabelId
* @param masterId * @param brandId
* @return * @return
* @throws PermissionException * @throws PermissionException
*/ */
@ApiOperation(value = "微信群广告主标记列表", httpMethod = "GET") @ApiOperation(value = "微信群品牌方标记列表", httpMethod = "GET")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = "currentPage", value = "当前页", dataType = "integer", paramType = "query"), @ApiImplicitParam(name = "currentPage", value = "当前页", dataType = "integer", paramType = "query"),
@ApiImplicitParam(name = "numPerPage", value = "每页数量", dataType = "integer", paramType = "query"), @ApiImplicitParam(name = "numPerPage", value = "每页数量", dataType = "integer", paramType = "query"),
...@@ -999,34 +1003,42 @@ public interface AdvertisingSpaceFacade { ...@@ -999,34 +1003,42 @@ public interface AdvertisingSpaceFacade {
@ApiImplicitParam(name = "proLabelId", value = "专业标签id", dataType = "long", required = false, paramType = "query"), @ApiImplicitParam(name = "proLabelId", value = "专业标签id", dataType = "long", required = false, paramType = "query"),
@ApiImplicitParam(name = "depLabelId", value = "深度标签id", dataType = "long", required = false, paramType = "query"), @ApiImplicitParam(name = "depLabelId", value = "深度标签id", dataType = "long", required = false, paramType = "query"),
@ApiImplicitParam(name = "purLabelId", value = "目的标签id", dataType = "string", required = false, paramType = "query"), @ApiImplicitParam(name = "purLabelId", value = "目的标签id", dataType = "string", required = false, paramType = "query"),
@ApiImplicitParam(name = "masterId", value = "广告主id", dataType = "string", required = false, paramType = "query") @ApiImplicitParam(name = "brandId", value = "品牌方id", dataType = "string", required = false, paramType = "query")
}) })
@RequestMapping(value = "listPageGroupMaster", method = RequestMethod.GET) @RequestMapping(value = "listPageGroupMaster", method = RequestMethod.GET)
public ResponseDto<PageBeanNew<GroupMasterDTO>> listPageGroupMaster( public ResponseDto<PageBeanNew<GroupTagDTO>> listPageGroupMaster(
@RequestHeader("token") String token, @RequestParam("currentPage") Integer currentPage, @RequestParam("numPerPage") Integer numPerPage, @RequestHeader("token") String token, @RequestParam("currentPage") Integer currentPage, @RequestParam("numPerPage") Integer numPerPage,
@RequestParam(value = "name", required = false) String name, @RequestParam(value = "proLabelId", required = false) Long proLabelId, @RequestParam(value = "name", required = false) String name, @RequestParam(value = "proLabelId", required = false) Long proLabelId,
@RequestParam(value = "depLabelId", required = false) Long depLabelId, @RequestParam(value = "purLabelId", required = false) Long purLabelId, @RequestParam(value = "depLabelId", required = false) Long depLabelId, @RequestParam(value = "purLabelId", required = false) Long purLabelId,
@RequestParam(value = "masterId", required = false) Long masterId) throws PermissionException; @RequestParam(value = "brandId", required = false) Long brandId) throws PermissionException;
/**
* 获取品牌方
* @param token
* @return
* @throws PermissionException
* @throws BizException
* @throws JsonParseException
*/
@ApiOperation(value = "获取品牌方广告主", httpMethod = "GET") @ApiOperation(value = "获取品牌方广告主", httpMethod = "GET")
@RequestMapping(value = "getBrandMaster", method = RequestMethod.GET) @RequestMapping(value = "getBrandMaster", method = RequestMethod.GET)
ResponseDto<?> getBrandMaster(@RequestHeader("token") String token) throws PermissionException, BizException, JsonParseException; ResponseDto<?> getBrandMaster(@RequestHeader("token") String token) throws PermissionException, BizException, JsonParseException;
/** /**
* 微信群标记广告主 * 微信群标记品牌方
* @param token * @param token
* @param groupMasterAddDTO * @param groupTagAddDTO
* @return * @return
* @throws PermissionException * @throws PermissionException
*/ */
@ApiOperation(value = "微信群标记广告主", httpMethod = "POST") @ApiOperation(value = "微信群标记广告主", httpMethod = "POST")
@PostMapping("setGroupMaster") @PostMapping("setGroupMaster")
public ResponseDto<?> setGroupMaster(@RequestHeader("token") String token, @RequestBody @ApiParam GroupMasterAddDTO groupMasterAddDTO) throws PermissionException; public ResponseDto<?> setGroupMaster(@RequestHeader("token") String token, @RequestBody @ApiParam GroupTagAddDTO groupTagAddDTO) throws PermissionException;
/** /**
* 广告主标记书刊列表 * 品牌方标记书刊列表
* @param token * @param token
* @param currentPage * @param currentPage
* @param numPerPage * @param numPerPage
...@@ -1034,19 +1046,19 @@ public interface AdvertisingSpaceFacade { ...@@ -1034,19 +1046,19 @@ public interface AdvertisingSpaceFacade {
* @return * @return
* @throws PermissionException * @throws PermissionException
*/ */
@ApiOperation(value = "广告主标记书刊列表", httpMethod = "GET") @ApiOperation(value = "品牌方标记书刊列表", httpMethod = "GET")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = "currentPage", value = "当前页", dataType = "integer", paramType = "query"), @ApiImplicitParam(name = "currentPage", value = "当前页", dataType = "integer", paramType = "query"),
@ApiImplicitParam(name = "numPerPage", value = "每页数量", dataType = "integer", paramType = "query"), @ApiImplicitParam(name = "numPerPage", value = "每页数量", dataType = "integer", paramType = "query"),
@ApiImplicitParam(name = "name", value = "书籍名称", dataType = "string", required = false, paramType = "query") @ApiImplicitParam(name = "name", value = "书籍名称", dataType = "string", required = false, paramType = "query")
}) })
@RequestMapping(value = "listPageBook4AdMaster", method = RequestMethod.GET) @RequestMapping(value = "listPageBook4AdMaster", method = RequestMethod.GET)
public ResponseDto<PageBeanNew<Book4AdvertisingMasterDTO>> listPageBook4AdMaster( public ResponseDto<PageBeanNew<Book4AdvertisingTagDTO>> listPageBook4AdMaster(
@RequestHeader("token") String token, @RequestParam("currentPage") Integer currentPage, @RequestParam("numPerPage") Integer numPerPage, @RequestHeader("token") String token, @RequestParam("currentPage") Integer currentPage, @RequestParam("numPerPage") Integer numPerPage,
@RequestParam(value = "name", required = false) String name) throws PermissionException; @RequestParam(value = "name", required = false) String name) throws PermissionException;
/** /**
* 品牌方广告主-微信群列表 * 品牌方账号-微信群列表
* @param token * @param token
* @param currentPage * @param currentPage
* @param numPerPage * @param numPerPage
...@@ -1059,7 +1071,7 @@ public interface AdvertisingSpaceFacade { ...@@ -1059,7 +1071,7 @@ public interface AdvertisingSpaceFacade {
* @return * @return
* @throws PermissionException * @throws PermissionException
*/ */
@ApiOperation(value = "品牌方广告主-微信群列表", httpMethod = "GET") @ApiOperation(value = "品牌方账号-微信群列表", httpMethod = "GET")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = "currentPage", value = "当前页", dataType = "integer", paramType = "query"), @ApiImplicitParam(name = "currentPage", value = "当前页", dataType = "integer", paramType = "query"),
@ApiImplicitParam(name = "numPerPage", value = "每页数量", dataType = "integer", paramType = "query"), @ApiImplicitParam(name = "numPerPage", value = "每页数量", dataType = "integer", paramType = "query"),
...@@ -1071,7 +1083,7 @@ public interface AdvertisingSpaceFacade { ...@@ -1071,7 +1083,7 @@ public interface AdvertisingSpaceFacade {
@ApiImplicitParam(name = "endTime", value = "endTime", dataType = "string", required = false, paramType = "query") @ApiImplicitParam(name = "endTime", value = "endTime", dataType = "string", required = false, paramType = "query")
}) })
@RequestMapping(value = "listPageGroupList4Master", method = RequestMethod.GET) @RequestMapping(value = "listPageGroupList4Master", method = RequestMethod.GET)
public ResponseDto<PageBeanNew<GroupMasterDTO>> listPageGroupList4Master( public ResponseDto<PageBeanNew<GroupTagDTO>> listPageGroupList4Master(
@RequestHeader("token") String token, @RequestParam("currentPage") Integer currentPage, @RequestParam("numPerPage") Integer numPerPage, @RequestHeader("token") String token, @RequestParam("currentPage") Integer currentPage, @RequestParam("numPerPage") Integer numPerPage,
@RequestParam(value = "name", required = false) String name, @RequestParam(value = "proLabelId", required = false) Long proLabelId, @RequestParam(value = "name", required = false) String name, @RequestParam(value = "proLabelId", required = false) Long proLabelId,
@RequestParam(value = "depLabelId", required = false) Long depLabelId, @RequestParam(value = "purLabelId", required = false) Long purLabelId, @RequestParam(value = "depLabelId", required = false) Long depLabelId, @RequestParam(value = "purLabelId", required = false) Long purLabelId,
...@@ -1079,33 +1091,33 @@ public interface AdvertisingSpaceFacade { ...@@ -1079,33 +1091,33 @@ public interface AdvertisingSpaceFacade {
/** /**
* 导出-微信群广告主标记列表 * 导出-微信群品牌方标记列表
* @param token * @param token
* @param name * @param name
* @param proLabelId * @param proLabelId
* @param depLabelId * @param depLabelId
* @param purLabelId * @param purLabelId
* @param masterId * @param brandId
* @return * @return
* @throws PermissionException * @throws PermissionException
*/ */
@ApiOperation(value = "导出-微信群广告主标记列表", httpMethod = "GET") @ApiOperation(value = "导出-微信群品牌方标记列表", httpMethod = "GET")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = "name", value = "书籍名称", dataType = "string", required = false, paramType = "query"), @ApiImplicitParam(name = "name", value = "书籍名称", dataType = "string", required = false, paramType = "query"),
@ApiImplicitParam(name = "proLabelId", value = "专业标签id", dataType = "long", required = false, paramType = "query"), @ApiImplicitParam(name = "proLabelId", value = "专业标签id", dataType = "long", required = false, paramType = "query"),
@ApiImplicitParam(name = "depLabelId", value = "深度标签id", dataType = "long", required = false, paramType = "query"), @ApiImplicitParam(name = "depLabelId", value = "深度标签id", dataType = "long", required = false, paramType = "query"),
@ApiImplicitParam(name = "purLabelId", value = "目的标签id", dataType = "string", required = false, paramType = "query"), @ApiImplicitParam(name = "purLabelId", value = "目的标签id", dataType = "string", required = false, paramType = "query"),
@ApiImplicitParam(name = "masterId", value = "广告主id", dataType = "string", required = false, paramType = "query") @ApiImplicitParam(name = "brandId", value = "品牌方id", dataType = "string", required = false, paramType = "query")
}) })
@RequestMapping(value = "exportGroupMaster", method = RequestMethod.GET) @RequestMapping(value = "exportGroupMaster", method = RequestMethod.GET)
public ResponseDto<?> exportGroupMaster( public ResponseDto<?> exportGroupMaster(
@RequestHeader("token") String token, @RequestHeader("token") String token,
@RequestParam(value = "name", required = false) String name, @RequestParam(value = "proLabelId", required = false) Long proLabelId, @RequestParam(value = "name", required = false) String name, @RequestParam(value = "proLabelId", required = false) Long proLabelId,
@RequestParam(value = "depLabelId", required = false) Long depLabelId, @RequestParam(value = "purLabelId", required = false) Long purLabelId, @RequestParam(value = "depLabelId", required = false) Long depLabelId, @RequestParam(value = "purLabelId", required = false) Long purLabelId,
@RequestParam(value = "masterId", required = false) Long masterId) throws PermissionException; @RequestParam(value = "brandId", required = false) Long brandId) throws PermissionException;
/** /**
* 品牌方广告主-微信群列表-导出 * 品牌方账号-微信群列表-导出
* @param token * @param token
* @param name * @param name
* @param proLabelId * @param proLabelId
...@@ -1116,7 +1128,7 @@ public interface AdvertisingSpaceFacade { ...@@ -1116,7 +1128,7 @@ public interface AdvertisingSpaceFacade {
* @return * @return
* @throws PermissionException * @throws PermissionException
*/ */
@ApiOperation(value = "品牌方广告主-微信群列表-导出", httpMethod = "GET") @ApiOperation(value = "品牌方账号-微信群列表-导出", httpMethod = "GET")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = "name", value = "书籍名称", dataType = "string", required = false, paramType = "query"), @ApiImplicitParam(name = "name", value = "书籍名称", dataType = "string", required = false, paramType = "query"),
@ApiImplicitParam(name = "proLabelId", value = "专业标签id", dataType = "long", required = false, paramType = "query"), @ApiImplicitParam(name = "proLabelId", value = "专业标签id", dataType = "long", required = false, paramType = "query"),
...@@ -1126,14 +1138,14 @@ public interface AdvertisingSpaceFacade { ...@@ -1126,14 +1138,14 @@ public interface AdvertisingSpaceFacade {
@ApiImplicitParam(name = "endTime", value = "endTime", dataType = "string", required = false, paramType = "query") @ApiImplicitParam(name = "endTime", value = "endTime", dataType = "string", required = false, paramType = "query")
}) })
@RequestMapping(value = "exportGroupList4Master", method = RequestMethod.GET) @RequestMapping(value = "exportGroupList4Master", method = RequestMethod.GET)
public ResponseDto<PageBeanNew<GroupMasterDTO>> exportGroupList4Master( public ResponseDto<Map<String,Object>> exportGroupList4Master(
@RequestHeader("token") String token, @RequestHeader("token") String token,
@RequestParam(value = "name", required = false) String name, @RequestParam(value = "proLabelId", required = false) Long proLabelId, @RequestParam(value = "name", required = false) String name, @RequestParam(value = "proLabelId", required = false) Long proLabelId,
@RequestParam(value = "depLabelId", required = false) Long depLabelId, @RequestParam(value = "purLabelId", required = false) Long purLabelId, @RequestParam(value = "depLabelId", required = false) Long depLabelId, @RequestParam(value = "purLabelId", required = false) Long purLabelId,
@RequestParam(value = "startTime", required = false) String startTime, @RequestParam(value = "endTime", required = false) String endTime) throws PermissionException; @RequestParam(value = "startTime", required = false) String startTime, @RequestParam(value = "endTime", required = false) String endTime) throws PermissionException;
/** /**
* 品牌方广告主-微信群基本信息列表 * 品牌方账号-微信群基本信息列表
* @param token * @param token
* @param currentPage * @param currentPage
* @param numPerPage * @param numPerPage
...@@ -1141,27 +1153,63 @@ public interface AdvertisingSpaceFacade { ...@@ -1141,27 +1153,63 @@ public interface AdvertisingSpaceFacade {
* @return * @return
* @throws PermissionException * @throws PermissionException
*/ */
@ApiOperation(value = "品牌方广告主-微信群基本信息列表", httpMethod = "GET") @ApiOperation(value = "品牌方账号-微信群基本信息列表", httpMethod = "GET")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = "currentPage", value = "当前页", dataType = "integer", paramType = "query"), @ApiImplicitParam(name = "currentPage", value = "当前页", dataType = "integer", paramType = "query"),
@ApiImplicitParam(name = "numPerPage", value = "每页数量", dataType = "integer", paramType = "query"), @ApiImplicitParam(name = "numPerPage", value = "每页数量", dataType = "integer", paramType = "query"),
@ApiImplicitParam(name = "name", value = "书籍名称", dataType = "string", required = false, paramType = "query") @ApiImplicitParam(name = "name", value = "书籍名称", dataType = "string", required = false, paramType = "query")
}) })
@RequestMapping(value = "listPageGroupBaseInfo4Master", method = RequestMethod.GET) @RequestMapping(value = "listPageGroupBaseInfo4Master", method = RequestMethod.GET)
public ResponseDto<PageBeanNew<GroupMasterDTO>> listPageGroupBaseInfo4Master( public ResponseDto<PageBeanNew<GroupTagDTO>> listPageGroupBaseInfo4Master(
@RequestHeader("token") String token, @RequestParam("currentPage") Integer currentPage, @RequestHeader("token") String token, @RequestParam("currentPage") Integer currentPage,
@RequestParam("numPerPage") Integer numPerPage, @RequestParam(value = "name", required = false) String name) throws PermissionException; @RequestParam("numPerPage") Integer numPerPage, @RequestParam(value = "name", required = false) String name) throws PermissionException;
/** /**
* 广告主已标记的书刊id * 品牌方已标记的书刊id
* @param token * @param token
* @param masterId * @param brandId
* @return * @return
* @throws PermissionException * @throws PermissionException
*/ */
@ApiOperation(value = "广告主已标记的书刊id", httpMethod = "GET") @ApiOperation(value = "品牌方已标记的书刊id", httpMethod = "GET")
@ApiImplicitParam(name = "masterId", value = "广告主id", dataType = "long", paramType = "query") @ApiImplicitParam(name = "brandId", value = "品牌方id", dataType = "long", paramType = "query")
@GetMapping("getTagBookIds4AdMatser") @GetMapping("getTagBookIds4AdMatser")
public ResponseDto<List<Long>> getTagBookIds4AdMatser( public ResponseDto<List<Long>> getTagBookIds4AdMatser(
@RequestHeader("token") String token, @RequestParam(value = "masterId", required = false) Long masterId) throws PermissionException; @RequestHeader("token") String token, @RequestParam(value = "brandId", required = false) Long brandId) throws PermissionException;
@ApiOperation(value = "创建品牌方账号", httpMethod = "POST")
@PostMapping("createBrand")
public ResponseDto<?> createBrand(@RequestHeader("token") String token, @RequestBody @ApiParam AdvertisingBrand advertisingBrand) throws PermissionException;
@ApiOperation(value = "根据id获得品牌方信息", httpMethod = "GET")
@ApiImplicitParam(name = "brandId", value = "品牌方id", dataType = "long", paramType = "query")
@GetMapping("getBrandById")
public ResponseDto<AdvertisingBrandDTO> getBrandById(@RequestHeader("token") String token, @RequestParam("brandId") Long brandId) throws PermissionException;
@ApiOperation(value = "修改品牌方密码", httpMethod = "POST")
@PostMapping("updateBrandPassword")
public ResponseDto<?> updateBrandPassword(@RequestHeader("token") String token, @RequestBody @ApiParam AdvertisingBrand advertisingBrand) throws PermissionException;
@ApiOperation(value = "根据id删除品牌方", httpMethod = "GET")
@ApiImplicitParam(name = "brandId", value = "品牌方id", dataType = "long", paramType = "query")
@GetMapping("deleteBrandById")
public ResponseDto<?> deleteBrandById(@RequestHeader("token") String token, @RequestParam("brandId") Long brandId) throws PermissionException;
@ApiOperation(value = "分页查询品牌方", httpMethod = "GET")
@ApiImplicitParams({
@ApiImplicitParam(name = "currentPage", value = "当前页", dataType = "integer", paramType = "query"),
@ApiImplicitParam(name = "numPerPage", value = "每页数量", dataType = "integer", paramType = "query"),
@ApiImplicitParam(name = "name", value = "登录账号", dataType = "string", required = false, paramType = "query")})
@GetMapping("listPageBrand")
public ResponseDto<PageBean> listPageBrand(
@RequestHeader("token") String token, @RequestParam("currentPage") Integer currentPage,
@RequestParam("numPerPage") Integer numPerPage, @RequestParam(value = "name", required = false) String name) throws PermissionException;
@ApiOperation(value = "品牌方登录", httpMethod = "POST")
@PostMapping("brandLogin")
public ResponseDto<?> brandLogin(@RequestBody @ApiParam AdvertisingBrandDTO advertisingBrandDTO);
@ApiOperation(value = "获得品牌方登录信息", httpMethod = "GET")
@GetMapping("getBrandLoginInfo")
public ResponseDto<?> getBrandLoginInfo(@RequestHeader("token") String token) throws PermissionException;
} }
package com.pcloud.book.advertising.facade.impl; package com.pcloud.book.advertising.facade.impl;
import com.pcloud.book.advertising.biz.AdvertisingSpaceBiz; import com.pcloud.book.advertising.biz.AdvertisingSpaceBiz;
import com.pcloud.book.advertising.biz.GroupMasterTagBiz; import com.pcloud.book.advertising.biz.GroupTagBiz;
import com.pcloud.book.advertising.dto.AdvertisingBrandDTO;
import com.pcloud.book.advertising.dto.AdvertisingSpaceDTO; import com.pcloud.book.advertising.dto.AdvertisingSpaceDTO;
import com.pcloud.book.advertising.dto.Book4AdvertisingMasterDTO; import com.pcloud.book.advertising.dto.Book4AdvertisingTagDTO;
import com.pcloud.book.advertising.dto.GroupMasterAddDTO; import com.pcloud.book.advertising.dto.GroupTagAddDTO;
import com.pcloud.book.advertising.dto.GroupMasterDTO; import com.pcloud.book.advertising.dto.GroupTagDTO;
import com.pcloud.book.advertising.dto.TestParamDTO; import com.pcloud.book.advertising.dto.TestParamDTO;
import com.pcloud.book.advertising.entity.AdvertisingAdviserPermission; import com.pcloud.book.advertising.entity.AdvertisingAdviserPermission;
import com.pcloud.book.advertising.entity.AdvertisingAgentPermission; 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.AdvertisingBrowseRecord;
import com.pcloud.book.advertising.entity.AdvertisingClickRecord; import com.pcloud.book.advertising.entity.AdvertisingClickRecord;
import com.pcloud.book.advertising.entity.AdvertisingDistributionBook; import com.pcloud.book.advertising.entity.AdvertisingDistributionBook;
...@@ -63,7 +65,7 @@ public class AdvertisingSpaceFacadeImpl implements AdvertisingSpaceFacade { ...@@ -63,7 +65,7 @@ public class AdvertisingSpaceFacadeImpl implements AdvertisingSpaceFacade {
@Autowired @Autowired
private AdvertisingSpaceBiz advertisingSpaceBiz; private AdvertisingSpaceBiz advertisingSpaceBiz;
@Autowired @Autowired
private GroupMasterTagBiz groupMasterTagBiz; private GroupTagBiz groupTagBiz;
/** /**
* 创建广告位 * 创建广告位
...@@ -909,15 +911,15 @@ public class AdvertisingSpaceFacadeImpl implements AdvertisingSpaceFacade { ...@@ -909,15 +911,15 @@ public class AdvertisingSpaceFacadeImpl implements AdvertisingSpaceFacade {
} }
/** /**
* 微信群广告主标记列表 * 微信群品牌方标记列表
*/ */
@Override @Override
@RequestMapping(value = "listPageGroupMaster", method = RequestMethod.GET) @RequestMapping(value = "listPageGroupMaster", method = RequestMethod.GET)
public ResponseDto<PageBeanNew<GroupMasterDTO>> listPageGroupMaster( public ResponseDto<PageBeanNew<GroupTagDTO>> listPageGroupMaster(
@RequestHeader("token") String token, @RequestParam("currentPage") Integer currentPage, @RequestParam("numPerPage") Integer numPerPage, @RequestHeader("token") String token, @RequestParam("currentPage") Integer currentPage, @RequestParam("numPerPage") Integer numPerPage,
@RequestParam(value = "name", required = false) String name, @RequestParam(value = "proLabelId", required = false) Long proLabelId, @RequestParam(value = "name", required = false) String name, @RequestParam(value = "proLabelId", required = false) Long proLabelId,
@RequestParam(value = "depLabelId", required = false) Long depLabelId, @RequestParam(value = "purLabelId", required = false) Long purLabelId, @RequestParam(value = "depLabelId", required = false) Long depLabelId, @RequestParam(value = "purLabelId", required = false) Long purLabelId,
@RequestParam(value = "masterId", required = false) Long masterId) throws PermissionException { @RequestParam(value = "brandId", required = false) Long brandId) throws PermissionException {
SessionUtil.getVlaue(token, SessionUtil.PARTY_ID); SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
if (currentPage == null || numPerPage == null || currentPage < 0 || numPerPage < 0) { if (currentPage == null || numPerPage == null || currentPage < 0 || numPerPage < 0) {
throw BookBizException.PAGE_PARAM_DELETION; throw BookBizException.PAGE_PARAM_DELETION;
...@@ -927,59 +929,59 @@ public class AdvertisingSpaceFacadeImpl implements AdvertisingSpaceFacade { ...@@ -927,59 +929,59 @@ public class AdvertisingSpaceFacadeImpl implements AdvertisingSpaceFacade {
paramMap.put("proLabelId", proLabelId); paramMap.put("proLabelId", proLabelId);
paramMap.put("depLabelId", depLabelId); paramMap.put("depLabelId", depLabelId);
paramMap.put("purLabelId", purLabelId); paramMap.put("purLabelId", purLabelId);
paramMap.put("masterId", masterId); paramMap.put("brandId", brandId);
PageBeanNew<GroupMasterDTO> pageBeanNew = groupMasterTagBiz.listPageGroupMaster(currentPage, numPerPage, paramMap); PageBeanNew<GroupTagDTO> pageBeanNew = groupTagBiz.listPageGroup4Brand(currentPage, numPerPage, paramMap);
return new ResponseDto<>(pageBeanNew); return new ResponseDto<>(pageBeanNew);
} }
/** /**
* 获取品牌方广告主 * 获取品牌方
*/ */
@Override @Override
@RequestMapping(value = "getBrandMaster", method = RequestMethod.GET) @RequestMapping(value = "getBrandMaster", method = RequestMethod.GET)
public ResponseDto<?> getBrandMaster(@RequestHeader("token") String token) throws PermissionException, BizException, JsonParseException { public ResponseDto<?> getBrandMaster(@RequestHeader("token") String token) throws PermissionException, BizException, JsonParseException {
SessionUtil.getVlaue(token, SessionUtil.PARTY_ID); SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
return new ResponseDto<>(groupMasterTagBiz.getBrandMaster()); return new ResponseDto<>(groupTagBiz.getAllBrand());
} }
/** /**
* 微信群标记广告主 * 微信群标记品牌方
*/ */
@Override @Override
@PostMapping("setGroupMaster") @PostMapping("setGroupMaster")
public ResponseDto<?> setGroupMaster(@RequestHeader("token") String token, @RequestBody @ApiParam GroupMasterAddDTO groupMasterAddDTO) throws PermissionException { public ResponseDto<?> setGroupMaster(@RequestHeader("token") String token, @RequestBody @ApiParam GroupTagAddDTO groupTagAddDTO) throws PermissionException {
SessionUtil.getVlaue(token, SessionUtil.PARTY_ID); SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
if (null == groupMasterAddDTO) { if (null == groupTagAddDTO) {
throw new BookBizException(BookBizException.PARAM_IS_NULL, "参数缺失!"); throw new BookBizException(BookBizException.PARAM_IS_NULL, "参数缺失!");
} }
if (ListUtils.isEmpty(groupMasterAddDTO.getGroupQrcodeIdList()) && null == groupMasterAddDTO.getMasterId()) { if (ListUtils.isEmpty(groupTagAddDTO.getGroupQrcodeIdList()) && null == groupTagAddDTO.getBrandId()) {
throw new BookBizException(BookBizException.PARAM_IS_NULL, "缺少微信群或广告主id!"); throw new BookBizException(BookBizException.PARAM_IS_NULL, "缺少微信群或品牌方id!");
} }
groupMasterTagBiz.setGroupMaster(groupMasterAddDTO); groupTagBiz.setGroupBrand(groupTagAddDTO);
return new ResponseDto<>(); return new ResponseDto<>();
} }
/** /**
* 广告主标记书刊列表 * 品牌方标记书刊列表
*/ */
@Override @Override
@RequestMapping(value = "listPageBook4AdMaster", method = RequestMethod.GET) @RequestMapping(value = "listPageBook4AdMaster", method = RequestMethod.GET)
public ResponseDto<PageBeanNew<Book4AdvertisingMasterDTO>> listPageBook4AdMaster( public ResponseDto<PageBeanNew<Book4AdvertisingTagDTO>> listPageBook4AdMaster(
@RequestHeader("token") String token, @RequestParam("currentPage") Integer currentPage, @RequestParam("numPerPage") Integer numPerPage, @RequestHeader("token") String token, @RequestParam("currentPage") Integer currentPage, @RequestParam("numPerPage") Integer numPerPage,
@RequestParam(value = "name", required = false) String name) throws PermissionException { @RequestParam(value = "name", required = false) String name) throws PermissionException {
SessionUtil.getVlaue(token, SessionUtil.PARTY_ID); SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
if (currentPage == null || numPerPage == null || currentPage < 0 || numPerPage < 0) { if (currentPage == null || numPerPage == null || currentPage < 0 || numPerPage < 0) {
throw BookBizException.PAGE_PARAM_DELETION; throw BookBizException.PAGE_PARAM_DELETION;
} }
PageBeanNew<Book4AdvertisingMasterDTO> pageBeanNew = groupMasterTagBiz.listPageBook4AdMaster(currentPage,numPerPage,name); PageBeanNew<Book4AdvertisingTagDTO> pageBeanNew = groupTagBiz.listPageBook4AdBrand(currentPage,numPerPage,name);
return new ResponseDto<>(pageBeanNew); return new ResponseDto<>(pageBeanNew);
} }
/** /**
* 品牌方广告主-微信群列表 * 品牌方账号-微信群列表
*/ */
@RequestMapping(value = "listPageGroupList4Master", method = RequestMethod.GET) @RequestMapping(value = "listPageGroupList4Master", method = RequestMethod.GET)
public ResponseDto<PageBeanNew<GroupMasterDTO>> listPageGroupList4Master( public ResponseDto<PageBeanNew<GroupTagDTO>> listPageGroupList4Master(
@RequestHeader("token") String token, @RequestParam("currentPage") Integer currentPage, @RequestParam("numPerPage") Integer numPerPage, @RequestHeader("token") String token, @RequestParam("currentPage") Integer currentPage, @RequestParam("numPerPage") Integer numPerPage,
@RequestParam(value = "name", required = false) String name, @RequestParam(value = "proLabelId", required = false) Long proLabelId, @RequestParam(value = "name", required = false) String name, @RequestParam(value = "proLabelId", required = false) Long proLabelId,
@RequestParam(value = "depLabelId", required = false) Long depLabelId, @RequestParam(value = "purLabelId", required = false) Long purLabelId, @RequestParam(value = "depLabelId", required = false) Long depLabelId, @RequestParam(value = "purLabelId", required = false) Long purLabelId,
...@@ -995,12 +997,12 @@ public class AdvertisingSpaceFacadeImpl implements AdvertisingSpaceFacade { ...@@ -995,12 +997,12 @@ public class AdvertisingSpaceFacadeImpl implements AdvertisingSpaceFacade {
paramMap.put("purLabelId", purLabelId); paramMap.put("purLabelId", purLabelId);
paramMap.put("startTime", startTime); paramMap.put("startTime", startTime);
paramMap.put("endTime", endTime); paramMap.put("endTime", endTime);
PageBeanNew<GroupMasterDTO> pageBeanNew = groupMasterTagBiz.listPageGroupList4Master(userId, currentPage, numPerPage, paramMap); PageBeanNew<GroupTagDTO> pageBeanNew = groupTagBiz.listPageGroupList4Brand(userId, currentPage, numPerPage, paramMap);
return new ResponseDto<>(pageBeanNew); return new ResponseDto<>(pageBeanNew);
} }
/** /**
* 导出-微信群广告主标记列表 * 导出-微信群品牌方标记列表
*/ */
@Override @Override
@RequestMapping(value = "exportGroupMaster", method = RequestMethod.GET) @RequestMapping(value = "exportGroupMaster", method = RequestMethod.GET)
...@@ -1008,34 +1010,28 @@ public class AdvertisingSpaceFacadeImpl implements AdvertisingSpaceFacade { ...@@ -1008,34 +1010,28 @@ public class AdvertisingSpaceFacadeImpl implements AdvertisingSpaceFacade {
@RequestHeader("token") String token, @RequestHeader("token") String token,
@RequestParam(value = "name", required = false) String name, @RequestParam(value = "proLabelId", required = false) Long proLabelId, @RequestParam(value = "name", required = false) String name, @RequestParam(value = "proLabelId", required = false) Long proLabelId,
@RequestParam(value = "depLabelId", required = false) Long depLabelId, @RequestParam(value = "purLabelId", required = false) Long purLabelId, @RequestParam(value = "depLabelId", required = false) Long depLabelId, @RequestParam(value = "purLabelId", required = false) Long purLabelId,
@RequestParam(value = "masterId", required = false) Long masterId) throws PermissionException { @RequestParam(value = "brandId", required = false) Long brandId) throws PermissionException {
Map<String, Object> map = SessionUtil.getToken4Redis(token); Map<String, Object> map = SessionUtil.getToken4Redis(token);
String isSystem = (String) map.get(SessionUtil.IS_SYSTEM); String isSystem = (String) map.get(SessionUtil.IS_SYSTEM);
Long partyId = (Long) map.get(SessionUtil.PARTY_ID); Long partyId = (Long) map.get(SessionUtil.PARTY_ID);
if (IsSystem.NOT_SYSTEM.code.equals(isSystem)) { if (IsSystem.NOT_SYSTEM.code.equals(isSystem)) {
partyId = (Long) map.get(SessionUtil.MEMBER_ID); partyId = (Long) map.get(SessionUtil.MEMBER_ID);
} }
groupMasterTagBiz.exportGroupMaster(name, proLabelId, depLabelId, purLabelId, masterId, partyId); groupTagBiz.exportGroupBrand(name, proLabelId, depLabelId, purLabelId, brandId, partyId);
return new ResponseDto<>(); return new ResponseDto<>();
} }
/** /**
* 品牌方广告主-微信群列表-导出 * 品牌方账号-微信群列表-导出
*/ */
@Override @Override
@RequestMapping(value = "exportGroupList4Master", method = RequestMethod.GET) @RequestMapping(value = "exportGroupList4Master", method = RequestMethod.GET)
public ResponseDto<PageBeanNew<GroupMasterDTO>> exportGroupList4Master( public ResponseDto<Map<String, Object>> exportGroupList4Master(
@RequestHeader("token") String token, @RequestHeader("token") String token,
@RequestParam(value = "name", required = false) String name, @RequestParam(value = "proLabelId", required = false) Long proLabelId, @RequestParam(value = "name", required = false) String name, @RequestParam(value = "proLabelId", required = false) Long proLabelId,
@RequestParam(value = "depLabelId", required = false) Long depLabelId, @RequestParam(value = "purLabelId", required = false) Long purLabelId, @RequestParam(value = "depLabelId", required = false) Long depLabelId, @RequestParam(value = "purLabelId", required = false) Long purLabelId,
@RequestParam(value = "startTime", required = false) String startTime, @RequestParam(value = "endTime", required = false) String endTime) throws PermissionException { @RequestParam(value = "startTime", required = false) String startTime, @RequestParam(value = "endTime", required = false) String endTime) throws PermissionException {
Map<String, Object> map = SessionUtil.getToken4Redis(token); Long userId = (Long) SessionUtil.getVlaue(token, SessionUtil.USER_ID);
String isSystem = (String) map.get(SessionUtil.IS_SYSTEM);
Long partyId = (Long) map.get(SessionUtil.PARTY_ID);
if (IsSystem.NOT_SYSTEM.code.equals(isSystem)) {
partyId = (Long) map.get(SessionUtil.MEMBER_ID);
}
Long userId = (Long) map.get(SessionUtil.USER_ID);
Map<String, Object> paramMap = new HashMap<>(); Map<String, Object> paramMap = new HashMap<>();
paramMap.put("name", name); paramMap.put("name", name);
paramMap.put("proLabelId", proLabelId); paramMap.put("proLabelId", proLabelId);
...@@ -1043,43 +1039,164 @@ public class AdvertisingSpaceFacadeImpl implements AdvertisingSpaceFacade { ...@@ -1043,43 +1039,164 @@ public class AdvertisingSpaceFacadeImpl implements AdvertisingSpaceFacade {
paramMap.put("purLabelId", purLabelId); paramMap.put("purLabelId", purLabelId);
paramMap.put("startTime", startTime); paramMap.put("startTime", startTime);
paramMap.put("endTime", endTime); paramMap.put("endTime", endTime);
groupMasterTagBiz.exportGroupList4Master(partyId, paramMap, userId); Map<String, Object> map = groupTagBiz.exportGroupList4Brand(paramMap, userId);
return new ResponseDto<>(); return new ResponseDto<>(map);
} }
/** /**
* 品牌方广告主-微信群基本信息列表 * 品牌方账号-微信群基本信息列表
*/ */
@Override @Override
@RequestMapping(value = "listPageGroupBaseInfo4Master", method = RequestMethod.GET) @RequestMapping(value = "listPageGroupBaseInfo4Master", method = RequestMethod.GET)
public ResponseDto<PageBeanNew<GroupMasterDTO>> listPageGroupBaseInfo4Master( public ResponseDto<PageBeanNew<GroupTagDTO>> listPageGroupBaseInfo4Master(
@RequestHeader("token") String token, @RequestParam("currentPage") Integer currentPage, @RequestHeader("token") String token, @RequestParam("currentPage") Integer currentPage,
@RequestParam("numPerPage") Integer numPerPage, @RequestParam(value = "name", required = false) String name) throws PermissionException { @RequestParam("numPerPage") Integer numPerPage, @RequestParam(value = "name", required = false) String name) throws PermissionException {
if (currentPage == null || numPerPage == null || currentPage < 0 || numPerPage < 0) {
throw BookBizException.PAGE_PARAM_DELETION;
}
Long userId = (Long) SessionUtil.getVlaue(token, SessionUtil.USER_ID); Long userId = (Long) SessionUtil.getVlaue(token, SessionUtil.USER_ID);
PageBeanNew<GroupMasterDTO> pageBeanNew = groupMasterTagBiz.listPageGroupBaseInfo4Master(currentPage, numPerPage, name, userId); PageBeanNew<GroupTagDTO> pageBeanNew = groupTagBiz.listPageGroupBaseInfo4Brand(currentPage, numPerPage, name, userId);
return new ResponseDto<>(pageBeanNew); return new ResponseDto<>(pageBeanNew);
} }
@ApiOperation(value = "更新广告主登录id,内部人员使用!!", httpMethod = "GET")
@GetMapping("updateMasterLoginId")
public ResponseDto<?> updateMasterLoginId(@RequestParam("masterId") Long masterId, @RequestParam("loginId") Long loginId) {
groupMasterTagBiz.updateMasterLoginId(masterId, loginId);
return new ResponseDto<>();
}
/** /**
* 广告主已标记的书刊id * 品牌方已标记的书刊id
*/ */
@Override @Override
@GetMapping("getTagBookIds4AdMatser") @GetMapping("getTagBookIds4AdMatser")
public ResponseDto<List<Long>> getTagBookIds4AdMatser( public ResponseDto<List<Long>> getTagBookIds4AdMatser(
@RequestHeader("token") String token, @RequestParam(value = "masterId", required = false) Long masterId) throws PermissionException { @RequestHeader("token") String token, @RequestParam(value = "brandId", required = false) Long brandId) throws PermissionException {
SessionUtil.getVlaue(token, SessionUtil.PARTY_ID); SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
if (null == masterId) { if (null == brandId) {
throw new BookBizException(BookBizException.ERROR, "请选择广告主"); throw new BookBizException(BookBizException.ERROR, "请选择品牌方");
} }
List<Long> bookIds = groupMasterTagBiz.getTagBookIds4AdMatser(masterId); List<Long> bookIds = groupTagBiz.getTagBookIds4AdBrand(brandId);
return new ResponseDto<>(bookIds); return new ResponseDto<>(bookIds);
} }
/**
* 创建品牌方账号
*/
@Override
@PostMapping("createBrand")
public ResponseDto<?> createBrand(@RequestHeader("token") String token, @RequestBody @ApiParam AdvertisingBrand advertisingBrand) throws PermissionException {
if (null == advertisingBrand) {
throw new BookBizException(BookBizException.PARAM_IS_NULL, "参数为空");
}
if (StringUtil.isEmpty(advertisingBrand.getBrandName())
|| StringUtil.isEmpty(advertisingBrand.getLoginName()) || StringUtil.isEmpty(advertisingBrand.getPassword())) {
throw new BookBizException(BookBizException.PARAM_IS_NULL, "用户名或密码为空");
}
Map<String, Object> map = SessionUtil.getToken4Redis(token);
String isSystem = (String) map.get(SessionUtil.IS_SYSTEM);
Long partyId = (Long) map.get(SessionUtil.PARTY_ID);
if (IsSystem.NOT_SYSTEM.code.equals(isSystem)) {
partyId = (Long) map.get(SessionUtil.MEMBER_ID);
}
advertisingBrand.setCreateUser(partyId);
Long id = groupTagBiz.createBrand(advertisingBrand);
return new ResponseDto<>(id);
}
/**
* 根据id获得品牌方信息
*/
@Override
@GetMapping("getBrandById")
public ResponseDto<AdvertisingBrandDTO> getBrandById(@RequestHeader("token") String token, @RequestParam("brandId") Long brandId) throws PermissionException {
if (null == brandId) {
throw new BookBizException(BookBizException.PARAM_IS_NULL, "品牌方id为空");
}
SessionUtil.getToken4Redis(token);
AdvertisingBrandDTO dto = groupTagBiz.getBrandById(brandId);
return new ResponseDto<>(dto);
}
/**
* 修改品牌方密码
*/
@Override
@PostMapping("updateBrandPassword")
public ResponseDto<?> updateBrandPassword(@RequestHeader("token") String token, @RequestBody @ApiParam AdvertisingBrand advertisingBrand) throws PermissionException {
if (null == advertisingBrand) {
throw new BookBizException(BookBizException.PARAM_IS_NULL, "参数为空");
}
if (null == advertisingBrand.getId() || StringUtil.isEmpty(advertisingBrand.getPassword())) {
throw new BookBizException(BookBizException.PARAM_IS_NULL, "id或密码为空");
}
Map<String, Object> map = SessionUtil.getToken4Redis(token);
String isSystem = (String) map.get(SessionUtil.IS_SYSTEM);
Long partyId = (Long) map.get(SessionUtil.PARTY_ID);
if (IsSystem.NOT_SYSTEM.code.equals(isSystem)) {
partyId = (Long) map.get(SessionUtil.MEMBER_ID);
}
advertisingBrand.setUpdateUser(partyId);
groupTagBiz.updateBrandPassword(advertisingBrand);
return new ResponseDto<>();
}
/**
* 根据id删除品牌方
*/
@Override
@GetMapping("deleteBrandById")
public ResponseDto<?> deleteBrandById(@RequestHeader("token") String token, @RequestParam("brandId") Long brandId) throws PermissionException {
if (null == brandId) {
throw new BookBizException(BookBizException.PARAM_IS_NULL, "品牌方id为空");
}
SessionUtil.getToken4Redis(token);
groupTagBiz.deleteBrandById(brandId);
return new ResponseDto<>();
}
/**
* 分页查询品牌方
*/
@Override
@GetMapping("listPageBrand")
public ResponseDto<PageBean> listPageBrand(
@RequestHeader("token") String token, @RequestParam("currentPage") Integer currentPage,
@RequestParam("numPerPage") Integer numPerPage, @RequestParam(value = "name", required = false) String name) throws PermissionException {
if (currentPage == null || numPerPage == null || currentPage < 0 || numPerPage < 0) {
throw BookBizException.PAGE_PARAM_DELETION;
}
SessionUtil.getToken4Redis(token);
PageBean pageBean = groupTagBiz.listPageBrand(currentPage, numPerPage, name);
return new ResponseDto<>(pageBean);
}
/**
* 品牌方登录
*/
@Override
@PostMapping("brandLogin")
public ResponseDto<?> brandLogin(@RequestBody @ApiParam AdvertisingBrandDTO advertisingBrandDTO) {
if (null == advertisingBrandDTO) {
throw new BookBizException(BookBizException.PARAM_IS_NULL, "参数为空");
}
if (StringUtil.isEmpty(advertisingBrandDTO.getLoginName()) || StringUtil.isEmpty(advertisingBrandDTO.getPassword())) {
throw new BookBizException(BookBizException.PARAM_IS_NULL, "用户名或密码为空");
}
Map<String, Object> map = groupTagBiz.brandLogin(advertisingBrandDTO);
return new ResponseDto<>(map);
}
@ApiOperation(value = "品牌方旧数据处理---内部使用!!",httpMethod = "GET")
@GetMapping("dealOldBrandStatistic")
public ResponseDto<?> dealOldBrandStatistic(){
groupTagBiz.dealOldBrandStatistic();
return new ResponseDto<>();
}
/**
* 获得品牌方登录信息
*/
@Override
@GetMapping("getBrandLoginInfo")
public ResponseDto<?> getBrandLoginInfo(@RequestHeader("token") String token) throws PermissionException {
Long userId = (Long) SessionUtil.getVlaue(token, SessionUtil.USER_ID);
Map<String, Object> map = groupTagBiz.getBrandLoginInfo(userId);
return new ResponseDto<>(map);
}
} }
package com.pcloud.book.advertising.service.impl; package com.pcloud.book.advertising.service.impl;
import com.pcloud.book.advertising.biz.AdvertisingSpaceBiz; import com.pcloud.book.advertising.biz.AdvertisingSpaceBiz;
import com.pcloud.book.advertising.biz.GroupMasterTagBiz; import com.pcloud.book.advertising.biz.GroupTagBiz;
import com.pcloud.book.advertising.service.AdvertisingSpaceService; import com.pcloud.book.advertising.service.AdvertisingSpaceService;
import com.pcloud.common.core.aspect.ParamLog; import com.pcloud.common.core.aspect.ParamLog;
import com.pcloud.common.dto.ResponseDto; import com.pcloud.common.dto.ResponseDto;
...@@ -38,7 +38,7 @@ public class AdvertisingSpaceServiceImpl implements AdvertisingSpaceService { ...@@ -38,7 +38,7 @@ public class AdvertisingSpaceServiceImpl implements AdvertisingSpaceService {
@Autowired @Autowired
private AdvertisingSpaceBiz advertisingSpaceBiz; private AdvertisingSpaceBiz advertisingSpaceBiz;
@Autowired @Autowired
private GroupMasterTagBiz groupMasterTagBiz; private GroupTagBiz groupTagBiz;
/** /**
* 每日凌晨计算昨日广告位收益 * 每日凌晨计算昨日广告位收益
...@@ -61,7 +61,16 @@ public class AdvertisingSpaceServiceImpl implements AdvertisingSpaceService { ...@@ -61,7 +61,16 @@ public class AdvertisingSpaceServiceImpl implements AdvertisingSpaceService {
@GetMapping("getTagWxGroupIdsByUserId") @GetMapping("getTagWxGroupIdsByUserId")
@ParamLog("根据登录用户获取标记的微信群列表") @ParamLog("根据登录用户获取标记的微信群列表")
public ResponseEntity<ResponseDto<List<String>>> getTagWxGroupIdsByUserId(@RequestParam("userId") Long userId) { public ResponseEntity<ResponseDto<List<String>>> getTagWxGroupIdsByUserId(@RequestParam("userId") Long userId) {
List<String> list = groupMasterTagBiz.getTagWxGroupIdsByUserId(userId); List<String> list = groupTagBiz.getTagWxGroupIdsByUserId(userId);
return ResponseHandleUtil.toResponse(list); return ResponseHandleUtil.toResponse(list);
} }
@Override
@GetMapping("getBrandIdsByWxGroupId")
@ParamLog("查微信群标记的品牌方id")
public ResponseEntity<ResponseDto<List<Long>>> getBrandIdsByWxGroupId(@RequestParam("wxGroupId") String wxGroupId) {
List<Long> brandIds = groupTagBiz.getBrandIdsByWxGroupId(wxGroupId);
return ResponseHandleUtil.toResponse(brandIds);
}
} }
...@@ -77,38 +77,6 @@ public class PartyConsr { ...@@ -77,38 +77,6 @@ public class PartyConsr {
return partyIdListVO; return partyIdListVO;
} }
@ParamLog("创建平台端登录账号")
public Long addLoginAccount(String loginName, String password) {
Long loginId = null;
try {
//todo
loginId = 000l;
} catch (Exception e) {
LOGGER.error("【用户中心】创建平台端登录账号失败" + e.getMessage(), e);
}
return loginId;
}
@ParamLog("修改平台端登录账号")
public void updateLoginAccount(String loginName, String password, Long loginId) {
try {
//todo
} catch (Exception e) {
LOGGER.error("【用户中心】修改平台端登录账号失败" + e.getMessage(), e);
}
}
@ParamLog("删除登录账号")
public void deleteLoginAccount(Long loginId) {
try {
//todo
} catch (Exception e) {
LOGGER.error("【用户中心】删除平台端登录账号失败" + e.getMessage(), e);
}
}
@ParamLog("获取登录账号信息") @ParamLog("获取登录账号信息")
public UserLogin getUserLoginInfo(Long loginId) { public UserLogin getUserLoginInfo(Long loginId) {
......
...@@ -976,11 +976,12 @@ public class BookGroupClassifyBizImpl implements BookGroupClassifyBiz { ...@@ -976,11 +976,12 @@ public class BookGroupClassifyBizImpl implements BookGroupClassifyBiz {
@ParamLog("获取编辑的分类") @ParamLog("获取编辑的分类")
public PageBeanNew<AdviserClassifyVO> listAdviserClassify(Long adviserId, AdviserClassifyParam adviserClassifyParam) { public PageBeanNew<AdviserClassifyVO> listAdviserClassify(Long adviserId, AdviserClassifyParam adviserClassifyParam) {
PageParam pageParam = new PageParam(adviserClassifyParam.getCurrentPage(), adviserClassifyParam.getNumPerPage()); PageParam pageParam = new PageParam(adviserClassifyParam.getCurrentPage(), adviserClassifyParam.getNumPerPage());
Map<String,Object> paramMap = new HashMap<>(); Map<String, Object> paramMap = new HashMap<>();
paramMap.put("adviserId",adviserId); paramMap.put("adviserId", adviserId);
paramMap.put("classify",adviserClassifyParam.getClassify()); paramMap.put("classify", adviserClassifyParam.getClassify());
paramMap.put("bookId", adviserClassifyParam.getBookId());
PageBeanNew<AdviserClassifyVO> pageBeanNew = bookGroupClassifyDao.listPageNew(pageParam, paramMap, "listAdviserClassify"); PageBeanNew<AdviserClassifyVO> pageBeanNew = bookGroupClassifyDao.listPageNew(pageParam, paramMap, "listAdviserClassify");
if(pageBeanNew == null){ if (pageBeanNew == null) {
return new PageBeanNew<>(adviserClassifyParam.getCurrentPage(), adviserClassifyParam.getNumPerPage(), new ArrayList<>()); return new PageBeanNew<>(adviserClassifyParam.getCurrentPage(), adviserClassifyParam.getNumPerPage(), new ArrayList<>());
} }
return pageBeanNew; return pageBeanNew;
......
package com.pcloud.book.group.biz.impl; package com.pcloud.book.group.biz.impl;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import com.pcloud.book.advertising.biz.AdvertisingSpaceBiz; import com.pcloud.book.advertising.biz.AdvertisingSpaceBiz;
import com.pcloud.book.advertising.biz.GroupMasterTagBiz; import com.pcloud.book.advertising.biz.GroupTagBiz;
import com.pcloud.book.advertising.dto.QrcodeAdvertisingSpaceCountDTO; import com.pcloud.book.advertising.dto.QrcodeAdvertisingSpaceCountDTO;
import com.pcloud.book.base.exception.BookBizException; import com.pcloud.book.base.exception.BookBizException;
import com.pcloud.book.consumer.label.LabelConsr; import com.pcloud.book.consumer.label.LabelConsr;
...@@ -16,9 +15,7 @@ import com.pcloud.book.group.biz.BookGroupClassifyBiz; ...@@ -16,9 +15,7 @@ import com.pcloud.book.group.biz.BookGroupClassifyBiz;
import com.pcloud.book.group.biz.GroupAnnouncementBiz; import com.pcloud.book.group.biz.GroupAnnouncementBiz;
import com.pcloud.book.group.biz.GroupQrcodeBiz; import com.pcloud.book.group.biz.GroupQrcodeBiz;
import com.pcloud.book.group.biz.WeixinQrcodeBiz; import com.pcloud.book.group.biz.WeixinQrcodeBiz;
import com.pcloud.book.group.constants.BookBusinessConstants;
import com.pcloud.book.group.dao.GroupQrcodeDao; import com.pcloud.book.group.dao.GroupQrcodeDao;
import com.pcloud.book.group.dto.AutoUpdateGroupNumDTO;
import com.pcloud.book.group.dto.BookWxQrcodeDTO; import com.pcloud.book.group.dto.BookWxQrcodeDTO;
import com.pcloud.book.group.dto.ChangeGroupNameDTO; import com.pcloud.book.group.dto.ChangeGroupNameDTO;
import com.pcloud.book.group.dto.GroupAndUserNumberDTO; import com.pcloud.book.group.dto.GroupAndUserNumberDTO;
...@@ -67,16 +64,11 @@ import org.springframework.util.CollectionUtils; ...@@ -67,16 +64,11 @@ import org.springframework.util.CollectionUtils;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Objects; import java.util.Objects;
import java.util.Optional; import java.util.Optional;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
...@@ -116,7 +108,7 @@ public class GroupQrcodeBizImpl implements GroupQrcodeBiz { ...@@ -116,7 +108,7 @@ public class GroupQrcodeBizImpl implements GroupQrcodeBiz {
@Autowired @Autowired
private BookGroupBiz bookGroupBiz; private BookGroupBiz bookGroupBiz;
@Autowired @Autowired
private GroupMasterTagBiz groupMasterTagBiz; private GroupTagBiz groupTagBiz;
/** /**
...@@ -240,7 +232,6 @@ public class GroupQrcodeBizImpl implements GroupQrcodeBiz { ...@@ -240,7 +232,6 @@ public class GroupQrcodeBizImpl implements GroupQrcodeBiz {
} }
} }
String url = null; String url = null;
List<ClassifyQrcodeVO> canUserQrcode = Lists.newArrayList();
for (ClassifyQrcodeVO vo : collect) { for (ClassifyQrcodeVO vo : collect) {
if (vo.getUserNumber() >= classify.getChangeNumber()) { if (vo.getUserNumber() >= classify.getChangeNumber()) {
//将二维码修改为已满群状态 //将二维码修改为已满群状态
...@@ -252,14 +243,9 @@ public class GroupQrcodeBizImpl implements GroupQrcodeBiz { ...@@ -252,14 +243,9 @@ public class GroupQrcodeBizImpl implements GroupQrcodeBiz {
log.info("[前端调用切群接口] getChangeGroupQrCode 处理超出了但是没有更新状态的群 vo:{}", vo); log.info("[前端调用切群接口] getChangeGroupQrCode 处理超出了但是没有更新状态的群 vo:{}", vo);
} }
if (vo.getUserNumber() < classify.getChangeNumber()) { if (vo.getUserNumber() < classify.getChangeNumber()) {
canUserQrcode.add(vo); url = vo.getQrcodeUrl();
} }
} }
// 获取群人数最少的可用群二维码返回出去
if (!CollectionUtils.isEmpty(canUserQrcode)) {
ClassifyQrcodeVO vo = canUserQrcode.stream().min(Comparator.comparingInt(ClassifyQrcodeVO::getUserNumber)).orElseGet(ClassifyQrcodeVO::new);
url = StringUtil.isBlank(vo.getQrcodeUrl()) ? null : vo.getQrcodeUrl();
}
if (Objects.isNull(url)) { if (Objects.isNull(url)) {
// 如果没有群则新增一个 // 如果没有群则新增一个
String qrcodeUrl = changeGroupQrCode(classifyId); String qrcodeUrl = changeGroupQrCode(classifyId);
...@@ -269,7 +255,6 @@ public class GroupQrcodeBizImpl implements GroupQrcodeBiz { ...@@ -269,7 +255,6 @@ public class GroupQrcodeBizImpl implements GroupQrcodeBiz {
return url; return url;
} }
@Override @Override
public String changeGroupQrCode(Long classifyId) { public String changeGroupQrCode(Long classifyId) {
return changeGroup(classifyId); return changeGroup(classifyId);
...@@ -336,7 +321,7 @@ public class GroupQrcodeBizImpl implements GroupQrcodeBiz { ...@@ -336,7 +321,7 @@ public class GroupQrcodeBizImpl implements GroupQrcodeBiz {
public Long insert(GroupQrcode groupQrcode) { public Long insert(GroupQrcode groupQrcode) {
groupQrcodeDao.insert(groupQrcode); groupQrcodeDao.insert(groupQrcode);
//判断广告位标记 //判断广告位标记
groupMasterTagBiz.addTagByBookGroup(groupQrcode.getClassifyId(), groupQrcode.getId()); groupTagBiz.addTagByBookGroup(groupQrcode.getClassifyId(), groupQrcode.getId());
return groupQrcode.getId(); return groupQrcode.getId();
} }
......
package com.pcloud.book.group.dao; package com.pcloud.book.group.dao;
import com.pcloud.book.advertising.dto.GroupMasterDTO; import com.pcloud.book.advertising.dto.GroupTagDTO;
import com.pcloud.book.advertising.dto.WeixinClassifyInfoDTO; import com.pcloud.book.advertising.dto.WeixinClassifyInfoDTO;
import com.pcloud.book.group.dto.*; import com.pcloud.book.group.dto.*;
import com.pcloud.book.group.entity.GroupQrcode; import com.pcloud.book.group.entity.GroupQrcode;
...@@ -236,11 +236,11 @@ public interface GroupQrcodeDao extends BaseDao<GroupQrcode> { ...@@ -236,11 +236,11 @@ public interface GroupQrcodeDao extends BaseDao<GroupQrcode> {
public Map<String, Object> getGroupCountUserCountByBookId(Long bookId); public Map<String, Object> getGroupCountUserCountByBookId(Long bookId);
/** /**
* 查询微信群广告标记列表 * 查询微信群品牌方标记列表
* @param map * @param map
* @return * @return
*/ */
public List<GroupMasterDTO> listPageGroupMaster(Map<String, Object> map); public List<GroupTagDTO> listPageGroup4Brand(Map<String, Object> map);
List<ClassifyQrcodeVO> getQrcodeByClassify(Long classifyId); List<ClassifyQrcodeVO> getQrcodeByClassify(Long classifyId);
......
...@@ -2,7 +2,7 @@ package com.pcloud.book.group.dao.impl; ...@@ -2,7 +2,7 @@ package com.pcloud.book.group.dao.impl;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import com.pcloud.book.advertising.dto.GroupMasterDTO; import com.pcloud.book.advertising.dto.GroupTagDTO;
import com.pcloud.book.advertising.dto.WeixinClassifyInfoDTO; import com.pcloud.book.advertising.dto.WeixinClassifyInfoDTO;
import com.pcloud.book.group.dao.GroupQrcodeDao; import com.pcloud.book.group.dao.GroupQrcodeDao;
import com.pcloud.book.group.dto.*; import com.pcloud.book.group.dto.*;
...@@ -242,8 +242,8 @@ public class GroupQrcodeDaoImpl extends BaseDaoImpl<GroupQrcode> implements Grou ...@@ -242,8 +242,8 @@ public class GroupQrcodeDaoImpl extends BaseDaoImpl<GroupQrcode> implements Grou
} }
@Override @Override
public List<GroupMasterDTO> listPageGroupMaster(Map<String, Object> map) { public List<GroupTagDTO> listPageGroup4Brand(Map<String, Object> map) {
return getSessionTemplate().selectList(getStatement("listPageGroupMaster"), map); return getSessionTemplate().selectList(getStatement("listPageGroup4Brand"), map);
} }
} }
...@@ -18,6 +18,9 @@ public class AdviserClassifyParam { ...@@ -18,6 +18,9 @@ public class AdviserClassifyParam {
@ApiModelProperty("分类名称") @ApiModelProperty("分类名称")
private String classify; private String classify;
@ApiModelProperty("图书id")
private Long bookId;
public Integer getCurrentPage() { public Integer getCurrentPage() {
return currentPage; return currentPage;
} }
...@@ -42,12 +45,21 @@ public class AdviserClassifyParam { ...@@ -42,12 +45,21 @@ public class AdviserClassifyParam {
this.classify = classify; this.classify = classify;
} }
public Long getBookId() {
return bookId;
}
public void setBookId(Long bookId) {
this.bookId = bookId;
}
@Override @Override
public String toString() { public String toString() {
return "AdviserClassifyParam{" + return "AdviserClassifyParam{" +
"currentPage=" + currentPage + "currentPage=" + currentPage +
", numPerPage=" + numPerPage + ", numPerPage=" + numPerPage +
", classify='" + classify + '\'' + ", classify='" + classify + '\'' +
", bookId=" + bookId +
'}'; '}';
} }
} }
<?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.AdvertisingBrandDaoImpl" >
<resultMap id="BaseResultMap" type="com.pcloud.book.advertising.entity.AdvertisingBrand" >
<id column="id" property="id" jdbcType="BIGINT" />
<result column="brand_name" property="brandName" jdbcType="VARCHAR" />
<result column="login_name" property="loginName" jdbcType="VARCHAR" />
<result column="password" property="password" jdbcType="VARCHAR" />
<result column="is_delete" property="isDelete" jdbcType="BIT" />
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
<result column="create_user" property="createUser" jdbcType="BIGINT" />
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
<result column="update_user" property="updateUser" jdbcType="BIGINT" />
</resultMap>
<sql id="Base_Column_List" >
id, brand_name, login_name, password, is_delete, create_time, create_user, update_time,
update_user
</sql>
<insert id="insert" parameterType="com.pcloud.book.advertising.entity.AdvertisingBrand" useGeneratedKeys="true" keyProperty="id">
insert into advertising_brand (brand_name, login_name,
password, is_delete, create_time,
create_user
)
values (#{brandName,jdbcType=VARCHAR}, #{loginName,jdbcType=VARCHAR},
#{password,jdbcType=VARCHAR}, #{isDelete,jdbcType=BIT}, NOW(),
#{createUser,jdbcType=BIGINT}
)
</insert>
<update id="update" parameterType="com.pcloud.book.advertising.entity.AdvertisingBrand" >
update advertising_brand
<set >
<if test="password != null" >
password = #{password,jdbcType=VARCHAR},
</if>
update_time = NOW(),
<if test="updateUser != null" >
update_user = #{updateUser,jdbcType=BIGINT},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<select id="getByGroupQrcodeId" parameterType="long" resultType="com.pcloud.book.advertising.dto.AdvertisingBrandDTO">
SELECT
b.id id,
b.brand_name brandName
FROM
advertising_group_tag t
LEFT JOIN advertising_brand b ON t.brand_id = b.id
WHERE
t.group_qrcode_id = #{groupQrcodeId}
AND b.is_delete = 0
ORDER BY b.id ASC
</select>
<select id="getAllBrand" resultType="com.pcloud.book.advertising.dto.AdvertisingBrandDTO">
SELECT
id id,
brand_name brandName
FROM
advertising_brand
WHERE
is_delete = 0
ORDER BY id ASC
</select>
<update id="deleteBrand" parameterType="long">
update advertising_brand
set is_delete = 1
where id = #{id,jdbcType=BIGINT}
</update>
<select id="getBrandById" parameterType="long" resultType="com.pcloud.book.advertising.dto.AdvertisingBrandDTO">
SELECT
brand_name brandName,
login_name loginName,
password password
FROM
advertising_brand
WHERE
is_delete = 0
AND id = #{id,jdbcType=BIGINT}
</select>
<select id="checkBrandNameRepeat" parameterType="string" resultType="boolean">
SELECT
EXISTS (
SELECT
brand_name
FROM
advertising_brand
WHERE
brand_name = #{brandName}
AND is_delete = 0
)
</select>
<select id="checkLoginNameRepeat" resultType="boolean" parameterType="string">
SELECT
EXISTS (
SELECT
brand_name
FROM
advertising_brand
WHERE
login_name = #{loginName}
AND is_delete = 0
)
</select>
<select id="listPageBrand" parameterType="map" resultType="com.pcloud.book.advertising.dto.AdvertisingBrandDTO">
SELECT
id id,
brand_name brandName,
login_name loginName,
create_time createTime
FROM
advertising_brand
WHERE
is_delete = 0
<if test="name != null">
AND login_name LIKE concat('%', #{name}, '%')
</if>
ORDER BY
create_time DESC
</select>
<select id="getLoginInfo" parameterType="map" resultMap="BaseResultMap">
SELECT
<include refid="Base_Column_List"/>
FROM
advertising_brand
WHERE
login_name = #{loginName}
AND is_delete = 0
LIMIT 1
</select>
</mapper>
\ No newline at end of file
...@@ -5,52 +5,52 @@ ...@@ -5,52 +5,52 @@
<id column="id" property="id" jdbcType="BIGINT" /> <id column="id" property="id" jdbcType="BIGINT" />
<result column="tag_book_id" property="tagBookId" jdbcType="BIGINT" /> <result column="tag_book_id" property="tagBookId" jdbcType="BIGINT" />
<result column="group_qrcode_id" property="groupQrcodeId" jdbcType="BIGINT" /> <result column="group_qrcode_id" property="groupQrcodeId" jdbcType="BIGINT" />
<result column="master_id" property="masterId" jdbcType="BIGINT" /> <result column="brand_id" property="brandId" jdbcType="BIGINT" />
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" /> <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
</resultMap> </resultMap>
<sql id="Base_Column_List" > <sql id="Base_Column_List" >
id, tag_book_id, group_qrcode_id, master_id, create_time id, tag_book_id, group_qrcode_id, brand_id, create_time
</sql> </sql>
<insert id="insert" parameterType="com.pcloud.book.advertising.entity.AdvertisingGroupTag" useGeneratedKeys="true" keyProperty="id"> <insert id="insert" parameterType="com.pcloud.book.advertising.entity.AdvertisingGroupTag" useGeneratedKeys="true" keyProperty="id">
insert into advertising_group_tag (tag_book_id, group_qrcode_id, insert into advertising_group_tag (tag_book_id, group_qrcode_id,
master_id, create_time) brand_id, create_time)
values (#{tagBookId,jdbcType=BIGINT}, #{groupQrcodeId,jdbcType=BIGINT}, values (#{tagBookId,jdbcType=BIGINT}, #{groupQrcodeId,jdbcType=BIGINT},
#{masterId,jdbcType=BIGINT},NOW()) #{brandId,jdbcType=BIGINT},NOW())
</insert> </insert>
<delete id="deleteByMasterId" parameterType="long"> <delete id="deleteByBrandId" parameterType="long">
DELETE DELETE
FROM FROM
advertising_group_tag advertising_group_tag
WHERE WHERE
master_id = #{masterId} brand_id = #{brandId}
</delete> </delete>
<insert id="batchInsert" parameterType="com.pcloud.book.advertising.entity.AdvertisingGroupTag" useGeneratedKeys="true" keyProperty="id"> <insert id="batchInsert" parameterType="com.pcloud.book.advertising.entity.AdvertisingGroupTag" useGeneratedKeys="true" keyProperty="id">
insert into advertising_group_tag ( insert into advertising_group_tag (
tag_book_id, tag_book_id,
group_qrcode_id, group_qrcode_id,
master_id, brand_id,
create_time create_time
) values ) values
<foreach collection="list" item="item" index="index" <foreach collection="list" item="item" index="index"
separator=","> separator=",">
(#{item.tagBookId,jdbcType=BIGINT}, (#{item.tagBookId,jdbcType=BIGINT},
#{item.groupQrcodeId,jdbcType=BIGINT}, #{item.groupQrcodeId,jdbcType=BIGINT},
#{item.masterId,jdbcType=BIGINT}, #{item.brandId,jdbcType=BIGINT},
NOW()) NOW())
</foreach> </foreach>
</insert> </insert>
<select id="getBookIdsByMasterId" parameterType="long" resultType="long"> <select id="getBookIdsByBrandId" parameterType="long" resultType="long">
SELECT DISTINCT SELECT DISTINCT
tag_book_id tag_book_id
FROM FROM
advertising_group_tag advertising_group_tag
WHERE WHERE
master_id = #{masterId} brand_id = #{brandId}
AND tag_book_id IS NOT NULL AND tag_book_id IS NOT NULL
AND group_qrcode_id = 0 AND group_qrcode_id = 0
</select> </select>
...@@ -62,13 +62,13 @@ ...@@ -62,13 +62,13 @@
WHERE group_qrcode_id = #{groupQrcodeId} WHERE group_qrcode_id = #{groupQrcodeId}
</delete> </delete>
<select id="getGroupQrcodeIdsByMasterId" parameterType="long" resultType="long"> <select id="getGroupQrcodeIdsByBrandId" parameterType="long" resultType="long">
SELECT DISTINCT SELECT DISTINCT
group_qrcode_id group_qrcode_id
FROM FROM
advertising_group_tag advertising_group_tag
WHERE WHERE
master_id = #{masterId} brand_id = #{brandId}
AND group_qrcode_id != 0 AND group_qrcode_id != 0
</select> </select>
...@@ -77,31 +77,49 @@ ...@@ -77,31 +77,49 @@
FROM FROM
advertising_group_tag advertising_group_tag
WHERE WHERE
master_id = #{masterId} brand_id = #{brandId}
AND tag_book_id in AND tag_book_id in
<foreach collection="bookIds" index="index" item="item" open="(" separator="," close=")"> <foreach collection="bookIds" index="index" item="item" open="(" separator="," close=")">
${item} ${item}
</foreach> </foreach>
</delete> </delete>
<select id="getTagWxGroupIdsByMasterId" parameterType="long" resultType="string"> <select id="getTagWxGroupIdsByBrandId" parameterType="long" resultType="string">
SELECT DISTINCT SELECT DISTINCT
q.weixin_group_id q.weixin_group_id
FROM FROM
book_group_qrcode q book_group_qrcode q
LEFT JOIN advertising_group_tag t ON q.id = t.group_qrcode_id LEFT JOIN advertising_group_tag t ON q.id = t.group_qrcode_id
WHERE WHERE
t.master_id = #{masterId} t.brand_id = #{brandId}
AND q.weixin_group_id IS NOT NULL AND q.weixin_group_id IS NOT NULL
</select> </select>
<select id="getMasterIdsByBookId" parameterType="long" resultType="long"> <select id="getBrandIdsByBookId" parameterType="long" resultType="long">
SELECT DISTINCT SELECT DISTINCT
master_id brand_id
FROM FROM
advertising_group_tag advertising_group_tag
WHERE WHERE
tag_book_id = #{bookId} tag_book_id = #{bookId}
AND group_qrcode_id = 0 AND group_qrcode_id = 0
</select> </select>
<select id="getBrandIdsByWxGroupId" parameterType="string" resultType="long">
SELECT DISTINCT
t.brand_id
FROM
advertising_group_tag t
LEFT JOIN book_group_qrcode q ON t.group_qrcode_id = q.id
WHERE
q.weixin_group_id = #{wxGroupId}
</select>
<update id="updateId" parameterType="map">
UPDATE advertising_group_tag
SET brand_id = #{brandId}
WHERE
brand_id = #{masterId}
</update>
</mapper> </mapper>
\ No newline at end of file
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
<result column="master_name" property="masterName" jdbcType="VARCHAR"/> <result column="master_name" property="masterName" jdbcType="VARCHAR"/>
<result column="create_time" property="createTime" jdbcType="TIMESTAMP"/> <result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP"/> <result column="update_time" property="updateTime" jdbcType="TIMESTAMP"/>
<result column="login_id" property="loginId" jdbcType="BIGINT"/>
</resultMap> </resultMap>
<resultMap id="AdvertisingMasterDTO" type="com.pcloud.book.advertising.dto.AdvertisingMasterDTO"> <resultMap id="AdvertisingMasterDTO" type="com.pcloud.book.advertising.dto.AdvertisingMasterDTO">
...@@ -14,11 +13,10 @@ ...@@ -14,11 +13,10 @@
<result column="master_name" property="masterName" jdbcType="VARCHAR"/> <result column="master_name" property="masterName" jdbcType="VARCHAR"/>
<result column="create_time" property="createTime" jdbcType="TIMESTAMP"/> <result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP"/> <result column="update_time" property="updateTime" jdbcType="TIMESTAMP"/>
<result column="login_id" property="loginId" jdbcType="BIGINT"/>
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, master_name, create_time, update_time, login_id id, master_name, create_time, update_time
</sql> </sql>
<select id="getById" resultMap="BaseResultMap" parameterType="java.lang.Long"> <select id="getById" resultMap="BaseResultMap" parameterType="java.lang.Long">
...@@ -86,13 +84,11 @@ ...@@ -86,13 +84,11 @@
master_name, master_name,
create_time, create_time,
update_time, update_time,
login_id,
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
#{masterName,jdbcType=VARCHAR}, #{masterName,jdbcType=VARCHAR},
NOW(), NOW(),
NOW(), NOW(),
#{loginId},
</trim> </trim>
</insert> </insert>
...@@ -103,50 +99,26 @@ ...@@ -103,50 +99,26 @@
master_name = #{masterName,jdbcType=VARCHAR}, master_name = #{masterName,jdbcType=VARCHAR},
</if> </if>
update_time = NOW(), update_time = NOW(),
<if test="loginId != null">
login_id = #{loginId},
</if>
</set> </set>
where id = #{id,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT}
</update> </update>
<select id="getByGroup" parameterType="long" resultType="com.pcloud.book.advertising.entity.AdvertisingMaster"> <select id="getMasterBrand" resultType="com.pcloud.book.advertising.dto.OldBrandMasterDTO">
SELECT
m.id id,
m.master_name masterName
FROM
advertising_master m
LEFT JOIN advertising_group_tag t ON m.id = t.master_id
WHERE
t.group_qrcode_id = #{groupQrcodeId}
</select>
<select id="getBrandMaster" resultType="com.pcloud.book.advertising.dto.AdvertisingMasterDTO">
SELECT SELECT
m.id id, id id,
m.master_name masterName master_name masterName,
FROM login_id loginId
advertising_master m
LEFT JOIN advertising_settlement_method s ON m.id = s.master_id
WHERE
s.settlement_method = 'Brand'
GROUP BY
m.id
</select>
<select id="getIdByUserLoginId" resultType="long" parameterType="long">
SELECT
id
FROM FROM
advertising_master advertising_master
WHERE WHERE
login_id = #{loginId} login_id IS NOT NULL
</select> </select>
<update id="updateMasterLoginId" parameterType="map"> <update id="updateLoginId" parameterType="string">
UPDATE advertising_master UPDATE advertising_master
SET login_id = #{loginId} SET login_id = NULL
WHERE WHERE
id = #{masterId} master_name = #{masterName}
</update> </update>
</mapper> </mapper>
\ No newline at end of file
...@@ -698,6 +698,9 @@ ...@@ -698,6 +698,9 @@
<if test="classify!=null"> <if test="classify!=null">
and classify like concat('%', #{classify}, '%') and classify like concat('%', #{classify}, '%')
</if> </if>
<if test="bookId != null">
AND c.book_id = #{bookId}
</if>
</select> </select>
<select id="getProAssocGroupAndUserNumber" resultType="ProAssocGroupAndUserNumberDTO" parameterType="Long"> <select id="getProAssocGroupAndUserNumber" resultType="ProAssocGroupAndUserNumberDTO" parameterType="Long">
......
...@@ -344,7 +344,7 @@ ...@@ -344,7 +344,7 @@
where id = #{bookGroupId} and is_delete = 0 where id = #{bookGroupId} and is_delete = 0
</update> </update>
<select id="listPageBook4AdMaster" parameterType="map" resultType="com.pcloud.book.advertising.dto.Book4AdvertisingMasterDTO"> <select id="listPageBook4AdBrand" parameterType="map" resultType="com.pcloud.book.advertising.dto.Book4AdvertisingTagDTO">
SELECT SELECT
b.BOOK_ID bookId, b.BOOK_ID bookId,
b.ISBN isbn, b.ISBN isbn,
......
...@@ -559,7 +559,7 @@ ...@@ -559,7 +559,7 @@
id = #{qrcodeId} id = #{qrcodeId}
</update> </update>
<select id="listPageGroupMaster" parameterType="map" resultType="com.pcloud.book.advertising.dto.GroupMasterDTO"> <select id="listPageGroup4Brand" parameterType="map" resultType="com.pcloud.book.advertising.dto.GroupTagDTO">
SELECT SELECT
q.weixin_group_id wxGroupId, q.weixin_group_id wxGroupId,
q.id groupQrcodeId, q.id groupQrcodeId,
...@@ -610,8 +610,8 @@ ...@@ -610,8 +610,8 @@
<if test="purLabelId != null"> <if test="purLabelId != null">
AND bg.pur_label_id = #{purLabelId} AND bg.pur_label_id = #{purLabelId}
</if> </if>
<if test="masterId != null"> <if test="brandId != null">
AND t.master_id = #{masterId} AND t.brand_id = #{brandId}
</if> </if>
<if test="startTime != null and endTime!= null"> <if test="startTime != null and endTime!= null">
AND t.create_time BETWEEN #{startTime} AND #{endTime} AND t.create_time BETWEEN #{startTime} AND #{endTime}
......
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