18792927508 преди 2 години
родител
ревизия
7bcec78774
променени са 31 файла, в които са добавени 1622 реда и са изтрити 41 реда
  1. 3
    3
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CommonController.java
  2. 68
    1
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/mscase/MsCaseApplicationController.java
  3. 95
    0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/mscase/MsCaseApplicationPayController.java
  4. 66
    0
      ruoyi-common/src/main/java/com/ruoyi/common/enums/AnnexTypeEnum.java
  5. 65
    0
      ruoyi-common/src/main/java/com/ruoyi/common/enums/PaymentStatusEnum.java
  6. 61
    0
      ruoyi-common/src/main/java/com/ruoyi/common/utils/BookMarkUtil.java
  7. 31
    5
      ruoyi-common/src/main/java/com/ruoyi/common/utils/SmsUtils.java
  8. 9
    0
      ruoyi-system/src/main/java/com/ruoyi/system/mapper/flow/MsCaseFlowMapper.java
  9. 34
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/dto/mscase/CaseConfirmPayDTO.java
  10. 47
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/dto/mscase/CasePayDTO.java
  11. 44
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/dto/mscase/CasePaymentRecord.java
  12. 8
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/dto/sendrecord/SmsSendRecord.java
  13. 11
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/entity/mscase/MsCaseApplication.java
  14. 63
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/entity/mscase/MsCasePaymentRecord.java
  15. 34
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/mscase/MediatorVO.java
  16. 9
    1
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/mscase/MsCaseApplicationReq.java
  17. 54
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/mscase/PaymentDetailVO.java
  18. 8
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/mscase/MsCaseApplicationMapper.java
  19. 4
    1
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/mscase/MsCaseAttachMapper.java
  20. 8
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/mscase/MsCasePaymentRecordMapper.java
  21. 2
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/template/TemplateManageMapper.java
  22. 6
    14
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/dept/impl/DeptIdentifyServiceImpl.java
  23. 62
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/MsCaseApplicationService.java
  24. 36
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/MsCasePaymentService.java
  25. 3
    4
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/CallBackHandleServiceImpl.java
  26. 427
    7
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/MsCaseApplicationServiceImpl.java
  27. 332
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/MsCasePaymentServiceImpl.java
  28. 9
    2
      ruoyi-system/src/main/resources/mapper/wisdomarbitrate/mscase/MsCaseAttachMapper.xml
  29. 17
    0
      ruoyi-system/src/main/resources/mapper/wisdomarbitrate/mscase/MsCasePaymentRecordMapper.xml
  30. 3
    3
      ruoyi-system/src/main/resources/mapper/wisdomarbitrate/sendrecord/SmsRecordMapper.xml
  31. 3
    0
      ruoyi-system/src/main/resources/mapper/wisdomarbitrate/template/TemplateManageMapper.xml

+ 3
- 3
ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CommonController.java Целия файл

@@ -106,13 +106,13 @@ public class CommonController
106 106
      * 保存到案件附件表
107 107
      * @param
108 108
      * @param annexType
109
-     * @param fileName
109
+     * @param path
110 110
      * @param originalFilename
111 111
      */
112
-    private Long saveCaseAttach(Integer annexType, String fileName, String originalFilename) {
112
+    private Long saveCaseAttach(Integer annexType, String path, String originalFilename) {
113 113
         MsCaseAttach caseAttach = MsCaseAttach.builder()
114 114
                 .annexName(originalFilename)
115
-                .annexPath(fileName)
115
+                .annexPath(path)
116 116
                 .annexType(annexType)
117 117
                 .useId(SecurityUtils.getUserId())
118 118
                 .useAccount(SecurityUtils.getUsername())

+ 68
- 1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/mscase/MsCaseApplicationController.java Целия файл

@@ -1,8 +1,11 @@
1 1
 package com.ruoyi.web.controller.wisdomarbitrate.mscase;
2 2
 
3
+
4
+import cn.hutool.core.util.StrUtil;
3 5
 import com.ruoyi.common.core.controller.BaseController;
4 6
 import com.ruoyi.common.core.domain.AjaxResult;
5 7
 import com.ruoyi.common.core.page.TableDataInfo;
8
+import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseApplication;
6 9
 import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseApplicationReq;
7 10
 import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseApplicationVO;
8 11
 import com.ruoyi.wisdomarbitrate.service.mscase.MsCaseApplicationService;
@@ -80,8 +83,72 @@ public class MsCaseApplicationController extends BaseController {
80 83
         return caseApplicationService.uploadCaseZipFile(file,templateId);
81 84
     }
82 85
 
86
+    /**
87
+     * 生成调解申请书
88
+     * @param
89
+     * @return
90
+     * @throws IOException
91
+     */
92
+    @PostMapping("/generateApplication")
93
+    public AjaxResult generateApplication(@RequestBody MsCaseApplicationReq req)   {
94
+        if (req.getTemplateId() == null||req.getCaseFlowId() == null || (req.getId() == null && StrUtil.isEmpty(req.getBatchNumber()))) {
95
+            return error("参数校验失败");
96
+        }
83 97
 
98
+        return caseApplicationService.generateApplication(req);
99
+    }
84 100
 
85
-
101
+    /**
102
+     * 证据上传
103
+     * @param file
104
+     * @param annexType
105
+     * @param id
106
+     * @return
107
+     */
108
+    @PostMapping("/batchUpload")
109
+    public AjaxResult batchUpload(@RequestParam("file") MultipartFile[] file, @RequestParam("annexType")Integer annexType,  @RequestParam("id")Long id) {
110
+        if(file==null){
111
+            return error("请选择要上传的文件");
112
+        }
113
+        return caseApplicationService.batchUpload(file, annexType, id);
114
+    }
115
+    /**
116
+     * 案件受理
117
+     * @param req
118
+     * @return
119
+     */
120
+    @PostMapping("/accept")
121
+    public AjaxResult accept(@RequestBody MsCaseApplication req ) {
122
+        if (StrUtil.isEmpty(req.getMediationMethod())
123
+                || req.getPaperFlag() == null
124
+                || req.getCaseFlowId() == null
125
+                || req.getArbitrateConfirm() == null
126
+                || (req.getId() == null && StrUtil.isEmpty(req.getBatchNumber()))) {
127
+            return error("参数校验失败");
128
+        }
129
+        return caseApplicationService.accept(req);
130
+    }
131
+    /**
132
+     * 案件提交
133
+     * @param req
134
+     * @return
135
+     */
136
+    @PostMapping("/submit")
137
+    public AjaxResult submit(@RequestBody MsCaseApplication req ) {
138
+        if (req.getCaseFlowId() == null
139
+                || (req.getId() == null && StrUtil.isEmpty(req.getBatchNumber()))) {
140
+            return error("参数校验失败");
141
+        }
142
+        return caseApplicationService.submit(req);
143
+    }
144
+    /**
145
+     * 查询调解员
146
+     * @param
147
+     * @return
148
+     */
149
+    @GetMapping("/listMediator")
150
+    public AjaxResult listMediator( ) {
151
+        return caseApplicationService.listMediator();
152
+    }
86 153
 
87 154
 }

+ 95
- 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/mscase/MsCaseApplicationPayController.java Целия файл

@@ -0,0 +1,95 @@
1
+package com.ruoyi.web.controller.wisdomarbitrate.mscase;
2
+
3
+import cn.hutool.core.collection.CollectionUtil;
4
+import cn.hutool.core.util.StrUtil;
5
+import com.ruoyi.common.core.controller.BaseController;
6
+import com.ruoyi.common.core.domain.AjaxResult;
7
+import com.ruoyi.wisdomarbitrate.domain.dto.mscase.CaseConfirmPayDTO;
8
+import com.ruoyi.wisdomarbitrate.domain.dto.mscase.CasePayDTO;
9
+import com.ruoyi.wisdomarbitrate.service.mscase.MsCasePaymentService;
10
+import org.springframework.validation.annotation.Validated;
11
+import org.springframework.web.bind.annotation.*;
12
+
13
+import javax.annotation.Resource;
14
+
15
+
16
+/**
17
+ * 案件缴费控制层
18
+ * @Author wangqiong
19
+ * @Date 2024/01/8
20
+ * @Version V1.0
21
+ */
22
+@RestController
23
+@RequestMapping("/pay")
24
+public class MsCaseApplicationPayController extends BaseController {
25
+
26
+    @Resource
27
+    private MsCasePaymentService casePaymentService;
28
+    /**
29
+     * 根据案件id或者批次号查询申请人及应缴费用
30
+     * @param dto 缴费传入参数
31
+     * @return 统一响应结果
32
+     */
33
+    @PostMapping("/selectTotalFee")
34
+    public AjaxResult selectTotalFee(@RequestBody CasePayDTO dto) {
35
+        if ((dto.getCaseId() == null && StrUtil.isEmpty(dto.getBatchNumber()))
36
+        ) {
37
+            return error("参数校验失败");
38
+        }
39
+        return casePaymentService.selectTotalFee(dto);
40
+    }
41
+    /**
42
+     * 根据案件id查询缴费单
43
+     * @param id
44
+     * @return 统一响应结果
45
+     */
46
+    @GetMapping("/selectPaymentDetail")
47
+    public AjaxResult selectPaymentDetail(@RequestParam(value = "id",required = true) Long id) {
48
+        return AjaxResult.success(casePaymentService.selectPaymentDetail(id));
49
+    }
50
+
51
+
52
+    /**
53
+     * 案件缴费,线上缴费,支持批量(batchNumber不为空,则为批量缴费)
54
+     * @param dto 缴费传入参数
55
+     * @return 统一响应结果
56
+     */
57
+    @PostMapping("/casePay")
58
+    public AjaxResult casePay(@Validated @RequestBody CasePayDTO dto) {
59
+        if ((dto.getCaseId() == null && StrUtil.isEmpty(dto.getBatchNumber()))
60
+                || StrUtil.isEmpty(dto.getPlatform()) ||StrUtil.isEmpty(dto.getTradeType())
61
+                ) {
62
+            return error("参数校验失败");
63
+        }
64
+        return casePaymentService.casePay(dto);
65
+    }
66
+
67
+    /**
68
+     * 确认缴费,支持批量(batchNumber不为空,则为批量)
69
+     * @param dto 缴费传入参数
70
+     * @return 统一响应结果
71
+     */
72
+    @PostMapping("/confirmPayment")
73
+    public AjaxResult confirmPayment(@RequestBody CaseConfirmPayDTO dto) {
74
+        if ((dto.getCaseId() == null && StrUtil.isEmpty(dto.getBatchNumber()))
75
+                || StrUtil.isEmpty(dto.getPayType()) || CollectionUtil.isEmpty(dto.getPayOrderList())
76
+                || dto.getCaseFlowId() == null) {
77
+            return error("参数校验失败");
78
+        }
79
+        return casePaymentService.confirmPayment(dto);
80
+    }
81
+    /**
82
+     * 确认已缴费,支持批量(batchNumber不为空,则为批量)
83
+     * @param dto 缴费传入参数
84
+     * @return 统一响应结果
85
+     */
86
+    @PostMapping("/confirmPaid")
87
+    public AjaxResult confirmPaid(@RequestBody CaseConfirmPayDTO dto) {
88
+        if ((dto.getCaseId() == null && StrUtil.isEmpty(dto.getBatchNumber()))
89
+                || dto.getCaseFlowId() == null) {
90
+            return error("参数校验失败");
91
+        }
92
+        return casePaymentService.confirmPaid(dto);
93
+    }
94
+
95
+}

+ 66
- 0
ruoyi-common/src/main/java/com/ruoyi/common/enums/AnnexTypeEnum.java Целия файл

@@ -0,0 +1,66 @@
1
+package com.ruoyi.common.enums;
2
+
3
+import com.ruoyi.common.interfaces.EnumsInterface;
4
+
5
+/**
6
+ * @Classname AnnexTypeEnum
7
+ * @Description 附件类型枚举
8
+ * @Version 1.0.0
9
+ * @Date 2024/1/12 17:50
10
+ * @Created wangqiong
11
+ */
12
+public enum AnnexTypeEnum implements EnumsInterface {
13
+    APPLICATION(1, "仲裁申请书"),
14
+    APPLICATION_EVIDENCE(2, "申请人证据"),
15
+    MEDIATION_APPLICATION(3, "调解申请书"),
16
+    PAYMENT_RECEIPT(4, "缴费单"),
17
+
18
+    ;
19
+
20
+    private final Integer code;
21
+    private final String text;
22
+
23
+    AnnexTypeEnum(Integer code, String text)
24
+    {
25
+        this.code = code;
26
+        this.text = text;
27
+    }
28
+
29
+    public Integer getCode()
30
+    {
31
+        return code;
32
+    }
33
+
34
+    public String getText()
35
+    {
36
+        return text;
37
+    }
38
+
39
+    /**
40
+     * 根据code获取text
41
+     * @param codeNo
42
+     * @return
43
+     */
44
+    public static String getTextByCode(Integer codeNo){
45
+        for (AnnexTypeEnum value : AnnexTypeEnum.values()) {
46
+            if (value.getCode().equals(codeNo)){
47
+                return value.getText();
48
+            }
49
+        }
50
+        return codeNo.toString();
51
+    }
52
+
53
+    /**
54
+     * 根据text获取code
55
+     * @param textStr
56
+     * @return
57
+     */
58
+    public static String getCodeByText(String textStr){
59
+        for (AnnexTypeEnum value : AnnexTypeEnum.values()) {
60
+            if (value.getText().equals(textStr)){
61
+                return value.getText();
62
+            }
63
+        }
64
+        return textStr;
65
+    }
66
+}

+ 65
- 0
ruoyi-common/src/main/java/com/ruoyi/common/enums/PaymentStatusEnum.java Целия файл

@@ -0,0 +1,65 @@
1
+package com.ruoyi.common.enums;
2
+
3
+import com.ruoyi.common.interfaces.EnumsInterface;
4
+
5
+/**
6
+ * @Classname PaymentStatusEnum
7
+ * @Description 支付状态枚举
8
+ * @Version 1.0.0
9
+ * @Date 2024/1/12 18:07
10
+ * @Created wangqiong
11
+ */
12
+public enum PaymentStatusEnum implements EnumsInterface {
13
+    UNPAID(0, "未支付"),
14
+    PAID(1, "已支付"),
15
+
16
+
17
+    ;
18
+
19
+    private final Integer code;
20
+    private final String text;
21
+
22
+    PaymentStatusEnum(Integer code, String text)
23
+    {
24
+        this.code = code;
25
+        this.text = text;
26
+    }
27
+
28
+    public Integer getCode()
29
+    {
30
+        return code;
31
+    }
32
+
33
+    public String getText()
34
+    {
35
+        return text;
36
+    }
37
+
38
+    /**
39
+     * 根据code获取text
40
+     * @param codeNo
41
+     * @return
42
+     */
43
+    public static String getTextByCode(Integer codeNo){
44
+        for (PaymentStatusEnum value : PaymentStatusEnum.values()) {
45
+            if (value.getCode().equals(codeNo)){
46
+                return value.getText();
47
+            }
48
+        }
49
+        return codeNo.toString();
50
+    }
51
+
52
+    /**
53
+     * 根据text获取code
54
+     * @param textStr
55
+     * @return
56
+     */
57
+    public static String getCodeByText(String textStr){
58
+        for (PaymentStatusEnum value : PaymentStatusEnum.values()) {
59
+            if (value.getText().equals(textStr)){
60
+                return value.getText();
61
+            }
62
+        }
63
+        return textStr;
64
+    }
65
+}

+ 61
- 0
ruoyi-common/src/main/java/com/ruoyi/common/utils/BookMarkUtil.java Целия файл

@@ -0,0 +1,61 @@
1
+package com.ruoyi.common.utils;
2
+
3
+import cn.hutool.core.collection.CollectionUtil;
4
+import cn.hutool.core.util.StrUtil;
5
+import org.apache.poi.xwpf.usermodel.XWPFDocument;
6
+import org.apache.poi.xwpf.usermodel.XWPFParagraph;
7
+
8
+import java.io.FileInputStream;
9
+import java.io.IOException;
10
+import java.util.ArrayList;
11
+import java.util.List;
12
+import java.util.regex.Matcher;
13
+import java.util.regex.Pattern;
14
+
15
+/**
16
+ * @Classname BookMarkUtil
17
+ * @Description 获取模板中的占位符{{xxx}}
18
+ * @Version 1.0.0
19
+ * @Date 2024/1/11 18:07
20
+ * @Created wangqiong
21
+ */
22
+public class BookMarkUtil {
23
+    /**
24
+     * 根据裁决书模板获取所有的占位符,占位符必须是{{name}}格式
25
+     *
26
+     * @param path
27
+     * @return
28
+     */
29
+    public static List<String> getBookmarkByDocx(String path) {
30
+        XWPFDocument xwpfDocument = null;
31
+        try {
32
+            FileInputStream fileInputStream = new FileInputStream(path);
33
+            xwpfDocument = new XWPFDocument(fileInputStream);
34
+        } catch (IOException e) {
35
+            e.printStackTrace();
36
+        }
37
+        if (xwpfDocument == null) {
38
+            return new ArrayList<>();
39
+        }
40
+        List<XWPFParagraph> paragraphs = xwpfDocument.getParagraphs();
41
+        if (CollectionUtil.isEmpty(xwpfDocument.getParagraphs())) {
42
+            return new ArrayList<>();
43
+        }
44
+        String regex = "\\{\\{.*?\\}\\}"; // 定义占位符的正则表达式
45
+        Pattern pattern = Pattern.compile(regex);
46
+        List<String> bookmarkList = new ArrayList<>();
47
+        for (XWPFParagraph paragraph : paragraphs) {
48
+            String text = paragraph.getText();
49
+            if (StrUtil.isNotEmpty(text)) {
50
+                Matcher matcher = pattern.matcher(text);
51
+
52
+                while (matcher.find()) {
53
+                    String placeholder = matcher.group();
54
+                    String keyword = placeholder.substring(2, placeholder.length() - 2);
55
+                    bookmarkList.add(keyword);
56
+                }
57
+            }
58
+        }
59
+        return bookmarkList;
60
+    }
61
+}

+ 31
- 5
ruoyi-common/src/main/java/com/ruoyi/common/utils/SmsUtils.java Целия файл

@@ -2,15 +2,12 @@ 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;
10 5
 import com.tencentcloudapi.sms.v20210111.SmsClient;
11 6
 import com.tencentcloudapi.sms.v20210111.models.SendSmsResponse;
12 7
 import com.tencentcloudapi.sms.v20210111.models.SendStatus;
8
+import lombok.AllArgsConstructor;
13 9
 import lombok.Data;
10
+import lombok.NoArgsConstructor;
14 11
 import lombok.extern.slf4j.Slf4j;
15 12
 import lombok.var;
16 13
 
@@ -53,10 +50,39 @@ public class SmsUtils {
53 50
         }
54 51
         return Boolean.FALSE;
55 52
     }
