Parcourir la source

截止9.14开发

hejinbo il y a 2 ans
Parent
révision
3028291cce

+ 49
- 12
ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseEvidenceController.java Voir le fichier

@@ -10,6 +10,7 @@ import org.springframework.beans.factory.annotation.Autowired;
10 10
 import org.springframework.web.bind.annotation.*;
11 11
 import org.springframework.web.multipart.MultipartFile;
12 12
 
13
+import java.util.ArrayList;
13 14
 import java.util.List;
14 15
 
15 16
 /**
@@ -19,40 +20,76 @@ import java.util.List;
19 20
 @RequestMapping("/evidence")
20 21
 public class CaseEvidenceController extends BaseController {
21 22
     private final ICaseEvidenceService caseEvidenceService;
23
+
22 24
     @Autowired
23 25
     public CaseEvidenceController(ICaseEvidenceService caseEvidenceService) {
24 26
         this.caseEvidenceService = caseEvidenceService;
25 27
     }
26
-    /**
28
+
29
+   /* *//**
27 30
      * 查询被申请人案件列表
31
+     *
28 32
      * @param identityNum 身份证号
29 33
      * @return
30
-     */
34
+     *//*
31 35
     @GetMapping("/respondent")
32
-    public TableDataInfo getCaseListByRespondent(@RequestParam String identityNum
33
-            ,Integer pageNum,Integer pageSize){
36
+    public TableDataInfo getCaseListByRespondent(@RequestParam String identityNum) {
34 37
         startPage();
35 38
         List<CaseEvidenceVO> list = caseEvidenceService.getCaseListByRespondent(identityNum);
36
-        return getDataTable(list);
37
-    }
39
+        if (list != null) {
40
+            return getDataTable(list);
41
+        }
42
+        return getDataTable(new ArrayList<>());
43
+    }*/
44
+
38 45
     /**
39
-     * 根据案件id查询案件详情
46
+     * 被申请人根据案件id查询案件详情
47
+     *
40 48
      * @param id
41 49
      * @return
42 50
      */
43 51
     @GetMapping("/{id}")
