Kaynağa Gözat

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

wangqiong123 2 yıl önce
ebeveyn
işleme
c596c5654f
38 değiştirilmiş dosya ile 1303 ekleme ve 190 silme
  1. 17
    0
      ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java
  2. 8
    4
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/flow/CaseFlowController.java
  3. 23
    14
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictDataController.java
  4. 32
    12
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java
  5. 31
    7
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/mscase/MsCaseApplicationController.java
  6. 20
    0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/mscase/MsSignSealController.java
  7. 7
    0
      ruoyi-admin/src/main/resources/application.yml
  8. 4
    0
      ruoyi-common/src/main/java/com/ruoyi/common/constant/CacheConstants.java
  9. 23
    1
      ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java
  10. 24
    0
      ruoyi-common/src/main/java/com/ruoyi/common/core/domain/model/LoginBody.java
  11. 1
    1
      ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java
  12. 93
    13
      ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysLoginService.java
  13. 24
    11
      ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/TokenService.java
  14. 28
    0
      ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/flow/MsBaseCaseFlow.java
  15. 4
    0
      ruoyi-system/src/main/java/com/ruoyi/system/mapper/flow/MsCaseFlowMapper.java
  16. 8
    0
      ruoyi-system/src/main/java/com/ruoyi/system/service/flow/CaseFlowService.java
  17. 8
    0
      ruoyi-system/src/main/java/com/ruoyi/system/service/flow/CaseFlowServiceImpl.java
  18. 3
    0
      ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java
  19. 24
    1
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/dto/miniprogress/IdentityAuthentication.java
  20. 21
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/entity/dept/MsSealSignRecord.java
  21. 10
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/entity/mscase/MsCaseAffiliate.java
  22. 3
    3
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/entity/mscase/MsCaseAttach.java
  23. 7
    1
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/mscase/MsCaseApplicationVO.java
  24. 19
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/mscase/MsCaseBatchInsertVO.java
  25. 10
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/mscase/MsCaseLogRecordMapper.java
  26. 2
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/miniprogress/impl/WeChatUserServiceImpl.java
  27. 27
    2
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/MsCaseApplicationService.java
  28. 3
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/MsSignSealService.java
  29. 304
    100
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/MsCaseApplicationServiceImpl.java
  30. 2
    2
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/MsCasePaymentServiceImpl.java
  31. 341
    5
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/MsSignSealServiceImpl.java
  32. 46
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/DigesdateUtils.java
  33. 1
    1
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/FixSelectFlowDetailUtils.java
  34. 5
    1
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/SignAward.java
  35. 99
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/SignVerifyUtils.java
  36. 9
    1
      ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml
  37. 4
    0
      ruoyi-system/src/main/resources/mapper/wisdomarbitrate/dept/MsSealSignRecordMapper.xml
  38. 8
    10
      ruoyi-system/src/main/resources/mapper/wisdomarbitrate/mscase/MsCaseAttachMapper.xml

+ 17
- 0
ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java Dosyayı Görüntüle

@@ -1,11 +1,19 @@
1 1
 package com.ruoyi;
2 2
 
3
+import cn.hutool.core.collection.CollectionUtil;
4
+import com.ruoyi.common.constant.CacheConstants;
5
+import com.ruoyi.common.core.domain.entity.SysUser;
6
+import com.ruoyi.common.core.redis.RedisCache;
7
+import com.ruoyi.common.utils.spring.SpringUtils;
8
+import com.ruoyi.system.mapper.SysUserMapper;
3 9
 import org.springframework.boot.SpringApplication;
4 10
 import org.springframework.boot.autoconfigure.SpringBootApplication;
5 11
 import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
6 12
 import org.springframework.scheduling.annotation.EnableScheduling;
7 13
 import springfox.documentation.swagger2.annotations.EnableSwagger2;
8 14
 
15
+import java.util.List;
16
+
9 17
 /**
10 18
  * 启动程序
11 19
  * 
@@ -30,5 +38,14 @@ public class RuoYiApplication
30 38
                 " |  | \\ `'   /|   `-'  /           \n" +
31 39
                 " |  |  \\    /  \\      /           \n" +
32 40
                 " ''-'   `'-'    `-..-'              ");
41
+        // 启动成功后,查询用户表,将用户信息存到redis
42
+        RedisCache redisCache = SpringUtils.getBean(RedisCache.class);
43
+        SysUserMapper userMapper = SpringUtils.getBean(SysUserMapper.class);
44
+        List<SysUser> sysUsers = userMapper.selectUserListByIds(null);
45
+        if(CollectionUtil.isNotEmpty(sysUsers)){
46
+            for (SysUser sysUser : sysUsers) {
47
+                redisCache.setCacheObject(CacheConstants.USER_KEY+sysUser.getUserId(),sysUser);
48
+            }
49
+        }
33 50
     }
34 51
 }

+ 8
- 4
ruoyi-admin/src/main/java/com/ruoyi/web/controller/flow/CaseFlowController.java Dosyayı Görüntüle

@@ -5,10 +5,7 @@ import com.ruoyi.system.domain.vo.flow.MsCaseFlowSearchVO;
5 5
 import com.ruoyi.system.domain.vo.flow.MsCaseFlowVO;
6 6
 import com.ruoyi.system.service.flow.CaseFlowService;
7 7
 import org.springframework.beans.factory.annotation.Autowired;
8
-import org.springframework.web.bind.annotation.PostMapping;
9
-import org.springframework.web.bind.annotation.RequestBody;
10
-import org.springframework.web.bind.annotation.RequestMapping;
11
-import org.springframework.web.bind.annotation.RestController;
8
+import org.springframework.web.bind.annotation.*;
12 9
 
13 10
 import static com.ruoyi.common.core.domain.AjaxResult.success;
14 11
 
@@ -28,6 +25,13 @@ public class CaseFlowController {
28 25
     public Object queryCaseFlowInfo(@RequestBody MsCaseFlowSearchVO caseFlowSearchVO) {
29 26
         return caseFlowService.queryCaseFlowInfo(caseFlowSearchVO);
30 27
     }
28
+    /**
29
+     * 查询案件流程信息
30
+     */
31
+    @GetMapping("/selectCaseFlow")
32
+    public AjaxResult selectCaseFlow() {
33
+        return caseFlowService.selectCaseFlow();
34
+    }
31 35
 
32 36
     /**
33 37
      * 新增或编辑案件流程节点信息

+ 23
- 14
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictDataController.java Dosyayı Görüntüle

@@ -1,19 +1,6 @@
1 1
 package com.ruoyi.web.controller.system;
2 2
 
3
-import java.util.ArrayList;
4
-import java.util.List;
5
-import javax.servlet.http.HttpServletResponse;
6
-import org.springframework.beans.factory.annotation.Autowired;
7
-import org.springframework.security.access.prepost.PreAuthorize;
8
-import org.springframework.validation.annotation.Validated;
9
-import org.springframework.web.bind.annotation.DeleteMapping;
10
-import org.springframework.web.bind.annotation.GetMapping;
11
-import org.springframework.web.bind.annotation.PathVariable;
12
-import org.springframework.web.bind.annotation.PostMapping;
13
-import org.springframework.web.bind.annotation.PutMapping;
14
-import org.springframework.web.bind.annotation.RequestBody;
15
-import org.springframework.web.bind.annotation.RequestMapping;
16
-import org.springframework.web.bind.annotation.RestController;
3
+import com.ruoyi.common.annotation.Anonymous;
17 4
 import com.ruoyi.common.annotation.Log;
18 5
 import com.ruoyi.common.core.controller.BaseController;
19 6
 import com.ruoyi.common.core.domain.AjaxResult;
@@ -24,6 +11,14 @@ import com.ruoyi.common.utils.StringUtils;
24 11
 import com.ruoyi.common.utils.poi.ExcelUtil;
25 12
 import com.ruoyi.system.service.ISysDictDataService;
26 13
 import com.ruoyi.system.service.ISysDictTypeService;
14
+import org.springframework.beans.factory.annotation.Autowired;
15
+import org.springframework.security.access.prepost.PreAuthorize;
16
+import org.springframework.validation.annotation.Validated;
17
+import org.springframework.web.bind.annotation.*;
18
+
19
+import javax.servlet.http.HttpServletResponse;
20
+import java.util.ArrayList;
21
+import java.util.List;
27 22
 
28 23
 /**
29 24
  * 数据字典信息
@@ -82,6 +77,20 @@ public class SysDictDataController extends BaseController
82 77
         }
83 78
         return success(data);
84 79
     }
80
+    /**
81
+     * 根据字典类型查询字典数据信息,跳过token
82
+     */
83
+    @Anonymous
84
+    @GetMapping(value = "/type/skipToken/{dictType}")
85
+    public AjaxResult skipToken(@PathVariable String dictType)
86
+    {
87
+        List<SysDictData> data = dictTypeService.selectDictDataByType(dictType);
88
+        if (StringUtils.isNull(data))
89
+        {
90
+            data = new ArrayList<SysDictData>();
91
+        }
92
+        return success(data);
93
+    }
85 94
 
86 95
     /**
87 96
      * 新增字典类型

+ 32
- 12
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java Dosyayı Görüntüle

@@ -1,17 +1,7 @@
1 1
 package com.ruoyi.web.controller.system;
2 2
 
3
-import java.util.List;
4
-import java.util.Set;
5
-
6
-import com.ruoyi.system.service.ISysUserService;
7
-import com.ruoyi.system.service.flow.CaseFlowService;
8
-import com.ruoyi.wisdomarbitrate.domain.dto.miniprogress.IdentityAuthentication;
9
-import com.ruoyi.wisdomarbitrate.service.miniprogress.IdentityAuthenticationService;
10
-import org.springframework.beans.factory.annotation.Autowired;
11
-import org.springframework.web.bind.annotation.GetMapping;
12
-import org.springframework.web.bind.annotation.PostMapping;
13
-import org.springframework.web.bind.annotation.RequestBody;
14
-import org.springframework.web.bind.annotation.RestController;
3
+import cn.hutool.core.util.StrUtil;
4
+import cn.hutool.crypto.digest.MD5;
15 5
 import com.ruoyi.common.constant.Constants;
16 6
 import com.ruoyi.common.core.domain.AjaxResult;
17 7
 import com.ruoyi.common.core.domain.entity.SysMenu;
@@ -20,7 +10,20 @@ import com.ruoyi.common.core.domain.model.LoginBody;
20 10
 import com.ruoyi.common.utils.SecurityUtils;
21 11
 import com.ruoyi.framework.web.service.SysLoginService;
22 12
 import com.ruoyi.framework.web.service.SysPermissionService;
13
+import com.ruoyi.framework.web.service.TokenService;
23 14
 import com.ruoyi.system.service.ISysMenuService;
15
+import com.ruoyi.system.service.ISysUserService;
16
+import com.ruoyi.system.service.flow.CaseFlowService;
17
+import com.ruoyi.wisdomarbitrate.domain.dto.miniprogress.IdentityAuthentication;
18
+import com.ruoyi.wisdomarbitrate.service.miniprogress.IdentityAuthenticationService;
19
+import org.springframework.beans.factory.annotation.Autowired;
20
+import org.springframework.web.bind.annotation.GetMapping;
21
+import org.springframework.web.bind.annotation.PostMapping;
22
+import org.springframework.web.bind.annotation.RequestBody;
23
+import org.springframework.web.bind.annotation.RestController;
24
+
25
+import java.util.List;
26
+import java.util.Set;
24 27
 
25 28
 /**
26 29
  * 登录验证
@@ -43,6 +46,8 @@ public class SysLoginController {
43 46
     private ISysUserService sysUserService;
44 47
     @Autowired
45 48
     private CaseFlowService caseFlowService;
49
+    @Autowired
50
+    private TokenService tokenService;
46 51
     /**
47 52
      * 登录方法
48 53
      *
@@ -102,4 +107,19 @@ public class SysLoginController {
102 107
         List<SysMenu> menus = menuService.selectMenuTreeByUserId(userId);
103 108
         return AjaxResult.success(menuService.buildMenus(menus));
104 109
     }
110
+    /**sso登录接口*/
111
+    @PostMapping("login/sso")
112
+    public AjaxResult loginSSO( @RequestBody LoginBody loginBody){
113
+        if(StrUtil.isEmpty(loginBody.getUsername()) || StrUtil.isEmpty(loginBody.getTicket())
114
+                || StrUtil.isEmpty(loginBody.getRoleName()) ){
115
+            return AjaxResult.error("参数错误");
116
+        }
117
+      return   loginService.loginSSO(loginBody);
118
+
119
+    }
120
+
121
+    public static void main(String[] args) {
122
+        System.out.println( MD5.create().digestHex("BMceshi" ));
123
+    }
105 124
 }
125
+

+ 31
- 7
ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/mscase/MsCaseApplicationController.java Dosyayı Görüntüle

