预警excel导出 数据与表格对应
This commit is contained in:
+3
-2
@@ -9,6 +9,7 @@ import com.adc.da.slrs.sarStandIssueControlProduct.entity.StandIssueControlProdu
|
|||||||
import com.adc.da.slrs.sarStandWarning.entity.EarlyWarningEO;
|
import com.adc.da.slrs.sarStandWarning.entity.EarlyWarningEO;
|
||||||
import com.adc.da.slrs.sarStandWarning.entity.StandWarningEO;
|
import com.adc.da.slrs.sarStandWarning.entity.StandWarningEO;
|
||||||
import com.adc.da.slrs.sarStandWarning.entity.WarningExcelVO;
|
import com.adc.da.slrs.sarStandWarning.entity.WarningExcelVO;
|
||||||
|
import com.adc.da.slrs.sarStandWarning.entity.WarningExportVO;
|
||||||
import com.adc.da.slrs.sarStandWarning.service.Impl.EarlyWarningEOServiceImpl;
|
import com.adc.da.slrs.sarStandWarning.service.Impl.EarlyWarningEOServiceImpl;
|
||||||
|
|
||||||
import com.alibaba.excel.EasyExcel;
|
import com.alibaba.excel.EasyExcel;
|
||||||
@@ -148,11 +149,11 @@ public class EarlyWarningEOController extends BaseController<EarlyWarningEO> {
|
|||||||
response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx");
|
response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx");
|
||||||
|
|
||||||
// List<StandWarningEO> exportExcel = earlyWarningEOService.getExportExcel(excelVO);
|
// List<StandWarningEO> exportExcel = earlyWarningEOService.getExportExcel(excelVO);
|
||||||
List<StandWarningEO> exportExcel = earlyWarningEOService.getExportExcel(excelVO);
|
List<WarningExportVO> exportExcel = earlyWarningEOService.getExportExcel(excelVO);
|
||||||
|
|
||||||
|
|
||||||
// 这里需要设置不关闭流
|
// 这里需要设置不关闭流
|
||||||
EasyExcel.write(response.getOutputStream(), StandWarningEO.class).autoCloseStream(Boolean.FALSE).sheet("sheet1")
|
EasyExcel.write(response.getOutputStream(), WarningExportVO.class).autoCloseStream(Boolean.FALSE).sheet("sheet1")
|
||||||
.doWrite(exportExcel);
|
.doWrite(exportExcel);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
System.out.println(e);
|
System.out.println(e);
|
||||||
|
|||||||
+2
-1
@@ -3,6 +3,7 @@ package com.adc.da.slrs.sarStandWarning.dao;
|
|||||||
|
|
||||||
import com.adc.da.slrs.sarStandWarning.entity.EarlyWarningEO;
|
import com.adc.da.slrs.sarStandWarning.entity.EarlyWarningEO;
|
||||||
import com.adc.da.slrs.sarStandWarning.entity.StandWarningEO;
|
import com.adc.da.slrs.sarStandWarning.entity.StandWarningEO;
|
||||||
|
import com.adc.da.slrs.sarStandWarning.entity.WarningExportVO;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
@@ -14,6 +15,6 @@ public interface EarlyWarningEODao extends BaseMapper<EarlyWarningEO> {
|
|||||||
IPage<StandWarningEO> selectWarningPage(IPage<StandWarningEO> page, @Param("waringEO") StandWarningEO warningEO);
|
IPage<StandWarningEO> selectWarningPage(IPage<StandWarningEO> page, @Param("waringEO") StandWarningEO warningEO);
|
||||||
|
|
||||||
|
|
||||||
List<StandWarningEO> exportWarning(@Param("idList") List<String> ids);
|
List<WarningExportVO> exportWarning(@Param("idList") List<String> ids);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+7
-7
@@ -47,17 +47,17 @@ public class EarlyWarningEO extends BaseEntity {
|
|||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private String standType;
|
private String standType;
|
||||||
|
|
||||||
@ExcelProperty("标准号")
|
@ExcelProperty(value = "标准号",index = 1)
|
||||||
@ApiModelProperty("标准号")
|
@ApiModelProperty("标准号")
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private String standCode;
|
private String standCode;
|
||||||
|
|
||||||
@ExcelProperty("标准名称")
|
@ExcelProperty(value = "标准名称",index = 2)
|
||||||
@ApiModelProperty("标准名称")
|
@ApiModelProperty("标准名称")
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private String standName;
|
private String standName;
|
||||||
|
|
||||||
@ExcelProperty("发布日期")
|
@ExcelProperty(value = "发布日期",index = 5)
|
||||||
@ApiModelProperty("发布日期")
|
@ApiModelProperty("发布日期")
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||||
@@ -67,12 +67,12 @@ public class EarlyWarningEO extends BaseEntity {
|
|||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private Date lastTime;
|
private Date lastTime;
|
||||||
|
|
||||||
@ExcelProperty("适用车型")
|
@ExcelIgnore
|
||||||
@ApiModelProperty("适用车型")
|
@ApiModelProperty("适用车型")
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private String applyType;
|
private String applyType;
|
||||||
|
|
||||||
@ExcelProperty("责任工程师")
|
@ExcelIgnore
|
||||||
@ApiModelProperty("责任工程师")
|
@ApiModelProperty("责任工程师")
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private String dutyEngineer;
|
private String dutyEngineer;
|
||||||
@@ -82,12 +82,12 @@ public class EarlyWarningEO extends BaseEntity {
|
|||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private String itemsId;
|
private String itemsId;
|
||||||
|
|
||||||
@ExcelProperty("条款(分解单)编号")
|
@ExcelProperty(value = "条款(分解单)编号",index = 3)
|
||||||
@ApiModelProperty("条款(分解单)编号")
|
@ApiModelProperty("条款(分解单)编号")
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private String itemsNum;
|
private String itemsNum;
|
||||||
|
|
||||||
@ExcelProperty("条款(分解单)名称")
|
@ExcelProperty(value = "条款(分解单)名称",index = 4)
|
||||||
@ApiModelProperty("条款(分解单)名称")
|
@ApiModelProperty("条款(分解单)名称")
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private String itemsName;
|
private String itemsName;
|
||||||
|
|||||||
@@ -0,0 +1,35 @@
|
|||||||
|
package com.adc.da.slrs.sarStandWarning.entity;
|
||||||
|
|
||||||
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class WarningExportVO extends EarlyWarningEO {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ExcelProperty(value = "实施日期",index = 6)
|
||||||
|
@ApiModelProperty("标准号")
|
||||||
|
private String SSRQ;
|
||||||
|
|
||||||
|
|
||||||
|
@ExcelProperty(value = "新车型实施日期",index = 7)
|
||||||
|
@ApiModelProperty("新车型实施日期")
|
||||||
|
private String XCXSSRQ;
|
||||||
|
|
||||||
|
@ExcelProperty(value = "在产车实施日期",index = 8)
|
||||||
|
@ApiModelProperty("在产车实施日期")
|
||||||
|
private String ZCCSSRQ;
|
||||||
|
|
||||||
|
@ExcelProperty(value = "标准类别",index = 0)
|
||||||
|
@ApiModelProperty("标准类别显示")
|
||||||
|
private String standTypeShow;
|
||||||
|
|
||||||
|
@ExcelProperty(value = "适用车型",index = 9)
|
||||||
|
@ApiModelProperty("适用车型展示")
|
||||||
|
private String applyTypeShow;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
+2
-1
@@ -4,6 +4,7 @@ package com.adc.da.slrs.sarStandWarning.service;
|
|||||||
import com.adc.da.slrs.sarStandWarning.entity.EarlyWarningEO;
|
import com.adc.da.slrs.sarStandWarning.entity.EarlyWarningEO;
|
||||||
import com.adc.da.slrs.sarStandWarning.entity.StandWarningEO;
|
import com.adc.da.slrs.sarStandWarning.entity.StandWarningEO;
|
||||||
import com.adc.da.slrs.sarStandWarning.entity.WarningExcelVO;
|
import com.adc.da.slrs.sarStandWarning.entity.WarningExcelVO;
|
||||||
|
import com.adc.da.slrs.sarStandWarning.entity.WarningExportVO;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
@@ -22,5 +23,5 @@ public interface EarlyWarningEOService extends IService<EarlyWarningEO> {
|
|||||||
|
|
||||||
IPage<StandWarningEO> getStandWarning(StandWarningEO queryPage);
|
IPage<StandWarningEO> getStandWarning(StandWarningEO queryPage);
|
||||||
|
|
||||||
List<StandWarningEO> getExportExcel(WarningExcelVO excelVO);
|
List<WarningExportVO> getExportExcel(WarningExcelVO excelVO);
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-2
@@ -5,6 +5,7 @@ import com.adc.da.slrs.sarStandWarning.dao.EarlyWarningEODao;
|
|||||||
import com.adc.da.slrs.sarStandWarning.entity.EarlyWarningEO;
|
import com.adc.da.slrs.sarStandWarning.entity.EarlyWarningEO;
|
||||||
import com.adc.da.slrs.sarStandWarning.entity.StandWarningEO;
|
import com.adc.da.slrs.sarStandWarning.entity.StandWarningEO;
|
||||||
import com.adc.da.slrs.sarStandWarning.entity.WarningExcelVO;
|
import com.adc.da.slrs.sarStandWarning.entity.WarningExcelVO;
|
||||||
|
import com.adc.da.slrs.sarStandWarning.entity.WarningExportVO;
|
||||||
import com.adc.da.slrs.sarStandWarning.service.EarlyWarningEOService;
|
import com.adc.da.slrs.sarStandWarning.service.EarlyWarningEOService;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
@@ -120,8 +121,8 @@ public class EarlyWarningEOServiceImpl extends ServiceImpl<EarlyWarningEODao, Ea
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<StandWarningEO> getExportExcel(WarningExcelVO excelVO){
|
public List<WarningExportVO> getExportExcel(WarningExcelVO excelVO){
|
||||||
List<StandWarningEO> standWarningEOList = earlyWarningEODao.exportWarning( excelVO.getIds());
|
List<WarningExportVO> standWarningEOList = earlyWarningEODao.exportWarning( excelVO.getIds());
|
||||||
// IPage<StandWarningEO> standWarningEOIPage = earlyWarningEODao.selectWarningPage(null, null, null);
|
// IPage<StandWarningEO> standWarningEOIPage = earlyWarningEODao.selectWarningPage(null, null, null);
|
||||||
|
|
||||||
return standWarningEOList;
|
return standWarningEOList;
|
||||||
|
|||||||
+28
-10
@@ -38,8 +38,6 @@
|
|||||||
|
|
||||||
<sql id="stand_where">
|
<sql id="stand_where">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<if test="waringEO.standCode != null and waringEO.standCode != ''">
|
<if test="waringEO.standCode != null and waringEO.standCode != ''">
|
||||||
AND trim(replace(CONCAT(
|
AND trim(replace(CONCAT(
|
||||||
sarInfo.STAND_SORT,
|
sarInfo.STAND_SORT,
|
||||||
@@ -74,18 +72,35 @@
|
|||||||
)
|
)
|
||||||
</if>
|
</if>
|
||||||
</sql>
|
</sql>
|
||||||
<select id="exportWarning" resultType="com.adc.da.slrs.sarStandWarning.entity.StandWarningEO">
|
|
||||||
|
<sql id="export_column">
|
||||||
|
warning.id AS ID,
|
||||||
|
sarInfo.ID AS STAND_ID,
|
||||||
|
sarInfo.STAND_TYPE,
|
||||||
|
CONCAT(sarInfo.STAND_SORT,' ',sarInfo.STAND_NUMBER,'-',sarInfo.STAND_YEAR) AS STAND_CODE,
|
||||||
|
sarInfo.STAND_NAME,
|
||||||
|
sarInfo.PUT_TIME,
|
||||||
|
attr.SSRQ as SSRQ,
|
||||||
|
case stand_type
|
||||||
|
when 'INLAND' then '国内标准'
|
||||||
|
when 'FOREIGN' then '国外标准'
|
||||||
|
ELSE ''
|
||||||
|
END
|
||||||
|
as standTypeShow
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<select id="exportWarning" resultType="com.adc.da.slrs.sarStandWarning.entity.WarningExportVO">
|
||||||
|
|
||||||
SELECT WARNING_RESULT.* FROM
|
SELECT WARNING_RESULT.* FROM
|
||||||
(
|
(
|
||||||
|
|
||||||
SELECT
|
SELECT
|
||||||
<include refid="stand_column"/>
|
<include refid="export_column"/> ,
|
||||||
,
|
dicType.DIC_TYPE_NAME AS applyTypeShow,
|
||||||
attr.CLLX AS
|
attr.CLLX AS APPLY_TYPE ,
|
||||||
APPLY_TYPE ,
|
attr.ZRGCS AS DUTY_ENGINEER ,
|
||||||
attr
|
|
||||||
.ZRGCS AS DUTY_ENGINEER ,
|
|
||||||
NULL AS ITEMS_ID ,
|
NULL AS ITEMS_ID ,
|
||||||
NULL AS ITEMS_NUM , NULL AS ITEMS_NAME ,
|
NULL AS ITEMS_NUM , NULL AS ITEMS_NAME ,
|
||||||
NULL AS POLICY_ID ,
|
NULL AS POLICY_ID ,
|
||||||
@@ -97,6 +112,7 @@
|
|||||||
FROM sar_stand_warning AS warning
|
FROM sar_stand_warning AS warning
|
||||||
LEFT JOIN sar_standards_info AS sarInfo on sarInfo.id=warning.STAND_ID
|
LEFT JOIN sar_standards_info AS sarInfo on sarInfo.id=warning.STAND_ID
|
||||||
LEFT JOIN sar_stand_attr_info AS attr on attr.STAND_ID=warning.STAND_ID
|
LEFT JOIN sar_stand_attr_info AS attr on attr.STAND_ID=warning.STAND_ID
|
||||||
|
LEFT JOIN ts_dictype as dicType on dicType.DIC_TYPE_CODE =attr.CLLX
|
||||||
<where>
|
<where>
|
||||||
POWER = '1'
|
POWER = '1'
|
||||||
AND (MARK = 'stand')
|
AND (MARK = 'stand')
|
||||||
@@ -116,7 +132,8 @@
|
|||||||
UNION ALL
|
UNION ALL
|
||||||
|
|
||||||
SELECT
|
SELECT
|
||||||
<include refid="stand_column"/> ,
|
<include refid="export_column"/> ,
|
||||||
|
dicType.DIC_TYPE_NAME AS applyTypeShow,
|
||||||
items.APPLY_ARCTIC AS APPLY_TYPE ,
|
items.APPLY_ARCTIC AS APPLY_TYPE ,
|
||||||
items.DUTY_ENGINEER AS DUTY_ENGINEER ,
|
items.DUTY_ENGINEER AS DUTY_ENGINEER ,
|
||||||
items.ID AS ITEMS_ID ,
|
items.ID AS ITEMS_ID ,
|
||||||
@@ -133,6 +150,7 @@
|
|||||||
LEFT JOIN sar_standards_info AS sarInfo ON sarInfo.id = warning.STAND_ID
|
LEFT JOIN sar_standards_info AS sarInfo ON sarInfo.id = warning.STAND_ID
|
||||||
LEFT JOIN sar_stand_items AS items ON items.STAND_ID = warning.STAND_ID
|
LEFT JOIN sar_stand_items AS items ON items.STAND_ID = warning.STAND_ID
|
||||||
LEFT JOIN sar_stand_attr_info AS attr ON attr.STAND_ID = warning.STAND_ID
|
LEFT JOIN sar_stand_attr_info AS attr ON attr.STAND_ID = warning.STAND_ID
|
||||||
|
LEFT JOIN ts_dictype as dicType on dicType.DIC_TYPE_CODE =items.APPLY_ARCTIC
|
||||||
<where>
|
<where>
|
||||||
POWER = '1'
|
POWER = '1'
|
||||||
AND (MARK = 'item')
|
AND (MARK = 'item')
|
||||||
|
|||||||
Reference in New Issue
Block a user