|
|
@ -28,6 +28,8 @@ package com.yxt.anrui.fin.biz.finuncollectedreceivablesdetailed; |
|
|
|
import cn.hutool.core.date.DateUtil; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.yxt.anrui.base.api.basevehiclestate.BaseVehicleState; |
|
|
|
import com.yxt.anrui.base.api.basevehiclestate.BaseVehicleStateFeign; |
|
|
|
import com.yxt.anrui.base.api.basevehicletempstate.BaseVehicleTempstateFeign; |
|
|
|
import com.yxt.anrui.base.api.commoncontract.CommonContractFeign; |
|
|
|
import com.yxt.anrui.base.api.commoncontract.CommonContractVo; |
|
|
@ -124,7 +126,8 @@ public class FinUncollectedReceivablesDetailedService extends MybatisBaseService |
|
|
|
private FinCompanyInvoicingService finCompanyInvoicingService; |
|
|
|
@Autowired |
|
|
|
private FinVehicleInvoiceService finVehicleInvoiceService; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private BaseVehicleStateFeign baseVehicleStateFeign; |
|
|
|
@Autowired |
|
|
|
private FinFundsCarriedForwardApplyService finFundsCarriedForwardApplyService; |
|
|
|
|
|
|
@ -506,33 +509,41 @@ public class FinUncollectedReceivablesDetailedService extends MybatisBaseService |
|
|
|
if ((StringUtils.isNotBlank(svo.getBondAmounts()) && !("0.00").equals(svo.getBondAmounts())) |
|
|
|
|| (StringUtils.isNotBlank(svo.getDepositPremium()) && !("0.00").equals(svo.getDepositPremium())) |
|
|
|
|| (StringUtils.isNotBlank(svo.getDepositSettle()) && !("0.00").equals(svo.getDepositSettle()))) { |
|
|
|
List<String> sidList = baseMapper.selectSidBybusVinSidAndConNo(record.getBusVinSid(), record.getContractNo()); |
|
|
|
List<BigDecimal> noSubscriptionMoneyList = new ArrayList<>(); |
|
|
|
List<Integer> noSubscriptionMoneyCheckList = new ArrayList<>(); |
|
|
|
if (null != sidList) { |
|
|
|
for (String s : sidList) { |
|
|
|
FinUncollectedReceivablesDetailed detailed = fetchBySid(s); |
|
|
|
List<FinSelectedReceivablesDetailed> detaileds = finSelectedReceivablesDetailedService.fetchByReceivablesSid(s).getData(); |
|
|
|
BigDecimal sumCheck = new BigDecimal(0).setScale(2, RoundingMode.HALF_EVEN); |
|
|
|
for (FinSelectedReceivablesDetailed selectedReceivablesDetailed : detaileds) { |
|
|
|
BigDecimal subscriptionMoney = selectedReceivablesDetailed.getSubscriptionMoney(); |
|
|
|
sumCheck = sumCheck.add(subscriptionMoney); |
|
|
|
BaseVehicleState vehicleState = baseVehicleStateFeign.selectOneByBusSidAndOrderSid(record.getBusVinSid(),salesOrderSid).getData(); |
|
|
|
if (null != vehicleState) { |
|
|
|
if (StringUtils.isNotBlank(vehicleState.getFinState())) { |
|
|
|
if (vehicleState.getFinState().equals("1")) { |
|
|
|
record.setDownload(true); |
|
|
|
} |
|
|
|
BigDecimal reveivableMoneyCheck = new BigDecimal(detailed.getReveivableMoney()); |
|
|
|
BigDecimal noSubscriptionMoneyCheck = reveivableMoneyCheck.subtract(sumCheck); |
|
|
|
noSubscriptionMoneyList.add(noSubscriptionMoneyCheck); |
|
|
|
} |
|
|
|
if (null != noSubscriptionMoneyList) { |
|
|
|
for (BigDecimal money : noSubscriptionMoneyList) { |
|
|
|
if (money.compareTo(BigDecimal.ZERO) > 0) { |
|
|
|
noSubscriptionMoneyCheckList.add(1); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if (null == noSubscriptionMoneyCheckList || noSubscriptionMoneyCheckList.size() == 0 || noSubscriptionMoneyCheckList.isEmpty()) { |
|
|
|
record.setDownload(true); |
|
|
|
} |
|
|
|
} |
|
|
|
// List<String> sidList = baseMapper.selectSidBybusVinSidAndConNo(record.getBusVinSid(), record.getContractNo());
|
|
|
|
// List<BigDecimal> noSubscriptionMoneyList = new ArrayList<>();
|
|
|
|
// List<Integer> noSubscriptionMoneyCheckList = new ArrayList<>();
|
|
|
|
// if (null != sidList) {
|
|
|
|
// for (String s : sidList) {
|
|
|
|
// FinUncollectedReceivablesDetailed detailed = fetchBySid(s);
|
|
|
|
// List<FinSelectedReceivablesDetailed> detaileds = finSelectedReceivablesDetailedService.fetchByReceivablesSid(s).getData();
|
|
|
|
// BigDecimal sumCheck = new BigDecimal(0).setScale(2, RoundingMode.HALF_EVEN);
|
|
|
|
// for (FinSelectedReceivablesDetailed selectedReceivablesDetailed : detaileds) {
|
|
|
|
// BigDecimal subscriptionMoney = selectedReceivablesDetailed.getSubscriptionMoney();
|
|
|
|
// sumCheck = sumCheck.add(subscriptionMoney);
|
|
|
|
// }
|
|
|
|
// BigDecimal reveivableMoneyCheck = new BigDecimal(detailed.getReveivableMoney());
|
|
|
|
// BigDecimal noSubscriptionMoneyCheck = reveivableMoneyCheck.subtract(sumCheck);
|
|
|
|
// noSubscriptionMoneyList.add(noSubscriptionMoneyCheck);
|
|
|
|
// }
|
|
|
|
// if (null != noSubscriptionMoneyList) {
|
|
|
|
// for (BigDecimal money : noSubscriptionMoneyList) {
|
|
|
|
// if (money.compareTo(BigDecimal.ZERO) > 0) {
|
|
|
|
// noSubscriptionMoneyCheckList.add(1);
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// if (null == noSubscriptionMoneyCheckList || noSubscriptionMoneyCheckList.size() == 0 || noSubscriptionMoneyCheckList.isEmpty()) {
|
|
|
|
// record.setDownload(true);
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|