44
-    public AjaxResult getCaseDetailsById(@PathVariable Long id ){
52
+    public AjaxResult getCaseDetailsById(@PathVariable Long id) {
45 53
         return caseEvidenceService.getCaseDetailsById(id);
46 54
     }
55
+
47 56
     /**
48 57
      * 案件证据上传
49
-     * @param file 附件
58
+     *
59
+     * @param file      附件
50 60
      * @param annexType 附件类型,立案申请书(1)、证据材料(2)、仲裁文书(3)、案件视频(4)、身份证件(5)
51
-     * @param id 案件申请id
61
+     * @param id        案件申请id
52 62
      * @return
53 63
      */
54 64
     @PostMapping("/upload")
55
-    public AjaxResult uploadEvidence(@RequestParam("file") MultipartFile file , Integer annexType , Long id){
56
-        return caseEvidenceService.uploadEvidence(file,annexType,id);
65
+    public AjaxResult uploadEvidence(@RequestParam("file") MultipartFile file, Integer annexType, Long id) {
66
+        return caseEvidenceService.uploadEvidence(file, annexType, id);
57 67
     }
68
+
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
+    /**
80
+     * 查询当前用户案件列表
81
+     * @param identityNum
82
+     * @return
83
+     */
84
+    @GetMapping("/all")
85
+    public TableDataInfo getCaseListAll(@RequestParam String identityNum) {
86
+        startPage();
87
+        List<CaseEvidenceVO> list = caseEvidenceService.getCaseListAll(identityNum);
88
+        if (list != null) {
89
+            return getDataTable(list);
90
+        }
91
+        return getDataTable(new ArrayList<>());
92
+    }
93
+
94
+
58 95
 }

+ 2
- 2
ruoyi-admin/src/main/resources/application.yml Voir le fichier

@@ -9,7 +9,7 @@ ruoyi:
9 9
   # 实例演示开关
10 10
   demoEnabled: true
11 11
   # 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath)
12
-  profile: D:/ruoyi/uploadPath
12
+  profile: /home/ruoyi/uploadPath
13 13
   # 获取ip地址开关
14 14
   addressEnabled: false
15 15
   # 验证码类型 math 数字计算 char 字符验证
@@ -142,5 +142,5 @@ elegent:
142 142
       appId: 2021003141676135
143 143
     callback:
144 144
       domain: http://121.40.189.20:9000/
145
-      watch: true
145
+      watch: false
146 146
       cycle: 10

+ 28
- 9
ruoyi-common/src/main/java/com/ruoyi/common/utils/SmsUtils.java Voir le fichier

@@ -2,8 +2,14 @@ package com.ruoyi.common.utils;
2 2
 
3 3
 import com.tencentcloudapi.common.Credential;
4 4
 import com.tencentcloudapi.common.exception.TencentCloudSDKException;
5
+import com.tencentcloudapi.common.profile.ClientProfile;
6
+import com.tencentcloudapi.common.profile.HttpProfile;
7
+import com.tencentcloudapi.cvm.v20170312.CvmClient;
8
+import com.tencentcloudapi.cvm.v20170312.models.DescribeRegionsRequest;
9
+import com.tencentcloudapi.cvm.v20170312.models.DescribeRegionsResponse;
5 10
 import com.tencentcloudapi.sms.v20210111.SmsClient;
6 11
 import com.tencentcloudapi.sms.v20210111.models.SendSmsResponse;
12
+import com.tencentcloudapi.sms.v20210111.models.SendStatus;
7 13
 import lombok.Data;
8 14
 import lombok.extern.slf4j.Slf4j;
9 15
 import lombok.var;
@@ -12,21 +18,26 @@ import java.util.Objects;
12 18
 
13 19
 @Slf4j
14 20
 public class SmsUtils {
15
-    private static final String SDK_APP_ID = "应用id";
16
-    private static final String SECRET_ID = "API的SecretId";
17
-    private static final String SECRET_KEY = "API的SecretKey";
18
-    private static final String SIGN_NAME = "签名内容";
21
+    //应用id
22
+    private static final String SDK_APP_ID = "1400854852";
23
+    //API的SecretId
24
+    private static final String SECRET_ID = "AKIDeEf2A8uX1HSainvvnXAc3X9ZlhtyvkMp";
25
+    //API的SecretKey
26
+    private static final String SECRET_KEY = "QjphKo8zkHZigT8j9PVtFPJyfIvO3d6V";
27
+    //签名内容
28
+    private static final String SIGN_NAME = "西安云美电子科技有限公司";
29
+
19 30
     public static Boolean sendSms(SendSmsRequest request) {
20
-        Credential cred = new Credential(SECRET_ID,SECRET_KEY);
31
+        Credential cred = new Credential(SECRET_ID, SECRET_KEY );
32
+
21 33
         SmsClient client = new SmsClient(cred, "ap-guangzhou");
22 34
 
23 35
         final var req = new com.tencentcloudapi.sms.v20210111.models.SendSmsRequest();
24 36
         req.setPhoneNumberSet(new String[]{"+86" + request.getPhone()});
25
-        req.setSmsSdkAppId(SDK_APP_ID);
37
+        req.setSmsSdkAppId(SDK_APP_ID );
26 38
         req.setSignName(SIGN_NAME);
27 39
         req.setTemplateId(request.getTemplateId());
28 40
         req.setTemplateParamSet(request.getTemplateParamSet());
29
-
30 41
         SendSmsResponse res = null;
31 42
         try {
32 43
             res = client.SendSms(req);
@@ -34,14 +45,14 @@ public class SmsUtils {
34 45
             log.error("发送短信出错:", e);
35 46
             return Boolean.FALSE;
36 47
         }
37
-        log.error("发送短信结果:", SendSmsResponse.toJsonString(res));
48
+        SendStatus sendStatus = res.getSendStatusSet()[0];
49
+        log.info("发送短信结果:Code={}, Message={}", sendStatus.getCode(), sendStatus.getMessage());
38 50
 
39 51
         if (Objects.nonNull(res.getSendStatusSet()) && res.getSendStatusSet().length > 0 && "Ok".equals(res.getSendStatusSet()[0].getCode())){
40 52
             return Boolean.TRUE;
41 53
         }
42 54
         return Boolean.FALSE;
43 55
     }
44
-
45 56
     /**
46 57
      * 参数对象
47 58
      */
@@ -63,4 +74,12 @@ public class SmsUtils {
63 74
         private String[] templateParamSet;
64 75
 
65 76
     }
77
+
78
+    public static void main(String[] args) {
79
+        SendSmsRequest sendSmsRequest = new SendSmsRequest();
80
+        sendSmsRequest.setPhone("15029925289");
81
+        sendSmsRequest.setTemplateId("1927509");
82
+        sendSmsRequest.setTemplateParamSet(new String[]{"用户"});
83
+        SmsUtils.sendSms(sendSmsRequest);
84
+    }
66 85
 }

+ 11
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/CaseDetailVO.java Voir le fichier

@@ -1,5 +1,6 @@
1 1
 package com.ruoyi.wisdomarbitrate.domain.vo;
2 2
 
3
+import com.ruoyi.wisdomarbitrate.domain.CaseAttach;
3 4
 import lombok.AllArgsConstructor;
4 5
 import lombok.Builder;
5 6
 import lombok.Data;
@@ -7,6 +8,7 @@ import lombok.NoArgsConstructor;
7 8
 
8 9
 import java.math.BigDecimal;
9 10
 import java.util.Date;
11
+import java.util.List;
10 12
 
11 13
 @Data
12 14
 @Builder
@@ -53,4 +55,13 @@ public class CaseDetailVO {
53 55
      * 申请人主张违约金
54 56
      */
55 57
     private BigDecimal claimLiquidDamag;
58
+
59
+    /**
60
+     * 证据材料
61
+     */
62
+    private List<CaseAttach> evidenceMaterialList;
63
+    /**
64
+     * 当前登录人身份类型
65
+     */
66
+    private Integer identityType;
56 67
 }

+ 4
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAttachMapper.java Voir le fichier

@@ -2,6 +2,10 @@ package com.ruoyi.wisdomarbitrate.mapper;
2 2
 
3 3
 import com.ruoyi.wisdomarbitrate.domain.CaseAttach;
4 4
 
5
+import java.util.List;
6
+
5 7
 public interface CaseAttachMapper {
6 8
     int save(CaseAttach caseAttach);
9
+
10
+    List<CaseAttach> queryAnnexPathByCaseId(Long id);
7 11
 }

+ 1
- 1
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseEvidenceMapper.java Voir le fichier

@@ -10,6 +10,6 @@ import java.util.List;
10 10
 @Mapper
11 11
 public interface CaseEvidenceMapper {
12 12
     List<CaseEvidenceVO> getCaseListByRespondent(@Param(value = "identityNum" ) String identityNum
13
-            , @Param(value = "caseStatus" ) Integer caseStatus
13
+            , @Param(value = "caseStatusList") List<Integer> caseStatusList
14 14
             , @Param(value = "identityType" ) Integer identityType);
15 15
 }

+ 6
- 1
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseEvidenceService.java Voir le fichier

@@ -8,9 +8,14 @@ import org.springframework.web.multipart.MultipartFile;
8 8
 import java.util.List;
9 9
 
10 10
 public interface ICaseEvidenceService {
11
-    List<CaseEvidenceVO> getCaseListByRespondent(String identityNum);
11
+   // List<CaseEvidenceVO> getCaseListByRespondent(String identityNum);
12 12
 
13 13
     AjaxResult getCaseDetailsById(Long id);
14 14
 
15 15
     AjaxResult uploadEvidence(MultipartFile file, Integer annexType, Long id);
16
+
17
+    //List<CaseEvidenceVO> getCaseListByApplicant(String identityNum);
18
+
19
+    List<CaseEvidenceVO> getCaseListAll(String identityNum);
20
+
16 21
 }

+ 48
- 19
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseEvidenceServiceImpl.java Voir le fichier

@@ -19,6 +19,7 @@ import org.springframework.stereotype.Service;
19 19
 import org.springframework.web.multipart.MultipartFile;
20 20
 
21 21
 import java.io.IOException;
22
+import java.util.Arrays;
22 23
 import java.util.List;
23 24
 
24 25
 @Service
@@ -31,24 +32,10 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService {
31 32
     private CaseApplicationMapper caseApplicationMapper;
32 33
     @Autowired
33 34
     private CaseAttachMapper caseAttachMapper;
34
-    @Override
35
+ /*   @Override
35 36
     public List<CaseEvidenceVO> getCaseListByRespondent(String identityNum) {
36
-        int caseStatus = 3;
37
-        int identityType = 2;
38
-        List<CaseEvidenceVO> caseListByRespondent = caseEvidenceMapper.getCaseListByRespondent(identityNum, caseStatus,identityType);
39
-        if (caseListByRespondent!= null && caseListByRespondent.size()>0){
40
-            for (CaseEvidenceVO caseEvidenceVO : caseListByRespondent) {
41
-                //根据案件id查询申请人姓名
42
-                CaseAffiliate caseAffiliate = new CaseAffiliate();
43
-                caseAffiliate.setCaseAppliId(caseEvidenceVO.getId());
44
-                caseAffiliate.setIdentityType(1);
45
-                String name = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate).get(0).getName();
46
-                caseEvidenceVO.setApplicantName(name);
47
-            }
48
-            return caseListByRespondent;
49
-        }
50
-        return null;
51
-    }
37
+        return getCaseEvidenceVOList(identityNum,3, 2);
38
+    }*/
52 39
 
53 40
     @Override
54 41
     public AjaxResult getCaseDetailsById(Long id) {
@@ -58,6 +45,8 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService {
58 45
         if (caseApplication1!=null){
59 46
             CaseDetailVO caseDetailVO = new CaseDetailVO();
60 47
             BeanUtils.copyProperties(caseApplication1,caseDetailVO);
48
+            //查询案件证据材料
49
+           // List <CaseAttach> evidenceMaterialList = caseAttachMapper.queryAnnexPathByCaseId(id);
61 50
             CaseAffiliate caseAffiliate = new CaseAffiliate();
62 51
             caseAffiliate.setCaseAppliId(id);
63 52
             List<CaseAffiliate> caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate);
@@ -81,15 +70,23 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService {
81 70
         }
82 71
         try {
83 72
             String filePath  = RuoYiConfig.getUploadPath();
73
+            // 获取文件原始名称
74
+            String fileName = file.getOriginalFilename();
75
+            String fileSavePath = filePath + "/" +  fileName;
84 76
             // 上传并返回新文件名称
85
-            String fileNewName  = FileUploadUtils.upload(filePath, file);
77
+            String fileNewName  = FileUploadUtils.upload(filePath,file);
86 78
             CaseAttach caseAttach = CaseAttach.builder().caseAppliId(id)
87 79
                     .annexName(fileNewName)
88
-                    .annexPath(filePath)
80
+                    .annexPath(fileSavePath)
89 81
                     .annexType(annexType)
90 82
                     .build();
91 83
             int count = caseAttachMapper.save(caseAttach);
92 84
             if (count>0){
85
+                //修改案件状态
86
+                CaseApplication caseApplication = new CaseApplication();
87
+                caseApplication.setId(id);
88
+                caseApplication.setCaseStatus(4);
89
+                caseApplicationMapper.submitCaseApplication(caseApplication);
93 90
                 return AjaxResult.success("上传成功");
94 91
             }
95 92
         } catch (IOException e) {
@@ -98,4 +95,36 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService {
98 95
 
99 96
         return AjaxResult.error("上传失败");
100 97
     }
98
+
99
+/*    @Override
100
+    public List<CaseEvidenceVO> getCaseListByApplicant(String identityNum) {
101
+        return getCaseEvidenceVOList(identityNum,4, 1);
102
+    }*/
103
+
104
+    @Override
105
+    public List<CaseEvidenceVO> getCaseListAll(String identityNum) {
106
+        List<Integer> caseStatusList = Arrays.asList(3, 4, 5, 9);
107
+        return getCaseEvidenceVOList(identityNum,caseStatusList,null);
108
+    }
109
+
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){
113
+            for (CaseEvidenceVO caseEvidenceVO : caseListByRespondent) {
114
+                //根据案件id查询姓名
115
+                CaseAffiliate caseAffiliate = new CaseAffiliate();
116
+                caseAffiliate.setCaseAppliId(caseEvidenceVO.getId());
117
+                List<CaseAffiliate> caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate);
118
+                for (CaseAffiliate affiliate : caseAffiliates) {
119
+                    if (affiliate.getIdentityType() == 1){  //申请人
120
+                        caseEvidenceVO.setApplicantName(affiliate.getName());
121
+                    }else {
122
+                        caseEvidenceVO.setRespondentName(affiliate.getName());
123
+                    }
124
+                }
125
+            }
126
+            return caseListByRespondent;
127
+        }
128
+        return null;
129
+    }
101 130
 }

+ 1
- 1
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CasePaymentServiceImpl.java Voir le fichier

@@ -110,7 +110,7 @@ public class CasePaymentServiceImpl implements ICasePaymentService {
110 110
                         request.setTemplateParamSet(new String[]{"模板中的参数值,如果没有则为空"});
111 111
                     }
112 112
                 }
113
-                //SmsUtils.sendSms(request);
113
+                SmsUtils.sendSms(request);
114 114
                 return AjaxResult.success();
115 115
             }
