Commit 44678827 authored by hanfeng's avatar hanfeng

添加车辆信息下载

parent 0937758d
......@@ -5,7 +5,7 @@ import lombok.Data;
import java.util.Date;
@Data
public class ResultVehicleVo {
public class ResultVehicleVo {
/**
* 主键(uuid)
*/
......@@ -55,6 +55,8 @@ public class ResultVehicleVo {
*/
private String parkBranchCompanyName;
/**
* 目的地分支机构(id)
*/
......@@ -70,6 +72,12 @@ public class ResultVehicleVo {
*/
private Integer useType;
/**
* 用途名称
*/
private String useTypeName;
/**
* 备注信息
*/
......
......@@ -2,11 +2,10 @@ package com.xxfc.platform.vehicle.pojo;
import lombok.Data;
import java.util.HashMap;
import java.util.Map;
@Data
public class VehicleExcelVo {
public class VehicleExcelVo {
/**
......@@ -27,7 +26,7 @@ public class VehicleExcelVo {
/**
*
* 用途名称
*/
private String useTypeName;
......
package com.xxfc.platform.vehicle.biz;
import com.alibaba.fastjson.JSON;
import com.github.pagehelper.PageHelper;
import com.github.wxiaoqi.security.admin.feign.UserFeign;
import com.github.wxiaoqi.security.admin.feign.dto.UserDTO;
import com.github.wxiaoqi.security.common.biz.BaseBiz;
import com.google.common.collect.Lists;
......@@ -11,19 +9,20 @@ import com.xxfc.platform.vehicle.mapper.VehicleMapper;
import com.xxfc.platform.vehicle.pojo.ResultVehicleVo;
import com.xxfc.platform.vehicle.pojo.VehicleExcelVo;
import com.xxfc.platform.vehicle.pojo.VehiclePageQueryVo;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.beanutils.BeanUtilsBean;
import org.apache.commons.beanutils.PropertyUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
@Service
@Slf4j
public class VehicleInformationDownloadBiz extends BaseBiz<VehicleMapper, Vehicle> {
@Autowired
......@@ -32,7 +31,7 @@ public class VehicleInformationDownloadBiz extends BaseBiz<VehicleMapper, Vehicl
public List<ResultVehicleVo> getByPageNotAllData(VehiclePageQueryVo vehiclePageQueryVo, List<Integer> companyList) throws Exception {
public List getByPageNotAllData(VehiclePageQueryVo vehiclePageQueryVo, List<Integer> companyList) throws Exception {
Map<String, Object> params = PropertyUtils.describe(vehiclePageQueryVo);
//处理预定日期相关参数
vehicleBiz.adjustBookedInfoParam(params, vehiclePageQueryVo);
......@@ -45,7 +44,7 @@ public class VehicleInformationDownloadBiz extends BaseBiz<VehicleMapper, Vehicl
return mapper.getByPageNotAllData(params);
}
public List<ResultVehicleVo> getByPage(VehiclePageQueryVo vehiclePageQueryVo) throws Exception {
public List getByPage(VehiclePageQueryVo vehiclePageQueryVo) throws Exception {
Map<String, Object> params = PropertyUtils.describe(vehiclePageQueryVo);
//处理预定日期相关参数
......@@ -56,7 +55,7 @@ public class VehicleInformationDownloadBiz extends BaseBiz<VehicleMapper, Vehicl
}
return mapper.getByPage(params);
}
//getResultVehicleVoList
public List<ResultVehicleVo> getResultVehicleVoList(String vehiclePageQueryVoJson, UserDTO userDTO) {
VehiclePageQueryVo vehiclePageQueryVo = new VehiclePageQueryVo();
try {
......@@ -80,11 +79,16 @@ public class VehicleInformationDownloadBiz extends BaseBiz<VehicleMapper, Vehicl
public List<VehicleExcelVo> getList(String vehiclePageQueryVoJson, UserDTO userDTO) throws Exception {
List<ResultVehicleVo> resultVehicleVoList = getResultVehicleVoList(vehiclePageQueryVoJson, userDTO);
ArrayList<VehicleExcelVo> arrayList = Lists.newArrayList();
for (ResultVehicleVo resultVehicleVo : resultVehicleVoList) {
VehicleExcelVo vehicleExcelVo = new VehicleExcelVo();
BeanUtilsBean.getInstance().copyProperties(vehicleExcelVo,resultVehicleVo);
arrayList.add(vehicleExcelVo);
}
resultVehicleVoList.parallelStream().forEach(result->{
try {
VehicleExcelVo vehicleExcelVo = new VehicleExcelVo();
BeanUtilsBean.getInstance().copyProperties(vehicleExcelVo,result);
arrayList.add(vehicleExcelVo);
} catch (Exception e) {
log.error(e.getMessage());
e.printStackTrace();
}
});
return arrayList;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment