|
|
@@ -2,6 +2,7 @@ package com.ruoyi.wisdomarbitrate.service.impl;
|
|
2
|
2
|
|
|
3
|
3
|
|
|
4
|
4
|
import cn.hutool.core.collection.CollectionUtil;
|
|
|
5
|
+import cn.hutool.core.util.IdcardUtil;
|
|
5
|
6
|
import cn.hutool.core.util.StrUtil;
|
|
6
|
7
|
import com.alibaba.fastjson.JSON;
|
|
7
|
8
|
import com.alibaba.fastjson.JSONArray;
|
|
|
@@ -14,11 +15,13 @@ import com.ruoyi.common.constant.CaseApplicationConstants;
|
|
14
|
15
|
import com.ruoyi.common.core.domain.AjaxResult;
|
|
15
|
16
|
import com.ruoyi.common.core.domain.entity.*;
|
|
16
|
17
|
import com.ruoyi.common.core.domain.model.LoginUser;
|
|
|
18
|
+import com.ruoyi.common.enums.UpdateSubmitStatus;
|
|
17
|
19
|
import com.ruoyi.common.exception.EsignDemoException;
|
|
18
|
20
|
import com.ruoyi.common.exception.ServiceException;
|
|
19
|
21
|
import com.ruoyi.common.utils.*;
|
|
20
|
22
|
import com.ruoyi.common.utils.file.SaaSAPIFileUtils;
|
|
21
|
23
|
import com.ruoyi.common.core.domain.entity.SysUser;
|
|
|
24
|
+import com.ruoyi.common.utils.thread.ThreadPoolUtil;
|
|
22
|
25
|
import com.ruoyi.system.domain.SysUserRole;
|
|
23
|
26
|
import com.ruoyi.system.mapper.SysDeptMapper;
|
|
24
|
27
|
import com.ruoyi.system.mapper.SysRoleMapper;
|
|
|
@@ -59,9 +62,11 @@ import java.util.*;
|
|
59
|
62
|
import java.util.regex.Pattern;
|
|
60
|
63
|
import java.util.stream.Collectors;
|
|
61
|
64
|
|
|
|
65
|
+import static com.ruoyi.common.core.domain.AjaxResult.success;
|
|
62
|
66
|
import static com.ruoyi.common.utils.PageUtils.startPage;
|
|
63
|
67
|
import static com.ruoyi.common.utils.SecurityUtils.getLoginUser;
|
|
64
|
68
|
import static com.ruoyi.common.utils.SecurityUtils.getUsername;
|
|
|
69
|
+import static com.ruoyi.wisdomarbitrate.utils.CaseLogUtils.insertCaseLog;
|
|
65
|
70
|
|
|
66
|
71
|
|
|
67
|
72
|
@Service
|
|
|
@@ -107,13 +112,17 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
107
|
112
|
|
|
108
|
113
|
@Autowired
|
|
109
|
114
|
private SealManageMapper sealManageMapper;
|
|
|
115
|
+ @Autowired
|
|
|
116
|
+ private CaseApplicationLogMapper caseApplicationLogMapper;
|
|
|
117
|
+ @Autowired
|
|
|
118
|
+ private CaseAffiliateLogMapper caseAffiliateLogMapper;
|
|
110
|
119
|
|
|
111
|
120
|
// 手机号正则
|
|
112
|
121
|
private static final Pattern TELEPHONE_REGX = Pattern.compile("^1(3\\d|4[5-9]|5[0-35-9]|6[2567]|7[0-8]|8\\d|9[0-35-9])\\d{8}$");
|
|
113
|
122
|
// 邮箱正则
|
|
114
|
123
|
private static final Pattern EMAIL_PATTERN = Pattern.compile("^[a-zA-Z0-9_+&*-]+(?:\\.[a-zA-Z0-9_+&*-]+)*@(?:[a-zA-Z0-9-]+\\.)+[a-zA-Z]{2,7}$");
|
|
115
|
124
|
// 身份证号码正则表达式
|
|
116
|
|
- private static final String ID_REGEX = "^(\\d{14}|\\d{17})(\\d|[Xx])$";
|
|
|
125
|
+ private static final String ID_REGEX = "^(\\\\d{15}$|\\\\d{18}$|\\\\d{17}([0-9]|X))$";
|
|
117
|
126
|
|
|
118
|
127
|
/**
|
|
119
|
128
|
* 数据权限:1.每个人不同的角色,而每个角色可以操作不同的案件状态
|
|
|
@@ -148,40 +157,47 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
148
|
157
|
}
|
|
149
|
158
|
|
|
150
|
159
|
for (SysRole role : roles) {
|
|
|
160
|
+ if(StrUtil.isEmpty(role.getRoleName())){
|
|
|
161
|
+ continue;
|
|
|
162
|
+ }
|
|
151
|
163
|
// 超级管理员和仲裁委(部门长)案件,可查看所有案件 √
|
|
152
|
|
- if (role.getRoleName().equals("超级管理员")
|
|
|
164
|
+ if ("超级管理员".equals(role.getRoleName())
|
|
153
|
165
|
) {
|
|
154
|
166
|
return caseApplicationMapper.selectAdminCaseApplicationList(caseApplication);
|
|
155
|
167
|
}
|
|
156
|
|
- if (role.getRoleName().equals("仲裁委")
|
|
157
|
|
- || role.getRoleName().equals("部门长")) {
|
|
|
168
|
+ if ("仲裁委".equals(role.getRoleName())
|
|
|
169
|
+ || "部门长".equals(role.getRoleName())) {
|
|
158
|
170
|
List<Integer> caseStatusList = new ArrayList<>();
|
|
159
|
171
|
caseStatusList.add(CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL);
|
|
160
|
172
|
caseStatusList.add(CaseApplicationConstants.ARBITRATED_SEAL);
|
|
161
|
173
|
caseApplication.setDeptHeadStatus(caseStatusList);
|
|
|
174
|
+ caseApplication.setIsOtherRole(1);
|
|
162
|
175
|
}
|
|
163
|
|
- if (role.getRoleName().equals("仲裁员")) {
|
|
|
176
|
+ if ("仲裁员".equals(role.getRoleName())) {
|
|
164
|
177
|
caseApplication.setUserId(String.valueOf(userId));
|
|
|
178
|
+ caseApplication.setIsOtherRole(1);
|
|
165
|
179
|
}
|
|
166
|
|
- if (role.getRoleName().equals("财务")) {
|
|
|
180
|
+ if ("财务".equals(role.getRoleName())) {
|
|
|
181
|
+ caseApplication.setIsOtherRole(1);
|
|
167
|
182
|
caseApplication.setFinanceStatus(CaseApplicationConstants.PENDING_PAYMENT_CONFIRM);
|
|
168
|
183
|
}
|
|
169
|
|
- if (role.getRoleName().equals("法律顾问")) {
|
|
|
184
|
+ if ("法律顾问".equals(role.getRoleName())) {
|
|
170
|
185
|
// 查询角色有关的用户部门
|
|
171
|
|
- // List<Long> deptIds = sysDeptMapper.selectUserDeptListByRoleId(role.getRoleId());
|
|
172
|
186
|
List<Long> deptIds = new ArrayList<>();
|
|
173
|
187
|
deptIds.add(sysUser.getDeptId());
|
|
174
|
188
|
caseApplication.setDeptIds(deptIds);
|
|
175
|
189
|
}
|
|
176
|
|
- if (role.getRoleName().equals("申请人")) {
|
|
|
190
|
+ if ("申请人".equals(role.getRoleName())) {
|
|
177
|
191
|
// 查询有关的用户部门
|
|
178
|
192
|
caseApplication.setApplicationOrganId(String.valueOf(sysUser.getDeptId()));
|
|
179
|
193
|
}
|
|
180
|
|
- if (role.getRoleName().equals("被申请人")) {
|
|
|
194
|
+ if ("被申请人".equals(role.getRoleName())) {
|
|
|
195
|
+ caseApplication.setIsOtherRole(1);
|
|
181
|
196
|
//
|
|
182
|
197
|
caseApplication.setIdCard(String.valueOf(sysUser.getIdCard()));
|
|
183
|
198
|
}
|
|
184
|
|
- if (role.getRoleName().equals("代理人")) {
|
|
|
199
|
+ if ("代理人".equals(role.getRoleName())) {
|
|
|
200
|
+ caseApplication.setIsOtherRole(1);
|
|
185
|
201
|
// 查询角色有关的用户部门
|
|
186
|
202
|
// List<Long> agentDeptIds = sysDeptMapper.selectUserDeptListByRoleId(role.getRoleId());
|
|
187
|
203
|
List<Long> agentDeptIds = new ArrayList<>();
|
|
|
@@ -192,7 +208,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
192
|
208
|
|
|
193
|
209
|
|
|
194
|
210
|
// 根据条件查询申请人,被申请人,仲裁员,法律顾问案件
|
|
195
|
|
- return caseApplicationMapper.selectCaseApplicationList(caseApplication);
|
|
|
211
|
+// return caseApplicationMapper.selectCaseApplicationList(caseApplication);
|
|
|
212
|
+ return caseApplicationMapper.selectCaseApplicationList1(caseApplication);
|
|
196
|
213
|
}
|
|
197
|
214
|
|
|
198
|
215
|
}
|
|
|
@@ -215,40 +232,47 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
215
|
232
|
CaseApplication caseApplication = new CaseApplication();
|
|
216
|
233
|
List<Integer> caseStatusList = new ArrayList<>();
|
|
217
|
234
|
for (SysRole role : roles) {
|
|
|
235
|
+ if(StrUtil.isEmpty(role.getRoleName())){
|
|
|
236
|
+ continue;
|
|
|
237
|
+ }
|
|
218
|
238
|
// 超级管理员和仲裁委(部门长)案件,可查看所有案件 √
|
|
219
|
239
|
if (role.getRoleName().equals("超级管理员")
|
|
220
|
240
|
) {
|
|
221
|
241
|
return caseApplicationMapper.selectAdminCaseToDoCount();
|
|
222
|
242
|
}
|
|
223
|
|
- if (role.getRoleName().equals("仲裁委")
|
|
224
|
|
- || role.getRoleName().equals("部门长")) {
|
|
225
|
|
-
|
|
|
243
|
+ if ("仲裁委".equals(role.getRoleName())
|
|
|
244
|
+ || "部门长".equals(role.getRoleName())) {
|
|
|
245
|
+ caseApplication.setIsOtherRole(1);
|
|
226
|
246
|
caseStatusList.add(CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL);
|
|
227
|
247
|
caseStatusList.add(CaseApplicationConstants.ARBITRATED_SEAL);
|
|
228
|
248
|
caseApplication.setDeptHeadStatus(caseStatusList);
|
|
229
|
249
|
}
|
|
230
|
|
- if (role.getRoleName().equals("仲裁员")) {
|
|
|
250
|
+ if ("仲裁员".equals(role.getRoleName())) {
|
|
|
251
|
+ caseApplication.setIsOtherRole(1);
|
|
231
|
252
|
caseApplication.setUserId(String.valueOf(userId));
|
|
232
|
253
|
}
|
|
233
|
|
- if (role.getRoleName().equals("财务")) {
|
|
|
254
|
+ if ("财务".equals(role.getRoleName())) {
|
|
|
255
|
+ caseApplication.setIsOtherRole(1);
|
|
234
|
256
|
caseApplication.setFinanceStatus(CaseApplicationConstants.PENDING_PAYMENT_CONFIRM);
|
|
235
|
257
|
}
|
|
236
|
|
- if (role.getRoleName().equals("法律顾问")) {
|
|
|
258
|
+ if ("法律顾问".equals(role.getRoleName())) {
|
|
237
|
259
|
// 查询角色有关的用户部门
|
|
238
|
260
|
// List<Long> deptIds = sysDeptMapper.selectUserDeptListByRoleId(role.getRoleId());
|
|
239
|
261
|
List<Long> deptIds = new ArrayList<>();
|
|
240
|
262
|
deptIds.add(sysUser.getDeptId());
|
|
241
|
263
|
caseApplication.setDeptIds(deptIds);
|
|
242
|
264
|
}
|
|
243
|
|
- if (role.getRoleName().equals("申请人")) {
|
|
|
265
|
+ if ("申请人".equals(role.getRoleName())) {
|
|
244
|
266
|
// 查询角色有关的用户部门
|
|
245
|
267
|
caseApplication.setApplicationOrganId(String.valueOf(sysUser.getDeptId()));
|
|
246
|
268
|
}
|
|
247
|
|
- if (role.getRoleName().equals("被申请人")) {
|
|
|
269
|
+ if ("被申请人".equals(role.getRoleName())) {
|
|
|
270
|
+ caseApplication.setIsOtherRole(1);
|
|
248
|
271
|
//
|
|
249
|
272
|
caseApplication.setIdCard(String.valueOf(sysUser.getIdCard()));
|
|
250
|
273
|
}
|
|
251
|
|
- if (role.getRoleName().equals("代理人")) {
|
|
|
274
|
+ if ("代理人".equals(role.getRoleName())) {
|
|
|
275
|
+ caseApplication.setIsOtherRole(1);
|
|
252
|
276
|
// 查询角色有关的用户部门
|
|
253
|
277
|
// List<Long> agentDeptIds = sysDeptMapper.selectUserDeptListByRoleId(role.getRoleId());
|
|
254
|
278
|
List<Long> agentDeptIds = new ArrayList<>();
|
|
|
@@ -259,7 +283,11 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
259
|
283
|
|
|
260
|
284
|
|
|
261
|
285
|
// 根据条件查询申请人,被申请人,仲裁员,法律顾问案件
|
|
262
|
|
- return caseApplicationMapper.selectTodoCountByRole(caseApplication);
|
|
|
286
|
+ ToDoCount toDoCount = caseApplicationMapper.selectTodoCountByRole(caseApplication);
|
|
|
287
|
+ if(toDoCount==null){
|
|
|
288
|
+ return new ToDoCount();
|
|
|
289
|
+ }
|
|
|
290
|
+ return toDoCount;
|
|
263
|
291
|
}
|
|
264
|
292
|
|
|
265
|
293
|
@Override
|
|
|
@@ -280,7 +308,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
280
|
308
|
records.addAll(recordsnofinish);
|
|
281
|
309
|
datas.put("allCasenode", records);
|
|
282
|
310
|
datas.put("caseStatus", caseStatus);
|
|
283
|
|
- return AjaxResult.success(datas);
|
|
|
311
|
+ return success(datas);
|
|
284
|
312
|
|
|
285
|
313
|
}
|
|
286
|
314
|
|
|
|
@@ -298,7 +326,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
298
|
326
|
// 发送开庭日期通知短信
|
|
299
|
327
|
sendHearDateMessage(caseApplication, request, "1975139");
|
|
300
|
328
|
// 新增日志
|
|
301
|
|
- CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.PENDING_OPENCOURT_HEAR, "");
|
|
|
329
|
+ insertCaseLog(caseApplication.getId(), CaseApplicationConstants.PENDING_OPENCOURT_HEAR, "");
|
|
302
|
330
|
return rows;
|
|
303
|
331
|
}
|
|
304
|
332
|
|
|
|
@@ -511,7 +539,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
511
|
539
|
}
|
|
512
|
540
|
}
|
|
513
|
541
|
|
|
514
|
|
- return AjaxResult.success();
|
|
|
542
|
+ return success();
|
|
515
|
543
|
|
|
516
|
544
|
}
|
|
517
|
545
|
|
|
|
@@ -846,6 +874,11 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
846
|
874
|
|
|
847
|
875
|
}
|
|
848
|
876
|
|
|
|
877
|
+ /**
|
|
|
878
|
+ * 新增案件
|
|
|
879
|
+ * @param caseApplication
|
|
|
880
|
+ * @return
|
|
|
881
|
+ */
|
|
849
|
882
|
@Override
|
|
850
|
883
|
@Transactional
|
|
851
|
884
|
public int insertcaseApplication(CaseApplication caseApplication) {
|
|
|
@@ -860,8 +893,12 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
860
|
893
|
String caseNum = generateCaseNum();
|
|
861
|
894
|
caseApplication.setCaseNum(caseNum);
|
|
862
|
895
|
caseApplication.setCreateBy(getUsername());
|
|
|
896
|
+ caseApplication.setVersion(1);
|
|
863
|
897
|
// 新增立案信息
|
|
864
|
898
|
int rows = caseApplicationMapper.insertCaseApplication(caseApplication);
|
|
|
899
|
+ if(rows==0){
|
|
|
900
|
+ return rows;
|
|
|
901
|
+ }
|
|
865
|
902
|
List<CaseAffiliate> caseAffiliates = caseApplication.getCaseAffiliates();
|
|
866
|
903
|
Map<String, Long> deptMap = new HashMap<>();
|
|
867
|
904
|
// 判断申请机构
|
|
|
@@ -876,6 +913,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
876
|
913
|
Long roleId = roleMapper.selectRoleIdByName("申请人");
|
|
877
|
914
|
for (CaseAffiliate caseAffiliate : caseAffiliates) {
|
|
878
|
915
|
caseAffiliate.setCaseAppliId(caseApplication.getId());
|
|
|
916
|
+ caseAffiliate.setCaseAppliLogId(caseApplication.getId());
|
|
879
|
917
|
if (caseAffiliate.getIdentityType() == 1 && StrUtil.isNotEmpty(caseAffiliate.getName())) {
|
|
880
|
918
|
// 将组织机构id设为申请人名称
|
|
881
|
919
|
if (deptMap.containsKey(caseAffiliate.getName())) {
|
|
|
@@ -918,7 +956,19 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
918
|
956
|
}
|
|
919
|
957
|
}
|
|
920
|
958
|
// 新增日志
|
|
921
|
|
- CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CASE_APPLICATION, "");
|
|
|
959
|
+ insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CASE_APPLICATION, "");
|
|
|
960
|
+ // 异步新增案件日志
|
|
|
961
|
+ ThreadPoolUtil.execute(() -> {
|
|
|
962
|
+ caseApplication.setCaseAppliId(caseApplication.getId());
|
|
|
963
|
+ caseApplication.setUpdateSubmitStatus(UpdateSubmitStatus.UNCOMMITTED.getCode());
|
|
|
964
|
+ int insertRow = caseApplicationLogMapper.insert(caseApplication);
|
|
|
965
|
+ if (insertRow != 0 && CollectionUtil.isNotEmpty(caseAffiliates)) {
|
|
|
966
|
+ caseAffiliates.forEach(caseAffiliate -> caseAffiliate.setCaseAppliLogId(caseApplication.getId()));
|
|
|
967
|
+ // 插入案件日志人员相关表
|
|
|
968
|
+ caseAffiliateLogMapper.batchCaseAffiliate(caseAffiliates);
|
|
|
969
|
+ }
|
|
|
970
|
+ });
|
|
|
971
|
+
|
|
922
|
972
|
return rows;
|
|
923
|
973
|
}
|
|
924
|
974
|
|
|
|
@@ -950,15 +1000,17 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
950
|
1000
|
|
|
951
|
1001
|
@Override
|
|
952
|
1002
|
@Transactional
|
|
953
|
|
- public int editCaseApplication(CaseApplication caseApplication) {
|
|
|
1003
|
+ public AjaxResult editCaseApplication(CaseApplication caseApplication) {
|
|
954
|
1004
|
//根据仲裁费用计费规则计算应缴费用
|
|
955
|
1005
|
//暂时设置计费比率为0.01
|
|
956
|
1006
|
BigDecimal feeRate = new BigDecimal("0.01");
|
|
957
|
1007
|
BigDecimal feePayable = caseApplication.getCaseSubjectAmount().multiply(feeRate).setScale(2, RoundingMode.HALF_UP);
|
|
958
|
1008
|
caseApplication.setFeePayable(feePayable);
|
|
959
|
1009
|
caseApplication.setUpdateBy(getUsername());
|
|
960
|
|
-
|
|
961
|
|
- int rows = caseApplicationMapper.updataCaseApplication(caseApplication);
|
|
|
1010
|
+ // int rows = caseApplicationMapper.updataCaseApplication(caseApplication);
|
|
|
1011
|
+// if(rows==0){
|
|
|
1012
|
+// return rows;
|
|
|
1013
|
+// }
|
|
962
|
1014
|
List<CaseAffiliate> caseAffiliates = caseApplication.getCaseAffiliates();
|
|
963
|
1015
|
if (caseAffiliates != null && caseAffiliates.size() > 0) {
|
|
964
|
1016
|
// 查询所有的组织机构,组装成map
|
|
|
@@ -1001,7 +1053,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
1001
|
1053
|
|
|
1002
|
1054
|
}
|
|
1003
|
1055
|
|
|
1004
|
|
- caseAffiliateMapper.updataCaseAffiliate(caseAffiliate);
|
|
|
1056
|
+ // caseAffiliateMapper.updataCaseAffiliate(caseAffiliate);
|
|
1005
|
1057
|
}
|
|
1006
|
1058
|
|
|
1007
|
1059
|
}
|
|
|
@@ -1013,8 +1065,29 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
1013
|
1065
|
}
|
|
1014
|
1066
|
|
|
1015
|
1067
|
}
|
|
|
1068
|
+ // 根据案件id查询最新版本号
|
|
|
1069
|
+ Integer maxVersion = caseApplicationLogMapper.selectMaxVersionByCaseId(caseApplication.getId());
|
|
|
1070
|
+ if (maxVersion == null) {
|
|
|
1071
|
+ maxVersion = 1;
|
|
|
1072
|
+ }
|
|
|
1073
|
+ caseApplication.setVersion(maxVersion+1);
|
|
|
1074
|
+ // 将修改提交状态改为未提交
|
|
|
1075
|
+ caseApplication.setUpdateSubmitStatus(UpdateSubmitStatus.UNCOMMITTED.getCode());
|
|
|
1076
|
+ // 修改案件表的版本号
|
|
|
1077
|
+ // caseApplicationMapper.updateVersionById(caseApplication.getId(),caseApplication.getVersion());
|
|
1016
|
1078
|
|
|
1017
|
|
- return rows;
|
|
|
1079
|
+ // 异步新增案件日志
|
|
|
1080
|
+ ThreadPoolUtil.execute(() -> {
|
|
|
1081
|
+ caseApplication.setCaseAppliId(caseApplication.getId());
|
|
|
1082
|
+ int insertRow = caseApplicationLogMapper.insert(caseApplication);
|
|
|
1083
|
+ if (insertRow != 0 && CollectionUtil.isNotEmpty(caseAffiliates)) {
|
|
|
1084
|
+ caseAffiliates.forEach(caseAffiliate -> caseAffiliate.setCaseAppliLogId(caseApplication.getId()));
|
|
|
1085
|
+ // 插入案件日志人员相关表
|
|
|
1086
|
+ caseAffiliateLogMapper.batchCaseAffiliate(caseAffiliates);
|
|
|
1087
|
+ }
|
|
|
1088
|
+ });
|
|
|
1089
|
+
|
|
|
1090
|
+ return success();
|
|
1018
|
1091
|
}
|
|
1019
|
1092
|
|
|
1020
|
1093
|
|
|
|
@@ -1132,7 +1205,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
1132
|
1205
|
application.setCaseStatus(CaseApplicationConstants.CASE_CHECK);
|
|
1133
|
1206
|
rows += caseApplicationMapper.submitCaseApplication(application);
|
|
1134
|
1207
|
// 新增日志
|
|
1135
|
|
- CaseLogUtils.insertCaseLog(application.getId(), CaseApplicationConstants.CASE_CHECK, "");
|
|
|
1208
|
+ insertCaseLog(application.getId(), CaseApplicationConstants.CASE_CHECK, "");
|
|
1136
|
1209
|
}
|
|
1137
|
1210
|
return rows;
|
|
1138
|
1211
|
}
|
|
|
@@ -1140,16 +1213,17 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
1140
|
1213
|
@Override
|
|
1141
|
1214
|
@Transactional
|
|
1142
|
1215
|
public int deletecaseApplicationByIds(List<Long> ids) {
|
|
1143
|
|
-
|
|
|
1216
|
+ int rows = caseApplicationMapper.batchDeletecaseApplication(ids);
|
|
1144
|
1217
|
caseAffiliateMapper.batchDeletecaseAffiliate(ids);
|
|
1145
|
|
- return caseApplicationMapper.batchDeletecaseApplication(ids);
|
|
|
1218
|
+ caseApplicationLogMapper.batchDeleteLog(ids);
|
|
|
1219
|
+ return rows;
|
|
1146
|
1220
|
}
|
|
1147
|
1221
|
|
|
1148
|
1222
|
@Override
|
|
1149
|
1223
|
public CaseApplication selectCaseApplication(CaseApplication caseApplication) {
|
|
1150
|
|
- CaseApplication caseApplicationselect = caseApplicationMapper.selectCaseApplication(caseApplication);
|
|
1151
|
|
- CaseAffiliate caseAffiliate = new CaseAffiliate();
|
|
1152
|
|
- caseAffiliate.setCaseAppliId(caseApplication.getId());
|
|
|
1224
|
+ CaseApplication caseApplicationselect=caseApplicationLogMapper.selectByCaseIdAndVersion(caseApplication.getId(),caseApplication.getVersion());
|
|
|
1225
|
+ caseApplicationselect.setId(caseApplication.getId());
|
|
|
1226
|
+
|
|
1153
|
1227
|
|
|
1154
|
1228
|
ArbitrateRecord arbitrateRecord = new ArbitrateRecord();
|
|
1155
|
1229
|
arbitrateRecord.setCaseAppliId(caseApplication.getId());
|
|
|
@@ -1178,8 +1252,9 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
1178
|
1252
|
}
|
|
1179
|
1253
|
}
|
|
1180
|
1254
|
caseApplicationselect.setCaseAttachList(caseAttachList);
|
|
1181
|
|
-
|
|
1182
|
|
- List<CaseAffiliate> caseAffiliatListeselect = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate);
|
|
|
1255
|
+ CaseAffiliate caseAffiliateLog = new CaseAffiliate();
|
|
|
1256
|
+ caseAffiliateLog.setCaseAppliLogId(caseApplication.getCaseLogId());
|
|
|
1257
|
+ List<CaseAffiliate> caseAffiliatListeselect = caseAffiliateLogMapper.selectCaseAffiliate(caseAffiliateLog);
|
|
1183
|
1258
|
if (caseAffiliatListeselect != null) {
|
|
1184
|
1259
|
// 查询组织机构
|
|
1185
|
1260
|
List<SysDept> sysDepts = sysDeptMapper.selectDeptList(new SysDept());
|
|
|
@@ -1219,6 +1294,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
1219
|
1294
|
StringBuilder failureMsg = new StringBuilder();
|
|
1220
|
1295
|
StringBuilder successMsg = new StringBuilder();
|
|
1221
|
1296
|
int successNum = 0;
|
|
|
1297
|
+ List<CaseAffiliate> caseAffiliateLogList=new ArrayList<>();
|
|
1222
|
1298
|
if (caseApplicationList != null && caseApplicationList.size() > 0) {
|
|
1223
|
1299
|
// 1,查询所有的组织机构,组装成map
|
|
1224
|
1300
|
List<SysDept> deptList = sysDeptMapper.selectDeptList(new SysDept());
|
|
|
@@ -1254,14 +1330,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
1254
|
1330
|
}
|
|
1255
|
1331
|
}
|
|
1256
|
1332
|
if (caseApplicationListinsert.size() > 0) {
|
|
1257
|
|
-// List<CaseApplication> caseApplicationListinsertDiffer = caseApplicationListinsert.stream().collect(
|
|
1258
|
|
-// collectingAndThen(
|
|
1259
|
|
-// toCollection(() -> new TreeSet<>(Comparator.comparing(CaseApplication::getCaseNum))),
|
|
1260
|
|
-// ArrayList::new));
|
|
1261
|
|
-
|
|
1262
|
|
-
|
|
1263
|
1333
|
//对不重复的立案对象集合的立案对象重新组装对应的案件关联人信息
|
|
1264
|
|
-// if(caseApplicationListinsertDiffer!=null&&caseApplicationListinsertDiffer.size()>0){
|
|
1265
|
1334
|
List<CaseApplication> caseApplicationNewList = null;
|
|
1266
|
1335
|
for (int i = 0; i < caseApplicationListinsert.size(); i++) {
|
|
1267
|
1336
|
caseApplicationNewList = new ArrayList<>();
|
|
|
@@ -1290,9 +1359,13 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
1290
|
1359
|
// 新增立案信息
|
|
1291
|
1360
|
caseApplicationItera.setCaseStatus(CaseApplicationConstants.CASE_APPLICATION);
|
|
1292
|
1361
|
caseApplicationItera.setCreateBy(getUsername());
|
|
|
1362
|
+ caseApplicationItera.setImportFlag(1);
|
|
1293
|
1363
|
int rows = caseApplicationMapper.insertCaseApplication(caseApplicationItera);
|
|
|
1364
|
+ if(rows==0){
|
|
|
1365
|
+ continue;
|
|
|
1366
|
+ }
|
|
1294
|
1367
|
// 新增日志
|
|
1295
|
|
- CaseLogUtils.insertCaseLog(caseApplicationItera.getId(), CaseApplicationConstants.CASE_APPLICATION, "");
|
|
|
1368
|
+ insertCaseLog(caseApplicationItera.getId(), CaseApplicationConstants.CASE_APPLICATION, "");
|
|
1296
|
1369
|
|
|
1297
|
1370
|
List<CaseAffiliate> caseAffiliates = caseApplicationItera.getCaseAffiliates();
|
|
1298
|
1371
|
if (caseAffiliates != null && caseAffiliates.size() > 0) {
|
|
|
@@ -1302,16 +1375,31 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
1302
|
1375
|
}
|
|
1303
|
1376
|
caseAffiliateMapper.batchCaseAffiliate(caseAffiliates);
|
|
1304
|
1377
|
}
|
|
1305
|
|
-
|
|
|
1378
|
+ // 新增案件记录
|
|
|
1379
|
+ caseApplicationItera.setCaseAppliId(caseApplicationItera.getId());
|
|
|
1380
|
+ caseApplicationItera.setUpdateSubmitStatus(UpdateSubmitStatus.UNCOMMITTED.getCode());
|
|
|
1381
|
+ caseApplicationItera.setVersion(1);
|
|
|
1382
|
+
|
|
|
1383
|
+ int insertRow = caseApplicationLogMapper.insert(caseApplicationItera);
|
|
|
1384
|
+ if(insertRow>0){
|
|
|
1385
|
+ caseAffiliates.forEach(caseAffiliate -> caseAffiliate.setCaseAppliLogId(caseApplicationItera.getId()));
|
|
|
1386
|
+ caseAffiliateLogList.addAll(caseAffiliates);
|
|
|
1387
|
+ }
|
|
1306
|
1388
|
successNum++;
|
|
1307
|
1389
|
successMsg.append("<br/>").append(successNum).append("、立案编号 ").append(caseApplicationItera.getCaseNum()).append(" 导入成功");
|
|
1308
|
1390
|
}
|
|
1309
|
1391
|
|
|
1310
|
|
-// }
|
|
1311
|
1392
|
|
|
1312
|
1393
|
}
|
|
1313
|
1394
|
|
|
1314
|
1395
|
}
|
|
|
1396
|
+ // 异步新增案件日志
|
|
|
1397
|
+ ThreadPoolUtil.execute(() -> {
|
|
|
1398
|
+ if ( CollectionUtil.isNotEmpty(caseAffiliateLogList)) {
|
|
|
1399
|
+ // 插入案件日志人员相关表
|
|
|
1400
|
+ caseAffiliateLogMapper.batchCaseAffiliate(caseAffiliateLogList);
|
|
|
1401
|
+ }
|
|
|
1402
|
+ });
|
|
1315
|
1403
|
|
|
1316
|
1404
|
|
|
1317
|
1405
|
} else {
|
|
|
@@ -1342,48 +1430,6 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
1342
|
1430
|
validDebtorApplicationAgentColumn(caseApplication, failureMsg);
|
|
1343
|
1431
|
}
|
|
1344
|
1432
|
|
|
1345
|
|
- /**
|
|
1346
|
|
- * 验证身份证号码是否合法
|
|
1347
|
|
- * @param idCard
|
|
1348
|
|
- * @return
|
|
1349
|
|
- */
|
|
1350
|
|
- public static boolean validateIdCard(String idCard) {
|
|
1351
|
|
- if (idCard == null || idCard.trim().isEmpty()) {
|
|
1352
|
|
- return false;
|
|
1353
|
|
- }
|
|
1354
|
|
-
|
|
1355
|
|
- if (!Pattern.matches(ID_REGEX, idCard)) {
|
|
1356
|
|
- return false;
|
|
1357
|
|
- }
|
|
1358
|
|
-
|
|
1359
|
|
- // 根据身份证号码的长度,采取不同的校验位计算方式
|
|
1360
|
|
- if (idCard.length() == 15) {
|
|
1361
|
|
- // 旧版身份证校验位计算
|
|
1362
|
|
- int sum = 0;
|
|
1363
|
|
- int[] weights = {7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8};
|
|
1364
|
|
- String idDigits = idCard.substring(0, 14);
|
|
1365
|
|
- for (int i = 0; i < idDigits.length(); i++) {
|
|
1366
|
|
- sum += Integer.parseInt(idDigits.substring(i, i + 1)) * weights[i];
|
|
1367
|
|
- }
|
|
1368
|
|
- int checkCode = 11 - (sum % 11);
|
|
1369
|
|
- if (checkCode == 10) {
|
|
1370
|
|
- checkCode = 0;
|
|
1371
|
|
- }
|
|
1372
|
|
- return idCard.substring(idCard.length() - 1).equals(String.valueOf(checkCode));
|
|
1373
|
|
- } else if (idCard.length() == 18) {
|
|
1374
|
|
- // 新版身份证校验位计算
|
|
1375
|
|
- int sum = 0;
|
|
1376
|
|
- int[] weights = {6, 7, 8, 4, 5, 6, 3, 2, 1, 0, 9, 7, 3, 4, 5, 6, 2, 8};
|
|
1377
|
|
- String idDigits = idCard.substring(0, 17);
|
|
1378
|
|
- for (int i = 0; i < idDigits.length(); i++) {
|
|
1379
|
|
- sum += Integer.parseInt(idDigits.substring(i, i + 1)) * weights[i];
|
|
1380
|
|
- }
|
|
1381
|
|
- int checkCode = sum % 10;
|
|
1382
|
|
- return idCard.substring(idCard.length() - 1).equals(String.valueOf(checkCode));
|
|
1383
|
|
- }
|
|
1384
|
|
-
|
|
1385
|
|
- return false;
|
|
1386
|
|
- }
|
|
1387
|
1433
|
/**
|
|
1388
|
1434
|
* 校验被申请人代理信息
|
|
1389
|
1435
|
*
|
|
|
@@ -1398,7 +1444,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
1398
|
1444
|
}
|
|
1399
|
1445
|
if (StrUtil.isEmpty(caseApplication.getDebtorIdentityNumAgent())) {
|
|
1400
|
1446
|
failureMsg.append("【被申请人主体信息-代理人身份证号】字段不能为空;");
|
|
1401
|
|
- } else if (!validateIdCard(caseApplication.getDebtorIdentityNumAgent())) {
|
|
|
1447
|
+ } else if (! IdcardUtil.isValidCard((caseApplication.getDebtorIdentityNumAgent()))) {
|
|
1402
|
1448
|
failureMsg.append("【被申请人主体信息-代理人身份证号】不合法;");
|
|
1403
|
1449
|
}
|
|
1404
|
1450
|
String debtorContactTelphoneAgent = caseApplication.getDebtorContactTelphoneAgent();
|
|
|
@@ -1428,7 +1474,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
1428
|
1474
|
}
|
|
1429
|
1475
|
if (StrUtil.isEmpty(caseApplication.getDebtorIdentityNum())) {
|
|
1430
|
1476
|
failureMsg.append("【被申请人主体信息-身份证号】字段不能为空;");
|
|
1431
|
|
- } else if (!validateIdCard(caseApplication.getDebtorIdentityNum())) {
|
|
|
1477
|
+ } else if (! IdcardUtil.isValidCard(caseApplication.getDebtorIdentityNum())) {
|
|
1432
|
1478
|
failureMsg.append("【被申请人主体信息-身份证号】不合法;");
|
|
1433
|
1479
|
}
|
|
1434
|
1480
|
String debtorContactTelphone = caseApplication.getDebtorContactTelphone();
|
|
|
@@ -1485,7 +1531,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
1485
|
1531
|
}
|
|
1486
|
1532
|
if (StrUtil.isEmpty(caseApplication.getIdentityNumAgent())) {
|
|
1487
|
1533
|
failureMsg.append("【申请人主体信息-代理人身份证号】字段不能为空;");
|
|
1488
|
|
- } else if (!validateIdCard(caseApplication.getIdentityNumAgent())) {
|
|
|
1534
|
+ } else if (!IdcardUtil.isValidCard(caseApplication.getIdentityNumAgent())) {
|
|
1489
|
1535
|
failureMsg.append("【申请人主体信息-代理人身份证号】不合法;");
|
|
1490
|
1536
|
}
|
|
1491
|
1537
|
validAgentInfo(caseApplication, failureMsg, deptMap);
|
|
|
@@ -1701,7 +1747,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
1701
|
1747
|
}
|
|
1702
|
1748
|
}
|
|
1703
|
1749
|
// 新增日志
|
|
1704
|
|
- CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL, "");
|
|
|
1750
|
+ insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL, "");
|
|
1705
|
1751
|
return rows;
|
|
1706
|
1752
|
}
|
|
1707
|
1753
|
|
|
|
@@ -1713,7 +1759,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
1713
|
1759
|
ArbitrateRecord arbitrateRecord = caseApplication.getArbitrateRecord();
|
|
1714
|
1760
|
arbitrateRecordMapper.updataArbitrateRecord(arbitrateRecord);
|
|
1715
|
1761
|
// 新增日志
|
|
1716
|
|
- CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CHECK_ARBITRATION, "");
|
|
|
1762
|
+ insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CHECK_ARBITRATION, "");
|
|
1717
|
1763
|
return rows;
|
|
1718
|
1764
|
|
|
1719
|
1765
|
}
|
|
|
@@ -1906,18 +1952,18 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
1906
|
1952
|
}
|
|
1907
|
1953
|
caseApplication.setCaseStatus(CaseApplicationConstants.SIGN_ARBITRATION);
|
|
1908
|
1954
|
// 新增日志
|
|
1909
|
|
- CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.SIGN_ARBITRATION, "");
|
|
|
1955
|
+ insertCaseLog(caseApplication.getId(), CaseApplicationConstants.SIGN_ARBITRATION, "");
|
|
1910
|
1956
|
|
|
1911
|
1957
|
rows = caseApplicationMapper.submitCaseApplication(caseApplication);
|
|
1912
|
1958
|
} else if (agreeOrNotCheck.intValue() == 2) {//拒绝审核
|
|
1913
|
1959
|
caseApplication.setCaseStatus(CaseApplicationConstants.VERPRIF_ARBITRATION);
|
|
1914
|
1960
|
// 新增日志
|
|
1915
|
|
- CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.VERPRIF_ARBITRATION, "");
|
|
|
1961
|
+ insertCaseLog(caseApplication.getId(), CaseApplicationConstants.VERPRIF_ARBITRATION, "");
|
|
1916
|
1962
|
|
|
1917
|
1963
|
rows = caseApplicationMapper.submitCaseApplication(caseApplication);
|
|
1918
|
1964
|
}
|
|
1919
|
1965
|
|
|
1920
|
|
- return AjaxResult.success();
|
|
|
1966
|
+ return success();
|
|
1921
|
1967
|
}
|
|
1922
|
1968
|
|
|
1923
|
1969
|
@Override
|
|
|
@@ -1937,7 +1983,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
1937
|
1983
|
rows += caseApplicationMapper.submitCaseApplication(caseApplication);
|
|
1938
|
1984
|
}
|
|
1939
|
1985
|
// 新增日志
|
|
1940
|
|
- CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.PENDING_PAYMENT, "");
|
|
|
1986
|
+ insertCaseLog(caseApplication.getId(), CaseApplicationConstants.PENDING_PAYMENT, "");
|
|
1941
|
1987
|
}
|
|
1942
|
1988
|
|
|
1943
|
1989
|
|
|
|
@@ -2144,7 +2190,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
2144
|
2190
|
caseLogRecordMapper.insertCaseLogRecord(caseLogRecord);
|
|
2145
|
2191
|
|
|
2146
|
2192
|
// 新增日志
|
|
2147
|
|
- CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.GENERATED_ARBITRATION, "");
|
|
|
2193
|
+ insertCaseLog(caseApplication.getId(), CaseApplicationConstants.GENERATED_ARBITRATION, "");
|
|
2148
|
2194
|
|
|
2149
|
2195
|
|
|
2150
|
2196
|
}
|
|
|
@@ -2163,7 +2209,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
2163
|
2209
|
caseLogRecordMapper.insertCaseLogRecord(caseLogRecord);
|
|
2164
|
2210
|
|
|
2165
|
2211
|
// 新增日志
|
|
2166
|
|
- CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.GENERATED_ARBITRATION, "");
|
|
|
2212
|
+ insertCaseLog(caseApplication.getId(), CaseApplicationConstants.GENERATED_ARBITRATION, "");
|
|
2167
|
2213
|
|
|
2168
|
2214
|
}
|
|
2169
|
2215
|
}
|
|
|
@@ -2281,7 +2327,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
2281
|
2327
|
|
|
2282
|
2328
|
//获取案件详细信息
|
|
2283
|
2329
|
CaseApplication caseApplicationSelct = selectCaseApplication(caseApplication);
|
|
2284
|
|
- return AjaxResult.success(caseApplicationSelct);
|
|
|
2330
|
+ return success(caseApplicationSelct);
|
|
2285
|
2331
|
} catch (IOException e) {
|
|
2286
|
2332
|
e.printStackTrace();
|
|
2287
|
2333
|
return AjaxResult.error("生成庭审笔录异常");
|
|
|
@@ -2344,7 +2390,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
2344
|
2390
|
// 发送开庭日期通知短信
|
|
2345
|
2391
|
sendHearDateMessage(caseApplication, request, "1947342");
|
|
2346
|
2392
|
// 新增日志
|
|
2347
|
|
- CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.MODIFY_HEARDATE, "");
|
|
|
2393
|
+ insertCaseLog(caseApplication.getId(), CaseApplicationConstants.MODIFY_HEARDATE, "");
|
|
2348
|
2394
|
|
|
2349
|
2395
|
return rows;
|
|
2350
|
2396
|
|
|
|
@@ -2682,7 +2728,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
2682
|
2728
|
ReservedConference conference = new ReservedConference(reservedConferenceVO.getCaseId(), roomId,
|
|
2683
|
2729
|
reservedConferenceVO.getScheduleStartTime(), reservedConferenceVO.getScheduleEndTime(),1);
|
|
2684
|
2730
|
reservedConferenceMapper.insert(conference);
|
|
2685
|
|
- return AjaxResult.success("预约会议成功");
|
|
|
2731
|
+ return success("预约会议成功");
|
|
2686
|
2732
|
|
|
2687
|
2733
|
case 42002:
|
|
2688
|
2734
|
return AjaxResult.error("预定会议无效");
|
|
|
@@ -2770,8 +2816,10 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
2770
|
2816
|
@Override
|
|
2771
|
2817
|
public AjaxResult deleteRoom(String roomId) {
|
|
2772
|
2818
|
|
|
2773
|
|
- return AjaxResult.success( reservedConferenceMapper.deleteByRoomId(roomId));
|
|
|
2819
|
+ return success( reservedConferenceMapper.deleteByRoomId(roomId));
|
|
2774
|
2820
|
}
|
|
|
2821
|
+
|
|
|
2822
|
+
|
|
2775
|
2823
|
}
|
|
2776
|
2824
|
|
|
2777
|
2825
|
|