53
+    public static Boolean sendSms(Long caseId,String templateId,String phone,String[] templateParamSet) {
54
+        SendSmsRequest request = new SendSmsRequest(phone,templateId,templateParamSet,caseId);
55
+        Credential cred = new Credential(SECRET_ID, SECRET_KEY );
56
+
57
+        SmsClient client = new SmsClient(cred, "ap-guangzhou");
58
+
59
+        final var req = new com.tencentcloudapi.sms.v20210111.models.SendSmsRequest();
60
+        req.setPhoneNumberSet(new String[]{"+86" + request.getPhone()});
61
+        req.setSmsSdkAppId(SDK_APP_ID );
62
+        req.setSignName(SIGN_NAME);
63
+        req.setTemplateId(request.getTemplateId());
64
+        req.setTemplateParamSet(request.getTemplateParamSet());
65
+        SendSmsResponse res = null;
66
+        try {
67
+            res = client.SendSms(req);
68
+        } catch (TencentCloudSDKException e) {
69
+            log.error("发送短信出错:", e);
70
+            return Boolean.FALSE;
71
+        }
72
+        SendStatus sendStatus = res.getSendStatusSet()[0];
73
+        log.info("发送短信结果:Code={}, Message={}", sendStatus.getCode(), sendStatus.getMessage());
74
+
75
+        if (Objects.nonNull(res.getSendStatusSet()) && res.getSendStatusSet().length > 0 && "Ok".equals(res.getSendStatusSet()[0].getCode())){
76
+            return Boolean.TRUE;
77
+        }
78
+        return Boolean.FALSE;
79
+    }
56 80
     /**
57 81
      * 参数对象
58 82
      */
59 83
     @Data
84
+    @NoArgsConstructor
85
+    @AllArgsConstructor
60 86
     public static class SendSmsRequest {
61 87
         /**
62 88
          * 电话

+ 9
- 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/flow/MsCaseFlowMapper.java Целия файл

@@ -1,7 +1,16 @@
1 1
 package com.ruoyi.system.mapper.flow;
2 2
 
3 3
 import com.ruoyi.system.domain.entity.flow.MsCaseFlow;
4
+import org.apache.ibatis.annotations.Select;
4 5
 import tk.mybatis.mapper.common.Mapper;
5 6
 
6 7
 public interface MsCaseFlowMapper extends Mapper<MsCaseFlow> {
8
+    /**
9
+     * 根据流程查找下一个流程
10
+     *
11
+     * @param caseFlowId 流程id
12
+     * @return
13
+     */
14
+    @Select("select f1.id,f1.node_id nodeId,f1.node_name nodeName,f1.case_status_name caseStatusName,f1.back_flow_id backFlowId,f1.sort from ms_case_flow f1 join ms_case_flow f2 on  f2.id=#{caseFlowId}  and f1.sort=f2.sort+1 ")
15
+    MsCaseFlow nextFlow(Integer caseFlowId);
7 16
 }

+ 34
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/dto/mscase/CaseConfirmPayDTO.java Целия файл

@@ -0,0 +1,34 @@
1
+package com.ruoyi.wisdomarbitrate.domain.dto.mscase;
2
+
3
+import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAttach;
4
+import lombok.Data;
5
+
6
+import java.util.List;
7
+
8
+/**
9
+ * 案件确认缴费传入对象
10
+ */
11
+@Data
12
+public class CaseConfirmPayDTO {
13
+    /**
14
+     * 案件id
15
+     */
16
+    private Long caseId;
17
+    /**
18
+     * 批次号
19
+     */
20
+    private String batchNumber;
21
+    /**
22
+     * 支付方式 0线上支付,1线下支付
23
+     */
24
+    private String payType;
25
+    /**
26
+     * 流程节点id
27
+     */
28
+    private Integer caseFlowId;
29
+    /**
30
+     * 缴费凭证
31
+     */
32
+    private List<MsCaseAttach> payOrderList;
33
+
34
+}

+ 47
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/dto/mscase/CasePayDTO.java Целия файл

