package com.oa.serviceimpl;
import org.apache.log4j.Logger;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.oa.daoimpl.Addressbookdaoimpl;
import com.oa.daoimpl.Egressiondaoimpl;
import com.oa.daoimpl.Employeedaoimpl;
import com.oa.daoimpl.Messagesdaoimpl;
import com.oa.daoimpl.Opiniondaoimpl;
import com.oa.daoimpl.Tongxundaoimpl;
import com.oa.idao.Addressbookidao;
import com.oa.idao.Egressiondao;
import com.oa.idao.Employeedao;
import com.oa.idao.Messagesdao;
import com.oa.idao.Opiniondao;
import com.oa.idao.Tongxundao;
import com.oa.iservice.MessageServicedao;
import com.oa.pojos.Employee;
import com.oa.pojos.Messages;
import com.oa.pojos.Opinion;
public class MessagesServiceimpl implements MessageServicedao {
/**
* Logger for this class
*/
private static final Logger logger = Logger.getLogger(MessagesServiceimpl.class);
private Messagesdao messagesdao = new Messagesdaoimpl();
private Employeedao emp = new Employeedaoimpl();
private Tongxundao tongxun = new Tongxundaoimpl();
private Addressbookidao adress = new Addressbookdaoimpl();
private Opiniondao o = new Opiniondaoimpl();
private Egressiondao egression = new Egressiondaoimpl();
/*
* (non-Javadoc)
*
* @see
* com.oa.serviceimpl.MessageServicedao#MessageAdd(com.oa.pojos.Messages)
*/
public void MessageAdd(Messages obj) {
if (logger.isDebugEnabled()) {
logger.debug("MessageAdd(Messages) - start"); //$NON-NLS-1$
}
messagesdao.add(obj);
if (logger.isDebugEnabled()) {
logger.debug("MessageAdd(Messages) - end"); //$NON-NLS-1$
}
}
/*
* (non-Javadoc)
*
* @see com.oa.serviceimpl.MessageServicedao#Selectyifa()
*/
public List<Messages> Selectyifa() {
if (logger.isDebugEnabled()) {
logger.debug("Selectyifa() - start"); //$NON-NLS-1$
}
List<Messages> returnList = messagesdao.getQuery("select e from Messages e ", null);
if (logger.isDebugEnabled()) {
logger.debug("Selectyifa() - end"); //$NON-NLS-1$
}
return returnList;
}
/*
* (non-Javadoc)
*
* @see com.oa.serviceimpl.MessageServicedao#SelectYiShou()
*/
public List<Messages> SelectYiShou() {
if (logger.isDebugEnabled()) {
logger.debug("SelectYiShou() - start"); //$NON-NLS-1$
}
String hql = "select e from Messages e join e.employeeByMincept p where p.isjieshuo=?";
List<Messages> returnList = messagesdao.getQuery(hql, "有");
if (logger.isDebugEnabled()) {
logger.debug("SelectYiShou() - end"); //$NON-NLS-1$
}
return returnList;
}
/**
* 根据名称查询一个员工
*/
public Employee SelectEmp(String name) {
if (logger.isDebugEnabled()) {
logger.debug("SelectEmp(String) - start"); //$NON-NLS-1$
}
Employee returnEmployee = this.emp.getUniqueResult("select e from Employee e where e.ename=?", name);
if (logger.isDebugEnabled()) {
logger.debug("SelectEmp(String) - end"); //$NON-NLS-1$
}
return returnEmployee;
}
public Employee selectmessage(String id) {
if (logger.isDebugEnabled()) {
logger.debug("selectmessage(String) - start"); //$NON-NLS-1$
}
String hql = "select e from Employee e join e.messagesesForMincept t where t.mid='"
+ id + "'";
Employee returnEmployee = this.emp.getUniqueResult(hql, null);
if (logger.isDebugEnabled()) {
logger.debug("selectmessage(String) - end"); //$NON-NLS-1$
}
return returnEmployee;
}
public Map selectMessage(Integer page, int size,Integer eid) {
if (logger.isDebugEnabled()) {
logger.debug("selectMessage(Integer, int, Integer) - start"); //$NON-NLS-1$
}
String hql = "select e from Messages e join e.employeeByMtxd t where t.eid=?";
// 查询
List list = messagesdao.getPageQuery(hql, page, size, eid);
// 总条数
int sum = list.size();
// 总页数
int count = sum % size == 0 ? sum / size : sum / size + 1;
// 越界检查
if (page <= 1)
page = 1;
if (page >= count)
page = count;
Map map = new HashMap();
map.put("page", page);
map.put("size", size);
map.put("count", count);
map.put("list", list);
map.put("sum", sum);
if (logger.isDebugEnabled()) {
logger.debug("selectMessage(Integer, int, Integer) - end"); //$NON-NLS-1$
}
return map;
}
/**
* 修改员工
*
*/
public void updateEmp(String id) {
if (logger.isDebugEnabled()) {
logger.debug("updateEmp(String) - start"); //$NON-NLS-1$
}
Employee e = this.selectmessage(id);
System.out.println("e " + e);
e.setIsjieshuo("是");
emp.update(e);
if (logger.isDebugEnabled()) {
logger.debug("updateEmp(String) - end"); //$NON-NLS-1$
}
}
public void updateEmpone(String name) {
if (logger.isDebugEnabled()) {
logger.debug("updateEmpone(String) - start"); //$NON-NLS-1$
}
Employee e = this.SelectEmp(name);
System.out.println("e " + e);
e.setIsjieshuo("是");
emp.update(e);
if (logger.isDebugEnabled()) {
logger.debug("updateEmpone(String) - end"); //$NON-NLS-1$
}
}
public void del(String id) {
if (logger.isDebugEnabled()) {
logger.debug("del(String) - start"); //$NON-NLS-1$
}
String hql = "delete from Messages m where m.mid in" + id + "";
messagesdao.blukUpdate(hql, null);
if (logger.isDebugEnabled()) {
logger.debug("del(String) - end"); //$NON-NLS-1$
}
}
public Map SelectShouxin(Integer page, int size,Integer eid) {
if (logger.isDebugEnabled()) {
logger.debug("SelectShouxin(Integer, int, Integer) - start"); //$NON-NLS-1$
}
String hql = "select e from Messages e join e.employeeByMincept p where p.isjieshuo=? and p.eid=?";
// 查询
List list = messagesdao.getPageQuery(hql, page, size, "是",eid);
// 总条数
int sum = list.size();
System.out.println("------------- " + sum);
// 总页数
int count = sum % size == 0 ? sum / size : sum / size + 1;
// 越界检查
if (page <= 1)
page = 1;
if (page >= count)
page = count;
Map map = new HashMap();
map.put("page", page);
map.put("size", size);
map.put("count", count);
map.put("list", list);
map.put("sum", sum);
if (logger.isDebugEnabled()) {
logger.debug("SelectShouxin(Integer, int, Integer) - end"); //$NON-NLS-1$
}
return map;
}
public Map selectTongxunLu(Integer page, int size, Short id, String name) {
if (logger.isDebugEnabled()) {
logger.debug("selectTongxunLu(Integer, int, Short, String) - start"); //$NON-NLS-1$
}
String hql = "";
List list = null;
if (id == 0 || name == "") {
hql = "select t from Employee t join t.dept d where 1=1";
// 查询
list = tongxun.getPageQuery(hql, page, size, null);
}
if (id != 0) {
hql = "select t from Employee t join t.dept d where d.depid=?";
list = tongxun.getPageQuery(hql, page, size, id);
}
if (name != "") {
System.out.println("ssssssssssss");
hql = "select t from Employee t join t.dept d where t.ename like '%"
+ name + "%'";
list = tongxun.getPageQuery(hql, page, size, null);
}
// 总条数
int sum = list.size();
System.out.println("------------- " + list.size());
// 总页数
int count = sum % size == 0 ? sum / size : sum / size + 1;
// 越界检查
if (page <= 1)
page = 1;
if (page >= count)
page = count;
Map map = new HashMap();
map.put("page", page);
map.put("size", size);
map.put("count", count);
map.put("list", list);
map.put("sum", sum);
if (logger.isDebugEnabled()) {
logger.debug("selectTongxunLu(Integer, int, Short, String) - end"); //$NON-NLS-1$
}
return map;
}
/**
* 公共通讯录
*/
public Map SelectGongTongxun(Integer page, int size, Stri
没有合适的资源?快使用搜索试试~ 我知道了~
MyOA.rar_myoa
共394个文件
jar:71个
class:70个
java:70个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 44 浏览量
2022-09-14
17:30:15
上传
评论
收藏 19.59MB RAR 举报
温馨提示
基于Struts2+hibernate+Srping的华天动力系统
资源推荐
资源详情
资源评论
收起资源包目录
MyOA.rar_myoa (394个子文件)
Userservice.class 16KB
MessagesServiceimpl.class 15KB
WebHelp.class 11KB
MessagesAction.class 10KB
NavigateAction.class 7KB
Employee.class 7KB
BaseDao.class 5KB
Addressbookdaoimpl.class 5KB
Filerundaoimpl.class 5KB
Egressiondaoimpl.class 5KB
Urlhostdaoimpl.class 5KB
Messagesdaoimpl.class 5KB
Employeedaoimpl.class 5KB
Purviewdaoimpl.class 5KB
Opiniondaoimpl.class 5KB
Tongxundaoimpl.class 5KB
Kaoqingdaoimpl.class 5KB
TongxunAction.class 5KB
Roleesdaoimpl.class 4KB
Deptdaoimpl.class 4KB
Runtimes.class 4KB
Util.class 4KB
AdressTongxunAction.class 4KB
KaoQingAction.class 4KB
OpinionAction.class 3KB
UrlHostAction.class 3KB
HibernateSessionFactory.class 3KB
EmpAction.class 3KB
JosnContxt.class 3KB
Messages.class 3KB
UserAction.class 3KB
Addressbook.class 2KB
Purview.class 2KB
Egression.class 2KB
OpenSessionInViewFilter.class 2KB
Kaoqing.class 2KB
Dept.class 2KB
EgressionAction.class 2KB
AdressTongxunOv.class 2KB
Uservicedao.class 2KB
MyInvocationHandler.class 2KB
Rolees.class 2KB
Filerun.class 2KB
EgressionOv.class 2KB
Tongxun.class 2KB
Econding.class 2KB
SelectMessageOv.class 2KB
KaoqingOv.class 1KB
ServiceFactory.class 1KB
Urlhouse.class 1KB
MessageServicedao.class 1KB
MessagesOv.class 1KB
PowerIntercept.class 1KB
TongxunOv.class 1KB
DividePageOv.class 1KB
Opinion.class 1KB
UrlhostOv.class 1KB
Addressbookidao.class 1KB
Filerundao.class 1KB
Egressiondao.class 1KB
Urlhostdao.class 1KB
Employeedao.class 1KB
Messagesdao.class 1KB
Tongxundao.class 1KB
Opiniondao.class 1KB
Purviewdao.class 1KB
Kaoqingdao.class 1KB
Roleesdao.class 1KB
Deptdao.class 1KB
Lonin.class 927B
.classpath 6KB
org.eclipse.wst.jsdt.ui.superType.container 49B
oa.css 6KB
public.css 2KB
styles.css 1KB
dtree.css 795B
Thumbs.db 39KB
index.gif 49KB
url.gif 41KB
globe.gif 1KB
globe.gif 1KB
trash.gif 1KB
trash.gif 1KB
question.gif 1KB
question.gif 1KB
base.gif 1KB
base.gif 1KB
page_tools_bar.gif 991B
nolines_plus.gif 870B
nolines_plus.gif 870B
nolines_minus.gif 861B
nolines_minus.gif 861B
musicfolder.gif 633B
musicfolder.gif 633B
imgfolder.gif 622B
imgfolder.gif 622B
page.gif 582B
page.gif 582B
folderopen.gif 376B
folderopen.gif 376B
共 394 条
- 1
- 2
- 3
- 4
资源评论
APei
- 粉丝: 65
- 资源: 1万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功