|
@@ -7,15 +7,12 @@ import com.travel.model.BuyOfferNum;
|
|
|
import com.travel.model.Supplier;
|
|
|
import com.travel.model.SupplierRelease;
|
|
|
import com.travel.model.ZFBPay;
|
|
|
+import com.travel.service.IndexService;
|
|
|
import com.travel.service.ZFBPayService;
|
|
|
import com.travel.util.ParsingToken;
|
|
|
import com.travel.util.SnowflakeUtil;
|
|
|
import com.travel.zfb.ZfbPayUtils;
|
|
|
-import lombok.var;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.core.io.ClassPathResource;
|
|
|
-import org.springframework.util.ClassUtils;
|
|
|
-import org.springframework.util.FileCopyUtils;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
@@ -24,10 +21,7 @@ import com.alipay.api.DefaultAlipayClient;
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
import java.io.IOException;
|
|
|
-import java.io.InputStream;
|
|
|
import java.io.PrintWriter;
|
|
|
-import java.io.UnsupportedEncodingException;
|
|
|
-import java.nio.charset.StandardCharsets;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.util.*;
|
|
|
|
|
@@ -40,6 +34,9 @@ public class ZfbPayController extends ZfbPayUtils {
|
|
|
|
|
|
@Autowired
|
|
|
private ZFBPayService zfbPayService;
|
|
|
+ //系统配置
|
|
|
+ @Autowired
|
|
|
+ private IndexService indexService;
|
|
|
|
|
|
//雪花算法
|
|
|
private SnowflakeUtil snowflakeUtil = new SnowflakeUtil(1, 1, 1);
|
|
@@ -284,10 +281,15 @@ public class ZfbPayController extends ZfbPayUtils {
|
|
|
//修改状态为已付费
|
|
|
supplierRelease2.setOrderType("2");
|
|
|
zfbPayService.updatePrivateType(supplierRelease2);
|
|
|
+ Map<String, Object> mapCommis = indexService.getSitesInfo();//查询系统配置
|
|
|
+ //手续费
|
|
|
+ Double poundage = Double.parseDouble(wxPay.getTotalFee()) * Double.parseDouble((String) mapCommis.get("percentageFee"));
|
|
|
+ //实际金额 - 手续费 = 供应商收入
|
|
|
+ poundage = Double.parseDouble(wxPay.getTotalFee()) - poundage;
|
|
|
//用户购买报价单后将50%的资金转入供应商余额
|
|
|
Supplier supplier = new Supplier()
|
|
|
.setCode(list.get(0).getCode())
|
|
|
- .setBalanceOf(String.valueOf(Double.parseDouble(wxPay.getTotalFee()) * 0.5));
|
|
|
+ .setBalanceOf(String.valueOf(poundage));
|
|
|
zfbPayService.addSupplierBalanceOf(supplier);
|
|
|
} else {
|
|
|
supplierRelease2.setOrderType("9");
|