zenglf
2023-08-18 a693d3897dc9739dee07e4f15dd5eeb086f4d9ab
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
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
package org.jeecg.common.system.api;
 
 
import com.alibaba.fastjson.JSONObject;
import org.jeecg.common.api.CommonAPI;
import org.jeecg.common.api.dto.DataLogDTO;
import org.jeecg.common.api.dto.OnlineAuthDTO;
import org.jeecg.common.api.dto.message.*;
import org.jeecg.common.system.base.entity.DataVersion;
import org.jeecg.common.system.base.entity.SysUpload;
import org.jeecg.common.system.base.entity.SysUploadRela;
import org.jeecg.common.system.vo.*;
import org.springframework.web.multipart.MultipartFile;
 
import java.util.List;
import java.util.Map;
import java.util.Set;
 
/**
 * @Description  底层共通业务API,提供其他独立模块调用
 * @Author  scott
 * @Date 2019-4-20
 * @Version V1.0
 */
public interface ISysBaseAPI extends CommonAPI {
 
 
    /**
     * 1发送系统消息
     * @param message 使用构造器赋值参数 如果不设置category(消息类型)则默认为2 发送系统消息
     */
    void sendSysAnnouncement(MessageDTO message);
 
    /**
     * 2发送消息 附带业务参数
     * @param message 使用构造器赋值参数
     */
    void sendBusAnnouncement(BusMessageDTO message);
 
    /**
     * 3通过模板发送消息
     * @param message 使用构造器赋值参数
     */
    void sendTemplateAnnouncement(TemplateMessageDTO message);
 
    /**
     * 4通过模板发送消息 附带业务参数
     * @param message 使用构造器赋值参数
     */
    void sendBusTemplateAnnouncement(BusTemplateMessageDTO message);
 
    /**
     * 5通过消息中心模板,生成推送内容
     * @param templateDTO 使用构造器赋值参数
     * @return
     */
    String parseTemplateByCode(TemplateDTO templateDTO);
 
    //update-begin---author:taoyan ---date:20220705  for:支持自定义推送类型,邮件、钉钉、企业微信、系统消息-----------
    /**
     * 发送模板消息【新,支持自定义推送类型】
     * @param message
     */
    void sendTemplateMessage(MessageDTO message);
 
    /**
     * 根据模板编码获取模板内容【新,支持自定义推送类型】
     * @param templateCode
     * @return
     */
    String getTemplateContent(String templateCode);
    //update-begin---author:taoyan ---date:20220705  for:支持自定义推送类型,邮件、钉钉、企业微信、系统消息-----------
    
    /**
     * 6根据用户id查询用户信息
     * @param id
     * @return
     */
    LoginUser getUserById(String id);
 
    /**
     * 7通过用户账号查询角色集合
     * @param username
     * @return
     */
    List<String> getRolesByUsername(String username);
 
    /**
     * 8通过用户账号查询部门集合
     * @param username
     * @return 部门 id
     */
    List<String> getDepartIdsByUsername(String username);
 
    /**
     * 9通过用户账号查询部门 name
     * @param username
     * @return 部门 name
     */
    List<String> getDepartNamesByUsername(String username);
 
 
 
    /** 11查询所有的父级字典,按照create_time排序
     * @return List<DictModel> 字典集合
     */
    public List<DictModel> queryAllDict();
 
    /**
     * 12查询所有分类字典
     * @return
     */
    public List<SysCategoryModel> queryAllSysCategory();
 
 
    /**
     * 14查询所有部门 作为字典信息 id -->value,departName -->text
     * @return
     */
    public List<DictModel> queryAllDepartBackDictModel();
 
    /**
     * 15根据业务类型及业务id修改消息已读
     * @param busType
     * @param busId
     */
    public void updateSysAnnounReadFlag(String busType, String busId);
 
    /**
     * 16查询表字典 支持过滤数据
     * @param table
     * @param text
     * @param code
     * @param filterSql
     * @return
     */
    public List<DictModel> queryFilterTableDictInfo(String table, String text, String code, String filterSql);
 
