添加日志
This commit is contained in:
1 parent
d7bcbb4e1e
commit
3bdaa080e3
1 file changed
+5
@@ -14,6 +14,7 @@ import com.ruoyi.system.mapper.AppsBalanceLedgerMapper;
|
|||||||
import com.ruoyi.system.mapper.AppsMapper;
|
import com.ruoyi.system.mapper.AppsMapper;
|
||||||
import com.ruoyi.system.mapper.UsdtConfigMapper;
|
import com.ruoyi.system.mapper.UsdtConfigMapper;
|
||||||
import com.ruoyi.system.mapper.WalletAddressLedgerMapper;
|
import com.ruoyi.system.mapper.WalletAddressLedgerMapper;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.transaction.support.TransactionSynchronization;
|
import org.springframework.transaction.support.TransactionSynchronization;
|
||||||
@@ -26,6 +27,7 @@ import java.math.BigDecimal;
|
|||||||
* 系统业务流水入账服务。
|
* 系统业务流水入账服务。
|
||||||
* 链上广播必须在调用本服务前完成,本服务只负责数据库状态与流水的原子落库。
|
* 链上广播必须在调用本服务前完成,本服务只负责数据库状态与流水的原子落库。
|
||||||
*/
|
*/
|
||||||
|
@Slf4j
|
||||||
@Service
|
@Service
|
||||||
public class WalletLedgerPostingService {
|
public class WalletLedgerPostingService {
|
||||||
private static final long STATUS_PENDING = 1L;
|
private static final long STATUS_PENDING = 1L;
|
||||||
@@ -66,12 +68,15 @@ public class WalletLedgerPostingService {
|
|||||||
throw new CustomException("订单不存在");
|
throw new CustomException("订单不存在");
|
||||||
}
|
}
|
||||||
if (Long.valueOf(STATUS_PAID).equals(order.getStatus())) {
|
if (Long.valueOf(STATUS_PAID).equals(order.getStatus())) {
|
||||||
|
log.warn("订单已经支付 {}",orderId);
|
||||||
return transactionId.equals(order.getBlockTransactionId());
|
return transactionId.equals(order.getBlockTransactionId());
|
||||||
}
|
}
|
||||||
if (!Long.valueOf(STATUS_PENDING).equals(order.getStatus())) {
|
if (!Long.valueOf(STATUS_PENDING).equals(order.getStatus())) {
|
||||||
|
log.warn("订单状态不正确 {}",orderId);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (ordersMapper.countPaidByTransactionId(transactionId, orderId) > 0) {
|
if (ordersMapper.countPaidByTransactionId(transactionId, orderId) > 0) {
|
||||||
|
log.warn("订单transactionId已经存在 {}",orderId);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user