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

Merge branch 'wq' of SH-Arbitrate/Arbitrate-Backend into dev

wangqiong123 преди 2 години
родител
ревизия
d69b959534

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

@@ -3,6 +3,7 @@ package com.ruoyi.wisdomarbitrate.mapper;
3 3
 import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
4 4
 import com.ruoyi.wisdomarbitrate.domain.CaseLogRecord;
5 5
 import org.apache.ibatis.annotations.Mapper;
6
+import org.apache.ibatis.annotations.Param;
6 7
 import org.springframework.stereotype.Repository;
7 8
 
8 9
 import java.util.List;
@@ -13,4 +14,6 @@ public interface CaseLogRecordMapper {
13 14
     List<CaseLogRecord> selectCaseLogRecordList(CaseLogRecord caseLogRecord);
14 15
 
15 16
     int insertCaseLogRecord(CaseLogRecord caseLogRecord);
17
+
18
+    void batchInsertRecord(@Param("list")List<CaseLogRecord> list);
16 19
 }

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

@@ -55,7 +55,7 @@ public class CaseApplicationLogServiceImpl implements CaseApplicationLogService
55 55
     private ColumnValueLogMapper columnValueLogMapper;
56 56
     // 对比两个版本修改的字段,基本字段对比
57 57
     private static final String[] columns = {"caseName","caseSubjectAmount","loanStartDate", "loanEndDate","contractNumber","claimInterestOwed","claimLiquidDamag",
58
-            "claimPrinciOwed","arbitratClaims","properPreser","requestRule"};
58
+            "claimPrinciOwed","arbitratClaims","properPreser","requestRule","facts"};
59 59
     // 人员字段对比
60 60
     private static final String[] affiliateColumns = {"name", "identityNum","contactTelphone","contactAddress","workTelphone","workAddress","email",
61 61
             "nameAgent", "identityNumAgent","contactTelphoneAgent","contactAddressAgent","residenAffili","compLegalPerson",

+ 32
- 21
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java Целия файл

@@ -926,6 +926,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
926 926
         }
927 927
         caseApplication.setCreateBy(getUsername());
928 928
         caseApplication.setVersion(1);
929
+        caseApplication.setId(IdWorkerUtil.getId());
929 930
         // 新增立案信息
930 931
         int rows = caseApplicationMapper.insertCaseApplication(caseApplication);
931 932
         if (rows == 0) {
@@ -1010,10 +1011,11 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
1010 1011
             // 新增案件日志表
1011 1012
             caseApplication.setCaseAppliId(caseApplication.getId());
1012 1013
             caseApplication.setUpdateSubmitStatus(UpdateSubmitStatus.UNCOMMITTED.getCode());
1014
+            caseApplication.setCaseLogId(IdWorkerUtil.getId());
1013 1015
             int insertRow = caseApplicationLogMapper.insert(caseApplication);
1014 1016
             // 插入案件相关人员表日志
1015 1017
             if (insertRow != 0 && CollectionUtil.isNotEmpty(caseAffiliates)) {
1016
-                caseAffiliates.forEach(caseAffiliate -> caseAffiliate.setCaseAppliLogId(caseApplication.getId()));
1018
+                caseAffiliates.forEach(caseAffiliate -> caseAffiliate.setCaseAppliLogId(caseApplication.getCaseLogId()));
1017 1019
 
1018 1020
                 caseAffiliateLogMapper.batchCaseAffiliate(caseAffiliates);
1019 1021
             }
@@ -1025,7 +1027,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
1025 1027
                     for (CaseAttach caseAttach : filterList) {
1026 1028
                         // 查询附件表
1027 1029
                         CaseAttach attach = caseAttachMapper.queryAnnexById(caseAttach.getAnnexId());
1028
-                        attach.setCaseAppliLogId(caseApplication.getId());
1030
+                        attach.setCaseAppliLogId(caseApplication.getCaseLogId());
1029 1031
                         caseAttachLogMapper.save(attach);
1030 1032
                     }
1031 1033
                 }
@@ -1033,7 +1035,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
1033 1035
             }
1034 1036
             // 插入columnValueLog自定义字段日志表
1035 1037
             if (CollectionUtil.isNotEmpty(columnValueList)) {
1036
-                columnValueList.forEach(caseAffiliate -> caseAffiliate.setCaseAppliLogId(caseApplication.getId()));
1038
+                columnValueList.forEach(caseAffiliate -> caseAffiliate.setCaseAppliLogId(caseApplication.getCaseLogId()));
1037 1039
                 columnValueLogMapper.batchSave(columnValueList);
1038 1040
 
1039 1041
             }
