大写的YYYY大写p是什么意思思

项目语言:JAVA
权限:read-only(如需更高权限请先加入项目)
Index: FtpTransmitUtil.java
===================================================================
--- FtpTransmitUtil.java (revision 0)
+++ FtpTransmitUtil.java (revision 2)
@@ -0,0 +1,513 @@
+package com.viewscenes.util.
+import java.io.BufferedInputS
+import java.io.BufferedOutputS
+import java.io.F
+import java.io.FileInputS
+import java.io.FileOutputS
+import java.io.IOE
+import mons.net.ftp.FTP;
+import mons.net.ftp.FTPC
+import mons.net.ftp.FTPR
+import mons.net.ftp.FTPF
+import java.util.StringT
+import java.io.OutputS
+import javax.servlet.http.HttpServletR
+import javax.servlet.http.HttpServletR
+import java.util.ArrayL
+import java.io.InputS
+import java.io.*;
+import org.apache.tools.zip.ZipOutputS
+import org.apache.tools.zip.ZipE
+ * 该类提供了用ftp协议上传和下载文件的服务
+ * @author MingGAO
+ * @version 0.5.0
+public class FtpTransmitUtil {
private String serverUrl =
private String user =
private String password =
private FTPClient ftp =
public FtpTransmitUtil(String server_url, String user, String password) {
this.serverUrl = server_
this.user =
this.password =
this.ftp = new FTPClient();
* 打开连接
* @throws Exception
public void openConnection() throws Exception {
int reply = -1;
ftp.connect(this.serverUrl);
reply = ftp.getReplyCode();
if (!FTPReply.isPositiveCompletion(reply)) {
ftp.disconnect();
ftp.login(this.user, this.password);
} catch (Exception e) {
if (ftp.isConnected()) {
ftp.disconnect();
} catch (IOException ioe) {
* 关闭连接
* @throws Exception
public void closeConnection() throws Exception {
ftp.logout();
} catch (Exception e) {
} finally {
if (ftp.isConnected()) {
ftp.disconnect();
} catch (IOException ioe) {
// do nothing
* 上传文件到远程服务器
* @param local_file_name
待上传的目录或文件
* @throws Exception
public void uploadFile(File file) throws
Exception {
FileInputStream fi = new FileInputStream(file);
BufferedInputStream bi = new BufferedInputStream(fi);
String fileName =
String local_file_name = file.getName();
int pos = local_file_name.lastIndexOf(&\\&);
if (pos == -1) {
fileName = local_file_
fileName = local_file_name.substring(pos + 1, local_file_name
.length());
String fileType = fileName.substring(fileName.lastIndexOf(&.&) + 1, fileName.length());
String filePath = &report&;
if(fileType.equalsIgnoreCase(&jpg&) || fileType.equalsIgnoreCase(&jpeg&)
|| fileType.equalsIgnoreCase(&gif&)) {
filePath = &picture&;
} else if(fileType.equalsIgnoreCase(&htm&) || fileType.equalsIgnoreCase(&html&)
|| fileType.equalsIgnoreCase(&swf&)) {
filePath = &report&;
filePath = &rpt&;
if(fileType.equalsIgnoreCase(&jpg&) || fileType.equalsIgnoreCase(&jpeg&)
|| fileType.equalsIgnoreCase(&gif&) || fileType.equalsIgnoreCase(&swf&)) {
ftp.setFileType(FTP.IMAGE_FILE_TYPE);
} else if(fileType.equalsIgnoreCase(&htm&) || fileType.equalsIgnoreCase(&html&)
|| fileType.equalsIgnoreCase(&jsp&)) {
ftp.setFileType(FTP.ASCII_FILE_TYPE);
} else if(fileType.equalsIgnoreCase(&txt&)){
ftp.setFileType(FTP.BINARY_FILE_TYPE);
throw new Exception(&文件类型错误!&);
ftp.changeWorkingDirectory(filePath);
ftp.storeFile(fileName, bi);
bi.close();
} catch (Exception e) {
if (ftp.isConnected()) {
ftp.disconnect();
catch (IOException ioe) {
// do nothing
public static void main(String[] args) throws Exception {
FtpTransmitUtil util = new FtpTransmitUtil(&10.10.2.80&, &Anonymous&, null);
+ FtpTransmitUtil util = new FtpTransmitUtil(&10.10.2.80&, &user&, &user&);
+// util.openConnection();
+// util.downloadFileFromFtp(&D:\\video_location\\&, &Btest__13_97400_R1.mp3&);
+// util.closeConnection();
util.openConnection();
util.uploadFile(new File(&D:\\test1.txt&));
+// util.downloadFtpFile(&c:\\&,&ftp://10.10.5.35///OAS06/五七三台提供_OAS06_大阪_15130kHz_京_564_4702_日常.067&);
+ util.closeConnection();
} catch (Exception e) {
e.printStackTrace();
util.closeConnection();
} catch (Exception ex) {
* 从远程服务器上下载文件,亦可考虑下载所有文件。
* @param local_dir
* @param remote_file_name
远程文件名后缀
* @throws Exception
public void downloadFileFromFtp(String local_dir, String fileName) throws Exception {
FileOutputStream fo = new FileOutputStream(local_dir
+ fileName);
BufferedOutputStream bo = new BufferedOutputStream(fo);
Thread.currentThread().sleep(10000); // 延时1秒
ftp.retrieveFile(fileName, bo); //从FTP上下载符合条件的文件
//ftp.deleteFile(fileName); //从FTP上删除已下载文件
}catch(Exception e)
bo.flush();
bo.close();
} catch (Exception e) {
if (ftp.isConnected()) {
ftp.disconnect();
catch (IOException ioe) {
// do nothing
* 从远程服务器上下载文件,亦可考虑下载所有文件。
* @param local_dir
* @param remote_file_name
远程文件名后缀
* @throws Exception
public void downloadFile(String local_dir, String remote_fileSuffix) throws Exception {
String fileName =
FTPFile[] files = ftp.listFiles();
for (int i = 0; i & files. i++) {
fileName = files[i].getName();
if (fileName.endsWith(remote_fileSuffix)) {
FileOutputStream fo = new FileOutputStream(local_dir + &\\&
+ fileName);
BufferedOutputStream bo = new BufferedOutputStream(fo);
ftp.retrieveFile(fileName, bo); //从FTP上下载符合条件的文件
//ftp.deleteFile(fileName); //从FTP上删除已下载文件
bo.flush();
bo.close();
} catch (Exception e) {
if (ftp.isConnected()) {
ftp.disconnect();
catch (IOException ioe) {
// do nothing
* 从远程服务器上下载文件。
* @param local_dir
* @param remote_file_name
远程文件名
* @throws Exception
public boolean downloadFtpFile(HttpServletRequest request, HttpServletResponse response, String remote_fileSuffix) throws Exception {
String fileName =
ArrayList fileList=new ArrayList();
if(remote_fileSuffix.equals(&all&))
String tmpFile=&c:\\ftpDowndAll&;
String tmpZip=&c:\\all.zip&;
File f=new File(tmpFile);
File zf=new File(tmpZip);
fileList = (ArrayList) request.getSession().getAttribute(&allFile&);
OutputStream fo =response.getOutputStream();
for(int k=0;k&fileList.size();k++)
String strArray[]=fileList.get(k).toString().split(&/&);
for (int i = 4; i & strArray.length - 1; i++) {
ftp.cwd(strArray[i]);
fileName= strArray[strArray.length-1];
String str=&&;
ftp.setControlEncoding(&GBK&);
str = fileN
fileName = fileName+&.mp3&;
response.setContentType(&application/x-msdownload&);
response.setHeader(&Content-Disposition&,&filename=all.zip&);
str=new String(str.getBytes(&GBK&),&ISO-8859-1&);
if(!f.exists())
f.mkdir();
FileOutputStream lo = new FileOutputStream(f+&\\&
+ fileName);
BufferedOutputStream bo = new BufferedOutputStream(lo);
ftp.retrieveFile(str, bo);
bo.flush();
bo.close();
lo.flush();
lo.close();
//从FTP上下载符合条件的文件
//ftp.deleteFile(fileName); //从FTP上删除已下载文件
System.out.println(&下载完毕-------&);
this.zip(tmpFile,tmpZip);
if (f.isDirectory()) {
File[] files = f.listFiles();
for (int i = 0; i & files. i++) {
files[i].delete();
System.out.println(&不是文件夹 !&);
InputStream is = new FileInputStream(zf);
BufferedInputStream bis = new BufferedInputStream(is);
byte [] buf = new byte [1024];
int length = 0;
while ((length = bis.read(buf)) & 0) {
fo.write(buf, 0, length);
File fff=new File(&c:\\all.zip&);
fff.deleteOnExit();
catch (Exception e) {
System.out.println(&这里出错了!&);
e.printStackTrace();
fo.flush();
fo.close();
bis.close();
is.close();
String strArray[]=remote_fileSuffix.split(&/&);
for(int i=4;i&strArray.length-1;i++)
ftp.cwd(strArray[i]);
fileName= strArray[strArray.length-1];
String str=&&;
ftp.setControlEncoding(&GBK&);
str = fileN
fileName = fileName+&.mp3&;
response.setContentType(&application/x-msdownload&);
response.setHeader(&Content-Disposition&,&filename=&+new String(fileName.getBytes(&GBK&),&ISO-8859-1&));
File file=new File(&c:\\&);
OutputStream fo =response.getOutputStream();
str=new String(str.getBytes(&GBK&),&ISO-8859-1&);
ftp.retrieveFile(str, fo);
//从FTP上下载符合条件的文件
//ftp.deleteFile(fileName); //从FTP上删除已下载文件
fo.flush();
fo.close();
} catch (Exception e) {
if (ftp.isConnected()) {
ftp.disconnect();
catch (IOException ioe) {
// do nothing
* 功能:把 sourceDir 目录下的所有文件进行 zip 格式的压缩,保存为指定 zip 文件 create date:
* author:Administrator
* @param sourceDir
* @param zipFile
格式: E:\\stu \\zipFile.zip 注意:加入 zipFile 我们传入的字符串值是
: &E:\\stu \\& 或者 &E:\\stu &
如果 E 盘已经存在 stu 这个文件夹的话,那么就会出现 java.io.FileNotFoundException: E:\stu
( 拒绝访问。 ) 这个异常,所以要注意正确传参调用本函数哦
public static void zip(String sourceDir, String zipFile) {
OutputStream os = new FileOutputStream(zipFile);
BufferedOutputStream bos = new BufferedOutputStream(os);
ZipOutputStream zos = new ZipOutputStream(bos);
File file = new File(sourceDir);
String basePath =
if (file.isDirectory()) {
basePath = file.getPath();
basePath = file.getParent();
zipFile (file, basePath, zos);
zos.closeEntry();
zos.close();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
* create date: author:Administrator
* @param source
* @param basePath
* @param zos
* @throws IOException
private static void zipFile(File source, String basePath,
ZipOutputStream zos) {
File[] files = new File[0];
if (source.isDirectory()) {
files = source.listFiles();
files = new File[1];
files[0] =
String pathN
byte [] buf = new byte [1024];
int length = 0;
for (int i=0;i&files.i++) {
File file=files[i];
if (file.isDirectory()) {
pathName = file.getPath().substring(basePath.length() + 1)
zos.putNextEntry( new ZipEntry(pathName));
zipFile (file, basePath, zos);
pathName = file.getPath().substring(basePath.length() + 1);
InputStream is = new FileInputStream(file);
BufferedInputStream bis = new BufferedInputStream(is);
zos.putNextEntry( new ZipEntry(pathName));
while ((length = bis.read(buf)) & 0) {
zos.write(buf, 0, length);
is.close();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
Index: ReceiverListGetUtil.java
===================================================================
--- ReceiverListGetUtil.java (revision 0)
+++ ReceiverListGetUtil.java (revision 2)
@@ -0,0 +1,420 @@
+package com.viewscenes.util.
+import java.util.*;
+import java.sql.*;
+import com.viewscenes.dao.database.DbC
+import com.viewscenes.pub.GDS
+ * &p&Title:接收机列表提取。 &/p&
+ * &p&Description: 根据站点类型(采集点还是遥控站),
+ * 站点代码(如果有的话,提取相应版本号),音频还是视频&/p&
+ * &p&Copyright: Copyright (c) 2009&/p&
+ * &p&Company: &/p&
+ * @author not attributable
+ * @version 1.0
+public class ReceiverListGetUtil {
private static int VIDEO_AUDIO_SEP = 200;
private static Hashtable RECEIVER_CODES =
private static Hashtable RECEIVER_NAMES =
public ReceiverListGetUtil() {
public static String getCodesByCodeIds(String codeIds) {
String[] codeIdArray = codeIds.split(&,&);
String codes = &&;
for (int i = 0; i & codeIdArray. i++) {
codes += getCodeByCodeId(codeIdArray[i]) + &,&;
return codes.substring(0, codes.length() - 1);
* @param codeId String
* @return String
public static String getCodeByCodeId(String codeId) {
if (RECEIVER_CODES == null || RECEIVER_CODES.size() == 0) {
loadResource();
if (RECEIVER_CODES != null) {
return (String) RECEIVER_CODES.get(codeId);
public static String getCodeNamesByNameIds(String nameIds) {
String[] nameIdArray = nameIds.split(&,&);
String names = &&;
for (int i = 0; i & nameIdArray. i++) {
names += getCodeNameByNameId(nameIdArray[i]) + &,&;
return names.substring(0, names.length() - 1);
* @param nameId String
* @return String
public static String getCodeNameByNameId(String nameId) {
if (RECEIVER_NAMES == null || RECEIVER_NAMES.size() == 0) {
loadResource();
if (RECEIVER_NAMES != null) {
return (String) RECEIVER_NAMES.get(nameId);
* 强制提取接收机名称资源
public synchronized static void loadResource() {
RECEIVER_CODES = new Hashtable();
RECEIVER_NAMES = new Hashtable();
GDSet codeSt =
GDSet nameSt =
String codeSql =
&select code_id,CODE from dic_headend_receiver_code_tab &;
String nameSql =
&select name_id,name from dic_headend_receiver_name_tab &;
codeSt = DbComponent.Query(codeSql);
nameSt = DbComponent.Query(nameSql);
for(int i=0;i&codeSt.getRowCount();i++) {
RECEIVER_CODES.put(codeSt.getString(i,&code_id&), codeSt.getString(i,&CODE&));
for(int i=0;i&nameSt.getRowCount();i++) {
RECEIVER_NAMES.put(nameSt.getString(i,&name_id&), nameSt.getString(i,&name&));
catch (Exception ex) {
ex.printStackTrace();
* 提取站点配置文件。
* @param field String
* @param headManu String
* @param headType String
* @param headVersion String
* @throws Exception
* @return String
public static String getConfigByHeadend(String field, String headManu,
String headType, String headVersion) throws
Exception {
String errorMessage = &站点信息:厂商=& + headManu + &,版本=& + headVersion +
&,站点类型=& + headT
//提取配置文件接收机列表。
String configSql =
& select & + field + & from DIC_HEADEND_MANUFACTURER_TAB & +
& where MANUFACTURER_NAME = '& + headManu +
&' and VERSION = '& + headVersion + &' and HEADEND_TYPE ='& + headType+&' &;
GDSet rs = DbComponent.Query(configSql);
int num = rs.getRowCount();
if (num &= 0) {
throw new Exception(&提取不到相关配置!&);
if (num & 1) {
System.out.println(&出现重复配置!&);
return rs.getString(0, 0);
catch (Exception ex) {
throw new Exception(errorMessage + &提取站点特性(接收机、电压下限等)配置时出现异常:& +
ex.getMessage());
* 提取接收机列表的基列。
* @param headManu String
* @param headType String
* @param headVersion String
* @param isRadio boolean
* @throws Exception
public static Vector getReceiverBaseList(String headManu, String headType,
String headVersion, boolean isRadio) throws
Exception {
String codeIds = getConfigByHeadend(&RECEIVER_CODE_LIST&, headManu,
headType, headVersion);
String nameIds = getConfigByHeadend(&RECEIVER_NAME_LIST&, headManu,
headType, headVersion);
Vector recVec = new Vector();
String[] codeArray = codeIds.split(&,&);
String[] nameArray = nameIds.split(&,&);
for (int i = 0; i & codeArray. i++) {
//如果取接收机,不能大于要求值,不满足条件返回.
if (isRadio && new Integer(codeArray[i]).intValue() &= VIDEO_AUDIO_SEP) {
//如果取摄像头,不能小于要求值,不满足条件返回。
else if (!isRadio &&
new Integer(codeArray[i]).intValue() & VIDEO_AUDIO_SEP) {
String code = getCodeByCodeId(codeArray[i]);
recVec.add(code);
recVec.add(code + &:& + getCodeNameByNameId(nameArray[i]));
return recV
* 提取接收机列表,加自动选择。
* @param headManu String
* @param headType String
* @param headVersion String
* @param isRadio boolean
* @throws Exception
* @return Vector
public static Vector getReceiverList(String headManu, String headType,
String headVersion, boolean isRadio) throws
Exception {
Vector receiverVector = new Vector();
receiverVector.add(&&);
receiverVector.add(&自动选择&);
Vector baseVec = getReceiverBaseList(headManu, headType, headVersion,
if (baseVec != null && baseVec.size() & 0) {
receiverVector.addAll(baseVec);
throw new Exception(&站点未配置相应接收机!&);
return receiverV
public static Vector getReceiverList(String headCode, boolean isRadio) throws
Exception {
Vector receiverVector = new Vector();
receiverVector.add(&&);
receiverVector.add(&自动选择&);
String headManu = SiteVersionUtil.getSiteManu(headCode);
String headType = SiteVersionUtil.getSiteType(headCode);
String headVer = SiteVersionUtil.getSiteVerStr(headCode);
Vector baseVec = getReceiverBaseList(headManu, headType, headVer,
if (baseVec != null && baseVec.size() & 0) {
receiverVector.addAll(baseVec);
throw new Exception(&站点未配置相应接收机!&);
return receiverV
* 提取接收机列表,加所有。
* @param headManu String
* @param headType String
* @param headVersion String
* @param isRadio boolean
* @throws Exception
* @return Vector
public static Vector getReceiverAllList(String headManu, String headType,
String headVersion, boolean isRadio) throws
Exception {
//获取接收机列表
Vector receiverVector = new Vector();
receiverVector.add(&all&);
receiverVector.add(&所有&);
Vector baseVec = getReceiverBaseList(headManu, headType, headVersion,
if (baseVec != null && baseVec.size() & 0) {
receiverVector.addAll(baseVec);
throw new Exception(&站点未配置相应接收机!&);
return receiverV
public static String[][] getReceiverParamsArray(String receiverCode) {
//接收机代码与类型映射。
if (receiverCode == null) {
receiverCode = &R1&;
String receiType = &2&;
if (receiverCode.equalsIgnoreCase(&R1&)) {
receiType = &1&;
else if (receiverCode.equalsIgnoreCase(&R1&)) {
receiType = &3&;
String[][] words = {
String sql=&select type ,word from dic_receiver_control_word_tab
where type='&+receiType+&' order by word asc&;
GDSet dataTypes = DbComponent.Query(sql);
int rowTypes = dataTypes.getRowCount();
if (rowTypes & 0) {
words = new String[2][rowTypes];
for (int rti = 0; rti & rowT rti++) {
String word = dataTypes.getString(rti, &word&);
words[0][rti] =
words[1][rti] =
catch (Exception ex) {
ex.printStackTrace();
public static String[][] getReceiveSortArray(String headCode,
boolean isRadio) throws
Exception {
String headManu = SiteVersionUtil.getSiteManu(headCode);
String headType = SiteVersionUtil.getSiteType(headCode);
String headVer = SiteVersionUtil.getSiteVerStr(headCode);
return getReceiveSortArray(headManu, headType, headVer, isRadio);
* 根据站点id提取
接收机代码与type名称的排序数组。
* @param headendid
* @return Object[] 0为站点类型,1为接收机Code与名称映射表。
public static String[][] getReceiveSortArray(String headManu,
String headType,
String headVersion,
boolean isRadio) throws
Exception {
String[][] recArray =
Vector receiVec = getReceiverBaseList(headManu, headType, headVersion,
if (receiVec != null && receiVec.size() & 0) {
recArray = new String[9][2];
for (int i = 0; i & receiVec.size(); i += 2) {
String key = (String) receiVec.get(i);
String keyValue = (String) receiVec.get(i + 1);
if (keyValue != null && keyValue.length() & 0) {
if (key.equalsIgnoreCase(&R1&)) {
recArray[0][0] =
recArray[0][1] = keyV
else if (key.equalsIgnoreCase(&R2&)) {
recArray[1][0] =
recArray[1][1] = keyV
else if (key.equalsIgnoreCase(&R3&)) {
recArray[2][0] =
recArray[2][1] = keyV
else if (key.equalsIgnoreCase(&R4&)) {
recArray[3][0] =
recArray[3][1] = keyV
else if (key.equalsIgnoreCase(&R5&)) {
recArray[4][0] =
recArray[4][1] = keyV
else if (key.equalsIgnoreCase(&R6&)) {
recArray[5][0] =
recArray[5][1] = keyV
else if (key.equalsIgnoreCase(&R7&)) {
recArray[6][0] =
recArray[6][1] = keyV
else if (key.equalsIgnoreCase(&R8&)) {
recArray[7][0] =
recArray[7][1] = keyV
else if (key.equalsIgnoreCase(&R9&)) {
recArray[8][0] =
recArray[8][1] = keyV
throw new Exception(&没有配置相应接收机&);
return recA
* 根据站点id提取
接收机代码与type名称的映射表。
* @param headendid
* @return Object[] 0为站点类型,1为接收机Code与名称映射表。
public static HashMap getReceiveCTMap(String headCode, boolean isRadio) throws
Exception {
String headManu = SiteVersionUtil.getSiteManu(headCode);
String headType = SiteVersionUtil.getSiteType(headCode);
String headVer = SiteVersionUtil.getSiteVerStr(headCode);
return getReceiveCTMap(headManu, headType, headVer, isRadio);
* 根据站点id提取
接收机代码与type名称的映射表。
* @param headendid
* @return Object[] 0为站点类型,1为接收机Code与名称映射表。
public static HashMap getReceiveCTMap(String headManu, String headType,
String headVersion,
boolean isRadio) throws
Exception {
String codeIds = getConfigByHeadend(&RECEIVER_CODE_LIST&, headManu,
headType, headVersion);
String nameIds = getConfigByHeadend(&RECEIVER_NAME_LIST&, headManu,
headType, headVersion);
HashMap recMap = new HashMap();
String[] codeArray = codeIds.split(&,&);
String[] nameArray = nameIds.split(&,&);
for (int i = 0; i & codeArray. i++) {
//如果取接收机,不能大于要求值,不满足条件返回.
if (isRadio && new Integer(codeArray[i]).intValue() &= VIDEO_AUDIO_SEP) {
//如果取摄像头,不能小于要求值,不满足条件返回。
else if (!isRadio &&
new Integer(codeArray[i]).intValue() & VIDEO_AUDIO_SEP) {
String code = getCodeByCodeId(codeArray[i]);
recMap.put(code, code + &:& + getCodeNameByNameId(nameArray[i]));
return recM
Index: SystemIdUtil.java
===================================================================
--- SystemIdUtil.java (revision 0)
+++ SystemIdUtil.java (revision 2)
@@ -0,0 +1,101 @@
+package com.viewscenes.util.
+import java.sql.*;
+import com.viewscenes.dao.database.DbC
+import com.viewscenes.pub.GDS
+ * 当前系统id判断类。
+ * &p&Title: &/p&
+ * &p&Description: &/p&
+ * &p&Copyright: Copyright (c) 2005&/p&
+ * &p&Company: &/p&
+ * @author not attributable
+ * @version 1.0
+public class SystemIdUtil {
+ public static String CENTER_ID =
+ //用来生成任务id时使用。
+ public static String CENTER_ID_FORTASK =
public static String CENTER_NAME=
public static String CENTER_CODE=
public SystemIdUtil() {
* 判断本前系统是否配置成数据中心系统。
* @return boolean
public static boolean isCenter() {
boolean isCenter =
String locCenterId = getLocalCenterId();
if (!&100&.equalsIgnoreCase(locCenterId)) {
isCenter =
return isC
* center_id是100,运行在数据中心。
* 其它表明是直属台系统。
* @return String
public synchronized static String getLocalCenterId() {
if (CENTER_ID == null) {
String task =
&select param_value from
sys_configuration_tab where param_name='local_center_id' &;
GDSet result =
result = DbComponent.Query(task);
if (result.getRowCount()&0) {
CENTER_ID = result.getString(0,&param_value&);
catch (Exception ex2) {
System.out.println(&查询系统所属台id信息出错!&);
ex2.printStackTrace();
return CENTER_ID;
* 取得当前数据库连接的直属台名字
public synchronized static String getLocalCenterName() {
if (CENTER_NAME == null) {
String task =
&select name,center_id,code from res_center_tab t where t.center_id= (select param_value from
sys_configuration_tab where param_name='local_center_id') &;
GDSet result =
result = DbComponent.Query(task);
if (result.getRowCount()&0) {
CENTER_ID = result.getString(0,&center_id&);
if (&100&.equalsIgnoreCase(CENTER_ID)) {
CENTER_ID_FORTASK=&1000&;
CENTER_ID_FORTASK=CENTER_ID;
CENTER_NAME = result.getString(0,&name&);
CENTER_CODE = result.getString(0,&code&);
catch (Exception ex2) {
System.out.println(&查询系统所属台id信息出错!&);
ex2.printStackTrace();
return CENTER_NAME;
public static void main(String[] args) {
SystemIdUtil systemIdUtil1 = new SystemIdUtil();
Index: runplan/TimeSpan.java
===================================================================
--- runplan/TimeSpan.java (revision 0)
+++ runplan/TimeSpan.java (revision 2)
@@ -0,0 +1,554 @@
+package com.viewscenes.util.business.
+ * *************************************
+* 项目名称:hwdata
+* 类名称:TimeSpan
+* 类描述:
+* 创建人:刘斌
+* 创建时间: 下午03:45:16
+* 修改人:刘斌
+* 修改时间: 下午03:45:16
+* 修改备注:
+* @version
+***************************************
+public class TimeSpan {
private long startT //起始时刻 (秒)
private long endT //结束时刻 (秒)
+ // 运行图类型 1:播出,2:检修,3:停播
private ProgramInfo programI
* 构造函数
public TimeSpan() {
startTime = 0;
endTime = 0;
programInfo =
* 构造函数
* @param startTime (秒)
* @param endTime (秒)
* @param type 1:播出,2:检修
public TimeSpan(long startTime, long endTime, long type) {
setStartTime(startTime);
setEndTime(endTime);
setType(type);
programInfo =
public TimeSpan(long startTime, long endTime, long type,
ProgramInfo programInfo) {
setStartTime(startTime);
setEndTime(endTime);
setType(type);
setProgramInfo(programInfo);
* 构造函数
* @param startTime
HH24:MI:SS
* @param endTime HH24:MI:SS
* @param type 1:播出,2:检修
public TimeSpan(String startTime, String endTime, String type) {
setStartTime(startTime);
setEndTime(endTime);
setType(type);
public TimeSpan(String startTime, String endTime, String type,
ProgramInfo programInfo) {
setStartTime(startTime);
setEndTime(endTime);
setType(type);
setProgramInfo(programInfo);
* 返回开始时刻
* @return (秒)
public long getStartTime() {
return startT
* 设置开始时刻
* @param startTime (秒)
public void setStartTime(long startTime) {
if (startTime &= 24 * 3600 - 1 || startTime & 0) {
startTime = 0;
this.startTime = startT
* 设置开始时刻
* @param startStr HH24:MI:SS
public void setStartTime(String startStr) {
this.startTime = parse(startStr);
if (startTime &= 24 * 3600 - 1 || startTime & 0) {
startTime = 0;
* 获取结束时刻
* @return (秒)
public long getEndTime() {
return endT
* 设置结束时刻
* @param endTime (秒)
public void setEndTime(long endTime) {
if (endTime &= 24 * 3600 - 1 || endTime &= 0) {
endTime = 24 * 3600;
this.endTime = endT
* 设置结束时刻
* @param endStr HH24:MI:SS
public void setEndTime(String endStr) {
this.endTime = parse(endStr);
if (endTime &= 24 * 3600 - 1 || endTime &= 0) {
endTime = 24 * 3600;
* 返回总时长
* @return (秒)
public long getInterval() {
long returnValue = endTime - startT
if (returnValue & 0) {
returnValue += 24 * 3600;
return returnV
* 返回运行图类型
* @return 1:播出,2:检修
public long getType() {
* 设置运行图类型
* @param type 1:播出,2:检修
public void setType(long type) {
this.type =
* 设置运行图类型
* @param type 1:播出,2:检修
public void setType(String type) {
this.type = new Long(type).longValue();
catch (Exception e) {
e.printStackTrace();
this.type = 0;
public ProgramInfo getProgramInfo() {
return programI
public void setProgramInfo(ProgramInfo programInfo) {
this.programInfo = programI
* 检查时间格式
* @param str
HH24:MI:SS
* @return 成功返回规范的 HH24:MI:SS 格式,否则返回 NULL
public static String checkParse(String str) {
return checkParse(str, false, false);
* 检查时间格式
* @param str
HH24:MI:SS
* @param overDays true:允许跨天,false:24小时以内
* @return 成功返回规范的 HH24:MI:SS 格式,否则返回 NULL
public static String checkParse(String str, boolean overDays) {
return checkParse(str, overDays, false);
* 检查时间格式
* @param str
HH24:MI:SS
* @param overDays true:允许跨天,false:24小时以内
* @param enableNegative true:允许负数,false:负数取反
* @return 成功返回规范的 HH24:MI:SS 格式,否则返回 NULL
public static String checkParse(String str, boolean overDays,
boolean enableNegative) {
String returnValue =
long hour = 0;
long min = 0;
long sec = 0;
boolean nagativeValue =
String val[] = str.split(&:&);
if (val.length & 0 && val[0].length() & 0) {
+ if (val[0].charAt(0) == '-') {
nagativeValue =
hour = new Long(val[0].substring(1)).longValue();
hour = new Long(val[0]).longValue();
if (val.length & 1 && val[1].length() & 0) {
+ min = new Long(val[1]).longValue();
if (val.length & 2 && val[2].length() & 0) {
+ sec = new Long(val[2]).longValue();
if (sec & 59) {
+ min += sec / 60;
+ sec %= 60;
if (min & 59) {
+ hour += min / 60;
+ min %= 60;
if (sec & 0) {
+ sec = 0;
if (min & 0) {
+ min = 0;
long parseVal = hour * 3600 + min * 60 +
if (nagativeValue && enableNegative) {
+ parseVal *= -1;
returnValue = format(parseVal, overDays, enableNegative);
catch (Exception e) {
e.printStackTrace();
return returnV
* 解析时间串,正数,24小时内
* @param str HH24:MI:SS
* @return (秒)
public static long parse(String str) {
return parse(str, false, false);
* 解析时间串,正数
* @param str HH24:MI:SS
* @return (秒)
public static long parse(String str, boolean overDays) {
return parse(str, overDays, false);
* 解析时间串
* @param str HH24:MI:SS
* @param overDays true:允许跨天,false:24小时以内
* @param enableNegative true:允许负数,false:负数取反
* @return (秒)
public static long parse(String str, boolean overDays, boolean enableNegative) {
long returnValue = 0;
long hour = 0;
long min = 0;
long sec = 0;
boolean nagativeValue =
String val[] = str.split(&:&);
if (val.length & 0 && val[0].length() & 0) {
+ if (val[0].charAt(0) == '-') {
nagativeValue =
hour = new Long(val[0].substring(1)).longValue();
hour = new Long(val[0]).longValue();
if (val.length & 1 && val[1].length() & 0) {
+ min = new Long(val[1]).longValue();
if (val.length & 2 && val[2].length() & 0) {
+ sec = new Long(val[2]).longValue();
catch (Exception e) {
e.printStackTrace();
if (sec & 59) {
min += sec / 60;
sec %= 60;
if (min & 59) {
hour += min / 60;
min %= 60;
if (sec & 0) {
if (min & 0) {
if (!overDays && (hour & 24 || min != 0 || sec != 0)) {
hour %= 24;
returnValue = hour * 3600 + min * 60 +
if (nagativeValue && enableNegative) {
returnValue *= -1;
return returnV
* 格式化字符串,正数,24小时内
* @param val (秒)
* @return HH24:MI:SS
public static String format(long val) {
return format(val, false, false);
* 格式化字符串,正数
* @param val (秒)
* @return HH24:MI:SS
public static String format(long val, boolean overDays) {
return format(val, overDays, false);
* 格式化字符串
* @param val (秒)
* @param overDays true:允许跨天,false:24小时以内
* @param enableNegative true:允许负数,false:负数取反
* @return HH24:MI:SS
public static String format(long val, boolean overDays,
boolean enableNegative) {
String returnV
tmpVal = Math.abs(val / 3600);
if (!overDays) {
tmpVal %= 24;
String tmpStr = new Long(tmpVal).toString();
if (tmpStr.length() & 2) {
tmpStr = &0& + tmpS
returnValue = tmpStr + &:&;
tmpVal = Math.abs( (val % 3600) / 60);
tmpStr = new Long(tmpVal).toString();
if (tmpStr.length() & 2) {
tmpStr = &0& + tmpS
returnValue += tmpStr + &:&;
tmpVal = Math.abs(val % 60);
tmpStr = new Long(tmpVal).toString();
if (tmpStr.length() & 2) {
tmpStr = &0& + tmpS
returnValue += tmpS
if (val & 0 && enableNegative) {
returnValue = &-& + returnV
return returnV
public static boolean checkConflict(String startA, String endA, String startB,
String endB) {
return checkConflict(startA, endA, &all&, startB, endB, &all&);
* 检查两时间段是否有冲突
* @param sa
* @param ea
* @param sb
* @param eb
public static boolean checkConflict(String startA, String endA,
String weekDayA, String startB,
String endB, String weekDayB) {
boolean returnValue =
long sa = parse(startA);
long ea = parse(endA);
long sb = parse(startB);
long eb = parse(endB);
long wa = 0;
long wb = 0;
if (weekDayA.equalsIgnoreCase(&all&)) {
wa = new Long(weekDayA).longValue();
if (weekDayB.equalsIgnoreCase(&all&)) {
wb = new Long(weekDayB).longValue();
if (wa != 8 && wb != 8) {
//任何一各都不是每天,直接比较
if (wa == 6 && wb == 0) {
+ //处理周六与周日
if (wb == 6 && wa == 0) {
+ //处理周六与周日
//间隔超过一天,必然不冲突
if (Math.abs(wa - wb) & 1) {
//获取连续时间段
if (ea &= sa) {
+ ea += 24 * 3600;
if (eb &= sb) {
+ eb += 24 * 3600;
+ //天数大的加24小时
if (wa & wb) {
+ sb += 24 * 3600;
+ eb += 24 * 3600;
else if (wa & wb) {
+ sa += 24 * 3600;
+ ea += 24 * 3600;
int sPos, eP
sPos = isSecondBetween(sa, sb, eb, false);
ePos = isSecondBetween(ea, sb, eb, true);
if (sa & ea) {
if (sb & eb) {
+ //包容或交叉
+ if (sPos == 0 || ePos == 0 || (sPos & 0 && ePos & 0)) {
returnValue =
+ //被跨天包容
+ if (sPos == 0 || ePos == 0) {
returnValue =
if (sb & eb) {
+ //包容或交叉
+ if (sPos &= 0 || ePos &= 0) {
returnValue =
+ //均跨天,一定冲突
+ returnValue =
return returnV
* 检查一个时刻是否在时段范围内
* @param checkSecond
* @param startSecond
* @param endSecond
public static int isSecondBetween(long checkSecond, long startSecond,
long endSecond, boolean isCheckEnd) {
int returnValue = 0;
if (startSecond & endSecond) {
if (isCheckEnd) {
+ if (checkSecond &= startSecond) {
returnValue = -1;
+ if (checkSecond & endSecond) {
returnValue = 1;
+ if (checkSecond & startSecond) {
returnValue = -1;
+ if (checkSecond &= endSecond) {
returnValue = 1;
if (isCheckEnd) {
+ if (checkSecond & endSecond && checkSecond &= startSecond) {
returnValue = -1;
+ if (checkSecond &= endSecond && checkSecond & startSecond) {
returnValue = -1;
return returnV
* 转化为描述字符串
HH24:MI:SS - HH24:MI:SS [1/2]
public String toString() {
String returnValue = &&;
returnValue = format(startTime) + & - & + format(endTime) + & [& + type +
return returnV
Index: runplan/ProgramInfo.java
===================================================================
--- runplan/ProgramInfo.java (revision 0)
+++ runplan/ProgramInfo.java (revision 2)
@@ -0,0 +1,164 @@
+package com.viewscenes.util.business.
+ * &p&Title: &/p&
+ * &p&Description: &/p&
+ * &p&Copyright: Copyright (c) 2003&/p&
+ * &p&Company: &/p&
+ * @author not attributable
+ * @version 1.0
+public class ProgramInfo
extends RunPlanInfo { //频率//节目编号//发射台编号
private String programName = &&; //节目名称//发射台名称
private String programType = &&; //节目类型//发射台位置//运行图类型
private String coverObject = &&;
private String antenna = &&;
private String serviceArea = &&;
private String language = &&;
private String direction = &&;
private String antennaType = &&;
private String broadType = &&;
private String broadCast = &&; //运行图编号
private String weekDays = &&;
public ProgramInfo() {
public ProgramInfo(RunPlanInfo runPlanInfo) {
this.setFrequency(runPlanInfo.getFrequency());
this.setPower(runPlanInfo.getPower());
this.setRunplanID(runPlanInfo.getRunplanID());
this.setRunplanType(runPlanInfo.getRunplanType());
this.setStationID(runPlanInfo.getStationID());
this.setStationType(runPlanInfo.getStationType());
this.setStationName(runPlanInfo.getStationName());
this.setTemporary(runPlanInfo.getTemporary());
this.setTransmitter(runPlanInfo.getTransmitter());
this.setTypeName(runPlanInfo.getTypeName());
this.setValidendtime(runPlanInfo.getValidendtime());
this.setValidstarttime(runPlanInfo.getValidstarttime());
public String getProgramName() {
return programN
public void setProgramName(String programName) {
if (programName != null) {
this.programName = programName.trim();
public String getProgramType() {
return programT
public void setProgramType(String programType) {
if (programType != null) {
this.programType = programType.trim();
public String getCoverObject() {
return coverO
public void setCoverObject(String coverObject) {
if (coverObject != null) {
this.coverObject = coverObject.trim();
public String getAntenna() {
public void setAntenna(String antenna) {
if (antenna != null) {
this.antenna = antenna.trim();
public String getServiceArea() {
return serviceA
public void setServiceArea(String serviceArea) {
if (serviceArea != null) {
this.serviceArea = serviceArea.trim();
public String getLanguage() {
public void setLanguage(String language) {
if (language != null) {
this.language = language.trim();
public String getDirection() {
public void setDirection(String direction) {
if (direction != null) {
this.direction = direction.trim();
public String getAntennaType() {
return antennaT
public void setAntennaType(String antennaType) {
if (antennaType != null) {
this.antennaType = antennaType.trim();
public String getBroadType() {
return broadT
public void setBroadType(String broadType) {
if (broadType != null) {
this.broadType = broadType.trim();
public String getBroadCast() {
return broadC
public void setBroadCast(String broadCast) {
if (broadCast != null) {
this.broadCast = broadCast.trim();
public String getWeekDays() {
return weekD
public void setWeekDays(String weekDays) {
if (weekDays != null) {
this.weekDays = weekDays.trim();
public boolean equals(ProgramInfo obj) {
return this.toString().equalsIgnoreCase(obj.toString());
public String toString() {
return super.toString() + &:& + programName + &:& + programType + &:& +
+ coverObject + &:&
+ + antenna + &:& + serviceArea + &:& + language + &:& + direction + &:&
+ + antennaType + &:& + broadType + &:& + broadCast + &:& + weekD
Index: runplan/RunPlanInfo.java
===================================================================
--- runplan/RunPlanInfo.java (revision 0)
+++ runplan/RunPlanInfo.java (revision 2)
@@ -0,0 +1,167 @@
+package com.viewscenes.util.business.
+ * &p&Title: &/p&
+ * &p&Description: &/p&
+ * &p&Copyright: Copyright (c) 2003&/p&
+ * &p&Company: &/p&
+ * @author not attributable
+ * @version 1.0
+public class RunPlanInfo
implements Cloneable {
private String runplanID = &&;
private String runplanType = &&;
private String transmitter = &&;
private String stationID = &&;
private String stationType = &&;
private long validstarttime = 0;
private long validendtime = 0;
private String power = &&;
private String temporary = &&;
private String frequency = &&;
private String stationName = &&;
private String typeName = &&;
public RunPlanInfo() {
public String getRunplanID() {
return runplanID;
public void setRunplanID(String runplanID) {
if (runplanID != null) {
this.runplanID = runplanID.trim();
public String getRunplanType() {
return runplanT
public void setRunplanType(String runplanType) {
if (runplanType != null) {
this.runplanType = runplanType.trim();
public String getTransmitter() {
public void setTransmitter(String transmitter) {
if (transmitter != null) {
this.transmitter = transmitter.trim();
public String getStationID() {
return stationID;
public void setStationID(String stationID) {
if (stationID != null) {
this.stationID = stationID.trim();
public String getStationType() {
return stationT
public void setStationType(String stationType) {
if (stationType != null) {
this.stationType = stationType.trim();
public long getValidstarttime() {
public void setValidstarttime(long validstarttime) {
this.validstarttime =
public long getValidendtime() {
public void setValidendtime(long validendtime) {
this.validendtime =
public String getPower() {
public void setPower(String power) {
if (power != null) {
this.power = power.trim();
public String getTemporary() {
public void setTemporary(String temporary) {
if (temporary != null) {
this.temporary = temporary.trim();
public String getFrequency() {
public void setFrequency(String frequency) {
if (frequency != null) {
this.frequency = frequency.trim();
public String getStationName() {
return stationN
public void setStationName(String stationName) {
if (stationName != null) {
this.stationName = stationName.trim();
public String getTypeName() {
return typeN
public void setTypeName(String typeName) {
if (typeName != null) {
this.typeName = typeName.trim();
public Object clone() {
return super.clone();
catch (CloneNotSupportedException e) {
e.printStackTrace();
public boolean equals(RunPlanInfo obj) {
return this.toString().equalsIgnoreCase(obj.toString());
public String toString() {
return runplanID + &:& + runplanType + &:& + transmitter + &:& + stationID +
+ + stationType + &:& + validstarttime + &:& + validendtime + &:& + power +
+ + temporary + &:& + frequency + &:& + stationName + &:& + typeN
Index: runplan/TimeSpanGroup.java
===================================================================
--- runplan/TimeSpanGroup.java (revision 0)
+++ runplan/TimeSpanGroup.java (revision 2)
@@ -0,0 +1,264 @@
+package com.viewscenes.util.business.
+import java.util.*;
+ * &p&Title: 运行图时间段容器&/p&
+ * &p&Description: 对运行图时间段组以及运行图信息的封装&/p&
+ * &p&Copyright: Copyright (c) 2003&/p&
+ * &p&Company: 永新同方&/p&
+ * @author 徐雁威
+ * @version 1.0
+public class TimeSpanGroup {
private Vector spanV
private RunPlanInfo runPlanI
* 构造函数
public TimeSpanGroup() {
spanVector = new Vector();
runPlanInfo =
* 转换为字串
public String toString() {
String returnValue = &&;
for (int i = 0; i & spanVector.size(); i++) {
returnValue += i + &. & + this.get(i).toString();
return returnV
* 清除数据
public void removeAll() {
spanVector.clear();
* 添加融合形时间段
* @param runSpan 时间段TimeSpan
public void add(TimeSpan runSpan) {
add(runSpan, false);
* 去除指定时间段
* @param index
public void remove(int index) {
if (index & spanVector.size()) {
spanVector.remove(index);
* 插入时段,对跨天时段先拆分后插入
* @param newItem 时间段TimeSpan
* @param overWrite 覆盖标志 true:覆盖,false:融合
public void add(TimeSpan newItem, boolean overWrite) {
TimeSpan addedI
if (newItem.getProgramInfo() != null) {
addedItem = new TimeSpan(newItem.getStartTime(), newItem.getEndTime(),
newItem.getType(),
(ProgramInfo) newItem.getProgramInfo().clone());
addedItem = new TimeSpan(newItem.getStartTime(), newItem.getEndTime(),
newItem.getType(), newItem.getProgramInfo());
//split two parts
if (addedItem.getStartTime() &= addedItem.getEndTime()) {
TimeSpan item = new TimeSpan(0, addedItem.getEndTime(), addedItem.getType(),
addedItem.getProgramInfo());
addItem(item, overWrite);
addedItem.setEndTime(24 * 3600);
addItem(addedItem, overWrite);
addItem(addedItem, overWrite);
* 插入一个时间段
* @param newItem 时间段TimeSpan
* @param overWrite 覆盖标志 true:覆盖,false:融合
private void addItem(TimeSpan newItem, boolean overWrite) {
for (i = 0; i & spanVector.size(); i++) {
item = this.get(i);
if (newItem.getStartTime() &= item.getEndTime()) {
//insert new item in the early most
if (newItem.getEndTime() & item.getStartTime()) {
+ spanVector.insertElementAt(newItem, i);
//split new item, continue using left parts
if (newItem.getStartTime() & item.getStartTime()) {
+ sitem = new TimeSpan(newItem.getStartTime(), item.getStartTime(),
newItem.getType(), newItem.getProgramInfo());
+ spanVector.insertElementAt(sitem, i);
+ newItem.setStartTime(item.getStartTime());
//split exist item
if (newItem.getStartTime() & item.getStartTime()) {
+ sitem = new TimeSpan(item.getStartTime(), newItem.getStartTime(),
item.getType(), item.getProgramInfo());
+ spanVector.insertElementAt(sitem, i);
+ item.setStartTime(newItem.getStartTime());
//split exist item
if (newItem.getEndTime() & item.getEndTime()) {
+ //create left item
+ sitem = new TimeSpan(newItem.getEndTime(), item.getEndTime(),
item.getType(), item.getProgramInfo());
+ spanVector.insertElementAt(sitem, i + 1);
+ //shorten exist item end
+ item.setEndTime(newItem.getEndTime());
//common part combination
if (newItem.getType() & item.getType() || overWrite) {
+ item.setType(newItem.getType());
+ item.setProgramInfo(newItem.getProgramInfo());
//split new item, continue using left parts
if (newItem.getEndTime() & item.getEndTime()) {
+ newItem.setStartTime(item.getEndTime());
+ //no block left
//add to the last
if (i &= spanVector.size()) {
spanVector.add(newItem);
compressItems();
* 压缩前后链接的时间段
private void compressItems() {
TimeSpan itemN
int i = 0;
while (i & spanVector.size() - 1) {
item = this.get(i);
itemNext = this.get(i + 1);
item.getEndTime() == itemNext.getStartTime() &&
item.getType() == itemNext.getType()
item.getProgramInfo() != null && itemNext.getProgramInfo() != null
(item.getProgramInfo() == itemNext.getProgramInfo() ||
item.getProgramInfo().equals(itemNext.getProgramInfo()))
(item.getProgramInfo() == null && itemNext.getProgramInfo() == null)
+ item.setEndTime(itemNext.getEndTime());
+ spanVector.remove(i + 1);
* 获得一个时间段
* @param index 索引
时间段TimeSpan
public TimeSpan get(int index) {
TimeSpan returnV
if (index & spanVector.size()) {
returnValue = (TimeSpan) spanVector.get(index);
returnValue = new TimeSpan();
return returnV
* 获取时间段个数
* @param type 运行图类型, 0:全部,1:播出,2:检修
public int getTimeSpanNum(long type) {
int returnValue = 0;
if (type == 0) {
returnValue = spanVector.size();
for (int i = 0; i & spanVector.size(); i++) {
+ if (this.get(i).getType() == type) {
returnValue++;
return returnV
* 获取总时长
* @param type 运行图类型, 0:全部, 1:播出, 2:检修
* @return (秒)
public long getTotalInterval(long type) {
long returnValue = 0;
for (int i = 0; i & spanVector.size(); i++) {
if (type == 0 || this.get(i).getType() == type) {
+ returnValue += this.get(i).getInterval();
return returnV
* 获取运行图节目信息
* @return ProgramInfo
public RunPlanInfo getRunPlanInfo() {
return runPlanI
* 设置运行图节目信息
* @param programInfo ProgramInfo
public void setRunPlanInfo(RunPlanInfo runPlanInfo) {
this.runPlanInfo = runPlanI
Index: runplan/RunPlan.java
===================================================================
--- runplan/RunPlan.java (revision 0)
+++ runplan/RunPlan.java (revision 2)
@@ -0,0 +1,855 @@
+package com.viewscenes.util.business.
+import java.util.C
+import java.util.V
+import com.viewscenes.dao.DAOC
+import com.viewscenes.dao.DAOO
+import com.viewscenes.dao.DaoF
+import com.viewscenes.pub.GDS
+import com.viewscenes.util.StringT
+import com.viewscenes.util.business.SiteRunplanU
+import com.viewscenes.util.business.SiteVersionU
+import com.viewscenes.util.business.SystemIdU
+ * &p&Title: 运行图工具&/p&
+ * &p&Description: 运行图常用相关功能查询&/p&
+ * &p&Copyright: Copyright (c) 2003&/p&
+ * &p&Company: 永新同方&/p&
+ * @author 徐雁威
+ * @version 1.0
+public class RunPlan {
public RunPlan() {
* 获取节目时长
* @param stationID 发射台编号
* @param checkDate 检查日期
* @param runplanType 运行图类型
* @param programType 节目类型
* @return 0:节目时长,1:节目频率数
public static long[] getProgramLengths(String stationID, String checkDate,
String runplanType, String programType) {
long returnValue[] = {
Vector tsgVector = RunPlan.getTimeSpanGroups(&&, stationID, checkDate, false,
&&, &&, runplanType,
programType);
String frequency = &&;
for (int i = 0; i & tsgVector.size(); i++) {
tsitem = (TimeSpanGroup) tsgVector.get(i);
returnValue[0] += tsitem.getTotalInterval(1);
if (!frequency.equalsIgnoreCase(tsitem.getRunPlanInfo().getFrequency())) {
frequency = tsitem.getRunPlanInfo().getFrequency();
returnValue[1]++;
return returnV
public static long getProgramLength(String headendCode, String stationID,
String frequency, String startDate,
String endDate) {
long returnValue = 0;
long startTime, endT
startTime = StringTool.stringToDate(startDate).getTime() / 1000;
endTime = StringTool.stringToDate(endDate).getTime() / 1000;
if (endTime & startTime) {
returnValue = endTime - startT
long programLength = 0;
String startDay, checkDay, endD
long checkT
Vector tsgV
TimeSpan beginTimeSpan =
TimeSpan endTimeSpan =
if (!startDate.substring(11).equalsIgnoreCase(&00:00:00&)) {
beginTimeSpan = new TimeSpan(&00:00:00&, startDate.substring(11), &2&);
//if(!endDate.substring(11).equalsIgnoreCase(&00:00:00&))
endTimeSpan = new TimeSpan(endDate.substring(11), &00:00:00&, &2&);
startDay = startDate.substring(0, 10) + & 00:00:00&;
endDay = endDate.substring(0, 10) + & 00:00:00&;
checkDay = startD
while (pareTo(endDay) &= 0) {
tsgVector = RunPlan.getTimeSpanGroups(headendCode, stationID, checkDay, false,
frequency, &&, &&, &&);
for (i = 0; i & tsgVector.size(); i++) {
tsitem = (TimeSpanGroup) tsgVector.get(i);
if (checkDay.equalsIgnoreCase(startDay) && beginTimeSpan != null) {
tsitem.add(beginTimeSpan);
if (checkDay.equalsIgnoreCase(endDay) && endTimeSpan != null) {
tsitem.add(endTimeSpan);
programLength += tsitem.getTotalInterval(1);
//System.out.print(&\n &+tsgVector.toString()+&\nProgamLength:&+programLength+&\n&);
checkTime = StringTool.stringToDate(checkDay).getTime();
checkDay = StringTool.Date2String(new java.util.Date(checkTime +
24 * 3600 * 1000));
if (programLength & 0 && programLength & returnValue) {
returnValue = programL
return returnV
* 处理有效期问题
* @param timeSpan
* @param rvStartTime
* @param rvEndTime
* @param startInMiddle
* @param endInMiddle
private static TimeSpanGroup processMiddleHour(TimeSpan timeSpan,
long rvStartTime,
long rvEndTime,
boolean startInMiddle,
boolean endInMiddle) {
TimeSpanGroup returnValue = new TimeSpanGroup();
long type = timeSpan.getType();
TimeSpan validItem = new TimeSpan();
//delete through dayitem if valid start from today
if (timeSpan.getStartTime() &= timeSpan.getEndTime() && startInMiddle) {
timeSpan.setEndTime(0);
returnValue.add(timeSpan);
//trim start
if (startInMiddle) {
validItem.setStartTime(0);
validItem.setEndTime(rvStartTime);
validItem.setProgramInfo(timeSpan.getProgramInfo());
if (type == 1) {
validItem.setType(2);
returnValue.add(validItem);
validItem.setType(1);
returnValue.add(validItem, true);
//trim end
if (endInMiddle) {
validItem.setStartTime(rvEndTime);
validItem.setEndTime(0);
validItem.setProgramInfo(timeSpan.getProgramInfo());
if (type == 1) {
validItem.setType(2);
returnValue.add(validItem);
validItem.setType(1);
returnValue.add(validItem, true);
int i = 0;
while (i & returnValue.getTimeSpanNum(0)) {
if (returnValue.get(i).getType() != type) {
returnValue.remove(i);
return returnV
* 获取运行图查询条件
* @param headCode
* @param stationID
* @param checkTime
* @param matchTime
* @param frequency
* @param band
* @param runPlanType
* @param programType
public static DAOCondition getRunPlanCondition(String headCode,
String stationID,
String checkTime,
boolean matchTime,
boolean matchWeek,
String frequency, String band,
String runPlanType,
String programType) {
DAOCondition returnValue =
if (headCode == null) {
headCode = &&;
if (stationID == null) {
stationID = &&;
if (checkTime == null) {
checkTime = &&;
if (frequency == null) {
frequency = &&;
if (band == null) {
band = &&;
if (runPlanType == null) {
runPlanType = &&;
if (programType == null) {
programType = &&;
returnValue = new DAOCondition(&zres_runplan_gb_view&);
returnValue.addCondition(&is_delete&, &NUMBER&, &=&, &0&);
returnValue.addCondition(&is_predefine&, &NUMBER&, &=&, &0&);
returnValue.addCondition(&is_confirm&, &NUMBER&, &=&, &1&);
returnValue.addCondition(&is_special&, &NUMBER&, &=&, &0&);
returnValue.addCondition(&timespan_type_id&, &NUMBER&, &=&, &1&);
returnValue.addCondition(&broadcast_type_id&, &NUMBER&, &=&, &3&);
if (checkTime.length() & 0) {
Calendar nowCal = Calendar.getInstance();
nowCal.setTime(StringTool.stringToDate(checkTime));
String weekday = new Integer(nowCal.get(Calendar.DAY_OF_WEEK) - 1).
toString();
int prvWeek = nowCal.get(Calendar.DAY_OF_WEEK) - 2;
if (prvWeek & 0) {
prvWeek = 6;
String prvweekday = new Integer(prvWeek).toString();
String beginDate = checkTime.substring(0, 10) + & 00:00:00&;
String endDate = checkTime.substring(0, 10) + & 23:59:59&;
if (matchTime) { //获取制定时刻的
returnValue.addCondition(&valid_startdatetime&, &DATE&, &&=&,
checkTime);
returnValue.addCondition(&valid_enddatetime&, &DATE&, &&&, checkTime);
//两天该时间有播音。但视图中,开播时间、停播时间已经转成其它格式。
String checkTime1 = & & + checkTime.substring(11);
String checkTime2 = & & + checkTime.substring(11);
DAOCondition scon = new DAOCondition(&zres_runplan_gb_view&);
DAOCondition sscon = new DAOCondition(&zres_runplan_gb_view&);
sscon.addCondition(&start_time&, &DATE&, &&=&, checkTime1, &and&);
sscon.addCondition(&end_time&, &DATE&, &&=&, checkTime1, &and&);
scon.addCondition(&&, &&, &()&, sscon.toString(), &or&);
sscon = new DAOCondition(&zres_runplan_gb_view&);
sscon.addCondition(&start_time&, &DATE&, &&=&, checkTime2, &and&);
sscon.addCondition(&end_time&, &DATE&, &&=&, checkTime2, &and&);
scon.addCondition(&&, &&, &()&, sscon.toString(), &or&);
returnValue.addCondition(&&, &&, &()&, scon.toString());
else { //获取制定日期的
returnValue.addCondition(&valid_startdatetime&, &DATE&, &&=&, endDate);
returnValue.addCondition(&valid_enddatetime&, &DATE&, &&&, beginDate);
if (matchWeek) {
//查询周有效的
scondition = new DAOCondition(&zres_runplan_gb_view&);
scondition.addCondition(&weekdays&, &VARCHAR&, &=&, &all&, &or&);
scondition.addCondition(&weekdays&, &VARCHAR&, &=&, weekday, &or&);
scondition.addCondition(&weekdays&, &VARCHAR&, &=&, prvweekday, &or&);
returnValue.addCondition(&&, &&, &()&, scondition.toString());
if (frequency.length() & 0) {
returnValue.addCondition(&frequency&, &NUMBER&, &=&, frequency);
if (band.length() & 0) {
returnValue.addCondition(&band&, &NUMBER&, &=&, band);
//匹配运行图类型
if (runPlanType.length() & 0) {
scondition = new DAOCondition(&zres_runplan_gb_view&);
String[] runplanArray = runPlanType.split(&,&);
for (int i = 0; i & runplanArray. i++) {
if (runplanArray[i].trim().length() & 0) {
scondition.addCondition(&runplan_type_id&, &NUMBER&, &=&,
runplanArray[i].trim(), &or&);
returnValue.addCondition(&&, &&, &()&, scondition.toString());
//匹配节目类型
if (programType.length() & 0) {
scondition = new DAOCondition(&zres_runplan_gb_view&);
String[] programArray = programType.split(&,&);
for (int i = 0; i & programArray. i++) {
if (programArray[i].trim().length() & 0) {
scondition.addCondition(&program_type_id&, &NUMBER&, &=&,
programArray[i].trim(), &or&);
returnValue.addCondition(&&, &&, &()&, scondition.toString());
if (stationID.length() & 0) { //匹配发射台
returnValue.addCondition(&station_id&, &NUMBER&, &=&, stationID);
else if (headCode.length() & 0) { //匹配前端的
//统一逻辑。遥控站(mon_area),采集点(发射台关联)lixuefeng
scondition = new DAOCondition(&zres_runplan_gb_view&);
String siteType = SiteVersionUtil.getSiteType(headCode);
String headendID = SiteVersionUtil.getSiteHeadId(headCode);
if (siteType.equalsIgnoreCase(&101&)) {
DAOCondition s11condition = new DAOCondition(
&res_monitor_station_tab&);
s11condition.addCondition(&head_id&, &NUMBER&, &=&, headendID);
DAOCondition s12condition = new DAOCondition(
&res_transmit_station_tab&);
s12condition.addCondition(&is_delete&, &NUMBER&, &=&, &0&);
s12condition.addCondition(&station_id&, &NUMBER&, &in&,
s11condition.toString());
scondition.addCondition(&station_id&, &NUMBER&, &in&,
s12condition.toString());
returnValue.addCondition(&&, &&, &()&, scondition.toString());
//遥控站,中心根据拆分表,其它根据mon_area字段。
if (SystemIdUtil.getLocalCenterId().equalsIgnoreCase(&100&)) {
DAOCondition s11condition = new DAOCondition(
&zres_runplan_station_view&);
s11condition.addCondition(&effect_ids&, &VARCHAR&, &like&,
&%& + headendID + &%&);
scondition.addCondition(&runplan_id&, &NUMBER&, &in&,
s11condition.toString());
returnValue.addCondition(&&, &&, &()&, scondition.toString());
String headName = SiteVersionUtil.getSiteName(headCode);
scondition.addCondition(&mon_area&, &VARCHAR&, &like&,
&%& + headName + &%&);
returnValue.addCondition(&&, &&, &()&, scondition.toString());
catch (Exception e) {
e.printStackTrace();
return returnV
* 查找指点前端,制定时刻,制定频率的节目信息
* @param headCode
* @param checkTime
* @param frequency 不填则返回该时刻所有可监测频率的信息
public static Vector getProgramInfos(String headCode, String checkTime,
String frequency) {
return getProgramInfos(headCode, &&, checkTime, true, frequency, &&, &&, &&);
* 查找匹配的节目信息
* @param headCode 前端代号
* @param checkTime 检查时间
* @param frequency 频率
public static Vector getProgramInfos(String headCode, String StationID,
String checkTime, boolean matchTime,
String frequency, String band,
String runplanType, String programType) {
Vector returnValue = new Vector();
Vector tsVector = getTimeSpanGroups(headCode, StationID, checkTime,
matchTime, frequency, band, runplanType,
programType);
TimeSpanGroup tsG
TimeSpan timeS
long alarmTime = TimeSpan.parse(checkTime.substring(11)); //get rid of &yyyy-mm-dd &
for (i = 0; i & tsVector.size(); i++) {
tsGroup = (TimeSpanGroup) tsVector.get(i);
for (j = 0; j & tsGroup.getTimeSpanNum(0); j++) {
timeSpan = tsGroup.get(j);
if (timeSpan.getType() == 1) { //只取出播出的,如果匹配时间则还检查时间
if (!matchTime ||
(timeSpan.getStartTime() & timeSpan.getEndTime() &&
alarmTime &= timeSpan.getStartTime() &&
alarmTime & timeSpan.getEndTime())
(timeSpan.getStartTime() & timeSpan.getEndTime() &&
(alarmTime &= timeSpan.getStartTime() ||
alarmTime & timeSpan.getEndTime()))
//System.out.print(&\nadd to output &+timeSpan.getProgramInfo().getFrequency());
returnValue.add(timeSpan.getProgramInfo());
return returnV
* 获取指定参数的
* @param headCode
* @param stationID
* @param checkTime
* @param matchTime
* @param frequency
* @param band
* @param runplanType
* @param programType
public static Vector getTimeSpanGroups(String headCode, String stationID,
String checkTime, boolean matchTime,
String frequency, String band,
String runplanType, String programType) {
Vector returnValue = new Vector();
String beginDate = checkTime.substring(0, 10) + & 00:00:00&;
String endDate = checkTime.substring(0, 10) + & 23:59:59&;
Calendar nowCal = Calendar.getInstance();
nowCal.setTime(StringTool.stringToDate(checkTime));
String weekday = new Integer(nowCal.get(Calendar.DAY_OF_WEEK) - 1).
toString();
int prvWeek = nowCal.get(Calendar.DAY_OF_WEEK) - 2;
if (prvWeek & 0) {
prvWeek = 6;
String prvweekday = new Integer(prvWeek).toString();
DAOOperator d = (DAOOperator) DaoFactory.create(DaoFactory.DAO_OBJECT);
DAOCondition condition = getRunPlanCondition(headCode, stationID,
checkTime, matchTime, true, frequency, band, runplanType, programType);
if (condition != null) {
condition.addCondition(
&frequency,transmiter_no,is_temporary,& +
&runplan_id,weekdays desc,timespan_type_id,is_broadcast&, &&,
&order by&, &&);
GDSet result_set = d.Query(&*&, condition);
condition = new DAOCondition(&res_transmit_station_type_tab&);
GDSet type_set = d.Query(&*&, condition);
//long totalLength = 0;
TimeSpan timeS
TimeSpanGroup tsGroup =
TimeSpanGroup validG
RunPlanInfo runPlanInfo =
ProgramInfo programInfo =
//运行图有效期以及部分有效标识
String rvStartDate = &&;
String rvEndDate = &&;
boolean startInMiddle =
boolean endInMiddle =
//唯一性标志
String curRunplanID = &&;
String curFrequency = &&;
String curTransmitter = &&;
boolean overWrite =
boolean validSpan =
for (i = 0; i &= result_set.getRowCount(); i++) {
//处理最后的
if (i == result_set.getRowCount()) {
if (i != 0) {
returnValue.add(tsGroup);
//根据来源与频率与机号分类
if (!curFrequency.equalsIgnoreCase(result_set.getString(i,
&frequency&)) ||
!curTransmitter.equalsIgnoreCase(result_set.getString(i,
&transmiter_no&))) {
//添加之前的记录
if (i & 0) {
returnValue.add(tsGroup);
//记录现有标志
curFrequency = result_set.getString(i, &frequency&);
curTransmitter = result_set.getString(i, &transmiter_no&);
tsGroup = new TimeSpanGroup();
runPlanInfo = new RunPlanInfo();
//curRunplanID = result_set.getString(i, &runplan_id&);
runPlanInfo.setRunplanID(result_set.getString(i, &runplan_id&));
runPlanInfo.setRunplanType(result_set.getString(i,
&runplan_type_id&));
runPlanInfo.setTypeName(result_set.getString(i, &type&));
runPlanInfo.setTemporary(result_set.getString(i, &is_temporary&));
runPlanInfo.setFrequency(result_set.getString(i, &frequency&));
runPlanInfo.setTransmitter(result_set.getString(i, &transmiter_no&));
runPlanInfo.setPower(result_set.getString(i, &power&));
runPlanInfo.setStationID(result_set.getString(i, &station_id&));
runPlanInfo.setStationName(result_set.getString(i, &station_name&));
runPlanInfo.setValidstarttime(StringTool.stringToDate(result_set.
getString(i, &valid_startdatetime&)).getTime());
runPlanInfo.setValidendtime(StringTool.stringToDate(result_set.
getString(i, &valid_enddatetime&)).getTime());
if (runPlanInfo.getStationID().length() & 0 &&
type_set.getRowCount() & 0) {
for (j = 0; j & type_set.getRowCount(); j++) {
if (type_set.getString(j, &station_id&).equalsIgnoreCase(
runPlanInfo.getStationID())) {
runPlanInfo.setStationType(type_set.getString(j,
&station_type_id&));
tsGroup.setRunPlanInfo(runPlanInfo);
//获取时段覆盖标志,临时覆盖日常,指定日期覆盖每天
if (result_set.getString(i, &is_temporary&).equalsIgnoreCase(&1&)||
!result_set.getString(i, &weekdays&).equalsIgnoreCase(&all&))
overWrite =
else//检修、停播覆盖播出
overWrite =
//遇到冲突,总是后面的覆盖前面的,即临时覆盖日常,指定日期覆盖每天,检修、停播覆盖播出,播出的覆盖未播出的
overWrite =
//runplanID 变化,更新信息
if (!curRunplanID.equalsIgnoreCase(result_set.getString(i,
&runplan_id&))) {
curRunplanID = result_set.getString(i, &runplan_id&);
rvStartDate = result_set.getString(i, &valid_startdatetime&);
rvEndDate = result_set.getString(i, &valid_enddatetime&);
//检查有效期是否在所选日期中间
if (pareTo(beginDate) & 0) {
startInMiddle =
startInMiddle =
if (pareTo(endDate) & 0) {
endInMiddle =
endInMiddle =
runPlanInfo = new RunPlanInfo();
runPlanInfo.setRunplanID(result_set.getString(i, &runplan_id&));
runPlanInfo.setRunplanType(result_set.getString(i,
&runplan_type_id&));
runPlanInfo.setTypeName(result_set.getString(i, &type&));
runPlanInfo.setTemporary(result_set.getString(i, &is_temporary&));
runPlanInfo.setFrequency(result_set.getString(i, &frequency&));
runPlanInfo.setTransmitter(result_set.getString(i, &transmiter_no&));
runPlanInfo.setPower(result_set.getString(i, &power&));
runPlanInfo.setStationID(result_set.getString(i, &station_id&));
runPlanInfo.setStationName(result_set.getString(i, &station_name&));
runPlanInfo.setValidstarttime(StringTool.stringToDate(result_set.
getString(i, &valid_startdatetime&)).getTime());
runPlanInfo.setValidendtime(StringTool.stringToDate(result_set.
getString(i, &valid_enddatetime&)).getTime());
if (runPlanInfo.getStationID().length() & 0 &&
type_set.getRowCount() & 0) {
for (j = 0; j & type_set.getRowCount(); j++) {
if (type_set.getString(j,
&station_id&).equalsIgnoreCase(
runPlanInfo.getStationID())) {
runPlanInfo.setStationType(type_set.getString(j,
&station_type_id&));
validSpan =
timeSpan = new TimeSpan();
timeSpan.setType(new Long(result_set.getString(i, &timespan_type_id&)).
longValue());
timeSpan.setStartTime(result_set.getString(i, &starttime&));
timeSpan.setEndTime(result_set.getString(i, &endtime&));
if (result_set.getString(i, &weekdays&).equalsIgnoreCase(prvweekday)) {
if (timeSpan.getEndTime() &= timeSpan.getStartTime()) {
timeSpan.setStartTime(0);
validSpan =
if (result_set.getString(i, &weekdays&).equalsIgnoreCase(weekday)) {
if (timeSpan.getEndTime() &= timeSpan.getStartTime()) {
timeSpan.setEndTime(0);
if (validSpan) {
programInfo = new ProgramInfo(runPlanInfo);
programInfo.setProgramType(result_set.getString(i,
&program_type_id&));
programInfo.setProgramName(result_set.getString(i, &program_name&));
programInfo.setRunplanID(result_set.getString(i, &runplan_id&));
programInfo.setBroadCast(result_set.getString(i, &is_broadcast&));
programInfo.setCoverObject(result_set.getString(i, &cover_object&));
programInfo.setServiceArea(result_set.getString(i, &service_area&));
programInfo.setAntenna(result_set.getString(i, &antenna&));
programInfo.setAntennaType(result_set.getString(i, &antenna_type&));
programInfo.setLanguage(result_set.getString(i, &language_name&));
programInfo.setDirection(result_set.getString(i, &direction&));
programInfo.setBroadType(result_set.getString(i,
&broadcast_type_id&));
programInfo.setWeekDays(result_set.getString(i,
&weekdays&));
timeSpan.setProgramInfo(programInfo);
//有效期在中间,进行切割
if (startInMiddle || endInMiddle) {
validGroup = processMiddleHour(timeSpan,
TimeSpan.parse(rvStartDate.
substring(11)),
TimeSpan.parse(rvEndDate.substring(
11)), startInMiddle, endInMiddle);
for (j = 0; j & validGroup.getTimeSpanNum(0); j++) {
tsGroup.add(validGroup.get(j), overWrite);
tsGroup.add(timeSpan, overWrite);
catch (Exception e) {
e.printStackTrace();
return returnV
* 获取报警参数值
* @param headendID 前端ID
* @param equCode 接收机代号
* @param frequency 频率
public static GDSet getAlarmInfo(String headendID, String equCode,
String frequency) {
String band = SiteRunplanUtil.getBandFromFreq(frequency);
return getAlarmInfo(headendID, equCode, band, frequency, null);
* 查询报警参数值
* @param headendID 前端ID
* @param equCode
* @param band 波段
* @param frequency 频率
* @param paramID 可返回对应的参数ID
public static GDSet getAlarmInfo(String headendID, String equCode,
String band, String frequency,
String[] paramID) {
GDSet result_set =
long desireMatch = 0;
if (headendID.length() & 0) {
if (equCode.length() & 0) {
if (band.length() & 0) {
if (frequency.length() & 0) {
desireMatch = 7;
desireMatch = 6;
desireMatch = 5;
if (band.length() & 0) {
if (frequency.length() & 0) {
desireMatch = 4;
desireMatch = 3;
desireMatch = 2;
desireMatch = 1;
long matchNum = 0;
long lastMatchNum = 0;
DAOOperator d = (DAOOperator) DaoFactory.create(DaoFactory.DAO_OBJECT);
DAOCondition condition = new DAOCondition(&radio_quality_alarm_param_tab&);
result_set = d.Query(&*&, condition);
String pmH
int matchRow = 0;
String pmE
String pmB
String pmF
long headM
long bandM
long freqM
while (result_set.getRowCount() & matchRow) {
matchNum = 0;
headMatch = 0;
equMatch = 0;
bandMatch = 0;
freqMatch = 0;
pmHead = result_set.getString(matchRow, &head_id&);
pmEqu = result_set.getString(matchRow, &equ_code&);
pmBand = result_set.getString(matchRow, &band&);
pmFreq = result_set.getString(matchRow, &frequency&);
if (pmHead.equalsIgnoreCase(headendID)) {
headMatch = 2;
else if (pmHead.length() == 0) {
headMatch = 1;
headMatch = 0;
if (pmEqu.equalsIgnoreCase(equCode)) {
equMatch = 2;
else if (pmEqu.equalsIgnoreCase(&All&)) {
equMatch = 1;
equMatch = 0;
if (pmBand.equalsIgnoreCase(band)) {
bandMatch = 2;
else if (pmBand.equalsIgnoreCase(&9&)) {
bandMatch = 1;
bandMatch = 0;
if (pmFreq.equalsIgnoreCase(frequency)) {
freqMatch = 2;
else if (pmFreq.equalsIgnoreCase(&0&)) {
freqMatch = 1;
freqMatch = 0;
if (headMatch == 2) {
if (equMatch == 2) {
if (bandMatch == 2) {
if (freqMatch == 2) {
matchNum = 7;
else if (freqMatch == 1) {
matchNum = 6;
//else no match
else if (bandMatch == 1) {
matchNum = 5;
//else no match
else if (equMatch == 1) {
if (bandMatch == 2) {
if (freqMatch == 2) {
matchNum = 4;
else if (freqMatch == 1) {
matchNum = 3;
//else no match
else if (bandMatch == 1) {
matchNum = 2;
//else no match
else if (headMatch == 1) {
matchNum = 1;
if (matchNum &= lastMatchNum) {
lastMatchNum = matchN
if (matchRow & 0) {
result_set.removeRow(0);
result_set.removeRow(matchRow);
matchRow = 1;
if (lastMatchNum == desireMatch && paramID != null && paramID.length & 0) {
paramID[0] = result_set.getString(0, &param_id&);
catch (Exception e) {
e.printStackTrace();
return result_
Index: SiteRunplanUtil.java
===================================================================
--- SiteRunplanUtil.java (revision 0)
+++ SiteRunplanUtil.java (revision 2)
@@ -0,0 +1,669 @@
+package com.viewscenes.util.
+import java.text.SimpleDateF
+import java.util.C
+import java.util.D
+import java.util.L
+import java.util.V
+import com.viewscenes.dao.database.DbC
+import com.viewscenes.pub.GDS
+import com.viewscenes.util.StringT
+import com.viewscenes.util.business.runplan.ProgramI
+import com.viewscenes.util.business.runplan.RunP
+public class SiteRunplanUtil {
public SiteRunplanUtil() {
* 根据站点提取 运行图关联sql。
* 我见到的都改到这了,别人做的有可能没有用共用的。维护请注意。
* 采集点从关联中取。
* 遥控站直属台从运行图mon_area取,中心根据拆分表来取。
* @param hide_code String 传过来的参数只有一个站点。
* @return String
public stat}

我要回帖

更多关于 大写的呵呵什么意思 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信