|
@@ -5,7 +5,6 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.fasterxml.jackson.databind.node.JsonNodeFactory;
|
|
|
import com.fasterxml.jackson.databind.node.ObjectNode;
|
|
|
-import com.huifu.bspay.sdk.opps.core.utils.RsaUtils;
|
|
|
import com.szwl.constant.HuifuConstant;
|
|
|
import com.szwl.constant.JoinpayConstant;
|
|
|
import com.szwl.model.entity.WithdrawalRecord;
|
|
@@ -14,11 +13,11 @@ import com.szwl.service.WithdrawalRecordService;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.web.bind.annotation.GetMapping;
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
+import java.util.Date;
|
|
|
+import java.util.Map;
|
|
|
|
|
|
/**
|
|
|
* <p>
|
|
@@ -37,25 +36,25 @@ public class CallbackController {
|
|
|
private WithdrawalRecordService withdrawalRecordService;
|
|
|
|
|
|
@ApiOperation("汇聚提现回调")
|
|
|
- @GetMapping("/withdrawJoinPay")
|
|
|
- public Object withdrawJoinPay(HttpServletRequest request) {
|
|
|
-
|
|
|
- String resp_code = request.getParameter("resp_code");
|
|
|
- String da = request.getParameter("data");
|
|
|
- JSONObject data =JSONObject.parseObject(da);
|
|
|
+ @PostMapping("/withdrawJoinPay")
|
|
|
+ public Object withdrawJoinPay(@RequestBody Map<String, Object> rawData) {
|
|
|
+ log.info("汇聚提现回调,参数,rawData={}", rawData);
|
|
|
+ String respCode = (String) rawData.get("resp_code");
|
|
|
+ Map<String, Object> data = (Map<String, Object>) rawData.get("data");
|
|
|
|
|
|
// 交易状态
|
|
|
- String orderStatus = data.getString("order_status");
|
|
|
+ String orderStatus = (String)data.get("order_status");
|
|
|
// 分账方编号
|
|
|
- String mchOrderNo = data.getString("mch_order_no");
|
|
|
+ String mchOrderNo = (String)data.get("mch_order_no");
|
|
|
LambdaQueryWrapper<WithdrawalRecord> query = Wrappers.lambdaQuery();
|
|
|
query.eq(WithdrawalRecord::getOrderNo, mchOrderNo);
|
|
|
WithdrawalRecord withdrawalRecord = withdrawalRecordService.getOne(query);
|
|
|
withdrawalRecord.setStatus(2);
|
|
|
- if (JoinpayConstant.order_status1.equals(orderStatus)) {
|
|
|
+ if (JoinpayConstant.order_status2.equals(orderStatus)) {
|
|
|
+ withdrawalRecord.setArrivalDate(new Date());
|
|
|
withdrawalRecord.setStatus(1);
|
|
|
}
|
|
|
- String bizMsg = data.getString("biz_msg");
|
|
|
+ String bizMsg = (String)data.get("biz_msg");
|
|
|
withdrawalRecord.setResultMsg(bizMsg);
|
|
|
withdrawalRecordService.updateById(withdrawalRecord);
|
|
|
|
|
@@ -91,7 +90,6 @@ public class CallbackController {
|
|
|
withdrawalRecord.setStatus(2);
|
|
|
if (HuifuConstant.RESP_CODE.equals(subRespCode)) {
|
|
|
// 业务处理成功
|
|
|
- log.info("处理成功");
|
|
|
if (HuifuConstant.TRANS_STAT_S.equals(transStat)) {
|
|
|
withdrawalRecord.setStatus(1);
|
|
|
} else {
|
|
@@ -99,7 +97,6 @@ public class CallbackController {
|
|
|
}
|
|
|
} else {
|
|
|
// 业务处理失败
|
|
|
- log.info("处理失败");
|
|
|
withdrawalRecord.setResultMsg(respDesc);
|
|
|
}
|
|
|
withdrawalRecordService.updateById(withdrawalRecord);
|