    /**
     * 17查询指定table的 text code 获取字典,包含text和value
     * @param table
     * @param text
     * @param code
     * @param keyArray
     * @return
     */
    @Deprecated
    public List<String> queryTableDictByKeys(String table, String text, String code, String[] keyArray);
 
    /**
     * 18查询所有用户 返回ComboModel
     * @return
     */
    public List<ComboModel> queryAllUserBackCombo();
 
    /**
     * 19分页查询用户 返回JSONObject
     * @param userIds 多个用户id
     * @param pageNo 当前页数
     * @param pageSize 每页显示条数
     * @return
     */
    public JSONObject queryAllUser(String userIds, Integer pageNo, Integer pageSize);
 
    /**
     * 20获取所有角色
     * @return
     */
    public List<ComboModel> queryAllRole();
 
    /**
     * 21获取所有角色 带参
     * @param roleIds 默认选中角色
     * @return
     */
    public List<ComboModel> queryAllRole(String[] roleIds );
 
    /**
     * 22通过用户账号查询角色Id集合
     * @param username
     * @return
     */
    public List<String> getRoleIdsByUsername(String username);
 
    /**
     * 23通过部门编号查询部门id
     * @param orgCode
     * @return
     */
    public String getDepartIdsByOrgCode(String orgCode);
 
    /**
     * 24查询所有部门
     * @return
     */
    public List<SysDepartModel> getAllSysDepart();
 
    /**
     * 25查找父级部门
     * @param departId
     * @return
     */
    DictModel getParentDepartId(String departId);
 
    /**
     * 26根据部门Id获取部门负责人
     * @param deptId
     * @return
     */
    public List<String> getDeptHeadByDepId(String deptId);
 
    /**
     * 27给指定用户发消息
     * @param userIds
     * @param cmd
     */
    public void sendWebSocketMsg(String[] userIds, String cmd);
 
    /**
     * 28根据id获取所有参与用户
     * @param userIds 多个用户id
     * @return
     */
    public List<LoginUser> queryAllUserByIds(String[] userIds);
 
    /**
     * 29将会议签到信息推动到预览
     * userIds
     * @return
     * @param userId
     */
    void meetingSignWebsocket(String userId);
 
    /**
     * 30根据name获取所有参与用户
     * @param userNames 多个用户账户
     * @return
     */
    List<LoginUser> queryUserByNames(String[] userNames);
 
 
    /**
     * 31获取用户的角色集合
     * @param username
     * @return
     */
    Set<String> getUserRoleSet(String username);
 
    /**
     * 32获取用户的权限集合
     * @param username
     * @return
     */
    Set<String> getUserPermissionSet(String username);
 
    /**
     * 33判断是否有online访问的权限
     * @param onlineAuthDTO
     * @return
     */
    boolean hasOnlineAuth(OnlineAuthDTO onlineAuthDTO);
 
    /**
     * 34通过部门id获取部门全部信息
     * @param id 部门id
     * @return SysDepartModel对象
     */
    SysDepartModel selectAllById(String id);
 
    /**
     * 35根据用户id查询用户所属公司下所有用户ids
     * @param userId
     * @return
     */
    List<String> queryDeptUsersByUserId(String userId);
 
    /**
     * 36根据多个用户账号(逗号分隔),查询返回多个用户信息
     * @param usernames
     * @return
     */
    List<JSONObject> queryUsersByUsernames(String usernames);
 
    /**
     * 37根据多个用户ID(逗号分隔),查询返回多个用户信息
     * @param ids
     * @return
     */
    List<JSONObject> queryUsersByIds(String ids);
 
    /**
     * 38根据多个部门编码(逗号分隔),查询返回多个部门信息
     * @param orgCodes
     * @return
     */
    List<JSONObject> queryDepartsByOrgcodes(String orgCodes);
 
    /**
     * 39根据多个部门id(逗号分隔),查询返回多个部门信息
     * @param ids
     * @return
     */
    List<JSONObject> queryDepartsByIds(String ids);
 
