Bladeren bron

恢复平台打款

简德馨 2 jaren geleden
bovenliggende
commit
68c2a4a465

+ 9 - 0
src/main/java/org/springblade/modules/api/controller/AliPay01Controller.java

@@ -698,6 +698,15 @@ public class AliPay01Controller extends BladeController {
 			log.info(errMsg + "-body:" + body);
 			//寄售来源为后台 不打款 订单的打款 2是订单
 			if (consign.getConsignFor() == 2){
+				//判断商品抢购价和进货价是否产生收益
+				if(consign.getObtainPrice() < consign.getConsignPrice()){
+					//收益金额 收益金额等于抢购价减去取得价
+					BigDecimal bigDecimal = new BigDecimal(price).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);
+					//收款金额需扣除税费
+					price = new BigDecimal(consign.getConsignPrice()).subtract(bigDecimal1).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
+				}
 				//获取寄售人信息
 				UserApp userApp = new UserApp();
 				UserApp query = userApp.selectOne(Wrappers.<UserApp>lambdaQuery().eq(UserApp::getUserId,consign.getConsignUserId()));

+ 1 - 11
src/main/java/org/springblade/modules/api/controller/Api05Controller.java

@@ -170,17 +170,7 @@ public class Api05Controller extends BladeController {
 				Consign consign = consignService.getById(orderConsign.getConsignId());
 				//收款金额 默认等于抢购金额
 				BigDecimal collectionPrice = new BigDecimal(consign.getConsignPrice());
-				//判断商品抢购价和进货价是否产生收益
-				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(), orderConsign.getConsignPrice());
-				}
+
 				//使用收款账户进行打款
 				boolean flg = orderConsign(outTradeNo, request.getOrderNo(), collectionPrice.doubleValue());
 				if (flg){//是否发起统一收单