//Date: 2008-4-24 11:36:15
//~
//~
//CopyRight@criway FileName: JsInfoProcess.java
package com.criway.jsinfo;
import com.criway.database.DataConn;
import com.criway.oa.schedule.Task;
import java.io.PrintStream;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.Statement;
import java.sql.Timestamp;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.AbstractCollection;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
import java.util.Hashtable;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import org.apache.log4j.Category;
import org.apache.log4j.Logger;
// Referenced classes of package com.criway.jsinfo:
// JsMessage, User, InvalidateException, ApplicationException,
// JsInfoProcessHelper
public class JsInfoProcess
{
public JsInfoProcess()
{
_$12585 = 60;
_$12586 = 60;
_$12587 = 60;
_$12588 = false;
_$9576 = false;
_$12492 = null;
_$12492 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
}
public JsInfoProcess(boolean isInitData)
{
_$12585 = 60;
_$12586 = 60;
_$12587 = 60;
_$12588 = false;
_$9576 = false;
_$12492 = null;
_$12492 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
}
public JsInfoProcess(ServletContext app)
{
_$12585 = 60;
_$12586 = 60;
_$12587 = 60;
_$12588 = false;
_$9576 = false;
_$12492 = null;
_$12492 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
if(_$12589 == null)
_$12589 = app;
}
public static ServletContext getSingle_app()
{
return _$12589;
}
public static String getAbsPathPre()
{
return _$12590;
}
public static synchronized void setAbsPathPre(String absPath)
{
_$12590 = absPath;
}
public void initDbData(ArrayList messages)
throws Exception
{
if(messages == null)
throw new Exception("JsInfoProcess initDbData() messages is null!");
DataConn dataConn = null;
try
{
dataConn = new DataConn();
Statement stmt = dataConn.getConnection().createStatement();
String sql = "delete from OA_jsxxjl where type_id not in(-1, 2) or (type_id = 2 and isSendClearFlag = 1 and isReceiveClearFlag = 1)";
stmt.executeUpdate(sql);
sql = " select sender_name,receiver_name,type_id,send_time,content, id from OA_jsxxjl where real_receive_time is null and (type_id = -1 or type_id = 2) ";
logger.debug("initDbData sql : ".concat(String.valueOf(String.valueOf(sql))));
ResultSet rs = stmt.executeQuery(sql);
JsMessage message = null;
String sendLoginName = "";
String sendName = "";
String sendDepName = "";
int sendId = 0;
int typeId = 0;
String receiveLoginName = "";
String receiveName = "";
String receiveDepName = "";
int receiveId = 0;
User sendUser = null;
User receiveUser = null;
for(; rs.next(); messages.add(message))
{
message = new JsMessage();
sendLoginName = rs.getString(1).trim();
receiveLoginName = rs.getString(2).trim();
typeId = rs.getInt(3);
sendUser = JsInfoProcessHelper.getInstance().findUserByLoginName(sendLoginName);
receiveUser = JsInfoProcessHelper.getInstance().findUserByLoginName(receiveLoginName);
if(sendUser != null)
{
sendId = sendUser.getUserId();
sendName = sendUser.getUserName();
if(typeId == -1)
sendDepName = "\u7CFB\u7EDF\u63D0\u9192";
else
sendDepName = sendUser.getDepName();
}
if(receiveUser != null)
{
receiveId = receiveUser.getUserId();
receiveName = receiveUser.getUserName();
receiveDepName = receiveUser.getDepName();
}
message.setTypeId(typeId);
message.setSenderId(sendId);
message.setSenderLoginName(sendLoginName);
message.setSenderName(sendName);
message.setSenderDeptName(sendDepName);
try
{
message.setSendTimeStr(_$12492.format(rs.getTimestamp(4)));
}
catch(Exception e)
{
logger.debug(" initDbData Exception :".concat(String.valueOf(String.valueOf(e.getMessage()))));
}
message.setContent(rs.getString(5));
message.setReceiverId(receiveId);
message.setReceiverLoginName(receiveLoginName);
message.setReceiverName(receiveName);
message.setReceiverDeptName(receiveDepName);
message.setId(rs.getInt(6));
}
}
catch(Exception e)
{
throw e;
}
finally
{
if(dataConn != null)
dataConn.close();
}
}
public void refreshApplication(ServletContext application)
throws Exception
{
String db_deptNames[] = findByAllDep();
ArrayList db_users = (ArrayList)findByAllUser();
Hashtable online = new Hashtable();
Hashtable offline = new Hashtable();
ArrayList tmponline = null;
ArrayList tmpoffline = null;
synchronized(application)
{
String deptNames[] = (String[])application.getAttribute("deptName");
online = (Hashtable)application.getAttribute("online");
offline = (Hashtable)application.getAttribute("offline");
for(int i = 0; db_deptNames != null && i < db_deptNames.length; i++)
{
tmponline = (ArrayList)online.get(db_deptNames[i]);
tmpoffline = (ArrayList)offline.get(db_deptNames[i]);
if(tmponline == null && tmpoffline == null)
{
tmponline = new ArrayList();
tmpoffline = new ArrayList();
online.put(db_deptNames[i], tmponline);
offline.put(db_deptNames[i], tmpoffline);
}
for(int j = 0; db_users != null && j < db_users.size(); j++)
{
User user1 = (User)db_users.get(j);
tmpoffline.add(user1);
tmponline.add(user1);
}
}
application.setAttribute("deptName", db_deptNames);
application.setAttribute("online", online);
application.setAttribute("offline", offline);
}
}
public void refreshApplicationWhenAddDept(ServletContext application, String deptName)
throws Exception
{
synchronized(application)
{
String deptNames[] = (String[])application.getAttribute("deptName");
String db_deptNames[] = findByAllDep();
Hashtable online = (Hashtable)application.getAttribute("online");
Hashtable offline = (Hashtable)application.getAttribute("offline");
ArrayList tmponline = (ArrayList)online.get(deptName);
ArrayList tmpoffline = (ArrayList)offline.get(deptName);
if(tmponline == null && tmpoffline == null)
{
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
JAVA极品OA-Eclipse项目完整版.rar (1605个子文件)
checkuser.jsp.bak 9KB
userinfor.jsp.bak 3KB
web.xml.bak 2KB
index.jsp.bak 756B
runConfig.xml.bak 416B
admin20077115554160.bmp 102KB
ETCELL.cab 259KB
.classpath 2KB
menu.css 9KB
css.css 9KB
css1.css 5KB
2003.css 5KB
office2005.css 3KB
test.css 3KB
toolbars.css 2KB
toolbars.css 2KB
normal.css 1KB
normal.css 1KB
normal.css 1KB
Thumbs.db 180KB
Thumbs.db 84KB
Thumbs.db 80KB
Thumbs.db 49KB
Thumbs.db 26KB
Thumbs.db 24KB
Thumbs.db 21KB
Thumbs.db 20KB
Thumbs.db 12KB
Thumbs.db 6KB
Thumbs.db 5KB
dogjava.dll 60KB
login_body_left.gif 22KB
login_body_right.gif 13KB
top_button_04.gif 9KB
top_button_02.gif 6KB
top_button_logo2.gif 5KB
top_button_logo1.gif 5KB
loading.gif 3KB
bg.gif 2KB
reply_on3.gif 2KB
top_button_01.gif 2KB
menu_button_mid.gif 2KB
login_button_cancel.gif 1KB
login_button_login.gif 1KB
person.gif 1KB
function_reset.gif 1KB
function_printset.gif 1KB
reddot.gif 1KB
reddot.gif 1KB
reddot.gif 1KB
menu_button_left.gif 1KB
zrrc1.gif 1KB
25.gif 1KB
17.gif 1KB
function_calendar.gif 1KB
cancel_on3.gif 1KB
function_speak.gif 1KB
function_add.gif 1KB
function_search.gif 1KB
zrrc2.gif 1KB
cancel_on2.gif 1KB
reply_on2.gif 1KB
function_make.gif 1KB
function_set.gif 1KB
login_mid_bg.gif 1KB
function_other.gif 1KB
history_cancel.gif 1KB
function_back.gif 1KB
top_button_05.gif 1KB
top_button_online2.gif 1KB
top_button_online1.gif 1KB
history_close.gif 1KB
function_send.gif 1KB
history.gif 1KB
function_save.gif 1KB
function_print.gif 1KB
function_ok.gif 1KB
63.gif 1KB
login_mid_bg1.gif 1KB
menu_bg.gif 1KB
login_05.gif 1KB
function_go.gif 1KB
page_last.gif 1KB
page_last.gif 1KB
cancel.gif 1KB
page_first.gif 1KB
page_first.gif 1KB
2cancel.gif 1KB
2history_cancel.gif 1KB
2history_close.gif 1KB
zanxinicai.gif 1KB
2history.gif 1KB
page_next.gif 1KB
page_next.gif 1KB
page_prio.gif 1KB
page_prio.gif 1KB
person2.gif 1010B
top_button_address_list1.gif 1009B
top_button_address_list2.gif 1009B
send.gif 989B
共 1605 条
- 1
- 2
- 3
- 4
- 5
- 6
- 17
飘逸的风衣
- 粉丝: 2
- 资源: 15
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 555springboot + vue 线上教学平台.zip(可运行源码+数据库文件+文档)
- 554springcloud + vue 房产销售平台.zip(可运行源码+数据库文件+文档)
- 小霸王坦克游戏源码.7z
- 蓝桥杯单片机基础学习项目(LED,数码管,蜂鸣器,继电器,按键控制)
- 553springboot + vue 某银行OA系统.zip(可运行源码+数据库文件+文档)
- DatabaseWatermarkingBasedonTextFormat
- yolov8常用二维码检测检测+数据集
- -移动通信-网络课程设计与研究
- 基于Python的PCA人脸识别算法的原理及实现代码+文档详解.zip
- 甘肃移动全业务工程建设项目管理流程优化研究
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
- 3
- 4
前往页