@@ -73,14 +73,25 @@ public class MsCaseApplicationController extends BaseController {
73 73
     /**
74 74
      * 新增案件
75 75
      */
76
+    // todo 重复提交校验
76 77
     @PostMapping("/insert")
77 78
     public AjaxResult insert(@RequestBody MsCaseApplicationVO caseApplication )
78 79
     {
79 80
         if(caseApplication.getAffiliate()==null||caseApplication.getAffiliate().getOrganizeFlag()==null){
80 81
             error("参数校验失败");
81 82
         }
83
+        AjaxResult ajaxResult = AjaxResult.success();
84
+        ajaxResult.put("caseNum",caseApplicationService.insert(caseApplication));
85
+        return ajaxResult;
86
+    }
87
+    /**
88
+     * 批量新增案件
89
+     */
90
+    @PostMapping("/batchInsert")
91
+    public AjaxResult batchInsert(@RequestBody MsCaseBatchInsertVO list )
92
+    {
82 93
 
83
-        return success(caseApplicationService.insert(caseApplication));
94
+        return caseApplicationService.batchInsert(list);
84 95
     }
85 96
 
86 97
     /**
@@ -90,10 +101,10 @@ public class MsCaseApplicationController extends BaseController {
90 101
     public AjaxResult getInfoByIdCard(@RequestParam(value = "idCard" ,required = false) String idCard)
91 102
     {
92 103
         if(StrUtil.isEmpty(idCard)){
93
-            error("身份证号不能为空");
104
+           return error("身份证号不能为空");
94 105
         }
95 106
         if(!IdcardUtil.isValidCard(idCard)){
96
-            error("身份证不合法,请输入正确的身份证号");
107
+          return   error("身份证不合法,请输入正确的身份证号");
97 108
         }
98 109
         AjaxResult ajax = AjaxResult.success();
99 110
         Map<String, String> identityNumMap = IdCardUtils.getBirAgeSex(idCard);
@@ -140,12 +151,12 @@ public class MsCaseApplicationController extends BaseController {
140 151
      * 根据id查询案件
141 152
      */
142 153
     @GetMapping("/selectById")
143
-    public AjaxResult selectById(@RequestParam Long id )
154
+    public AjaxResult selectById(@RequestParam(required = false) Long id ,@RequestParam(required = false) String caseNum  )
144 155
     {
145
-        if(id==null){
146
-            error("id不能为空");
156
+        if(id==null && caseNum==null ){
157
+            error("参数校验失败");
147 158
         }
148
-        return success(caseApplicationService.selectById(id));
159
+        return success(caseApplicationService.selectById(id,caseNum));
149 160
     }
150 161
     /**
151 162
      * 案件压缩包导入
@@ -402,4 +413,17 @@ public class MsCaseApplicationController extends BaseController {
402 413
         List<SmsSendRecord> list = caseApplicationService.getSmsSendRecord(smsSendRecord);
403 414
         return getDataTable(list);
404 415
     }
416
+    /**
417
+     * 保存onlyOffice在线编辑的文件
418
+     * @param
419
+     * @return
420
+     */
421
+    @PostMapping("/saveOnlyOfficeFile")
422
+    public AjaxResult saveOnlyOfficeFile(  @RequestBody MsCaseAttach caseAttach) {
423
+        if(caseAttach.getCaseAppliId()==null||StrUtil.isEmpty(caseAttach.getOnlyOfficeFileId())||StrUtil.isEmpty(caseAttach.getAnnexPath())){
424
+            return error("参数校验失败");
425
+        }
426
+
427
+        return  caseApplicationService.saveOnlyOfficeFile(caseAttach);
428
+    }
405 429
 }

+ 20
- 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/mscase/MsSignSealController.java Dosyayı Görüntüle

@@ -2,6 +2,8 @@ package com.ruoyi.web.controller.wisdomarbitrate.mscase;
2 2
 
3 3
 import cn.hutool.core.collection.CollectionUtil;
4 4
 import cn.hutool.core.util.StrUtil;
5
+import cn.hutool.json.JSONUtil;
6
+import com.ruoyi.common.annotation.Anonymous;
5 7
 import com.ruoyi.common.core.controller.BaseController;
6 8
 import com.ruoyi.common.core.domain.AjaxResult;
7 9
 import com.ruoyi.common.exception.EsignDemoException;
@@ -10,6 +12,8 @@ import com.ruoyi.wisdomarbitrate.domain.dto.mscase.SealSignRecord;
10 12
 import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseApplicationVO;
11 13
 import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseLogRecordVO;
12 14
 import com.ruoyi.wisdomarbitrate.service.mscase.MsSignSealService;
15
+import com.ruoyi.wisdomarbitrate.utils.SignVerifyUtils;
16
+import org.springframework.beans.BeanUtils;
13 17
 import org.springframework.beans.factory.annotation.Autowired;
14 18
 import org.springframework.validation.annotation.Validated;
15 19
 import org.springframework.web.bind.annotation.PostMapping;
@@ -57,6 +61,22 @@ public class MsSignSealController  extends BaseController {
57 61
         return success(sealUrlRecordselect);
58 62
     }
59 63
 
64
+    /**
65
+     * 签名用印回调
66
+     */
67
+    @Anonymous
68
+    @PostMapping("/signSeaalCaseApplicaCallback")
69
+    public AjaxResult signSeaalCaseApplicaCallback() throws Exception {
70
+        boolean checkResult= SignVerifyUtils.checkSignuter();
71
+        if(checkResult){
72
+            String reqbodystr =SignVerifyUtils.getRequestBody();
73
+            return msSignSealService.signSeaalCaseApplicaCallback(reqbodystr);
74
+        }else {
75
+            return AjaxResult.error("error");
76
+        }
77
+
78
+    }
79
+
60 80
     /**
61 81
      * 查询案件进度
62 82
      */

+ 7
- 0
ruoyi-admin/src/main/resources/application.yml Dosyayı Görüntüle

@@ -191,6 +191,13 @@ organizeConfig:
191 191
 #  引入仲裁系统url配置
192 192
 arbitrateConfig:
193 193
   url: http://121.40.189.20:9001/callArbitrateCaseApplication/generateCaseApplication
194
+# 回调通知
195
+signSealCallbackConfig:
196
+  url: http://121.40.189.20:7001/mssignSeal/signSeaalCaseApplicaCallback
197
+#  onlyOffice系统url配置
198
+onlyOfficeConfig:
199
+#  url: http://172.16.0.254:9090/files/upload
200
+  url: http://121.40.189.20:9090/files/upload
194 201
 #jodconverter:
195 202
 #  local:
196 203
 #    host: 121.40.189.20

+ 4
- 0
ruoyi-common/src/main/java/com/ruoyi/common/constant/CacheConstants.java Dosyayı Görüntüle

@@ -46,4 +46,8 @@ public class CacheConstants
46 46
      * 案件 redis key
47 47
      */
48 48
     public static final String CASE_KEY = "case_codes:";
49
+    /**
50
+     * 所有用户 redis key
51
+     */
52
+    public static final String USER_KEY = "user_key:";
49 53
 }

+ 23
- 1
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java Dosyayı Görüntüle

@@ -63,8 +63,12 @@ public class SysUser extends BaseEntity
63 63
 
64 64
 
65 65
     /** 用户身份证号 */
66
-    @Excel(name = "身份证号")
67 66
     private String idCard;
67
+    /** 身份类别,0-身份证,1-护照,默认0 */
68
+    private Integer idType;
69
+    /** 国籍,0-国内,1-国外,默认0 */
70
+
71
+    private Integer nationality;
68 72
 
69 73
     /** 用户邮箱 */
70 74
     @Excel(name = "用户邮箱")
@@ -136,6 +140,22 @@ public class SysUser extends BaseEntity
136 140
         this.userId = userId;
137 141
     }
138 142
 
143
+    public Integer getIdType() {
144
+        return idType;
145
+    }
146
+
147
+    public void setIdType(Integer idType) {
148
+        this.idType = idType;
149
+    }
150
+
151
+    public Integer getNationality() {
152
+        return nationality;
153
+    }
154
+
155
+    public void setNationality(Integer nationality) {
156
+        this.nationality = nationality;
157
+    }
158
+
139 159
     public Long getUserId()
140 160
     {
141 161
         return userId;
@@ -361,6 +381,8 @@ public class SysUser extends BaseEntity
361 381
             .append("deptIds", getDeptIds())
362 382
             .append("userName", getUserName())
363 383
             .append("idCard", getIdCard())
384
+            .append("idType", getIdType())
385
+            .append("nationality", getNationality())
364 386
             .append("nickName", getNickName())
365 387
             .append("email", getEmail())
366 388
             .append("phonenumber", getPhonenumber())

+ 24
- 0
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/model/LoginBody.java Dosyayı Görüntüle

@@ -26,12 +26,36 @@ public class LoginBody
26 26
      * 唯一标识
27 27
      */
28 28
     private String uuid;
29
+    /**
30
+     * 密文:BM+用户名用MD5加密
31
+     */
32
+    private String ticket;
33
+    /**
34
+     * 角色名,申请人,被申请人,委托代理人
35
+     */
36
+    private String roleName;
37
+
38
+    public String getRoleName() {
39
+        return roleName;
40
+    }
41
+
42
+    public void setRoleName(String roleName) {
43
+        this.roleName = roleName;
44
+    }
29 45
 
30 46
     public String getUsername()
31 47
     {
32 48
         return username;
33 49
     }
34 50
 
51
+    public String getTicket() {
52
+        return ticket;
53
+    }
54
+
55
+    public void setTicket(String ticket) {
56
+        this.ticket = ticket;
57
+    }
58
+
35 59
     public void setUsername(String username)
36 60
     {
37 61
         this.username = username;

+ 1
- 1
ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java Dosyayı Görüntüle

@@ -111,7 +111,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
111 111
                 // 过滤请求
112 112
                 .authorizeRequests()
113 113
                 // 对于登录login 注册register 验证码captchaImage 允许匿名访问
114
-                .antMatchers("/login", "/register", "/captchaImage","/uploadPath/**","/websocket/**").permitAll()
114
+                .antMatchers("/login","/login/sso", "/register", "/captchaImage","/uploadPath/**","/websocket/**").permitAll()
115 115
                 // 静态资源,可匿名访问
116 116
                 .antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll()
117 117
                 .antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**").permitAll()

+ 93
- 13
ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysLoginService.java Dosyayı Görüntüle

@@ -1,33 +1,35 @@
1 1
 package com.ruoyi.framework.web.service;
2 2
 
3
-import javax.annotation.Resource;
4
-import org.springframework.beans.factory.annotation.Autowired;
5
-import org.springframework.security.authentication.AuthenticationManager;
6
-import org.springframework.security.authentication.BadCredentialsException;
7
-import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
8
-import org.springframework.security.core.Authentication;
9
-import org.springframework.stereotype.Component;
3
+import cn.hutool.crypto.digest.MD5;
10 4
 import com.ruoyi.common.constant.CacheConstants;
11 5
 import com.ruoyi.common.constant.Constants;
12 6
 import com.ruoyi.common.constant.UserConstants;
7
+import com.ruoyi.common.core.domain.AjaxResult;
13 8
 import com.ruoyi.common.core.domain.entity.SysUser;
9
+import com.ruoyi.common.core.domain.model.LoginBody;
14 10
 import com.ruoyi.common.core.domain.model.LoginUser;
15 11
 import com.ruoyi.common.core.redis.RedisCache;
16 12
 import com.ruoyi.common.exception.ServiceException;
17
-import com.ruoyi.common.exception.user.BlackListException;
18
-import com.ruoyi.common.exception.user.CaptchaException;
19
-import com.ruoyi.common.exception.user.CaptchaExpireException;
20
-import com.ruoyi.common.exception.user.UserNotExistsException;
21
-import com.ruoyi.common.exception.user.UserPasswordNotMatchException;
13
+import com.ruoyi.common.exception.user.*;
22 14
 import com.ruoyi.common.utils.DateUtils;
23 15
 import com.ruoyi.common.utils.MessageUtils;
16
+import com.ruoyi.common.utils.SecurityUtils;
24 17
 import com.ruoyi.common.utils.StringUtils;
25 18
 import com.ruoyi.common.utils.ip.IpUtils;
26 19
 import com.ruoyi.framework.manager.AsyncManager;
27 20
 import com.ruoyi.framework.manager.factory.AsyncFactory;
28 21
 import com.ruoyi.framework.security.context.AuthenticationContextHolder;
22
+import com.ruoyi.system.mapper.SysRoleMapper;
29 23
 import com.ruoyi.system.service.ISysConfigService;
30 24
 import com.ruoyi.system.service.ISysUserService;
25
+import org.springframework.beans.factory.annotation.Autowired;
26
+import org.springframework.security.authentication.AuthenticationManager;
27
+import org.springframework.security.authentication.BadCredentialsException;
28
+import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
29
+import org.springframework.security.core.Authentication;
30
+import org.springframework.stereotype.Component;
31
+
32
+import javax.annotation.Resource;
31 33
 
32 34
 /**
33 35
  * 登录校验方法
@@ -51,6 +53,8 @@ public class SysLoginService
51 53
 
52 54
     @Autowired
53 55
     private ISysConfigService configService;
56
+    @Autowired
57
+    private SysRoleMapper roleMapper;
54 58
 
55 59
     /**
56 60
      * 登录验证
@@ -63,7 +67,6 @@ public class SysLoginService
63 67
      */
64 68
     public String login(String username, String password, String code, String uuid)
65 69
     {
66
-        // 验证码校验
67 70
         validateCaptcha(username, code, uuid);
68 71
         // 登录前置校验
69 72
         loginPreCheck(username, password);
@@ -99,6 +102,45 @@ public class SysLoginService
99 102
         // 生成token
100 103
         return tokenService.createToken(loginUser);
101 104
     }
105
+    /**
106
+     * 无需验证码登录
107
+     * 重写login方法将验证码模块去掉
108
+     * @param username
109
+     * @param password
110
+     * @param uuid
111
+     * @return
112
+     */
113
+    public String loginNoCaptcha(String username, String password,  String uuid)
114
+    {
115
+        // 用户验证
116
+        Authentication authentication = null;
117
+        try
118
+        {
119
+            UsernamePasswordAuthenticationToken authenticationToken = new UsernamePasswordAuthenticationToken(username, password);
120
+            AuthenticationContextHolder.setContext(authenticationToken);
121
+            // 该方法会去调用UserDetailsServiceImpl.loadUserByUsername
122
+            authentication = authenticationManager.authenticate(authenticationToken);
123
+        }
124
+        catch (Exception e)
125
+        {
126
+            if (e instanceof BadCredentialsException)
127
+            {
128
+                AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.password.not.match")));
129
+                throw new UserPasswordNotMatchException();
130
+            }
131
+            else
132
+            {
133
+                AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, e.getMessage()));
134
+                throw new ServiceException(e.getMessage());
135
+            }
136
+        }
137
+        AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_SUCCESS, MessageUtils.message("user.login.success")));
138
+        LoginUser loginUser = (LoginUser) authentication.getPrincipal();
139
+        recordLoginInfo(loginUser.getUserId());
140
+        // 生成token
141
+        return tokenService.createToken(loginUser);
142
+    }
143
+
102 144
 
103 145
     /**
104 146
      * 校验验证码
@@ -178,4 +220,42 @@ public class SysLoginService
178 220
         sysUser.setLoginDate(DateUtils.getNowDate());
179 221
         userService.updateUserProfile(sysUser);
180 222
     }
223
+
224
+    public AjaxResult loginSSO(LoginBody loginBody) {
225
+        // MD5加密并和Ticket比对
226
+        String currentTicket = MD5.create().digestHex("BM" + loginBody.getUsername());
227
+        if(!currentTicket.equals(loginBody.getTicket())){
228
+            return AjaxResult.error("ticket校验失败");
229
+        }
230
+        AjaxResult ajax = AjaxResult.success();
231
+        String username = loginBody.getUsername();
232
+        // 根据用户名获取用户信息,如果用户不存在则新增用户
233
+        SysUser user = userService.selectUserByUserName(username);
234
+        if(user==null){
235
+            // 新增用户
236
+            user = new SysUser();
237
+            user.setUserName(username);
238
+            user.setPassword(SecurityUtils.encryptPassword("abc123456"));
239
+            user.setNickName(username);
240
+            // 代理人角色相当于申请人角色
241
+            if(loginBody.getRoleName().contains("代理人")){
242
+                loginBody.setRoleName("申请人");
243
+            }
244
+            // 根据角色名查询角色id
245
+            Long roleIdByName = roleMapper.selectRoleIdByName(loginBody.getRoleName());
246
+            if(roleIdByName==null){
247
+                return AjaxResult.error("角色不存在");
248
+            }
249
+            user.setRoleIds( new Long[]{roleIdByName});
250
+            userService.insertUser(user);
251
+
252
+        }// 生成token
253
+        LoginUser loginUser = new LoginUser();
254
+        loginUser.setUser(user);
255
+        loginUser.setUserId(user.getUserId());
256
+        String token = tokenService.createToken(loginUser);
257
+        ajax.put("userName", user.getUserName());
258
+        ajax.put(Constants.TOKEN, token);
259
+        return ajax;
260
+    }
181 261
 }

+ 24
- 11
ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/TokenService.java Dosyayı Görüntüle

@@ -1,14 +1,5 @@
1 1
 package com.ruoyi.framework.web.service;
2 2
 
3
-import java.util.HashMap;
4
-import java.util.Map;
5
-import java.util.concurrent.TimeUnit;
6
-import javax.servlet.http.HttpServletRequest;
7
-import org.slf4j.Logger;
8
-import org.slf4j.LoggerFactory;
9
-import org.springframework.beans.factory.annotation.Autowired;
10
-import org.springframework.beans.factory.annotation.Value;
11
-import org.springframework.stereotype.Component;
12 3
 import com.ruoyi.common.constant.CacheConstants;
13 4
 import com.ruoyi.common.constant.Constants;
14 5
 import com.ruoyi.common.core.domain.model.LoginUser;
@@ -22,6 +13,16 @@ import eu.bitwalker.useragentutils.UserAgent;
22 13
 import io.jsonwebtoken.Claims;
23 14
 import io.jsonwebtoken.Jwts;
24 15
 import io.jsonwebtoken.SignatureAlgorithm;
16
+import org.slf4j.Logger;
17
+import org.slf4j.LoggerFactory;
18
+import org.springframework.beans.factory.annotation.Autowired;
19
+import org.springframework.beans.factory.annotation.Value;
20
+import org.springframework.stereotype.Component;
21
+
22
+import javax.servlet.http.HttpServletRequest;
23
+import java.util.HashMap;
24
+import java.util.Map;
25
+import java.util.concurrent.TimeUnit;
25 26
 
26 27
 /**
27 28
  * token验证处理
@@ -119,6 +120,8 @@ public class TokenService
119 120
         refreshToken(loginUser);
120 121
 
121 122
         Map<String, Object> claims = new HashMap<>();
123
+        claims.put("userName",loginUser.getUsername());
124
+        claims.put("userId",loginUser.getUserId());
122 125
         claims.put(Constants.LOGIN_USER_KEY, token);
123 126
         return createToken(claims);
124 127
     }
@@ -207,14 +210,24 @@ public class TokenService
207 210
         Claims claims = parseToken(token);
208 211
         return claims.getSubject();
209 212
     }
210
-
213
+    /**
214
+     * 从令牌中获取用户名
215
+     *
216
+     * @param token 令牌
217
+     * @return 用户名
218
+     */
219
+    public String getUserNameFromToken(String token)
220
+    {
221
+        Claims claims = parseToken(token);
222
+        return claims.get("userName").toString();
223
+    }
211 224
     /**
212 225
      * 获取请求token
213 226
      *
214 227
      * @param request
215 228
      * @return token
216 229
      */
