分车型和全车型导出

This commit is contained in:
zhn
2023-08-21 18:06:12 +08:00
parent d5ed455691
commit 5bd07d6de5
6 changed files with 247 additions and 13 deletions
@@ -72,8 +72,9 @@ public class OtaManageApplyEOController extends JeroController<OtaManageApplyEO,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
String cut) {
IPage<OtaManageApplyEO> pageList = otaManageApplyEOService.getOtaCarPage(otaManageApplyEO,pageNo,pageSize,cut);
return Result.OK(pageList);
List<OtaManageApplyEO> list = otaManageApplyEOService.getOtaCarPage(otaManageApplyEO, cut);
Page pages = PageUtil.getPages(pageNo, pageSize, list);
return Result.OK(pages);
}
/**
* 下拉数据-软件版本,适用车型,市场
@@ -294,6 +295,28 @@ public class OtaManageApplyEOController extends JeroController<OtaManageApplyEO,
public ModelAndView otaExportXls(HttpServletRequest request, OtaManageApplyEO otaManageApplyEO) {
return otaManageApplyEOService.otaExportXls(request, otaManageApplyEO);
}
/**
* 全车型导出excel
*
* @param request
* @param otaManageApplyEO
*/
@RequestMapping(value = "/allCarExportXls")
@ApiOperation(value = "全车型导出excel", notes = "OTA管理导出excel")
public ModelAndView allCarExportXls(HttpServletRequest request, OtaManageApplyEO otaManageApplyEO) {
return otaManageApplyEOService.allCarExportXls(request, otaManageApplyEO);
}
/**
* 分车型导出excel
*
* @param request
* @param otaManageApplyEO
*/
@RequestMapping(value = "/oneCarExportXls")
@ApiOperation(value = "分车型导出excel", notes = "OTA管理导出excel")
public ModelAndView oneCarExportXls(HttpServletRequest request, OtaManageApplyEO otaManageApplyEO) {
return otaManageApplyEOService.oneCarExportXls(request, otaManageApplyEO);
}
}
@@ -202,5 +202,13 @@ public class OtaManageApplyEO implements Serializable {
@ApiModelProperty(value = "排序")
private java.lang.String orderBy;
@TableField(exist = false)
@ApiModelProperty(value = "导出文件名")
private String exportName;
@TableField(exist = false)
@ApiModelProperty(value = "中英文切换")
private String cut;
}
@@ -1,6 +1,5 @@
package com.jero.modules.ota.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.jero.modules.ota.entity.OtaManageApplyEO;
import com.jero.modules.ota.vo.VersionVO;
@@ -75,11 +74,9 @@ public interface IOtaManageApplyEOService extends IService<OtaManageApplyEO> {
/**
* 分车型列表-分页列表查询
* @param otaManageApplyEO
* @param pageNo
* @param pageSize
* @return
*/
IPage<OtaManageApplyEO> getOtaCarPage(OtaManageApplyEO otaManageApplyEO,Integer pageNo,Integer pageSize,String cut);
List<OtaManageApplyEO> getOtaCarPage(OtaManageApplyEO otaManageApplyEO,String cut);
/**
* 下拉数据-软件版本,适用车型,市场
* @return
@@ -125,4 +122,8 @@ public interface IOtaManageApplyEOService extends IService<OtaManageApplyEO> {
List<OtaManageApplyEO> getStatisticalStatus(String projectId, String plannedBpLaunchBatch, String cut);
ModelAndView otaExportXls(HttpServletRequest request, OtaManageApplyEO otaManageApplyEO);
ModelAndView allCarExportXls(HttpServletRequest request, OtaManageApplyEO otaManageApplyEO);
ModelAndView oneCarExportXls(HttpServletRequest request, OtaManageApplyEO otaManageApplyEO);
}
@@ -18,6 +18,8 @@ import com.jero.modules.ota.enums.OtaStatusEnum;
import com.jero.modules.ota.mapper.OtaManageApplyEOMapper;
import com.jero.modules.ota.service.IOtaManageApplyEOService;
import com.jero.modules.ota.service.IOtaManageHistoryService;
import com.jero.modules.ota.vo.AllCarExportVO;
import com.jero.modules.ota.vo.OneCarExportVO;
import com.jero.modules.ota.vo.OtaExportVO;
import com.jero.modules.ota.vo.VersionVO;
import com.jero.modules.project.entity.ProjectLibraryBase;
@@ -35,6 +37,7 @@ import com.jero.modules.system.service.impl.SysDictItemServiceImpl;
import com.jero.modules.system.util.StringUtils;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.poi.ss.formula.functions.T;
import org.apache.shiro.SecurityUtils;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
@@ -575,12 +578,10 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
/**
* 分车型列表-分页列表查询
* @param otaManageApplyEO
* @param pageNo
* @param pageSize
* @return
*/
@Override
public IPage<OtaManageApplyEO> getOtaCarPage(OtaManageApplyEO otaManageApplyEO, Integer pageNo, Integer pageSize,String cut) {
public List<OtaManageApplyEO> getOtaCarPage(OtaManageApplyEO otaManageApplyEO,String cut) {
List<OtaManageApplyEO> otaManageApplyEOList = otaManageApplyEOMapper.getOtaCarPage(otaManageApplyEO);
List<OtaManageApplyEO> list = new ArrayList<>();
String carMarket = otaManageApplyEO.getAppliedVehicleProject();
@@ -697,8 +698,7 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
//表头排序
heartSort(otaManageApplyEO, list);
}
Page pages = PageUtil.getPages(pageNo, pageSize, list);
return pages;
return list;
}
/**
@@ -1083,8 +1083,6 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
@Override
public ModelAndView otaExportXls(HttpServletRequest request, OtaManageApplyEO otaManageApplyEO) {
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
// Step.2 获取导出数据
List<OtaManageApplyEO> pageList = getOtaPage(otaManageApplyEO);
List<OtaManageApplyEO> exportList = null;
@@ -1113,7 +1111,68 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
mv.addObject(NormalExcelConstants.PARAMS,exportParams);
mv.addObject(NormalExcelConstants.DATA_LIST, dataList);
return mv;
}
@Override
public ModelAndView allCarExportXls(HttpServletRequest request, OtaManageApplyEO otaManageApplyEO) {
// Step.2 获取导出数据
List<OtaManageApplyEO> pageList = getOtaPage(otaManageApplyEO);
List<OtaManageApplyEO> exportList = null;
// 过滤选中数据
String selections = request.getParameter("selections");
if (oConvertUtils.isNotEmpty(selections)) {
List<String> selectionList = Arrays.asList(selections.split(","));
exportList = pageList.stream().filter(e -> selectionList.contains(e.getId())).collect(Collectors.toList());
} else {
exportList = pageList;
}
List<AllCarExportVO> dataList = new ArrayList<>();
for (OtaManageApplyEO manageApplyEO : exportList) {
AllCarExportVO allCarExportVO = new AllCarExportVO();
BeanUtils.copyProperties(manageApplyEO, allCarExportVO);
dataList.add(allCarExportVO);
}
// Step.3 AutoPoi 导出Excel
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
mv.addObject(NormalExcelConstants.CLASS, AllCarExportVO.class);
ExportParams exportParams=new ExportParams(otaManageApplyEO.getExportName(), null, otaManageApplyEO.getExportName());
mv.addObject(NormalExcelConstants.PARAMS,exportParams);
mv.addObject(NormalExcelConstants.DATA_LIST, dataList);
return mv;
}
@Override
public ModelAndView oneCarExportXls(HttpServletRequest request, OtaManageApplyEO otaManageApplyEO) {
// Step.2 获取导出数据
List<OtaManageApplyEO> pageList = getOtaCarPage(otaManageApplyEO,otaManageApplyEO.getCut());
List<OtaManageApplyEO> exportList = null;
// 过滤选中数据
String selections = request.getParameter("selections");
if (oConvertUtils.isNotEmpty(selections)) {
List<String> selectionList = Arrays.asList(selections.split(","));
exportList = pageList.stream().filter(e -> selectionList.contains(e.getId())).collect(Collectors.toList());
} else {
exportList = pageList;
}
List<OneCarExportVO> dataList = new ArrayList<>();
for (OtaManageApplyEO manageApplyEO : exportList) {
OneCarExportVO oneCarExportVO = new OneCarExportVO();
BeanUtils.copyProperties(manageApplyEO, oneCarExportVO);
dataList.add(oneCarExportVO);
}
// Step.3 AutoPoi 导出Excel
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
mv.addObject(NormalExcelConstants.CLASS, OneCarExportVO.class);
ExportParams exportParams=new ExportParams(otaManageApplyEO.getExportName(), null, otaManageApplyEO.getExportName());
mv.addObject(NormalExcelConstants.PARAMS,exportParams);
mv.addObject(NormalExcelConstants.DATA_LIST, dataList);
return mv;
}
@@ -0,0 +1,52 @@
package com.jero.modules.ota.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.jeecgframework.poi.excel.annotation.Excel;
/**
* @description
* @date 2023/8/9 11:28
* @auth zhn
*/
@Data
public class AllCarExportVO {
@Excel(name = "VDR", width = 15)
@ApiModelProperty(value = "VDR")
private java.lang.String vdr;
@Excel(name = "主题", width = 15)
@ApiModelProperty(value = "主题")
private java.lang.String summary;
@Excel(name = "VDR状态", width = 15)
@ApiModelProperty(value = "VDR状态")
private java.lang.String status;
@Excel(name = "认证影响", width = 15)
@ApiModelProperty(value = "认证影响")
private java.lang.String homologationImpact;
@Excel(name = "影响描述", width = 15)
@ApiModelProperty(value = "影响描述")
private java.lang.String homologation;
@Excel(name = "影响法规-CN", width = 15)
@ApiModelProperty(value = "影响法规-CN")
private java.lang.String impactCnHomo;
@Excel(name = "影响法规-EU", width = 15)
@ApiModelProperty(value = "影响法规-EU")
private java.lang.String impactEuHomo;
@Excel(name = "责任部门", width = 15)
@ApiModelProperty(value = "责任部门")
private java.lang.String masterDomain;
@Excel(name = "适用车型", width = 50)
@ApiModelProperty(value = "适用车型")
private java.lang.String appliedVehicleProject;
}
@@ -0,0 +1,91 @@
package com.jero.modules.ota.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
/**
* @description
* @date 2023/8/9 11:28
* @auth zhn
*/
@Data
public class OneCarExportVO {
@Excel(name = "VDR", width = 15)
@ApiModelProperty(value = "VDR")
private java.lang.String vdr;
@Excel(name = "主题", width = 15)
@ApiModelProperty(value = "主题")
private java.lang.String summary;
@Excel(name = "VDR状态", width = 15)
@ApiModelProperty(value = "VDR状态")
private java.lang.String status;
@Excel(name = "认证影响", width = 15)
@ApiModelProperty(value = "认证影响")
private java.lang.String homologationImpact;
@Excel(name = "影响说明", width = 15)
@ApiModelProperty(value = "影响说明")
private java.lang.String homologation;
@Excel(name = "影响法规-CN", width = 15)
@ApiModelProperty(value = "影响法规-CN")
private java.lang.String impactCnHomo;
@Excel(name = "影响法规-EU", width = 15)
@ApiModelProperty(value = "影响法规-EU")
private java.lang.String impactEuHomo;
@Excel(name = "责任部门", width = 15)
@ApiModelProperty(value = "责任部门")
private java.lang.String masterDomain;
@Excel(name = "R&H Studio", width = 15)
@ApiModelProperty(value = "R&H Studio")
private java.lang.String studioText;
@Excel(name = "项目版本", width = 15)
@ApiModelProperty(value = "项目版本")
private java.lang.String projectVersionText;
@Excel(name = "认证开始", width = 15)
@ApiModelProperty(value = "认证开始")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private Date attestationStartTime;
@Excel(name = "认证申报", width = 15)
@ApiModelProperty(value = "认证申报")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private Date certificationSubmission;
@Excel(name = "认证批准", width = 15)
@ApiModelProperty(value = "认证批准")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private Date attestationEndTime;
@Excel(name = "认证进度", width = 15)
@ApiModelProperty(value = "认证进度")
private java.lang.String attestationSchedule;
@Excel(name = "匹配状态", width = 15)
@ApiModelProperty(value = "匹配状态")
private java.lang.String matchStatusText;
@Excel(name = "备注", width = 15)
@ApiModelProperty(value = "备注")
private java.lang.String remark;
}