lyh
2025-06-25 6d44fa56ae000ecc3b34c681e16d721789c1f49e
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
package org.jeecg.modules.dnc.service;
 
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.common.api.vo.Result;
import org.jeecg.modules.dnc.dto.ComponentExt;
import org.jeecg.modules.dnc.entity.ComponentInfo;
import org.jeecg.modules.dnc.entity.DocInfo;
import org.jeecg.modules.dnc.entity.PermissionStream;
import org.jeecg.modules.dnc.request.TreeInfoRequest;
import org.jeecg.modules.system.entity.MdcProduction;
import org.jeecg.modules.system.entity.SysUser;
 
import java.util.Collection;
import java.util.List;
public interface IComponentInfoService extends IService<ComponentInfo> {
 
    /**
     * 新增
     * @param componentInfo
     * @return
     */
    boolean addComponentInfo(ComponentInfo componentInfo);
 
    /**
     * 编辑
     * @param id
     * @param componentInfo
     * @return
     */
    boolean editComponentInfo(String id ,ComponentInfo componentInfo);
 
    /**
     * 获取所有的部件父子关系
     * @return
     */
    List<ComponentExt> findExtAll();
 
 
    /**
     * 根据用户id获取部件信息
     * @param userId
     * @return
     */
    List<ComponentExt> getByUserPerms(String userId);
 
    /**
     * 根据用户id和查询条件获取部件信息
     * @param userId
     * @param queryParam
     * @return
     */
    List<ComponentInfo> getByUserPerms(String userId, String queryParam);
 
    /**
     * 根据用户id获取部件信息 向上查询父
     * @param userId
     * @return
     */
    List<ComponentExt> getByUserPermsAs(String userId);
 
    /**
     * 根据产品id获取
     * @param productId
     * @return
     */
    List<ComponentInfo> getByProductId(String productId);
 
    /**
     * 根据产品id删除部件
     * @param componentInfoList
     * @return
     */
    boolean deleteCollections(List<ComponentInfo> componentInfoList);
 
    /**
     * 根据部件
     * @param id
     * @return
     */
    boolean deleteComponentInfo(String id);
 
    /**
     * 获取节点下的所有子节点
     * @param componentId
     * @return
     */
    List<ComponentInfo> getByParentId(String componentId);
 
    /**
     * 分配用户权限
     * @param componentInfo
     * @param userList
     * @return
     */
    boolean assignAddUser(ComponentInfo componentInfo, Collection<SysUser> userList);
    /**
     * 移除用户权限
     * @param componentInfo
     * @param userList
     * @return
     */
    boolean assignRemoveUser(ComponentInfo componentInfo, Collection<SysUser> userList);
    /**
     * 分配部门权限
     * @param componentInfo
     * @param departmentList
     * @return
     */
    boolean assignAddDepart(ComponentInfo componentInfo, Collection<MdcProduction> departmentList);
 
    /**
     * 移除部门权限
     * @param componentInfo
     * @param departmentList
     * @return
     */
    boolean assignRemoveDepart(ComponentInfo componentInfo, Collection<MdcProduction> departmentList);
 
    /**
     * 获取唯一 部件编号
     * @param code
     * @return
     */
    ComponentInfo getByCode(String code);
 
    /**
     * 检查pn码的有效性
     * @param pnCode
     * @return
     */
    PermissionStream validateComponentOrPartsPnCode(String pnCode);
 
    /**
     * 根据产品id和用户id获取部门列表
     * @param paramId
     * @param userId
     * @return
     */
    List<ComponentInfo> getByProductIdAndUserId(String paramId, String userId);
 
    /**
     * 根据父Id和用户id获取部门列表
     * @param parentId
     * @param userId
     * @return
     */
    List<ComponentInfo> getByParentIdAndUserId(String parentId, String userId);
 
    /**
     * 通过零件号、材质等查询对应电子样板
     * @param treeInfoRequest
     * @return
     */
    List<DocInfo> getByComponentInfo(TreeInfoRequest treeInfoRequest);
 
    /**
     * 查询可以被引用的部件
     * @param componentInfo
     * @param pageNo
     * @param pageSize
     * @return
     */
    IPage<ComponentInfo> getByComponentId(ComponentInfo componentInfo, Integer pageNo, Integer pageSize);
 
    /**
     * 借用部件(可批量) - 原有部件id,新部件ids
     * @param oldId,newIds
     * @return
     */
    Result<?> borrowComponent(String oldId, String newIds);
 
    boolean assignPermission(Object entity, Collection<SysUser> userList, boolean isAdd);
 
    boolean assignDepartPermission(Object entity, Collection<MdcProduction> departments, boolean isAdd);
}