OTA软件版本导出
This commit is contained in:
+18
-2
@@ -3,9 +3,11 @@ package com.jero.modules.ota.controller;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.aspect.annotation.AutoLog;
|
||||
import com.jero.common.system.base.controller.JeroController;
|
||||
import com.jero.common.util.PageUtil;
|
||||
import com.jero.modules.ota.entity.OtaManageApplyEO;
|
||||
import com.jero.modules.ota.service.IOtaManageApplyEOService;
|
||||
import com.jero.modules.ota.vo.VersionVO;
|
||||
@@ -50,8 +52,9 @@ public class OtaManageApplyEOController extends JeroController<OtaManageApplyEO,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize) {
|
||||
|
||||
IPage<OtaManageApplyEO> pageList = otaManageApplyEOService.getOtaPage(otaManageApplyEO,pageNo,pageSize);
|
||||
return Result.OK(pageList);
|
||||
List<OtaManageApplyEO> list = otaManageApplyEOService.getOtaPage(otaManageApplyEO);
|
||||
Page pages = PageUtil.getPages(pageNo, pageSize, list);
|
||||
return Result.OK(pages);
|
||||
}
|
||||
/**
|
||||
* 分车型列表-分页列表查询
|
||||
@@ -280,4 +283,17 @@ public class OtaManageApplyEOController extends JeroController<OtaManageApplyEO,
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* OTA管理导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param otaManageApplyEO
|
||||
*/
|
||||
@RequestMapping(value = "/otaExportXls")
|
||||
@ApiOperation(value = "OTA管理导出excel", notes = "OTA管理导出excel")
|
||||
public ModelAndView otaExportXls(HttpServletRequest request, OtaManageApplyEO otaManageApplyEO) {
|
||||
return otaManageApplyEOService.otaExportXls(request, otaManageApplyEO);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
+5
-3
@@ -4,7 +4,9 @@ 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;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -66,11 +68,9 @@ public interface IOtaManageApplyEOService extends IService<OtaManageApplyEO> {
|
||||
/**
|
||||
* OTA管理列表和全车型列表-分页列表查询
|
||||
* @param otaManageApplyEO
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @return
|
||||
*/
|
||||
IPage<OtaManageApplyEO> getOtaPage(OtaManageApplyEO otaManageApplyEO,Integer pageNo,Integer pageSize);
|
||||
List<OtaManageApplyEO> getOtaPage(OtaManageApplyEO otaManageApplyEO);
|
||||
|
||||
/**
|
||||
* 分车型列表-分页列表查询
|
||||
@@ -123,4 +123,6 @@ public interface IOtaManageApplyEOService extends IService<OtaManageApplyEO> {
|
||||
List<OtaManageApplyEO> getVdrListByProject(String projectId, String cut);
|
||||
|
||||
List<OtaManageApplyEO> getStatisticalStatus(String projectId, String plannedBpLaunchBatch, String cut);
|
||||
|
||||
ModelAndView otaExportXls(HttpServletRequest request, OtaManageApplyEO otaManageApplyEO);
|
||||
}
|
||||
|
||||
+62
-6
@@ -8,6 +8,7 @@ import com.jero.common.constant.enums.CutEnum;
|
||||
import com.jero.common.system.vo.LoginUser;
|
||||
import com.jero.common.util.DateUtils;
|
||||
import com.jero.common.util.PageUtil;
|
||||
import com.jero.common.util.oConvertUtils;
|
||||
import com.jero.modules.dummy.enums.OrderEnum;
|
||||
import com.jero.modules.ota.entity.OtaManageApplyEO;
|
||||
import com.jero.modules.ota.entity.OtaManageReceiveNsdpEO;
|
||||
@@ -17,6 +18,7 @@ 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.OtaExportVO;
|
||||
import com.jero.modules.ota.vo.VersionVO;
|
||||
import com.jero.modules.project.entity.ProjectLibraryBase;
|
||||
import com.jero.modules.project.entity.ProjectTaskPlanning;
|
||||
@@ -34,13 +36,32 @@ import com.jero.modules.system.util.StringUtils;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
||||
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.text.Collator;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@@ -69,6 +90,9 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
|
||||
@Autowired
|
||||
private IOtaManageHistoryService otaManageHistoryService;
|
||||
|
||||
@Value(value = "${jero.path.upload}")
|
||||
private String upLoadPath;
|
||||
|
||||
|
||||
private static SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");
|
||||
private static SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
|
||||
@@ -151,12 +175,10 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
|
||||
/**
|
||||
* OTA管理列表和全车型列表-分页列表查询
|
||||
* @param otaManageApplyEO
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public IPage<OtaManageApplyEO> getOtaPage(OtaManageApplyEO otaManageApplyEO, Integer pageNo, Integer pageSize) {
|
||||
public List<OtaManageApplyEO> getOtaPage(OtaManageApplyEO otaManageApplyEO) {
|
||||
List<OtaManageApplyEO> otaManageApplyEOList = otaManageApplyEOMapper.getOtaList(otaManageApplyEO);
|
||||
if(!otaManageApplyEOList.isEmpty()){
|
||||
List<String> otaNameList = OtaCarEnum.getOtaNameList();
|
||||
@@ -223,8 +245,7 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
|
||||
//表头排序
|
||||
heartSort(otaManageApplyEO, otaManageApplyEOList);
|
||||
}
|
||||
Page pages = PageUtil.getPages(pageNo, pageSize, otaManageApplyEOList);
|
||||
return pages;
|
||||
return otaManageApplyEOList;
|
||||
}
|
||||
|
||||
private void heartSort(OtaManageApplyEO otaManageApplyEO, List<OtaManageApplyEO> otaManageApplyEOList) {
|
||||
@@ -1060,5 +1081,40 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
|
||||
return this.list(queryWrapper);
|
||||
}
|
||||
|
||||
@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;
|
||||
|
||||
// 过滤选中数据
|
||||
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<OtaExportVO> dataList = new ArrayList<>();
|
||||
for (OtaManageApplyEO manageApplyEO : exportList) {
|
||||
OtaExportVO otaExportVO = new OtaExportVO();
|
||||
BeanUtils.copyProperties(manageApplyEO, otaExportVO);
|
||||
dataList.add(otaExportVO);
|
||||
}
|
||||
|
||||
// Step.3 AutoPoi 导出Excel
|
||||
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
|
||||
mv.addObject(NormalExcelConstants.FILE_NAME, "OTA列表"); //此处设置的filename无效 ,前端会重更新设置一下
|
||||
mv.addObject(NormalExcelConstants.CLASS, OtaExportVO.class);
|
||||
ExportParams exportParams=new ExportParams("OTA软件版本", null, "OTA软件版本");
|
||||
mv.addObject(NormalExcelConstants.PARAMS,exportParams);
|
||||
mv.addObject(NormalExcelConstants.DATA_LIST, dataList);
|
||||
return mv;
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
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;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @description
|
||||
* @date 2023/8/9 11:28
|
||||
* @auth zhn
|
||||
*/
|
||||
@Data
|
||||
public class OtaExportVO {
|
||||
|
||||
@Excel(name = "软件版本", width = 15)
|
||||
@ApiModelProperty(value = "软件版本")
|
||||
private java.lang.String plannedBpLaunchBatch;
|
||||
|
||||
@Excel(name = "市场", width = 15)
|
||||
@ApiModelProperty(value = "市场")
|
||||
private java.lang.String market;
|
||||
|
||||
@Excel(name = "适用车型", width = 50)
|
||||
@ApiModelProperty(value = "适用车型")
|
||||
private java.lang.String appliedVehicleProject;
|
||||
|
||||
@Excel(name = "软件发布时间", width = 15)
|
||||
@ApiModelProperty(value = "软件发布时间")
|
||||
private String releaseName;
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user