格式化
This commit is contained in:
parent
468238c2ed
commit
a156d22f4d
|
@ -5,7 +5,9 @@ import com.len.service.ActAssigneeService;
|
|||
import com.len.service.impl.ActAssigneeServiceImpl;
|
||||
import com.len.util.AssigneeType;
|
||||
import com.len.util.SpringUtil;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.activiti.engine.delegate.DelegateTask;
|
||||
import org.activiti.engine.delegate.TaskListener;
|
||||
|
||||
|
@ -13,14 +15,15 @@ import org.activiti.engine.delegate.TaskListener;
|
|||
* @author zhuxiaomeng
|
||||
* @date 2018/1/20.
|
||||
* @email 154040976@qq.com
|
||||
*
|
||||
* <p>
|
||||
* 流程监听器 动态注入节点办理人
|
||||
*/
|
||||
public class ActNodeListener implements TaskListener {
|
||||
|
||||
@Override
|
||||
public void notify(DelegateTask delegateTask) {
|
||||
String nodeId=delegateTask.getTaskDefinitionKey();//key
|
||||
//KEY
|
||||
String nodeId = delegateTask.getTaskDefinitionKey();
|
||||
ActAssigneeService actAssigneeService = SpringUtil.getBean(ActAssigneeServiceImpl.class);
|
||||
List<ActAssignee> assigneeList = actAssigneeService.selectListByPage(new ActAssignee(nodeId));
|
||||
for (ActAssignee assignee : assigneeList) {
|
||||
|
|
|
@ -1,14 +1,16 @@
|
|||
package com.len.actlistener;
|
||||
|
||||
import com.len.entity.UserLeave;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import org.activiti.engine.delegate.DelegateTask;
|
||||
|
||||
/**
|
||||
* @author zhuxiaomeng
|
||||
* @date 2018/1/25.
|
||||
* @email 154040976@qq.com
|
||||
*
|
||||
* <p>
|
||||
* 自定义请假流程 监听器
|
||||
*/
|
||||
public class LeaveListenerImpl extends ActNodeListener {
|
||||
|
@ -17,10 +19,8 @@ public class LeaveListenerImpl extends ActNodeListener {
|
|||
public void notify(DelegateTask delegateTask) {
|
||||
super.notify(delegateTask);
|
||||
String taskId = delegateTask.getId();
|
||||
System.out.println(taskId);
|
||||
Map<String, Object> map = delegateTask.getVariables();
|
||||
UserLeave userLeave = (UserLeave) map.get("userLeave");
|
||||
delegateTask.addCandidateUser(userLeave.getUserId());
|
||||
System.out.println(userLeave);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,9 +6,11 @@ import com.len.entity.SysUser;
|
|||
import com.len.service.ActAssigneeService;
|
||||
import com.len.service.SysUserService;
|
||||
import com.len.util.JsonUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import org.activiti.engine.IdentityService;
|
||||
import org.activiti.engine.identity.Group;
|
||||
import org.activiti.engine.identity.User;
|
||||
|
@ -26,10 +28,8 @@ import org.springframework.stereotype.Component;
|
|||
* @author zhuxiaomeng
|
||||
* @date 2018/1/25.
|
||||
* @email 154040976@qq.com
|
||||
*
|
||||
* <p>
|
||||
* 切入实现系统用户 角色 用户-角色 同步到 activiti 用户 组 用户组 同步到工作流,模块化 无侵入
|
||||
*
|
||||
*
|
||||
*/
|
||||
@Aspect
|
||||
@Component
|
||||
|
@ -44,6 +44,7 @@ public class ListenUserRole {
|
|||
/**********************用户处理begin***************************/
|
||||
/**
|
||||
* 明确切入方法的参数
|
||||
*
|
||||
* @param joinPoint
|
||||
*/
|
||||
@Around("execution(com.len.util.JsonUtil com.len.controller.UserController.updateUser(*,String[]))")
|
||||
|
@ -66,12 +67,12 @@ public class ListenUserRole {
|
|||
|
||||
/**
|
||||
* 新增用户监听 同步工作流用户表 环绕注解能得到 插入用户id 啊哈哈
|
||||
*
|
||||
* @param joinPoint
|
||||
*/
|
||||
@Around("execution(com.len.util.JsonUtil com.len.controller.UserController.addUser(*,String[]))")
|
||||
public Object listenerUserInsert(ProceedingJoinPoint joinPoint) throws Throwable {
|
||||
Object o=new Object();
|
||||
o = joinPoint.proceed(joinPoint.getArgs());
|
||||
Object o = joinPoint.proceed(joinPoint.getArgs());
|
||||
Object[] args = joinPoint.getArgs();
|
||||
if (args.length == 2) {
|
||||
JsonUtil jsonUtil = (JsonUtil) o;
|
||||
|
@ -84,8 +85,7 @@ public class ListenUserRole {
|
|||
|
||||
@Around("execution(com.len.util.JsonUtil com.len.controller.UserController.del(..))")
|
||||
public Object listenDelUser(ProceedingJoinPoint point) throws Throwable {
|
||||
Object o=new Object();
|
||||
o = point.proceed(point.getArgs());
|
||||
Object o = point.proceed(point.getArgs());
|
||||
JsonUtil util = (JsonUtil) o;
|
||||
if (util.isFlag()) {
|
||||
Object[] args = point.getArgs();
|
||||
|
@ -97,6 +97,7 @@ public class ListenUserRole {
|
|||
|
||||
/**
|
||||
* 保存进 activiti 用户 角色 用户角色中间表
|
||||
*
|
||||
* @param obj
|
||||
*/
|
||||
private void changeUser(Object[] obj, List<String> strings) {
|
||||
|
@ -123,12 +124,10 @@ public class ListenUserRole {
|
|||
/**********************用户处理end***************************/
|
||||
|
||||
|
||||
|
||||
/**********************角色处理begin***************************/
|
||||
@Around("execution(com.len.util.JsonUtil com.len.controller.RoleController.addRole(*,String[]))")
|
||||
public Object listenRoleInsert(ProceedingJoinPoint joinPoint) throws Throwable {
|
||||
Object o=null;
|
||||
o=joinPoint.proceed(joinPoint.getArgs());
|
||||
Object o = joinPoint.proceed(joinPoint.getArgs());
|
||||
JsonUtil j = (JsonUtil) o;
|
||||
if (j.isFlag()) {
|
||||
Object[] args = joinPoint.getArgs();
|
||||
|
@ -141,8 +140,7 @@ public class ListenUserRole {
|
|||
|
||||
@Around("execution(com.len.util.JsonUtil com.len.controller.RoleController.updateUser(*,String[]))")
|
||||
public Object listenRoleUpdate(ProceedingJoinPoint joinPoint) throws Throwable {
|
||||
Object o=null;
|
||||
o=joinPoint.proceed(joinPoint.getArgs());
|
||||
Object o = joinPoint.proceed(joinPoint.getArgs());
|
||||
Object[] args = joinPoint.getArgs();
|
||||
if (args.length == 2) {
|
||||
if (((JsonUtil) o).isFlag()) {
|
||||
|
@ -155,8 +153,7 @@ public class ListenUserRole {
|
|||
|
||||
@Around("execution(com.len.util.JsonUtil com.len.controller.RoleController.del(..))")
|
||||
public Object listenDelRole(ProceedingJoinPoint point) throws Throwable {
|
||||
Object o=new Object();
|
||||
o = point.proceed(point.getArgs());
|
||||
Object o = point.proceed(point.getArgs());
|
||||
JsonUtil util = (JsonUtil) o;
|
||||
if (util.isFlag()) {
|
||||
Object[] args = point.getArgs();
|
||||
|
@ -167,6 +164,7 @@ public class ListenUserRole {
|
|||
|
||||
/**
|
||||
* 更新进组
|
||||
*
|
||||
* @param obj
|
||||
*/
|
||||
public void changeRole(Object[] obj) {
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
package com.len.config;
|
||||
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
|
||||
import org.activiti.engine.DynamicBpmnService;
|
||||
import org.activiti.engine.FormService;
|
||||
import org.activiti.engine.HistoryService;
|
||||
|
@ -28,7 +30,9 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter
|
|||
@Configuration
|
||||
public class ActivitiConfig {
|
||||
|
||||
/**spring 集成 activiti*/
|
||||
/**
|
||||
* spring 集成 activiti
|
||||
*/
|
||||
@Bean
|
||||
public ProcessEngineConfiguration processEngineConfiguration(DataSource dataSource, PlatformTransactionManager transactionManager) {
|
||||
SpringProcessEngineConfiguration processEngineConfiguration = new SpringProcessEngineConfiguration();
|
||||
|
|
|
@ -21,6 +21,7 @@ import com.len.service.SysUserService;
|
|||
import com.len.util.Checkbox;
|
||||
import com.len.util.JsonUtil;
|
||||
import com.len.util.ReType;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
|
@ -33,6 +34,7 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.activiti.bpmn.converter.BpmnXMLConverter;
|
||||
import org.activiti.bpmn.model.BpmnModel;
|
||||
import org.activiti.editor.constants.ModelDataJsonConstants;
|
||||
|
@ -67,7 +69,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
|
|||
* @author zhuxiaomeng
|
||||
* @date 2018/1/13.
|
||||
* @email 154040976@qq.com
|
||||
*
|
||||
* <p>
|
||||
* 流程管理 流程创建、发布 流程节点绑定角色/用户(绑定用户 开始ing)
|
||||
*/
|
||||
@Controller
|
||||
|
@ -140,8 +142,9 @@ public class ActivitiController extends BaseController {
|
|||
}
|
||||
return j;
|
||||
}
|
||||
/**方法此有所参考 感谢我参考原作者:liuruijie
|
||||
*
|
||||
|
||||
/**
|
||||
* 方法此有所参考 感谢我参考原作者:liuruijie
|
||||
*/
|
||||
@GetMapping(value = "goActiviti")
|
||||
public String goActiviti() throws UnsupportedEncodingException {
|
||||
|
@ -299,6 +302,7 @@ public class ActivitiController extends BaseController {
|
|||
|
||||
/**
|
||||
* 根据流程部署id获取节点并且传到前端
|
||||
*
|
||||
* @param deploymentId 部署id
|
||||
* @param model
|
||||
* @return
|
||||
|
@ -351,6 +355,7 @@ public class ActivitiController extends BaseController {
|
|||
|
||||
/**
|
||||
* 节点更新配置办理者(人/组)
|
||||
*
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
|
@ -387,6 +392,7 @@ public class ActivitiController extends BaseController {
|
|||
|
||||
/**
|
||||
* 删除流程定义 级联 删除 流程节点绑定信息
|
||||
*
|
||||
* @param model
|
||||
* @param id
|
||||
* @return
|
||||
|
@ -417,6 +423,7 @@ public class ActivitiController extends BaseController {
|
|||
|
||||
@Autowired
|
||||
ActPropertiesConfig actPropertiesConfig;
|
||||
|
||||
@PostMapping("delModel")
|
||||
@ResponseBody
|
||||
public JsonUtil delModel(org.springframework.ui.Model model, String id) {
|
||||
|
|
|
@ -14,6 +14,7 @@ import com.len.util.BeanUtil;
|
|||
import com.len.util.CommonUtil;
|
||||
import com.len.util.JsonUtil;
|
||||
import com.len.util.ReType;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.ArrayList;
|
||||
|
@ -24,6 +25,7 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.activiti.bpmn.model.BpmnModel;
|
||||
import org.activiti.engine.*;
|
||||
import org.activiti.engine.history.HistoricActivityInstance;
|
||||
|
@ -51,7 +53,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
|
|||
* @author zhuxiaomeng
|
||||
* @date 2018/1/21.
|
||||
* @email 154040976@qq.com
|
||||
*
|
||||
* <p>
|
||||
* 请假流程示例
|
||||
*/
|
||||
@Controller
|
||||
|
@ -114,6 +116,7 @@ public class UserLeaveController extends BaseController {
|
|||
|
||||
/**
|
||||
* 根据 执行对象id获取审批信息
|
||||
*
|
||||
* @param model
|
||||
* @param processId
|
||||
* @return
|
||||
|
@ -222,7 +225,9 @@ public class UserLeaveController extends BaseController {
|
|||
return j;
|
||||
}
|
||||
|
||||
/**---------我的任务---------*/
|
||||
/**
|
||||
* ---------我的任务---------
|
||||
*/
|
||||
@GetMapping(value = "showTask")
|
||||
public String showTask(Model model) {
|
||||
return "/act/task/taskList";
|
||||
|
@ -296,8 +301,10 @@ public class UserLeaveController extends BaseController {
|
|||
|
||||
@Autowired
|
||||
HistoryService historyService;
|
||||
|
||||
/**
|
||||
* 追踪图片成图
|
||||
*
|
||||
* @param request
|
||||
* @param resp
|
||||
* @param processInstanceId
|
||||
|
|
Loading…
Reference in New Issue