|
@@ -18,7 +18,6 @@ import com.poteviohealth.ym.ipos.service.*;
|
|
|
import com.poteviohealth.ym.ipos.utils.YmUtil;
|
|
import com.poteviohealth.ym.ipos.utils.YmUtil;
|
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
-import jodd.util.StringUtil;
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.apache.commons.lang3.time.DateFormatUtils;
|
|
import org.apache.commons.lang3.time.DateFormatUtils;
|
|
|
import org.springframework.stereotype.Controller;
|
|
import org.springframework.stereotype.Controller;
|
|
@@ -29,10 +28,9 @@ import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
|
|
|
+import java.math.RoundingMode;
|
|
|
import java.util.Date;
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
|
|
-import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 第三方支付
|
|
* 第三方支付
|
|
@@ -100,10 +98,18 @@ public class IposFeignController extends BaseFeignController {
|
|
|
public VaultsResponse<List<SplitPay>> splitOrder(@RequestBody List<SplitInfo> list) {
|
|
public VaultsResponse<List<SplitPay>> splitOrder(@RequestBody List<SplitInfo> list) {
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
|
|
+ * 分成顺序:平台自留->供应价/结算价->区域运营商分成->团长分成->站长分成->平台运营商
|
|
|
|
|
+ * 手续费:0.3%(由第三方提供)
|
|
|
* 分账金额=(总价-手续费)
|
|
* 分账金额=(总价-手续费)
|
|
|
* 分账 = 分账金额*99%;平台自留: 分账金额*1%
|
|
* 分账 = 分账金额*99%;平台自留: 分账金额*1%
|
|
|
|
|
+ * 可分账 = 分账-供应价(结算价)
|
|
|
|
|
+ * 区域运营商分账 = 可分账 * 分账比例
|
|
|
|
|
+ * 剩余分账 = 可分账 - 区域运营商分账
|
|
|
|
|
+ * 团长分账 = 剩余分账 * 分账比例
|
|
|
|
|
+ * 站长分账 = 剩余分账 * 分账比例
|
|
|
|
|
+ * 平台运营商分账 = 可分账 - 区域运营商分账 -团长分账 -站长分账
|
|
|
*/
|
|
*/
|
|
|
- BigDecimal proportion = new BigDecimal(0.99);
|
|
|
|
|
|
|
+ BigDecimal proportion = new BigDecimal(0.01);
|
|
|
List<SplitPay> returnList = Lists.newArrayList();
|
|
List<SplitPay> returnList = Lists.newArrayList();
|
|
|
for (SplitInfo splitInfo : list) {
|
|
for (SplitInfo splitInfo : list) {
|
|
|
//List<SplitRecords> splitRecordsList = Lists.newArrayList();
|
|
//List<SplitRecords> splitRecordsList = Lists.newArrayList();
|
|
@@ -118,131 +124,223 @@ public class IposFeignController extends BaseFeignController {
|
|
|
records.setPayId(splitInfo.getPayId());
|
|
records.setPayId(splitInfo.getPayId());
|
|
|
records.setPaySn(splitInfo.getPaySn());
|
|
records.setPaySn(splitInfo.getPaySn());
|
|
|
records.setSumPrice(splitInfo.getSumPrice());
|
|
records.setSumPrice(splitInfo.getSumPrice());
|
|
|
- //平台分成
|
|
|
|
|
- SplitRecordsDetail pt = new SplitRecordsDetail();
|
|
|
|
|
- pt.setSplitId(records.getSplitId());
|
|
|
|
|
- pt.setSourceId(0);
|
|
|
|
|
|
|
+ //手续费
|
|
|
BigDecimal chargeAmount = new BigDecimal(pr.getChargeAmount());
|
|
BigDecimal chargeAmount = new BigDecimal(pr.getChargeAmount());
|
|
|
BigDecimal ptAmount = BigDecimal.ZERO;
|
|
BigDecimal ptAmount = BigDecimal.ZERO;
|
|
|
BigDecimal tzAmount = BigDecimal.ZERO;
|
|
BigDecimal tzAmount = BigDecimal.ZERO;
|
|
|
|
|
+ BigDecimal stationAmount = BigDecimal.ZERO;
|
|
|
BigDecimal ptyysAmount = BigDecimal.ZERO;
|
|
BigDecimal ptyysAmount = BigDecimal.ZERO;
|
|
|
BigDecimal supplierOneAmount = BigDecimal.ZERO;
|
|
BigDecimal supplierOneAmount = BigDecimal.ZERO;
|
|
|
BigDecimal supplierTwoAmount = BigDecimal.ZERO;
|
|
BigDecimal supplierTwoAmount = BigDecimal.ZERO;
|
|
|
BigDecimal supplierAmount = BigDecimal.ZERO;
|
|
BigDecimal supplierAmount = BigDecimal.ZERO;
|
|
|
- //团长分成
|
|
|
|
|
- SplitRecordsDetail tz = new SplitRecordsDetail();
|
|
|
|
|
- tz.setSplitId(records.getSplitId());
|
|
|
|
|
- tz.setSourceId(3);
|
|
|
|
|
-
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 0.平台自留金额
|
|
|
|
|
+ */
|
|
|
|
|
+ //平台自留
|
|
|
|
|
+ SplitRecordsDetail pt = new SplitRecordsDetail();
|
|
|
|
|
+ pt.setSplitId(records.getSplitId());
|
|
|
|
|
+ pt.setSourceId(0);
|
|
|
for (SplitDetail detail : splitInfo.getDetails()) {
|
|
for (SplitDetail detail : splitInfo.getDetails()) {
|
|
|
SplitPay sp = new SplitPay();
|
|
SplitPay sp = new SplitPay();
|
|
|
sp.setOrderId(detail.getOrderId());
|
|
sp.setOrderId(detail.getOrderId());
|
|
|
sp.setSplitId(records.getSplitId());
|
|
sp.setSplitId(records.getSplitId());
|
|
|
- //总价格 支付价-手续费
|
|
|
|
|
|
|
+ //总分账金额 支付价-手续费
|
|
|
BigDecimal sumPrice = new BigDecimal(detail.getPrice()).subtract(chargeAmount);
|
|
BigDecimal sumPrice = new BigDecimal(detail.getPrice()).subtract(chargeAmount);
|
|
|
- //运算价格 总价格*99%
|
|
|
|
|
- BigDecimal price = sumPrice.multiply(proportion);
|
|
|
|
|
|
|
+ //平台自留=总分账金额*1%
|
|
|
|
|
+ BigDecimal ptDecimal = sumPrice.multiply(proportion).setScale(0, RoundingMode.HALF_UP);
|
|
|
|
|
+ //可分金额=总分账金额-平台自留
|
|
|
|
|
+ BigDecimal price = sumPrice.subtract(ptDecimal);
|
|
|
detail.setPrice(price.longValue());
|
|
detail.setPrice(price.longValue());
|
|
|
- //平台金额=总价格-运算价格
|
|
|
|
|
- BigDecimal ptDecimal = sumPrice.subtract(price);
|
|
|
|
|
- BigDecimal valDecimal = new BigDecimal("1");
|
|
|
|
|
- if(ptDecimal.longValue() > 0){
|
|
|
|
|
- valDecimal = new BigDecimal(ptDecimal.longValue());
|
|
|
|
|
- }
|
|
|
|
|
- ptAmount = ptAmount.add(valDecimal);
|
|
|
|
|
|
|
+ //平台自留金额
|
|
|
|
|
+ ptAmount = ptAmount.add(ptDecimal);
|
|
|
returnList.add(sp);
|
|
returnList.add(sp);
|
|
|
- }
|
|
|
|
|
- pt.setDivAmt(String.valueOf(ptAmount.longValue()));
|
|
|
|
|
- details.add(pt);
|
|
|
|
|
-
|
|
|
|
|
- //一级供应商
|
|
|
|
|
- Map<String, List<SplitDetail>> oneMaps = splitInfo.getDetails().stream().filter(s -> StringUtils.isNotEmpty(s.getSupplierOneMerchantId()) && s.getBelong().equals(1)).collect(Collectors.groupingBy(SplitDetail::getSupplierOneMerchantId));
|
|
|
|
|
-
|
|
|
|
|
- for (String s : oneMaps.keySet()) {
|
|
|
|
|
- SplitRecordsDetail supplierOne = new SplitRecordsDetail();
|
|
|
|
|
- supplierOne.setSplitId(records.getSplitId());
|
|
|
|
|
- supplierOne.setSourceId(2);
|
|
|
|
|
- supplierOne.setMerchantId(s);
|
|
|
|
|
- for (SplitDetail detail : oneMaps.get(s)) {
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 2.供应价/结算价 的分账(包含区域运营商/一级供应商/二级供应商/服务站)
|
|
|
|
|
+ */
|
|
|
|
|
+ //一级供应商
|
|
|
|
|
+ if(StringUtils.isNotEmpty(detail.getSupplierOneMerchantId()) && detail.getBelong().equals(1)){
|
|
|
|
|
+ SplitRecordsDetail supplierOne = new SplitRecordsDetail();
|
|
|
|
|
+ supplierOne.setSplitId(records.getSplitId());
|
|
|
|
|
+ supplierOne.setSourceId(3);
|
|
|
|
|
+ supplierOne.setMerchantId(detail.getSupplierOneMerchantId());
|
|
|
|
|
+ for (SplitRecordsDetail splitRecordsDetail : details) {
|
|
|
|
|
+ if(splitRecordsDetail.getMerchantId().equals(detail.getSupplierOneMerchantId())){
|
|
|
|
|
+ supplierOne = splitRecordsDetail;
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ detail.setPrice(detail.getPrice()-detail.getConsignmentPrice());
|
|
|
supplierOneAmount = supplierOneAmount.add(new BigDecimal(detail.getConsignmentPrice()));
|
|
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) {
|
|
|
|
|
- supplierOne.setDivAmt(String.valueOf(supplierOneAmount.longValue()));
|
|
|
|
|
- details.add(supplierOne);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- //二级供应商
|
|
|
|
|
- Map<String, List<SplitDetail>> twoMaps = splitInfo.getDetails().stream().filter(s -> StringUtils.isNotEmpty(s.getServiceStationMerchantId()) && s.getBelong().equals(2)).collect(Collectors.groupingBy(SplitDetail::getServiceStationMerchantId));
|
|
|
|
|
-
|
|
|
|
|
- for (String s : twoMaps.keySet()) {
|
|
|
|
|
- SplitRecordsDetail supplierTwo = new SplitRecordsDetail();
|
|
|
|
|
- supplierTwo.setSplitId(records.getSplitId());
|
|
|
|
|
- supplierTwo.setSourceId(2);
|
|
|
|
|
- supplierTwo.setMerchantId(s);
|
|
|
|
|
- for (SplitDetail detail : twoMaps.get(s)) {
|
|
|
|
|
- supplierTwoAmount = supplierTwoAmount.add(new BigDecimal(detail.getConsignmentPrice()));
|
|
|
|
|
|
|
+ if (supplierOneAmount.compareTo(BigDecimal.ZERO) == 1) {
|
|
|
|
|
+ supplierOne.setDivAmt(supplierOneAmount.toString());
|
|
|
|
|
+ details.add(supplierOne);
|
|
|
|
|
+ }
|
|
|
|
|
+ }else if(StringUtils.isNotEmpty(detail.getServiceStationMerchantId()) && detail.getBelong().equals(2)){
|
|
|
|
|
+ //二级供应商
|
|
|
|
|
+ SplitRecordsDetail supplierTwo = new SplitRecordsDetail();
|
|
|
|
|
+ supplierTwo.setSplitId(records.getSplitId());
|
|
|
|
|
+ supplierTwo.setSourceId(4);
|
|
|
|
|
+ supplierTwo.setMerchantId(detail.getServiceStationMerchantId());
|
|
|
|
|
+ boolean is_have = false;
|
|
|
|
|
+ for (SplitRecordsDetail splitRecordsDetail : details) {
|
|
|
|
|
+ if(splitRecordsDetail.getMerchantId().equals(detail.getServiceStationMerchantId())){
|
|
|
|
|
+ supplierTwo = splitRecordsDetail;
|
|
|
|
|
+ is_have = true;
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
detail.setPrice(detail.getPrice() - detail.getConsignmentPrice());
|
|
detail.setPrice(detail.getPrice() - detail.getConsignmentPrice());
|
|
|
- }
|
|
|
|
|
|
|
+ supplierTwoAmount = supplierTwoAmount.add(new BigDecimal(detail.getConsignmentPrice()));
|
|
|
|
|
|
|
|
- if (supplierTwoAmount.compareTo(BigDecimal.ZERO) == 1) {
|
|
|
|
|
- supplierTwo.setDivAmt(String.valueOf(supplierTwoAmount.longValue()));
|
|
|
|
|
- details.add(supplierTwo);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ if (supplierTwoAmount.compareTo(BigDecimal.ZERO) == 1) {
|
|
|
|
|
+ supplierTwo.setDivAmt(supplierTwoAmount.toString());
|
|
|
|
|
+ if(!is_have){
|
|
|
|
|
+ details.add(supplierTwo);
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- //供应商
|
|
|
|
|
- Map<String, List<SplitDetail>> maps = splitInfo.getDetails().stream().filter(s -> StringUtils.isNotEmpty(s.getSupplierMerchantId()) && s.getBelong().equals(0)).collect(Collectors.groupingBy(SplitDetail::getSupplierMerchantId));
|
|
|
|
|
|
|
+ }
|
|
|
|
|
+ }else if(detail.getBelong().equals(0)){
|
|
|
|
|
+ //服务站
|
|
|
|
|
+ if(StringUtils.isNotEmpty(detail.getServiceStationMerchantId()) && detail.getOrderType().equals(2)){
|
|
|
|
|
+ SplitRecordsDetail serviceStation = new SplitRecordsDetail();
|
|
|
|
|
+ serviceStation.setSplitId(records.getSplitId());
|
|
|
|
|
+ serviceStation.setSourceId(5);
|
|
|
|
|
+ serviceStation.setMerchantId(detail.getServiceStationMerchantId());
|
|
|
|
|
+ boolean is_have = false;
|
|
|
|
|
+ for (SplitRecordsDetail splitRecordsDetail : details) {
|
|
|
|
|
+ if(splitRecordsDetail.getMerchantId().equals(detail.getServiceStationMerchantId())){
|
|
|
|
|
+ serviceStation = splitRecordsDetail;
|
|
|
|
|
+ is_have=true;
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ stationAmount = stationAmount.add(new BigDecimal(detail.getSettlementPrice()));
|
|
|
|
|
+ detail.setPrice(detail.getPrice() - detail.getSettlementPrice());
|
|
|
|
|
+ if (stationAmount.compareTo(BigDecimal.ZERO) == 1) {
|
|
|
|
|
+ serviceStation.setDivAmt(stationAmount.toString());
|
|
|
|
|
+ if(!is_have){
|
|
|
|
|
+ details.add(serviceStation);
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- for (String s : maps.keySet()) {
|
|
|
|
|
- SplitRecordsDetail supplier = new SplitRecordsDetail();
|
|
|
|
|
- supplier.setSplitId(records.getSplitId());
|
|
|
|
|
- supplier.setSourceId(2);
|
|
|
|
|
- supplier.setMerchantId(s);
|
|
|
|
|
- for (SplitDetail detail : maps.get(s)) {
|
|
|
|
|
- supplierAmount = supplierAmount.add(new BigDecimal(detail.getSettlementPrice()));
|
|
|
|
|
- detail.setPrice(new BigDecimal(detail.getPrice()).subtract(new BigDecimal(detail.getSettlementPrice())).longValue());
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ }
|
|
|
|
|
+ }else if(StringUtils.isNotEmpty(detail.getSupplierMerchantId()) && detail.getOrderType().equals(1)){
|
|
|
|
|
+ //供应商
|
|
|
|
|
+ boolean is_have = false;
|
|
|
|
|
+ SplitRecordsDetail supplier = new SplitRecordsDetail();
|
|
|
|
|
+ supplier.setSplitId(records.getSplitId());
|
|
|
|
|
+ supplier.setSourceId(2);
|
|
|
|
|
+ supplier.setMerchantId(detail.getSupplierMerchantId());
|
|
|
|
|
+ for (SplitRecordsDetail splitRecordsDetail : details) {
|
|
|
|
|
+ if(splitRecordsDetail.getMerchantId().equals(detail.getSupplierMerchantId())){
|
|
|
|
|
+ supplier = splitRecordsDetail;
|
|
|
|
|
+ is_have =true;
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ supplierAmount = supplierAmount.add(new BigDecimal(detail.getSettlementPrice()));
|
|
|
|
|
+ detail.setPrice(detail.getPrice()-detail.getSettlementPrice());
|
|
|
|
|
+ if (supplierAmount.compareTo(BigDecimal.ZERO) == 1) {
|
|
|
|
|
+ supplier.setDivAmt(supplierAmount.toString());
|
|
|
|
|
+ if(!is_have){
|
|
|
|
|
+ details.add(supplier);
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- if (supplierAmount.compareTo(BigDecimal.ZERO) == 1) {
|
|
|
|
|
- supplier.setDivAmt(String.valueOf(supplierAmount.longValue()));
|
|
|
|
|
- details.add(supplier);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 3.分成
|
|
|
|
|
+ */
|
|
|
|
|
+ //区域运营商
|
|
|
|
|
+ if(detail.getSupplierMoney()!= null && detail.getSupplierMoney()>0L){
|
|
|
|
|
+ SplitRecordsDetail supplier = new SplitRecordsDetail();
|
|
|
|
|
+ supplier.setSplitId(records.getSplitId());
|
|
|
|
|
+ supplier.setSourceId(2);
|
|
|
|
|
+ supplier.setMerchantId(detail.getSupplierMerchantId());
|
|
|
|
|
+ boolean is_have = false;
|
|
|
|
|
+ for (SplitRecordsDetail splitRecordsDetail : details) {
|
|
|
|
|
+ if(splitRecordsDetail.getMerchantId().equals(detail.getSupplierMerchantId())){
|
|
|
|
|
+ supplier = splitRecordsDetail;
|
|
|
|
|
+ is_have =true;
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ supplierAmount = supplierAmount.add(new BigDecimal(detail.getSupplierMoney()));
|
|
|
|
|
+ detail.setPrice(detail.getPrice()-detail.getSupplierMoney());
|
|
|
|
|
+ if (supplierAmount.compareTo(BigDecimal.ZERO) == 1) {
|
|
|
|
|
+ supplier.setDivAmt(supplierAmount.toString());
|
|
|
|
|
+ if(!is_have){
|
|
|
|
|
+ details.add(supplier);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- for (SplitDetail detail : splitInfo.getDetails()) {
|
|
|
|
|
- //团长金额
|
|
|
|
|
- if (StringUtil.isNotEmpty(detail.getGroupLeaderMerchantId())) {
|
|
|
|
|
- tz.setMerchantId(detail.getGroupLeaderMerchantId());
|
|
|
|
|
- BigDecimal tbd = detail.getGroupCommission().multiply(new BigDecimal(detail.getPrice()));
|
|
|
|
|
- detail.setPrice(detail.getPrice()-tbd.longValue());
|
|
|
|
|
- tzAmount = tzAmount.add(tbd);
|
|
|
|
|
|
|
+ //团长
|
|
|
|
|
+ if(detail.getGroupCommissionMoney() != null && detail.getGroupCommissionMoney()>0L){
|
|
|
|
|
+ SplitRecordsDetail tz = new SplitRecordsDetail();
|
|
|
|
|
+ tz.setSplitId(records.getSplitId());
|
|
|
|
|
+ tz.setSourceId(6);
|
|
|
|
|
+ tz.setMerchantId(detail.getGroupLeaderMerchantId());
|
|
|
|
|
+ boolean is_have = false;
|
|
|
|
|
+ for (SplitRecordsDetail splitRecordsDetail : details) {
|
|
|
|
|
+ if(splitRecordsDetail.getMerchantId().equals(detail.getGroupLeaderMerchantId())){
|
|
|
|
|
+ tz = splitRecordsDetail;
|
|
|
|
|
+ is_have =true;
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ tzAmount = tzAmount.add(new BigDecimal(detail.getGroupCommissionMoney()));
|
|
|
|
|
+ detail.setPrice(detail.getPrice()-detail.getGroupCommissionMoney());
|
|
|
|
|
+ if (tzAmount.compareTo(BigDecimal.ZERO) == 1) {
|
|
|
|
|
+ tz.setDivAmt(tzAmount.toString());
|
|
|
|
|
+ if(!is_have){
|
|
|
|
|
+ details.add(tz);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ //站长
|
|
|
|
|
+ if(detail.getStationmasterCommissionMoney() != null && detail.getStationmasterCommissionMoney()>0L){
|
|
|
|
|
+ SplitRecordsDetail station = new SplitRecordsDetail();
|
|
|
|
|
+ station.setSplitId(records.getSplitId());
|
|
|
|
|
+ station.setSourceId(5);
|
|
|
|
|
+ station.setMerchantId(detail.getStationmasterMerchantId());
|
|
|
|
|
+ boolean is_have = false;
|
|
|
|
|
+ for (SplitRecordsDetail splitRecordsDetail : details) {
|
|
|
|
|
+ if(splitRecordsDetail.getMerchantId().equals(detail.getStationmasterMerchantId())){
|
|
|
|
|
+ station = splitRecordsDetail;
|
|
|
|
|
+ is_have =true;
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ stationAmount = stationAmount.add(new BigDecimal(detail.getStationmasterCommissionMoney()));
|
|
|
|
|
+ detail.setPrice(detail.getPrice()-detail.getStationmasterCommissionMoney());
|
|
|
|
|
+ if (stationAmount.compareTo(BigDecimal.ZERO) == 1) {
|
|
|
|
|
+ station.setDivAmt(stationAmount.toString());
|
|
|
|
|
+ if(!is_have){
|
|
|
|
|
+ details.add(station);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if(detail.getPrice()>0L){
|
|
|
|
|
+ ptyysAmount = ptyysAmount.add(new BigDecimal(detail.getPrice()));
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- if (tzAmount.compareTo(BigDecimal.ZERO) == 1) {
|
|
|
|
|
- tz.setDivAmt(String.valueOf(tzAmount.longValue()));
|
|
|
|
|
- details.add(tz);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
|
|
+ pt.setDivAmt(String.valueOf(ptAmount.longValue()));
|
|
|
|
|
+ details.add(pt);
|
|
|
|
|
|
|
|
//平台运营商
|
|
//平台运营商
|
|
|
SplitRecordsDetail ptyys = new SplitRecordsDetail();
|
|
SplitRecordsDetail ptyys = new SplitRecordsDetail();
|
|
|
ptyys.setSplitId(records.getSplitId());
|
|
ptyys.setSplitId(records.getSplitId());
|
|
|
ptyys.setSourceId(1);
|
|
ptyys.setSourceId(1);
|
|
|
- for (SplitDetail detail : splitInfo.getDetails()) {
|
|
|
|
|
- ptyysAmount = ptyysAmount.add(new BigDecimal(detail.getPrice()));
|
|
|
|
|
- }
|
|
|
|
|
ptyys.setMerchantId(splitInfo.getOperatorMerchantId());
|
|
ptyys.setMerchantId(splitInfo.getOperatorMerchantId());
|
|
|
- ptyys.setDivAmt(String.valueOf(ptyysAmount.longValue()));
|
|
|
|
|
|
|
+ ptyys.setDivAmt(ptyysAmount.toString());
|
|
|
details.add(ptyys);
|
|
details.add(ptyys);
|
|
|
- VaultsResponse vaultsResponse = splitService.delayConfirm(records,details);
|
|
|
|
|
|
|
+ /*VaultsResponse vaultsResponse = splitService.delayConfirm(records,details);
|
|
|
if(!vaultsResponse.validate()){
|
|
if(!vaultsResponse.validate()){
|
|
|
records.setComment(vaultsResponse.getMessage());
|
|
records.setComment(vaultsResponse.getMessage());
|
|
|
- }
|
|
|
|
|
|
|
+ }*/
|
|
|
records.setStatus(2);
|
|
records.setStatus(2);
|
|
|
- //splitRecordsList.add(records);
|
|
|
|
|
splitRecordsService.save(records);
|
|
splitRecordsService.save(records);
|
|
|
splitRecordsDetailService.saveBatch(details);
|
|
splitRecordsDetailService.saveBatch(details);
|
|
|
}
|
|
}
|