@ -67,6 +67,7 @@ import org.springframework.stereotype.Service;
import java.util.ArrayList ;
import java.util.Collections ;
import java.util.Date ;
import java.util.List ;
/ * *
@ -425,12 +426,19 @@ public class BusHandoverPrepareService extends MybatisBaseService<BusHandoverPre
List < AppBusHandoverPrepareVehicleDto > handoverPrepareVehicleDtos = dto . getCarDataList ( ) ;
if ( handoverPrepareVehicleDtos . size ( ) > 0 ) {
String sid = dto . getSid ( ) ;
busHandoverPrepareVehicleService . deleteByMainSid ( sid ) ;
// busHandoverPrepareVehicleService.deleteByMainSid(sid);
for ( AppBusHandoverPrepareVehicleDto handoverPrepareVehicleDto : handoverPrepareVehicleDtos ) {
BusHandoverPrepareVehicle busHandoverPrepareVehicle = new BusHandoverPrepareVehicle ( ) ;
/ * BusHandoverPrepareVehicle busHandoverPrepareVehicle = new BusHandoverPrepareVehicle ( ) ;
BeanUtil . copyProperties ( handoverPrepareVehicleDto , busHandoverPrepareVehicle ) ;
busHandoverPrepareVehicle . setMainSid ( busHandoverPrepare . getSid ( ) ) ;
busHandoverPrepareVehicleService . save ( busHandoverPrepareVehicle ) ;
busHandoverPrepareVehicleService . save ( busHandoverPrepareVehicle ) ; * /
BusHandoverPrepareVehicle busHandoverPrepareVehicle = busHandoverPrepareVehicleService . fetchBySid ( handoverPrepareVehicleDto . getSid ( ) ) ;
busHandoverPrepareVehicle . setInvoicingState ( handoverPrepareVehicleDto . isInvoicingState ( ) ? 1 : 0 ) ;
busHandoverPrepareVehicle . setCertificateState ( handoverPrepareVehicleDto . isCertificateState ( ) ? 1 : 0 ) ;
busHandoverPrepareVehicle . setOnBoardDataState ( handoverPrepareVehicleDto . isOnBoardDataState ( ) ? 1 : 0 ) ;
busHandoverPrepareVehicle . setOtherDataState ( handoverPrepareVehicleDto . isOtherDataState ( ) ? 1 : 0 ) ;
busHandoverPrepareVehicle . setPolicyState ( handoverPrepareVehicleDto . isPolicyState ( ) ? 1 : 0 ) ;
busHandoverPrepareVehicleService . updateById ( busHandoverPrepareVehicle ) ;
}
}
updateById ( busHandoverPrepare ) ;
@ -468,12 +476,19 @@ public class BusHandoverPrepareService extends MybatisBaseService<BusHandoverPre
List < AppBusHandoverPrepareVehicleDto > handoverPrepareVehicleDtos = dto . getCarDataList ( ) ;
if ( handoverPrepareVehicleDtos . size ( ) > 0 ) {
String sid = dto . getSid ( ) ;
busHandoverPrepareVehicleService . deleteByMainSid ( sid ) ;
// busHandoverPrepareVehicleService.deleteByMainSid(sid);
for ( AppBusHandoverPrepareVehicleDto handoverPrepareVehicleDto : handoverPrepareVehicleDtos ) {
BusHandoverPrepareVehicle busHandoverPrepareVehicle = new BusHandoverPrepareVehicle ( ) ;
BusHandoverPrepareVehicle busHandoverPrepareVehicle = busHandoverPrepareVehicleService . fetchBySid ( handoverPrepareVehicleDto . getSid ( ) ) ;
busHandoverPrepareVehicle . setInvoicingState ( handoverPrepareVehicleDto . isInvoicingState ( ) ? 1 : 0 ) ;
busHandoverPrepareVehicle . setCertificateState ( handoverPrepareVehicleDto . isCertificateState ( ) ? 1 : 0 ) ;
busHandoverPrepareVehicle . setOnBoardDataState ( handoverPrepareVehicleDto . isOnBoardDataState ( ) ? 1 : 0 ) ;
busHandoverPrepareVehicle . setOtherDataState ( handoverPrepareVehicleDto . isOtherDataState ( ) ? 1 : 0 ) ;
busHandoverPrepareVehicle . setPolicyState ( handoverPrepareVehicleDto . isPolicyState ( ) ? 1 : 0 ) ;
busHandoverPrepareVehicleService . updateById ( busHandoverPrepareVehicle ) ;
/ * BusHandoverPrepareVehicle busHandoverPrepareVehicle = new BusHandoverPrepareVehicle ( ) ;
BeanUtil . copyProperties ( handoverPrepareVehicleDto , busHandoverPrepareVehicle ) ;
busHandoverPrepareVehicle . setMainSid ( busHandoverPrepare . getSid ( ) ) ;
busHandoverPrepareVehicleService . save ( busHandoverPrepareVehicle ) ;
busHandoverPrepareVehicleService . save ( busHandoverPrepareVehicle ) ; * /
BusHandoverWaitDto busHandoverWaitDto = new BusHandoverWaitDto ( ) ;
busHandoverWaitDto . setContractNo ( busHandoverPrepare . getContractNo ( ) ) ;
@ -486,6 +501,8 @@ public class BusHandoverPrepareService extends MybatisBaseService<BusHandoverPre
busHandoverWaitDto . setModelSid ( data . getModelSid ( ) ) ;
busHandoverWaitDto . setModelName ( data . getModelName ( ) ) ;
}
busHandoverWaitDto . setPayStateKey ( busHandoverPrepareVehicle . getSubscriptionKey ( ) ) ;
busHandoverWaitDto . setPayStateValue ( busHandoverPrepareVehicle . getSubscription ( ) ) ;
busHandoverWaitDto . setUseOrgSid ( busHandoverPrepare . getUseOrgSid ( ) ) ;
busHandoverWaitDto . setPayTypeKey ( busHandoverPrepare . getPayTypeKey ( ) ) ;
busHandoverWaitDto . setPayTypeValue ( busHandoverPrepare . getPayType ( ) ) ;
@ -498,12 +515,17 @@ public class BusHandoverPrepareService extends MybatisBaseService<BusHandoverPre
return rb . success ( ) ;
}
/ * *
* 交车准备获取随车资料
* @param sid
* @return
* /
public ResultBean < HandoverInformationVo > getVehicleInformationInfo ( String sid ) {
ResultBean < HandoverInformationVo > rb = ResultBean . fireFail ( ) ;
HandoverInformationVo handoverInformationVo = new HandoverInformationVo ( ) ;
BusHandoverPrepareVehicle busHandoverPrepareVehicle = busHandoverPrepareVehicleService . fetchBySid ( sid ) ;
BusVehicleInformationHandover busVehicleInformationHandover = busVehicleInformationHandoverService . getVehicleInformationInfo ( busHandoverPrepareVehicle . getVinSid ( ) ) ;
if ( busVehicleInformationHandover ! = null ) {
if ( busVehicleInformationHandover ! = null ) {
handoverInformationVo . setContractNo ( busVehicleInformationHandover . getContractNo ( ) ) ;
handoverInformationVo . setCustomerName ( busVehicleInformationHandover . getCustomerName ( ) ) ;
handoverInformationVo . setVinNo ( busVehicleInformationHandover . getVinNo ( ) ) ;
@ -515,4 +537,21 @@ public class BusHandoverPrepareService extends MybatisBaseService<BusHandoverPre
}
return rb . success ( ) . setData ( handoverInformationVo ) ;
}
/ * *
* 随车资料确认
*
* @param sid
* @return
* /
public ResultBean updateVehicleInformation ( String sid ) {
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 ( ) ) ;
}
return rb . success ( ) ;
}
}