| | |
| | | package com.stylefeng.guns.modular.system.controller.general; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | import com.stylefeng.guns.core.beetl.ShiroExtUtil; |
| | |
| | | import org.springframework.web.bind.annotation.RequestMethod; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.util.*; |
| | |
| | | |
| | | @Autowired |
| | | private ITDriverService tDriverService; |
| | | |
| | | |
| | | @Autowired |
| | | private ITOrderTaxiService tOrderTaxiService; |
| | | |
| | | |
| | | @Autowired |
| | | private ITCarService tCarService; |
| | | |
| | | |
| | | @Autowired |
| | | private ITTaxiCardService taxiCardService; |
| | | |
| | | @Autowired |
| | | private RedisTemplate redisTemplate; |
| | | |
| | | |
| | | @Resource |
| | | private RedisTemplate<String, Object> redisTemplate; |
| | | |
| | | @Autowired |
| | | private IUserService userService; |
| | | |
| | | |
| | | @Autowired |
| | | private ITCompanyService tCompanyService; |
| | | |
| | | |
| | | @Autowired |
| | | private ITCarBrandService carBrandService; |
| | | |
| | | |
| | | @Autowired |
| | | private ITCarModelService carModelService; |
| | | |
| | |
| | | public Object getDriverPosition(Integer companyId){ |
| | | Integer id = ShiroExtUtil.getUser().getId(); |
| | | User user = userService.selectById(id); |
| | | if(companyId == null && user.getRoleType() != 1){ |
| | | if (companyId == null && user.getRoleType() != 1) { |
| | | companyId = user.getObjectId(); |
| | | } |
| | | Wrapper<TDriver> ne = new EntityWrapper<TDriver>().eq("authState", 2).eq("state", 2).ne("flag", 3); |
| | | if(companyId != null){ |
| | | if (companyId != null) { |
| | | ne.eq("companyId", companyId).or().eq("franchiseeId", companyId); |
| | | } |
| | | List<TDriver> tDrivers = tDriverService.selectList(ne); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | List<Object> list = new ArrayList<>(); |
| | | for(TDriver tDriver : tDrivers){ |
| | | System.out.println(tDrivers.toString()); |
| | | for (TDriver tDriver : tDrivers) { |
| | | Map<String, Object> d = new HashMap<>(); |
| | | String value = (String)redisTemplate.opsForValue().get("DRIVER" + tDriver.getId()); |
| | | if(ToolUtil.isEmpty(value)){ |
| | | String value = (String) redisTemplate.opsForValue().get("DRIVER" + tDriver.getId()); |
| | | System.out.println(value); |
| | | if (ToolUtil.isEmpty(value)) { |
| | | continue; |
| | | } |
| | | d.put("driver", tDriver); |