|
|
@ -35,10 +35,7 @@ import com.yxt.anrui.base.api.basevehiclecertificate.BaseVehicleCertificateFeign |
|
|
|
import com.yxt.anrui.base.api.basevehiclecertificate.HandoverCertVo; |
|
|
|
import com.yxt.anrui.buscenter.api.buscenterfile.BuscenterFile; |
|
|
|
import com.yxt.anrui.buscenter.api.buscenterfile.BuscenterFileEnum; |
|
|
|
import com.yxt.anrui.buscenter.api.bushandoverprepare.BusHandoverPrepare; |
|
|
|
import com.yxt.anrui.buscenter.api.bushandoverprepare.BusHandoverPrepareAddDto; |
|
|
|
import com.yxt.anrui.buscenter.api.bushandoverprepare.HandoverInformationIntemVo; |
|
|
|
import com.yxt.anrui.buscenter.api.bushandoverprepare.HandoverInformationVo; |
|
|
|
import com.yxt.anrui.buscenter.api.bushandoverprepare.*; |
|
|
|
import com.yxt.anrui.buscenter.api.bushandoverprepare.app.*; |
|
|
|
import com.yxt.anrui.buscenter.api.bushandoverpreparevehicle.AppBusHandoverPrepareVehicleDto; |
|
|
|
import com.yxt.anrui.buscenter.api.bushandoverpreparevehicle.AppBusHandoverPrepareVehicleInfoVo; |
|
|
@ -308,6 +305,7 @@ public class BusHandoverPrepareService extends MybatisBaseService<BusHandoverPre |
|
|
|
* 确认时更新接收记录的接收日期及接收备注,如果发票移交状态为移交中的,则更新为已移交。 |
|
|
|
*/ |
|
|
|
ResultBean<AppInvoicingInfoVo> rb = new ResultBean(); |
|
|
|
AppInvoicingInfoVo vo = new AppInvoicingInfoVo(); |
|
|
|
BusHandoverPrepareVehicle busHandoverPrepareVehicle = busHandoverPrepareVehicleService.fetchBySid(query.getSid()); |
|
|
|
//查询销售专员的用户sid
|
|
|
|
BusHandoverPrepare busHandoverPrepare = fetchBySid(busHandoverPrepareVehicle.getMainSid()); |
|
|
@ -316,8 +314,10 @@ public class BusHandoverPrepareService extends MybatisBaseService<BusHandoverPre |
|
|
|
ResultBean<BusTransferRecords> busTransferRecordsResultBean = busTransferRecordsService.selectByVinSid(busHandoverPrepareVehicle.getVinSid(), receiveUserSid, BusTransferRecordEnum.FP.getCode()); |
|
|
|
if (busTransferRecordsResultBean.getData() == null) { |
|
|
|
return rb.setMsg("发票未准备好"); |
|
|
|
} else { |
|
|
|
BusTransferRecords busTransferRecords = busTransferRecordsResultBean.getData(); |
|
|
|
vo.setRemarks(busTransferRecords.getReceiveRemarks()); |
|
|
|
} |
|
|
|
AppInvoicingInfoVo vo = new AppInvoicingInfoVo(); |
|
|
|
ResultBean<FinVehicleInvoice> resultBean = finVehicleInvoiceFeign.selectByVinSids(busHandoverPrepareVehicle.getVinSid()); |
|
|
|
if (resultBean.getData() != null) { |
|
|
|
FinVehicleInvoice finVehicleInvoice = resultBean.getData(); |
|
|
@ -346,6 +346,7 @@ public class BusHandoverPrepareService extends MybatisBaseService<BusHandoverPre |
|
|
|
*/ |
|
|
|
public ResultBean<AppCertificateInfoVo> getCertificateInfo(AppCertificateInfoQuery query) { |
|
|
|
ResultBean<AppCertificateInfoVo> rb = new ResultBean(); |
|
|
|
AppCertificateInfoVo vo = new AppCertificateInfoVo(); |
|
|
|
//根据车辆sid以及销售专员的用户sid查询是否有待接收的记录
|
|
|
|
BusHandoverPrepareVehicle busHandoverPrepareVehicle = busHandoverPrepareVehicleService.fetchBySid(query.getSid()); |
|
|
|
//查询销售专员的用户sid
|
|
|
@ -354,8 +355,10 @@ public class BusHandoverPrepareService extends MybatisBaseService<BusHandoverPre |
|
|
|
ResultBean<BusTransferRecords> busTransferRecordsResultBean = busTransferRecordsService.selectByVinSid(busHandoverPrepareVehicle.getVinSid(), receiveUserSid, BusTransferRecordEnum.HGZ.getCode()); |
|
|
|
if (busTransferRecordsResultBean.getData() == null) { |
|
|
|
return rb.setMsg("合格证未准备好"); |
|
|
|
} else { |
|
|
|
BusTransferRecords busTransferRecords = busTransferRecordsResultBean.getData(); |
|
|
|
vo.setRemarks(busTransferRecords.getReceiveRemarks()); |
|
|
|
} |
|
|
|
AppCertificateInfoVo vo = new AppCertificateInfoVo(); |
|
|
|
ResultBean<HandoverCertVo> resultBean = baseVehicleCertificateFeign.getCertificateInfoOne(busHandoverPrepareVehicle.getVinSid(), busHandoverPrepare.getUseOrgSid()); |
|
|
|
HandoverCertVo handoverCertVo = resultBean.getData(); |
|
|
|
BeanUtil.copyProperties(handoverCertVo, vo); |
|
|
@ -374,17 +377,23 @@ public class BusHandoverPrepareService extends MybatisBaseService<BusHandoverPre |
|
|
|
List<String> policyList = new ArrayList<>();// 保单照片
|
|
|
|
List<String> licenceList = new ArrayList<>();// 临时牌照
|
|
|
|
List<BuscenterFile> policyFiles = buscenterFile.selectByLinkSid(query.getSid(), BuscenterFileEnum.HANDOVER_POLICY.getAttachType()); |
|
|
|
for (BuscenterFile file : policyFiles) { |
|
|
|
policyList.add(fileUploadComponent.getUrlPrefix() + file.getFilePath()); |
|
|
|
policyFiles.removeAll(Collections.singleton(null)); |
|
|
|
if (!policyFiles.isEmpty()) { |
|
|
|
for (BuscenterFile file : policyFiles) { |
|
|
|
policyList.add(fileUploadComponent.getUrlPrefix() + file.getFilePath()); |
|
|
|
} |
|
|
|
} |
|
|
|
List<BuscenterFile> licenceFiles = buscenterFile.selectByLinkSid(query.getSid(), BuscenterFileEnum.HANDOVER_LICENCE.getAttachType()); |
|
|
|
for (BuscenterFile file : licenceFiles) { |
|
|
|
licenceList.add(fileUploadComponent.getUrlPrefix() + file.getFilePath()); |
|
|
|
licenceFiles.removeAll(Collections.singleton(null)); |
|
|
|
if (!licenceFiles.isEmpty()) { |
|
|
|
for (BuscenterFile file : licenceFiles) { |
|
|
|
licenceList.add(fileUploadComponent.getUrlPrefix() + file.getFilePath()); |
|
|
|
} |
|
|
|
} |
|
|
|
vo.setPolicyList(policyList); |
|
|
|
vo.setLicenceList(licenceList); |
|
|
|
vo.setSid(query.getSid()); |
|
|
|
vo.setVin(query.getVin()); |
|
|
|
/* vo.setSid(query.getSid()); |
|
|
|
vo.setVin(query.getVin());*/ |
|
|
|
return rb.success().setData(vo); |
|
|
|
} |
|
|
|
|
|
|
@ -397,9 +406,17 @@ public class BusHandoverPrepareService extends MybatisBaseService<BusHandoverPre |
|
|
|
public ResultBean savePolicyInfo(AppPolicyDto dto) { |
|
|
|
ResultBean rb = new ResultBean<>(); |
|
|
|
buscenterFile.delByLinkSidOrType(dto.getSid(), BuscenterFileEnum.HANDOVER_POLICY.getAttachType()); |
|
|
|
buscenterFile.saveAll(dto.getSid(), dto.getPolicyList(), BuscenterFileEnum.HANDOVER_POLICY.getAttachType()); |
|
|
|
List<String> policyList = dto.getPolicyList(); |
|
|
|
if (!policyList.isEmpty()) { |
|
|
|
policyList = policyList.stream().map(c -> c.replaceAll(fileUploadComponent.getUrlPrefix(), "")).collect(Collectors.toList()); |
|
|
|
} |
|
|
|
buscenterFile.saveAll(dto.getSid(), policyList, BuscenterFileEnum.HANDOVER_POLICY.getAttachType()); |
|
|
|
buscenterFile.delByLinkSidOrType(dto.getSid(), BuscenterFileEnum.HANDOVER_LICENCE.getAttachType()); |
|
|
|
buscenterFile.saveAll(dto.getSid(), dto.getLicenceList(), BuscenterFileEnum.HANDOVER_LICENCE.getAttachType()); |
|
|
|
List<String> licenceList = dto.getLicenceList(); |
|
|
|
if (!licenceList.isEmpty()) { |
|
|
|
licenceList = licenceList.stream().map(c -> c.replaceAll(fileUploadComponent.getUrlPrefix(), "")).collect(Collectors.toList()); |
|
|
|
} |
|
|
|
buscenterFile.saveAll(dto.getSid(), licenceList, BuscenterFileEnum.HANDOVER_LICENCE.getAttachType()); |
|
|
|
return rb.success(); |
|
|
|
} |
|
|
|
|
|
|
@ -413,13 +430,15 @@ public class BusHandoverPrepareService extends MybatisBaseService<BusHandoverPre |
|
|
|
ResultBean<AppOtherDataInfoVo> rb = new ResultBean<>(); |
|
|
|
AppOtherDataInfoVo vo = new AppOtherDataInfoVo(); |
|
|
|
List<BuscenterFile> otherFiles = buscenterFile.selectByLinkSid(query.getSid(), BuscenterFileEnum.HANDOVER_OTHRRDATA.getAttachType()); |
|
|
|
otherFiles.removeAll(Collections.singleton(null)); |
|
|
|
List<String> otherInfo = new ArrayList<>(); |
|
|
|
for (BuscenterFile file : otherFiles) { |
|
|
|
otherInfo.add(fileUploadComponent.getUrlPrefix() + file.getFilePath()); |
|
|
|
if(!otherFiles.isEmpty()){ |
|
|
|
for (BuscenterFile file : otherFiles) { |
|
|
|
otherInfo.add(fileUploadComponent.getUrlPrefix() + file.getFilePath()); |
|
|
|
} |
|
|
|
} |
|
|
|
vo.setOtherInfo(otherInfo); |
|
|
|
vo.setSid(query.getSid()); |
|
|
|
vo.setVin(query.getVin()); |
|
|
|
return rb.success().setData(vo); |
|
|
|
} |
|
|
|
|
|
|
@ -435,7 +454,11 @@ public class BusHandoverPrepareService extends MybatisBaseService<BusHandoverPre |
|
|
|
return rb.setMsg("其他资料图片为必填项"); |
|
|
|
} |
|
|
|
buscenterFile.delByLinkSidOrType(dto.getSid(), BuscenterFileEnum.HANDOVER_OTHRRDATA.getAttachType()); |
|
|
|
buscenterFile.saveAll(dto.getSid(), dto.getOtherInfo(), BuscenterFileEnum.HANDOVER_OTHRRDATA.getAttachType()); |
|
|
|
List<String> otherInfoList = dto.getOtherInfo(); |
|
|
|
if(!otherInfoList.isEmpty()){ |
|
|
|
otherInfoList = otherInfoList.stream().map(v->v.replaceAll(fileUploadComponent.getUrlPrefix(),"")).collect(Collectors.toList()); |
|
|
|
buscenterFile.saveAll(dto.getSid(), otherInfoList, BuscenterFileEnum.HANDOVER_OTHRRDATA.getAttachType()); |
|
|
|
} |
|
|
|
return rb.success(); |
|
|
|
} |
|
|
|
|
|
|
@ -448,16 +471,10 @@ public class BusHandoverPrepareService extends MybatisBaseService<BusHandoverPre |
|
|
|
public ResultBean saveDeliveryPlanInfo(AppHandoverPrepareDto dto) { |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
BusHandoverPrepare busHandoverPrepare = fetchBySid(dto.getSid()); |
|
|
|
BeanUtil.copyProperties(dto, busHandoverPrepare); |
|
|
|
List<AppBusHandoverPrepareVehicleDto> handoverPrepareVehicleDtos = dto.getCarDataList(); |
|
|
|
if (handoverPrepareVehicleDtos.size() > 0) { |
|
|
|
// BeanUtil.copyProperties(dto, busHandoverPrepare);
|
|
|
|
/* if (handoverPrepareVehicleDtos.size() > 0) { |
|
|
|
String sid = dto.getSid(); |
|
|
|
// busHandoverPrepareVehicleService.deleteByMainSid(sid);
|
|
|
|
for (AppBusHandoverPrepareVehicleDto handoverPrepareVehicleDto : handoverPrepareVehicleDtos) { |
|
|
|
/* BusHandoverPrepareVehicle busHandoverPrepareVehicle = new BusHandoverPrepareVehicle(); |
|
|
|
BeanUtil.copyProperties(handoverPrepareVehicleDto, busHandoverPrepareVehicle); |
|
|
|
busHandoverPrepareVehicle.setMainSid(busHandoverPrepare.getSid()); |
|
|
|
busHandoverPrepareVehicleService.save(busHandoverPrepareVehicle);*/ |
|
|
|
BusHandoverPrepareVehicle busHandoverPrepareVehicle = busHandoverPrepareVehicleService.fetchBySid(handoverPrepareVehicleDto.getSid()); |
|
|
|
busHandoverPrepareVehicle.setInvoicingState(handoverPrepareVehicleDto.isInvoicingState() ? 1 : 0); |
|
|
|
busHandoverPrepareVehicle.setCertificateState(handoverPrepareVehicleDto.isCertificateState() ? 1 : 0); |
|
|
@ -467,7 +484,7 @@ public class BusHandoverPrepareService extends MybatisBaseService<BusHandoverPre |
|
|
|
busHandoverPrepareVehicleService.updateById(busHandoverPrepareVehicle); |
|
|
|
} |
|
|
|
} |
|
|
|
updateById(busHandoverPrepare); |
|
|
|
updateById(busHandoverPrepare);*/ |
|
|
|
return rb.success(); |
|
|
|
} |
|
|
|
|
|
|
@ -581,4 +598,8 @@ public class BusHandoverPrepareService extends MybatisBaseService<BusHandoverPre |
|
|
|
} |
|
|
|
return rb.success(); |
|
|
|
} |
|
|
|
|
|
|
|
public ResultBean saveRemarks(RemarkDto dto) { |
|
|
|
return null; |
|
|
|
} |
|
|
|
} |