Browse Source

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

wangqiong123 2 years ago
parent
commit
f87943e9f5

+ 15
- 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/miniprogress/WeChatUserController.java View File

5
 import com.ruoyi.common.core.controller.BaseController;
5
 import com.ruoyi.common.core.controller.BaseController;
6
 import com.ruoyi.common.core.domain.AjaxResult;
6
 import com.ruoyi.common.core.domain.AjaxResult;
7
 import com.ruoyi.common.core.domain.entity.SysRole;
7
 import com.ruoyi.common.core.domain.entity.SysRole;
8
+import com.ruoyi.common.core.domain.entity.SysUser;
8
 import com.ruoyi.system.mapper.SysRoleMapper;
9
 import com.ruoyi.system.mapper.SysRoleMapper;
10
+import com.ruoyi.system.mapper.SysUserMapper;
9
 import com.ruoyi.wisdomarbitrate.domain.dto.miniprogress.IdentityAuthentication;
11
 import com.ruoyi.wisdomarbitrate.domain.dto.miniprogress.IdentityAuthentication;
10
 import com.ruoyi.wisdomarbitrate.domain.vo.miniprogress.WeChatUserVO;
12
 import com.ruoyi.wisdomarbitrate.domain.vo.miniprogress.WeChatUserVO;
11
 import com.ruoyi.wisdomarbitrate.service.miniprogress.WeChatUserService;
13
 import com.ruoyi.wisdomarbitrate.service.miniprogress.WeChatUserService;
26
     private WeChatUserService weChatUserService;
28
     private WeChatUserService weChatUserService;
27
     @Autowired
29
     @Autowired
28
     private SysRoleMapper roleMapper;
30
     private SysRoleMapper roleMapper;
31
+    @Autowired
32
+    private SysUserMapper userMapper;
29
     /**
33
     /**
30
      * 小程序端获取手机验证码
34
      * 小程序端获取手机验证码
31
      * @param userVO
35
      * @param userVO
67
         logger.info("调用小程序注册==="+ientityAuthentication.toString());
71
         logger.info("调用小程序注册==="+ientityAuthentication.toString());
68
         return weChatUserService.registerUser(ientityAuthentication);
72
         return weChatUserService.registerUser(ientityAuthentication);
69
     }
73
     }
74
+    @Anonymous
75
+    @GetMapping("/verifyUserName")
76
+    public AjaxResult verifyUserName(@RequestParam("userName") String userName)
77
+    {
78
+        SysUser sysUser = userMapper.checkUserNameUnique(userName);
79
+        if(sysUser==null){
80
+            return AjaxResult.success();
81
+        }else {
82
+            return AjaxResult.error("用户名已存在!");
83
+        }
84
+    }
70
 
85
 
71
 }
86
 }

+ 2
- 1
ruoyi-admin/src/main/resources/application-druid.yml View File

6
         druid:
6
         druid:
7
             # 主库数据源
7
             # 主库数据源
8
             master:
8
             master:
9
-                url: jdbc:mysql://121.40.189.20:3306/mediation_system?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&useSSL=true&serverTimezone=Asia/Shanghai&useSSL=false
9
+#                url: jdbc:mysql://121.40.189.20:3306/mediation_system?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&useSSL=true&serverTimezone=Asia/Shanghai&useSSL=false
10
+                url: jdbc:mysql://121.40.189.20:3306/mediation_system_prod?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&useSSL=true&serverTimezone=Asia/Shanghai&useSSL=false
10
                 username: root
11
                 username: root
11
                 password: YMzc157#
12
                 password: YMzc157#
12
             # 从库数据源
13
             # 从库数据源

+ 7
- 4
ruoyi-admin/src/main/resources/application.yml View File

17
 
17
 
18
 # 开发环境配置
18
 # 开发环境配置
19
 server:
19
 server:
20
-  # 服务器的HTTP端口,默认为8080
21
-  port: 6001
20
+  # 测试环境6001,开发环境7001
21
+  port: 7001
22
   servlet:
22
   servlet:
23
     # 应用的访问路径
23
     # 应用的访问路径
24
     context-path: /
24
     context-path: /
131
   mapperLocations: classpath*:mapper/**/*Mapper.xml
