hejinbo пре 2 година
родитељ
комит
1e362973a5

+ 16
- 30
ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseEvidenceController.java Прегледај датотеку

@@ -7,6 +7,7 @@ import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
7 7
 import com.ruoyi.wisdomarbitrate.domain.vo.CaseEvidenceVO;
8 8
 import com.ruoyi.wisdomarbitrate.service.ICaseEvidenceService;
9 9
 import org.springframework.beans.factory.annotation.Autowired;
10
+import org.springframework.validation.annotation.Validated;
10 11
 import org.springframework.web.bind.annotation.*;
11 12
 import org.springframework.web.multipart.MultipartFile;
12 13
 
@@ -26,31 +27,16 @@ public class CaseEvidenceController extends BaseController {
26 27
         this.caseEvidenceService = caseEvidenceService;
27 28
     }
28 29
 
29
-   /* *//**
30
-     * 查询被申请人案件列表
31
-     *
32
-     * @param identityNum 身份证号
33
-     * @return
34
-     *//*
35
-    @GetMapping("/respondent")
36
-    public TableDataInfo getCaseListByRespondent(@RequestParam String identityNum) {
37
-        startPage();
38
-        List<CaseEvidenceVO> list = caseEvidenceService.getCaseListByRespondent(identityNum);
39
-        if (list != null) {
40
-            return getDataTable(list);
41
-        }
42
-        return getDataTable(new ArrayList<>());
43
-    }*/
44
-
45 30
     /**
46
-     * 被申请人根据案件id查询案件详情
31
+     * 根据案件id查询案件详情
47 32
      *
48 33
      * @param id
49 34
      * @return
50 35
      */
51 36
     @GetMapping("/{id}")
52 37
     public AjaxResult getCaseDetailsById(@PathVariable Long id) {
53
-        return caseEvidenceService.getCaseDetailsById(id);
38
+        String username = this.getUsername();
39
+        return caseEvidenceService.getCaseDetailsById(id,username);
54 40
     }
55 41
 
56 42
     /**
@@ -63,19 +49,11 @@ public class CaseEvidenceController extends BaseController {
63 49
      */
64 50
     @PostMapping("/upload")
65 51
     public AjaxResult uploadEvidence(@RequestParam("file") MultipartFile file, Integer annexType, Long id) {
66
-        return caseEvidenceService.uploadEvidence(file, annexType, id);
52
+        String username = this.getUsername();
53
+        Long userId = this.getUserId();
54
+        return caseEvidenceService.uploadEvidence(file, annexType, id,username,userId);
67 55
     }
68 56
 
69
- /*   @GetMapping("/applicant")
70
-    public TableDataInfo getCaseListByApplicant(@RequestParam String identityNum) {
71
-        startPage();
72
-        List<CaseEvidenceVO> list = caseEvidenceService.getCaseListByApplicant(identityNum);
73
-        if (list != null) {
74
-            return getDataTable(list);
75
-        }
76
-        return getDataTable(new ArrayList<>());
77
-    }*/
78
-
79 57
     /**
80 58
      * 查询当前用户案件列表
81 59
      * @param identityNum
@@ -91,5 +69,13 @@ public class CaseEvidenceController extends BaseController {
91 69
         return getDataTable(new ArrayList<>());
92 70
     }
93 71
 
94
-
72
+    /**
73
+     * 证据确认
74
+     * @param caseApplication 案件对象
75
+     * @return 统一返回结果
76
+     */
77
+    @PutMapping("/confirm")
78
+    public AjaxResult evidenceConfirmation(@Validated @RequestBody CaseApplication caseApplication){
79
+        return caseEvidenceService.evidenceConfirmation(caseApplication);
80
+    }
95 81
 }

+ 3
- 3
ruoyi-common/src/main/java/com/ruoyi/common/utils/SmsUtils.java Прегледај датотеку

@@ -77,9 +77,9 @@ public class SmsUtils {
77 77
 
78 78
     public static void main(String[] args) {
79 79
         SendSmsRequest sendSmsRequest = new SendSmsRequest();
80
-        sendSmsRequest.setPhone("15029925289");
81
-        sendSmsRequest.setTemplateId("1927509");
82
-        sendSmsRequest.setTemplateParamSet(new String[]{"用户"});
80
+        sendSmsRequest.setPhone("18792613219");
81
+        sendSmsRequest.setTemplateId("1928003");
82
+        sendSmsRequest.setTemplateParamSet(new String[]{"xxx","仲裁","编号"});
83 83
         SmsUtils.sendSms(sendSmsRequest);
84 84
     }
85 85
 }

