hjg
2023-11-22 975c04c0181b3da82a79cb04abe6a2f1799eb363
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
//
//package com.mandi.fendan.util;
//
//import java.util.HashMap;
//import java.util.List;
//import java.util.Map;
//
//import org.activiti.engine.task.Task;
//
//import com.mandi.activiti.service.IActivitiProcessService;
//import com.mandi.fendan.mapper.Fd_YKTMapper;
//
//
///** 
// * Function: TODO <br/> 
// * Date:     2017年2月11日 上午11:04:26 <br/> 
// * @author   guolq        
// */
//public class VarsUtils {
//    
//    
//    /**
//     * 当前任务节点
//     * @param acpser
//     * @param wuper
//     * @param instanceID
//     * @param username
//     * @param mmm
//     * @return
//     */
//    public static Map<String, Object> findtaskinfobySheet(IActivitiProcessService acpser,Fd_YKTMapper wuper,String instanceID,String username,Map<String, Object> mmm){
//        
////        mmm:{TaskName:任务名字,TaskId:任务Id,canHandle:是否可以办理,
////        Ctasker/Atasker/Etasker/Ntasker:办理人(可办/必办/没有指定办理人都可办/没有找到办理人) 这几个值统一为Ctasker,
////        Canagnee:是否必办(必办/其他(/没有指定办理人都可办/没有找到办理人)除了必办为true其他全为false)}
////        canEdit:是否可以编辑放到外边   ,(这个用我的待办代替)
//        if(username==null||username.trim().isEmpty()||instanceID==null||instanceID.trim().isEmpty())
//        {
//            mmm.put("Ctasker","");
//            mmm.put("TaskName", "");
//            mmm.put("canEdit", false);
//            mmm.put("Canagnee", false);
//            mmm.put("TaskId", "");
//            return mmm;
//        }
//        Task tk=acpser.findTaskByInstanceID(instanceID);
//        if(tk!=null){//任务是在办的
//            String formk=tk.getFormKey();
//            if(formk==null||formk.trim().isEmpty()){//没有添加formkey的不让办理
//                mmm.put("TaskName", tk.getDescription());//任务描述
//                mmm.put("TaskId", tk.getId());//任务id
//                mmm.put("canHandle", false);//办理是否显示
//                mmm.put("Canagnee", false);//是否必须办理
//                if(tk.getAssignee()==null){
//                    List<String> slist=acpser.findCandidateUsersByTaskID(tk.getId());
//                    if(slist!=null&&slist.size()>0){
//                        int a=0;
//                        for (String ss : slist) {
//                            if(ss.equals(username)){
//                                a++;
//                                break;
//                            }
//                        }
//                        Map<String, Object> ew=null;
//                        if(a==0){
//                            ew=wuper.findWorkerByUserName(slist.get(0));
//                        }else{
//                            ew=wuper.findWorkerByUserName(username);
//                        }
//                        if(ew!=null){
//                            mmm.put("Ctasker", ew.get("name")+"");
//                        }else{
//                            mmm.put("Ctasker", "帐号:"+slist.get(0));//有账号没有员工信息 该帐号的员工信息不存在了
//                        }
//                    }else{
//                        mmm.put("Ctasker", "");
//                    }
//                }else{
//                    Map<String, Object> ew=wuper.findWorkerByUserName(tk.getAssignee());
//                    if(tk.getAssignee().equals(username)){
//                        mmm.put("Canagnee", true);
//                    }
//                    if(ew!=null){
////                        mmm.put("Atasker", ew.getName());
//                        mmm.put("Ctasker", ew.get("name")+"");
//                    }else{
////                        mmm.put("Atasker", "帐号:"+tk.getAssignee());//有账号没有员工信息 该帐号的员工信息不存在了
//                        mmm.put("Ctasker", "");
//                    }
//                }
//            }else{
//                mmm.put("TaskName", tk.getDescription());//任务描述
//                mmm.put("TaskId", tk.getId());//任务id
//                mmm.put("canHandle", false);//办理是否显示
//                mmm.put("Canagnee", false);//是否必须办理
//                if(tk.getAssignee()==null){
//                    String taskid =tk.getId();
//                    List<String> slist=acpser.findCandidateUsersByTaskID(taskid);
//                    if(slist!=null&&slist.size()>0){
//                        int a=0;
//                        for (String ss : slist) {
//                            if(ss.equals(username)){
//                                mmm.put("canHandle", true);
//                                mmm.put("Canagnee", true);
//                                a++;
//                                break;
//                            }
//                        }
//                        Map<String, Object> ew=null;
//                        if(a==0){
//                            ew=wuper.findWorkerByUserName(slist.get(0));
//                        }else{
//                            ew=wuper.findWorkerByUserName(username);
//                        }
//                        if(ew!=null)
//                            mmm.put("Ctasker", ew.get("name")+"");
//                        else
//                            mmm.put("Ctasker", "");
//                    }else{//每个人都可以办理
////                        mmm.put("Etasker", "");
////                        Enterworker ew=wuper.findWorkerByUserName(username);
////                        if(ew!=null)
////                            mmm.put("Ctasker", ew.getName());
////                        else
////                            mmm.put("Ctasker", "帐号:"+username);
//                        mmm.put("Ctasker", "");
//                            
//                        mmm.put("canHandle", true);
//                    }
//                }else{
//                    Map<String, Object> ew=wuper.findWorkerByUserName(tk.getAssignee());
//                    if(tk.getAssignee().equals(username)){
//                        mmm.put("Canagnee", true);
//                        mmm.put("canHandle", true);
//                    }
//                    if(ew!=null){
////                        mmm.put("Atasker", ew.getName());
//                        mmm.put("Ctasker", ew.get("name")+"");
//                    }else{
////                        mmm.put("Atasker", "帐号:"+tk.getAssignee());
//                        mmm.put("Ctasker", "");
//                    }
//                }
//            }
//        }else{//任务已经结束或者完成
////            mmm.put("Ntasker","");
//            mmm.put("Ctasker","");
//            mmm.put("TaskName", "");
//            mmm.put("canEdit", false);
//            mmm.put("Canagnee", false);
//            mmm.put("TaskId", "");
//        }
//        return mmm;
//    }
//    
//}