131
   mapperLocations: classpath*:mapper/**/*Mapper.xml
132
   # 加载全局的配置文件
132
   # 加载全局的配置文件
133
   configLocation: classpath:mybatis/mybatis-config.xml
133
   configLocation: classpath:mybatis/mybatis-config.xml
134
-  configuration:
135
-    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
134
+#  configuration:
135
+#    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
136
 # PageHelper分页插件
136
 # PageHelper分页插件
137
 pagehelper:
137
 pagehelper:
138
   helperDialect: mysql
138
   helperDialect: mysql
188
 organizeConfig:
188
 organizeConfig:
189
   # creditCode
189
   # creditCode
190
   creditCode: 910000058386410047
190
   creditCode: 910000058386410047
191
+#  引入仲裁系统url配置
192
+arbitrateConfig:
193
+  url: http://121.40.189.20:9001/callArbitrateCaseApplication/generateCaseApplication
191
 #jodconverter:
194
 #jodconverter:
192
 #  local:
195
 #  local:
193
 #    host: 121.40.189.20
196
 #    host: 121.40.189.20

+ 1
- 1
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/entity/mscase/MsCaseApplication.java View File

99
     private String payType;
99
     private String payType;
100
 
100
 
101
     /**
101
     /**
102
-     * 调解结果,1达成调解,2未达成调解,3未达成调解但不再争议,4未达成调解但同意引入仲裁
102
+     * 调解结果,1达成调解,2未达成调解,3未达成调解但不再争议,4未达成调解但同意引入仲裁,5-达成和解
103
      */
103
      */
104
     @Column(name = "media_result")
104
     @Column(name = "media_result")
105
     private Integer mediaResult;
105
     private Integer mediaResult;

+ 4
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/mscase/MsCaseApplicationVO.java View File

73
      * 缴费拒绝原因
73
      * 缴费拒绝原因
74
      */
74
      */
75
     private String reason;
75
     private String reason;
76
+    /**
77
+     * 签名按钮显示,0-显示,1-不显示
78
+     */
79
+    private Integer signButtonFlag;
76
 
80
 
77
 
81
 
78
 }
82
 }

+ 2
- 2
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/mscase/MsCaseApplicationMapper.java View File

34
      * @param caseStatusNames
34
      * @param caseStatusNames
35
      * @return
35
      * @return
36
      */
36
      */
37
-    @Select("<script> select t.* from (select c.id,c.room_id roomId,c.mediation_method mediationMethod," +
37
+    @Select("<script> select t.* from (select c.media_result mediaResult,c.id,c.room_id roomId,c.mediation_method mediationMethod," +
38
             "   CASE c.mediation_method when 1 then '线上调解' when 2 then '线下调解' ELSE '' END mediationMethodName,"
38
             "   CASE c.mediation_method when 1 then '线上调解' when 2 then '线下调解' ELSE '' END mediationMethodName,"
39
             +
39
             +
40
             "0 AS pendingStatus,c.case_flow_id caseFlowId,c.batch_number batchNumber,c.case_num caseNum,c.case_subject_amount caseSubjectAmount," +
40
             "0 AS pendingStatus,c.case_flow_id caseFlowId,c.batch_number batchNumber,c.case_num caseNum,c.case_subject_amount caseSubjectAmount," +
80
             "<if test=\"req.endTime != null and req.endTime != ''\">" +
80
             "<if test=\"req.endTime != null and req.endTime != ''\">" +
81
             "and c.create_time &lt;= #{req.endTime}</if>" +
81
             "and c.create_time &lt;= #{req.endTime}</if>" +
82
             "        </where> " +
82
             "        </where> " +
83
-            "union  select c.id id,c.room_id roomId,c.mediation_method mediationMethod,"
83
+            "union  select c.media_result mediaResult,c.id id,c.room_id roomId,c.mediation_method mediationMethod,"
84
             +
84
             +
85
             "   CASE c.mediation_method when 1 then '线上调解' when 2 then '线下调解' ELSE '' END mediationMethodName,"
85
             "   CASE c.mediation_method when 1 then '线上调解' when 2 then '线下调解' ELSE '' END mediationMethodName,"
86
             +
86
             +

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

42
      * @param ids
42
      * @param ids
43
      */
43
      */
44
     void batchDelete(@Param("ids")List<Long> ids);
44
     void batchDelete(@Param("ids")List<Long> ids);
45
+
46
+    /**
47
+     * 根据附件名查找数量
48
+     * @param fileName
49
+     * @return
50
+     */
51
+    int countByfileName(@Param("annexName") String fileName,@Param("caseAppliId") Long caseAppliId);
45
 }
52
 }

