|
|
@@ -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.file.SaaSAPIFileUtils;
|
|
|
@@ -50,6 +49,7 @@ import java.util.*;
|
|
50
|
49
|
import java.util.regex.Pattern;
|
|
51
|
50
|
import java.util.stream.Collectors;
|
|
52
|
51
|
|
|
|
52
|
+import static com.ruoyi.common.utils.SecurityUtils.getLoginUser;
|
|
53
|
53
|
import static com.ruoyi.common.utils.SecurityUtils.getUsername;
|
|
54
|
54
|
|
|
55
|
55
|
|
|
|
@@ -62,7 +62,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
62
|
62
|
private CaseAffiliateMapper caseAffiliateMapper;
|
|
63
|
63
|
|
|
64
|
64
|
@Autowired
|
|
65
|
|
- private ArbitratorMapper arbitratorMapper;
|
|
|
65
|
+ private CasePaymentRecordMapper casePaymentRecordMapper;
|
|
66
|
66
|
@Autowired
|
|
67
|
67
|
private ArbitrateRecordMapper arbitrateRecordMapper;
|
|
68
|
68
|
@Autowired
|
|
|
@@ -79,9 +79,45 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
79
|
79
|
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}$");
|
|
80
|
80
|
|
|
81
|
81
|
|
|
82
|
|
-
|
|
|
82
|
+ /**
|
|
|
83
|
+ * 数据权限:1.每个人不同的角色,而每个角色可以操作不同的案件状态
|
|
|
84
|
+ * 2.申请人:金融机构下,可以看到改机构的所有的案件
|
|
|
85
|
+ * 3.被申请人:可以看到自己相关的案件(案件有被申请人相关的信息)
|
|
|
86
|
+ * 4.仲裁员:案件选定了某个仲裁员后,该仲裁员就可以查看该案件
|
|
|
87
|
+ * 5.仲裁委(部门长):可以查看所有的案件
|
|
|
88
|
+ * 6.法律顾问秘书:可以属于多个机构,可以查看相关机构的所有案件
|
|
|
89
|
+ * 7.超级管理员:可以查看所有的信息和数据
|
|
|
90
|
+ * @param caseApplication
|
|
|
91
|
+ * @return
|
|
|
92
|
+ */
|
|
83
|
93
|
@Override
|
|
84
|
94
|
public List<CaseApplication> selectCaseApplicationList(CaseApplication caseApplication) {
|
|
|
95
|
+ // 获取登录用户
|
|
|
96
|
+ LoginUser loginUser = getLoginUser();
|
|
|
97
|
+ SysUser user = loginUser.getUser();
|
|
|
98
|
+ Long userId = user.getUserId();
|
|
|
99
|
+ Long deptId = user.getDeptId();
|
|
|
100
|
+ List<SysRole> roles = user.getRoles();
|
|
|
101
|
+ // 查询登录人身份证号
|
|
|
102
|
+ SysUser sysUser = sysUserMapper.selectUserById(userId);
|
|
|
103
|
+ caseApplication.setIdCard(sysUser.getIdCard());
|
|
|
104
|
+ caseApplication.setUserId(String.valueOf(userId));
|
|
|
105
|
+ for (SysRole role : roles) {
|
|
|
106
|
+ // 超级管理员和仲裁委(部门长)案件,可查看所有案件 √
|
|
|
107
|
+ if(role.getRoleName().equals("超级管理员")
|
|
|
108
|
+ ||role.getRoleName().equals("仲裁委")
|
|
|
109
|
+ ||role.getRoleName().equals("部门长")){
|
|
|
110
|
+ return caseApplicationMapper.selectAdminCaseApplicationList(caseApplication);
|
|
|
111
|
+ }
|
|
|
112
|
+ if(role.getRoleName().equals("法律顾问")){
|
|
|
113
|
+ // 查询角色有关的用户部门
|
|
|
114
|
+ List<Long> deptIds = sysDeptMapper.selectUserDeptListByRoleId(role.getRoleId());
|
|
|
115
|
+ caseApplication.setDeptIds(deptIds);
|
|
|
116
|
+ }
|
|
|
117
|
+ }
|
|
|
118
|
+
|
|
|
119
|
+
|
|
|
120
|
+ // 根据条件查询申请人,被申请人,仲裁员,法律顾问案件
|
|
85
|
121
|
return caseApplicationMapper.selectCaseApplicationList(caseApplication);
|
|
86
|
122
|
|
|
87
|
123
|
}
|
|
|
@@ -99,6 +135,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
99
|
135
|
// 获取自动编码
|
|
100
|
136
|
String caseNum = generateCaseNum();
|
|
101
|
137
|
caseApplication.setCaseNum(caseNum);
|
|
|
138
|
+ caseApplication.setCreateBy(getUsername());
|
|
102
|
139
|
|
|
103
|
140
|
int rows = caseApplicationMapper.insertCaseApplication(caseApplication);
|
|
104
|
141
|
List<CaseAffiliate> caseAffiliates = caseApplication.getCaseAffiliates();
|
|
|
@@ -116,7 +153,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
116
|
153
|
if(caseAffiliate.getIdentityType()==1&&StrUtil.isNotEmpty(caseAffiliate.getName())) {
|
|
117
|
154
|
// 将组织机构id设为申请人名称
|
|
118
|
155
|
if (deptMap.containsKey(caseAffiliate.getName())) {
|
|
119
|
|
- caseAffiliate.setName(String.valueOf(deptMap.get(caseAffiliate.getName())));
|
|
|
156
|
+ caseAffiliate.setApplicationOrganId(String.valueOf(deptMap.get(caseAffiliate.getName())));
|
|
|
157
|
+ caseAffiliate.setApplicationOrganName(caseAffiliate.getName());
|
|
120
|
158
|
} else {
|
|
121
|
159
|
// 如果不存在则新增
|
|
122
|
160
|
SysDept dept = new SysDept();
|
|
|
@@ -130,7 +168,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
130
|
168
|
dept.setUpdateBy(getUsername());
|
|
131
|
169
|
sysDeptMapper.insertDept(dept);
|
|
132
|
170
|
deptMap.put(dept.getDeptName(), dept.getDeptId());
|
|
133
|
|
- caseAffiliate.setName(String.valueOf(dept.getDeptId()));
|
|
|
171
|
+ caseAffiliate.setApplicationOrganId(String.valueOf(dept.getDeptId()));
|
|
|
172
|
+ caseAffiliate.setApplicationOrganName(caseAffiliate.getName());
|
|
134
|
173
|
|
|
135
|
174
|
}
|
|
136
|
175
|
}
|
|
|
@@ -184,6 +223,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
184
|
223
|
BigDecimal feeRate = new BigDecimal(0.01);
|
|
185
|
224
|
BigDecimal feePayable = caseApplication.getCaseSubjectAmount().multiply(feeRate).setScale(2,BigDecimal.ROUND_HALF_UP);
|
|
186
|
225
|
caseApplication.setFeePayable(feePayable);
|
|
|
226
|
+ caseApplication.setUpdateBy(getUsername());
|
|
187
|
227
|
|
|
188
|
228
|
int rows = caseApplicationMapper.updataCaseApplication(caseApplication);
|
|
189
|
229
|
List<CaseAffiliate> caseAffiliates = caseApplication.getCaseAffiliates();
|
|
|
@@ -199,7 +239,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
199
|
239
|
if(caseAffiliate.getIdentityType()==1&&StrUtil.isNotEmpty(caseAffiliate.getName())) {
|
|
200
|
240
|
// 将组织机构id设为申请人名称
|
|
201
|
241
|
if (deptMap.containsKey(caseAffiliate.getName())) {
|
|
202
|
|
- caseAffiliate.setName(String.valueOf(deptMap.get(caseAffiliate.getName())));
|
|
|
242
|
+ caseAffiliate.setApplicationOrganName(caseAffiliate.getName());
|
|
|
243
|
+ caseAffiliate.setApplicationOrganId(String.valueOf(deptMap.get(caseAffiliate.getName())));
|
|
203
|
244
|
} else {
|
|
204
|
245
|
// 如果不存在则新增
|
|
205
|
246
|
SysDept dept = new SysDept();
|
|
|
@@ -213,7 +254,9 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
213
|
254
|
dept.setUpdateBy(getUsername());
|
|
214
|
255
|
sysDeptMapper.insertDept(dept);
|
|
215
|
256
|
deptMap.put(dept.getDeptName(), dept.getDeptId());
|
|
216
|
|
- caseAffiliate.setName(String.valueOf(dept.getDeptId()));
|
|
|
257
|
+
|
|
|
258
|
+ caseAffiliate.setApplicationOrganName(caseAffiliate.getName());
|
|
|
259
|
+ caseAffiliate.setApplicationOrganId(String.valueOf(dept.getDeptId()));
|
|
217
|
260
|
|
|
218
|
261
|
}
|
|
219
|
262
|
}
|
|
|
@@ -400,7 +443,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
400
|
443
|
CaseApplication caseApplicationItera = caseApplicationNewList.get(k);
|
|
401
|
444
|
// 新增立案信息
|
|
402
|
445
|
caseApplicationItera.setCaseStatus(CaseApplicationConstants.CASE_APPLICATION);
|
|
403
|
|
-
|
|
|
446
|
+ caseApplicationItera.setCreateBy(getUsername());
|
|
404
|
447
|
int rows = caseApplicationMapper.insertCaseApplication(caseApplicationItera);
|
|
405
|
448
|
List<CaseAffiliate> caseAffiliates = caseApplicationItera.getCaseAffiliates();
|
|
406
|
449
|
if(caseAffiliates!=null&&caseAffiliates.size()>0){
|
|
|
@@ -879,29 +922,22 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
879
|
922
|
caseAffiliate.setCaseAppliId(caseApplication.getId());
|
|
880
|
923
|
List<CaseAffiliate> caseAffiliatListeselect = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate);
|
|
881
|
924
|
if(caseAffiliatListeselect!=null){
|
|
882
|
|
- // 查询组织机构
|
|
883
|
|
- List<SysDept> sysDepts = sysDeptMapper.selectDeptList(new SysDept());
|
|
884
|
|
- Map<String,String> deptMap=new HashMap<>();
|
|
885
|
|
- if(CollectionUtil.isNotEmpty(sysDepts)){
|
|
886
|
|
- for (SysDept sysDept : sysDepts) {
|
|
887
|
|
- deptMap.put(String.valueOf(sysDept.getDeptId()),sysDept.getDeptName());
|
|
888
|
|
- }
|
|
889
|
|
- }
|
|
890
|
|
- StringBuffer applicantName = new StringBuffer();
|
|
|
925
|
+
|
|
891
|
926
|
for (int i = 0; i < caseAffiliatListeselect.size(); i++){
|
|
892
|
927
|
CaseAffiliate caseAffiliateselect = caseAffiliatListeselect.get(i);
|
|
893
|
928
|
int identityType = caseAffiliateselect.getIdentityType();
|
|
894
|
929
|
if(identityType==1){
|
|
895
|
|
- if(StrUtil.isNotEmpty(caseAffiliateselect.getName())&&deptMap.containsKey(caseAffiliateselect.getName())){
|
|
896
|
|
- caseAffiliateselect.setName(deptMap.get(caseAffiliateselect.getName()));
|
|
897
|
|
- }
|
|
898
|
|
- applicantName.append(caseAffiliateselect.getName()).append(",");;
|
|
|
930
|
+
|
|
|
931
|
+ caseApplicationselect.setApplicantName(caseAffiliateselect.getApplicationOrganName());
|
|
899
|
932
|
}
|
|
900
|
933
|
}
|
|
901
|
|
- caseApplicationselect.setApplicantName(applicantName.toString());
|
|
902
|
|
-
|
|
903
|
934
|
|
|
904
|
935
|
}
|
|
|
936
|
+ caseApplication.setAnnexType(8);
|
|
|
937
|
+ // 查询缴费凭证
|
|
|
938
|
+ List<CaseAttach> payOrderList = caseAttachMapper.queryCaseAttachList(caseApplication);
|
|
|
939
|
+ caseApplicationselect.setPayOrderList(payOrderList);
|
|
|
940
|
+
|
|
905
|
941
|
return caseApplicationselect;
|
|
906
|
942
|
}
|
|
907
|
943
|
|
|
|
@@ -1012,21 +1048,12 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
1012
|
1048
|
caseAffiliate.setCaseAppliId(caseApplication.getId());
|
|
1013
|
1049
|
List<CaseAffiliate> caseAffiliatListeselect = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate);
|
|
1014
|
1050
|
if(caseAffiliatListeselect!=null) {
|
|
1015
|
|
- // 查询组织机构
|
|
1016
|
|
- List<SysDept> sysDepts = sysDeptMapper.selectDeptList(new SysDept());
|
|
1017
|
|
- Map<String,String> deptMap=new HashMap<>();
|
|
1018
|
|
- if(CollectionUtil.isNotEmpty(sysDepts)){
|
|
1019
|
|
- for (SysDept sysDept : sysDepts) {
|
|
1020
|
|
- deptMap.put(String.valueOf(sysDept.getDeptId()),sysDept.getDeptName());
|
|
1021
|
|
- }
|
|
1022
|
|
- }
|
|
|
1051
|
+
|
|
1023
|
1052
|
for (int j = 0; j < caseAffiliatListeselect.size(); j++) {
|
|
1024
|
1053
|
CaseAffiliate caseAffiliateselect = caseAffiliatListeselect.get(j);
|
|
1025
|
1054
|
int identityType = caseAffiliateselect.getIdentityType();
|
|
1026
|
1055
|
if(identityType==1){
|
|
1027
|
|
- if(StrUtil.isNotEmpty(caseAffiliateselect.getName())&&deptMap.containsKey(caseAffiliateselect.getName())){
|
|
1028
|
|
- caseAffiliateselect.setName(deptMap.get(caseAffiliateselect.getName()));
|
|
1029
|
|
- }
|
|
|
1056
|
+ caseAffiliateselect.setName(caseAffiliateselect.getApplicationOrganName());
|
|
1030
|
1057
|
|
|
1031
|
1058
|
}
|
|
1032
|
1059
|
//给申请人、被申请人发送短信通知
|
|
|
@@ -1108,7 +1135,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
1108
|
1135
|
|
|
1109
|
1136
|
// 将组织机构id设为申请人名称
|
|
1110
|
1137
|
if(deptMap.containsKey(caseApplication.getName())){
|
|
1111
|
|
- caseAffiliate.setName(String.valueOf(deptMap.get(caseApplication.getName())));
|
|
|
1138
|
+ caseAffiliate.setApplicationOrganId(String.valueOf(deptMap.get(caseApplication.getName())));
|
|
|
1139
|
+ caseAffiliate.setApplicationOrganName(caseApplication.getName());
|
|
1112
|
1140
|
}else {
|
|
1113
|
1141
|
// 如果不存在则新增
|
|
1114
|
1142
|
SysDept dept = new SysDept();
|
|
|
@@ -1122,7 +1150,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|
1122
|
1150
|
dept.setUpdateBy(getUsername());
|
|
1123
|
1151
|
sysDeptMapper.insertDept(dept);
|
|
1124
|
1152
|
deptMap.put(dept.getDeptName(),dept.getDeptId());
|
|
1125
|
|
- caseAffiliate.setName(String.valueOf(dept.getDeptId()));
|
|
|
1153
|
+ caseAffiliate.setApplicationOrganId(String.valueOf(dept.getDeptId()));
|
|
|
1154
|
+ caseAffiliate.setApplicationOrganName(caseApplication.getName());
|
|
1126
|
1155
|
|
|
1127
|
1156
|
}
|
|
1128
|
1157
|
|