|
@@ -165,15 +165,7 @@ public class Api05Controller extends BladeController {
|
|
|
response.setOutTradeNo(outTradeNo);
|
|
|
//获取当前订单信息
|
|
|
OrderConsign orderConsign = orderConsignService.getOne(Wrappers.lambdaQuery(OrderConsign.class).eq(OrderConsign::getOutTradeNo,outTradeNo));
|
|
|
- String collectionAccount = properties.getPayeeUserId();//默认为系统收单庄户
|
|
|
- if (0 != orderConsign.getConsignUserId()){//如果为用户单则修改收款账户单为用户支付宝账户
|
|
|
- //等于用户单时进行用户打款操作
|
|
|
- //获取寄售用户支付至账号进行打款
|
|
|
- LambdaQueryWrapper<UserApp> wrapper = Wrappers.lambdaQuery(UserApp.class);
|
|
|
- wrapper.eq(UserApp::getUserId,orderConsign.getConsignUserId());
|
|
|
- UserApp collectionUser = userAppMapper.selectOne(wrapper);
|
|
|
- collectionAccount = collectionUser.getAlipayUserId();
|
|
|
- }
|
|
|
+
|
|
|
//查询寄售商品
|
|
|
Consign consign = consignService.getById(orderConsign.getConsignId());
|
|
|
//收款金额 默认等于抢购金额
|
|
@@ -182,16 +174,15 @@ public class Api05Controller extends BladeController {
|
|
|
if(consign.getObtainPrice() < consign.getConsignPrice()){
|
|
|
//收益金额
|
|
|
BigDecimal bigDecimal = new BigDecimal(consign.getConsignPrice()).subtract(new BigDecimal(consign.getObtainPrice())).setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
|
- //税费金额
|
|
|
+ //税费金额 todo 0.03修改为配置
|
|
|
BigDecimal bigDecimal1 = bigDecimal.multiply(new BigDecimal(0.03)).setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
|
//收款金额需扣除税费
|
|
|
collectionPrice = new BigDecimal(consign.getConsignPrice()).subtract(bigDecimal1).setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
|
//将税费扣除到平台账户
|
|
|
- orderConsign(outTradeNo, request.getOrderNo(), properties.getPayeeUserId(), orderConsign.getConsignPrice());
|
|
|
+ orderConsign(outTradeNo, request.getOrderNo(), orderConsign.getConsignPrice());
|
|
|
}
|
|
|
-
|
|
|
//使用收款账户进行打款
|
|
|
- boolean flg = orderConsign(outTradeNo, request.getOrderNo(), collectionAccount, collectionPrice.doubleValue());
|
|
|
+ boolean flg = orderConsign(outTradeNo, request.getOrderNo(), collectionPrice.doubleValue());
|
|
|
if (flg){//是否发起统一收单
|
|
|
//修改授权状态
|
|
|
flg = orderGrantService.thaw(orderGrant);//flg = true
|
|
@@ -372,11 +363,10 @@ public class Api05Controller extends BladeController {
|
|
|
* 预支付统一收单
|
|
|
* @param outTradeNo 订单号
|
|
|
* @param orderNo 授权
|
|
|
- * @param collectionAccount 收款账户
|
|
|
* @param price 打款金额
|
|
|
* @return R
|
|
|
*/
|
|
|
- public boolean orderConsign(String outTradeNo, String orderNo, String collectionAccount, Double price) {
|
|
|
+ public boolean orderConsign(String outTradeNo, String orderNo, Double price) {
|
|
|
//查询抢购订单数据
|
|
|
Order order = orderService.getOne(Wrappers.<Order>lambdaQuery().eq(Order::getOutTradeNo, outTradeNo));
|
|
|
|
|
@@ -406,7 +396,7 @@ public class Api05Controller extends BladeController {
|
|
|
//授权数量不为1时,交易继续,只进行收单操作
|
|
|
data.put("auth_confirm_mode", "NOT_COMPLETE");//不解冻
|
|
|
}
|
|
|
- data.put("seller_id", collectionAccount); //收款方
|
|
|
+ data.put("seller_id", properties.getPayeeUserId()); //收款方
|
|
|
// data.put("seller_id", properties.getPayeeUserId()); //收款方
|
|
|
data.put("buyer_id", query.getAlipayUserId()); //买家ID //2088012801069195
|
|
|
//APP支付
|