...
|
...
|
@@ -14,6 +14,7 @@ import org.slf4j.LoggerFactory; |
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
import java.util.*;
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -51,7 +52,7 @@ public class PanshiServiceImpl implements IOrderPushService { |
|
|
param.put("orTime",DateUtil.date2String(new Date((long)orderInfo.getOrderTime() * 1000), "yyyy-MM-dd HH:mm:ss"));
|
|
|
param.put("code", orderInfo.getTrackingCode());
|
|
|
// param.put("code", "1|2|3|4|5|6"); 测试时code
|
|
|
param.put("orMoney", orderInfo.getOrderAmount());
|
|
|
BigDecimal orMoney = new BigDecimal(0);
|
|
|
if(orderInfo.getPayment().equals("2")){
|
|
|
param.put("psy","b"); //2=银联支付
|
|
|
}else if(orderInfo.getPayment().equals("3")){
|
...
|
...
|
@@ -75,6 +76,7 @@ public class PanshiServiceImpl implements IOrderPushService { |
|
|
param.put("proName", good.getProductName());
|
|
|
param.put("proCat", good.getSortName());
|
|
|
param.put("commRate", COMMRATE);
|
|
|
orMoney = good.getRealPayFee().multiply(new BigDecimal(good.getBuyNumber())).setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
|
} else {
|
|
|
StringBuffer skns = new StringBuffer();
|
|
|
StringBuffer prices = new StringBuffer();
|
...
|
...
|
@@ -84,13 +86,13 @@ public class PanshiServiceImpl implements IOrderPushService { |
|
|
StringBuffer rates = new StringBuffer();
|
|
|
for (int i = 0; i < goods.size(); i++) {
|
|
|
skns.append(goods.get(i).getProductSkn() + "|");
|
|
|
prices.append(goods.get(i).getRealPayFee() + "|");
|
|
|
prices.append(goods.get(i).getRealPayFee().setScale(2, BigDecimal.ROUND_HALF_UP) + "|");
|
|
|
nums.append(goods.get(i).getBuyNumber() + "|");
|
|
|
names.append(goods.get(i).getProductName() + "|");
|
|
|
cats.append(goods.get(i).getSortName() + "|");
|
|
|
rates.append(COMMRATE + "|");
|
|
|
orMoney = orMoney.add(goods.get(i).getRealPayFee().multiply(new BigDecimal(goods.get(i).getBuyNumber()))).setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
|
}
|
|
|
|
|
|
param.put("proNo", skns.substring(0, skns.length() - 1));
|
|
|
param.put("proPrice", prices.substring(0, prices.length() - 1));
|
|
|
param.put("proNum", nums.substring(0, nums.length() - 1));
|
...
|
...
|
@@ -98,6 +100,7 @@ public class PanshiServiceImpl implements IOrderPushService { |
|
|
param.put("proCat", cats.substring(0, cats.length() - 1));
|
|
|
param.put("commRate", rates.substring(0, rates.length() - 1));
|
|
|
}
|
|
|
param.put("orMoney",orMoney.doubleValue());
|
|
|
Pair<Integer, String> pair = null;
|
|
|
try {
|
|
|
pair = HttpUtils.httpPost(URL, param);
|
...
|
...
|
|