Commit e9c018a3 by 罗绍泽

新增我的任务

parent b3b4931b
...@@ -114,4 +114,8 @@ ...@@ -114,4 +114,8 @@
<bean id="ProcdefiChooseDeptBusiness" class="com.gaowj.business.procdefiChooseDept.ProcdefiChooseDeptBusinessImpl"> <bean id="ProcdefiChooseDeptBusiness" class="com.gaowj.business.procdefiChooseDept.ProcdefiChooseDeptBusinessImpl">
<property name="procdefiChooseDeptDAO" ref="procdefiChooseDeptDAO"></property> <property name="procdefiChooseDeptDAO" ref="procdefiChooseDeptDAO"></property>
</bean> </bean>
<bean id="ProctaskBusiness" class="com.gaowj.business.proctask.ProctaskBusinessImpl">
<property name="taskService" ref="taskService"></property>
</bean>
</beans> </beans>
...@@ -309,4 +309,7 @@ ...@@ -309,4 +309,7 @@
} }
.icon-ext-02_22{ .icon-ext-02_22{
background:url('../../../../images/icons/(02,22).png') no-repeat left center; background:url('../../../../images/icons/(02,22).png') no-repeat left center;
}
.icon-ext-07_35{
background:url('../../../../images/icons/(07,35).png') no-repeat left center;
} }
\ No newline at end of file
...@@ -122,11 +122,17 @@ function formatMenu(value, data,index) { ...@@ -122,11 +122,17 @@ function formatMenu(value, data,index) {
//上浮横向菜单集里的具体菜单项(需更改) //上浮横向菜单集里的具体菜单项(需更改)
function getOptionMenu(data,index){ function getOptionMenu(data,index){
var returnData= "<span class=\"icon-edit\" style=\"padding-left:20px;*width:20px;\"></span><a href=\"javascript:void(0);\" onclick=\"showProcinstanceImg('" var returnData=[];
+ index + "')\">流程图</a> | <span class=\"icon-ext-file\" style=\"padding-left:20px;*width:20px;\"></span><a href=\"javascript:void(0);\" onclick=\"deploy('" var editBtn="<span class=\"icon-edit\" style=\"padding-left:20px;*width:20px;\"></span><a href=\"javascript:void(0);\" onclick=\"showProcinstanceImg('"
+ index + "')\">部署</a> | <span class=\"icon-clear\" style=\"padding-left:20px;*width:20px;\"></span><a href=\"javascript:void(0);\" onclick=\"deleteRow('" + index + "')\">处理</a>";
var delBtn="<span class=\"icon-edit\" style=\"padding-left:20px;*width:20px;\"></span><a href=\"javascript:void(0);\" onclick=\"showProcinstanceImg('"
+ index + "')\">删除</a>"; + index + "')\">删除</a>";
return returnData; var procinstanceImgBtn="<span class=\"icon-edit\" style=\"padding-left:20px;*width:20px;\"></span><a href=\"javascript:void(0);\" onclick=\"showProcinstanceImg('"
+ index + "')\">进度</a>";
returnData.push(editBtn);
returnData.push(delBtn);
returnData.push(procinstanceImgBtn);
return returnData.join(" | ");
} }
//返回菜单集的菜单个数(需更改) //返回菜单集的菜单个数(需更改)
......
//此乃本模块与后台交互的方法接口部分
var proctaskModule = function(format) {
this.module = "";
this.action = "";
this.format = format;
};
//定义数据交互
proctaskModule.prototype = BusinessObject;
//插入流程实例
proctaskModule.prototype.insertInfo = function(){};
//修改流程实例
proctaskModule.prototype.updateInfo = function(){};
//删除流程实例
proctaskModule.prototype.deleteInfo = function(){};
//创建一个数据操作对象,然后再后续使用
proctaskModule.act = new proctaskModule("json").delegate("proctaskAct");
//创建一个数据获取对象,然后再后续使用
proctaskModule.data = new proctaskModule("json").delegate("proctaskData");
//说明: 1、所有方法里统一传递josn格式的参数,用于后台交互,如data.listTables(param) ,如没有参数则传'{}',如data.listTables({})
// 2、前后台数据获取传输协议 如:json[{'0':{pageCount':'2','pageNo':'1','pageSize':'20','rowSet':'[{0},{1}....]'}}]
// 3、前后台增删改的返回状态 如:json[{'0':{'rowSet':{'NAME':'-1','VALUE':'保存失败'}}}]
<%@page contentType="text/html; charset=UTF-8"%>
<%@ include file="/gaowj/header-simple-1.0.jsp"%>
<div id="procinstanceTab">
<link rel="stylesheet" type="text/css" href="${ctx}/jwapp/common/css/content_body.css" charset="utf-8"></link>
<link rel="stylesheet" type="text/css" href="${ctx}/jwapp/common/css/content_table.css" charset="utf-8"></link>
<link rel="stylesheet" type="text/css" href="${ctx}/jwapp/common/css/content_input.css" charset="utf-8"></link>
</div>
<table id="list" style="width: 100%; height: 100%;"></table>
<div id="tb">
<form id="procinstanceTab_searchForm" style="float:left">
流程: <input class="easyui-textbox" id="FIELD_PROCDEFINITION_UUID" name="FIELD_PROCDEFINITION_UUID" style="width:200px"/>&nbsp;&nbsp;
</form>
<a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-search',plain:true" onclick="javascript:searchRow()">查询</a>
<a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-ext-advsearch',plain:true" onclick="javascript:advsearchRow()">高级查询</a>
<a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true" onclick="javascript:refreshRow()">刷新</a>
<a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true" onclick="javascript:addRow()">新增</a>
<a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-clear',plain:true" onclick="javascript:deleteBatchRow()">删除</a>
<a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-ext-file',plain:true" onclick="javascript:uploadcommonBatchRow()">附件</a>
</div>
<div id="detail" style="overflow:auto;"></div>
<script type="text/javascript" src="${ctx}/jwapp/pages/standard/js/jwStandardModule.js" charset="utf-8"></script>
<script type="text/javascript" src="${ctx}/process/pages/proctask/js/proctaskModule.js" charset="utf-8"></script>
<script type="text/javascript" src="${ctx}/process/pages/proctask/js/proctaskTab.js" charset="utf-8"></script>
...@@ -104,5 +104,22 @@ ...@@ -104,5 +104,22 @@
<param name="bufferSize">1024</param> <param name="bufferSize">1024</param>
</result> </result>
</action> </action>
<action name="proctaskView_*" class="com.gaowj.proctask.action.viewAction"
method="{1}">
<result name="{1}">/process/pages/proctask/{1}.jsp</result>
</action>
<action name="proctaskAct_*" class="com.gaowj.proctask.action.actAction"
method="{1}">
<result name="json" type="json">
<param name="root">jsonObject</param>
</result>
</action>
<action name="proctaskData_*" class="com.gaowj.proctask.action.dataAction"
method="{1}">
<result name="json" type="json">
<param name="root">jsonObject</param>
</result>
</action>
</package> </package>
</struts> </struts>
...@@ -14,7 +14,7 @@ public class AssignmentTaskListener implements TaskListener { ...@@ -14,7 +14,7 @@ public class AssignmentTaskListener implements TaskListener {
@Override @Override
public void notify(DelegateTask task) { public void notify(DelegateTask task) {
/*System.out.println(task.getAssignee()); System.out.println(task.getAssignee());
System.out.println(task.getCategory()); System.out.println(task.getCategory());
System.out.println(task.getDescription()); System.out.println(task.getDescription());
System.out.println(task.getEventName()); System.out.println(task.getEventName());
...@@ -29,7 +29,7 @@ public class AssignmentTaskListener implements TaskListener { ...@@ -29,7 +29,7 @@ public class AssignmentTaskListener implements TaskListener {
System.out.println(task.getProcessInstanceId()); System.out.println(task.getProcessInstanceId());
System.out.println(task.getTaskDefinitionKey()); System.out.println(task.getTaskDefinitionKey());
System.out.println(task.getTenantId()); System.out.println(task.getTenantId());
System.out.println(task.getVariables().toString());*/ System.out.println(task.getVariables().toString());
task.setAssignee(SessionUtil.getCode()); task.setAssignee(SessionUtil.getCode());
// //
......
package com.gaowj.business;
import java.util.Map;
import org.springframework.stereotype.Service;
import com.gaowj.business.exception.BusinessException;
import com.gaowj.business.util.Page;
@Service
public interface ProctaskBusiness {
/**
* 分页获取记录
*
* @param entity
* @throws BusinessException
*/
Page<Map<String, Object>> list_proc_task(int pageNo, int pageSize, Map<String, Object> query) throws BusinessException;
}
package com.gaowj.business.proctask;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.activiti.engine.TaskService;
import org.activiti.engine.task.Task;
import org.activiti.engine.task.TaskQuery;
import com.gaowj.business.ProctaskBusiness;
import com.gaowj.business.exception.BusinessException;
import com.gaowj.business.util.Page;
import com.gaowj.business.util.SessionUtil;
public class ProctaskBusinessImpl implements ProctaskBusiness {
private TaskService taskService;
public TaskService getTaskService() {
return taskService;
}
public void setTaskService(TaskService taskService) {
this.taskService = taskService;
}
@Override
public Page<Map<String, Object>> list_proc_task(int pageNo, int pageSize, Map<String, Object> query) throws BusinessException {
Page<Map<String, Object>> page = new Page<Map<String, Object>>();
// 计算起始记录
int pageStart = (pageNo - 1) * pageSize;
TaskQuery taskQuery=taskService.createTaskQuery().taskAssignee(SessionUtil.getCode());
page.setStart(pageStart);
page.setLimit(pageSize);
page.setCount((int)taskQuery.count());
List<Task> list = taskQuery.orderByTaskCreateTime().asc().listPage(pageStart, pageSize);
List<Map<String,Object>> items=new ArrayList<Map<String,Object>>();
for(Task task:list){
Map<String,Object> map=new HashMap<String, Object>();
items.add(map);
map.put("createTime", task.getCreateTime());
map.put("executionId", task.getExecutionId());
}
page.setItems(items);
return page;
}
}
package com.gaowj.proctask.action;
import com.gaowj.business.action.BasicAction;
public class actAction extends BasicAction{
/**
*
*/
private static final long serialVersionUID = -4062030374955033260L;
}
package com.gaowj.proctask.action;
import java.sql.SQLException;
import java.text.ParseException;
import java.util.HashMap;
import java.util.Map;
import com.gaowj.business.ProcinstanceBusiness;
import com.gaowj.business.ProctaskBusiness;
import com.gaowj.business.action.BasicAction;
import com.gaowj.business.comp.BusinessManager;
import com.gaowj.business.exception.BusinessException;
import com.gaowj.business.util.Page;
import com.gaowj.business.util.QueryParamUtil;
import com.gaowj.business.util.RequestUtils;
import net.sf.json.JSONObject;
public class dataAction extends BasicAction{
/**
*
*/
private static final long serialVersionUID = 7116947652619171108L;
private JSONObject jsonObject = new JSONObject();
private int rows = 20;// 每页显示的记录数
private int page = 1;// 当前第几页
public JSONObject getJsonObject() {
return jsonObject;
}
public void setJsonObject(JSONObject jsonObject) {
this.jsonObject = jsonObject;
}
public int getRows() {
return rows;
}
public void setRows(int rows) {
this.rows = rows;
}
public int getPage() {
return page;
}
public void setPage(int page) {
this.page = page;
}
/**
* 分页获取记录
* @param entity
* @throws BusinessException
*/
public String list() throws BusinessException {
ProctaskBusiness business = BusinessManager.getBusiness(ProctaskBusiness.class);
Map<String, Object> query = RequestUtils.getUpdateFieldMap(request,RequestUtils.UPDATEDATAFIELDPREFIX);
try {
query = QueryParamUtil.StringToDate(query);
Page<Map<String, Object>> pageRows = business.list_proc_task(pageNo,pageSize, query);
setPageCount((pageRows.getCount() - 1) / pageSize + 1);
Map<String, Object> data = new HashMap<String, Object>();
data.put("rowSet", QueryParamUtil.DateTimeToString(pageRows.getItems()));
data.put("pageNo", pageNo);
data.put("pageSize", pageSize);
data.put("pageCount", pageCount);
data.put("rows", data.get("rowSet"));
data.put("total", pageRows.getCount());
jsonObject = new JSONObject();
jsonObject.putAll(data);
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (ParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return "json";
}
}
package com.gaowj.proctask.action;
import com.gaowj.business.action.BasicAction;
import com.gaowj.business.exception.BusinessException;
public class viewAction extends BasicAction{
/**
*
*/
private static final long serialVersionUID = 388673018812505782L;
public String proctaskTab() throws BusinessException{
return "proctaskTab";
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment