记得上下班打卡 | git大法好,push需谨慎

Commit 3e419dfb authored by sunyuntian's avatar sunyuntian

修改bug

parent bc85ccca
...@@ -30,33 +30,34 @@ public class SweetWechatMaoDengServiceImpl { ...@@ -30,33 +30,34 @@ public class SweetWechatMaoDengServiceImpl {
@Autowired @Autowired
WechatMaConfigure maConfigure; WechatMaConfigure maConfigure;
public ResponseDto addBuilderImg(String userId, String imgUrl) { public ResponseDto addBuilderImg(String userId,String imgUrl){
LocalDateTime localDateTime = DateUtil.asLocalDateTime(DateUtil.now()); //生成创建时间 LocalDateTime localDateTime = DateUtil.asLocalDateTime(DateUtil.now()); //生成创建时间
try { try {
log.error("[userId] = {}", userId); log.error("[userId] = {}", userId);
log.error("[imgUrl] = {}", imgUrl); log.error("[imgUrl] = {}", imgUrl);
String maoId = IDGenerator.nextSnowId();
SweetWechatUsersVo wechatUsers = redisUtils.getSweetWechatUsersOfUnionId(userId, 1); String maoId = IDGenerator.nextSnowId();
if (null == wechatUsers) { SweetWechatUsersVo wechatUsers = redisUtils.getSweetWechatUsersOfUnionId(userId, 1);
return ResponseDto.failure("请求失败"); if (null == wechatUsers) {
} return ResponseDto.failure("请求失败");
SweetMaoDengVo sweetMaoDeng = redisUtils.getSweetMaoDeng(wechatUsers.getOpenId()); }
if (sweetMaoDeng != null) { SweetMaoDengVo sweetMaoDeng = redisUtils.getSweetMaoDeng(wechatUsers.getOpenId());
sweetMaoDeng.setImgUrl(imgUrl); if (sweetMaoDeng != null){
} sweetMaoDeng.setImgUrl(imgUrl);
String textMsg = sweetMaoDeng.getTextMsg(); }
String picUrl = sweetMaoDeng.getPicUrl(); String textMsg = sweetMaoDeng.getTextMsg();
sweetMaoDeng.setCreatedAt(localDateTime); String picUrl = sweetMaoDeng.getPicUrl();
redisUtils.setSweetMaoDeng(sweetMaoDeng); sweetMaoDeng.setCreatedAt(localDateTime);
if (StringUtil.isNotEmpty(textMsg) && StringUtil.isNotEmpty(picUrl)) { redisUtils.setSweetMaoDeng(sweetMaoDeng);
//redis队列入库 if (StringUtil.isNotEmpty(textMsg) && StringUtil.isNotEmpty(picUrl)){
LinkedList<String> sqls = CollectionUtil.linkedListString(); //redis队列入库
LinkedList<Object[]> sqlsDataA = CollectionUtil.linkedListObjectArr(); LinkedList<String> sqls = CollectionUtil.linkedListString();
sqls.add(SqlMapping.get("sweet_wechat_maodeng.insert")); LinkedList<Object[]> sqlsDataA = CollectionUtil.linkedListObjectArr();
sqlsDataA.add(new Object[]{maoId, userId, textMsg, picUrl, imgUrl,localDateTime}); sqls.add(SqlMapping.get("sweet_wechat_maodeng.insert"));
queueUtils.sendMsgByRedis(MQConst.SweetQueue.SWEET_WECHAT_MAODENG_TEXT_INSERT.getKey(), SqlMapping.gets(sqls, sqlsDataA)); sqlsDataA.add(new Object[]{maoId, userId, textMsg, picUrl,imgUrl,localDateTime});
return ResponseDto.failure("请求成功"); queueUtils.sendMsgByRedis(MQConst.SweetQueue.SWEET_WECHAT_MAODENG_TEXT_INSERT.getKey(), SqlMapping.gets(sqls, sqlsDataA));
} return ResponseDto.failure("请求成功");
}
return ResponseDto.failure("请求失败"); return ResponseDto.failure("请求失败");
} catch (Exception e) { } catch (Exception 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