Commit 83aaa1e4 authored by hanfeng's avatar hanfeng

Merge branch 'master-background-manager' into dev

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