116 116
         }

+ 13
- 0
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAttachMapper.xml Voir le fichier

@@ -3,8 +3,21 @@
3 3
         PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
4 4
         "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
5 5
 <mapper namespace="com.ruoyi.wisdomarbitrate.mapper.CaseAttachMapper">
6
+    <resultMap type="CaseAttach" id="CaseAttachResult">
7
+        <id     property="annexId"       column="annex_id"      />
8
+        <result property="caseAppliId"       column="case_appli_id"      />
9
+        <result property="annexName"     column="annex_name"    />
10
+        <result property="annexPath"     column="annex_path"    />
11
+        <result property="annexPath"     column="annex_type"    />
12
+        <result property="note"     column="note"    />
13
+    </resultMap>
6 14
     <insert id="save">
7 15
         INSERT INTO case_attach (case_appli_id, annex_name, annex_path , annex_type,note)
8 16
         VALUES (#{caseAppliId}, #{annexName}, #{annexPath},#{annexType},#{note})
9 17
     </insert>
18
+    <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
20
+        from case_attach
21
+        where
22
+    </select>
10 23
 </mapper>

+ 20
- 4
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseEvidenceMapper.xml Voir le fichier

@@ -3,10 +3,26 @@
3 3
         PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
4 4
         "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
5 5
 <mapper namespace="com.ruoyi.wisdomarbitrate.mapper.CaseEvidenceMapper">
6
-    <select id="getCaseListByRespondent" resultType="CaseEvidenceVO">
7
-        select c.id, c.case_num as caseNum ,c.case_status as caseStatus,d.name as respondentName
6
+    <resultMap type="CaseEvidenceVO" id="CaseEvidenceVOResult">
7
+        <id     property="id"       column="id"      />
8
+        <result property="caseNum"       column="case_num"      />
9
+        <result property="caseStatus"     column="case_status"    />
10
+    </resultMap>
11
+    <select id="getCaseListByRespondent" resultType="CaseEvidenceVO" resultMap="CaseEvidenceVOResult">
12
+        select c.id, c.case_num,c.case_status
8 13
         from case_application as c  ,case_affiliate as d
9
-        where c.id = d.case_appli_id and d.identity_num = #{identityNum} and identity_type = #{identityType}
10
-          and c.case_status = #{caseStatus}
14
+        where c.id = d.case_appli_id
15
+        <if test="identityNum != null and identityNum != ''">
16
+            and d.identity_num = #{identityNum}
17
+        </if>
18
+        <if test="identityType != null ">
19
+            and identity_type = #{identityType}
20
+        </if>
21
+        <if test="caseStatusList != null and caseStatusList.size() > 0">
22
+            and c.case_status in
23
+            <foreach item="caseStatus" collection="caseStatusList" open="(" separator="," close=")">
24
+                #{caseStatus}
25
+            </foreach>
26
+        </if>
11 27
     </select>
12 28
 </mapper>