Commit e87bb825 by lili

mq 修改

parent b8fd3490
package com.pcloud.book.book.biz.impl; package com.pcloud.book.book.biz.impl;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import com.pcloud.book.base.enums.ProxyModeEnum; import com.pcloud.book.base.enums.ProxyModeEnum;
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 org.springframework.transaction.annotation.Transactional;
import com.pcloud.book.base.exception.BookBizException; import com.pcloud.book.base.exception.BookBizException;
import com.pcloud.book.book.biz.BookFreezeBiz; import com.pcloud.book.book.biz.BookFreezeBiz;
import com.pcloud.book.book.biz.BookFundBiz; import com.pcloud.book.book.biz.BookFundBiz;
...@@ -20,9 +9,20 @@ import com.pcloud.book.book.dto.BookFreezeDto; ...@@ -20,9 +9,20 @@ import com.pcloud.book.book.dto.BookFreezeDto;
import com.pcloud.book.book.entity.BookFreeze; import com.pcloud.book.book.entity.BookFreeze;
import com.pcloud.book.book.entity.BookFund; import com.pcloud.book.book.entity.BookFund;
import com.pcloud.book.book.entity.ThawEarning; import com.pcloud.book.book.entity.ThawEarning;
import com.pcloud.book.mq.config.MqConfig; import com.pcloud.common.core.constant.MQTopicProducer;
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.string.StringUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/** /**
* 图书冻结业务层实现类 * 图书冻结业务层实现类
...@@ -41,6 +41,8 @@ public class BookFreezeBizImpl implements BookFreezeBiz { ...@@ -41,6 +41,8 @@ public class BookFreezeBizImpl implements BookFreezeBiz {
private BookFreezeDao bookFreezeDao; private BookFreezeDao bookFreezeDao;
@Autowired @Autowired
private BookFundBiz bookFundBiz; private BookFundBiz bookFundBiz;
@Autowired
private AmqpTemplate amqpTemplate;
/** /**
* 获取图书是否被冻结 * 获取图书是否被冻结
...@@ -109,12 +111,13 @@ public class BookFreezeBizImpl implements BookFreezeBiz { ...@@ -109,12 +111,13 @@ public class BookFreezeBizImpl implements BookFreezeBiz {
Long bookFundId = bookFund == null ? null : bookFund.getBookFundId(); Long bookFundId = bookFund == null ? null : bookFund.getBookFundId();
try { try {
bookFreezeDao.thaw(bookFundId,thawEarning.getBookId(), partyId); bookFreezeDao.thaw(bookFundId,thawEarning.getBookId(), partyId);
}catch (Exception e) { } catch (Exception e) {
LOGGER.error("【图书收益冻结管理(平台端)】解冻收益,<ERROR>.[bookFreezeDao.thaw]" + e.getMessage(), e); LOGGER.error("【图书收益冻结管理(平台端)】解冻收益,<ERROR>.[bookFreezeDao.thaw]" + e.getMessage(), e);
throw new BookBizException(BookBizException.DB_DML_FAIL, "解冻收益失败!"); throw new BookBizException(BookBizException.DB_DML_FAIL, "解冻收益失败!");
} }
thawEarning.setFreezetime(bookFreezeDto.getFreezetime()); thawEarning.setFreezetime(bookFreezeDto.getFreezetime());
MqConfig.sendBookThawTopic(thawEarning); amqpTemplate.convertAndSend(MQTopicProducer.EXCHAGE, MQTopicProducer.BOOK_THAW, thawEarning);
} }
/** /**
......
...@@ -44,12 +44,12 @@ import com.pcloud.book.consumer.user.BookcaseConsr; ...@@ -44,12 +44,12 @@ import com.pcloud.book.consumer.user.BookcaseConsr;
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.user.PartyConsr;
import com.pcloud.book.consumer.voicemessage.MerchantVideoConsr; import com.pcloud.book.consumer.voicemessage.MerchantVideoConsr;
import com.pcloud.book.mq.config.MqConfig;
import com.pcloud.channelcenter.base.constants.MessageFromTypeEnum; import com.pcloud.channelcenter.base.constants.MessageFromTypeEnum;
import com.pcloud.channelcenter.qrcode.dto.QrcodeLocationDto; import com.pcloud.channelcenter.qrcode.dto.QrcodeLocationDto;
import com.pcloud.channelcenter.qrcode.vo.BookAssocLastQrAskVO; import com.pcloud.channelcenter.qrcode.vo.BookAssocLastQrAskVO;
import com.pcloud.channelcenter.qrcode.vo.BookAssocLastQrVO; import com.pcloud.channelcenter.qrcode.vo.BookAssocLastQrVO;
import com.pcloud.comment.base.enums.SysCodeEnum; import com.pcloud.comment.base.enums.SysCodeEnum;
import com.pcloud.common.core.constant.MQTopicProducer;
import com.pcloud.common.core.constant.SystemCode; import com.pcloud.common.core.constant.SystemCode;
import com.pcloud.common.exceptions.BizException; import com.pcloud.common.exceptions.BizException;
import com.pcloud.common.utils.BookUtils; import com.pcloud.common.utils.BookUtils;
...@@ -72,11 +72,16 @@ import org.apache.commons.lang3.StringUtils; ...@@ -72,11 +72,16 @@ import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.math.NumberUtils; import org.apache.commons.lang3.math.NumberUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.*; import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/** /**
* @描述:图书信息填充 * @描述:图书信息填充
...@@ -130,7 +135,8 @@ public class BookSet { ...@@ -130,7 +135,8 @@ public class BookSet {
private MessageConsr messageConsr; private MessageConsr messageConsr;
@Autowired @Autowired
private BookFreezeDao bookFreezeDao; private BookFreezeDao bookFreezeDao;
@Autowired
private AmqpTemplate amqpTemplate;
/** /**
* 检验书号是否合法,包括ISSN,ISBN,CSSN * 检验书号是否合法,包括ISSN,ISBN,CSSN
* *
...@@ -400,7 +406,7 @@ public class BookSet { ...@@ -400,7 +406,7 @@ public class BookSet {
bookIds.add(bookId); bookIds.add(bookId);
bookDeleteDto.setBookIds(bookIds); bookDeleteDto.setBookIds(bookIds);
try { try {
MqConfig.sendBookDeleteTopic(bookDeleteDto); amqpTemplate.convertAndSend(MQTopicProducer.EXCHAGE, MQTopicProducer.BOOK_DELETE, bookDeleteDto);
} catch (Exception e) { } catch (Exception e) {
LOGGER.error("【书籍基础】发送书籍删除topic,<ERROR>", e); LOGGER.error("【书籍基础】发送书籍删除topic,<ERROR>", e);
} }
...@@ -417,7 +423,7 @@ public class BookSet { ...@@ -417,7 +423,7 @@ public class BookSet {
BookDeleteDto bookDeleteDto = new BookDeleteDto(); BookDeleteDto bookDeleteDto = new BookDeleteDto();
bookDeleteDto.setBookIds(bookIds); bookDeleteDto.setBookIds(bookIds);
try { try {
MqConfig.sendBookDeleteTopic(bookDeleteDto); amqpTemplate.convertAndSend(MQTopicProducer.EXCHAGE, MQTopicProducer.BOOK_DELETE, bookDeleteDto);
} catch (Exception e) { } catch (Exception e) {
LOGGER.error("【书籍基础】发送批量删除书籍topic,<ERROR>", e); LOGGER.error("【书籍基础】发送批量删除书籍topic,<ERROR>", e);
} }
......
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