|
|
@@ -4,6 +4,7 @@ import com.github.pagehelper.PageHelper;
|
|
4
|
4
|
import com.github.pagehelper.PageInfo;
|
|
5
|
5
|
import com.ruoyi.common.core.domain.entity.SysRole;
|
|
6
|
6
|
import com.ruoyi.common.core.page.TableDataInfo;
|
|
|
7
|
+import com.ruoyi.common.utils.StringUtils;
|
|
7
|
8
|
import com.ruoyi.system.domain.entity.flow.MsCaseFlow;
|
|
8
|
9
|
import com.ruoyi.system.domain.entity.flow.MsCaseFlowRoleRelated;
|
|
9
|
10
|
import com.ruoyi.system.domain.vo.flow.MsCaseFlowSearchVO;
|
|
|
@@ -13,6 +14,7 @@ import com.ruoyi.system.mapper.flow.MsCaseFlowMapper;
|
|
13
|
14
|
import com.ruoyi.system.mapper.flow.MsCaseFlowRoleRelatedMapper;
|
|
14
|
15
|
import com.ruoyi.system.util.NewStringUtil;
|
|
15
|
16
|
import com.ruoyi.system.util.TableDataUtil;
|
|
|
17
|
+import org.bouncycastle.crypto.DataLengthException;
|
|
16
|
18
|
import org.springframework.beans.BeanUtils;
|
|
17
|
19
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
18
|
20
|
import org.springframework.stereotype.Service;
|
|
|
@@ -51,10 +53,13 @@ public class CaseFlowServiceImpl implements CaseFlowService {
|
|
51
|
53
|
//分页查询案件流程节点信息
|
|
52
|
54
|
Map<Integer, List<SysRole>> sysRoleMap = queryRoleByFlowId(null);
|
|
53
|
55
|
Example example = new Example(MsCaseFlow.class);
|
|
54
|
|
- example.setOrderByClause(" sort DESC ");
|
|
|
56
|
+ example.setOrderByClause(" sort ASC ");
|
|
55
|
57
|
Example.Criteria criteria = example.createCriteria();
|
|
56
|
|
- if (caseFlowSearchVO.getNodeName() != null) {
|
|
57
|
|
- criteria.andLike("nodeName", "%" + caseFlowSearchVO.getNodeName() + "%");
|
|
|
58
|
+ if (caseFlowSearchVO.getCaseStatusName() != null) {
|
|
|
59
|
+ criteria.andLike("caseStatusName", "%" + caseFlowSearchVO.getCaseStatusName() + "%");
|
|
|
60
|
+ }
|
|
|
61
|
+ if (caseFlowSearchVO.getNodeId() != null) {
|
|
|
62
|
+ criteria.andEqualTo("nodeId", caseFlowSearchVO.getNodeId());
|
|
58
|
63
|
}
|
|
59
|
64
|
PageHelper.startPage(caseFlowSearchVO.getPageNum(), caseFlowSearchVO.getPageSize());
|
|
60
|
65
|
List<MsCaseFlow> msCaseFlows = msCaseFlowMapper.selectByExample(example);
|
|
|
@@ -82,7 +87,7 @@ public class CaseFlowServiceImpl implements CaseFlowService {
|
|
82
|
87
|
//驳回节点
|
|
83
|
88
|
if (msCaseFlow.getBackFlowId() != null) {
|
|
84
|
89
|
MsCaseFlow msCaseFlow1 = msCaseFlowMapper.selectByPrimaryKey(msCaseFlow.getBackFlowId());
|
|
85
|
|
- temp.setBackFlowName(msCaseFlow1.getNodeName());
|
|
|
90
|
+ temp.setBackFlowName(msCaseFlow1 != null ? msCaseFlow1.getNodeName() : "");
|
|
86
|
91
|
}
|
|
87
|
92
|
list.add(temp);
|
|
88
|
93
|
}
|
|
|
@@ -201,8 +206,17 @@ public class CaseFlowServiceImpl implements CaseFlowService {
|
|
201
|
206
|
* @return
|
|
202
|
207
|
*/
|
|
203
|
208
|
@Override
|
|
204
|
|
- public Boolean deleteCaseFlow(MsCaseFlowVO caseFlowVO) {
|
|
|
209
|
+ public Boolean deleteCaseFlow(MsCaseFlowVO caseFlowVO) throws Exception {
|
|
205
|
210
|
if (caseFlowVO.getId() != null) {
|
|
|
211
|
+ //判断是否有其他的流程节点引用
|
|
|
212
|
+ Example example = new Example(MsCaseFlow.class);
|
|
|
213
|
+ Example.Criteria criteria = example.createCriteria();
|
|
|
214
|
+ criteria.andEqualTo("backFlowId", caseFlowVO.getId());
|
|
|
215
|
+ int count = msCaseFlowMapper.selectCountByExample(example);
|
|
|
216
|
+ if (count > 0) {
|
|
|
217
|
+ throw new Exception("当前流程节点被其他节点引用,无法删除");
|
|
|
218
|
+// return false;
|
|
|
219
|
+ }
|
|
206
|
220
|
//删除案件流程信息
|
|
207
|
221
|
int i = msCaseFlowMapper.deleteByPrimaryKey(caseFlowVO.getId());
|
|
208
|
222
|
if (i > 0) {
|
|
|
@@ -221,7 +235,7 @@ public class CaseFlowServiceImpl implements CaseFlowService {
|
|
221
|
235
|
* @return
|
|
222
|
236
|
*/
|
|
223
|
237
|
@Override
|
|
224
|
|
- public Boolean sortCaseFlow(MsCaseFlowSearchVO caseFlowVO) {
|
|
|
238
|
+ public Boolean sortCaseFlow(MsCaseFlowSearchVO caseFlowVO) throws Exception {
|
|
225
|
239
|
if (caseFlowVO != null && caseFlowVO.getId() != null && caseFlowVO.getSortType() != null) {
|
|
226
|
240
|
//升序查询所有案件流程信息
|
|
227
|
241
|
Example example = new Example(MsCaseFlow.class);
|
|
|
@@ -241,7 +255,8 @@ public class CaseFlowServiceImpl implements CaseFlowService {
|
|
241
|
255
|
if (caseFlowVO.getSortType() == 0) {
|
|
242
|
256
|
//降序(序号加1)
|
|
243
|
257
|
if (currentIndex == msCaseFlows.size() - 1) {
|
|
244
|
|
- return false;
|
|
|
258
|
+ throw new Exception("当前是流程最后一个节点,无需降序");
|
|
|
259
|
+// return false;
|
|
245
|
260
|
} else {
|
|
246
|
261
|
int nextIndex = currentIndex + 1;
|
|
247
|
262
|
MsCaseFlow current = msCaseFlows.get(currentIndex);
|
|
|
@@ -255,7 +270,8 @@ public class CaseFlowServiceImpl implements CaseFlowService {
|
|
255
|
270
|
} else if (caseFlowVO.getSortType() == 1) {
|
|
256
|
271
|
//升序(序号减1)
|
|
257
|
272
|
if (currentIndex == 0) {
|
|
258
|
|
- return false;
|
|
|
273
|
+ throw new Exception("当前是流程第一个节点,无需升序");
|
|
|
274
|
+// return false;
|
|
259
|
275
|
} else {
|
|
260
|
276
|
int lastIndex = currentIndex - 1;
|
|
261
|
277
|
MsCaseFlow current = msCaseFlows.get(currentIndex);
|