|
@@ -322,27 +322,28 @@ public class AssetServiceImpl extends ServiceImpl<AssetMapper, Asset> implements
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public void withdrawNotify(SxyNotifyParam param) {
|
|
|
|
|
|
+ public String withdrawNotify(SxyNotifyParam param) {
|
|
|
|
+ String statusStr = "FAIL";
|
|
JSONObject responseData = TradeHandle.decrypt(param);
|
|
JSONObject responseData = TradeHandle.decrypt(param);
|
|
if(responseData == null){
|
|
if(responseData == null){
|
|
- return;
|
|
|
|
|
|
+ return statusStr;
|
|
}
|
|
}
|
|
log.info("提现回调参数:{}", responseData);
|
|
log.info("提现回调参数:{}", responseData);
|
|
String requestId = responseData.getString("requestId");
|
|
String requestId = responseData.getString("requestId");
|
|
Long id = Long.parseLong(requestId);
|
|
Long id = Long.parseLong(requestId);
|
|
OmsTransferWithdraw withdraw = transferWithdrawService.queryById(id);
|
|
OmsTransferWithdraw withdraw = transferWithdrawService.queryById(id);
|
|
if(withdraw == null){
|
|
if(withdraw == null){
|
|
- return;
|
|
|
|
|
|
+ return statusStr;
|
|
}
|
|
}
|
|
final Integer[] transferStatus = {withdraw.getStatus()};
|
|
final Integer[] transferStatus = {withdraw.getStatus()};
|
|
if(transferStatus[0] != 0){
|
|
if(transferStatus[0] != 0){
|
|
- return;
|
|
|
|
|
|
+ return "success";
|
|
}
|
|
}
|
|
String withdrawAmount = responseData.getString("withdrawAmount");
|
|
String withdrawAmount = responseData.getString("withdrawAmount");
|
|
BigDecimal amount = withdraw.getAmount();
|
|
BigDecimal amount = withdraw.getAmount();
|
|
if(amount.multiply(new BigDecimal("100")).compareTo(new BigDecimal(withdrawAmount)) != 0){
|
|
if(amount.multiply(new BigDecimal("100")).compareTo(new BigDecimal(withdrawAmount)) != 0){
|
|
//金额不一致
|
|
//金额不一致
|
|
- return;
|
|
|
|
|
|
+ return statusStr;
|
|
}
|
|
}
|
|
String withdrawStatus = responseData.getString("withdrawStatus");
|
|
String withdrawStatus = responseData.getString("withdrawStatus");
|
|
final BigDecimal[] procedureAmount = {BigDecimal.ZERO};
|
|
final BigDecimal[] procedureAmount = {BigDecimal.ZERO};
|
|
@@ -355,7 +356,7 @@ public class AssetServiceImpl extends ServiceImpl<AssetMapper, Asset> implements
|
|
} else if("FAIL".equals(withdrawStatus)){
|
|
} else if("FAIL".equals(withdrawStatus)){
|
|
transferStatus[0] = 2;
|
|
transferStatus[0] = 2;
|
|
} else {
|
|
} else {
|
|
- return;
|
|
|
|
|
|
+ return statusStr;
|
|
}
|
|
}
|
|
String errorMessage = responseData.getString("errorMessage");
|
|
String errorMessage = responseData.getString("errorMessage");
|
|
DatabaseContextHolder.transactional((Executor) () -> {
|
|
DatabaseContextHolder.transactional((Executor) () -> {
|
|
@@ -374,6 +375,7 @@ public class AssetServiceImpl extends ServiceImpl<AssetMapper, Asset> implements
|
|
}
|
|
}
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
+ return "success";
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -382,27 +384,28 @@ public class AssetServiceImpl extends ServiceImpl<AssetMapper, Asset> implements
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public void transferNotify(SxyNotifyParam param) {
|
|
|
|
|
|
+ public String transferNotify(SxyNotifyParam param) {
|
|
|
|
+ String statusStr = "FAIL";
|
|
JSONObject responseData = TradeHandle.decrypt(param);
|
|
JSONObject responseData = TradeHandle.decrypt(param);
|
|
log.info("转账回调参数:{}", responseData);
|
|
log.info("转账回调参数:{}", responseData);
|
|
if(responseData == null){
|
|
if(responseData == null){
|
|
- return;
|
|
|
|
|
|
+ return statusStr;
|
|
}
|
|
}
|
|
String requestId = responseData.getString("requestId");
|
|
String requestId = responseData.getString("requestId");
|
|
Long id = Long.parseLong(requestId);
|
|
Long id = Long.parseLong(requestId);
|
|
OmsTransferWithdraw transfer = transferWithdrawService.queryById(id);
|
|
OmsTransferWithdraw transfer = transferWithdrawService.queryById(id);
|
|
if(transfer == null){
|
|
if(transfer == null){
|
|
- return;
|
|
|
|
|
|
+ return statusStr;
|
|
}
|
|
}
|
|
final Integer[] transferStatus = {transfer.getStatus()};
|
|
final Integer[] transferStatus = {transfer.getStatus()};
|
|
if(transferStatus[0] != 0){
|
|
if(transferStatus[0] != 0){
|
|
- return;
|
|
|
|
|
|
+ return "success";
|
|
}
|
|
}
|
|
String transferAmount = responseData.getString("amount");
|
|
String transferAmount = responseData.getString("amount");
|
|
BigDecimal amount = transfer.getAmount();
|
|
BigDecimal amount = transfer.getAmount();
|
|
if(amount.multiply(new BigDecimal("100")).compareTo(new BigDecimal(transferAmount)) != 0){
|
|
if(amount.multiply(new BigDecimal("100")).compareTo(new BigDecimal(transferAmount)) != 0){
|
|
//金额不一致
|
|
//金额不一致
|
|
- return;
|
|
|
|
|
|
+ return statusStr;
|
|
}
|
|
}
|
|
String transferResultStatus = responseData.getString("status");
|
|
String transferResultStatus = responseData.getString("status");
|
|
if("SUCCESS".equals(transferResultStatus)){
|
|
if("SUCCESS".equals(transferResultStatus)){
|
|
@@ -412,7 +415,7 @@ public class AssetServiceImpl extends ServiceImpl<AssetMapper, Asset> implements
|
|
} else if("FAILED".equals(transferResultStatus)){
|
|
} else if("FAILED".equals(transferResultStatus)){
|
|
transferStatus[0] = 2;
|
|
transferStatus[0] = 2;
|
|
} else {
|
|
} else {
|
|
- return;
|
|
|
|
|
|
+ return statusStr;
|
|
}
|
|
}
|
|
String errorMessage = responseData.getString("errorMessage");
|
|
String errorMessage = responseData.getString("errorMessage");
|
|
DatabaseContextHolder.transactional((Executor) () -> {
|
|
DatabaseContextHolder.transactional((Executor) () -> {
|
|
@@ -444,5 +447,6 @@ public class AssetServiceImpl extends ServiceImpl<AssetMapper, Asset> implements
|
|
}
|
|
}
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
+ return "success";
|
|
}
|
|
}
|
|
}
|
|
}
|