|
|
@@ -1,10 +1,12 @@ |
|
|
|
package com.taauav.admin.service.impl; |
|
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
import com.taauav.admin.query.TauvDriverQuery; |
|
|
|
import com.taauav.admin.service.ISysCityService; |
|
|
|
import com.taauav.admin.vo.TauvDriverListVo; |
|
|
|
import com.taauav.common.bean.Response; |
|
|
|
import com.taauav.admin.entity.SysAdmin; |
|
|
|
import com.taauav.admin.entity.TauvDriver; |
|
|
@@ -18,6 +20,7 @@ import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.util.StringUtils; |
|
|
|
|
|
|
|
import java.math.BigInteger; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
@@ -70,7 +73,28 @@ public class TauvDriverServiceImpl extends BaseServiceImpl<TauvDriverMapper, Tau |
|
|
|
queryWrapper.orderByDesc("id"); |
|
|
|
IPage<TauvDriver> page = new Page<>(query.getPage(), query.getPageSize()); |
|
|
|
IPage<TauvDriver> data = driverMapper.selectPage(page, queryWrapper); |
|
|
|
return response.success(data); |
|
|
|
List<TauvDriver> driverList = data.getRecords(); |
|
|
|
List<TauvDriverListVo> driverListVoList = new ArrayList<>(); |
|
|
|
if (!driverList.isEmpty()) { |
|
|
|
driverList.forEach(item -> { |
|
|
|
TauvDriverListVo driverListVo = new TauvDriverListVo(); |
|
|
|
// 拷贝属性 |
|
|
|
BeanUtil.copyProperties(item, driverListVo); |
|
|
|
// 区划名称 |
|
|
|
String cityName = cityService.getCityName(item.getDriverArea()); |
|
|
|
driverListVo.setDriverAreaName(cityName); |
|
|
|
driverListVoList.add(driverListVo); |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
// 返回结果 |
|
|
|
Map<String, Object> result = new HashMap<>(); |
|
|
|
result.put("total", data.getTotal()); |
|
|
|
result.put("size", data.getSize()); |
|
|
|
result.put("current", data.getCurrent()); |
|
|
|
result.put("pages", data.getPages()); |
|
|
|
result.put("records", driverListVoList); |
|
|
|
return response.success(result); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
@@ -191,7 +215,7 @@ public class TauvDriverServiceImpl extends BaseServiceImpl<TauvDriverMapper, Tau |
|
|
|
TauvDriver driver = new TauvDriver(); |
|
|
|
Map<String, Object> map = new HashMap<>(3); |
|
|
|
map.put("type_list", driver.getTypeList()); |
|
|
|
map.put("area_list", cityService.getCityList(BigInteger.valueOf(Long.valueOf("320117")), false)); |
|
|
|
map.put("area_list", cityService.getCityList(BigInteger.valueOf(Long.valueOf("320117")), true)); |
|
|
|
map.put("level_list", driver.getLevelList()); |
|
|
|
return map; |
|
|
|
} |