Selaa lähdekoodia

Merge branch 'wq' of SH-Arbitrate/Arbitrate-Backend into dev

wangqiong123 2 vuotta sitten
vanhempi
commit
f7fe71a2d5

+ 1
- 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java Näytä tiedosto

@@ -2,6 +2,7 @@ package com.ruoyi.web.controller.wisdomarbitrate;
2 2
 
3 3
 import cn.hutool.core.util.StrUtil;
4 4
 import com.ruoyi.common.annotation.Anonymous;
5
+import com.ruoyi.common.annotation.CaseLog;
5 6
 import com.ruoyi.common.annotation.Log;
6 7
 import com.ruoyi.common.core.controller.BaseController;
7 8
 import com.ruoyi.common.core.domain.AjaxResult;

+ 34
- 0
ruoyi-common/src/main/java/com/ruoyi/common/annotation/CaseLog.java Näytä tiedosto

@@ -0,0 +1,34 @@
1
+package com.ruoyi.common.annotation;
2
+
3
+
4
+import java.lang.annotation.*;
5
+
6
+/**
7
+ * 案件操作日志记录注解
8
+ * 
9
+ * @author wangqiong
10
+ *
11
+ */
12
+@Target({ ElementType.PARAMETER, ElementType.METHOD })
13
+@Retention(RetentionPolicy.RUNTIME)
14
+@Documented
15
+public @interface CaseLog
16
+{
17
+    /**
18
+     * 案件申请人id
19
+     */
20
+    public long caseAppliId() default 0L;
21
+
22
+    /**
23
+     * 案件节点
24
+     */
25
+    public String caseNode() default "";
26
+
27
+
28
+    /**
29
+     * 备注
30
+     */
31
+    public String notes() default "";
32
+
33
+
34
+}

+ 87
- 0
ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/CaseLogAspect.java Näytä tiedosto

@@ -0,0 +1,87 @@
1
+package com.ruoyi.framework.aspectj;
2
+
3
+
4
+import com.ruoyi.common.annotation.CaseLog;
5
+import com.ruoyi.common.core.domain.model.LoginUser;
6
+import com.ruoyi.common.utils.SecurityUtils;
7
+import com.ruoyi.wisdomarbitrate.domain.CaseLogRecord;
8
+import com.ruoyi.wisdomarbitrate.mapper.CaseLogRecordMapper;
9
+import org.aspectj.lang.JoinPoint;
10
+import org.aspectj.lang.annotation.AfterReturning;
11
+import org.aspectj.lang.annotation.Aspect;
12
+import org.aspectj.lang.annotation.Before;
13
+import org.slf4j.Logger;
14
+import org.slf4j.LoggerFactory;
15
+import org.springframework.beans.factory.annotation.Autowired;
16
+import org.springframework.stereotype.Component;
17
+
18
+/**
19
+ * 案件操作日志记录处理
20
+ * 
21
+ * @author wangqiong
22
+ */
23
+@Aspect
24
+@Component
25
+public class CaseLogAspect {
26
+    @Autowired
27
+    private CaseLogRecordMapper logRecordMapper;
28
+    private static final Logger log = LoggerFactory.getLogger(CaseLogAspect.class);
29
+
30
+
31
+    /**
32
+     * 处理请求前执行
33
+     */
34
+    @Before(value = "@annotation(controllerLog)")
35
+    public void boBefore(JoinPoint joinPoint, CaseLog controllerLog) {
36
+    }
37
+
38
+    /**
39
+     * 处理完请求后执行
40
+     *
41
+     * @param joinPoint 切点
42
+     */
43
+    @AfterReturning(pointcut = "@annotation(controllerLog)", returning = "jsonResult")
44
+    public void doAfterReturning(JoinPoint joinPoint, CaseLog controllerLog, Object jsonResult) {
45
+        handleLog(joinPoint, controllerLog, null, jsonResult);
46
+    }
47
+
48
+    protected void handleLog(final JoinPoint joinPoint, CaseLog controllerLog, final Exception e, Object jsonResult) {
49
+        try {
50
+            // 获取当前的用户
51
+            LoginUser loginUser = SecurityUtils.getLoginUser();
52
+            String nickName = loginUser.getUser().getNickName();
53
+
54
+            // *========数据库日志=========*//
55
+            CaseLogRecord operLog = new CaseLogRecord();
56
+            operLog.setCreateBy(nickName);
57
+            operLog.setUpdateBy(nickName);
58
+            // 处理设置注解上的参数
59
+            getControllerMethodDescription(joinPoint, controllerLog, operLog, jsonResult);
60
+
61
+            // 保存数据库
62
+            logRecordMapper.insertCaseLogRecord(operLog);
63
+        } catch (Exception exp) {
64
+            // 记录本地异常日志
65
+            log.error("异常信息:{}", exp.getMessage());
66
+            exp.printStackTrace();
67
+        }
68
+    }
69
+
70
+    /**
71
+     * 获取注解中对方法的描述信息 用于Controller层注解
72
+     *
73
+     * @param log     日志
74
+     * @param operLog 操作日志
75
+     * @throws Exception
76
+     */
77
+    public void getControllerMethodDescription(JoinPoint joinPoint, CaseLog log, CaseLogRecord operLog, Object jsonResult) throws Exception {
78
+        // 设置案件id
79
+        operLog.setCaseAppliId(log.caseAppliId());
80
+        // 设置案件节点
81
+        operLog.setNotes(log.caseNode());
82
+        // 设置备注
83
+        operLog.setNotes(log.notes());
84
+
85
+    }
86
+
87
+}

