@ -3786,16 +3786,16 @@ public class FinCollectionConfirmationService extends MybatisBaseService<FinColl
if ( v . getReceivablesName ( ) . equals ( "月还" ) ) {
if ( null ! = planDetails . getPaymentMoney ( ) ) {
if ( planDetails . getPaymentMoney ( ) . compareTo ( BigDecimal . ZERO ) = = 1 ) {
BigDecimal paymentMoney = planDetails . getPaymentMoney ( ) ;
String subscriptionMoney = v . getSubscriptionMoney ( ) ;
BigDecimal subtract = paymentMoney . subtract ( new BigDecimal ( subscriptionMoney ) ) ;
planDetails . setPaymentMoney ( subtract ) ;
loanRepaymentPlanDetailsFeign . updateByEntity ( planDetails ) ;
String orderSid = planDetails . getSalesOrderSid ( ) ;
ResultBean < LoanFinBank > bankResultBean = loanFinBankFeign . reAdvancesByOrderSid ( orderSid ) ;
if ( bankResultBean . getData ( ) ! = null ) {
LoanFinBank loanFinBank = bankResultBean . getData ( ) ;
if ( null ! = loanFinBank . getReAdvances ( ) ) {
BigDecimal paymentMoney = planDetails . getPaymentMoney ( ) ;
String subscriptionMoney = v . getSubscriptionMoney ( ) ;
BigDecimal subtract = paymentMoney . subtract ( new BigDecimal ( subscriptionMoney ) ) ;
planDetails . setPaymentMoney ( subtract ) ;
loanRepaymentPlanDetailsFeign . updateByEntity ( planDetails ) ;
if ( loanFinBank . getReAdvances ( ) = = 1 ) {
FinUncollectedReceivablesDetailedJR jr = new FinUncollectedReceivablesDetailedJR ( ) ;
jr . setCreateBySid ( userSid ) ;
@ -3823,19 +3823,19 @@ public class FinCollectionConfirmationService extends MybatisBaseService<FinColl
if ( v . getReceivablesName ( ) . equals ( "资方逾期利息" ) ) {
if ( null ! = planDetails . getPaymentInterest ( ) ) {
if ( planDetails . getPaymentInterest ( ) . compareTo ( BigDecimal . ZERO ) = = 1 ) {
BigDecimal paymentInterest = planDetails . getPaymentInterest ( ) ;
String subscriptionMoney = v . getSubscriptionMoney ( ) ;
BigDecimal subtract = paymentInterest . subtract ( new BigDecimal ( subscriptionMoney ) ) ;
planDetails . setPaymentInterest ( subtract ) ;
BigDecimal paymentMoney = planDetails . getPaymentMoney ( ) ;
BigDecimal subtract2 = paymentMoney . subtract ( new BigDecimal ( subscriptionMoney ) ) ;
planDetails . setPaymentMoney ( subtract2 ) ;
loanRepaymentPlanDetailsFeign . updateByEntity ( planDetails ) ;
String orderSid = planDetails . getSalesOrderSid ( ) ;
ResultBean < LoanFinBank > bankResultBean = loanFinBankFeign . reAdvancesByOrderSid ( orderSid ) ;
if ( bankResultBean . getData ( ) ! = null ) {
LoanFinBank loanFinBank = bankResultBean . getData ( ) ;
if ( null ! = loanFinBank . getReAdvances ( ) ) {
BigDecimal paymentInterest = planDetails . getPaymentInterest ( ) ;
String subscriptionMoney = v . getSubscriptionMoney ( ) ;
BigDecimal subtract = paymentInterest . subtract ( new BigDecimal ( subscriptionMoney ) ) ;
planDetails . setPaymentInterest ( subtract ) ;
BigDecimal paymentMoney = planDetails . getPaymentMoney ( ) ;
BigDecimal subtract2 = paymentMoney . subtract ( new BigDecimal ( subscriptionMoney ) ) ;
planDetails . setPaymentMoney ( subtract2 ) ;
loanRepaymentPlanDetailsFeign . updateByEntity ( planDetails ) ;
if ( loanFinBank . getReAdvances ( ) = = 1 ) {
FinUncollectedReceivablesDetailedJR jr = new FinUncollectedReceivablesDetailedJR ( ) ;
jr . setCreateBySid ( userSid ) ;
@ -3893,19 +3893,19 @@ public class FinCollectionConfirmationService extends MybatisBaseService<FinColl
List < String > stringList = baseMapper . selectBys ( loanRepaymentPlanDetails . getBusVinSid ( ) ) ;
stringList . removeAll ( Collections . singleton ( null ) ) ;
BigDecimal a3 = BigDecimal . ZERO ;
if ( ! stringList . isEmpty ( ) ) {
if ( ! stringList . isEmpty ( ) ) {
a3 = baseMapper . selectA3 ( stringList ) ;
}
unall = unall . add ( a1 ) . add ( a3 ) ;
List < String > unList = baseMapper . selectUnA ( busVinSid ) ;
unList . removeAll ( Collections . singleton ( null ) ) ;
BigDecimal a4 = BigDecimal . ZERO ;
if ( ! unList . isEmpty ( ) ) {
if ( ! unList . isEmpty ( ) ) {
//已收
a4 = baseMapper . selectA4 ( unList ) ;
}
BigDecimal a5 = BigDecimal . ZERO ;
if ( ! stringList . isEmpty ( ) ) {
if ( ! stringList . isEmpty ( ) ) {
a5 = baseMapper . selectA5 ( stringList ) ;
}
@ -3919,7 +3919,7 @@ public class FinCollectionConfirmationService extends MybatisBaseService<FinColl
List < String > stringList = baseMapper . selectBys ( loanRepaymentPlanDetails . getBusVinSid ( ) ) ;
stringList . removeAll ( Collections . singleton ( null ) ) ;
BigDecimal a3 = BigDecimal . ZERO ;
if ( ! stringList . isEmpty ( ) ) {
if ( ! stringList . isEmpty ( ) ) {
a3 = baseMapper . selectA3 ( stringList ) ;
}
BigDecimal a1 = baseMapper . selectA1 ( busVinSid ) ;
@ -3928,12 +3928,12 @@ public class FinCollectionConfirmationService extends MybatisBaseService<FinColl
//已收
unList . removeAll ( Collections . singleton ( null ) ) ;
BigDecimal a4 = BigDecimal . ZERO ;
if ( ! unList . isEmpty ( ) ) {
if ( ! unList . isEmpty ( ) ) {
//已收
a4 = baseMapper . selectA4 ( unList ) ;
}
BigDecimal a5 = BigDecimal . ZERO ;
if ( ! stringList . isEmpty ( ) ) {
if ( ! stringList . isEmpty ( ) ) {
a5 = baseMapper . selectA5 ( stringList ) ;
}
yAll = yAll . add ( a4 ) . add ( a5 ) ;
@ -4317,23 +4317,30 @@ public class FinCollectionConfirmationService extends MybatisBaseService<FinColl
voucherDetail . setCustomerCode ( customerNumber ) ;
voucherDetail . setCustomerName ( customerName ) ;
}
if ( v . getReceivablesName ( ) . equals ( "资方逾期利息" ) ) {
//间还已逾期
voucherDetail . setSceneCode ( SceneCodeEnum . INDIRECT_VOUCHER2 . getCode ( ) ) ;
} else {
LoanRepaymentPlanDetailsForOverDue checkOverdue = loanRepaymentPlanDetailsFeign . checkOverDue ( planSid ) . getData ( ) ;
if ( checkOverdue ! = null ) {
if ( StringUtils . isNotBlank ( checkOverdue . getOverdueState ( ) ) ) {
if ( checkOverdue . getOverdueState ( ) . equals ( "0" ) ) {
//间还已逾期
voucherDetail . setSceneCode ( SceneCodeEnum . INDIRECT_VOUCHER2 . getCode ( ) ) ;
} else if ( checkOverdue . getOverdueState ( ) . equals ( "1" ) ) {
//间还未逾期
voucherDetail . setSceneCode ( SceneCodeEnum . INDIRECT_VOUCHER1 . getCode ( ) ) ;
}
}
if ( null ! = planDetails . getOweState ( ) ) {
if ( planDetails . getOweState ( ) = = 0 ) {
voucherDetail . setSceneCode ( SceneCodeEnum . INDIRECT_VOUCHER2 . getCode ( ) ) ;
} else if ( planDetails . getOweState ( ) = = 1 ) {
voucherDetail . setSceneCode ( SceneCodeEnum . INDIRECT_VOUCHER1 . getCode ( ) ) ;
}
}
// if (v.getReceivablesName().equals("资方逾期利息")) {
// //间还已逾期
// voucherDetail.setSceneCode(SceneCodeEnum.INDIRECT_VOUCHER2.getCode());
// } else {
// LoanRepaymentPlanDetailsForOverDue checkOverdue = loanRepaymentPlanDetailsFeign.checkOverDue(planSid).getData();
// if (checkOverdue != null) {
// if (StringUtils.isNotBlank(checkOverdue.getOverdueState())) {
// if (checkOverdue.getOverdueState().equals("0")) {
// //间还已逾期
// voucherDetail.setSceneCode(SceneCodeEnum.INDIRECT_VOUCHER2.getCode());
// } else if (checkOverdue.getOverdueState().equals("1")) {
// //间还未逾期
// voucherDetail.setSceneCode(SceneCodeEnum.INDIRECT_VOUCHER1.getCode());
// }
// }
// }
// }
try {
voucherDetail . setDataTime ( sdf . parse ( finCollectionConfirmation . getCollectionDate ( ) ) ) ;
} catch ( ParseException e ) {