|
|
@@ -103,10 +103,13 @@ public class IposFeignController extends BaseFeignController {
|
|
|
@ResponseBody
|
|
|
public VaultsResponse<List<SplitPay>> splitOrder(@RequestBody List<SplitInfo> list) {
|
|
|
|
|
|
- final BigDecimal proportion= new BigDecimal("1");
|
|
|
List<SplitPay> returnList = Lists.newArrayList();
|
|
|
for (SplitInfo splitInfo : list) {
|
|
|
//List<SplitRecords> splitRecordsList = Lists.newArrayList();
|
|
|
+ PaymentRecords pr = paymentRecordsService.getPaymentRecords(splitInfo.getPayId());
|
|
|
+ if(pr == null){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
List<SplitRecordsDetail> details = Lists.newArrayList();
|
|
|
SplitRecords records = new SplitRecords();
|
|
|
records.setOperatorId(splitInfo.getOperatorId());
|
|
|
@@ -118,7 +121,7 @@ public class IposFeignController extends BaseFeignController {
|
|
|
SplitRecordsDetail pt = new SplitRecordsDetail();
|
|
|
pt.setSplitId(records.getSplitId());
|
|
|
pt.setSourceId(0);
|
|
|
-
|
|
|
+ BigDecimal chargeAmount = new BigDecimal(pr.getChargeAmount());
|
|
|
BigDecimal ptAmount = BigDecimal.ZERO;
|
|
|
BigDecimal tzAmount = BigDecimal.ZERO;
|
|
|
BigDecimal ptyysAmount = BigDecimal.ZERO;
|
|
|
@@ -135,10 +138,10 @@ public class IposFeignController extends BaseFeignController {
|
|
|
sp.setOrderId(detail.getOrderId());
|
|
|
sp.setSplitId(records.getSplitId());
|
|
|
//运算价格
|
|
|
- BigDecimal price = new BigDecimal(detail.getPrice()).multiply(proportion);
|
|
|
+ BigDecimal price = new BigDecimal(detail.getPrice()).subtract(chargeAmount);
|
|
|
|
|
|
//平台金额
|
|
|
- BigDecimal ptDecimal = new BigDecimal(split).multiply(new BigDecimal(detail.getPrice()));
|
|
|
+ BigDecimal ptDecimal = new BigDecimal(split).multiply(price);
|
|
|
BigDecimal valDecimal = new BigDecimal("1");
|
|
|
if(ptDecimal.longValue() > 0){
|
|
|
valDecimal = ptDecimal;
|
|
|
@@ -161,8 +164,8 @@ public class IposFeignController extends BaseFeignController {
|
|
|
supplierOne.setSourceId(2);
|
|
|
supplierOne.setMerchantId(s);
|
|
|
for (SplitDetail detail : oneMaps.get(s)) {
|
|
|
- supplierOneAmount = supplierOneAmount.add(new BigDecimal(detail.getConsignmentPrice()).multiply(proportion));
|
|
|
- detail.setPrice(new BigDecimal(detail.getPrice()).subtract(new BigDecimal(detail.getConsignmentPrice()).multiply(proportion)).longValue());
|
|
|
+ supplierOneAmount = supplierOneAmount.add(new BigDecimal(detail.getConsignmentPrice()));
|
|
|
+ detail.setPrice(new BigDecimal(detail.getPrice()).subtract(new BigDecimal(detail.getConsignmentPrice())).longValue());
|
|
|
}
|
|
|
|
|
|
if (supplierOneAmount.compareTo(BigDecimal.ZERO) == 1) {
|
|
|
@@ -180,7 +183,7 @@ public class IposFeignController extends BaseFeignController {
|
|
|
supplierTwo.setSourceId(2);
|
|
|
supplierTwo.setMerchantId(s);
|
|
|
for (SplitDetail detail : twoMaps.get(s)) {
|
|
|
- supplierTwoAmount = supplierTwoAmount.add(new BigDecimal(detail.getConsignmentPrice()).multiply(proportion));
|
|
|
+ supplierTwoAmount = supplierTwoAmount.add(new BigDecimal(detail.getConsignmentPrice()));
|
|
|
detail.setPrice(detail.getPrice() - detail.getConsignmentPrice());
|
|
|
}
|
|
|
|
|
|
@@ -199,8 +202,8 @@ public class IposFeignController extends BaseFeignController {
|
|
|
supplier.setSourceId(2);
|
|
|
supplier.setMerchantId(s);
|
|
|
for (SplitDetail detail : maps.get(s)) {
|
|
|
- supplierAmount = supplierAmount.add(new BigDecimal(detail.getSettlementPrice()).multiply(proportion));
|
|
|
- detail.setPrice(new BigDecimal(detail.getPrice()).subtract(new BigDecimal(detail.getSettlementPrice()).multiply(proportion)).longValue());
|
|
|
+ supplierAmount = supplierAmount.add(new BigDecimal(detail.getSettlementPrice()));
|
|
|
+ detail.setPrice(new BigDecimal(detail.getPrice()).subtract(new BigDecimal(detail.getSettlementPrice())).longValue());
|
|
|
// detail.setPrice(detail.getPrice() - detail.getSettlementPrice());
|
|
|
}
|
|
|
|