|
@@ -17,7 +17,6 @@
|
|
package org.springblade.modules.api.controller;
|
|
package org.springblade.modules.api.controller;
|
|
|
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
import cn.hutool.core.collection.CollUtil;
|
|
-import cn.hutool.core.util.NumberUtil;
|
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alipay.api.AlipayApiException;
|
|
import com.alipay.api.AlipayApiException;
|
|
@@ -36,17 +35,17 @@ import org.slf4j.Logger;
|
|
import org.slf4j.LoggerFactory;
|
|
import org.slf4j.LoggerFactory;
|
|
import org.springblade.common.constant.CommonConstant;
|
|
import org.springblade.common.constant.CommonConstant;
|
|
import org.springblade.core.boot.ctrl.BladeController;
|
|
import org.springblade.core.boot.ctrl.BladeController;
|
|
|
|
+import org.springblade.core.log.annotation.ApiLog;
|
|
import org.springblade.core.log.exception.ServiceException;
|
|
import org.springblade.core.log.exception.ServiceException;
|
|
import org.springblade.core.mp.support.Condition;
|
|
import org.springblade.core.mp.support.Condition;
|
|
import org.springblade.core.mp.support.Query;
|
|
import org.springblade.core.mp.support.Query;
|
|
import org.springblade.core.tool.api.R;
|
|
import org.springblade.core.tool.api.R;
|
|
import org.springblade.core.tool.utils.StringUtil;
|
|
import org.springblade.core.tool.utils.StringUtil;
|
|
import org.springblade.core.tool.utils.WebUtil;
|
|
import org.springblade.core.tool.utils.WebUtil;
|
|
-import org.springblade.modules.api.request.ConsignPayRequest;
|
|
|
|
-import org.springblade.modules.api.request.OrderCommonSaveRequest;
|
|
|
|
-import org.springblade.modules.api.request.OrderConsignRandomRequest;
|
|
|
|
-import org.springblade.modules.api.request.OrderTakeRequest;
|
|
|
|
|
|
+import org.springblade.modules.api.request.*;
|
|
import org.springblade.modules.api.response.ConsignResponse;
|
|
import org.springblade.modules.api.response.ConsignResponse;
|
|
|
|
+import org.springblade.modules.api.service.AliFaceService;
|
|
|
|
+import org.springblade.modules.api.service.IAliService;
|
|
import org.springblade.modules.api.service.ITradeService;
|
|
import org.springblade.modules.api.service.ITradeService;
|
|
import org.springblade.modules.auth.utils.TokenUtil;
|
|
import org.springblade.modules.auth.utils.TokenUtil;
|
|
import org.springblade.modules.finance.entity.Order;
|
|
import org.springblade.modules.finance.entity.Order;
|
|
@@ -76,7 +75,10 @@ import org.springframework.web.bind.annotation.*;
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
import javax.validation.Valid;
|
|
import javax.validation.Valid;
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
-import java.util.*;
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
|
+import java.util.Comparator;
|
|
|
|
+import java.util.List;
|
|
|
|
+import java.util.Map;
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -110,6 +112,14 @@ public class Api05Controller extends BladeController {
|
|
@Resource
|
|
@Resource
|
|
private IUserService userService;
|
|
private IUserService userService;
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private AliFaceService aliFaceService;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ @Autowired
|
|
|
|
+ private IAliService aliService;
|
|
|
|
+
|
|
|
|
+
|
|
//抢购
|
|
//抢购
|
|
private static final String TRADE_URL = "/api/v1/aliPay/sdk/trade_notify_url";
|
|
private static final String TRADE_URL = "/api/v1/aliPay/sdk/trade_notify_url";
|
|
@Autowired
|
|
@Autowired
|
|
@@ -124,13 +134,13 @@ public class Api05Controller extends BladeController {
|
|
public R orderCommonSave(@Valid @RequestBody OrderCommonSaveRequest request) {
|
|
public R orderCommonSave(@Valid @RequestBody OrderCommonSaveRequest request) {
|
|
//租户号
|
|
//租户号
|
|
String tenantId = WebUtil.getRequest().getHeader(TokenUtil.TENANT_HEADER_KEY);
|
|
String tenantId = WebUtil.getRequest().getHeader(TokenUtil.TENANT_HEADER_KEY);
|
|
- if(StringUtil.isEmpty(request.getDistributeMode())){
|
|
|
|
|
|
+ if (StringUtil.isEmpty(request.getDistributeMode())) {
|
|
request.setDistributeMode(2); //物流配送
|
|
request.setDistributeMode(2); //物流配送
|
|
}
|
|
}
|
|
- if(StringUtil.isEmpty(request.getUserId())){
|
|
|
|
|
|
+ if (StringUtil.isEmpty(request.getUserId())) {
|
|
return R.fail("请求参数错误!");
|
|
return R.fail("请求参数错误!");
|
|
}
|
|
}
|
|
- if(request.getGoodsList() == null || request.getGoodsList().size() == 0){
|
|
|
|
|
|
+ if (request.getGoodsList() == null || request.getGoodsList().size() == 0) {
|
|
return R.fail("请选择购买的商品!");
|
|
return R.fail("请选择购买的商品!");
|
|
}
|
|
}
|
|
return R.data(orderService.commonOrderInsert(request, tenantId));
|
|
return R.data(orderService.commonOrderInsert(request, tenantId));
|
|
@@ -143,28 +153,28 @@ public class Api05Controller extends BladeController {
|
|
public R consignRandom(@RequestBody OrderConsignRandomRequest request) {
|
|
public R consignRandom(@RequestBody OrderConsignRandomRequest request) {
|
|
String tenantId = WebUtil.getRequest().getHeader(TokenUtil.TENANT_HEADER_KEY);
|
|
String tenantId = WebUtil.getRequest().getHeader(TokenUtil.TENANT_HEADER_KEY);
|
|
UserApp userApp = new UserApp();
|
|
UserApp userApp = new UserApp();
|
|
- UserApp query = userApp.selectOne(Wrappers.<UserApp>lambdaQuery().eq(UserApp::getUserId,request.getUserId()));
|
|
|
|
- if (query == null){
|
|
|
|
|
|
+ UserApp query = userApp.selectOne(Wrappers.<UserApp>lambdaQuery().eq(UserApp::getUserId, request.getUserId()));
|
|
|
|
+ if (query == null) {
|
|
return R.fail("该用户不存在");
|
|
return R.fail("该用户不存在");
|
|
}
|
|
}
|
|
- if (query.getState() != 1){
|
|
|
|
|
|
+ if (query.getState() != 1) {
|
|
return R.fail("登录账号已冻结");
|
|
return R.fail("登录账号已冻结");
|
|
}
|
|
}
|
|
- if (query.getCreditScore() < 100){
|
|
|
|
|
|
+ if (query.getCreditScore() < 100) {
|
|
return R.fail("您的信誉分不够");
|
|
return R.fail("您的信誉分不够");
|
|
}
|
|
}
|
|
if (StringUtil.isEmpty(query.getAlipayUserId())) {
|
|
if (StringUtil.isEmpty(query.getAlipayUserId())) {
|
|
return R.fail("请绑定支付宝打款账号");
|
|
return R.fail("请绑定支付宝打款账号");
|
|
}
|
|
}
|
|
- if (query.getTicket() < 100){
|
|
|
|
|
|
+ if (query.getTicket() < 100) {
|
|
throw new ServiceException("您的绿色积分达不到要求!");
|
|
throw new ServiceException("您的绿色积分达不到要求!");
|
|
}
|
|
}
|
|
//判断用户授权
|
|
//判断用户授权
|
|
ConsignResponse response = orderService.consignGrant(query, request.getConsignConfigId(), request.getOrderNo());
|
|
ConsignResponse response = orderService.consignGrant(query, request.getConsignConfigId(), request.getOrderNo());
|
|
- if (response.getStatus() == 2){
|
|
|
|
|
|
+ if (response.getStatus() == 2) {
|
|
//已授权则生成订单
|
|
//已授权则生成订单
|
|
String outTradeNo = orderService.consignOrderInsert(request, query, tenantId);
|
|
String outTradeNo = orderService.consignOrderInsert(request, query, tenantId);
|
|
- if (!StringUtil.isEmpty(outTradeNo)){
|
|
|
|
|
|
+ if (!StringUtil.isEmpty(outTradeNo)) {
|
|
//通过订单号获取授权信息
|
|
//通过订单号获取授权信息
|
|
OrderGrant orderGrant = orderGrantService.getOne(Wrappers.<OrderGrant>lambdaQuery().eq(OrderGrant::getOrderNo, request.getOrderNo()));
|
|
OrderGrant orderGrant = orderGrantService.getOne(Wrappers.<OrderGrant>lambdaQuery().eq(OrderGrant::getOrderNo, request.getOrderNo()));
|
|
//重新查询返回是否授权
|
|
//重新查询返回是否授权
|
|
@@ -172,7 +182,7 @@ public class Api05Controller extends BladeController {
|
|
//返回订单号
|
|
//返回订单号
|
|
response.setOutTradeNo(outTradeNo);
|
|
response.setOutTradeNo(outTradeNo);
|
|
//获取当前订单信息
|
|
//获取当前订单信息
|
|
- OrderConsign orderConsign = orderConsignService.getOne(Wrappers.lambdaQuery(OrderConsign.class).eq(OrderConsign::getOutTradeNo,outTradeNo));
|
|
|
|
|
|
+ OrderConsign orderConsign = orderConsignService.getOne(Wrappers.lambdaQuery(OrderConsign.class).eq(OrderConsign::getOutTradeNo, outTradeNo));
|
|
|
|
|
|
//查询寄售商品
|
|
//查询寄售商品
|
|
Consign consign = consignService.getById(orderConsign.getConsignId());
|
|
Consign consign = consignService.getById(orderConsign.getConsignId());
|
|
@@ -181,10 +191,10 @@ public class Api05Controller extends BladeController {
|
|
|
|
|
|
//统一收单
|
|
//统一收单
|
|
boolean flg = orderConsign(outTradeNo, request.getOrderNo(), collectionPrice.doubleValue());
|
|
boolean flg = orderConsign(outTradeNo, request.getOrderNo(), collectionPrice.doubleValue());
|
|
- if (flg){//是否发起统一收单
|
|
|
|
|
|
+ if (flg) {//是否发起统一收单
|
|
//修改授权状态
|
|
//修改授权状态
|
|
flg = orderGrantService.thaw(orderGrant);//flg = true
|
|
flg = orderGrantService.thaw(orderGrant);//flg = true
|
|
- if (!flg){
|
|
|
|
|
|
+ if (!flg) {
|
|
log.info("授权授权信息修改失败");
|
|
log.info("授权授权信息修改失败");
|
|
throw new ServiceException("亲!请重新抢单");
|
|
throw new ServiceException("亲!请重新抢单");
|
|
}
|
|
}
|
|
@@ -200,19 +210,19 @@ public class Api05Controller extends BladeController {
|
|
|
|
|
|
@PostMapping("checkConsignPay")
|
|
@PostMapping("checkConsignPay")
|
|
@ApiOperation(value = "确认付款id")
|
|
@ApiOperation(value = "确认付款id")
|
|
- public R checkConsignPay(@RequestBody ConsignPayRequest payRequest){
|
|
|
|
- if(ObjectUtil.isNull(payRequest)){
|
|
|
|
|
|
+ public R checkConsignPay(@RequestBody ConsignPayRequest payRequest) {
|
|
|
|
+ if (ObjectUtil.isNull(payRequest)) {
|
|
return R.fail("参数传递为null");
|
|
return R.fail("参数传递为null");
|
|
}
|
|
}
|
|
- if(payRequest.getConsignId().size() < 1){
|
|
|
|
|
|
+ if (payRequest.getConsignId().size() < 1) {
|
|
return R.fail("请选择打款订单");
|
|
return R.fail("请选择打款订单");
|
|
}
|
|
}
|
|
- if(0 == payRequest.getPayType()){//等于0时进行打款操作
|
|
|
|
|
|
+ if (0 == payRequest.getPayType()) {//等于0时进行打款操作
|
|
List<Consign> consigns = consignService.listByIds(payRequest.getConsignId());
|
|
List<Consign> consigns = consignService.listByIds(payRequest.getConsignId());
|
|
for (Consign consign : consigns) {
|
|
for (Consign consign : consigns) {
|
|
- if(consign.getConsignState() == 2 && consign.getConsignFor() == 2){
|
|
|
|
- UserApp userApp = userAppMapper.selectOne(Wrappers.lambdaQuery(UserApp.class).eq(UserApp::getUserId,consign.getConsignUserId()));
|
|
|
|
- iTradeService.transfer(userApp, consign.getConsignPrice().toString(), consign.getConsignConfigId(),consign);
|
|
|
|
|
|
+ if (consign.getConsignState() == 2 && consign.getConsignFor() == 2) {
|
|
|
|
+ UserApp userApp = userAppMapper.selectOne(Wrappers.lambdaQuery(UserApp.class).eq(UserApp::getUserId, consign.getConsignUserId()));
|
|
|
|
+ iTradeService.transfer(userApp, consign.getConsignPrice().toString(), consign.getConsignConfigId(), consign);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return R.success("确认付款成功");
|
|
return R.success("确认付款成功");
|
|
@@ -222,14 +232,13 @@ public class Api05Controller extends BladeController {
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
- *
|
|
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
@PostMapping("getConsignListByConfigId")
|
|
@PostMapping("getConsignListByConfigId")
|
|
@ApiOperation(value = "查询场次付款记录")
|
|
@ApiOperation(value = "查询场次付款记录")
|
|
- public R<List<Consign>> getConsignListByConfigId(@ApiParam(value = "批次ID", required = true) @RequestParam Long consignConfigId){
|
|
|
|
|
|
+ public R<List<Consign>> getConsignListByConfigId(@ApiParam(value = "批次ID", required = true) @RequestParam Long consignConfigId) {
|
|
LambdaQueryWrapper<Consign> query = Wrappers.lambdaQuery(Consign.class);
|
|
LambdaQueryWrapper<Consign> query = Wrappers.lambdaQuery(Consign.class);
|
|
- query.eq(Consign::getConsignConfigId,consignConfigId);
|
|
|
|
|
|
+ query.eq(Consign::getConsignConfigId, consignConfigId);
|
|
query.eq(Consign::getConsignState, 2);
|
|
query.eq(Consign::getConsignState, 2);
|
|
query.eq(Consign::getNowStock, 0);
|
|
query.eq(Consign::getNowStock, 0);
|
|
query.eq(Consign::getConsignFor, 2);
|
|
query.eq(Consign::getConsignFor, 2);
|
|
@@ -237,7 +246,7 @@ public class Api05Controller extends BladeController {
|
|
List<Consign> list = consignService.list(query);
|
|
List<Consign> list = consignService.list(query);
|
|
//获取用户id
|
|
//获取用户id
|
|
List<Long> collect = list.stream().map(Consign::getConsignUserId).collect(Collectors.toList());
|
|
List<Long> collect = list.stream().map(Consign::getConsignUserId).collect(Collectors.toList());
|
|
- if(ObjectUtil.isEmpty(list)){
|
|
|
|
|
|
+ if (ObjectUtil.isEmpty(list)) {
|
|
return R.data(list);
|
|
return R.data(list);
|
|
}
|
|
}
|
|
List<User> users = userService.listByIds(collect);
|
|
List<User> users = userService.listByIds(collect);
|
|
@@ -253,12 +262,11 @@ public class Api05Controller extends BladeController {
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
- *
|
|
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
@PostMapping("getConsignALLList")
|
|
@PostMapping("getConsignALLList")
|
|
@ApiOperation(value = "查询付款授权场次")
|
|
@ApiOperation(value = "查询付款授权场次")
|
|
- public R<List<ConsignListVO>> getConsignALLList(){
|
|
|
|
|
|
+ public R<List<ConsignListVO>> getConsignALLList() {
|
|
//查询已授权表记录
|
|
//查询已授权表记录
|
|
LambdaQueryWrapper<PlatformAuthorization> query = Wrappers.lambdaQuery(PlatformAuthorization.class);
|
|
LambdaQueryWrapper<PlatformAuthorization> query = Wrappers.lambdaQuery(PlatformAuthorization.class);
|
|
query.eq(PlatformAuthorization::getState, 1);
|
|
query.eq(PlatformAuthorization::getState, 1);
|
|
@@ -272,7 +280,7 @@ public class Api05Controller extends BladeController {
|
|
for (Map.Entry<Long, List<Consign>> entry : collect1.entrySet()) {
|
|
for (Map.Entry<Long, List<Consign>> entry : collect1.entrySet()) {
|
|
consignListVO = new ConsignListVO();
|
|
consignListVO = new ConsignListVO();
|
|
Integer num = entry.getValue().size();
|
|
Integer num = entry.getValue().size();
|
|
- if(num > 0){
|
|
|
|
|
|
+ if (num > 0) {
|
|
consignListVO.setConsignConfigId(entry.getKey());
|
|
consignListVO.setConsignConfigId(entry.getKey());
|
|
consignListVO.setOrderNum(num);
|
|
consignListVO.setOrderNum(num);
|
|
consignListVO.setOrderPrice(new BigDecimal(entry.getValue().get(0).getConsignPrice()).setScale(2, BigDecimal.ROUND_DOWN));
|
|
consignListVO.setOrderPrice(new BigDecimal(entry.getValue().get(0).getConsignPrice()).setScale(2, BigDecimal.ROUND_DOWN));
|
|
@@ -286,12 +294,11 @@ public class Api05Controller extends BladeController {
|
|
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
- *
|
|
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
@PostMapping("getConsignList")
|
|
@PostMapping("getConsignList")
|
|
@ApiOperation(value = "查询付款授权场次")
|
|
@ApiOperation(value = "查询付款授权场次")
|
|
- public R<List<ConsignListVO>> getConsignList(){
|
|
|
|
|
|
+ public R<List<ConsignListVO>> getConsignList() {
|
|
//查询已授权表记录
|
|
//查询已授权表记录
|
|
LambdaQueryWrapper<PlatformAuthorization> query = Wrappers.lambdaQuery(PlatformAuthorization.class);
|
|
LambdaQueryWrapper<PlatformAuthorization> query = Wrappers.lambdaQuery(PlatformAuthorization.class);
|
|
query.eq(PlatformAuthorization::getState, 1);
|
|
query.eq(PlatformAuthorization::getState, 1);
|
|
@@ -308,17 +315,17 @@ public class Api05Controller extends BladeController {
|
|
List<PlatformAuthorization> platformAuthorizations1 = collect.get(entry.getKey());
|
|
List<PlatformAuthorization> platformAuthorizations1 = collect.get(entry.getKey());
|
|
consignListVO = new ConsignListVO();
|
|
consignListVO = new ConsignListVO();
|
|
Integer num = entry.getValue().size();
|
|
Integer num = entry.getValue().size();
|
|
- if(ObjectUtil.isNotNull(platformAuthorizations1)){
|
|
|
|
|
|
+ if (ObjectUtil.isNotNull(platformAuthorizations1)) {
|
|
for (PlatformAuthorization platformAuthorization : platformAuthorizations1) {
|
|
for (PlatformAuthorization platformAuthorization : platformAuthorizations1) {
|
|
//判断授权数量是否大于待付款数量
|
|
//判断授权数量是否大于待付款数量
|
|
- if(num > platformAuthorization.getTotalNum()){
|
|
|
|
|
|
+ if (num > platformAuthorization.getTotalNum()) {
|
|
num = num - platformAuthorization.getTotalNum();
|
|
num = num - platformAuthorization.getTotalNum();
|
|
- }else{
|
|
|
|
|
|
+ } else {
|
|
num = 0;
|
|
num = 0;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- if(num > 0){
|
|
|
|
|
|
+ if (num > 0) {
|
|
consignListVO.setConsignConfigId(entry.getKey());
|
|
consignListVO.setConsignConfigId(entry.getKey());
|
|
consignListVO.setOrderNum(num);
|
|
consignListVO.setOrderNum(num);
|
|
consignListVO.setOrderPrice(new BigDecimal(entry.getValue().get(0).getConsignPrice()).setScale(2, BigDecimal.ROUND_DOWN));
|
|
consignListVO.setOrderPrice(new BigDecimal(entry.getValue().get(0).getConsignPrice()).setScale(2, BigDecimal.ROUND_DOWN));
|
|
@@ -337,8 +344,8 @@ public class Api05Controller extends BladeController {
|
|
Order order = new Order();
|
|
Order order = new Order();
|
|
order.setUserId(userId);
|
|
order.setUserId(userId);
|
|
order.setOrderType(1);//普通订单
|
|
order.setOrderType(1);//普通订单
|
|
- if(!StringUtil.isEmpty(payFlag)){
|
|
|
|
- if(payFlag != 0){
|
|
|
|
|
|
+ if (!StringUtil.isEmpty(payFlag)) {
|
|
|
|
+ if (payFlag != 0) {
|
|
order.setPayFlag(payFlag); //订单状态
|
|
order.setPayFlag(payFlag); //订单状态
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -355,11 +362,11 @@ public class Api05Controller extends BladeController {
|
|
Query query) {
|
|
Query query) {
|
|
Consign consign = new Consign();
|
|
Consign consign = new Consign();
|
|
consign.setConsignUserId(userId);
|
|
consign.setConsignUserId(userId);
|
|
- if(status == 1){
|
|
|
|
|
|
+ if (status == 1) {
|
|
consign.setConsignState(1); //寄售中
|
|
consign.setConsignState(1); //寄售中
|
|
- }else if(status == 2){
|
|
|
|
|
|
+ } else if (status == 2) {
|
|
consign.setConsignState(2); //待收款
|
|
consign.setConsignState(2); //待收款
|
|
- }else if(status == 3){
|
|
|
|
|
|
+ } else if (status == 3) {
|
|
consign.setConsignState(3); //已收款
|
|
consign.setConsignState(3); //已收款
|
|
}//查询全部
|
|
}//查询全部
|
|
IPage<Consign> pages = consignService.page(Condition.getPage(query),
|
|
IPage<Consign> pages = consignService.page(Condition.getPage(query),
|
|
@@ -389,21 +396,60 @@ public class Api05Controller extends BladeController {
|
|
@ApiOperation(value = "确认收货", notes = "待收货变为已完成")
|
|
@ApiOperation(value = "确认收货", notes = "待收货变为已完成")
|
|
public R orderConfirm(@ApiParam(value = "订单ID", required = true) @RequestParam Long orderId,
|
|
public R orderConfirm(@ApiParam(value = "订单ID", required = true) @RequestParam Long orderId,
|
|
@ApiParam(value = "用户id", required = true) @RequestParam(required = false) Long userId) {
|
|
@ApiParam(value = "用户id", required = true) @RequestParam(required = false) Long userId) {
|
|
- return R.status(orderService.orderEnd(orderId,userId));
|
|
|
|
|
|
+ return R.status(orderService.orderEnd(orderId, userId));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @ApiLog("获取人脸认证Url")
|
|
|
|
+ @PostMapping("/getAuthenticationUrl")
|
|
|
|
+ @ApiOperation(value = "设置用户信息", notes = "设置用户信息")
|
|
|
|
+ @ApiOperationSupport(order = 97)
|
|
|
|
+ public R getAuthenticationUrl(@Valid @RequestBody AliUserAuthRequst requst) {
|
|
|
|
+ String url = aliFaceService.startCertify(requst.getRealName(), requst.getIdNum());
|
|
|
|
+ return R.data(url);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @ApiLog("获取人脸认证结果")
|
|
|
|
+ @GetMapping("/getAuthenticationResult")
|
|
|
|
+ @ApiOperation(value = "获取人脸认证结果")
|
|
|
|
+ @ApiOperationSupport(order = 97)
|
|
|
|
+ public R getAuthenticationResult() {
|
|
|
|
+ Boolean b = aliFaceService.queryCertifyResult();
|
|
|
|
+ return R.data(b);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @ApiLog("实名认证信息对比1、录入用户实名信息")
|
|
|
|
+ @PostMapping("/getVerifyid")
|
|
|
|
+ @ApiOperation(value = "实名认证信息")
|
|
|
|
+ @ApiOperationSupport(order = 97)
|
|
|
|
+ public R getVerifyid(@Valid @RequestBody AliUserAuthRequst requst) throws AlipayApiException {
|
|
|
|
+ R r = aliService.getVerifyid(requst.getRealName(), requst.getIdNum(), requst.getMobil());
|
|
|
|
+ return r;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @ApiLog("实名认证信息对比2、实名信息校验")
|
|
|
|
+ @GetMapping("/realNameCheck")
|
|
|
|
+ @ApiOperation(value = "实名认证信息")
|
|
|
|
+ @ApiOperationSupport(order = 97)
|
|
|
|
+ public R realNameCheck(@ApiParam(value = "verifyid", required = true) @RequestParam String verifyid,
|
|
|
|
+ @ApiParam(value = "授权码", required = true) @RequestParam String authCode) throws AlipayApiException {
|
|
|
|
+ R r = aliService.realNameCheck(verifyid, authCode);
|
|
|
|
+ return r;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 预支付统一收单
|
|
* 预支付统一收单
|
|
|
|
+ *
|
|
* @param outTradeNo 订单号
|
|
* @param outTradeNo 订单号
|
|
- * @param orderNo 授权
|
|
|
|
- * @param price 打款金额
|
|
|
|
|
|
+ * @param orderNo 授权
|
|
|
|
+ * @param price 打款金额
|
|
* @return R
|
|
* @return R
|
|
*/
|
|
*/
|
|
public boolean orderConsign(String outTradeNo, String orderNo, Double price) {
|
|
public boolean orderConsign(String outTradeNo, String orderNo, Double price) {
|
|
//查询抢购订单数据
|
|
//查询抢购订单数据
|
|
Order order = orderService.getOne(Wrappers.<Order>lambdaQuery().eq(Order::getOutTradeNo, outTradeNo));
|
|
Order order = orderService.getOne(Wrappers.<Order>lambdaQuery().eq(Order::getOutTradeNo, outTradeNo));
|
|
|
|
|
|
- if (ObjectUtil.isNull(order)){
|
|
|
|
|
|
+ if (ObjectUtil.isNull(order)) {
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
//通过授权号查询用户授权信息
|
|
//通过授权号查询用户授权信息
|
|
@@ -422,10 +468,10 @@ public class Api05Controller extends BladeController {
|
|
data.put("product_code", "PRE_AUTH_ONLINE");
|
|
data.put("product_code", "PRE_AUTH_ONLINE");
|
|
data.put("auth_no", orderGrant.getAuthNo());
|
|
data.put("auth_no", orderGrant.getAuthNo());
|
|
data.put("body", orderGrant.getAuthNo());
|
|
data.put("body", orderGrant.getAuthNo());
|
|
- if (nowNum == 1){//判断剩余授权数量是否为1
|
|
|
|
|
|
+ if (nowNum == 1) {//判断剩余授权数量是否为1
|
|
//授权数量为1是进行解冻
|
|
//授权数量为1是进行解冻
|
|
data.put("auth_confirm_mode", "COMPLETE"); //解冻
|
|
data.put("auth_confirm_mode", "COMPLETE"); //解冻
|
|
- }else{
|
|
|
|
|
|
+ } else {
|
|
//授权数量不为1时,交易继续,只进行收单操作
|
|
//授权数量不为1时,交易继续,只进行收单操作
|
|
data.put("auth_confirm_mode", "NOT_COMPLETE");//不解冻
|
|
data.put("auth_confirm_mode", "NOT_COMPLETE");//不解冻
|
|
}
|
|
}
|
|
@@ -443,18 +489,18 @@ public class Api05Controller extends BladeController {
|
|
update.setId(order.getId());
|
|
update.setId(order.getId());
|
|
update.setGrantNo(orderGrant.getAuthNo());
|
|
update.setGrantNo(orderGrant.getAuthNo());
|
|
boolean flg = orderService.updateById(update);
|
|
boolean flg = orderService.updateById(update);
|
|
- if (!flg){
|
|
|
|
|
|
+ if (!flg) {
|
|
log.info("订单绑定失败 + update.toString()");
|
|
log.info("订单绑定失败 + update.toString()");
|
|
}
|
|
}
|
|
//普通模式 使用 execute
|
|
//普通模式 使用 execute
|
|
//证书使用 使用 certificateExecute
|
|
//证书使用 使用 certificateExecute
|
|
AlipayTradePayResponse response = client.certificateExecute(request);
|
|
AlipayTradePayResponse response = client.certificateExecute(request);
|
|
- if (response.isSuccess()){
|
|
|
|
|
|
+ if (response.isSuccess()) {
|
|
orderService.payConsignSuccess(order);
|
|
orderService.payConsignSuccess(order);
|
|
return true;
|
|
return true;
|
|
- }else{
|
|
|
|
|
|
+ } else {
|
|
orderGrantService.remove(Wrappers.<OrderGrant>lambdaQuery()
|
|
orderGrantService.remove(Wrappers.<OrderGrant>lambdaQuery()
|
|
- .eq(OrderGrant::getId,orderGrant.getId())
|
|
|
|
|
|
+ .eq(OrderGrant::getId, orderGrant.getId())
|
|
.eq(OrderGrant::getStatus, 0));
|
|
.eq(OrderGrant::getStatus, 0));
|
|
log.info("订单绑定失败 + 删除预授权数据");
|
|
log.info("订单绑定失败 + 删除预授权数据");
|
|
}
|
|
}
|
|
@@ -464,4 +510,5 @@ public class Api05Controller extends BladeController {
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
}
|
|
}
|