    /**
     * 40发送邮件消息
     * @param email
     * @param title
     * @param content
     */
    void sendEmailMsg(String email,String title,String content);
    /**
     * 41 获取公司下级部门和公司下所有用户信息
     * @param orgCode
     * @return List<Map>
     */
    List<Map> getDeptUserByOrgCode(String orgCode);
 
    /**
     * 查询分类字典翻译
     * @param ids 多个分类字典id
     * @return List<String>
     */
    List<String> loadCategoryDictItem(String ids);
 
    /**
     * 根据字典code加载字典text
     *
     * @param dictCode 顺序:tableName,text,code
     * @param keys     要查询的key
     * @return
     */
    List<String> loadDictItem(String dictCode, String keys);
 
    /**
     * 根据字典code查询字典项
     *
     * @param dictCode 顺序:tableName,text,code
     * @param dictCode 要查询的key
     * @return
     */
    List<DictModel> getDictItems(String dictCode);
 
    /**
     *  根据多个字典code查询多个字典项
     * @param dictCodeList
     * @return key = dictCode ; value=对应的字典项
     */
    Map<String, List<DictModel>> getManyDictItems(List<String> dictCodeList);
 
    /**
     * 【JSearchSelectTag下拉搜索组件专用接口】
     * 大数据量的字典表 走异步加载  即前端输入内容过滤数据
     *
     * @param dictCode 字典code格式:table,text,code
     * @param keyword 过滤关键字
     * @param pageSize 分页条数
     * @return
     */
    List<DictModel> loadDictItemByKeyword(String dictCode, String keyword, Integer pageSize);
 
    /**
     * 新增数据日志
     * @param dataLogDto
     */
    void saveDataLog(DataLogDTO dataLogDto);
 
    /**
     * 添加文件到知识库
     * @param sysFilesModel
     */
    void addSysFiles(SysFilesModel sysFilesModel);
 
    /**
     * 通过文件路径获取文件id
     * @param fileId
     */
    String getFileUrl(String fileId);
 
    /**
     * 更新头像
     * @param loginUser
     */
    void updateAvatar(LoginUser loginUser);
 
    /**
     * 向app端 websocket推送聊天刷新消息
     * @param userId
     */
    void sendAppChatSocket(String userId);
    List<SysUploadRela> listByBusIdAndBusType(String busId, String busType);
 
 
    SysUpload getUploadById(String id);
 
    boolean saveOrUpdateBatchUploadRela(List<SysUploadRela> sysUploadRelaList);
 
    boolean  updateBatchUploadById(List<SysUpload> sysUploadList);
 
    List<SysUpload> batchUploadFile(String fileType, List<MultipartFile> multipartFileList, String description) throws Exception;
 
    void saveOrUpdateUploadRale(String busId, String busType, String uploadId);
 
//    Unit getUnitById(id);
 
    void removeDataVersionByBusinessId(String businessId);
 
    void removeUploadById(String id);
 
    void removeUploadRelaById(String id);
 
    void delSysUploadRelaByBusIdAndBusType(String busId, String busType);
 
    String getUnitNameById(String unitId);
 
    String queryDictTextByKey(String dictCode, String key);
 
    String getVersionStatusByVersionAndBusinessType(Integer version, String businessType);
 
    void saveDataVersion(DataVersion dataVersion);
 
    DataVersion getDataVersionByBusinessId(String id);
 
    void removeDataVersionById(String id);
 
    String getEnterpriseNameById(String enterpriseId);
 
    List<DataVersion> getLastDataVersion(String businessType, String enterpriseId, String isLastusable);
 
 
    List<DataVersion>  getDataVersionList(String businessType,String enterpriseId,String versionStatus, String version);
 
    /**根据ids 批量删除 数据版本
     *
     * @param ids
     */
    void removeDataVersionByIds(String ids);
 
    void updateBatchDataVersion(List<DataVersion> dataVersionList);
 
 
    void closeJobByClassName(String className);
}