Commit 1302072a by java-李谡

申请单管理列表根据更新时间排序

parent 31a0426a
......@@ -176,34 +176,28 @@
favt.arr_iata_name AS arrIataName,
favt.dep_iata AS depIata,
favt.dep_iata_name AS depIataName,
favt.depart_id AS departId,
favt.roundtrip_type AS roundtripType,
favt.verif_id AS verifId,
favt.verif_no AS verifNo,
favt.last_airline_time AS lastAirlineTime,
CASE
WHEN
DATE_SUB( #{benchmarkingTime}, INTERVAL 180 DAY ) <![CDATA[<=]]> favt.last_airline_time
AND
favt.last_airline_time <![CDATA[<=]]> DATE_SUB( #{benchmarkingTime}, INTERVAL - 180 DAY )
THEN
1
ELSE
0
END AS airlineStatus,
favt.airline_json AS airlineJson,
favt.update_date as updateTime
AND
favt.last_airline_time <![CDATA[<=]]> DATE_SUB( #{benchmarkingTime}, INTERVAL - 180 DAY )
THEN
1
ELSE
0
END AS airlineStatus,
favt.airline_json AS airlineJson,
favt.update_date as updateTime
FROM
foc_airline_verify_test favt
foc_airline_sta favt
WHERE
favt.del_flag = #{DEL_FLAG_NORMAL}
favt.del_flag = #{DEL_FLAG_NORMAL}
<if test="depIata != null and depIata != ''">
and favt.dep_iata = #{depIata}
and (favt.dep_iata = #{depIata} or favt.arr_iata= #{depIata})
</if>
<if test="arrIata != null and arrIata != ''">
and favt.arr_iata = #{arrIata}
and (favt.arr_iata = #{arrIata} or favt.arr_iata = #{depIata})
</if>
</select>
......
......@@ -79,11 +79,6 @@ public class SecurityPropertyPlaceholderConfigurer extends PropertyPlaceholderCo
}
public static void main(String[] args) {
System.out.println(Util.phoneReg("18501501226"));
System.out.println(Util.phoneReg("018501501226".replaceAll("^0+", "")));
System.out.println(Util.phoneReg("0018501501226".replaceAll("^0+", "")));
System.out.println(Util.phoneReg("51018501501226".replaceAll("^0+", "")));
System.out.println(Util.phoneReg("8618501501226".replaceAll("^0+", "")));
System.out.println(Util.phoneReg("+8618501501226".replaceAll("^0+", "")));
System.out.println(DES3Utils.decrypt("f5c9d35c1df1eb31c0f15d23ee5af33d15ee14d1133b16ae580893ec603fc77c0057d3cccb34407d0505fc99a849cd7ee060d2c605d68b21ea7fea2a325dd4026e7f13e65e216d967bc7696f608fe56ef11ae4801b727c51d09bc4beb44b24f0", CONF_DESC_KEY));
}
}
/**
*
*
*/
package com.ejweb.modules.airport.api;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.ejweb.modules.airport.bean.StatisticalListBean;
import com.ejweb.modules.airport.entity.StatisticalListEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.ejweb.core.api.RequestBean;
import com.ejweb.core.api.ResponseBean;
import com.ejweb.core.base.PageEntity;
......@@ -23,36 +10,48 @@ import com.ejweb.core.conf.ErrorCode;
import com.ejweb.core.conf.GConstants;
import com.ejweb.core.utils.excel.ExportExcel;
import com.ejweb.modules.airport.bean.StatisticalBean;
import com.ejweb.modules.airport.bean.StatisticalListBean;
import com.ejweb.modules.airport.entity.StatisticalEntity;
import com.ejweb.modules.airport.entity.StatisticalListEntity;
import com.ejweb.modules.airport.service.StatisticalService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
/**
* 数据统计
* @team suzhou
*
* @author huhy
* @version 1.0
* @time 2016年9月7日
* @team suzhou
* @time 2016年9月7日
*/
@Controller
@RequestMapping(value = "/api/airline/statistical")
public class StatisticalController{
public class StatisticalController {
@Autowired
private StatisticalService statisticalService;
@ResponseBody
@RequestMapping(value = "/list")
public ResponseBean getStatisticalList(RequestBean requestBean){
public ResponseBean getStatisticalList(RequestBean requestBean) {
ResponseBean responseBean = new ResponseBean();
StatisticalBean bean = requestBean.getObjectBean(StatisticalBean.class);
String sort=bean.getSort();
if(sort!=null && !"".equals(sort)){
if(",".equals(sort.substring(0, 1))){
sort=sort.substring(1,sort.length());
String sort = bean.getSort();
if (sort != null && !"".equals(sort)) {
if (",".equals(sort.substring(0, 1))) {
sort = sort.substring(1, sort.length());
}
}
String message = statisticalService.validate(bean);
if(message == null){
if (message == null) {
// 参数校验为通过
PageEntity<StatisticalEntity> list = statisticalService.getStatisticalList(bean);
// 查询结果为空
......@@ -70,25 +69,26 @@ public class StatisticalController{
responseBean.setStatus(ErrorCode.STATUS_CODE_4001);
return responseBean;
}
@RequestMapping(value = "export")
public ResponseBean exportExcel(RequestBean requestBean,HttpServletResponse response){
public ResponseBean exportExcel(RequestBean requestBean, HttpServletResponse response) {
ResponseBean responseBean = new ResponseBean();
StatisticalBean bean = requestBean.getObjectBean(StatisticalBean.class);
String message = statisticalService.validate(bean);
if(message == null){
if (message == null) {
bean.setPageSize(1000);
// 参数校验为通过
PageEntity<StatisticalEntity> page = statisticalService.getStatisticalList(bean);
List<StatisticalEntity> list=new ArrayList<StatisticalEntity>();
if(page != null){// 查询结果为空
list=page.getList();
List<StatisticalEntity> list = new ArrayList<StatisticalEntity>();
// 查询结果为空
if (page != null) {
list = page.getList();
}
String fileName = "航线论证数据统计.xlsx";
try {
new ExportExcel("航线论证数据统计", StatisticalEntity.class).setDataList(list).write(response, fileName).dispose();
} catch (IOException e) {
responseBean.setMessage("导出数据失败"+e.getMessage());
responseBean.setMessage("导出数据失败" + e.getMessage());
return responseBean;
}
return null;
......@@ -100,11 +100,11 @@ public class StatisticalController{
@ResponseBody
@RequestMapping(value = "/getList")
public ResponseBean getList(RequestBean requestBean){
public ResponseBean getList(RequestBean requestBean) {
ResponseBean responseBean = new ResponseBean();
StatisticalListBean bean = requestBean.getObjectBean(StatisticalListBean.class);
String message = statisticalService.validate(bean);
if(message == null){
if (message == null) {
bean.setPageSize(1000);
// 参数校验为通过
PageEntity<StatisticalListEntity> list = statisticalService.getList(bean);
......@@ -125,26 +125,26 @@ public class StatisticalController{
}
@RequestMapping(value = "newExport")
public ResponseBean newExport(RequestBean requestBean,HttpServletResponse response){
public ResponseBean newExport(RequestBean requestBean, HttpServletResponse response) {
ResponseBean responseBean = new ResponseBean();
StatisticalListBean bean = requestBean.getObjectBean(StatisticalListBean.class);
String message = statisticalService.validate(bean);
if(message == null){
if (message == null) {
bean.setPageSize(1000);
// 参数校验为通过
PageEntity<StatisticalListEntity> page = statisticalService.getList(bean);
List<StatisticalListEntity> list=new ArrayList<StatisticalListEntity>();
if(page != null){// 查询结果为空
list=page.getList();
List<StatisticalListEntity> list = new ArrayList<StatisticalListEntity>();
if (page != null) {// 查询结果为空
list = page.getList();
String fileName = "航线论证数据统计.xlsx";
try {
new ExportExcel("航线论证数据统计", StatisticalEntity.class).setDataList(list).write(response, fileName).dispose();
} catch (IOException e) {
responseBean.setMessage("导出数据失败"+e.getMessage());
return responseBean;
}
return null;
String fileName = "航线论证数据统计.xlsx";
try {
new ExportExcel("航线论证数据统计", StatisticalEntity.class).setDataList(list).write(response, fileName).dispose();
} catch (IOException e) {
responseBean.setMessage("导出数据失败" + e.getMessage());
return responseBean;
}
return null;
}
responseBean.setMessage(GConstants.OK);
responseBean.setStatus(ErrorCode.STATUS_CODE_4001);
......
......@@ -11,10 +11,6 @@ public class StatisticalListEntity extends BaseEntity {
private String arrIataName;
private String depIata;
private String depIataName;
private String departId;
private String roundtripType;
private String verifId; // 拟用机型
private String verifNo ;
private String lastAirlineTime;
private String updateTime;
private int airlineStatus;
......@@ -52,38 +48,6 @@ public class StatisticalListEntity extends BaseEntity {
this.depIataName = depIataName;
}
public String getDepartId() {
return departId;
}
public void setDepartId(String departId) {
this.departId = departId;
}
public String getRoundtripType() {
return roundtripType;
}
public void setRoundtripType(String roundtripType) {
this.roundtripType = roundtripType;
}
public String getVerifId() {
return verifId;
}
public void setVerifId(String verifId) {
this.verifId = verifId;
}
public String getVerifNo() {
return verifNo;
}
public void setVerifNo(String verifNo) {
this.verifNo = verifNo;
}
public String getLastAirlineTime() {
return lastAirlineTime;
}
......
......@@ -150,12 +150,10 @@ public class StatisticalService extends BaseService<StatisticalDao> {
//使用迭代器进行筛选
Iterator<StatisticalListEntity> iter = lists.iterator();
while (iter.hasNext()) {
//当此对象状态与传入状态不一致时remove对象
if (iter.next().getAirlineStatus() != statisticalListBean.getAirlineStatus()){
iter.remove();
}
}
}
pageInfo = new PageInfo<StatisticalListEntity>(lists);
......
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