|
|
@@ -14,13 +14,12 @@ import com.google.gson.JsonObject;
|
|
14
|
14
|
import com.ruoyi.common.annotation.DataScope;
|
|
15
|
15
|
import com.ruoyi.common.constant.CaseApplicationConstants;
|
|
16
|
16
|
import com.ruoyi.common.core.domain.AjaxResult;
|
|
17
|
|
-import com.ruoyi.common.core.domain.entity.EsignHttpResponse;
|
|
18
|
|
-import com.ruoyi.common.core.domain.entity.SysDept;
|
|
|
17
|
+import com.ruoyi.common.core.domain.entity.*;
|
|
19
|
18
|
|
|
20
|
|
-import com.ruoyi.common.core.domain.entity.SysUser;
|
|
|
19
|
+import com.ruoyi.common.core.domain.model.LoginUser;
|
|
21
|
20
|
import com.ruoyi.common.exception.EsignDemoException;
|
|
22
|
21
|
import com.ruoyi.common.exception.ServiceException;
|
|
23
|
|
-import com.ruoyi.common.utils.WordUtil;
|
|
|
22
|
+import com.ruoyi.common.utils.*;
|
|
24
|
23
|
import com.ruoyi.common.utils.file.SaaSAPIFileUtils;
|
|
25
|
24
|
|
|
26
|
25
|
|
|
|
@@ -30,9 +29,6 @@ import com.ruoyi.common.exception.EsignDemoException;
|
|
30
|
29
|
import com.ruoyi.common.exception.ServiceException;
|
|
31
|
30
|
import com.ruoyi.system.mapper.SysUserMapper;
|
|
32
|
31
|
import com.ruoyi.wisdomarbitrate.utils.CaseLogUtils;
|
|
33
|
|
-import com.ruoyi.common.utils.DateUtils;
|
|
34
|
|
-import com.ruoyi.common.utils.SmsUtils;
|
|
35
|
|
-import com.ruoyi.common.utils.StringUtils;
|
|
36
|
32
|
import com.ruoyi.common.utils.bean.BeanUtils;
|
|
37
|
33
|
import com.ruoyi.system.mapper.SysDeptMapper;
|
|
38
|
34
|
import com.ruoyi.wisdomarbitrate.domain.*;
|
|
|
@@ -57,6 +53,8 @@ import java.util.*;
|
|
57
|
53
|
import java.util.regex.Pattern;
|
|
58
|
54
|
import java.util.stream.Collectors;
|
|
59
|
55
|
|
|
|
56
|
+import static com.ruoyi.common.utils.PageUtils.startPage;
|
|
|
57
|
+import static com.ruoyi.common.utils.SecurityUtils.getLoginUser;
|
|
60
|
58
|
import static com.ruoyi.common.utils.SecurityUtils.getUsername;
|
|
61
|
59
|
|
|
62
|
60
|
|
|
|
@@ -69,7 +67,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
69
|
67
|
private CaseAffiliateMapper caseAffiliateMapper;
|
|
70
|
68
|
|
|
71
|
69
|
@Autowired
|
|
72
|
|
- private ArbitratorMapper arbitratorMapper;
|
|
|
70
|
+ private CasePaymentRecordMapper casePaymentRecordMapper;
|
|
73
|
71
|
@Autowired
|
|
74
|
72
|
private ArbitrateRecordMapper arbitrateRecordMapper;
|
|
75
|
73
|
@Autowired
|
|
|
@@ -88,13 +86,58 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
88
|
86
|
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}$");
|
|
89
|
87
|
|
|
90
|
88
|
|
|
91
|
|
-
|
|
|
89
|
+ /**
|
|
|
90
|
+ * 数据权限:1.每个人不同的角色,而每个角色可以操作不同的案件状态
|
|
|
91
|
+ * 2.申请人:金融机构下,可以看到改机构的所有的案件
|
|
|
92
|
+ * 3.被申请人:可以看到自己相关的案件(案件有被申请人相关的信息)
|
|
|
93
|
+ * 4.仲裁员:案件选定了某个仲裁员后,该仲裁员就可以查看该案件
|
|
|
94
|
+ * 5.仲裁委(部门长):可以查看所有的案件
|
|
|
95
|
+ * 6.法律顾问秘书:可以属于多个机构,可以查看相关机构的所有案件
|
|
|
96
|
+ * 7.超级管理员:可以查看所有的信息和数据
|
|
|
97
|
+ * @param caseApplication
|
|
|
98
|
+ * @return
|
|
|
99
|
+ */
|
|
|
100
|
+// @Override
|
|
|
101
|
+// public List<CaseApplication> selectCaseApplicationList(CaseApplication caseApplication) {
|
|
|
102
|
+// // 获取登录用户
|
|
|
103
|
+// LoginUser loginUser = getLoginUser();
|
|
|
104
|
+// SysUser user = loginUser.getUser();
|
|
|
105
|
+// Long userId = user.getUserId();
|
|
|
106
|
+// Long deptId = user.getDeptId();
|
|
|
107
|
+// List<SysRole> roles = user.getRoles();
|
|
|
108
|
+// // 查询登录人身份证号
|
|
|
109
|
+// SysUser sysUser = sysUserMapper.selectUserById(userId);
|
|
|
110
|
+// caseApplication.setIdCard(sysUser.getIdCard());
|
|
|
111
|
+// caseApplication.setUserId(String.valueOf(userId));
|
|
|
112
|
+// startPage();
|
|
|
113
|
+// for (SysRole role : roles) {
|
|
|
114
|
+// // 超级管理员和仲裁委(部门长)案件,可查看所有案件 √
|
|
|
115
|
+// if(role.getRoleName().equals("超级管理员")
|
|
|
116
|
+// ||role.getRoleName().equals("仲裁委")
|
|
|
117
|
+// ||role.getRoleName().equals("部门长")){
|
|
|
118
|
+// return caseApplicationMapper.selectAdminCaseApplicationList(caseApplication);
|
|
|
119
|
+// }
|
|
|
120
|
+// if(role.getRoleName().equals("法律顾问")){
|
|
|
121
|
+// // 查询角色有关的用户部门
|
|
|
122
|
+// List<Long> deptIds = sysDeptMapper.selectUserDeptListByRoleId(role.getRoleId());
|
|
|
123
|
+// caseApplication.setDeptIds(deptIds);
|
|
|
124
|
+// }
|
|
|
125
|
+// if(StrUtil.isEmpty(caseApplication.getNameId())&&role.getRoleName().equals("申请人")){
|
|
|
126
|
+// // 查询角色有关的用户部门
|
|
|
127
|
+// caseApplication.setNameId(String.valueOf(sysUser.getDeptId()));
|
|
|
128
|
+// }
|
|
|
129
|
+// }
|
|
|
130
|
+//
|
|
|
131
|
+//
|
|
|
132
|
+// // 根据条件查询申请人,被申请人,仲裁员,法律顾问案件
|
|
|
133
|
+// return caseApplicationMapper.selectCaseApplicationList(caseApplication);
|
|
|
134
|
+//
|
|
|
135
|
+// }
|
|
92
|
136
|
@Override
|
|
93
|
137
|
public List<CaseApplication> selectCaseApplicationList(CaseApplication caseApplication) {
|
|
94
|
|
- return caseApplicationMapper.selectCaseApplicationList(caseApplication);
|
|
|
138
|
+ return caseApplicationMapper.selectAdminCaseApplicationList(caseApplication);
|
|
95
|
139
|
|
|
96
|
140
|
}
|
|
97
|
|
-
|
|
98
|
141
|
@Override
|
|
99
|
142
|
@Transactional
|
|
100
|
143
|
public int insertcaseApplication(CaseApplication caseApplication) {
|
|
|
@@ -108,6 +151,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
108
|
151
|
// 获取自动编码
|
|
109
|
152
|
String caseNum = generateCaseNum();
|
|
110
|
153
|
caseApplication.setCaseNum(caseNum);
|
|
|
154
|
+ caseApplication.setCreateBy(getUsername());
|
|
111
|
155
|
|
|
112
|
156
|
int rows = caseApplicationMapper.insertCaseApplication(caseApplication);
|
|
113
|
157
|
List<CaseAffiliate> caseAffiliates = caseApplication.getCaseAffiliates();
|
|
|
@@ -125,7 +169,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
125
|
169
|
if(caseAffiliate.getIdentityType()==1&&StrUtil.isNotEmpty(caseAffiliate.getName())) {
|
|
126
|
170
|
// 将组织机构id设为申请人名称
|
|
127
|
171
|
if (deptMap.containsKey(caseAffiliate.getName())) {
|
|
128
|
|
- caseAffiliate.setName(String.valueOf(deptMap.get(caseAffiliate.getName())));
|
|
|
172
|
+ caseAffiliate.setApplicationOrganId(String.valueOf(deptMap.get(caseAffiliate.getName())));
|
|
|
173
|
+ caseAffiliate.setApplicationOrganName(caseAffiliate.getName());
|
|
129
|
174
|
} else {
|
|
130
|
175
|
// 如果不存在则新增
|
|
131
|
176
|
SysDept dept = new SysDept();
|
|
|
@@ -139,7 +184,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
139
|
184
|
dept.setUpdateBy(getUsername());
|
|
140
|
185
|
sysDeptMapper.insertDept(dept);
|
|
141
|
186
|
deptMap.put(dept.getDeptName(), dept.getDeptId());
|
|
142
|
|
- caseAffiliate.setName(String.valueOf(dept.getDeptId()));
|
|
|
187
|
+ caseAffiliate.setApplicationOrganId(String.valueOf(dept.getDeptId()));
|
|
|
188
|
+ caseAffiliate.setApplicationOrganName(caseAffiliate.getName());
|
|
143
|
189
|
|
|
144
|
190
|
}
|
|
145
|
191
|
}
|
|
|
@@ -193,6 +239,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
193
|
239
|
BigDecimal feeRate = new BigDecimal(0.01);
|
|
194
|
240
|
BigDecimal feePayable = caseApplication.getCaseSubjectAmount().multiply(feeRate).setScale(2,BigDecimal.ROUND_HALF_UP);
|
|
195
|
241
|
caseApplication.setFeePayable(feePayable);
|
|
|
242
|
+ caseApplication.setUpdateBy(getUsername());
|
|
196
|
243
|
|
|
197
|
244
|
int rows = caseApplicationMapper.updataCaseApplication(caseApplication);
|
|
198
|
245
|
List<CaseAffiliate> caseAffiliates = caseApplication.getCaseAffiliates();
|
|
|
@@ -208,7 +255,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
208
|
255
|
if(caseAffiliate.getIdentityType()==1&&StrUtil.isNotEmpty(caseAffiliate.getName())) {
|
|
209
|
256
|
// 将组织机构id设为申请人名称
|
|
210
|
257
|
if (deptMap.containsKey(caseAffiliate.getName())) {
|
|
211
|
|
- caseAffiliate.setName(String.valueOf(deptMap.get(caseAffiliate.getName())));
|
|
|
258
|
+ caseAffiliate.setApplicationOrganName(caseAffiliate.getName());
|
|
|
259
|
+ caseAffiliate.setApplicationOrganId(String.valueOf(deptMap.get(caseAffiliate.getName())));
|
|
212
|
260
|
} else {
|
|
213
|
261
|
// 如果不存在则新增
|
|
214
|
262
|
SysDept dept = new SysDept();
|
|
|
@@ -222,7 +270,9 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
222
|
270
|
dept.setUpdateBy(getUsername());
|
|
223
|
271
|
sysDeptMapper.insertDept(dept);
|
|
224
|
272
|
deptMap.put(dept.getDeptName(), dept.getDeptId());
|
|
225
|
|
- caseAffiliate.setName(String.valueOf(dept.getDeptId()));
|
|
|
273
|
+
|
|
|
274
|
+ caseAffiliate.setApplicationOrganName(caseAffiliate.getName());
|
|
|
275
|
+ caseAffiliate.setApplicationOrganId(String.valueOf(dept.getDeptId()));
|
|
226
|
276
|
|
|
227
|
277
|
}
|
|
228
|
278
|
}
|
|
|
@@ -409,7 +459,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
409
|
459
|
CaseApplication caseApplicationItera = caseApplicationNewList.get(k);
|
|
410
|
460
|
// 新增立案信息
|
|
411
|
461
|
caseApplicationItera.setCaseStatus(CaseApplicationConstants.CASE_APPLICATION);
|
|
412
|
|
-
|
|
|
462
|
+ caseApplicationItera.setCreateBy(getUsername());
|
|
413
|
463
|
int rows = caseApplicationMapper.insertCaseApplication(caseApplicationItera);
|
|
414
|
464
|
List<CaseAffiliate> caseAffiliates = caseApplicationItera.getCaseAffiliates();
|
|
415
|
465
|
if(caseAffiliates!=null&&caseAffiliates.size()>0){
|
|
|
@@ -888,29 +938,22 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
888
|
938
|
caseAffiliate.setCaseAppliId(caseApplication.getId());
|
|
889
|
939
|
List<CaseAffiliate> caseAffiliatListeselect = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate);
|
|
890
|
940
|
if(caseAffiliatListeselect!=null){
|
|
891
|
|
- // 查询组织机构
|
|
892
|
|
- List<SysDept> sysDepts = sysDeptMapper.selectDeptList(new SysDept());
|
|
893
|
|
- Map<String,String> deptMap=new HashMap<>();
|
|
894
|
|
- if(CollectionUtil.isNotEmpty(sysDepts)){
|
|
895
|
|
- for (SysDept sysDept : sysDepts) {
|
|
896
|
|
- deptMap.put(String.valueOf(sysDept.getDeptId()),sysDept.getDeptName());
|
|
897
|
|
- }
|
|
898
|
|
- }
|
|
899
|
|
- StringBuffer applicantName = new StringBuffer();
|
|
|
941
|
+
|
|
900
|
942
|
for (int i = 0; i < caseAffiliatListeselect.size(); i++){
|
|
901
|
943
|
CaseAffiliate caseAffiliateselect = caseAffiliatListeselect.get(i);
|
|
902
|
944
|
int identityType = caseAffiliateselect.getIdentityType();
|
|
903
|
945
|
if(identityType==1){
|
|
904
|
|
- if(StrUtil.isNotEmpty(caseAffiliateselect.getName())&&deptMap.containsKey(caseAffiliateselect.getName())){
|
|
905
|
|
- caseAffiliateselect.setName(deptMap.get(caseAffiliateselect.getName()));
|
|
906
|
|
- }
|
|
907
|
|
- applicantName.append(caseAffiliateselect.getName()).append(",");;
|
|
|
946
|
+
|
|
|
947
|
+ caseApplicationselect.setApplicantName(caseAffiliateselect.getApplicationOrganName());
|
|
908
|
948
|
}
|
|
909
|
949
|
}
|
|
910
|
|
- caseApplicationselect.setApplicantName(applicantName.toString());
|
|
911
|
|
-
|
|
912
|
950
|
|
|
913
|
951
|
}
|
|
|
952
|
+ caseApplication.setAnnexType(8);
|
|
|
953
|
+ // 查询缴费凭证
|
|
|
954
|
+ List<CaseAttach> payOrderList = caseAttachMapper.queryCaseAttachList(caseApplication);
|
|
|
955
|
+ caseApplicationselect.setPayOrderList(payOrderList);
|
|
|
956
|
+
|
|
914
|
957
|
return caseApplicationselect;
|
|
915
|
958
|
}
|
|
916
|
959
|
|
|
|
@@ -1216,21 +1259,12 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
1216
|
1259
|
caseAffiliate.setCaseAppliId(caseApplication.getId());
|
|
1217
|
1260
|
List<CaseAffiliate> caseAffiliatListeselect = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate);
|
|
1218
|
1261
|
if(caseAffiliatListeselect!=null) {
|
|
1219
|
|
- // 查询组织机构
|
|
1220
|
|
- List<SysDept> sysDepts = sysDeptMapper.selectDeptList(new SysDept());
|
|
1221
|
|
- Map<String,String> deptMap=new HashMap<>();
|
|
1222
|
|
- if(CollectionUtil.isNotEmpty(sysDepts)){
|
|
1223
|
|
- for (SysDept sysDept : sysDepts) {
|
|
1224
|
|
- deptMap.put(String.valueOf(sysDept.getDeptId()),sysDept.getDeptName());
|
|
1225
|
|
- }
|
|
1226
|
|
- }
|
|
|
1262
|
+
|
|
1227
|
1263
|
for (int j = 0; j < caseAffiliatListeselect.size(); j++) {
|
|
1228
|
1264
|
CaseAffiliate caseAffiliateselect = caseAffiliatListeselect.get(j);
|
|
1229
|
1265
|
int identityType = caseAffiliateselect.getIdentityType();
|
|
1230
|
1266
|
if(identityType==1){
|
|
1231
|
|
- if(StrUtil.isNotEmpty(caseAffiliateselect.getName())&&deptMap.containsKey(caseAffiliateselect.getName())){
|
|
1232
|
|
- caseAffiliateselect.setName(deptMap.get(caseAffiliateselect.getName()));
|
|
1233
|
|
- }
|
|
|
1267
|
+ caseAffiliateselect.setName(caseAffiliateselect.getApplicationOrganName());
|
|
1234
|
1268
|
|
|
1235
|
1269
|
}
|
|
1236
|
1270
|
//给申请人、被申请人发送短信通知
|
|
|
@@ -1312,7 +1346,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
1312
|
1346
|
|
|
1313
|
1347
|
// 将组织机构id设为申请人名称
|
|
1314
|
1348
|
if(deptMap.containsKey(caseApplication.getName())){
|
|
1315
|
|
- caseAffiliate.setName(String.valueOf(deptMap.get(caseApplication.getName())));
|
|
|
1349
|
+ caseAffiliate.setApplicationOrganId(String.valueOf(deptMap.get(caseApplication.getName())));
|
|
|
1350
|
+ caseAffiliate.setApplicationOrganName(caseApplication.getName());
|
|
1316
|
1351
|
}else {
|
|
1317
|
1352
|
// 如果不存在则新增
|
|
1318
|
1353
|
SysDept dept = new SysDept();
|
|
|
@@ -1326,7 +1361,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
1326
|
1361
|
dept.setUpdateBy(getUsername());
|
|
1327
|
1362
|
sysDeptMapper.insertDept(dept);
|
|
1328
|
1363
|
deptMap.put(dept.getDeptName(),dept.getDeptId());
|
|
1329
|
|
- caseAffiliate.setName(String.valueOf(dept.getDeptId()));
|
|
|
1364
|
+ caseAffiliate.setApplicationOrganId(String.valueOf(dept.getDeptId()));
|
|
|
1365
|
+ caseAffiliate.setApplicationOrganName(caseApplication.getName());
|
|
1330
|
1366
|
|
|
1331
|
1367
|
}
|
|
1332
|
1368
|
|