|
|
@ -48,6 +48,7 @@ import com.yxt.anrui.buscenter.api.bussalesorder.BusSalesOrder; |
|
|
|
import com.yxt.anrui.buscenter.api.bussalesorder.app.order.AppOrderDetailsVo; |
|
|
|
import com.yxt.anrui.buscenter.api.bussalesorder.app.order.AppOrderModelInfoVo; |
|
|
|
import com.yxt.anrui.buscenter.api.bussalesorder.app.order.AppOrderPriceInfoVo; |
|
|
|
import com.yxt.anrui.buscenter.api.bussalesorderborrower.BusSalesOrderBorrower; |
|
|
|
import com.yxt.anrui.buscenter.api.bussalesorderdiscount.BusSalesOrderDiscount; |
|
|
|
import com.yxt.anrui.buscenter.api.bussalesordersubmit.SubmitVo; |
|
|
|
import com.yxt.anrui.buscenter.api.bussalesordervehicle.BusSalesOrderVehicle; |
|
|
@ -57,6 +58,7 @@ import com.yxt.anrui.buscenter.biz.busdeliveredapplydetails.BusDeliveredApplyDet |
|
|
|
import com.yxt.anrui.buscenter.biz.busdelivereddetailsdiscount.BusDeliveredDetailsDiscountService; |
|
|
|
import com.yxt.anrui.buscenter.biz.busdeliveredusemessage.BusDeliveredUseMessageService; |
|
|
|
import com.yxt.anrui.buscenter.biz.bussalesorder.BusSalesOrderService; |
|
|
|
import com.yxt.anrui.buscenter.biz.bussalesorderborrower.BusSalesOrderBorrowerService; |
|
|
|
import com.yxt.anrui.buscenter.biz.bussalesorderdiscount.BusSalesOrderDiscountService; |
|
|
|
import com.yxt.anrui.buscenter.biz.bussalesordervehicle.BusSalesOrderVehicleService; |
|
|
|
import com.yxt.anrui.fin.api.finbillapplication.FinBillApplication; |
|
|
@ -69,6 +71,9 @@ import com.yxt.anrui.portal.api.sysuser.SysUserFeign; |
|
|
|
import com.yxt.anrui.portal.api.sysuser.SysUserVo; |
|
|
|
import com.yxt.anrui.riskcenter.api.loanfileexamine.LoanFileexamine; |
|
|
|
import com.yxt.anrui.riskcenter.api.loanfileexamine.LoanFileexamineFeign; |
|
|
|
import com.yxt.anrui.riskcenter.api.loanhomevisitinvestigate.LoanHomevisitInvestigate; |
|
|
|
import com.yxt.anrui.riskcenter.api.loanhomevisitinvestigatecustomer.LoanHomevisitInvestigateCustomer; |
|
|
|
import com.yxt.anrui.riskcenter.api.loanhomevisitinvestigateotherpeo.LoanHomevisitInvestigateOtherpeo; |
|
|
|
import com.yxt.common.base.config.component.FileUploadComponent; |
|
|
|
import com.yxt.common.base.service.MybatisBaseService; |
|
|
|
import com.yxt.common.base.utils.PagerUtil; |
|
|
@ -135,6 +140,8 @@ public class BusDeliveredService extends MybatisBaseService<BusDeliveredMapper, |
|
|
|
private FileUploadComponent fileUploadComponent; |
|
|
|
@Autowired |
|
|
|
private BusBillApplicationService busBillApplicationService; |
|
|
|
@Autowired |
|
|
|
private BusSalesOrderBorrowerService busSalesOrderBorrowerService; |
|
|
|
|
|
|
|
/** |
|
|
|
* 待出库车辆分页列表 |
|
|
@ -297,6 +304,26 @@ public class BusDeliveredService extends MybatisBaseService<BusDeliveredMapper, |
|
|
|
return iPage; |
|
|
|
} |
|
|
|
|
|
|
|
public IPage<AppBusDeliveredPageVo> getRetrievalNotListNew2(PagerQuery<AppBusDeliveredPageQuery> pq) { |
|
|
|
QueryWrapper<AppBusDeliveredPageQuery> qw = new QueryWrapper<>(); |
|
|
|
String name = pq.getParams().getName(); |
|
|
|
IPage<AppBusDeliveredPageVo> page = PagerUtil.queryToPage(pq); |
|
|
|
String orgPath = pq.getParams().getOrgPath(); |
|
|
|
String orgSid = ""; |
|
|
|
if (StringUtils.isNotBlank(orgPath)) { |
|
|
|
orgSid = sysStaffOrgFeign.getOrgSidByPath(orgPath).getData(); |
|
|
|
} else { |
|
|
|
orgSid = sysStaffOrgFeign.getPathSidByUserSid(pq.getParams().getUserSid()).getData(); |
|
|
|
} |
|
|
|
qw.eq("bo.useOrgSid", orgSid); |
|
|
|
if (StringUtils.isNotBlank(pq.getParams().getUserSid())) { |
|
|
|
qw.eq("bo.createBySid", pq.getParams().getUserSid()); |
|
|
|
} |
|
|
|
IPage<AppBusDeliveredPageVo> iPage = baseMapper.getRetrievalNotListNew2(page, qw, name); |
|
|
|
return iPage; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/* public IPage<AppBusDeliveredPageVo> getRetrievalNotLists(PagerQuery<AppBusDeliveredPageQuery> pq) { |
|
|
|
QueryWrapper<AppBusDeliveredPageQuery> qw = new QueryWrapper<>(); |
|
|
|
String name = pq.getParams().getName(); |
|
|
@ -396,6 +423,9 @@ public class BusDeliveredService extends MybatisBaseService<BusDeliveredMapper, |
|
|
|
appDeliveredDetailsVo.setPaymentMethodKey(appOrderDetailsVo.getPayTypeKey()); |
|
|
|
if ("2".equals(appDeliveredDetailsVo.getPaymentMethodKey())) { |
|
|
|
appDeliveredDetailsVo.setShowLoanUser(true); |
|
|
|
appDeliveredDetailsVo.setForbidInvoiceChoice(true); |
|
|
|
appDeliveredDetailsVo.setHasInvoice("否"); |
|
|
|
appDeliveredDetailsVo.setHasInvoiceKey("0"); |
|
|
|
} |
|
|
|
//客户名称
|
|
|
|
appDeliveredDetailsVo.setName(appOrderDetailsVo.getName()); |
|
|
@ -433,6 +463,12 @@ public class BusDeliveredService extends MybatisBaseService<BusDeliveredMapper, |
|
|
|
appCarListVo.setVinSid(list.get(i)); |
|
|
|
appDeliveredDetailsVo.setLoanSid(busSalesOrderVehicle.getBorrowerSid()); |
|
|
|
appDeliveredDetailsVo.setLoanName(busSalesOrderVehicle.getBorrowName()); |
|
|
|
if(StringUtils.isNotBlank(busSalesOrderVehicle.getBorrowerSid())){ |
|
|
|
BusSalesOrderBorrower busSalesOrderBorrower = busSalesOrderBorrowerService.fetchBySid(busSalesOrderVehicle.getBorrowerSid()); |
|
|
|
appDeliveredDetailsVo.setLoanMobile(busSalesOrderBorrower.getMobile()); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
//查询该车辆是否有挂车
|
|
|
|
ResultBean<TraliveredVo> trailerList = baseTrailerFeign.trailerList(vinSid, contractNo); |
|
|
|
if (trailerList.getData() != null && trailerList.getData().getList().isEmpty() && trailerList.getData().getVehillModelList().isEmpty()) { |
|
|
@ -457,6 +493,51 @@ public class BusDeliveredService extends MybatisBaseService<BusDeliveredMapper, |
|
|
|
appCarListVo.setDiscountUse(discountList); |
|
|
|
BusDeliveredUseMessagesVo deliveredUseMessagesVo = new BusDeliveredUseMessagesVo(); |
|
|
|
deliveredUseMessagesVo.setVin(busSalesOrderVehicle.getLinkNo().substring(busSalesOrderVehicle.getLinkNo().length() - 8)); |
|
|
|
if(StringUtils.isNotBlank(busSalesOrderVehicle.getBorrowerSid())){ |
|
|
|
//查询实际购车人
|
|
|
|
LoanHomevisitInvestigate loanHomevisitInvestigate = baseMapper.selectByBorrowSidAndOrder(busSalesOrderVehicle.getBorrowerSid(),busSalesOrderVehicle.getSalesOrderSid()); |
|
|
|
if(loanHomevisitInvestigate != null){ |
|
|
|
LoanHomevisitInvestigateOtherpeo loanHomevisitInvestigateOtherpeo = baseMapper.selectVisitSid(loanHomevisitInvestigate.getSid()); |
|
|
|
if(loanHomevisitInvestigateOtherpeo != null){ |
|
|
|
appDeliveredDetailsVo.setTypeKey("2"); |
|
|
|
appDeliveredDetailsVo.setType("其他人"); |
|
|
|
} |
|
|
|
LoanHomevisitInvestigateCustomer loanHomevisitInvestigateCustomer = baseMapper.selectCustomer(loanHomevisitInvestigate.getSid()); |
|
|
|
if(loanHomevisitInvestigateCustomer != null){ |
|
|
|
appDeliveredDetailsVo.setTypeKey("1"); |
|
|
|
appDeliveredDetailsVo.setType("贷款人"); |
|
|
|
} |
|
|
|
if (!query.isPcView()) { |
|
|
|
if ("2".equals(appDeliveredDetailsVo.getTypeKey())) {//其他人
|
|
|
|
deliveredUseMessagesVo.setMobile(loanHomevisitInvestigateOtherpeo.getMobile()); |
|
|
|
deliveredUseMessagesVo.setCustomerType("个人"); |
|
|
|
deliveredUseMessagesVo.setCustomerTypeKey("1"); |
|
|
|
deliveredUseMessagesVo.setAddress(loanHomevisitInvestigateOtherpeo.getPeoPreAddress()); |
|
|
|
deliveredUseMessagesVo.setName(loanHomevisitInvestigateOtherpeo.getPeoName()); |
|
|
|
deliveredUseMessagesVo.setIdNumber(loanHomevisitInvestigateOtherpeo.getIdNumber()); |
|
|
|
} |
|
|
|
} else { |
|
|
|
if ("2".equals(appDeliveredDetailsVo.getTypeKey())) {//其他人
|
|
|
|
deliveredUseMessagesVo.setMobile(loanHomevisitInvestigateOtherpeo.getMobile()); |
|
|
|
deliveredUseMessagesVo.setCustomerType("个人"); |
|
|
|
deliveredUseMessagesVo.setCustomerTypeKey("1"); |
|
|
|
deliveredUseMessagesVo.setAddress(loanHomevisitInvestigateOtherpeo.getPeoPreAddress()); |
|
|
|
deliveredUseMessagesVo.setName(loanHomevisitInvestigateOtherpeo.getPeoName()); |
|
|
|
deliveredUseMessagesVo.setIdNumber(loanHomevisitInvestigateOtherpeo.getIdNumber()); |
|
|
|
}else if("1".equals(appDeliveredDetailsVo.getTypeKey())){ |
|
|
|
deliveredUseMessagesVo.setMobile(loanHomevisitInvestigateCustomer.getBorrowerMobile()); |
|
|
|
deliveredUseMessagesVo.setCustomerType("个人"); |
|
|
|
deliveredUseMessagesVo.setCustomerTypeKey("1"); |
|
|
|
deliveredUseMessagesVo.setAddress(loanHomevisitInvestigateCustomer.getBorrowerPreAddress()); |
|
|
|
deliveredUseMessagesVo.setName(loanHomevisitInvestigateCustomer.getBorrowerName()); |
|
|
|
deliveredUseMessagesVo.setIdNumber(loanHomevisitInvestigateCustomer.getBorrowerIdNumber()); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
appCarListVo.setRealBuyer(deliveredUseMessagesVo); |
|
|
|
//===============================添加资料是否齐全和资方放款是否审核
|
|
|
|
BusSalesOrder busSalesOrder = busSalesOrderService.fetchBySid(busSalesOrderVehicle.getSalesOrderSid()); |
|
|
@ -495,7 +576,7 @@ public class BusDeliveredService extends MybatisBaseService<BusDeliveredMapper, |
|
|
|
ResultBean<List<DictCommonVo>> listResultBean = dictCommonFeign.getTypeValues("buyerType", "0"); |
|
|
|
List<DictCommonVo> dictCommonVoList = listResultBean.getData(); |
|
|
|
List<DeliveredDictVo> voList = Optional.ofNullable(dictCommonVoList).orElse(new ArrayList<>()).stream().map(m -> JSON.parseObject(JSON.toJSONString(m), DeliveredDictVo.class)).collect(Collectors.toList()); |
|
|
|
if ("1".equals(appOrderDetailsVo.getPayTypeKey())) {//贷款
|
|
|
|
if ("1".equals(appOrderDetailsVo.getPayTypeKey())) {//全款
|
|
|
|
voList.remove(1); |
|
|
|
} |
|
|
|
appDeliveredDetailsVo.setBuyerType(voList); |
|
|
@ -544,6 +625,7 @@ public class BusDeliveredService extends MybatisBaseService<BusDeliveredMapper, |
|
|
|
} |
|
|
|
if ("2".equals(appDeliveredDetailsVo.getPaymentMethodKey())) { |
|
|
|
appDeliveredDetailsVo.setShowLoanUser(true); |
|
|
|
appDeliveredDetailsVo.setForbidInvoiceChoice(true); |
|
|
|
} |
|
|
|
appDeliveredDetailsVo.setTaskDefKey(busDeliveredApply.getTaskDefKey()); |
|
|
|
appDeliveredDetailsVo.setBusSalesOrderSid(resultBean.getData().getBusSalesOrderSid()); |
|
|
@ -585,8 +667,6 @@ public class BusDeliveredService extends MybatisBaseService<BusDeliveredMapper, |
|
|
|
AppCarListVo appCarListVo = new AppCarListVo(); |
|
|
|
appCarListVo.setDiscount(busDeliveredApplyDetails.getSingleCarDiscountPrice()); |
|
|
|
appCarListVo.setVinSid(busDeliveredApplyDetails.getVinSid()); |
|
|
|
appDeliveredDetailsVo.setLoanName(busSalesOrderVehicle.getBorrowName()); |
|
|
|
appDeliveredDetailsVo.setLoanSid(busSalesOrderVehicle.getBorrowerSid()); |
|
|
|
//查询该车辆是否有挂车
|
|
|
|
ResultBean<TraliveredVo> trailerList = baseTrailerFeign.trailerList(busDeliveredApplyDetails.getVinSid(), busDeliveredApply.getContractNo()); |
|
|
|
if (trailerList.getData().getList().isEmpty() && trailerList.getData().getVehillModelList().isEmpty()) { |
|
|
@ -790,7 +870,14 @@ public class BusDeliveredService extends MybatisBaseService<BusDeliveredMapper, |
|
|
|
List<String> vinSids = query.getVinSids(); |
|
|
|
vinSids.removeAll(Collections.singleton(null)); |
|
|
|
List<AppCarListVo> list = new ArrayList<>(); |
|
|
|
List<BusSalesOrderVehicle> busSalesOrderVehicleList = busSalesOrderVehicleService.selectByNoAndVinSidsNew(contractNo); |
|
|
|
List<BusSalesOrderVehicle> busSalesOrderVehicleList = new ArrayList<>(); |
|
|
|
BusSalesOrder busSalesOrder = busSalesOrderService.selectByContractNos(contractNo); |
|
|
|
if("1".equals(busSalesOrder.getPayTypeKey())){ |
|
|
|
busSalesOrderVehicleList = busSalesOrderVehicleService.selectByNoAndVinSidsNew(contractNo); |
|
|
|
}else{ |
|
|
|
busSalesOrderVehicleList = busSalesOrderVehicleService.selectByNoAndVinSidsNew1(contractNo); |
|
|
|
} |
|
|
|
|
|
|
|
for (int i = 0; i < busSalesOrderVehicleList.size(); i++) { |
|
|
|
AppCarListVo appCarListVo = new AppCarListVo(); |
|
|
|
BusSalesOrderVehicle busSalesOrderVehicle = busSalesOrderVehicleList.get(i); |
|
|
@ -799,6 +886,11 @@ public class BusDeliveredService extends MybatisBaseService<BusDeliveredMapper, |
|
|
|
if (vinSelectSid.contains(vinSid)) { |
|
|
|
continue; |
|
|
|
} |
|
|
|
if(StringUtils.isNotBlank(query.getLoanSid())){ |
|
|
|
if(!query.getLoanSid().equals(busSalesOrderVehicle.getBorrowerSid())){ |
|
|
|
continue; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if (!vinSids.isEmpty()) { |
|
|
|
if (vinSids.contains(vinSid)) { |
|
|
@ -835,7 +927,7 @@ public class BusDeliveredService extends MybatisBaseService<BusDeliveredMapper, |
|
|
|
BusDeliveredUseMessagesVo deliveredUseMessagesVo = new BusDeliveredUseMessagesVo(); |
|
|
|
deliveredUseMessagesVo.setVin(busSalesOrderVehicle.getLinkNo().substring(busSalesOrderVehicle.getLinkNo().length() - 8)); |
|
|
|
appCarListVo.setRealBuyer(deliveredUseMessagesVo); |
|
|
|
BusSalesOrder busSalesOrder = busSalesOrderService.fetchBySid(busSalesOrderVehicle.getSalesOrderSid()); |
|
|
|
busSalesOrder = busSalesOrderService.fetchBySid(busSalesOrderVehicle.getSalesOrderSid()); |
|
|
|
if (busSalesOrder != null && "2".equals(busSalesOrder.getPayTypeKey())) { |
|
|
|
//===============================添加资料是否齐全和资方放款是否审核
|
|
|
|
String saleOrderSid = busSalesOrderVehicle.getSalesOrderSid(); |
|
|
|