修复商品审核关闭后,修改商品不生成索引问题。升级mybatis-plus版本至 3.4.3.4 和hutool版本至 5.7.16。适配新版本mybatis-plus

This commit is contained in:
paulGao
2021-12-15 11:35:41 +08:00
parent c3fbad7dbf
commit a9ddcfeb95
62 changed files with 193 additions and 211 deletions

View File

@@ -130,8 +130,8 @@ public class GoodsMessageListener implements RocketMQListener<MessageExt> {
//生成索引
case GENERATOR_GOODS_INDEX:
try {
String goodsJsonStr = new String(messageExt.getBody());
Goods goods = JSONUtil.toBean(goodsJsonStr, Goods.class);
String goodsId = new String(messageExt.getBody());
Goods goods = this.goodsService.getById(goodsId);
updateGoodsIndex(goods);
} catch (Exception e) {
log.error("生成商品索引事件执行异常,商品信息 {}", new String(messageExt.getBody()));

View File

@@ -158,12 +158,12 @@ public class NoticeSendMessageListener implements RocketMQListener<MessageExt> {
//查询所有会员总数,因为会员总数比较大 如果一次性查出来会占用数据库资源,所以要分页查询
MemberSearchVO memberSearchVO = new MemberSearchVO();
memberSearchVO.setDisabled(SwitchEnum.OPEN.name());
Integer memberNum = memberService.getMemberNum(memberSearchVO);
long memberNum = memberService.getMemberNum(memberSearchVO);
//构建分页查询参数
//100条查一次
Integer pageSize = 100;
Integer pageCount = 0;
pageCount = memberNum / pageSize;
int pageSize = 100;
int pageCount;
pageCount = (int) (memberNum / pageSize);
pageCount = memberNum % pageSize > 0 ? pageCount + 1 : pageCount;
for (int i = 1; i <= pageCount; i++) {
PageVO pageVO = new PageVO();