|
|
@@ -28,6 +28,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
import java.math.BigDecimal;
|
|
|
+import java.math.RoundingMode;
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
@@ -110,7 +111,7 @@ public class IposFeignController extends BaseFeignController {
|
|
|
* 站长分账 = 剩余分账 * 分账比例
|
|
|
* 平台运营商分账 = 可分账 - 区域运营商分账 -团长分账 -站长分账
|
|
|
*/
|
|
|
- BigDecimal proportion = new BigDecimal(0.1);
|
|
|
+ BigDecimal proportion = new BigDecimal(0.01);
|
|
|
List<SplitPay> returnList = Lists.newArrayList();
|
|
|
for (SplitInfo splitInfo : list) {
|
|
|
//List<SplitRecords> splitRecordsList = Lists.newArrayList();
|
|
|
@@ -149,7 +150,7 @@ public class IposFeignController extends BaseFeignController {
|
|
|
//总分账金额 支付价-手续费
|
|
|
BigDecimal sumPrice = new BigDecimal(detail.getPrice()).subtract(chargeAmount);
|
|
|
//平台自留=总分账金额*1%
|
|
|
- BigDecimal ptDecimal = sumPrice.multiply(proportion);
|
|
|
+ BigDecimal ptDecimal = sumPrice.multiply(proportion).setScale(0, RoundingMode.HALF_UP);
|
|
|
//可分金额=总分账金额-平台自留
|
|
|
BigDecimal price = sumPrice.subtract(ptDecimal);
|
|
|
detail.setPrice(price.longValue());
|
|
|
@@ -250,7 +251,7 @@ public class IposFeignController extends BaseFeignController {
|
|
|
supplier.setSourceId(2);
|
|
|
supplier.setMerchantId(s);
|
|
|
for (SplitDetail detail : supplierMaps.get(s)) {
|
|
|
- Long supplierPrice = new BigDecimal(detail.getPrice()).multiply(detail.getSupplierCommission()).longValue();
|
|
|
+ Long supplierPrice = new BigDecimal(detail.getPrice()).multiply(detail.getSupplierCommission()).setScale(0, RoundingMode.HALF_UP).longValue();
|
|
|
supplierAmount = supplierAmount.add(new BigDecimal(supplierPrice));
|
|
|
detail.setPrice(new BigDecimal(detail.getPrice()).subtract(new BigDecimal(supplierPrice)).longValue());
|
|
|
}
|
|
|
@@ -279,7 +280,7 @@ public class IposFeignController extends BaseFeignController {
|
|
|
tz.setSourceId(6);
|
|
|
tz.setMerchantId(s);
|
|
|
for (SplitDetail detail : tzMaps.get(s)) {
|
|
|
- Long tzPrice = new BigDecimal(detail.getPrice()).multiply(detail.getGroupCommission()).longValue();
|
|
|
+ Long tzPrice = new BigDecimal(detail.getPrice()).multiply(detail.getGroupCommission()).setScale(0, RoundingMode.HALF_UP).longValue();
|
|
|
tzAmount = tzAmount.add(new BigDecimal(tzPrice));
|
|
|
}
|
|
|
|
|
|
@@ -297,7 +298,7 @@ public class IposFeignController extends BaseFeignController {
|
|
|
station.setSourceId(5);
|
|
|
station.setMerchantId(s);
|
|
|
for (SplitDetail detail : stationMaps.get(s)) {
|
|
|
- Long stationPrice = new BigDecimal(detail.getPrice()).multiply(detail.getStationmasterCommission()).longValue();
|
|
|
+ Long stationPrice = new BigDecimal(detail.getPrice()).multiply(detail.getStationmasterCommission()).setScale(0, RoundingMode.HALF_UP).longValue();
|
|
|
stationAmount = stationAmount.add(new BigDecimal(stationPrice));
|
|
|
}
|
|
|
|
|
|
@@ -328,10 +329,10 @@ public class IposFeignController extends BaseFeignController {
|
|
|
ptyys.setMerchantId(splitInfo.getOperatorMerchantId());
|
|
|
ptyys.setDivAmt(String.valueOf(ptyysAmount.longValue()));
|
|
|
details.add(ptyys);
|
|
|
- VaultsResponse vaultsResponse = splitService.delayConfirm(records,details);
|
|
|
+ /*VaultsResponse vaultsResponse = splitService.delayConfirm(records,details);
|
|
|
if(!vaultsResponse.validate()){
|
|
|
records.setComment(vaultsResponse.getMessage());
|
|
|
- }
|
|
|
+ }*/
|
|
|
records.setStatus(2);
|
|
|
splitRecordsService.save(records);
|
|
|
splitRecordsDetailService.saveBatch(details);
|