显示电池信息
This commit is contained in:
		| @ -1,13 +1,14 @@ | ||||
| package com.sczx.car.service.impl; | ||||
|  | ||||
| import com.sczx.car.convert.RentBatteyRuleConvert; | ||||
| import com.sczx.car.dto.RentBatteyRuleDTO; | ||||
| import com.sczx.car.po.RentBatteyRulePO; | ||||
| import com.sczx.car.repository.RentBatteyRuleRepo; | ||||
| import com.sczx.car.service.RentBatteyRuleService; | ||||
| import lombok.extern.slf4j.Slf4j; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.stereotype.Service; | ||||
| import org.springframework.util.CollectionUtils; | ||||
|  | ||||
| import java.util.List; | ||||
|  | ||||
| @Slf4j | ||||
| @Service | ||||
| @ -18,7 +19,11 @@ public class RentBatteyRuleServiceImpl implements RentBatteyRuleService { | ||||
|  | ||||
|     @Override | ||||
|     public RentBatteyRuleDTO getRentBatteyRuleByBatteyRuleId(Long carRuleId) { | ||||
|         RentBatteyRulePO rentBatteyRulePO = rentBatteyRuleRepo.getById(carRuleId); | ||||
|         return RentBatteyRuleConvert.INSTANCE.poToDto(rentBatteyRulePO); | ||||
| //        RentBatteyRulePO rentBatteyRulePO = rentBatteyRuleRepo.getById(carRuleId); | ||||
|         List<RentBatteyRuleDTO> rentBatteyRuleList = rentBatteyRuleRepo.queryRentBatteyRuleByCarRuleId(carRuleId.intValue()); | ||||
|         if(CollectionUtils.isEmpty(rentBatteyRuleList)){ | ||||
|             return null; | ||||
|         } | ||||
|         return rentBatteyRuleList.get(0); | ||||
|     } | ||||
| } | ||||
|  | ||||
		Reference in New Issue
	
	Block a user