|
|
@ -28,6 +28,7 @@ import com.yxt.anrui.riskcenter.api.loanmortgageinformationtransact.*; |
|
|
|
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.loanwarrantinformation.LoanWarrantDto; |
|
|
|
import com.yxt.anrui.riskcenter.api.loanwarrantinformation.LoanWarrantInformation; |
|
|
|
import com.yxt.anrui.riskcenter.biz.loanfile.LoanFileService; |
|
|
|
import com.yxt.anrui.riskcenter.biz.loanwarrantinformation.LoanWarrantInformationService; |
|
|
@ -476,6 +477,17 @@ public class LoanMortgageInformationTransactService extends MybatisBaseService<L |
|
|
|
qw.eq("isDelete", 0); |
|
|
|
qw.orderByDesc("createTime"); |
|
|
|
IPage<LoanMortgageInformationTransactVo> pagging = baseMapper.newlistPage(page, qw); |
|
|
|
List<LoanMortgageInformationTransactVo> records = pagging.getRecords(); |
|
|
|
records.removeAll(Collections.singleton(null)); |
|
|
|
if (!records.isEmpty()) { |
|
|
|
for (LoanMortgageInformationTransactVo record : records) { |
|
|
|
if (pagerQuery.getType().equals("1")) { |
|
|
|
record.setShowHandleBtn(true); |
|
|
|
} else if (pagerQuery.getType().equals("2")) { |
|
|
|
record.setShowHandleBtn(false); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
PagerVo<LoanMortgageInformationTransactVo> p = PagerUtil.pageToVo(pagging, null); |
|
|
|
return p; |
|
|
|
} |
|
|
@ -495,7 +507,6 @@ public class LoanMortgageInformationTransactService extends MybatisBaseService<L |
|
|
|
if (null != entity) { |
|
|
|
if (null != dto.getMortgageDate()) { |
|
|
|
entity.setMortgageDate(dto.getMortgageDate()); |
|
|
|
entity.setState(0); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(dto.getRemarks())) { |
|
|
|
entity.setRemarks(dto.getRemarks()); |
|
|
@ -557,141 +568,89 @@ public class LoanMortgageInformationTransactService extends MybatisBaseService<L |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
ResultBean resultBean = saveMortgageInfo(dto); |
|
|
|
if (resultBean.getSuccess()) { |
|
|
|
baseVehicleStateFeign.updateBusStateByBusSid(dto.getBusVinSid(), "308"); |
|
|
|
LoanMortgageInformationTransact loanMortgageInformationTransact = baseMapper.fetchByBusVinSid(dto.getBusVinSid()); |
|
|
|
LoanWarrantInformation warrantInformation = new LoanWarrantInformation(); |
|
|
|
warrantInformation.setBusVinSid(dto.getBusVinSid()); |
|
|
|
warrantInformation.setAuditStateKey("001"); |
|
|
|
warrantInformation.setAuditStateValue("待审核"); |
|
|
|
warrantInformation.setRemarks(loanMortgageInformationTransact.getRemarks()); |
|
|
|
//根据业务车辆sid查询 销售订单业务车辆表
|
|
|
|
BusSalesOrderVehicle orderVehicle = busSalesOrderVehicleFeign.details(dto.getBusVinSid()).getData(); |
|
|
|
if (null != orderVehicle) { |
|
|
|
if (StringUtils.isNotBlank(orderVehicle.getLinkNo())) { |
|
|
|
warrantInformation.setVinNo(orderVehicle.getLinkNo()); |
|
|
|
// baseVehicleStateFeign.updateBusStateByBusSid(dto.getBusVinSid(), "308");
|
|
|
|
LoanMortgageInformationTransact entity = baseMapper.fetchByBusVinSid(dto.getBusVinSid()); |
|
|
|
if (null != entity) { |
|
|
|
entity.setState(0); |
|
|
|
baseMapper.updateById(entity); |
|
|
|
LoanWarrantDto loanWarrantDto = new LoanWarrantDto(); |
|
|
|
if (StringUtils.isNotBlank(entity.getVinNo())) { |
|
|
|
loanWarrantDto.setVinNo(entity.getVinNo()); |
|
|
|
} |
|
|
|
String salesOrderSid = orderVehicle.getSalesOrderSid(); |
|
|
|
warrantInformation.setSalesOrderSid(salesOrderSid); |
|
|
|
BusSalesOrder salesOrder = busSalesOrderFeign.fetchBySid(salesOrderSid).getData(); |
|
|
|
if (null != salesOrder) { |
|
|
|
//组织全路径
|
|
|
|
if (StringUtils.isNotBlank(salesOrder.getOrgSidPath())) { |
|
|
|
warrantInformation.setOrgSidPath(salesOrder.getOrgSidPath()); |
|
|
|
ResultBean<String> orgSidByPath = sysStaffOrgFeign.getOrgSidByPath(salesOrder.getOrgSidPath()); |
|
|
|
if (orgSidByPath.getSuccess()) { |
|
|
|
String userOrgSid = orgSidByPath.getData(); |
|
|
|
warrantInformation.setUseOrgSid(userOrgSid); |
|
|
|
ResultBean<SysOrganizationVo> organizationVo = sysOrganizationFeign.fetchBySid(userOrgSid); |
|
|
|
if (organizationVo.getSuccess()) { |
|
|
|
SysOrganizationVo organizationVoData = organizationVo.getData(); |
|
|
|
if (null != organizationVoData) { |
|
|
|
warrantInformation.setUseOrgName(organizationVoData.getName()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
//创建人sid
|
|
|
|
if (StringUtils.isNotBlank(salesOrder.getCreateBySid())) { |
|
|
|
warrantInformation.setCreateBySid(salesOrder.getCreateBySid()); |
|
|
|
} |
|
|
|
//销售部门
|
|
|
|
if (StringUtils.isNotBlank(salesOrder.getOrgName())) { |
|
|
|
warrantInformation.setDepartment(salesOrder.getOrgName()); |
|
|
|
} |
|
|
|
//销售专员
|
|
|
|
if (StringUtils.isNotBlank(salesOrder.getStaffName())) { |
|
|
|
warrantInformation.setSalesman(salesOrder.getStaffName()); |
|
|
|
} |
|
|
|
//根据销售订单sid查询消贷合同表
|
|
|
|
BusSalesOrderLoancontract loancontract = busSalesOrderLoancontractFeign.fetchDetailsByOrderSid(salesOrderSid).getData(); |
|
|
|
if (null != loancontract) { |
|
|
|
//消贷合同编号
|
|
|
|
if (StringUtils.isNotBlank(loancontract.getLoanContractNo())) { |
|
|
|
warrantInformation.setContractNo(loancontract.getLoanContractNo()); |
|
|
|
} |
|
|
|
//贷款人
|
|
|
|
if (StringUtils.isNotBlank(loancontract.getBorrowerName())) { |
|
|
|
warrantInformation.setBorrowerName(loancontract.getBorrowerName()); |
|
|
|
} |
|
|
|
//资方
|
|
|
|
if (StringUtils.isNotBlank(loancontract.getBankName())) { |
|
|
|
warrantInformation.setBankName(loancontract.getBankName()); |
|
|
|
} |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(entity.getSalesOrderSid())) { |
|
|
|
loanWarrantDto.setSalesOrderSid(entity.getSalesOrderSid()); |
|
|
|
} |
|
|
|
//组织全路径
|
|
|
|
if (StringUtils.isNotBlank(entity.getOrgSidPath())) { |
|
|
|
loanWarrantDto.setOrgSidPath(entity.getOrgSidPath()); |
|
|
|
} |
|
|
|
//创建人sid
|
|
|
|
if (StringUtils.isNotBlank(entity.getCreateBySid())) { |
|
|
|
loanWarrantDto.setCreateBySid(entity.getCreateBySid()); |
|
|
|
} |
|
|
|
//销售部门
|
|
|
|
if (StringUtils.isNotBlank(entity.getDept())) { |
|
|
|
loanWarrantDto.setDepartment(entity.getDept()); |
|
|
|
} |
|
|
|
//销售专员
|
|
|
|
if (StringUtils.isNotBlank(entity.getStaff())) { |
|
|
|
loanWarrantDto.setSalesman(entity.getStaff()); |
|
|
|
} |
|
|
|
//消贷合同编号
|
|
|
|
if (StringUtils.isNotBlank(entity.getLoanContractNo())) { |
|
|
|
loanWarrantDto.setContractNo(entity.getLoanContractNo()); |
|
|
|
} |
|
|
|
//贷款人
|
|
|
|
if (StringUtils.isNotBlank(entity.getBorrowerName())) { |
|
|
|
loanWarrantDto.setBorrowerName(entity.getBorrowerName()); |
|
|
|
} |
|
|
|
//资方
|
|
|
|
if (StringUtils.isNotBlank(entity.getBankName())) { |
|
|
|
loanWarrantDto.setBankName(entity.getBankName()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(entity.getBusVinSid())) { |
|
|
|
loanWarrantDto.setBusVinSid(entity.getBusVinSid()); |
|
|
|
} |
|
|
|
loanWarrantDto.setAuditStateKey("001"); |
|
|
|
loanWarrantDto.setAuditStateValue("待审核"); |
|
|
|
loanWarrantInformationService.saveWarrant(loanWarrantDto); |
|
|
|
} |
|
|
|
loanWarrantInformationService.insert(warrantInformation); |
|
|
|
} |
|
|
|
return rb.success().setData(dto.getBusVinSid()); |
|
|
|
} |
|
|
|
|
|
|
|
public ResultBean<LoanMortgageInformationTransactDetailsVo> getMortgageInfo(String busVinSid) { |
|
|
|
ResultBean<LoanMortgageInformationTransactDetailsVo> rb = ResultBean.fireFail(); |
|
|
|
LoanMortgageInformationTransactDetailsVo fetchVo = baseMapper.getMortgageInfo(busVinSid); |
|
|
|
LoanMortgageInformationTransactDetailsVo vo = new LoanMortgageInformationTransactDetailsVo(); |
|
|
|
//根据业务车辆sid查询 销售订单业务车辆表
|
|
|
|
BusSalesOrderVehicle orderVehicle = busSalesOrderVehicleFeign.details(busVinSid).getData(); |
|
|
|
if (null != orderVehicle) { |
|
|
|
if (StringUtils.isNotBlank(orderVehicle.getLinkNo())) { |
|
|
|
vo.setVinNo(orderVehicle.getLinkNo()); |
|
|
|
} |
|
|
|
String salesOrderSid = orderVehicle.getSalesOrderSid(); |
|
|
|
//根据销售订单sid查询消贷合同表
|
|
|
|
BusSalesOrderLoancontract loancontract = busSalesOrderLoancontractFeign.fetchDetailsByOrderSid(salesOrderSid).getData(); |
|
|
|
if (null != loancontract) { |
|
|
|
//消贷合同编号
|
|
|
|
if (StringUtils.isNotBlank(loancontract.getLoanContractNo())) { |
|
|
|
vo.setContractId(loancontract.getLoanContractNo()); |
|
|
|
} |
|
|
|
//贷款人
|
|
|
|
if (StringUtils.isNotBlank(loancontract.getBorrowerName())) { |
|
|
|
vo.setBorrowerName(loancontract.getBorrowerName()); |
|
|
|
} |
|
|
|
} |
|
|
|
//登记证 1-2页
|
|
|
|
List<LoanFile> fileList = loanFileService.selectByLinkSid(busVinSid, LoanFileEnum.REGISTRATION_FILES_ONE.getAttachType()); |
|
|
|
fileList.removeAll(Collections.singleton(null)); |
|
|
|
if (!fileList.isEmpty()) { |
|
|
|
List<String> registrationFiles1 = fileList.stream().map(c -> fileUploadComponent.getUrlPrefix() + c.getFilePath()). |
|
|
|
collect(Collectors.toList()); |
|
|
|
vo.setRegistrationFiles1(registrationFiles1); |
|
|
|
} |
|
|
|
//登记证 3-4页
|
|
|
|
fileList = loanFileService.selectByLinkSid(busVinSid, LoanFileEnum.REGISTRATION_FILES_TWO.getAttachType()); |
|
|
|
fileList.removeAll(Collections.singleton(null)); |
|
|
|
if (!fileList.isEmpty()) { |
|
|
|
List<String> registrationFiles2 = fileList.stream().map(c -> fileUploadComponent.getUrlPrefix() + c.getFilePath()).collect(Collectors.toList()); |
|
|
|
vo.setRegistrationFiles2(registrationFiles2); |
|
|
|
} |
|
|
|
//营运证
|
|
|
|
fileList = loanFileService.selectByLinkSid(busVinSid, LoanFileEnum.TAXI_FILES.getAttachType()); |
|
|
|
fileList.removeAll(Collections.singleton(null)); |
|
|
|
if (!fileList.isEmpty()) { |
|
|
|
List<String> taxiFiles = fileList.stream().map(c -> fileUploadComponent.getUrlPrefix() + c.getFilePath()).collect(Collectors.toList()); |
|
|
|
vo.setTaxiFiles(taxiFiles); |
|
|
|
} |
|
|
|
//行驶证
|
|
|
|
fileList = loanFileService.selectByLinkSid(busVinSid, LoanFileEnum.DRIVING_CARD_FILES.getAttachType()); |
|
|
|
fileList.removeAll(Collections.singleton(null)); |
|
|
|
if (!fileList.isEmpty()) { |
|
|
|
List<String> drivingFiles = fileList.stream().map(c -> fileUploadComponent.getUrlPrefix() + c.getFilePath()).collect(Collectors.toList()); |
|
|
|
vo.setDrivingFiles(drivingFiles); |
|
|
|
} |
|
|
|
LoanMortgageInformationTransactDetailsVo vo = baseMapper.getMortgageInfo(busVinSid); |
|
|
|
//登记证 1-2页
|
|
|
|
List<LoanFile> fileList = loanFileService.selectByLinkSid(busVinSid, LoanFileEnum.REGISTRATION_FILES_ONE.getAttachType()); |
|
|
|
fileList.removeAll(Collections.singleton(null)); |
|
|
|
if (!fileList.isEmpty()) { |
|
|
|
List<String> registrationFiles1 = fileList.stream().map(c -> fileUploadComponent.getUrlPrefix() + c.getFilePath()). |
|
|
|
collect(Collectors.toList()); |
|
|
|
vo.setRegistrationFiles1(registrationFiles1); |
|
|
|
} |
|
|
|
if (null != fetchVo) { |
|
|
|
if (StringUtils.isNotBlank(fetchVo.getMortgageDate())) { |
|
|
|
vo.setMortgageDate(fetchVo.getMortgageDate()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(fetchVo.getRemarks())) { |
|
|
|
vo.setRemarks(fetchVo.getRemarks()); |
|
|
|
} |
|
|
|
// else {
|
|
|
|
// vo.setMortgageDate("-");
|
|
|
|
// }
|
|
|
|
//登记证 3-4页
|
|
|
|
fileList = loanFileService.selectByLinkSid(busVinSid, LoanFileEnum.REGISTRATION_FILES_TWO.getAttachType()); |
|
|
|
fileList.removeAll(Collections.singleton(null)); |
|
|
|
if (!fileList.isEmpty()) { |
|
|
|
List<String> registrationFiles2 = fileList.stream().map(c -> fileUploadComponent.getUrlPrefix() + c.getFilePath()).collect(Collectors.toList()); |
|
|
|
vo.setRegistrationFiles2(registrationFiles2); |
|
|
|
} |
|
|
|
//营运证
|
|
|
|
fileList = loanFileService.selectByLinkSid(busVinSid, LoanFileEnum.TAXI_FILES.getAttachType()); |
|
|
|
fileList.removeAll(Collections.singleton(null)); |
|
|
|
if (!fileList.isEmpty()) { |
|
|
|
List<String> taxiFiles = fileList.stream().map(c -> fileUploadComponent.getUrlPrefix() + c.getFilePath()).collect(Collectors.toList()); |
|
|
|
vo.setTaxiFiles(taxiFiles); |
|
|
|
} |
|
|
|
//行驶证
|
|
|
|
fileList = loanFileService.selectByLinkSid(busVinSid, LoanFileEnum.DRIVING_CARD_FILES.getAttachType()); |
|
|
|
fileList.removeAll(Collections.singleton(null)); |
|
|
|
if (!fileList.isEmpty()) { |
|
|
|
List<String> drivingFiles = fileList.stream().map(c -> fileUploadComponent.getUrlPrefix() + c.getFilePath()).collect(Collectors.toList()); |
|
|
|
vo.setDrivingFiles(drivingFiles); |
|
|
|
} |
|
|
|
// else {
|
|
|
|
// vo.setMortgageDate("-");
|
|
|
|
// }
|
|
|
|
vo.setBusVinSid(busVinSid); |
|
|
|
return rb.success().setData(vo); |
|
|
|
} |
|
|
|