Administrator
2023-04-19 40ec16bbb7c9d23df625aa31ae42ac36e901749d
提交 | 用户 | 时间
58d006 1 //
A 2 //package com.mandi.fendan.util;
3 //
4 //import java.util.HashMap;
5 //import java.util.List;
6 //import java.util.Map;
7 //
8 //import org.activiti.engine.task.Task;
9 //
10 //import com.mandi.activiti.service.IActivitiProcessService;
11 //import com.mandi.fendan.mapper.Fd_YKTMapper;
12 //
13 //
14 ///** 
15 // * Function: TODO <br/> 
16 // * Date:     2017年2月11日 上午11:04:26 <br/> 
17 // * @author   guolq        
18 // */
19 //public class VarsUtils {
20 //    
21 //    
22 //    /**
23 //     * 当前任务节点
24 //     * @param acpser
25 //     * @param wuper
26 //     * @param instanceID
27 //     * @param username
28 //     * @param mmm
29 //     * @return
30 //     */
31 //    public static Map<String, Object> findtaskinfobySheet(IActivitiProcessService acpser,Fd_YKTMapper wuper,String instanceID,String username,Map<String, Object> mmm){
32 //        
33 ////        mmm:{TaskName:任务名字,TaskId:任务Id,canHandle:是否可以办理,
34 ////        Ctasker/Atasker/Etasker/Ntasker:办理人(可办/必办/没有指定办理人都可办/没有找到办理人) 这几个值统一为Ctasker,
35 ////        Canagnee:是否必办(必办/其他(/没有指定办理人都可办/没有找到办理人)除了必办为true其他全为false)}
36 ////        canEdit:是否可以编辑放到外边   ,(这个用我的待办代替)
37 //        if(username==null||username.trim().isEmpty()||instanceID==null||instanceID.trim().isEmpty())
38 //        {
39 //            mmm.put("Ctasker","");
40 //            mmm.put("TaskName", "");
41 //            mmm.put("canEdit", false);
42 //            mmm.put("Canagnee", false);
43 //            mmm.put("TaskId", "");
44 //            return mmm;
45 //        }
46 //        Task tk=acpser.findTaskByInstanceID(instanceID);
47 //        if(tk!=null){//任务是在办的
48 //            String formk=tk.getFormKey();
49 //            if(formk==null||formk.trim().isEmpty()){//没有添加formkey的不让办理
50 //                mmm.put("TaskName", tk.getDescription());//任务描述
51 //                mmm.put("TaskId", tk.getId());//任务id
52 //                mmm.put("canHandle", false);//办理是否显示
53 //                mmm.put("Canagnee", false);//是否必须办理
54 //                if(tk.getAssignee()==null){
55 //                    List<String> slist=acpser.findCandidateUsersByTaskID(tk.getId());
56 //                    if(slist!=null&&slist.size()>0){
57 //                        int a=0;
58 //                        for (String ss : slist) {
59 //                            if(ss.equals(username)){
60 //                                a++;
61 //                                break;
62 //                            }
63 //                        }
64 //                        Map<String, Object> ew=null;
65 //                        if(a==0){
66 //                            ew=wuper.findWorkerByUserName(slist.get(0));
67 //                        }else{
68 //                            ew=wuper.findWorkerByUserName(username);
69 //                        }
70 //                        if(ew!=null){
71 //                            mmm.put("Ctasker", ew.get("name")+"");
72 //                        }else{
73 //                            mmm.put("Ctasker", "帐号:"+slist.get(0));//有账号没有员工信息 该帐号的员工信息不存在了
74 //                        }
75 //                    }else{
76 //                        mmm.put("Ctasker", "");
77 //                    }
78 //                }else{
79 //                    Map<String, Object> ew=wuper.findWorkerByUserName(tk.getAssignee());
80 //                    if(tk.getAssignee().equals(username)){
81 //                        mmm.put("Canagnee", true);
82 //                    }
83 //                    if(ew!=null){
84 ////                        mmm.put("Atasker", ew.getName());
85 //                        mmm.put("Ctasker", ew.get("name")+"");
86 //                    }else{
87 ////                        mmm.put("Atasker", "帐号:"+tk.getAssignee());//有账号没有员工信息 该帐号的员工信息不存在了
88 //                        mmm.put("Ctasker", "");
89 //                    }
90 //                }
91 //            }else{
92 //                mmm.put("TaskName", tk.getDescription());//任务描述
93 //                mmm.put("TaskId", tk.getId());//任务id
94 //                mmm.put("canHandle", false);//办理是否显示
95 //                mmm.put("Canagnee", false);//是否必须办理
96 //                if(tk.getAssignee()==null){
97 //                    String taskid =tk.getId();
98 //                    List<String> slist=acpser.findCandidateUsersByTaskID(taskid);
99 //                    if(slist!=null&&slist.size()>0){
100 //                        int a=0;
101 //                        for (String ss : slist) {
102 //                            if(ss.equals(username)){
103 //                                mmm.put("canHandle", true);
104 //                                mmm.put("Canagnee", true);
105 //                                a++;
106 //                                break;
107 //                            }
108 //                        }
109 //                        Map<String, Object> ew=null;
110 //                        if(a==0){
111 //                            ew=wuper.findWorkerByUserName(slist.get(0));
112 //                        }else{
113 //                            ew=wuper.findWorkerByUserName(username);
114 //                        }
115 //                        if(ew!=null)
116 //                            mmm.put("Ctasker", ew.get("name")+"");
117 //                        else
118 //                            mmm.put("Ctasker", "");
119 //                    }else{//每个人都可以办理
120 ////                        mmm.put("Etasker", "");
121 ////                        Enterworker ew=wuper.findWorkerByUserName(username);
122 ////                        if(ew!=null)
123 ////                            mmm.put("Ctasker", ew.getName());
124 ////                        else
125 ////                            mmm.put("Ctasker", "帐号:"+username);
126 //                        mmm.put("Ctasker", "");
127 //                            
128 //                        mmm.put("canHandle", true);
129 //                    }
130 //                }else{
131 //                    Map<String, Object> ew=wuper.findWorkerByUserName(tk.getAssignee());
132 //                    if(tk.getAssignee().equals(username)){
133 //                        mmm.put("Canagnee", true);
134 //                        mmm.put("canHandle", true);
135 //                    }
136 //                    if(ew!=null){
137 ////                        mmm.put("Atasker", ew.getName());
138 //                        mmm.put("Ctasker", ew.get("name")+"");
139 //                    }else{
140 ////                        mmm.put("Atasker", "帐号:"+tk.getAssignee());
141 //                        mmm.put("Ctasker", "");
142 //                    }
143 //                }
144 //            }
145 //        }else{//任务已经结束或者完成
146 ////            mmm.put("Ntasker","");
147 //            mmm.put("Ctasker","");
148 //            mmm.put("TaskName", "");
149 //            mmm.put("canEdit", false);
150 //            mmm.put("Canagnee", false);
151 //            mmm.put("TaskId", "");
152 //        }
153 //        return mmm;
154 //    }
155 //    
156 //}