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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
package com.vci.web.service;
 
import com.vci.corba.omd.data.AttributeValue;
import com.vci.corba.omd.data.BusinessObject;
import com.vci.corba.omd.data.LinkObject;
import com.vci.starter.web.exception.VciBaseException;
import com.vci.starter.web.pagemodel.DataGrid;
import com.vci.starter.web.pagemodel.PageHelper;
import com.vci.web.query.UILinkTypeDataQuery;
 
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
 
public interface WebLoServiceI {
 
 
 
    /**
     * 根据查询条件来查询链接类型
     * @param linkType 链接类型
     * @param conditionMap
     * @return
     * @throws VciBaseException
     */
     List<LinkObject>  queryCLO(String linkType, Map<String, String> conditionMap) throws VciBaseException;
 
    /**
     * 根据查询条件来查询链接类型
     * @param linkType 链接类型
     * @param toBtmname to端的业务类型
     * @param conditionMap 查询条件
     * @return
     * @throws VciBaseException
     */
     List<BusinessObject> queryLinkCbo(String linkType, String toBtmname, Map<String, String> conditionMap) throws VciBaseException;
 
    /**
     * 查询链接类型
     * @param linkType 链接类型
     * @param toBtmName to 端的业务类型
     * @param level 查询级别
     * @param conditionMap 查询条件
     * @return
     * @throws VciBaseException
     */
     List<LinkObject> queryCLO(String linkType, String toBtmName, int level, Map<String, String> conditionMap) throws VciBaseException;
 
    /**
     * 查询to端的业务类型
     * @param linkType 链接类型
     * @param toBtmname to端的业务类型
     * @param level 级别
     * @param conditionMap 查询条件
     * @return
     * @throws VciBaseException
     */
     List<BusinessObject> queryLinkCbo(String linkType, String toBtmname, int level, Map<String, String> conditionMap) throws VciBaseException;
 
    /**
     * 查询链接类型
     * @param linkType 链接类型
     * @param toBtmName to端的业务类型
     * @param level 级别
     * @param isDirection 是否反向
     * @param conditionMap 查询条件
     * @return
     * @throws VciBaseException
     */
     List<LinkObject> queryCLO(String linkType, String toBtmName,
                                     int level, boolean isDirection, Map<String, String> conditionMap)
            throws VciBaseException;
 
    /**
     * 查询链接类型
     * @param linkType 链接类型
     * @param toBtmName to端的业务类型
     * @param level 级别
     * @param isDirection 是否反向
     * @param conditionMap 查询条件
     * @param ph 分页对象
     * @return
     * @throws VciBaseException
     */
     List<LinkObject> queryCLO(String linkType, String toBtmName,
                                     int level, boolean isDirection, Map<String, String> conditionMap, PageHelper ph)
            throws VciBaseException;
 
    /**
     * 查询to端的业务类型
     * @param linkType 链接类型
     * @param toBtmname to端的业务类型
     * @param level 级别
     * @param isDirection 反向
     * @param conditionMap 查询条件
     * @return
     * @throws VciBaseException
     */
     List<BusinessObject> queryLinkCbo(String linkType, String toBtmname,
                                             int level, boolean isDirection, Map<String, String> conditionMap)
            throws VciBaseException;
 
    /**
     * 查询链接类型某端的业务类型
     * @param lo 链接类型对象
     * @param isDirection 是否反向
     * @return
     * @throws VciBaseException
     */
     Map<String,BusinessObject> queryLinkedCbo(LinkObject[] lo, boolean isDirection) throws VciBaseException;
 
    /**
     *查询链接类型某端的业务类型
     * @param los 链接类型对象
     * @param isDirection 是否反向
     * @return
     * @throws VciBaseException
     */
     Map<String,BusinessObject> queryLinkedCbo(List los, boolean isDirection) throws VciBaseException;
 
//    /**
//     *查询链接类型某端的业务类型
//     * @param clo 链接类型对象
//     * @param isDirection 是否反向
//     * @return
//     * @throws VciBaseException
//     */
//     Map<String,BusinessObject> queryLinkedCbo(LinkObject[] clo, boolean isDirection) throws VciBaseException;
 
    /**
     * 查询链接类型某端的业务类型
     * @param clol 链接类型
     * @param isDirection 是否反向
     * @param queryColumn 要查询的列
     * @return
     * @throws VciBaseException
     */
     Map<String, BusinessObject> queryLinkedCbo(LinkObject[] clol,
                                                      boolean isDirection, List<String> queryColumn) throws VciBaseException;
 
    /**
     * 查询链接类型某端的业务类型
     * @param los 链接类型
     * @param isDirection 是否反向
     * @param queryColumn 要查询的列
     * @return
     * @throws VciBaseException
     */
     Map<String, BusinessObject> queryLinkedCbo(List los,
                                                      boolean isDirection, List<String> queryColumn) throws VciBaseException;
    
