@ -278,7 +278,7 @@ public class BusHandoverPrepareService extends MybatisBaseService<BusHandoverPre
String sid = query . getSid ( ) ;
AppBusHandoverPrepareInfoVo appBusHandoverPrepareInfoVo = new AppBusHandoverPrepareInfoVo ( ) ;
BusHandoverPrepare busHandoverPrepare = fetchBySid ( sid ) ;
if ( busHandoverPrepare = = null ) {
if ( busHandoverPrepare = = null ) {
return rb . setMsg ( "该交车准备记录不存在" ) ;
}
BeanUtil . copyProperties ( busHandoverPrepare , appBusHandoverPrepareInfoVo ) ;
@ -320,6 +320,7 @@ public class BusHandoverPrepareService extends MybatisBaseService<BusHandoverPre
vo . setInvoiceAmount ( finVehicleInvoice . getInvoiceAmount ( ) . toString ( ) ) ;
vo . setInvoiceTitle ( finVehicleInvoice . getInvoiceTitle ( ) ) ;
vo . setInvoiceType ( finVehicleInvoice . getInvoiceType ( ) ) ;
vo . setInvoicingName ( finVehicleInvoice . getInvoicingName ( ) ) ;
vo . setDrawer ( finVehicleInvoice . getDrawer ( ) ) ;
if ( finVehicleInvoice . getInvoiceDate ( ) ! = null ) {
vo . setInvoiceDate ( DateUtil . format ( finVehicleInvoice . getInvoiceDate ( ) , "yyyy-MM-dd" ) ) ;
@ -329,6 +330,7 @@ public class BusHandoverPrepareService extends MybatisBaseService<BusHandoverPre
vo . setInvoiceImages ( filePathList ) ;
}
}
vo . setVinNo ( busHandoverPrepareVehicle . getVinNo ( ) ) ;
vo . setSid ( busHandoverPrepareVehicle . getVinSid ( ) ) ;
return rb . success ( ) . setData ( vo ) ;
}
@ -370,7 +372,7 @@ public class BusHandoverPrepareService extends MybatisBaseService<BusHandoverPre
public ResultBean < AppPolicyInfoVo > getPolicyInfo ( AppPolicyInfoQuery query ) {
ResultBean < AppPolicyInfoVo > rb = new ResultBean < > ( ) ;
BusHandoverPrepareVehicle busHandoverPrepareVehicle = busHandoverPrepareVehicleService . fetchBySid ( query . getSid ( ) ) ;
if ( busHandoverPrepareVehicle = = null ) {
if ( busHandoverPrepareVehicle = = null ) {
return rb . setMsg ( "该交车准备的车辆记录不存在" ) ;
}
AppPolicyInfoVo vo = new AppPolicyInfoVo ( ) ;
@ -404,7 +406,7 @@ public class BusHandoverPrepareService extends MybatisBaseService<BusHandoverPre
public ResultBean savePolicyInfo ( AppPolicyDto dto ) {
ResultBean rb = new ResultBean < > ( ) ;
BusHandoverPrepareVehicle busHandoverPrepareVehicle = busHandoverPrepareVehicleService . fetchBySid ( dto . getSid ( ) ) ;
if ( busHandoverPrepareVehicle = = null ) {
if ( busHandoverPrepareVehicle = = null ) {
return rb . setMsg ( "该交车准备车辆记录不存在" ) ;
}
busHandoverPrepareVehicle . setPolicyState ( 1 ) ;
@ -433,7 +435,7 @@ public class BusHandoverPrepareService extends MybatisBaseService<BusHandoverPre
public ResultBean < AppOtherDataInfoVo > getOtherDataInfo ( AppOtherDataInfoQuery query ) {
ResultBean < AppOtherDataInfoVo > rb = new ResultBean < > ( ) ;
BusHandoverPrepareVehicle busHandoverPrepareVehicle = busHandoverPrepareVehicleService . fetchBySid ( query . getSid ( ) ) ;
if ( busHandoverPrepareVehicle = = null ) {
if ( busHandoverPrepareVehicle = = null ) {
return rb . setMsg ( "该交车准备的车辆记录不存在" ) ;
}
AppOtherDataInfoVo vo = new AppOtherDataInfoVo ( ) ;
@ -463,7 +465,7 @@ public class BusHandoverPrepareService extends MybatisBaseService<BusHandoverPre
}
//修改该车辆的状态
BusHandoverPrepareVehicle busHandoverPrepareVehicle = busHandoverPrepareVehicleService . fetchBySid ( dto . getSid ( ) ) ;
if ( busHandoverPrepareVehicle = = null ) {
if ( busHandoverPrepareVehicle = = null ) {
return rb . setMsg ( "该交车准备的车辆记录不存在" ) ;
}
busHandoverPrepareVehicle . setOtherDataState ( 1 ) ;
@ -596,17 +598,17 @@ public class BusHandoverPrepareService extends MybatisBaseService<BusHandoverPre
if ( busVehicleInformationHandover ! = null ) {
List < BusVehicleInformation > busVehicleInformationList = busVehicleInformationService . selectByMainSids ( busVehicleInformationHandover . getSid ( ) ) ;
busVehicleInformationList . removeAll ( Collections . singleton ( null ) ) ;
if ( busVehicleInformationList . isEmpty ( ) ) {
if ( busVehicleInformationList . isEmpty ( ) ) {
return rb . setMsg ( "该交车准备的车辆信息的随车资料未准备好" ) ;
} else {
} else {
//根据随车资料主表sid查询随车资料的记录
List < HandoverInformationIntemVo > list = busVehicleInformationService . selectByMainSid ( busVehicleInformationHandover . getSid ( ) ) ;
list . removeAll ( Collections . singleton ( null ) ) ;
for ( int i = 0 ; i < list . size ( ) ; i + + ) {
HandoverInformationIntemVo handoverInformationIntemVo = list . get ( i ) ;
if ( StringUtils . isNotBlank ( handoverInformationIntemVo . getRecTime ( ) ) ) {
if ( StringUtils . isNotBlank ( handoverInformationIntemVo . getRecTime ( ) ) ) {
handoverInformationIntemVo . setShowBtn ( false ) ;
} else {
} else {
handoverInformationIntemVo . setShowBtn ( true ) ;
}
}
@ -619,24 +621,41 @@ public class BusHandoverPrepareService extends MybatisBaseService<BusHandoverPre
/ * *
* 随车资料确认
*
* @param sid
* @return
* /
public ResultBean updateVehicleInformation ( String sid ) {
public ResultBean updateVehicleInformation ( MaterialsQuery query ) {
ResultBean rb = ResultBean . fireFail ( ) ;
BusHandoverPrepareVehicle busHandoverPrepareVehicle = busHandoverPrepareVehicleService . fetchBySid ( sid ) ;
BusVehicleInformationHandover busVehicleInformationHandover = busVehicleInformationHandoverService . getVehicleInformationInfo ( busHandoverPrepareVehicle . getVinSid ( ) ) ;
if ( busVehicleInformationHandover ! = null ) {
//根据随车资料主表sid查询随车资料的记录
busVehicleInformationService . updateDate ( busVehicleInformationHandover . getSid ( ) , new Date ( ) ) ;
String sid = query . getSid ( ) ;
String remarks = query . getRemarks ( ) ;
boolean isTrue = false ;
BusVehicleInformation busVehicleInformation = busVehicleInformationService . fetchBySid ( sid ) ;
if ( busVehicleInformation ! = null ) {
busVehicleInformation . setRecTime ( new Date ( ) ) ;
if ( StringUtils . isNotBlank ( remarks ) ) {
busVehicleInformation . setRemarks ( remarks ) ;
}
busVehicleInformationService . updateById ( busVehicleInformation ) ;
BusVehicleInformationHandover busVehicleInformationHandover = busVehicleInformationHandoverService . fetchBySid ( busVehicleInformation . getHandoverSid ( ) ) ;
if ( busVehicleInformationHandover . getCompleteState ( ) = = 1 ) { //已完成
isTrue = true ;
}
busVehicleInformationHandover . setTransferStateKey ( CertificState . TransferState . TRANSTATE_YYJ . getCode ( ) ) ;
busVehicleInformationHandover . setTransferStateValue ( CertificState . TransferState . TRANSTATE_YYJ . getRemarks ( ) ) ;
busVehicleInformationHandoverService . updateById ( busVehicleInformationHandover ) ;
}
if ( isTrue ) { //若已完成,则更新状态为已确认
BusHandoverPrepareVehicle busHandoverPrepareVehicle = busHandoverPrepareVehicleService . fetchBySid ( query . getBusSid ( ) ) ;
busHandoverPrepareVehicle . setOnBoardDataState ( 1 ) ;
busHandoverPrepareVehicleService . updateById ( busHandoverPrepareVehicle ) ;
}
return rb . success ( ) ;
}
public ResultBean saveRemarks ( RemarkDto dto ) {
ResultBean rb = ResultBean . fireFail ( ) ;
BusHandoverPrepareVehicle busHandoverPrepareVehicle = busHandoverPrepareVehicleService . fetchBySid ( dto . getSid ( ) ) ;
if ( busHandoverPrepareVehicle = = null ) {
if ( busHandoverPrepareVehicle = = null ) {
return rb . setMsg ( "该记录不存在" ) ;
}
busHandoverPrepareVehicle . setRemarks ( dto . getRemarks ( ) ) ;