Explorar el Código

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

wangqiong123 hace 2 años
padre
commit
8e8b402ced
Se han modificado 26 ficheros con 329 adiciones y 241 borrados
  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 Ver fichero

391
     private CloseableHttpClient getWxHttpClient() {
391
     private CloseableHttpClient getWxHttpClient() {
392
         try {
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
             // 加载商户私钥(privateKey:私钥字符串)
395
             // 加载商户私钥(privateKey:私钥字符串)
396
             String key = FileUtil.readToStr("wxpay_private.key");
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 Ver fichero

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

+ 10
- 8
ruoyi-admin/src/main/resources/application.yml Ver fichero

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

+ 5
- 1
ruoyi-common/src/main/java/com/ruoyi/common/core/controller/BaseController.java Ver fichero

19
 import org.springframework.web.bind.annotation.InitBinder;
19
 import org.springframework.web.bind.annotation.InitBinder;
20
 
20
 
21
 import java.beans.PropertyEditorSupport;
21
 import java.beans.PropertyEditorSupport;
22
+import java.util.ArrayList;
22
 import java.util.Date;
23
 import java.util.Date;
23
 import java.util.List;
24
 import java.util.List;
24
 
25
 
83
     @SuppressWarnings({ "rawtypes", "unchecked" })
84
     @SuppressWarnings({ "rawtypes", "unchecked" })
84
     protected TableDataInfo getDataTable(List<?> list)
85
     protected TableDataInfo getDataTable(List<?> list)
85
     {
86
     {
87
+        if(list == null){
88
+            list=new ArrayList<>();
89
+        }
86
         TableDataInfo rspData = new TableDataInfo();
90
         TableDataInfo rspData = new TableDataInfo();
87
         rspData.setCode(HttpStatus.SUCCESS);
91
         rspData.setCode(HttpStatus.SUCCESS);
88
         rspData.setMsg("查询成功");
92
         rspData.setMsg("查询成功");
112
      */
116
      */
113
     public AjaxResult success(String message)
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 Ver fichero

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

+ 1
- 1
ruoyi-system/src/main/java/com/ruoyi/system/service/MsRequestLogService.java Ver fichero

4
 
4
 
5
 /**
5
 /**
6
  * @Classname MsRequestLogService
6
  * @Classname MsRequestLogService
7
- * @Description TODO
7
+ * @Description
8
  * @Version 1.0.0
8
  * @Version 1.0.0
9
  * @Date 2024/4/2 14:18
9
  * @Date 2024/4/2 14:18
10
  * @Created wangqiong
10
  * @Created wangqiong

+ 1
- 1
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/MsRequestLogServiceImpl.java Ver fichero

10
 
10
 
11
 /**
11
 /**
12
  * @Classname MsRequestLogServiceImpl
12
  * @Classname MsRequestLogServiceImpl
13
- * @Description TODO
13
+ * @Description
14
  * @Version 1.0.0
14
  * @Version 1.0.0
15
  * @Date 2024/4/2 14:19
15
  * @Date 2024/4/2 14:19
16
  * @Created wangqiong
16
  * @Created wangqiong

+ 4
- 1
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/dto/sendrecord/SendMailRecord.java Ver fichero

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

+ 1
- 1
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/mscase/MsCaseAffiliateParent.java Ver fichero

2
 
2
 
3
 /**
3
 /**
4
  * @Classname MsCaseAffiliateParent
4
  * @Classname MsCaseAffiliateParent
5
- * @Description TODO
5
+ * @Description
6
  * @Version 1.0.0
6
  * @Version 1.0.0
7
  * @Date 2024/3/27 16:05
7
  * @Date 2024/3/27 16:05
8
  * @Created wangqiong
8
  * @Created wangqiong

+ 4
- 1
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/mscase/MsCaseApplicationReq.java Ver fichero

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

+ 12
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/mscase/MsCaseApplicationVO.java Ver fichero

29
      * 被申请人姓名
29
      * 被申请人姓名
30
      */
30
      */
31
     private String respondentName;
31
     private String respondentName;
32
+    /**
33
+     * 创建者
34
+     */
35
+    private String creatBy;
32
 
36
 
33
     /**
37
     /**
34
      * 案件相关人员
38
      * 案件相关人员
95
      * 是否财务,部门长,秘书,0-否,1-是
99
      * 是否财务,部门长,秘书,0-否,1-是
96
      */
100
      */
97
     private Integer otherFlag;
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
      * 调解书上传下载按钮权限,调解员,顾问在调节之后,送达之前显示,0-否,1-是
111
      * 调解书上传下载按钮权限,调解员,顾问在调节之后,送达之前显示,0-否,1-是
100
      */
112
      */

+ 7
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/mscase/MsCaseAttachMapper.java Ver fichero

50
      * @return
50
      * @return
51
      */
51
      */
52
     int countByfileName(@Param("annexName") String fileName,@Param("caseAppliId") Long caseAppliId);
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 Ver fichero

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

+ 5
- 3
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/MsCaseApplicationService.java Ver fichero

57
      * @param affiliate
57
      * @param affiliate
58
      * @param groupOrder 组别
58
      * @param groupOrder 组别
59
      * @param operatorCount 操作人数量
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
      * @param affiliate 相关人员信息
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 Ver fichero

211
             startPage();
211
             startPage();
212
             List<MsCaseApplicationVO> list = msCaseApplicationMapper.list(req, null,null);
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
             return list;
215
             return list;
216
         }
216
         }
217
         if(CollectionUtil.isEmpty(roles) ){
217
         if(CollectionUtil.isEmpty(roles) ){
238
 
238
 
239
         // 是否查询所有
239
         // 是否查询所有
240
         boolean isSelectAll = false;
240
         boolean isSelectAll = false;
241
+        // 是否嗲三方代理人
242
+        boolean agentFlag = false;
241
 
243
 
242
         for (SysRole role : roles) {
244
         for (SysRole role : roles) {
243
             if(StrUtil.isNotEmpty(role.getRoleName())){
245
             if(StrUtil.isNotEmpty(role.getRoleName())){
251
                 if(StrUtil.equals(role.getRoleName(),"调解员")) {
253
                 if(StrUtil.equals(role.getRoleName(),"调解员")) {
252
                     req.setMediatorId(String.valueOf(sysUser.getUserId()));
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
         if(!isSelectAll){
262
         if(!isSelectAll){
265
         // 查询案件列表
271
         // 查询案件列表
266
         List<MsCaseApplicationVO> list = msCaseApplicationMapper.list(req, caseFlowIds,roleIds);
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
         return list;
275
         return list;
270
     }
276
     }
271
 
277
 
273
      * 设置申请人被申请人及签名按钮限
279
      * 设置申请人被申请人及签名按钮限
274
      * @param
280
      * @param
275
      * @param list
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
         if(CollectionUtil.isEmpty(list)){
285
         if(CollectionUtil.isEmpty(list)){
280
             return;
286
             return;
281
         }
287
         }
294
         }
300
         }
295
 
301
 
296
         for (MsCaseApplicationVO vo : list) {
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
                 isMediatorRole=true;
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
             if(affiliateMap!=null && affiliateMap.containsKey(vo.getId())){
325
             if(affiliateMap!=null && affiliateMap.containsKey(vo.getId())){
308
                         if (affiliate.getUserId()!=null && affiliate.getRoleType() != null && affiliate.getOperatorFlag() != null && affiliate.getOperatorFlag() == 1) {
332
                         if (affiliate.getUserId()!=null && affiliate.getRoleType() != null && affiliate.getOperatorFlag() != null && affiliate.getOperatorFlag() == 1) {
309
                             if (vo.getAppOperatorFlag() == null && (affiliate.getRoleType() == 1 || affiliate.getRoleType() == 2)) {
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
                                     vo.setAppOperatorFlag(1);
336
                                     vo.setAppOperatorFlag(1);
313
                                 }else if(vo.getCaseStatusName().equals("待签名")) {
337
                                 }else if(vo.getCaseStatusName().equals("待签名")) {
314
-                                    if(affiliate.getUserId().equals(loginUserId)){
338
+                                    if(affiliate.getUserId().equals(loginUser.getUserId())){
315
                                         vo.setAppOperatorFlag(1);
339
                                         vo.setAppOperatorFlag(1);
316
                                     }else {
340
                                     }else {
317
                                         vo.setAppOperatorFlag(0);
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
                                     vo.setSignFlag(1);
346
                                     vo.setSignFlag(1);
323
                                 }
347
                                 }
324
 
348
 
325
                             }
349
                             }
326
                             if (vo.getResOperatorFlag() == null && (affiliate.getRoleType() == 3 || affiliate.getRoleType() == 4)) {
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
                                     vo.setResOperatorFlag(1);
353
                                     vo.setResOperatorFlag(1);
330
                                 }else if(vo.getCaseStatusName().equals("待签名")) {
354
                                 }else if(vo.getCaseStatusName().equals("待签名")) {
331
-                                    if(Objects.equals(affiliate.getUserId(), loginUserId)){
355
+                                    if(Objects.equals(affiliate.getUserId(), loginUser.getUserId())){
332
                                         vo.setResOperatorFlag(1);
356
                                         vo.setResOperatorFlag(1);
333
                                     }else {
357
                                     }else {
334
                                         vo.setResOperatorFlag(0);
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
                                     vo.setSignFlag(1);
363
                                     vo.setSignFlag(1);
340
                                 }
364
                                 }
341
                             }
365
                             }
402
                     if(StrUtil.contains(role.getRoleName(),"财务")
426
                     if(StrUtil.contains(role.getRoleName(),"财务")
403
                             ||StrUtil.contains(role.getRoleName(),"法律顾问")
427
                             ||StrUtil.contains(role.getRoleName(),"法律顾问")
404
                             ||StrUtil.contains(role.getRoleName(),"部门长")
428
                             ||StrUtil.contains(role.getRoleName(),"部门长")
405
-                            ||StrUtil.contains(role.getRoleName(),"调解员")
429
+//                            ||StrUtil.contains(role.getRoleName(),"调解员")
406
                     ){
430
                     ){
407
                        vo.setOtherFlag(1);
431
                        vo.setOtherFlag(1);
408
                     }
432
                     }
483
             // 查询案件列表
507
             // 查询案件列表
484
 
508
 
485
             for (SysRole role : roles) {
509
             for (SysRole role : roles) {
510
+                if (StrUtil.isEmpty(role.getRoleName())) {
511
+                    continue;
512
+                }
486
                 if(StrUtil.contains(role.getRoleName(),"财务")
513
                 if(StrUtil.contains(role.getRoleName(),"财务")
487
                         ||StrUtil.contains(role.getRoleName(),"法律顾问")
514
                         ||StrUtil.contains(role.getRoleName(),"法律顾问")
488
                         ||StrUtil.contains(role.getRoleName(),"部门长")
515
                         ||StrUtil.contains(role.getRoleName(),"部门长")
491
                     roleIds=null;
518
                     roleIds=null;
492
 
519
 
493
                 }
520
                 }
494
-                if (StrUtil.isNotEmpty(role.getRoleName())) {
521
+
495
                     if (StrUtil.equals(role.getRoleName(), "调解员")) {
522
                     if (StrUtil.equals(role.getRoleName(), "调解员")) {
496
                         req.setMediatorId(String.valueOf(sysUser.getUserId()));
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
             if(!isSelectAll){
532
             if(!isSelectAll){
503
                 req.setUserId(loginUser.getUserId());
533
                 req.setUserId(loginUser.getUserId());
504
             }
534
             }
701
                     if(CollectionUtil.isNotEmpty(applicant)){
731
                     if(CollectionUtil.isNotEmpty(applicant)){
702
                         for (int i = 0; i < applicant.size(); i++) {
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
                     if(CollectionUtil.isNotEmpty(res)){
739
                     if(CollectionUtil.isNotEmpty(res)){
710
                         for (int i = 0; i < res.size(); i++) {
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
             if (appOperatorCount < 1 && resOperatorCount < 1) {
747
             if (appOperatorCount < 1 && resOperatorCount < 1) {
769
      * 设置案件相关信息
799
      * 设置案件相关信息
770
      * @param caseApplication
800
      * @param caseApplication
771
      * @param affiliate
801
      * @param affiliate
802
+     * @param groupOrder 组别
803
+     * @param operatorCount 操作人数量
804
+     * @param updateFlag 是否修改案件
772
      */
805
      */
773
     @Transactional
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
         if(affiliate==null){
808
         if(affiliate==null){
776
             return operatorCount;
809
             return operatorCount;
777
         }
810
         }
793
         }
826
         }
794
         affiliate.setCaseAppliId(caseApplication.getId());
827
         affiliate.setCaseAppliId(caseApplication.getId());
795
         List<Long> roleIdList = new ArrayList<>();
828
         List<Long> roleIdList = new ArrayList<>();
796
-     //   Long roleId = null;
797
-
798
             switch (affiliate.getRoleType()) {
829
             switch (affiliate.getRoleType()) {
799
                 case 1:
830
                 case 1:
800
                     roleIdList.add((Long) applicantObj);
831
                     roleIdList.add((Long) applicantObj);
827
                     }
858
                     }
828
                     break;
859
                     break;
829
                 default:
860
                 default:
830
-
831
                     break;
861
                     break;
832
             }
862
             }
833
         // 如果是申请人,则和用户表关联
863
         // 如果是申请人,则和用户表关联
834
         if (affiliate.getOrganizeFlag() == 0) {
864
         if (affiliate.getOrganizeFlag() == 0) {
835
-            caseApplicationService.insertAfficateUser(affiliate, roleIdList);
865
+            caseApplicationService.insertAfficateUser(affiliate, roleIdList, updateFlag);
836
         } else {
866
         } else {
837
             // 申请机构
867
             // 申请机构
838
             if (affiliate.getRoleType() == 1 || affiliate.getRoleType()==3) {
868
             if (affiliate.getRoleType() == 1 || affiliate.getRoleType()==3) {
839
                 affiliate.setOperatorFlag(0);
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
                 if (dept==null) {
883
                 if (dept==null) {
844
                     // 不存在该部门,新增
884
                     // 不存在该部门,新增
845
                     dept = new SysDept();
885
                     dept = new SysDept();
872
                 }
912
                 }
873
                 affiliate.setApplicantDeptId(dept.getDeptId());
913
                 affiliate.setApplicantDeptId(dept.getDeptId());
874
             } else {
914
             } else {
875
-                caseApplicationService.insertAfficateUser(affiliate, roleIdList);
915
+                caseApplicationService.insertAfficateUser(affiliate, roleIdList, updateFlag);
876
             }
916
             }
877
         }
917
         }
878
         // 保存人员
918
         // 保存人员
887
      * 新增案件相关人员信息
927
      * 新增案件相关人员信息
888
      * @param affiliate 相关人员信息
928
      * @param affiliate 相关人员信息
889
      * @param roleIdList 角色id
929
      * @param roleIdList 角色id
930
+     * @param updateFlag 是否修改案件
890
 
931
 
891
      */
932
      */
892
     @Transactional
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
         if(StrUtil.isEmpty(affiliate.getEmail())){
936
         if(StrUtil.isEmpty(affiliate.getEmail())){
896
             return;
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
         if(user==null){
952
         if(user==null){
901
             // 不存在,则新增
953
             // 不存在,则新增
1079
             if(CollectionUtil.isNotEmpty(applicant)){
1131
             if(CollectionUtil.isNotEmpty(applicant)){
1080
                 for (int i = 0; i < applicant.size(); i++) {
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
             if(CollectionUtil.isNotEmpty(res)){
1139
             if(CollectionUtil.isNotEmpty(res)){
1088
                 for (int i = 0; i < res.size(); i++) {
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
         if (appOperatorCount < 1 && resOperatorCount < 1) {
1147
         if (appOperatorCount < 1 && resOperatorCount < 1) {
2442
         }
2494
         }
2443
         application.setRejectReason(reason);
2495
         application.setRejectReason(reason);
2444
         if(application.getCaseFlowId()!=null && application.getCaseFlowId()==4){
2496
         if(application.getCaseFlowId()!=null && application.getCaseFlowId()==4){
2445
-            // todo 超过五日还没有受理,给申请操作人发送不受理通知,有手机号发短信,没有手机号发邮箱
2446
-            // 申请人不受理分配通知 // todo 短信异步
2497
+            //  超过五日还没有受理,给申请操作人发送不受理通知,有手机号发短信,没有手机号发邮箱
2498
+            // 申请人不受理分配通知 //  短信异步
2447
             ExecutorService executor = ThreadUtil.createThreadPool();
2499
             ExecutorService executor = ThreadUtil.createThreadPool();
2448
             CompletableFuture.runAsync(() -> {
2500
             CompletableFuture.runAsync(() -> {
2449
             String rejectReason = application.getRejectReason() == null ? "" : application.getRejectReason();
2501
             String rejectReason = application.getRejectReason() == null ? "" : application.getRejectReason();
2566
         if (CollectionUtil.isEmpty(affiliates)) {
2618
         if (CollectionUtil.isEmpty(affiliates)) {
2567
             throw new ServiceException("未找到案件人员");
2619
             throw new ServiceException("未找到案件人员");
2568
         }
2620
         }
2621
+        //  签名时取用户为申请人角色并且是申请操作人
2569
         // 申请操作人
2622
         // 申请操作人
2570
         Optional<MsCaseAffiliate> applicantAffiliateOpt = affiliates.stream().filter(affiliate -> affiliate.getOperatorFlag() == 1 && StrUtil.isNotEmpty(affiliate.getPhone()) && (affiliate.getRoleType().equals(1) || affiliate.getRoleType().equals(2))).findFirst();
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 Ver fichero

77
 import java.util.stream.Collectors;
77
 import java.util.stream.Collectors;
78
 
78
 
79
 import static com.google.common.io.Files.getFileExtension;
79
 import static com.google.common.io.Files.getFileExtension;
80
+import static com.ruoyi.common.core.domain.AjaxResult.error;
80
 import static com.ruoyi.common.core.domain.AjaxResult.success;
81
 import static com.ruoyi.common.core.domain.AjaxResult.success;
81
 
82
 
82
 @Slf4j
83
 @Slf4j
180
 
181
 
181
     @Override
182
     @Override
182
     public SealSignRecord selectSealUrl(MsSignSealDTO dto) throws EsignDemoException {
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
         Example example = new Example(MsSealSignRecord.class);
189
         Example example = new Example(MsSealSignRecord.class);
184
         Example.Criteria criteria = example.createCriteria();
190
         Example.Criteria criteria = example.createCriteria();
185
         criteria.andEqualTo("caseAppliId", dto.getCaseId());
191
         criteria.andEqualTo("caseAppliId", dto.getCaseId());
200
             JsonObject signUrlData = signUrlJsonObject.getAsJsonObject("data");
206
             JsonObject signUrlData = signUrlJsonObject.getAsJsonObject("data");
201
             String url = signUrlData.get("shortUrl").getAsString();
207
             String url = signUrlData.get("shortUrl").getAsString();
202
             sealSignRecordReslt.setSealUrl(url);
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
         return sealSignRecordReslt;
227
         return sealSignRecordReslt;
205
     }
228
     }
316
                 if (record.getCreateTime() != null) {
339
                 if (record.getCreateTime() != null) {
317
                     caseNodeTime = DateUtil.format(record.getCreateTime(), DatePattern.NORM_DATETIME_FORMATTER);
340
                     caseNodeTime = DateUtil.format(record.getCreateTime(), DatePattern.NORM_DATETIME_FORMATTER);
318
                 }
341
                 }
342
+
319
                 Integer caseNode = record.getCaseNode();
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
             JSONObject operator = jsonObjectCallback.getJSONObject("operator");
697
             JSONObject operator = jsonObjectCallback.getJSONObject("operator");
668
             JSONObject psnAccount = operator.getJSONObject("psnAccount");
698
             JSONObject psnAccount = operator.getJSONObject("psnAccount");
669
             String accountMobile = psnAccount.getString("accountMobile");
699
             String accountMobile = psnAccount.getString("accountMobile");
700
+            // 根据电话查询用户名
701
+            SysUser sysUser = sysUserMapper.selectUserByPhone(accountMobile);
670
 
702
 
671
             Example msSealSignRecordExample = new Example(MsSealSignRecord.class);
703
             Example msSealSignRecordExample = new Example(MsSealSignRecord.class);
672
             msSealSignRecordExample.createCriteria().andEqualTo("signFlowId", signFlowId);
704
             msSealSignRecordExample.createCriteria().andEqualTo("signFlowId", signFlowId);
673
             MsSealSignRecord sealSignRecordsel = sealSignRecordMapper.selectOneByExample(msSealSignRecordExample);
705
             MsSealSignRecord sealSignRecordsel = sealSignRecordMapper.selectOneByExample(msSealSignRecordExample);
674
-
706
+            if(sealSignRecordsel==null){
707
+                return error("未找到签署流程");
708
+            }
675
             String pensonAccountApply = sealSignRecordsel.getPensonAccount();
709
             String pensonAccountApply = sealSignRecordsel.getPensonAccount();
676
             String orgnNamePsnAcc = sealSignRecordsel.getOrgnNamePsnAcc();
710
             String orgnNamePsnAcc = sealSignRecordsel.getOrgnNamePsnAcc();
677
             String pensonAccountRes = sealSignRecordsel.getPensonAccountRes();
711
             String pensonAccountRes = sealSignRecordsel.getPensonAccountRes();
701
                         sealSignRecordsel.setSignStatusApply(1);
735
                         sealSignRecordsel.setSignStatusApply(1);
702
                         sealSignRecordMapper.updateByPrimaryKeySelective(sealSignRecordsel);
736
                         sealSignRecordMapper.updateByPrimaryKeySelective(sealSignRecordsel);
703
                         MsCaseLogRecord operLog = new MsCaseLogRecord();
737
                         MsCaseLogRecord operLog = new MsCaseLogRecord();
738
+                        if(sysUser!=null){
739
+                            operLog.setCreateBy(sysUser.getUserName());
740
+                        }
704
                         operLog.setCreateNickName(pensonName);
741
                         operLog.setCreateNickName(pensonName);
705
                         operLog.setCaseStatusName(caseStatusName);
742
                         operLog.setCaseStatusName(caseStatusName);
706
                         operLog.setCaseAppliId(caseAppliId);
743
                         operLog.setCaseAppliId(caseAppliId);
742
                         sealSignRecordsel.setSignStatusResponse(1);
779
                         sealSignRecordsel.setSignStatusResponse(1);
743
                         sealSignRecordMapper.updateByPrimaryKeySelective(sealSignRecordsel);
780
                         sealSignRecordMapper.updateByPrimaryKeySelective(sealSignRecordsel);
744
                         MsCaseLogRecord operLog = new MsCaseLogRecord();
781
                         MsCaseLogRecord operLog = new MsCaseLogRecord();
782
+                        if(sysUser!=null){
783
+                            operLog.setCreateBy(sysUser.getUserName());
784
+                        }
745
                         operLog.setCreateNickName(pensonNameRes);
785
                         operLog.setCreateNickName(pensonNameRes);
746
                         operLog.setCaseStatusName(caseStatusName);
786
                         operLog.setCaseStatusName(caseStatusName);
747
                         operLog.setCaseAppliId(caseAppliId);
787
                         operLog.setCaseAppliId(caseAppliId);
784
                         sealSignRecordsel.setSignStatusMediator(1);
824
                         sealSignRecordsel.setSignStatusMediator(1);
785
                         sealSignRecordMapper.updateByPrimaryKeySelective(sealSignRecordsel);
825
                         sealSignRecordMapper.updateByPrimaryKeySelective(sealSignRecordsel);
786
                         MsCaseLogRecord operLog = new MsCaseLogRecord();
826
                         MsCaseLogRecord operLog = new MsCaseLogRecord();
827
+                        if(sysUser!=null){
828
+                            operLog.setCreateBy(sysUser.getUserName());
829
+                        }
787
                         operLog.setCreateNickName(pensonNameMedi);
830
                         operLog.setCreateNickName(pensonNameMedi);
788
                         operLog.setCaseStatusName(caseStatusName);
831
                         operLog.setCaseStatusName(caseStatusName);
789
                         operLog.setCaseAppliId(caseAppliId);
832
                         operLog.setCaseAppliId(caseAppliId);
826
                         sealSignRecordsel.setSealStatus(1);
869
                         sealSignRecordsel.setSealStatus(1);
827
                         sealSignRecordsel.setSignFlowStatus(3);
870
                         sealSignRecordsel.setSignFlowStatus(3);
828
                         sealSignRecordMapper.updateByPrimaryKeySelective(sealSignRecordsel);
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
                         // 根据流程id查找下一个流程节点
874
                         // 根据流程id查找下一个流程节点
838
                         MsCaseFlow nextFlow = caseFlowMapper.nextFlow(caseApplicationselect.getCaseFlowId());
875
                         MsCaseFlow nextFlow = caseFlowMapper.nextFlow(caseApplicationselect.getCaseFlowId());
854
                         sealSignRecordsel.setSignStatusApply(1);
891
                         sealSignRecordsel.setSignStatusApply(1);
855
                         sealSignRecordMapper.updateByPrimaryKeySelective(sealSignRecordsel);
892
                         sealSignRecordMapper.updateByPrimaryKeySelective(sealSignRecordsel);
856
                         MsCaseLogRecord operLog = new MsCaseLogRecord();
893
                         MsCaseLogRecord operLog = new MsCaseLogRecord();
894
+                        if(sysUser!=null){
895
+                            operLog.setCreateBy(sysUser.getUserName());
896
+                        }
857
                         operLog.setCreateNickName(pensonName);
897
                         operLog.setCreateNickName(pensonName);
858
                         operLog.setCaseStatusName(caseStatusName);
898
                         operLog.setCaseStatusName(caseStatusName);
859
                         operLog.setCaseAppliId(caseAppliId);
899
                         operLog.setCaseAppliId(caseAppliId);
874
 
914
 
875
                             //下载审核完成的调解书
915
                             //下载审核完成的调解书
876
                             msSignSealService.downloadMediationBook(caseApplicationselect, signFlowId, gson, caseAppliId);
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
                     } else if (StringUtils.isNotEmpty(accountMobile) && accountMobile.equals(pensonAccountRes)) {
919
                     } else if (StringUtils.isNotEmpty(accountMobile) && accountMobile.equals(pensonAccountRes)) {
944
                         //被申请人签名
920
                         //被申请人签名
945
                         sealSignRecordsel.setSignStatusResponse(1);
921
                         sealSignRecordsel.setSignStatusResponse(1);
946
                         sealSignRecordMapper.updateByPrimaryKeySelective(sealSignRecordsel);
922
                         sealSignRecordMapper.updateByPrimaryKeySelective(sealSignRecordsel);
947
                         MsCaseLogRecord operLog = new MsCaseLogRecord();
923
                         MsCaseLogRecord operLog = new MsCaseLogRecord();
924
+                        if(sysUser!=null){
925
+                            operLog.setCreateBy(sysUser.getUserName());
926
+                        }
948
                         operLog.setCreateNickName(pensonNameRes);
927
                         operLog.setCreateNickName(pensonNameRes);
949
                         operLog.setCaseStatusName(caseStatusName);
928
                         operLog.setCaseStatusName(caseStatusName);
950
                         operLog.setCaseAppliId(caseAppliId);
929
                         operLog.setCaseAppliId(caseAppliId);
965
 
944
 
966
                             //下载审核完成的调解书
945
                             //下载审核完成的调解书
967
                             msSignSealService.downloadMediationBook(caseApplicationselect, signFlowId, gson, caseAppliId);
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
         sendMailRecord.setSendTime(new Date());
1158
         sendMailRecord.setSendTime(new Date());
1245
         sendMailRecord.setMailSubject("签署后的调解书");
1159
         sendMailRecord.setMailSubject("签署后的调解书");
1246
         sendMailRecord.setMailFromAddress(emailFrom);
1160
         sendMailRecord.setMailFromAddress(emailFrom);
1247
-        sendMailRecord.setFileIds(fileId != null ? fileId.toString() : null);
1161
+        sendMailRecord.setFileIds(fileId != null ? fileId.toString() : "");
1248
 //        sendMailRecord.setCreateBy(SecurityUtils.getUsername());
1162
 //        sendMailRecord.setCreateBy(SecurityUtils.getUsername());
1249
         sendMailRecord.setCreateTime(new Date());
1163
         sendMailRecord.setCreateTime(new Date());
1250
         sendMailRecord.setMailFromAddress(emailFrom);
1164
         sendMailRecord.setMailFromAddress(emailFrom);

+ 10
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/VideoConferenceServiceImpl.java Ver fichero

3
 import cn.hutool.core.collection.CollectionUtil;
3
 import cn.hutool.core.collection.CollectionUtil;
4
 import cn.hutool.core.io.FileUtil;
4
 import cn.hutool.core.io.FileUtil;
5
 import cn.hutool.core.util.StrUtil;
5
 import cn.hutool.core.util.StrUtil;
6
+import cn.hutool.http.HttpRequest;
7
+import cn.hutool.http.HttpResponse;
6
 import cn.hutool.http.HttpUtil;
8
 import cn.hutool.http.HttpUtil;
7
 import cn.hutool.json.JSONArray;
9
 import cn.hutool.json.JSONArray;
8
 import cn.hutool.json.JSONUtil;
10
 import cn.hutool.json.JSONUtil;
108
     BeiMingInterfaceService beiMingInterfaceService;
110
     BeiMingInterfaceService beiMingInterfaceService;
109
     @Autowired
111
     @Autowired
110
     private SmsRecordMapper smsRecordMapper;
112
     private SmsRecordMapper smsRecordMapper;
113
+    // 仲裁短信回调
114
+    @Value("${arbitrateConfig.smsURL}")
115
+    private String smsURL;
111
 
116
 
112
     /**
117
     /**
113
         视频回调
118
         视频回调
173
                             smsSendRecord.setReason(description != null ? description.toString() : null);
178
                             smsSendRecord.setReason(description != null ? description.toString() : null);
174
                         }
179
                         }
175
                         smsRecordMapper.updateStatus(smsSendRecord);
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 Ver fichero

1
 package com.ruoyi.wisdomarbitrate.service.sendrecord.impl;
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
 import com.ruoyi.common.core.domain.AjaxResult;
6
 import com.ruoyi.common.core.domain.AjaxResult;
4
 import com.ruoyi.common.utils.EmailOutUtil;
7
 import com.ruoyi.common.utils.EmailOutUtil;
5
 import com.ruoyi.system.domain.entity.shortmessage.MsSendMailHistoryRecord;
8
 import com.ruoyi.system.domain.entity.shortmessage.MsSendMailHistoryRecord;
14
 import org.springframework.stereotype.Service;
17
 import org.springframework.stereotype.Service;
15
 
18
 
16
 import java.io.File;
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
 @Service
24
 @Service
23
 public class SendMailRecordServiceImpl implements ISendMailRecordService {
25
 public class SendMailRecordServiceImpl implements ISendMailRecordService {
28
     @Override
30
     @Override
29
     public List<SendMailRecord> selectSendMailRecordList(SendMailRecord sendMailRecord) {
31
     public List<SendMailRecord> selectSendMailRecordList(SendMailRecord sendMailRecord) {
30
         List<SendMailRecord> records = sendMailRecordMapper.selectSendMailRecord(sendMailRecord);
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
         return records;
58
         return records;
32
     }
59
     }
33
 
60
 
50
                 msSendMailHistoryRecord.setId(null);
77
                 msSendMailHistoryRecord.setId(null);
51
                 msSendMailHistoryRecordMapper.insertSelective(msSendMailHistoryRecord);
78
                 msSendMailHistoryRecordMapper.insertSelective(msSendMailHistoryRecord);
52
                 sendMailRecord.setUpdateTime(new Date());
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
                 sendMailRecordMapper.updateSendMailRecord(sendMailRecord);
87
                 sendMailRecordMapper.updateSendMailRecord(sendMailRecord);
54
                 return AjaxResult.success("编辑成功");
88
                 return AjaxResult.success("编辑成功");
55
             } else {
89
             } else {

+ 1
- 1
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/sms/SMSTemplateService.java Ver fichero

7
 
7
 
8
 /**
8
 /**
9
  * @Classname SMSTemplateService
9
  * @Classname SMSTemplateService
10
- * @Description TODO
10
+ * @Description
11
  * @Version 1.0.0
11
  * @Version 1.0.0
12
  * @Date 2024/4/16 11:39
12
  * @Date 2024/4/16 11:39
13
  * @Created wangqiong
13
  * @Created wangqiong

+ 2
- 2
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/sms/impl/SMSTemplateServiceImpl.java Ver fichero

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

+ 1
- 1
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/FixSelectFlowDetailUtils.java Ver fichero

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

+ 5
- 0
ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml Ver fichero

180
 			left join ms_sys_role r on r.role_id = ur.role_id
180
 			left join ms_sys_role r on r.role_id = ur.role_id
181
 		where u.id_card = #{idCard} and u.del_flag = '0' and u.status='0' order by u.create_time limit 1
181
 		where u.id_card = #{idCard} and u.del_flag = '0' and u.status='0' order by u.create_time limit 1
182
 	</select>
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
 	<select id="selectUserByEmail" parameterType="String" resultMap="SysUserResult">
188
 	<select id="selectUserByEmail" parameterType="String" resultMap="SysUserResult">
184
 		select u.*,ur.role_id
189
 		select u.*,ur.role_id
185
 			from ms_sys_user u
190
 			from ms_sys_user u

+ 1
- 1
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/mscase/MsCaseAffiliateMapper.xml Ver fichero

40
   </select>
40
   </select>
41
     <select id="selectByCaseId" resultType="com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAffiliate">
41
     <select id="selectByCaseId" resultType="com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAffiliate">
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,
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
                (case when a.user_id is null then d.dept_name else u.nick_name end)  name,
44
                (case when a.user_id is null then d.dept_name else u.nick_name end)  name,
45
                (case when a.user_id is null then d.home else u.home end) home,
45
                (case when a.user_id is null then d.home else u.home end) home,
46
                (case when a.user_id is null then d.address else u.address end) address,
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 Ver fichero

40
     JOIN ms_case_affiliate a ON c.id = a.case_appli_id
40
     JOIN ms_case_affiliate a ON c.id = a.case_appli_id
41
     LEFT JOIN ms_sys_user u ON u.user_id = a.user_id
41
     LEFT JOIN ms_sys_user u ON u.user_id = a.user_id
42
     LEFT JOIN ms_sys_user u1 ON u1.user_id = c.mediator_id
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
     LEFT JOIN ms_sys_dept d ON d.dept_id = a.applicant_dept_id
46
     LEFT JOIN ms_sys_dept d ON d.dept_id = a.applicant_dept_id
46
     <where>
47
     <where>
47
 <!--      调解员角色和申请人,被申,代理人-->
48
 <!--      调解员角色和申请人,被申,代理人-->
48
       <if test = 'req.mediatorId != null and req.userId!=null'>
49
       <if test = 'req.mediatorId != null and req.userId!=null'>
49
         AND (c.mediator_id = #{req.mediatorId} or a.user_id=#{req.userId})
50
         AND (c.mediator_id = #{req.mediatorId} or a.user_id=#{req.userId})
50
       </if>
51
       </if>
52
+
51
 <!--      admin,财务,顾问,部门长查看所有案件,申请人,被申,代理人根据userId查-->
53
 <!--      admin,财务,顾问,部门长查看所有案件,申请人,被申,代理人根据userId查-->
52
       <if test = 'req.mediatorId == null and  req.userId != null'>
54
       <if test = 'req.mediatorId == null and  req.userId != null'>
53
         AND (a.user_id=#{req.userId} )
55
         AND (a.user_id=#{req.userId} )
54
       </if>
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
       <if test='roleIds != null and roleIds.size() > 0 '>
67
       <if test='roleIds != null and roleIds.size() > 0 '>
57
         and  r.role_id in
68
         and  r.role_id in
75
       </if>
86
       </if>
76
       <!--  案件编号-->
87
       <!--  案件编号-->
77
       <if test = 'req.caseNum != null and req.caseNum != "" '>
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
       </if>
90
       </if>
91
+
87
     </where>
92
     </where>
88
 
93
 
89
   </sql>
94
   </sql>
113
   <select id="list" resultType="com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseApplicationVO">
118
   <select id="list" resultType="com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseApplicationVO">
114
     select t.* from(
119
     select t.* from(
115
     SELECT
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
     c.case_flow_id caseFlowId,c.batch_number batchNumber,c.case_num caseNum,
122
     c.case_flow_id caseFlowId,c.batch_number batchNumber,c.case_num caseNum,
118
     u1.nick_name mediatorName,c.hear_date hearDate,c.case_status_name caseStatusName,c.create_time createTime,
123
     u1.nick_name mediatorName,c.hear_date hearDate,c.case_status_name caseStatusName,c.create_time createTime,
119
     c.mediation_method mediationMethod,
124
     c.mediation_method mediationMethod,
123
     c.id
128
     c.id
124
     union
129
     union
125
     SELECT
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
     c.case_flow_id caseFlowId,c.batch_number batchNumber,c.case_num caseNum,
132
     c.case_flow_id caseFlowId,c.batch_number batchNumber,c.case_num caseNum,
128
     u1.nick_name mediatorName,c.hear_date hearDate,c.case_status_name caseStatusName,c.create_time createTime,
133
     u1.nick_name mediatorName,c.hear_date hearDate,c.case_status_name caseStatusName,c.create_time createTime,
129
     c.mediation_method mediationMethod,
134
     c.mediation_method mediationMethod,
149
       </if>
154
       </if>
150
       <!--  案件编号-->
155
       <!--  案件编号-->
151
       <if test = 'req.caseNum != null and req.caseNum != "" '>
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
       </if>
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
     </where>
167
     </where>
163
     GROUP BY
168
     GROUP BY
164
     c.id
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
   </select>
191
   </select>
168
   <select id="countCasePerson" resultType="java.lang.Long">
192
   <select id="countCasePerson" resultType="java.lang.Long">

+ 8
- 1
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/mscase/MsCaseAttachMapper.xml Ver fichero

157
         </where>
157
         </where>
158
     </update>
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
 </mapper>
168
 </mapper>

+ 2
- 2
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/sendrecord/SendMailRecordMapper.xml Ver fichero

21
 
21
 
22
     <select id="selectSendMailRecord" parameterType="com.ruoyi.wisdomarbitrate.domain.dto.sendrecord.SendMailRecord"
22
     <select id="selectSendMailRecord" parameterType="com.ruoyi.wisdomarbitrate.domain.dto.sendrecord.SendMailRecord"
23
             resultMap="SendMailRecordResult">
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
         from ms_send_mail_record s left join ms_case_application c
25
         from ms_send_mail_record s left join ms_case_application c
27
         on s.case_id = c.id
26
         on s.case_id = c.id
28
         <where>
27
         <where>
67
         <if test="updateTime != null ">,update_time=#{updateTime}</if>
66
         <if test="updateTime != null ">,update_time=#{updateTime}</if>
68
         <if test="sendTime != null ">,send_time=#{sendTime}</if>
67
         <if test="sendTime != null ">,send_time=#{sendTime}</if>
69
         <if test="sendStatus != null ">,send_status=#{sendStatus}</if>
68
         <if test="sendStatus != null ">,send_status=#{sendStatus}</if>
69
+        <if test="fileIds != null  and fileIds != ''">,file_ids=#{fileIds}</if>
70
         where id = #{id}
70
         where id = #{id}
71
     </update>
71
     </update>
72
     <select id="querySendMailRecordById" resultMap="SendMailRecordResult">
72
     <select id="querySendMailRecordById" resultMap="SendMailRecordResult">