如何用java写一个呼叫中心系统(上)

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

java的功能很强大。今天牛蛙网络就教大家如何用java写一个呼叫中心系统代码如下packagecom.hollycrm.fjunicom.reserve.impl;importjava.text.SimpleDateFormat;importjava.util.ArrayList;importjava.util.Collection;importjava.util.Date;importjava.util.HashSet;importjava.util.Iterator;importjava.util.List;importjava.util.Set;importjavax.servlet.http.HttpServletRequest;importnet.sf.hibernate.HibernateException;importnet.sf.hibernate.Query;importnet.sf.hibernate.Session;importorg.springframework.orm.hibernate.HibernateCallback;importorg.springframework.orm.hibernate.HibernateTemplate;importorg.springframework.orm.hibernate.support.HibernateDaoSupport;importcom.hollycrm.fjunicom.reserve.Page;importcom.hollycrm.fjunicom.reserve.ReserveConstant;importcom.hollycrm.fjunicom.reserve.model.IReserveSheetDeal;importcom.hollycrm.fjunicom.reserve.model.ReserveSheetDealInfo;importcom.hollycrm.fjunicom.reserve.model.ReserveSheetInfo;importcom.hollycrm.fjunicom.reserve.service.ReserveSheetService;importcom.hollycrm.fjunicom.reserve.utils.ReserveUtils;importcom.hollycrm.fjunicom.reserve.web.AcceptReserverSheetForm;importcom.hollycrm.fjunicom.reserve.web.ReserveSheetForm;importcom.hollycrm.springframework.factory.DefaultBeanFactory;importcom.hollycrm.unicom.BeanResource;importcom.hollycrm.unicom.common.PageViewObject;importcom.hollycrm.unicom.security.AuthToken;importcom.hollycrm.unicom.sequenceservice.SequenceManager;importcom.hollycrm.unicom.sheet.SheetException;importcom.hollycrm.unicom.sheet.code.CodeManager;importcom.hollycrm.unicom.sheet.domain.SmsSend;importcom.hollycrm.unicom.usersupport.Department;importcom.hollycrm.unicom.usersupport.Right;importcom.hollycrm.unicom.usersupport.Role;importcom.hollycrm.unicom.usersupport.User;importcom.hollycrm.unicom.usersupport.hibernate.HibernateUserSupportHelper;publicclassReserveSheetServiceImplextendsHibernateDaoSupportimplementsReserveSheetService{publicvoidsaveObject(Objectobj)throwsHibernateException{HibernateTemplateht=getHibernateTemplate();ht.save(obj);}publicObjectgetObject(StringobjId,ClassobjClass){HibernateTemplateht=getHibernateTemplate();returnht.load(objClass,objId);}publicvoidsaveOrUpdate(Objectobj){HibernateTemplateht=getHibernateTemplate();ht.saveOrUpdate(obj);}publicPageViewObjectquerySheet(finalStringhql,finalintcurrentPage,finalintperPageCount)throwsSheetException{HibernateTemplatetemplate=getHibernateTemplate();return(PageViewObject)template.execute(newHibernateCallback(){publicObjectdoInHibernate(Sessionsession)throwsHibernateException{QueryqueryCount=session.createQuery(selectcount(sheet)+hql);QueryqueryObj=session.createQuery(selectsheet+hql);returngetOnePageResult(session,queryCount,queryObj,hql,currentPage,perPageCount);}});}publicPageViewObjectgetOnePageResult(Sessionsession,QueryqueryCount,QueryqueryObj,Stringhql,intcurrentPage,intperPageCount)throwsHibernateException{PageViewObjectpageViewObject=newPageViewObject();ListcountList=queryCount.list();inttotalSize=countList.isEmpty()?0:((Integer)countList.get(0)).intValue();if(perPageCount==0)perPageCount=totalSize;queryObj.setFirstResult(perPageCount*((currentPage==0)?0:currentPage-1));queryObj.setMaxResults(perPageCount);Listresults=queryObj.list();pageViewObject.setRowList(results);pageViewObject.setTotalCount(totalSize);pageViewObject.setPerPageCount(perPageCount);returnpageViewObject;}//工单池查询addbyzhangmengpublicListgetReserveSheetList(finalStringdeptID,finalStringstatus,Pagepage,finalReserveSheetFormform,finalAuthTokenauthToken){HibernateTemplateht=getHibernateTemplate();finalintpageMin=(Integer.parseInt(page.getCurrentPage())-1)*Integer.parseInt(page.getPageSize())+1;finalintpageSize=Integer.parseInt(page.getPageSize());return(List)ht.execute(newHibernateCallback(){/***doInHibernate**@paramsession*Session*@returnObject*@throwsHibernateException*/publicObjectdoInHibernate(Sessionsession)throwsHibernateException{returnReserveSheetServiceImpl.findQueryReserveList(session,getHibernateTemplate(),pageSize,pageMin,deptID,status,form,authToken);}});}protectedstaticObjectfindQueryReserveList(Sessionsession,HibernateTemplateht,intpageMax,intpageMin,StringdeptID,Stringstatus,ReserveSheetFormform,AuthTokenauthToken)throwsHibernateException{StringBuffersql=newStringBuffer();sql.append(fromReserveSheetInforwherer.categoryID='20');if(status!=null&&status.equals(ReserveConstant.SHEET_STATUS_RETURN)){sql.append(andr.tradeCenterName='+deptID+');}else{sql.append(and(r.handleDept='+deptID+'orr.tradeCenterName='+deptID+'));}if(status!=&&status!=null&&!status.equals(null)){sql.append(andr.status='+status.trim()+');}if(status==null){sql.append(andr.status='*');}if(ReserveConstant.SHEET_STATUS_RETURN==status||ReserveConstant.SHEET_STATUS_RETURN.equals(status)){Listrights=authToken.getRights();if(rights.contains(ReserveConstant.TRADE_CENTER_CHANNEL_10)){sql.append(andr.acceptChannel='+ReserveConstant.TRADE_CENTER_CHANNEL_10+');}elseif(rights.contains(ReserveConstant.TRADE_CENTER_CHANNEL_18)){sql.append(andr.acceptChannel='+ReserveConstant.TRADE_CENTER_CHANNEL_18+');}els

1 / 17
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功