@@ -1168,10 +1170,11 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
1168 1170
         ThreadPoolUtil.execute(() -> {
1169 1171
             try {
1170 1172
                 caseApplication.setCaseAppliId(caseApplication.getId());
1173
+                caseApplication.setCaseLogId(IdWorkerUtil.getId());
1171 1174
                 int insertRow = caseApplicationLogMapper.insert(caseApplication);
1172 1175
                 if (insertRow != 0) {
1173 1176
                     if (CollectionUtil.isNotEmpty(caseAffiliates)) {
1174
-                        caseAffiliates.forEach(caseAffiliate -> caseAffiliate.setCaseAppliLogId(caseApplication.getId()));
1177
+                        caseAffiliates.forEach(caseAffiliate -> caseAffiliate.setCaseAppliLogId(caseApplication.getCaseLogId()));
1175 1178
                         // 插入案件日志人员相关表
1176 1179
                         caseAffiliateLogMapper.batchCaseAffiliate(caseAffiliates);
1177 1180
                     }
@@ -1182,7 +1185,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
1182 1185
                             for (CaseAttach caseAttach : filterList) {
1183 1186
                                 // 查询附件表
1184 1187
                                 CaseAttach attach = caseAttachMapper.queryAnnexById(caseAttach.getAnnexId());
1185
-                                attach.setCaseAppliLogId(caseApplication.getId());
1188
+                                attach.setCaseAppliLogId(caseApplication.getCaseLogId());
1186 1189
                                 caseAttachLogMapper.save(attach);
1187 1190
                             }
1188 1191
                         }
@@ -1190,7 +1193,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
1190 1193
                     }
1191 1194
                     // 插入案件columnValueLog自定义字段表
1192 1195
                     if (CollectionUtil.isNotEmpty(caseApplication.getColumnValues())) {
1193
-                        caseApplication.getColumnValues().forEach(columnValue -> columnValue.setCaseAppliLogId(caseApplication.getId()));
1196
+                        caseApplication.getColumnValues().forEach(columnValue -> columnValue.setCaseAppliLogId(caseApplication.getCaseLogId()));
1194 1197
 
1195 1198
                         columnValueLogMapper.batchSave(caseApplication.getColumnValues());
1196 1199
                     }
@@ -1534,6 +1537,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
1534 1537
                         caseApplicationItera.setCaseStatus(CaseApplicationConstants.CASE_APPLICATION);
1535 1538
                         caseApplicationItera.setCreateBy(getUsername());
1536 1539
                         caseApplicationItera.setImportFlag(1);
1540
+                        caseApplicationItera.setId(IdWorkerUtil.getId());
1537 1541
                         int rows = caseApplicationMapper.insertCaseApplication(caseApplicationItera);
1538 1542
                         if (rows == 0) {
1539 1543
                             continue;
@@ -1553,7 +1557,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
1553 1557
                         caseApplicationItera.setCaseAppliId(caseApplicationItera.getId());
1554 1558
                         caseApplicationItera.setUpdateSubmitStatus(UpdateSubmitStatus.UNCOMMITTED.getCode());
1555 1559
                         caseApplicationItera.setVersion(1);
1556
-
1560
+                        caseApplicationItera.setCaseLogId(IdWorkerUtil.getId());
1557 1561
                         int insertRow = caseApplicationLogMapper.insert(caseApplicationItera);
1558 1562
                         if (insertRow > 0) {
1559 1563
                             caseAffiliates.forEach(caseAffiliate -> caseAffiliate.setCaseAppliLogId(caseApplicationItera.getId()));
@@ -1845,9 +1849,13 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
1845 1849
 
1846 1850
             rows = caseApplicationMapper.submitCaseApplication(caseApplication);
1847 1851
         } else if (agreeOrNotCheck.intValue() == 2) {//拒绝审核
1848
-            caseApplication.setCaseStatus(CaseApplicationConstants.VERPRIF_ARBITRATION);
1852
+            caseApplication.setCaseStatus(CaseApplicationConstants.HEAD_CHECK_ARBITRATION);
1853
+            String notes="";
1854
+            if(caseApplication.getArbitrateRecord()!=null&&StrUtil.isNotEmpty(caseApplication.getArbitrateRecord().getDeptorReject())){
1855
+                notes="部门长驳回仲裁文书,驳回原因:"+caseApplication.getArbitrateRecord().getDeptorReject();
1856
+            }
1849 1857
             // 新增日志
1850
-            insertCaseLog(caseApplication.getId(), CaseApplicationConstants.VERPRIF_ARBITRATION, "");
1858
+            insertCaseLog(caseApplication.getId(), CaseApplicationConstants.HEAD_CHECK_ARBITRATION, notes);
1851 1859
 
1852 1860
             rows = caseApplicationMapper.submitCaseApplication(caseApplication);
1853 1861
         }
@@ -1875,14 +1883,20 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
1875 1883
         Integer agreeOrNotCheck = caseApplication.getAgreeOrNotCheck();
1876 1884
         if (agreeOrNotCheck.intValue() == 1) {
1877 1885
             caseApplication.setCaseStatus(CaseApplicationConstants.CHECK_ARBITRATION);
1886
+
1887
+            rows = caseApplicationMapper.submitCaseApplication(caseApplication);
1878 1888
             // 新增日志
1879 1889
             insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CHECK_ARBITRATION, "");
1880
-            rows = caseApplicationMapper.submitCaseApplication(caseApplication);
1881 1890
         } else if (agreeOrNotCheck.intValue() == 2) {//拒绝审核
1882 1891
             caseApplication.setCaseStatus(CaseApplicationConstants.VERPRIF_ARBITRATION);
1883
-            // 新增日志
1884
-            insertCaseLog(caseApplication.getId(), CaseApplicationConstants.VERPRIF_ARBITRATION, "");
1892
+
1885 1893
             rows = caseApplicationMapper.submitCaseApplication(caseApplication);
1894
+            String notes="";
1895
+            if(caseApplication.getArbitrateRecord()!=null&&StrUtil.isNotEmpty(caseApplication.getArbitrateRecord().getArbitrateReject())){
1896
+                notes="仲裁员驳回仲裁文书,驳回原因:"+caseApplication.getArbitrateRecord().getArbitrateReject();
1897
+            }
1898
+            // 新增日志
1899
+            insertCaseLog(caseApplication.getId(), CaseApplicationConstants.VERPRIF_ARBITRATION, notes);
1886 1900
         }
1887 1901
         return success();
1888 1902
     }
@@ -1895,6 +1909,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
1895 1909
         //提交立案审查
1896 1910
         int rows = 0;
1897 1911
         for (Long id : ids) {
1912
+            String notes="";
1898 1913
             CaseApplication caseApplication = new CaseApplication();
1899 1914
             caseApplication.setId(id);
1900 1915
             caseApplication.setAgreeOrNotCheck(agreeOrNotCheck);
@@ -1902,6 +1917,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
1902 1917
                 caseApplication.setCaseStatus(CaseApplicationConstants.PENDING_PAYMENT);
1903 1918
                 rows += caseApplicationMapper.submitCaseApplication(caseApplication);
1904 1919
             } else if (agreeOrNotCheck == 2) {//拒绝审核
1920
+                notes="驳回立案申请,驳回原因:"+caseCheckReject;
1905 1921
                 caseApplication.setCaseStatus(CaseApplicationConstants.CASE_APPLICATION);
1906 1922
                 rows += caseApplicationMapper.submitCaseApplication(caseApplication);
1907 1923
                 ArbitrateRecord arbitrateRecordsel = new ArbitrateRecord();
@@ -1912,13 +1928,15 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
1912 1928
                     arbitrateRecordMapper.updataArbitrateRecord(arbitrateRecordnew);
1913 1929
                 }else {
1914 1930
                     arbitrateRecordsel.setCaseCheckReject(caseCheckReject);
1931
+
1932
+
1915 1933
                     arbitrateRecordMapper.insertArbitrateRecord(arbitrateRecordsel);
1916 1934
                 }
1917 1935
 
1918 1936
 
1919 1937
             }
