| | |
| | | package com.stylefeng.guns.modular.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.stylefeng.guns.modular.system.model.TDriver; |
| | | import com.stylefeng.guns.modular.system.dao.TDriverMapper; |
| | | import com.stylefeng.guns.modular.system.model.TDriverLine; |
| | | import com.stylefeng.guns.modular.system.model.TLine; |
| | | import com.stylefeng.guns.modular.system.service.ITDriverLineService; |
| | | import com.stylefeng.guns.modular.system.service.ITDriverService; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.stylefeng.guns.modular.system.service.ITLineService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | @Service |
| | | public class TDriverServiceImpl extends ServiceImpl<TDriverMapper, TDriver> implements ITDriverService { |
| | | |
| | | @Autowired |
| | | private ITDriverLineService driverLineService; |
| | | |
| | | @Autowired |
| | | private ITLineService lineService; |
| | | |
| | | |
| | | |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> getAuthDriverList(Page<Map<String, Object>> page, String beginTime, String endTime, String companyName, String phone, String account, Integer addType, Integer authState) { |
| | |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> getDriverList(Page<Map<String, Object>> page, Integer roleType,Integer nowUserId,String beginTime, String endTime, String companyName, String phone, String name, Integer addType, Integer authState) { |
| | | return this.baseMapper.getDriverList(page,roleType,nowUserId, beginTime, endTime, companyName, phone, name, addType, authState); |
| | | List<Map<String, Object>> driverList = this.baseMapper.getDriverList(page, roleType, nowUserId, beginTime, endTime, companyName, phone, name, addType, authState); |
| | | for (Map<String, Object> map : driverList) { |
| | | Integer id = Integer.valueOf(map.get("id").toString()); |
| | | List<TDriverLine> driverLines = driverLineService.selectList(new EntityWrapper<TDriverLine>().eq("driverId", id)); |
| | | List<Integer> collect = driverLines.stream().map(TDriverLine::getLineId).collect(Collectors.toList()); |
| | | if(collect.size() > 0){ |
| | | List<TLine> tLines = lineService.selectBatchIds(collect); |
| | | String collect1 = tLines.stream().map(TLine::getName).collect(Collectors.joining("<br/>")); |
| | | map.put("lineStr", collect1); |
| | | } |
| | | |
| | | } |
| | | return driverList; |
| | | } |
| | | |
| | | @Override |