|
@@ -1,5 +1,6 @@
|
|
|
package com.usky.dxtop.service.impl;
|
|
|
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
@@ -28,9 +29,16 @@ public class MsgLogServiceImpl extends ServiceImpl<MsgLogMapper, MsgLog> impleme
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public void consumerSuccess(Long id,String consequence) {
|
|
|
- MsgLog msgLog = this.getById(id);
|
|
|
+ public void consumerSuccess(String consequence) {
|
|
|
+ JSONObject jsonObject = JSONObject.parseObject(consequence);
|
|
|
+ Long msgId = Long.parseLong(jsonObject.get("seq").toString());
|
|
|
+ MsgLog msgLog = this.getById(msgId);
|
|
|
if (this.isRepetition(msgLog)){
|
|
|
+ if ("1".equals(jsonObject.get("code").toString())){
|
|
|
+ msgLog.setIsSuccess(true);
|
|
|
+ }else {
|
|
|
+ msgLog.setIsSuccess(false);
|
|
|
+ }
|
|
|
msgLog.setConsequence(consequence);
|
|
|
msgLog.setMsgFlag(MsgLogStatus.CONSUMER_SUCCESS.getCode());
|
|
|
this.updateById(msgLog);
|
|
@@ -41,6 +49,7 @@ public class MsgLogServiceImpl extends ServiceImpl<MsgLogMapper, MsgLog> impleme
|
|
|
public boolean isSuccess(Long businessId) {
|
|
|
LambdaQueryWrapper<MsgLog> queryWrapper = Wrappers.lambdaQuery();
|
|
|
queryWrapper.eq(MsgLog::getMsgFlag,MsgLogStatus.CONSUMER_SUCCESS.getCode())
|
|
|
+ .eq(MsgLog::getIsSuccess,true)
|
|
|
.eq(MsgLog::getBusinessId,businessId);
|
|
|
int count = this.count(queryWrapper);
|
|
|
if (count > 0){
|