Commit 05d5122e by java-温文海

excel导出格式变更

parent c774bcc4
...@@ -176,7 +176,7 @@ ...@@ -176,7 +176,7 @@
favt.arr_iata_name AS arrIataName, favt.arr_iata_name AS arrIataName,
favt.dep_iata AS depIata, favt.dep_iata AS depIata,
favt.dep_iata_name AS depIataName, favt.dep_iata_name AS depIataName,
favt.last_airline_time AS lastAirlineTime, DATE_FORMAT(favt.last_airline_time,'%Y/%m/%d') AS lastAirlineTime,
CASE CASE
WHEN WHEN
DATE_SUB( #{benchmarkingTime}, INTERVAL 180 DAY ) <![CDATA[<=]]> favt.last_airline_time DATE_SUB( #{benchmarkingTime}, INTERVAL 180 DAY ) <![CDATA[<=]]> favt.last_airline_time
...@@ -218,7 +218,7 @@ ...@@ -218,7 +218,7 @@
<if test="dbName == 'mysql'">CONCAT('%', #{arrIata}, '%')</if> <if test="dbName == 'mysql'">CONCAT('%', #{arrIata}, '%')</if>
) )
</if> </if>
ORDER BY favt.last_airline_time DESC
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -138,8 +138,15 @@ public class StatisticalController { ...@@ -138,8 +138,15 @@ public class StatisticalController {
List<StatisticalListEntity> list = new ArrayList<StatisticalListEntity>(); List<StatisticalListEntity> list = new ArrayList<StatisticalListEntity>();
if (page != null) {// 查询结果为空 if (page != null) {// 查询结果为空
list = page.getList(); list = page.getList();
//自定义导出序号
int no = 1;
for (StatisticalListEntity s:list for (StatisticalListEntity s:list
) { ) {
//自定义导出格式
s.setDepIataLabel(s.getArrIataName()+"="+s.getDepIataName());
s.setNo(no);
no++;
//航线状态自定义 //航线状态自定义
if (s.getAirlineStatus() == 0){ if (s.getAirlineStatus() == 0){
s.setStatus("失效"); s.setStatus("失效");
...@@ -149,14 +156,14 @@ public class StatisticalController { ...@@ -149,14 +156,14 @@ public class StatisticalController {
} }
//机型状态自定义 //机型状态自定义
List<TypeBean> typeBeans = JSON.parseArray(s.getAirlineJson(),TypeBean.class); List<TypeBean> typeBeans = JSON.parseArray(s.getAirlineJson(),TypeBean.class);
s.setTypeOne(typeInfo(typeBeans.get(typeBeans.size()-typeBeans.size()),s.getAirlineStatus())); s.setTypeOne(typeInfo(typeBeans.get(0),s.getAirlineStatus()));
s.setTypeTwo(typeInfo(typeBeans.get(typeBeans.size()-3),s.getAirlineStatus())); s.setTypeTwo(typeInfo(typeBeans.get(typeBeans.size()-3),s.getAirlineStatus()));
s.setTypeThree(typeInfo(typeBeans.get(typeBeans.size()-2),s.getAirlineStatus())); s.setTypeThree(typeInfo(typeBeans.get(typeBeans.size()-2),s.getAirlineStatus()));
s.setTypeFour(typeInfo(typeBeans.get(typeBeans.size()-1),s.getAirlineStatus())); s.setTypeFour(typeInfo(typeBeans.get(typeBeans.size()-1),s.getAirlineStatus()));
} }
String fileName = "航线执行期监控统计.xlsx"; String fileName = "航线执行期监控统计.xlsx";
try { try {
new ExportExcel("航线执行期监控统计", StatisticalListEntity.class).setDataList(list).write(response, fileName).dispose(); new ExportExcel("航线执行期监控统计---"+bean.getBenchmarkingTime(), StatisticalListEntity.class).setDataList(list).write(response, fileName).dispose();
} catch (IOException e) { } catch (IOException e) {
responseBean.setMessage("导出数据失败" + e.getMessage()); responseBean.setMessage("导出数据失败" + e.getMessage());
return responseBean; return responseBean;
......
...@@ -12,20 +12,25 @@ public class StatisticalListEntity extends BaseEntity { ...@@ -12,20 +12,25 @@ public class StatisticalListEntity extends BaseEntity {
private String arrIataName; private String arrIataName;
private String depIata; private String depIata;
private String depIataName; private String depIataName;
@ExcelField(title="最后一班航班时间", type=0, align=1, sort=25 )
private String lastAirlineTime; private String lastAirlineTime;
private String updateTime; private String updateTime;
private int airlineStatus; private int airlineStatus;
private String airlineJson; private String airlineJson;
@ExcelField(title="航线状态", type=0, align=1, sort=26 )
private String status; private String status;
@ExcelField(title="A319/A320", type=0, align=1, sort=21 )
private String typeOne; private String typeOne;
@ExcelField(title="A321", type=0, align=1, sort=22 )
private String typeTwo; private String typeTwo;
@ExcelField(title="A320neo", type=0, align=1, sort=23 )
private String typeThree; private String typeThree;
@ExcelField(title="A330", type=0, align=1, sort=24 )
private String typeFour; private String typeFour;
@ExcelField(title="航线", type=0, align=1, sort=20 )
private String depIataLabel;
@ExcelField(title="序号", type=0, align=1, sort=19 )
private int no;
public String getArrIata() { public String getArrIata() {
return arrIata; return arrIata;
...@@ -35,7 +40,6 @@ public class StatisticalListEntity extends BaseEntity { ...@@ -35,7 +40,6 @@ public class StatisticalListEntity extends BaseEntity {
this.arrIata = arrIata; this.arrIata = arrIata;
} }
@ExcelField(title="起飞", type=0, align=1, sort=19 )
public String getArrIataName() { public String getArrIataName() {
return arrIataName; return arrIataName;
} }
...@@ -52,7 +56,6 @@ public class StatisticalListEntity extends BaseEntity { ...@@ -52,7 +56,6 @@ public class StatisticalListEntity extends BaseEntity {
this.depIata = depIata; this.depIata = depIata;
} }
@ExcelField(title="终点", type=0, align=1, sort=20 )
public String getDepIataName() { public String getDepIataName() {
return depIataName; return depIataName;
} }
...@@ -61,7 +64,7 @@ public class StatisticalListEntity extends BaseEntity { ...@@ -61,7 +64,7 @@ public class StatisticalListEntity extends BaseEntity {
this.depIataName = depIataName; this.depIataName = depIataName;
} }
@ExcelField(title="最后一班航班时间", type=0, align=1, sort=25 )
public String getLastAirlineTime() { public String getLastAirlineTime() {
return lastAirlineTime; return lastAirlineTime;
} }
...@@ -95,7 +98,6 @@ public class StatisticalListEntity extends BaseEntity { ...@@ -95,7 +98,6 @@ public class StatisticalListEntity extends BaseEntity {
this.updateTime = updateTime; this.updateTime = updateTime;
} }
@ExcelField(title="A319/A320", type=0, align=1, sort=21 )
public String getTypeOne() { public String getTypeOne() {
return typeOne; return typeOne;
} }
...@@ -104,7 +106,6 @@ public class StatisticalListEntity extends BaseEntity { ...@@ -104,7 +106,6 @@ public class StatisticalListEntity extends BaseEntity {
this.typeOne = typeOne; this.typeOne = typeOne;
} }
@ExcelField(title="A321", type=0, align=1, sort=22 )
public String getTypeTwo() { public String getTypeTwo() {
return typeTwo; return typeTwo;
} }
...@@ -113,7 +114,6 @@ public class StatisticalListEntity extends BaseEntity { ...@@ -113,7 +114,6 @@ public class StatisticalListEntity extends BaseEntity {
this.typeTwo = typeTwo; this.typeTwo = typeTwo;
} }
@ExcelField(title="A320neo", type=0, align=1, sort=23 )
public String getTypeThree() { public String getTypeThree() {
return typeThree; return typeThree;
} }
...@@ -122,7 +122,6 @@ public class StatisticalListEntity extends BaseEntity { ...@@ -122,7 +122,6 @@ public class StatisticalListEntity extends BaseEntity {
this.typeThree = typeThree; this.typeThree = typeThree;
} }
@ExcelField(title="A330", type=0, align=1, sort=24 )
public String getTypeFour() { public String getTypeFour() {
return typeFour; return typeFour;
} }
...@@ -131,7 +130,6 @@ public class StatisticalListEntity extends BaseEntity { ...@@ -131,7 +130,6 @@ public class StatisticalListEntity extends BaseEntity {
this.typeFour = typeFour; this.typeFour = typeFour;
} }
@ExcelField(title="航线状态", type=0, align=1, sort=26 )
public String getStatus() { public String getStatus() {
return status; return status;
} }
...@@ -139,4 +137,20 @@ public class StatisticalListEntity extends BaseEntity { ...@@ -139,4 +137,20 @@ public class StatisticalListEntity extends BaseEntity {
public void setStatus(String status) { public void setStatus(String status) {
this.status = status; this.status = status;
} }
public String getDepIataLabel() {
return depIataLabel;
}
public void setDepIataLabel(String depIataLabel) {
this.depIataLabel = depIataLabel;
}
public int getNo() {
return no;
}
public void setNo(int no) {
this.no = no;
}
} }
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