|
|
@@ -14,10 +14,9 @@ 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
|
22
|
import com.ruoyi.common.utils.WordUtil;
|
|
|
@@ -57,6 +56,7 @@ import java.util.*;
|
|
57
|
56
|
import java.util.regex.Pattern;
|
|
58
|
57
|
import java.util.stream.Collectors;
|
|
59
|
58
|
|
|
|
59
|
+import static com.ruoyi.common.utils.SecurityUtils.getLoginUser;
|
|
60
|
60
|
import static com.ruoyi.common.utils.SecurityUtils.getUsername;
|
|
61
|
61
|
|
|
62
|
62
|
|
|
|
@@ -69,7 +69,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
69
|
69
|
private CaseAffiliateMapper caseAffiliateMapper;
|
|
70
|
70
|
|
|
71
|
71
|
@Autowired
|
|
72
|
|
- private ArbitratorMapper arbitratorMapper;
|
|
|
72
|
+ private CasePaymentRecordMapper casePaymentRecordMapper;
|
|
73
|
73
|
@Autowired
|
|
74
|
74
|
private ArbitrateRecordMapper arbitrateRecordMapper;
|
|
75
|
75
|
@Autowired
|
|
|
@@ -88,9 +88,45 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
88
|
88
|
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
|
89
|
|
|
90
|
90
|
|
|
91
|
|
-
|
|
|
91
|
+ /**
|
|
|
92
|
+ * 数据权限:1.每个人不同的角色,而每个角色可以操作不同的案件状态
|
|
|
93
|
+ * 2.申请人:金融机构下,可以看到改机构的所有的案件
|
|
|
94
|
+ * 3.被申请人:可以看到自己相关的案件(案件有被申请人相关的信息)
|
|
|
95
|
+ * 4.仲裁员:案件选定了某个仲裁员后,该仲裁员就可以查看该案件
|
|
|
96
|
+ * 5.仲裁委(部门长):可以查看所有的案件
|
|
|
97
|
+ * 6.法律顾问秘书:可以属于多个机构,可以查看相关机构的所有案件
|
|
|
98
|
+ * 7.超级管理员:可以查看所有的信息和数据
|
|
|
99
|
+ * @param caseApplication
|
|
|
100
|
+ * @return
|
|
|
101
|
+ */
|
|
92
|
102
|
@Override
|
|
93
|
103
|
public List<CaseApplication> selectCaseApplicationList(CaseApplication caseApplication) {
|
|
|
104
|
+ // 获取登录用户
|
|
|
105
|
+ LoginUser loginUser = getLoginUser();
|
|
|
106
|
+ SysUser user = loginUser.getUser();
|
|
|
107
|
+ Long userId = user.getUserId();
|
|
|
108
|
+ Long deptId = user.getDeptId();
|
|
|
109
|
+ List<SysRole> roles = user.getRoles();
|
|
|
110
|
+ // 查询登录人身份证号
|
|
|
111
|
+ SysUser sysUser = sysUserMapper.selectUserById(userId);
|
|
|
112
|
+ caseApplication.setIdCard(sysUser.getIdCard());
|
|
|
113
|
+ caseApplication.setUserId(String.valueOf(userId));
|
|
|
114
|
+ for (SysRole role : roles) {
|
|
|
115
|
+ // 超级管理员和仲裁委(部门长)案件,可查看所有案件 √
|
|
|
116
|
+ if(role.getRoleName().equals("超级管理员")
|
|
|
117
|
+ ||role.getRoleName().equals("仲裁委")
|
|
|
118
|
+ ||role.getRoleName().equals("部门长")){
|
|
|
119
|
+ return caseApplicationMapper.selectAdminCaseApplicationList(caseApplication);
|
|
|
120
|
+ }
|
|
|
121
|
+ if(role.getRoleName().equals("法律顾问")){
|
|
|
122
|
+ // 查询角色有关的用户部门
|
|
|
123
|
+ List<Long> deptIds = sysDeptMapper.selectUserDeptListByRoleId(role.getRoleId());
|
|
|
124
|
+ caseApplication.setDeptIds(deptIds);
|
|
|
125
|
+ }
|
|
|
126
|
+ }
|
|
|
127
|
+
|
|
|
128
|
+
|
|
|
129
|
+ // 根据条件查询申请人,被申请人,仲裁员,法律顾问案件
|
|
94
|
130
|
return caseApplicationMapper.selectCaseApplicationList(caseApplication);
|
|
95
|
131
|
|
|
96
|
132
|
}
|
|
|
@@ -108,6 +144,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
108
|
144
|
// 获取自动编码
|
|
109
|
145
|
String caseNum = generateCaseNum();
|
|
110
|
146
|
caseApplication.setCaseNum(caseNum);
|
|
|
147
|
+ caseApplication.setCreateBy(getUsername());
|
|
111
|
148
|
|
|
112
|
149
|
int rows = caseApplicationMapper.insertCaseApplication(caseApplication);
|
|
113
|
150
|
List<CaseAffiliate> caseAffiliates = caseApplication.getCaseAffiliates();
|
|
|
@@ -125,7 +162,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
125
|
162
|
if(caseAffiliate.getIdentityType()==1&&StrUtil.isNotEmpty(caseAffiliate.getName())) {
|
|
126
|
163
|
// 将组织机构id设为申请人名称
|
|
127
|
164
|
if (deptMap.containsKey(caseAffiliate.getName())) {
|
|
128
|
|
- caseAffiliate.setName(String.valueOf(deptMap.get(caseAffiliate.getName())));
|
|
|
165
|
+ caseAffiliate.setApplicationOrganId(String.valueOf(deptMap.get(caseAffiliate.getName())));
|
|
|
166
|
+ caseAffiliate.setApplicationOrganName(caseAffiliate.getName());
|
|
129
|
167
|
} else {
|
|
130
|
168
|
// 如果不存在则新增
|
|
131
|
169
|
SysDept dept = new SysDept();
|
|
|
@@ -139,7 +177,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
139
|
177
|
dept.setUpdateBy(getUsername());
|
|
140
|
178
|
sysDeptMapper.insertDept(dept);
|
|
141
|
179
|
deptMap.put(dept.getDeptName(), dept.getDeptId());
|
|
142
|
|
- caseAffiliate.setName(String.valueOf(dept.getDeptId()));
|
|
|
180
|
+ caseAffiliate.setApplicationOrganId(String.valueOf(dept.getDeptId()));
|
|
|
181
|
+ caseAffiliate.setApplicationOrganName(caseAffiliate.getName());
|
|
143
|
182
|
|
|
144
|
183
|
}
|
|
145
|
184
|
}
|
|
|
@@ -193,6 +232,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
193
|
232
|
BigDecimal feeRate = new BigDecimal(0.01);
|
|
194
|
233
|
BigDecimal feePayable = caseApplication.getCaseSubjectAmount().multiply(feeRate).setScale(2,BigDecimal.ROUND_HALF_UP);
|
|
195
|
234
|
caseApplication.setFeePayable(feePayable);
|
|
|
235
|
+ caseApplication.setUpdateBy(getUsername());
|
|
196
|
236
|
|
|
197
|
237
|
int rows = caseApplicationMapper.updataCaseApplication(caseApplication);
|
|
198
|
238
|
List<CaseAffiliate> caseAffiliates = caseApplication.getCaseAffiliates();
|
|
|
@@ -208,7 +248,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
208
|
248
|
if(caseAffiliate.getIdentityType()==1&&StrUtil.isNotEmpty(caseAffiliate.getName())) {
|
|
209
|
249
|
// 将组织机构id设为申请人名称
|
|
210
|
250
|
if (deptMap.containsKey(caseAffiliate.getName())) {
|
|
211
|
|
- caseAffiliate.setName(String.valueOf(deptMap.get(caseAffiliate.getName())));
|
|
|
251
|
+ caseAffiliate.setApplicationOrganName(caseAffiliate.getName());
|
|
|
252
|
+ caseAffiliate.setApplicationOrganId(String.valueOf(deptMap.get(caseAffiliate.getName())));
|
|
212
|
253
|
} else {
|
|
213
|
254
|
// 如果不存在则新增
|
|
214
|
255
|
SysDept dept = new SysDept();
|
|
|
@@ -222,7 +263,9 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
222
|
263
|
dept.setUpdateBy(getUsername());
|
|
223
|
264
|
sysDeptMapper.insertDept(dept);
|
|
224
|
265
|
deptMap.put(dept.getDeptName(), dept.getDeptId());
|
|
225
|
|
- caseAffiliate.setName(String.valueOf(dept.getDeptId()));
|
|
|
266
|
+
|
|
|
267
|
+ caseAffiliate.setApplicationOrganName(caseAffiliate.getName());
|
|
|
268
|
+ caseAffiliate.setApplicationOrganId(String.valueOf(dept.getDeptId()));
|
|
226
|
269
|
|
|
227
|
270
|
}
|
|
228
|
271
|
}
|
|
|
@@ -409,7 +452,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
409
|
452
|
CaseApplication caseApplicationItera = caseApplicationNewList.get(k);
|
|
410
|
453
|
// 新增立案信息
|
|
411
|
454
|
caseApplicationItera.setCaseStatus(CaseApplicationConstants.CASE_APPLICATION);
|
|
412
|
|
-
|
|
|
455
|
+ caseApplicationItera.setCreateBy(getUsername());
|
|
413
|
456
|
int rows = caseApplicationMapper.insertCaseApplication(caseApplicationItera);
|
|
414
|
457
|
List<CaseAffiliate> caseAffiliates = caseApplicationItera.getCaseAffiliates();
|
|
415
|
458
|
if(caseAffiliates!=null&&caseAffiliates.size()>0){
|
|
|
@@ -888,29 +931,22 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
888
|
931
|
caseAffiliate.setCaseAppliId(caseApplication.getId());
|
|
889
|
932
|
List<CaseAffiliate> caseAffiliatListeselect = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate);
|
|
890
|
933
|
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();
|
|
|
934
|
+
|
|
900
|
935
|
for (int i = 0; i < caseAffiliatListeselect.size(); i++){
|
|
901
|
936
|
CaseAffiliate caseAffiliateselect = caseAffiliatListeselect.get(i);
|
|
902
|
937
|
int identityType = caseAffiliateselect.getIdentityType();
|
|
903
|
938
|
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(",");;
|
|
|
939
|
+
|
|
|
940
|
+ caseApplicationselect.setApplicantName(caseAffiliateselect.getApplicationOrganName());
|
|
908
|
941
|
}
|
|
909
|
942
|
}
|
|
910
|
|
- caseApplicationselect.setApplicantName(applicantName.toString());
|
|
911
|
|
-
|
|
912
|
943
|
|
|
913
|
944
|
}
|
|
|
945
|
+ caseApplication.setAnnexType(8);
|
|
|
946
|
+ // 查询缴费凭证
|
|
|
947
|
+ List<CaseAttach> payOrderList = caseAttachMapper.queryCaseAttachList(caseApplication);
|
|
|
948
|
+ caseApplicationselect.setPayOrderList(payOrderList);
|
|
|
949
|
+
|
|
914
|
950
|
return caseApplicationselect;
|
|
915
|
951
|
}
|
|
916
|
952
|
|
|
|
@@ -1216,21 +1252,12 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
1216
|
1252
|
caseAffiliate.setCaseAppliId(caseApplication.getId());
|
|
1217
|
1253
|
List<CaseAffiliate> caseAffiliatListeselect = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate);
|
|
1218
|
1254
|
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
|
|
- }
|
|
|
1255
|
+
|
|
1227
|
1256
|
for (int j = 0; j < caseAffiliatListeselect.size(); j++) {
|
|
1228
|
1257
|
CaseAffiliate caseAffiliateselect = caseAffiliatListeselect.get(j);
|
|
1229
|
1258
|
int identityType = caseAffiliateselect.getIdentityType();
|
|
1230
|
1259
|
if(identityType==1){
|
|
1231
|
|
- if(StrUtil.isNotEmpty(caseAffiliateselect.getName())&&deptMap.containsKey(caseAffiliateselect.getName())){
|
|
1232
|
|
- caseAffiliateselect.setName(deptMap.get(caseAffiliateselect.getName()));
|
|
1233
|
|
- }
|
|
|
1260
|
+ caseAffiliateselect.setName(caseAffiliateselect.getApplicationOrganName());
|
|
1234
|
1261
|
|
|
1235
|
1262
|
}
|
|
1236
|
1263
|
//给申请人、被申请人发送短信通知
|
|
|
@@ -1312,7 +1339,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
1312
|
1339
|
|
|
1313
|
1340
|
// 将组织机构id设为申请人名称
|
|
1314
|
1341
|
if(deptMap.containsKey(caseApplication.getName())){
|
|
1315
|
|
- caseAffiliate.setName(String.valueOf(deptMap.get(caseApplication.getName())));
|
|
|
1342
|
+ caseAffiliate.setApplicationOrganId(String.valueOf(deptMap.get(caseApplication.getName())));
|
|
|
1343
|
+ caseAffiliate.setApplicationOrganName(caseApplication.getName());
|
|
1316
|
1344
|
}else {
|
|
1317
|
1345
|
// 如果不存在则新增
|
|
1318
|
1346
|
SysDept dept = new SysDept();
|
|
|
@@ -1326,7 +1354,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
1326
|
1354
|
dept.setUpdateBy(getUsername());
|
|
1327
|
1355
|
sysDeptMapper.insertDept(dept);
|
|
1328
|
1356
|
deptMap.put(dept.getDeptName(),dept.getDeptId());
|
|
1329
|
|
- caseAffiliate.setName(String.valueOf(dept.getDeptId()));
|
|
|
1357
|
+ caseAffiliate.setApplicationOrganId(String.valueOf(dept.getDeptId()));
|
|
|
1358
|
+ caseAffiliate.setApplicationOrganName(caseApplication.getName());
|
|
1330
|
1359
|
|
|
1331
|
1360
|
}
|
|
1332
|
1361
|
|