+ 8
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseAttach.java Прегледај датотеку

@@ -34,5 +34,13 @@ public class CaseAttach {
34 34
      * 备注
35 35
      */
36 36
     private String note;
37
+    /**
38
+     * 用户id
39
+     */
40
+    private Long userId;
41
+    /**
42
+     * 用户账户
43
+     */
44
+    private String userName;
37 45
 
38 46
 }

+ 5
- 5
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseEvidenceService.java Прегледај датотеку

@@ -2,20 +2,20 @@ package com.ruoyi.wisdomarbitrate.service;
2 2
 
3 3
 
4 4
 import com.ruoyi.common.core.domain.AjaxResult;
5
+import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
5 6
 import com.ruoyi.wisdomarbitrate.domain.vo.CaseEvidenceVO;
6 7
 import org.springframework.web.multipart.MultipartFile;
7 8
 
8 9
 import java.util.List;
9 10
 
10 11
 public interface ICaseEvidenceService {
11
-   // List<CaseEvidenceVO> getCaseListByRespondent(String identityNum);
12 12
 
13
-    AjaxResult getCaseDetailsById(Long id);
13
+    AjaxResult getCaseDetailsById(Long id,String userName);
14 14
 
15
-    AjaxResult uploadEvidence(MultipartFile file, Integer annexType, Long id);
16
-
17
-    //List<CaseEvidenceVO> getCaseListByApplicant(String identityNum);
15
+    AjaxResult uploadEvidence(MultipartFile file, Integer annexType, Long id,String userName,Long userId);
18 16
 
19 17
     List<CaseEvidenceVO> getCaseListAll(String identityNum);
20 18
 
19
+    AjaxResult evidenceConfirmation(CaseApplication caseApplication);
20
+
21 21
 }

+ 43
- 24
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseEvidenceServiceImpl.java Прегледај датотеку

@@ -1,6 +1,7 @@
1 1
 package com.ruoyi.wisdomarbitrate.service.impl;
2 2
 
3 3
 import com.ruoyi.common.config.RuoYiConfig;
4
+import com.ruoyi.common.constant.CaseApplicationConstants;
4 5
 import com.ruoyi.common.core.domain.AjaxResult;
5 6
 import com.ruoyi.common.utils.file.FileUploadUtils;
6 7
 import com.ruoyi.wisdomarbitrate.domain.CaseAffiliate;
@@ -19,6 +20,9 @@ import org.springframework.stereotype.Service;
19 20
 import org.springframework.web.multipart.MultipartFile;
20 21
 
21 22
 import java.io.IOException;
23
+import java.time.LocalDate;
24
+import java.time.LocalDateTime;
25
+import java.time.format.DateTimeFormatter;
22 26
 import java.util.Arrays;
23 27
 import java.util.List;
24 28
 
@@ -38,50 +42,55 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService {
38 42
     }*/
39 43
 
40 44
     @Override
