732dba7fce6ad3d7c46e874612d32cee26fdba7c.svn-base
3.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
/**
* Copyright © 2015-2018 ODM All rights reserved.
*/
package com.thinkgem.jeesite.modules.act.service.ext;
import java.util.List;
import java.util.Map;
import org.activiti.engine.identity.Group;
import org.activiti.engine.identity.GroupQuery;
import org.activiti.engine.impl.GroupQueryImpl;
import org.activiti.engine.impl.Page;
import org.activiti.engine.impl.persistence.entity.GroupEntity;
import org.activiti.engine.impl.persistence.entity.GroupEntityManager;
import org.springframework.stereotype.Service;
import com.google.common.collect.Lists;
import com.thinkgem.jeesite.common.utils.SpringContextHolder;
import com.thinkgem.jeesite.modules.act.utils.ActUtils;
import com.thinkgem.jeesite.modules.sys.entity.Role;
import com.thinkgem.jeesite.modules.sys.entity.User;
import com.thinkgem.jeesite.modules.sys.service.SystemService;
/**
* Activiti Group Entity Service
* @author ThinkGem
* @version 2013-12-05
*/
@Service
public class ActGroupEntityService extends GroupEntityManager {
private SystemService systemService;
public SystemService getSystemService() {
if (systemService == null){
systemService = SpringContextHolder.getBean(SystemService.class);
}
return systemService;
}
public Group createNewGroup(String groupId) {
return new GroupEntity(groupId);
}
public void insertGroup(Group group) {
// getDbSqlSession().insert((PersistentObject) group);
throw new RuntimeException("not implement method.");
}
public void updateGroup(GroupEntity updatedGroup) {
// CommandContext commandContext = Context.getCommandContext();
// DbSqlSession dbSqlSession = commandContext.getDbSqlSession();
// dbSqlSession.update(updatedGroup);
throw new RuntimeException("not implement method.");
}
public void deleteGroup(String groupId) {
// GroupEntity group = getDbSqlSession().selectById(GroupEntity.class, groupId);
// getDbSqlSession().delete("deleteMembershipsByGroupId", groupId);
// getDbSqlSession().delete(group);
throw new RuntimeException("not implement method.");
}
public GroupQuery createNewGroupQuery() {
// return new GroupQueryImpl(Context.getProcessEngineConfiguration().getCommandExecutorTxRequired());
throw new RuntimeException("not implement method.");
}
// @SuppressWarnings("unchecked")
public List<Group> findGroupByQueryCriteria(GroupQueryImpl query, Page page) {
// return getDbSqlSession().selectList("selectGroupByQueryCriteria", query, page);
throw new RuntimeException("not implement method.");
}
public long findGroupCountByQueryCriteria(GroupQueryImpl query) {
// return (Long) getDbSqlSession().selectOne("selectGroupCountByQueryCriteria", query);
throw new RuntimeException("not implement method.");
}
public List<Group> findGroupsByUser(String userId) {
// return getDbSqlSession().selectList("selectGroupsByUserId", userId);
List<Group> list = Lists.newArrayList();
User user = getSystemService().getUserByLoginName(userId);
if (user != null && user.getRoleList() != null){
for (Role role : user.getRoleList()){
list.add(ActUtils.toActivitiGroup(role));
}
}
return list;
}
public List<Group> findGroupsByNativeQuery(Map<String, Object> parameterMap, int firstResult, int maxResults) {
// return getDbSqlSession().selectListWithRawParameter("selectGroupByNativeQuery", parameterMap, firstResult, maxResults);
throw new RuntimeException("not implement method.");
}
public long findGroupCountByNativeQuery(Map<String, Object> parameterMap) {
// return (Long) getDbSqlSession().selectOne("selectGroupCountByNativeQuery", parameterMap);
throw new RuntimeException("not implement method.");
}
}