|
|
@ -27,18 +27,17 @@ package com.yxt.anrui.buscenter.biz.bussalesordervehicle; |
|
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.yxt.anrui.base.api.basepurchasesystem.BasePurchSystemVo; |
|
|
|
import com.yxt.anrui.base.api.basetrailer.BaseTrailerFeign; |
|
|
|
import com.yxt.anrui.base.api.basetrailer.TrailerVo; |
|
|
|
import com.yxt.anrui.base.api.basetrailer.TraliveredVo; |
|
|
|
import com.yxt.anrui.base.api.basevehicle.BaseVehicle; |
|
|
|
import com.yxt.anrui.base.api.basevehicle.BaseVehicleFeign; |
|
|
|
import com.yxt.anrui.buscenter.api.busarrearscarryvehicleapply.AdCarListVo; |
|
|
|
import com.yxt.anrui.buscenter.api.busarrearscarryvehicleapply.GCarListVo; |
|
|
|
import com.yxt.anrui.base.api.basevehicle.BaseVehicleQKKPTrailerVo; |
|
|
|
import com.yxt.anrui.base.api.basevehicle.BaseVehicleQKKPVo; |
|
|
|
import com.yxt.anrui.base.api.basevehiclecertificate.BaseVehicleCertificateFeign; |
|
|
|
import com.yxt.anrui.base.api.basevehiclecertificate.BaseVehicleCertificateVo; |
|
|
|
import com.yxt.anrui.buscenter.api.busarrearscarryvehicleapply.AdCarListVo; |
|
|
|
import com.yxt.anrui.buscenter.api.busarrearscarryvehicleapply.GCarListVo; |
|
|
|
import com.yxt.anrui.buscenter.api.bussalesorder.app.model.AppNowCarListVo; |
|
|
|
import com.yxt.anrui.buscenter.api.bussalesorder.app.vin.VinListsVo; |
|
|
|
import com.yxt.anrui.buscenter.api.bussalesordervehicle.*; |
|
|
@ -46,7 +45,10 @@ import com.yxt.anrui.buscenter.api.bussalesordervehicle.app.AppBusSalesOrderVehi |
|
|
|
import com.yxt.anrui.buscenter.biz.bussalesorder.BusSalesOrderService; |
|
|
|
import com.yxt.anrui.fin.api.finselectedreceivablesdetailed.FinSelectedReceivablesDetailedFeign; |
|
|
|
import com.yxt.common.base.service.MybatisBaseService; |
|
|
|
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.apache.commons.lang3.StringUtils; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
@ -298,6 +300,9 @@ public class BusSalesOrderVehicleService extends MybatisBaseService<BusSalesOrde |
|
|
|
if (StringUtils.isNotBlank(query.getContractNo())) { |
|
|
|
qw.eq("bo.contractNo", query.getContractNo()); |
|
|
|
} |
|
|
|
if(StringUtils.isNotBlank(query.getVinNo())){ |
|
|
|
qw.like("bv.linkNo",query.getVinNo()); |
|
|
|
} |
|
|
|
List<QCarVo> list = baseMapper.getCanUseCars(qw); |
|
|
|
list.removeAll(Collections.singleton(null)); |
|
|
|
if (!list.isEmpty()) { |
|
|
@ -311,20 +316,73 @@ public class BusSalesOrderVehicleService extends MybatisBaseService<BusSalesOrde |
|
|
|
adCarListVo.setSubscribedAll(stringResultBean.getData()); |
|
|
|
} |
|
|
|
List<GCarListVo> gcList = new ArrayList<>(); |
|
|
|
TraliveredVo traliveredVo = baseTrailerFeign.trailerList(qCarVo.getCarSid(), query.getContractNo()).getData(); |
|
|
|
List<TrailerVo> trailerVos = traliveredVo.getList(); |
|
|
|
if (!trailerVos.isEmpty()) { |
|
|
|
for (TrailerVo trailerVo : trailerVos) { |
|
|
|
GCarListVo gCarListVo = new GCarListVo(); |
|
|
|
gCarListVo.setVinNo(traliveredVo.getVinNo()); |
|
|
|
gCarListVo.setGcVinNo(trailerVo.getTrailerVinNo()); |
|
|
|
gCarListVo.setPrice(trailerVo.getDealPrice()); |
|
|
|
gcList.add(gCarListVo); |
|
|
|
ResultBean<TraliveredVo> voResultBean = baseTrailerFeign.trailerList(qCarVo.getCarSid(), query.getContractNo()); |
|
|
|
if(voResultBean.getData() != null){ |
|
|
|
TraliveredVo traliveredVo = baseTrailerFeign.trailerList(qCarVo.getCarSid(), query.getContractNo()).getData(); |
|
|
|
List<TrailerVo> trailerVos = traliveredVo.getList(); |
|
|
|
if (!trailerVos.isEmpty()) { |
|
|
|
for (TrailerVo trailerVo : trailerVos) { |
|
|
|
GCarListVo gCarListVo = new GCarListVo(); |
|
|
|
gCarListVo.setVinNo(traliveredVo.getVinNo()); |
|
|
|
gCarListVo.setGcVinNo(trailerVo.getTrailerVinNo()); |
|
|
|
gCarListVo.setPrice(trailerVo.getDealPrice()); |
|
|
|
gcList.add(gCarListVo); |
|
|
|
} |
|
|
|
qCarVo.setGcList(gcList); |
|
|
|
} |
|
|
|
qCarVo.setGcList(gcList); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return rb.success().setData(list); |
|
|
|
} |
|
|
|
|
|
|
|
public PagerVo<QCarVo> getCanUseCarsPage(PagerQuery<QCarQuery> pagerQuery) { |
|
|
|
IPage<BaseVehicle> page = PagerUtil.queryToPage(pagerQuery); |
|
|
|
QCarQuery params = pagerQuery.getParams(); |
|
|
|
QueryWrapper<BaseVehicle> qw = new QueryWrapper<>(); |
|
|
|
if (params.getVinSids() != null) { |
|
|
|
if (params.getVinSids().size() > 0) { |
|
|
|
qw.notIn("bv.linkSid", params.getVinSids()); |
|
|
|
} |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(params.getContractNo())) { |
|
|
|
qw.eq("bo.contractNo", params.getContractNo()); |
|
|
|
} |
|
|
|
if(StringUtils.isNotBlank(params.getVinNo())){ |
|
|
|
qw.like("bv.linkNo",params.getVinNo()); |
|
|
|
} |
|
|
|
IPage<QCarVo> pagging = baseMapper.selectPageVo(page,qw); |
|
|
|
PagerVo<QCarVo> p = PagerUtil.pageToVo(pagging, null); |
|
|
|
List<QCarVo> list =pagging.getRecords(); |
|
|
|
list.removeAll(Collections.singleton(null)); |
|
|
|
if (!list.isEmpty()) { |
|
|
|
for (int i = 0; i < list.size(); i++) { |
|
|
|
QCarVo qCarVo = list.get(i); |
|
|
|
AdCarListVo adCarListVo = new AdCarListVo(); |
|
|
|
BeanUtil.copyProperties(qCarVo, adCarListVo); |
|
|
|
//查询该车辆已收款
|
|
|
|
ResultBean<String> stringResultBean = finSelectedReceivablesDetailedFeign.selectByBusVinSid(qCarVo.getBusVinSid()); |
|
|
|
if (stringResultBean.getData() != null) { |
|
|
|
adCarListVo.setSubscribedAll(stringResultBean.getData()); |
|
|
|
} |
|
|
|
List<GCarListVo> gcList = new ArrayList<>(); |
|
|
|
ResultBean<TraliveredVo> voResultBean = baseTrailerFeign.trailerList(qCarVo.getCarSid(), qCarVo.getContractNo()); |
|
|
|
if(voResultBean.getData() != null){ |
|
|
|
TraliveredVo traliveredVo = baseTrailerFeign.trailerList(qCarVo.getCarSid(), qCarVo.getContractNo()).getData(); |
|
|
|
List<TrailerVo> trailerVos = traliveredVo.getList(); |
|
|
|
if (!trailerVos.isEmpty()) { |
|
|
|
for (TrailerVo trailerVo : trailerVos) { |
|
|
|
GCarListVo gCarListVo = new GCarListVo(); |
|
|
|
gCarListVo.setVinNo(traliveredVo.getVinNo()); |
|
|
|
gCarListVo.setGcVinNo(trailerVo.getTrailerVinNo()); |
|
|
|
gCarListVo.setPrice(trailerVo.getDealPrice()); |
|
|
|
gcList.add(gCarListVo); |
|
|
|
} |
|
|
|
qCarVo.setGcList(gcList); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return p; |
|
|
|
} |
|
|
|
} |