@@ -0,0 +1,47 @@
1
+package com.ruoyi.wisdomarbitrate.domain.dto.mscase;
2
+
3
+
4
+import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAttach;
5
+import lombok.Data;
6
+
7
+import java.util.List;
8
+
9
+/**
10
+ * 案件缴费传入对象
11
+ */
12
+@Data
13
+public class CasePayDTO {
14
+    /**
15
+     * 案件id
16
+     */
17
+    private Long caseId;
18
+    /**
19
+     * 案件流程节点id
20
+     */
21
+    private Integer caseFlowId;
22
+
23
+    /**
24
+     * 订单金额 单位:分
25
+     */
26
+    private int totalFee;
27
+    /**
28
+     * 交易类型 native(扫码) / jsapi(小程序) / app / h5
29
+     */
30
+    private String tradeType;
31
+    /**
32
+     * 支付方式 wxpay(微信)  alipay(支付宝)
33
+     */
34
+    private String platform;
35
+    /**
36
+     * 支付方式 0线上支付,1线下支付
37
+     */
38
+    private String payType;
39
+    /**
40
+     * 缴费凭证
41
+     */
42
+    private List<MsCaseAttach> payOrderList;
43
+    /**
44
+     * 批号
45
+     */
46
+    private String batchNumber;
47
+}

+ 44
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/dto/mscase/CasePaymentRecord.java Целия файл

@@ -0,0 +1,44 @@
1
+package com.ruoyi.wisdomarbitrate.domain.dto.mscase;
2
+
3
+import com.fasterxml.jackson.annotation.JsonFormat;
4
+import lombok.Data;
5
+
6
+import java.util.Date;
7
+
8
+@Data
9
+public class CasePaymentRecord {
10
+    private static final long serialVersionUID = 1L;
11
+    /**
12
+     * 主键
13
+     */
14
+    private Integer id;
15
+    /**
16
+     * 案件id
17
+     */
18
+    private Long caseId;
19
+    /**
20
+     * 订单号
21
+     */
22
+    private String orderNumber;
23
+    /**
24
+     * 支付状态(0未支付,1已支付)
25
+     */
26
+    private Integer paymentStatus;
27
+    /**
28
+     * 支付时间
29
+     */
30
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
31
+    private Date paymentTime;
32
+
33
+    /** 创建时间 */
34
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
35
+    private Date createTime;
36
+
37
+    /** 更新时间 */
38
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
39
+    private Date updateTime;
40
+    /**
41
+     * 支付方式 0线上支付,1线下支付
42
+     */
43
+    private Integer payType;
44
+}

+ 8
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/dto/sendrecord/SmsSendRecord.java Целия файл

@@ -42,4 +42,12 @@ public class SmsSendRecord extends BaseEntity {
42 42
      * 发送状态
43 43
      */
44 44
     private Integer sendStatus;
45
+
46
+    public SmsSendRecord(Long caseId, String caseNum, String phone, Date sendTime, String sendContent) {
47
+        this.caseId = caseId;
48
+        this.caseNum = caseNum;
49
+        this.phone = phone;
50
+        this.sendTime = sendTime;
51
+        this.sendContent = sendContent;
52
+    }
45 53
 }

+ 11
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/entity/mscase/MsCaseApplication.java Целия файл

@@ -138,6 +138,16 @@ public class MsCaseApplication {
138 138
      */
139 139
     @Column(name = "respon_isWrit_hear")
140 140
     private Integer responIswritHear;
141
+    /**
142
+     * 是否纸质送达,0-否,1-是
143
+     */
144
+    @Column(name = "paper_flag")
145
+    private Integer paperFlag;
146
+    /**
147
+     * 是否需要仲裁确认,0-否,1-是
148
+     */
149
+    @Column(name = "arbitrate_confirm")
150
+    private Integer arbitrateConfirm;
141 151
 
142 152
     /**
143 153
      * 创建者
@@ -210,4 +220,5 @@ public class MsCaseApplication {
210 220
      */
211 221
     @Column(name = "mediation_agreement")
212 222
     private String mediationAgreement;
223
+
213 224
 }

+ 63
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/entity/mscase/MsCasePaymentRecord.java Целия файл

@@ -0,0 +1,63 @@
1
+package com.ruoyi.wisdomarbitrate.domain.entity.mscase;
2
+
3
+import lombok.Getter;
4
+import lombok.Setter;
5
+import lombok.ToString;
6
+
7
+import javax.persistence.Column;
8
+import javax.persistence.GeneratedValue;
9
+import javax.persistence.Id;
10
+import javax.persistence.Table;
11
+import java.util.Date;
12
+
13
+@Getter
14
+@Setter
15
+@ToString
16
+@Table(name = "ms_case_payment_record")
17
+public class MsCasePaymentRecord {
18
+    @Id
19
+    @GeneratedValue(generator = "JDBC")
20
+    private Long id;
21
+
22
+    /**
23
+     * 案件id
24
+     */
25
+    @Column(name = "case_id")
26
+    private Long caseId;
27
+
28
+    /**
29
+     * 订单号
30
+     */
31
+    @Column(name = "order_number")
32
+    private String orderNumber;
33
+
34
+    /**
35
+     * 支付时间
36
+     */
37
+    @Column(name = "payment_time")
38
+    private Date paymentTime;
39
+
40
+    /**
41
+     * 创建时间
42
+     */
43
+    @Column(name = "create_time")
44
+    private Date createTime;
45
+
46
+    /**
47
+     * 更新时间
48
+     */
49
+    @Column(name = "update_time")
50
+    private Date updateTime;
51
+
52
+    /**
53
+     * 支付状态(0未支付,1已支付)
54
+     */
55
+    @Column(name = "payment_status")
56
+    private Integer paymentStatus;
57
+
58
+    /**
59
+     * 支付方式(0线上支付,1线下支付)
60
+     */
61
+    @Column(name = "pay_type")
62
+    private Integer payType;
63
+}

+ 34
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/mscase/MediatorVO.java Целия файл

@@ -0,0 +1,34 @@
1
+package com.ruoyi.wisdomarbitrate.domain.vo.mscase;
2
+
3
+import lombok.Data;
4
+
5
+/**
6
+ * @Classname MediatorVO
7
+ * @Description 调解员VO
8
+ * @Version 1.0.0
9
+ * @Date 2024/1/15 15:48
10
+ * @Created wangqiong
11
+ */
12
+@Data
13
+public class MediatorVO {
14
+    /**
15
+     * 调解员id
16
+     */
17
+    private Long mediatorId;
18
+    /**
19
+     * 调解员名称
20
+     */
21
+    private String mediatorName;
22
+    /**
23
+     * 专业
24
+     */
25
+    private String specialty;
26
+    /**
27
+     * 待办数量
28
+     */
29
+    private Integer todoAmount;
30
+    /**
31
+     * 已办数量
32
+     */
33
+    private Integer completeAmount;
34
+}

+ 9
- 1
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/mscase/MsCaseApplicationReq.java Целия файл

@@ -8,6 +8,14 @@ import lombok.NoArgsConstructor;
8 8
 @AllArgsConstructor
9 9
 @Data