217
-    private String getToken(HttpServletRequest request)
230
+    public String getToken(HttpServletRequest request)
218 231
     {
219 232
         String token = request.getHeader(header);
220 233
         if (StringUtils.isNotEmpty(token) && token.startsWith(Constants.TOKEN_PREFIX))

+ 28
- 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/flow/MsBaseCaseFlow.java Dosyayı Görüntüle

@@ -0,0 +1,28 @@
1
+package com.ruoyi.system.domain.vo.flow;
2
+
3
+import lombok.AllArgsConstructor;
4
+import lombok.Builder;
5
+import lombok.Data;
6
+import lombok.NoArgsConstructor;
7
+
8
+
9
+@AllArgsConstructor
10
+@NoArgsConstructor
11
+@Builder
12
+@Data
13
+public class MsBaseCaseFlow {
14
+    /**
15
+     * 主键id
16
+     */
17
+    private Integer id;
18
+
19
+    /**
20
+     * 顺序
21
+     */
22
+    private Integer sort;
23
+
24
+    /**
25
+     * 案件状态名称
26
+     */
27
+    private String caseStatusName;
28
+}

+ 4
- 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/flow/MsCaseFlowMapper.java Dosyayı Görüntüle

@@ -1,6 +1,7 @@
1 1
 package com.ruoyi.system.mapper.flow;
2 2
 
3 3
 import com.ruoyi.system.domain.entity.flow.MsCaseFlow;
4
+import com.ruoyi.system.domain.vo.flow.MsBaseCaseFlow;
4 5
 import com.ruoyi.system.domain.vo.flow.MsCaseFlowVO;
5 6
 import org.apache.ibatis.annotations.Select;
6 7
 import tk.mybatis.mapper.common.Mapper;
@@ -25,4 +26,7 @@ public interface MsCaseFlowMapper extends Mapper<MsCaseFlow> {
25 26
 
26 27
     @Select("SELECT r.role_name as roleName ,f.node_name as nodeName ,f.case_status_name as caseStatusName FROM ms_case_flow f left join ms_case_flow_role_related fr on f.id  = fr.flow_id  left join ms_sys_role r on fr.roleid  = r.role_id  WHERE f.id  = #{caseFlowId} ")
27 28
     List<MsCaseFlowVO> selectFlowRole(Integer caseFlowId);
29
+    @Select("select f1.id,f1.case_status_name caseStatusName,f1.sort from ms_case_flow f1 order by f1.sort")
30
+
31
+    List<MsBaseCaseFlow> selectCaseFlow();
28 32
 }

+ 8
- 0
ruoyi-system/src/main/java/com/ruoyi/system/service/flow/CaseFlowService.java Dosyayı Görüntüle

@@ -1,5 +1,6 @@
1 1
 package com.ruoyi.system.service.flow;
2 2
 
3
+import com.ruoyi.common.core.domain.AjaxResult;
3 4
 import com.ruoyi.system.domain.vo.flow.MsCaseFlowSearchVO;
4 5
 import com.ruoyi.system.domain.vo.flow.MsCaseFlowVO;
5 6
 
@@ -12,6 +13,11 @@ public interface CaseFlowService {
12 13
      * @return
13 14
      */
14 15
     Object queryCaseFlowInfo(MsCaseFlowSearchVO caseFlowSearchVO);
16
+    /**
17
+     * 查询案件流程信息
18
+     * @return
19
+     */
20
+    AjaxResult selectCaseFlow();
15 21
 
16 22
     /**
17 23
      * 新增或编辑案件流程节点信息
@@ -40,4 +46,6 @@ public interface CaseFlowService {
40 46
      * @return
41 47
      */
42 48
     Set<Integer> getCaseStatusIdByRoleKey(Set<String> roles);
49
+
50
+
43 51
 }

+ 8
- 0
ruoyi-system/src/main/java/com/ruoyi/system/service/flow/CaseFlowServiceImpl.java Dosyayı Görüntüle

@@ -2,10 +2,12 @@ package com.ruoyi.system.service.flow;
2 2
 
3 3
 import com.github.pagehelper.PageHelper;
4 4
 import com.github.pagehelper.PageInfo;
5
+import com.ruoyi.common.core.domain.AjaxResult;
5 6
 import com.ruoyi.common.core.domain.entity.SysRole;
6 7
 import com.ruoyi.common.core.page.TableDataInfo;
7 8
 import com.ruoyi.system.domain.entity.flow.MsCaseFlow;
8 9
 import com.ruoyi.system.domain.entity.flow.MsCaseFlowRoleRelated;
10
+import com.ruoyi.system.domain.vo.flow.MsBaseCaseFlow;
9 11
 import com.ruoyi.system.domain.vo.flow.MsCaseFlowSearchVO;
10 12
 import com.ruoyi.system.domain.vo.flow.MsCaseFlowVO;
11 13
 import com.ruoyi.system.mapper.SysRoleMapper;
@@ -95,6 +97,12 @@ public class CaseFlowServiceImpl implements CaseFlowService {
95 97
         }
96 98
     }
97 99
 
100
+    @Override
101
+    public AjaxResult selectCaseFlow() {
102
+        List<MsBaseCaseFlow> caseFlows = msCaseFlowMapper.selectCaseFlow();
103
+        return AjaxResult.success(caseFlows);
104
+    }
105
+
98 106
     /**
99 107
      * 查询流程信息相关的角色信息
100 108
      *

+ 3
- 0
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java Dosyayı Görüntüle

@@ -8,6 +8,7 @@ import com.ruoyi.common.core.domain.entity.SysRole;
8 8
 import com.ruoyi.common.core.domain.entity.SysUser;
9 9
 import com.ruoyi.common.core.domain.entity.SysUserDept;
10 10
 import com.ruoyi.common.exception.ServiceException;
11
+import com.ruoyi.common.utils.DateUtils;
11 12
 import com.ruoyi.common.utils.SecurityUtils;
12 13
 import com.ruoyi.common.utils.StringUtils;
13 14
 import com.ruoyi.common.utils.bean.BeanValidators;
@@ -241,6 +242,8 @@ public class SysUserServiceImpl implements ISysUserService {
241 242
     @Transactional
242 243
     public AjaxResult insertUser(SysUser user) {
243 244
         // 新增用户信息
245
+        user.setCreateBy("admin");
246
+        user.setCreateTime(DateUtils.getNowDate());
244 247
         int rows = userMapper.insertUser(user);
245 248
         // 新增用户部门关联
246 249
         if(CollectionUtil.isNotEmpty(user.getDeptIds())) {

+ 24
- 1
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/dto/miniprogress/IdentityAuthentication.java Dosyayı Görüntüle

@@ -1,7 +1,6 @@
1 1
 package com.ruoyi.wisdomarbitrate.domain.dto.miniprogress;
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;
6 5
 import lombok.Data;
7 6
 
@@ -20,6 +19,14 @@ public class IdentityAuthentication   extends BaseEntity {
20 19
     private String name;
21 20
     /** 身份证号 */
22 21
     private String identityNo;
22
+    /**
23
+     *  身份类别,0-身份证,1-护照,默认0
24
+     */
25
+    private Integer idType;
26
+    /**
27
+     * 国籍,0-国内,1-国外,默认0
28
+     */
29
+    private Integer nationality;
23 30
     /**
24 31
      * 短信验证码
25 32
      */
@@ -104,6 +111,22 @@ public class IdentityAuthentication   extends BaseEntity {
104 111
         return userId;
105 112
     }
106 113
 
114
+    public Integer getIdType() {
115
+        return idType;
116
+    }
117
+
118
+    public void setIdType(Integer idType) {
119
+        this.idType = idType;
120
+    }
121
+
122
+    public Integer getNationality() {
123
+        return nationality;
124
+    }
125
+
126
+    public void setNationality(Integer nationality) {
127
+        this.nationality = nationality;
128
+    }
129
+
107 130
     public void setUserId(Long userId) {
108 131
         this.userId = userId;
109 132
     }

+ 21
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/entity/dept/MsSealSignRecord.java Dosyayı Görüntüle

@@ -144,6 +144,27 @@ public class MsSealSignRecord {
144 144
     @Column(name = "position_ypsn_medi")
145 145
     private double positionYpsnMedi;
146 146
 
147
+    /**
148
+     * 申请人签名状态
149
+     */
150
+    @Column(name = "sign_status_apply")
151
+    private Integer signStatusApply;
152
+    /**
153
+     * 被申请人签名状态
154
+     */
155
+    @Column(name = "sign_status_response")
156
+    private Integer signStatusResponse;
157
+    /**
158
+     * 调解员签名状态
159
+     */
160
+    @Column(name = "sign_status_mediator")
161
+    private Integer signStatusMediator;
162
+    /**
163
+     * 用印状态
164
+     */
165
+    @Column(name = "seal_status")
166
+    private Integer sealStatus;
167
+
147 168
 
148 169
 
149 170
 }

+ 10
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/entity/mscase/MsCaseAffiliate.java Dosyayı Görüntüle

@@ -154,4 +154,14 @@ public class MsCaseAffiliate {
154 154
      */
155 155
     @Column(name = "is_sign_respon")
156 156
     private Integer isSignRespon;
157
+    /**
158
+     * 身份类别,0-身份证,1-护照,默认0
159
+     */
160
+    @Column(name = "id_type")
161
+    private Integer idType;
162
+    /**
163
+     * 国籍,0-国内,1-国外,默认0
164
+     */
165
+    @Column(name = "nationality")
166
+    private Integer nationality;
157 167
 }

+ 3
- 3
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/entity/mscase/MsCaseAttach.java Dosyayı Görüntüle

@@ -73,8 +73,8 @@ public class MsCaseAttach {
73 73
     private Long sealStatus;
74 74
 
75 75
     /**
76
-     * 是否是证据上传,0-否,1-是
76
+     * onlyOffice附件id
77 77
      */
78
-    @Column(name = "is_batch_upload")
79
-    private Long isBatchUpload;
78
+    @Column(name = "only_office_file_id")
79
+    private String onlyOfficeFileId;
80 80
 }

+ 7
- 1
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/mscase/MsCaseApplicationVO.java Dosyayı Görüntüle

@@ -1,5 +1,6 @@
1 1
 package com.ruoyi.wisdomarbitrate.domain.vo.mscase;
2 2
 
3
+import com.fasterxml.jackson.annotation.JsonFormat;
3 4
 import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAffiliate;
4 5
 import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseApplication;
5 6
 import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAttach;
@@ -7,6 +8,7 @@ import lombok.AllArgsConstructor;
7 8
 import lombok.Data;
8 9
 import lombok.NoArgsConstructor;
9 10
 
11
+import java.util.Date;
10 12
 import java.util.List;
11 13
 
12 14
 /**
@@ -77,6 +79,10 @@ public class MsCaseApplicationVO extends MsCaseApplication {
77 79
      * 签名按钮显示,0-显示,1-不显示
78 80
      */
79 81
     private Integer signButtonFlag;
80
-
82
+    /**
83
+     * 结束时间
84
+     */
85
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
86
+    private Date endTime;
81 87
 
82 88
 }

+ 19
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/mscase/MsCaseBatchInsertVO.java Dosyayı Görüntüle

@@ -0,0 +1,19 @@
1
+package com.ruoyi.wisdomarbitrate.domain.vo.mscase;
2
+
3
+import lombok.Data;
4
+
5
+import java.io.Serializable;
6
+import java.util.List;
7
+
8
+/**
9
+ * @Classname MsCaseBatchInsertVO
10
+ * @Description 批量新增案件
11
+ * @Version 1.0.0
12
+ * @Date 2024/3/11 10:04
13
+ * @Created wangqiong
14
+ */
15
+@Data
16
+public class MsCaseBatchInsertVO implements Serializable {
17
+    private static final long serialVersionUID = 1L;
18
+    private List<MsCaseApplicationVO> list;
19
+}

+ 10
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/mscase/MsCaseLogRecordMapper.java Dosyayı Görüntüle

@@ -6,6 +6,7 @@ import org.apache.ibatis.annotations.Param;
6 6
 import org.apache.ibatis.annotations.Select;
7 7
 import tk.mybatis.mapper.common.Mapper;
8 8
 
9
+import java.util.Date;
9 10
 import java.util.List;
10 11
 
