系统工作流管理:
概述:系统采用JBPM4.3作为工作流引擎
所有流程的处理都从我的代办任务页面进入。
表单审批页面的审核按钮为动态生成:
在你Action中跳转到审核页面中你会这么写:
this.transitions =this.tasksManager.getTransitionsByTaskId(taskId);
页面中为:
<s:iteratorvalue="transitions"status="stat">
<button onclick="javascript:ck('<s:propertyvalue="name"/>')"class="sexybutton sexysimple sexyblue"id="accept">转至[<s:propertyvalue="destination.name"/>]
</button>
</s:iterator>
具体请参看:web----hr----TravelyApplyAction中auditForward方法以及audit方法
<button onclick="javascript:showDialog();return false; "class="sexybutton"><span><span><spanclass="flow">查看流程图</span></span></span></button>
可以在审核按钮旁边放上这个链接,并加入
Javascript方法:
function showDialog(){
window.open ('${ctx}/workflow/processDefinition!showFlowImage.action?taskId=${task.id}','newwindow', 'height=650, width=650, top=10, left=200, toolbar=no, menubar=no,resizable=yes,location=no, status=no');
}
供审核人查看流程图以及流程处理过程中的信息。
系统提供三种消息提醒方式,分别为:站内信提醒,email提醒和手机短信提醒。
三个类分别为:MessageInRemind.java,EmailRemind.java,PhoneMessageRemind.java.
都实现接口:IRemindType.java在填写流程表单页面,可以加入:
在Action 中加入:
private Map<String,String>redmindTypeMap = SysConstants.getRemindTypeMap();
并加入get方法:
<divid="tixing"style="text-align:left">
任务提醒方式:
<s:checkboxlistname="remindTypes"list="redmindTypeMap"listKey="value"listValue="key"value="remindTypes"theme="simple"/>
</div>
其后的处理请参看TravelApplyAction中的audit方法。
主要是在asiignment中写入:
String reminds =(String)execution.getVariable("remindTypes");
Class<IRemindType> remind =(Class<IRemindType>) Class.forName(clazz);
IRemindType rt =remind.newInstance();
rt.remind("系统提醒您…..",u);
系统提供基于PDF的打印功能:基于 iText
在需要打印的地方加入:
<a href="${ctx}/common/print!print.action?id=${id}&type=com.hjc.entity.hr.WorkSummary&template=worksummary.tpl"title="打印"><imgsrc="${ctx }/images/icons/printer.png"alt="打印 "/></a>
其中type为要打印的实体类型,id为实体ID值,template为打印模版(freemarker)。
然后在reportTpl文件夹下创建模版:
使用freemarker创建模版,支持CSS,注意:在文件过多时候打印时候不能自动换行,需要加入:
<div style="width:100%;word-break:break-all; overflow:auto;"> </div>
将以上代码作为文字的父容器。
系统提供定时调度的功能:基于spring squartz
你只需要在spring的配置文件中(applicationContext-job.xml)中参考已有配置,参考quartz的表达式文档,使用合适的表达式即可。
页面结构:
所有的查询页面有相同的结构:
<%@ pagecontentType="text/html;charset=UTF-8"%>
<%@ includefile="/common/header.jsp"%>
<head>
<script type="text/javascript"src="${ctx }/js/ext/UserSettingWindow.js"></script>
<script type="text/javascript"src="${ctx }/js/ext/extMessage.js"></script>
</head>
<body></body>
<bodystyle="margin-left:4px">
<div id="Navgtion">
</div>
<form name=”mainFrom”>
<div id="QueryPanel">
<legend class="small"align=left>
<b>查询</b>
</legend>
<table width="100%"class="TableList"align="left">
</table>
</div>
<div id="ActionPanel">
<button class="sexybutton"id="add"><span><span><spanclass="add">录入本周工作日记</span></span></span></button>
…………
</div>
<divid="TablePanel">
<table width="98%"class="bg"border=1cellspacing=0id="theObjTable">
</table>
</div>
<%@ includefile="/common/msg.jsp"%>
<%@ includefile="/common/pages.jsp"%>
<%@ includefile="/common/footer.jsp"%>
<%@ includefile="/common/bottom.jsp"%>
</form>
所有的查询页面都需要引入:ext的相关文件,以及
<%@ includefile="/common/bottom.jsp"%>
按钮样式采用 sexy button 样式库。
其它说明
JSON: 采用JsonLib 提供Strut2Utils类,ajax返回通常采用这个类
DateUitl:提供获取日期以及日期转换等方法
ReflectionUtils:提供反射的常用封装
EncodeUtils:编码常用类
编码规约:
所有的包名,类名,文件名都只采用英文全写的方式,比如实体类名为user ,则对应的DAO方法为userDAO,action为userAction页面为 user.jsp user-input.jsp
尽量采用已有的包,而不是自己随意建包,注意:你所建的任何一个Package,任何一个Class,任何一个jsp都影响着本系统未来的维护者。所以请慎重!