ludc
2023-12-05 ee68ec1a404b8df679a8cb76ab6eab59979c0b9d
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
package com.vci.ubcs.code.service;
 
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.vci.ubcs.code.bo.CodeClassifyFullInfoBO;
import com.vci.ubcs.code.entity.CodeClassify;
import com.vci.ubcs.code.vo.pagemodel.CodeClassifyVO;
import com.vci.ubcs.omd.vo.BtmTypeAttributeVO;
import com.vci.ubcs.starter.exception.VciBaseException;
import com.vci.ubcs.starter.revision.model.TreeQueryObject;
import com.vci.ubcs.starter.web.pagemodel.BaseQueryObject;
import com.vci.ubcs.starter.web.pagemodel.DataGrid;import com.vci.ubcs.starter.web.pagemodel.Tree;
import org.apache.ibatis.annotations.Param;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.tool.api.R;
import java.io.File;
import java.util.Collection;
import java.util.List;
 
/**
 * 主题库分类服务接口
 *
 * @author ludc
 * @date 2022-01-20
 */
public interface ICodeClassifyService extends IService<CodeClassify> {
 
    /**
     * 使用查询封装器来查询
     * @param wrapper 查询封装器
     * @return 数据对象
     */
    List<CodeClassify> selectByWrapper(Wrapper wrapper);
 
    /**
     * 使用查询封装器来查询
     * @param wrapper 查询封装器
     * @return 数据对象
     */
    List<String> select1(Wrapper wrapper);
 
    /**
     * 自定义分页
     *
     * @param page
     * @param plCodeClassify
     * @return
     */
    IPage<CodeClassifyVO> selectPlCodeClassifyPage(IPage<CodeClassifyVO> page, CodeClassifyVO plCodeClassify);
 
    /**
     * 增加主题库分类
     * @param codeClassifyEntity 主题库分类数据传输对象
     * @return 执行结果
     */
    R addSave(CodeClassify codeClassifyEntity);
 
    /**
     * 修改主题库分类
     * @param codeClassifyEntity 主题库分类数据传输对象
     * @return 执行结果
     */
    R editSave(CodeClassify codeClassifyEntity);
 
    /**
     * 检查 主题库分类是否删除
     * @param codeClassify 主题库分类数据传输对象,必须要有oid和ts属性
     * @return 执行结果
     */
    R checkIsCanDelete(CodeClassify codeClassify);
 
    /**
     * 检查是否有下级是否关联了数据
     *
     * @param oid 主键
     * @return true 表示有引用,false表示没有引用
     */
    boolean checkChildIsLinked(String oid) ;
 
    /**
     * 校验是否有下级节点,不校验是否关联了数据
     *
     * @param oid 主键
     * @return true表示有下级,false表示没有下级
     */
    boolean checkHasChild(String oid) ;
 
    /**
     * 删除主题库分类
     * @param codeClassify 主题库分类数据传输对象,oid和ts需要传输
     * @return 删除结果反馈::success:成功,fail:失败
     */
    R deleteCodeClassify(CodeClassify codeClassify) ;
 
    /**
     * 启用、停用
     * @param oid 主键
     * @param lcStatus 状态
     * @return 执行结果
     */
    R updateLcStatus(String oid, String lcStatus);
 
    /**
     * 根据主键批量查询对象
     * @param oids 对象主键,使用逗号分隔,但是不能超过1000
     * @return 业务对象
     */
//    List<CodeClassify> selectByPrimaryKeyCollection(Collection<String> oids);
 
    /**
     * 主键批量获取主题库分类
     * @param oidCollections 主键集合,但是受性能影响,建议一次查询不超过10000个
     * @return 主题库分类显示对象
     */
    Collection<CodeClassifyVO> listCodeClassifyByOids(Collection<String> oidCollections) ;
 
    /**
     * 批量数据对象转换为显示对象
     * @param codeClassifys 数据对象列表
     * @return 显示对象
     */
    List<CodeClassifyVO> codeClassifyDO2VOs(Collection<CodeClassify>  codeClassifys);
 
    /**
     * 数据对象转换为显示对象
     * @param  codeClassify 数据对象
     * @return 显示对象
     */
    CodeClassifyVO codeClassifyDO2VO(CodeClassify codeClassify);
 
    /**
     * 参照树 主题库分类
     * @param treeQueryObject 树形查询对象
     * @return 主题库分类显示树
     */
    List<Tree> referTree(TreeQueryObject treeQueryObject);
 
    /**
     * 查询主题库分类 树
     * @param treeQueryObject 树查询对象
     * @return 主题库分类 显示树
     */
    List<Tree> treeCodeClassify(TreeQueryObject treeQueryObject);
 
    /**
     * 导出分类
     * @param oid 分类主键
     * @return excel文件路径
     */
    String exportClassify(String oid);
 
