@ -32,7 +32,9 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yxt.anrui.base.api.basevehicle.BaseVehicle ;
import com.yxt.anrui.base.api.basevehicle.BaseVehicleFeign ;
import com.yxt.anrui.base.api.basevehiclecertificate.BaseVehicleCertificateFeign ;
import com.yxt.anrui.base.api.basevehiclecertificate.CertificateStateQuery ;
import com.yxt.anrui.base.api.basevehiclecertificate.HandoverCertVo ;
import com.yxt.anrui.base.common.enums.CertificState ;
import com.yxt.anrui.buscenter.api.buscenterfile.BuscenterFile ;
import com.yxt.anrui.buscenter.api.buscenterfile.BuscenterFileEnum ;
import com.yxt.anrui.buscenter.api.bushandoverprepare.* ;
@ -53,6 +55,7 @@ import com.yxt.anrui.buscenter.biz.busvehicleinformationhandover.BusVehicleInfor
import com.yxt.anrui.fin.api.finbillvehicle.FinBillVehicleFeign ;
import com.yxt.anrui.fin.api.finvehicleinvoice.FinVehicleInvoice ;
import com.yxt.anrui.fin.api.finvehicleinvoice.FinVehicleInvoiceFeign ;
import com.yxt.anrui.fin.api.finvehicleinvoice.StateUpdateQuery ;
import com.yxt.anrui.portal.api.sysstafforg.SysStaffOrgFeign ;
import com.yxt.anrui.portal.api.sysuser.PrivilegeQuery ;
import com.yxt.anrui.portal.api.sysuser.SysUserFeign ;
@ -362,6 +365,7 @@ public class BusHandoverPrepareService extends MybatisBaseService<BusHandoverPre
ResultBean < HandoverCertVo > resultBean = baseVehicleCertificateFeign . getCertificateInfoOne ( busHandoverPrepareVehicle . getVinSid ( ) , busHandoverPrepare . getUseOrgSid ( ) ) ;
HandoverCertVo handoverCertVo = resultBean . getData ( ) ;
BeanUtil . copyProperties ( handoverCertVo , vo ) ;
vo . setVinNo ( busHandoverPrepareVehicle . getVinNo ( ) ) ;
return rb . success ( ) . setData ( vo ) ;
}
@ -432,7 +436,7 @@ public class BusHandoverPrepareService extends MybatisBaseService<BusHandoverPre
List < BuscenterFile > otherFiles = buscenterFile . selectByLinkSid ( query . getSid ( ) , BuscenterFileEnum . HANDOVER_OTHRRDATA . getAttachType ( ) ) ;
otherFiles . removeAll ( Collections . singleton ( null ) ) ;
List < String > otherInfo = new ArrayList < > ( ) ;
if ( ! otherFiles . isEmpty ( ) ) {
if ( ! otherFiles . isEmpty ( ) ) {
for ( BuscenterFile file : otherFiles ) {
otherInfo . add ( fileUploadComponent . getUrlPrefix ( ) + file . getFilePath ( ) ) ;
}
@ -455,8 +459,8 @@ public class BusHandoverPrepareService extends MybatisBaseService<BusHandoverPre
}
buscenterFile . delByLinkSidOrType ( dto . getSid ( ) , BuscenterFileEnum . HANDOVER_OTHRRDATA . getAttachType ( ) ) ;
List < String > otherInfoList = dto . getOtherInfo ( ) ;
if ( ! otherInfoList . isEmpty ( ) ) {
otherInfoList = otherInfoList . stream ( ) . map ( v - > v . replaceAll ( fileUploadComponent . getUrlPrefix ( ) , "" ) ) . collect ( Collectors . toList ( ) ) ;
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 ( ) ;
@ -568,16 +572,20 @@ public class BusHandoverPrepareService extends MybatisBaseService<BusHandoverPre
ResultBean < HandoverInformationVo > rb = ResultBean . fireFail ( ) ;
HandoverInformationVo handoverInformationVo = new HandoverInformationVo ( ) ;
BusHandoverPrepareVehicle busHandoverPrepareVehicle = busHandoverPrepareVehicleService . fetchBySid ( sid ) ;
BusHandoverPrepare busHandoverPrepare = fetchBySid ( busHandoverPrepareVehicle . getMainSid ( ) ) ;
handoverInformationVo . setModelSid ( busHandoverPrepare . getModelSid ( ) ) ;
handoverInformationVo . setModel ( busHandoverPrepare . getModel ( ) ) ;
handoverInformationVo . setConfigSid ( busHandoverPrepare . getConfigSid ( ) ) ;
handoverInformationVo . setOrgPath ( busHandoverPrepare . getOrgSidPath ( ) ) ;
handoverInformationVo . setCustomerName ( busHandoverPrepare . getCustomerName ( ) ) ;
handoverInformationVo . setContractNo ( busHandoverPrepare . getContractNo ( ) ) ;
handoverInformationVo . setSid ( busHandoverPrepareVehicle . getSid ( ) ) ;
BusVehicleInformationHandover busVehicleInformationHandover = busVehicleInformationHandoverService . getVehicleInformationInfo ( busHandoverPrepareVehicle . getVinSid ( ) ) ;
if ( busVehicleInformationHandover ! = null ) {
handoverInformationVo . setContractNo ( busVehicleInformationHandover . getContractNo ( ) ) ;
handoverInformationVo . setCustomerName ( busVehicleInformationHandover . getCustomerName ( ) ) ;
handoverInformationVo . setVinNo ( busVehicleInformationHandover . getVinNo ( ) ) ;
handoverInformationVo . setModel ( busVehicleInformationHandover . getModel ( ) ) ;
//根据随车资料主表sid查询随车资料的记录
List < HandoverInformationIntemVo > list = busVehicleInformationService . selectByMainSid ( busVehicleInformationHandover . getSid ( ) ) ;
list . removeAll ( Collections . singleton ( null ) ) ;
handoverInformationVo . setItem List ( list ) ;
handoverInformationVo . setRecordList ( list ) ;
}
return rb . success ( ) . setData ( handoverInformationVo ) ;
}
@ -600,6 +608,53 @@ public class BusHandoverPrepareService extends MybatisBaseService<BusHandoverPre
}
public ResultBean saveRemarks ( RemarkDto dto ) {
return null ;
ResultBean rb = ResultBean . fireFail ( ) ;
BusHandoverPrepareVehicle busHandoverPrepareVehicle = busHandoverPrepareVehicleService . fetchBySid ( dto . getSid ( ) ) ;
busHandoverPrepareVehicle . setRemarks ( dto . getRemarks ( ) ) ;
busHandoverPrepareVehicleService . updateById ( busHandoverPrepareVehicle ) ;
return rb . success ( ) ;
}
public ResultBean saveState ( AppStateDateDto dto ) {
ResultBean rb = ResultBean . fireFail ( ) ;
BusHandoverPrepareVehicle busHandoverPrepareVehicle = busHandoverPrepareVehicleService . fetchBySid ( dto . getSid ( ) ) ;
BusHandoverPrepare busHandoverPrepare = fetchBySid ( busHandoverPrepareVehicle . getMainSid ( ) ) ;
if ( "01" . equals ( dto . getKey ( ) ) ) {
//发票确认:确认时更新接收记录的接收日期及接收备注,如果发票移交状态为移交中的,则更新为已移交。
busHandoverPrepareVehicle . setInvoicingState ( 1 ) ;
//根据车辆sid查询移交记录
ResultBean < BusTransferRecords > busTransferRecordsResultBean = busTransferRecordsService . selectByVinSid ( busHandoverPrepareVehicle . getVinSid ( ) , busHandoverPrepare . getCreateBySid ( ) , BusTransferRecordEnum . FP . getCode ( ) ) ;
if ( busTransferRecordsResultBean . getData ( ) ! = null ) {
BusTransferRecords busTransferRecords = busTransferRecordsResultBean . getData ( ) ;
busTransferRecords . setReceiveRemarks ( dto . getRemarks ( ) ) ;
busTransferRecords . setReceiveTime ( new Date ( ) ) ;
busTransferRecordsService . updateById ( busTransferRecords ) ;
}
//更新发票的移交状态为已移交
StateUpdateQuery stateUpdateQuery = new StateUpdateQuery ( ) ;
stateUpdateQuery . setVinSid ( busHandoverPrepareVehicle . getVinSid ( ) ) ;
stateUpdateQuery . setTransferState ( CertificState . TransferState . TRANSTATE_YYJ . getRemarks ( ) ) ;
stateUpdateQuery . setTransferStateKey ( CertificState . TransferState . TRANSTATE_YYJ . getCode ( ) ) ;
finVehicleInvoiceFeign . updateYjState ( stateUpdateQuery ) ;
} else if ( "02" . equals ( dto . getKey ( ) ) ) {
//合格证确认:确认接收后,修改合格证的移交状态为已移交。
busHandoverPrepareVehicle . setCertificateState ( 1 ) ;
//根据车辆sid查询移交记录
ResultBean < BusTransferRecords > busTransferRecordsResultBean = busTransferRecordsService . selectByVinSid ( busHandoverPrepareVehicle . getVinSid ( ) , busHandoverPrepare . getCreateBySid ( ) , BusTransferRecordEnum . HGZ . getCode ( ) ) ;
if ( busTransferRecordsResultBean . getData ( ) ! = null ) {
BusTransferRecords busTransferRecords = busTransferRecordsResultBean . getData ( ) ;
busTransferRecords . setReceiveRemarks ( dto . getRemarks ( ) ) ;
busTransferRecords . setReceiveTime ( new Date ( ) ) ;
busTransferRecordsService . updateById ( busTransferRecords ) ;
}
//修改合格证的移交状态为已移交
CertificateStateQuery certificateStateQuery = new CertificateStateQuery ( ) ;
certificateStateQuery . setVinSid ( busHandoverPrepareVehicle . getVinSid ( ) ) ;
certificateStateQuery . setTransferStateKey ( CertificState . TransferState . TRANSTATE_YYJ . getCode ( ) ) ;
certificateStateQuery . setTransferStateValue ( CertificState . TransferState . TRANSTATE_YYJ . getRemarks ( ) ) ;
baseVehicleCertificateFeign . updateYjState ( certificateStateQuery ) ;
}
return rb . success ( ) ;
}
}