Commit 098f6cb7 authored by hanfeng's avatar hanfeng

车辆详情列表下载

parent 8b81605f
......@@ -118,7 +118,7 @@ public class ResultVehicleVo {
/**
* 交强险公司
*/
private String strongInsuranceCompany;
private Integer strongInsuranceCompany;
/**
* 交强险单号
......
......@@ -79,7 +79,7 @@ public class VehicleExcelVo {
/**
* 商业险公司,见常量表
*/
private Integer insuranceCompany;
private String insuranceCompany;
/**
......
package com.xxfc.platform.vehicle.biz;
import com.alibaba.fastjson.JSON;
import com.github.wxiaoqi.security.admin.entity.Group;
import com.github.wxiaoqi.security.admin.feign.dto.UserDTO;
import com.github.wxiaoqi.security.common.biz.BaseBiz;
import com.google.common.collect.Lists;
import com.xxfc.platform.vehicle.entity.Constant;
import com.xxfc.platform.vehicle.entity.Vehicle;
import com.xxfc.platform.vehicle.mapper.VehicleMapper;
import com.xxfc.platform.vehicle.pojo.ResultVehicleVo;
......@@ -22,6 +24,7 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@Service
@Slf4j
......@@ -29,7 +32,8 @@ public class VehicleInformationDownloadBiz extends BaseBiz<VehicleMapper, Vehicl
@Autowired
private VehicleBiz vehicleBiz;
@Autowired
private ConstantBiz constantBiz;
@Autowired
private BranchCompanyVehicleCountBiz branchCompanyVehicleCountBiz;
......@@ -83,14 +87,15 @@ public class VehicleInformationDownloadBiz extends BaseBiz<VehicleMapper, Vehicl
public List<VehicleExcelVo> getList(String vehiclePageQueryVoJson, UserDTO userDTO) throws Exception {
List<Constant> constants = constantBiz.selectList(new Constant() {{
setType(3);
}});
Map<Integer, List<Constant>> map = constants.parallelStream().collect(Collectors.groupingBy(Constant::getCode));
List<ResultVehicleVo> resultVehicleVoList = getResultVehicleVoList(vehiclePageQueryVoJson, userDTO);
ArrayList<VehicleExcelVo> arrayList = Lists.newArrayList();
resultVehicleVoList.stream().forEach(result->{
try {
Integer belongTo = result.getBelongTo();
if (belongTo!=null&& belongTo==1) {
System.out.println(belongTo);
}
VehicleExcelVo build = VehicleExcelVo.builder()
.code(result.getCode())
.numberPlate(result.getNumberPlate())
......@@ -101,10 +106,10 @@ public class VehicleInformationDownloadBiz extends BaseBiz<VehicleMapper, Vehicl
.belongToName(result.getBelongTo()!=null&&result.getBelongTo()==1?"欣新房车有限公司":result.getBelongToName())
.vin(result.getVin())
.engineNum(result.getEngineNum())
.insuranceCompany(result.getInsuranceCompany())
.insuranceCompany(result.getInsuranceCompany()!=null?map.get(result.getInsuranceCompany()).get(0).getVal():null)
.insuranceNo(result.getInsuranceNo())
.insuranceEndDate(result.getInsuranceEndDate())
.strongInsuranceCompany(result.getStrongInsuranceCompany())
.strongInsuranceCompany(result.getStrongInsuranceCompany()!=null?map.get(result.getStrongInsuranceCompany()).get(0).getVal():null)
.strongInsuranceNo(result.getInsuranceNo())
.strongInsuranceEndDate(result.getStrongInsuranceEndDate())
.build();
......
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