1、新增dc下载任务附件web ip 获取方式 开关
2、监测数据解析增加 空串判断 3、修复 nc 重启获取 已下发成功的 任务
This commit is contained in:
@@ -468,7 +468,10 @@ public class Constants {
|
||||
|
||||
public static final Long HANDSHANK_DELAY_TIME;
|
||||
|
||||
|
||||
/**
|
||||
* 任务 文件 下载 ip 获取方式,true:配置文件中的 web.socket.ip;false:system_table表中的 server_ip
|
||||
*/
|
||||
public static final boolean FILE_DOWNLOAD_FROM_COMMUNICATE_WEB;
|
||||
|
||||
static {
|
||||
|
||||
@@ -827,6 +830,11 @@ public class Constants {
|
||||
CURRVAL_FUNCTION_NAME = Config.getString("currval_function_name", "currval");
|
||||
HANDSHANK_DELAY_TIME = Long.parseLong(Config.getString("handshank.delay.time", 15000+""));
|
||||
|
||||
/*
|
||||
* 任务 文件 下载 ip 获取方式,true:配置文件中的 web.socket.ip;false:system_table表中的 server_ip
|
||||
*/
|
||||
FILE_DOWNLOAD_FROM_COMMUNICATE_WEB = Config.getBoolan("file.download.from.communicate.web", true);
|
||||
|
||||
}
|
||||
|
||||
//文件传输 临时文件命名后缀
|
||||
|
||||
@@ -237,7 +237,12 @@ public class UpgradeService extends CommonService{
|
||||
searchSql.append("and t.is_loop =0 "); //非周期任务
|
||||
// searchSql.append("and mpt4.node_group_id in( "+groupsIdsSQL+") ");
|
||||
searchSql.append("and mpt4.mission_id in( "+missionSql4+") ");
|
||||
searchSql.append("and mrt4.result >= 40 ");
|
||||
/*
|
||||
* 2018年10月12日18:10:49
|
||||
* nc 重启获取 未下发的任务
|
||||
*/
|
||||
// searchSql.append("and mrt4.result >=40 ");
|
||||
searchSql.append("and mrt4.result = 3 ");//3:任务下发中
|
||||
searchSql.append("and mrt4.seq_id ="+uuid+" ");
|
||||
searchSql.append("order by t.create_time asc ");
|
||||
mapsList = dao.dbSelect(searchSql.toString(), fields);
|
||||
@@ -303,7 +308,12 @@ public class UpgradeService extends CommonService{
|
||||
// searchSql.append("and mpt4.node_group_id in( "+groupsIdsSQL+") ");
|
||||
searchSql.append("and mpt4.mission_id in( "+missionSql4+") ");
|
||||
// searchSql.append("and nt.seq_id = "+uuid.longValue()+" ");
|
||||
searchSql.append("and mrt4.result >= 40 ");
|
||||
/*
|
||||
* 2018年10月12日18:10:49
|
||||
* nc 重启获取 未下发的任务
|
||||
*/
|
||||
// searchSql.append("and mrt4.result >=40 ");
|
||||
searchSql.append("and mrt4.result = 3 ");//3:任务下发中
|
||||
searchSql.append("and mrt4.seq_id ="+uuid+" ");
|
||||
searchSql.append("order by t.create_time asc ");
|
||||
mapsList = dao.dbSelect(searchSql.toString(), fields);
|
||||
@@ -370,7 +380,12 @@ public class UpgradeService extends CommonService{
|
||||
// searchSql.append("and mpt6.node_group_id in( "+groupsIdsSQL+") ");
|
||||
searchSql.append("and mpt6.mission_id in( "+missionSql6+") ");
|
||||
// searchSql.append("and nt.seq_id = "+uuid.longValue()+" ");
|
||||
searchSql.append("and mrt6.result >= 40 ");
|
||||
/*
|
||||
* 2018年10月12日18:10:49
|
||||
* nc 重启获取 未下发的任务
|
||||
*/
|
||||
// searchSql.append("and mrt6.result >=40 ");
|
||||
searchSql.append("and mrt6.result = 3 ");//3:任务下发中
|
||||
searchSql.append("and mrt6.seq_id ="+uuid+" ");
|
||||
searchSql.append("order by t.create_time asc ");
|
||||
mapsList = dao.dbSelect(searchSql.toString(), fields);
|
||||
|
||||
@@ -38,7 +38,7 @@ import com.nms.server.util.StringUtil;
|
||||
*/
|
||||
public class DataResolveThread implements Runnable{
|
||||
private static Logger logger = Logger.getLogger(DataResolveThread.class);
|
||||
private final SimpleDateFormat format = Common.getFormat(); //Java Date 类型数据格式化格式
|
||||
private SimpleDateFormat format = new SimpleDateFormat(Constants.COMMON_DATE_FORMAT); //Java Date 类型数据格式化格式
|
||||
private static Db db = Common.getDb();
|
||||
|
||||
|
||||
@@ -955,28 +955,32 @@ public class DataResolveThread implements Runnable{
|
||||
}
|
||||
try {
|
||||
String fileType = field.getFiledType().toUpperCase();
|
||||
String col = detailsArr0[index];
|
||||
if("DATE".equals(fileType)){
|
||||
if(StringUtils.isNumeric(detailsArr0[index])){//如果为数字型时间,转换
|
||||
detail.put(field.getFiledName(), format.format(new Date(Long.parseLong(detailsArr0[index].trim()))));
|
||||
if(StringUtils.isBlank(col)){
|
||||
detail.put(field.getFiledName(), null);
|
||||
}else if(StringUtils.isNumeric(col)){//如果为数字型时间,转换
|
||||
detail.put(field.getFiledName(), format.format(new Date(Long.parseLong(col.trim()))));
|
||||
}else{//eg:2016-03-06 12:12:12
|
||||
detail.put(field.getFiledName(), detailsArr0[index].trim());
|
||||
detail.put(field.getFiledName(), col.trim());
|
||||
}
|
||||
}else{
|
||||
if("NUMBER".equals(fileType)){
|
||||
if (StringUtils.isBlank(detailsArr0[index])
|
||||
|| StringUtil.isRationalNumber(detailsArr0[index])) {
|
||||
detail.put(field.getFiledName(), detailsArr0[index].trim());
|
||||
} else if (detailsArr0[index].trim().contains(" days, ")) {
|
||||
detail.put(field.getFiledName(), CommonService.getLongTimeStr(detailsArr0[index].trim()));
|
||||
if(StringUtils.isBlank(col)){
|
||||
detail.put(field.getFiledName(), null);
|
||||
} else if (StringUtil.isRationalNumber(col)) {
|
||||
detail.put(field.getFiledName(), col.trim());
|
||||
} else if (col.trim().contains(" days, ")) {
|
||||
detail.put(field.getFiledName(), CommonService.getLongTimeStr(col.trim()));
|
||||
} else {
|
||||
throw new Exception("NUMBER数据格式错误!");
|
||||
}
|
||||
}else{ // VARCHAR2(x)
|
||||
String length = fileType.replaceAll("VARCHAR2\\((\\d+)\\)", "$1");
|
||||
if(Integer.parseInt(length) < detailsArr0[index].trim().length()) {
|
||||
if(Integer.parseInt(length) < col.trim().length()) {
|
||||
throw new Exception("VARCHAR2数据格式错误!");
|
||||
}
|
||||
detail.put(field.getFiledName(), detailsArr0[index].trim());
|
||||
detail.put(field.getFiledName(), col.trim());
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
@@ -988,7 +992,7 @@ public class DataResolveThread implements Runnable{
|
||||
}
|
||||
errorInfo.deleteCharAt(errorInfo.length()-1);
|
||||
//监测数据的详细信息如果和指定的字段类型不匹配,则抛弃此条监测数据,避免影响批量入库
|
||||
logger.error(" 第一步-1: 新格式监测数据解析异常: seqId:"+seqId+",setInfoId:"+setInfoId+",checkType:"+checkType+" checkTime:"+new Date(checkTime)+" 监测数据解析异常:"+errorInfo);
|
||||
logger.error(" 第一步-1: 新格式监测数据解析异常: seqId:"+seqId+",setInfoId:"+setInfoId+",checkType:"+checkType+" checkTime:"+new Date(checkTime)+" 监测数据解析异常:"+errorInfo,e);
|
||||
return null;
|
||||
}
|
||||
index++;
|
||||
|
||||
@@ -142,7 +142,11 @@ public class LoadNewMissionThread implements Runnable{
|
||||
continue;
|
||||
}
|
||||
|
||||
String hostIp = service.getHostIpBySystemId(mission.getSystemId());
|
||||
/*
|
||||
* 任务 文件 下载 ip 获取方式,true:配置文件中的 web.socket.ip;false:system_table表中的 server_ip
|
||||
* 默认 :true
|
||||
*/
|
||||
String hostIp = Constants.FILE_DOWNLOAD_FROM_COMMUNICATE_WEB ? Constants.WEB_SOCKET_IP : service.getHostIpBySystemId(mission.getSystemId());
|
||||
Integer port = Constants.WEB_SOCKET_PORT;
|
||||
if(missionFileList != null && missionFileList.size()>0){
|
||||
// ServerTable serverTable = Common.getServerTable();
|
||||
|
||||
Reference in New Issue
Block a user