1920 1938
             // 新增日志
1921
-            insertCaseLog(caseApplication.getId(), CaseApplicationConstants.PENDING_PAYMENT, "");
1939
+            insertCaseLog(caseApplication.getId(), CaseApplicationConstants.PENDING_PAYMENT, notes);
1922 1940
         }
1923 1941
 
1924 1942
 
@@ -2853,15 +2871,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
2853 2871
     @Transactional
2854 2872
     @Override
2855 2873
     public AjaxResult uploadCaseZipFile(MultipartFile file, Long templateId) {
2856
-        CaseApplication caseApplication=null;
2857 2874
         AjaxResult ajaxResult = caseZipImportImpl.zipImport( file, templateId);
2858
-        if(ajaxResult.isSuccess()&&caseApplication!=null) {
2859
-            // 新增案件基本信息表
2860
-            this.insertcaseApplication(caseApplication);
2861
-            return success("导入成功");
2862
-        }else {
2863
-            return ajaxResult;
2864
-        }
2875
+       return ajaxResult;
2865 2876
     }
2866 2877
 
2867 2878
 

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

@@ -34,6 +34,9 @@ public class CaseLogRecordServiceImpl  implements ICaseLogRecordService {
34 34
                 if(StrUtil.isNotEmpty(record.getContent())){
35 35
                     contentBuilder.append(record.getContent());
36 36
                 }
37
+                if(StrUtil.isNotEmpty(record.getNotes())){
38
+                    contentBuilder.append(",").append(record.getNotes());
39
+                }
37 40
                 record.setContent(contentBuilder.toString());
38 41
 
39 42
             });

+ 132
- 62
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseZipImportImpl.java Целия файл

@@ -9,6 +9,7 @@ import com.ruoyi.common.constant.Constants;
9 9
 import com.ruoyi.common.core.domain.entity.SysDept;
10 10
 import com.ruoyi.common.core.domain.entity.SysRole;
11 11
 import com.ruoyi.common.core.domain.entity.SysUser;
12
+import com.ruoyi.common.core.domain.model.LoginUser;
12 13
 import com.ruoyi.common.enums.UpdateSubmitStatus;
13 14
 import com.ruoyi.common.utils.*;
14 15
 import com.ruoyi.common.config.RuoYiConfig;
@@ -18,14 +19,13 @@ import com.ruoyi.common.exception.ServiceException;
18 19
 import com.ruoyi.common.utils.file.FileUtils;
19 20
 import com.ruoyi.common.utils.thread.MultipleThreadListParam;
20 21
 import com.ruoyi.common.utils.thread.MultipleThreadWorkUtil;
22
+import com.ruoyi.common.utils.thread.ThreadPoolUtil;
21 23
 import com.ruoyi.system.domain.SysUserRole;
22 24
 import com.ruoyi.system.mapper.*;
23
-import com.ruoyi.wisdomarbitrate.domain.CaseAffiliate;
24
-import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
25
-import com.ruoyi.wisdomarbitrate.domain.CaseAttach;
26
-import com.ruoyi.wisdomarbitrate.domain.FatchRule;
25
+import com.ruoyi.wisdomarbitrate.domain.*;
27 26
 import com.ruoyi.wisdomarbitrate.domain.vo.ColumnValue;
28 27
 import com.ruoyi.wisdomarbitrate.mapper.*;
28
+import com.ruoyi.wisdomarbitrate.utils.CaseLogUtils;
29 29
 import com.ruoyi.wisdomarbitrate.utils.OCRUtils;
30 30
 import com.ruoyi.wisdomarbitrate.utils.UnZipFileUtils;
31 31
 import org.apache.pdfbox.pdmodel.PDDocument;