+ 26
- 3
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/MsCaseApplicationServiceImpl.java View File

88
      */
88
      */
89
     @Value("${organizeConfig.creditCode}")
89
     @Value("${organizeConfig.creditCode}")
90
     private long creditCode;
90
     private long creditCode;
91
+
92
+    @Value("${arbitrateConfig.url}")
93
+    private String arbitrateUrl;
91
     @Autowired
94
     @Autowired
92
     MsCaseApplicationService caseApplicationService;
95
     MsCaseApplicationService caseApplicationService;
93
     @Autowired
96
     @Autowired
185
         }
188
         }
186
     //    Map<String, MsCaseFlow> flowMap = caseFlows.stream().collect(Collectors.toMap(MsCaseFlow::getButtonAuthFlag, Function.identity()));
189
     //    Map<String, MsCaseFlow> flowMap = caseFlows.stream().collect(Collectors.toMap(MsCaseFlow::getButtonAuthFlag, Function.identity()));
187
         List<String> caseStatusNames = caseFlows.stream().map(MsCaseFlow::getCaseStatusName).collect(Collectors.toList());
190
         List<String> caseStatusNames = caseFlows.stream().map(MsCaseFlow::getCaseStatusName).collect(Collectors.toList());
191
+        // 是否调解员
192
+        boolean isMediatorRole=false;
188
         // 如果是申请人,可以看见申请人为自己(即自然人)或者委托代理人为自己的案件(即机构)
193
         // 如果是申请人,可以看见申请人为自己(即自然人)或者委托代理人为自己的案件(即机构)
189
         for (SysRole role : roles) {
194
         for (SysRole role : roles) {
190
             if(StrUtil.isNotEmpty(role.getRoleName())){
195
             if(StrUtil.isNotEmpty(role.getRoleName())){
209
                     break;
214
                     break;
210
                 }
215
                 }
211
                 if(StrUtil.equals(role.getRoleName(),"调解员")) {
216
                 if(StrUtil.equals(role.getRoleName(),"调解员")) {
217
+                    isMediatorRole=true;
212
                     req.setMediatorId(String.valueOf(sysUser.getUserId()));
218
                     req.setMediatorId(String.valueOf(sysUser.getUserId()));
213
                     break;
219
                     break;
214
                 }
220
                 }
220
         }
226
         }
221
         startPage();
227
         startPage();
222
         // 查询案件列表
228
         // 查询案件列表
223
-        return  msCaseApplicationMapper.list(req, caseStatusNames);
229
+        List<MsCaseApplicationVO> list = msCaseApplicationMapper.list(req, caseStatusNames);
230
+        if (CollectionUtil.isNotEmpty(list)) {
231
+        // 判断调解员签名按钮权限,0-显示,1-不显示
232
+            for (MsCaseApplicationVO vo : list) {
233
+                if (isMediatorRole && vo.getMediaResult()!=null && vo.getMediaResult()==5) {
234
+                    // 是调解员并且是和解协议,不显示
235
+                    vo.setSignButtonFlag(1);
236
+
237
+                }else {
238
+                    vo.setSignButtonFlag(0);
239
+                }
240
+            }
241
+
242
+        }
243
+        return list;
224
     }
244
     }
225
 
245
 
226
     @Override
246
     @Override
1317
             sendContent = "尊敬的用户,您的" + application.getCaseNum() + "的案件,线上调解日期已确定为"+application.getHearDate()+",请知晓,如非本人操作,请忽略本短信。";
1337
             sendContent = "尊敬的用户,您的" + application.getCaseNum() + "的案件,线上调解日期已确定为"+application.getHearDate()+",请知晓,如非本人操作,请忽略本短信。";
