田源
2024-03-07 4b4083fd73dc27ece42f4835483565eef0e4f608
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
package com.vci.common.portal.utils;
 
import com.vci.common.utility.ObjectUtility;
import com.vci.corba.portal.data.PLCommandParameter;
import com.vci.corba.portal.data.PLTabButton;
 
 
public class PortalUtil {
    private static Object lock = new Object();
    private static PortalUtil instance = null;
    private PortalUtil(){};
    public static PortalUtil getInstance(){
        if(instance == null){
            synchronized(lock){
                if(instance == null){
                    instance = new PortalUtil();
                }
            }
        }
        return instance;
    }
    
    /**
     * 返回克隆的PLTabButton对象
     * @param tabBtn 源PLTabButton对象
     * @return 新克隆的PLTabButton对象
     */
    public PLTabButton clonePLTabButton(PLTabButton tabBtn){
        PLTabButton btn = new PLTabButton();
        btn.plOId = ObjectUtility.getNewObjectID36();
        btn.plTableOId = tabBtn.plTableOId;
        btn.plPageOId = tabBtn.plPageOId;
        btn.plActionOId = tabBtn.plActionOId;
        btn.plLabel = tabBtn.plLabel;
        btn.plAreaType = tabBtn.plAreaType;
        btn.plDesc = tabBtn.plDesc;
        btn.plSeq = tabBtn.plSeq;
        btn.plCreateTime = tabBtn.plCreateTime;
        btn.plCreateUser = tabBtn.plCreateUser;
        btn.plModifyTime = tabBtn.plModifyTime;
        btn.plModifyUser = tabBtn.plModifyUser;
        btn.plLicensOrs = tabBtn.plLicensOrs;
        btn.plParentOid = tabBtn.plParentOid;
        btn.displayMode = tabBtn.displayMode;
        btn.iconPath = tabBtn.iconPath;
        btn.authorization = tabBtn.authorization;
        btn.show = tabBtn.show;
        return btn;
    }
    
    /**
     * 返回克隆的PLCommandParameter对象
     * @param cmdPar 源PLCommandParameter对象
     * @return 新PLCommandParameter对象
     */
    public PLCommandParameter clonePLCommandParameter(PLCommandParameter cmdPar){
        PLCommandParameter cmd = new PLCommandParameter();
        cmd.plOId = ObjectUtility.getNewObjectID36();
        cmd.plCommandOId = cmdPar.plCommandOId;
        cmd.plKey = cmdPar.plKey;
        cmd.plValue = cmdPar.plValue;
        cmd.plCreateTime = cmdPar.plCreateTime;
        cmd.plCreateUser = cmdPar.plCreateUser;
        cmd.plModifyTime = cmdPar.plModifyTime;
        cmd.plModifyUser = cmdPar.plModifyUser;
        cmd.plLicensOrs = cmdPar.plLicensOrs;
        return cmd;
    }
}