Commit f84a1001 authored by hanfeng's avatar hanfeng

Merge branch 'master-background-manager' into base-modify

parents 335529e3 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,9 +26,9 @@ public class VehicleExcelVo { ...@@ -27,9 +26,9 @@ public class VehicleExcelVo {
/** /**
* * 用途名称
*/ */
private String useType; 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<VehicleExcelVo> 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);
...@@ -42,10 +41,10 @@ public class VehicleInformationDownloadBiz extends BaseBiz<VehicleMapper, Vehicl ...@@ -42,10 +41,10 @@ public class VehicleInformationDownloadBiz extends BaseBiz<VehicleMapper, Vehicl
params.put("companyList", Arrays.asList(-1)); params.put("companyList", Arrays.asList(-1));
} }
return mapper.getVehicleExcelVoNotAllData(params); return mapper.getByPageNotAllData(params);
} }
public List<VehicleExcelVo> 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);
//处理预定日期相关参数 //处理预定日期相关参数
...@@ -54,10 +53,10 @@ public class VehicleInformationDownloadBiz extends BaseBiz<VehicleMapper, Vehicl ...@@ -54,10 +53,10 @@ public class VehicleInformationDownloadBiz extends BaseBiz<VehicleMapper, Vehicl
if (vehiclePageQueryVo.getModelId() == null) { if (vehiclePageQueryVo.getModelId() == null) {
params.remove("modelId"); params.remove("modelId");
} }
return mapper.getVehicleExcelVo(params); return mapper.getByPage(params);
} }
//getResultVehicleVoList
public List<VehicleExcelVo> getList(String vehiclePageQueryVoJson, UserDTO userDTO) { public List<ResultVehicleVo> getResultVehicleVoList(String vehiclePageQueryVoJson, UserDTO userDTO) {
VehiclePageQueryVo vehiclePageQueryVo = new VehiclePageQueryVo(); VehiclePageQueryVo vehiclePageQueryVo = new VehiclePageQueryVo();
try { try {
if (StringUtils.isNotBlank(vehiclePageQueryVoJson)){ if (StringUtils.isNotBlank(vehiclePageQueryVoJson)){
...@@ -75,4 +74,22 @@ public class VehicleInformationDownloadBiz extends BaseBiz<VehicleMapper, Vehicl ...@@ -75,4 +74,22 @@ public class VehicleInformationDownloadBiz extends BaseBiz<VehicleMapper, Vehicl
} }
return new ArrayList(); return new ArrayList();
} }
public List<VehicleExcelVo> getList(String vehiclePageQueryVoJson, UserDTO userDTO) throws Exception {
List<ResultVehicleVo> resultVehicleVoList = getResultVehicleVoList(vehiclePageQueryVoJson, userDTO);
ArrayList<VehicleExcelVo> arrayList = Lists.newArrayList();
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;
}
} }
...@@ -16,9 +16,7 @@ public interface VehicleMapper extends Mapper<Vehicle> { ...@@ -16,9 +16,7 @@ public interface VehicleMapper extends Mapper<Vehicle> {
public List<ResultVehicleVo> getByPageNotAllData(Map<String, Object> params); public List<ResultVehicleVo> getByPageNotAllData(Map<String, Object> params);
List<VehicleExcelVo> getVehicleExcelVo(Map<String, Object> params);
List<VehicleExcelVo> getVehicleExcelVoNotAllData(Map<String, Object> params);
public int updateStatusById(Map<String, Object> params); public int updateStatusById(Map<String, Object> params);
......
...@@ -51,7 +51,7 @@ public class VehicleInformationDownloadController extends BaseController<Vehicle ...@@ -51,7 +51,7 @@ public class VehicleInformationDownloadController extends BaseController<Vehicle
writer.addHeaderAlias("numberPlate", "车牌号"); writer.addHeaderAlias("numberPlate", "车牌号");
writer.addHeaderAlias("code", "车辆编码"); writer.addHeaderAlias("code", "车辆编码");
writer.addHeaderAlias("vehicleType", "车型"); writer.addHeaderAlias("vehicleType", "车型");
writer.addHeaderAlias("useType", "用途"); writer.addHeaderAlias("useTypeName", "用途");
writer.addHeaderAlias("parkBranchCompanyName", "停靠分公司"); writer.addHeaderAlias("parkBranchCompanyName", "停靠分公司");
// 一次性写出内容,使用默认样式,强制输出标题 // 一次性写出内容,使用默认样式,强制输出标题
writer.write(rows, true); writer.write(rows, true);
......
...@@ -71,6 +71,7 @@ ...@@ -71,6 +71,7 @@
v.update_time, v.update_time,
v.model_id, v.model_id,
v.mileage_last_update as mileage, v.mileage_last_update as mileage,
c.val as useTypeName,
vm.name as vehicleType vm.name as vehicleType
<if test=" yearMonthAndParam != null "> <if test=" yearMonthAndParam != null ">
,vbi.booked_date ,vbi.booked_date
...@@ -89,6 +90,7 @@ ...@@ -89,6 +90,7 @@
LEFT JOIN vehicle_book_record v2 on v2.id = (select id from vehicle_book_record where vehicle_id = v.id order by update_time DESC LIMIT 1) LEFT JOIN vehicle_book_record v2 on v2.id = (select id from vehicle_book_record where vehicle_id = v.id order by update_time DESC LIMIT 1)
LEFT JOIN vehicle_departure_log v3 on v2.id = v3.book_record_id LEFT JOIN vehicle_departure_log v3 on v2.id = v3.book_record_id
LEFT JOIN vehicle_model vm ON v.model_id = vm.id LEFT JOIN vehicle_model vm ON v.model_id = vm.id
LEFT JOIN (select * from constant where type = 2) c ON v.use_type = c.code
where where
v.is_del=0 v.is_del=0
<if test="mRangeDateEnd !=null"> <if test="mRangeDateEnd !=null">
...@@ -214,6 +216,7 @@ ...@@ -214,6 +216,7 @@
v.update_time, v.update_time,
v.model_id, v.model_id,
v.mileage_last_update as mileage, v.mileage_last_update as mileage,
c.val as useTypeName,
vm.name as vehicleType vm.name as vehicleType
<if test=" yearMonthAndParam !=null "> <if test=" yearMonthAndParam !=null ">
,vbi.booked_date ,vbi.booked_date
...@@ -232,6 +235,7 @@ ...@@ -232,6 +235,7 @@
LEFT JOIN vehicle_book_record v2 on v2.id = (select id from vehicle_book_record where vehicle_id = v.id order by update_time DESC LIMIT 1) LEFT JOIN vehicle_book_record v2 on v2.id = (select id from vehicle_book_record where vehicle_id = v.id order by update_time DESC LIMIT 1)
LEFT JOIN vehicle_departure_log v3 on v2.id = v3.book_record_id LEFT JOIN vehicle_departure_log v3 on v2.id = v3.book_record_id
LEFT JOIN vehicle_model vm ON v.model_id = vm.id LEFT JOIN vehicle_model vm ON v.model_id = vm.id
LEFT JOIN (select * from constant where type = 2) c ON v.use_type = c.code
where where
v.is_del=0 v.is_del=0
<if test="companyList != null"> <if test="companyList != null">
......
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