wangting
2024-09-27 a3e87f78ee262ca9bb7d9b0c997639d5f3295890
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
package com.vci.client.uif.actions.client;
 
import java.util.Map;
import java.util.Map.Entry;
 
import com.vci.client.LogonApplication;
import com.vci.client.common.objects.UserEntityObject;
import com.vci.client.uif.engine.common.IDataNode;
import com.vci.client.workflow.delegate.ProcessCustomClientDelegate;
import com.vci.client.workflow.task.TaskAssignedForPlatformDialog;
import com.vci.mw.ClientContextVariable;
 
/**
 * Action
 * <p>单个任务转移</p>
 * @author liudi
 *
 */
public class SetTaskAssignWorkFlowAction extends AbstractBusionessOperationAction {
 
    @Override
    public String getKey() {
        return "settaskassign";
    }
    
    @Override
    public boolean checkHasRight() {
        return true;
    }
 
    /* (non-Javadoc)
     * @see plm.uif.actions.client.BusinessOperationAction#doPost()
     */
    @Override
    public boolean doPost() {
        // 获取选择的数据
        // 数据的实际类型一般为 IDataNode
        Object[] objs = getDataModel().getSelectObjects();
//        paramsMap = getButtonParams();
        
        UserEntityObject userEntityObject = new UserEntityObject();
        String ip = ClientContextVariable.getInvocationInfo().clientIPInfo;
        String loginUserName = ClientContextVariable.getInvocationInfo().userName;
        userEntityObject.setIp(ip);
        userEntityObject.setUserName(loginUserName);
        userEntityObject.setModules("");
        ProcessCustomClientDelegate delegate = new ProcessCustomClientDelegate(userEntityObject);
        String[] taskOids = new String[objs.length];
        String[] executionIds = new String[objs.length];
        String[] taskNames = new String[objs.length];
        String[] taskStatuss = new String[objs.length];
        for(int objectIndex=0;objectIndex<objs.length;objectIndex++){
            IDataNode idn = (IDataNode) objs[objectIndex];
            Map<String, String> valueMap = idn.getValueMap();
            int j=0;
            int k=0;
            for(Entry<String, String> entrySet : valueMap.entrySet()){
                if(entrySet.getKey()!=null&&entrySet.getKey().equals("Executionid".toLowerCase())){
                    executionIds[j] = entrySet.getValue();
                    j++;
                }
                if(entrySet.getKey()!=null&&entrySet.getKey().equals("Name".toLowerCase())){
                    taskNames[k] = entrySet.getValue().substring(entrySet.getValue().lastIndexOf("-")+1);
                    k++;
                }
            }
        }
        TaskAssignedForPlatformDialog dialog = new TaskAssignedForPlatformDialog(LogonApplication.frame,taskNames,executionIds);
        
        return true;
    }
}