Commit 52fed1eb by luoh

油量接口,字段添加

parent 80491980
...@@ -2,18 +2,19 @@ ...@@ -2,18 +2,19 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ejweb.modules.airport.dao.OilAnalysisDao"> <mapper namespace="com.ejweb.modules.airport.dao.OilAnalysisDao">
<select id="getOilAnalysisData" resultType="com.ejweb.modules.airport.entity.OilAnalysisEntity"> <select id="getOilAnalysisData" resultType="com.ejweb.modules.airport.entity.OilAnalysisEntity">
select DATE_FORMAT(sta.std, '%Y-%m-%d %H:%i')as std, select DATE_FORMAT(sta.std, '%Y/%m/%d %H:%i')as std,
sta.flight_no, sta.flight_no,
sta.ac_no, sta.ac_no,
CONCAT(IFNULL(u.name,''),sta.dispatcher_name) as dispatcher_name, sta.dispatcher_name,
IFNULL(u.name,'') as dispatcherAccount,
sta.total_oil, sta.total_oil,
sta.dep_iata_id, sta.dep_iata_id,
sta.arr_iata_id, sta.arr_iata_id,
sta.extra_oil_fuel_reason, sta.extra_oil_fuel_reason,
DATE_FORMAT(sta.update_date, '%Y:%m:%d')as updateDate, DATE_FORMAT(sta.update_date, '%Y/%m/%d')as updateDate,
airArr.city_name as arrAirPortName, airArr.city_name as arrAirPortName,
airdep.city_name as depAirPortName, airdep.city_name as depAirPortName,
acType.type_name as acTypeName IFNULL(acType.type_name,'') as acTypeName
from foc_flight_dynamics_sta sta from foc_flight_dynamics_sta sta
left join foc_airports airArr on airArr.airport_iata = sta.arr_iata_id left join foc_airports airArr on airArr.airport_iata = sta.arr_iata_id
...@@ -21,6 +22,8 @@ ...@@ -21,6 +22,8 @@
left join foc_ac_type acType on acType.flight_no = sta.ac_no left join foc_ac_type acType on acType.flight_no = sta.ac_no
left join sys_user u on u.login_name = sta.dispatcher_name left join sys_user u on u.login_name = sta.dispatcher_name
where 1=1 where 1=1
<if test="arrIata!=null and arrIata!='' "> <if test="arrIata!=null and arrIata!='' ">
...@@ -35,16 +38,20 @@ ...@@ -35,16 +38,20 @@
and sta.flight_no = #{flightNo} and sta.flight_no = #{flightNo}
</if> </if>
<if test="dispatcher!=null and dispatcher!=''"> <if test="dispatcherZH!=null and dispatcherZH!=''">
and sta.dispatcher_name = #{dispatcher} and u.name LIKE CONCAT('%',#{dispatcherZH}, '%')
</if>
<if test="dispatcherENG!=null and dispatcherENG!=''">
and sta.dispatcher_name LIKE CONCAT('%',#{dispatcherENG}, '%')
</if> </if>
<if test="minDepTime !=null and minDepTime!=''"> <if test="minDepTime !=null and minDepTime!=''">
and sta.std <![CDATA[>=]]> date_format(#{minDepTime},'%Y-%c-%d %H:%i:%s') and sta.std <![CDATA[>=]]> date_format(#{minDepTime},'%Y-%c-%d %H:%i')
</if> </if>
<if test="maxDepTime !=null and maxDepTime!=''"> <if test="maxDepTime !=null and maxDepTime!=''">
and sta.std <![CDATA[<]]> date_format(#{maxDepTime},'%Y-%c-%d %H:%i:%s') and sta.std <![CDATA[<]]> date_format(#{maxDepTime},'%Y-%c-%d %H:%i')
</if> </if>
<if test="mintotalOil !=null and mintotalOil!=''"> <if test="mintotalOil !=null and mintotalOil!=''">
...@@ -55,6 +62,7 @@ ...@@ -55,6 +62,7 @@
and substring_index(sta.total_oil,'KGS',1) <![CDATA[<]]> #{maxtotalOil} and substring_index(sta.total_oil,'KGS',1) <![CDATA[<]]> #{maxtotalOil}
</if> </if>
order by std desc
</select> </select>
......
package com.ejweb.core.api; package com.ejweb.core.api;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import org.apache.poi.util.SystemOutLogger;
import org.hibernate.validator.constraints.NotEmpty; import org.hibernate.validator.constraints.NotEmpty;
import org.springframework.validation.BindingResult; import org.springframework.validation.BindingResult;
import org.springframework.validation.ObjectError; import org.springframework.validation.ObjectError;
...@@ -54,7 +55,9 @@ public class RequestBean { ...@@ -54,7 +55,9 @@ public class RequestBean {
try { try {
return JSON.parseObject(content, clazz); return JSON.parseObject(content, clazz);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace();
// TODO: handle exception // TODO: handle exception
} }
return null; return null;
} }
......
...@@ -49,6 +49,10 @@ public class AirportController { ...@@ -49,6 +49,10 @@ public class AirportController {
PageEntity<AirportListEntity> list = null; PageEntity<AirportListEntity> list = null;
ResponseBean responseBean = new ResponseBean(); ResponseBean responseBean = new ResponseBean();
AirportListBean bean = requestBean.getObjectBean(AirportListBean.class); AirportListBean bean = requestBean.getObjectBean(AirportListBean.class);
String message = airportService.validate(bean); String message = airportService.validate(bean);
if(message == null){// 通过参数校验 if(message == null){// 通过参数校验
......
...@@ -8,6 +8,7 @@ import com.ejweb.core.conf.ErrorCode; ...@@ -8,6 +8,7 @@ import com.ejweb.core.conf.ErrorCode;
import com.ejweb.core.conf.GConstants; import com.ejweb.core.conf.GConstants;
import com.ejweb.core.utils.excel.ExportExcel; import com.ejweb.core.utils.excel.ExportExcel;
import com.ejweb.modules.airport.bean.OilAnalysisBean; import com.ejweb.modules.airport.bean.OilAnalysisBean;
import com.ejweb.modules.airport.bean.StatisticalBean;
import com.ejweb.modules.airport.dao.OilAnalysisDao; import com.ejweb.modules.airport.dao.OilAnalysisDao;
import com.ejweb.modules.airport.entity.AirportListEntity; import com.ejweb.modules.airport.entity.AirportListEntity;
import com.ejweb.modules.airport.entity.OilAnalysisEntity; import com.ejweb.modules.airport.entity.OilAnalysisEntity;
...@@ -61,9 +62,9 @@ public class OilAnalysisController { ...@@ -61,9 +62,9 @@ public class OilAnalysisController {
{ {
list = page.getList(); list = page.getList();
//自定义导出序号 //自定义导出序号
String fileName = "油量分析统计.xlsx"; String fileName = "油量分析统计(油量单位:KGS).xlsx";
try { try {
new ExportExcel("油量分析统计", OilAnalysisEntity.class).setDataList(list).write(response, fileName).dispose(); new ExportExcel("油量分析统计(油量单位:KGS)", OilAnalysisEntity.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;
......
package com.ejweb.modules.airport.bean; package com.ejweb.modules.airport.bean;
import com.alibaba.fastjson.annotation.JSONField;
import com.ejweb.core.base.GenericBean; import com.ejweb.core.base.GenericBean;
import com.ejweb.core.conf.GConstants; import com.ejweb.core.conf.GConstants;
...@@ -15,6 +16,7 @@ import javax.validation.constraints.Min; ...@@ -15,6 +16,7 @@ import javax.validation.constraints.Min;
*/ */
public class OilAnalysisBean extends GenericBean { public class OilAnalysisBean extends GenericBean {
//最低起飞时间 //最低起飞时间
private String minDepTime; private String minDepTime;
//最大起飞时间 //最大起飞时间
...@@ -25,8 +27,12 @@ public class OilAnalysisBean extends GenericBean { ...@@ -25,8 +27,12 @@ public class OilAnalysisBean extends GenericBean {
private String depIata; private String depIata;
//目的机场三字码 //目的机场三字码
private String arrIata; private String arrIata;
//签派员d //签派员
private String dispatcher; private String dispatcher;
//签派员英文名
private String dispatcherENG;
//签派员中文名
private String dispatcherZH;
//最低总油量 //最低总油量
private Integer mintotalOil; private Integer mintotalOil;
//最高总油量 //最高总油量
...@@ -38,42 +44,53 @@ public class OilAnalysisBean extends GenericBean { ...@@ -38,42 +44,53 @@ public class OilAnalysisBean extends GenericBean {
@Min(value=1, message="pageSize必须大于等于1") @Min(value=1, message="pageSize必须大于等于1")
private int pageSize= GConstants.PAGE_SIZE;//每页条数 private int pageSize= GConstants.PAGE_SIZE;//每页条数
public int getPageNo() { public String getMinDepTime() {
return pageNo; return minDepTime;
} }
public void setPageNo(int pageNo) { public void setMinDepTime(String minDepTime) {
this.pageNo = pageNo; this.minDepTime = minDepTime;
} }
public int getPageSize() { public String getMaxDepTime() {
return pageSize; return maxDepTime;
} }
public void setPageSize(int pageSize) { public void setMaxDepTime(String maxDepTime) {
this.pageSize = pageSize; this.maxDepTime = maxDepTime;
} }
public String getFlightNo() {
return flightNo;
}
public void setFlightNo(String flightNo) {
this.flightNo = flightNo;
}
public String getDepIata() {
public String getMinDepTime() { return depIata;
return minDepTime;
} }
public void setMinDepTime(String minDepTime) { public void setDepIata(String depIata) {
this.minDepTime = minDepTime; this.depIata = depIata;
} }
public String getMaxDepTime() { public String getArrIata() {
return maxDepTime; return arrIata;
} }
public void setMaxDepTime(String maxDepTime) { public void setArrIata(String arrIata) {
this.maxDepTime = maxDepTime; this.arrIata = arrIata;
} }
public String getDispatcher() {
return dispatcher;
}
public void setDispatcher(String dispatcher) {
this.dispatcher = dispatcher;
}
public Integer getMintotalOil() { public Integer getMintotalOil() {
return mintotalOil; return mintotalOil;
...@@ -91,38 +108,41 @@ public class OilAnalysisBean extends GenericBean { ...@@ -91,38 +108,41 @@ public class OilAnalysisBean extends GenericBean {
this.maxtotalOil = maxtotalOil; this.maxtotalOil = maxtotalOil;
} }
public String getDispatcher() { public int getPageNo() {
return dispatcher; return pageNo;
} }
public void setDispatcher(String dispatcher) { public void setPageNo(int pageNo) {
this.dispatcher = dispatcher; this.pageNo = pageNo;
} }
public String getFlightNo() { public int getPageSize() {
return flightNo; return pageSize;
} }
public void setFlightNo(String flightNo) { public void setPageSize(int pageSize) {
this.flightNo = flightNo; this.pageSize = pageSize;
} }
public String getDepIata() { public String getDispatcherENG() {
return depIata; return dispatcherENG;
} }
public void setDepIata(String depIata) { public void setDispatcherENG(String dispatcherENG) {
this.depIata = depIata; this.dispatcherENG = dispatcherENG;
} }
public String getDispatcherZH() {
public String getArrIata() { return dispatcherZH;
return arrIata;
} }
public void setArrIata(String arrIata) { public void setDispatcherZH(String dispatcherZH) {
this.arrIata = arrIata; this.dispatcherZH = dispatcherZH;
} }
} }
...@@ -24,37 +24,60 @@ public class OilAnalysisEntity { ...@@ -24,37 +24,60 @@ public class OilAnalysisEntity {
private String acNo; // 飞机号 private String acNo; // 飞机号
@ExcelField(title="机型", type=0, align=1, sort=31 ) @ExcelField(title="机型", type=0, align=1, sort=31 )
private String acTypeName; // 机型 private String acTypeName; // 机型
@ExcelField(title="起飞机场", type=0, align=1, sort=32 ) @ExcelField(title="起飞机场", type=0, align=1, sort=32 )
private String depAirPortName; // 起飞机场中文名称 private String depAirPortName; // 起飞机场中文名称
@ExcelField(title="目的机场", type=0, align=1, sort=33 ) @ExcelField(title="起飞机场三字码", type=0, align=1, sort=33 )
private String depIataId; // 起飞机场三字码
@ExcelField(title="目的机场", type=0, align=1, sort=34 )
private String arrAirPortName; // 落地机场中文名称 private String arrAirPortName; // 落地机场中文名称
@ExcelField(title="签派人", type=0, align=1, sort=34 ) @ExcelField(title="目的机场三字码", type=0, align=1, sort=35 )
private String arrIataId; // 落地机场三字码
@ExcelField(title="签派人姓名", type=0, align=1, sort=36 )
private String dispatcherAccount; // 签派人账号
@ExcelField(title="签派人账号", type=0, align=1, sort=37 )
private String dispatcherName; // 签派人 private String dispatcherName; // 签派人
@ExcelField(title="总油量", type=0, align=1, sort=35 )
@ExcelField(title="总油量", type=0, align=1, sort=38 )
private String totalOil; // 总油量 private String totalOil; // 总油量
@ExcelField(title="起飞额外油量", type=0, align=1, sort=36 ) @ExcelField(title="起飞额外油量", type=0, align=1, sort=39 )
private String extraOilFuelTakeoff; // 起飞额外油量 private String extraOilFuelTakeoff; // 起飞额外油量
@ExcelField(title="起飞额外油量原因", type=0, align=1, sort=37 ) @ExcelField(title="起飞额外油量原因", type=0, align=1, sort=40 )
private String extraOilFuelTakeoffReason; // 起飞额外油量原因 private String extraOilFuelTakeoffReason; // 起飞额外油量原因
@ExcelField(title="到达额外油量", type=0, align=1, sort=38 ) @ExcelField(title="到达额外油量", type=0, align=1, sort=41 )
private String extraOilFuelArr; // 到达额外油量 private String extraOilFuelArr; // 到达额外油量
@ExcelField(title="到达额外油量原因", type=0, align=1, sort=39 ) @ExcelField(title="到达额外油量原因", type=0, align=1, sort=42 )
private String extraOilFuelArrReason; // 到达额外油量原因 private String extraOilFuelArrReason; // 到达额外油量原因
@ExcelField(title="航路额外油量", type=0, align=1, sort=40 ) @ExcelField(title="航路额外油量", type=0, align=1, sort=43 )
private String extraOilFuelFlight; // 航路额外油量 private String extraOilFuelFlight; // 航路额外油量
@ExcelField(title="航路额外油量原因", type=0, align=1, sort=41 ) @ExcelField(title="航路额外油量原因", type=0, align=1, sort=44 )
private String extraOilFuelFlightReason; // 航路额外油量原因 private String extraOilFuelFlightReason; // 航路额外油量原因
@ExcelField(title="其他额外油量", type=0, align=1, sort=42 ) @ExcelField(title="其他额外油量", type=0, align=1, sort=45 )
private String extraOilFuelOther; // 其他额外油量 private String extraOilFuelOther; // 其他额外油量
@ExcelField(title="其他额外油量原因", type=0, align=1, sort=43 ) @ExcelField(title="其他额外油量原因", type=0, align=1, sort=46 )
private String extraOilFuelOtherReason; // 起飞额外油量原因 private String extraOilFuelOtherReason; // 起飞额外油量原因
@ExcelField(title="数据更新时间", type=0, align=1, sort=44 ) @ExcelField(title="数据更新时间", type=0, align=1, sort=47 )
private String updateDate; // 数据更新时间 private String updateDate; // 数据更新时间
private String depIataId; // 起飞机场三字码
private String arrIataId; // 落地机场三字码
private String extraOilFuelReason; // 额外油加注原因 private String extraOilFuelReason; // 额外油加注原因
public String getDispatcherAccount() {
return dispatcherAccount;
}
public void setDispatcherAccount(String dispatcherAccount) {
this.dispatcherAccount = dispatcherAccount;
}
public String getExtraOilFuelTakeoffReason() { public String getExtraOilFuelTakeoffReason() {
return extraOilFuelTakeoffReason; return extraOilFuelTakeoffReason;
} }
......
...@@ -26,7 +26,19 @@ public class OilAnalysisService extends BaseService<OilAnalysisDao> { ...@@ -26,7 +26,19 @@ public class OilAnalysisService extends BaseService<OilAnalysisDao> {
{ {
PageHelper.startPage(bean.getPageNo(), bean.getPageSize()); PageHelper.startPage(bean.getPageNo(), bean.getPageSize());
} }
//派遣员条件为账号和名字
if ( ! StringUtils.isEmpty(bean.getDispatcher()) )
{
if (bean.getDispatcher().matches("[\u4E00-\u9FA5]+"))
{
//内容是中文
bean.setDispatcherZH(bean.getDispatcher());
}else {
//内容包含非中文
bean.setDispatcherENG(bean.getDispatcher());
}
}
PageInfo<OilAnalysisEntity> pageInfo = null; PageInfo<OilAnalysisEntity> pageInfo = null;
List <OilAnalysisEntity> oilAnalysisEntityList = oilAnalysisDao.getOilAnalysisData(bean); List <OilAnalysisEntity> oilAnalysisEntityList = oilAnalysisDao.getOilAnalysisData(bean);
......
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