ソースを参照

Merge branch 'dev' of http://git.xayunmei.com/SH-Arbitrate/Arbitrate-Backend into bgy

gy b 2 年 前
コミット
2b3a0d30c7

+ 4
- 1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java ファイルの表示

@@ -1,5 +1,6 @@
1 1
 package com.ruoyi.web.controller.wisdomarbitrate;
2 2
 
3
+import com.ruoyi.common.annotation.Anonymous;
3 4
 import com.ruoyi.common.annotation.Log;
4 5
 import com.ruoyi.common.core.controller.BaseController;
5 6
 import com.ruoyi.common.core.domain.AjaxResult;
@@ -18,6 +19,7 @@ import org.springframework.web.bind.annotation.*;
18 19
 import com.ruoyi.common.utils.poi.ExcelUtil;
19 20
 import org.springframework.web.multipart.MultipartFile;
20 21
 
22
+import javax.annotation.security.PermitAll;
21 23
 import javax.servlet.http.HttpServletResponse;
22 24
 import java.io.IOException;
23 25
 import java.util.List;
@@ -221,8 +223,9 @@ public class CaseApplicationController  extends BaseController {
221 223
 
222 224
 
223 225
     /**
224
-     * 确认缴费查询立案信息
226
+     * 发送房间号短信
225 227
      */
228
+    @Anonymous
226 229
     @PostMapping("/sendRoomNoMessage")
227 230
     public AjaxResult sendRoomNoMessage(@Validated @RequestBody SendRoomNoMessageVO messageVO)
228 231
     {

+ 42
- 2
ruoyi-common/src/main/java/com/ruoyi/common/utils/file/SaaSAPIFileUtils.java ファイルの表示

@@ -1,5 +1,6 @@
1 1
 package com.ruoyi.common.utils.file;
2 2
 
3
+import cn.hutool.json.JSONObject;
3 4
 import com.ruoyi.common.config.EsignDemoConfig;
4 5
 import com.ruoyi.common.constant.EsignHeaderConstant;
5 6
 import com.ruoyi.common.core.domain.entity.EsignHttpResponse;
@@ -16,8 +17,6 @@ public class SaaSAPIFileUtils {
16 17
     private static String eSignAppSecret=EsignDemoConfig.EsignAppSecret;
17 18
     /**
18 19
      * 获取文件上传地址
19
-     *
20
-     * @return
21 20
      */
22 21
     public static EsignHttpResponse getUploadUrl(String filePath) throws EsignDemoException {
23 22
         //自定义的文件封装类,传入文件地址可以获取文件的名称大小,文件流等数据
@@ -38,6 +37,47 @@ public class SaaSAPIFileUtils {
38 37
         //发起接口请求
39 38
         return EsignHttpHelper.doCommHttp(eSignHost, apiaddr, requestType, jsonParm, header, true);
40 39
     }
40
+    /**
41
+     * 上传文件流
42
+     */
43
+    public static EsignHttpResponse uploadFile(String uploadUrl,String filePath) throws EsignDemoException {
44
+        //根据文件地址获取文件contentMd5
45
+        EsignFileBean esignFileBean = new EsignFileBean(filePath);
46
+        //请求方法
47
+        EsignRequestType requestType= EsignRequestType.PUT;
48
+        return EsignHttpHelper.doUploadHttp(uploadUrl,requestType,esignFileBean.getFileBytes(),esignFileBean.getFileContentMD5(), EsignHeaderConstant.CONTENTTYPE_STREAM.VALUE(),true);
49
+    }
41 50
 
51
+    /**
52
+     * 获取文件上传状态
53
+     */
54
+    public static EsignHttpResponse getFileStatus(String fileId) throws EsignDemoException {
55
+        String apiaddr="/v3/files/"+fileId;
56
+
57
+        //请求参数body体,json格式。get或者delete请求时jsonString传空json:"{}"或者null
58
+        String jsonParm=null;
59
+        //请求方法
60
+        EsignRequestType requestType= EsignRequestType.GET;
61
+        //生成签名鉴权方式的的header
62
+        Map<String, String> header = EsignHttpHelper.signAndBuildSignAndJsonHeader(eSignAppId,eSignAppSecret,jsonParm,requestType.name(),apiaddr,true);
63
+        //发起接口请求
64
+        return EsignHttpHelper.doCommHttp(eSignHost, apiaddr,requestType , jsonParm, header,true);
65
+    }
42 66
 
67
+/*    public static void main(String[] args) throws EsignDemoException {
68
+        String filePath = "D:\\home\\ruoyi\\uploadPath\\upload\\2023\\10\\07\\6babb8e261454fffbacf6d9fd1589b9b.docx";
69
+        EsignHttpResponse uploadUrl = getUploadUrl(filePath);
70
+        String body = uploadUrl.getBody();
71
+        JSONObject jsonObject = new JSONObject(body);
72
+        JSONObject dataObj = jsonObject.getJSONObject("data");
73
+        String fileUploadUrl = dataObj.get("fileUploadUrl").toString();
74
+        System.out.println("这是fileUploadUrl:"+fileUploadUrl);
75
+        String fileId = dataObj.get("fileId").toString();
76
+        System.out.println("这是fileId:"+fileId);
77
+        EsignHttpResponse esignHttpResponse = uploadFile(fileUploadUrl, filePath);
78
+        System.out.println("这是上传文件流的结果:"+esignHttpResponse.getBody());
79
+        EsignHttpResponse fileStatus = getFileStatus(fileId);
80
+        System.out.println("这是获取文件上传状态的结果:"+fileStatus.getBody());
81
+        getFileStatus("95d0c307d91e4985bdb8874f6f84daa5");
82
+    }*/
43 83
 }

+ 2
- 1
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/SendRoomNoMessageVO.java ファイルの表示

@@ -3,6 +3,7 @@ package com.ruoyi.wisdomarbitrate.domain.vo;
3 3
 import lombok.Data;
4 4
 
5 5
 import javax.validation.constraints.NotEmpty;
6
+import javax.validation.constraints.NotNull;
6 7
 import java.io.Serializable;
7 8
 
8 9
 /**
@@ -13,7 +14,7 @@ import java.io.Serializable;
13 14
 @Data
14 15
 public class SendRoomNoMessageVO implements Serializable {
15 16
     private static final long serialVersionUID = 1L;
16
-    @NotEmpty(message = "案件id不能为空")
17
+    @NotNull(message = "案件id不能为空")
17 18
     private Long id;
18 19
     @NotEmpty(message = "房间号不能为空")
19 20
     private String roomNo;

+ 0
- 8
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/ArbitratorMapper.java ファイルの表示

@@ -8,12 +8,4 @@ import java.util.List;
8 8
 public interface ArbitratorMapper {
9 9
     List<Arbitrator> selectArbitratorList(Arbitrator arbitrator);
10 10
 
11
-    /**
12
-     * 根据案件id和身份类型查询案件关联人
13
-     * @param caseAppliId
14
-     * @param identityType
15
-     * @return
16
-     */
17
-    Arbitrator selectArbitratorById(@Param("caseAppliId") Long caseAppliId,@Param("identityType") Integer identityType);
18
-
19 11
 }

+ 2
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAffiliateMapper.java ファイルの表示

@@ -2,6 +2,7 @@ package com.ruoyi.wisdomarbitrate.mapper;
2 2
 
3 3
 import com.ruoyi.wisdomarbitrate.domain.CaseAffiliate;
4 4
 import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
5
+import org.apache.ibatis.annotations.Param;
5 6
 
6 7
 import java.util.List;
7 8
 
@@ -15,6 +16,7 @@ public interface CaseAffiliateMapper {
15 16
 
16 17
 
17 18
     List<CaseAffiliate>  selectCaseAffiliate(CaseAffiliate caseAffiliate);
19
+    CaseAffiliate  selectCaseAffiliateByIdentityType(@Param("caseAppliId") Long caseAppliId, @Param("identityType")int identityType);
18 20
 
19 21
     int updataCaseAffiliate(CaseAffiliate caseAffiliate);
20 22
 }

+ 5
- 5
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java ファイルの表示

@@ -461,8 +461,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
461 461
      */
462 462
     @Override
463 463
     public String sendRoomNoMessage(SendRoomNoMessageVO messageVO) {
464
-        Arbitrator arbitrator = arbitratorMapper.selectArbitratorById(messageVO.getId(), 2);
465
-        if(null==arbitrator){
464
+        CaseAffiliate caseAffiliate = caseAffiliateMapper.selectCaseAffiliateByIdentityType(messageVO.getId(), 2);
465
+        if(null==caseAffiliate){
466 466
             return "被申请人不存在";
467 467
         }
468 468
         CaseApplication caseApplication = new CaseApplication();
@@ -473,9 +473,9 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
473 473
         SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest();
474 474
         request.setTemplateId("1948332");
475 475
         // 1948332 普通短信 开庭审理房间号通知 尊敬的{1}用户,您的{2}仲裁案件,开庭审理房间号为{3},请知晓,如非本人操作,请忽略本短信。
476
-        request.setPhone(arbitrator.getTelephone());
477
-        request.setTemplateParamSet(new String[]{arbitrator.getArbitratorName(), caseApplicationselect.getCaseNum(), messageVO.getRoomNo()});
478
-
476
+        request.setPhone(caseAffiliate.getContactTelphone());
477
+        request.setTemplateParamSet(new String[]{caseAffiliate.getName(), caseApplicationselect.getCaseNum(), messageVO.getRoomNo()});
478
+        SmsUtils.sendSms(request);
479 479
 
480 480
         return "短信发送成功";
481 481
     }

+ 0
- 16
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/ArbitratorMapper.xml ファイルの表示

@@ -36,21 +36,5 @@
36 36
 
37 37
         </where>
38 38
     </select>
39
-    <select id="selectArbitratorById" resultMap="ArbitratorResult">
40
-        select a.id ,a.arbitrator_name ,a.title ,a.career ,a.professi_classifi ,
41
-        a.education ,a.area ,a.telephone ,a.current_case_num ,a.closed_case_num
42
-        from arbitrator a
43
-        <where>
44
-            <if test="caseAppliId != null and caseAppliId != ''">
45
-                AND ca.ase_appliId=#{caseAppliId}
46
-            </if>
47
-
48
-            <if test="identityType != null and identityType != ''">
49
-                a.identity_type=#{identityType}
50
-            </if>
51
-
52
-        </where>
53
-    </select>
54
-
55 39
 
56 40
 </mapper>

+ 14
- 0
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAffiliateMapper.xml ファイルの表示

@@ -33,6 +33,20 @@
33 33
             </if>
34 34
         </where>
35 35
     </select>
36
+    <select id="selectCaseAffiliateByIdentityType"  resultMap="CaseAffiliateResult">
37
+        select c.id ,c.case_appli_id ,c.identity_type ,c.name ,c.identity_num ,c.contact_telphone ,c.contact_address ,
38
+        c.work_address ,c.work_telphone ,c.name_agent, c.identity_num_agent ,c.contact_telphone_agent ,c.contact_address_agent,
39
+        c.track_num
40
+        from case_affiliate c
41
+        <where>
42
+            <if test="caseAppliId != null ">
43
+                AND c.case_appli_id = #{caseAppliId}
44
+            </if>
45
+            <if test="caseAppliId != null ">
46
+                AND c.identity_type = #{identityType}
47
+            </if>
48
+        </where>
49
+    </select>
36 50
 
37 51
 
38 52
     <insert id="batchCaseAffiliate">