+ 54
- 2
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java Näytä tiedosto

@@ -3,6 +3,7 @@ package com.ruoyi.wisdomarbitrate.service.impl;
3 3
 
4 4
 import cn.hutool.core.collection.CollectionUtil;
5 5
 import cn.hutool.core.util.StrUtil;
6
+import com.ruoyi.common.annotation.CaseLog;
6 7
 import com.ruoyi.common.annotation.DataScope;
7 8
 import com.ruoyi.common.constant.CaseApplicationConstants;
8 9
 import com.ruoyi.common.core.domain.entity.SysDept;
@@ -113,9 +114,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
113 114
                 caseAttach.setCaseAppliId(caseApplication.getId());
114 115
                 caseAttachMapper.updateCaseAttach(caseAttach);
115 116
             }
116
-
117 117
         }
118
-
119 118
         return rows;
120 119
     }
121 120
 
@@ -156,10 +155,38 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
156 155
         int rows = caseApplicationMapper.updataCaseApplication(caseApplication);
157 156
         List<CaseAffiliate> caseAffiliates = caseApplication.getCaseAffiliates();
158 157
         if(caseAffiliates!=null&&caseAffiliates.size()>0){
158
+            // 查询所有的组织机构,组装成map
159
+            List<SysDept> deptList = sysDeptMapper.selectDeptList(new SysDept());
160
+            if (CollectionUtil.isEmpty(deptList)) {
161
+                deptList = new ArrayList<>();
162
+            }
163
+            Map<String, Long> deptMap = deptList.stream().collect(Collectors.toMap(SysDept::getDeptName, SysDept::getDeptId,(oldV,newV)->newV));
159 164
             for (CaseAffiliate caseAffiliate : caseAffiliates){
160 165
                 caseAffiliate.setCaseAppliId(caseApplication.getId());
166
+                if(caseAffiliate.getIdentityType()==1&&StrUtil.isNotEmpty(caseAffiliate.getName())) {
167
+                    // 将组织机构id设为申请人名称
168
+                    if (deptMap.containsKey(caseApplication.getName())) {
169
+                        caseAffiliate.setName(String.valueOf(deptMap.get(caseAffiliate.getName())));
170
+                    } else {
171
+                        // 如果不存在则新增
172
+                        SysDept dept = new SysDept();
173
+                        dept.setParentId(0L);
174
+                        dept.setDeptName(caseAffiliate.getName());
175
+                        dept.setAncestors("0");
176
+                        dept.setOrderNum(1);
177
+                        dept.setStatus("0");
178
+                        dept.setDelFlag("0");
179
+                        dept.setCreateBy(getUsername());
180
+                        dept.setUpdateBy(getUsername());
181
+                        sysDeptMapper.insertDept(dept);
182
+                        deptMap.put(dept.getDeptName(), dept.getDeptId());
183
+                        caseAffiliate.setName(String.valueOf(dept.getDeptId()));
184
+
185
+                    }
186
+                }
161 187
                 caseAffiliateMapper.updataCaseAffiliate(caseAffiliate);
162 188
             }
189
+
163 190
         }
164 191
         List<CaseAttach> caseAttachList = caseApplication.getCaseAttachList();
165 192
         if(caseAttachList!=null&&caseAttachList.size()>0){
@@ -458,11 +485,22 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
458 485
         caseAffiliate.setCaseAppliId(caseApplication.getId());
459 486
         List<CaseAffiliate> caseAffiliatListeselect = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate);
460 487
         if(caseAffiliatListeselect!=null){
488
+            // 查询组织机构
489
+            List<SysDept> sysDepts = sysDeptMapper.selectDeptList(new SysDept());
490
+            Map<String,String> deptMap=new HashMap<>();
491
+            if(CollectionUtil.isNotEmpty(sysDepts)){
492
+                for (SysDept sysDept : sysDepts) {
493
+                    deptMap.put(String.valueOf(sysDept.getDeptId()),sysDept.getDeptName());
494
+                }
495
+            }
461 496
             StringBuffer applicantName = new StringBuffer();
462 497
             for (int i = 0; i < caseAffiliatListeselect.size(); i++){
463 498
                 CaseAffiliate caseAffiliateselect = caseAffiliatListeselect.get(i);
464 499
                 int identityType = caseAffiliateselect.getIdentityType();
465 500
                 if(identityType==1){
501
+                    if(StrUtil.isNotEmpty(caseAffiliateselect.getName())&&deptMap.containsKey(caseAffiliateselect.getName())){
502
+                        caseAffiliateselect.setName(deptMap.get(caseAffiliateselect.getName()));
503
+                    }
466 504
                     applicantName.append(caseAffiliateselect.getName()).append(",");;
467 505
                 }
468 506
             }
@@ -543,9 +581,23 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
543 581
         caseAffiliate.setCaseAppliId(caseApplication.getId());
544 582
         List<CaseAffiliate> caseAffiliatListeselect = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate);
