田源
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
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
package com.vci.server.workflow.event;
 
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
 
import com.vci.common.qt.object.Condition;
import com.vci.common.qt.object.QueryTemplate;
import com.vci.corba.common.VCIError;
import com.vci.corba.omd.data.BusinessObject;
import com.vci.corba.omd.data.LinkObject;
import com.vci.server.base.utility.OQueryHelper;
import com.vci.server.base.utility.ServerServiceProvider;
 
public class QueryHelper
{
//    public static BusinessObject[] getbo(String[] oids,String boType)
//    {
//        BusinessObject[] bos = null;
//        try
//        {
//            bos = ServerServiceProvider.getBOFService().getBatchBusinessObject(oids, boType);
//        } catch (VCIError e) {
//            e.printStackTrace();
//        } catch (Throwable e) {
//            e.printStackTrace();
//        }
//        if (bos == null || bos.length < 0) {
//            return null;
//        }
//        return bos;
//    }
 
//    public static BusinessObject getbo(String oid,String boType)
//    {
//        BusinessObject bo = null;
//        try
//        {
//            return ServerServiceProvider.getBOFService().readBusinessObject(oid, boType);
//        } catch (VCIError e) {
//            e.printStackTrace();
//        } catch (Throwable e) {
//            e.printStackTrace();
//        }
//        if (bos == null || bos.length < 0) {
//            return null;
//        }
//        return null;
//    }
 
//    public static LinkObject getlo(String dboid,String partoid, String linkType){
//        LinkObject lo = null;
//        try {
//            QueryTemplate qt2 = new QueryTemplate();
//            qt2.setId("btmQuery");
//            qt2.setLinkType(linkType);
//            qt2.setType("link");
//            qt2.setVersion(1);
//            qt2.setQueryChildrenFlag(true);
//            List<String> clauseList = new ArrayList<String>();
//            clauseList.add("*");
//            qt2.setClauseList(clauseList);
//            Map<String, String> conditions = new HashMap<String, String>();
//            conditions.put("f_oid", dboid);    
//            conditions.put("t_oid", partoid);
//            Condition cond = OQueryHelper.getCondition(conditions);
//            
//            qt2.setCondition(cond);
//            LinkObject[] los = ServerServiceProvider.getOQService().findLTObjects(qt2.getId(), OQueryHelper.getQTTextByQT(qt2));
//            if(los.length>0)
//                lo = los[0];
//            
//        } catch (VCIError e) {
//            e.printStackTrace();
//        } catch (Throwable e) {
//            e.printStackTrace();
//        }
//    
//        return lo;
//    }
 
//    public static String convertGBKToISO_8859_1(String text){
//        return convertEncoding(text, "GBK", "ISO-8859-1");
//    }
//    
//    public static String convertISO_8859_1ToGBK(String text){
//        return convertEncoding(text, "ISO-8859-1", "GBK");
//    }
//    
//    public static String convertEncoding(String text, String fromEncoding, String toEncoding){
//        String res = text;
//        try {
//            res = new String(text.getBytes(fromEncoding), toEncoding);
//        } catch (UnsupportedEncodingException e) {
//            e.printStackTrace();
//        } 
//        return res;
//    }
}