|
@@ -16,6 +16,7 @@
|
|
|
*/
|
|
|
package org.springblade.modules.api.controller;
|
|
|
|
|
|
+import cn.hutool.core.util.ObjectUtil;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.alipay.api.AlipayApiException;
|
|
|
import com.alipay.api.AlipayClient;
|
|
@@ -230,15 +231,17 @@ public class Api05Controller extends BladeController {
|
|
|
* @return R
|
|
|
*/
|
|
|
public R orderConsign(String outTradeNo, String orderNo) {
|
|
|
+ //查询抢购订单数据
|
|
|
Order order = orderService.getOne(Wrappers.<Order>lambdaQuery().eq(Order::getOutTradeNo, outTradeNo));
|
|
|
- if (order == null){
|
|
|
+ if (ObjectUtil.isNull(order)){
|
|
|
return R.fail("请求参数错误!");
|
|
|
}
|
|
|
+ //通过授权号查询用户授权信息
|
|
|
OrderGrant orderGrant = orderGrantService.getOne(Wrappers.<OrderGrant>lambdaQuery().eq(OrderGrant::getOrderNo, orderNo));
|
|
|
- if (orderGrant == null) {
|
|
|
+ if (ObjectUtil.isNull(orderGrant)) {
|
|
|
return R.fail("请求参数错误!");
|
|
|
}
|
|
|
- //获取数量
|
|
|
+ //获取剩余预售授权数量
|
|
|
Integer nowNum = orderGrant.getNowNum();
|
|
|
UserApp userApp = new UserApp();
|
|
|
UserApp query = userApp.selectOne(Wrappers.<UserApp>lambdaQuery().eq(UserApp::getUserId, orderGrant.getUserId()));
|
|
@@ -249,9 +252,11 @@ public class Api05Controller extends BladeController {
|
|
|
data.put("product_code", "PRE_AUTH_ONLINE");
|
|
|
data.put("auth_no", orderGrant.getAuthNo());
|
|
|
data.put("body", orderGrant.getAuthNo());
|
|
|
- if (nowNum == 1){
|
|
|
+ if (nowNum == 1){//判断剩余授权数量是否为1
|
|
|
+ //授权数量为1是进行解冻
|
|
|
data.put("auth_confirm_mode", "COMPLETE"); //解冻
|
|
|
}else{
|
|
|
+ //授权数量不为1时,交易继续,只进行收单操作
|
|
|
data.put("auth_confirm_mode", "NOT_COMPLETE");//不解冻
|
|
|
}
|
|
|
data.put("seller_id", properties.getPayeeUserId()); //收款方
|