1318
         }else {
1338
         }else {
1319
             // 线下调解 2077966 尊敬的用户,您的{1}案件,线下调解日期已确定为{2},请知晓,如非本人操作,请忽略本短信。
1339
             // 线下调解 2077966 尊敬的用户,您的{1}案件,线下调解日期已确定为{2},请知晓,如非本人操作,请忽略本短信。
1320
-            smsFlag = SmsUtils.sendSms(application.getId(), "2075447", phone, new String[]{application.getCaseNum(),application.getHearDate()});
1340
+            smsFlag = SmsUtils.sendSms(application.getId(), "2077966", phone, new String[]{application.getCaseNum(),application.getHearDate()});
1321
             sendContent = "尊敬的用户,您的" + application.getCaseNum() + "的案件,线下调解日期已确定为"+application.getHearDate()+",请知晓,如非本人操作,请忽略本短信。";
1341
             sendContent = "尊敬的用户,您的" + application.getCaseNum() + "的案件,线下调解日期已确定为"+application.getHearDate()+",请知晓,如非本人操作,请忽略本短信。";
1322
 
1342
 
1323
         }
1343
         }
1824
                     String paramsbody = JSONUtil.toJsonStr(caseApplicationVO);
1844
                     String paramsbody = JSONUtil.toJsonStr(caseApplicationVO);
1825
                     long timestamp = System.currentTimeMillis();
1845
                     long timestamp = System.currentTimeMillis();
1826
                     String signStr = SignCheckUtils.getSign(paramsbody, accessSec, timestamp);
1846
                     String signStr = SignCheckUtils.getSign(paramsbody, accessSec, timestamp);
1827
-                    String urlstr = "http://localhost:8001/callArbitrateCaseApplication/generateCaseApplication";
1847
+                    String urlstr = arbitrateUrl;
1828
                     HttpResponse httpResponse = (HttpResponse) HttpRequest.post(urlstr)
1848
                     HttpResponse httpResponse = (HttpResponse) HttpRequest.post(urlstr)
1829
                             .header("timestampstr", String.valueOf(timestamp))
1849
                             .header("timestampstr", String.valueOf(timestamp))
1830
                             .header("signstr", signStr)
1850
                             .header("signstr", signStr)
2027
                                                 if(caseFlow != null){
2047
                                                 if(caseFlow != null){
2028
                                                     application.setCaseFlowId(caseFlow.getId());
2048
                                                     application.setCaseFlowId(caseFlow.getId());
2029
                                                     application.setCaseStatusName(caseFlow.getCaseStatusName());
2049
                                                     application.setCaseStatusName(caseFlow.getCaseStatusName());
2050
+                                                    // 新增日志
2051
+                                                    CaseLogUtils.insertCaseLog(application.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(),"");
2052
+
2030
                                                 }
2053
                                                 }
2031
 
2054
 
2032
                                                 application.setMediaResult(mediaResult);
2055
                                                 application.setMediaResult(mediaResult);

+ 8
- 1
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/MsSignSealServiceImpl.java View File

538
             }
538
             }
539
 
539
 
540
         }
540
         }
541
-        datas.put("finishCasenode", recordsNew);
541
+        if(caseLogRecordsin!=null&&caseLogRecordsin.size()>0){
542
+            datas.put("finishCasenode", recordsNew);
543
+        }else {
544
+            MsCaseLogRecordVO msCaseLogRecordVO1 = new MsCaseLogRecordVO();
545
+            msCaseLogRecordVO1.setContent("结束");
546
+            recordsNew.add(msCaseLogRecordVO1);
547
+            datas.put("finishCasenode", recordsNew);
548
+        }
542
         datas.put("inCasenode", caseLogRecordsin);
549
         datas.put("inCasenode", caseLogRecordsin);
543
         datas.put("nextCasenode", caseLogRecordsnext);
550
         datas.put("nextCasenode", caseLogRecordsnext);
544
         return success(datas);
551
         return success(datas);

+ 17
- 12
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/VideoConferenceServiceImpl.java View File

53
 import java.util.stream.Collectors;
53
 import java.util.stream.Collectors;
54
 
54
 
