|
@@ -7,6 +7,9 @@ import cn.hutool.json.JSONUtil;
|
|
|
import lombok.Data;
|
|
import lombok.Data;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
+import org.apache.dubbo.config.annotation.DubboReference;
|
|
|
|
|
+import org.dromara.backstage.api.RemoteXfExceptionService;
|
|
|
|
|
+import org.dromara.backstage.api.domain.bo.RemoteXfExceptionBo;
|
|
|
import org.dromara.backstage.api.domain.vo.RemoteCardVo;
|
|
import org.dromara.backstage.api.domain.vo.RemoteCardVo;
|
|
|
import org.dromara.backstage.api.domain.vo.RemoteMealTypeVo;
|
|
import org.dromara.backstage.api.domain.vo.RemoteMealTypeVo;
|
|
|
import org.dromara.backstage.api.domain.vo.RemoteUserAccountVo;
|
|
import org.dromara.backstage.api.domain.vo.RemoteUserAccountVo;
|
|
@@ -29,6 +32,7 @@ import org.dromara.server.consume.check.ConsumeUploadCheck;
|
|
|
import org.dromara.server.consume.domain.vo.PtBagVo;
|
|
import org.dromara.server.consume.domain.vo.PtBagVo;
|
|
|
import org.dromara.server.consume.domain.vo.XfCardLimitedVo;
|
|
import org.dromara.server.consume.domain.vo.XfCardLimitedVo;
|
|
|
import org.dromara.server.consume.domain.vo.XfTermVo;
|
|
import org.dromara.server.consume.domain.vo.XfTermVo;
|
|
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.scheduling.annotation.Async;
|
|
import org.springframework.scheduling.annotation.Async;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
@@ -50,12 +54,17 @@ import java.util.concurrent.atomic.AtomicInteger;
|
|
|
@Service
|
|
@Service
|
|
|
@RequiredArgsConstructor
|
|
@RequiredArgsConstructor
|
|
|
public class ConsumeBusiness {
|
|
public class ConsumeBusiness {
|
|
|
|
|
+ @Value("${sms.swdx.phone}")
|
|
|
|
|
+ private String exSendPhone;
|
|
|
|
|
+
|
|
|
private final CommonCheck commonCheck;
|
|
private final CommonCheck commonCheck;
|
|
|
private final ConsumeRequestCheck requestCheck;
|
|
private final ConsumeRequestCheck requestCheck;
|
|
|
private final ConsumeUploadCheck uploadCheck;
|
|
private final ConsumeUploadCheck uploadCheck;
|
|
|
private final BaseBusiness baseBusiness;
|
|
private final BaseBusiness baseBusiness;
|
|
|
private final TermBusiness termBusiness;
|
|
private final TermBusiness termBusiness;
|
|
|
|
|
|
|
|
|
|
+ @DubboReference
|
|
|
|
|
+ private final RemoteXfExceptionService remoteXfExceptionService;
|
|
|
/**
|
|
/**
|
|
|
* 请求消费
|
|
* 请求消费
|
|
|
*
|
|
*
|
|
@@ -218,6 +227,7 @@ public class ConsumeBusiness {
|
|
|
@Async
|
|
@Async
|
|
|
public void postOrderAsync(ConsumptionBo bo, String mac, String xfPwd) {
|
|
public void postOrderAsync(ConsumptionBo bo, String mac, String xfPwd) {
|
|
|
R<ErrorInfo> result = null;
|
|
R<ErrorInfo> result = null;
|
|
|
|
|
+ //setConsumeDetailException(bo, "消费明细异常测试");
|
|
|
for (int i = 0; i < 3; i++) {
|
|
for (int i = 0; i < 3; i++) {
|
|
|
result = SpringUtils.getAopProxy(this).postOrder(bo, mac, xfPwd);
|
|
result = SpringUtils.getAopProxy(this).postOrder(bo, mac, xfPwd);
|
|
|
if (R.isSuccess(result)) {
|
|
if (R.isSuccess(result)) {
|
|
@@ -227,10 +237,31 @@ public class ConsumeBusiness {
|
|
|
}
|
|
}
|
|
|
if (R.isError(result)) {
|
|
if (R.isError(result)) {
|
|
|
log.info("[上传交易异步处理尝试3次失败,需要手工处理]-[{}]-[{}]", JSONUtil.toJsonStr(bo), JSONUtil.toJsonStr(result.getData()));
|
|
log.info("[上传交易异步处理尝试3次失败,需要手工处理]-[{}]-[{}]", JSONUtil.toJsonStr(bo), JSONUtil.toJsonStr(result.getData()));
|
|
|
|
|
+ setConsumeDetailException(bo, JSONUtil.toJsonStr(result.getData()));
|
|
|
}
|
|
}
|
|
|
log.info("[上传交易异步处理完成]");
|
|
log.info("[上传交易异步处理完成]");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ private void setConsumeDetailException(ConsumptionBo bo,String message){
|
|
|
|
|
+ RemoteXfExceptionBo remoteBo = new RemoteXfExceptionBo();
|
|
|
|
|
+ remoteBo.setCardNo(bo.getCardNo());
|
|
|
|
|
+ remoteBo.setFactoryId(bo.getFactoryId());
|
|
|
|
|
+ remoteBo.setTermNo(bo.getTermNo());
|
|
|
|
|
+ remoteBo.setTermRecordId(bo.getTermRecordId());
|
|
|
|
|
+ remoteBo.setRecordId(bo.getRecordId());
|
|
|
|
|
+ remoteBo.setUserId(bo.getUserId());
|
|
|
|
|
+ remoteBo.setUserNumb(bo.getUserNumb());
|
|
|
|
|
+ remoteBo.setRealName(bo.getRealName());
|
|
|
|
|
+ remoteBo.setConsumeDate(bo.getConsumeDate());
|
|
|
|
|
+ remoteBo.setConsumeMoney(bo.getConsumeMoney());
|
|
|
|
|
+ remoteBo.setRequestData(JsonUtils.toJsonString(bo));
|
|
|
|
|
+ remoteBo.setExceptInfo(message);
|
|
|
|
|
+ remoteBo.setStatus("0");
|
|
|
|
|
+ remoteBo.setDealInfo("");
|
|
|
|
|
+
|
|
|
|
|
+ remoteXfExceptionService.insertByRemoteBo(remoteBo);
|
|
|
|
|
+ remoteXfExceptionService.sendExceptionSms(exSendPhone,message);
|
|
|
|
|
+ }
|
|
|
//region 原始消费记录对账
|
|
//region 原始消费记录对账
|
|
|
|
|
|
|
|
/**
|
|
/**
|