| | |
| | | package com.stylefeng.guns.modular.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | import com.stylefeng.guns.modular.system.dao.DriverOnlineMapper; |
| | | import com.stylefeng.guns.modular.system.model.DriverOnline; |
| | | import com.stylefeng.guns.modular.system.service.IDriverOnlineService; |
| | | import com.stylefeng.guns.modular.system.util.RedisUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | |
| | | |
| | | |
| | | |
| | | @Autowired |
| | | private RedisUtil redisUtil; |
| | | /** |
| | | * 获取列表数据 |
| | | * @param name |
| | |
| | | public Map<String, Object> queryOnlineDriver(String name, String phone, Integer offset, Integer limit) throws Exception { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | List<Map<String, Object>> list = driverOnlineMapper.queryOnlineDriver(name, phone, offset, limit); |
| | | int i = driverOnlineMapper.queryOnlineDriverCount(name, phone); |
| | | map.put("rows", list); |
| | | int i = 0 ; |
| | | List<Map<String, Object>> res = new ArrayList<>(); |
| | | System.err.println("执行queryOnlineDriver==============》"+list); |
| | | for (Map<String, Object> stringObjectMap : list) { |
| | | String value1 = redisUtil.getValue("DRIVER" + stringObjectMap.get("id")); |
| | | if(ToolUtil.isEmpty(value1)){ |
| | | continue; |
| | | } |
| | | System.err.println("添加-"+value1); |
| | | res.add(stringObjectMap); |
| | | i++; |
| | | } |
| | | // int i = driverOnlineMapper.queryOnlineDriverCount(name, phone); |
| | | map.put("rows", res); |
| | | map.put("total", i); |
| | | return map; |
| | | } |