@@ -149,6 +149,10 @@ public class CaseZipImportImpl {
149 149
         if (fatchMap.size() <= 0) {
150 150
             return error("从压缩包中未抓取到内容,请检查抓取字段配置");
151 151
         }
152
+        // 尊敬的{1},您的代理的案件已接入仲裁系统,复制访问https://miniapp-3gpama6l759911ef-1321289474.tcloudbaseapp.com/jump-mp.html 进入小程序进行认证注册。如非本人操作,请忽略本短信
153
+        SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest();
154
+        request.setTemplateId("1956159");
155
+
152 156
         // 新增的案件
153 157
         List<CaseApplication> caseApplications = new ArrayList<>();
154 158
         //  从抓取规则表取字段和字典表取基本字段,字典表的字段名塞到基本表,is_default=1自定义字段塞到columnValue
@@ -181,6 +185,10 @@ public class CaseZipImportImpl {
181 185
         List<SysDept> sysDepts = new ArrayList<>();
182 186
         // 案件附件
183 187
         List<CaseAttach> caseAttachs = new ArrayList<>();
188
+        //发送短信列表
189
+        List<SmsSendRecord> smsSendRecordList = new ArrayList<>();
190
+        // 短信记录
191
+        List<SmsUtils.SendSmsRequest> smsRequestList = new ArrayList<>();
184 192
         /**
185 193
          * 用户表已存在的用户
186 194
          */
@@ -192,7 +200,7 @@ public class CaseZipImportImpl {
192 200
         //查询出当天的案件编号的最大值
193 201
         String currentDay = DateUtils.dateTime();
194 202
         String caseNum = "zc" + currentDay;
195
-         maxCaseNum = caseApplicationMapper.selectCaseNumLike(caseNum, caseNum.length());
203
+        maxCaseNum = caseApplicationMapper.selectCaseNumLike(caseNum, caseNum.length());
196 204
         // 需要新增的用户
197 205
         List<SysUser> addUsers = new ArrayList<>();
198 206
         for (Long caseId : fileMap.keySet()) {
@@ -218,15 +226,15 @@ public class CaseZipImportImpl {
218 226
             if (StrUtil.isEmpty(caseApplication.getBatchNumber())) {
219 227
                 maxBatchNumber = caseApplicationMapper.selectBatchNumberLike();
220 228
                 if (maxBatchNumber == null) {
221
-                    maxBatchNumber=1;
229
+                    maxBatchNumber = 1;
222 230
                     caseApplication.setBatchNumber(maxBatchNumber.toString());
223 231
                 } else {
224
-                    maxBatchNumber=maxBatchNumber+1;
225
-                    caseApplication.setBatchNumber( maxBatchNumber.toString());
232
+                    maxBatchNumber = maxBatchNumber + 1;
233
+                    caseApplication.setBatchNumber(maxBatchNumber.toString());
226 234
                 }
227 235
             }
228 236
             // 设置编号
229
-            String maxCaseNumStr=generateCaseNum();
237
+            String maxCaseNumStr = generateCaseNum();
230 238
             caseApplication.setCaseNum(maxCaseNumStr);
231 239
             caseApplication.setCreateBy(getUsername());
232 240
             caseApplication.setVersion(1);
@@ -248,7 +256,7 @@ public class CaseZipImportImpl {
248 256
             }
249 257
             caseApplication.setColumnValues(columnValueList);
250 258
             // 组装内置字段
251
-            buildDefaultColumn(caseApplication, dictDataList, fatchMap, caseAffiliates, deptMap, sysDepts, userMap, addUsers, userRoleList);
259
+            buildDefaultColumn(caseApplication, dictDataList, fatchMap, caseAffiliates, deptMap, sysDepts, userMap, addUsers, userRoleList, smsSendRecordList, smsRequestList);
252 260
             for (File caseFile : fileMap.get(caseId)) {
253 261
                 String fileUrl = caseFile.getAbsolutePath();
254 262
                 if (StrUtil.isEmpty(fileUrl)) {
@@ -277,55 +285,95 @@ public class CaseZipImportImpl {
277 285
             }
278 286
             // 案件压缩包导入
279 287
             caseApplication.setImportFlag(2);
288
+            // 组装短信
280 289
 
281 290
         }
282 291
         // 多线程执行
283
-        List<MultipleThreadListParam> execList=new ArrayList<>();
292
+        List<MultipleThreadListParam> execList = new ArrayList<>();
284 293
         if (CollectionUtil.isNotEmpty(addUsers)) {
285
-            Function<List<SysUser>,Integer> function=userMapper::batchSave;
286
-            execList.add(new MultipleThreadListParam(function,addUsers));
294
+            Function<List<SysUser>, Integer> function = userMapper::batchSave;
295
+            execList.add(new MultipleThreadListParam(function, addUsers));
287 296
         }
288 297
         if (CollectionUtil.isNotEmpty(userRoleList)) {
289
-            Function<List<SysUserRole>,Integer> function=userRoleMapper::batchUserRole;
290
-            execList.add(new MultipleThreadListParam(function,userRoleList));
298
+            Function<List<SysUserRole>, Integer> function = userRoleMapper::batchUserRole;
299
+            execList.add(new MultipleThreadListParam(function, userRoleList));
291 300
 
292 301
         }
293 302
         if (CollectionUtil.isNotEmpty(sysDepts)) {
294
-            Function<List<SysDept>,Integer> function=sysDeptMapper::batchSave;
295
-            execList.add(new MultipleThreadListParam(function,sysDepts));
303
+            Function<List<SysDept>, Integer> function = sysDeptMapper::batchSave;
304
+            execList.add(new MultipleThreadListParam(function, sysDepts));
296 305
 
297 306
         }
298 307
         if (CollectionUtil.isNotEmpty(caseApplications)) {
299
-            Function<List<CaseApplication>,Integer> function=caseApplicationMapper::batchSave;
300
-            execList.add(new MultipleThreadListParam(function,caseApplications));
301
-            Function<List<CaseApplication>,Integer> functionLog=caseApplicationLogMapper::batchSave;
302
-            execList.add(new MultipleThreadListParam(functionLog,caseApplications));
308
+            Function<List<CaseApplication>, Integer> function = caseApplicationMapper::batchSave;
309
+            execList.add(new MultipleThreadListParam(function, caseApplications));
310
+            Function<List<CaseApplication>, Integer> functionLog = caseApplicationLogMapper::batchSave;
311
+            execList.add(new MultipleThreadListParam(functionLog, caseApplications));
303 312
 
304 313
         }
305 314
         if (CollectionUtil.isNotEmpty(caseAffiliates)) {
306
-            Function<List<CaseAffiliate>,Integer> function=caseAffiliateMapper::batchCaseAffiliate;
307
-            execList.add(new MultipleThreadListParam(function,caseAffiliates));
308
-            Function<List<CaseAffiliate>,Integer> functionLog=caseAffiliateLogMapper::batchCaseAffiliate;
309
-            execList.add(new MultipleThreadListParam(functionLog,caseAffiliates));
315
+            Function<List<CaseAffiliate>, Integer> function = caseAffiliateMapper::batchCaseAffiliate;
316
+            execList.add(new MultipleThreadListParam(function, caseAffiliates));
317
+            Function<List<CaseAffiliate>, Integer> functionLog = caseAffiliateLogMapper::batchCaseAffiliate;
318
+            execList.add(new MultipleThreadListParam(functionLog, caseAffiliates));
310 319
         }
311 320
         if (CollectionUtil.isNotEmpty(caseAttachs)) {
312
-            Function<List<CaseAttach>,Integer> function=caseAttachMapper::batchSave;
313
-            execList.add(new MultipleThreadListParam(function,caseAttachs));
314
-            Function<List<CaseAttach>,Integer> functionLog=caseAttachLogMapper::batchSave;
315
-            execList.add(new MultipleThreadListParam(functionLog,caseAttachs));
321
+            Function<List<CaseAttach>, Integer> function = caseAttachMapper::batchSave;
322
+            execList.add(new MultipleThreadListParam(function, caseAttachs));
323
+            Function<List<CaseAttach>, Integer> functionLog = caseAttachLogMapper::batchSave;
324
+            execList.add(new MultipleThreadListParam(functionLog, caseAttachs));
316 325
         }
317 326
         if (CollectionUtil.isNotEmpty(columnValueList)) {
318
-            Function<List<ColumnValue>,Integer> function=columnValueMapper::batchSave;
319
-            execList.add(new MultipleThreadListParam(function,columnValueList));
320
-            Function<List<ColumnValue>,Integer> functionLog=columnValueLogMapper::batchSave;
321
-            execList.add(new MultipleThreadListParam(functionLog,columnValueList));
327
+            Function<List<ColumnValue>, Integer> function = columnValueMapper::batchSave;
328
+            execList.add(new MultipleThreadListParam(function, columnValueList));
329
+            Function<List<ColumnValue>, Integer> functionLog = columnValueLogMapper::batchSave;
330
+            execList.add(new MultipleThreadListParam(functionLog, columnValueList));
322 331
         }
323
-        if(CollectionUtil.isNotEmpty(execList)){
332
+        if (CollectionUtil.isNotEmpty(execList)) {
324 333
             MultipleThreadWorkUtil.execListFun(execList.toArray(new MultipleThreadListParam[execList.size()]));
325 334
         }
335
+        if (CollectionUtil.isNotEmpty(caseApplications)) {
336
+            LoginUser loginUser = SecurityUtils.getLoginUser();
337
+            List<CaseLogRecord> logRecords = new ArrayList<>();
338
+
339
+            caseApplications.forEach(caseApplication -> {
340
+                        CaseLogRecord operLog = new CaseLogRecord();
341
+                        // 获取当前的用户
342
+
343
+                        if (loginUser != null) {
344
+                            SysUser user = loginUser.getUser();
345
+                            operLog.setCreateBy(user.getUserName());
346
+                            operLog.setCreateNickName(user.getNickName());
347
+                            operLog.setUpdateBy(user.getUserName());
348
+                        } else {
349
+                            operLog.setCreateBy("admin");
350
+                            operLog.setCreateNickName("管理员");
351
+                            operLog.setUpdateBy("admin");
352
+                        }
353
+                        operLog.setCaseAppliId(caseApplication.getId());
354
+                        operLog.setCaseNode(CaseApplicationConstants.CASE_APPLICATION);
355
+                        logRecords.add(operLog);
356
+                    }
357
+            );
358
+            // todo 发送短信
359
+//            ThreadPoolUtil.execute(() -> {
360
+//                        CaseLogUtils.batchInsertCaseLog(logRecords);
361
+//                        // 发送短信
362
+//                        if (CollectionUtil.isNotEmpty(smsRequestList)) {
363
+//                            for (SmsUtils.SendSmsRequest sendSmsRequest : smsRequestList) {
364
+//                                Boolean aBoolean = SmsUtils.sendSms(request);
365
+//                            }
366
+//                        }
367
+//
368
+//                    }
369
+//
370
+//            );
371
+        }
372
+        // 案件日志
326 373
         return success("导入成功");
327 374
 
328 375
     }
376
+
329 377
     /**
330 378
      * 获取自动编码
331 379
      *
@@ -339,15 +387,16 @@ public class CaseZipImportImpl {
339 387
 
340 388
 
341 389
         if (null == maxCaseNum) {
342
-            maxCaseNum=1;
390
+            maxCaseNum = 1;
343 391
             caseNum = caseNum + "001";
344 392
         } else {
345
-            maxCaseNum=maxCaseNum+1;
393
+            maxCaseNum = maxCaseNum + 1;
346 394
             caseNum = caseNum + String.format("%03d", maxCaseNum);
347 395
         }
348 396
         return caseNum;
349 397
 
350 398
     }
399
+
351 400
     public void inputChangeToFile(InputStream instream, File file) {
352 401
         try {
353 402
             OutputStream outStr = new FileOutputStream(file);
@@ -527,7 +576,8 @@ public class CaseZipImportImpl {
527 576
      */
528 577
     private void buildDefaultColumn(CaseApplication caseApplication, List<SysDictData> dictDataList, Map<String, String> fatchMap,
529 578
                                     List<CaseAffiliate> caseAffiliates, Map<String, Long> deptMap, List<SysDept> sysDepts,
530
-                                    Map<String, SysUser> userMap, List<SysUser> addUsers, List<SysUserRole> userRoleList) {
579
+                                    Map<String, SysUser> userMap, List<SysUser> addUsers, List<SysUserRole> userRoleList,
580
+                                    List<SmsSendRecord> smsSendRecords, List<SmsUtils.SendSmsRequest> smsRequestList) {
531 581
         // 组装内置字段
532 582
         if (CollectionUtil.isEmpty(dictDataList)) {
533 583
             return;
@@ -544,14 +594,14 @@ public class CaseZipImportImpl {
544 594
             if (StrUtil.isNotEmpty(dictData.getDictLabel())) {
545 595
                 if (dictData.getDictLabel().contains("被申请人")) {
546 596
                     // 组装被申请人内置自段
547
-                    buildDebtorColumn(dictData, fatchMap, debtorAffiliate,caseApplication.getId());
597
+                    buildDebtorColumn(dictData, fatchMap, debtorAffiliate, caseApplication.getId());
548 598
                 } else if (dictData.getDictLabel().contains("申请人") || dictData.getDictLabel().contains("统一社会信用代码")
549 599
                         || dictData.getDictLabel().contains("法定代表人") || dictData.getDictLabel().contains("委托代理人")) {
550 600
                     // 组装申请人内置自段
551
-                    buildAffilcateColumn(dictData, fatchMap, affiliate, deptMap, sysDepts, userMap, addUsers, userRoleList,caseApplication.getId());
601
+                    buildAffilcateColumn(dictData, fatchMap, affiliate, deptMap, sysDepts, userMap, addUsers, userRoleList, caseApplication.getId(), smsSendRecords, smsRequestList);
552 602
                 } else if (dictData.getDictLabel().contains("合同编号")) {
553 603
                     // 合同编号
554
-                    String contractNumber = fatchMap.get("合同编号"+ Constants.PDFSTR + caseApplication.getId());
604
+                    String contractNumber = fatchMap.get("合同编号" + Constants.PDFSTR + caseApplication.getId());
555 605
                     if (StrUtil.isNotEmpty(contractNumber)) {
556 606
                         // 提取字母和数字
557 607
                         String regx = "[^a-zA-Z0-9]";
@@ -559,11 +609,11 @@ public class CaseZipImportImpl {
559 609
                         caseApplication.setContractNumber(replaceAll.toUpperCase());
560 610
                     }
561 611
                 } else {
562
-                    ObjectFieldUtils.setValue(caseApplication, dictData.getDictValue(), fatchMap.get(dictData.getDictLabel()+ Constants.PDFSTR + caseApplication.getId()));
612
+                    ObjectFieldUtils.setValue(caseApplication, dictData.getDictValue(), fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseApplication.getId()));
563 613
                 }
564 614
 
565 615
             } else {
566
-                ObjectFieldUtils.setValue(caseApplication, dictData.getDictValue(), fatchMap.get(dictData.getDictLabel()+ Constants.PDFSTR + caseApplication.getId()));
616
+                ObjectFieldUtils.setValue(caseApplication, dictData.getDictValue(), fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseApplication.getId()));
567 617
 
568 618
             }
569 619
 
@@ -587,14 +637,15 @@ public class CaseZipImportImpl {
587 637
      */
588 638
     private void buildAffilcateColumn(SysDictData dictData, Map<String, String> fatchMap, CaseAffiliate affiliate,
589 639
                                       Map<String, Long> deptMap, List<SysDept> sysDepts,
590
-                                      Map<String, SysUser> userMap, List<SysUser> addUsers, List<SysUserRole> userRoleList,Long caseId) {
640
+                                      Map<String, SysUser> userMap, List<SysUser> addUsers, List<SysUserRole> userRoleList, Long caseId,
641
+                                      List<SmsSendRecord> smsSendRecords, List<SmsUtils.SendSmsRequest> smsRequestList) {
591 642
 
592 643
         affiliate.setIdentityType(1);
593 644
 
594 645
         // 申请人
595 646
         switch (dictData.getDictLabel()) {
596 647
             case "申请人姓名":
597
-                affiliate.setName((fatchMap.get(dictData.getDictLabel()+ Constants.PDFSTR + caseId)));
648
+                affiliate.setName((fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId)));
598 649
                 if (StrUtil.isNotEmpty(affiliate.getName())) {
599 650
                     // 组装申请机构
600 651
                     // 将组织机构id设为申请人名称
@@ -622,29 +673,30 @@ public class CaseZipImportImpl {
622 673
                 }
623 674
                 break;
624 675
             case "统一社会信用代码":
625
-                affiliate.setIdentityNum((fatchMap.get(dictData.getDictLabel()+ Constants.PDFSTR + caseId)));
676
+                affiliate.setIdentityNum((fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId)));
626 677
                 break;
627 678
             case "法定代表人":
628
-                affiliate.setCompLegalPerson(fatchMap.get(dictData.getDictLabel()+ Constants.PDFSTR + caseId));
679
+                affiliate.setCompLegalPerson(fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId));
629 680
                 break;
630 681
             case "法定代表人职位":
631
-                affiliate.setCompLegalperPost((fatchMap.get(dictData.getDictLabel()+ Constants.PDFSTR + caseId)));
682
+                affiliate.setCompLegalperPost((fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId)));
632 683
                 break;
633 684
             case "申请人住所":
634
-                affiliate.setResidenAffili((fatchMap.get(dictData.getDictLabel()+ Constants.PDFSTR + caseId)));
685
+                affiliate.setResidenAffili((fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId)));
635 686
                 break;
636 687
             case "申请人联系地址":
637
-                affiliate.setContactAddress(fatchMap.get(dictData.getDictLabel()+ Constants.PDFSTR + caseId));
688
+                affiliate.setContactAddress(fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId));
638 689
                 break;
639 690
             case "委托代理人姓名":
640
-                affiliate.setNameAgent(fatchMap.get(dictData.getDictLabel()+ Constants.PDFSTR + caseId));
691
+                affiliate.setNameAgent(fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId));
641 692
                 break;
642 693
             case "委托代理人联系电话":
643
-                affiliate.setContactTelphoneAgent(fatchMap.get(dictData.getDictLabel()+ Constants.PDFSTR + caseId));
694
+                affiliate.setContactTelphoneAgent(fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId));
644 695
                 if (StrUtil.isNotEmpty(affiliate.getContactTelphoneAgent())) {
696
+                    SysUser agentUser = null;
645 697
                     // 用户已存在
646 698
                     if (userMap.containsKey(affiliate.getContactTelphoneAgent())) {
647
-                        SysUser agentUser = userMap.get(affiliate.getContactTelphoneAgent());
699
+                        agentUser = userMap.get(affiliate.getContactTelphoneAgent());
648 700
                         if (null != agentUser.getDeptId() && String.valueOf(agentUser.getDeptId()).equals(affiliate.getApplicationOrganId())) {
649 701
                             // 同步用户表和案件关联人表的手机号和名称
650 702
                             affiliate.setContactTelphoneAgent(agentUser.getPhonenumber());
@@ -670,7 +722,7 @@ public class CaseZipImportImpl {
670 722
                         }
671 723
                     } else {
672 724
                         // 用户不存在,新增
673
-                        SysUser agentUser = new SysUser();
725
+                        agentUser = new SysUser();
674 726
                         agentUser.setUserId(Long.valueOf(IdWorkerUtil.getId()));
675 727
                         agentUser.setIdCard(affiliate.getIdentityNumAgent());
676 728
                         agentUser.setNickName(affiliate.getNameAgent());
@@ -683,10 +735,29 @@ public class CaseZipImportImpl {
683 735
                         insertAgentUserRole(agentUser, roleId, userRoleList);
684 736
 
685 737
                     }
738
+                    if (addUsers != null) {
739
+                        SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest();
740
+                        request.setTemplateId("1956159");
741
+                        request.setPhone(agentUser.getPhonenumber());
742
+                        request.setTemplateParamSet(new String[]{agentUser.getNickName()});
743
+                        SmsSendRecord smsSendRecord = new SmsSendRecord();
744
+                        smsSendRecord.setCaseId(caseId);
745
+                        CaseApplication caseApplication = new CaseApplication();
746
+                        caseApplication.setId(caseId);
747
+                        smsSendRecord.setCaseNum(caseApplication.getCaseNum());
748
+                        smsSendRecord.setPhone(request.getPhone());
749
+                        smsSendRecord.setSendTime(new Date());
750
+                        String content = "尊敬的" + agentUser.getNickName() + ",您的代理的案件已接入仲裁系统,复制访问https://miniapp-3gpama6l759911ef-1321289474.tcloudbaseapp.com/jump-mp.html 进入小程序进行认证注册。如非本人操作,请忽略本短信";
751
+                        smsSendRecord.setSendContent(content);
752
+                        smsSendRecord.setCreateBy(getUsername());
753
+                        smsSendRecords.add(smsSendRecord);
754
+                        smsRequestList.add(request);
755
+                    }
756
+
686 757
                 }
687 758
                 break;
688 759
             case "委托代理人电子邮件":
689
-                affiliate.setAgentEmail(StrUtil.isNotEmpty(fatchMap.get(dictData.getDictLabel()+ Constants.PDFSTR + caseId)) ? fatchMap.get(dictData.getDictLabel()+ Constants.PDFSTR + caseId).replace("\n", "").replaceAll("\\s", "") : null);
760
+                affiliate.setAgentEmail(StrUtil.isNotEmpty(fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId)) ? fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId).replace("\n", "").replaceAll("\\s", "") : null);
690 761
 
691 762
                 break;
692 763
             default:
@@ -716,17 +787,17 @@ public class CaseZipImportImpl {
716 787
      * @param fatchMap        抓取内容
717 788
      * @param debtorAffiliate 被申请人
718 789
      */
719
-    private void buildDebtorColumn(SysDictData dictData, Map<String, String> fatchMap, CaseAffiliate debtorAffiliate,Long caseId) {
790
+    private void buildDebtorColumn(SysDictData dictData, Map<String, String> fatchMap, CaseAffiliate debtorAffiliate, Long caseId) {
720 791
 
721 792
         debtorAffiliate.setIdentityType(2);
722 793
         // 被申请人
723 794
         switch (dictData.getDictLabel()) {
724 795
             case "被申请人姓名":
725
-                debtorAffiliate.setName(fatchMap.get(dictData.getDictLabel()+ Constants.PDFSTR + caseId));
796
+                debtorAffiliate.setName(fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId));
726 797
                 break;
727 798
             case "被申请人身份证号":
728
-                String identityNum = fatchMap.get(dictData.getDictLabel()+ Constants.PDFSTR + caseId);
729
-                debtorAffiliate.setIdentityNum(fatchMap.get(dictData.getDictLabel()+ Constants.PDFSTR + caseId));
799
+                String identityNum = fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId);
800
+                debtorAffiliate.setIdentityNum(fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId));
730 801
                 // 出生年月日,从身份证抓取
731 802
                 if (StrUtil.isNotEmpty(identityNum)) {
732 803
                     identityNum = identityNum.replace("\n", "");
@@ -748,13 +819,13 @@ public class CaseZipImportImpl {
748 819
 
749 820
                 break;
750 821
             case "被申请人住所":
751
-                debtorAffiliate.setResidenAffili(fatchMap.get(dictData.getDictLabel()+ Constants.PDFSTR + caseId));
822
+                debtorAffiliate.setResidenAffili(fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId));
752 823
                 break;
753 824
             case "被申请人联系电话":
754
-                debtorAffiliate.setContactTelphone(fatchMap.get(dictData.getDictLabel()+ Constants.PDFSTR + caseId));
825
+                debtorAffiliate.setContactTelphone(fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId));
755 826
                 break;
756 827
             case "被申请人电子邮件":
757
-                debtorAffiliate.setEmail(StrUtil.isNotEmpty(fatchMap.get(dictData.getDictLabel()+ Constants.PDFSTR + caseId)) ? fatchMap.get(dictData.getDictLabel()+ Constants.PDFSTR + caseId).replace("\n", "").replaceAll("\\s", "") : null);
828
+                debtorAffiliate.setEmail(StrUtil.isNotEmpty(fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId)) ? fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId).replace("\n", "").replaceAll("\\s", "") : null);
758 829
 
759 830
                 break;
760 831
             default:
@@ -807,5 +878,4 @@ public class CaseZipImportImpl {
807 878
     }
808 879
 
809 880
 
810
-
811 881
 }

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

@@ -10,6 +10,7 @@ import com.ruoyi.wisdomarbitrate.mapper.CaseLogRecordMapper;
10 10
 
11 11
 import javax.validation.constraints.NotEmpty;
12 12
 import javax.validation.constraints.NotNull;
13
+import java.util.List;
13 14
 
14 15
 /**
15 16
  * 案件记录日志文件
@@ -46,6 +47,14 @@ public class CaseLogUtils
46 47
         operLog.setNotes(notes);
47 48
         caseLogRecordMapper.insertCaseLogRecord(operLog);
48 49
     }
50
+    /**
51
+     * 批量新增案件日志
52
+     * @param list
53
+     */
54
+    public static void batchInsertCaseLog(List<CaseLogRecord> list ){
55
+
56
+        caseLogRecordMapper.batchInsertRecord(list);
57
+    }
49 58
 
50 59
 
51 60
 }

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

@@ -60,6 +60,7 @@
60 60
     </resultMap>
61 61
     <insert id="insert" parameterType="com.ruoyi.wisdomarbitrate.domain.CaseApplication" useGeneratedKeys="true" keyProperty="id">
62 62
         insert into case_application_log(
63
+        <if test="caseLogId != null  ">id ,</if>
63 64
         <if test="caseAppliId != null  ">case_appli_id ,</if>
64 65
         <if test="caseName != null  and caseName != ''">case_name ,</if>
65 66
         <if test="caseNum != null and caseNum != ''">case_num,</if>
@@ -89,6 +90,7 @@
89 90
         mediation_agreement,
90 91
         create_time
91 92
         )values(
93
+        <if test="caseLogId != null  ">#{id} ,</if>
92 94
         <if test="caseAppliId != null">#{caseAppliId},</if>
93 95
         <if test="caseName != null and caseName != ''">#{caseName},</if>
94 96
         <if test="caseNum != null and caseNum != ''">#{caseNum},</if>

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

@@ -901,6 +901,7 @@
901 901
     </select>
902 902
     <insert id="insertCaseApplication" parameterType="CaseApplication" useGeneratedKeys="true" keyProperty="id">
903 903
         insert into case_application(
904
+        <if test="id != null''">id ,</if>
904 905
         <if test="caseName != null  and caseName != ''">case_name ,</if>
905 906
         <if test="caseNum != null and caseNum != ''">case_num,</if>
906 907
         <if test="caseSubjectAmount != null">case_subject_amount,</if>
@@ -934,6 +935,7 @@
934 935
         batch_number,
935 936
         create_time
936 937
         )values(
938
+        <if test="id != null''">#{id} ,</if>
937 939
         <if test="caseName != null and caseName != ''">#{caseName},</if>
938 940
         <if test="caseNum != null and caseNum != ''">#{caseNum},</if>
939 941
         <if test="caseSubjectAmount != null">#{caseSubjectAmount},</if>

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

@@ -20,17 +20,26 @@
20 20
             #{caseAppliId},#{caseNode},sysdate(),#{notes},#{createBy},#{createNickName},sysdate(),#{updateBy},sysdate()
21 21
         )
22 22
     </insert>
23
+    <insert id="batchInsertRecord">
24
+        insert into case_log_record(case_appli_id, case_node,case_node_time,notes,create_by,create_nick_name,create_time,update_by,update_time ) values
25
+        <foreach item="item" index="index" collection="list" separator=",">
26
+        (
27
+            #{item.caseAppliId},#{item.caseNode},sysdate(),#{item.notes},#{item.createBy},#{item.createNickName},sysdate(),#{item.updateBy},sysdate()
28
+        )
29
+        </foreach>
30
+    </insert>
23 31
     <select id="selectCaseLogRecordList" resultType="com.ruoyi.wisdomarbitrate.domain.CaseLogRecord">
24 32
             select cl.case_node caseNode ,cl.case_node_time caseNodeTime ,cl.notes  ,cl.id ,cl.case_appli_id caseAppliId,
25 33
             cl.create_by createBy,cl.create_nick_name createNickName,cl.create_time createTime,cl.update_by updateBy,cl.update_time updateTime,
26 34
         CASE cl.case_node when 0 then '立案申请' when 1 then '提交立案申请' when 2 then '立案审查'
27 35
         when 3 then '支付成功' when 4 then '缴费确认' when 5 then '案件质证'
28 36
         when 6 then '组庭审核' when 7 then '组庭确认' when 8 then '当前仲裁方式为开庭审理'
29
-        when 9 then '当前仲裁方式为书面审理' when 10 then '书面审理' when 11 then '生成裁決书'
30
-        when 12 then '核验裁决书' when 13 then '同意裁决书' when 14 then '签名成功'
37
+        when 9 then '当前仲裁方式为书面审理' when 10 then '书面审理' when 11 then '秘书审核裁决书'
38
+        when 12 then '部门长核验裁决书' when 13 then '同意裁决书' when 14 then '签名成功'
31 39
         when 15 then '用印成功' when 16 then '送达仲裁文书' when 17 then '案件归档'
32 40
         when 26 then '证据确认成功'
33 41
         when 31 then '修改开庭时间'
42
+        when 18 then '仲裁员审核仲裁文书'
34 43
         ELSE '无案件状态'
35 44
         END content,
36 45
         CASE cl.case_node when 0 then '申请人' when 1 then '申请人' when 2 then '法律顾问'