55
 import static com.ruoyi.common.core.domain.AjaxResult.success;
55
 import static com.ruoyi.common.core.domain.AjaxResult.success;
56
-import static com.ruoyi.common.utils.file.FileUploadUtils.getAbsoluteFile;
57
-import static com.ruoyi.common.utils.file.FileUploadUtils.getPathFileName;
56
+import static com.ruoyi.common.utils.file.FileUploadUtils.*;
58
 
57
 
59
 /**
58
 /**
60
  * @author wangqiong
59
  * @author wangqiong
454
             String fileName = fileUrl.substring(fileUrl.lastIndexOf("/"));
453
             String fileName = fileUrl.substring(fileUrl.lastIndexOf("/"));
455
             fileName = fileName.replace("/", "");
454
             fileName = fileName.replace("/", "");
456
             fileName=fileId+fileName;
455
             fileName=fileId+fileName;
457
-                String absPath = getAbsoluteFile(RuoYiConfig.getVideoUploadPath(), fileName).getAbsolutePath();
456
+            String annexName=System.currentTimeMillis()+fileName;
457
+            String absPath = getAbsoluteFile(RuoYiConfig.getVideoUploadPath(), annexName).getAbsolutePath();
458
                 staticAndMksDir = Paths.get(absPath).toFile().toString();
458
                 staticAndMksDir = Paths.get(absPath).toFile().toString();
459
             long downloadFile = HttpUtil.downloadFile(fileUrl, staticAndMksDir);
459
             long downloadFile = HttpUtil.downloadFile(fileUrl, staticAndMksDir);
460
             if(downloadFile>0) {
460
             if(downloadFile>0) {
461
+
461
                 Example example = new Example(MsCaseApplication.class);
462
                 Example example = new Example(MsCaseApplication.class);
462
                 example.createCriteria().andEqualTo("roomId", roomId);
463
                 example.createCriteria().andEqualTo("roomId", roomId);
463
                 MsCaseApplication caseApplication = caseApplicationMapper.selectOneByExample(example);
464
                 MsCaseApplication caseApplication = caseApplicationMapper.selectOneByExample(example);
464
                 if(caseApplication != null) {
465
                 if(caseApplication != null) {
465
-                    String annexName = getPathFileName(RuoYiConfig.getVideoUploadPath(), fileName);
466
-                    // 存入数据库
467
-                    MsCaseAttach caseAttach = MsCaseAttach.builder().caseAppliId(caseApplication.getId())
468
-                            .annexName(fileName)
469
-                            .annexPath(annexName)
470
-                            .annexType(AnnexTypeEnum.MEETING_VIDEO.getCode())
471
-                            .build();
472
-                    caseAttachMapper.save(caseAttach);
473
-                    return annexName;
466
+                    // 根据文件名称查询附件,如果该视频已存在则不存入数据库
467
+                    int count= caseAttachMapper.countByfileName(fileName,caseApplication.getId());
468
+                    if(count<1) {
469
+                         annexName = getPathFileName(RuoYiConfig.getVideoUploadPath(), annexName);
470
+                        // 存入数据库
471
+                        MsCaseAttach caseAttach = MsCaseAttach.builder().caseAppliId(caseApplication.getId())
472
+                                .annexName(fileName)
473
+                                .annexPath(annexName)
474
+                                .annexType(AnnexTypeEnum.MEETING_VIDEO.getCode())
475
+                                .build();
476
+                        caseAttachMapper.save(caseAttach);
477
+                        return annexName;
478
+                    }
474
                 }
479
                 }
475
             }
480
             }
476
         }
481
         }

+ 3
- 0
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/mscase/MsCaseAttachMapper.xml View File

104
             </if>
104
             </if>
105
         </where>
105
         </where>
106
     </select>
106
     </select>
107
+    <select id="countByfileName" resultType="java.lang.Integer">
108
+        select count(1) from ms_case_attach where case_appli_id=#{caseAppliId} and annex_name=#{annexName}
109
+    </select>
107
 
110
 
108
     <update id="updateCaseAttach" parameterType="com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAttach">
111
     <update id="updateCaseAttach" parameterType="com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAttach">
109
         update ms_case_attach
112
         update ms_case_attach