Commit 7aac8d48 by 吕明尚

优惠卷日志只在核销劵的方法保存

parent 803b62b8
package share.framework.aspectj;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
......@@ -89,21 +90,22 @@ public class QPServiceImplAspect {
JSONObject jsonObject = JSON.parseObject(params);
//获得出参
String outParams = JSON.toJSONString(result);
// if(methodName.equals("consume")){
saveLog(couponLog, jsonObject);
couponLog.setStatus(YesNoEnum.yes.getDisplay_3());
couponLog.setMessage(outParams);
couponLog.setCreateTime(new Date());
// 异步执行
CompletableFuture.supplyAsync(() -> {
int i = couponLogService.insertCouponLog(couponLog);
if (i > 0) {
return true;
} else {
return false;
}
});
if (methodName.equals("consume")) {
saveLog(couponLog, jsonObject);
couponLog.setStatus(YesNoEnum.yes.getDisplay_3());
couponLog.setMessage(outParams);
couponLog.setCreateTime(new Date());
// 异步执行
CompletableFuture.supplyAsync(() -> {
int i = couponLogService.insertCouponLog(couponLog);
if (i > 0) {
return true;
} else {
return false;
}
});
// }
}
} catch (Exception e) {
e.printStackTrace();
}
......@@ -127,7 +129,7 @@ public class QPServiceImplAspect {
String params = argsArrayToString(paramNames, joinPoint.getArgs());
//转JSON
JSONObject jsonObject = JSON.parseObject(params);
// if(methodName.equals("consume")) {
if (methodName.equals("consume")) {
saveLog(couponLog, jsonObject);
couponLog.setStatus(YesNoEnum.no.getDisplay_3());
couponLog.setNumber(tryCount);
......@@ -142,7 +144,7 @@ public class QPServiceImplAspect {
return false;
}
});
// }
}
} catch (Exception e2) {
e2.printStackTrace();
}
......
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