Browse Source

修改结案凭证

master
dimengzhe 2 weeks ago
parent
commit
a86dc424b5
  1. 11
      anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loancasecloseapply/LoanCaseCloseApplyService.java
  2. 7
      anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loancaseexecuteapply/LoanCaseExecuteApplyService.java
  3. 3
      anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loancaseprogressexecute/LoanCaseProgressExecuteMapper.java
  4. 3
      anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loancaseprogressexecute/LoanCaseProgressExecuteMapper.xml
  5. 5
      anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loancaseprogressexecute/LoanCaseProgressExecuteService.java

11
anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loancasecloseapply/LoanCaseCloseApplyService.java

@ -106,6 +106,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.*;
import java.util.concurrent.*;
import java.util.stream.Collectors;
@ -572,13 +573,22 @@ public class LoanCaseCloseApplyService extends MybatisBaseService<LoanCaseCloseA
voucher.setAccountBook(organizationVo.getOrgCode());
voucher.setVoucherNo(organizationVo.getOrgCode());
}
List<Voucher.VoucherResultDetailDto> voucherResultDetailDtos = new ArrayList<>();
List<Voucher.VoucherResultDetailDto> voucherResultDetailDtos2 = new ArrayList<>();
List<Voucher.VoucherResultDetailDto> voucherResultDetailDtos3= new ArrayList<>();
SysOrganizationVo deptVo = sysOrganizationFeign.fetchBySid(loanCaseCloseApply.getDeptSid()).getData();
List<String> busVinSidList = loanCaseProgressVehService.selectByMainSid(loanCaseCloseApply.getBusSid());
busVinSidList.removeAll(Collections.singleton(null));
BigDecimal executeExpenseAmount = BigDecimal.ZERO;
if(!busVinSidList.isEmpty()){
LoanCaseExecuteApply loanCaseExecuteApply = loanCaseProgressExecuteService.selectByBusSid(loanCaseCloseApply.getBusSid());
if(loanCaseExecuteApply != null){
executeExpenseAmount= loanCaseExecuteApply.getExecuteExpenseAmount();//预计申请坏账金额
if(executeExpenseAmount != null){
executeExpenseAmount = executeExpenseAmount.divide(BigDecimal.valueOf(busVinSidList.size()),2, RoundingMode.HALF_UP);
}
}
for (int i = 0; i < busVinSidList.size(); i++) {
String busVinSid = busVinSidList.get(i);
BusSalesOrderVehicle busSalesOrderVehicle = busSalesOrderVehicleFeign.details(busVinSid).getData();
@ -638,6 +648,7 @@ public class LoanCaseCloseApplyService extends MybatisBaseService<LoanCaseCloseA
String feesMoney = baseMapper.selectFeesMoney(loanCaseCloseApply.getBusSid());
ssf = ssf.add(StringUtils.isNotBlank(preserveMoney)?new BigDecimal(preserveMoney):BigDecimal.ZERO).add(StringUtils.isNotBlank(feesMoney)?new BigDecimal(feesMoney):BigDecimal.ZERO);
fxMoney = all.add(ssf);
ysqhz = executeExpenseAmount;
String allMoney = loanRepaymentPlanDetailsService.selectAllMoney(busVinSid);
String wdqMoney = loanRepaymentPlanDetailsService.getWdq(busVinSid);

7
anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loancaseexecuteapply/LoanCaseExecuteApplyService.java

@ -90,6 +90,7 @@ import com.yxt.common.core.vo.PagerVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.*;
import java.util.concurrent.*;
import java.util.stream.Collectors;
@ -554,6 +555,10 @@ public class LoanCaseExecuteApplyService extends MybatisBaseService<LoanCaseExec
List<Voucher.VoucherResultDetailDto> voucherResultDetailDtos = new ArrayList<>();
SysOrganizationVo deptVo = sysOrganizationFeign.fetchBySid(loanCaseExecuteApply.getDeptSid()).getData();
List<String> busVinSidList = loanCaseProgressVehService.selectByMainSid(loanCaseExecuteApply.getBusSid());
BigDecimal executeAmountInArear= loanCaseExecuteApply.getExecuteAmountInArear();//其中执行欠款金额
if(executeAmountInArear != null){
executeAmountInArear = executeAmountInArear.divide(BigDecimal.valueOf(busVinSidList.size()),2, RoundingMode.HALF_UP);
}
for (int i = 0; i < busVinSidList.size(); i++) {
String busVinSid = busVinSidList.get(i);
BusSalesOrderVehicle busSalesOrderVehicle = busSalesOrderVehicleFeign.details(busVinSid).getData();
@ -607,6 +612,8 @@ public class LoanCaseExecuteApplyService extends MybatisBaseService<LoanCaseExec
String allMoney = loanRepaymentPlanDetailsService.selectAllMoney(busVinSid);
String wdqMoney = loanRepaymentPlanDetailsService.getWdq(busVinSid);
all = all.add(StringUtils.isNotBlank(allMoney) ? new BigDecimal(allMoney) : BigDecimal.ZERO).add(StringUtils.isNotBlank(wdqMoney) ? new BigDecimal(wdqMoney) : BigDecimal.ZERO);
qzzxqk = executeAmountInArear;
ysqhz = all.subtract(qzzxqk);
//贷方
Voucher.VoucherResultDetailDto voucherResultDetailDtoDf = new Voucher.VoucherResultDetailDto();
//借方

3
anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loancaseprogressexecute/LoanCaseProgressExecuteMapper.java

@ -1,6 +1,7 @@
package com.yxt.anrui.riskcenter.biz.loancaseprogressexecute;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yxt.anrui.riskcenter.api.loancaseexecuteapply.LoanCaseExecuteApply;
import com.yxt.anrui.riskcenter.api.loancaseprogressclosed.LoanCaseProgressClosed;
import com.yxt.anrui.riskcenter.api.loancaseprogressexecute.LoanCaseProgressExecute;
import org.apache.ibatis.annotations.Mapper;
@ -17,4 +18,6 @@ public interface LoanCaseProgressExecuteMapper extends BaseMapper<LoanCaseProgre
@Select("select * from loan_case_progress_execute where mainSid = #{sid} and terminate = '0'")
LoanCaseProgressExecute selByMainSid(String sid);
LoanCaseExecuteApply selectByBusSid(String busSid);
}

3
anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loancaseprogressexecute/LoanCaseProgressExecuteMapper.xml

@ -2,4 +2,7 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yxt.anrui.riskcenter.biz.loancaseprogressexecute.LoanCaseProgressExecuteMapper">
<select id="selectByBusSid" resultType="com.yxt.anrui.riskcenter.api.loancaseexecuteapply.LoanCaseExecuteApply">
select * from loan_case_execute_apply where busSid = #{busSid} order by id desc limit 1
</select>
</mapper>

5
anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loancaseprogressexecute/LoanCaseProgressExecuteService.java

@ -3,6 +3,7 @@ package com.yxt.anrui.riskcenter.biz.loancaseprogressexecute;
import com.yxt.anrui.portal.api.sysorganization.SysOrganizationFeign;
import com.yxt.anrui.portal.api.sysstafforg.SysStaffOrgFeign;
import com.yxt.anrui.portal.api.sysuser.SysUserFeign;
import com.yxt.anrui.riskcenter.api.loancaseexecuteapply.LoanCaseExecuteApply;
import com.yxt.anrui.riskcenter.api.loancaseprogressclosed.LoanCaseProgressClosed;
import com.yxt.anrui.riskcenter.api.loancaseprogressexecute.LoanCaseProgressExecute;
import com.yxt.common.base.service.MybatisBaseService;
@ -29,4 +30,8 @@ public class LoanCaseProgressExecuteService extends MybatisBaseService<LoanCaseP
public LoanCaseProgressExecute selByMainSid(String sid) {
return baseMapper.selByMainSid(sid);
}
public LoanCaseExecuteApply selectByBusSid(String busSid) {
return baseMapper.selectByBusSid(busSid);
}
}

Loading…
Cancel
Save