|
@@ -103,6 +103,7 @@ public class IposFeignController extends BaseFeignController {
|
|
|
@ResponseBody
|
|
@ResponseBody
|
|
|
public VaultsResponse<List<SplitPay>> splitOrder(@RequestBody List<SplitInfo> list) {
|
|
public VaultsResponse<List<SplitPay>> splitOrder(@RequestBody List<SplitInfo> list) {
|
|
|
|
|
|
|
|
|
|
+ final BigDecimal proportion= new BigDecimal("0.2");
|
|
|
List<SplitPay> returnList = Lists.newArrayList();
|
|
List<SplitPay> returnList = Lists.newArrayList();
|
|
|
List<SplitRecords> splitRecordsList = Lists.newArrayList();
|
|
List<SplitRecords> splitRecordsList = Lists.newArrayList();
|
|
|
List<SplitRecordsDetail> details = Lists.newArrayList();
|
|
List<SplitRecordsDetail> details = Lists.newArrayList();
|
|
@@ -134,14 +135,14 @@ public class IposFeignController extends BaseFeignController {
|
|
|
|
|
|
|
|
for (SplitDetail detail : splitInfo.getDetails()) {
|
|
for (SplitDetail detail : splitInfo.getDetails()) {
|
|
|
//运算价格
|
|
//运算价格
|
|
|
- BigDecimal price = new BigDecimal(detail.getPrice());
|
|
|
|
|
|
|
+ BigDecimal price = new BigDecimal(detail.getPrice()).multiply(proportion);
|
|
|
|
|
|
|
|
//平台金额
|
|
//平台金额
|
|
|
BigDecimal ptDecimal = new BigDecimal(split).multiply(new BigDecimal(detail.getPrice()));
|
|
BigDecimal ptDecimal = new BigDecimal(split).multiply(new BigDecimal(detail.getPrice()));
|
|
|
- logger.info("ptDecimal==="+ptDecimal.longValue());
|
|
|
|
|
- logger.info(String.valueOf(ptDecimal.longValue() == 0));
|
|
|
|
|
- logger.info(String.valueOf(ptDecimal.longValue() == 0L));
|
|
|
|
|
- BigDecimal valDecimal = ptDecimal.longValue() == 0 ? new BigDecimal(1) : ptDecimal;
|
|
|
|
|
|
|
+ BigDecimal valDecimal = new BigDecimal(1);
|
|
|
|
|
+ if(ptDecimal.longValue() > 0){
|
|
|
|
|
+ valDecimal = ptDecimal;
|
|
|
|
|
+ }
|
|
|
price = price.subtract(valDecimal);
|
|
price = price.subtract(valDecimal);
|
|
|
ptAmount.add(valDecimal);
|
|
ptAmount.add(valDecimal);
|
|
|
|
|
|
|
@@ -170,7 +171,7 @@ public class IposFeignController extends BaseFeignController {
|
|
|
supplierOne.setSourceId(2);
|
|
supplierOne.setSourceId(2);
|
|
|
supplierOne.setMerchantId(s);
|
|
supplierOne.setMerchantId(s);
|
|
|
for (SplitDetail detail : oneMaps.get(s)) {
|
|
for (SplitDetail detail : oneMaps.get(s)) {
|
|
|
- supplierOneAmount = supplierOneAmount.add(new BigDecimal(detail.getConsignmentPrice()));
|
|
|
|
|
|
|
+ supplierOneAmount = supplierOneAmount.add(new BigDecimal(detail.getConsignmentPrice()).multiply(proportion));
|
|
|
detail.setPrice(detail.getPrice() - detail.getConsignmentPrice());
|
|
detail.setPrice(detail.getPrice() - detail.getConsignmentPrice());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -189,7 +190,7 @@ public class IposFeignController extends BaseFeignController {
|
|
|
supplierTwo.setSourceId(2);
|
|
supplierTwo.setSourceId(2);
|
|
|
supplierTwo.setMerchantId(s);
|
|
supplierTwo.setMerchantId(s);
|
|
|
for (SplitDetail detail : twoMaps.get(s)) {
|
|
for (SplitDetail detail : twoMaps.get(s)) {
|
|
|
- supplierTwoAmount = supplierTwoAmount.add(new BigDecimal(detail.getConsignmentPrice()));
|
|
|
|
|
|
|
+ supplierTwoAmount = supplierTwoAmount.add(new BigDecimal(detail.getConsignmentPrice()).multiply(proportion));
|
|
|
detail.setPrice(detail.getPrice() - detail.getConsignmentPrice());
|
|
detail.setPrice(detail.getPrice() - detail.getConsignmentPrice());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -208,7 +209,7 @@ public class IposFeignController extends BaseFeignController {
|
|
|
supplier.setSourceId(2);
|
|
supplier.setSourceId(2);
|
|
|
supplier.setMerchantId(s);
|
|
supplier.setMerchantId(s);
|
|
|
for (SplitDetail detail : maps.get(s)) {
|
|
for (SplitDetail detail : maps.get(s)) {
|
|
|
- supplierAmount = supplierAmount.add(new BigDecimal(detail.getSettlementPrice()));
|
|
|
|
|
|
|
+ supplierAmount = supplierAmount.add(new BigDecimal(detail.getSettlementPrice()).multiply(proportion));
|
|
|
detail.setPrice(detail.getPrice() - detail.getSettlementPrice());
|
|
detail.setPrice(detail.getPrice() - detail.getSettlementPrice());
|
|
|
}
|
|
}
|
|
|
|
|
|