10 10
 public class MsCaseApplicationReq {
11
+    /**
12
+     * 案件ID
13
+     */
14
+    private Long id;
15
+    /**
16
+     * 模板id
17
+     */
18
+    private String templateId;
11 19
     /**
12 20
      * 批次
13 21
      */
@@ -24,7 +32,7 @@ public class MsCaseApplicationReq {
24 32
     /**
25 33
      * 案件状态ID
26 34
      */
27
-    private Long caseFlowId;
35
+    private Integer caseFlowId;
28 36
     /**
29 37
      * 开始时间
30 38
      */

+ 54
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/mscase/PaymentDetailVO.java Целия файл

@@ -0,0 +1,54 @@
1
+package com.ruoyi.wisdomarbitrate.domain.vo.mscase;
2
+
3
+import com.ruoyi.common.annotation.EnumsConvert;
4
+import com.ruoyi.common.enums.PaymentStatusEnum;
5
+import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAttach;
6
+import lombok.AllArgsConstructor;
7
+import lombok.Data;
8
+import lombok.NoArgsConstructor;
9
+
10
+import java.math.BigDecimal;
11
+import java.util.List;
12
+
13
+/**
14
+ * @Classname PaymentDetailVO
15
+ * @Description 缴费单详情VO
16
+ * @Version 1.0.0
17
+ * @Date 2024/1/12 17:59
18
+ * @Created wangqiong
19
+ */
20
+@Data
21
+@NoArgsConstructor
22
+@AllArgsConstructor
23
+public class PaymentDetailVO {
24
+    private String caseNum;
25
+    /**
26
+     * 案件标的(欠款总金额)
27
+     */
28
+    private BigDecimal caseSubjectAmount;
29
+    /**
30
+     * 缴费金额
31
+     */
32
+    private BigDecimal feePayable;
33
+    /**
34
+     * 缴费单
35
+     */
36
+    private List<MsCaseAttach> caseAttachList;
37
+    /**
38
+     * 申请人
39
+     */
40
+    private String applicationOrganName;
41
+    /**
42
+     * 案件状态
43
+     */
44
+    private String caseStatusName;
45
+    /**
46
+     * 案件状态
47
+     */
48
+    @EnumsConvert(getEnumsInterface= PaymentStatusEnum.class,targetField = "paymentStatusName")
49
+    private String paymentStatus;
50
+    /**
51
+     * 案件状态
52
+     */
53
+    private String paymentStatusName;
54
+}

+ 8
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/mscase/MsCaseApplicationMapper.java Целия файл

@@ -1,6 +1,7 @@
1 1
 package com.ruoyi.wisdomarbitrate.mapper.mscase;
2 2
 
3 3
 import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseApplication;
4
+import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MediatorVO;
4 5
 import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseApplicationReq;
5 6
 import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseApplicationVO;
6 7
 import org.apache.ibatis.annotations.Param;
@@ -114,4 +115,11 @@ public interface MsCaseApplicationMapper extends Mapper<MsCaseApplication> {
114 115
             "         ) t order by  t.createTime desc,t.caseNum desc" +
115 116
             " </script>")
116 117
     List<MsCaseApplicationVO> list(@Param("req")MsCaseApplicationReq req, @Param("caseStatusNames") List<String> caseStatusNames);
118
+
119
+    /**
120
+     * 查询调解员列表
121
+     * @return
122
+     */
123
+    @Select("select a.id id,a.mediator_name mediatorName,a.mediator_phone mediatorPhone,a.mediator_email mediatorEmail,a.mediator_address mediatorAddress,a.mediator_id mediatorId,a.mediator_type mediatorType,a.mediator_status mediatorStatus,a.mediator_remark mediatorRemark,a.create_time createTime from ms_case_mediator a")
124
+    List<MediatorVO> listMediator();
117 125
 }

+ 4
- 1
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/mscase/MsCaseAttachMapper.java Целия файл

@@ -18,12 +18,13 @@ public interface MsCaseAttachMapper {
18 18
 
19 19
 
20 20
     int updateCaseAttach(MsCaseAttach caseAttach);
21
+    void batchUpdate(@Param("list") List<MsCaseAttach> caseAttachList);
21 22
 
22 23
     int updateCaseAttachBycaseid(MsCaseAttach caseAttach);
23 24
 
24 25
     int deleteByFileIds(@Param("ids") List<Integer> fileIds);
25 26
 
26
-    List<MsCaseAttach> getCaseAttachByCaseIdAndType(MsCaseAttach caseAttach);
27
+    List<MsCaseAttach> listCaseAttachByCaseIdAndType(@Param("caseAppliId")Long caseAppliId,@Param("annexType") int annexType);
27 28
 
28 29
     MsCaseAttach queryAnnexById(@Param("annexId") Long annexId);
29 30
 
@@ -35,4 +36,6 @@ public interface MsCaseAttachMapper {
35 36
     void deleteByCasedIdAndType(@Param("caseAppliId")Long caseAppliId,@Param("annexType") int annexType,@Param("isBatchUpload") int isBatchUpload);
36 37
 
37 38
     void deleteCaseAttachByCasedIdAndType(@Param("caseAppliId")Long caseAppliId,@Param("annexType") int annexType);
39
+
40
+
38 41
 }

+ 8
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/mscase/MsCasePaymentRecordMapper.java Целия файл

@@ -0,0 +1,8 @@
1
+package com.ruoyi.wisdomarbitrate.mapper.mscase;
2
+
3
+import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCasePaymentRecord;
4
+import tk.mybatis.mapper.common.Mapper;
5
+
6
+public interface MsCasePaymentRecordMapper extends Mapper<MsCasePaymentRecord> {
7
+
8
+}

+ 2
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/template/TemplateManageMapper.java Целия файл

@@ -2,6 +2,7 @@ package com.ruoyi.wisdomarbitrate.mapper.template;
2 2
 
3 3
 import com.ruoyi.wisdomarbitrate.domain.dto.template.TemplateManage;
4 4
 import org.apache.ibatis.annotations.Mapper;
5
+import org.apache.ibatis.annotations.Param;
5 6
 
6 7
 import java.util.List;
7 8
 
@@ -12,4 +13,5 @@ public interface TemplateManageMapper {
12 13
     int insertTemplateManage(TemplateManage templateManage);
13 14
 
14 15
     int updateTemplateManage(TemplateManage templateManage);
16
+    TemplateManage selectById(@Param("id") String id);
15 17
 }

+ 6
- 14
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/dept/impl/DeptIdentifyServiceImpl.java Целия файл

@@ -418,15 +418,11 @@ public class DeptIdentifyServiceImpl implements IDeptIdentifyService {
418 418
             String filePath = RuoYiConfig.getUploadPath();
419 419
             // 上传
420 420
             String fileName = FileUploadUtils.upload(filePath, file);
421
-            String prefix = "/profile";
422
-            int startIndex = fileName.indexOf(prefix);
423
-            startIndex += prefix.length();
424
-            String annexPath = "uploadPath" + fileName.substring(startIndex);
425
-            templateManage.setTemOrigPath(annexPath);
421
+
422
+            templateManage.setTemOrigPath(fileName);
426 423
             String format = getFileExtension(fileName);
427 424
             templateManage.setTemFormat(format);
428
-            String subFileName = fileName.substring(fileName.lastIndexOf("/") + 1);
429
-            templateManage.setFileName(subFileName);
425
+            templateManage.setFileName(file.getOriginalFilename());
430 426
             templateManage.setCreateBy(getUsername());
431 427
             int i = templateManageMapper.insertTemplateManage(templateManage);
432 428
             if (i > 0) {
@@ -449,13 +445,9 @@ public class DeptIdentifyServiceImpl implements IDeptIdentifyService {
449 445
                 String filePath = RuoYiConfig.getUploadPath();
450 446
                 // 上传
451 447
                 String fileName = FileUploadUtils.upload(filePath, file);
452
-                String prefix = "/profile";
453
-                int startIndex = fileName.indexOf(prefix);
454
-                startIndex += prefix.length();
455
-                String annexPath = "uploadPath" + fileName.substring(startIndex);
456
-                templateManage.setTemOrigPath(annexPath);
457
-                String subFileName = fileName.substring(fileName.lastIndexOf("/") + 1);
458
-                templateManage.setFileName(subFileName);
448
+
449
+                templateManage.setTemOrigPath(fileName);
450
+                templateManage.setFileName(file.getOriginalFilename());
459 451
                 String format = getFileExtension(fileName);
460 452
                 templateManage.setTemFormat(format);
461 453
             }

+ 62
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/MsCaseApplicationService.java Целия файл

@@ -1,7 +1,9 @@
1 1
 package com.ruoyi.wisdomarbitrate.service.mscase;
2 2
 
3 3
 import com.ruoyi.common.core.domain.AjaxResult;
4
+import com.ruoyi.system.domain.entity.flow.MsCaseFlow;
4 5
 import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAffiliate;
6
+import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseApplication;
5 7
 import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseApplicationReq;
6 8
 import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseApplicationVO;
7 9
 import org.springframework.web.multipart.MultipartFile;
@@ -56,4 +58,64 @@ public interface MsCaseApplicationService {
56 58
      * @return
57 59
      */
58 60
     AjaxResult uploadCaseZipFile(MultipartFile file, Long templateId);
61
+
62
+    /**
63
+     * 生成调解申请书
64
+     * @param req
65
+     * @return
66
+     */
67
+    AjaxResult generateApplication(MsCaseApplicationReq req);
68
+
69
+    /**
70
+     * 根据批次号和流程id查找未锁定的案件
71
+     * @param batchNumber
72
+     * @param caseFlowId 案件流程id
73
+     * @return
74
+     */
75
+    List<MsCaseApplication> listByBatchNumber(String batchNumber,Integer caseFlowId);
76
+    /**
77
+     * 批量更新附件
78
+     * @param req
79
+     * @return
80
+     */
81
+
82
+    AjaxResult batchUpdateAttach(MsCaseApplicationVO req);
83
+
84
+    /**
85
+     * 批量上传证据
86
+     * @param file
87
+     * @param annexType
88
+     * @param id
89
+     * @return
90
+     */
91
+
92
+    AjaxResult batchUpload(MultipartFile[] file, Integer annexType, Long id);
93
+    /**
94
+     * 流向下一个流程节点
95
+     * @param caseId 案件id
96
+     * @param caseFlowId 案件流程id
97
+     * @param lockStatus '是否锁定,0-否,1-是',单独操作案件时需要锁定
98
+     * @return
99
+     */
100
+    MsCaseFlow nextFlow(Long caseId, Integer caseFlowId,Integer lockStatus);
101
+
102
+    /**
103
+     * 案件受理
104
+     * @param req
105
+     * @return
106
+     */
107
+    AjaxResult accept(MsCaseApplication req);
108
+
109
+    /**
110
+     * 案件提交
111
+     * @param req
112
+     * @return
113
+     */
114
+    AjaxResult submit(MsCaseApplication req);
115
+
116
+    /**
117
+     * 查询调解员
118
+     * @return
119
+     */
120
+    AjaxResult listMediator();
59 121
 }

+ 36
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/MsCasePaymentService.java Целия файл

@@ -0,0 +1,36 @@
1
+package com.ruoyi.wisdomarbitrate.service.mscase;
2
+
3
+import com.ruoyi.common.core.domain.AjaxResult;
4
+import com.ruoyi.wisdomarbitrate.domain.dto.mscase.CaseConfirmPayDTO;
5
+import com.ruoyi.wisdomarbitrate.domain.dto.mscase.CasePayDTO;
6
+import com.ruoyi.wisdomarbitrate.domain.vo.mscase.PaymentDetailVO;
7
+
8
+public interface MsCasePaymentService {
9
+    /**
10
+     * 案件线上缴费
11
+     */
12
+    AjaxResult casePay(CasePayDTO casePayDTO);
13
+
14
+    /**
15
+     * 缴费
16
+     * @param payDTO
17
+     * @return
18
+     */
19
+    AjaxResult confirmPayment(CaseConfirmPayDTO payDTO);
20
+
21
+    /**
22
+     * 根据案件id或者批次号查询申请人及应缴费用
23
+     * @param dto
24
+     * @return
25
+     */
26
+    AjaxResult selectTotalFee(CasePayDTO dto);
27
+
28
+    /**
29
+     * 根据案件id查询缴费单
30
+     * @param id
31
+     * @return
32
+     */
33
+    PaymentDetailVO selectPaymentDetail(Long id);
34
+
35
+    AjaxResult confirmPaid(CaseConfirmPayDTO dto);
36
+}

+ 3
- 4
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/CallBackHandleServiceImpl.java Целия файл

@@ -11,13 +11,12 @@ import org.springframework.stereotype.Component;
11 11
 @Component
12 12
 @Slf4j
13 13
 public class CallBackHandleServiceImpl implements CallBackService {
14
-    // todo
15
-//    @Autowired
16
-//    private CasePaymentServiceImpl casePaymentService;
14
+    @Autowired
15
+    private MsCasePaymentServiceImpl casePaymentService;
17 16
 
18 17
     @Override
19 18
     public void successPay(String orderSn) {
20
-    //    casePaymentService.callback(orderSn);
19
+        casePaymentService.callback(orderSn);
21 20
     }
22 21
 
23 22
     @Override

+ 427
- 7
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/MsCaseApplicationServiceImpl.java Целия файл

@@ -3,33 +3,43 @@ package com.ruoyi.wisdomarbitrate.service.mscase.impl;
3 3
 import cn.hutool.core.bean.BeanUtil;
4 4
 import cn.hutool.core.collection.CollectionUtil;
5 5
 import cn.hutool.core.util.StrUtil;
6
+import com.ruoyi.common.config.RuoYiConfig;
6 7
 import com.ruoyi.common.core.domain.AjaxResult;
7 8
 import com.ruoyi.common.core.domain.entity.SysDept;
8 9
 import com.ruoyi.common.core.domain.entity.SysDictData;
9 10
 import com.ruoyi.common.core.domain.entity.SysRole;
10 11
 import com.ruoyi.common.core.domain.entity.SysUser;
11 12
 import com.ruoyi.common.core.domain.model.LoginUser;
13
+import com.ruoyi.common.enums.AnnexTypeEnum;
14
+import com.ruoyi.common.enums.YesOrNoEnum;
12 15
 import com.ruoyi.common.exception.ServiceException;
13 16
 import com.ruoyi.common.utils.*;
17
+import com.ruoyi.common.utils.file.FileUploadUtils;
14 18
 import com.ruoyi.system.domain.entity.flow.MsCaseFlow;
15 19
 import com.ruoyi.system.domain.entity.flow.MsCaseFlowRoleRelated;
16 20
 import com.ruoyi.system.mapper.*;
17 21
 import com.ruoyi.system.mapper.flow.MsCaseFlowMapper;
18 22
 import com.ruoyi.system.mapper.flow.MsCaseFlowRoleRelatedMapper;
23
+import com.ruoyi.wisdomarbitrate.domain.dto.sendrecord.SmsSendRecord;
19 24
 import com.ruoyi.wisdomarbitrate.domain.dto.template.FatchRule;
25
+import com.ruoyi.wisdomarbitrate.domain.dto.template.TemplateManage;
20 26
 import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAffiliate;
21 27
 import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseApplication;
22 28
 import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAttach;
29
+import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MediatorVO;
23 30
 import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseApplicationReq;
24 31
 import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseApplicationVO;
25 32
 import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsColumnValueVO;
26 33
 import com.ruoyi.wisdomarbitrate.mapper.mscase.*;
34
+import com.ruoyi.wisdomarbitrate.mapper.sendrecord.SmsRecordMapper;
27 35
 import com.ruoyi.wisdomarbitrate.mapper.template.FatchRuleMapper;
36
+import com.ruoyi.wisdomarbitrate.mapper.template.TemplateManageMapper;
28 37
 import com.ruoyi.wisdomarbitrate.service.mscase.MsCaseApplicationService;
29 38
 import com.ruoyi.wisdomarbitrate.utils.CaseLogUtils;
30 39
 import com.ruoyi.wisdomarbitrate.utils.OCRUtils;
31 40
 import com.ruoyi.wisdomarbitrate.utils.UnZipFileUtils;
32 41
 import org.apache.pdfbox.pdmodel.PDDocument;
42
+import org.apache.poi.xwpf.usermodel.XWPFDocument;
33 43
 import org.springframework.beans.factory.annotation.Autowired;
34 44
 import org.springframework.stereotype.Service;
35 45
 import org.springframework.transaction.annotation.Transactional;
@@ -39,10 +49,17 @@ import tk.mybatis.mapper.entity.Example;
39 49
 import java.io.*;
40 50
 import java.math.BigDecimal;
41 51
 import java.math.RoundingMode;
52
+import java.nio.file.Files;
53
+import java.nio.file.Path;
54
+import java.nio.file.StandardCopyOption;
42 55
 import java.text.SimpleDateFormat;
56
+import java.time.LocalDate;
57
+import java.time.format.DateTimeFormatter;
43 58
 import java.util.*;
59
+import java.util.function.Function;
44 60
 import java.util.stream.Collectors;
45 61
 
62
+import static com.ruoyi.common.utils.BookMarkUtil.getBookmarkByDocx;
46 63
 import static com.ruoyi.common.utils.SecurityUtils.getUsername;
47 64
 
48 65
 /**
@@ -86,6 +103,10 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
86 103
     FatchRuleMapper fatchRuleMapper;
87 104
     @Autowired
88 105
     SysDictDataMapper dictDataMapper;
106
+    @Autowired
107
+    TemplateManageMapper templateManageMapper;
108
+    @Autowired
109
+    private SmsRecordMapper smsRecordMapper;
89 110
     // 案件基本字段
90 111
     public static final List<String> CASE_BASE_COLUMN = Arrays.asList("caseSubjectAmount", "arbitratClaims", "facts", "requestRule");
91 112
     public static final SimpleDateFormat yyyymmddFormat = new SimpleDateFormat("yyyy-MM-dd");
@@ -233,11 +254,16 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
233 254
             }
234 255
             // 保存案件附件
235 256
 
236
-            if (CollectionUtil.isNotEmpty(caseAttachList) && !caseApplication.isImportFlag()) {
257
+            if (CollectionUtil.isNotEmpty(caseAttachList)) {
237 258
                 for (MsCaseAttach caseAttach : caseAttachList) {
238 259
                     caseAttach.setCaseAppliId(caseApplication.getId());
260
+                }
261
+                if(!caseApplication.isImportFlag()) {
239 262
                     // 修改案件附件
240
-                    msCaseAttachMapper.updateCaseAttach(caseAttach);
263
+                    msCaseAttachMapper.batchUpdate(caseAttachList);
264
+                }else {
265
+                    // 压缩包导入保存附件
266
+                    msCaseAttachMapper.batchSave(caseAttachList);
241 267
                 }
242 268
             }
243 269
             List<MsColumnValueVO> columnValueList = caseApplication.getColumnValueList();
@@ -373,8 +399,9 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
373 399
         }
374 400
         //查询批次号
375 401
         String batchNumber = getBatchNumber();
376
-        // 抓取内容
377
-        Map<String, String> fatchMap = new HashMap<>();
402
+        // 案件数量
403
+        int caseCount = 0;
404
+
378 405
         for (File outFile : files) {
379 406
             if (!outFile.isDirectory() || outFile.listFiles() == null) {
380 407
                 continue;
@@ -384,6 +411,8 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
384 411
                 // 所有的文件,fileMap<fileName,filePath>
385 412
                 Map<String, String> fileMap = findFile(inFile);
386 413
                 if (fileMap != null && !fileMap.isEmpty()) {
414
+                    // 抓取内容
415
+                    Map<String, String> fatchMap = new HashMap<>();
387 416
                     // 根据抓取规则设置字段值
388 417
                     for (Map.Entry<String, List<FatchRule>> entry : fatchRuleMap.entrySet()) {
389 418
                         getFatchContent(fileMap, entry.getKey(), fatchMap, entry.getValue());
@@ -429,15 +458,406 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
429 458
                         caseApplicationVO.setColumnValueList(columnValueList);
430 459
                         caseApplicationVO.setImportFlag(true);
431 460
                         insert(caseApplicationVO);
461
+                        caseCount++;
432 462
 
433 463
                     }
434 464
                 }
435 465
             }
436 466
 
437 467
         }
438
-        return AjaxResult.success();
468
+        if(caseCount>0) {
469
+            return AjaxResult.success();
470
+        }else {
471
+            return AjaxResult.error("请检查压缩包!");
472
+        }
473
+    }
474
+
475
+    /**
476
+     * 生成调解申请书
477
+     * @param req
478
+     * @return
479
+     */
480
+    @Override
481
+    public AjaxResult generateApplication(MsCaseApplicationReq req) {
482
+        // 根据模板id查询申请书
483
+        TemplateManage templateManage=templateManageMapper.selectById(req.getTemplateId());
484
+        if(templateManage==null||StrUtil.isEmpty(templateManage.getTemOrigPath())){
485
+            return AjaxResult.error("未找到调解申请书模板");
486
+        }
487
+        String templatePath = templateManage.getTemOrigPath();
488
+        try {
489
+            File file = new File(templatePath);
490
+        } catch (Exception e) {
491
+            return AjaxResult.error("未找到调解申请书模板");
492
+        }
493
+
494
+        // 获取模板中的占位符key
495
+        List<String> bookmarkList = getBookmarkByDocx(templatePath);
496
+        if (CollectionUtil.isEmpty(bookmarkList)) {
497
+            return AjaxResult.success("请检查模板是否配置正确,未获取到占位符");
498
+        }
499
+        // 在系统表中查询案件内置字段
500
+        SysDictData sysDictData = new SysDictData();
501
+        sysDictData.setDictType("case_built_type");
502
+        List<SysDictData> dictDataList = dictDataMapper.selectDictDataList(sysDictData);
503
+        if(CollectionUtil.isEmpty(dictDataList)){
504
+            return AjaxResult.error("未找到系统内置字段");
505
+        }
506
+        // 如果批号不为空,则为批量操作,根据批号查询未锁定的案件
507
+        if(StrUtil.isNotEmpty(req.getBatchNumber())){
508
+            List<MsCaseApplication> caseApplicationList=listByBatchNumber(req.getBatchNumber(),req.getCaseFlowId());
509
+            if(CollectionUtil.isEmpty(caseApplicationList)){
510
+                return AjaxResult.error("该批次号下未找到案件");
511
+            }
512
+            // 案件ids
513
+            List<Long> caseIds = caseApplicationList.stream().map(MsCaseApplication::getId).collect(Collectors.toList());
514
+            // 根据ids查询案件关联人员
515
+            Example afflicateExample = new Example(MsCaseFlow.class);
516
+            afflicateExample.createCriteria().andIn("case_appli_id", caseIds);
517
+            List<MsCaseAffiliate> affiliateList = msCaseAffiliateMapper.selectByExample(caseIds);
518
+            if(CollectionUtil.isEmpty(affiliateList)){
519
+                return AjaxResult.error("该批次号下未找到案件关联人员");
520
+            }
521
+
522
+            Map<Long, MsCaseAffiliate> affiliateMap = affiliateList.stream().collect(Collectors.toMap(MsCaseAffiliate::getCaseAppliId, Function.identity()));
523
+
524
+            // 循环生成调解申请书
525
+            for (MsCaseApplication application : caseApplicationList) {
526
+
527
+                // 案件相关人员
528
+                MsCaseAffiliate affiliate = affiliateMap.get(application.getId());
529
+                if(affiliate==null){
530
+                    continue;
531
+                }
532
+                createMediateApplication(application, affiliate, templatePath, bookmarkList,dictDataList);
533
+
534
+            }
535
+        }else {
536
+            // 单独生成调解申请书
537
+            // 根据案件id查询案件信息
538
+            MsCaseApplication application = msCaseApplicationMapper.selectByPrimaryKey(req.getId());
539
+            // 查询案件关联人员
540
+            MsCaseAffiliate caseAffiliate = msCaseAffiliateMapper.selectByPrimaryKey(req.getId());
541
+            if (application == null || caseAffiliate == null) {
542
+                return AjaxResult.error("该案件不存在");
543
+            }
544
+            createMediateApplication(application, caseAffiliate, templatePath, bookmarkList,dictDataList);
545
+        }
546
+
547
+
548
+        return AjaxResult.success("调解申请书生成成功");
549
+    }
550
+
551
+    public List<MsCaseApplication> listByBatchNumber(String batchNumber,Integer caseFlowId) {
552
+        Example example = new Example(MsCaseFlow.class);
553
+        example.createCriteria().andEqualTo("batch_number", batchNumber);
554
+        example.createCriteria().andEqualTo("lock_status", 0);
555
+        if(caseFlowId!=null){
556
+            example.createCriteria().andEqualTo("case_flow_id",caseFlowId);
557
+        }
558
+        return msCaseApplicationMapper.selectByExample(example);
559
+
439 560
     }
440 561
 
562
+    @Override
563
+    public AjaxResult batchUpdateAttach(MsCaseApplicationVO req) {
564
+        for (MsCaseAttach attach : req.getCaseAttachList()) {
565
+            attach.setCaseAppliId(req.getId());
566
+            msCaseAttachMapper.updateCaseAttach(attach);
567
+        }
568
+        return null;
569
+    }
570
+
571
+    @Override
572
+    public AjaxResult batchUpload(MultipartFile[] files, Integer annexType, Long id) {
573
+        List<MsCaseAttach> successList = new ArrayList<>();
574
+        try {
575
+            String filePath = RuoYiConfig.getUploadPath();
576
+            for (MultipartFile file : files) {
577
+                // 上传
578
+                String path = FileUploadUtils.upload(filePath, file);
579
+                MsCaseAttach caseAttach = MsCaseAttach.builder().caseAppliId(id)
580
+                        .annexName(file.getOriginalFilename())
581
+                        .annexPath(path)
582
+                        .annexType(annexType)
583
+                        .useId(SecurityUtils.getUserId())
584
+                        .useAccount(SecurityUtils.getUsername())
585
+                        .isBatchUpload(1L)
586
+                        .build();
587
+                int count = msCaseAttachMapper.save(caseAttach);
588
+                if (count > 0 ) {
589
+                    MsCaseAttach caseAttachselect = new MsCaseAttach();
590
+                    caseAttachselect.setAnnexId(caseAttach.getAnnexId());
591
+                    caseAttachselect.setAnnexName(caseAttach.getAnnexName());
592
+                    caseAttachselect.setAnnexType(caseAttach.getAnnexType());
593
+                    successList.add(caseAttachselect);
594
+                }
595
+            }
596
+
597
+
598
+        } catch (IOException e) {
599
+            e.printStackTrace();
600
+            return AjaxResult.error("上传失败");
601
+        }
602
+        return AjaxResult.success("上传成功", successList);
603
+    }
604
+
605
+    /**
606
+     * 案件受理
607
+     * @param req
608
+     * @return
609
+     */
610
+    @Override
611
+    public AjaxResult accept(MsCaseApplication req) {
612
+        if (StrUtil.isNotEmpty(req.getBatchNumber())) {
613
+            // 根据批号查询未锁定的案件
614
+            List<MsCaseApplication> applicationList = listByBatchNumber(req.getBatchNumber(), req.getCaseFlowId());
615
+            if (CollectionUtil.isEmpty(applicationList)) {
616
+                return AjaxResult.error("该批次号下未找到案件");
617
+            }
618
+            // 查询案件关联人员
619
+            Example example = new Example(MsCaseAffiliate.class);
620
+            example.createCriteria().andIn("case_appli_id", applicationList.stream().map(MsCaseApplication::getId).collect(Collectors.toList()));
621
+            List<MsCaseAffiliate> affiliateList = msCaseAffiliateMapper.selectByExample(example);
622
+            if (CollectionUtil.isEmpty(affiliateList)) {
623
+                return AjaxResult.error("该批次号下未找到案件");
624
+            }
625
+            Map<Long, MsCaseAffiliate> affiliateMap = affiliateList.stream().collect(Collectors.toMap(MsCaseAffiliate::getCaseAppliId, Function.identity()));
626
+            for (MsCaseApplication application : applicationList) {
627
+                accept(application,req,affiliateMap);
628
+            }
629
+
630
+        } else {
631
+            // 根据案件id查询案件相关人
632
+            MsCaseAffiliate caseAffiliate = msCaseAffiliateMapper.selectByPrimaryKey(req.getId());
633
+            if (caseAffiliate == null) {
634
+                return AjaxResult.error("该案件不存在");
635
+            }
636
+            // 锁定该案件
637
+            req.setLockStatus(YesOrNoEnum.YES.getCode());
638
+            Map<Long, MsCaseAffiliate> affiliateMap=new HashMap<>();
639
+            affiliateMap.put(req.getId(),caseAffiliate);
640
+            accept(req,req,affiliateMap);
641
+        }
642
+
643
+        return AjaxResult.success("受理成功");
644
+    }
645
+
646
+    /**
647
+     * 案件提交
648
+     * @param req
649
+     * @return
650
+     */
651
+    @Override
652
+    public AjaxResult submit(MsCaseApplication req) {
653
+        if(StrUtil.isNotEmpty(req.getBatchNumber())){
654
+            // 批量提交
655
+            List<MsCaseApplication> list = listByBatchNumber(req.getBatchNumber(), req.getCaseFlowId());
656
+            if(CollectionUtil.isEmpty(list)){
657
+                return AjaxResult.error("该批次号下未找到案件");
658
+            }
659
+            for (MsCaseApplication application : list) {
660
+                MsCaseFlow caseFlow = nextFlow(application.getId(), req.getCaseFlowId(), YesOrNoEnum.NO.getCode());
661
+                CaseLogUtils.insertCaseLog(application.getId(), caseFlow.getNodeId(), caseFlow.getCaseStatusName(), "提交成功");
662
+            }
663
+        }else {
664
+            MsCaseFlow caseFlow = nextFlow(req.getId(), req.getCaseFlowId(), YesOrNoEnum.NO.getCode());
665
+            CaseLogUtils.insertCaseLog(req.getId(), caseFlow.getNodeId(), caseFlow.getCaseStatusName(), "提交成功");
666
+
667
+        }
668
+        return AjaxResult.success("提交成功");
669
+    }
670
+
671
+    @Override
672
+    public AjaxResult listMediator() {
673
+        List<MediatorVO> mediatorVOS = new ArrayList<MediatorVO>();
674
+        mediatorVOS= msCaseApplicationMapper.listMediator();
675
+
676
+        return null;
677
+    }
678
+
679
+    /**
680
+     * 案件受理
681
+     * @param application
682
+     * @param req
683
+     * @param affiliateMap
684
+     */
685
+    private void accept(MsCaseApplication application, MsCaseApplication req, Map<Long, MsCaseAffiliate> affiliateMap) {
686
+        application.setUpdateBy(SecurityUtils.getUsername());
687
+        application.setUpdateTime(new Date());
688
+        msCaseApplicationMapper.updateByPrimaryKeySelective(application);
689
+        MsCaseFlow caseFlow = nextFlow(application.getId(), req.getCaseFlowId(),req.getLockStatus());
690
+        // 给申请人被申请人发送短信
691
+        if (affiliateMap.containsKey(application.getId())) {
692
+            MsCaseAffiliate affiliate = affiliateMap.get(application.getId());
693
+
694
+            if (StrUtil.isNotEmpty(affiliate.getContactTelphoneAgent())) {
695
+                String sendContent = "尊敬的" + affiliate.getNameAgent() + "用户,您的" + application.getCaseNum() + "{2}仲裁案件,已成功受理,请知晓,如非本人操作,请忽略本短信";
696
+                // 给申请人发送案件受理短信 尊敬的{1}用户,您的{2}仲裁案件,已成功受理,请知晓,如非本人操作,请忽略本短信
697
+                Boolean smsFlag = SmsUtils.sendSms(application.getId(), "2049503", affiliate.getContactTelphoneAgent(), new String[]{affiliate.getNameAgent(), application.getCaseNum()});
698
+                CaseLogUtils.insertCaseLog(application.getId(), caseFlow.getNodeId(), caseFlow.getNodeName(), "向申请人发送短信," + sendContent);
699
+                SmsSendRecord smsSendRecord = new SmsSendRecord(application.getId(), application.getCaseNum(), affiliate.getContactTelphoneAgent(), new Date(), sendContent);
700
+                if (smsFlag) {
701
+                    // 发送成功
702
+                    smsSendRecord.setSendStatus(YesOrNoEnum.YES.getCode());
703
+                } else {
704
+                    smsSendRecord.setSendStatus(YesOrNoEnum.NO.getCode());
705
+                }
706
+                smsRecordMapper.saveSmsSendRecord(smsSendRecord);
707
+            }
708
+            // 给申请人被申请人发送短信
709
+            if (StrUtil.isNotEmpty(affiliate.getRespondentPhone())) {
710
+                String sendContent = "尊敬的" + affiliate.getRespondentName() + "用户,您的" + application.getCaseNum() + "{2}仲裁案件,已成功受理,请知晓,如非本人操作,请忽略本短信";
711
+                // 给被申请人发送案件受理短信 尊敬的{1}用户,您的{2}仲裁案件,已成功受理,请知晓,如非本人操作,请忽略本短信
712
+                Boolean smsFlag = SmsUtils.sendSms(application.getId(), "2049503", affiliate.getRespondentPhone(), new String[]{affiliate.getRespondentName(), application.getCaseNum()});
713
+                CaseLogUtils.insertCaseLog(application.getId(), caseFlow.getNodeId(), caseFlow.getNodeName(), "向被申请人发送短信," + sendContent);
714
+                SmsSendRecord smsSendRecord = new SmsSendRecord(application.getId(), application.getCaseNum(), affiliate.getRespondentPhone(), new Date(), sendContent);
715
+                if (smsFlag) {
716
+                    // 发送成功
717
+                    smsSendRecord.setSendStatus(YesOrNoEnum.YES.getCode());
718
+                } else {
719
+                    smsSendRecord.setSendStatus(YesOrNoEnum.NO.getCode());
720
+                }
721
+                smsRecordMapper.saveSmsSendRecord(smsSendRecord);
722
+            }
723
+        }
724
+    }
725
+
726
+    /**
727
+     * 流向下一个流程节点
728
+     * @param caseId 案件id
729
+     * @param caseFlowId 案件流程id
730
+     * @param lockStatus '是否锁定,0-否,1-是',单独操作案件时需要锁定
731
+     * @return
732
+     */
733
+    @Override
734
+    public MsCaseFlow nextFlow(Long caseId,Integer caseFlowId,Integer lockStatus) {
735
+        MsCaseFlow nextFlow = caseFlowMapper.nextFlow(caseFlowId);
736
+        if (nextFlow == null) {
737
+            throw new ServiceException("未找到下一个流程节点");
738
+        }
739
+        MsCaseApplication application = new MsCaseApplication();
740
+        application.setId(caseId);
741
+        // 更改案件流程id和案件状态
742
+        application.setCaseFlowId(nextFlow.getId());
743
+        application.setCaseStatusName(nextFlow.getCaseStatusName());
744
+        application.setLockStatus(lockStatus);
745
+        msCaseApplicationMapper.updateByPrimaryKeySelective(application);
746
+        // 新增日志
747
+        CaseLogUtils.insertCaseLog(application.getId(), nextFlow.getNodeId(), nextFlow.getCaseStatusName(),"");
748
+        return nextFlow;
749
+    }
750
+
751
+    /**
752
+     * 生成调解申请书
753
+     * @param application 案件基本信息
754
+     * @param affiliate 案件相关人员
755
+     * @param templatePath 模板路径
756
+     * @param bookmarkList 标签
757
+     * @param dictDataList 内置字段
758
+     */
759
+    private void createMediateApplication(MsCaseApplication application, MsCaseAffiliate affiliate, String templatePath, List<String> bookmarkList, List<SysDictData> dictDataList) {
760
+        // 申请书需要的字段和内容,valueMap<占位符,替换的值>
761
+        Map<String, String> valueMap = new HashMap<>();
762
+        for (SysDictData dictData : dictDataList) {
763
+            if (CASE_BASE_COLUMN.contains(dictData.getDictValue())) {
764
+                valueMap.put(dictData.getDictLabel(), ObjectFieldUtils.getValue(application, dictData.getDictValue()));
765
+            } else {
766
+                // 相关人员字段
767
+                valueMap.put(dictData.getDictLabel(), ObjectFieldUtils.getValue(affiliate, dictData.getDictValue()));
768
+            }
769
+
770
+        }
771
+        // 书签对应值
772
+        Map<String, Object> bookmarkValueMap = new HashMap<>();
773
+        // 读取调节申请书,找到占位符,替换值
774
+        // 遍历书签,给书签赋值
775
+        replaceBookmark(bookmarkList, bookmarkValueMap, valueMap);
776
+        // 根据条件替换书签
777
+//                conditionReplaceBookmark(caseApplicationById, bookmarkValueMap, agentName, resName, arbitrateRecordSelect);
778
+        // 申请书生成时间
779
+        LocalDate now = LocalDate.now();
780
+        int year = now.getYear();
781
+        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy年MM月dd日");
782
+        // 格式化当前日期
783
+        String formattedDate = now.format(formatter);
784
+        bookmarkValueMap.put("日期", formattedDate);
785
+
786
+        String month = String.format("%02d", now.getMonthValue());
787
+        String day = String.format("%02d", now.getDayOfMonth());
788
+        // todo
789
+        String saveFolderPath = "/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day;
790
+//            String saveFolderPath = "D:/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day;
791
+        String orgFileName="调解申请书";
792
+        String fileName = UUID.randomUUID().toString().replace("-", "")+orgFileName + ".docx";
793
+        // todo
794
+        String saveName = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName;
795
+//            String saveName = "D:/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day + "/" + fileName;
796
+        String resultFilePath = saveFolderPath + "/" + fileName;
797
+        // 将word中的标签替换掉,生成新的word
798
+        wordChangeText(templatePath, bookmarkValueMap,saveFolderPath,resultFilePath);
799
+
800
+        //      String savePath = docFilePath.substring(0, docFilePath.indexOf("/upload/") + 8);
801
+        // 保存裁决书附件
802
+        //      saveArbitorFile(id, saveName, savePath, caseApplicationById, arbitrateRecordSelect);
803
+        MsCaseAttach caseAttach = MsCaseAttach.builder()
804
+                .caseAppliId(application.getId())
805
+                .annexName(orgFileName)
806
+                .annexPath(resultFilePath)
807
+                .annexType(AnnexTypeEnum.MEDIATION_APPLICATION.getCode())
808
+                .build();
809
+        //保存到附件表里,先删除之前的在保存
810
+        msCaseAttachMapper.deleteCaseAttachByCasedIdAndType(caseAttach.getCaseAppliId(), 3);
811
+        msCaseAttachMapper.save(caseAttach);
812
+    }
813
+
814
+    /**
815
+     * 将word中的标签替换掉,生成新的word
816
+     *
817
+     * @param modalFilePath  调解申请书模板路径
818
+     * @param datas          替换标签的内容
819
+     * @param resultFilePath 保存路径
820
+
821
+     * @return
822
+     * @throws IOException
823
+     */
824
+    private void wordChangeText(String modalFilePath, Map<String, Object> datas, String saveFolderPath, String resultFilePath)  {
825
+        // 调解申请书保存的路径
826
+
827
+        // 创建日期目录
828
+        File saveFolder = new File(saveFolderPath);
829
+        if (!saveFolder.exists()) {
830
+            saveFolder.mkdirs();
831
+        }
832
+        Path sourcePath = new File(modalFilePath).toPath();
833
+        Path destinationPath = new File(resultFilePath).toPath();
834
+        try {
835
+            Files.copy(sourcePath, destinationPath, StandardCopyOption.REPLACE_EXISTING);
836
+            WordUtil.getDocFilePath(datas, modalFilePath, resultFilePath);
837
+            File file = new File(resultFilePath);
838
+            if (file.exists()) {
839
+                InputStream in = new FileInputStream(file);
840
+                XWPFDocument xwpfDocument = new XWPFDocument(in);
841
+                WordUtil.changeText(xwpfDocument);
842
+            }
843
+        } catch (IOException e) {
844
+            throw new RuntimeException("请检查文件路径是否有误");
845
+        }
846
+    }
847
+    /**
848
+     * 给模板中的占位符赋值
849
+     *
850
+     * @param bookmarkList 书签
851
+     * @param bookmarkValueMap        书签赋值
852
+     * @param valueMap     案件内容
853
+     */
854
+    private void replaceBookmark(List<String> bookmarkList, Map<String, Object> bookmarkValueMap, Map<String, String> valueMap) {
855
+        for (String bookmark : bookmarkList) {
856
+            if (valueMap.containsKey(bookmark)) {
857
+                bookmarkValueMap.put(bookmark, valueMap.get(bookmark));
858
+            }
859
+        }
860
+    }
441 861
     /**
442 862
      * 组装附件
443 863
      *
@@ -463,12 +883,12 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
463 883
 //                                        caseAttach.setAnnexName(entry.getKey());
464 884
 //                                    }
465 885
             // 申请人提供的证据材料
466
-            caseAttach.setAnnexType(2);
886
+            caseAttach.setAnnexType(AnnexTypeEnum.APPLICATION_EVIDENCE.getCode());
467 887
             attachList.add(caseAttach);
468 888
             if (fileUrl.contains("仲裁申请书")) {
469 889
                 MsCaseAttach applyFile = new MsCaseAttach();
470 890
                 BeanUtil.copyProperties(caseAttach, applyFile);
471
-                applyFile.setAnnexType(1);
891
+                applyFile.setAnnexType(AnnexTypeEnum.APPLICATION.getCode());
472 892
                 attachList.add(applyFile);
473 893
             }
474 894
 

+ 332
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/MsCasePaymentServiceImpl.java Целия файл

@@ -0,0 +1,332 @@
1
+package com.ruoyi.wisdomarbitrate.service.mscase.impl;
2
+
3
+
4
+import cn.hutool.core.collection.CollectionUtil;
5
+import cn.hutool.core.util.StrUtil;
6
+import cn.hutool.json.JSONObject;
7
+import com.ruoyi.ElegentPay;
8
+import com.ruoyi.common.core.domain.AjaxResult;
9
+import com.ruoyi.common.enums.AnnexTypeEnum;
10
+import com.ruoyi.common.enums.PaymentStatusEnum;
11
+import com.ruoyi.common.enums.YesOrNoEnum;
12
+import com.ruoyi.dto.PayRequest;
13
+import com.ruoyi.dto.PayResponse;
14
+import com.ruoyi.system.domain.entity.flow.MsCaseFlow;
15
+import com.ruoyi.system.mapper.flow.MsCaseFlowMapper;
16
+import com.ruoyi.wisdomarbitrate.domain.dto.mscase.CaseConfirmPayDTO;
17
+import com.ruoyi.wisdomarbitrate.domain.dto.mscase.CasePayDTO;
18
+import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAffiliate;
19
+import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseApplication;
20
+import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAttach;
21
+import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCasePaymentRecord;
22
+import com.ruoyi.wisdomarbitrate.domain.vo.mscase.PaymentDetailVO;
23
+import com.ruoyi.wisdomarbitrate.mapper.mscase.MsCaseAffiliateMapper;
24
+import com.ruoyi.wisdomarbitrate.mapper.mscase.MsCaseApplicationMapper;
25
+import com.ruoyi.wisdomarbitrate.mapper.mscase.MsCaseAttachMapper;
26
+import com.ruoyi.wisdomarbitrate.mapper.mscase.MsCasePaymentRecordMapper;
27
+import com.ruoyi.wisdomarbitrate.mapper.sendrecord.SmsRecordMapper;
28
+import com.ruoyi.wisdomarbitrate.service.mscase.MsCaseApplicationService;
29
+import com.ruoyi.wisdomarbitrate.service.mscase.MsCasePaymentService;
30
+import com.ruoyi.wisdomarbitrate.utils.CaseLogUtils;
31
+import org.springframework.beans.factory.annotation.Autowired;
32
+import org.springframework.stereotype.Service;
33
+import org.springframework.transaction.annotation.Transactional;
34
+import tk.mybatis.mapper.entity.Example;
35
+
36
+import javax.annotation.Resource;
37
+import java.math.BigDecimal;
38
+import java.util.ArrayList;
39
+import java.util.Date;
40
+import java.util.List;
41
+
42
+@Service
43
+public class MsCasePaymentServiceImpl implements MsCasePaymentService {
44
+    @Autowired
45
+    private ElegentPay elegentPay;
46
+    @Autowired
47
+    private MsCasePaymentRecordMapper casePaymentRecordMapper;
48
+    @Autowired
49
+    private MsCaseAttachMapper caseAttachMapper;
50
+    @Autowired
51
+    private MsCaseApplicationMapper caseApplicationMapper;
52
+    @Autowired
53
+    private SmsRecordMapper smsRecordMapper;
54
+    @Resource
55
+    private MsCaseApplicationService applicationService;
56
+    @Autowired
57
+    MsCaseFlowMapper caseFlowMapper;
58
+    @Autowired
59
+    MsCaseAffiliateMapper caseAffiliateMapper;
60
+
61
+
62
+    @Override
63
+    @Transactional
64
+    public AjaxResult casePay(CasePayDTO casePayDTO) {
65
+        List<MsCaseApplication> applicationList = new ArrayList<>();
66
+        PayRequest payRequest = new PayRequest();
67
+        payRequest.setBody("案件缴费");
68
+        payRequest.setOrderSn(System.currentTimeMillis() + "");
69
+        // 计算缴费总金额
70
+        int totalFee = 0;
71
+        if (StrUtil.isNotEmpty(casePayDTO.getBatchNumber())) {
72
+            // 批量缴费
73
+            applicationList = applicationService.listByBatchNumber(casePayDTO.getBatchNumber(), casePayDTO.getCaseFlowId());
74
+            if (CollectionUtil.isEmpty(applicationList)) {
75
+                return AjaxResult.error("该批号下未找到案件");
76
+            }
77
+
78
+            for (MsCaseApplication application : applicationList) {
79
+                // 应缴费用单位为元,将应缴费用转换为分即*100
80
+                if (application.getFeePayable() != null) {
81
+                    totalFee += ((application.getFeePayable().multiply(new BigDecimal("100")))).intValue();
82
+                }
83
+            }
84
+        } else {
85
+            MsCaseApplication application = caseApplicationMapper.selectByPrimaryKey(casePayDTO.getCaseId());
86
+            if (application == null) {
87
+                return AjaxResult.error("该案件不存在");
88
+            }
89
+            applicationList.add(application);
90
+            totalFee += ((application.getFeePayable().multiply(new BigDecimal("100")))).intValue();
91
+        }
92
+        // 单位分
93
+        payRequest.setTotalFee(totalFee);
94
+        PayResponse response = elegentPay.requestPay(payRequest, casePayDTO.getTradeType(), casePayDTO.getPlatform());
95
+        if (response.getCode_url() == null) {
96
+            return AjaxResult.error();
97
+        }
98
+        for (MsCaseApplication application : applicationList) {
99
+            //缴费记录表里新增数据
100
+            MsCasePaymentRecord casePaymentRecord = new MsCasePaymentRecord();
101
+            casePaymentRecord.setCaseId(application.getId());
102
+            casePaymentRecord.setOrderNumber(payRequest.getOrderSn());
103
+            casePaymentRecord.setPaymentStatus(PaymentStatusEnum.UNPAID.getCode());
104
+            casePaymentRecord.setCreateTime(new Date());
105
+            casePaymentRecordMapper.insert(casePaymentRecord);
106
+
107
+        }
108
+        return AjaxResult.success(response);
109
+    }
110
+
111
+    /**
112
+     * 支付回调
113
+     *
114
+     * @param orderNumber
115
+     * @return
116
+     */
117
+    @Transactional
118
+    public AjaxResult callback(String orderNumber) {
119
+        //查询记录
120
+        Example casePayExample = new Example(MsCasePaymentRecord.class);
121
+        casePayExample.createCriteria().andEqualTo("order_number", orderNumber);
122
+        List<MsCasePaymentRecord> casePaymentRecords = casePaymentRecordMapper.selectByExample(orderNumber);
123
+        if (casePaymentRecords != null && casePaymentRecords.size() > 0) {
124
+            for (MsCasePaymentRecord casePaymentRecord : casePaymentRecords) {
125
+                //更改记录表里的支付状态和支付时间
126
+                casePaymentRecord.setPaymentStatus(1);
127
+                casePaymentRecord.setPaymentTime(new Date());
128
+                casePaymentRecord.setUpdateTime(new Date());
129
+                casePaymentRecordMapper.updateByPrimaryKeySelective(casePaymentRecord);
130
+            }
131
+        } else {
132
+            return AjaxResult.error("未查询到相关记录");
133
+        }
134
+        return AjaxResult.success("支付成功");
135
+    }
136
+
137
+    /**
138
+     * 确认缴费
139
+     *
140
+     * @param dto
141
+     * @return
142
+     */
143
+    @Transactional
144
+    @Override
145
+    public AjaxResult confirmPayment(CaseConfirmPayDTO dto) {
146
+        // 根据流程id查找下一个流程节点
147
+        MsCaseFlow nextFlow = caseFlowMapper.nextFlow(dto.getCaseFlowId());
148
+        if (nextFlow == null) {
149
+            return AjaxResult.error("未找到下一个流程节点");
150
+        }
151
+        if (StrUtil.isNotEmpty(dto.getBatchNumber())) {
152
+            // 批量操作
153
+            // 查询该批号下该流程的案件
154
+            List<MsCaseApplication> applicationList = applicationService.listByBatchNumber(dto.getBatchNumber(), dto.getCaseFlowId());
155
+            if (CollectionUtil.isEmpty(applicationList)) {
156
+                return AjaxResult.error("该批号下未找到案件");
157
+            }
158
+            for (MsCaseApplication application : applicationList) {
159
+                confirmPayment(nextFlow, application, dto);
160
+
161
+            }
162
+        } else {
163
+            // 单独
164
+            MsCaseApplication application = new MsCaseApplication();
165
+            application.setId(dto.getCaseId());
166
+            application.setLockStatus(YesOrNoEnum.YES.getCode());
167
+            confirmPayment(nextFlow, application, dto);
168
+
169
+        }
170
+        return AjaxResult.success("确认缴费成功");
171
+
172
+    }
173
+
174
+    /**
175
+     * 查询应缴费用和申请人
176
+     *
177
+     * @param casePayDTO
178
+     * @return
179
+     */
180
+    @Override
181
+    public AjaxResult selectTotalFee(CasePayDTO casePayDTO) {
182
+
183
+        Long caseId = null;
184
+        // 计算缴费总金额
185
+        int totalFee = 0;
186
+        if (StrUtil.isNotEmpty(casePayDTO.getBatchNumber())) {
187
+            // 批量缴费
188
+            List<MsCaseApplication> applicationList = applicationService.listByBatchNumber(casePayDTO.getBatchNumber(), casePayDTO.getCaseFlowId());
189
+            if (CollectionUtil.isEmpty(applicationList)) {
190
+                return AjaxResult.error("该批号下未找到案件");
191
+            }
192
+            caseId = applicationList.get(0).getId();
193
+            for (MsCaseApplication application : applicationList) {
194
+                // 应缴费用单位为元,将应缴费用转换为分即*100
195
+                if (application.getFeePayable() != null) {
196
+                    totalFee += ((application.getFeePayable().multiply(new BigDecimal("100")))).intValue();
197
+                }
198
+            }
199
+
200
+        } else {
201
+            MsCaseApplication  resultApplication = caseApplicationMapper.selectByPrimaryKey(casePayDTO.getCaseId());
202
+            if (resultApplication == null) {
203
+                return AjaxResult.error("该案件不存在");
204
+            }
205
+            caseId = resultApplication.getId();
206
+            totalFee += ((resultApplication.getFeePayable().multiply(new BigDecimal("100")))).intValue();
207
+
208
+        }
209
+        // 根据caseId查询申请人
210
+        MsCaseAffiliate affiliate = caseAffiliateMapper.selectByPrimaryKey(caseId);
211
+        if (affiliate == null) {
212
+            return AjaxResult.error("该案件不存在");
213
+        }
214
+        JSONObject jsonObject = new JSONObject();
215
+        jsonObject.set("totalFee", totalFee);
216
+        jsonObject.set("applicationOrganName", affiliate.getApplicationOrganName());
217
+        return AjaxResult.success(jsonObject);
218
+    }
219
+
220
+    /**
221
+     * 根据案件id查询缴费单
222
+     *
223
+     * @param id
224
+     * @return
225
+     */
226
+    @Override
227
+    public PaymentDetailVO selectPaymentDetail(Long id) {
228
+        PaymentDetailVO result = null;
229
+        MsCaseApplication application = caseApplicationMapper.selectByPrimaryKey(id);
230
+        if (application == null) {
231
+            return null;
232
+        }
233
+        result=new PaymentDetailVO();
234
+        result.setCaseNum(application.getCaseNum());
235
+        result.setCaseSubjectAmount(application.getCaseSubjectAmount());
236
+        result.setFeePayable(application.getFeePayable());
237
+        result.setCaseStatusName(application.getCaseStatusName());
238
+        MsCaseAffiliate affiliate = caseAffiliateMapper.selectByPrimaryKey(application.getId());
239
+        if(affiliate != null) {
240
+            result.setApplicationOrganName(affiliate.getApplicationOrganName());
241
+        }
242
+        // 查询缴费单
243
+        result.setCaseAttachList(caseAttachMapper.listCaseAttachByCaseIdAndType(id, AnnexTypeEnum.PAYMENT_RECEIPT.getCode()));
244
+
245
+        return result;
246
+    }
247
+
248
+    /**
249
+     * 确认已缴费
250
+     * @param dto
251
+     * @return
252
+     */
253
+    @Transactional
254
+    @Override
255
+    public AjaxResult confirmPaid(CaseConfirmPayDTO dto) {
256
+        // 根据流程id查找下一个流程节点
257
+        MsCaseFlow nextFlow = caseFlowMapper.nextFlow(dto.getCaseFlowId());
258
+        if (nextFlow == null) {
259
+            return AjaxResult.error("未找到下一个流程节点");
260
+        }
261
+
262
+        if (StrUtil.isNotEmpty(dto.getBatchNumber())) {
263
+            // 批量
264
+            List<MsCaseApplication> applicationList = applicationService.listByBatchNumber(dto.getBatchNumber(), dto.getCaseFlowId());
265
+            if(CollectionUtil.isEmpty(applicationList)){
266
+                return AjaxResult.error("该批号下未找到案件");
267
+            }
268
+            for (MsCaseApplication application : applicationList) {
269
+                confirmPaid(nextFlow, application);
270
+            }
271
+        }else {
272
+            MsCaseApplication caseApplication=new MsCaseApplication();
273
+            caseApplication.setId(dto.getCaseId());
274
+            caseApplication.setLockStatus(YesOrNoEnum.YES.getCode());
275
+            confirmPaid(nextFlow,caseApplication );
276
+        }
277
+
278
+
279
+        return AjaxResult.success("确认缴费成功");
280
+    }
281
+
282
+    /**
283
+     * 确认已缴费
284
+     * @param nextFlow
285
+     * @param application
286
+     * @param
287
+     */
288
+    private void confirmPaid(MsCaseFlow nextFlow, MsCaseApplication application) {
289
+        //更改记录表里的支付状态和支付时间
290
+        MsCasePaymentRecord casePaymentRecord = new MsCasePaymentRecord();
291
+        casePaymentRecord.setPaymentStatus(1);
292
+        casePaymentRecord.setCaseId(application.getId());
293
+        casePaymentRecord.setPaymentTime(new Date());
294
+        casePaymentRecord.setUpdateTime(new Date());
295
+        Example example = new Example(MsCasePaymentRecord.class);
296
+        example.createCriteria().andEqualTo("caseId", casePaymentRecord.getCaseId());
297
+        casePaymentRecordMapper.updateByExampleSelective(casePaymentRecord,example);
298
+        // 更改案件流程id和案件状态
299
+        application.setCaseFlowId(nextFlow.getId());
300
+        application.setCaseStatusName(nextFlow.getCaseStatusName());
301
+        caseApplicationMapper.updateByPrimaryKeySelective(application);
302
+        // 新增日志
303
+        CaseLogUtils.insertCaseLog(application.getId(), nextFlow.getNodeId(), nextFlow.getCaseStatusName(),"确认已缴费");
304
+
305
+    }
306
+
307
+    /**
308
+     * 确认缴费
309
+     *
310
+     * @param nextFlow
311
+     * @param application
312
+     * @param dto
313
+     */
314
+
315
+    private void confirmPayment(MsCaseFlow nextFlow, MsCaseApplication application, CaseConfirmPayDTO dto) {
316
+        application.setPayType(dto.getPayType());
317
+        // 修改缴费附件
318
+        if (CollectionUtil.isNotEmpty(dto.getPayOrderList())) {
319
+            for (MsCaseAttach caseAttach : dto.getPayOrderList()) {
320
+                caseAttach.setCaseAppliId(application.getId());
321
+                caseAttachMapper.updateCaseAttach(caseAttach);
322
+            }
323
+        }
324
+        // 修改支付方式,流程节点和案件状态名称
325
+        application.setCaseFlowId(nextFlow.getId());
326
+        application.setCaseStatusName(nextFlow.getCaseStatusName());
327
+        caseApplicationMapper.updateByPrimaryKeySelective(application);
328
+        CaseLogUtils.insertCaseLog(application.getId(), nextFlow.getNodeId(), nextFlow.getCaseStatusName(),"确认缴费");
329
+    }
330
+
331
+
332
+}

+ 9
- 2
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/mscase/MsCaseAttachMapper.xml Целия файл

@@ -49,7 +49,7 @@
49 49
         where case_appli_id =#{id}
50 50
     </select>
51 51
 
52
-    <select id="getCaseAttachByCaseIdAndType" resultType="com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAttach" resultMap="CaseAttachResult">
52
+    <select id="listCaseAttachByCaseIdAndType" resultType="com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAttach" resultMap="CaseAttachResult">
53 53
         select annex_id,case_appli_id,annex_name,annex_path,annex_type,note,use_id,use_account
54 54
         from ms_case_attach
55 55
         <where>
@@ -102,7 +102,15 @@
102 102
         case_appli_id= #{caseAppliId}
103 103
         where annex_id = #{annexId}
104 104
     </update>
105
+    <update id="batchUpdate">
106
+        <foreach collection="list" item="item" >
107
+            update ms_case_attach
108
+            set
109
+            case_appli_id= #{item.caseAppliId}
105 110
 
111
+            where annex_id = #{item.annexId};
112
+        </foreach>
113
+    </update>
106 114
     <update id="updateCaseAttachBycaseid" parameterType="com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAttach" >
107 115
         update ms_case_attach
108 116
         <set>
@@ -120,5 +128,4 @@
120 128
     </update>
121 129
 
122 130
 
123
-
124 131
 </mapper>

+ 17
- 0
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/mscase/MsCasePaymentRecordMapper.xml Целия файл

@@ -0,0 +1,17 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3
+<mapper namespace="com.ruoyi.wisdomarbitrate.mapper.mscase.MsCasePaymentRecordMapper">
4
+  <resultMap id="BaseResultMap" type="com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCasePaymentRecord">
5
+    <!--
6
+      WARNING - @mbg.generated
7
+    -->
8
+    <id column="id" jdbcType="BIGINT" property="id" />
9
+    <result column="case_id" jdbcType="BIGINT" property="caseId" />
10
+    <result column="order_number" jdbcType="VARCHAR" property="orderNumber" />
11
+    <result column="payment_time" jdbcType="TIMESTAMP" property="paymentTime" />
12
+    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
13
+    <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
14
+    <result column="payment_status" jdbcType="INTEGER" property="paymentStatus" />
15
+    <result column="pay_type" jdbcType="INTEGER" property="payType" />
16
+  </resultMap>
17
+</mapper>

+ 3
- 3
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/sendrecord/SmsRecordMapper.xml Целия файл

@@ -19,7 +19,7 @@
19 19
     </resultMap>
20 20
     <insert id="saveSmsSendRecord" parameterType="com.ruoyi.wisdomarbitrate.domain.dto.sendrecord.SmsSendRecord" useGeneratedKeys="true" keyProperty="id">
21 21
 
22
-        insert into sms_send_record(
22
+        insert into ms_sms_send_record(
23 23
         <if test="caseId != null ">case_appli_id,</if>
24 24
         <if test="caseNum != null ">case_num,</if>
25 25
         <if test="phone != null and phone != ''">phone,</if>
@@ -41,7 +41,7 @@
41 41
     </insert>
42 42
     <insert id="batchSaveSmsSendRecord">
43 43
 
44
-        insert into sms_send_record(
44
+        insert into ms_sms_send_record(
45 45
        case_appli_id,
46 46
        case_num,
47 47
        phone,
@@ -68,7 +68,7 @@
68 68
     <select id="getSmsSendRecord" parameterType="com.ruoyi.wisdomarbitrate.domain.dto.sendrecord.SmsSendRecord" resultMap="SmsSendRecordResult">
69 69
 
70 70
         select id ,case_appli_id ,case_num ,phone ,send_time ,send_content,send_status
71
-        from sms_send_record
71
+        from ms_sms_send_record
72 72
         <where>
73 73
             <if test="caseNum != null and caseNum != ''">
74 74
                 AND case_num = #{caseNum}

+ 3
- 0
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/template/TemplateManageMapper.xml Целия файл

@@ -82,4 +82,7 @@
82 82
         ORDER BY create_time DESC
83 83
     </select>
84 84
 
85
+    <select id="selectById" resultMap="TemplateManageResult">
86
+        select * from ms_template_manage where id=#{id}
87
+    </select>
85 88
 </mapper>