Commit 05feca4c by 阮思源

Merge branch 'master' into feat-1001857

parents c7dd0d00 b382a120
......@@ -17,4 +17,30 @@ public interface AdNewsDao extends BaseDao<AdNews> {
* @return
*/
List<AdNews> getNewsToSendBySetIdAndAdviser4Own(Long adNewsSetId, Long adviserId, Integer top);
/**
* 根据标签匹配新闻————新闻标题
* @param adNewsSetId
* @param adviserId
* @param beginTime
* @param proLabelName
* @param depLabelName
* @param purLabelName
* @param top
* @return
*/
List<AdNews> getNewsByLabelName(Long adNewsSetId, Long adviserId, String beginTime, String proLabelName, String depLabelName, String purLabelName, Integer top);
/**
* 根据标签匹配新闻————公众号名称
* @param adNewsSetId
* @param adviserId
* @param beginTime
* @param proLabelName
* @param depLabelName
* @param purLabelName
* @param top
* @return
*/
List<AdNews> getNews4WechatByLabelName(Long adNewsSetId, Long adviserId, String beginTime, String proLabelName, String depLabelName, String purLabelName, Integer top);
}
......@@ -33,4 +33,30 @@ public class AdNewsDaoImpl extends BaseDaoImpl<AdNews> implements AdNewsDao {
map.put("top", top);
return super.getSqlSession().selectList(getStatement("getNewsToSendBySetIdAndAdviser4Own"), map);
}
@Override
public List<AdNews> getNewsByLabelName(Long adNewsSetId, Long adviserId, String beginTime, String proLabelName, String depLabelName, String purLabelName, Integer top) {
Map<String, Object> map = new HashMap<>();
map.put("adNewsSetId", adNewsSetId);
map.put("adviserId", adviserId);
map.put("beginTime", beginTime);
map.put("proLabelName", proLabelName);
map.put("depLabelName", depLabelName);
map.put("purLabelName", purLabelName);
map.put("top", top);
return super.getSqlSession().selectList(getStatement("getNewsByLabelName"), map);
}
@Override
public List<AdNews> getNews4WechatByLabelName(Long adNewsSetId, Long adviserId,String beginTime, String proLabelName, String depLabelName, String purLabelName, Integer top) {
Map<String, Object> map = new HashMap<>();
map.put("adNewsSetId", adNewsSetId);
map.put("adviserId", adviserId);
map.put("beginTime", beginTime);
map.put("proLabelName", proLabelName);
map.put("depLabelName", depLabelName);
map.put("purLabelName", purLabelName);
map.put("top", top);
return super.getSqlSession().selectList(getStatement("getNews4WechatByLabelName"), map);
}
}
......@@ -33,6 +33,9 @@ public class AdNewsSet extends BaseEntity {
@ApiModelProperty("发送次数")
private Integer sendCount;
@ApiModelProperty("发送规则")
private Integer sendRule;
@ApiModelProperty("开场语")
private String startContent;
......
package com.pcloud.book.adnews.enums;
/**
* @author zhengyongqiang
* @date 2019/10/9 9:39
*/
public enum AdNewsSendRuleEnum {
LAST_UPDATE(0, "最近更新"),
MATCH_LABEL(1, "匹配标签");
public final Integer key;
public final String description;
AdNewsSendRuleEnum(Integer key, String description) {
this.key = key;
this.description = description;
}
public static String getDescriptionByKey(Integer key) {
AdNewsSendRuleEnum[] var1 = values();
int var2 = var1.length;
for (int var3 = 0; var3 < var2; ++var3) {
AdNewsSendRuleEnum methodEnum = var1[var3];
if (methodEnum.key.equals(key)) {
return methodEnum.description;
}
}
return null;
}
}
......@@ -294,7 +294,7 @@ public class AdvertisingSpaceBizImpl implements AdvertisingSpaceBiz {
Long seconds = detailFile.getFilePilotSecond();
String title = detailFile.getTitle();
//总时长
Integer duration = null;
BigDecimal duration = null;
if (!StringUtil.isEmpty(fileId)) {
//获取转码路径
FileUploadInfo fileUploadInfo = convertConsr.getByFileId(fileId);
......@@ -305,7 +305,7 @@ public class AdvertisingSpaceBizImpl implements AdvertisingSpaceBiz {
duration = fileUploadInfo.getDuration();
detailFile.setFileUrl(fileUrl);
if (null != duration) {
detailFile.setFileDuration(duration.longValue());
detailFile.setFileDuration(duration);
}
}
/* if (StringUtil.isEmpty(fileUrl) && !StringUtil.isEmpty(fileId)) {
......@@ -314,7 +314,7 @@ public class AdvertisingSpaceBizImpl implements AdvertisingSpaceBiz {
advertisingSpace.setAdDetailFileConvertState(0);
return advertisingSpace;
}*/
if (null != duration && null != seconds && seconds >= duration) {
if (null != duration && null != seconds && BigDecimal.valueOf(seconds.doubleValue()).compareTo(duration) >= 0) {
throw new BookBizException(BookBizException.PARAM_IS_ERROR, "资源" + title + "时长" + duration + "s,试听/试看时长超过该时长,请重新设置");
}
if (!StringUtil.isEmpty(fileUrl)) {//剪切文件
......@@ -349,7 +349,6 @@ public class AdvertisingSpaceBizImpl implements AdvertisingSpaceBiz {
} catch (Exception e) {
LOGGER.error("【文件转换(消)】向文件转换中心发送通知.[sendConvertFileQueue]:" + e.getMessage(), e);
}
LOGGER.info("【文件转换(消)】向文件转换中心发送通知,<END>");
}
/**
......@@ -655,7 +654,6 @@ public class AdvertisingSpaceBizImpl implements AdvertisingSpaceBiz {
// 获取群信息
GroupQrcode groupQrcode = groupQrcodeDao.getById(group.getQrcodeId());
String groupId = groupQrcode.getWeixinGroupId();
ClassifyDTO classifyDTO = bookGroupClassifyDao.getById(group.getClassifyId());
// 获取机器人微信号
String altId = wechatGroupConsr.getSendAdRobotByGroupId(groupId);
if (StringUtil.isEmpty(altId)) {
......
......@@ -3,6 +3,7 @@ package com.pcloud.book.advertising.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.pcloud.common.entity.BaseEntity;
import java.math.BigDecimal;
import java.util.Date;
/**
......@@ -35,7 +36,7 @@ public class AdvertisingDetailFile extends BaseEntity{
/**
*文件时长
*/
private Long fileDuration;
private BigDecimal fileDuration;
/**
*文件路径
*/
......@@ -116,11 +117,11 @@ public class AdvertisingDetailFile extends BaseEntity{
this.fileName = fileName == null ? null : fileName.trim();
}
public Long getFileDuration() {
public BigDecimal getFileDuration() {
return fileDuration;
}
public void setFileDuration(Long fileDuration) {
public void setFileDuration(BigDecimal fileDuration) {
this.fileDuration = fileDuration;
}
......
......@@ -334,7 +334,6 @@ public class BookAppealBizImpl implements BookAppealBiz {
insertBookAppealResult(bookAppealDto.getBookId(), bookAppealDto.getBookAppealId());
// 发送模板消息
sendAppealTemplate(isOnlyOneAdviser, appealAdviserId, adviserBooks, bookId, bookAppealDto.getChannelId(), mainAdviserId);
LOGGER.info("【书籍申诉-平台】设置主编辑,<END>.");
}
/**
......
......@@ -147,7 +147,6 @@ public class BookAdviserBizImpl implements BookAdviserBiz {
// 默认是主编辑
bookAdviser.setIsMainEditor(true);
bookAdviserDao.insert(bookAdviser);
LOGGER.info("【书籍-编辑】编辑设置书籍推广信息,<END>");
} catch (DataIntegrityViolationException e) {
throw new BookBizException(BookBizException.DB_DML_FAIL, "该书刊已经被别的编辑添加过");
} catch (Exception e) {
......@@ -235,7 +234,6 @@ public class BookAdviserBizImpl implements BookAdviserBiz {
}
LOGGER.info("【书籍-编辑】删除编辑和书籍的推广信息,<START>.[bookId]=" + bookId);
bookAdviserDao.deleteByBook(bookId);
LOGGER.info("【书籍-编辑】删除编辑和书籍的推广信息,<END>");
}
/**
......@@ -251,7 +249,6 @@ public class BookAdviserBizImpl implements BookAdviserBiz {
try {
LOGGER.info("【书籍-编辑】批量删除书刊的推广信息,<START>.[bookIds]=" + bookIds.toString());
bookAdviserDao.deleteByBooks(bookIds);
LOGGER.info("【书籍-编辑】批量删除书刊的推广信息,<END>");
} catch (Exception e) {
LOGGER.error("【书籍-编辑】批量删除书刊的推广信息,<ERROR>.[bookAdviserDao.deleteByBooks]" + e.getMessage(), e);
throw new BookBizException(BookBizException.DB_DML_FAIL, "批量删除书刊的推广信息失败");
......@@ -480,7 +477,6 @@ public class BookAdviserBizImpl implements BookAdviserBiz {
LOGGER.info("【书籍-编辑】编辑设置书籍推广信息,<START>.[bookAdviser]=" + bookAdviser.toString());
// 默认是主编辑
bookAdviserDao.insert(bookAdviser);
LOGGER.info("【书籍-编辑】编辑设置书籍推广信息,<END>");
} catch (Exception e) {
LOGGER.warn("【书籍-编辑】编辑设置书籍推广信息,<ERROR>.[BookAdviserDao.insert]" + e.getMessage(), e);
}
......@@ -620,7 +616,6 @@ public class BookAdviserBizImpl implements BookAdviserBiz {
deleteBook4ViceAdviser(bookId,adviserId,channelId);
}
LOGGER.info("删除书籍(编辑端)<END>");
}
/**
......@@ -645,7 +640,6 @@ public class BookAdviserBizImpl implements BookAdviserBiz {
// 删除读者端的书架的书籍
bookcaseConsr.deleteBookForAdviser(bookId, channelId, adviserId);
}
LOGGER.info("删除主编辑书籍<END>.");
}
/**
......@@ -667,7 +661,6 @@ public class BookAdviserBizImpl implements BookAdviserBiz {
updateBookAdviserStatus(bookId, adviserId, channelId, null,null, BookConstant.BOOK_ADVISER_DELETE, null);
// 删除读者端的书架的书籍
bookcaseConsr.deleteBookForAdviser(bookId, channelId, adviserId);
LOGGER.info("删除副编辑书籍<END>.");
}
/**
......@@ -686,7 +679,6 @@ public class BookAdviserBizImpl implements BookAdviserBiz {
qrcodeSceneConsr.recoverByBook(bookId, channelId, adviserId);
}
LOGGER.info("恢复书籍-编辑 ,<END>");
}
/**
......@@ -713,7 +705,6 @@ public class BookAdviserBizImpl implements BookAdviserBiz {
if (BookConstant.BOOK_ADVISER_DELETE.equals(deleteStatus)) {
bookGroupBiz.deleteByBookId(bookId, channelId, adviserId);
}
LOGGER.info("修改书籍编辑的状态(删除或者恢复) <END>");
}
/**
......@@ -727,7 +718,6 @@ public class BookAdviserBizImpl implements BookAdviserBiz {
countDto.setCount(count);
Integer bookGroupCount = bookGroupDao.getBookGroupCount(adviserId);
countDto.setBookGroupCount(bookGroupCount);
LOGGER.info("获取编辑的图书总数 ,<END>");
return countDto;
}
......@@ -738,7 +728,6 @@ public class BookAdviserBizImpl implements BookAdviserBiz {
public void setBookTemplet(BookAdviser bookAdviser) {
LOGGER.info("设置图书使用模板【START】bookAdviser="+bookAdviser);
bookAdviserDao.updateBookTemplet(bookAdviser);
LOGGER.info("设置图书使用模板【END】");
}
@Override
@ParamLog(value = "获取图书基本信息", isBefore = false, isAfterReturn = false)
......
......@@ -3,19 +3,8 @@
*/
package com.pcloud.book.book.biz.impl;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DataIntegrityViolationException;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.google.common.collect.Maps;
import com.pcloud.book.base.exception.BookBizException;
import com.pcloud.book.book.biz.BookAppBiz;
import com.pcloud.book.book.cache.BookAppCache;
......@@ -26,6 +15,18 @@ import com.pcloud.book.book.set.BookSet;
import com.pcloud.common.exceptions.BizException;
import com.pcloud.common.utils.ListUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DataIntegrityViolationException;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @描述:
* @作者:songx
......@@ -55,13 +56,12 @@ public class BookAppBizImpl implements BookAppBiz {
@Override
@Transactional(rollbackFor = Exception.class)
public void create(BookApp bookApp) throws BizException {
LOGGER.info("【书籍-应用-编辑】创建书刊应用关联,bookApp:{}", bookApp);
// 校验参数
this.checkParam(bookApp);
try {
LOGGER.info("【书籍-应用-编辑】创建书刊应用关联,<START>.[bookApp]=" + bookApp.toString());
bookAppDao.insert(bookApp);
LOGGER.info("【书籍-应用-编辑】创建书刊应用关联,<END>");
}catch (DataIntegrityViolationException e) {
LOGGER.error("【书籍-应用-编辑】创建书刊应用关联,已关联过>>>>>>" + e.getMessage());
throw new BookBizException(BookBizException.DB_DML_FAIL, "请稍等,正在处理中...");
......@@ -153,7 +153,6 @@ public class BookAppBizImpl implements BookAppBiz {
try {
LOGGER.info("【书籍-应用-编辑】删除书刊应用关联,<START>.[bookAppId]=" + bookAppId);
bookAppDao.deleteById(bookAppId);
LOGGER.info("【书籍-应用-编辑】删除书刊应用关联,<END>");
} catch (Exception e) {
LOGGER.error("【书籍-应用-编辑】删除书刊应用关联,<ERROR>.[bookDao.deleteById]" + e.getMessage(), e);
throw new BookBizException(BookBizException.DB_DML_FAIL, "删除书刊应用关联失败~!");
......@@ -183,7 +182,6 @@ public class BookAppBizImpl implements BookAppBiz {
try {
LOGGER.info("【书籍-应用-编辑】根据书籍删除关联的应用,<START>.[bookId]=" + bookId);
bookAppDao.deleteByBook(bookId);
LOGGER.info("【书籍-应用-编辑】根据书籍删除关联的应用,<END>");
} catch (Exception e) {
LOGGER.error("【书籍-应用-编辑】根据书籍删除关联的应用,<ERROR>.[bookDao.deleteByBook]" + e.getMessage(), e);
throw new BookBizException(BookBizException.DB_DML_FAIL, "根据书籍删除关联的应用失败~!");
......@@ -204,7 +202,6 @@ public class BookAppBizImpl implements BookAppBiz {
try {
LOGGER.info("【书籍-应用-编辑】批量删除应用关联关系,<START>.[bookIds]=" + bookIds.toString());
bookAppDao.deleteByBooks(bookIds);
LOGGER.info("【书籍-应用-编辑】批量删除应用关联关系,<END>");
} catch (Exception e) {
LOGGER.error("【书籍-应用-编辑】批量删除应用关联关系,<ERROR>.[bookDao.deleteByBooks]" + e.getMessage(), e);
throw new BookBizException(BookBizException.DB_DML_FAIL, "批量删除应用关联关系失败~!");
......@@ -223,6 +220,7 @@ public class BookAppBizImpl implements BookAppBiz {
*/
@Override
public List<BookAppDto> listBaseById(BookApp bookApp) throws BizException {
LOGGER.info("【书籍-应用-编辑】获取单个书籍和应用关联关系,[bookApp]:{}", bookApp);
// 校验参数
if (bookApp.getBookId() == null) {
throw new BookBizException(BookBizException.PARAM_IS_NULL, "书籍标识不能为空~!");
......@@ -233,19 +231,16 @@ public class BookAppBizImpl implements BookAppBiz {
if (bookApp.getChannelId() == null) {
throw new BookBizException(BookBizException.PARAM_IS_NULL, "渠道标识不能为空~!");
}
//从缓存中读取书籍与应用关联关系
List<BookAppDto> listBookAppAssoc = bookAppCache.listBookAppAssoc(bookApp.getBookId(), bookApp.getChannelId(), bookApp.getCreatedUser());
if(ListUtils.isEmpty(listBookAppAssoc)){
try {
LOGGER.info("【书籍-应用-编辑】获取单个书籍和应用关联关系,<PARAM>.[bookApp]=" + bookApp.toString());
listBookAppAssoc = bookAppDao.listBaseById(bookApp);
if (listBookAppAssoc == null) {
listBookAppAssoc = new ArrayList<>();
}else{
bookAppCache.setBookAppAssoc(bookApp.getBookId(), bookApp.getChannelId(), bookApp.getCreatedUser(), listBookAppAssoc);
}
LOGGER.info("【书籍-应用-编辑】获取单个书籍和应用关联关系,<END>.[listBookAppAssoc]=" + listBookAppAssoc);
} catch (Exception e) {
LOGGER.error("【书籍-应用-编辑】获取单个书籍和应用关联关系,<ERROR>.[bookAppDao.getById]:" + e.getMessage(), e);
throw BizException.DB_SELECT_IS_FAIL;
......@@ -345,7 +340,6 @@ public class BookAppBizImpl implements BookAppBiz {
LOGGER.error("修改书籍应用关系,<ERROR>.[updateBookAppStatus]:" + e.getMessage(), e);
throw new BookBizException(BookBizException.DB_DML_FAIL, "修改书籍应用关系失败");
}
LOGGER.info("修改书籍应用关系,<END>");
}
}
......@@ -51,7 +51,6 @@ public class BookFreezeBizImpl implements BookFreezeBiz {
public Boolean isFreeze(Long bookId) {
LOGGER.info("获取图书是否被冻结参数:bookId=" + bookId);
Boolean isFreeze = bookFreezeDao.isFreeze(bookId);
LOGGER.info("获取图书是否被冻结参数:isFreeze=" + isFreeze);
return isFreeze;
}
......@@ -210,7 +209,6 @@ public class BookFreezeBizImpl implements BookFreezeBiz {
if (bookFundList == null) {
bookFundList = new ArrayList<>();
}
LOGGER.info("该书刊当前和以后基金冻结信息<END>,bookFundList=" + bookFundList);
return bookFundList;
}
......@@ -227,7 +225,6 @@ public class BookFreezeBizImpl implements BookFreezeBiz {
if (bookFundList == null) {
bookFundList = new ArrayList<>();
}
LOGGER.info("批量获取书刊当前和以后基金冻结信息<END>,bookFundList=" + bookFundList);
return bookFundList;
}
......
package com.pcloud.book.book.biz.impl;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.pcloud.book.book.dto.BookFundInfoDto;
import com.pcloud.common.core.aspect.ParamLog;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.pcloud.book.base.exception.BookBizException;
import com.pcloud.book.book.biz.BookFundBiz;
import com.pcloud.book.book.dao.BookFundDao;
import com.pcloud.book.book.dto.BookFundDto;
import com.pcloud.book.book.dto.BookFundInfoDto;
import com.pcloud.book.book.entity.BookFund;
import com.pcloud.common.core.aspect.ParamLog;
import com.pcloud.common.exceptions.BizException;
import com.pcloud.common.page.PageBean;
import com.pcloud.common.page.PageParam;
......@@ -26,6 +14,18 @@ import com.pcloud.common.utils.DateUtils;
import com.pcloud.common.utils.ListUtils;
import com.pcloud.common.utils.string.StringUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @描述:书刊基金业务实现层
* @作者:lihao
......@@ -45,7 +45,7 @@ public class BookFundBizImpl implements BookFundBiz {
@Override
@Transactional(rollbackFor = Exception.class)
public void create(BookFund bookFund) {
LOGGER.info("【书刊管理(平台端)】创建书刊基金状态,<START>.[bookFund]=" + bookFund.toString());
LOGGER.info("【书刊管理(平台端)】创建书刊基金状态,<START>.[bookFund]:{}" , bookFund);
// 参数校验
this.checkAddParam(bookFund);
// 判断有效期是否重复
......@@ -64,7 +64,7 @@ public class BookFundBizImpl implements BookFundBiz {
@Override
@Transactional(rollbackFor = Exception.class)
public void update(BookFund bookFund) {
LOGGER.info("【书刊管理(平台端)】修改刊基金状态,<START>.[bookFund]=" + bookFund.toString());
LOGGER.info("【书刊管理(平台端)】修改刊基金状态,<START>.[bookFund]:{}", bookFund);
if (null == bookFund.getBookFundId()) {
throw new BookBizException(BookBizException.PARAM_IS_NULL, "基金标识不能为空!");
}
......@@ -171,12 +171,11 @@ public class BookFundBizImpl implements BookFundBiz {
*/
@Override
public List<BookFundDto> getByBookId(Long bookId) {
LOGGER.info("【书刊管理(平台端)】根据BookId获取基金状态,<START>.[bookId]=" + bookId);
LOGGER.info("【书刊管理(平台端)】根据BookId:{}获取基金状态,", bookId);
if (null == bookId) {
throw new BookBizException(BookBizException.PARAM_IS_NULL, "书籍标识不能为空!");
}
List<BookFundDto> bookFundDtos = bookFundDao.getByBookId(bookId);
LOGGER.info("【书刊管理(平台端)】根据BookId获取基金状态,<END>");
return bookFundDtos;
}
......@@ -185,7 +184,6 @@ public class BookFundBizImpl implements BookFundBiz {
*/
@Override
public Boolean isFundOccupy(Long bookId, String date) {
LOGGER.info("【书刊管理(内部)】判断书刊基金是否被买断,<START>.[bookId]=" + bookId + ",[date]=" + date);
if (null == bookId || null == date) {
throw new BookBizException(BookBizException.PARAM_IS_NULL, "参数缺失!");
}
......@@ -197,7 +195,7 @@ public class BookFundBizImpl implements BookFundBiz {
if (null != bookFundDto && bookFundDto.size() != 0) {
isOcuppy = true;
}
LOGGER.info("【书刊管理(内部)】判断书刊基金是否被买断,<END>bookFundDto=" + bookFundDto + "isOcuppy=" + isOcuppy);
LOGGER.info("【书刊管理(内部)】判断书刊基金是否被买断,bookId:{};date:{};bookFundDto:{};isOcuppy:{}", bookId, date, bookFundDto, isOcuppy);
return isOcuppy;
}
......@@ -206,7 +204,7 @@ public class BookFundBizImpl implements BookFundBiz {
*/
@Override
public Map<String, Object> getFundList4Adviser(Long bookId) {
LOGGER.info("【书刊管理(编辑端)】编辑端获取基金买断信息,<START>.[bookId]=" + bookId);
LOGGER.info("【书刊管理(编辑端)】编辑端获取基金买断信息,bookId:{}", bookId);
if (null == bookId) {
throw new BookBizException(BookBizException.PARAM_IS_NULL, "书籍标识不能为空!");
}
......@@ -224,7 +222,6 @@ public class BookFundBizImpl implements BookFundBiz {
reultMap.put("isOcuppy", isOcuppy);
reultMap.put("bookFundDto", new ArrayList<>());
}
LOGGER.info("【书刊管理(编辑端)】编辑端获取基金买断信息,<END>");
return reultMap;
}
......@@ -233,7 +230,7 @@ public class BookFundBizImpl implements BookFundBiz {
*/
@Override
public Map<Long, BigDecimal> getBookFundMoney(List<Long> bookIds) {
LOGGER.info("【书刊管理(编辑端)】批量获取书刊基金总额,<START>.[bookIds]=" + bookIds);
LOGGER.info("【书刊管理(编辑端)】批量获取书刊基金总额,bookIds:{}", bookIds);
if (null == bookIds || bookIds.size() == 0) {
throw new BookBizException(BookBizException.PARAM_IS_NULL, "书籍标识不能为空!");
}
......@@ -244,7 +241,6 @@ public class BookFundBizImpl implements BookFundBiz {
bookFundMap.put(entry.getKey(), entry.getValue().getFundMoneySum());
}
}
LOGGER.info("【书刊管理(编辑端)】批量获取书刊基金总额,<END>");
return bookFundMap;
}
......@@ -268,14 +264,13 @@ public class BookFundBizImpl implements BookFundBiz {
*/
@Override
public PageBean listByBookId(PageParam pageParam, Long bookId) {
LOGGER.info("根据BookId获取基金状态,<START>.[bookId]=" + bookId);
LOGGER.info("根据BookId获取基金状态,bookId:{}", bookId);
if (null == bookId) {
throw new BookBizException(BookBizException.PARAM_IS_NULL, "书籍标识不能为空!");
}
Map<String, Object> paramMap = new HashMap<>();
paramMap.put("bookId", bookId);
PageBean pageBean = bookFundDao.listPage(pageParam, paramMap, "listByBookId");
LOGGER.info("根据BookId获取基金状态,<END>");
return pageBean;
}
......@@ -284,7 +279,7 @@ public class BookFundBizImpl implements BookFundBiz {
*/
@Override
public Long getHaveFundBook(List<Long> bookIds) {
LOGGER.info("正在基金支持的图书,<START>.[bookIds]=" + bookIds);
LOGGER.info("正在基金支持的图书,<START>.[bookIds]:{}", bookIds);
if (ListUtils.isEmpty(bookIds)) {
return null;
}
......@@ -323,12 +318,11 @@ public class BookFundBizImpl implements BookFundBiz {
*/
@Override
public List<Long> listHaveFundBooks(List<Long> bookIds) {
LOGGER.info("正在基金支持的图书列表,<START>.[bookIds]=" + bookIds);
LOGGER.info("正在基金支持的图书列表,bookIds:{}", bookIds);
if (ListUtils.isEmpty(bookIds)) {
return null;
}
List<Long> fundBookIds = bookFundDao.listHaveFundBooks(bookIds);
LOGGER.info("正在基金支持的图书列表,<END>");
return fundBookIds;
}
......@@ -337,9 +331,7 @@ public class BookFundBizImpl implements BookFundBiz {
*/
@Override
public List<Long> listAllHaveFundBooks() {
LOGGER.info("获取所有正在基金支持的书,<START>.");
List<Long> fundBookIds = bookFundDao.listAllHaveFundBooks();
LOGGER.info("获取所有正在基金支持的书,<END>.");
return fundBookIds;
}
......
......@@ -209,7 +209,6 @@ public class BookKeywordWarehouseBizImpl implements BookKeywordWarehouseBiz {
@Transactional(rollbackFor = {Exception.class})
public void deleteBookKeyword(Long keywordId, Long adviserId) {
if (null == keywordId || null == adviserId) {
log.info("[deleteBookKeyword] keywordId is null");
throw new BookBizException(BookBizException.PARAM_IS_ERROR, "参数错误");
}
final KeywordWarehouse keywordWarehouse = keywordWarehouseDao.selectByPrimaryKey(keywordId);
......
......@@ -3,19 +3,8 @@
*/
package com.pcloud.book.book.biz.impl;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import org.apache.commons.collections.MapUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DataIntegrityViolationException;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.google.common.collect.Maps;
import com.pcloud.book.base.exception.BookBizException;
import com.pcloud.book.book.biz.BookProductBiz;
import com.pcloud.book.book.cache.BookProductCache;
......@@ -34,6 +23,18 @@ import com.pcloud.resourcecenter.base.constants.ProCons;
import com.pcloud.resourcecenter.product.dto.ProductDto;
import com.pcloud.resourcecenter.product.dto.ProductTypeDto;
import org.apache.commons.collections.MapUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DataIntegrityViolationException;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
* @描述:
*
......@@ -72,12 +73,11 @@ public class BookProductBizImpl implements BookProductBiz {
@Override
@Transactional(rollbackFor = Exception.class)
public void create(BookProduct bookProduct) throws BizException {
LOGGER.info("【书籍-作品-编辑】添加书籍作品关联关系,bookProduct:{}", bookProduct);
// 参数校验
this.checkParam(bookProduct);
try {
LOGGER.info("【书籍-作品-编辑】添加书籍作品关联关系,<START>.[bookProduct]=" + bookProduct.toString());
bookProductDao.insert(bookProduct);
LOGGER.info("【书籍-作品-编辑】添加书籍作品关联关系,<END>");
} catch (DataIntegrityViolationException e) {
LOGGER.error("【书籍-作品-编辑】添加书籍作品关联关系>>>>>>" + e.getMessage());
throw new BizException(BookBizException.FREQUENTLY_REQUEST, "请稍等,正在处理中...");
......@@ -118,6 +118,7 @@ public class BookProductBizImpl implements BookProductBiz {
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(Long bookId, Long productId, Long adviserId, Long channelId) throws BizException {
LOGGER.info("【书籍-作品-编辑】删除书籍作品关联关系,bookId:{};productId:{};adviserId:{};channelId:{}", bookId, productId, adviserId, channelId);
if (bookId == null) {
throw new BookBizException(BookBizException.PARAM_IS_NULL, "书籍标识不能为空~!");
}
......@@ -138,11 +139,9 @@ public class BookProductBizImpl implements BookProductBiz {
bookProduct.setChannelId(channelId);
try {
LOGGER.info("【书籍-作品-编辑】删除书籍作品关联关系,<START>.[bookProduct]=" + bookProduct.toString());
bookProductDao.delete(bookProduct);
LOGGER.info("【书籍-作品-编辑】删除书籍作品关联关系,<END>");
} catch (Exception e) {
LOGGER.error("【书籍-作品-编辑】删除书籍作品关联关系,<ERROR>.[bookProductDao.delete]" + e.getMessage(), e);
LOGGER.error("【书籍-作品-编辑】删除书籍作品关联关系,bookProduct:{}<ERROR>:{}.[bookProductDao.delete]",bookProduct, e);
throw new BookBizException(BookBizException.DB_DML_FAIL, "删除书籍作品关联关系失败~!");
}
// 清除图书应用关联关系
......@@ -159,16 +158,15 @@ public class BookProductBizImpl implements BookProductBiz {
@Override
@Transactional(rollbackFor = Exception.class)
public void deleteByBook(Long bookId) throws BizException {
LOGGER.info("【书籍-作品-编辑】根据书籍删除作品关联关系,bookId:{}", bookId);
if (bookId == null) {
throw new BookBizException(BookBizException.PARAM_IS_NULL, "书籍标识不能为空~!");
}
try {
LOGGER.info("【书籍-作品-编辑】根据书籍删除作品关联关系,<START>.[bookId]=" + bookId);
bookProductDao.deleteByBook(bookId);
LOGGER.info("【书籍-作品-编辑】根据书籍删除作品关联关系,<END>");
} catch (Exception e) {
LOGGER.error("【书籍-作品-编辑】根据书籍删除作品关联关系,<ERROR>.[bookDao.insert]" + e.getMessage(), e);
LOGGER.error("【书籍-作品-编辑】根据书籍删除作品关联关系,bookId:{}<ERROR>:{}.[bookDao.insert]", bookId, e);
throw new BookBizException(BookBizException.DB_DML_FAIL, "删除作品关联关系失败~!");
}
// 清除图书应用关联关系
......@@ -185,16 +183,15 @@ public class BookProductBizImpl implements BookProductBiz {
@Override
@Transactional(rollbackFor = Exception.class)
public void deleteByBooks(List<Long> bookIds) throws BizException {
LOGGER.info("【书籍-作品-编辑】批量删除作品关联关系,bookIds:{}", bookIds);
if (bookIds == null || bookIds.isEmpty()) {
throw new BookBizException(BookBizException.PARAM_IS_NULL, "书籍标识不能为空~!");
}
try {
LOGGER.info("【书籍-作品-编辑】批量删除作品关联关系,<START>.[bookIds]=" + bookIds.toString());
bookProductDao.deleteByBooks(bookIds);
LOGGER.info("【书籍-作品-编辑】批量删除作品关联关系,<END>");
} catch (Exception e) {
LOGGER.error("【书籍-作品-编辑】批量删除作品关联关系,<ERROR>.[bookProductDao.deleteByBooks]" + e.getMessage(), e);
LOGGER.error("【书籍-作品-编辑】批量删除作品关联关系,bookIds:{}<ERROR>:{}.[bookProductDao.deleteByBooks]",bookIds , e);
throw new BookBizException(BookBizException.DB_DML_FAIL, "批量删除作品关联关系失败~!");
}
try {
......@@ -211,6 +208,7 @@ public class BookProductBizImpl implements BookProductBiz {
*/
@Override
public List<BookProductDto> getListById(Long bookId, Long adviserId, Long channelId) throws BizException {
LOGGER.info("【书籍-作品-编辑】获取书籍关联的作品,bookId:{};adviserId:{};channelId:{}" ,bookId ,adviserId, channelId);
if (bookId == null) {
throw new BookBizException(BookBizException.PARAM_IS_NULL, "书籍标识不能为空~!");
}
......@@ -228,14 +226,12 @@ public class BookProductBizImpl implements BookProductBiz {
bookProduct.setChannelId(channelId);
bookProduct.setCreatedUser(adviserId);
try {
LOGGER.info("【书籍-作品-编辑】获取书籍关联的作品,<START>.[bookProduct]=" + bookProduct.toString());
listBookProductAssoc = bookProductDao.getListById(bookProduct);
if (listBookProductAssoc == null) {
listBookProductAssoc = new ArrayList<>();
} else {
bookProductCache.setBookProductAssoc(bookId, channelId, adviserId, listBookProductAssoc);
}
LOGGER.info("【书籍-作品-编辑】获取书籍关联的作品,<END>.[listBookProductAssoc]=" + listBookProductAssoc);
} catch (Exception e) {
LOGGER.error("【书籍-作品-编辑】获取书籍关联的作品,<ERROR>.[bookProductDao.getListById]:" + e.getMessage(), e);
throw BizException.DB_SELECT_IS_FAIL;
......@@ -414,8 +410,6 @@ public class BookProductBizImpl implements BookProductBiz {
} catch (Exception e) {
LOGGER.error("清除录音失败");
}
LOGGER.info("【图书商品】修改录音.<END>");
}
/**
......@@ -423,7 +417,6 @@ public class BookProductBizImpl implements BookProductBiz {
*/
@Override
public void updateProductType() {
LOGGER.info("【图书商品】更新商品类型.<START>.");
// 获取所有图书关联商品
List<BookProductDto> allBookProduct = bookProductDao.getAllBookProduct();
if (ListUtils.isEmpty(allBookProduct)) {
......@@ -450,7 +443,6 @@ public class BookProductBizImpl implements BookProductBiz {
}
}
bookProductDao.updateProductType(allBookProduct);
}
/**
......@@ -458,8 +450,7 @@ public class BookProductBizImpl implements BookProductBiz {
*/
@Override
public List<BookProductDto> list4Adviser(Long bookId, Long channelId, Long adviserId) {
LOGGER.info(
"【书刊】获取图书关联作品,<START>.[bookId]=" + bookId + ",[channelId]=" + channelId + "[adviserId]=" + adviserId);
LOGGER.info("【书刊】获取图书关联作品,<START>.[bookId]=" + bookId + ",[channelId]=" + channelId + "[adviserId]=" + adviserId);
// 获取图书
List<BookProductDto> bookProductAssoc = getListById(bookId, adviserId, channelId);
// 设置作者录音
......@@ -493,8 +484,7 @@ public class BookProductBizImpl implements BookProductBiz {
*/
@Override
public Integer getProCount(Long adviserId, Long bookId, Long channelId) {
LOGGER.info("【编辑书刊】 获取图书关联商品个数,<START>.[bookId]=" + bookId + ",[channelId]=" + channelId + "[adviserId]="
+ adviserId);
LOGGER.info("【编辑书刊】 获取图书关联商品个数,<START>.[bookId]=" + bookId + ",[channelId]=" + channelId + "[adviserId]="+ adviserId);
try {
Map<String, Object> paramMap = Maps.newHashMap();
paramMap.put("bookId", bookId);
......
......@@ -3,18 +3,8 @@
*/
package com.pcloud.book.book.biz.impl;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DataIntegrityViolationException;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.google.common.collect.Maps;
import com.pcloud.book.base.exception.BookBizException;
import com.pcloud.book.book.biz.BookProductBiz;
import com.pcloud.book.book.biz.BookResourceBiz;
......@@ -27,6 +17,17 @@ import com.pcloud.book.book.set.BookSet;
import com.pcloud.common.exceptions.BizException;
import com.pcloud.common.utils.ListUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DataIntegrityViolationException;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
* @描述:
* @作者:songx
......@@ -58,13 +59,12 @@ public class BookResourceBizImpl implements BookResourceBiz {
@Override
@Transactional(rollbackFor = Exception.class)
public void create(BookResource bookResource) throws BizException {
LOGGER.info("【书籍-资源-编辑】创建书刊资源关联,bookResource:{}", bookResource);
// 校验参数
this.checkParam(bookResource);
try {
LOGGER.info("【书籍-资源-编辑】创建书刊资源关联,<START>.[bookResource]=" + bookResource.toString());
bookResourceDao.insert(bookResource);
LOGGER.info("【书籍-资源-编辑】创建书刊资源关联,<END>");
}catch (DataIntegrityViolationException e) {
LOGGER.error("【书籍-资源-编辑】创建书刊资源关联,已关联过" + e.getMessage());
throw new BizException(BookBizException.FREQUENTLY_REQUEST, "请稍等,正在处理中...");
......@@ -97,7 +97,7 @@ public class BookResourceBizImpl implements BookResourceBiz {
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(Long bookResourceId) throws BizException {
LOGGER.info("【书籍-资源-编辑】删除书刊资源关联,<START>.[bookResourceId]=" + bookResourceId);
LOGGER.info("【书籍-资源-编辑】删除书刊资源关联,bookResourceId:{}", bookResourceId);
if (bookResourceId == null) {
throw new BookBizException(BookBizException.PARAM_IS_NULL, "请选择资源");
}
......@@ -106,7 +106,6 @@ public class BookResourceBizImpl implements BookResourceBiz {
try {
bookResourceDao.deleteById(bookResourceId);
LOGGER.info("【书籍-资源-编辑】删除书刊资源关联,<END>");
} catch (Exception e) {
LOGGER.error("【书籍-资源-编辑】删除书刊资源关联,<ERROR>.[bookResourceDto.deleteById]" + e.getMessage(), e);
throw new BookBizException(BookBizException.DB_DML_FAIL, "删除书刊资源关联失败~!");
......@@ -120,14 +119,13 @@ public class BookResourceBizImpl implements BookResourceBiz {
@Override
@Transactional(rollbackFor = Exception.class)
public void deleteByBook(Long bookId) throws BizException {
LOGGER.info("【书籍-资源-编辑】根据书籍删除关联的应用,<START>.[bookId]=" + bookId);
LOGGER.info("【书籍-资源-编辑】根据书籍删除关联的应用,bookId:{}", bookId);
if (bookId == null) {
throw new BookBizException(BookBizException.PARAM_IS_NULL, "请选择书籍");
}
try {
bookResourceDao.deleteByBook(bookId);
LOGGER.info("【书籍-资源-编辑】根据书籍删除关联的应用,<END>");
} catch (Exception e) {
LOGGER.error("【书籍-资源-编辑】根据书籍删除关联的应用,<ERROR>.[bookResourceDto.deleteByBook]" + e.getMessage(), e);
throw new BookBizException(BookBizException.DB_DML_FAIL, "根据书籍删除关联的应用~!");
......@@ -147,14 +145,13 @@ public class BookResourceBizImpl implements BookResourceBiz {
@Override
@Transactional(rollbackFor = Exception.class)
public void deleteByBooks(List<Long> bookIds) throws BizException {
LOGGER.info("【书籍-资源-编辑】批量删除资源关联关系,<START>.[bookIds]=" + bookIds.toString());
LOGGER.info("【书籍-资源-编辑】批量删除资源关联关系,bookIds:{}", bookIds);
if (bookIds == null || bookIds.isEmpty()) {
throw new BookBizException(BookBizException.PARAM_IS_NULL, "书籍标识不能为空~!");
}
try {
bookResourceDao.deleteByBooks(bookIds);
LOGGER.info("【书籍-资源-编辑】批量删除资源关联关系,<END>");
} catch (Exception e) {
LOGGER.error("【书籍-资源-编辑】批量删除资源关联关系,<ERROR>.[bookResourceDto.deleteByBooks]" + e.getMessage(), e);
throw new BookBizException(BookBizException.DB_DML_FAIL, "批量删除应用关联关系失败~!");
......@@ -212,7 +209,6 @@ public class BookResourceBizImpl implements BookResourceBiz {
}else{
bookResourceCache.setBookResourceAssoc(bookId, channelId, adviserId, bookResources);
}
LOGGER.info("【书籍-资源-编辑】获取书籍关联的资源,<END>.[bookResources]=" + bookResources.toString());
return bookResources;
} catch (Exception e) {
LOGGER.error("【书籍-资源-编辑】获取书籍关联的资源,<ERROR>.[bookResourceDto.getListById]:" + e.getMessage(), e);
......
......@@ -41,7 +41,6 @@ public class BookTypeBizImpl implements BookTypeBiz {
@Override
public List<BookTypeDto> getList() throws BizException {
try {
LOGGER.info("【书籍-类型-编辑】获取书籍类型列表,<START>");
return bookTypeDao.getList();
} catch (Exception e) {
LOGGER.error("【书籍-类型-编辑】获取书籍类型列表,<ERROR>.[bookDao.insert]" + e.getMessage(), e);
......@@ -55,7 +54,7 @@ public class BookTypeBizImpl implements BookTypeBiz {
@Override
public List<BookTypeDto> getPercent4Type(Long adviserId) throws BizException {
try {
LOGGER.info("【书籍-类型-编辑】获取图书和期刊占比,<START>");
LOGGER.info("【书籍-类型-编辑】获取图书和期刊占比,<START>adviserId:{}", adviserId);
List<BookTypeDto> bookTypes = bookTypeDao.getPercent4Type(adviserId);
bookSet.setPercent(bookTypes);
return bookTypes;
......
......@@ -241,7 +241,6 @@ public class BookSet {
* 批量填充渠道信息
*/
public void setChannelInfoList(List<Object> objects) throws BizException {
LOGGER.info("【书刊基础】批量填充渠道信息,<START>");
// 组装运营标识(去重)
List<Long> channelIds = BookTools.listChannelIds(objects);
// 从用户中心批量获取渠道名称
......@@ -251,14 +250,12 @@ public class BookSet {
}
// 批量填充运营信息
BookTools.setChannelNames(objects, channelNameMap);
LOGGER.info("【书刊基础】批量填充渠道信息,<END>");
}
/**
* 批量填充渠道公众号信息
*/
public void setChannelOfficialAccountInfoList(List<Object> objects) throws BizException {
LOGGER.info("【书刊基础】批量填充渠道公众号信息,<START>");
// 组装运营标识(去重)
List<Long> channelIds = BookTools.listChannelIds(objects);
if (ListUtils.isEmpty(channelIds)) {
......@@ -271,14 +268,12 @@ public class BookSet {
}
// 批量填充运营公众号信息
BookTools.setChannelOfficialAccountsNames(objects, officialAccountNameMap);
LOGGER.info("【书刊基础】批量填充渠道公众号信息,<END>");
}
/**
* 批量填充顾问名称
*/
public void setAdviserName4BookDto(List<Object> objects) {
LOGGER.info("【书刊基础】批量填充顾问名称,<START>");
// 组装编辑标识(去重)
List<Long> adviserIds = BookTools.listAdviserIds(objects);
// 从用户中心批量获取编辑名称
......@@ -288,14 +283,12 @@ public class BookSet {
}
// 批量填充编辑名称
BookTools.setAdviserNames(objects, adviserNameMap);
LOGGER.info("【书刊基础】批量填充顾问名称,<END>");
}
/**
* 批量填充出版ID
*/
public void setAgentId4BookDto(List<Object> objects) {
LOGGER.info("【书刊基础】批量填充出版ID,<START>");
for (Object object : objects) {
BookDto bookDto = (BookDto) object;
Long adviserId = bookDto.getAdviserId();
......@@ -304,14 +297,12 @@ public class BookSet {
bookDto.setAgentId(agentId);
}
}
LOGGER.info("【书刊基础】批量填充出版ID,<END>");
}
/**
* 批量填充出版名称
*/
public void setAgentName4BookDto(List<Object> objects) {
LOGGER.info("【书刊基础】批量填充出版名称,<START>");
// 组装出版标识(去重)
List<Long> agentIds = BookTools.listAgentIds(objects);
// 从用户中心批量获取出版名称
......@@ -321,7 +312,6 @@ public class BookSet {
}
// 批量填充出版名称
BookTools.setAgentNames(objects, agentNameMap);
LOGGER.info("【书刊基础】批量填充出版名称,<END>");
}
......@@ -329,7 +319,6 @@ public class BookSet {
* 批量填充顾问名称
*/
public void setAdviserName(List<Object> objects) {
LOGGER.info("【书刊基础】批量填充顾问名称,<START>");
// 组装编辑标识(去重)
List<Long> adviserIds = BookAppealTools.listAdviserIds(objects);
// 从用户中心批量获取编辑名称
......@@ -339,7 +328,6 @@ public class BookSet {
}
// 批量填充编辑名称
BookAppealTools.setAdviserNames(objects, adviserNameMap);
LOGGER.info("【书刊基础】批量填充顾问名称,<END>");
}
/**
......@@ -347,7 +335,6 @@ public class BookSet {
* @param bookAppealDto
*/
public void setAdviserInfo(BookAppealDto bookAppealDto) {
LOGGER.info("【书刊基础】设置申诉方及被诉方基本信息(objects),<START>");
List<Long> adviserIds = new ArrayList<>();
List<Long> channelIds = new ArrayList<>();
Long channelId = bookAppealDto.getChannelId();
......@@ -469,7 +456,7 @@ public class BookSet {
* @param bookId 书籍标识
*/
public void sendBookDeleteTopic(Long bookId) {
LOGGER.info("【书籍基础】发送书籍删除topic,<START>");
LOGGER.info("【书籍基础】发送书籍删除topic,<START>bookId:{}", bookId);
BookDeleteDto bookDeleteDto = new BookDeleteDto();
List<Long> bookIds = new ArrayList<>();
bookIds.add(bookId);
......@@ -479,7 +466,6 @@ public class BookSet {
} catch (Exception e) {
LOGGER.error("【书籍基础】发送书籍删除topic,<ERROR>", e);
}
LOGGER.info("【书籍基础】发送书籍删除topic,<END>");
}
/**
......@@ -487,7 +473,7 @@ public class BookSet {
* @param bookIds
*/
public void sendBooksDeleteTopic(List<Long> bookIds) {
LOGGER.info("【书籍基础】发送批量删除书籍topic,<START>");
LOGGER.info("【书籍基础】发送批量删除书籍topic,<START>bookIds:{}", bookIds);
BookDeleteDto bookDeleteDto = new BookDeleteDto();
bookDeleteDto.setBookIds(bookIds);
try {
......@@ -495,7 +481,6 @@ public class BookSet {
} catch (Exception e) {
LOGGER.error("【书籍基础】发送批量删除书籍topic,<ERROR>", e);
}
LOGGER.info("【书籍基础】发送批量删除书籍topic,<END>");
}
/**
......@@ -1634,7 +1619,6 @@ public class BookSet {
}
public void setAdviserInfo4BookDto(List<Object> objects) {
LOGGER.info("【书刊基础】批量填充顾问名称、手机号,<START>");
// 组装编辑标识(去重)
List<Long> adviserIds = BookTools.listAdviserIds(objects);
// 从用户中心批量获取编辑名称
......@@ -1654,6 +1638,5 @@ public class BookSet {
bookDto.setPhone("");
}
}
LOGGER.info("【书刊基础】批量填充顾问名称、手机号,<END>");
}
}
......@@ -3,19 +3,19 @@
*/
package com.pcloud.book.consumer.analysisengine;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.pcloud.analysisengine.qrcode.service.BookScanCountService;
import com.pcloud.common.exceptions.BizException;
import com.pcloud.common.utils.ListUtils;
import com.pcloud.common.utils.ResponseHandleUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.pcloud.analysisengine.qrcode.service.BookScanCountService;
import com.pcloud.common.exceptions.BizException;
import com.pcloud.common.utils.ListUtils;
import com.pcloud.common.utils.ResponseHandleUtil;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @描述:书籍统计中间件
......@@ -57,7 +57,6 @@ public class BookScanCountConsr {
} catch (Exception e) {
LOGGER.error("【二维码-渠道(消)】获取书籍扫描数,<ERROR>.[create]:" + e.getMessage(), e);
}
LOGGER.info("【二维码-渠道(消)】获取书籍扫描数,<END>");
return bookScanCount;
}
......
......@@ -39,7 +39,7 @@ public class BrowseRecordConsr {
* 获取资源文件浏览量
*/
public Map<Long, Long> getPvOfAdviserRes(List<Long> resourceFileIds) throws BizException {
LOGGER.info("【分析引擎(消)】获取资源文件浏览量,<START>.[resourceIds]=" + resourceFileIds);
LOGGER.info("[getPvOfAdviserRes] resourceFileIds:{}", resourceFileIds);
if (ListUtils.isEmpty(resourceFileIds)) {
return null;
}
......@@ -52,7 +52,6 @@ public class BrowseRecordConsr {
} catch (Exception e) {
LOGGER.error("【分析引擎(消)】获取资源文件浏览量.[getPvOfAdviserRes]:" + e.getMessage(), e);
}
LOGGER.info("【分析引擎(消)】获取资源文件浏览量,<END>.[resultMap]=" + (resultMap == null ? null : resultMap.toString()));
return resultMap;
}
......@@ -82,7 +81,6 @@ public class BrowseRecordConsr {
} catch (Exception e) {
LOGGER.error("【分析引擎(消)】图书的:扫描量、读者量.[getBookScanAndUv]:" + e.getMessage(), e);
}
LOGGER.info("【分析引擎(消)】图书的:扫描量、读者量END");
return resultMap;
}
......@@ -111,7 +109,6 @@ public class BrowseRecordConsr {
} catch (Exception e) {
LOGGER.error("【分析引擎(消)】图书的:扫描量、读者量、浏览量.[getBookScanAndUv]:" + e.getMessage(), e);
}
LOGGER.info("【分析引擎(消)】图书的:扫描量、读者量、浏览量END");
return resultMap;
}
......
......@@ -3,17 +3,17 @@
*/
package com.pcloud.book.consumer.analysisengine;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.pcloud.analysisengine.qrcode.dto.BookTimeSourceDto;
import com.pcloud.analysisengine.qrcode.service.SceneRecordService;
import com.pcloud.book.base.exception.BookBizException;
import com.pcloud.common.exceptions.BizException;
import com.pcloud.common.utils.ResponseHandleUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* @描述:二维码记录中间件
* @作者:songx
......@@ -51,7 +51,6 @@ public class SceneRecordConsr {
LOGGER.error("【二维码-渠道(消)】获取第一次扫描时间,<ERROR>.[getBookScanInfo]:" + e.getMessage(), e);
throw new BookBizException(BookBizException.INVOKE_USER_ERROR, "获取第一次扫描时间失败~!");
}
LOGGER.info("【二维码-渠道(消)】获取第一次扫描时间,<END>");
return bookTimeSourceDto;
}
}
......@@ -63,7 +63,6 @@ public class QrcodeSceneConsr {
}
try {
qrcodeSceneService.deleteBook(bookId, channelId, adviserId);
LOGGER.info("【二维码-渠道(消)】删除书籍关联的二维码关联关系,<END>");
} catch (BizException e) {
LOGGER.warn("【二维码-渠道(消)】删除书籍关联的二维码关联关系,<ERROR>.[qrcodeSceneService.deleteBook]:" + e.getMessage(), e);
throw new BizException(e.getCode(), e.getMessage());
......@@ -82,7 +81,6 @@ public class QrcodeSceneConsr {
try {
ResponseEntity<ResponseDto<Map<String, Object>>> qr4Book = qrcodeSceneService.getQr4Book(bookId);
result = ResponseHandleUtil.parseMap(qr4Book, String.class, Object.class);
LOGGER.info("【二维码-渠道(消)】 获取书籍对应二维码关系,<END>");
} catch (BizException e) {
LOGGER.warn("【二维码-渠道(消)】 获取书籍对应二维码关系,<ERROR>.[qrcodeSceneService.getQr4Book]:" + e.getMessage(), e);
throw new BizException(e.getCode(), e.getMessage());
......@@ -105,7 +103,6 @@ public class QrcodeSceneConsr {
try {
qrcodeSceneService.deleteAdviserBookQrRelation(adviserId, bookId);
LOGGER.info("【二维码-渠道(消)】删除编辑二维码关联关系,<END>");
} catch (BizException e) {
LOGGER.warn("【二维码-渠道(消)】删除编辑二维码关联关系,<ERROR>.[qrcodeSceneService.deleteBook]:" + e.getMessage(), e);
throw new BizException(e.getCode(), e.getMessage());
......@@ -140,7 +137,6 @@ public class QrcodeSceneConsr {
LOGGER.error("【二维码-渠道(消)】获取书籍二维码个数,<ERROR>.:" + e.getMessage(), e);
throw new BookBizException(BookBizException.INVOKE_CHANNEL_ERROR, "获取书籍二维码个数失败~!");
}
LOGGER.info("【二维码-渠道(消)】获取书籍二维码个数,<END>");
return bookQrCount;
}
......@@ -163,7 +159,6 @@ public class QrcodeSceneConsr {
e);
throw new BookBizException(BookBizException.INVOKE_CHANNEL_ERROR, " 根据图书删除二维码失败~!");
}
LOGGER.info("【二维码-渠道(消)】 根据图书删除二维码,<END>");
}
/**
......@@ -185,7 +180,6 @@ public class QrcodeSceneConsr {
e);
throw new BookBizException(BookBizException.INVOKE_CHANNEL_ERROR, " 根据图书恢复二维码失败~!");
}
LOGGER.info("【二维码-渠道(消)】 根据图书恢复二维码,<END>");
}
/**
......@@ -207,7 +201,6 @@ public class QrcodeSceneConsr {
e);
throw new BookBizException(BookBizException.INVOKE_CHANNEL_ERROR, " 获取图书待审核二维码失败~!");
}
LOGGER.info("【二维码-渠道(消)】 获取图书待审核二维码,<END>");
return result;
}
......@@ -230,7 +223,6 @@ public class QrcodeSceneConsr {
e);
throw new BookBizException(BookBizException.INVOKE_CHANNEL_ERROR, " 获取图书最近关联二维码信息失败~!");
}
LOGGER.info("【二维码-渠道(消)】 获取图书最近关联二维码信息,<END>");
return result;
}
......
......@@ -238,7 +238,6 @@ public class IsbnConsr {
}
}
LOGGER.info("【外部】根据isbn获取书籍信息,<END>");
return result;
}
......@@ -274,7 +273,6 @@ public class IsbnConsr {
httpClient.close();
}
}
LOGGER.info("【外部】根据isbn获取书籍信息,<END>result="+result);
return result;
}
......@@ -312,7 +310,6 @@ public class IsbnConsr {
LOGGER.error("查询书籍失败" + e.getMessage(), e);
}
LOGGER.info("【外部】根据isbn获取书籍信息,<END>");
return result;
}
......
......@@ -10,8 +10,6 @@ import com.pcloud.common.utils.ListUtils;
import com.pcloud.common.utils.ResponseHandleUtil;
import com.pcloud.labelcenter.label.service.LabelService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
......@@ -50,7 +48,6 @@ public class LabelConsr {
} catch (Exception e) {
log.error("【标签中心(消)】标签使用量.[sendMessageQueue]:" + e.getMessage(), e);
}
log.info("【标签中心(消)】标签使用量,<END>");
}
/**
......@@ -67,7 +64,6 @@ public class LabelConsr {
} catch (Exception e) {
log.error("【标签中心(消)】获取标签的名称.[getLabelName]:" + e.getMessage(), e);
}
log.info("【标签中心(消)】获取标签的名称,<END>.[labelNameMap]=" + (labelNameMap == null ? null : labelNameMap.toString()));
return labelNameMap;
}
......@@ -87,7 +83,6 @@ public class LabelConsr {
} catch (Exception e) {
log.error("【标签中心(消)】根据标签名称获取标签id.[getLableIdByName]:" + e.getMessage(), e);
}
log.info("【标签中心(消)】根据标签名称获取标签id,<START>.[labelId]=" + labelId);
return labelId;
}
}
......@@ -3,16 +3,18 @@
*/
package com.pcloud.book.consumer.message;
import java.util.Date;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.pcloud.common.core.biz.MessageBiz;
import com.pcloud.common.core.dto.SendNotifyDto;
import com.pcloud.common.exceptions.BizException;
import com.pcloud.common.utils.string.StringUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.Date;
/**
* @描述:消息中心中间件
* @作者:songx
......@@ -56,7 +58,6 @@ public class MessageConsr {
} catch (Exception e) {
LOGGER.error("【站内信(消)】发送站内信.[sendLetter]:" + e.getMessage(), e);
}
LOGGER.info("【站内信(消)】发送站内信,<END>");
}
/**
......@@ -87,7 +88,6 @@ public class MessageConsr {
} catch (Exception e) {
LOGGER.error("【站内信(消)】发送站内信.[sendLetter]:" + e.getMessage(), e);
}
LOGGER.info("【站内信(消)】发送站内信,<END>");
}
}
......@@ -3,18 +3,17 @@
*/
package com.pcloud.book.consumer.message;
import java.util.Map;
import com.pcloud.common.core.biz.TemplateQueueBiz;
import com.pcloud.common.core.constant.WechatCode;
import com.pcloud.common.core.dto.TemplateMessageDto;
import com.pcloud.common.exceptions.BizException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.pcloud.common.core.biz.TemplateQueueBiz;
import com.pcloud.common.core.constant.SendType;
import com.pcloud.common.core.constant.WechatCode;
import com.pcloud.common.core.dto.TemplateMessageDto;
import com.pcloud.common.exceptions.BizException;
import java.util.Map;
/**
* @描述:发送模板消息
......@@ -56,7 +55,6 @@ public class TemplateConsr {
} catch (Exception e) {
LOGGER.error("【模板消息(消)】发送模板消息topic(管理公众号),<ERROR>.[sendMessageQueue]:" + e.getMessage(), e);
}
LOGGER.info("【模板消息(消)】发送模板消息topic(管理公众号),<END>");
}
public void sendOperate(String SceneCode, Long sendPartyId, Long wechatUserId, String url,
......@@ -76,7 +74,6 @@ public class TemplateConsr {
} catch (Exception e) {
LOGGER.error("【模板消息(消)】发送模板消息topic(运营号),<ERROR>.[sendMessageQueue]:" + e.getMessage(), e);
}
LOGGER.info("【模板消息(消)】发送模板消息topic(运营号),<END>");
}
}
......@@ -8,17 +8,14 @@ import com.pcloud.common.core.biz.WeektaskQueueBiz;
import com.pcloud.common.core.constant.WeektaskBehaviorCode;
import com.pcloud.common.core.constant.WeektaskCode;
import com.pcloud.common.core.dto.WeektaskMessageDto;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.pcloud.common.exceptions.BizException;
import com.pcloud.raystask.entity.AdviserDefault;
import com.pcloud.raystask.task.service.MainLineService;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* @描述:
......@@ -44,7 +41,7 @@ public class MainLineConsr {
* 设置默认应用标识
*/
public void sendDefaultId(AdviserDefault adviserDefault) throws BizException {
LOGGER.info("【rays小游戏(消)】设置默认应用标识,<START>");
LOGGER.info("【rays小游戏(消)】设置默认应用标识,<START>adviserDefault:{}", adviserDefault);
try {
mainLineService.sendDefaultId(adviserDefault);
} catch (Exception e) {
......
......@@ -58,8 +58,6 @@ public class ProductConsr {
} catch (Exception e) {
LOGGER.error("【资源中心(消)】微信端,获取商品信息.[listProDetail4Wechat]:" + e.getMessage(), e);
throw new BookBizException(BookBizException.INVOKE_RES_ERROR, "服务内部错误,请稍后重试");
} finally {
LOGGER.info("【资源中心(消)】微信端,获取商品信息,<END>");
}
}
......@@ -80,8 +78,6 @@ public class ProductConsr {
} catch (Exception e) {
LOGGER.error("【资源中心(消)】获取商品ID集合获取商品的标签.[listProDetail4Wechat]:" + e.getMessage(), e);
throw new BookBizException(BookBizException.INVOKE_RES_ERROR, "服务内部错误,请稍后重试");
} finally {
LOGGER.info("【资源中心(消)】获取商品ID集合获取商品的标签信息,<END>");
}
}
......@@ -102,8 +98,6 @@ public class ProductConsr {
} catch (Exception e) {
LOGGER.error("【资源中心(消)】获取商品基本信息.[getProBasesByIds]:" + e.getMessage(), e);
throw new BookBizException(BookBizException.INVOKE_RES_ERROR, "服务内部错误,请稍后重试");
} finally {
LOGGER.info("【资源中心(消)】获取商品基本信息,<END>");
}
}
......@@ -124,8 +118,6 @@ public class ProductConsr {
} catch (Exception e) {
LOGGER.error("【资源中心(消)】获取商品基本信息.[getProInfoListWithScene]:" + e.getMessage(), e);
throw new BookBizException(BookBizException.INVOKE_RES_ERROR, "服务内部错误,请稍后重试");
} finally {
LOGGER.info("【资源中心(消)】获取商品基本信息,<END>");
}
}
......@@ -145,7 +137,6 @@ public class ProductConsr {
productDtoMap = ResponseHandleUtil.parseMapResponse(
productService.getQaProRetailBase4Group(productIds, channelId, agentId), Long.class,
ProductDto.class);
LOGGER.info("【资源中心(消)】获取问答商品信息结束[productService.getQaProductInfoByIds]:" + productDtoMap);
} catch (BizException e) {
LOGGER.warn("【资源中心(消)】获取问答商品信息失败:" + e.getMessage(), e);
throw new BizException(e.getCode(), e.getMessage());
......@@ -184,7 +175,6 @@ public class ProductConsr {
LOGGER.error("【资源中心(消)】获取商品基本信息.[getProBasesByIds]:" + e.getMessage(), e);
throw new BookBizException(BookBizException.INVOKE_RES_ERROR, "服务内部错误,请稍后重试");
} finally {
LOGGER.info("【资源中心(消)】获取商品基本信息,<END>");
}
}
......@@ -206,8 +196,6 @@ public class ProductConsr {
} catch (Exception e) {
LOGGER.error("【资源中心(消)】自动上架.[productAutoOnShelves]:" + e.getMessage(), e);
throw new BookBizException(BookBizException.INVOKE_RES_ERROR, "服务内部错误,请稍后重试");
} finally {
LOGGER.info("【资源中心(消)】自动上架,<END>");
}
return resultMap;
}
......@@ -230,8 +218,6 @@ public class ProductConsr {
} catch (Exception e) {
LOGGER.error("【资源中心(消)】判断是否是超级作者.[getIsSuperByProductIdList]:" + e.getMessage(), e);
throw new BookBizException(BookBizException.INVOKE_RES_ERROR, "服务内部错误,请稍后重试");
} finally {
LOGGER.info("【资源中心(消)】判断是否是超级作者,<END>");
}
return resultMap;
}
......@@ -262,8 +248,6 @@ public class ProductConsr {
} catch (Exception e) {
LOGGER.error("【资源中心(消)】获取商品基本信息.[getProBasesInfoById]:" + e.getMessage(), e);
throw new BookBizException(BookBizException.INVOKE_RES_ERROR, "服务内部错误,请稍后重试");
} finally {
LOGGER.info("【资源中心(消)】获取商品基本信息,<END>");
}
}
......
package com.pcloud.book.consumer.settlement;
import java.math.BigDecimal;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.pcloud.book.base.exception.BookBizException;
import com.pcloud.common.core.aspect.ParamLog;
import com.pcloud.common.dto.ResponseDto;
import com.pcloud.common.exceptions.BizException;
import com.pcloud.common.utils.ListUtils;
import com.pcloud.common.utils.ResponseHandleUtil;
import com.pcloud.settlementcenter.record.dto.BookIncomeDto;
import com.pcloud.settlementcenter.record.dto.GetGroupClassifyIncomeDTO;
import com.pcloud.settlementcenter.record.dto.GetGroupQrcodeIncomeDTO;
import com.pcloud.settlementcenter.record.dto.GroupRescourceIncomeParamDTO;
import com.pcloud.settlementcenter.record.service.BookService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Component;
import com.pcloud.book.base.exception.BookBizException;
import com.pcloud.common.exceptions.BizException;
import com.pcloud.common.utils.ListUtils;
import com.pcloud.common.utils.ResponseHandleUtil;
import com.pcloud.settlementcenter.record.dto.BookIncomeDto;
import com.pcloud.settlementcenter.record.service.BookService;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @描述:书刊收益中间件
......@@ -65,7 +64,6 @@ public class BookConsr {
LOGGER.error("【书刊-结算(消)】书籍收益信息,<ERROR>.[getBookIncomeInfo]:" + e.getMessage(), e);
throw new BookBizException(BookBizException.INVOKE_USER_ERROR, "书籍收益信息失败~!");
}
LOGGER.info("【书刊-结算(消)】书籍收益信息,<END>");
return bookIncomeMap;
}
......@@ -89,7 +87,6 @@ public class BookConsr {
LOGGER.warn("【书刊-结算(消)】获取图书收益,<ERROR>.[getBookIncome]:" + e.getMessage(), e);
throw new BookBizException(BookBizException.INVOKE_USER_ERROR, "获取图书收益失败~!");
}
LOGGER.info("【书刊-结算(消)】获取图书收益,<END>");
return bookIncome;
}
......@@ -106,7 +103,6 @@ public class BookConsr {
paramMap.put("adviserIdList", adviserIdList);
Map<String, BigDecimal> resultMap = ResponseHandleUtil.parseMap(bookService.getBookIncome(paramMap),
String.class, BigDecimal.class);
LOGGER.info("【书刊-结算(消)】批量获取书刊总收益,<END>");
return resultMap;
}
......
......@@ -3,14 +3,6 @@
*/
package com.pcloud.book.consumer.user;
import java.util.List;
import java.util.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.pcloud.common.exceptions.BizException;
import com.pcloud.common.utils.ListUtils;
import com.pcloud.common.utils.ResponseHandleUtil;
......@@ -18,6 +10,14 @@ import com.pcloud.usercenter.party.adviser.dto.AdviserBaseInfoDto;
import com.pcloud.usercenter.party.adviser.entity.Adviser;
import com.pcloud.usercenter.party.adviser.service.AdviserService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.List;
import java.util.Map;
/**
* @描述:顾问用户中间类
* @作者:lili
......@@ -48,7 +48,6 @@ public class AdviserConsr {
} catch (Exception e) {
LOGGER.error("【顾问用户(消)】获取顾问名称.[getNameById]:" + e.getMessage(), e);
}
LOGGER.info("【顾问用户(消)】获取顾问名称,<END>.[adviserName]=" + adviserName);
return adviserName == null ? "" : adviserName;
}
......@@ -67,7 +66,6 @@ public class AdviserConsr {
} catch (Exception e) {
LOGGER.error("【顾问用户(消)】批量获取顾问名称.[getNames]:" + e.getMessage(), e);
}
LOGGER.info("【顾问用户(消)】批量获取顾问名称,<END>");
return adviserMap;
}
......@@ -85,7 +83,6 @@ public class AdviserConsr {
} catch (Exception e) {
LOGGER.error("【顾问用户(消)】获取顾问基本信息.[getById]:" + e.getMessage(), e);
}
LOGGER.info("【顾问用户(消)】获取顾问基本信息,<END>");
return adviser;
}
......@@ -103,7 +100,6 @@ public class AdviserConsr {
} catch (Exception e) {
LOGGER.error("【顾问用户(消)】获取顾问所属出版.[getAgentIdByAdviser]:" + e.getMessage(), e);
}
LOGGER.info("【顾问用户(消)】获取顾问所属出版,<END>.[agentId]=" + agentId);
return agentId;
}
......@@ -122,7 +118,6 @@ public class AdviserConsr {
} catch (Exception e) {
LOGGER.error("【顾问用户(消)】获取顾问信息(包含所属出版社).[getAdviserId2AdviserInfoDtoMap]:" + e.getMessage(), e);
}
LOGGER.info("【顾问用户(消)】获取顾问信息(包含所属出版社),<END>");
return resultMap;
}
......@@ -143,7 +138,6 @@ public class AdviserConsr {
} catch (Exception e) {
LOGGER.error("【顾问用户(消)】根据代理标识获取编辑标识列表.[getByAgentId]:" + e.getMessage(), e);
}
LOGGER.info("【顾问用户(消)】根据代理标识获取编辑标识列表,<END>");
return adviserIds;
}
......@@ -165,7 +159,6 @@ public class AdviserConsr {
} catch (Exception e) {
LOGGER.error("【顾问用户(消)】根据名称代理标识获取编辑标识列表.[getIdsByNameAndAgentId]:" + e.getMessage(), e);
}
LOGGER.info("【顾问用户(消)】根据名称代理标识获取编辑标识列表,<END>");
return adviserIds;
}
......@@ -182,7 +175,6 @@ public class AdviserConsr {
}catch (Exception e) {
LOGGER.error("【顾问用户(消)】获取默认运营.[getNameById]:" + e.getMessage(), e);
}
LOGGER.info("【顾问用户(消)】获取默认运营,<END>.");
return channelId;
}
......
......@@ -3,13 +3,6 @@
*/
package com.pcloud.book.consumer.user;
import java.util.List;
import java.util.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Component;
import com.pcloud.channelcenter.base.exceptions.ChannelBizException;
import com.pcloud.common.dto.ResponseDto;
import com.pcloud.common.exceptions.BizException;
......@@ -18,6 +11,15 @@ import com.pcloud.common.utils.ResponseHandleUtil;
import com.pcloud.usercenter.party.agent.entity.Agent;
import com.pcloud.usercenter.party.agent.service.AgentService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Component;
import java.util.List;
import java.util.Map;
/**
* @描述:代理工具类
* @作者:songx
......@@ -45,7 +47,6 @@ public class AgentConsr {
} catch (Exception e) {
LOGGER.error("【代理用户(消)】获取代理类型,<ERROR>.[getAgentType]:" + e.getMessage(), e);
}
LOGGER.info("【代理用户(消)】获取代理类型,<END>.[agentType]=" + agentType);
return agentType == null ? null : agentType;
}
......@@ -91,7 +92,6 @@ public class AgentConsr {
} catch (Exception e) {
LOGGER.error("【出版用户(消)】批量获取出版名称.[getNames]:" + e.getMessage(), e);
}
LOGGER.info("【出版用户(消)】批量获取出版名称,<END>");
return agentMap;
}
}
......@@ -3,19 +3,19 @@
*/
package com.pcloud.book.consumer.user;
import java.util.List;
import java.util.Map;
import com.pcloud.book.base.exception.BookBizException;
import com.pcloud.common.exceptions.BizException;
import com.pcloud.common.utils.ResponseHandleUtil;
import com.pcloud.usercenter.common.dto.BookCaseParamDto;
import com.pcloud.usercenter.common.service.BookcaseService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.pcloud.book.base.exception.BookBizException;
import com.pcloud.common.exceptions.BizException;
import com.pcloud.common.utils.ResponseHandleUtil;
import com.pcloud.usercenter.common.dto.BookCaseParamDto;
import com.pcloud.usercenter.common.service.BookcaseService;
import java.util.List;
import java.util.Map;
/**
* @描述:书架中间类
......@@ -48,7 +48,6 @@ public class BookcaseConsr {
LOGGER.error("【书架-用户(消)】更换书架书籍所属权,<ERROR>.[changeBookAdviser]:" + e.getMessage(), e);
throw new BookBizException(BookBizException.INVOKE_USER_ERROR, "更换书架书籍所属权失败~!");
}
LOGGER.info("【书架-用户(消)】更换书架书籍所属权,<END>");
}
/**
......@@ -67,7 +66,6 @@ public class BookcaseConsr {
LOGGER.error("【书架-用户(消)】获取书籍是否加入书架,<ERROR>.[changeBookAdviser]:" + e.getMessage(), e);
throw new BookBizException(BookBizException.INVOKE_USER_ERROR, "获取书籍是否加入书架失败~!");
}
LOGGER.info("【书架-用户(消)】获取书籍是否加入书架,<END>");
return resultMap;
}
......@@ -86,6 +84,5 @@ public class BookcaseConsr {
LOGGER.error("【书架-用户(消)】删除读者书架上的书籍,<ERROR>.[deleteBookForAdviser]:" + e.getMessage(), e);
throw new BookBizException(BookBizException.INVOKE_USER_ERROR, "删除读者书架上的书籍失败~!");
}
LOGGER.info("【书架-用户(消)】删除读者书架上的书籍,<END>");
}
}
\ No newline at end of file
......@@ -46,8 +46,7 @@ public class ChannelConsr {
} catch (Exception e) {
LOGGER.error("【渠道用户(消)】获取渠道名称,<ERROR>.[getNameById]:" + e.getMessage(), e);
}
LOGGER.info("【渠道用户(消)】获取渠道名称,<END>.[channelName]=" + channelName);
return channelName == null ? null : channelName;
return channelName;
}
/**
......@@ -65,7 +64,6 @@ public class ChannelConsr {
} catch (Exception e) {
LOGGER.error("【渠道用户(消)】获取渠道信息,<ERROR>.[getNamesByIdList]:" + e.getMessage(), e);
}
LOGGER.info("【渠道用户(消)】获取渠道信息,<END>");
return channelMap;
}
......@@ -83,7 +81,6 @@ public class ChannelConsr {
} catch (Exception e) {
LOGGER.error("【渠道用户(消)】获取代理标识,<ERROR>.[getParentId]:" + e.getMessage(), e);
}
LOGGER.info("【渠道用户(消)】获取渠道标识,<END>.[agentId]=" + agentId);
return agentId;
}
......@@ -101,7 +98,6 @@ public class ChannelConsr {
try {
status = ResponseHandleUtil
.parseResponse(channelService.judgeChannelAdviserRelationship(channelId, adviserId), Boolean.class);
LOGGER.info("验证编辑渠道是否为一个出版社结束[channelService.judgeChannelAdviserRelationship]");
} catch (BizException e) {
LOGGER.warn("验证编辑渠道是否为一个出版社失败:" + e.getMessage(), e);
throw new BizException(e.getCode(), e.getMessage());
......
......@@ -52,7 +52,6 @@ public class PartyConsr {
}
Map<Long, Agent> agentInfoMap = ResponseHandleUtil
.parseMapResponse(partyService.getAgentByPartyId(partyIds, roleCode), Long.class, Agent.class);
LOGGER.info("【用户中心(消)】批量获取代理基本信息,<END>");
return agentInfoMap;
}
......@@ -66,7 +65,6 @@ public class PartyConsr {
}
Map<Long, String> resultMap = ResponseHandleUtil
.parseMapResponse(userLoginService.getAllUserLoginName(partyId, systemCode), Long.class, String.class);
LOGGER.info("【用户中心(消)】获取平台端所有账号的用户名,<END>.result = " + resultMap.toString());
return resultMap;
}
......
......@@ -58,8 +58,6 @@ public class WechatGroupConsr {
} catch (Exception e) {
log.error("根据机器人id和用户微信id获取最新暗号.[getCipherByRobotAndUserWxId]:" + e.getMessage(), e);
throw new BookBizException(BookBizException.INVOKE_RES_ERROR, "服务内部错误,请稍后重试");
} finally {
log.info("【根据机器人id和用户微信id获取最新暗号,<END>");
}
}
......@@ -77,7 +75,6 @@ public class WechatGroupConsr {
log.error("是否群机器人.[isGroupRobot]:" + e.getMessage(), e);
throw new BookBizException(BookBizException.INVOKE_RES_ERROR, "服务内部错误,请稍后重试");
} finally {
log.info("【是否群机器人,<END>");
}
}
......@@ -98,7 +95,6 @@ public class WechatGroupConsr {
log.error("是否黑名单.[isKickUser]:" + e.getMessage(), e);
throw new BookBizException(BookBizException.INVOKE_RES_ERROR, "服务内部错误,请稍后重试");
} finally {
log.info("【是否黑名单,<END>");
}
}
......@@ -120,7 +116,6 @@ public class WechatGroupConsr {
log.error("根据群号获取机器人微信号.[getRobotIdByGroupId]:" + e.getMessage(), e);
throw new BookBizException(BookBizException.INVOKE_RES_ERROR, "服务内部错误,请稍后重试");
} finally {
log.info("【根据群号获取机器人微信号,<END>");
}
}
......@@ -138,8 +133,6 @@ public class WechatGroupConsr {
} catch (Exception e) {
log.error("根据群号获取发广告机器人微信号.[getSendAdRobotByGroupId]:" + e.getMessage(), e);
throw new BookBizException(BookBizException.INVOKE_RES_ERROR, "服务内部错误,请稍后重试");
} finally {
log.info("【根据群号获取发广告机器人微信号,<END>");
}
}
......@@ -161,8 +154,6 @@ public class WechatGroupConsr {
} catch (Exception e) {
log.error("根据昵称获取微信id.[getWxUserIdsByNickName]:" + e.getMessage(), e);
throw new BookBizException(BookBizException.INVOKE_RES_ERROR, "服务内部错误,请稍后重试");
} finally {
log.info("【根据昵称获取微信id,<END>");
}
}
......@@ -275,8 +266,6 @@ public class WechatGroupConsr {
} catch (Exception e) {
log.error("根据群号获取群主微信号.[getMasterIdByGroupId]:" + e.getMessage(), e);
throw new BookBizException(BookBizException.INVOKE_RES_ERROR, "服务内部错误,请稍后重试");
} finally {
log.info("【根据群号获取群主微信号,<END>--masterId=" + masterId);
}
}
......
......@@ -45,8 +45,6 @@ import com.pcloud.common.utils.json.JSONUtils;
import com.pcloud.common.utils.string.StringUtil;
import com.pcloud.readercenter.wechat.entity.WechatUser;
import com.pcloud.resourcecenter.base.exceptions.ResBizException;
import com.pcloud.resourcecenter.product.dto.ProductFreeCodeDto;
import com.pcloud.resourcecenter.product.entity.ProductFreeCode;
import com.pcloud.settlementcenter.record.exceptions.RecordException;
import org.apache.commons.lang3.StringUtils;
......@@ -167,7 +165,7 @@ public class BookAuthCodeBizImpl implements BookAuthCodeBiz {
}
@Override
@ParamLog("校验服务是否需要验证")
@ParamLog(value = "校验服务是否需要验证", isAfterReturn = false)
public Boolean checkServe(CheckIsAuthServeParam checkIsAuthServeParam, Long channelId, Long wechatUserId) {
Long serveId = checkIsAuthServeParam.getServeId();
String serveType = checkIsAuthServeParam.getServeType();
......@@ -194,11 +192,7 @@ public class BookAuthCodeBizImpl implements BookAuthCodeBiz {
}
//校验用户是否已经授权过
Boolean isHaveAuth = bookAuthUserBiz.checkIsHaveAuth(bookId, channelId, adviserId, wechatUserId,null);
if (isHaveAuth) {
return false;
} else {
return true;
}
return !isHaveAuth;
}
@Override
......@@ -371,7 +365,7 @@ public class BookAuthCodeBizImpl implements BookAuthCodeBiz {
}
//表名
String title = "《" + bookDto.getBookName() + "》" + "的授权码";
String[] rowsName = {"序号", "授权码", "完整授权码", "生成方式", "状态", "创建时间"};
String[] rowsName = {"序号", "完整授权码", "生成方式", "状态", "创建时间"};
String fileUrl = "";
String finalTitle = title;
//不管是全部导出还是导出部分,都使用异步处理
......@@ -443,13 +437,13 @@ public class BookAuthCodeBizImpl implements BookAuthCodeBiz {
}
Object[] objs = new Object[rowsNameList.size()];
objs[0] = i + 1;
objs[1] = bookAuthCode.getAuthCode();
objs[2] = bookAuthCode.getFullCode();
//objs[1] = bookAuthCode.getAuthCode();
objs[1] = bookAuthCode.getFullCode();
CopyrightConstants.CreateType createType = CopyrightConstants.CreateType.CRATE_TYPE_MAP.get(bookAuthCode.getCreateType());
objs[3] = null == createType ? "-" : createType.getName();
objs[4] = bookAuthCode.getUseCount() > 0 ? "已使用" : "未使用";
objs[2] = null == createType ? "-" : createType.getName();
objs[3] = bookAuthCode.getUseCount() > 0 ? "已使用" : "未使用";
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
objs[5] = bookAuthCode.getCreatedDate() != null ? df.format(bookAuthCode.getCreatedDate()) : "";
objs[4] = bookAuthCode.getCreatedDate() != null ? df.format(bookAuthCode.getCreatedDate()) : "";
dataList.add(objs);
fileUrl = exportConsr.exportExcel(title, rowsName, dataList);
}
......@@ -516,20 +510,20 @@ public class BookAuthCodeBizImpl implements BookAuthCodeBiz {
SXSSFCell cell0 = srow.createCell(0);
cell0.setCellStyle(dataStyle);
cell0.setCellValue(k++);
SXSSFCell cell1 = srow.createCell(1);
/*SXSSFCell cell1 = srow.createCell(1);
cell1.setCellStyle(dataStyle);
cell1.setCellValue(bookAuthCodeDTO.getAuthCode());
SXSSFCell cell2 = srow.createCell(2);
cell1.setCellValue(bookAuthCodeDTO.getAuthCode());*/
SXSSFCell cell2 = srow.createCell(1);
cell2.setCellStyle(dataStyle);
cell2.setCellValue(bookAuthCodeDTO.getFullCode());
SXSSFCell cell3 = srow.createCell(3);
SXSSFCell cell3 = srow.createCell(2);
cell3.setCellStyle(dataStyle);
CopyrightConstants.CreateType createType = CopyrightConstants.CreateType.CRATE_TYPE_MAP.get(bookAuthCodeDTO.getCreateType());
cell3.setCellValue(null == createType ? "-" : createType.getName());
SXSSFCell cell4 = srow.createCell(4);
SXSSFCell cell4 = srow.createCell(3);
cell4.setCellStyle(dataStyle);
cell4.setCellValue(bookAuthCodeDTO.getUseCount() > 0 ? "已使用" : "未使用");
SXSSFCell cell5 = srow.createCell(5);
SXSSFCell cell5 = srow.createCell(4);
cell5.setCellStyle(dataStyle);
cell5.setCellValue(bookAuthCodeDTO.getCreatedDate() != null ? df.format(bookAuthCodeDTO.getCreatedDate()) : "");
}
......
......@@ -51,17 +51,12 @@ public class ESNewsBizImpl implements ESNewsBiz {
Integer index = 0;
Integer offset = 10000;
while (index * offset < count) {
Date date=new Date();
List<ESNews> list = newsDao.findAll(maxId, offset);
LOGGER.info("查询10000用时" + (new Date().getTime() - date.getTime()));
if (ListUtils.isEmpty(list)) {
break;
}
Date date1=new Date();
newsRepository.save(list);
LOGGER.info("插入es10000用时" + (new Date().getTime() - date1.getTime()));
maxId = Long.valueOf(list.get(list.size() - 1).getId());
LOGGER.info("导入数据至" + maxId);
index += 1;
}
}
......
......@@ -6,8 +6,8 @@ import com.pcloud.book.group.dao.AppClickRecordDao;
import com.pcloud.book.group.dao.GroupQrcodeDao;
import com.pcloud.book.group.entity.AppClickRecord;
import com.pcloud.book.group.entity.GroupQrcode;
import com.pcloud.common.core.aspect.ParamLog;
import com.pcloud.common.utils.string.StringUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
......@@ -25,7 +25,6 @@ public class AppClickRecordBizImpl implements AppClickRecordBiz {
private GroupQrcodeDao groupQrcodeDao;
@ParamLog("新增应用作品点击记录")
@Override
public Long createAppClickRecord(AppClickRecord appClickRecord) {
if (appClickRecord.getQrcodeId() == null) {
......
......@@ -2012,9 +2012,8 @@ public class BookGroupBizImpl implements BookGroupBiz {
dataMap.put("productSumStatistics", productSumStatistics);
String today = DateUtils.formatDate(DateUtils.nowTimeStamp(), DateUtils.DATE_FORMAT_DATEONLY);
String fileName = title+ "-" + today;
String filePath = "";
String filePath;
try {
LOGGER.info("生成Excel【START】");
filePath = ExcelExportor.uploadExcel(this.getClass(), dataMap, "template_bookGroupStatistics.ftl");
LOGGER.info("生成Excel【END】" + filePath);
} catch (Exception e) {
......
package com.pcloud.book.group.dto;
import com.pcloud.book.adnews.entity.AdNews;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* @Description
* @Author ruansiyuan
* @Date 2019/7/18 15:09
**/
@Data
public class GroupQrcodeFoAdDTO implements Serializable {
private static final long serialVersionUID = 7018070035247234809L;
......@@ -18,45 +23,25 @@ public class GroupQrcodeFoAdDTO implements Serializable {
private String weixinGroupId;
public Long getQrcodeId() {
return qrcodeId;
}
public void setQrcodeId(Long qrcodeId) {
this.qrcodeId = qrcodeId;
}
public Long getClassifyId() {
return classifyId;
}
public void setClassifyId(Long classifyId) {
this.classifyId = classifyId;
}
public Long getBookGroupId() {
return bookGroupId;
}
public void setBookGroupId(Long bookGroupId) {
this.bookGroupId = bookGroupId;
}
public String getWeixinGroupId() {
return weixinGroupId;
}
public void setWeixinGroupId(String weixinGroupId) {
this.weixinGroupId = weixinGroupId;
}
@Override
public String toString() {
return "GroupQrcodeFoAdDTO{" +
"qrcodeId=" + qrcodeId +
", classifyId=" + classifyId +
", bookGroupId=" + bookGroupId +
", weixinGroupId='" + weixinGroupId + '\'' +
'}';
}
// 专业id
private Long proLabelId;
// 深度id
private Long depLabelId;
// 目的id
private Long purLabelId;
// 专业
private String proLabelName;
// 深度
private String depLabelName;
// 目的
private String purLabelName;
// 需要发送的早晚报
private List<AdNews> adNewsList;
}
package com.pcloud.book.group.facade;
import com.pcloud.book.group.vo.*;
import com.pcloud.book.group.vo.AddClassifyVO;
import com.pcloud.book.group.vo.AdviserClassifyParam;
import com.pcloud.book.group.vo.AdviserClassifyVO;
import com.pcloud.book.group.vo.BookGroupClassifyVO;
import com.pcloud.book.group.vo.BookGroupQrcodeStatisticVO;
import com.pcloud.book.group.vo.ClassifyAndGroupCountVO;
import com.pcloud.book.group.vo.ClassifyAndUserCountVO;
import com.pcloud.book.group.vo.ClassifyNameVO;
import com.pcloud.book.group.vo.ClassifyVO;
import com.pcloud.book.group.vo.GroupQrcode4ClassifyVO;
import com.pcloud.book.group.vo.ListBookGroupQrcodeExportParamVO;
import com.pcloud.book.group.vo.ListBookGroupQrcodeParamVO;
import com.pcloud.book.group.vo.ListClassify4WechatVO;
import com.pcloud.book.group.vo.ListClassifyVO;
import com.pcloud.book.group.vo.ListGroupClassifyParam;
import com.pcloud.book.group.vo.StatisticVO;
import com.pcloud.book.group.vo.UpdateClassifyVO;
import com.pcloud.book.group.vo.UpdateRankVO;
import com.pcloud.common.dto.ResponseDto;
import com.pcloud.common.exceptions.BizException;
import com.pcloud.common.page.PageBeanNew;
import com.pcloud.common.permission.PermissionException;
import io.swagger.annotations.*;
import org.springframework.web.bind.annotation.CookieValue;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
......@@ -18,6 +34,12 @@ import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
/**
* @author lily
* @date 2019/4/16 21:00
......@@ -141,7 +163,6 @@ public interface BookGroupClassifyFacade {
ResponseDto<?> bookGroupQrcodeStatisticExport(@RequestHeader("token") String token, @RequestBody ListBookGroupQrcodeExportParamVO listBookGroupQrcodeExportParamVO) throws PermissionException;
@ApiOperation(value = "获取编辑社群码统计数据", httpMethod = "GET")
@RequestMapping(value = "getStatistic4Adviser", method = RequestMethod.GET)
@ApiImplicitParams({@ApiImplicitParam(name = "token", value = "token", dataType = "String", paramType = "header")
})
@GetMapping("getStatistic4Adviser")
......
......@@ -301,7 +301,7 @@ public class BookGroupFacadeImpl implements BookGroupFacade {
@RequestMapping(value = "isSpecialAgent", method = RequestMethod.GET)
public ResponseDto<Boolean> isSpecialAgent(@RequestHeader("token") String token) throws BizException, PermissionException {
Long agentId = (Long) SessionUtil.getVlaue(token, SessionUtil.TENANT_ID);
return new ResponseDto<Boolean>(bookGroupBiz.isSpecialAgent(agentId));
return new ResponseDto<>(bookGroupBiz.isSpecialAgent(agentId));
}
@ApiOperation("获取应用作品统计")
......
......@@ -27,7 +27,7 @@ public class GroupSet {
* @param classifyId
*/
public void sendGroupClassifyDeleteTopic(Long classifyId) {
LOGGER.info("【社群书】发送群分类删除topic,<START>");
LOGGER.info("【社群书】发送群分类删除topic,<START>classifyId:{}", classifyId);
GroupTopicDTO groupTopicDTO = new GroupTopicDTO();
groupTopicDTO.setClassifyId(classifyId);
try {
......@@ -35,7 +35,6 @@ public class GroupSet {
} catch (Exception e) {
LOGGER.error("【社群书】发送群分类删除topic,<ERROR>", e);
}
LOGGER.info("【社群书】发送群分类删除topic,<END>");
}
}
......@@ -411,7 +411,7 @@ public class SendWeixinRequestTools {
// 1001745 包含图片和文字则不合并关键词详情,其他情况走之前的模式
if (CollectionUtils.isEmpty(collect)) {
isOld = false;
sb.append("\n\n本群配有以下资源服务,链接或回复相应关键词立即获取:\n");
sb.append("\n\n本群配有以下资源服务,点击链接或回复相应关键词立即获取:\n");
for (KeywordDTO keyword : keywords) {
if (sb.length() + (keyword.getKeywords() + "\n").length() >= 730) {
break;
......@@ -419,7 +419,7 @@ public class SendWeixinRequestTools {
sb.append("关键词:").append(keyword.getKeywords()).append("\n");
if (ReplyTypeEnum.LINK.value.equals(keyword.getReplyType()) || ReplyTypeEnum.APP.value.equals(keyword.getReplyType())) {
String linkUrl = SendWeixinRequestTools.splitUrlNew(accountSettingDto, keyword.getLinkUrl(), classifyQrcodeInfo.getBookGroupId(), classifyQrcodeInfo.getClassifyId(), classifyQrcodeInfo.getGroupQrcodeId());
sb.append(" ").append(keyword.getContent()).append(UrlUtils.getShortUrl4Own(linkUrl)).append("\n\n");
sb.append(" ").append(keyword.getContent()).append("\n->").append(UrlUtils.getShortUrl4Own(linkUrl)).append("\n\n");
}
}
} else {
......@@ -442,7 +442,7 @@ public class SendWeixinRequestTools {
String feedbackUrl = "*common/C" + classifyQrcodeInfo.getChannelId() + "/A0/feedback/suggest?groupQrcodeId=" + classifyQrcodeInfo.getGroupQrcodeId();
String url = splitUrl(accountSettingDto, feedbackUrl);
LOGGER.info("发送欢迎语反馈链接feedbackUrl:{}, url:{}", feedbackUrl, url);
groupKeyword.append("\n\n群资源与书上介绍不符?点这里反馈\n->").append(UrlUtils.getShortUrl4Own(url));
groupKeyword.append("群资源与书上介绍不符?点这里反馈\n->").append(UrlUtils.getShortUrl4Own(url));
return groupKeyword;
}
......@@ -461,7 +461,6 @@ public class SendWeixinRequestTools {
}
if(isOld) {
// 旧流程直接输出关键词, 不用考虑换行问题
if(dto.getReportOpen()) {
sb.append("【学习报告】");
}
......@@ -471,33 +470,24 @@ public class SendWeixinRequestTools {
if(dto.getClockOpen()) {
sb.append("【").append(dto.getClockKeyword()).append("】");
}
// 最后加入空白行
sb.append("\n\n");
}
else {
//新流程在每个关键词开头检查前面是否有关键词输出, 并决定是否需要添加空行
boolean hasItem = false;
if(dto.getReportOpen()) {
sb.append("关键词:学习报告\n回复学习报告,获取个人学习报告,与群成员PK元气值");
hasItem = true;
sb.append("关键词:学习报告\n 回复学习报告,获取个人学习报告,与群成员PK元气值\n\n");
}
if(dto.getRiddleOpen()) {
addEmptyLineWhenHasItem(hasItem,sb);
sb.append("关键词:猜谜语\n回复猜谜语,开启群游戏,连续答对5题,所有群成员可获得精美礼券");
hasItem = true;
sb.append("关键词:猜谜语\n 回复猜谜语,开启群游戏,连续答对5题,所有群成员可获得精美礼券\n\n");
}
if(dto.getClockOpen()) {
addEmptyLineWhenHasItem(hasItem,sb);
sb.append("关键词:").append(dto.getClockKeyword()).append("\n").append(dto.getClockGuide());
sb.append("关键词:").append(dto.getClockKeyword()).append("\n ").append(dto.getClockGuide()).append("\n\n");
}
}
return sb;
}
private static void addEmptyLineWhenHasItem(boolean hasItem, StringBuilder sb) {
if(hasItem){
sb.append("\n\n");
}
}
private static String getNickNameStr(String weixinGroupId) {
StringBuilder nameStr = new StringBuilder();
Map<String, Integer> nickNames = JedisClusterUtils.getJson("BOOK:WEIXINGROUP:GUIDEUSER" + weixinGroupId, Map.class);
......
......@@ -392,7 +392,7 @@ public class BookKeywordBizImpl implements BookKeywordBiz {
}
@Override
@ParamLog("获取关键词列表")
@ParamLog(value = "获取关键词列表", isAfterReturn = false)
public PageBeanNew<ListKeywordVO> listKeywordsByClassify(ListKeywordParam listKeywordParam) {
PageParam pageParam = new PageParam(listKeywordParam.getCurrentPage(), listKeywordParam.getNumPerPage());
Map<String, Object> paramMap = new HashMap<>();
......
......@@ -50,7 +50,6 @@ public class ConvertFileListener {
@Override
public void run() {
while (true) {
LOGGER.info("开始轮询cqds");
//如果cqds没有记录,休眠60秒
if (MapUtils.isEmpty(cqds)) {
try {
......@@ -62,7 +61,7 @@ public class ConvertFileListener {
for (Map.Entry<String, ConvertQueueDto> e : cqds.entrySet()) {
if (e.getValue() != null) {
ConvertQueueDto convertFileDto = e.getValue();
LOGGER.warn("转码后信息>>>>>" + convertFileDto.toString());
LOGGER.info("转码后信息>>>>>" + convertFileDto.toString());
String fileCategory = FileUtils.getGatherName(convertFileDto.getFileType());
String fileId = convertFileDto.getFileId();
String fileUrl = convertFileDto.getFileUrl();
......
......@@ -41,18 +41,15 @@ public class PayMentListener {
public void onMessage(OrderTopicDto dto) throws BizException {
LOGGER.info("【接收交易中心支付消息】[Message]={}", dto);
if (dto == null || dto.getOrderNum() == null) {
LOGGER.error("【接收支付信息】订单为空,<ERROR>.[orderNum]={}", dto.getOrderNum());
throw new BookBizException(BookBizException.CONSUMER_TOPIC_ERROR, "订单为空");
}
// 判断是不是群分类作品,如果不是跳过不处理
List<OrderItemTopicDto> itemList = dto.getItemList();
if (CollectionUtils.isEmpty(itemList)) {
LOGGER.info("【接收支付信息】不是有效的作品订单消息,<ERROR>");
return;
}
OrderItemTopicDto orderItemTopicDto = itemList.get(0);
if (!ProductTypeConstant.BOOK_GROUP.equals(orderItemTopicDto.getProductTypeCode())) {
LOGGER.info("【接收支付信息】不是有效的群分类作品订单消息,<ERROR>");
return;
}
// BigDecimal actualPay = dto.getActualPay();
......
......@@ -108,7 +108,6 @@ public class WXGroupLearningReportListener {
sendTextMessageVO.setAltId(alt);
sendTextMessageVO.setContent("个人专属学习报告,及群成员元气排行榜。点击获取" + resultUrl);
sendTextMessageVO.setIp(findIp(wechatGroupId));
LOGGER.info("发送文字消息开始"+sendTextMessageVO.toString());
WxGroupSDK.sendTextMessage(sendTextMessageVO);
LOGGER.info("发送文字消息结束"+sendTextMessageVO.toString());
if (ListUtils.isEmpty(learningScoreDTOS)) {
......@@ -120,9 +119,8 @@ public class WXGroupLearningReportListener {
sendPicMessageVO.setWxGroupId(wechatGroupId);
sendPicMessageVO.setAltId(alt);
sendPicMessageVO.setIp(findIp(wechatGroupId));
LOGGER.info("发送分享图消息开始"+sendPicMessageVO.toString());
WxGroupSDK.sendPicMessage(sendPicMessageVO);
LOGGER.info("发送分享图消息开始"+sendPicMessageVO.toString());
LOGGER.info("发送分享图消息结束"+sendPicMessageVO.toString());
} catch (Exception e) {
LOGGER.error("接收学习报告topic失败" + e.getMessage(), e);
}
......
package com.pcloud.book.mq.topic;
import com.pcloud.book.clock.biz.BookClockKeywordBiz;
import com.pcloud.book.clock.check.BookClockCheck;
import com.pcloud.book.clock.dto.BookClockInfoDTO;
import com.pcloud.book.consumer.wechatgroup.WechatGroupConsr;
import com.pcloud.book.group.biz.BookGroupClassifyBiz;
import com.pcloud.book.group.biz.GroupQrcodeBiz;
......@@ -12,22 +9,21 @@ import com.pcloud.book.mq.config.MQTopicConumer;
import com.pcloud.book.riddle.biz.RiddleRecordBiz;
import com.pcloud.book.util.common.ThreadPoolUtils;
import com.pcloud.book.weixinclock.biz.WeixinClockBiz;
import com.pcloud.common.constant.CacheConstant;
import com.pcloud.common.core.aspect.ParamLog;
import com.pcloud.common.exceptions.BizException;
import com.pcloud.common.utils.ListUtils;
import com.pcloud.common.utils.cache.redis.JedisClusterUtils;
import com.pcloud.common.utils.string.StringUtil;
import com.pcloud.wechatgroup.message.dto.SendTextDTO;
import com.sdk.wxgroup.SendMessageTypeEnum;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.List;
import java.util.Objects;
import lombok.extern.slf4j.Slf4j;
......@@ -75,7 +71,6 @@ public class WxGroupSendTextListener {
} else {
final long l = System.currentTimeMillis();
bookKeywordBiz.sendKeywordMessage(sendTextDTO);
log.info("[接收用户发送文本消息] 总耗时:{}ms ", System.currentTimeMillis() - l);
}
//猜谜语
riddleRecordBiz.riddleProcess(sendTextDTO);
......
......@@ -325,7 +325,6 @@ public class PushBizImpl implements PushBiz {
//遍历发送消息
for (PushItem pushItem : pushItemList) {
try {
LOGGER.info("发送一个群里的一个消息开始pushGroup=" + pushGroup.toString() + "pushItem=" + pushItem.toString() + "altId=" + altId);
sendWechatMessage(pushGroup, pushItem, pushGroupRecord.getId(), altId);
LOGGER.info("发送一个群里的一个消息结束,休眠1秒pushGroup=" + pushGroup.toString() + "pushItem=" + pushItem.toString() + "altId=" + altId);
Thread.sleep(1000);
......
......@@ -120,7 +120,7 @@
NOT EXISTS ( SELECT 1 FROM ad_news_ban e WHERE a.id = e.ad_news_id AND e.adviser_id = c.adviser_id )
AND NOT EXISTS (SELECT 1 from ad_news_group_record f WHERE f.ad_news_id=a.id and f.ad_news_set_id=#{adNewsSetId})
ORDER BY
a.id DESC
a.create_time DESC
LIMIT #{top}
</select>
......@@ -139,7 +139,55 @@
NOT EXISTS ( SELECT 1 FROM ad_news_ban e WHERE a.id = e.ad_news_id AND e.adviser_id = #{adviserId} )
AND NOT EXISTS (SELECT 1 from ad_news_group_record f WHERE f.ad_news_id=a.id and f.ad_news_set_id=#{adNewsSetId})
ORDER BY
a.id DESC
a.create_time DESC
LIMIT #{top}
</select>
<!--查找要发送的新闻(新闻标题匹配标签)-->
<!--
1、ad_news_ban 排除掉禁止发送的
2、ad_news_group_record 排除掉已发送的
-->
<select id="getNewsByLabelName" parameterType="map" resultMap="BaseResultMap">
SELECT
a.id, a.type, a.news_from, a.title, a.publisher, a.url, a.short_url, a.news_date, a.create_time,0 content_from
FROM
ad_news a
INNER JOIN ad_news_wechat b ON a.news_from = b.news_from AND b.is_delete = 0
INNER JOIN ad_news_wechat_choose c ON c.ad_news_wechat_id = b.id AND c.is_delete = 0 AND c.adviser_id = #{adviserId}
WHERE
NOT EXISTS ( SELECT 1 FROM ad_news_ban e WHERE a.id = e.ad_news_id AND e.adviser_id = c.adviser_id )
AND NOT EXISTS (SELECT 1 from ad_news_group_record f WHERE f.ad_news_id=a.id and f.ad_news_set_id=#{adNewsSetId})
AND a.create_time >= #{beginTime}
AND (a.title LIKE CONCAT('%', #{proLabelName},'%')
OR a.title LIKE CONCAT('%', #{depLabelName},'%')
OR a.title LIKE CONCAT('%', #{purLabelName},'%'))
ORDER BY
a.create_time DESC
LIMIT #{top}
</select>
<!--查找要发送的新闻(公众号名称匹配标签)-->
<!--
1、ad_news_ban 排除掉禁止发送的
2、ad_news_group_record 排除掉已发送的
-->
<select id="getNews4WechatByLabelName" parameterType="map" resultMap="BaseResultMap">
SELECT
a.id, a.type, a.news_from, a.title, a.publisher, a.url, a.short_url, a.news_date, a.create_time,0 content_from
FROM
ad_news a
INNER JOIN ad_news_wechat b ON a.news_from = b.news_from AND b.is_delete = 0
INNER JOIN ad_news_wechat_choose c ON c.ad_news_wechat_id = b.id AND c.is_delete = 0 AND c.adviser_id = #{adviserId}
WHERE
NOT EXISTS ( SELECT 1 FROM ad_news_ban e WHERE a.id = e.ad_news_id AND e.adviser_id = c.adviser_id )
AND NOT EXISTS (SELECT 1 from ad_news_group_record f WHERE f.ad_news_id=a.id and f.ad_news_set_id=#{adNewsSetId})
AND a.create_time >= #{beginTime}
AND (b.wechat_name LIKE CONCAT('%', #{proLabelName},'%')
OR b.wechat_name LIKE CONCAT('%', #{depLabelName},'%')
OR b.wechat_name LIKE CONCAT('%', #{purLabelName},'%'))
ORDER BY
a.create_time DESC
LIMIT #{top}
</select>
......@@ -180,10 +228,10 @@
AND a.title like concat('%', #{title},'%')
</if>
<if test="beginTime!=null">
AND a.news_date <![CDATA[>=]]> #{beginTime}
AND a.create_time <![CDATA[>=]]> #{beginTime}
</if>
<if test="endTime!=null">
AND a.news_date<![CDATA[<=]]> #{endTime}
AND a.create_time<![CDATA[<=]]> #{endTime}
</if>
<if test="hasBan==0">
AND NOT EXISTS (SELECT 1 FROM ad_news_ban WHERE ad_news_id=a.id and adviser_id=#{partyId} LIMIT 1)
......@@ -197,6 +245,7 @@
<if test="hasUsed==1">
AND EXISTS (SELECT 1 FROM ad_news_group_record WHERE ad_news_id=a.id and create_user=#{partyId} LIMIT 1)
</if>
ORDER BY a.create_time DESC,a.id DESC
</select>
<!--获取编辑选择的素材-->
......
......@@ -8,6 +8,7 @@
<result column="has_morning_open" property="hasMorningOpen" jdbcType="BOOLEAN"/>
<result column="has_evening_open" property="hasEveningOpen" jdbcType="BOOLEAN"/>
<result column="send_count" property="sendCount" jdbcType="INTEGER"/>
<result column="send_rule" property="sendRule" jdbcType="INTEGER"/>
<result column="start_content" property="startContent" jdbcType="VARCHAR"/>
<result column="end_content" property="endContent" jdbcType="VARCHAR"/>
<result column="has_start_content" property="hasStartContent" jdbcType="BOOLEAN"/>
......@@ -22,7 +23,7 @@
</resultMap>
<sql id="Base_Column_List">
id, morning_time, evening_time, has_morning_open, has_evening_open, send_count, start_content,
id, morning_time, evening_time, has_morning_open, has_evening_open, send_count,send_rule, start_content,
end_content, has_start_content, has_end_content, create_user, create_time, update_user, update_time
,content_from,morning_content,evening_content
</sql>
......@@ -42,6 +43,7 @@
has_morning_open,
has_evening_open,
send_count,
send_rule,
start_content,
end_content,
has_start_content,
......@@ -60,6 +62,7 @@
#{hasMorningOpen,jdbcType=BOOLEAN},
#{hasEveningOpen,jdbcType=BOOLEAN},
#{sendCount,jdbcType=INTEGER},
#{sendRule,jdbcType=INTEGER},
#{startContent,jdbcType=VARCHAR},
#{endContent,jdbcType=VARCHAR},
#{hasStartContent,jdbcType=BOOLEAN},
......@@ -92,6 +95,9 @@
<if test="sendCount != null">
send_count = #{sendCount,jdbcType=INTEGER},
</if>
<if test="sendRule != null">
send_rule = #{sendRule,jdbcType=INTEGER},
</if>
<if test="startContent != null">
start_content = #{startContent,jdbcType=VARCHAR},
</if>
......
......@@ -8,7 +8,7 @@
<result column="file_convert_state" property="fileConvertState" jdbcType="INTEGER" />
<result column="file_size" property="fileSize" jdbcType="BIGINT" />
<result column="file_name" property="fileName" jdbcType="VARCHAR" />
<result column="file_duration" property="fileDuration" jdbcType="BIGINT" />
<result column="file_duration" property="fileDuration" jdbcType="DECIMAL" />
<result column="file_url" property="fileUrl" jdbcType="VARCHAR" />
<result column="file_pilot_second" property="filePilotSecond" jdbcType="BIGINT" />
<result column="file_pilot_url" property="filePilotUrl" jdbcType="VARCHAR" />
......@@ -49,7 +49,7 @@
(
#{item.adId,jdbcType=BIGINT}, #{item.fileId,jdbcType=VARCHAR},
#{item.fileConvertState,jdbcType=INTEGER}, #{item.fileSize,jdbcType=BIGINT}, #{item.fileName,jdbcType=VARCHAR},
#{item.fileDuration,jdbcType=BIGINT}, #{item.fileUrl,jdbcType=VARCHAR}, #{item.filePilotSecond,jdbcType=BIGINT},
#{item.fileDuration,jdbcType=DECIMAL}, #{item.fileUrl,jdbcType=VARCHAR}, #{item.filePilotSecond,jdbcType=BIGINT},
#{item.filePilotUrl,jdbcType=VARCHAR}, #{item.filePilotFinishTip,jdbcType=VARCHAR}, #{item.title,jdbcType=VARCHAR},
#{item.coverPic,jdbcType=VARCHAR}, NOW(), #{item.cpaId}
)
......
......@@ -537,13 +537,18 @@
t.id qrcodeId,
t.weixin_group_id weixinGroupId,
t1.id classifyId,
t1.book_group_id bookGroupId
t1.book_group_id bookGroupId,
t2.pro_label_id proLabelId,
t2.dep_label_id depLabelId,
t2.pur_label_id purLabelId
FROM
book_group_qrcode t
INNER JOIN book_group_classify t1 ON t.classify_id = t1.id
INNER JOIN book_group t2 ON t2.id = t1.book_group_id
WHERE
t.is_delete = 0
AND t1.is_delete = 0
AND t2.is_delete = 0
AND t1.id IN
<foreach collection = "list" index="index" item = "item" open = "(" separator= "," close = ")">
#{item}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment