Commit 289dc4d1 by 桂前礼

bug: [none] 解决未捕获到超过限制异常的bug

parent a0c815d9
......@@ -7,7 +7,6 @@ import com.pcloud.book.group.biz.GroupMaterialAccountBiz;
import com.pcloud.book.group.entity.GroupMaterialAccount;
import com.pcloud.book.group.mapper.GroupMaterialAccountMapper;
import com.pcloud.common.utils.ResponseHandleUtil;
import com.pcloud.facade.wechat.exceptions.WechatSeviceException;
import com.pcloud.facade.wechat.material.service.MaterialService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -71,16 +70,13 @@ public class GroupMaterialAccountBizImpl implements GroupMaterialAccountBiz {
String mediaId = ResponseHandleUtil.parseResponse(materialService.addImgMaterial(account.getAccountId(), COVER_IMAGE), String.class);
account.setCoverMediaId(mediaId);
}
} catch (WechatSeviceException e) {
// 接口调用超过限制,继续循环,获取下一个公众号
if (45009 == e.getCode()) {
// 更新状态为达到限制
} catch (Exception e) {
// 接口调用超过限制,更新状态为达到限制,继续循环,获取下一个公众号
if (account.getStatus() == 1) {
account.setStatus(0);
account.setUpdateTime(new Date());
groupMaterialAccountMapper.update(account);
}
}
continue;
}
}
......
......@@ -236,18 +236,13 @@ public class WeixinQrcodeBizImpl implements WeixinQrcodeBiz {
mediaId = ResponseHandleUtil.parseResponse(materialService.getGroupNewsMaterial(groupNewsMaterialAddDTO), String.class);
// 增加素材更新时间字段,方便查询更新失败的群信息
groupQrcodeDao.updateMediaId(baseById.getId(), mediaId, new Date());
} catch (WechatSeviceException e) {
// 接口调用超过限制,继续循环,获取下一个公众号
if (45009 == e.getCode()) {
// 更新状态为达到限制
} catch (Exception e) {
if (activeAccount.getStatus() == 1) {
activeAccount.setStatus(0);
activeAccount.setUpdateTime(new Date());
groupMaterialAccountMapper.update(activeAccount);
}
}
throw new BizException(WechatSeviceException.MATERIAL_ADD_ERROR, "更新二维码永久图文素材失败!");
}
}
}
......
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