xiejun
2023-09-05 2a88f1118840323953d0fd28bdf03787bfd655de
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
package com.vci.ubcs.code.service;
 
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.vci.ubcs.code.dto.CodeBasicSecDTO;
import com.vci.ubcs.code.dto.CodeOrderDTO;
import com.vci.ubcs.code.dto.CodeRuleDTO;
import com.vci.ubcs.code.entity.CodeBasicSec;
import com.vci.ubcs.code.vo.CodeReferConfigVO;
import com.vci.ubcs.code.vo.pagemodel.CodeBasicSecVO;
import com.vci.ubcs.code.vo.pagemodel.CodeRuleVO;
import com.vci.ubcs.starter.exception.VciBaseException;
import com.vci.ubcs.starter.web.pagemodel.*;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.BeanUtil;
import org.springframework.util.CollectionUtils;
 
import java.util.*;
 
/**
 * 固定码段的码值服务接口
 *
 * @author ludc
 * @date 2022-01-24
 */
public interface ICodeBasicSecService extends IService<CodeBasicSec> {
 
    /**
     * 查询所有的码段基础信息
     * @param conditionMap 查询条件
     * @param query 分页对象
     * @return 执行结果
     * @throws VciBaseException 查询条件和分页出错的时候会抛出异常
     */
    IPage<CodeBasicSecVO> gridCodeBasicSec(Query query, Map<String,Object> conditionMap) throws VciBaseException;
 
    /**
     * 根据编码规则批量删除码段基本信息
     * @param codeRuleOid 编码规则主键
     * @return 执行结果
     */
    boolean batchDeleteSecByCodeRuleOid(String codeRuleOid);
 
    /**
     * 根据码段分类的类型判断属性是否是空的
     *
     * @param codeBasicSecDTO 码段基础信息数据传输对象
     * @return 有空的则传key-属性名 value-字段含义,没有空的则传 key-success value-true
     */
    KeyValue checkAttrNullableBySecType(CodeBasicSecDTO codeBasicSecDTO);
 
    /**
     * 增加码段基础信息
     * @param codeBasicSecDTO 码段基础信息数据传输对象
     * @return 执行结果
     * @throws VciBaseException 参数为空,唯一项,必输项不通过时会抛出异常
     */
    boolean addSave(CodeBasicSecDTO codeBasicSecDTO) throws VciBaseException;
 
    /**
     * 修改码段基础信息
     * @param codeBasicSecDTO 码段基础信息数据传输对象
     * @return 执行结果
     * @throws VciBaseException 参数为空,唯一项,必输项不通过时会抛出异常
     */
    boolean editSave(CodeBasicSecDTO codeBasicSecDTO) throws VciBaseException;
 
    /**
     * 删除码段基础信息
     * @param codeBasicSecDTO 码段基础信息数据传输对象,oid和ts需要传输
     * @return 删除结果反馈::success:成功,fail:失败
     * @throws VciBaseException 参数为空,被引用时抛出异常
     */
    R deleteCodeBasicSec(CodeBasicSecDTO codeBasicSecDTO) throws VciBaseException;
 
    /**
     * 主键删除码段基础信息
     * @param oid 码段基础信息主键
     * @return 删除结果反馈::success:成功,fail:失败
     * @throws VciBaseException 参数为空,被引用时抛出异常
     */
    R deleteCodeBasicSecByPrimaryKey(String oid) throws VciBaseException;
 
    /**
     * 主键获取码段基础信息
     * @param oid 主键
     * @return 码段基础信息显示对象
     * @throws VciBaseException 参数为空,数据不存在时会抛出异常
     */
    CodeBasicSecVO getObjectByOid(String oid) throws VciBaseException;
 
    /**
     * 主键批量获取码段基础信息
     * @param oidCollections 主键集合,但是受性能影响,建议一次查询不超过10000个
     * @return 码段基础信息显示对象
     * @throws VciBaseException 查询出现异常时会抛出
     */
    Collection<CodeBasicSecVO> listCodeBasicSecByOids(Collection<String> oidCollections) throws VciBaseException;
 
    /**
     * 参照码段基础信息列表
     * @param conditionMap 查询条件
     * @param query 分页和排序
     * @return 码段基础信息显示对象列表,生效的内容
     * @throws VciBaseException 查询条件和分页出错的时候会抛出异常
     */
    IPage<CodeBasicSecVO> refDataGridCodeBasicSec(Query query ,Map<String,Object> conditionMap) throws VciBaseException;
 
    /**
     * 参照分类的码段
     * @param conditionMap 查询条件
     * @param query 分页和排序
     * @return 码段的内容
     */
    IPage<CodeBasicSecVO> refDataGridClassifySec(Query query ,Map<String,Object> conditionMap);
 
    /**
     * 克隆码段信息
     * @param oidList 源码段信息主键集合
     * @param pkCodeRule 目标编码规则
     * @return 克隆结果反馈::success:成功,fail:失败
     */
    R cloneCodeBasicSec(List<String> oidList, String pkCodeRule);
 
    /**
     * 查询目标分类码段所在的树结构
     * @param oid 目标分类码段主键
     * @return 分类码段树结构
     */
    //List<Tree> gridCodeClassifySecTree(String oid);
 
    /**
     * 上移
     * @param oid 主键
     */
    boolean upOrderNum(String oid);
 
    /**
     * 下移
     * @param oid 主键
     */
    boolean downOrderNum(String oid);
 
    /**
     * 树形结构查询oid
     * @param codeClassifySecOid
     * @return
     */
    List<String> getOidByCodeclassifysecOid(String codeClassifySecOid);
 
    /**
     * 使用规则的主键获取对应的码段内容
     * @param ruleOid 规则的内容
     * @return 码段的内容
     */
    List<CodeBasicSecVO> listCodeBasicSecByRuleOid(String ruleOid);
 
    /**
     * 批量数据对象转换为显示对象
     *
     * @param codeBasicSecDOs 数据对象列表
     * @param hasFixedValue 是否有固定值
     * @return 显示对象
     * @throws VciBaseException 参数为空或者不存在的时候会抛出异常
     */
    List<CodeBasicSecVO> codeBasicSecDO2VOs(Collection<CodeBasicSec> codeBasicSecDOs, boolean hasFixedValue) throws VciBaseException;
 
    /**
     * 批量数据对象转换为显示对象
     * @param codeBasicSecDOs 数据对象列表
     * @return 显示对象
     * @throws VciBaseException 参数为空或者不存在的时候会抛出异常
     */
    List<CodeBasicSecVO> codeBasicSecDO2VOs(Collection<CodeBasicSec>  codeBasicSecDOs) throws VciBaseException;
 
    /**
     * 数据对象转换为显示对象
     * @param  codeBasicSecDO 数据对象
     * @return 显示对象
     * @throws VciBaseException 拷贝属性出错的时候会抛出异常
     */
    CodeBasicSecVO codeBasicSecDO2VO(CodeBasicSec codeBasicSecDO) throws VciBaseException;
 
    /**
     * 根据编码规则主键获取编码下的流水依赖码段
     * @param oid 编码规则主键
     * @return
     * @throws VciBaseException
     */
    CodeRuleVO getSerialNumberDepend(String oid) throws VciBaseException;
 
    /**
     * 设置最大流水号
     * @param codeOrderDTO 编码申请传输对象
     * @return
     * @throws VciBaseException
     */
    String setMaxSerialNumberForCodeRule(CodeOrderDTO codeOrderDTO) throws VciBaseException;
}