Преглед на файлове

Merge branch 'dev' of SH-Arbitrate/Mediation-Backend into prod

wangqiong123 преди 2 години
родител
ревизия
8e8b402ced
променени са 26 файла, в които са добавени 329 реда и са изтрити 241 реда
  1. 1
    1
      pay/src/main/java/com/ruoyi/wx/WxPayElegentTrade.java
  2. 9
    1
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/mscase/MsVideoConferenceController.java
  3. 10
    8
      ruoyi-admin/src/main/resources/application.yml
  4. 5
    1
      ruoyi-common/src/main/java/com/ruoyi/common/core/controller/BaseController.java
  5. 1
    0
      ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java
  6. 1
    1
      ruoyi-system/src/main/java/com/ruoyi/system/service/MsRequestLogService.java
  7. 1
    1
      ruoyi-system/src/main/java/com/ruoyi/system/service/impl/MsRequestLogServiceImpl.java
  8. 4
    1
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/dto/sendrecord/SendMailRecord.java
  9. 1
    1
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/mscase/MsCaseAffiliateParent.java
  10. 4
    1
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/mscase/MsCaseApplicationReq.java
  11. 12
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/mscase/MsCaseApplicationVO.java
  12. 7
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/mscase/MsCaseAttachMapper.java
  13. 0
    1
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/miniprogress/impl/IdentityAuthenticationServiceImpl.java
  14. 5
    3
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/MsCaseApplicationService.java
  15. 88
    35
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/MsCaseApplicationServiceImpl.java
  16. 67
    153
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/MsSignSealServiceImpl.java
  17. 10
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/VideoConferenceServiceImpl.java
  18. 38
    4
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/sendrecord/impl/SendMailRecordServiceImpl.java
  19. 1
    1
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/sms/SMSTemplateService.java
  20. 2
    2
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/sms/impl/SMSTemplateServiceImpl.java
  21. 1
    1
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/FixSelectFlowDetailUtils.java
  22. 5
    0
      ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml
  23. 1
    1
      ruoyi-system/src/main/resources/mapper/wisdomarbitrate/mscase/MsCaseAffiliateMapper.xml
  24. 45
    21
      ruoyi-system/src/main/resources/mapper/wisdomarbitrate/mscase/MsCaseApplicationMapper.xml
  25. 8
    1
      ruoyi-system/src/main/resources/mapper/wisdomarbitrate/mscase/MsCaseAttachMapper.xml
  26. 2
    2
      ruoyi-system/src/main/resources/mapper/wisdomarbitrate/sendrecord/SendMailRecordMapper.xml

+ 1
- 1
pay/src/main/java/com/ruoyi/wx/WxPayElegentTrade.java Целия файл

