Commit 3250c9ae by java-李谡

修改航线论证列表展示,修改手机号码归属地查询服务

parent b3b9aa50
...@@ -77,7 +77,7 @@ ...@@ -77,7 +77,7 @@
LEFT JOIN foc_airline_verified s ON a.id = s.verif_id LEFT JOIN foc_airline_verified s ON a.id = s.verif_id
LEFT JOIN foc_verify_change t ON a.id = t.verif_id LEFT JOIN foc_verify_change t ON a.id = t.verif_id
AND t.field_value = 'startTime' AND t.field_value = 'startTime'
AND t.del_flag = '2' AND t.del_flag = '0'
WHERE a.id = #{verifId} WHERE a.id = #{verifId}
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -28,15 +28,14 @@ ...@@ -28,15 +28,14 @@
<select id="getList" resultType="com.ejweb.modules.verify.entity.AirlineVerifyEntity"> <select id="getList" resultType="com.ejweb.modules.verify.entity.AirlineVerifyEntity">
SELECT SELECT
<include refid="airlineVerifyColumns"/> <include refid="airlineVerifyColumns"/>
,p.node_date ,p.end_time
FROM FROM
foc_airline_verify a foc_airline_verify a
LEFT JOIN foc_aircraft_type t ON a.aircraft_type = t.id LEFT JOIN foc_aircraft_type t ON a.aircraft_type = t.id
LEFT JOIN foc_airports d ON d.airport_iata = a.depIata LEFT JOIN foc_airports d ON d.airport_iata = a.depIata
LEFT JOIN foc_airports r ON r.airport_iata = a.arrIata LEFT JOIN foc_airports r ON r.airport_iata = a.arrIata
LEFT JOIN foc_verify_process p ON p.verif_id = a.id LEFT JOIN foc_airline_verified p ON p.verif_id = a.id
WHERE p.node_name='截止反馈时间' WHERE a.del_flag = #{DEL_FLAG_NORMAL}
and a.del_flag = #{DEL_FLAG_NORMAL}
<if test="depIata != null and depIata != ''"> <if test="depIata != null and depIata != ''">
AND (a.id in ( AND (a.id in (
......
...@@ -9,12 +9,16 @@ import java.io.IOException; ...@@ -9,12 +9,16 @@ import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.lang.reflect.Field; import java.lang.reflect.Field;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import java.text.SimpleDateFormat;
import java.util.Collections; import java.util.Collections;
import java.util.Comparator; import java.util.Comparator;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFDataFormat;
import org.apache.poi.hssf.usermodel.HSSFDateUtil;
import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.openxml4j.exceptions.InvalidFormatException; import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
import org.apache.poi.ss.usermodel.Cell; import org.apache.poi.ss.usermodel.Cell;
...@@ -32,7 +36,7 @@ import com.google.common.collect.Lists; ...@@ -32,7 +36,7 @@ import com.google.common.collect.Lists;
/** /**
* 导入Excel文件(支持“XLS”和“XLSX”格式) * 导入Excel文件(支持“XLS”和“XLSX”格式)
* *
* @author ThinkGem * @author ThinkGem
* @version 2013-03-10 * @version 2013-03-10
*/ */
...@@ -57,11 +61,9 @@ public class ImportExcel { ...@@ -57,11 +61,9 @@ public class ImportExcel {
/** /**
* 构造函数 * 构造函数
* *
* @param path * @param path 导入文件,读取第一个工作表
* 导入文件,读取第一个工作表 * @param headerNum 标题行号,数据行号=标题行号+1
* @param headerNum
* 标题行号,数据行号=标题行号+1
* @throws InvalidFormatException * @throws InvalidFormatException
* @throws IOException * @throws IOException
*/ */
...@@ -71,11 +73,9 @@ public class ImportExcel { ...@@ -71,11 +73,9 @@ public class ImportExcel {
/** /**
* 构造函数 * 构造函数
* *
* @param path * @param path 导入文件对象,读取第一个工作表
* 导入文件对象,读取第一个工作表 * @param headerNum 标题行号,数据行号=标题行号+1
* @param headerNum
* 标题行号,数据行号=标题行号+1
* @throws InvalidFormatException * @throws InvalidFormatException
* @throws IOException * @throws IOException
*/ */
...@@ -85,13 +85,10 @@ public class ImportExcel { ...@@ -85,13 +85,10 @@ public class ImportExcel {
/** /**
* 构造函数 * 构造函数
* *
* @param path * @param path 导入文件
* 导入文件 * @param headerNum 标题行号,数据行号=标题行号+1
* @param headerNum * @param sheetIndex 工作表编号
* 标题行号,数据行号=标题行号+1
* @param sheetIndex
* 工作表编号
* @throws InvalidFormatException * @throws InvalidFormatException
* @throws IOException * @throws IOException
*/ */
...@@ -101,13 +98,10 @@ public class ImportExcel { ...@@ -101,13 +98,10 @@ public class ImportExcel {
/** /**
* 构造函数 * 构造函数
* *
* @param path * @param path 导入文件对象
* 导入文件对象 * @param headerNum 标题行号,数据行号=标题行号+1
* @param headerNum * @param sheetIndex 工作表编号
* 标题行号,数据行号=标题行号+1
* @param sheetIndex
* 工作表编号
* @throws InvalidFormatException * @throws InvalidFormatException
* @throws IOException * @throws IOException
*/ */
...@@ -117,13 +111,10 @@ public class ImportExcel { ...@@ -117,13 +111,10 @@ public class ImportExcel {
/** /**
* 构造函数 * 构造函数
* *
* @param file * @param file 导入文件对象
* 导入文件对象 * @param headerNum 标题行号,数据行号=标题行号+1
* @param headerNum * @param sheetIndex 工作表编号
* 标题行号,数据行号=标题行号+1
* @param sheetIndex
* 工作表编号
* @throws InvalidFormatException * @throws InvalidFormatException
* @throws IOException * @throws IOException
*/ */
...@@ -134,13 +125,10 @@ public class ImportExcel { ...@@ -134,13 +125,10 @@ public class ImportExcel {
/** /**
* 构造函数 * 构造函数
* *
* @param path * @param path 导入文件对象
* 导入文件对象 * @param headerNum 标题行号,数据行号=标题行号+1
* @param headerNum * @param sheetIndex 工作表编号
* 标题行号,数据行号=标题行号+1
* @param sheetIndex
* 工作表编号
* @throws InvalidFormatException * @throws InvalidFormatException
* @throws IOException * @throws IOException
*/ */
...@@ -165,7 +153,7 @@ public class ImportExcel { ...@@ -165,7 +153,7 @@ public class ImportExcel {
/** /**
* 获取行对象 * 获取行对象
* *
* @param rownum * @param rownum
* @return * @return
*/ */
...@@ -175,7 +163,7 @@ public class ImportExcel { ...@@ -175,7 +163,7 @@ public class ImportExcel {
/** /**
* 获取数据行号 * 获取数据行号
* *
* @return * @return
*/ */
public int getDataRowNum() { public int getDataRowNum() {
...@@ -184,7 +172,7 @@ public class ImportExcel { ...@@ -184,7 +172,7 @@ public class ImportExcel {
/** /**
* 获取最后一个数据行号 * 获取最后一个数据行号
* *
* @return * @return
*/ */
public int getLastDataRowNum() { public int getLastDataRowNum() {
...@@ -193,7 +181,7 @@ public class ImportExcel { ...@@ -193,7 +181,7 @@ public class ImportExcel {
/** /**
* 获取最后一个列号 * 获取最后一个列号
* *
* @return * @return
*/ */
public int getLastCellNum() { public int getLastCellNum() {
...@@ -202,11 +190,9 @@ public class ImportExcel { ...@@ -202,11 +190,9 @@ public class ImportExcel {
/** /**
* 获取单元格值 * 获取单元格值
* *
* @param row * @param row 获取的行
* 获取的行 * @param column 获取单元格列号
* @param column
* 获取单元格列号
* @return 单元格值 * @return 单元格值
*/ */
public Object getCellValue(Row row, int column) { public Object getCellValue(Row row, int column) {
...@@ -215,16 +201,26 @@ public class ImportExcel { ...@@ -215,16 +201,26 @@ public class ImportExcel {
Cell cell = row.getCell(column); Cell cell = row.getCell(column);
if (cell != null) { if (cell != null) {
if (cell.getCellType() == Cell.CELL_TYPE_NUMERIC) { if (cell.getCellType() == Cell.CELL_TYPE_NUMERIC) {
val = cell.getNumericCellValue(); // 处理日期格式、时间格式
if (HSSFDateUtil.isCellDateFormatted(cell)) {
SimpleDateFormat sdf = null;
if (cell.getCellStyle().getDataFormat() == HSSFDataFormat
.getBuiltinFormat("h:mm")) {
sdf = new SimpleDateFormat("HH:mm");
}
Date date = cell.getDateCellValue();
val = sdf.format(date);
} else {
val = cell.getNumericCellValue();
}
} else if (cell.getCellType() == Cell.CELL_TYPE_STRING) { } else if (cell.getCellType() == Cell.CELL_TYPE_STRING) {
val = cell.getStringCellValue(); val = cell.getStringCellValue();
} else if (cell.getCellType() == Cell.CELL_TYPE_FORMULA) { } else if (cell.getCellType() == Cell.CELL_TYPE_FORMULA) {
// val = cell.getCellFormula(); try {
try { val = String.valueOf(cell.getStringCellValue());
val = String.valueOf(cell.getStringCellValue()); } catch (IllegalStateException e) {
} catch (IllegalStateException e) { val = String.valueOf(cell.getNumericCellValue());
val = String.valueOf(cell.getNumericCellValue()); }
}
} else if (cell.getCellType() == Cell.CELL_TYPE_BOOLEAN) { } else if (cell.getCellType() == Cell.CELL_TYPE_BOOLEAN) {
val = cell.getBooleanCellValue(); val = cell.getBooleanCellValue();
} else if (cell.getCellType() == Cell.CELL_TYPE_ERROR) { } else if (cell.getCellType() == Cell.CELL_TYPE_ERROR) {
...@@ -239,11 +235,9 @@ public class ImportExcel { ...@@ -239,11 +235,9 @@ public class ImportExcel {
/** /**
* 获取导入数据列表 * 获取导入数据列表
* *
* @param cls * @param cls 导入对象类型
* 导入对象类型 * @param groups 导入分组
* @param groups
* 导入分组
*/ */
public <E> List<E> getDataList(Class<E> cls, int... groups) throws InstantiationException, IllegalAccessException { public <E> List<E> getDataList(Class<E> cls, int... groups) throws InstantiationException, IllegalAccessException {
List<Object[]> annotationList = Lists.newArrayList(); List<Object[]> annotationList = Lists.newArrayList();
...@@ -261,13 +255,13 @@ public class ImportExcel { ...@@ -261,13 +255,13 @@ public class ImportExcel {
for (int efg : ef.groups()) { for (int efg : ef.groups()) {
if (g == efg) { if (g == efg) {
inGroup = true; inGroup = true;
annotationList.add(new Object[] { ef, f }); annotationList.add(new Object[]{ef, f});
break; break;
} }
} }
} }
} else { } else {
annotationList.add(new Object[] { ef, f }); annotationList.add(new Object[]{ef, f});
} }
} }
} }
...@@ -285,13 +279,13 @@ public class ImportExcel { ...@@ -285,13 +279,13 @@ public class ImportExcel {
for (int efg : ef.groups()) { for (int efg : ef.groups()) {
if (g == efg) { if (g == efg) {
inGroup = true; inGroup = true;
annotationList.add(new Object[] { ef, m }); annotationList.add(new Object[]{ef, m});
break; break;
} }
} }
} }
} else { } else {
annotationList.add(new Object[] { ef, m }); annotationList.add(new Object[]{ef, m});
} }
} }
} }
...@@ -299,7 +293,9 @@ public class ImportExcel { ...@@ -299,7 +293,9 @@ public class ImportExcel {
Collections.sort(annotationList, new Comparator<Object[]>() { Collections.sort(annotationList, new Comparator<Object[]>() {
public int compare(Object[] o1, Object[] o2) { public int compare(Object[] o1, Object[] o2) {
return new Integer(((ExcelField) o1[0]).sort()).compareTo(new Integer(((ExcelField) o2[0]).sort())); return new Integer(((ExcelField) o1[0]).sort()).compareTo(new Integer(((ExcelField) o2[0]).sort()));
}; }
;
}); });
// log.debug("Import column count:"+annotationList.size()); // log.debug("Import column count:"+annotationList.size());
// Get excel data // Get excel data
...@@ -373,7 +369,7 @@ public class ImportExcel { ...@@ -373,7 +369,7 @@ public class ImportExcel {
if ("get".equals(mthodName.substring(0, 3))) { if ("get".equals(mthodName.substring(0, 3))) {
mthodName = "set" + StringUtils.substringAfter(mthodName, "get"); mthodName = "set" + StringUtils.substringAfter(mthodName, "get");
} }
Reflections.invokeMethod(e, mthodName, new Class[] { valType }, new Object[] { val }); Reflections.invokeMethod(e, mthodName, new Class[]{valType}, new Object[]{val});
} }
} }
sb.append(val + ", "); sb.append(val + ", ");
......
...@@ -13,7 +13,7 @@ import com.ejweb.core.fetcher.FetchEntity; ...@@ -13,7 +13,7 @@ import com.ejweb.core.fetcher.FetchEntity;
import com.ejweb.core.fetcher.HCFetcher; import com.ejweb.core.fetcher.HCFetcher;
/** /**
* *
* @team IT Team * @team IT Team
* @author renmb * @author renmb
* @version 1.0 * @version 1.0
...@@ -23,7 +23,7 @@ public class PhoneAreaUtil { ...@@ -23,7 +23,7 @@ public class PhoneAreaUtil {
/** /**
* 360安全卫士提供的手机号归属地查询接口 * 360安全卫士提供的手机号归属地查询接口
* *
* @author renmb * @author renmb
* @time 2016年10月30日 * @time 2016年10月30日
* @param phone * @param phone
...@@ -34,20 +34,20 @@ public class PhoneAreaUtil { ...@@ -34,20 +34,20 @@ public class PhoneAreaUtil {
if(StringUtils.isBlank(mobile)) if(StringUtils.isBlank(mobile))
return null; return null;
HCFetcher fetcher = HCFetcher.getInstance(); HCFetcher fetcher = HCFetcher.getInstance();
FetchEntity entity = fetcher.get(GConstants.getValue("cx.shouji.360.cn", "https://cx.shouji.360.cn/phonearea.php")+"?number="+mobile); FetchEntity entity = fetcher.get(GConstants.getValue("cx.shouji.360.cn", "http://cx.shouji.360.cn/phonearea.php")+"?number="+mobile);
if(entity != null && entity.isSuccess()){ if(entity != null && entity.isSuccess()){
String txt = entity.getContent("UTF-8"); String txt = entity.getContent("UTF-8");
JSONObject object = JSON.parseObject(txt); JSONObject object = JSON.parseObject(txt);
JSONObject data = object.getJSONObject("data"); JSONObject data = object.getJSONObject("data");
if(StringUtils.isNotBlank(data.getString("province"))){ if(StringUtils.isNotBlank(data.getString("province"))){
PhoneAreaEntity area = new PhoneAreaEntity(); PhoneAreaEntity area = new PhoneAreaEntity();
area.setProvince(data.getString("province")); area.setProvince(data.getString("province"));
area.setCity(data.getString("city")); area.setCity(data.getString("city"));
area.setSp(data.getString("sp")); area.setSp(data.getString("sp"));
return area; return area;
} }
} }
...@@ -56,12 +56,12 @@ public class PhoneAreaUtil { ...@@ -56,12 +56,12 @@ public class PhoneAreaUtil {
} }
return null; return null;
} }
/** /**
* 百度号码认证平台提供 * 百度号码认证平台提供
* *
* http://haoma.baidu.com/ * http://haoma.baidu.com/
* *
* @author renmb * @author renmb
* @time 2017年3月3日 * @time 2017年3月3日
* @param mobile * @param mobile
...@@ -74,7 +74,7 @@ public class PhoneAreaUtil { ...@@ -74,7 +74,7 @@ public class PhoneAreaUtil {
HCFetcher fetcher = HCFetcher.getInstance(); HCFetcher fetcher = HCFetcher.getInstance();
FetchEntity entity = fetcher.get(GConstants.getValue("sp0.baidu.com", "https://sp0.baidu.com/8aQDcjqpAAV3otqbppnN2DJv")+"/api.php?query="+mobile+"&co=&resource_id=6004&t="+System.currentTimeMillis()+"&ie=utf8&oe=gbk&cb=&format=json&tn=baidu&cb=&_="+System.currentTimeMillis()); FetchEntity entity = fetcher.get(GConstants.getValue("sp0.baidu.com", "https://sp0.baidu.com/8aQDcjqpAAV3otqbppnN2DJv")+"/api.php?query="+mobile+"&co=&resource_id=6004&t="+System.currentTimeMillis()+"&ie=utf8&oe=gbk&cb=&format=json&tn=baidu&cb=&_="+System.currentTimeMillis());
if(entity != null && entity.isSuccess()){ if(entity != null && entity.isSuccess()){
String txt = entity.getContent("gbk"); String txt = entity.getContent("gbk");
// if(GConstants.DEBUG){ // if(GConstants.DEBUG){
// //
...@@ -86,12 +86,12 @@ public class PhoneAreaUtil { ...@@ -86,12 +86,12 @@ public class PhoneAreaUtil {
if(data != null && data.size()>0){ if(data != null && data.size()>0){
JSONObject row = data.getJSONObject(0); JSONObject row = data.getJSONObject(0);
if(StringUtils.isNotEmpty(row.getString("prov"))){ if(StringUtils.isNotEmpty(row.getString("prov"))){
PhoneAreaEntity area = new PhoneAreaEntity(); PhoneAreaEntity area = new PhoneAreaEntity();
area.setProvince(row.getString("prov")); area.setProvince(row.getString("prov"));
area.setCity(row.getString("city")); area.setCity(row.getString("city"));
area.setSp(row.getString("type")); area.setSp(row.getString("type"));
return area; return area;
} }
} }
......
...@@ -85,6 +85,8 @@ public class AirlineVerifyService extends BaseService<AirlineVerifyDao>{ ...@@ -85,6 +85,8 @@ public class AirlineVerifyService extends BaseService<AirlineVerifyDao>{
AssessmentDao riskDao; AssessmentDao riskDao;
@Autowired @Autowired
VerifyConditionDao verifyConditionDao; VerifyConditionDao verifyConditionDao;
@Autowired
VerifyProcessDao processDao;
public PageEntity<AirlineVerifyEntity> getAirlineVerifyList(AirlineVerifyBean bean) { public PageEntity<AirlineVerifyEntity> getAirlineVerifyList(AirlineVerifyBean bean) {
PageInfo<AirlineVerifyEntity> pageInfo = null; PageInfo<AirlineVerifyEntity> pageInfo = null;
// 必须紧贴dao的查询方法 // 必须紧贴dao的查询方法
...@@ -184,9 +186,9 @@ public List<com.ejweb.modules.route.entity.AirlineVerifyEntity> getRiskAssessmen ...@@ -184,9 +186,9 @@ public List<com.ejweb.modules.route.entity.AirlineVerifyEntity> getRiskAssessmen
List<com.ejweb.modules.route.entity.AirlineVerifyEntity> list=dao.getRiskAssessmentListForExcel(bean); List<com.ejweb.modules.route.entity.AirlineVerifyEntity> list=dao.getRiskAssessmentListForExcel(bean);
return list; return list;
} }
public List<ConnectionPlan> planlist(String fileName,String filePath){ public List<ConnectionPlan> planlist(String fileName,String filePath){
//读取文件 //读取文件
......
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