    /**
     * 获取子级的主题库分类
     *
     * @param codeClassifyOid 分类的主键
     * @param allLevel        是否所有的层级
     * @param fieldInPath 在路径中的字段
     * @param enable 是否只显示启用
     * @return 分类的显示对象
     */
    List<CodeClassifyVO> listChildrenClassify(String codeClassifyOid, boolean allLevel, String fieldInPath, boolean enable);
 
    /**
     * 创建导入模板
     * @return excel文件路径
     */
    String createImportExcel();
 
    /**
     * 导入分类
     * @param file1 文件的信息
     */
    void importClassify(File file1);
 
    /**
     * 获取分类关联的属性
     * @param baseQueryObject 查询对象,必须有codeClassifyOid,支持id和name两种查询条件
     * @return 属性的信息,包含默认的属性
     */
    DataGrid<BtmTypeAttributeVO> listClassifyLinkAttr(BaseQueryObject baseQueryObject) throws ServiceException;
 
    /**
     * 获取当前分类的顶层分类
     *
     * @param codeClassifyOid 分类的主键
     * @return 顶层分类的信息
     */
    CodeClassifyVO getTopClassifyVO(String codeClassifyOid);
 
    /**
     * 获取当前分类的所有上级分类(含本次查询层级号)
     * @param oid 主键
     * @return 所有的上级
     */
    List<CodeClassify> selectAllLevelParentByOid(String oid);
 
    /**
     * 使用编号的路径获取对象
     * @param idPath 编号的路径,一定要从最顶层节点开始,格式为xxx/yyy/zz 这样
     * @return 分类的显示对象
     */
    CodeClassifyVO getObjectByIdPath(String idPath);
 
    /**
     * 主题库的树
     * @param treeQueryObject 树形查询对象
     * @return 主题库显示树
     */
    List<Tree> treeTopCodeClassify(TreeQueryObject treeQueryObject);
 
    /**
     * 获取这个分类下的业务类型,当前没有就获取上级的第一个业务类型
     * @param oid 当前分类的oid
     * @return oid,id,name,btmtypeid,btmtypename
     */
    CodeClassify selectBtmOrParentBtm(String oid);
 
    /**
     * 获取所有下级数据
     * @param oid 数据主键
     * @return 查询结果
     */
    List<CodeClassify> selectAllLevelParents(String oid);
 
    /**
     * 主键获取主题库分类
     * @param oid 主键
     * @return 主题库分类显示对象
     */
    CodeClassifyVO getObjectByOid(String oid) throws VciBaseException;
 
    /**
     * 使用分类主键获取分类相关的所有信息
     * @param codeClassifyOid 分类的主键
     * @return 分类上级,下级的信息
     */
    CodeClassifyFullInfoBO getClassifyFullInfo(String codeClassifyOid);
 
    /**
     * 使用编号的路径获取对象
     * @param clsfNamePath 分类名称的路径,一定要从最顶层节点开始,格式为xxx/yyy/zz 这样
     * @return 分类的显示对象
     */
    CodeClassifyVO getObjectByClsfNamePath(String clsfNamePath);
 
    /***
     * 根据上级节点获取下级节点代号路径和名称路径
     * @param classifyId
     * @param enable
     * @return
     */
    public List<CodeClassifyVO> getIdPathToNamePathByParentId(String classifyId,boolean enable);
    /**
     * 根据树形查询对象来查询数据对象
     *
         * @param treeQueryObject 树形查询对象
     * @return 查询结果,数据对象
     */
    List<CodeClassifyVO> selectCodeClassifyDOByTree(TreeQueryObject treeQueryObject);
 
    /**
     * 统计子节点的个数
     *
     * @param codeClassifyOid 分类的主键
     * @return 个数
     */
    int countChildrenByClassifyOid(String codeClassifyOid);
 
    /***
     * 根据父节点查询下级叶子节点
     * @param parentId
     * @return
     */
    List<CodeClassifyVO> selectCodeClassifyVOByParentId(String parentId);
 
    /***
     * 根据库节点名称获取分类
     * @param libName
     * @return
     */
    List<CodeClassifyVO> getRMLibByName(String libName);
 
    /***
     * 根据分类描述备注和库节点查询分类信息
     * @param desc
     * @param codeLibName
     * @return
     */
    List<CodeClassifyVO> getRMTypeByDescAndLib(String desc,String codeLibName);
 
    /**
     * 根据分类描述备注和库节点查询分类信息
     * @param oid
     * @param fieldInPath
     * @return
     */
    List<CodeClassifyVO> selectAllClassifyByOid(String oid, String fieldInPath);
 
    /**
     * 根据顶层节点oid查询所有除当前节点以外所有不参与校验的分类oid
     * @param topOid
     * @param currentOid
     * @return
     */
    String selectLeafByParentClassifyOid(String topOid, String currentOid);
 
    /**
     * 流水依赖生成
     */
    R flowingDependencyGen(String classifyOid);
}