package com.etop.action;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.struts2.ServletActionContext;
import org.jbpm.api.ExecutionService;
import org.jbpm.api.ProcessEngine;
import org.jbpm.api.ProcessInstance;
import org.jbpm.api.RepositoryService;
import org.jbpm.api.TaskService;
import com.etop.model.Employeeleave;
import com.etop.model.LeaveModel;
import com.etop.service.EmployeeleaveService;
import com.etop.service.ILoginService;
import com.etop.serviceimpl.ManagerServiceImpl;
import com.etop.util.ExtHelper;
public class LesAction extends BaseAction {
private ProcessEngine processEngine; //启动流程引擎
public ProcessEngine getProcessEngine() {
return processEngine;
}
public void setProcessEngine(ProcessEngine processEngine) {
this.processEngine = processEngine;
}
private RepositoryService repositoryService;//用于发布流程
private ExecutionService executionService;//用于执行流程
private TaskService taskService ;//主要目的是提供对任务列表的访问途径
private void init()
{
repositoryService=processEngine.getRepositoryService();
executionService=processEngine.getExecutionService();
taskService=processEngine.getTaskService();
}
EmployeeleaveService IEmployeeleaveservice;
Employeeleave emp;
public Employeeleave getEmp() {
return emp;
}
public void setEmp(Employeeleave emp) {
this.emp = emp;
}
public EmployeeleaveService getIEmployeeleaveservice() {
return IEmployeeleaveservice;
}
public void setIEmployeeleaveservice(EmployeeleaveService IEmployeeleaveservice) {
this.IEmployeeleaveservice = IEmployeeleaveservice;
}
private String menuString;
public String getMenuString() {
return menuString;
}
public void setMenuString(String menuString) {
this.menuString = menuString;
}
public ILoginService ILoginservice;
public ILoginService getILoginservice() {
return ILoginservice;
}
public void setILoginservice(ILoginService iLoginservice) {
ILoginservice = iLoginservice;
}
String id;
String executionId;
public String getExecutionId() {
return executionId;
}
public void setExecutionId(String executionId) {
this.executionId = executionId;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
ManagerServiceImpl IManagerservice;
public ManagerServiceImpl getIManagerservice() {
return IManagerservice;
}
public void setIManagerservice(ManagerServiceImpl IManagerservice) {
this.IManagerservice = IManagerservice;
}
/**用于用户执行任务之前填写相关信息
* @return none
*/
public String userSubmit(){
String yz=null;
String name=(String) ServletActionContext.getRequest().getSession().getAttribute("userName");
System.out.println("sssssssss");
System.out.println(ILoginservice.getUser(name).getType());
if(ILoginservice.getUser(name).getType().equals("user"))
{// menuString="{\"success\":true,data:[{\"clericalworkname\":\""+IManagerservice.getManger().getClericalwork()+"\",\"success\":true}]";
yz="1";
menuString="[{\"boss\":\""+IManagerservice.getManger().getBoss()
+"\",\"dept\":\""+ IManagerservice.getManger().getDept()+"\",\"clericalwork\":\""+
IManagerservice.getManger().getClericalwork()+"\",\"manager\":\""+ IManagerservice.getManger().getManager()+"\",\"success\":true,\"yz\":\""+yz+"\"}]";
System.out.println(menuString);
outJson(menuString);
}else
{
String type=(String) ServletActionContext.getRequest().getSession().getAttribute("type");
if(type.equals("department"))
{
yz="2";
}
else if(type.equals("manager"))
{
yz="3";
}
else if
(type.equals("works"))
{ yz="4";}
else if(type.equals("boss"))
{
yz="5";
}
System.out.println(id+"+++++++++"+executionId);
Employeeleave emp=IEmployeeleaveservice.byId(executionId);//,\"why\":\""+emp.getBossopinion()+"\"
String str=",\"b\":\""+emp.getB()+"\",\"bossname\":\""+emp.getBossname()+"\",\"bossopinion\":\""+emp.getBossopinion()+"\",\"c\":\""+emp.getC()+"\"" +
",\"clericalworkname;\":\""+emp.getClericalworkname()+"\",\"clericalworkopinion\":\""+emp.getClericalworkopinion()+"\",\"days\":\""+emp.getDays()+"\"" +
",\"department\":\""+emp.getDepartment()+"\",\"deptemtpinion\":\""+emp.getDeptemtpinion()+"\",\"deptname\":\""+emp.getDeptname()+"\"" +
",\"endtime\":\""+emp.getEndtime()+"\",\"executionId\":\""+emp.getExecutionId()+"\",\"id\":\""+emp.getId()+"\",\"j\":\""+emp.getJ()+"\"" +
",\"managername\":\""+emp.getManagername()+"\",\"manageropinion\":\""+emp.getManageropinion()+"\",\"n\":\""+emp.getN()+"\",\"q\":\""+emp.getQ()+"\"" +
",\"s\":\""+emp.getS()+"\",\"sa\":\""+emp.getSa()+"\",\"sex\":\""+emp.getSex()+"\",\"starttime\":\""+emp.getStarttime()+"\",\"user\":\""+emp.getUser()+"\"" +
",\"username\":\""+emp.getUsername()+"\",\"userNo\":\""+emp.getUserNo()+"\",\"why\":\""+emp.getWhy()+"\"";
menuString="[{\"boss\":\""+IManagerservice.getManger().getBoss()
+"\",\"dept\":\""+ IManagerservice.getManger().getDept()+"\",\"clericalwork\":\""+
IManagerservice.getManger().getClericalwork()+"\",\"manager\":\""+ IManagerservice.getManger().getManager()+"\",\"success\":true,\"yz\":\""+yz+"\"" +
str+"}]";
System.out.println(menuString);
outJson(menuString);
}
return NONE;
}
/** 用于提交表单相关信息和执行流程信息
* @return none
*/
@SuppressWarnings("unchecked")
public String SubmitForm()
{ init();
String name=(String) ServletActionContext.getRequest().getSession().getAttribute("userName");
String type=(String) ServletActionContext.getRequest().getSession().getAttribute("type");
if(ILoginservice.getUser(name).getType().equals("user"))
{
Map map = new HashMap();
map.put("day", emp.getDays());
System.out.println("提交完毕"+id);
taskService.setVariables(id,map);
taskService.completeTask(id);
// taskService.completeTask(id, map);
emp.setExecutionId(executionId);
emp.setUserNo(ILoginservice.getUser(name).getId().toString());
IEmployeeleaveservice.addEmployeeleave(emp);
outJson("{success:true}");
}
else
{ System.out.println(emp.getDeptemtpinion());
emp.setExecutionId(executionId);
emp.setUserNo(ILoginservice.getUser(name).getId().toString());
if(type.equals("department")){
System.out.println("ddddddddddddddddd"+taskService.findPersonalTasks("department").get(0).getActivityName());
String tt="yes";
if(emp.getDeptemtpinion().equals("不同意")){
tt="no";
}
taskService.completeTask(id,tt);
IEmployeeleaveservice.updateEmployeeleave(emp);
outJson("{success:true}");
}
else if(type.equals("manager"))
{ taskService.completeTask(id,emp.getManageropinion());
IEmployeeleaveservice.updateEmployeeleave(emp);
outJson("{success:true}");}
else if(type.equals("works"))
{ taskService.completeTask(id,emp.getClericalworkopinion());
IEmployeeleaveservice.updateEmployeeleave(emp);
outJson("{success:true}");}
else if(type.equals("boss"))
{ taskService.completeTask(id,emp.getBossopinion());
IEmployeeleaveservice.updateEmployeeleave(emp);
outJson("{success:true}");}
else{outJson("{success:false}");}
}
return NONE;
}
public String getHistory()
{String name=(String) ServletActionContext.getRequest().getSession().getAttribute("userName");
List l=new ArrayList();
if(ILoginservice.getUser(name).getType().equals("user"))
{ l=IEmployeeleaveservice.getEmployeeleave(ILoginservice.getUser(name).getId().toString());
String jsonString = ExtHelper.getJsonFromList(l) ;
System.out.println("jsonString:"+jsonString);
outJson(jsonString);
}
else
{
l=IEmployeeleaveservice.getEmployeeleaveList();
String jsonString = ExtHelper.getJsonFromList(l) ;
System.out.println("jsonString:"+jsonString);
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
JBPM4 SSH EXTJS JBPM SSH EXTJS JBPM4 SSH EXTJS JBPM SSH EXTJS JBPM4 SSH EXTJS JBPM SSH EXTJS JBPM4 SSH EXTJS JBPM SSH EXTJS 希望对大家有帮助。
资源推荐
资源详情
资源评论
收起资源包目录
JBPM4 SSH EXTJS JBPM SSH EXTJS (743个子文件)
LesAction.class 9KB
LeaveAction.class 7KB
FlowAction.class 7KB
Employeeleave.class 6KB
LeaveModel.class 5KB
LoginAction.class 4KB
LoginImpl.class 2KB
EmployeeleaveImpl.class 2KB
LeaveDaoImpl.class 2KB
EmployeeleaveServiceImpl.class 2KB
Managertable.class 2KB
Userinfo.class 2KB
LoginServiceImpl.class 1KB
BaseAction.class 1KB
ExtHelper.class 1KB
Instance.class 1KB
Definition.class 1KB
Task.class 896B
ManagerImpl.class 856B
ManagerServiceImpl.class 808B
TotalJson.class 735B
EmployeeleaveService.class 569B
IEmployeeleaveDao.class 559B
Ttest.class 505B
FolwUtil.class 437B
Test.class 409B
ILoginService.class 405B
ILoginDao.class 375B
ILeaveDao.class 287B
UserLeave.class 282B
IManagerService.class 182B
IManagerDao.class 170B
.classpath 6KB
ext-all.css 140KB
ext-all-notheme.css 102KB
xtheme-blue.css 38KB
grid.css 11KB
form.css 10KB
button.css 8KB
panel.css 7KB
tabs.css 7KB
grid.css 6KB
panel-reset.css 6KB
toolbar.css 6KB
core.css 5KB
layout.css 5KB
date-picker.css 5KB
tree.css 4KB
tree.css 4KB
window.css 3KB
menu.css 3KB
resizable.css 3KB
editor.css 3KB
toolbar.css 3KB
date-picker.css 3KB
tabs.css 3KB
qtips.css 3KB
form.css 2KB
button.css 2KB
slider.css 2KB
panel.css 2KB
window.css 2KB
menu.css 2KB
resizable.css 2KB
list-view.css 2KB
core.css 2KB
box.css 1KB
box.css 1KB
layout.css 1KB
qtips.css 1KB
dialog.css 1KB
borders.css 1KB
dd.css 1KB
combo.css 887B
dialog.css 836B
list-view.css 804B
combo.css 785B
progress.css 727B
dd.css 658B
progress.css 648B
slider.css 647B
debug.css 552B
borders.css 548B
debug.css 488B
reset.css 463B
reset-min.css 463B
editor.css 307B
style.css 233B
default_pic.gif 8KB
default_pic.gif 8KB
tool-sprites.gif 4KB
btn.gif 4KB
tip-sprite.gif 4KB
error-tip-corners.gif 4KB
large-loading.gif 3KB
blue-loading.gif 3KB
tools-sprites-trans.gif 3KB
group-cs.gif 2KB
search-trigger.gif 2KB
tabs-sprite.gif 2KB
共 743 条
- 1
- 2
- 3
- 4
- 5
- 6
- 8
panyong_8
- 粉丝: 0
- 资源: 10
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
- 3
前往页