From 069988b494058ebdd5a9358bcc4bd54adaf40b66 Mon Sep 17 00:00:00 2001 From: ligaode Date: Tue, 20 May 2025 10:25:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../LoanCaseExecuteApplyService.java | 533 ------------------ 1 file changed, 533 deletions(-) diff --git a/anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loancaseexecuteapply/LoanCaseExecuteApplyService.java b/anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loancaseexecuteapply/LoanCaseExecuteApplyService.java index a38e711cb2..61cbdcf26f 100644 --- a/anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loancaseexecuteapply/LoanCaseExecuteApplyService.java +++ b/anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loancaseexecuteapply/LoanCaseExecuteApplyService.java @@ -41,7 +41,6 @@ import com.yxt.anrui.buscenter.api.bussalesorderborrower.BusSalesOrderBorrowerDe import com.yxt.anrui.buscenter.api.bussalesorderborrower.BusSalesOrderBorrowerFeign; import com.yxt.anrui.buscenter.api.bussalesordervehicle.BusSalesOrderVehicle; import com.yxt.anrui.buscenter.api.bussalesordervehicle.BusSalesOrderVehicleFeign; -import com.yxt.anrui.buscenter.api.bussalesordervehicle.BusVinStateSetQuery; import com.yxt.anrui.fin.api.kingdee.FinKingDeeFeign; import com.yxt.anrui.fin.api.kingdee.bdcustomer.BdCustomer; import com.yxt.anrui.fin.api.kingdee.voucher.Voucher; @@ -61,14 +60,8 @@ import com.yxt.anrui.portal.api.sysstafforg.SysStaffOrgFeign; import com.yxt.anrui.portal.api.sysuser.PrivilegeQuery; import com.yxt.anrui.portal.api.sysuser.SysUserFeign; import com.yxt.anrui.portal.api.sysuser.SysUserVo; -import com.yxt.anrui.riskcenter.api.loancaseappealapply.LoanCaseAppealApply; -import com.yxt.anrui.riskcenter.api.loancaseappealapply.LoanCaseAppealFile; -import com.yxt.anrui.riskcenter.api.loancaseappealapply.flowable.LoanCaseAppealApplyNodeVo; -import com.yxt.anrui.riskcenter.api.loancaseappealapply.flowable.SubmitLoanCaseAppealApplyDto; -import com.yxt.anrui.riskcenter.api.loancaseappealveh.LoanCaseAppealVehDetailsVo; import com.yxt.anrui.riskcenter.api.loancaseexecuteapply.*; import com.yxt.anrui.riskcenter.api.loancaseexecuteapply.flowable.*; -import com.yxt.anrui.riskcenter.api.loancaseexecuteveh.LoanCaseExecuteVeh; import com.yxt.anrui.riskcenter.api.loancaseexecuteveh.LoanCaseExecuteVehDetailsVo; import com.yxt.anrui.riskcenter.api.loancaseexecuteveh.LoanCaseExecuteVehDto; import com.yxt.anrui.riskcenter.api.loancaseprogress.LoanCaseProgress; @@ -76,7 +69,6 @@ import com.yxt.anrui.riskcenter.api.loancaseprogresstrial.LoanCaseProgressTrial; import com.yxt.anrui.riskcenter.api.loancaseprogressveh.LoanCaseProgressVeh; import com.yxt.anrui.riskcenter.api.loanfile.LoanFile; import com.yxt.anrui.riskcenter.api.loanfile.LoanFileEnum; -import com.yxt.anrui.riskcenter.api.loanoutboundapply.LoanOutboundApply; import com.yxt.anrui.riskcenter.api.loanrestorereportapply.AlrepaidAndArrVo; import com.yxt.anrui.riskcenter.biz.loancaseexecuteveh.LoanCaseExecuteVehService; import com.yxt.anrui.riskcenter.biz.loancaseprogress.LoanCaseProgressService; @@ -95,265 +87,16 @@ import com.yxt.common.base.utils.PagerUtil; import com.yxt.common.core.query.PagerQuery; import com.yxt.common.core.result.ResultBean; 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.util.*; import java.util.concurrent.*; import java.util.stream.Collectors; -/** - * Project: anrui-riskcenter(案件执行立案申请)
- * File: LoanCaseExecuteApplyService.java
- * Class: com.yxt.anrui.riskcenter.biz.loancaseexecuteapply.LoanCaseExecuteApplyService
- * Description: 案件执行立案申请 业务逻辑.
- * Copyright: Copyright (c) 2011
- * Company: https://gitee.com/liuzp315
- * Makedate: 2024-02-07 10:00:57
- * - * @author liupopo - * @version 1.0 - * @since 1.0 - */ @Service public class LoanCaseExecuteApplyService extends MybatisBaseService { - @Autowired - private SysUserFeign sysUserFeign; - @Autowired - private SysOrganizationFeign sysOrganizationFeign; - @Autowired - private SysStaffOrgFeign sysStaffOrgFeign; - @Autowired - private LoanCaseExecuteVehService loanCaseExecuteVehService; - @Autowired - private LoanCaseProgressService loanCaseProgressService; - @Autowired - private LoanCaseProgressTrialService loanCaseProgressTrialService; - @Autowired - private LoanCaseProgressVehService loanCaseProgressVehService; - @Autowired - private FileUploadComponent fileUploadComponent; - @Autowired - private LoanFileService loanFileService; - @Autowired - private FlowableFeign flowableFeign; - @Autowired - private MessageFeign messageFeign; - @Autowired - private FlowTaskFeign flowTaskFeign; - @Autowired - private FlowFeign flowFeign; - @Autowired - private BusSalesOrderVehicleFeign busSalesOrderVehicleFeign; - @Autowired - private BusSalesOrderFeign busSalesOrderFeign; - @Autowired - private FinKingDeeFeign finKingDeeFeign; - @Autowired - private BusSalesOrderBorrowerFeign busSalesOrderBorrowerFeign; - @Autowired - private BasePurchaseSystemFeign basePurchaseSystemFeign; - @Autowired - private LoanRestoreReportApplyService loanRestoreReportApplyService; - @Autowired - private LoanRepaymentPlanDetailsService loanRepaymentPlanDetailsService; - - public PagerVo listPageVo(PagerQuery pq) { - LoanCaseExecuteApplyQuery query = pq.getParams(); - QueryWrapper qw = new QueryWrapper<>(); - //========================================数据授权开始 - if (StringUtils.isNotBlank(query.getMenuUrl())) { - PrivilegeQuery privilegeQuery = new PrivilegeQuery(); - privilegeQuery.setOrgPath(query.getOrgPath()); - privilegeQuery.setMenuUrl(query.getMenuUrl()); - privilegeQuery.setMenuSid(query.getMenuSid()); - privilegeQuery.setUserSid(query.getUserSid()); - ResultBean defaultIdReltBean = sysUserFeign.selectPrivilegeLevel(privilegeQuery); - if (StringUtils.isNotBlank(defaultIdReltBean.getData())) { - //数据权限ID(1集团、2事业部、3分公司、4部门、5个人) - String orgSidPath = query.getOrgPath(); - orgSidPath = orgSidPath + "/"; - int i1 = orgSidPath.indexOf("/"); - int i2 = orgSidPath.indexOf("/", i1 + 1); - int i3 = orgSidPath.indexOf("/", i2 + 1); - int i4 = orgSidPath.indexOf("/", i3 + 1); - String orgLevelKey = defaultIdReltBean.getData(); - if ("1".equals(orgLevelKey)) { - orgSidPath = orgSidPath.substring(0, i1); - qw.like("orgPath", orgSidPath); - } else if ("2".equals(orgLevelKey)) { - orgSidPath = orgSidPath.substring(0, i2); - qw.like("orgPath", orgSidPath); - } else if ("3".equals(orgLevelKey)) { - orgSidPath = orgSidPath.substring(0, i3); - qw.like("orgPath", orgSidPath); - } else if ("4".equals(orgLevelKey)) { - orgSidPath = orgSidPath.substring(0, i4); - qw.like("orgPath", orgSidPath); - } else if ("5".equals(orgLevelKey)) { - qw.eq("createBySid", query.getUserSid()); - } else { - PagerVo p = new PagerVo<>(); - return p; - } - } else { - PagerVo p = new PagerVo<>(); - return p; - } - } - if (StringUtils.isNotBlank(query.getUseOrgName())) { - qw.like("useOrgName", query.getUseOrgName()); - } - if (StringUtils.isNotBlank(query.getDeptName())) { - qw.like("deptName", query.getDeptName()); - } - if (StringUtils.isNotBlank(query.getCreateByName())) { - qw.like("createByName", query.getCreateByName()); - } - qw.apply(StringUtils.isNotBlank(query.getCreateStartTime()), "date_format (createTime,'%Y-%m-%d') >= date_format('" + query.getCreateStartTime() + "','%Y-%m-%d')"). - apply(StringUtils.isNotBlank(query.getCreateEndTime()), "date_format (createTime,'%Y-%m-%d') <= date_format('" + query.getCreateEndTime() + "','%Y-%m-%d')" - ); - if (StringUtils.isNotBlank(query.getModifyStartTime()) && StringUtils.isNotBlank(query.getModifyEndTime())) { - qw.and(wrapper -> wrapper.eq("nodeState", "终止").or().eq("nodeState", "已办结")); - } - qw.apply(StringUtils.isNotBlank(query.getModifyStartTime()), "date_format (modifyTime,'%Y-%m-%d') >= date_format('" + query.getModifyStartTime() + "','%Y-%m-%d')"). - apply(StringUtils.isNotBlank(query.getModifyEndTime()), "date_format (modifyTime,'%Y-%m-%d') <= date_format('" + query.getModifyEndTime() + "','%Y-%m-%d')" - ); - if (StringUtils.isNotBlank(query.getLoanContract())){ - qw.like("loanContract",query.getLoanContract()); - } - if (StringUtils.isNotBlank(query.getCustomName())){ - qw.like("customName",query.getCustomName()); - } - if (StringUtils.isNotBlank(query.getLenderName())){ - qw.like("lenderName",query.getLenderName()); - } - if (StringUtils.isNotBlank(query.getExecuteDeadline())){ - qw.like("executeDeadline",query.getExecuteDeadline()); - } - if (StringUtils.isNotBlank(query.getExecuteRegisMoney())){ - qw.like("executeRegisMoney",query.getExecuteRegisMoney()); - } - qw.apply(StringUtils.isNotBlank(query.getExecuteRegisStartDate()), "date_format (executeRegisDate,'%Y-%m-%d') >= date_format('" + query.getExecuteRegisStartDate() + "','%Y-%m-%d')"). - apply(StringUtils.isNotBlank(query.getExecuteRegisEndDate()), "date_format (executeRegisDate,'%Y-%m-%d') <= date_format('" + query.getExecuteRegisEndDate() + "','%Y-%m-%d')" - ); - qw.orderByDesc("createTime"); - IPage page = PagerUtil.queryToPage(pq); - IPage pagging = baseMapper.selectPageVo(page, qw); - for (LoanCaseExecuteApplyVo record : pagging.getRecords()) { - if ("终止".equals(record.getNodeState()) || "已办结".equals(record.getNodeState())) { - DateTime modifyTime = DateUtil.parse(record.getModifyTime()); - record.setModifyTime(DateUtil.formatDate(modifyTime)); - } else { - record.setModifyTime(""); - } - } - PagerVo p = PagerUtil.pageToVo(pagging, null); - return p; - } - - public String saveOrUpdateDto(LoanCaseExecuteApplyDto dto){ - String dtoSid = dto.getSid(); - List pjclFiles = dto.getPjclFiles(); - List zxclFiles = dto.getZxclFiles(); - List loanCaseExecuteVehList = dto.getLoanCaseExecuteVehList(); - if (StringUtils.isBlank(dtoSid)) { - //生成单据编号 - String billNo = ""; - String date = DateUtil.format(DateUtil.date(), "yyyyMM"); - SysOrganizationVo sysOrganizationVo = sysOrganizationFeign.fetchBySid(dto.getUseOrgSid()).getData(); - billNo = "AJZXLA" + sysOrganizationVo.getOrgCode() + date; - String i = baseMapper.selectNum(billNo); - if (StringUtils.isNotBlank(i)) { - billNo = Rule.getBillNo(billNo, Integer.valueOf(i).intValue()); - } else { - billNo = Rule.getBillNo(billNo, 0); - } - dto.setBillNo(billNo); - String sid = this.insertByDto(dto); - for (LoanCaseExecuteVehDto loanCaseExecuteVehDto : loanCaseExecuteVehList) { - loanCaseExecuteVehDto.setMainSid(sid); - loanCaseExecuteVehService.saveOrUpdateDto(loanCaseExecuteVehDto); - } - if (pjclFiles != null && pjclFiles.size() > 0) { - for (LoanCaseExecuteFile file : pjclFiles) { - LoanFile loanFile = new LoanFile(); - loanFile.setLinkSid(sid); - loanFile.setAttachType(LoanFileEnum.AJZXLA_JUDGMENT.getAttachType()); - String filePath = file.getUrl(); - if (filePath.indexOf(fileUploadComponent.getUrlPrefix()) > -1) { - filePath = filePath.replace(fileUploadComponent.getUrlPrefix(), ""); - } - loanFile.setFilePath(filePath); - loanFileService.save(loanFile); - } - } - if (zxclFiles != null && zxclFiles.size() > 0) { - for (LoanCaseExecuteFile file : zxclFiles) { - LoanFile loanFile = new LoanFile(); - loanFile.setLinkSid(sid); - loanFile.setAttachType(LoanFileEnum.EXECUTE.getAttachType()); - String filePath = file.getUrl(); - if (filePath.indexOf(fileUploadComponent.getUrlPrefix()) > -1) { - filePath = filePath.replace(fileUploadComponent.getUrlPrefix(), ""); - } - loanFile.setFilePath(filePath); - loanFileService.save(loanFile); - } - } - return sid; - } - this.updateByDto(dto); - loanCaseExecuteVehService.delByMainSid(dtoSid); - for (LoanCaseExecuteVehDto loanCaseExecuteVehDto : loanCaseExecuteVehList) { - loanCaseExecuteVehDto.setSid(""); - loanCaseExecuteVehDto.setMainSid(dtoSid); - loanCaseExecuteVehService.saveOrUpdateDto(loanCaseExecuteVehDto); - } - loanFileService.delByLinkSidOrType(dtoSid, LoanFileEnum.AJZXLA_JUDGMENT.getAttachType()); - if (pjclFiles != null && pjclFiles.size() > 0) { - for (LoanCaseExecuteFile file : pjclFiles) { - LoanFile loanFile = new LoanFile(); - loanFile.setLinkSid(dtoSid); - loanFile.setAttachType(LoanFileEnum.AJZXLA_JUDGMENT.getAttachType()); - String filePath = file.getUrl(); - if (filePath.indexOf(fileUploadComponent.getUrlPrefix()) > -1) { - filePath = filePath.replace(fileUploadComponent.getUrlPrefix(), ""); - } - loanFile.setFilePath(filePath); - loanFileService.save(loanFile); - } - } - loanFileService.delByLinkSidOrType(dtoSid, LoanFileEnum.EXECUTE.getAttachType()); - if (zxclFiles != null && zxclFiles.size() > 0) { - for (LoanCaseExecuteFile file : zxclFiles) { - LoanFile loanFile = new LoanFile(); - loanFile.setLinkSid(dtoSid); - loanFile.setAttachType(LoanFileEnum.EXECUTE.getAttachType()); - String filePath = file.getUrl(); - if (filePath.indexOf(fileUploadComponent.getUrlPrefix()) > -1) { - filePath = filePath.replace(fileUploadComponent.getUrlPrefix(), ""); - } - loanFile.setFilePath(filePath); - loanFileService.save(loanFile); - } - } - return dtoSid; - } - - public String insertByDto(LoanCaseExecuteApplyDto dto){ - LoanCaseExecuteApply entity = new LoanCaseExecuteApply(); - BeanUtil.copyProperties(dto, entity, "id", "sid"); - entity.setNodeState("待提交"); - baseMapper.insert(entity); - return entity.getSid(); - } - - public void updateByDto(LoanCaseExecuteApplyDto dto){ - String dtoSid = dto.getSid(); @Autowired private SysUserFeign sysUserFeign; @Autowired @@ -630,46 +373,6 @@ public class LoanCaseExecuteApplyService extends MybatisBaseService loanCaseExecuteVehDetailsVoList = loanCaseExecuteVehService.selByMainSid(sid); - vo.setLoanCaseExecuteVehList(loanCaseExecuteVehDetailsVoList); - List pjcl = loanFileService.selectByLinkSid(sid, LoanFileEnum.AJZXLA_JUDGMENT.getAttachType()); - List pjclFiles = new ArrayList<>(); - if (pjcl != null && pjcl.size() > 0) { - for (LoanFile loanFile : pjcl) { - LoanCaseExecuteFile loanCaseExecuteFile = new LoanCaseExecuteFile(); - String filePath = loanFile.getFilePath(); - String urlPrefix = fileUploadComponent.getUrlPrefix(); - filePath = urlPrefix + filePath; - loanCaseExecuteFile.setUrl(filePath); - pjclFiles.add(loanCaseExecuteFile); - } - } - vo.setPjclFiles(pjclFiles); - List zxcl = loanFileService.selectByLinkSid(sid, LoanFileEnum.ANSWERRELATE.getAttachType()); - List zxclFiles = new ArrayList<>(); - if (zxcl != null && zxcl.size() > 0) { - for (LoanFile loanFile : zxcl) { - LoanCaseExecuteFile loanCaseExecuteFile = new LoanCaseExecuteFile(); - String filePath = loanFile.getFilePath(); - String urlPrefix = fileUploadComponent.getUrlPrefix(); - filePath = urlPrefix + filePath; - loanCaseExecuteFile.setUrl(filePath); - zxclFiles.add(loanCaseExecuteFile); - } - } - vo.setZxclFiles(zxclFiles); - return vo; - } public ResultBean delAll(String[] sids) { ResultBean rb = ResultBean.fireFail(); @@ -838,77 +541,6 @@ public class LoanCaseExecuteApplyService extends MybatisBaseService variables = new HashMap<>(); - Map appMap = new HashMap<>(); - appMap.put("sid", businessSid); - variables.put("app", appMap); - FlowProcessMapQuery flowProcessMapQuery = new FlowProcessMapQuery(); - if (StringUtils.isBlank(loanCaseExecuteApply.getProcDefId())) { - flowProcessMapQuery.setProDefKey(bv.getModelId()); - } else { - flowProcessMapQuery.setProDefKey(loanCaseExecuteApply.getProcDefId()); - } - flowProcessMapQuery.setVariables(variables); - variables = flowableFeign.getMap(flowProcessMapQuery).getData(); - //======================================= - bv.setFormVariables(variables); - bv.setOrgSidPath(loanCaseExecuteApply.getOrgPath()); - if (bv.getTaskId().equals(loanCaseExecuteApply.getTaskId())) { - ResultBean resultBean = flowFeign.handleProsess(bv); - if (!resultBean.getSuccess()) { - return rb.setMsg(resultBean.getMsg()); - } - UpdateFlowFieldVo ufVo = resultBean.getData(); - updateFlowFiled(BeanUtil.beanToMap(resultBean.getData())); - if ("Event_end".equals(resultBean.getData().getTaskDefKey())) { - try { - ThreadFactory namedThreadFactory = new ThreadFactoryBuilder() - .setNameFormat("demo-pool-%d").build(); - ExecutorService pool = new org.apache.tomcat.util.threads.ThreadPoolExecutor(2, 100, - 0L, TimeUnit.MILLISECONDS, - new LinkedBlockingQueue(1024), namedThreadFactory, new org.apache.tomcat.util.threads.ThreadPoolExecutor.AbortPolicy()); - LoanCaseExecuteApply finalLoanCaseExecuteApply = loanCaseExecuteApply; - Future future1 = pool.submit(() -> { - //推送财务凭证 - //TOdO: - pushRiskToFin(bv.getBusinessSid()); - //修改风控状态为执行 - //--更新销售订单车辆表的风控状态为执行 - List busVinSidList = loanCaseProgressVehService.selectByMainSid(finalLoanCaseExecuteApply.getBusSid()); - BusVinStateSetQuery busVinStateSetQuery = new BusVinStateSetQuery(); - busVinStateSetQuery.setState(12); - busVinStateSetQuery.setBusVinSidList(busVinSidList); - ResultBean resultBean1 = busSalesOrderVehicleFeign.setRiskState(busVinStateSetQuery); - }); - } catch (Exception e) { - e.printStackTrace(); - } - - } else { - //极光推送 - loanCaseExecuteApply = fetchBySid(businessSid); - MessageFlowableQuery messageFlowableQuery = new MessageFlowableQuery(); - MessageFlowVo messageFlowVo = new MessageFlowVo(); - BeanUtil.copyProperties(ufVo, messageFlowVo); - ufVo.setProcDefId(loanCaseExecuteApply.getProcDefId()); - ufVo.setProcInsId(loanCaseExecuteApply.getProcInstSid()); - messageFlowableQuery.setUfVo(messageFlowVo); - messageFlowableQuery.setAppMap(appMap); - messageFlowableQuery.setBusinessSid(businessSid); - messageFlowableQuery.setModuleName("案件执行立案申请"); - messageFlowableQuery.setMsgContent(loanCaseExecuteApply.getCreateByName() + "提交的" + messageFlowableQuery.getModuleName() + ",请审批"); - messageFlowableQuery.setMsgTitle("案件执行立案申请"); - messageFeign.pushMessage(messageFlowableQuery); - } - return rb.success().setData(resultBean.getData()); - } else { - return rb.setMsg("操作失败!提交的数据不一致"); - } - } public void pushRiskToFin(String sid) { LoanCaseExecuteApply loanCaseExecuteApply = fetchBySid(sid); @@ -975,157 +607,6 @@ public class LoanCaseExecuteApplyService extends MybatisBaseService voucherResultDetailDtos = new ArrayList<>(); - List voucherResultDetailDtos2 = new ArrayList<>(); - SysOrganizationVo deptVo = sysOrganizationFeign.fetchBySid(loanCaseExecuteApply.getDeptSid()).getData(); - List busVinSidList = loanCaseProgressVehService.selectByMainSid(loanCaseExecuteApply.getBusSid()); - for (int i = 0; i < busVinSidList.size(); i++) { - String busVinSid = busVinSidList.get(i); - BusSalesOrderVehicle busSalesOrderVehicle = busSalesOrderVehicleFeign.details(busVinSid).getData(); - String customerNumber = ""; - BusSalesOrder salesOrder = busSalesOrderFeign.fetchBySid(busSalesOrderVehicle.getSalesOrderSid()).getData(); - if (salesOrder != null && busSalesOrderVehicle != null) { - //判断财务系统是否有客户 - Boolean aBoolean = finKingDeeFeign.customerExistState(busSalesOrderVehicle.getTemporaryNo()).getData(); - String linkNo = ""; - BusSalesOrderBorrowerDetailsVo borrowerDetailsVo = busSalesOrderBorrowerFeign.fetchDetailsBySid(busSalesOrderVehicle.getBorrowerSid()).getData(); - if (!aBoolean) { - BdCustomer bdCustomer = new BdCustomer(); - bdCustomer.setFNumber(busSalesOrderVehicle.getTemporaryNo()); - bdCustomer.setFShortName(salesOrder.getContractNo()); - if (StringUtils.isNotBlank(salesOrder.getPurchaseSystemSid())) { - BasePurchaseSystemDetailsVo data = basePurchaseSystemFeign.fetchDetailsByDeptSid(salesOrder.getPurchaseSystemSid()).getData(); - bdCustomer.setTOrgIds(data.getOrgCode()); - } - bdCustomer.setTOrgIds(deptVo.getOrgCode()); - if (org.apache.commons.lang3.StringUtils.isNotBlank(busSalesOrderVehicle.getLinkNo())) { - String vinNo = busSalesOrderVehicle.getLinkNo(); - if (vinNo.length() > 8) { - linkNo = vinNo.substring(vinNo.length() - 8); - } else { - linkNo = busSalesOrderVehicle.getLinkNo(); - } - if (null != borrowerDetailsVo) { - bdCustomer.setFName(borrowerDetailsVo.getBorrowerName() + linkNo); - } - } else { - if (null != borrowerDetailsVo) { - bdCustomer.setFName(borrowerDetailsVo.getBorrowerName() + busSalesOrderVehicle.getTemporaryNo()); - } - } - // bdCustomers.add(bdCustomer); - ResultBean resultBean = finKingDeeFeign.draftBdCustomer(bdCustomer); - if (resultBean.getSuccess()) { - customerNumber = bdCustomer.getFNumber(); - } - } else { - customerNumber = busSalesOrderVehicle.getTemporaryNo(); - } - } - AlrepaidAndArrVo alrepaidAndArrVo = loanRestoreReportApplyService.getAlrepaidAndArr2(busVinSid); - //应收贷款车欠款_待处理欠款_处置车辆_已诉讼-当前欠款合计--不含资金占用费 - BigDecimal all = BigDecimal.ZERO; - //预申请坏账金额 - BigDecimal ysqhz = BigDecimal.ZERO; - //其中执行欠款金额 - BigDecimal qzzxqk = BigDecimal.ZERO; - 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); - - if("11".equals(busSalesOrderVehicle.getRiskState().toString())){//亏损立案---二次销售后的诉讼后的执行 - //-------------------------------------------应收贷款车欠款_待处理欠款_处置车辆_已诉讼-当前欠款合计 - if (all.compareTo(BigDecimal.ZERO) > 0) { - //贷方 - Voucher.VoucherResultDetailDto voucherResultDetailDtoDf = new Voucher.VoucherResultDetailDto(); - voucherResultDetailDtoDf.setSummary(customerNumber+"转执行"); - voucherResultDetailDtoDf.setSubjectNo("1201.03.04.02"); - //核算部门 - voucherResultDetailDtoDf.setDimensionDept(deptVo.getOrgCode()); - //核算客户 - voucherResultDetailDtoDf.setDimensionCustom(customerNumber); - voucherResultDetailDtoDf.setCredit(all.toString()); - voucherResultDetailDtos.add(voucherResultDetailDtoDf); - } - //---------------------------------------------待处理财产损溢 风险准备金(输入)-预申请坏账金额 - if (ysqhz.compareTo(BigDecimal.ZERO) > 0) { - //借方 - Voucher.VoucherResultDetailDto voucherResultDetailDtoJf = new Voucher.VoucherResultDetailDto(); - voucherResultDetailDtoJf.setSummary(customerNumber+"转执行"); - voucherResultDetailDtoJf.setSubjectNo("1911.05"); - //核算部门 - voucherResultDetailDtoJf.setDimensionDept(deptVo.getOrgCode()); - //核算客户 - voucherResultDetailDtoJf.setDimensionCustom(customerNumber); - voucherResultDetailDtoJf.setDebit(ysqhz.toString()); - voucherResultDetailDtos.add(voucherResultDetailDtoJf); - } - //--------------------------------------------应收贷款车欠款_待处理欠款_待执行-其中执行欠款金额 - if (qzzxqk.compareTo(BigDecimal.ZERO) > 0) { - Voucher.VoucherResultDetailDto voucherResultDetailDtoJf2 = new Voucher.VoucherResultDetailDto(); - voucherResultDetailDtoJf2.setSummary(customerNumber+"转执行"); - voucherResultDetailDtoJf2.setSubjectNo("1201.03.05"); - //核算部门 - voucherResultDetailDtoJf2.setDimensionDept(deptVo.getOrgCode()); - //核算客户 - voucherResultDetailDtoJf2.setDimensionCustom(customerNumber); - voucherResultDetailDtoJf2.setDebit(qzzxqk.toString()); - voucherResultDetailDtos.add(voucherResultDetailDtoJf2); - } - } - if("9".equals(busSalesOrderVehicle.getRiskState().toString()) || "10".equals(busSalesOrderVehicle.getRiskState().toString())){ - //未交回立案-交回立案后的执行 - //-------------------------------------------应收贷款车欠款_待处理欠款_诉讼车辆 - if (all.compareTo(BigDecimal.ZERO) > 0) { - //贷方 - Voucher.VoucherResultDetailDto voucherResultDetailDtoDf = new Voucher.VoucherResultDetailDto(); - voucherResultDetailDtoDf.setSummary(customerNumber+"转执行"); - voucherResultDetailDtoDf.setSubjectNo("1201.03.03"); - //核算部门 - voucherResultDetailDtoDf.setDimensionDept(deptVo.getOrgCode()); - //核算客户 - voucherResultDetailDtoDf.setDimensionCustom(customerNumber); - voucherResultDetailDtoDf.setCredit(all.toString()); - voucherResultDetailDtos2.add(voucherResultDetailDtoDf); - } - //---------------------------------------------待处理财产损溢 风险准备金(输入)-预申请坏账金额 - if (ysqhz.compareTo(BigDecimal.ZERO) > 0) { - //借方 - Voucher.VoucherResultDetailDto voucherResultDetailDtoJf = new Voucher.VoucherResultDetailDto(); - voucherResultDetailDtoJf.setSummary(customerNumber+"转执行"); - voucherResultDetailDtoJf.setSubjectNo("1911.05"); - //核算部门 - voucherResultDetailDtoJf.setDimensionDept(deptVo.getOrgCode()); - //核算客户 - voucherResultDetailDtoJf.setDimensionCustom(customerNumber); - voucherResultDetailDtoJf.setDebit(ysqhz.toString()); - voucherResultDetailDtos2.add(voucherResultDetailDtoJf); - } - //--------------------------------------------应收贷款车欠款_待处理欠款_待执行-其中执行欠款金额 - if (qzzxqk.compareTo(BigDecimal.ZERO) > 0) { - Voucher.VoucherResultDetailDto voucherResultDetailDtoJf2 = new Voucher.VoucherResultDetailDto(); - voucherResultDetailDtoJf2.setSummary(customerNumber+"转执行"); - voucherResultDetailDtoJf2.setSubjectNo("1201.03.05"); - //核算部门 - voucherResultDetailDtoJf2.setDimensionDept(deptVo.getOrgCode()); - //核算客户 - voucherResultDetailDtoJf2.setDimensionCustom(customerNumber); - voucherResultDetailDtoJf2.setDebit(qzzxqk.toString()); - voucherResultDetailDtos2.add(voucherResultDetailDtoJf2); - } - - } - } - //贷方 Voucher.VoucherResultDetailDto voucherResultDetailDtoDf = new Voucher.VoucherResultDetailDto(); //借方 @@ -1173,16 +654,6 @@ public class LoanCaseExecuteApplyService extends MybatisBaseService loanCaseExecuteVehDetailsVos = new ArrayList<>(); - BigDecimal amountInArear = new BigDecimal("0"); List loanCaseProgressVehs = loanCaseProgressVehService.selByMainSid(sid); for (LoanCaseProgressVeh loanCaseProgressVeh : loanCaseProgressVehs) { LoanCaseExecuteVehDetailsVo loanCaseExecuteVehDetailsVo = new LoanCaseExecuteVehDetailsVo(); @@ -1412,10 +882,7 @@ public class LoanCaseExecuteApplyService extends MybatisBaseService