Ver código fonte

申请人用手机号关联

18792927508 2 anos atrás
pai
commit
98200d775c

+ 8
- 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java Ver arquivo

@@ -148,6 +148,12 @@ public interface SysUserMapper
148 148
      * @return
149 149
      */
150 150
     SysUser selectUserByIdCard(@Param("idCard")String identityNo);
151
+    /**
152
+     * 根据手机号查询用户信息
153
+     * @param phone
154
+     * @return
155
+     */
156
+    SysUser selectUserByPhone(@Param("phone")String phone);
151 157
 
152 158
     /**
153 159
      * 根据部门和角色查询用户
@@ -158,4 +164,6 @@ public interface SysUserMapper
158 164
     List<SysUser> selectByDeptIdAndRole(@Param("deptId")String applicationOrganId, @Param("roleName")String roleName);
159 165
 
160 166
     List<SysUser>  selectRoleUserByDeptId(@Param("deptId")Long deptId,@Param("roleId") Long roleId );
167
+
168
+
161 169
 }

+ 76
- 71
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationLogServiceImpl.java Ver arquivo

@@ -50,6 +50,13 @@ public class CaseApplicationLogServiceImpl implements CaseApplicationLogService
50 50
     private SmsRecordMapper smsRecordMapper;
51 51
     @Autowired
52 52
     private ICaseApplicationService caseApplicationService;
53
+    // 对比两个版本修改的字段,基本字段对比
54
+    private static final String[] columns = {"caseName","caseSubjectAmount","loanStartDate", "loanEndDate","contractNumber","claimInterestOwed","claimLiquidDamag",
55
+            "claimPrinciOwed","arbitratClaims","properPreser","requestRule"};
56
+    // 人员字段对比
57
+    private static final String[] affiliateColumns = {"name", "identityNum","contactTelphone","contactAddress","workTelphone","workAddress","email",
58
+            "nameAgent", "identityNumAgent","contactTelphoneAgent","contactAddressAgent","residenAffili","compLegalPerson",
59
+            "compLegalperPost","responSex","responBirth"};
53 60
     @Override
54 61
     public int insert(CaseApplication caseApplicationLog) {
55 62
         return caseApplicationLogMapper.insert(caseApplicationLog);
@@ -146,40 +153,28 @@ public class CaseApplicationLogServiceImpl implements CaseApplicationLogService
146 153
                 List<CaseAttach> attachLogList = caseAttachLogMapper.queryCaseAttachList(caseApplication);
147 154
                 // 更新记录附件表
148 155
                 if(CollectionUtil.isNotEmpty(attachLogList)){
149
-                //    caseAttachMapper.deleteByCasedIdAndType(vo.getCaseId(), 2,0);
150 156
                     for (CaseAttach caseAttach : attachLogList) {
151 157
                         caseAttach.setCaseAppliId(vo.getCaseId());
152 158
                         caseAttachMapper.updateCaseAttach(caseAttach);
153 159
                     }
154 160
                 }
155
-             //   caseAffiliateMapper.updateCaseAffiliateByCaseId(caseApplicationLog.getCaseAppliId(), affiliateLogList);
156 161
             } else {
157 162
                 // 拒绝,将日志表改版本的状态改为拒绝
158 163
                 vo.setUpdateSubmitStatus(UpdateSubmitStatus.REFUSE.getCode());
159 164
                 caseApplicationLogMapper.updateStatus(vo);
160 165
                return sendAuditMessage(vo);
161
-
162
-
163
-                // 修改案件表的版本号
164
-                 //  caseApplicationMapper.updateVersionById(vo.getCaseId(),vo.getVersion());
165
-
166 166
             }
167 167
             return AjaxResult.success();
168 168
         } else if (Objects.equals(vo.getUpdateSubmitStatus(), UpdateSubmitStatus.REVOKE.getCode())) {
169
-            // 如果版本号为1,则直接返回
170
-
171 169
             // 审核修改撤销状态
172 170
             if (Objects.equals(vo.getIsAgree(), YesOrNoEnum.YES.getCode())) {
171
+                // 同意撤销
173 172
                 agreeRevoke(vo);
174
-                // 同意撤销,查询日志记录表上个版本数据,将数据更新到主表,并将日志表改版本的状态改为同意撤销
175
-
176 173
             } else {
177 174
                 // 拒绝撤销,将日志表改版本的状态改为拒绝撤销
178 175
                 vo.setUpdateSubmitStatus(UpdateSubmitStatus.REFUSE_REVOKE.getCode());
179 176
                 caseApplicationLogMapper.updateStatus(vo);
180 177
                 return sendAuditMessage(vo);
181
-                // 修改案件表的版本号
182
-             //   caseApplicationMapper.updateVersionById(vo.getCaseId(),vo.getVersion());
183 178
             }
184 179
             return AjaxResult.success();
185 180
         }
@@ -231,34 +226,43 @@ public class CaseApplicationLogServiceImpl implements CaseApplicationLogService
231 226
 
232 227
     @Override
233 228
     public AjaxResult selectCompareCase(UpdateSubmitVO vo) {
234
-        // 查询当前版本号和上一个版本号的案件
229
+        // 查询当前版本号和主表的案件
235 230
         CaseApplication afterCase = caseApplicationLogMapper.selectByCaseIdAndVersion(vo.getCaseId(), vo.getVersion());
236
-      //  CaseApplication beforeCase = caseApplicationLogMapper.selectBeforeCase(vo.getCaseId(), vo.getVersion());
237 231
         CaseApplication caseApplication = new CaseApplication();
238 232
         caseApplication.setCaseAppliId(vo.getCaseId());
239 233
         caseApplication.setId(vo.getCaseId());
240 234
         CaseApplication beforeCase=   caseApplicationService.selectCaseApplication(caseApplication);
241 235
 
242 236
         // 查询案件关联人员
243
-       // beforeCase.setCaseAffiliates(caseAffiliateLogMapper.selectCaseAffiliate(beforeCase.getCaseLogId()));
244 237
         afterCase.setCaseAffiliates(caseAffiliateLogMapper.selectCaseAffiliate(afterCase.getCaseLogId()));
245 238
         // 查询附件
246 239
         CaseAttach caseAttach = new CaseAttach();
247 240
         caseAttach.setCaseAppliLogId(beforeCase.getCaseLogId());
248 241
         caseAttach.setAnnexType(2);
249 242
         caseAttachLogMapper.getCaseAttachByCaseIdAndType(caseAttach);
250
-   //     beforeCase.setCaseAttachList(caseAttachLogMapper.getCaseAttachByCaseIdAndType(caseAttach));
251 243
         caseAttach.setCaseAppliLogId(afterCase.getCaseLogId());
252
-        afterCase.setCaseAttachList(caseAttachLogMapper.getCaseAttachByCaseIdAndType(caseAttach));
244
+        List<CaseAttach> afterAttachList = caseAttachLogMapper.getCaseAttachByCaseIdAndType(caseAttach);
245
+        if(CollectionUtil.isNotEmpty(afterAttachList)){
246
+            for (CaseAttach attach : afterAttachList) {
247
+                String annexName = attach.getAnnexName();
248
+                String prefix = "/profile";
249
+                int startIndex = annexName.indexOf(prefix);
250
+                startIndex += prefix.length();
251
+                String annexPath = "/uploadPath" + annexName.substring(startIndex);
252
+                attach.setAnnexPath(annexPath);
253
+                int startIndexnew = annexName.lastIndexOf("/");
254
+                if (startIndexnew != -1) {
255
+                    String annexNamenew = annexName.substring(startIndexnew + 1);
256
+                    attach.setAnnexName(annexNamenew);
257
+                }
258
+            }
259
+            afterCase.setCaseAttachList(afterAttachList);
260
+        }
261
+        afterCase.setCaseAttachList(afterAttachList);
253 262
         CompareCaseVO compareCaseVO = new CompareCaseVO();
254 263
         compareCaseVO.setBeforeCase(beforeCase);
255 264
         compareCaseVO.setAfterCase(afterCase);
256
-        // 对比两个版本修改的字段
257
-        String[] columns = {"caseName","caseSubjectAmount","loanStartDate", "loanEndDate","contractNumber","claimInterestOwed","claimLiquidDamag",
258
-                "claimPrinciOwed","arbitratClaims","properPreser","requestRule"};
259
-        String[] affiliateColumns = {"name", "identityNum","contactTelphone","contactAddress","workTelphone","workAddress","email",
260
-                "nameAgent", "identityNumAgent","contactTelphoneAgent","contactAddressAgent","residenAffili","compLegalPerson",
261
-        "compLegalperPost","responSex","responBirth"};
265
+
262 266
         StringBuilder changeColumn = new StringBuilder();
263 267
         // 对比基本字段
264 268
         for (String column : columns) {
@@ -279,6 +283,54 @@ public class CaseApplicationLogServiceImpl implements CaseApplicationLogService
279 283
             }
280 284
 
281 285
         }
286
+        // 对比案件人员字段
287
+        compareAffilate(beforeCase,afterCase);
288
+        // 对比申请人证据资料
289
+        compareCaseVO.setChangeColumn(compareApplicantFile(beforeCase,afterCase,changeColumn).toString());
290
+
291
+        return AjaxResult.success(compareCaseVO);
292
+    }
293
+
294
+    /**
295
+     * 对比申请人证据资料
296
+     * @param beforeCase
297
+     * @param afterCase
298
+     * @param changeColumn
299
+     * @return
300
+     */
301
+    private StringBuilder compareApplicantFile(CaseApplication beforeCase, CaseApplication afterCase, StringBuilder changeColumn) {
302
+        List<CaseAttach> beforeAttachFilter =new ArrayList<>();
303
+        List<CaseAttach> afterAttachFilter =new ArrayList<>();
304
+        if(CollectionUtil.isNotEmpty(beforeCase.getCaseAttachList())){
305
+            beforeAttachFilter = beforeCase.getCaseAttachList().stream().filter(n -> n.getAnnexType() == 2).collect(Collectors.toList());
306
+        }
307
+        if(CollectionUtil.isNotEmpty(afterCase.getCaseAttachList())){
308
+            afterAttachFilter = afterCase.getCaseAttachList().stream().filter(n -> n.getAnnexType() == 2).collect(Collectors.toList());
309
+        }
310
+        if(CollectionUtil.isNotEmpty(beforeAttachFilter)&& CollectionUtil.isNotEmpty(afterAttachFilter)){
311
+            if(beforeAttachFilter.size()!=afterAttachFilter.size()){
312
+                changeColumn.append("fileColumn");
313
+            }else {
314
+                Map<String, CaseAttach> afterAttachMap = afterAttachFilter.stream().collect(Collectors.toMap(CaseAttach::getAnnexPath, Function.identity(), (n1, n2) -> n2));
315
+                for (CaseAttach beforeCaseAttach : beforeAttachFilter) {
316
+                    if(!afterAttachMap.containsKey(beforeCaseAttach.getAnnexPath())) {
317
+                        changeColumn.append("fileColumn");
318
+                        break;
319
+                    }
320
+                }
321
+            }
322
+        }
323
+
324
+
325
+      return changeColumn;
326
+    }
327
+
328
+    /**
329
+     * 对比案件人员字段
330
+     * @param beforeCase
331
+     * @param afterCase
332
+     */
333
+    private void compareAffilate(CaseApplication beforeCase, CaseApplication afterCase) {
282 334
         // 对比人员字段
283 335
         List<CaseAffiliate> beforeCaseCaseAffiliates = beforeCase.getCaseAffiliates();
284 336
         List<CaseAffiliate> afterCaseCaseAffiliates = afterCase.getCaseAffiliates();
@@ -341,51 +393,6 @@ public class CaseApplicationLogServiceImpl implements CaseApplicationLogService
341 393
 
342 394
 
343 395
         }