     /**
     * LinkObject 转为HashMap
     * @param clos clos
     * @return map
     * @throws VciBaseException
     */
     List<Map> clos2Map(List<LinkObject> clos) throws VciBaseException;
    
    /**
     * LinkObject 转为HashMap
     * @param clo
     * @return
     * @throws VciBaseException
     */
     Map clo2Map(LinkObject clo) throws VciBaseException;
    
    /**
     * map转为LinkObject
     * @param map 
     * @return
     * @throws VciBaseException
     */
     List<LinkObject> map2Clos(List<Map> map) throws VciBaseException;
    
    /**
     * map转为LinkObject
     * @param map
     * @return
     * @throws VciBaseException
     */
     LinkObject map2Clo(Map map) throws VciBaseException;
 
    /**
     * 保存链接类型对象
     * @param clos 保存的业务类型对象
     * @return
     * @throws VciBaseException
     */
    List<LinkObject> saveLinkObjects(List<LinkObject> clos) throws VciBaseException;
 
    /**
     * 创建连接类型
     * @param loName
     * @return
     * @throws VciBaseException
     */
    LinkObject createLinkObject(String loName) throws VciBaseException;
 
    /**
     * 拷贝链接类型
     * @param clo 链接类型对象
     * @return
     * @throws VciBaseException
     */
    LinkObject cloneLinkObject(LinkObject clo) throws VciBaseException;
 
    /**
     * 删除链接类型
     * @param clos 链接类型的内容
     * @throws VciBaseException
     */
    void deleteLinkObjects(List<LinkObject> clos) throws VciBaseException;
 
    /**
     * 更新链接类型
     * @param clos 链接类型的对象
     * @throws VciBaseException 执行出错会抛出异常
     */
    void updateLinkObject(List<LinkObject> clos) throws VciBaseException;
 
    /**
     * 查询链接类型和业务类型
     * @param linkTypeDataQuery 查询对象
     * @return 链接类型和关联的to端
     */
    List<com.vci.corba.query.data.BOAndLO> queryCLOAndBOBySchema(UILinkTypeDataQuery linkTypeDataQuery) ;
 
    /**
     * 使用链接类型的名称查询 链接类型的to端的业务类型
     * @param linkTypeDataQuery 查询的对象
     * @return 链接对象和to端业务对象
     */
    List<com.vci.corba.query.data.BOAndLO> queryCLOAndBoByLinkType(UILinkTypeDataQuery linkTypeDataQuery);
 
    /**
     * 查询列表
     * @param linkTypeDataQuery 查询的对象
     * @return 列表的数据
     */
    DataGrid queryGridByScheme(UILinkTypeDataQuery linkTypeDataQuery);
 
    /**
     * 链接类型查询数量
     * @param linkType 链接类型
     * @param conditionMap 查询条件
     * @return 属性
     */
    Integer queryCount(String linkType, Map<String, String> conditionMap);
 
    /**
     * 链接类型查询数量
     *
     * @param linkType     链接类型
     * @param conditionMap 查询条件
     * @param isDirection 是否反向
     * @param level 层级
     * @return 个数
     */
    Integer queryCount(String linkType, Map<String, String> conditionMap, boolean isDirection, Integer level);
 
    /**
     * 链接类型
     * @param clo 链接类型
     * @param attributeName 属性名称
     * @param attributeValue 属性的值
     */
    public default void setAttribute(LinkObject clo,String attributeName,String attributeValue){
        com.vci.corba.omd.data.AttributeValue[] attrValues =clo.newAttrValList;
        ArrayList<com.vci.corba.omd.data.AttributeValue> attrValList = new ArrayList();
        com.vci.corba.omd.data.AttributeValue attrVal;
        int i;
        if (attrValues != null && attrValues.length > 0) {
            com.vci.corba.omd.data.AttributeValue[] var9 = attrValues;
            i = attrValues.length;
 
            for(int var7 = 0; var7 < i; ++var7) {
                attrVal = var9[var7];
                attrValList.add(attrVal);
            }
        }
 
        attrVal = null;
        boolean isExist = false;
 
        for(i = 0; i < attrValList.size(); ++i) {
            attrVal = (com.vci.corba.omd.data.AttributeValue)attrValList.get(i);
            if (attrVal.attrName.toUpperCase().equals(attributeName.toUpperCase())) {
                attrVal.attrVal = attributeValue;
                isExist = true;
                break;
            }
        }
 
        if (!isExist) {
            attrVal = new com.vci.corba.omd.data.AttributeValue();
            attrVal.attrName = attributeName.toUpperCase();
            attrVal.attrVal = attributeValue;
            attrValList.add(attrVal);
        }
 
        clo.newAttrValList = attrValList.toArray(new AttributeValue[attrValList.size()]);
    };
}