41
-    public AjaxResult getCaseDetailsById(Long id) {
45
+    public AjaxResult getCaseDetailsById(Long id,String userName) {
42 46
         CaseApplication caseApplication = new CaseApplication();
43 47
         caseApplication.setId(id);
44 48
         CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication);
45
-        if (caseApplication1!=null){
49
+        if (caseApplication1 != null) {
46 50
             CaseDetailVO caseDetailVO = new CaseDetailVO();
47
-            BeanUtils.copyProperties(caseApplication1,caseDetailVO);
48
-            //查询案件证据材料
49
-           // List <CaseAttach> evidenceMaterialList = caseAttachMapper.queryAnnexPathByCaseId(id);
51
+            BeanUtils.copyProperties(caseApplication1, caseDetailVO);
50 52
             CaseAffiliate caseAffiliate = new CaseAffiliate();
51 53
             caseAffiliate.setCaseAppliId(id);
52 54
             List<CaseAffiliate> caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate);
53 55
             for (CaseAffiliate affiliate : caseAffiliates) {
54
-                if (affiliate.getIdentityType() == 1){  //申请人
56
+                String name = affiliate.getName();
57
+                //判断当前登录人和案件关联人姓名是否一致
58
+                if (name.equals(userName)) {  //一致,将案件关联人的身份类型赋给当前登录人
59
+                    caseDetailVO.setIdentityType(affiliate.getIdentityType());
60
+                }
61
+                if (affiliate.getIdentityType() == 1) {  //申请人
55 62
                     caseDetailVO.setApplicantName(affiliate.getName());
56
-                }else {
63
+                } else {
57 64
                     caseDetailVO.setRespondentName(affiliate.getName());
58 65
                 }
66
+                //根据案件id查询案件证据材料
67
+                List<CaseAttach> evidenceMaterialList = caseAttachMapper.queryAnnexPathByCaseId(id);
68
+                caseDetailVO.setEvidenceMaterialList(evidenceMaterialList);
59 69
             }
60 70
             return AjaxResult.success(caseDetailVO);
61 71
         }
62
-
63 72
         return null;
64 73
     }
65 74
 
66 75
     @Override
67
-    public AjaxResult uploadEvidence(MultipartFile file , Integer annexType, Long id) {
76
+    public AjaxResult uploadEvidence(MultipartFile file, Integer annexType, Long id, String userName, Long userId) {
77
+
68 78
         if (file.isEmpty()) {
69 79
             return AjaxResult.error("请选择要上传的文件");
70 80
         }
71 81
         try {
72
-            String filePath  = RuoYiConfig.getUploadPath();
73
-            // 获取文件原始名称
74
-            String fileName = file.getOriginalFilename();
75
-            String fileSavePath = filePath + "/" +  fileName;
76
-            // 上传并返回新文件名称
77
-            String fileNewName  = FileUploadUtils.upload(filePath,file);
82
+            String filePath = RuoYiConfig.getUploadPath();
83
+            // 上传
84
+            String fileName = FileUploadUtils.upload(filePath, file);
78 85
             CaseAttach caseAttach = CaseAttach.builder().caseAppliId(id)
79
-                    .annexName(fileNewName)
80
-                    .annexPath(fileSavePath)
86
+                    .annexName(fileName)
87
+                    .annexPath(filePath)
81 88
                     .annexType(annexType)
89
+                    .userId(userId)
90
+                    .userName(userName)
82 91
                     .build();
83 92
             int count = caseAttachMapper.save(caseAttach);
84
-            if (count>0){
93
+            if (count > 0) {
85 94
                 //修改案件状态
86 95
                 CaseApplication caseApplication = new CaseApplication();
87 96
                 caseApplication.setId(id);
@@ -104,21 +113,31 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService {
104 113
     @Override
105 114
     public List<CaseEvidenceVO> getCaseListAll(String identityNum) {
106 115
         List<Integer> caseStatusList = Arrays.asList(3, 4, 5, 9);
107
-        return getCaseEvidenceVOList(identityNum,caseStatusList,null);
116
+        return getCaseEvidenceVOList(identityNum, caseStatusList, null);
117
+    }
118
+
119
+    @Override
120
+    public AjaxResult evidenceConfirmation(CaseApplication caseApplication) {
121
+        caseApplication.setCaseStatus(CaseApplicationConstants.PENDING_APPOINT_ARBOTRATAR);
122
+        int i = caseApplicationMapper.submitCaseApplication(caseApplication);
123
+        if (i>0){
124
+            return AjaxResult.success("证据确认成功");
125
+        }
126
+        return AjaxResult.error("暂无需要确认的证据");
108 127
     }
109 128
 
110
-    private  List<CaseEvidenceVO> getCaseEvidenceVOList(String identityNum ,List<Integer> caseStatusList, Integer identityType){
111
-        List<CaseEvidenceVO> caseListByRespondent = caseEvidenceMapper.getCaseListByRespondent(identityNum, caseStatusList,identityType);
112
-        if (caseListByRespondent!= null && caseListByRespondent.size()>0){
129
+    private List<CaseEvidenceVO> getCaseEvidenceVOList(String identityNum, List<Integer> caseStatusList, Integer identityType) {
130
+        List<CaseEvidenceVO> caseListByRespondent = caseEvidenceMapper.getCaseListByRespondent(identityNum, caseStatusList, identityType);
131
+        if (caseListByRespondent != null && caseListByRespondent.size() > 0) {
113 132
             for (CaseEvidenceVO caseEvidenceVO : caseListByRespondent) {
114 133
                 //根据案件id查询姓名
115 134
                 CaseAffiliate caseAffiliate = new CaseAffiliate();
116 135
                 caseAffiliate.setCaseAppliId(caseEvidenceVO.getId());
117 136
                 List<CaseAffiliate> caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate);
118 137
                 for (CaseAffiliate affiliate : caseAffiliates) {
119
-                    if (affiliate.getIdentityType() == 1){  //申请人
138
+                    if (affiliate.getIdentityType() == 1) {  //申请人
120 139
                         caseEvidenceVO.setApplicantName(affiliate.getName());
121
-                    }else {
140
+                    } else {
122 141
                         caseEvidenceVO.setRespondentName(affiliate.getName());
123 142
                     }
124 143
                 }

+ 17
- 5
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CasePaymentServiceImpl.java Прегледај датотеку

@@ -98,16 +98,28 @@ public class CasePaymentServiceImpl implements ICasePaymentService {
98 98
             List<CaseAffiliate> caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate);            //获取案件关联人信息
99 99
             if (caseAffiliates != null && caseAffiliates.size() > 0) {
100 100
                 for (CaseAffiliate affiliate : caseAffiliates) {
101
-                    request.setPhone(affiliate.getContactTelphone());
102 101
                     //获取身份类型
103 102
                     int identityType = affiliate.getIdentityType();
103
+                    //查询案件详细信息
104
+                    CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication);
105
+                    if (caseApplication1 == null){
106
+                        return AjaxResult.error();
107
+                    }
108
+                    String caseName = "仲裁"; //这里案件名称表里未定义,暂时写死
109
+                    String caseNum = caseApplication1.getCaseNum();
104 110
                     if (identityType == 1) {    //申请人
105
-                        request.setTemplateId("申请人模板id"); //传入申请人模板id
111
+                        request.setPhone(affiliate.getContactTelphone());
112
+                        request.setTemplateId("1928003"); //传入申请人模板id
106 113
                         // 这个值,要看你的模板中是否预留了占位符,如果没有则不需要设置
107
-                        request.setTemplateParamSet(new String[]{"模板中的参数值,如果没有则为空"});
114
+                        // 模板id:1928003 普通短信 案件受理通知 尊敬的{1}用户,您的{2}案件{3}已成功受理。
115
+                        String name = affiliate.getName();
116
+                        request.setTemplateParamSet(new String[]{name,caseName,caseNum});
108 117
                     } else {       //被申请人
109
-                        request.setTemplateId("被申请人模板id");
110
-                        request.setTemplateParamSet(new String[]{"模板中的参数值,如果没有则为空"});
118
+                        request.setPhone(affiliate.getContactTelphone());
119
+                        request.setTemplateId("1928006");
120
+                        // 模板id1928006 普通短信 案件应诉通知 尊敬的{1}用户,您的{2}案件{3}已成功受理,请点击https://phmapp.xayunmei.com选择是否应诉。
121
+                        String name = affiliate.getName();
122
+                        request.setTemplateParamSet(new String[]{name,caseName,caseNum});
111 123
                     }
112 124
                 }
113 125
                 SmsUtils.sendSms(request);

+ 7
- 5
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAttachMapper.xml Прегледај датотеку

@@ -8,16 +8,18 @@
8 8
         <result property="caseAppliId"       column="case_appli_id"      />
9 9
         <result property="annexName"     column="annex_name"    />
10 10
         <result property="annexPath"     column="annex_path"    />
11
-        <result property="annexPath"     column="annex_type"    />
11
+        <result property="annexType"     column="annex_type"    />
12 12
         <result property="note"     column="note"    />
13
+        <result property="userId"     column="use_id"    />
14
+        <result property="userName"     column="use_account"    />
13 15
     </resultMap>
14 16
     <insert id="save">
15
-        INSERT INTO case_attach (case_appli_id, annex_name, annex_path , annex_type,note)
16
-        VALUES (#{caseAppliId}, #{annexName}, #{annexPath},#{annexType},#{note})
17
+        INSERT INTO case_attach (case_appli_id, annex_name, annex_path , annex_type,note,use_id,use_account)
18
+        VALUES (#{caseAppliId}, #{annexName}, #{annexPath},#{annexType},#{note},#{userId},#{userName})
17 19
     </insert>
18 20
     <select id="queryAnnexPathByCaseId" resultType="com.ruoyi.wisdomarbitrate.domain.CaseAttach" resultMap="CaseAttachResult">
19
-        select annex_id,case_appli_id,annex_name,annex_path,annex_type,note
21
+        select annex_id,case_appli_id,annex_name,annex_path,annex_type,note,use_id,use_account
20 22
         from case_attach
21
-        where
23
+        where case_appli_id =#{id}
22 24
     </select>
23 25
 </mapper>