344
-        List<CaseAttach> beforeAttachFilter =new ArrayList<>();
345
-        List<CaseAttach> afterAttachFilter =new ArrayList<>();
346
-        if(CollectionUtil.isNotEmpty(beforeCase.getCaseAttachList())){
347
-            beforeAttachFilter = beforeCase.getCaseAttachList().stream().filter(n -> n.getAnnexType() == 2).collect(Collectors.toList());
348
-        }
349
-        if(CollectionUtil.isNotEmpty(beforeCase.getCaseAttachList())){
350
-          afterAttachFilter = afterCase.getCaseAttachList().stream().filter(n -> n.getAnnexType() == 2).collect(Collectors.toList());
351
-        }
352
-        if(CollectionUtil.isNotEmpty(beforeAttachFilter)&& CollectionUtil.isNotEmpty(afterAttachFilter)){
353
-            if(beforeAttachFilter.size()!=afterAttachFilter.size()){
354
-                changeColumn.append("fileColumn");
355
-            }else {
356
-                Map<String, CaseAttach> afterAttachMap = afterAttachFilter.stream().collect(Collectors.toMap(CaseAttach::getAnnexPath, Function.identity(), (n1, n2) -> n2));
357
-                for (CaseAttach beforeCaseAttach : beforeAttachFilter) {
358
-                    if(!afterAttachMap.containsKey(beforeCaseAttach.getAnnexPath())) {
359
-                        changeColumn.append("fileColumn");
360
-                        break;
361
-                    }
362
-                }
363
-            }
364
-        }
365
-
366
-      
367
-        compareCaseVO.setChangeColumn(changeColumn.toString());
368
-        if(CollectionUtil.isNotEmpty(afterCase.getCaseAttachList())){
369
-            List<CaseAttach> caseAttachList = afterCase.getCaseAttachList();
370
-            for (CaseAttach attach : caseAttachList) {
371
-                    String annexName = attach.getAnnexName();
372
-                    String prefix = "/profile";
373
-                    int startIndex = annexName.indexOf(prefix);
374
-                    startIndex += prefix.length();
375
-                    String annexPath = "/uploadPath" + annexName.substring(startIndex);
376
-                    attach.setAnnexPath(annexPath);
377
-                    int startIndexnew = annexName.lastIndexOf("/");
378
-                    if (startIndexnew != -1) {
379
-                        String annexNamenew = annexName.substring(startIndexnew + 1);
380
-                        attach.setAnnexName(annexNamenew);
381
-                    }
382
-
383
-
384
-                }
385
-            afterCase.setCaseAttachList(caseAttachList);
386
-        }
387
-
388
-        return AjaxResult.success(compareCaseVO);
389 396
     }