@@ -391,7 +391,7 @@ public class WxPayElegentTrade implements ElegentTrade {
391 391
     private CloseableHttpClient getWxHttpClient() {
392 392
         try {
393 393
             //这里对秘钥进行加密使用的完全是官网上的代码
394
-            //TODO 参考官网代码 https://pay.weixin.qq.com/wiki/doc/apiv3/open/pay/chapter2_6_2.shtml
394
+            // 参考官网代码 https://pay.weixin.qq.com/wiki/doc/apiv3/open/pay/chapter2_6_2.shtml
395 395
             // 加载商户私钥(privateKey:私钥字符串)
396 396
             String key = FileUtil.readToStr("wxpay_private.key");
397 397
 

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

@@ -71,6 +71,7 @@ public class MsVideoConferenceController extends BaseController {
71 71
             // 上传文件路径
72 72
             String filePath = RuoYiConfig.getUploadPath();
73 73
             // 上传并返回新文件名称
74
+
74 75
             String fileName = FileUploadUtils.upload(filePath, file);
75 76
             String suffix = getFileExtension(fileName);
76 77
             if(StrUtil.isNotEmpty(suffix)&& suffix.contains("doc")){
@@ -110,7 +111,7 @@ public class MsVideoConferenceController extends BaseController {
110 111
                     AjaxResult ajax = AjaxResult.success();
111 112
                     ajax.put("annexId", caseAttach.getAnnexId());
112 113
                     ajax.put("annexType", annexType);
113
-               //     ajax.put("url", url);
114
+                    ajax.put("onlyOfficeFileId", caseAttach.getOnlyOfficeFileId());
114 115
                     ajax.put("fileName", fileName);
115 116
                     ajax.put("newFileName", FileUtils.getName(fileName));
116 117
                     ajax.put("originalFilename", file.getOriginalFilename());
@@ -174,6 +175,13 @@ public class MsVideoConferenceController extends BaseController {
174 175
         }
175 176
         return success();
176 177
     }
178
+
179
+    /**
180
+     * 腾讯云短信回调
181
+     * @param body
182
+     * @param request
183
+     * @return
184
+     */
177 185
     @Anonymous
178 186
     @PostMapping("/smsRollBack")
179 187
     public AjaxResult smsRollBack(   @RequestBody String body, HttpServletRequest request) {

+ 10
- 8
ruoyi-admin/src/main/resources/application.yml Целия файл

@@ -72,7 +72,7 @@ spring:
72 72
     host: 121.40.189.20
73 73
     # 端口,默认为6379
74 74
     port: 6389
75
-    # 数据库索引,测试环境1,正式环境0
75
+    # TODO 数据库索引,测试环境1,正式环境0
76 76
     database: 1
77 77
     # 密码
78 78
     password:
@@ -131,8 +131,8 @@ mybatis:
131 131
   mapperLocations: classpath*:mapper/**/*Mapper.xml
132 132
   # 加载全局的配置文件
133 133
   configLocation: classpath:mybatis/mybatis-config.xml
134
-#  configuration:
135
-#    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
134
+  configuration:
135
+    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
136 136
 # PageHelper分页插件
137 137
 pagehelper:
138 138
   helperDialect: mysql
@@ -166,7 +166,8 @@ elegent:
166 166
     alipay:
167 167
       appId: 2021003141676135
168 168
     callback:
169
-      domain: http://121.40.189.20:9001/
169
+#      TODO
170
+      domain: http://121.40.189.20:7001/
170 171
       watch: true
171 172
       cycle: 10
172 173
 identityAuthentication:
@@ -187,14 +188,15 @@ imConfig:
187 188
   secretId: AKID3xfHgroY4MQHvLXUXMwIQL1UjmbBX1Tv
188 189
   # 腾讯云密钥
189 190
   secretKey: INDrIXcT8YmomZBcsy0oNirnU0LTN4X7
190
-# 调解机构代码配置
191
+# TODO 调解机构代码配置
191 192
 organizeConfig:
192 193
   # creditCode
193
-  creditCode: 910000058386410047
194
-#  引入仲裁系统url配置
194
+  creditCode: 910000870060480009
195
+#  TODO 引入仲裁系统url配置
195 196
 arbitrateConfig:
196 197
   url: http://121.40.189.20:9001/callArbitrateCaseApplication/generateCaseApplication
197
-# 回调通知
198
+  smsURL: http://121.40.189.20:9001/callArbitrateCaseApplication/sendSms
199
+# TODO 回调通知
198 200
 signSealCallbackConfig:
199 201
   url: http://121.40.189.20:7001/mssignSeal/signSeaalCaseApplicaCallback
200 202
 #  onlyOffice系统url配置

+ 5
- 1
ruoyi-common/src/main/java/com/ruoyi/common/core/controller/BaseController.java Целия файл

@@ -19,6 +19,7 @@ import org.springframework.web.bind.WebDataBinder;
19 19
 import org.springframework.web.bind.annotation.InitBinder;
20 20
 
21 21
 import java.beans.PropertyEditorSupport;
22
+import java.util.ArrayList;
22 23
 import java.util.Date;
23 24
 import java.util.List;
24 25
 
@@ -83,6 +84,9 @@ public class BaseController
83 84
     @SuppressWarnings({ "rawtypes", "unchecked" })
84 85
     protected TableDataInfo getDataTable(List<?> list)
85 86
     {
87
+        if(list == null){
88
+            list=new ArrayList<>();
89
+        }
86 90
         TableDataInfo rspData = new TableDataInfo();
87 91
         rspData.setCode(HttpStatus.SUCCESS);
88 92
         rspData.setMsg("查询成功");
@@ -112,7 +116,7 @@ public class BaseController
112 116
      */
113 117
     public AjaxResult success(String message)
114 118
     {
115
-        return AjaxResult.success(message);
119
+        return AjaxResult .success(message);
116 120
     }
117 121
     
118 122
     /**

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

@@ -143,6 +143,7 @@ public interface SysUserMapper
143 143
      * @return
144 144
      */
145 145
     SysUser selectUserByIdCard(@Param("idCard")String identityNo);
146
+    SysUser selectUserByPhone(@Param("phonenumber")String phonenumber);
146 147
     /**
147 148
      * 根据邮箱查询用户信息
148 149
      * @param email

+ 1
- 1
ruoyi-system/src/main/java/com/ruoyi/system/service/MsRequestLogService.java Целия файл

@@ -4,7 +4,7 @@ import com.ruoyi.system.domain.entity.log.MsRequestLog;
4 4
 
5 5
 /**
6 6
  * @Classname MsRequestLogService
7
- * @Description TODO
7
+ * @Description
8 8
  * @Version 1.0.0
9 9
  * @Date 2024/4/2 14:18
10 10
  * @Created wangqiong

+ 1
- 1
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/MsRequestLogServiceImpl.java Целия файл

@@ -10,7 +10,7 @@ import org.springframework.transaction.annotation.Transactional;
10 10
 
11 11
 /**
12 12
  * @Classname MsRequestLogServiceImpl
13
- * @Description TODO
13
+ * @Description
14 14
  * @Version 1.0.0
15 15
  * @Date 2024/4/2 14:19
16 16
  * @Created wangqiong

+ 4
- 1
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/dto/sendrecord/SendMailRecord.java Целия файл

@@ -1,11 +1,13 @@
1 1
 package com.ruoyi.wisdomarbitrate.domain.dto.sendrecord;
2 2
 
3 3
 import com.fasterxml.jackson.annotation.JsonFormat;
4
-import com.ruoyi.common.annotation.Excel;
5 4
 import com.ruoyi.common.core.domain.BaseEntity;
5
+import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAttach;
6 6
 import lombok.Data;
7 7
 
8 8
 import java.util.Date;
9
+import java.util.List;
10
+
9 11
 @Data
10 12
 public class SendMailRecord   extends BaseEntity {
11 13
     private static final long serialVersionUID = 1L;
@@ -49,6 +51,7 @@ public class SendMailRecord   extends BaseEntity {
49 51
 
50 52
     /** 邮件发件人地址 */
51 53
     private String mailFromAddress;
54
+    private List<MsCaseAttach> caseAttachList;
52 55
 
53 56
 
54 57
     public Integer getSendStatus() {

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

@@ -2,7 +2,7 @@ package com.ruoyi.wisdomarbitrate.domain.vo.mscase;
2 2
 
3 3
 /**
4 4
  * @Classname MsCaseAffiliateParent
5
- * @Description TODO
5
+ * @Description
6 6
  * @Version 1.0.0
7 7
  * @Date 2024/3/27 16:05
8 8
  * @Created wangqiong

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

@@ -115,6 +115,10 @@ public class MsCaseApplicationReq {
115 115
      * 申请人邮箱
116 116
      */
117 117
     private String email;
118
+    /**
119
+     * 创建人
120
+     */
121
+    private String createBy;
118 122
     /**
119 123
      * 角色类别
120 124
      */
@@ -127,6 +131,5 @@ public class MsCaseApplicationReq {
127 131
     /**
128 132
      * 是否需要用印,0-不需要,1-需要
129 133
      */
130
-    // todo 等会放开
131 134
     private Integer sealFlag=1;
132 135
 }

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

@@ -29,6 +29,10 @@ public class MsCaseApplicationVO extends MsCaseApplication {
29 29
      * 被申请人姓名
30 30
      */
31 31
     private String respondentName;
32
+    /**
33
+     * 创建者
34
+     */
35
+    private String creatBy;
32 36
 
33 37
     /**
34 38
      * 案件相关人员
@@ -95,6 +99,14 @@ public class MsCaseApplicationVO extends MsCaseApplication {
95 99
      * 是否财务,部门长,秘书,0-否,1-是
96 100
      */
97 101
     private Integer otherFlag;
102
+    /**
103
+     * 第三方代理人,0-否,1-是
104
+     */
105
+    private Integer agentFlag;
106
+    /**
107
+     * 调解员,0-否,1-是
108
+     */
109
+    private Integer mediatorFlag;
98 110
     /**
99 111
      * 调解书上传下载按钮权限,调解员,顾问在调节之后,送达之前显示,0-否,1-是
100 112
      */

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

@@ -50,4 +50,11 @@ public interface MsCaseAttachMapper {
50 50
      * @return
51 51
      */
52 52
     int countByfileName(@Param("annexName") String fileName,@Param("caseAppliId") Long caseAppliId);
53
+
54
+    /**
55
+     * 根据ids查询
56
+     * @param fileIds
57
+     * @return
58
+     */
59
+    List<MsCaseAttach> selectByIds(@Param("ids") List<String> fileIds);
53 60
 }

+ 0
- 1
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/miniprogress/impl/IdentityAuthenticationServiceImpl.java Целия файл

@@ -232,7 +232,6 @@ public class IdentityAuthenticationServiceImpl implements IdentityAuthentication
232 232
 
233 233
     @Override
234 234
     public AjaxResult selectPCEIDtokenStatus(String eidToken) {
235
-        // todo 送达时需要判断是否有pdf版的调解书,没有则不送达,签名完后下载pdf时不删除之前的doc调解书,上传调解书时,pdf的需要将类型设为13,异步发送短信邮件时将登录用户传参过来
236 235
         // todo E证通审核过后将PC端的机器id在YML文件中改掉
237 236
         JSONObject objJSON = null;
238 237
         IdentityAuthentication authentication = new IdentityAuthentication();

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

@@ -57,15 +57,17 @@ public interface MsCaseApplicationService {
57 57
      * @param affiliate
58 58
      * @param groupOrder 组别
59 59
      * @param operatorCount 操作人数量
60
+     * @param updateFlag 是否修改案件
60 61
      */
61
-    public int setCaseAfflicate(MsCaseApplicationVO caseApplication, MsCaseAffiliate affiliate,int groupOrder,int operatorCount);
62
+    public int setCaseAfflicate(MsCaseApplicationVO caseApplication, MsCaseAffiliate affiliate,int groupOrder,int operatorCount,boolean updateFlag);
62 63
     /**
63 64
      * 新增案件相关人员信息
64 65
      * @param affiliate 相关人员信息
65
-     * @param roleId 角色id
66
+     * @param roleIdList 角色id
67
+     * @param updateFlag 是否修改案件
66 68
 
67 69
      */
68
-    public void insertAfficateUser(MsCaseAffiliate affiliate,  List<Long> roleIdList);
70
+    public void insertAfficateUser(MsCaseAffiliate affiliate,  List<Long> roleIdList,boolean updateFlag);
69 71
 
70 72
     /**
71 73
      * 新增案件

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

@@ -211,7 +211,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
211 211
             startPage();
212 212
             List<MsCaseApplicationVO> list = msCaseApplicationMapper.list(req, null,null);
213 213
             // 设置申请人被申请人及签名按钮限
214
-            setAfflicate(new HashMap<>(),list,loginUser.getUserId(),roles);
214
+            setAfflicate(new HashMap<>(),list,loginUser,roles,false);
215 215
             return list;
216 216
         }
217 217
         if(CollectionUtil.isEmpty(roles) ){
@@ -238,6 +238,8 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
238 238
 
239 239
         // 是否查询所有
240 240
         boolean isSelectAll = false;
241
+        // 是否嗲三方代理人
242
+        boolean agentFlag = false;
241 243
 
242 244
         for (SysRole role : roles) {
243 245
             if(StrUtil.isNotEmpty(role.getRoleName())){
@@ -251,6 +253,10 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
251 253
                 if(StrUtil.equals(role.getRoleName(),"调解员")) {
252 254
                     req.setMediatorId(String.valueOf(sysUser.getUserId()));
253 255
                 }
256
+                if(StrUtil.contains(role.getRoleName(),"代理")) {
257
+                    req.setCreateBy(String.valueOf(sysUser.getUserName()));
258
+                    agentFlag=true;
259
+                }
254 260
             }
255 261
         }
256 262
         if(!isSelectAll){
@@ -265,7 +271,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
265 271
         // 查询案件列表
266 272
         List<MsCaseApplicationVO> list = msCaseApplicationMapper.list(req, caseFlowIds,roleIds);
267 273
         // 设置申请人被申请人及签名按钮限
268
-        setAfflicate(flowNameMap,list,loginUser.getUserId(),roles);
274
+        setAfflicate(flowNameMap,list,loginUser,roles,agentFlag);
269 275
         return list;
270 276
     }
271 277
 
@@ -273,9 +279,9 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
273 279
      * 设置申请人被申请人及签名按钮限
274 280
      * @param
275 281
      * @param list
276
-     * @param loginUserId 当前登录用户id
282
+     * @param loginUser 当前登录用户
277 283
      */
278
-    private void setAfflicate( Map<String, Integer> flowNameMap,List<MsCaseApplicationVO> list,Long loginUserId, List<SysRole> roles ) {
284
+    private void setAfflicate( Map<String, Integer> flowNameMap,List<MsCaseApplicationVO> list,LoginUser loginUser, List<SysRole> roles , boolean agentFlag) {
279 285
         if(CollectionUtil.isEmpty(list)){
280 286
             return;
281 287
         }
@@ -294,8 +300,26 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
294 300
         }
295 301
 
296 302
         for (MsCaseApplicationVO vo : list) {
297
-            if(vo.getMediatorId()!=null&&vo.getMediatorId().equals(loginUserId)){
303
+            if(vo.getMediatorId()!=null&&vo.getMediatorId().equals(loginUser.getUserId())){
298 304
                 isMediatorRole=true;
305
+                vo.setMediatorFlag(1);
306
+            }else {
307
+                vo.setMediatorFlag(0);
308
+            }
309
+            // 第三方代理人标志
310
+            if(StrUtil.isNotEmpty(vo.getCreatBy())){
311
+                if(StrUtil.isEmpty(loginUser.getUsername())){
312
+                    vo.setAgentFlag(0);
313
+                }else {
314
+                    // todo 如果案件流程id变了需要改
315
+                    if(StrUtil.equals(loginUser.getUsername(),vo.getCreatBy()) && agentFlag && vo.getCaseFlowId()!=null && mediatorSort!=null && vo.getCaseFlowId()<mediatorSort){
316
+                        vo.setAgentFlag(1);
317
+                    }else {
318
+                        vo.setAgentFlag(0);
319
+                    }
320
+                }
321
+            }else {
322
+                vo.setAgentFlag(0);
299 323
             }
300 324
             // 设置申请人和被申请人
301 325
             if(affiliateMap!=null && affiliateMap.containsKey(vo.getId())){
@@ -308,34 +332,34 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
308 332
                         if (affiliate.getUserId()!=null && affiliate.getRoleType() != null && affiliate.getOperatorFlag() != null && affiliate.getOperatorFlag() == 1) {
309 333
                             if (vo.getAppOperatorFlag() == null && (affiliate.getRoleType() == 1 || affiliate.getRoleType() == 2)) {
310 334
                                 // 申请人操作人
311
-                                if(affiliate.getUserId().equals(loginUserId) &&!vo.getCaseStatusName().equals("待签名")){
335
+                                if(affiliate.getUserId().equals(loginUser.getUserId()) &&!vo.getCaseStatusName().equals("待签名")){
312 336
                                     vo.setAppOperatorFlag(1);
313 337
                                 }else if(vo.getCaseStatusName().equals("待签名")) {
314
-                                    if(affiliate.getUserId().equals(loginUserId)){
338
+                                    if(affiliate.getUserId().equals(loginUser.getUserId())){
315 339
                                         vo.setAppOperatorFlag(1);
316 340
                                     }else {
317 341
                                         vo.setAppOperatorFlag(0);
318 342
                                     }
319 343
                                 }
320 344
                                 // 签收按钮权限
321
-                                if(affiliate.getUserId().equals(loginUserId) &&vo.getCaseStatusName().equals("待申请人签收")){
345
+                                if(affiliate.getUserId().equals(loginUser.getUserId()) &&vo.getCaseStatusName().equals("待申请人签收")){
322 346
                                     vo.setSignFlag(1);
323 347
                                 }
324 348
 
325 349
                             }
326 350
                             if (vo.getResOperatorFlag() == null && (affiliate.getRoleType() == 3 || affiliate.getRoleType() == 4)) {
327 351
                                 // 被申请人操作人
328
-                                if(Objects.equals(affiliate.getUserId(), loginUserId) &&!vo.getCaseStatusName().equals("待签名")){
352
+                                if(Objects.equals(affiliate.getUserId(), loginUser.getUserId()) &&!vo.getCaseStatusName().equals("待签名")){
329 353
                                     vo.setResOperatorFlag(1);
330 354
                                 }else if(vo.getCaseStatusName().equals("待签名")) {
331
-                                    if(Objects.equals(affiliate.getUserId(), loginUserId)){
355
+                                    if(Objects.equals(affiliate.getUserId(), loginUser.getUserId())){
332 356
                                         vo.setResOperatorFlag(1);
333 357
                                     }else {
334 358
                                         vo.setResOperatorFlag(0);
335 359
                                     }
336 360
                                 }
337 361
                                 // 签收按钮权限
338
-                                if(affiliate.getUserId().equals(loginUserId) &&vo.getCaseStatusName().equals("待被申请人签收")){
362
+                                if(affiliate.getUserId().equals(loginUser.getUserId()) &&vo.getCaseStatusName().equals("待被申请人签收")){
339 363
                                     vo.setSignFlag(1);
340 364
                                 }
341 365
                             }
@@ -402,7 +426,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
402 426
                     if(StrUtil.contains(role.getRoleName(),"财务")
403 427
                             ||StrUtil.contains(role.getRoleName(),"法律顾问")
404 428
                             ||StrUtil.contains(role.getRoleName(),"部门长")
405
-                            ||StrUtil.contains(role.getRoleName(),"调解员")
429
+//                            ||StrUtil.contains(role.getRoleName(),"调解员")
406 430
                     ){
407 431
                        vo.setOtherFlag(1);
408 432
                     }
@@ -483,6 +507,9 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
483 507
             // 查询案件列表
484 508
 
485 509
             for (SysRole role : roles) {
510
+                if (StrUtil.isEmpty(role.getRoleName())) {
511
+                    continue;
512
+                }
486 513
                 if(StrUtil.contains(role.getRoleName(),"财务")
487 514
                         ||StrUtil.contains(role.getRoleName(),"法律顾问")
488 515
                         ||StrUtil.contains(role.getRoleName(),"部门长")
@@ -491,14 +518,17 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
491 518
                     roleIds=null;
492 519
 
493 520
                 }
494
-                if (StrUtil.isNotEmpty(role.getRoleName())) {
521
+
495 522
                     if (StrUtil.equals(role.getRoleName(), "调解员")) {
496 523
                         req.setMediatorId(String.valueOf(sysUser.getUserId()));
497 524
 
498 525
                     }
499
-                }
526
+                    if(StrUtil.contains(role.getRoleName(),"代理")) {
527
+                        req.setCreateBy(String.valueOf(sysUser.getUserName()));
528
+                    }
529
+
500 530
             }
501
-            // 如果多个角色中有财务,顾问,部门长,则调解员查询所有
531
+            // 如果多个角色中有财务,顾问,部门长查询所有
502 532
             if(!isSelectAll){
503 533
                 req.setUserId(loginUser.getUserId());
504 534
             }
@@ -701,17 +731,17 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
701 731
                     if(CollectionUtil.isNotEmpty(applicant)){
702 732
                         for (int i = 0; i < applicant.size(); i++) {
703 733
                             // 申请人
704
-                            appOperatorCount= setCaseAfflicate(caseApplication, applicant.get(i).getApplicant(),i,appOperatorCount);
734
+                            appOperatorCount= setCaseAfflicate(caseApplication, applicant.get(i).getApplicant(),i,appOperatorCount,false);
705 735
                             // 申请人代理人
706
-                            appOperatorCount=setCaseAfflicate(caseApplication, applicant.get(i).getApplicantAgent(),i,appOperatorCount);
736
+                            appOperatorCount=setCaseAfflicate(caseApplication, applicant.get(i).getApplicantAgent(),i,appOperatorCount,false);
707 737
                         }
708 738
                     }
709 739
                     if(CollectionUtil.isNotEmpty(res)){
710 740
                         for (int i = 0; i < res.size(); i++) {
711 741
                             // 申请人
712
-                            resOperatorCount=   setCaseAfflicate(caseApplication, res.get(i).getRes(),i,resOperatorCount);
742
+                            resOperatorCount=   setCaseAfflicate(caseApplication, res.get(i).getRes(),i,resOperatorCount,false);
713 743
                             // 申请人代理人
714
-                            resOperatorCount= setCaseAfflicate(caseApplication, res.get(i).getResAgent(),i,resOperatorCount);
744
+                            resOperatorCount= setCaseAfflicate(caseApplication, res.get(i).getResAgent(),i,resOperatorCount,false);
715 745
                         }
716 746
                     }
717 747
             if (appOperatorCount < 1 && resOperatorCount < 1) {
@@ -769,9 +799,12 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
769 799
      * 设置案件相关信息
770 800
      * @param caseApplication
771 801
      * @param affiliate
802
+     * @param groupOrder 组别
803
+     * @param operatorCount 操作人数量
804
+     * @param updateFlag 是否修改案件
772 805
      */
773 806
     @Transactional
774
-    public int setCaseAfflicate(MsCaseApplicationVO caseApplication, MsCaseAffiliate affiliate,int groupOrder,int operatorCount) {
807
+    public int setCaseAfflicate(MsCaseApplicationVO caseApplication, MsCaseAffiliate affiliate,int groupOrder,int operatorCount,boolean updateFlag) {
775 808
         if(affiliate==null){
776 809
             return operatorCount;
777 810
         }
@@ -793,8 +826,6 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
793 826
         }
794 827
         affiliate.setCaseAppliId(caseApplication.getId());
795 828
         List<Long> roleIdList = new ArrayList<>();
796
-     //   Long roleId = null;
797
-
798 829
             switch (affiliate.getRoleType()) {
799 830
                 case 1:
800 831
                     roleIdList.add((Long) applicantObj);
@@ -827,19 +858,28 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
827 858
                     }
828 859
                     break;
829 860
                 default:
830
-
831 861
                     break;
832 862
             }
833 863
         // 如果是申请人,则和用户表关联
834 864
         if (affiliate.getOrganizeFlag() == 0) {
835
-            caseApplicationService.insertAfficateUser(affiliate, roleIdList);
865
+            caseApplicationService.insertAfficateUser(affiliate, roleIdList, updateFlag);
836 866
         } else {
837 867
             // 申请机构
838 868
             if (affiliate.getRoleType() == 1 || affiliate.getRoleType()==3) {
839 869
                 affiliate.setOperatorFlag(0);
840 870
                 // 申请人,从缓存中判断部门是否存在
841
-//                Object deptCache = redisCache.getCacheObject(CacheConstants.DEPT_KEY + affiliate.getName());
842
-                SysDept dept = sysDeptMapper.selectDeptByName(affiliate.getName());
871
+                SysDept dept = null;
872
+                if(!updateFlag) {
873
+                    // 新增则根据部门名称查
874
+                    dept = sysDeptMapper.selectDeptByName(affiliate.getName());
875
+                }else {
876
+                    if(affiliate.getApplicantDeptId()!=null){
877
+                        // 修改根据部门id查
878
+                        dept = sysDeptMapper.selectDeptById(affiliate.getApplicantDeptId());
879
+                    }else {
880
+                        dept = sysDeptMapper.selectDeptByName(affiliate.getName());
881
+                    }
882
+                }
843 883
                 if (dept==null) {
844 884
                     // 不存在该部门,新增
845 885
                     dept = new SysDept();
@@ -872,7 +912,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
872 912
                 }
873 913
                 affiliate.setApplicantDeptId(dept.getDeptId());
874 914
             } else {
875
-                caseApplicationService.insertAfficateUser(affiliate, roleIdList);
915
+                caseApplicationService.insertAfficateUser(affiliate, roleIdList, updateFlag);
876 916
             }
877 917
         }
878 918
         // 保存人员
@@ -887,15 +927,27 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
887 927
      * 新增案件相关人员信息
888 928
      * @param affiliate 相关人员信息
889 929
      * @param roleIdList 角色id
930
+     * @param updateFlag 是否修改案件
890 931
 
891 932
      */
892 933
     @Transactional
893
-    public void insertAfficateUser(MsCaseAffiliate affiliate,  List<Long> roleIdList) {
934
+    public void insertAfficateUser(MsCaseAffiliate affiliate,  List<Long> roleIdList,boolean updateFlag) {
894 935
 
895 936
         if(StrUtil.isEmpty(affiliate.getEmail())){
896 937
             return;
897 938
         }
898
-        SysUser user = sysUserMapper.selectUserByEmail(affiliate.getEmail());
939
+        SysUser user=null;
940
+        if(!updateFlag) {
941
+            // 新增案件则根据邮箱查用户
942
+             user = sysUserMapper.selectUserByEmail(affiliate.getEmail());
943
+        }else {
944
+            // 修改案件则根据userId查用户
945
+            if(affiliate.getUserId()!=null) {
946
+                user = sysUserMapper.selectUserById(affiliate.getUserId());
947
+            }else {
948
+                user = sysUserMapper.selectUserByEmail(affiliate.getEmail());
949
+            }
950
+        }
899 951
         // 判断该用户是否存在
900 952
         if(user==null){
901 953
             // 不存在,则新增
@@ -1079,17 +1131,17 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
1079 1131
             if(CollectionUtil.isNotEmpty(applicant)){
1080 1132
                 for (int i = 0; i < applicant.size(); i++) {
1081 1133
                     // 申请人
1082
-                    appOperatorCount=setCaseAfflicate(caseApplication, applicant.get(i).getApplicant(),i,appOperatorCount);
1134
+                    appOperatorCount=setCaseAfflicate(caseApplication, applicant.get(i).getApplicant(),i,appOperatorCount,true);
1083 1135
                     // 申请人代理人
1084
-                    appOperatorCount= setCaseAfflicate(caseApplication, applicant.get(i).getApplicantAgent(),i,appOperatorCount);
1136
+                    appOperatorCount= setCaseAfflicate(caseApplication, applicant.get(i).getApplicantAgent(),i,appOperatorCount,true);
1085 1137
                 }
1086 1138
             }
1087 1139
             if(CollectionUtil.isNotEmpty(res)){
1088 1140
                 for (int i = 0; i < res.size(); i++) {
1089 1141
                     // 申请人
1090
-                    resOperatorCount=setCaseAfflicate(caseApplication, res.get(i).getRes(),i,resOperatorCount);
1142
+                    resOperatorCount=setCaseAfflicate(caseApplication, res.get(i).getRes(),i,resOperatorCount,true);
1091 1143
                     // 申请人代理人
1092
-                    resOperatorCount=setCaseAfflicate(caseApplication, res.get(i).getResAgent(),i,resOperatorCount);
1144
+                    resOperatorCount=setCaseAfflicate(caseApplication, res.get(i).getResAgent(),i,resOperatorCount,true);
1093 1145
                 }
1094 1146
             }
1095 1147
         if (appOperatorCount < 1 && resOperatorCount < 1) {
@@ -2442,8 +2494,8 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
2442 2494
         }
2443 2495
         application.setRejectReason(reason);
2444 2496
         if(application.getCaseFlowId()!=null && application.getCaseFlowId()==4){
2445
-            // todo 超过五日还没有受理,给申请操作人发送不受理通知,有手机号发短信,没有手机号发邮箱
2446
-            // 申请人不受理分配通知 // todo 短信异步
2497
+            //  超过五日还没有受理,给申请操作人发送不受理通知,有手机号发短信,没有手机号发邮箱
2498
+            // 申请人不受理分配通知 //  短信异步
2447 2499
             ExecutorService executor = ThreadUtil.createThreadPool();
2448 2500
             CompletableFuture.runAsync(() -> {
2449 2501
             String rejectReason = application.getRejectReason() == null ? "" : application.getRejectReason();
@@ -2566,6 +2618,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
2566 2618
         if (CollectionUtil.isEmpty(affiliates)) {
2567 2619
             throw new ServiceException("未找到案件人员");
2568 2620
         }
2621
+        //  签名时取用户为申请人角色并且是申请操作人
2569 2622
         // 申请操作人
2570 2623
         Optional<MsCaseAffiliate> applicantAffiliateOpt = affiliates.stream().filter(affiliate -> affiliate.getOperatorFlag() == 1 && StrUtil.isNotEmpty(affiliate.getPhone()) && (affiliate.getRoleType().equals(1) || affiliate.getRoleType().equals(2))).findFirst();
2571 2624
         // 被申请操作人

+ 67
- 153
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/MsSignSealServiceImpl.java Целия файл

@@ -77,6 +77,7 @@ import java.util.concurrent.ExecutorService;
77 77
 import java.util.stream.Collectors;
78 78
 
79 79
 import static com.google.common.io.Files.getFileExtension;
80
+import static com.ruoyi.common.core.domain.AjaxResult.error;
80 81
 import static com.ruoyi.common.core.domain.AjaxResult.success;
81 82
 
82 83
 @Slf4j
@@ -180,6 +181,11 @@ public class MsSignSealServiceImpl implements MsSignSealService {
180 181
 
181 182
     @Override
182 183
     public SealSignRecord selectSealUrl(MsSignSealDTO dto) throws EsignDemoException {
184
+        MsCaseApplication application = msCaseApplicationMapper.selectByPrimaryKey(dto.getCaseId());
185
+        if(application == null){
186
+            throw new ServiceException("未找到当前案件");
187
+        }
188
+
183 189
         Example example = new Example(MsSealSignRecord.class);
184 190
         Example.Criteria criteria = example.createCriteria();
185 191
         criteria.andEqualTo("caseAppliId", dto.getCaseId());
@@ -200,6 +206,23 @@ public class MsSignSealServiceImpl implements MsSignSealService {
200 206
             JsonObject signUrlData = signUrlJsonObject.getAsJsonObject("data");
201 207
             String url = signUrlData.get("shortUrl").getAsString();
202 208
             sealSignRecordReslt.setSealUrl(url);
209
+            MsCaseLogRecord operLog = new MsCaseLogRecord();
210
+            if(StrUtil.isEmpty(SecurityUtils.getUsername())){
211
+                throw new ServiceException("未获取到当前登录用户");
212
+            }
213
+            SysUser sysUser = sysUserMapper.selectUserByUserName(SecurityUtils.getUsername());
214
+            if(sysUser==null){
215
+                throw new ServiceException("未获取到当前登录用户");
216
+            }
217
+            // 新增用印日志
218
+            operLog.setCreateBy(sysUser.getUserName());
219
+            operLog.setCreateNickName(sysUser.getNickName());
220
+            operLog.setCaseStatusName(application.getCaseStatusName());
221
+            operLog.setCaseAppliId(application.getId());
222
+            operLog.setCaseNode(application.getCaseFlowId());
223
+            operLog.setCreateTime(new Date());
224
+            caseLogRecordMapper.insert(operLog);
225
+
203 226
         }
204 227
         return sealSignRecordReslt;
205 228
     }
@@ -316,23 +339,30 @@ public class MsSignSealServiceImpl implements MsSignSealService {
316 339
                 if (record.getCreateTime() != null) {
317 340
                     caseNodeTime = DateUtil.format(record.getCreateTime(), DatePattern.NORM_DATETIME_FORMATTER);
318 341
                 }
342
+
319 343
                 Integer caseNode = record.getCaseNode();
320
-                String createBy = record.getCreateBy();
321
-                if (StrUtil.isNotEmpty(createBy)) {
322
-                    contentBuilder.append(Optional.ofNullable(record.getCreateNickName()).orElse("")).append("(").append(record.getCreateBy()).append(")").append("于").append(caseNodeTime);
323
-                } else {
324
-                    contentBuilder.append(Optional.ofNullable(record.getCreateNickName()).orElse("")).append("于").append(caseNodeTime);
325
-                }
344
+                if(caseNode!=null) {
345
+                    if(caseNode.equals(17)){
346
+                        contentBuilder.append("调解案件于").append(caseNodeTime).append("结束");
347
+                    }else {
348
+                        String createBy = record.getCreateBy();
349
+                        if (StrUtil.isNotEmpty(createBy)) {
350
+                            contentBuilder.append(Optional.ofNullable(record.getCreateNickName()).orElse("")).append("(").append(record.getCreateBy()).append(")").append("于").append(caseNodeTime);
351
+                        } else {
352
+                            contentBuilder.append(Optional.ofNullable(record.getCreateNickName()).orElse("")).append("于").append(caseNodeTime);
353
+                        }
326 354
 
327
-                if (StrUtil.isNotEmpty(record.getContent())) {
328
-                    contentBuilder.append(record.getContent());
329
-                } else if (caseNode.intValue() == 0) {
330
-                    contentBuilder.append(record.getCaseStatusName());
331
-                }
332
-                if (StrUtil.isNotEmpty(record.getNotes())) {
333
-                    contentBuilder.append(",").append(record.getNotes());
355
+                        if (StrUtil.isNotEmpty(record.getContent())) {
356
+                            contentBuilder.append(record.getContent());
357
+                        } else if (caseNode.intValue() == 0) {
358
+                            contentBuilder.append(record.getCaseStatusName());
359
+                        }
360
+                        if (StrUtil.isNotEmpty(record.getNotes())) {
361
+                            contentBuilder.append(",").append(record.getNotes());
362
+                        }
363
+                    }
364
+                    record.setContent(contentBuilder.toString());
334 365
                 }
335
-                record.setContent(contentBuilder.toString());
336 366
 
337 367
             });
338 368
         }
@@ -667,11 +697,15 @@ public class MsSignSealServiceImpl implements MsSignSealService {
667 697
             JSONObject operator = jsonObjectCallback.getJSONObject("operator");
668 698
             JSONObject psnAccount = operator.getJSONObject("psnAccount");
669 699
             String accountMobile = psnAccount.getString("accountMobile");
700
+            // 根据电话查询用户名
701
+            SysUser sysUser = sysUserMapper.selectUserByPhone(accountMobile);
670 702
 
671 703
             Example msSealSignRecordExample = new Example(MsSealSignRecord.class);
672 704
             msSealSignRecordExample.createCriteria().andEqualTo("signFlowId", signFlowId);
673 705
             MsSealSignRecord sealSignRecordsel = sealSignRecordMapper.selectOneByExample(msSealSignRecordExample);
674
-
706
+            if(sealSignRecordsel==null){
707
+                return error("未找到签署流程");
708
+            }
675 709
             String pensonAccountApply = sealSignRecordsel.getPensonAccount();
676 710
             String orgnNamePsnAcc = sealSignRecordsel.getOrgnNamePsnAcc();
677 711
             String pensonAccountRes = sealSignRecordsel.getPensonAccountRes();
@@ -701,6 +735,9 @@ public class MsSignSealServiceImpl implements MsSignSealService {
701 735
                         sealSignRecordsel.setSignStatusApply(1);
702 736
                         sealSignRecordMapper.updateByPrimaryKeySelective(sealSignRecordsel);
703 737
                         MsCaseLogRecord operLog = new MsCaseLogRecord();
738
+                        if(sysUser!=null){
739
+                            operLog.setCreateBy(sysUser.getUserName());
740
+                        }
704 741
                         operLog.setCreateNickName(pensonName);
705 742
                         operLog.setCaseStatusName(caseStatusName);
706 743
                         operLog.setCaseAppliId(caseAppliId);
@@ -742,6 +779,9 @@ public class MsSignSealServiceImpl implements MsSignSealService {
742 779
                         sealSignRecordsel.setSignStatusResponse(1);
743 780
                         sealSignRecordMapper.updateByPrimaryKeySelective(sealSignRecordsel);
744 781
                         MsCaseLogRecord operLog = new MsCaseLogRecord();
782
+                        if(sysUser!=null){
783
+                            operLog.setCreateBy(sysUser.getUserName());
784
+                        }
745 785
                         operLog.setCreateNickName(pensonNameRes);
746 786
                         operLog.setCaseStatusName(caseStatusName);
747 787
                         operLog.setCaseAppliId(caseAppliId);
@@ -784,6 +824,9 @@ public class MsSignSealServiceImpl implements MsSignSealService {
784 824
                         sealSignRecordsel.setSignStatusMediator(1);
785 825
                         sealSignRecordMapper.updateByPrimaryKeySelective(sealSignRecordsel);
786 826
                         MsCaseLogRecord operLog = new MsCaseLogRecord();
827
+                        if(sysUser!=null){
828
+                            operLog.setCreateBy(sysUser.getUserName());
829
+                        }
787 830
                         operLog.setCreateNickName(pensonNameMedi);
788 831
                         operLog.setCaseStatusName(caseStatusName);
789 832
                         operLog.setCaseAppliId(caseAppliId);
@@ -826,13 +869,7 @@ public class MsSignSealServiceImpl implements MsSignSealService {
826 869
                         sealSignRecordsel.setSealStatus(1);
827 870
                         sealSignRecordsel.setSignFlowStatus(3);
828 871
                         sealSignRecordMapper.updateByPrimaryKeySelective(sealSignRecordsel);
829
-                        MsCaseLogRecord operLog = new MsCaseLogRecord();
830
-                        operLog.setCreateNickName(orgnNamePsnName);
831
-                        operLog.setCaseStatusName(caseStatusName);
832
-                        operLog.setCaseAppliId(caseAppliId);
833
-                        operLog.setCaseNode(caseNode);
834
-                        operLog.setCreateTime(dateOperate);
835
-                        caseLogRecordMapper.insert(operLog);
872
+
836 873
 
837 874
                         // 根据流程id查找下一个流程节点
838 875
                         MsCaseFlow nextFlow = caseFlowMapper.nextFlow(caseApplicationselect.getCaseFlowId());
@@ -854,6 +891,9 @@ public class MsSignSealServiceImpl implements MsSignSealService {
854 891
                         sealSignRecordsel.setSignStatusApply(1);
855 892
                         sealSignRecordMapper.updateByPrimaryKeySelective(sealSignRecordsel);
856 893
                         MsCaseLogRecord operLog = new MsCaseLogRecord();
894
+                        if(sysUser!=null){
895
+                            operLog.setCreateBy(sysUser.getUserName());
896
+                        }
857 897
                         operLog.setCreateNickName(pensonName);
858 898
                         operLog.setCaseStatusName(caseStatusName);
859 899
                         operLog.setCaseAppliId(caseAppliId);
@@ -874,77 +914,16 @@ public class MsSignSealServiceImpl implements MsSignSealService {
874 914
 
875 915
                             //下载审核完成的调解书
876 916
                             msSignSealService.downloadMediationBook(caseApplicationselect, signFlowId, gson, caseAppliId);
877
-//                            EsignHttpResponse fileDownload = SaaSAPIFileUtils.fileDownloadUrl(signFlowId);
878
-//                            JsonObject fileDownloadJsonObject = gson.fromJson(fileDownload.getBody(), JsonObject.class);
879
-//                            JsonObject fileDownloadData = fileDownloadJsonObject.getAsJsonObject("data");
880
-//                            JsonArray filesArray = fileDownloadData.get("files").getAsJsonArray();
881
-//                            if (filesArray != null && filesArray.size() > 0) {
882
-//                                JsonObject fileObject = (JsonObject) filesArray.get(0);
883
-//                                String fileDownloadUrl = fileObject.get("downloadUrl").toString();
884
-//                                LocalDate now = LocalDate.now();
885
-//                                String year = Integer.toString(now.getYear());
886
-//                                String month = String.format("%02d", now.getMonthValue());
887
-//                                String day = String.format("%02d", now.getDayOfMonth());
888
-//                                String saveFolderPath = "/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day;
889
-//                                String fileName = UUID.randomUUID().toString().replace("-", "") + ".pdf";
890
-//                                String saveName = fileName;
891
-//                                String savePath = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName;
892
-//
893
-//                                // 创建日期目录
894
-//                                File saveFolder = new File(saveFolderPath);
895
-//                                if (!saveFolder.exists()) {
896
-//                                    saveFolder.mkdirs();
897
-//                                }
898
-//                                String resultFilePath = saveFolderPath + "/" + fileName;
899
-//                                File resultFilePathFile = new File(resultFilePath);
900
-//                                if (!resultFilePathFile.exists()) {
901
-//                                    resultFilePathFile.createNewFile();
902
-//                                }
903
-//
904
-//                                String fileDownloadUrlnew = fileDownloadUrl.substring(1, fileDownloadUrl.length() - 1);
905
-//                                boolean downLoadFile = FileTransformation.downLoadFileByUrl(fileDownloadUrlnew, resultFilePath);
906
-//                                if (downLoadFile) {
907
-//                                    // 先删除已经存在的调解书
908
-//                                    if(StrUtil.isEmpty(caseApplicationselect.getCaseSource())){
909
-//                                        List<MsCaseAttach> existAttach = msCaseAttachMapper.listCaseAttachByCaseIdAndType(caseAppliId, AnnexTypeEnum.MEDIATE_BOOK.getCode());
910
-//                                        if(CollectionUtil.isNotEmpty(existAttach)){
911
-//                                            //  对接北明,同步案件状态,删除
912
-//                                            for (MsCaseAttach msCaseAttach : existAttach) {
913
-//                                                if(StrUtil.isEmpty(msCaseAttach.getOtherSysFileId())||StrUtil.isEmpty(msCaseAttach.getAnnexPath())){
914
-//                                                    continue;
915
-//                                                }
916
-//                                                beiMingInterfaceService.deleteAttachmentInfo(caseApplicationselect.getCaseNum(), msCaseAttach.getOtherSysFileId(), FileUtil.getName(msCaseAttach.getAnnexPath()));
917
-//                                            }
918
-//                                        }
919
-//                                    }
920
-//                                    msCaseAttachMapper.deleteCaseAttachByCasedIdAndType(caseAppliId, AnnexTypeEnum.MEDIATE_BOOK.getCode());
921
-//                                    MsCaseAttach caseAttach = new MsCaseAttach();
922
-//                                    caseAttach.setCaseAppliId(caseAppliId);
923
-//                                    caseAttach.setAnnexType(AnnexTypeEnum.MEDIATE_BOOK.getCode());
924
-//                                    caseAttach.setAnnexPath(savePath);
925
-//                                    caseAttach.setAnnexName(saveName);
926
-//                                    caseAttachMapper.save(caseAttach);
927
-//                                    //  对接北明,调用上传附件接口
928
-//                                    if(StrUtil.isEmpty(caseApplicationselect.getCaseSource()) ) {
929
-//                                        String templatePath = "/home/ruoyi" + savePath;
930
-//                                        File file = new File(templatePath.replace("/profile", "/uploadPath"));
931
-//                                        MsCaseFileInfo caseFileInfo = beiMingInterfaceService.pushAttachmentInfo(BMUserName, BMPassword, file, BMSyncSource, caseApplicationselect.getCaseNum(), AttachmentOperateTypeEnum.ADD,DocumentTypeEnum.EVEDENT_AGREEMENT);
932
-//                                        // 更新附件表
933
-//                                        if(caseFileInfo!=null && StrUtil.isNotEmpty(caseFileInfo.getFileId())){
934
-//                                            caseAttach.setOtherSysFileId(caseFileInfo.getFileId());
935
-//                                            msCaseAttachMapper.updateCaseAttachBycaseid(caseAttach);
936
-//                                        }
937
-//
938
-//                                    }
939
-//                                }
940
-//
941
-//                            }
917
+
942 918
                         }
943 919
                     } else if (StringUtils.isNotEmpty(accountMobile) && accountMobile.equals(pensonAccountRes)) {
944 920
                         //被申请人签名
945 921
                         sealSignRecordsel.setSignStatusResponse(1);
946 922
                         sealSignRecordMapper.updateByPrimaryKeySelective(sealSignRecordsel);
947 923
                         MsCaseLogRecord operLog = new MsCaseLogRecord();
924
+                        if(sysUser!=null){
925
+                            operLog.setCreateBy(sysUser.getUserName());
926
+                        }
948 927
                         operLog.setCreateNickName(pensonNameRes);
949 928
                         operLog.setCaseStatusName(caseStatusName);
950 929
                         operLog.setCaseAppliId(caseAppliId);
@@ -965,71 +944,6 @@ public class MsSignSealServiceImpl implements MsSignSealService {
965 944
 
966 945
                             //下载审核完成的调解书
967 946
                             msSignSealService.downloadMediationBook(caseApplicationselect, signFlowId, gson, caseAppliId);
968
-//                            EsignHttpResponse fileDownload = SaaSAPIFileUtils.fileDownloadUrl(signFlowId);
969
-//                            JsonObject fileDownloadJsonObject = gson.fromJson(fileDownload.getBody(), JsonObject.class);
970
-//                            JsonObject fileDownloadData = fileDownloadJsonObject.getAsJsonObject("data");
971
-//                            JsonArray filesArray = fileDownloadData.get("files").getAsJsonArray();
972
-//                            if (filesArray != null && filesArray.size() > 0) {
973
-//                                JsonObject fileObject = (JsonObject) filesArray.get(0);
974
-//                                String fileDownloadUrl = fileObject.get("downloadUrl").toString();
975
-//                                LocalDate now = LocalDate.now();
976
-//                                String year = Integer.toString(now.getYear());
977
-//                                String month = String.format("%02d", now.getMonthValue());
978
-//                                String day = String.format("%02d", now.getDayOfMonth());
979
-//                                String saveFolderPath = "/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day;
980
-//                                String fileName = UUID.randomUUID().toString().replace("-", "") + ".pdf";
981
-//                                String saveName = fileName;
982
-//                                String savePath = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName;
983
-//
984
-//                                // 创建日期目录
985
-//                                File saveFolder = new File(saveFolderPath);
986
-//                                if (!saveFolder.exists()) {
987
-//                                    saveFolder.mkdirs();
988
-//                                }
989
-//                                String resultFilePath = saveFolderPath + "/" + fileName;
990
-//                                File resultFilePathFile = new File(resultFilePath);
991
-//                                if (!resultFilePathFile.exists()) {
992
-//                                    resultFilePathFile.createNewFile();
993
-//                                }
994
-//
995
-//                                String fileDownloadUrlnew = fileDownloadUrl.substring(1, fileDownloadUrl.length() - 1);
996
-//                                boolean downLoadFile = FileTransformation.downLoadFileByUrl(fileDownloadUrlnew, resultFilePath);
997
-//                                if (downLoadFile) {
998
-//                                    // 先删除已经存在的调解书
999
-//                                    if(StrUtil.isEmpty(caseApplicationselect.getCaseSource())){
1000
-//                                        List<MsCaseAttach> existAttach = msCaseAttachMapper.listCaseAttachByCaseIdAndType(caseAppliId, AnnexTypeEnum.MEDIATE_BOOK.getCode());
1001
-//                                        if(CollectionUtil.isNotEmpty(existAttach)){
1002
-//                                            //  对接北明,同步案件状态,删除
1003
-//                                            for (MsCaseAttach msCaseAttach : existAttach) {
1004
-//                                                if(StrUtil.isEmpty(msCaseAttach.getOtherSysFileId())||StrUtil.isEmpty(msCaseAttach.getAnnexPath())){
1005
-//                                                    continue;
1006
-//                                                }
1007
-//                                                beiMingInterfaceService.deleteAttachmentInfo(caseApplicationselect.getCaseNum(), msCaseAttach.getOtherSysFileId(), FileUtil.getName(msCaseAttach.getAnnexPath()));
1008
-//                                            }
1009
-//                                        }
1010
-//                                    }
1011
-//                                    msCaseAttachMapper.deleteCaseAttachByCasedIdAndType(caseAppliId, AnnexTypeEnum.MEDIATE_BOOK.getCode());
1012
-//                                    MsCaseAttach caseAttach = new MsCaseAttach();
1013
-//                                    caseAttach.setCaseAppliId(caseAppliId);
1014
-//                                    caseAttach.setAnnexType(7);
1015
-//                                    caseAttach.setAnnexPath(savePath);
1016
-//                                    caseAttach.setAnnexName(saveName);
1017
-//
1018
-//                                    //  对接北明,调用上传附件接口
1019
-//
1020
-//                                    if(StrUtil.isEmpty(caseApplicationselect.getCaseSource()) ) {
1021
-//                                        String templatePath = "/home/ruoyi" + savePath;
1022
-//                                        File file = new File(templatePath.replace("/profile", "/uploadPath"));
1023
-//                                        MsCaseFileInfo caseFileInfo = beiMingInterfaceService.pushAttachmentInfo(BMUserName, BMPassword, file, BMSyncSource, caseApplicationselect.getCaseNum(), AttachmentOperateTypeEnum.ADD,DocumentTypeEnum.EVEDENT_AGREEMENT);
1024
-//                                        // 更新附件表
1025
-//                                        if(caseFileInfo!=null && StrUtil.isNotEmpty(caseFileInfo.getFileId())){
1026
-//                                            caseAttach.setOtherSysFileId(caseFileInfo.getFileId());
1027
-//                                        }
1028
-//                                    }
1029
-//                                    caseAttachMapper.save(caseAttach);
1030
-//                                }
1031
-//
1032
-//                            }
1033 947
                         }
1034 948
                     }
1035 949
                 }
@@ -1244,7 +1158,7 @@ public class MsSignSealServiceImpl implements MsSignSealService {
1244 1158
         sendMailRecord.setSendTime(new Date());
1245 1159
         sendMailRecord.setMailSubject("签署后的调解书");
1246 1160
         sendMailRecord.setMailFromAddress(emailFrom);
1247
-        sendMailRecord.setFileIds(fileId != null ? fileId.toString() : null);
1161
+        sendMailRecord.setFileIds(fileId != null ? fileId.toString() : "");
1248 1162
 //        sendMailRecord.setCreateBy(SecurityUtils.getUsername());
1249 1163
         sendMailRecord.setCreateTime(new Date());
1250 1164
         sendMailRecord.setMailFromAddress(emailFrom);

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

@@ -3,6 +3,8 @@ package com.ruoyi.wisdomarbitrate.service.mscase.impl;
3 3
 import cn.hutool.core.collection.CollectionUtil;
4 4
 import cn.hutool.core.io.FileUtil;
5 5
 import cn.hutool.core.util.StrUtil;
6
+import cn.hutool.http.HttpRequest;
7
+import cn.hutool.http.HttpResponse;
6 8
 import cn.hutool.http.HttpUtil;
7 9
 import cn.hutool.json.JSONArray;
8 10
 import cn.hutool.json.JSONUtil;
@@ -108,6 +110,9 @@ public class VideoConferenceServiceImpl implements VideoConferenceService {
108 110
     BeiMingInterfaceService beiMingInterfaceService;
109 111
     @Autowired
110 112
     private SmsRecordMapper smsRecordMapper;
113
+    // 仲裁短信回调
114
+    @Value("${arbitrateConfig.smsURL}")
115
+    private String smsURL;
111 116
 
112 117
     /**
113 118
         视频回调
@@ -173,6 +178,11 @@ public class VideoConferenceServiceImpl implements VideoConferenceService {
173 178
                             smsSendRecord.setReason(description != null ? description.toString() : null);
174 179
                         }
175 180
                         smsRecordMapper.updateStatus(smsSendRecord);
181
+                    }else {
182
+                        // 查找仲裁系统,调用仲裁系统短信接口
183
+                        HttpResponse httpResponse = HttpRequest.post(smsURL)
184
+                                .body(JSONUtil.toJsonStr(jsonObject))
185
+                                .execute();
176 186
                     }
177 187
                 }
178 188
             }

+ 38
- 4
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/sendrecord/impl/SendMailRecordServiceImpl.java Целия файл

@@ -1,5 +1,8 @@
1 1
 package com.ruoyi.wisdomarbitrate.service.sendrecord.impl;
2 2
 
3
+import cn.hutool.core.collection.CollectionUtil;
4
+import cn.hutool.core.util.ObjectUtil;
5
+import cn.hutool.core.util.StrUtil;
3 6
 import com.ruoyi.common.core.domain.AjaxResult;
4 7
 import com.ruoyi.common.utils.EmailOutUtil;
5 8
 import com.ruoyi.system.domain.entity.shortmessage.MsSendMailHistoryRecord;
@@ -14,10 +17,9 @@ import org.springframework.beans.factory.annotation.Autowired;
14 17
 import org.springframework.stereotype.Service;
15 18
 
16 19
 import java.io.File;
17
-import java.util.Date;
18
-import java.util.HashMap;
19
-import java.util.List;
20
-import java.util.Map;
20
+import java.util.*;
21
+import java.util.function.Function;
22
+import java.util.stream.Collectors;
21 23
 
22 24
 @Service
23 25
 public class SendMailRecordServiceImpl implements ISendMailRecordService {
@@ -28,6 +30,31 @@ public class SendMailRecordServiceImpl implements ISendMailRecordService {
28 30
     @Override
29 31
     public List<SendMailRecord> selectSendMailRecordList(SendMailRecord sendMailRecord) {
30 32
         List<SendMailRecord> records = sendMailRecordMapper.selectSendMailRecord(sendMailRecord);
33
+        if(CollectionUtil.isNotEmpty(records)){
34
+            Map<Long, String> recordmap = records.stream().filter(record -> StrUtil.isNotEmpty(record.getFileIds())).collect(Collectors.toMap(SendMailRecord::getId, SendMailRecord::getFileIds, (k1, k2) -> k2));
35
+            List<String> fileIds = new ArrayList<>(recordmap.values());
36
+            if(CollectionUtil.isNotEmpty(fileIds)){
37
+             List<MsCaseAttach> caseAttaches=   msCaseAttachMapper.selectByIds(fileIds);
38
+             if(CollectionUtil.isNotEmpty(caseAttaches)){
39
+                 Map<Long, MsCaseAttach> attachMap = caseAttaches.stream().collect(Collectors.toMap(MsCaseAttach::getAnnexId, Function.identity(), (k1, k2) -> k2));
40
+                 for (SendMailRecord record : records) {
41
+                     List<MsCaseAttach> msCaseAttaches = new ArrayList<>();
42
+                     if(recordmap.containsKey(record.getId())){
43
+                         String fileIdStr = recordmap.get(record.getId());
44
+                         if(ObjectUtil.isNotNull(fileIdStr) ) {
45
+                             String[] splitFileId = fileIdStr.split(",");
46
+                             for (String fileId : splitFileId) {
47
+                                 if (ObjectUtil.isNotNull(fileId) && attachMap.containsKey(Long.parseLong(fileId))) {
48
+                                     msCaseAttaches.add(attachMap.get(Long.parseLong(fileId)));
49
+                                 }
50
+                             }
51
+                             record.setCaseAttachList(msCaseAttaches);
52
+                         }
53
+                     }
54
+                 }
55
+             }
56
+            }
57
+        }
31 58
         return records;
32 59
     }
33 60
 
@@ -50,6 +77,13 @@ public class SendMailRecordServiceImpl implements ISendMailRecordService {
50 77
                 msSendMailHistoryRecord.setId(null);
51 78
                 msSendMailHistoryRecordMapper.insertSelective(msSendMailHistoryRecord);
52 79
                 sendMailRecord.setUpdateTime(new Date());
80
+                if(CollectionUtil.isNotEmpty(sendMailRecord.getCaseAttachList())){
81
+                    List<Long> fileIdList = sendMailRecord.getCaseAttachList().stream().map(MsCaseAttach::getAnnexId).collect(Collectors.toList());
82
+                    if(CollectionUtil.isNotEmpty(fileIdList)){
83
+                        String fileIdStr = StrUtil.join(",", fileIdList);
84
+                        sendMailRecord.setFileIds(fileIdStr);
85
+                    }
86
+                }
53 87
                 sendMailRecordMapper.updateSendMailRecord(sendMailRecord);
54 88
                 return AjaxResult.success("编辑成功");
55 89
             } else {

+ 1
- 1
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/sms/SMSTemplateService.java Целия файл

@@ -7,7 +7,7 @@ import java.util.List;
7 7
 
8 8
 /**
9 9
  * @Classname SMSTemplateService
10
- * @Description TODO
10
+ * @Description
11 11
  * @Version 1.0.0
12 12
  * @Date 2024/4/16 11:39
13 13
  * @Created wangqiong

+ 2
- 2
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/sms/impl/SMSTemplateServiceImpl.java Целия файл

@@ -17,7 +17,7 @@ import java.util.stream.Collectors;
17 17
 
18 18
 /**
19 19
  * @Classname SMSTemplateServiceImpl
20
- * @Description TODO
20
+ * @Description
21 21
  * @Version 1.0.0
22 22
  * @Date 2024/4/16 11:40
23 23
  * @Created wangqiong
@@ -68,7 +68,7 @@ public class SMSTemplateServiceImpl implements SMSTemplateService {
68 68
             for (MsSmsTemplateParam templateParam : template.getTemplateParams()) {
69 69
                 templateParam.setSmsTemplateId(template.getId());
70 70
             }
71
-            // todo 先删除
71
+            //  先删除
72 72
             Example paramExam = new Example(MsSmsTemplateParam.class);
73 73
             paramExam.createCriteria().andEqualTo("smsTemplateId", template.getId());
74 74
             templateParamMapper.deleteByExample(paramExam);

+ 1
- 1
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/FixSelectFlowDetailUtils.java Целия файл

@@ -163,7 +163,7 @@ public class FixSelectFlowDetailUtils {
163 163
     /**
164 164
      * 定时查询印章审核状态
165 165
      */
166
-    @Scheduled(cron = "0/30 * * * * ?")
166
+//    @Scheduled(cron = "0/30 * * * * ?")
167 167
     @Transactional
168 168
     public void searchForInstitutionalSeal() {
169 169
         try {

+ 5
- 0
ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml Целия файл

@@ -180,6 +180,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
180 180
 			left join ms_sys_role r on r.role_id = ur.role_id
181 181
 		where u.id_card = #{idCard} and u.del_flag = '0' and u.status='0' order by u.create_time limit 1
182 182
 	</select>
183
+    <select id="selectUserByPhone" parameterType="String" resultMap="SysUserResult">
184
+        select u.*
185
+        from ms_sys_user u
186
+        where u.phonenumber = #{phonenumber}  order by u.create_time limit 1
187
+    </select>
183 188
 	<select id="selectUserByEmail" parameterType="String" resultMap="SysUserResult">
184 189
 		select u.*,ur.role_id
185 190
 			from ms_sys_user u

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

@@ -40,7 +40,7 @@
40 40
   </select>
41 41
     <select id="selectByCaseId" resultType="com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAffiliate">
42 42
         select c.id caseAppliId,r.role_id roleId,a.id,a.role_type roleType,a.group_order groupOrder,a.operator_flag operatorFlag,d.code,d.comp_legal_person compLegalPerson,u.id_card idCard,u.phonenumber phone,
43
-            u.email,u.user_name userName,
43
+            u.email,u.user_name userName,a.applicant_dept_id applicantDeptId,
44 44
                (case when a.user_id is null then d.dept_name else u.nick_name end)  name,
45 45
                (case when a.user_id is null then d.home else u.home end) home,
46 46
                (case when a.user_id is null then d.address else u.address end) address,

+ 45
- 21
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/mscase/MsCaseApplicationMapper.xml Целия файл

@@ -40,18 +40,29 @@
40 40
     JOIN ms_case_affiliate a ON c.id = a.case_appli_id
41 41
     LEFT JOIN ms_sys_user u ON u.user_id = a.user_id
42 42
     LEFT JOIN ms_sys_user u1 ON u1.user_id = c.mediator_id
43
-    LEFT JOIN ms_sys_user_role ur ON  u.user_id = ur.user_id or u1.user_id = ur.user_id
44
-    LEFT JOIN ms_sys_role r ON r.role_id = ur.role_id or r.role_id = ur.role_id
43
+    LEFT JOIN ms_sys_user u2 ON u2.user_name = c.create_by
44
+    LEFT JOIN ms_sys_user_role ur ON u.user_id = ur.user_id OR u1.user_id = ur.user_id or u2.user_id = ur.user_id
45
+    LEFT JOIN ms_sys_role r ON r.role_id = ur.role_id
45 46
     LEFT JOIN ms_sys_dept d ON d.dept_id = a.applicant_dept_id
46 47
     <where>
47 48
 <!--      调解员角色和申请人,被申,代理人-->
48 49
       <if test = 'req.mediatorId != null and req.userId!=null'>
49 50
         AND (c.mediator_id = #{req.mediatorId} or a.user_id=#{req.userId})
50 51
       </if>
52
+
51 53
 <!--      admin,财务,顾问,部门长查看所有案件,申请人,被申,代理人根据userId查-->
52 54
       <if test = 'req.mediatorId == null and  req.userId != null'>
53 55
         AND (a.user_id=#{req.userId} )
54 56
       </if>
57
+<!--      第三方代理人,调解员-->
58
+      <if test = 'req.createBy != null and req.mediatorId == null '>
59
+        or (c.create_by = #{req.createBy})
60
+      </if>
61
+
62
+
63
+      <if test = 'req.createBy != null and req.mediatorId != null '>
64
+        or (c.create_by = #{req.createBy} or c.mediator_id = #{req.mediatorId})
65
+      </if>
55 66
 <!--        根据角色查询-->
56 67
       <if test='roleIds != null and roleIds.size() > 0 '>
57 68
         and  r.role_id in
@@ -75,15 +86,9 @@
75 86
       </if>
76 87
       <!--  案件编号-->
77 88
       <if test = 'req.caseNum != null and req.caseNum != "" '>
78
-        AND c.case_num = #{req.caseNum}
79
-      </if>
80
-      <!--  时间-->
81
-      <if test = 'req.startTime != null and req.startTime != "" '>
82
-        and c.create_time &gt;= #{req.startTime}
83
-      </if>
84
-      <if test = 'req.endTime != null and req.endTime != "" '>
85
-        and c.create_time &lt;= #{req.endTime}
89
+        AND c.case_num like  concat('%',#{req.caseNum},'%')
86 90
       </if>
91
+
87 92
     </where>
88 93
 
89 94
   </sql>
@@ -113,7 +118,7 @@
113 118
   <select id="list" resultType="com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseApplicationVO">
114 119
     select t.* from(
115 120
     SELECT
116
-    c.id,c.seal_flag sealFlag,c.mediator_id mediatorId,c.case_source caseSource,c.media_result mediaResult,c.room_id roomId,0 AS pendingStatus,
121
+    c.id,c.create_by creatBy,c.seal_flag sealFlag,c.mediator_id mediatorId,c.case_source caseSource,c.media_result mediaResult,c.room_id roomId,0 AS pendingStatus,
117 122
     c.case_flow_id caseFlowId,c.batch_number batchNumber,c.case_num caseNum,
118 123
     u1.nick_name mediatorName,c.hear_date hearDate,c.case_status_name caseStatusName,c.create_time createTime,
119 124
     c.mediation_method mediationMethod,
@@ -123,7 +128,7 @@
123 128
     c.id
124 129
     union
125 130
     SELECT
126
-    c.id,c.seal_flag sealFlag,c.mediator_id mediatorId,c.case_source caseSource,c.media_result mediaResult,c.room_id roomId,1 AS pendingStatus,
131
+    c.id,c.create_by creatBy,c.seal_flag sealFlag,c.mediator_id mediatorId,c.case_source caseSource,c.media_result mediaResult,c.room_id roomId,1 AS pendingStatus,
127 132
     c.case_flow_id caseFlowId,c.batch_number batchNumber,c.case_num caseNum,
128 133
     u1.nick_name mediatorName,c.hear_date hearDate,c.case_status_name caseStatusName,c.create_time createTime,
129 134
     c.mediation_method mediationMethod,
@@ -149,20 +154,39 @@
149 154
       </if>
150 155
       <!--  案件编号-->
151 156
       <if test = 'req.caseNum != null and req.caseNum != "" '>
152
-        AND c.case_num = #{req.caseNum}
153
-      </if>
154
-      <!--  时间-->
155
-      <if test = 'req.startTime != null and req.startTime != "" '>
156
-        and c.create_time &gt;= #{req.startTime}
157
-      </if>
158
-      <if test = 'req.endTime != null and req.endTime != "" '>
159
-        and c.create_time &lt;= #{req.endTime}
157
+        AND c.case_num like  concat('%',#{req.caseNum},'%')
160 158
       </if>
159
+<!--      &lt;!&ndash;  时间&ndash;&gt;-->
160
+<!--      <if test = 'req.startTime != null and req.startTime != "" '>-->
161
+<!--        and c.create_time &gt;= #{req.startTime}-->
162
+<!--      </if>-->
163
+<!--      <if test = 'req.endTime != null and req.endTime != "" '>-->
164
+<!--        and c.create_time &lt;= #{req.endTime}-->
165
+<!--      </if>-->
161 166
 
162 167
     </where>
163 168
     GROUP BY
164 169
     c.id
165
-    ) t ORDER BY t.createTime desc,t.caseNum desc
170
+    ) t <where>
171
+    <!--  时间-->
172
+    <if test = 'req.startTime != null and req.startTime != "" '>
173
+      and t.createTime &gt;= #{req.startTime}
174
+    </if>
175
+    <if test = 'req.endTime != null and req.endTime != "" '>
176
+      and t.createTime &lt;= #{req.endTime}
177
+    </if>
178
+    <!--  案件状态id条件-->
179
+    <if test = 'req.caseFlowId != null'>
180
+      AND t.caseFlowId = #{req.caseFlowId}
181
+    </if>
182
+    <if test = 'req.caseId != null'>
183
+      AND t.id = #{req.caseId}
184
+    </if>
185
+    <!--  案件编号-->
186
+    <if test = 'req.caseNum != null and req.caseNum != "" '>
187
+      AND t.caseNum like  concat('%',#{req.caseNum},'%')
188
+    </if>
189
+  </where> ORDER BY t.createTime desc,t.caseNum desc
166 190
 
167 191
   </select>
168 192
   <select id="countCasePerson" resultType="java.lang.Long">

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

@@ -157,5 +157,12 @@
157 157
         </where>
158 158
     </update>
159 159
 
160
-
160
+    <select id="selectByIds" resultMap="CaseAttachResult">
161
+        select *
162
+        from ms_case_attach
163
+        where annex_id in
164
+        <foreach collection="ids" item="id" open="(" separator="," close=")">
165
+            #{id}
166
+        </foreach>
167
+    </select>
161 168
 </mapper>

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

@@ -21,8 +21,7 @@
21 21
 
22 22
     <select id="selectSendMailRecord" parameterType="com.ruoyi.wisdomarbitrate.domain.dto.sendrecord.SendMailRecord"
23 23
             resultMap="SendMailRecordResult">
24
-        SELECT s.id ,s.mail_name ,s.mail_content ,s.mail_address ,s.send_time ,s.case_id ,s.create_time ,s.create_by ,
25
-        s.update_by ,s.update_time , s.send_status ,s.file_ids ,s.mail_subject ,s.mail_from_address ,c.case_num
24
+        SELECT s.* ,c.case_num
26 25
         from ms_send_mail_record s left join ms_case_application c
27 26
         on s.case_id = c.id
28 27
         <where>
@@ -67,6 +66,7 @@
67 66
         <if test="updateTime != null ">,update_time=#{updateTime}</if>
68 67
         <if test="sendTime != null ">,send_time=#{sendTime}</if>
69 68
         <if test="sendStatus != null ">,send_status=#{sendStatus}</if>
69
+        <if test="fileIds != null  and fileIds != ''">,file_ids=#{fileIds}</if>
70 70
         where id = #{id}
71 71
     </update>
72 72
     <select id="querySendMailRecordById" resultMap="SendMailRecordResult">