Commit e0a79fa6 authored by qk's avatar qk

Update:参数核查无法导出,导出添加处理措施和处理时间。

parent 244d2479
......@@ -165,7 +165,7 @@ public class CertificationDTO extends BaseReqPageEntity {
/**
* 操作人名称
*/
@Excel(name ="操作人",width = 50)
// @Excel(name ="操作人",width = 50)
private transient String usname;
/**
......@@ -178,6 +178,11 @@ public class CertificationDTO extends BaseReqPageEntity {
/**
* 事业部
*/
@Excel(name ="事业部",width = 50)
// @Excel(name ="事业部",width = 50)
private transient String orgName;
@Excel(name ="处理措施",width = 50)
private String checkEnd;
@Excel(name ="处理时间",width = 50)
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", locale = "zh", timezone = "GMT+8")
private Date endDate;
}
......@@ -28,6 +28,12 @@ public class DownCheckFalseDTO {
private String fromData;
@Excel(name = "核查结果", orderNum = "1", width = 50)
private String checkResult;
@Excel(name = "处理措施", orderNum = "1", width = 50)
private String checkEnd;
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
private Date endDate;
@Excel(name = "处理时间", orderNum = "1", width = 50)
private String endDateStr;
@Excel(name = "核查时间", orderNum = "1", width = 50)
private String checkTimeStr;
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
......
......@@ -117,6 +117,7 @@ public class CheckDataCheckResultController extends BaseController {
carGroup,editionCode,paramName);
for (DownCheckFalseDTO downCheckFalseDTO : datas) {
downCheckFalseDTO.setCheckTimeStr(DateUtils.dateToString(downCheckFalseDTO.getCheckTime(),"yyyy-MM-dd HH:mm:ss"));
downCheckFalseDTO.setEndDateStr(DateUtils.dateToString(downCheckFalseDTO.getEndDate(),"yyyy-MM-dd HH:mm:ss"));
downCheckFalseDTO.setCheckResult(downCheckFalseDTO.getCheckResult().equals("2")?"处理完成":"不一致");
}
workbook = ExcelExportUtil.exportExcel(exportParams, DownCheckFalseDTO.class, datas);
......
package com.adc.da.system.controller;
import com.adc.da.dto.reqDTO.CertificationDTO;
import com.adc.da.dto.reqDTO.CheckRealVehicleVerificationDto;
import com.adc.da.dto.reqDTO.RVVObdDTO;
import com.adc.da.dto.reqDTO.RegulationsDTO;
import com.adc.da.dto.reqDTO.ScanCodeDTO;
import com.adc.da.excel.poi.excel.ExcelExportUtil;
import com.adc.da.excel.poi.excel.entity.ExportParams;
import com.adc.da.excel.poi.excel.entity.enums.ExcelType;
import com.adc.da.system.entity.CheckModelSeriesList;
import com.adc.da.system.entity.CheckRealVehicleVerification;
import com.adc.da.system.service.ICheckRealVehicleVerificationService;
import com.adc.da.util.FileUtil;
import com.adc.da.util.ReadExcel;
import com.adc.da.util.exception.AdcDaBaseException;
import com.adc.da.util.http.ResponseMessage;
import com.adc.da.util.http.Result;
import com.adc.da.util.utils.IOUtils;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.usermodel.Workbook;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
......@@ -21,6 +35,11 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
/**
* 实车核查第三页面
......@@ -347,147 +366,147 @@ public class CheckRealVehicleVerificationController {
return Result.success("200","待解决核查分页查询",
checkRealVehicleVerificationService.getCheckRealVehicleVerPage(checkRealVehicleVer));
}
//
// /**
// * 导出
// * @param response
// * @param request
// * @return
// */
// @ApiOperation(value ="导出")
// @GetMapping("/downTemplate")
// public ResponseMessage exportObdDetail(HttpServletResponse response, HttpServletRequest request,
// String id,String checkType,String handleType,String parameterName,
// String project){
// OutputStream os = null;
// Workbook workbook = null;
// List<String> ids = new ArrayList<>();
// try {
// if("1".equals(checkType)){
// response.setHeader("Content-Disposition",
// "attachment; filename=" + ReadExcel.encodeFileName( "OBD核查待解决问题.xlsx", request));
// }else if("2".equals(checkType)){
// response.setHeader("Content-Disposition",
// "attachment; filename=" + ReadExcel.encodeFileName( "扫码核查待解决问题.xlsx", request));
// }else if("3".equals(checkType)){
// response.setHeader("Content-Disposition",
// "attachment; filename=" + ReadExcel.encodeFileName( "认证一致性待解决问题.xlsx", request));
// }else if("4".equals(checkType)){
// response.setHeader("Content-Disposition",
// "attachment; filename=" + ReadExcel.encodeFileName( "法规待解决问题.xlsx", request));
// }
// response.setContentType("application/force-download");
// ExportParams exportParams = new ExportParams();
// exportParams.setType(ExcelType.XSSF);
// if(StringUtils.isNotBlank(id)){
// ids = Arrays.asList(id.split(","));
// }
// if("1".equals(checkType)) {
// List<RVVObdDTO> dates = checkRealVehicleVerificationService.getCheckRealVehicleVer(ids,checkType,
// handleType,parameterName);
// if(dates.size() != 0) {
// for (RVVObdDTO c : dates) {
// if (StringUtils.isNotBlank(c.getHandleType())) {
// switch (c.getHandleType()) {
// case "0":
// c.setHandleType("未处理");
// break;
// case "1":
// c.setHandleType("已处理");
// break;
// }
// }
// if (c.getCheckPicturePathTwo() != null){
// c.setCheckPictureTwo(FileUtil.readFileByBytes(uploadFile+c.getCheckPicturePathTwo()));
// }
// if (c.getCheckPicturePath() != null){
// c.setCheckPictureOne(FileUtil.readFileByBytes(uploadFile+c.getCheckPicturePath()));
// }
// }
// }else {
// dates = new ArrayList<>();
// }
// workbook = ExcelExportUtil.exportExcel(exportParams, RVVObdDTO.class, dates);
// }
// if("2".equals(checkType)) {
// List<ScanCodeDTO> dates = checkRealVehicleVerificationService.getCheckRealVehicleVer1(ids,checkType,handleType,parameterName);
/**
* 导出
* @param response
* @param request
* @return
*/
@ApiOperation(value ="导出")
@GetMapping("/downTemplate")
public ResponseMessage exportObdDetail(HttpServletResponse response, HttpServletRequest request,
String id, String checkType, String handleType, String parameterName,
String project){
OutputStream os = null;
Workbook workbook = null;
List<String> ids = new ArrayList<>();
try {
if("1".equals(checkType)){
response.setHeader("Content-Disposition",
"attachment; filename=" + ReadExcel.encodeFileName( "OBD核查待解决问题.xlsx", request));
}else if("2".equals(checkType)){
response.setHeader("Content-Disposition",
"attachment; filename=" + ReadExcel.encodeFileName( "扫码核查待解决问题.xlsx", request));
}else if("3".equals(checkType)){
response.setHeader("Content-Disposition",
"attachment; filename=" + ReadExcel.encodeFileName( "认证一致性待解决问题.xlsx", request));
}else if("4".equals(checkType)){
response.setHeader("Content-Disposition",
"attachment; filename=" + ReadExcel.encodeFileName( "法规待解决问题.xlsx", request));
}
response.setContentType("application/force-download");
ExportParams exportParams = new ExportParams();
exportParams.setType(ExcelType.XSSF);
if(StringUtils.isNotBlank(id)){
ids = Arrays.asList(id.split(","));
}
if("1".equals(checkType)) {
List<RVVObdDTO> dates = checkRealVehicleVerificationService.getCheckRealVehicleVer(ids,checkType,
handleType,parameterName);
if(dates.size() != 0) {
for (RVVObdDTO c : dates) {
if (StringUtils.isNotBlank(c.getHandleType())) {
switch (c.getHandleType()) {
case "0":
c.setHandleType("未处理");
break;
case "1":
c.setHandleType("已处理");
break;
}
}
if (c.getCheckPicturePathTwo() != null){
c.setCheckPictureTwo(FileUtil.readFileByBytes(uploadFile+c.getCheckPicturePathTwo()));
}
if (c.getCheckPicturePath() != null){
c.setCheckPictureOne(FileUtil.readFileByBytes(uploadFile+c.getCheckPicturePath()));
}
}
}else {
dates = new ArrayList<>();
}
workbook = ExcelExportUtil.exportExcel(exportParams, RVVObdDTO.class, dates);
}
if("2".equals(checkType)) {
List<ScanCodeDTO> dates = checkRealVehicleVerificationService.getCheckRealVehicleVer1(ids,checkType,handleType,parameterName);
if(dates.size() != 0) {
for (ScanCodeDTO c : dates) {
if (StringUtils.isNotBlank(c.getType())) {
switch (c.getType()) {
case "0":
c.setType("是");
break;
case "1":
c.setType("否");
break;
}
}
if (StringUtils.isNotBlank(c.getCheckPicturePathTwo())) {
switch (c.getCheckPicturePathTwo()) {
case "0":
c.setCheckPicturePathTwo("是");
break;
case "1":
c.setCheckPicturePathTwo("否");
break;
}
}
}
}else {
dates = new ArrayList<>();
}
workbook = ExcelExportUtil.exportExcel(exportParams, ScanCodeDTO.class, dates);
}
if("4".equals(checkType)) {
List<RegulationsDTO> dates = checkRealVehicleVerificationService.getCheckRealVehicleVer2(ids,checkType,handleType,parameterName,project);
if(dates.size() == 0) {
dates = new ArrayList<>();
}
for (RegulationsDTO regulationsDTO : dates) {
if (regulationsDTO.getCheckPicturePathTwo() != null){
regulationsDTO.setCheckPictureTwo(FileUtil.readFileByBytes(uploadFile+regulationsDTO.getCheckPicturePathTwo()));
}
if (regulationsDTO.getCheckPicturePath() != null){
regulationsDTO.setCheckPictureOne(FileUtil.readFileByBytes(uploadFile+regulationsDTO.getCheckPicturePath()));
}
}
workbook = ExcelExportUtil.exportExcel(exportParams, RegulationsDTO.class, dates);
}
if("3".equals(checkType)) {
List<CertificationDTO> dates = checkRealVehicleVerificationService.getCheckRealVehicleVer3(ids,checkType,handleType,parameterName);
// if(dates.size() != 0) {
// for (ScanCodeDTO c : dates) {
// if (StringUtils.isNotBlank(c.getType())) {
// switch (c.getType()) {
// case "0":
// c.setType("是");
// break;
// case "1":
// c.setType("否");
// break;
// }
// }
// if (StringUtils.isNotBlank(c.getCheckPicturePathTwo())) {
// switch (c.getCheckPicturePathTwo()) {
// case "0":
// c.setCheckPicturePathTwo("是");
// break;
// case "1":
// c.setCheckPicturePathTwo("否");
// break;
// }
// }
// }
// }else {
// dates = new ArrayList<>();
// }
// workbook = ExcelExportUtil.exportExcel(exportParams, ScanCodeDTO.class, dates);
// }
// if("4".equals(checkType)) {
// List<RegulationsDTO> dates = checkRealVehicleVerificationService.getCheckRealVehicleVer2(ids,checkType,handleType,parameterName,project);
// if(dates.size() == 0) {
// dates = new ArrayList<>();
// }
// for (RegulationsDTO regulationsDTO : dates) {
// if (regulationsDTO.getCheckPicturePathTwo() != null){
// regulationsDTO.setCheckPictureTwo(FileUtil.readFileByBytes(uploadFile+regulationsDTO.getCheckPicturePathTwo()));
// }
// if (regulationsDTO.getCheckPicturePath() != null){
// regulationsDTO.setCheckPictureOne(FileUtil.readFileByBytes(uploadFile+regulationsDTO.getCheckPicturePath()));
// }
// }
// workbook = ExcelExportUtil.exportExcel(exportParams, RegulationsDTO.class, dates);
// }
// if("3".equals(checkType)) {
// List<CertificationDTO> dates = checkRealVehicleVerificationService.getCheckRealVehicleVer3(ids,checkType,handleType,parameterName);
//// if(dates.size() != 0) {
//// dates = new ArrayList<>();
//// }
// for (CertificationDTO regulationsDTO : dates) {
// if (regulationsDTO.getCheckPicturePathTwo() != null){
// regulationsDTO.setCheckPictureTwo(FileUtil.readFileByBytes(uploadFile+regulationsDTO.getCheckPicturePathTwo()));
// }
// if (regulationsDTO.getCheckPicturePath() != null){
// regulationsDTO.setCheckPictureOne(FileUtil.readFileByBytes(uploadFile+regulationsDTO.getCheckPicturePath()));
// }
// }
// workbook = ExcelExportUtil.exportExcel(exportParams, CertificationDTO.class, dates);
// }
// os = response.getOutputStream();
// workbook.write(os);
// os.flush();
// } catch (Exception e) {
// e.printStackTrace();
// throw new AdcDaBaseException("下载文件失败,请重试");
// } finally {
// IOUtils.closeQuietly(os);
// }
// return Result.success("0", "操作成功");
// }
// /**
// * 查询上次改动不一致性的数据
// * @param
// * @return
// */
// @GetMapping("/getLastCheckRealVehicleVer")
// public ResponseMessage getLastCheckRealVehicleVer(CheckModelSeriesList checkModelSeriesList){
// return Result.success("200","查询成功",checkRealVehicleVerificationService.getLastCheckRealVehicleVer(checkModelSeriesList));
//
// }
for (CertificationDTO regulationsDTO : dates) {
if (regulationsDTO.getCheckPicturePathTwo() != null){
regulationsDTO.setCheckPictureTwo(FileUtil.readFileByBytes(uploadFile+regulationsDTO.getCheckPicturePathTwo()));
}
if (regulationsDTO.getCheckPicturePath() != null){
regulationsDTO.setCheckPictureOne(FileUtil.readFileByBytes(uploadFile+regulationsDTO.getCheckPicturePath()));
}
}
workbook = ExcelExportUtil.exportExcel(exportParams, CertificationDTO.class, dates);
}
os = response.getOutputStream();
workbook.write(os);
os.flush();
} catch (Exception e) {
e.printStackTrace();
throw new AdcDaBaseException("下载文件失败,请重试");
} finally {
IOUtils.closeQuietly(os);
}
return Result.success("0", "操作成功");
}
/**
* 查询上次改动不一致性的数据
* @param
* @return
*/
@GetMapping("/getLastCheckRealVehicleVer")
public ResponseMessage getLastCheckRealVehicleVer(CheckModelSeriesList checkModelSeriesList){
return Result.success("200","查询成功",checkRealVehicleVerificationService.getLastCheckRealVehicleVer(checkModelSeriesList));
}
}
package com.adc.da.system.controller;
import cn.afterturn.easypoi.excel.ExcelExportUtil;
import cn.afterturn.easypoi.excel.entity.ExportParams;
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
import com.adc.da.dto.resDTO.VehicleDatabaseDetailsDto;
import com.adc.da.system.entity.VehicleDatabase;
import com.adc.da.system.entity.VehicleDatabaseDetails;
import com.adc.da.system.service.IVehicleDatabaseDetailsService;
import com.adc.da.system.service.IVehicleDatabaseService;
import com.adc.da.util.ReadExcel;
import com.adc.da.util.exception.AdcDaBaseException;
import com.adc.da.util.http.ResponseMessage;
import com.adc.da.util.http.Result;
import com.adc.da.util.utils.IOUtils;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.usermodel.Workbook;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PutMapping;
......@@ -21,7 +29,11 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.List;
/**
* 车型库控制器
......
......@@ -73,6 +73,8 @@
CDCR.PARAM_NAME as paramName,
CDCR.CHECK_FORM_DATA AS fromData,
CDCR.CHECK_RESULT AS checkResult,
CDCR.CHECK_END AS checkEnd,
CDCR.END_DATE AS endDate,
CASE CDCR.CHECK_TYPE
WHEN '2' THEN
'合格证'
......
......@@ -23,10 +23,10 @@
AND t3.USNAME LIKE '%'||#{operator}||'%'
</if>
<if test="startTime != null and startTime != ''">
and TO_CHAR(t1.CREATION_TIME,'YYYY-MM-DD') &gt;= #{startTime}
and TO_CHAR(t1.CREATION_TIME,'YYYY-MM-DD hh:ss:mm') &gt;= #{startTime}
</if>
<if test="endTime != null and endTime != ''">
and TO_CHAR(t1.CREATION_TIME,'YYYY-MM-DD') &lt;= #{endTime}
and TO_CHAR(t1.CREATION_TIME,'YYYY-MM-DD hh:ss:mm') &lt;= #{endTime}
</if>
<if test="list.size() !=0">
AND t1.ID IN
......
......@@ -309,19 +309,13 @@
<select id="getCheckRealVehicleVer3" resultType="com.adc.da.dto.reqDTO.CertificationDTO">
SELECT
t1.ID,t2.VEHICLE_SERIES,t1.VEHICLE_TYPE,t1.PARAMETER_NAME,t1.PARAMETER,t1.DISCHARGE_STAGE,t1.TYPE,t1.RECORD_FAULT_CODE,
t1.HANDLE_TYPE,t1.CHECK_PICTURE_PATH_TWO,t1.REMARKS,t3.USNAME,t2.CREATE_TIME,t4.ORG_NAME,t1.PROJECT,t1.REGULATORY_REQUIREMENTS,
t1.VEHICLE_TYPE_NAME,t1.STANDARD_NAME,t1.CHECK_RESULT,t1.CHECK_PICTURE_PATH
t1.HANDLE_TYPE,t1.CHECK_PICTURE_PATH_TWO,t1.REMARKS,t2.CREATE_TIME,t1.PROJECT,t1.REGULATORY_REQUIREMENTS,
t1.VEHICLE_TYPE_NAME,t1.STANDARD_NAME,t1.CHECK_RESULT,t1.CHECK_PICTURE_PATH,t1.PARAM_CONFIG,t1.CHECK_END,t1.END_DATE
FROM
NERDS.CHECK_REAL_VEHICLE_VER t1
LEFT JOIN
CHECK_MODEL_SERIES_LIST t2
NERDS.CHECK_MODEL_SERIES_LIST t2
ON t1.VEHICLE_SERIES_ID = t2.ID
LEFT JOIN
TS_USER t3
ON t3.USID = t2.OPERATOR
LEFT JOIN
TS_ORG t4
ON t2.BASE = t4.ID
WHERE
1=1
AND t1.CHECK_TYPE is null
......@@ -345,7 +339,7 @@
SELECT
ID
FROM
CHECK_MODEL_SERIES_LIST
NERDS.CHECK_MODEL_SERIES_LIST
WHERE
VEHICLE_TYPE_AND_GROUP LIKE '%'||#{vehicleTypeAndGroup}||'%'
......@@ -359,7 +353,7 @@
</if>
<if test="detailType == 3">
AND CREATE_TIME=(SELECT MAX(CREATE_TIME) FROM
CHECK_MODEL_SERIES_LIST WHERE REAL_MOULD_STATUS = '0' and VEHICLE_TYPE_AND_GROUP LIKE '%'||#{vehicleTypeAndGroup}||'%')
NERDS.CHECK_MODEL_SERIES_LIST WHERE REAL_MOULD_STATUS = '0' and VEHICLE_TYPE_AND_GROUP LIKE '%'||#{vehicleTypeAndGroup}||'%')
</if>
<if test="detailType == 4">
AND STAND_TIME=(SELECT MAX(STAND_TIME) FROM
......@@ -375,7 +369,7 @@
t2.VEHICLE_TYPE_AND_GROUP
FROM
NERDS.CHECK_REAL_VEHICLE_VER t1
LEFT JOIN CHECK_MODEL_SERIES_LIST t2
LEFT JOIN NERDS.CHECK_MODEL_SERIES_LIST t2
ON t2.ID = t1.VEHICLE_SERIES_ID
WHERE
......
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