| | |
| | | package com.stylefeng.guns.modular.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.stylefeng.guns.modular.system.dao.CarBrandMapper; |
| | | import com.stylefeng.guns.modular.system.dao.CarMapper; |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.*; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | |
| | | @Service |
| | |
| | | */ |
| | | @Override |
| | | public boolean idle(Integer id) throws Exception { |
| | | Driver driver = driverService.selectOne(new EntityWrapper<Driver>().eq("carId", id).in("authState", Arrays.asList(1, 2)).ne("flag", 3)); |
| | | return null == driver ? true : false; |
| | | Car car = this.selectById(id); |
| | | List<Map<String, Object>> list = carMapper.queryIdleData(car.getFranchiseeId() != null && car.getFranchiseeId() != 0 ? car.getFranchiseeId() : ( |
| | | car.getCompanyId() != null && car.getCompanyId() != 0 ? car.getCompanyId() : 1)); |
| | | for(Map<String, Object> map : list){ |
| | | Integer carId = Integer.valueOf(String.valueOf(map.get("id"))); |
| | | if(carId.compareTo(id) == 0){ |
| | | return true; |
| | | } |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | |