|
|
@ -2,12 +2,8 @@ package com.yxt.anrui.riskcenter.biz.loanrepaymenthistory; |
|
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil; |
|
|
|
import cn.hutool.core.date.DateTime; |
|
|
|
import cn.hutool.core.math.Money; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.google.common.util.concurrent.ThreadFactoryBuilder; |
|
|
|
import com.yxt.anrui.base.api.basemodelmodprice.BaseModelModpriceImportReturn; |
|
|
|
import com.yxt.anrui.base.api.basemodelmodprice.BaseModelModpriceImportVo; |
|
|
|
import com.yxt.anrui.base.api.basepurchasesystem.BasePurchaseSystemDetailsVo; |
|
|
|
import com.yxt.anrui.base.api.basepurchasesystem.BasePurchaseSystemFeign; |
|
|
|
import com.yxt.anrui.buscenter.api.bussalesorder.BusSalesOrder; |
|
|
@ -16,10 +12,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.crm.api.crmcustomertemp.CrmCustomerTemp; |
|
|
|
import com.yxt.anrui.crm.api.crmcustomertemp.CrmCustomerTempExportVo; |
|
|
|
import com.yxt.anrui.fin.api.finmanufacturerbank.FinManufacturerBank; |
|
|
|
import com.yxt.anrui.fin.api.finpaymentrecord.FinPaymentrecordDto; |
|
|
|
import com.yxt.anrui.fin.api.finuncollectedreceivablesdetailedjr.FinUncollectedReceivablesDetailedJR; |
|
|
|
import com.yxt.anrui.fin.api.finuncollectedreceivablesdetailedjr.FinUncollectedReceivablesDetailedJRFeign; |
|
|
|
import com.yxt.anrui.fin.api.kingdee.FinKingDeeFeign; |
|
|
@ -28,31 +20,21 @@ import com.yxt.anrui.fin.api.kingdee.voucher.GeneralVoucher; |
|
|
|
import com.yxt.anrui.portal.api.sysorganization.SysOrganizationFeign; |
|
|
|
import com.yxt.anrui.portal.api.sysorganization.SysOrganizationVo; |
|
|
|
import com.yxt.anrui.portal.api.sysstafforg.SysStaffOrgFeign; |
|
|
|
import com.yxt.anrui.portal.api.sysstafforg.SysStaffOrgVo; |
|
|
|
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.loanbuckleapply.LoanBuckleApplyInit; |
|
|
|
import com.yxt.anrui.riskcenter.api.loanbuckleapply.LoanBuckleHistoryRecord; |
|
|
|
import com.yxt.anrui.riskcenter.api.loanfinbank.LoanFinBank; |
|
|
|
import com.yxt.anrui.riskcenter.api.loanmonthlyaccrualapply.LoanMonthlyAccrualApply; |
|
|
|
import com.yxt.anrui.riskcenter.api.loanmonthlyaccrualrecord.LoanMonthlyAccrualRecord; |
|
|
|
import com.yxt.anrui.riskcenter.api.loanparameter.LoanParameter; |
|
|
|
import com.yxt.anrui.riskcenter.api.loanparameter.LoanParameterQuery; |
|
|
|
import com.yxt.anrui.riskcenter.api.loanparameter.LoanParameterVo; |
|
|
|
import com.yxt.anrui.riskcenter.api.loanrepaymenthistory.*; |
|
|
|
import com.yxt.anrui.riskcenter.api.loanrepaymenthistory.export.PreTransferPaymentExportVo; |
|
|
|
import com.yxt.anrui.riskcenter.api.loanrepaymenthistory.export.RecordCountVo; |
|
|
|
import com.yxt.anrui.riskcenter.api.loanrepaymenthistory.export.RepaymentDetailsExportVo; |
|
|
|
import com.yxt.anrui.riskcenter.api.loanrepaymenthistory.export.TransferedPaymentExportVo; |
|
|
|
import com.yxt.anrui.riskcenter.api.loanrepaymenthistory.utils.CollectorsUtil; |
|
|
|
import com.yxt.anrui.riskcenter.api.loanrepaymentplandetails.CheckPayStateVo; |
|
|
|
import com.yxt.anrui.riskcenter.api.loanrepaymentplandetails.LoanPlanDetailsVoForLateVoucher; |
|
|
|
import com.yxt.anrui.riskcenter.api.loanrepaymentplandetails.LoanRepaymentPlanDetails; |
|
|
|
import com.yxt.anrui.riskcenter.api.loanrepaymentplandetails.LoanRepaymentPlanDetailsDto; |
|
|
|
import com.yxt.anrui.riskcenter.api.loanrepaymentschedule.AppRepaymentHistoryRecord; |
|
|
|
import com.yxt.anrui.riskcenter.api.loanrepaymentschedule.LoanRepaymentSchedule; |
|
|
|
import com.yxt.anrui.riskcenter.api.loantransferpaymentrecord.LoanTransferPaymentRecord; |
|
|
|
import com.yxt.anrui.riskcenter.biz.loanfinbank.LoanFinBankService; |
|
|
|
import com.yxt.anrui.riskcenter.biz.loanrepaymentplandetails.LoanRepaymentPlanDetailsService; |
|
|
|
import com.yxt.anrui.riskcenter.biz.loanrepaymentschedule.LoanRepaymentScheduleService; |
|
|
@ -61,7 +43,6 @@ 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 com.yxt.messagecenter.api.messageurgeList.MessageUrgeListVo; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.apache.poi.hssf.usermodel.HSSFWorkbook; |
|
|
|
import org.apache.poi.ss.usermodel.Cell; |
|
|
@ -85,11 +66,9 @@ import java.text.SimpleDateFormat; |
|
|
|
import java.time.LocalDate; |
|
|
|
import java.time.format.DateTimeFormatter; |
|
|
|
import java.util.*; |
|
|
|
import java.util.concurrent.*; |
|
|
|
import java.util.function.Predicate; |
|
|
|
import java.util.regex.Matcher; |
|
|
|
import java.util.regex.Pattern; |
|
|
|
import java.util.stream.Collector; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
|
|
@ -1501,6 +1480,108 @@ public class LoanRepaymentHistoryService extends MybatisBaseService<LoanRepaymen |
|
|
|
return p; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public List<RepaymentStatisticsVo> repaymentStatisticsList(RepaymentStatisticsQuery pagerQuery) { |
|
|
|
QueryWrapper<LoanRepaymentHistory> qw = new QueryWrapper<>(); |
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
|
|
|
//=======================
|
|
|
|
PrivilegeQuery privilegeQuery = new PrivilegeQuery(); |
|
|
|
privilegeQuery.setOrgPath(pagerQuery.getOrgPath()); |
|
|
|
privilegeQuery.setMenuSid(pagerQuery.getMenuSid()); |
|
|
|
privilegeQuery.setMenuUrl(pagerQuery.getMenuUrl()); |
|
|
|
privilegeQuery.setUserSid(pagerQuery.getUserSid()); |
|
|
|
ResultBean<String> defaultIdReltBean = sysUserFeign.selectPrivilegeLevel(privilegeQuery); |
|
|
|
if (StringUtils.isNotBlank(defaultIdReltBean.getData())) { |
|
|
|
//数据权限ID(1集团、2事业部、3分公司、4部门、5个人)
|
|
|
|
String orgSidPath = pagerQuery.getOrgPath(); |
|
|
|
orgSidPath = orgSidPath + "/"; |
|
|
|
System.out.println(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("a.orgSidPath", orgSidPath); |
|
|
|
} else if ("2".equals(orgLevelKey)) { |
|
|
|
orgSidPath = orgSidPath.substring(0, i2); |
|
|
|
qw.like("a.orgSidPath", orgSidPath); |
|
|
|
} else if ("3".equals(orgLevelKey)) { |
|
|
|
orgSidPath = orgSidPath.substring(0, i3); |
|
|
|
qw.like("a.orgSidPath", orgSidPath); |
|
|
|
} else if ("4".equals(orgLevelKey)) { |
|
|
|
orgSidPath = orgSidPath.substring(0, i4); |
|
|
|
qw.like("a.orgSidPath", orgSidPath); |
|
|
|
} else if ("5".equals(orgLevelKey)) { |
|
|
|
qw.eq("a.createBySid", pagerQuery.getUserSid()); |
|
|
|
} else { |
|
|
|
List<RepaymentStatisticsVo> p = new ArrayList<>(); |
|
|
|
return p; |
|
|
|
} |
|
|
|
} else { |
|
|
|
List<RepaymentStatisticsVo> p = new ArrayList<>(); |
|
|
|
return p; |
|
|
|
} |
|
|
|
//=======================
|
|
|
|
if (StringUtils.isNotBlank(pagerQuery.getUseOrgName())) { |
|
|
|
qw.like("a.useOrgName", pagerQuery.getUseOrgName()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(pagerQuery.getVinNo())) { |
|
|
|
qw.like("a.vinNo", pagerQuery.getVinNo()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(pagerQuery.getDept())) { |
|
|
|
qw.like("a.dept", pagerQuery.getDept()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(pagerQuery.getReturnState())) { |
|
|
|
qw.eq("a.returnState", pagerQuery.getReturnState()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(pagerQuery.getStaffName())) { |
|
|
|
qw.like("a.staffName", pagerQuery.getStaffName()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(pagerQuery.getLoanContractNo())) { |
|
|
|
qw.like("a.loanContractNo", pagerQuery.getLoanContractNo()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(pagerQuery.getPeriod())) { |
|
|
|
qw.eq("a.period", pagerQuery.getPeriod()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(pagerQuery.getBankName())) { |
|
|
|
qw.like("a.bankName", pagerQuery.getBankName()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(pagerQuery.getBankContractNo())) { |
|
|
|
qw.like("a.bankContractNo", pagerQuery.getBankContractNo()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(pagerQuery.getCustomer())) { |
|
|
|
qw.like("a.customer", pagerQuery.getCustomer()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(pagerQuery.getBorrowerName())) { |
|
|
|
qw.like("a.borrowerName", pagerQuery.getBorrowerName()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(pagerQuery.getDueOverdue())) { |
|
|
|
qw.eq("a.dueOverdue", pagerQuery.getDueOverdue()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(pagerQuery.getNowOverdue())) { |
|
|
|
qw.eq("a.nowOverdue", pagerQuery.getNowOverdue()); |
|
|
|
} |
|
|
|
String dueStartDate = pagerQuery.getDueStartDate(); |
|
|
|
String dueEndDate = pagerQuery.getDueEndDate(); |
|
|
|
qw.apply(StringUtils.isNotEmpty(dueStartDate), "date_format (a.dueDate,'%Y-%m-%d') >= date_format('" + dueStartDate + "','%Y-%m-%d')"). |
|
|
|
apply(StringUtils.isNotEmpty(dueEndDate), "date_format (a.dueDate,'%Y-%m-%d') <= date_format('" + dueEndDate + "','%Y-%m-%d')" |
|
|
|
); |
|
|
|
String updateStartDate = pagerQuery.getUpdateStartDate(); |
|
|
|
String updateEndDate = pagerQuery.getUpdateEndDate(); |
|
|
|
qw.apply(StringUtils.isNotEmpty(updateStartDate), "date_format (a.updateDate,'%Y-%m-%d') >= date_format('" + updateStartDate + "','%Y-%m-%d')"). |
|
|
|
apply(StringUtils.isNotEmpty(updateEndDate), "date_format (a.updateDate,'%Y-%m-%d') <= date_format('" + updateEndDate + "','%Y-%m-%d')" |
|
|
|
); |
|
|
|
qw.orderBy(true, true, "a.useOrgName") |
|
|
|
.orderBy(true, true, "a.vinNo") |
|
|
|
.orderBy(true, true, "a.period") |
|
|
|
.orderBy(true, true, "a.loanContractNo") |
|
|
|
; |
|
|
|
List<RepaymentStatisticsVo> p = baseMapper.repaymentStatisticsList(qw); |
|
|
|
return p; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 分页方法 |
|
|
|
*/ |
|
|
@ -2339,4 +2420,6 @@ public class LoanRepaymentHistoryService extends MybatisBaseService<LoanRepaymen |
|
|
|
public List<AppRepaymentHistoryRecord> selSchSidAndVinNo(String scheduleSid, String vinNo) { |
|
|
|
return baseMapper.selSchSidAndVinNo(scheduleSid, vinNo); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|