Commit 3250c9ae by java-李谡

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

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