545 583
         if(caseAffiliatListeselect!=null) {
584
+            // 查询组织机构
585
+            List<SysDept> sysDepts = sysDeptMapper.selectDeptList(new SysDept());
586
+            Map<String,String> deptMap=new HashMap<>();
587
+            if(CollectionUtil.isNotEmpty(sysDepts)){
588
+                for (SysDept sysDept : sysDepts) {
589
+                    deptMap.put(String.valueOf(sysDept.getDeptId()),sysDept.getDeptName());
590
+                }
591
+            }
546 592
             for (int j = 0; j < caseAffiliatListeselect.size(); j++) {
547 593
                 CaseAffiliate caseAffiliateselect = caseAffiliatListeselect.get(j);
548 594
                 int identityType = caseAffiliateselect.getIdentityType();
595
+                if(identityType==1){
596
+                    if(StrUtil.isNotEmpty(caseAffiliateselect.getName())&&deptMap.containsKey(caseAffiliateselect.getName())){
597
+                        caseAffiliateselect.setName(deptMap.get(caseAffiliateselect.getName()));
598
+                    }
599
+                    caseAffiliateselect.setName(caseAffiliateselect.getName());;
600
+                }
549 601
                 //给申请人、被申请人发送短信通知
550 602
                 request.setPhone(caseAffiliateselect.getContactTelphone());
551 603
                 // 1947342 普通短信 开庭日期通知 尊敬的{1}用户,您的{2}仲裁案件,开庭日期已确定为{3},请知晓,如非本人操作,请忽略本短信。

+ 36
- 7
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseLogRecordServiceImpl.java Näytä tiedosto

@@ -34,21 +34,50 @@ public class CaseLogRecordServiceImpl  implements ICaseLogRecordService {
34 34
                         contentBuilder.append("提交立案申请");
35 35
                         break;
36 36
                     case  2:
37
-                        contentBuilder.append("提交立案审查");
37
+                        contentBuilder.append("同意立案申请");
38 38
                         break;
39 39
                     case  3:
40
-                        contentBuilder.append("创建立案申请");
40
+                        contentBuilder.append("缴费成功");
41 41
                         break;
42 42
                     case  4:
43
-                        contentBuilder.append("缴费成功");
43
+                        contentBuilder.append("已确认缴费");
44 44
                     case  5:
45
-                        contentBuilder.append("缴费成功");
45
+                        contentBuilder.append("进行案件质证");
46 46
                     case  6:
47
-                        contentBuilder.append("缴费成功");
47
+                        contentBuilder.append("同意组庭审核");
48 48
                     case  7:
49
-                        contentBuilder.append("缴费成功");
49
+                        contentBuilder.append("组庭确认成功");
50 50
                     case  8:
51
-                        contentBuilder.append("缴费成功");
51
+                        contentBuilder.append("同意待开庭审理");
52
+                    case  9:
53
+                        contentBuilder.append("同意书面审理");
54
+                        break;
55
+                    case  10:
56
+                        contentBuilder.append("已完成书面审理");
57
+                        break;
58
+                    case  11:
59
+                        contentBuilder.append("已生成仲裁文书");
60
+                        break;
61
+                    case  12:
62
+                        contentBuilder.append("已核查仲裁文书");
63
+                        break;
64
+                    case  13:
65
+                        contentBuilder.append("已同意仲裁文书");
66
+                        break;
67
+                    case  14:
68
+                        contentBuilder.append("已完成仲裁文书签名");
69
+                        break;
70
+                    case  15:
71
+                        contentBuilder.append("已完成仲裁文书用印");
72
+                        break;
73
+                    case  16:
74
+                        contentBuilder.append("已送达仲裁文书");
75
+                        break;
76
+                    case  17:
77
+                        contentBuilder.append("已完成案件归档");
78
+                        break;
79
+                    case  26:
80
+                        contentBuilder.append("已完成证据确认");
52 81
                         break;
53 82
                 }
54 83
 

+ 1
- 3
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml Näytä tiedosto

@@ -238,10 +238,8 @@
238 238
         p.payment_status ,
239 239
         CASE p.payment_status when 1 then '已支付' when 0 then '未支付'
240 240
         ELSE '无支付状态'
241
-        END paymentStatusName,d.dept_name as applicantName
241
+        END paymentStatusName
242 242
         from case_application c left join case_payment_record p on c.id  = p.case_id
243
-        LEFT JOIN case_affiliate ca ON ca.case_appli_id = c.id and ca.identity_type=1
244
-        LEFT JOIN sys_dept d ON ca.NAME = d.dept_id and ca.name=d.dept_id
245 243
         where c.case_status  = 3 and p.payment_status  = 1
246 244
             AND c.id = #{id}
247 245