11 12
 public interface MsCaseLogRecordMapper extends Mapper<MsCaseLogRecord> {
@@ -33,4 +34,13 @@ public interface MsCaseLogRecordMapper extends Mapper<MsCaseLogRecord> {
33 34
 
34 35
     @Select("SELECT group_concat( DISTINCT t.createNickName) createNickName,t.nodeName content,t.nodeId,t.sort ,t.caseStatusName  FROM (SELECT l.create_nick_name createNickName ,f.node_name nodeName,f.node_id nodeId, f.sort, f.case_status_name caseStatusName FROM ms_case_log_record l left join ms_case_flow f on l.case_node  = f.node_id WHERE l.case_appli_id  = #{caseAppliId} and f.node_name is not null ) t group by t.nodeName,t.nodeId,t.sort ,t.caseStatusName   order by t.sort ")
35 36
     List<MsCaseLogRecordVO> selectCaseLogRecordListCaseProgress(Long caseAppliId);
37
+
38
+    /**
39
+     * 根据案件id查询结束时间
40
+     * @param caseAppliId
41
+     * @param caseStatusName
42
+     * @return
43
+     */
44
+    @Select("SELECT create_time endTime  FROM  ms_case_log_record where case_appli_id=#{caseAppliId} and case_status_name=#{caseStatusName} order by create_time desc limit 1")
45
+    Date selectEndTimeByCaseId(@Param("caseAppliId") Long caseAppliId, @Param("caseStatusName") String caseStatusName);
36 46
 }

+ 2
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/miniprogress/impl/WeChatUserServiceImpl.java Dosyayı Görüntüle

@@ -161,6 +161,8 @@ public class WeChatUserServiceImpl implements WeChatUserService {
161 161
             sysUser.setPhonenumber(ientityAuthentication.getPhone());
162 162
             sysUser.setEmail(ientityAuthentication.getEmail());
163 163
             sysUser.setCreateBy(ientityAuthentication.getUserName());
164
+            sysUser.setIdType(ientityAuthentication.getIdType());
165
+            sysUser.setNationality(ientityAuthentication.getNationality());
164 166
             sysUser.setPassword(SecurityUtils.encryptPassword(ientityAuthentication.getPassWord()));
165 167
             int row = sysUserMapper.insertUser(sysUser);
166 168
             if(row<1) {

+ 27
- 2
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/MsCaseApplicationService.java Dosyayı Görüntüle

@@ -1,5 +1,6 @@
1 1
 package com.ruoyi.wisdomarbitrate.service.mscase;
2 2
 
3
+import com.alibaba.fastjson.JSONArray;
3 4
 import com.ruoyi.common.core.domain.AjaxResult;
4 5
 import com.ruoyi.common.core.domain.entity.SysDictData;
5 6
 import com.ruoyi.common.core.domain.entity.SysUser;
@@ -40,14 +41,27 @@ public interface MsCaseApplicationService {
40 41
      * @param id
41 42
      * @return
42 43
      */
43
-    MsCaseApplicationVO selectById(Long id);
44
+    MsCaseApplicationVO selectById(Long id ,String caseNum );
44 45
 
45 46
     /**
46 47
      * 新增案件
47 48
      * @param caseApplication
48 49
      * @return
49 50
      */
50
-    int insert(MsCaseApplicationVO caseApplication);
51
+    String insert(MsCaseApplicationVO caseApplication);
52
+
53
+    /**
54
+     * 新增案件
55
+     * @param caseApplication
56
+     * @param caseFlow
57
+     */
58
+     String insert(MsCaseApplicationVO caseApplication, MsCaseFlow caseFlow);
59
+    /**
60
+     * 批量新增案件
61
+     * @param vo
62
+     * @return
63
+     */
64
+    AjaxResult batchInsert(MsCaseBatchInsertVO vo);
51 65
     /**
52 66
      * 新增用户
53 67
      * @param affiliate
@@ -206,6 +220,11 @@ public interface MsCaseApplicationService {
206 220
      * @param dictDataList 内置字段
207 221
      */
208 222
      void createMediateApplication(MsCaseApplication application, MsCaseAffiliate affiliate, String templatePath, List<String> bookmarkList, List<SysDictData> dictDataList, Integer templateType) ;
223
+    /**
224
+     * 调解书上传到onlyoffice服务器
225
+     * @param annexPath
226
+     */
227
+     JSONArray uploadOnlyOffice(String annexPath,Long id);
209 228
     /**
210 229
      * 案件受理
211 230
      * @param application
@@ -242,5 +261,11 @@ public interface MsCaseApplicationService {
242 261
      * @return
243 262
      */
244 263
     List<SmsSendRecord> getSmsSendRecord(SmsSendRecord smsSendRecord);
264
+    /**
265
+     * 保存onlyOffice在线编辑的文件
266
+     * @param
267
+     * @return
268
+     */
245 269
 
270
+    AjaxResult saveOnlyOfficeFile(MsCaseAttach caseAttach);
246 271
 }

+ 3
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/MsSignSealService.java Dosyayı Görüntüle

@@ -7,6 +7,7 @@ import com.ruoyi.wisdomarbitrate.domain.dto.mscase.SealSignRecord;
7 7
 import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseApplicationVO;
8 8
 import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseLogRecordVO;
9 9
 
10
+import java.io.IOException;
10 11
 import java.util.List;
11 12
 
12 13
 public interface MsSignSealService {
@@ -34,4 +35,6 @@ public interface MsSignSealService {
34 35
     AjaxResult msCaseSignUrlApplyAPP(MsSignSealDTO dto) throws EsignDemoException;
35 36
 
36 37
     AjaxResult msCaseSignUrlResAPP(MsSignSealDTO dto) throws EsignDemoException;
38
+
39
+    AjaxResult signSeaalCaseApplicaCallback(String reqbodystr) throws EsignDemoException, IOException;
37 40
 }

+ 304
- 100
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/MsCaseApplicationServiceImpl.java Dosyayı Görüntüle

@@ -5,6 +5,7 @@ import cn.hutool.core.collection.CollectionUtil;
5 5
 import cn.hutool.core.util.StrUtil;
6 6
 import cn.hutool.http.HttpRequest;
7 7
 import cn.hutool.http.HttpResponse;
8
+import cn.hutool.http.HttpUtil;
8 9
 import cn.hutool.json.JSONUtil;
9 10
 import com.alibaba.fastjson.JSONArray;
10 11
 import com.alibaba.fastjson.JSONObject;
@@ -47,7 +48,6 @@ import com.ruoyi.wisdomarbitrate.mapper.template.FatchRuleMapper;
47 48
 import com.ruoyi.wisdomarbitrate.mapper.template.TemplateManageMapper;
48 49
 import com.ruoyi.wisdomarbitrate.service.mscase.MsCaseApplicationService;
49 50
 import com.ruoyi.wisdomarbitrate.utils.*;
50
-
51 51
 import org.apache.pdfbox.pdmodel.PDDocument;
52 52
 import org.apache.poi.xwpf.usermodel.XWPFDocument;
53 53
 import org.springframework.beans.BeanUtils;
@@ -92,6 +92,8 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
92 92
 
93 93
     @Value("${arbitrateConfig.url}")
94 94
     private String arbitrateUrl;
95
+    @Value("${onlyOfficeConfig.url}")
96
+    private String onlyOfficeUrl;
95 97
     @Autowired
96 98
     MsCaseApplicationService caseApplicationService;
97 99
     @Autowired
@@ -158,22 +160,20 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
158 160
      */
159 161
     @Override
160 162
     public List<MsCaseApplicationVO> list(MsCaseApplicationReq req) {
161
-        // admin查询所有案件
162
-        if (StrUtil.equals(SecurityUtils.getUsername(), "admin")) {
163
-            startPage();
164
-            List<MsCaseApplicationVO> list = msCaseApplicationMapper.list(req, null);
165
-            for (MsCaseApplicationVO vo : list) {
166
-                    vo.setSignButtonFlag(0);
167
-            }
168
-            return list;
169
-        }
163
+
170 164
         // 根据用户查询角色
171 165
         LoginUser loginUser = SecurityUtils.getLoginUser();
172 166
         // 根据id查询用户
173 167
         SysUser sysUser = sysUserMapper.selectUserById(loginUser.getUserId());
174 168
         List<SysRole> roles = loginUser.getUser().getRoles();
175
-        if (CollectionUtil.isEmpty(roles)) {
176
-            throw new ServiceException("该用户未指定角色");
169
+        if (StrUtil.equals(SecurityUtils.getUsername(), "admin")||CollectionUtil.isEmpty(roles)) {
170
+            // 如果角色为空,按admin处理,查所有案件
171
+            startPage();
172
+            List<MsCaseApplicationVO> list = msCaseApplicationMapper.list(req, null);
173
+            for (MsCaseApplicationVO vo : list) {
174
+                vo.setSignButtonFlag(0);
175
+            }
176
+            return list;
177 177
         }
178 178
         req.setUserName(SecurityUtils.getUsername());
179 179
         req.setContactTelphoneAgent(sysUser.getPhonenumber());
@@ -353,10 +353,29 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
353 353
         return vo;
354 354
     }
355 355
 
356
+    /**
357
+     * 根据案件id或者案件编号查询详情
358
+     * @param id
359
+     * @param caseNum
360
+     * @param
361
+     * @return
362
+     */
356 363
     @Override
357
-    public MsCaseApplicationVO selectById(Long id) {
364
+    public MsCaseApplicationVO selectById(Long id,String caseNum ) {
365
+        // 根据案件id或者案件编号查询详情
358 366
         MsCaseApplicationVO vo = new MsCaseApplicationVO();
359
-        MsCaseApplication caseApplication = msCaseApplicationMapper.selectByPrimaryKey(id);
367
+        MsCaseApplication caseApplication = null;
368
+        if(id!=null) {
369
+             caseApplication = msCaseApplicationMapper.selectByPrimaryKey(id);
370
+        }else {
371
+            // 根据案件编号查
372
+            Example example = new Example(MsCaseApplication.class);
373
+            example.createCriteria().andEqualTo("caseNum", caseNum);
374
+            caseApplication = msCaseApplicationMapper.selectOneByExample(example);
375
+        }
376
+        if(caseApplication==null){
377
+            return vo;
378
+        }
360 379
         BeanUtil.copyProperties(caseApplication, vo);
361 380
         // 查询案件相关人员
362 381
         MsCaseAffiliate caseAffiliate = msCaseAffiliateMapper.selectByPrimaryKey(id);
@@ -369,6 +388,8 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
369 388
         vo.setColumnValueList(columnValueVOS);
370 389
         // 查询拒绝原因
371 390
         vo.setReason(auditMapper.selectByCaseId(id,caseApplication.getCaseFlowId()));
391
+        // todo 在日志表查詢结束时间返回
392
+        vo.setEndTime(caseLogRecordMapper.selectEndTimeByCaseId(caseApplication.getId(),"结束"));
372 393
         return vo;
373 394
     }
374 395
 
@@ -380,21 +401,36 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
380 401
      */
381 402
     @Transactional
382 403
     @Override
383
-    public int insert(MsCaseApplicationVO caseApplication) {
384
-        if (caseApplication.getId() == null) {
385
-            caseApplication.setId(IdWorkerUtil.getId());
386
-        }
404
+    public String insert(MsCaseApplicationVO caseApplication) {
387 405
 
388
-        // 根据角色获取案件流程
389
-        List<MsCaseFlow> caseFlows=  selectCaseFlows();
406
+
407
+        // todo 第三方调用该接口,未绑定角色,暂时不根据角色查询流程,根据角色获取案件流程
408
+       /** List<MsCaseFlow> caseFlows=  selectCaseFlows();
390 409
         if (CollectionUtil.isEmpty(caseFlows)) {
391
-            throw new ServiceException("该角色绑定案件流程");
410
+            throw new ServiceException("该角色绑定案件流程");
392 411
         }
412
+        */
393 413
         // 设置模板id,根据机构代码查询模板
394
-        Long templateId =  templateManageMapper.selectByCreditCode(creditCode);
414
+        Long templateId = getTemplate();
395 415
         caseApplication.setTemplateId(templateId);
416
+        // 获取第一个流程节点
417
+        MsCaseFlow caseFlow =  getCaseFlow();
418
+        return   insert(caseApplication,caseFlow);
396 419
 
397
-        MsCaseFlow caseFlow = caseFlows.get(0);
420
+    }
421
+
422
+    /**
423
+     * 新增案件
424
+     * @param caseApplication
425
+     * @param caseFlow
426
+     * @return
427
+     */
428
+    @Transactional
429
+    @Override
430
+    public String insert(MsCaseApplicationVO caseApplication, MsCaseFlow caseFlow) {
431
+        if (caseApplication.getId() == null) {
432
+            caseApplication.setId(IdWorkerUtil.getId());
433
+        }
398 434
         caseApplication.setCaseStatusName(caseFlow.getCaseStatusName());
399 435
         caseApplication.setCaseFlowId(caseFlow.getId());
400 436
         caseApplication.setCreateTime(new Date());
@@ -416,51 +452,51 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
416 452
         if (msCaseApplicationMapper.insertSelective(caseApplication) > 0) {
417 453
             List<MsCaseAttach> caseAttachList = caseApplication.getCaseAttachList();
418 454
             // 保存案件相关人员
419
-                // 设置申请机构
420
-                if (StrUtil.isNotEmpty(affiliate.getApplicationName())&&affiliate.getOrganizeFlag()==1) {
421
-                    // 组装申请机构
422
-                   // insertDept(affiliate);
423
-                    // 新增申请机构和代理人
424
-                    caseApplicationService.insertAgentUser(affiliate);
425
-                }else if(StrUtil.isNotEmpty(affiliate.getApplicationName())&&affiliate.getOrganizeFlag()==0){
426
-                    // 查询申请人角色id
427
-                    Long roleId = roleMapper.selectRoleIdByName("申请人");
428
-                    caseApplicationService.insertApplicantUser(affiliate,false,roleId);
429
-                    caseApplicationService.insertApplicantUser(affiliate,true,roleId);
455
+            // 设置申请机构
456
+            if (StrUtil.isNotEmpty(affiliate.getApplicationName())&&affiliate.getOrganizeFlag()==1) {
457
+                // 组装申请机构
458
+                // insertDept(affiliate);
459
+                // 新增申请机构和代理人
460
+                caseApplicationService.insertAgentUser(affiliate);
461
+            }else if(StrUtil.isNotEmpty(affiliate.getApplicationName())&&affiliate.getOrganizeFlag()==0){
462
+                // 查询申请人角色id
463
+                Long roleId = roleMapper.selectRoleIdByName("申请人");
464
+                caseApplicationService.insertApplicantUser(affiliate,false,roleId);
465
+                caseApplicationService.insertApplicantUser(affiliate,true,roleId);
430 466
 
431 467
 
432
-                }
433
-                // 压缩包导入,则根据身份证号获取性别和出生日期
434
-                if (caseApplication.isImportFlag() && StrUtil.isNotEmpty(affiliate.getRespondentIdentityNum())) {
435
-                    setBirthByIdentityNum(affiliate);
436
-                }
437
-                if (StrUtil.isNotEmpty(affiliate.getAgentEmail())) {
438
-                    affiliate.setAgentEmail(affiliate.getAgentEmail().replace("\n", "").replaceAll("\\s", ""));
439
-                }
440
-                if (StrUtil.isNotEmpty(affiliate.getRespondentEmail())) {
441
-                    affiliate.setRespondentEmail(affiliate.getRespondentEmail().replace("\n", "").replaceAll("\\s", ""));
442
-                }
443
-                    msCaseAffiliateMapper.insert(affiliate);
444
-                     // 批量生成调解申请书
445
-                    MsCaseApplicationReq req = new MsCaseApplicationReq();
446
-                        req.setCaseFlowId(caseFlow.getId());
447
-                    if(!caseApplication.isImportFlag()) {
448
-                      req.setId(caseApplication.getId());
449
-                    }else {
450
-                        // 压缩包导入
451
-                        req.setBatchNumber(caseApplication.getBatchNumber());
452
-                    }
453
-                    // 生成调解申请书
454
-                    if(affiliate.getOrganizeFlag()==0){
455
-                        // 自然人
456
-                        req.setTemplateType(TemplateTypeEnum.PERSON_MEDIATION_APPLICATION.getCode());
457
-                    }else {
458
-                        // 机构
459
-                        req.setTemplateType(TemplateTypeEnum.MEDIATION_APPLICATION.getCode());
460
-                    }
461
-                    req.setTemplateId(String.valueOf(templateId));
462
-
463
-                    caseApplicationService.generateApplication(req);
468
+            }
469
+            // 压缩包导入,则根据身份证号获取性别和出生日期
470
+            if (caseApplication.isImportFlag() && StrUtil.isNotEmpty(affiliate.getRespondentIdentityNum())) {
471
+                setBirthByIdentityNum(affiliate);
472
+            }
473
+            if (StrUtil.isNotEmpty(affiliate.getAgentEmail())) {
474
+                affiliate.setAgentEmail(affiliate.getAgentEmail().replace("\n", "").replaceAll("\\s", ""));
475
+            }
476
+            if (StrUtil.isNotEmpty(affiliate.getRespondentEmail())) {
477
+                affiliate.setRespondentEmail(affiliate.getRespondentEmail().replace("\n", "").replaceAll("\\s", ""));
478
+            }
479
+            msCaseAffiliateMapper.insert(affiliate);
480
+            // 批量生成调解申请书
481
+            MsCaseApplicationReq req = new MsCaseApplicationReq();
482
+            req.setCaseFlowId(caseFlow.getId());
483
+            if(!caseApplication.isImportFlag()) {
484
+                req.setId(caseApplication.getId());
485
+            }else {
486
+                // 压缩包导入
487
+                req.setBatchNumber(caseApplication.getBatchNumber());
488
+            }
489
+            // 生成调解申请书
490
+            if(affiliate.getOrganizeFlag()==0){
491
+                // 自然人
492
+                req.setTemplateType(TemplateTypeEnum.PERSON_MEDIATION_APPLICATION.getCode());
493
+            }else {
494
+                // 机构
495
+                req.setTemplateType(TemplateTypeEnum.MEDIATION_APPLICATION.getCode());
496
+            }
497
+            req.setTemplateId(String.valueOf(caseApplication.getTemplateId()));
498
+            // todo 部署放开
499
+            caseApplicationService.generateApplication(req);
464 500
             // 保存案件附件
465 501
             if (CollectionUtil.isNotEmpty(caseAttachList)) {
466 502
                 for (MsCaseAttach caseAttach : caseAttachList) {
@@ -482,10 +518,61 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
482 518
                 columnValueMapper.batchSave(columnValueList);
483 519
             }
484 520
             CaseLogUtils.insertCaseLog(caseApplication.getId(), 0, "新增案件", "");
485
-            return 1;
521
+            return caseApplication.getCaseNum();
486 522
         }
487 523
 
488
-        return 0;
524
+        return "";
525
+    }
526
+
527
+    /**
528
+     * 获取第一个流程节点
529
+     * @return
530
+     */
531
+    private MsCaseFlow getCaseFlow() {
532
+
533
+        //  查询所有流程节点
534
+        Example flowExample = new Example(MsCaseFlow.class);
535
+        flowExample.setOrderByClause("sort asc");
536
+        List<MsCaseFlow> caseFlows = caseFlowMapper.selectByExample(flowExample);
537
+        if (CollectionUtil.isEmpty(caseFlows)) {
538
+            throw new ServiceException("请先配置流程");
539
+        }
540
+        return caseFlows.get(0);
541
+    }
542
+
543
+    /**
544
+     * 获取模板id
545
+     * @return
546
+     */
547
+    private Long getTemplate() {
548
+
549
+       return templateManageMapper.selectByCreditCode(creditCode);
550
+    }
551
+
552
+    /**
553
+     * 批量新增
554
+     * @param vo
555
+     * @return
556
+     */
557
+    @Transactional
558
+    @Override
559
+    public AjaxResult batchInsert(MsCaseBatchInsertVO vo) {
560
+        if(CollectionUtil.isEmpty(vo.getList())){
561
+            return AjaxResult.error("案件不能为空");
562
+        }
563
+        // 设置模板id,根据机构代码查询模板
564
+        Long templateId = getTemplate();
565
+        // 获取第一个流程节点
566
+        MsCaseFlow caseFlow =  getCaseFlow();
567
+        List<String> caseNumList = new ArrayList<>();
568
+        for (MsCaseApplicationVO caseApplicationVO : vo.getList()) {
569
+            caseApplicationVO.setTemplateId(templateId);
570
+            String caseNum = caseApplicationService.insert(caseApplicationVO, caseFlow);
571
+            caseNumList.add(caseNum);
572
+        }
573
+        AjaxResult success = AjaxResult.success();
574
+        success.put("caseNumList",caseNumList);
575
+        return success;
489 576
     }
490 577
 
491 578
     /**
@@ -518,6 +605,8 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
518 605
                 sysUser.setNickName(name);
519 606
                 sysUser.setPhonenumber(phone);
520 607
                 sysUser.setPassword(SecurityUtils.encryptPassword("abc123456"));
608
+                sysUser.setIdType(affiliate.getIdType());
609
+                sysUser.setNationality(affiliate.getNationality());
521 610
                 sysUser.setCreateBy(SecurityUtils.getUsername());
522 611
                 userMapper.insertUser(sysUser);
523 612
                 userRoleMapper.insertUserRole(sysUser.getUserId(), roleId);
@@ -565,7 +654,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
565 654
         example.createCriteria().andIn("roleid", roles.stream().map(SysRole::getRoleId).collect(Collectors.toList()));
566 655
         List<MsCaseFlowRoleRelated> caseFlowRoleRelatedList = caseFlowRoleRelatedMapper.selectByExample(example);
567 656
         if (CollectionUtil.isEmpty(caseFlowRoleRelatedList)) {
568
-            throw new ServiceException("该角色绑定案件流程");
657
+            throw new ServiceException("该角色绑定案件流程");
569 658
         }
570 659
         Example flowExample = new Example(MsCaseFlow.class);
571 660
         flowExample.setOrderByClause("sort asc");
@@ -1461,7 +1550,6 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
1461 1550
                         .annexType(annexType)
1462 1551
                         .useId(SecurityUtils.getUserId())
1463 1552
                         .useAccount(SecurityUtils.getUsername())
1464
-                        .isBatchUpload(1L)
1465 1553
                         .build();
1466 1554
                 int count = msCaseAttachMapper.save(caseAttach);
1467 1555
                 if (count > 0 ) {
@@ -1672,7 +1760,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
1672 1760
         if (CollectionUtil.isEmpty(users)) {
1673 1761
             return AjaxResult.error("暂无调解员");
1674 1762
         }
1675
-        // todo 根据角色查询是否已经选择了调解员进行回显
1763
+        //  根据角色查询是否已经选择了调解员进行回显
1676 1764
         List<Long> userIds = users.stream().map(SysUser::getUserId).collect(Collectors.toList());
1677 1765
         //  状态为未结束的是待办数量,结束的是已办数量
1678 1766
         Map<Long, List<MsCaseApplication>> caseMap=null;
@@ -1777,7 +1865,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
1777 1865
         // 申请人预约
1778 1866
         if (vo.getMiniProgressFlag() == null || vo.getMiniProgressFlag().equals( YesOrNoEnum.NO.getCode())) {
1779 1867
             // 新增日志
1780
-            CaseLogUtils.insertCaseLog(vo.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(), "申请人选择调解员");
1868
+            CaseLogUtils.insertCaseLog(vo.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(), null);
1781 1869
 
1782 1870
             if (StrUtil.isEmpty(msCaseAffiliate.getRespondentIdentityNum())) {
1783 1871
                 return AjaxResult.error("被申请人身份证为空");
@@ -1788,7 +1876,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
1788 1876
         } else {
1789 1877
             // 被申请人预约
1790 1878
             // 新增日志
1791
-            CaseLogUtils.insertCaseLog(vo.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(), "被申请人选择调解员");
1879
+            CaseLogUtils.insertCaseLog(vo.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(), null);
1792 1880
             // 判断申请人是否预约
1793 1881
             caseApplicationService. isReservation( vo,userIds);
1794 1882
 
@@ -2067,6 +2155,26 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
2067 2155
     public List<SmsSendRecord> getSmsSendRecord(SmsSendRecord smsSendRecord) {
2068 2156
         return smsRecordMapper.getSmsSendRecord(smsSendRecord);
2069 2157
     }
2158
+    /**
2159
+     * 保存onlyOffice在线编辑的文件
2160
+     * @param
2161
+     * @return
2162
+     */
2163
+    @Transactional
2164
+    @Override
2165
+    public AjaxResult saveOnlyOfficeFile(MsCaseAttach caseAttach) {
2166
+        if(StrUtil.isEmpty(caseAttach.getAnnexName())) {
2167
+            caseAttach.setAnnexName("调解书");
2168
+        }
2169
+            caseAttach.setAnnexType(AnnexTypeEnum.MEDIATE_BOOK.getCode());
2170
+            caseAttach.setUseId(getUserInfo().getUserId());
2171
+            caseAttach.setUseAccount(getUserInfo().getUserName());
2172
+            // 先删除之前的在新增
2173
+            msCaseAttachMapper.deleteCaseAttachByCasedIdAndType(caseAttach.getCaseAppliId(), caseAttach.getAnnexType());
2174
+            msCaseAttachMapper.save(caseAttach);
2175
+
2176
+        return AjaxResult.success();
2177
+    }
2070 2178
 
2071 2179
     /**
2072 2180
      * 查询预约信息
@@ -2117,6 +2225,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
2117 2225
         if (currentFlow == null) {
2118 2226
             throw new ServiceException("未找到当前流程节点");
2119 2227
         }
2228
+        Integer mediaResult = req.getMediaResult();
2120 2229
         MsCaseAffiliate caseAffiliate = msCaseAffiliateMapper.selectByPrimaryKey(req.getId());
2121 2230
         if (application.getMediationMethod().equals("1")) {
2122 2231
             // 线上调解
@@ -2129,18 +2238,17 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
2129 2238
                     msCaseAttachMapper.updateCaseAttach(attach);
2130 2239
                 }
2131 2240
             }
2132
-            Integer mediaResult = req.getMediaResult();
2133
-            if(mediaResult!=null){
2134
-                if(mediaResult.intValue()==1){
2241
+                if(mediaResult ==1){
2135 2242
                     //达成调解
2136 2243
                         List<MsCaseAttach> caseAttachList = msCaseAttachMapper.queryAnnexPathByCaseId(req.getId());
2137 2244
                         if (caseAttachList != null && caseAttachList.size() > 0) {
2138 2245
                             for (MsCaseAttach caseAttach : caseAttachList) {
2139 2246
                                 if (caseAttach.getAnnexType() == AnnexTypeEnum.MEDIATE_BOOK.getCode()) {
2140
-                                    String prefix = "/profile";
2141
-                                    int startIndex = prefix.length();
2247
+                                  //  String prefix = "/profile";
2248
+                                  //  int startIndex = prefix.length();
2142 2249
                                     String annexPath = caseAttach.getAnnexPath();
2143
-                                    String path = "/home/ruoyi/uploadPath/" + annexPath.substring(startIndex+1);
2250
+                                  //  String path = "/home/ruoyi/uploadPath/" + annexPath.substring(startIndex+1);
2251
+                                    String path = annexPath;
2144 2252
                                     //获取文件上传地址
2145 2253
                                     EsignHttpResponse response = SaaSAPIFileUtils.getUploadUrl(path);
2146 2254
                                     String body = response.getBody();
@@ -2485,11 +2593,9 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
2485 2593
                         CaseLogUtils.insertCaseLog(application.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(),"");
2486 2594
                         application.setCaseFlowId(caseFlow.getId());
2487 2595
                         application.setCaseStatusName(caseFlow.getCaseStatusName());
2596
+                        application.setMediaResult(mediaResult);
2488 2597
                         msCaseApplicationMapper.updateByPrimaryKey(application);
2489 2598
                     }
2490
-
2491
-                    application.setMediaResult(mediaResult);
2492
-                    msCaseApplicationMapper.updateByPrimaryKeySelective(application);
2493 2599
                     return AjaxResult.success();
2494 2600
                 }else if(mediaResult.intValue()==3){
2495 2601
                     //未达成调解但不再争议
@@ -2500,14 +2606,12 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
2500 2606
                     if(caseFlow != null){
2501 2607
                         application.setCaseFlowId(caseFlow.getId());
2502 2608
                         application.setCaseStatusName(caseFlow.getCaseStatusName());
2609
+                        application.setMediaResult(mediaResult);
2503 2610
                         msCaseApplicationMapper.updateByPrimaryKey(application);
2504 2611
                         // 新增日志
2505 2612
                         CaseLogUtils.insertCaseLog(application.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(),"");
2506 2613
 
2507 2614
                     }
2508
-
2509
-                    application.setMediaResult(mediaResult);
2510
-                    msCaseApplicationMapper.updateByPrimaryKeySelective(application);
2511 2615
                     return AjaxResult.success();
2512 2616
                 }else if(mediaResult.intValue()==4){
2513 2617
                     //未达成调解但同意引入仲裁
@@ -2532,6 +2636,19 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
2532 2636
                             .header("signstr", signStr)
2533 2637
                             .body(paramsbody)
2534 2638
                             .execute();
2639
+                    // 修改案件状态为结束
2640
+                    Example flowExample = new Example(MsCaseFlow.class);
2641
+                    flowExample.createCriteria().andEqualTo("caseStatusName", "结束");
2642
+                    MsCaseFlow caseFlow = caseFlowMapper.selectOneByExample(flowExample);
2643
+                    if(caseFlow != null){
2644
+                        // 新增日志
2645
+                        CaseLogUtils.insertCaseLog(application.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(),"");
2646
+                        application.setCaseFlowId(caseFlow.getId());
2647
+                        application.setCaseStatusName(caseFlow.getCaseStatusName());
2648
+                        application.setMediaResult(mediaResult);
2649
+                        msCaseApplicationMapper.updateByPrimaryKey(application);
2650
+                    }
2651
+
2535 2652
                     return AjaxResult.success();
2536 2653
                 }else if(mediaResult.intValue()==5){
2537 2654
                     // 达成和解
@@ -2539,10 +2656,11 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
2539 2656
                         if (caseAttachList != null && caseAttachList.size() > 0) {
2540 2657
                             for (MsCaseAttach caseAttach : caseAttachList) {
2541 2658
                                 if (caseAttach.getAnnexType() == AnnexTypeEnum.MEDIATE_BOOK.getCode()) {
2542
-                                    String prefix = "/profile";
2543
-                                    int startIndex = prefix.length();
2659
+                                   // String prefix = "/profile";
2660
+                                  //  int startIndex = prefix.length();
2544 2661
                                     String annexPath = caseAttach.getAnnexPath();
2545
-                                    String path = "/home/ruoyi/uploadPath/" + annexPath.substring(startIndex+1);
2662
+//                                    String path = "/home/ruoyi/uploadPath/" + annexPath.substring(startIndex+1);
2663
+                                    String path = annexPath;
2546 2664
                                     //获取文件上传地址
2547 2665
                                     EsignHttpResponse response = SaaSAPIFileUtils.getUploadUrl(path);
2548 2666
                                     String body = response.getBody();
@@ -2779,7 +2897,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
2779 2897
                         }
2780 2898
                 }
2781 2899
 
2782
-            }
2900
+
2783 2901
         } else {
2784 2902
             // 线下调解
2785 2903
             List<MsCaseAttach> attachList = req.getAttachList();
@@ -2792,14 +2910,45 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
2792 2910
                 attach.setCaseAppliId(req.getId());
2793 2911
                 msCaseAttachMapper.updateCaseAttach(attach);
2794 2912
             }
2795
-           // msCaseAttachMapper.batchSave(attachList);
2796 2913
             // 修改案件状态为待送达
2797 2914
             Example flowExample = new Example(MsCaseFlow.class);
2798
-            flowExample.createCriteria().andEqualTo("caseStatusName", "待送达");
2915
+            if(mediaResult ==1 || mediaResult == 5){
2916
+                // 达成调解,达成和解,案件状态改为待送达
2917
+                flowExample.createCriteria().andEqualTo("caseStatusName", "待送达");
2918
+            } else if(mediaResult == 2 || mediaResult == 3){
2919
+                // 未达成调解,未达成调解但不在争议改为结束状态
2920
+                flowExample.createCriteria().andEqualTo("caseStatusName", "结束");
2921
+            }
2922
+            else if(mediaResult == 4){
2923
+                //  未达成调解但同意引入仲裁系统,改为结束状态,并调仲裁新增接口
2924
+                flowExample.createCriteria().andEqualTo("caseStatusName", "结束");
2925
+                String accessSec = "mCFMA6ffe938v79m";
2926
+                MsCaseApplicationVO applicationVO = new MsCaseApplicationVO();
2927
+                BeanUtils.copyProperties(application,applicationVO);
2928
+
2929
+                CaseApplicationVO caseApplicationVO = new CaseApplicationVO();
2930
+                BeanUtils.copyProperties(applicationVO,caseApplicationVO);
2931
+                boolean importFlag = applicationVO.isImportFlag();
2932
+                if(importFlag==true){
2933
+                    caseApplicationVO.setImportFlag(1);
2934
+                }else {
2935
+                    caseApplicationVO.setImportFlag(0);
2936
+                }
2937
+                String paramsbody = JSONUtil.toJsonStr(caseApplicationVO);
2938
+                long timestamp = System.currentTimeMillis();
2939
+                String signStr = SignCheckUtils.getSign(paramsbody, accessSec, timestamp);
2940
+                String urlstr = arbitrateUrl;
2941
+                HttpResponse httpResponse = HttpRequest.post(urlstr)
2942
+                        .header("timestampstr", String.valueOf(timestamp))
2943
+                        .header("signstr", signStr)
2944
+                        .body(paramsbody)
2945
+                        .execute();
2946
+            }
2799 2947
             MsCaseFlow caseFlow = caseFlowMapper.selectOneByExample(flowExample);
2800 2948
             if(caseFlow != null){
2801 2949
                 application.setCaseFlowId(caseFlow.getId());
2802 2950
                 application.setCaseStatusName(caseFlow.getCaseStatusName());
2951
+                application.setMediaResult(mediaResult);
2803 2952
                 msCaseApplicationMapper.updateByPrimaryKey(application);
2804 2953
                 // 新增日志
2805 2954
                 CaseLogUtils.insertCaseLog(application.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(),"");
@@ -2808,7 +2957,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
2808 2957
         }
2809 2958
 
2810 2959
 
2811
-        return AjaxResult.error();
2960
+        return AjaxResult.success();
2812 2961
     }
2813 2962
 
2814 2963
     /**
@@ -3633,15 +3782,68 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
3633 3782
         // 将word中的标签替换掉,生成新的word
3634 3783
         wordChangeText(templatePath, bookmarkValueMap,saveFolderPath,resultFilePath);
3635 3784
 
3636
-        MsCaseAttach caseAttach = MsCaseAttach.builder()
3637
-                .caseAppliId(application.getId())
3638
-                .annexName(orgFileName+".docx")
3639
-                .annexPath(resultFilePath.replace(RuoYiConfig.getProfile(),Constants.RESOURCE_PREFIX))
3640
-                .annexType(annexType)
3641
-                .build();
3785
+        MsCaseAttach caseAttach = null;
3786
+       String annexPath=resultFilePath.replace(RuoYiConfig.getProfile(),Constants.RESOURCE_PREFIX);
3787
+       // 如果是调解书或者调解协议上传到onlyoffice服务器
3788
+        if(annexType != null   && annexType.equals(AnnexTypeEnum.MEDIATE_BOOK.getCode())){
3789
+            JSONArray jsonArray = caseApplicationService.uploadOnlyOffice(annexPath,application.getId());
3790
+            if(jsonArray!=null && jsonArray.size() > 0){
3791
+                    for (Object obj : jsonArray) {
3792
+                        JSONObject jsonObject = (JSONObject) obj;
3793
+                        caseAttach=    MsCaseAttach.builder()
3794
+                                .caseAppliId(application.getId())
3795
+                                .annexName(jsonObject.getString("fileName"))
3796
+                                .annexPath(jsonObject.getString("filePath"))
3797
+                                .annexType(annexType)
3798
+                                .onlyOfficeFileId(jsonObject.getString("fileId"))
3799
+                                .build();
3800
+
3801
+                }
3802
+            }
3803
+
3804
+        }else {
3805
+            caseAttach = MsCaseAttach.builder()
3806
+                    .caseAppliId(application.getId())
3807
+                    .annexName(orgFileName+".docx")
3808
+                    .annexPath(resultFilePath.replace(RuoYiConfig.getProfile(),Constants.RESOURCE_PREFIX))
3809
+                    .annexType(annexType)
3810
+                    .build();
3811
+        }
3642 3812
         //保存到附件表里,先删除之前的在保存
3643
-        msCaseAttachMapper.deleteCaseAttachByCasedIdAndType(caseAttach.getCaseAppliId(), annexType);
3644
-        msCaseAttachMapper.save(caseAttach);
3813
+        if(caseAttach != null) {
3814
+           msCaseAttachMapper.deleteCaseAttachByCasedIdAndType(caseAttach.getCaseAppliId(), annexType);
3815
+            msCaseAttachMapper.save(caseAttach);
3816
+        }
3817
+    }
3818
+
3819
+    /**
3820
+     * 调解书上传到onlyoffice服务器
3821
+     * @param annexPath
3822
+     */
3823
+    @Override
3824
+    @Transactional
3825
+    public JSONArray uploadOnlyOffice(String annexPath,Long caseId) {
3826
+        annexPath=annexPath.replace("/profile","/home/ruoyi/uploadPath");
3827
+        File file = new File(annexPath);
3828
+        if (file.exists()) {
3829
+           // 调用onlyoffice
3830
+            try {
3831
+                Map<String, Object> params = new HashMap<>();
3832
+                params.put("file", file);
3833
+                String postResult = HttpUtil.post(onlyOfficeUrl+ "/"+String.valueOf(caseId), params);
3834
+                if(StrUtil.isNotEmpty(postResult)){
3835
+                    // 转为jsonArray
3836
+                    JSONArray jsonArray = JSONArray.parseArray(postResult);
3837
+
3838
+                    return jsonArray;
3839
+                }
3840
+            } catch (Exception e) {
3841
+                throw new ServiceException("上传OnlyOffice服务器失败");
3842
+            }
3843
+        }else {
3844
+            throw new ServiceException("文件不存在");
3845
+        }
3846
+        return null;
3645 3847
     }
3646 3848
 
3647 3849
     /**
@@ -3878,6 +4080,8 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
3878 4080
             agentUser.setNickName(affiliate.getNameAgent());
3879 4081
             agentUser.setPhonenumber(affiliate.getContactTelphoneAgent());
3880 4082
             agentUser.setPassword(SecurityUtils.encryptPassword("abc123456"));
4083
+            agentUser.setNationality(affiliate.getNationality());
4084
+            agentUser.setIdType(affiliate.getIdType());
3881 4085
          //   agentUser.setDeptId(Long.valueOf(affiliate.getApplicationId()));
3882 4086
             userMapper.insertUser(agentUser);
3883 4087
             userRoleMapper.insertUserRole(agentUser.getUserId(), roleId);

+ 2
- 2
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/MsCasePaymentServiceImpl.java Dosyayı Görüntüle

@@ -350,7 +350,7 @@ public class MsCasePaymentServiceImpl implements MsCasePaymentService {
350 350
         }
351 351
         // 新增日志
352 352
         if (dto.getYesOrNo().equals(YesOrNoEnum.YES.getCode())) {
353
-            CaseLogUtils.insertCaseLog(application.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(), "确认已缴费");
353
+            CaseLogUtils.insertCaseLog(application.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(), null);
354 354
         }else {
355 355
             CaseLogUtils.insertCaseLog(application.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(), "拒绝确认缴费,拒绝原因为:"+dto.getReason());
356 356
         }
@@ -509,7 +509,7 @@ public class MsCasePaymentServiceImpl implements MsCasePaymentService {
509 509
         application.setCaseFlowId(nextFlow.getId());
510 510
         application.setCaseStatusName(nextFlow.getCaseStatusName());
511 511
         caseApplicationMapper.updateByPrimaryKeySelective(application);
512
-        CaseLogUtils.insertCaseLog(application.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(),"确认缴费");
512
+        CaseLogUtils.insertCaseLog(application.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(),null);
513 513
     }
514 514
 
515 515
 

+ 341
- 5
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/MsSignSealServiceImpl.java Dosyayı Görüntüle

@@ -60,6 +60,7 @@ import tk.mybatis.mapper.entity.Example;
60 60
 
61 61
 import javax.annotation.Resource;
62 62
 import java.io.File;
63
+import java.io.IOException;
63 64
 import java.time.LocalDate;
64 65
 import java.util.*;
65 66
 import java.util.stream.Collectors;
@@ -83,6 +84,8 @@ public class MsSignSealServiceImpl implements MsSignSealService {
83 84
     MsCaseFlowMapper caseFlowMapper;
84 85
     @Autowired
85 86
     private SysUserMapper userMapper;
87
+    @Autowired
88
+    private MsCaseAttachMapper caseAttachMapper;
86 89
 
87 90
     @Autowired
88 91
     private SysUserMapper sysUserMapper;
@@ -408,7 +411,7 @@ public class MsSignSealServiceImpl implements MsSignSealService {
408 411
                 application.setCaseFlowId(nextFlow.getId());
409 412
                 application.setCaseStatusName(nextFlow.getCaseStatusName());
410 413
                 caseApplicationMapper.updateByPrimaryKeySelective(application);
411
-                CaseLogUtils.insertCaseLog(application.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(),"用印申请");
414
+                CaseLogUtils.insertCaseLog(application.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(),null);
412 415
             }
413 416
         } else {
414 417
             // 单独
@@ -418,7 +421,7 @@ public class MsSignSealServiceImpl implements MsSignSealService {
418 421
             application.setCaseFlowId(nextFlow.getId());
419 422
             application.setCaseStatusName(nextFlow.getCaseStatusName());
420 423
             caseApplicationMapper.updateByPrimaryKeySelective(application);
421
-            CaseLogUtils.insertCaseLog(application.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(),"用印申请");
424
+            CaseLogUtils.insertCaseLog(application.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(),null);
422 425
         }
423 426
         return AjaxResult.success("用印申请成功");
424 427
 
@@ -566,7 +569,13 @@ public class MsSignSealServiceImpl implements MsSignSealService {
566 569
                     caseNodeTime= DateUtil.format(record.getCreateTime(), DatePattern.NORM_DATETIME_FORMATTER);
567 570
                 }
568 571
                 Integer caseNode = record.getCaseNode();
569
-                contentBuilder.append(Optional.ofNullable(record.getCreateNickName()).orElse("")).append("(").append(record.getCreateBy()).append(")").append("于").append(caseNodeTime);
572
+                String createBy = record.getCreateBy();
573
+                if(StrUtil.isNotEmpty(createBy)){
574
+                    contentBuilder.append(Optional.ofNullable(record.getCreateNickName()).orElse("")).append("(").append(record.getCreateBy()).append(")").append("于").append(caseNodeTime);
575
+                }else{
576
+                    contentBuilder.append(Optional.ofNullable(record.getCreateNickName()).orElse("")).append("于").append(caseNodeTime);
577
+                }
578
+
570 579
                 if(StrUtil.isNotEmpty(record.getContent())){
571 580
                     contentBuilder.append(record.getContent());
572 581
                 }else if(caseNode.intValue() == 0){
@@ -777,7 +786,7 @@ public class MsSignSealServiceImpl implements MsSignSealService {
777 786
             caseApplicationselect.setCaseFlowId(nextFlow.getId());
778 787
             caseApplicationselect.setCaseStatusName(nextFlow.getCaseStatusName());
779 788
             caseApplicationMapper.updateByPrimaryKeySelective(caseApplicationselect);
780
-            CaseLogUtils.insertCaseLog(caseApplicationselect.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(),"签收");
789
+            CaseLogUtils.insertCaseLog(caseApplicationselect.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(),null);
781 790
         }
782 791
 //        if (dto.getIsSignRespon() != null && dto.getIsSignRespon().intValue() == 1) {
783 792
 //            caseAffiliate.setIsSignRespon(1);
@@ -801,7 +810,7 @@ public class MsSignSealServiceImpl implements MsSignSealService {
801 810
             caseApplicationselect.setCaseFlowId(nextFlow.getId());
802 811
             caseApplicationselect.setCaseStatusName(nextFlow.getCaseStatusName());
803 812
             caseApplicationMapper.updateByPrimaryKeySelective(caseApplicationselect);
804
-            CaseLogUtils.insertCaseLog(caseApplicationselect.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(),"签收");
813
+            CaseLogUtils.insertCaseLog(caseApplicationselect.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(),null);
805 814
         }
806 815
 
807 816
         return AjaxResult.success("签收成功");
@@ -1008,6 +1017,333 @@ public class MsSignSealServiceImpl implements MsSignSealService {
1008 1017
         return AjaxResult.success(sealSignRecordres);
1009 1018
     }
1010 1019
 
1020
+    @Override
1021
+    @Transactional(rollbackFor = Exception.class)
1022
+    public AjaxResult signSeaalCaseApplicaCallback(String reqbodystr) throws EsignDemoException, IOException {
1023
+        JSONObject jsonObjectCallback = JSONObject.parseObject(reqbodystr);
1024
+        Gson gson = new Gson();
1025
+        if (jsonObjectCallback != null) {
1026
+            int signResult = jsonObjectCallback.getIntValue("signResult");
1027
+            String action = jsonObjectCallback.getString("action");
1028
+            String signFlowId = jsonObjectCallback.getString("signFlowId");
1029
+            Long operateTime = jsonObjectCallback.getLongValue("operateTime");
1030
+            JSONObject operator = jsonObjectCallback.getJSONObject("operator");
1031
+            JSONObject psnAccount = operator.getJSONObject("psnAccount");
1032
+            String accountMobile = psnAccount.getString("accountMobile");
1033
+
1034
+            Example msSealSignRecordExample = new Example(MsSealSignRecord.class);
1035
+            msSealSignRecordExample.createCriteria().andEqualTo("signFlowId", signFlowId);
1036
+            MsSealSignRecord sealSignRecordsel = sealSignRecordMapper.selectOneByExample(msSealSignRecordExample);
1037
+
1038
+            String pensonAccountApply = sealSignRecordsel.getPensonAccount();
1039
+            String orgnNamePsnAcc = sealSignRecordsel.getOrgnNamePsnAcc();
1040
+            String pensonAccountRes = sealSignRecordsel.getPensonAccountRes();
1041
+            String pensonAccountMedi = sealSignRecordsel.getPensonAccountMedi();
1042
+            String pensonName = sealSignRecordsel.getPensonName();
1043
+            String orgnNamePsnName = sealSignRecordsel.getOrgnNamePsnName();
1044
+            String pensonNameRes = sealSignRecordsel.getPensonNameRes();
1045
+            String pensonNameMedi = sealSignRecordsel.getPensonNameMedi();
1046
+            Date dateOperate = new Date(operateTime);
1047
+
1048
+            Integer signStatusApply = sealSignRecordsel.getSignStatusApply();
1049
+            Integer signStatusResponse = sealSignRecordsel.getSignStatusResponse();
1050
+            Integer signStatusMediator = sealSignRecordsel.getSignStatusMediator();
1051
+            Integer sealStatus = sealSignRecordsel.getSealStatus();
1052
+
1053
+            Long caseAppliId = sealSignRecordsel.getCaseAppliId();
1054
+            MsCaseApplication caseApplicationselect = msCaseApplicationMapper.selectByPrimaryKey(caseAppliId);
1055
+            Integer mediaResult = caseApplicationselect.getMediaResult();
1056
+            MsCaseFlow currentFlow = caseFlowMapper.selectByPrimaryKey(caseApplicationselect.getCaseFlowId());
1057
+            Integer caseNode = currentFlow.getNodeId();
1058
+            String caseStatusName = currentFlow.getCaseStatusName();
1059
+
1060
+
1061
+            if("SIGN_MISSON_COMPLETE".equals(action) && signResult==2){
1062
+                if(mediaResult.intValue()==1){
1063
+                    //调解
1064
+                    if(StringUtils.isNotEmpty(accountMobile)&&accountMobile.equals(pensonAccountApply)){
1065
+                        //申请人签名
1066
+                        sealSignRecordsel.setSignStatusApply(1);
1067
+                        sealSignRecordMapper.updateByPrimaryKeySelective(sealSignRecordsel);
1068
+                        MsCaseLogRecord operLog = new MsCaseLogRecord();
1069
+                        operLog.setCreateNickName(pensonName);
1070
+                        operLog.setCaseStatusName(caseStatusName);
1071
+                        operLog.setCaseAppliId(caseAppliId);
1072
+                        operLog.setCaseNode(caseNode);
1073
+                        operLog.setCreateTime(dateOperate);
1074
+                        caseLogRecordMapper.insert(operLog);
1075
+                        if(signStatusResponse!=null&&signStatusResponse.intValue()==1&&
1076
+                                signStatusMediator!=null&&signStatusMediator.intValue()==1){
1077
+                            // 根据流程id查找下一个流程节点
1078
+                            MsCaseFlow nextFlow = caseFlowMapper.nextFlow(caseApplicationselect.getCaseFlowId().intValue());
1079
+                            MsCaseApplication application = new MsCaseApplication();
1080
+                            application.setId(caseApplicationselect.getId());
1081
+                            application.setCaseFlowId(nextFlow.getId());
1082
+                            application.setCaseStatusName(nextFlow.getCaseStatusName());
1083
+                            caseApplicationMapper.updateByPrimaryKeySelective(application);
1084
+
1085
+                            //修改"签署用印记录表"的状态为待用印
1086
+                            sealSignRecordsel.setSignFlowStatus(2);
1087
+                            sealSignRecordMapper.updateByPrimaryKeySelective(sealSignRecordsel);
1088
+                        }
1089
+                    }else if(StringUtils.isNotEmpty(accountMobile)&&accountMobile.equals(pensonAccountRes)){
1090
+                        //被申请人签名
1091
+                        sealSignRecordsel.setSignStatusResponse(1);
1092
+                        sealSignRecordMapper.updateByPrimaryKeySelective(sealSignRecordsel);
1093
+                        MsCaseLogRecord operLog = new MsCaseLogRecord();
1094
+                        operLog.setCreateNickName(pensonNameRes);
1095
+                        operLog.setCaseStatusName(caseStatusName);
1096
+                        operLog.setCaseAppliId(caseAppliId);
1097
+                        operLog.setCaseNode(caseNode);
1098
+                        operLog.setCreateTime(dateOperate);
1099
+                        caseLogRecordMapper.insert(operLog);
1100
+                        if(signStatusApply!=null&&signStatusApply.intValue()==1&&
1101
+                                signStatusMediator!=null&&signStatusMediator.intValue()==1){
1102
+                            // 根据流程id查找下一个流程节点
1103
+                            MsCaseFlow nextFlow = caseFlowMapper.nextFlow(caseApplicationselect.getCaseFlowId().intValue());
1104
+                            MsCaseApplication application = new MsCaseApplication();
1105
+                            application.setId(caseApplicationselect.getId());
1106
+                            application.setCaseFlowId(nextFlow.getId());
1107
+                            application.setCaseStatusName(nextFlow.getCaseStatusName());
1108
+                            caseApplicationMapper.updateByPrimaryKeySelective(application);
1109
+
1110
+                            //修改"签署用印记录表"的状态为待用印
1111
+                            sealSignRecordsel.setSignFlowStatus(2);
1112
+                            sealSignRecordMapper.updateByPrimaryKeySelective(sealSignRecordsel);
1113
+                        }
1114
+                    }else if(StringUtils.isNotEmpty(accountMobile)&&accountMobile.equals(pensonAccountMedi)){
1115
+                        //调解员签名
1116
+                        sealSignRecordsel.setSignStatusMediator(1);
1117
+                        sealSignRecordMapper.updateByPrimaryKeySelective(sealSignRecordsel);
1118
+                        MsCaseLogRecord operLog = new MsCaseLogRecord();
1119
+                        operLog.setCreateNickName(pensonNameMedi);
1120
+                        operLog.setCaseStatusName(caseStatusName);
1121
+                        operLog.setCaseAppliId(caseAppliId);
1122
+                        operLog.setCaseNode(caseNode);
1123
+                        operLog.setCreateTime(dateOperate);
1124
+                        caseLogRecordMapper.insert(operLog);
1125
+                        if(signStatusApply!=null&&signStatusApply.intValue()==1&&
1126
+                                signStatusResponse!=null&&signStatusResponse.intValue()==1){
1127
+                            // 根据流程id查找下一个流程节点
1128
+                            MsCaseFlow nextFlow = caseFlowMapper.nextFlow(caseApplicationselect.getCaseFlowId().intValue());
1129
+                            MsCaseApplication application = new MsCaseApplication();
1130
+                            application.setId(caseApplicationselect.getId());
1131
+                            application.setCaseFlowId(nextFlow.getId());
1132
+                            application.setCaseStatusName(nextFlow.getCaseStatusName());
1133
+                            caseApplicationMapper.updateByPrimaryKeySelective(application);
1134
+
1135
+                            //修改"签署用印记录表"的状态为待用印
1136
+                            sealSignRecordsel.setSignFlowStatus(2);
1137
+                            sealSignRecordMapper.updateByPrimaryKeySelective(sealSignRecordsel);
1138
+                        }
1139
+                    }else if(StringUtils.isNotEmpty(accountMobile)&&accountMobile.equals(orgnNamePsnAcc)){
1140
+                        sealSignRecordsel.setSealStatus(1);
1141
+                        sealSignRecordsel.setSignFlowStatus(3);
1142
+                        sealSignRecordMapper.updateByPrimaryKeySelective(sealSignRecordsel);
1143
+                        MsCaseLogRecord operLog = new MsCaseLogRecord();
1144
+                        operLog.setCreateNickName(orgnNamePsnName);
1145
+                        operLog.setCaseStatusName(caseStatusName);
1146
+                        operLog.setCaseAppliId(caseAppliId);
1147
+                        operLog.setCaseNode(caseNode);
1148
+                        operLog.setCreateTime(dateOperate);
1149
+                        caseLogRecordMapper.insert(operLog);
1150
+
1151
+                        // 根据流程id查找下一个流程节点
1152
+                        MsCaseFlow nextFlow = caseFlowMapper.nextFlow(caseApplicationselect.getCaseFlowId().intValue());
1153
+                        MsCaseApplication application = new MsCaseApplication();
1154
+                        application.setId(caseApplicationselect.getId());
1155
+                        application.setCaseFlowId(nextFlow.getId());
1156
+                        application.setCaseStatusName(nextFlow.getCaseStatusName());
1157
+                        caseApplicationMapper.updateByPrimaryKeySelective(application);
1158
+
1159
+                        //下载审核完成的调解书
1160
+                        EsignHttpResponse fileDownload = SaaSAPIFileUtils.fileDownloadUrl(signFlowId);
1161
+                        JsonObject fileDownloadJsonObject = gson.fromJson(fileDownload.getBody(), JsonObject.class);
1162
+                        JsonObject fileDownloadData = fileDownloadJsonObject.getAsJsonObject("data");
1163
+                        JsonArray filesArray = fileDownloadData.get("files").getAsJsonArray();
1164
+                        if (filesArray != null && filesArray.size() > 0) {
1165
+                            JsonObject fileObject = (JsonObject) filesArray.get(0);
1166
+                            String fileDownloadUrl = fileObject.get("downloadUrl").toString();
1167
+                            LocalDate now = LocalDate.now();
1168
+                            String year = Integer.toString(now.getYear());
1169
+                            String month = String.format("%02d", now.getMonthValue());
1170
+                            String day = String.format("%02d", now.getDayOfMonth());
1171
+                            String saveFolderPath = "/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day;
1172
+                            String fileName = UUID.randomUUID().toString().replace("-", "") + ".pdf";
1173
+//                                String saveName = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName;
1174
+//                                String savePath = "/home/ruoyi/uploadPath/upload/";
1175
+                            String saveName = fileName;
1176
+                            String savePath = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName;
1177
+
1178
+                            // 创建日期目录
1179
+                            File saveFolder = new File(saveFolderPath);
1180
+                            if (!saveFolder.exists()) {
1181
+                                saveFolder.mkdirs();
1182
+                            }
1183
+                            String resultFilePath = saveFolderPath + "/" + fileName;
1184
+                            File resultFilePathFile = new File(resultFilePath);
1185
+                            if (!resultFilePathFile.exists()) {
1186
+                                resultFilePathFile.createNewFile();
1187
+                            }
1188
+
1189
+                            String fileDownloadUrlnew = fileDownloadUrl.substring(1, fileDownloadUrl.length() - 1);
1190
+                            boolean downLoadFile = FileTransformation.downLoadFileByUrl(fileDownloadUrlnew, resultFilePath);
1191
+                            if (downLoadFile) {
1192
+                                MsCaseAttach caseAttach = new MsCaseAttach();
1193
+                                caseAttach.setCaseAppliId(caseAppliId);
1194
+                                caseAttach.setAnnexType(7);
1195
+                                caseAttach.setAnnexPath(savePath);
1196
+                                caseAttach.setAnnexName(saveName);
1197
+                                caseAttachMapper.updateCaseAttachBycaseid(caseAttach);
1198
+                            }
1199
+
1200
+                        }
1201
+                    }
1202
+
1203
+                }else if(mediaResult.intValue()==5){
1204
+                    //和解
1205
+                    if(StringUtils.isNotEmpty(accountMobile)&&accountMobile.equals(pensonAccountApply)){
1206
+                        //申请人签名
1207
+                        sealSignRecordsel.setSignStatusApply(1);
1208
+                        sealSignRecordMapper.updateByPrimaryKeySelective(sealSignRecordsel);
1209
+                        MsCaseLogRecord operLog = new MsCaseLogRecord();
1210
+                        operLog.setCreateNickName(pensonName);
1211
+                        operLog.setCaseStatusName(caseStatusName);
1212
+                        operLog.setCaseAppliId(caseAppliId);
1213
+                        operLog.setCaseNode(caseNode);
1214
+                        operLog.setCreateTime(dateOperate);
1215
+                        caseLogRecordMapper.insert(operLog);
1216
+                        if(signStatusResponse!=null&&signStatusResponse.intValue()==1){
1217
+                            MsCaseFlow nextFlow = caseFlowMapper.nextFlow1(caseApplicationselect.getCaseFlowId().intValue());
1218
+                            MsCaseApplication application = new MsCaseApplication();
1219
+                            application.setId(caseApplicationselect.getId());
1220
+                            application.setCaseFlowId(nextFlow.getId());
1221
+                            application.setCaseStatusName(nextFlow.getCaseStatusName());
1222
+                            caseApplicationMapper.updateByPrimaryKeySelective(application);
1223
+
1224
+                            //修改"签署用印记录表"的状态为完成
1225
+                            sealSignRecordsel.setSignFlowStatus(3);
1226
+                            sealSignRecordMapper.updateByPrimaryKeySelective(sealSignRecordsel);
1227
+
1228
+                            //下载审核完成的调解书
1229
+                            EsignHttpResponse fileDownload = SaaSAPIFileUtils.fileDownloadUrl(signFlowId);
1230
+                            JsonObject fileDownloadJsonObject = gson.fromJson(fileDownload.getBody(), JsonObject.class);
1231
+                            JsonObject fileDownloadData = fileDownloadJsonObject.getAsJsonObject("data");
1232
+                            JsonArray filesArray = fileDownloadData.get("files").getAsJsonArray();
1233
+                            if (filesArray != null && filesArray.size() > 0) {
1234
+                                JsonObject fileObject = (JsonObject) filesArray.get(0);
1235
+                                String fileDownloadUrl = fileObject.get("downloadUrl").toString();
1236
+                                LocalDate now = LocalDate.now();
1237
+                                String year = Integer.toString(now.getYear());
1238
+                                String month = String.format("%02d", now.getMonthValue());
1239
+                                String day = String.format("%02d", now.getDayOfMonth());
1240
+                                String saveFolderPath = "/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day;
1241
+                                String fileName = UUID.randomUUID().toString().replace("-", "") + ".pdf";
1242
+//                                String saveName = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName;
1243
+//                                String savePath = "/home/ruoyi/uploadPath/upload/";
1244
+                                String saveName = fileName;
1245
+                                String savePath = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName;
1246
+
1247
+                                // 创建日期目录
1248
+                                File saveFolder = new File(saveFolderPath);
1249
+                                if (!saveFolder.exists()) {
1250
+                                    saveFolder.mkdirs();
1251
+                                }
1252
+                                String resultFilePath = saveFolderPath + "/" + fileName;
1253
+                                File resultFilePathFile = new File(resultFilePath);
1254
+                                if (!resultFilePathFile.exists()) {
1255
+                                    resultFilePathFile.createNewFile();
1256
+                                }
1257
+
1258
+                                String fileDownloadUrlnew = fileDownloadUrl.substring(1, fileDownloadUrl.length() - 1);
1259
+                                boolean downLoadFile = FileTransformation.downLoadFileByUrl(fileDownloadUrlnew, resultFilePath);
1260
+                                if (downLoadFile) {
1261
+                                    MsCaseAttach caseAttach = new MsCaseAttach();
1262
+                                    caseAttach.setCaseAppliId(caseAppliId);
1263
+                                    caseAttach.setAnnexType(7);
1264
+                                    caseAttach.setAnnexPath(savePath);
1265
+                                    caseAttach.setAnnexName(saveName);
1266
+                                    caseAttachMapper.updateCaseAttachBycaseid(caseAttach);
1267
+                                }
1268
+
1269
+                            }
1270
+                        }
1271
+                    }else if(StringUtils.isNotEmpty(accountMobile)&&accountMobile.equals(pensonAccountRes)){
1272
+                        //被申请人签名
1273
+                        sealSignRecordsel.setSignStatusResponse(1);
1274
+                        sealSignRecordMapper.updateByPrimaryKeySelective(sealSignRecordsel);
1275
+                        MsCaseLogRecord operLog = new MsCaseLogRecord();
1276
+                        operLog.setCreateNickName(pensonNameRes);
1277
+                        operLog.setCaseStatusName(caseStatusName);
1278
+                        operLog.setCaseAppliId(caseAppliId);
1279
+                        operLog.setCaseNode(caseNode);
1280
+                        operLog.setCreateTime(dateOperate);
1281
+                        caseLogRecordMapper.insert(operLog);
1282
+                        if(signStatusApply!=null&&signStatusApply.intValue()==1){
1283
+                            MsCaseFlow nextFlow = caseFlowMapper.nextFlow1(caseApplicationselect.getCaseFlowId().intValue());
1284
+                            MsCaseApplication application = new MsCaseApplication();
1285
+                            application.setId(caseApplicationselect.getId());
1286
+                            application.setCaseFlowId(nextFlow.getId());
1287
+                            application.setCaseStatusName(nextFlow.getCaseStatusName());
1288
+                            caseApplicationMapper.updateByPrimaryKeySelective(application);
1289
+
1290
+                            //修改"签署用印记录表"的状态为完成
1291
+                            sealSignRecordsel.setSignFlowStatus(3);
1292
+                            sealSignRecordMapper.updateByPrimaryKeySelective(sealSignRecordsel);
1293
+
1294
+                            //下载审核完成的调解书
1295
+                            EsignHttpResponse fileDownload = SaaSAPIFileUtils.fileDownloadUrl(signFlowId);
1296
+                            JsonObject fileDownloadJsonObject = gson.fromJson(fileDownload.getBody(), JsonObject.class);
1297
+                            JsonObject fileDownloadData = fileDownloadJsonObject.getAsJsonObject("data");
1298
+                            JsonArray filesArray = fileDownloadData.get("files").getAsJsonArray();
1299
+                            if (filesArray != null && filesArray.size() > 0) {
1300
+                                JsonObject fileObject = (JsonObject) filesArray.get(0);
1301
+                                String fileDownloadUrl = fileObject.get("downloadUrl").toString();
1302
+                                LocalDate now = LocalDate.now();
1303
+                                String year = Integer.toString(now.getYear());
1304
+                                String month = String.format("%02d", now.getMonthValue());
1305
+                                String day = String.format("%02d", now.getDayOfMonth());
1306
+                                String saveFolderPath = "/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day;
1307
+                                String fileName = UUID.randomUUID().toString().replace("-", "") + ".pdf";
1308
+//                                String saveName = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName;
1309
+//                                String savePath = "/home/ruoyi/uploadPath/upload/";
1310
+                                String saveName = fileName;
1311
+                                String savePath = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName;
1312
+
1313
+                                // 创建日期目录
1314
+                                File saveFolder = new File(saveFolderPath);
1315
+                                if (!saveFolder.exists()) {
1316
+                                    saveFolder.mkdirs();
1317
+                                }
1318
+                                String resultFilePath = saveFolderPath + "/" + fileName;
1319
+                                File resultFilePathFile = new File(resultFilePath);
1320
+                                if (!resultFilePathFile.exists()) {
1321
+                                    resultFilePathFile.createNewFile();
1322
+                                }
1323
+
1324
+                                String fileDownloadUrlnew = fileDownloadUrl.substring(1, fileDownloadUrl.length() - 1);
1325
+                                boolean downLoadFile = FileTransformation.downLoadFileByUrl(fileDownloadUrlnew, resultFilePath);
1326
+                                if (downLoadFile) {
1327
+                                    MsCaseAttach caseAttach = new MsCaseAttach();
1328
+                                    caseAttach.setCaseAppliId(caseAppliId);
1329
+                                    caseAttach.setAnnexType(7);
1330
+                                    caseAttach.setAnnexPath(savePath);
1331
+                                    caseAttach.setAnnexName(saveName);
1332
+                                    caseAttachMapper.updateCaseAttachBycaseid(caseAttach);
1333
+                                }
1334
+
1335
+                            }
1336
+                        }
1337
+                    }
1338
+                }
1339
+            }
1340
+
1341
+        }else{
1342
+            return AjaxResult.error("error");
1343
+        }
1344
+        return AjaxResult.success("success");
1345
+    }
1346
+
1011 1347
     /**
1012 1348
      * 通过邮件发送裁决书文件
1013 1349
      *

+ 46
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/DigesdateUtils.java Dosyayı Görüntüle

@@ -0,0 +1,46 @@
1
+package com.ruoyi.wisdomarbitrate.utils;
2
+
3
+import javax.crypto.Mac;
4
+import javax.crypto.spec.SecretKeySpec;
5
+import java.io.UnsupportedEncodingException;
6
+import java.security.InvalidKeyException;
7
+import java.security.NoSuchAlgorithmException;
8
+
9
+public class DigesdateUtils {
10
+
11
+    public static String getSignStr(String paramsStr, String accessSec ) {
12
+        Mac macDiges = null;
13
+        try {
14
+            macDiges = Mac.getInstance("HmacSHA256");
15
+            SecretKeySpec accessSecKey = new SecretKeySpec(accessSec.getBytes("UTF-8"), "HmacSHA256");
16
+            macDiges.init(accessSecKey);
17
+            macDiges.update(paramsStr.getBytes("UTF-8"));
18
+        } catch (NoSuchAlgorithmException e) {
19
+            e.printStackTrace();
20
+            return null;
21
+        } catch (UnsupportedEncodingException e) {
22
+            e.printStackTrace();
23
+            return null;
24
+        } catch (InvalidKeyException e) {
25
+            e.printStackTrace();
26
+            return null;
27
+        }
28
+        return byteTrasferhex(macDiges.doFinal());
29
+    }
30
+
31
+    public static String byteTrasferhex(byte[] byteArrayData) {
32
+        StringBuilder hashBuilder = new StringBuilder();
33
+        String stmpHex;
34
+        for (int n = 0; byteArrayData != null && n < byteArrayData.length; n++) {
35
+            stmpHex = Integer.toHexString(byteArrayData[n] & 0XFF);
36
+            if (stmpHex.length() == 1)
37
+                hashBuilder.append('0');
38
+            hashBuilder.append(stmpHex);
39
+        }
40
+        return hashBuilder.toString();
41
+    }
42
+
43
+
44
+
45
+
46
+}

+ 1
- 1
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/FixSelectFlowDetailUtils.java Dosyayı Görüntüle

@@ -243,7 +243,7 @@ public class FixSelectFlowDetailUtils {
243 243
     /*
244 244
     定时查询签署流程详情
245 245
      */
246
-    @Scheduled(cron = "0/10 * * * * ?")
246
+//    @Scheduled(cron = "0/10 * * * * ?")
247 247
     @Transactional
248 248
     public void fixExecuteSelectFlowDetailUtils() {
249 249
         Gson gson = new Gson();

+ 5
- 1
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/SignAward.java Dosyayı Görüntüle

@@ -12,6 +12,7 @@ import com.ruoyi.common.utils.SealUtil;
12 12
 import com.ruoyi.wisdomarbitrate.domain.dto.dept.DeptIdentify;
13 13
 import com.ruoyi.wisdomarbitrate.domain.dto.mscase.SealSignRecord;
14 14
 import com.ruoyi.wisdomarbitrate.domain.vo.base.StringIdsReq;
15
+import org.springframework.beans.factory.annotation.Value;
15 16
 
16 17
 import java.util.List;
17 18
 import java.util.Map;
@@ -22,6 +23,9 @@ public class SignAward {
22 23
     private static String eSignAppId = EsignApplicaConfig.EsignAppId;
23 24
     private static String eSignAppSecret = EsignApplicaConfig.EsignAppSecret;
24 25
 
26
+    @Value("${signSealCallbackConfig.url}")
27
+    private static String signSealCallbackUrl;
28
+
25 29
 
26 30
     public static void main(String[] args) throws EsignDemoException {
27 31
         Gson gson = new Gson();
@@ -351,7 +355,7 @@ public class SignAward {
351 355
                 "       \"signConfig\": {\n" +
352 356
                 "           \"availableSignClientTypes\":  \"1\"\n" +
353 357
                 "       },\n" +
354
-
358
+//                "        \"notifyUrl\": \"" + signSealCallbackUrl + "\",\n" +
355 359
                 "        \"autoFinish\": true\n" +
356 360
                 "    },\n" +
357 361
 

+ 99
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/SignVerifyUtils.java Dosyayı Görüntüle

@@ -0,0 +1,99 @@
1
+package com.ruoyi.wisdomarbitrate.utils;
2
+
3
+import com.ruoyi.common.utils.EsignApplicaConfig;
4
+import com.ruoyi.common.utils.StringUtils;
5
+import com.ruoyi.wisdomarbitrate.service.miniprogress.impl.IdentityAuthenticationServiceImpl;
6
+import org.slf4j.Logger;
7
+import org.slf4j.LoggerFactory;
8
+import org.springframework.web.context.request.RequestContextHolder;
9
+import org.springframework.web.context.request.ServletRequestAttributes;
10
+
11
+import javax.servlet.http.HttpServletRequest;
12
+import java.io.IOException;
13
+import java.io.UnsupportedEncodingException;
14
+import java.util.ArrayList;
15
+import java.util.Collections;
16
+import java.util.Enumeration;
17
+import java.util.List;
18
+
19
+public class SignVerifyUtils {
20
+    private static String eSignAppSecret = EsignApplicaConfig.EsignAppSecret;
21
+
22
+
23
+
24
+    public static boolean checkSignuter() throws Exception {
25
+        HttpServletRequest httprequest = ((ServletRequestAttributes) (RequestContextHolder.currentRequestAttributes())).getRequest();
26
+        String orialsignature =  httprequest.getHeader("X-Tsign-Open-SIGNATURE");
27
+        String timestampreq = httprequest.getHeader("X-Tsign-Open-TIMESTAMP");
28
+        String reqQuerystr =getHttpreqQuery();
29
+        //获取请求参数
30
+        String reqbodystr =getRequestBody();
31
+        String signOriaData = timestampreq + reqQuerystr + reqbodystr;
32
+        String newDisgSignuter= DigesdateUtils.getSignStr(signOriaData, eSignAppSecret);
33
+
34
+
35
+        if (StringUtils.equals(orialsignature, newDisgSignuter)) {
36
+            return true;
37
+        }else {
38
+            return false;
39
+        }
40
+    }
41
+
42
+
43
+
44
+    public static  String getHttpreqQuery() {
45
+        HttpServletRequest httprequest = ((ServletRequestAttributes) (RequestContextHolder.currentRequestAttributes())).getRequest();
46
+        List<String> reqNames= new ArrayList();
47
+        Enumeration<String> httpreqEle =httprequest.getParameterNames();
48
+        while (httpreqEle.hasMoreElements()){
49
+            reqNames.add(httpreqEle.nextElement());
50
+        }
51
+        Collections.sort(reqNames);
52
+        String httpreqQuery = "";
53
+        for (String reqName : reqNames) {
54
+            String reqvalue = httprequest.getParameter(reqName);
55
+            httpreqQuery += reqvalue == null ? "" : reqvalue;
56
+        }
57
+        return  httpreqQuery;
58
+    }
59
+
60
+    public static String getRequestBody() {
61
+        HttpServletRequest httprequest = ((ServletRequestAttributes) (RequestContextHolder.currentRequestAttributes())).getRequest();
62
+        String requestBody = "";
63
+        int reqContentLen = httprequest.getContentLength();
64
+        if (reqContentLen < 0) {
65
+            return null;
66
+        }
67
+        byte bufByteArray[] = new byte[reqContentLen];
68
+        try {
69
+            for (int i = 0; i < reqContentLen;) {
70
+                int lengthReadInputStream = httprequest.getInputStream().read(bufByteArray, i, reqContentLen - i);
71
+                if (lengthReadInputStream == -1) {
72
+                    break;
73
+                }
74
+                i += lengthReadInputStream;
75
+            }
76
+        } catch (IOException e) {
77
+            e.printStackTrace();
78
+        }
79
+        try {
80
+            requestBody = new String(bufByteArray, "UTF-8");
81
+        } catch (UnsupportedEncodingException e) {
82
+            e.printStackTrace();
83
+        }
84
+        return requestBody;
85
+    }
86
+
87
+
88
+
89
+
90
+
91
+
92
+
93
+
94
+
95
+
96
+
97
+
98
+
99
+}

+ 9
- 1
ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml Dosyayı Görüntüle

@@ -9,6 +9,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
9 9
         <result property="userName"     column="user_name"    />
10 10
         <result property="nickName"     column="nick_name"    />
11 11
 		<result property="idCard"    column="id_card" />
12
+		<result property="idType"    column="id_type" />
13
+		<result property="nationality"    column="nationality" />
12 14
         <result property="email"        column="email"        />
13 15
         <result property="phonenumber"  column="phonenumber"  />
14 16
         <result property="sex"          column="sex"          />
@@ -50,7 +52,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
50 52
 	
51 53
 	<sql id="selectUserVo">
52 54
         select u.user_id, u.user_name, u.nick_name,u.specialty, u.id_card,u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark,
53
-        r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status,u.id_card
55
+        r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status,u.id_card,u.id_type,u.nationality
54 56
         from ms_sys_user u
55 57
 		    left join ms_sys_user_role ur on u.user_id = ur.user_id
56 58
 		    left join ms_sys_role r on r.role_id = ur.role_id
@@ -200,6 +202,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
200 202
  			<if test="userName != null and userName != ''">user_name,</if>
201 203
  			<if test="nickName != null and nickName != ''">nick_name,</if>
202 204
  			<if test="idCard != null and idCard != ''">id_card,</if>
205
+ 			<if test="idType != null ">id_type,</if>
206
+ 			<if test="nationality != null ">nationality,</if>
203 207
  			<if test="email != null and email != ''">email,</if>
204 208
  			<if test="avatar != null and avatar != ''">avatar,</if>
205 209
  			<if test="phonenumber != null and phonenumber != ''">phonenumber,</if>
@@ -216,6 +220,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
216 220
             <if test="userName != null and userName != ''">#{userName},</if>
217 221
             <if test="nickName != null and nickName != ''">#{nickName},</if>
218 222
             <if test="idCard != null and idCard != ''">#{idCard},</if>
223
+            <if test="idType != null ">#{idType},</if>
224
+            <if test="nationality != null ">#{nationality},</if>
219 225
             <if test="email != null and email != ''">#{email},</if>
220 226
             <if test="avatar != null and avatar != ''">#{avatar},</if>
221 227
             <if test="phonenumber != null and phonenumber != ''">#{phonenumber},</if>
@@ -272,6 +278,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
272 278
            <if test="userName != null and userName != ''">user_name = #{userName},</if>
273 279
            <if test="nickName != null and nickName != ''">nick_name = #{nickName},</if>
274 280
            <if test="idCard != null and idCard != ''">id_card = #{idCard},</if>
281
+           <if test="idType != null">id_type = #{idType},</if>
282
+           <if test="nationality != null">nationality = #{nationality},</if>
275 283
            <if test="email != null ">email = #{email},</if>
276 284
            <if test="phonenumber != null ">phonenumber = #{phonenumber},</if>
277 285
            <if test="sex != null and sex != ''">sex = #{sex},</if>

+ 4
- 0
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/dept/MsSealSignRecordMapper.xml Dosyayı Görüntüle

@@ -23,6 +23,10 @@
23 23
     <result column="position_xorg" jdbcType="DOUBLE" property="positionXorg" />
24 24
     <result column="position_yorg" jdbcType="DOUBLE" property="positionYorg" />
25 25
     <result column="file_download_url" jdbcType="LONGVARCHAR" property="fileDownloadUrl" />
26
+    <result column="sign_status_apply" jdbcType="INTEGER" property="signStatusApply" />
27
+    <result column="sign_status_response" jdbcType="INTEGER" property="signStatusResponse" />
28
+    <result column="sign_status_mediator" jdbcType="INTEGER" property="signStatusMediator" />
29
+    <result column="seal_status" jdbcType="INTEGER" property="sealStatus" />
26 30
   </resultMap>
27 31
 
28 32
 

+ 8
- 10
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/mscase/MsCaseAttachMapper.xml Dosyayı Görüntüle

@@ -13,18 +13,19 @@
13 13
         <result property="sealStatus"     column="seal_status"    />
14 14
         <result property="useId"     column="use_id"    />
15 15
         <result property="useAccount"     column="use_account"    />
16
+        <result property="onlyOfficeFileId"     column="only_office_file_id"    />
16 17
     </resultMap>
17 18
     <insert id="save" useGeneratedKeys="true" keyProperty="annexId">
18
-        INSERT INTO ms_case_attach (case_appli_id, annex_name, annex_path , annex_type,note,use_id,use_account,seal_status,is_batch_upload)
19
-        VALUES (#{caseAppliId}, #{annexName}, #{annexPath},#{annexType},#{note},#{useId},#{useAccount},#{sealStatus},#{isBatchUpload})
19
+        INSERT INTO ms_case_attach (case_appli_id, annex_name, annex_path , annex_type,note,use_id,use_account,seal_status,only_office_file_id)
20
+        VALUES (#{caseAppliId}, #{annexName}, #{annexPath},#{annexType},#{note},#{useId},#{useAccount},#{sealStatus},#{onlyOfficeFileId})
20 21
     </insert>
21 22
     <insert id="batchSave" useGeneratedKeys="true" keyProperty="annexId">
22
-        INSERT INTO ms_case_attach (case_appli_id, annex_name, annex_path , annex_type,note,use_id,use_account,seal_status,is_batch_upload)
23
+        INSERT INTO ms_case_attach (case_appli_id, annex_name, annex_path , annex_type,note,use_id,use_account,seal_status,only_office_file_id)
23 24
         VALUES
24 25
         <foreach item="item" index="index" collection="list" separator=",">
25 26
 
26 27
 
27
-         (#{item.caseAppliId}, #{item.annexName}, #{item.annexPath},#{item.annexType},#{item.note},#{item.useId},#{item.useAccount},#{item.sealStatus},#{item.isBatchUpload})
28
+         (#{item.caseAppliId}, #{item.annexName}, #{item.annexPath},#{item.annexType},#{item.note},#{item.useId},#{item.useAccount},#{item.sealStatus},#{item.onlyOfficeFileId})
28 29
         </foreach>
29 30
     </insert>
30 31
     <delete id="deleteByFileIds">
@@ -38,19 +39,16 @@
38 39
         delete from ms_case_attach
39 40
         where case_appli_id = #{caseAppliId}
40 41
         and annex_type = #{annexType}
41
-        <if test="isBatchUpload != null ">
42
-            AND is_batch_upload = #{isBatchUpload}
43
-        </if>
44 42
     </delete>
45 43
 
46 44
     <select id="queryAnnexPathByCaseId" resultType="com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAttach" resultMap="CaseAttachResult">
47
-        select annex_id,case_appli_id,annex_name,annex_path,annex_type,note,use_id,use_account
45
+        select *
48 46
         from ms_case_attach
49 47
         where case_appli_id =#{id}
50 48
     </select>
51 49
 
52 50
     <select id="listCaseAttachByCaseIdAndType" resultType="com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAttach" resultMap="CaseAttachResult">
53
-        select annex_id,case_appli_id,annex_name,annex_path,annex_type,note,use_id,use_account
51
+        select *
54 52
         from ms_case_attach
55 53
         <where>
56 54
             <if test="caseAppliId != null ">
@@ -78,7 +76,7 @@
78 76
     </delete>
79 77
 
80 78
     <select id="queryCaseAttachList" resultMap="CaseAttachResult">
81
-        select annex_id,case_appli_id,annex_name,annex_path,annex_type,note,use_id,use_account
79
+        select *
82 80
         from ms_case_attach
83 81
         <where>
84 82
             <if test="id != null ">