390 397
 
391 398
     /**
@@ -430,12 +437,10 @@ public class CaseApplicationLogServiceImpl implements CaseApplicationLogService
430 437
         List<CaseAttach> attachLogList = caseAttachLogMapper.queryCaseAttachList(caseApplication);
431 438
         // 更新记录附件表
432 439
         if(CollectionUtil.isNotEmpty(attachLogList)){
433
-        //    caseAttachMapper.deleteByCasedIdAndType(vo.getCaseId(), 2,0);
434 440
             for (CaseAttach caseAttach : attachLogList) {
435 441
                 caseAttach.setCaseAppliId(vo.getCaseId());
436 442
                 caseAttachMapper.updateCaseAttach(caseAttach);
437 443
             }
438 444
         }
439
-       // caseAffiliateMapper.updateCaseAffiliateByCaseId(caseApplicationLog.getCaseAppliId(), affiliateLogList);
440 445
     }
441 446
 }

+ 10
- 5
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java Ver arquivo

@@ -1189,13 +1189,13 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
1189 1189
         if (caseAffiliate.getIdentityType() == 1 && StrUtil.isNotEmpty(caseAffiliate.getNameAgent())) {
1190 1190
 
1191 1191
             // 组装申请机构代理人信息,用户表新增并且和部门关联
1192
-            // 根据代理人身份证去用户表查询,有修改,么有新增
1193
-            SysUser agentUser = sysUserMapper.selectUserByIdCard(caseAffiliate.getIdentityNumAgent());
1192
+            // 根据代理人手机号去用户表查询,有修改,么有新增
1193
+            SysUser agentUser = sysUserMapper.selectUserByPhone(caseAffiliate.getContactTelphoneAgent());
1194 1194
             if (agentUser == null) {
1195 1195
                 agentUser = new SysUser();
1196 1196
                 agentUser.setIdCard(caseAffiliate.getIdentityNumAgent());
1197 1197
                 agentUser.setNickName(caseAffiliate.getNameAgent());
1198
-                agentUser.setUserName(caseAffiliate.getIdentityNumAgent());
1198
+                agentUser.setUserName(caseAffiliate.getContactTelphoneAgent());
1199 1199
                 agentUser.setPhonenumber(caseAffiliate.getContactTelphoneAgent());
1200 1200
                 //   agentUser.setPassword(SecurityUtils.encryptPassword(Constants.DEFAULT_PASSWORD));
1201 1201
                 agentUser.setDeptId(Long.valueOf(caseAffiliate.getApplicationOrganId()));
@@ -1248,6 +1248,11 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
1248 1248
                 caseAffiliate.setContactTelphoneAgent(agentUser.getPhonenumber());
1249 1249
                 caseAffiliate.setNameAgent(agentUser.getNickName());
1250 1250
                 caseAffiliate.setApplicantAgentUserId(String.valueOf(agentUser.getUserId()));
1251
+                if(StrUtil.isNotEmpty(agentUser.getIdCard())){
1252
+                    caseAffiliate.setIdentityNumAgent(agentUser.getIdCard());
1253
+                }else {
1254
+                    caseAffiliate.setIdentityNumAgent(caseAffiliate.getIdentityNumAgent());
1255
+                }
1251 1256
                 List<Long> longList = new ArrayList<>();
1252 1257
                 // 新增角色为申请人
1253 1258
                 if (CollectionUtil.isNotEmpty(agentUser.getRoles())) {
@@ -2985,12 +2990,12 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
2985 2990
                         caseAffiliate.setIdentityNum(map.get("统一社会信用代码").get(0));
2986 2991
                         caseAffiliate.setCompLegalPerson(map.get("负责人").get(0));
2987 2992
                         caseAffiliate.setNameAgent(map.get("委托代理人").get(0));
2988
-                        caseAffiliate.setContactTelphone(map.get("联系电话").get(0));
2993
+                        caseAffiliate.setContactTelphoneAgent(map.get("联系电话").get(0));
2989 2994
                         caseAffiliate.setResidenAffili(map.get("住所").get(0));
2990 2995
                         caseAffiliate.setContactAddress(map.get("联系地址").get(0));
2991 2996
                         caseAffiliate.setEmail(map.get("电子邮件").get(0).replaceAll("\\s", ""));
2992 2997
                         //设置默认代理人的身份证号码,暂时写死 要不然新增方法报错
2993
-                        caseAffiliate.setIdentityNumAgent("610423199603171716");
2998
+                  //      caseAffiliate.setIdentityNumAgent("610423199603171716");
2994 2999
                         caseAffiliates.add(caseAffiliate);
2995 3000
                         CaseAffiliate caseAffiliate1 = new CaseAffiliate();
2996 3001
                         caseAffiliate1.setIdentityType(2);

+ 1
- 1
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/VideoServiceImpl.java Ver arquivo

@@ -329,7 +329,7 @@ public class VideoServiceImpl implements VideoService {
329 329
         } catch (IOException e) {
330 330
             throw new RuntimeException(e);
331 331
         }
332
-        String htmlContent = "<html><body style=\"font-size:12.0pt; font-family:SimSun;\">" +reservedConferenceVO.getHtmlContent()+"</body></html>";
332
+        String htmlContent = "<html><head> <title>庭审笔录</title></head><body style=\"font-size:12.0pt; font-family:SimSun;\"><h1 align=\"center\">庭审笔录</h1>" +reservedConferenceVO.getHtmlContent()+"</body></html>";
333 333
         // html转pdf并上传到服务器
334 334
         boolean convertFlag = PdfUtils.htmlStringConvertToPDF(RuoYiConfig.getHtml2PDFPath() +"/"+ currentFileName, htmlContent);
335 335
 

+ 8
- 0
ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml Ver arquivo

@@ -194,6 +194,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
194 194
 			left join sys_role r on r.role_id = ur.role_id
195 195
 		where u.id_card = #{idCard} and u.del_flag = '0' and u.status='0' order by u.create_time limit 1
196 196
 	</select>
197
+	<select id="selectUserByPhone" parameterType="String" resultMap="SysUserResult">
198
+		select u.*,d.dept_name,ur.role_id
199
+			from sys_user u
200
+		    left join sys_dept d on u.dept_id = d.dept_id
201
+			left join sys_user_role ur on u.user_id = ur.user_id
202
+			left join sys_role r on r.role_id = ur.role_id
203
+		where u.phonenumber = #{phone} and u.del_flag = '0' and u.status='0' order by u.create_time limit 1
204
+	</select>
197 205
     <select id="selectByDeptIdAndRole" resultMap="SysUserResult">
198 206
 		select u.* from
199 207
 		               sys_user u

+ 3
- 9
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml Ver arquivo

@@ -166,7 +166,7 @@
166 166
 
167 167
 
168 168
                 <!--申请人案件-->
169
-                select c.id ,l.id AS caseLogId,c.case_num ,c.case_subject_amount ,c.register_date ,c.arbitrat_method ,
169
+                select c.id ,'' AS caseLogId,c.case_num ,c.case_subject_amount ,c.register_date ,c.arbitrat_method ,
170 170
                 CASE c.arbitrat_method when 1 then '开庭审理' when 2 then '书面审理'
171 171
                 ELSE '无审理方式'
172 172
                 END arbitratMethodName,
@@ -192,8 +192,7 @@
192 192
                 update_submit_status from case_application_log where case_appli_id=c.id order by version desc limit 1)
193 193
                 as updateSubmitStatus
194 194
                 from case_application c
195
-                JOIN case_application_log l ON c.id = l.case_appli_id and c.version=l.version
196
-                JOIN case_affiliate_log ca ON ca.case_appli_log_id = l.id AND ca.identity_type = 1
195
+                JOIN case_affiliate ca ON ca.case_appli_id =c.id AND ca.identity_type = 1
197 196
 
198 197
                 <where>
199 198
                     (c.case_status &lt;= 10 or c.case_status=31) AND ca.identity_type=1
@@ -471,12 +470,7 @@
471 470
                 ) tt2
472 471
 
473 472
                                  <where>
474
-                                     <if test="caseStatusList != null and caseStatusList.size() > 0">
475
-                                         and tt2.case_status in
476
-                                         <foreach item="caseStatus" collection="caseStatusList" open="(" separator="," close=")">
477
-                                             #{caseStatus}
478
-                                         </foreach>
479
-                                     </if>
473
+
480 474
                                      <if test="caseStatus != null">
481 475
                                          AND tt2.case_status = #{caseStatus}
482 476
                                      </if>