85 Commits
Author SHA1 Message Date
qitz 21b93a7cfe Merge branch 'dev' of http://git.xayunmei.com/SH-Arbitrate/Arbitrate-Backend into qtz3
# Conflicts:
#	ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java
2023-12-13 10:14:26 +08:00
qitz 34e9faafe2 优化仲裁员驳回功能 2023-12-13 10:04:09 +08:00
wangqiong123andGitea d69b959534 Merge branch 'wq' of SH-Arbitrate/Arbitrate-Backend into dev 2023-12-12 19:09:28 +08:00
18792927508 60c1db6e2a 案件流程,日志修改 2023-12-12 19:08:23 +08:00
qtzandGitea d4db9785b3 Merge branch 'qtz3' of SH-Arbitrate/Arbitrate-Backend into dev 2023-12-12 18:26:54 +08:00
qitz 7ace643452 Merge branch 'dev' of http://git.xayunmei.com/SH-Arbitrate/Arbitrate-Backend into qtz3 2023-12-12 18:21:22 +08:00
qitz c4276aac48 优化仲裁员确认功能 2023-12-12 18:20:55 +08:00
qtzandGitea 02386824af Merge branch 'qtz3' of SH-Arbitrate/Arbitrate-Backend into dev 2023-12-12 17:16:15 +08:00
qitz 209de376e3 优化立案审查驳回接口 2023-12-12 17:12:31 +08:00
wangqiong123andGitea 4c4dfcd9d5 Merge branch 'wq' of SH-Arbitrate/Arbitrate-Backend into dev 2023-12-12 16:23:53 +08:00
18792927508 a78e3e23d6 工具类,案件压缩包导入优化 2023-12-12 16:22:41 +08:00
qtzandGitea 5730bb12a7 Merge branch 'qtz3' of SH-Arbitrate/Arbitrate-Backend into dev 2023-12-12 15:04:10 +08:00
qitz 2e1ceaa393 Merge branch 'dev' of http://git.xayunmei.com/SH-Arbitrate/Arbitrate-Backend into qtz3 2023-12-12 15:00:57 +08:00
qitz b1f0fb8f6f 优化案件提交退还原因 2023-12-12 14:59:01 +08:00
qtzandGitea 2e1c5eae8a Merge branch 'qtz3' of SH-Arbitrate/Arbitrate-Backend into dev 2023-12-12 11:56:05 +08:00
qitz 23d53688e4 Merge branch 'dev' of http://git.xayunmei.com/SH-Arbitrate/Arbitrate-Backend into qtz3 2023-12-12 11:50:11 +08:00
qitz 5558debc20 实现庭审笔录上传 2023-12-12 11:49:48 +08:00
qtzandGitea 1c9e92b60e Merge branch 'qtz3' of SH-Arbitrate/Arbitrate-Backend into dev 2023-12-11 18:06:03 +08:00
qitz 4be7832789 Merge branch 'dev' of http://git.xayunmei.com/SH-Arbitrate/Arbitrate-Backend into qtz3 2023-12-11 18:01:15 +08:00
qitz 0c968937af 实现下载案件压缩包 2023-12-11 18:00:37 +08:00
qtzandGitea c8aa73fc21 Merge branch 'qtz3' of SH-Arbitrate/Arbitrate-Backend into dev 2023-12-11 10:22:28 +08:00
qitz b2d42ccfba 优化更新自定义字段 2023-12-11 10:18:20 +08:00
wangqiong123andGitea a832a8281a Merge branch 'wq' of SH-Arbitrate/Arbitrate-Backend into dev 2023-12-11 09:24:51 +08:00
18792927508 27fa06ab04 案件功能优化 2023-12-11 09:23:47 +08:00
wangqiong123andGitea 397950e033 Merge branch 'wq' of SH-Arbitrate/Arbitrate-Backend into dev 2023-12-09 20:49:16 +08:00
18792927508 aa36758066 裁决书修改 2023-12-09 20:48:16 +08:00
qtzandGitea 69b5b0d072 Merge branch 'qtz3' of SH-Arbitrate/Arbitrate-Backend into dev 2023-12-09 15:38:14 +08:00
qitz 6f80764866 Merge branch 'dev' of http://git.xayunmei.com/SH-Arbitrate/Arbitrate-Backend into qtz3 2023-12-09 15:35:22 +08:00
qitz a10be7303f 优化案件更新 2023-12-09 15:35:04 +08:00
qtzandGitea 65dbeb9bdc Merge branch 'qtz3' of SH-Arbitrate/Arbitrate-Backend into dev 2023-12-09 15:18:14 +08:00
wangqiong123andGitea 4286d35243 Merge branch 'wq' of SH-Arbitrate/Arbitrate-Backend into dev 2023-12-09 15:18:05 +08:00
18792927508 4ea958e91d 短信签名修改 2023-12-09 15:17:00 +08:00
qitz 23f4c31338 优化更新功能 2023-12-09 15:14:38 +08:00
qitz 67b3566eb8 Merge branch 'dev' of http://git.xayunmei.com/SH-Arbitrate/Arbitrate-Backend into qtz3 2023-12-09 14:50:36 +08:00
qitz 965a5912c0 优化批量 2023-12-09 14:49:59 +08:00
wangqiong123andGitea f62248e93e Merge branch 'wq' of SH-Arbitrate/Arbitrate-Backend into dev 2023-12-09 14:21:05 +08:00
18792927508 2b6deb09b9 压缩包上传修改 2023-12-09 14:19:53 +08:00
qtzandGitea 9604bc938a Merge branch 'qtz3' of SH-Arbitrate/Arbitrate-Backend into dev 2023-12-09 12:03:40 +08:00
qitz 9d3b296a27 Merge branch 'dev' of http://git.xayunmei.com/SH-Arbitrate/Arbitrate-Backend into qtz3 2023-12-09 12:01:00 +08:00
qitz 9a1f6a107e 修改案件信息自定义字段 2023-12-09 12:00:44 +08:00
qtzandGitea db0cea67be Merge branch 'qtz3' of SH-Arbitrate/Arbitrate-Backend into dev 2023-12-09 10:54:19 +08:00
qitz 992817300c 优化案件修改功能 2023-12-09 10:50:33 +08:00
wangqiong123andGitea 9fdd40ee4e Merge branch 'wq' of SH-Arbitrate/Arbitrate-Backend into dev 2023-12-09 09:26:15 +08:00
18792927508 5d4929f36b 压缩包上传,裁决书生成,案件修改,修改后对比信息 2023-12-09 09:25:12 +08:00
18792927508 a7826fbc16 Merge branch 'dev' of http://git.xayunmei.com/SH-Arbitrate/Arbitrate-Backend into wq 2023-12-08 22:37:33 +08:00
qtzandGitea dc498364ae Merge branch 'qtz3' of SH-Arbitrate/Arbitrate-Backend into dev 2023-12-08 18:07:35 +08:00
qitz 0755325701 Merge branch 'dev' of http://git.xayunmei.com/SH-Arbitrate/Arbitrate-Backend into qtz3 2023-12-08 18:03:04 +08:00
qitz 3eeb1a0882 1 2023-12-08 18:02:54 +08:00
qitz f989831de2 修改抓取规则保存功能 2023-12-08 17:59:09 +08:00
18792927508 078c214202 生成裁决书修改 2023-12-08 13:50:01 +08:00
wangqiong123andGitea 4bc2940f9e Merge branch 'wq' of SH-Arbitrate/Arbitrate-Backend into dev 2023-12-08 11:04:16 +08:00
18792927508 923d1e0483 抓取规则修改 2023-12-08 11:02:49 +08:00
wangqiong123andGitea a87fdca103 Merge branch 'wq' of SH-Arbitrate/Arbitrate-Backend into dev 2023-12-07 17:41:59 +08:00
18792927508 0ec450d85c word转pdf 2023-12-07 17:41:00 +08:00
qtzandGitea c7988344d3 Merge branch 'qtz3' of SH-Arbitrate/Arbitrate-Backend into dev 2023-12-07 16:49:40 +08:00
qitz 3cc3be3ee0 优化导入压缩包功能 2023-12-07 16:46:05 +08:00
wangqiong123andGitea 3a831e31ad Merge branch 'wq' of SH-Arbitrate/Arbitrate-Backend into dev 2023-12-07 15:08:44 +08:00
18792927508 a525fd6a16 案件压缩包导入 2023-12-07 15:07:51 +08:00
qtzandGitea 6d720c5757 Merge branch 'qtz3' of SH-Arbitrate/Arbitrate-Backend into dev 2023-12-07 11:40:58 +08:00
qitz 023037e2ca 保存庭审记录 2023-12-07 11:37:16 +08:00
wangqiong123andGitea b3355ff79f Merge branch 'wq' of SH-Arbitrate/Arbitrate-Backend into dev 2023-12-07 09:46:15 +08:00
18792927508 feb30e9fe5 1 2023-12-07 09:45:23 +08:00
wangqiong123andGitea f9c3609b8b Merge branch 'wq' of SH-Arbitrate/Arbitrate-Backend into dev 2023-12-07 09:36:32 +08:00
18792927508 79bf8423e0 案件压缩包导入修改 2023-12-07 09:29:33 +08:00
qtzandGitea 45bea53a70 Merge branch 'qtz3' of SH-Arbitrate/Arbitrate-Backend into dev 2023-12-06 17:35:04 +08:00
qitz a24b78473f 保存抓取规则功能 2023-12-06 17:30:37 +08:00
qitz f9dbd8a010 Merge branch 'dev' of http://git.xayunmei.com/SH-Arbitrate/Arbitrate-Backend into qtz3 2023-12-06 10:45:03 +08:00
wangqiong123andGitea 31b4f482dd Merge branch 'wq' of SH-Arbitrate/Arbitrate-Backend into dev 2023-12-06 10:44:48 +08:00
18792927508 08758c78ab 抓取规则mapper 2023-12-06 10:43:41 +08:00
qitz 4a23dfbc2a Merge branch 'dev' of http://git.xayunmei.com/SH-Arbitrate/Arbitrate-Backend into qtz3 2023-12-06 10:35:00 +08:00
qitz 086cfca5dc 1 2023-12-06 10:34:40 +08:00
qtzandGitea 120b30c4ea Merge branch 'qtz3' of SH-Arbitrate/Arbitrate-Backend into dev 2023-12-05 17:49:01 +08:00
qitz df93d06ae2 实现仲裁员审核裁决书功能 2023-12-05 17:45:54 +08:00
wangqiong123andGitea a683b38e8d Merge branch 'wq' of SH-Arbitrate/Arbitrate-Backend into dev 2023-12-05 15:25:00 +08:00
18792927508 33d44eed4d 仲裁员审核裁决书 2023-12-05 15:19:36 +08:00
qtzandGitea 8615b98be2 Merge branch 'qtz3' of SH-Arbitrate/Arbitrate-Backend into dev 2023-12-05 11:40:19 +08:00
wangqiong123andGitea 57b5325154 Merge branch 'wq' of SH-Arbitrate/Arbitrate-Backend into dev 2023-12-05 11:37:31 +08:00
qitz 1ccbc8c895 Merge branch 'dev' of http://git.xayunmei.com/SH-Arbitrate/Arbitrate-Backend into qtz3 2023-12-05 11:37:07 +08:00
18792927508 0be2808800 生成裁决书路径修改 2023-12-05 11:36:33 +08:00
qitz 93b3c29ac3 优化查看流程功能 2023-12-05 11:35:53 +08:00
wangqiong123andGitea ffb0a9f6da Merge branch 'wq' of SH-Arbitrate/Arbitrate-Backend into dev 2023-12-05 11:06:42 +08:00
18792927508 93d9e11688 案件流程修改 2023-12-05 11:05:47 +08:00
wangqiong123andGitea 20e6986ec9 Merge branch 'wq' of SH-Arbitrate/Arbitrate-Backend into dev 2023-12-04 17:11:04 +08:00
18792927508 ba6237853e 生成裁决书修改 2023-12-04 17:08:39 +08:00
hejinboandGitea cc5c4ab49a Merge branch 'hjb' of SH-Arbitrate/Arbitrate-Backend into dev 2023-12-04 13:41:20 +08:00
69 changed files with 4396 additions and 2395 deletions
@@ -32,6 +32,9 @@ public class AdjudicationController extends BaseController {
*/
@PostMapping("/document")
public AjaxResult createDocument(@Validated @RequestBody CaseApplication caseApplication){
if (caseApplication.getId() == null) {
return AjaxResult.error("案件id不能为空");
}
return adjudicationService.createDocument(caseApplication);
}
@@ -93,6 +93,16 @@ public class CaseApplicationController extends BaseController {
return caseApplicationService.editCaseApplication(caseApplication);
}
/**
* 修改立案数据自定义字段
*/
// @PreAuthorize("@ss.hasPermi('caseManagement:list:update')")
@Log(title = "修改立案数据自定义字段", businessType = BusinessType.UPDATE)
@PostMapping("/editCaseApplicationDefineval")
public AjaxResult editCaseApplicationDefineval(@Validated @RequestBody CaseApplication caseApplication) {
return caseApplicationService.editCaseApplicationDefineval(caseApplication);
}
/**
* 提交立案申请
*/
@@ -273,15 +283,25 @@ public class CaseApplicationController extends BaseController {
}
/**
* 审核裁决书
* 部门长审核裁决书
*/
// @PreAuthorize("@ss.hasPermi('caseApplication:checkArbitrateRecord')")
@Log(title = "审核裁决书", businessType = BusinessType.UPDATE)
@Log(title = "部门长审核裁决书", businessType = BusinessType.UPDATE)
@PostMapping("/checkArbitrateRecord")
public AjaxResult checkArbitrateRecord(@Validated @RequestBody CaseApplication caseApplication) {
return caseApplicationService.checkArbitrateRecord(caseApplication);
}
/**
* 仲裁员审核裁决书
*/
// @PreAuthorize("@ss.hasPermi('caseApplication:checkArbitrateRecord')")
@Log(title = "仲裁员审核裁决书", businessType = BusinessType.UPDATE)
@PostMapping("/arbitrator/checkArbitrateRecord")
public AjaxResult arbitratorCheckArbitrateRecord(@Validated @RequestBody CaseApplication caseApplication) {
return caseApplicationService.arbitratorCheckArbitrateRecord(caseApplication);
}
/**
@@ -304,7 +324,7 @@ public class CaseApplicationController extends BaseController {
if(CollectionUtil.isEmpty(batchCaseApplication.getIds())|| batchCaseApplication.getAgreeOrNotCheck()==null){
return error("参数校验失败");
}
return success(caseApplicationService.submitCaseApplicationCheck(batchCaseApplication.getIds(),batchCaseApplication.getAgreeOrNotCheck()));
return success(caseApplicationService.submitCaseApplicationCheck(batchCaseApplication.getIds(),batchCaseApplication.getAgreeOrNotCheck(),batchCaseApplication.getCaseCheckReject()));
}
/**
@@ -317,6 +337,16 @@ public class CaseApplicationController extends BaseController {
return success(caseApplicationselect);
}
/**
* 下载案件压缩包
*/
@PostMapping("/downloadCaseZipFile")
public AjaxResult downloadCaseZipFile(@Validated @RequestBody CaseApplication caseApplication) {
CaseAttach caseAttach = caseApplicationService.downloadCaseZipFile(caseApplication);
return success(caseAttach);
}
/**
* 发送房间号短信
@@ -347,6 +377,18 @@ public class CaseApplicationController extends BaseController {
public AjaxResult creatTrialRecord(@Validated @RequestBody ArbitrateRecord arbitrateRecord){
return caseApplicationService.creatTrialRecord(arbitrateRecord);
}
/**
* 记录庭审笔录
* @param arbitrateRecord
* @return
*/
@PostMapping("/creatTrialRecordnew")
// @PreAuthorize("@ss.hasPermi('caseManagement:list:creatTrialRecord')")
public AjaxResult creatTrialRecordnew(@Validated @RequestBody ArbitrateRecord arbitrateRecord){
return caseApplicationService.creatTrialRecordnew(arbitrateRecord);
}
/**
* 案件锁定或者解锁
* @param caseApplication
@@ -435,8 +477,8 @@ public class CaseApplicationController extends BaseController {
* @throws IOException
*/
@PostMapping("/uploadCaseZipFile")
public AjaxResult uploadCaseZipFile(@RequestParam("file") MultipartFile file) throws IOException {
return caseApplicationService.uploadCaseZipFile(file);
public AjaxResult uploadCaseZipFile(@RequestParam("file") MultipartFile file,@RequestParam("templateId") Long templateId) throws IOException {
return caseApplicationService.uploadCaseZipFile(file,templateId);
}
/**
@@ -58,6 +58,22 @@ public class CaseEvidenceController extends BaseController {
Long userId = this.getUserId();
return caseEvidenceService.uploadEvidence(file, annexType, id, username, userId);
}
/**
* 上传庭审笔录
*
* @param file 附件
* @param annexType 附件类型,庭审笔录(7)
* @param id 案件申请id
* @return
*/
@PostMapping("/uploadRecord")
public AjaxResult uploadRecord(@RequestParam("file") MultipartFile file, Integer annexType, Long id) {
String username = this.getUsername();
Long userId = this.getUserId();
return caseEvidenceService.uploadRecord(file, annexType, id, username, userId);
}
@PostMapping("/batchUpload")
public AjaxResult batchUpload(@RequestParam("file") MultipartFile[] file, Integer annexType, Long id) {
if(file==null){
@@ -1,4 +1,5 @@
package com.ruoyi.web.controller.wisdomarbitrate;
import cn.hutool.core.util.StrUtil;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
@@ -177,4 +178,61 @@ public class DeptIdentifyController extends BaseController {
public AjaxResult bindHandler(DeptIdentify deptIdentify){
return deptIdentifyService.bindHandler(deptIdentify);
}
/**
* 根据模板id查询抓取规则
* @param templateManage
* @return
*/
@PostMapping("/getFatchRuleByTemplateid")
public AjaxResult getFatchRuleByTemplateid(@RequestBody TemplateManage templateManage){
List<FatchRule> fatchRuleList = deptIdentifyService.getFatchRuleByTemplateid(templateManage);
return AjaxResult.success(fatchRuleList);
}
/**
* 保存抓取规则
* @param templateManage
* @return
*/
@PostMapping("/saveFatchRules")
public AjaxResult saveFatchRules(@RequestBody TemplateManage templateManage){
return deptIdentifyService.saveFatchRules(templateManage);
}
/**
* 查询column和注释
* @return
*/
@PostMapping("/selectColumnandComment")
public AjaxResult selectColumnandComment(){
List<FatchRule> fatchRuleList = deptIdentifyService.selectColumnandComment();
return AjaxResult.success(fatchRuleList);
}
/**
* 查询column
* @return
*/
@PostMapping("/selectColumnbycomment")
public AjaxResult selectColumnbycomment(@RequestBody FatchRule fatchRule){
FatchRule fatchRulesel = deptIdentifyService.selectColumnbycomment(fatchRule);
return AjaxResult.success(fatchRulesel);
}
/**
* 根据模板id查询模板字段列表
* @param templateManage
* @return
*/
@GetMapping("/getTemplateInfoById")
public AjaxResult getTemplateInfoById(@RequestBody TemplateManage templateManage){
if(templateManage.getId()==null){
return error("参数校验错误");
}
List<FatchRule> fatchRuleList = deptIdentifyService.getTemplateInfoById(templateManage);
return AjaxResult.success(fatchRuleList);
}
}
+13 -1
View File
@@ -182,4 +182,16 @@ imConfig:
# 腾讯云账户 SecretId
secretId: AKID3xfHgroY4MQHvLXUXMwIQL1UjmbBX1Tv
# 腾讯云密钥
secretKey: INDrIXcT8YmomZBcsy0oNirnU0LTN4X7
secretKey: INDrIXcT8YmomZBcsy0oNirnU0LTN4X7
#jodconverter:
# local:
# host: 121.40.189.20
#暂时关闭预览,启动时会有点慢
# enabled: true
#设置libreoffice主目录 linux地址如:/usr/lib64/libreoffice
# office-home: /usr/lib64/libreoffice/
# office-home: D:\app\libreOffice\
#开启多个libreoffice进程,每个端口对应一个进程
# port-numbers: 8100
#libreoffice进程重启前的最大进程数
# max-tasks-per-process: 100
+64
View File
@@ -11,12 +11,76 @@
<artifactId>ruoyi-common</artifactId>
<description>
common通用工具
</description>
<dependencies>
<!--docx文件下载问题-->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>4.1.2</version>
</dependency>
<!-- POI依赖,读取.doc型文档-->
<!-- https://mvnrepository.com/artifact/org.apache.poi/poi-scratchpad -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-scratchpad</artifactId>
<version>4.1.1</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.6</version>
</dependency>
<dependency>
<groupId>org.jodconverter</groupId>
<artifactId>jodconverter-core</artifactId>
<version>4.2.0</version>
</dependency>
<dependency>
<groupId>org.jodconverter</groupId>
<artifactId>jodconverter-local</artifactId>
<version>4.2.0</version>
</dependency>
<dependency>
<groupId>org.jodconverter</groupId>
<artifactId>jodconverter-spring-boot-starter</artifactId>
<version>4.2.0</version>
</dependency>
<dependency>
<groupId>com.artofsolving</groupId>
<artifactId>jodconverter</artifactId>
<version>2.2.1</version>
</dependency>
<dependency>
<groupId>org.openoffice</groupId>
<artifactId>jurt</artifactId>
<version>3.0.1</version>
</dependency>
<dependency>
<groupId>org.openoffice</groupId>
<artifactId>ridl</artifactId>
<version>3.0.1</version>
</dependency>
<dependency>
<groupId>org.openoffice</groupId>
<artifactId>juh</artifactId>
<version>3.0.1</version>
</dependency>
<dependency>
<groupId>org.openoffice</groupId>
<artifactId>unoil</artifactId>
<version>3.0.1</version>
</dependency>
<!-- Spring框架基本的核心工具 -->
<dependency>
<groupId>org.springframework</groupId>
@@ -30,9 +30,9 @@ public class CaseApplicationConstants {
public static final int PENDING_WRIITEN_HEAR = 9;
/** 待生成仲裁文书 */
public static final int GENERATED_ARBITRATION = 10;
/**待核验仲裁文书*/
/**待秘书核验仲裁文书*/
public static final int VERPRIF_ARBITRATION = 11;
/**待审核仲裁文书*/
/**待部门长审核仲裁文书*/
public static final int CHECK_ARBITRATION = 12;
/**待仲裁文书签名*/
public static final int SIGN_ARBITRATION = 13;
@@ -47,6 +47,8 @@ public class CaseApplicationConstants {
/** 待修改开庭时间*/
public static final int MODIFY_HEARDATE = 31;
/**待仲裁员审核仲裁文书*/
public static final int HEAD_CHECK_ARBITRATION = 18;
@@ -28,6 +28,14 @@ public class Constants
* http请求
*/
public static final String HTTP = "http://";
/**
* br标签
*/
public static final String BR = "</br>";
/**
* pdf拼接符
*/
public static final String PDFSTR = "∰";
/**
* https请求
@@ -0,0 +1,57 @@
package com.ruoyi.common.utils;
import java.util.Calendar;
import java.util.HashMap;
import java.util.Map;
/**
* @author wangqiong
* @description 根据身份证号提取有效信息
* @date 2023-12-11 11:45
*/
public class IdCardUtils {
/**
* 通过身份证号码获取出生日期、性别、年龄
* @param certificateNo
* @return 返回的出生日期格式:1990-01-01 性别格式:1-女,0-男
*/
public static Map<String, String> getBirAgeSex(String certificateNo) {
String birthday = "";
String age = "";
String sexCode = "";
int year = Calendar.getInstance().get(Calendar.YEAR);
char[] number = certificateNo.toCharArray();
boolean flag = true;
if (number.length == 15) {
for (int x = 0; x < number.length; x++) {
if (!flag) return new HashMap<String, String>();
flag = Character.isDigit(number[x]);
}
} else if (number.length == 18) {
for (int x = 0; x < number.length - 1; x++) {
if (!flag) return new HashMap<String, String>();
flag = Character.isDigit(number[x]);
}
}
if (flag && certificateNo.length() == 15) {
birthday = "19" + certificateNo.substring(6, 8) + "-"
+ certificateNo.substring(8, 10) + "-"
+ certificateNo.substring(10, 12);
sexCode = Integer.parseInt(certificateNo.substring(certificateNo.length() - 3, certificateNo.length())) % 2 == 0 ? "1" : "0";
age = (year - Integer.parseInt("19" + certificateNo.substring(6, 8))) + "";
} else if (flag && certificateNo.length() == 18) {
birthday = certificateNo.substring(6, 10) + "-"
+ certificateNo.substring(10, 12) + "-"
+ certificateNo.substring(12, 14);
sexCode = Integer.parseInt(certificateNo.substring(certificateNo.length() - 4, certificateNo.length() - 1)) % 2 == 0 ? "1" : "0";
age = (year - Integer.parseInt(certificateNo.substring(6, 10))) + "";
}
Map<String, String> map = new HashMap<String, String>();
map.put("birthday", birthday);
map.put("age", age);
map.put("sexCode", sexCode);
return map;
}
}
@@ -0,0 +1,48 @@
package com.ruoyi.common.utils;
import cn.hutool.core.lang.Snowflake;
import cn.hutool.core.util.IdUtil;
import com.ruoyi.common.utils.uuid.UUID;
import java.math.BigInteger;
import java.util.Random;
/**
* 雪花算法工具类
* zq
* @since 2020/10/30 9:59
**/
public class IdWorkerUtil {
private static final long EPOCH = 1479533469598L; //开始时间,固定一个小于当前时间的毫秒数
private static final int max12bit = 4095;
private static final long max41bit= 1099511627775L;
private static String machineId = "" ; // 机器ID
/**
*
* 创建ID
*
* @return
*
*/
public static Long getId(){
long time = System.currentTimeMillis() - EPOCH + max41bit;
// 二进制的 毫秒级时间戳
String base = Long.toBinaryString(time);
// 序列数
String randomStr = StringUtils.leftPad(Integer.toBinaryString(new Random().nextInt(max12bit)),12,'0');
if(StringUtils.isNotEmpty(machineId)){
machineId = StringUtils.leftPad(machineId, 10, '0');
}
//拼接
String appendStr = base + machineId + randomStr;
// 转化为十进制 返回
BigInteger bi = new BigInteger(appendStr, 2);
return Long.valueOf(bi.toString());
}
}
@@ -0,0 +1,53 @@
package com.ruoyi.common.utils;
import java.math.BigDecimal;
import java.text.NumberFormat;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* @author wangqiong
* @description 金额格式化
* @date 2023-12-11 11:45
*/
public class MoneyFormatUtils {
/**
* 增加千分位
* @param money
* @return
*/
public static String moneyFormat(String money) {
// 金额格式化
try {
Double.parseDouble(money);
} catch (NumberFormatException e) {
String regEx = "[^0-9]";
Pattern p = Pattern.compile(regEx);
Matcher m = p.matcher(money);
String result = m.replaceAll("").trim();
BigDecimal bigDecimal = null;
if (money.contains("百")) {
bigDecimal = new BigDecimal(result).multiply(new BigDecimal("100"));
} else if (money.contains("千")) {
bigDecimal = new BigDecimal(result).multiply(new BigDecimal("1000"));
} else if (money.contains("万")) {
bigDecimal = new BigDecimal(result).multiply(new BigDecimal("10000"));
} else if (money.contains("百万")) {
bigDecimal = new BigDecimal(result).multiply(new BigDecimal("1000000"));
} else if (money.contains("千万")) {
bigDecimal = new BigDecimal(result).multiply(new BigDecimal("10000000"));
} else if (money.contains("亿")) {
bigDecimal = new BigDecimal(result).multiply(new BigDecimal("100000000"));
}
NumberFormat format = NumberFormat.getInstance();
return format.format(bigDecimal);
}
return "";
}
}
@@ -1,5 +1,7 @@
package com.ruoyi.common.utils;
import cn.hutool.core.util.StrUtil;
import java.lang.reflect.Field;
/**
@@ -7,6 +9,9 @@ import java.lang.reflect.Field;
*/
public class ObjectFieldUtils {
public static String getValue(Object obj,String fieldName){
if(obj==null || StrUtil.isEmpty(fieldName)){
return "";
}
Field field=null;
try{
field=obj.getClass().getDeclaredField(fieldName);
@@ -28,6 +33,9 @@ public class ObjectFieldUtils {
}
public static void setValue(Object obj,String fieldName,Object value){
if(obj==null || StrUtil.isEmpty(fieldName)||value==null){
return;
}
Field field=null;
try{
field=obj.getClass().getDeclaredField(fieldName);
@@ -0,0 +1,86 @@
package com.ruoyi.common.utils;
import org.apache.poi.hwpf.extractor.WordExtractor;
import org.apache.poi.xwpf.extractor.XWPFWordExtractor;
import org.apache.poi.xwpf.usermodel.XWPFDocument;
import java.io.*;
/**
* @author wangqiong
* @description 读取文件内容
* @date 2023-12-11 11:45
*/
public class ReadFileUtils {
public static String readerTxtFile(String filePath){
BufferedReader br=null;
StringBuilder result=new StringBuilder();
try {
br = new BufferedReader(new InputStreamReader(new FileInputStream(new File(filePath)),"GBK"));
String line=null;
while ((line=br.readLine())!=null) {
result.append(line).append("\n");
}
} catch (IOException e) {
e.printStackTrace();
} finally {
if (null!=br){
try {
br.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
return result.toString();
}
public static String readWord(String filePath) throws Exception{
File file = new File(filePath);
if(file.length()==0) return ""; // 需要操作原因是可能会空文件问题,如果不做处理,在下面读取中会报错
StringBuffer sb = new StringBuffer();
String buffer = "";
try {
if (filePath.endsWith(".doc")) {
InputStream is = new FileInputStream(file);
WordExtractor ex = new WordExtractor(is);
buffer = ex.getText();
if(buffer.length() > 0){
//使用回车换行符分割字符串
String [] arry = buffer.split("r\\n");
for (String string : arry) {
sb.append(string.trim());
}
}
} else if (filePath.endsWith(".docx")) {
FileInputStream fis = new FileInputStream(file);
XWPFDocument xdoc = new XWPFDocument(fis);
XWPFWordExtractor extractor = new XWPFWordExtractor(xdoc);
buffer = extractor.getText();
sb.append(buffer!=null?buffer:"");
// OPCPackage opcPackage = POIXMLDocument.openPackage(filePath);
// XWPFWordExtractor extractor = new XWPFWordExtractor(opcPackage);
// buffer = extractor.getText();
// if(buffer.length() > 0){
// //使用换行符分割字符串
// String [] arry = buffer.split("\n");
// for (String string : arry) {
// sb.append(string.trim());
// }
// }
} else {
return null;
}
return sb.toString();
} catch (Exception e) {
System.out.print("error---->"+filePath);
e.printStackTrace();
return null;
}
}
}
@@ -25,7 +25,7 @@ public class SmsUtils {
//API的SecretKey
private static final String SECRET_KEY = "QjphKo8zkHZigT8j9PVtFPJyfIvO3d6V";
//签名内容
private static final String SIGN_NAME = "西安云美电子科技有限公司";
private static final String SIGN_NAME = "乙巢智慧仲裁网";
public static Boolean sendSms(SendSmsRequest request) {
Credential cred = new Credential(SECRET_ID, SECRET_KEY );
@@ -0,0 +1,34 @@
package com.ruoyi.common.utils;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Component;
/**
* @author wangqiong
* @description 获取bean工具类
* @date 2023-12-11 11:45
*/
@Component
public class SpringUtil implements ApplicationContextAware {
private static ApplicationContext applicationContext;
@Override
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
if(SpringUtil.applicationContext==null){
SpringUtil.applicationContext=applicationContext;
}
}
public static ApplicationContext getApplicationContext(){
return applicationContext;
}
public static <T>T getBean(Class<T> clazz){
return getApplicationContext().getBean(clazz);
}
public static <T>T getBean(String name, Class<T> clazz){
return getApplicationContext().getBean(name,clazz);
}
}
@@ -288,4 +288,18 @@ public class FileUtils
String baseName = FilenameUtils.getBaseName(fileName);
return baseName;
}
/**
* 获取文件后缀名
* @param file
* @return
*/
public static String getFileExtension(File file) {
String name = file.getName();
int lastIndexOfDot = name.lastIndexOf(".");
if (lastIndexOfDot != -1 && lastIndexOfDot < name.length() - 1) {
return name.substring(lastIndexOfDot + 1);
} else {
return "";
}
}
}
@@ -185,7 +185,52 @@ public class MultipleThreadWorkUtil {
mainLatch,threadLatch,rollBack,times);
return returnList;
}
public static <R,A>List<R> execListFun(MultipleThreadListParam<R,A> ...params){
List<R> returnList=new ArrayList<>();
if(ArrayUtil.isEmpty(params)){
return returnList;
}
List<Integer> threadCountList=new ArrayList<>();
for (MultipleThreadListParam param : params) {
if(param.getList().size()<SIMPLE_TIME_COUNT){
threadCountList.add(1);
}else{
if(param.getList().size()%SIMPLE_TIME_COUNT>0){
threadCountList.add(param.getList().size()/SIMPLE_TIME_COUNT+1);
}else{
threadCountList.add(param.getList().size()/SIMPLE_TIME_COUNT);
}
}
}
int times=0;
for (Integer count : threadCountList) {
times+=count;
}
CountDownLatch mainLatch=new CountDownLatch(1);
//监控子线程
CountDownLatch threadLatch=new CountDownLatch(times);
//根据子线程执行结果判断是否需要回滚
BlockingDeque<Boolean> resultList=new LinkedBlockingDeque<>();
//必须使用对象,如果使用变量会造成线程之间不能共享变量值
RollBack rollBack=new RollBack(false);
ExecutorService executorService=Executors.newFixedThreadPool(times);
List<Future<R>> futureList=new ArrayList<>();
for (int i = 0; i < params.length; i++) {
MultipleThreadListParam param=params[i];
for (int j = 0; j <threadCountList.get(i) ; j++) {
if(j*SIMPLE_TIME_COUNT+SIMPLE_TIME_COUNT<param.getList().size()){
Future<R> future=executorService.submit(new ExecThread(mainLatch,threadLatch,rollBack,resultList,param.getList().subList(j*SIMPLE_TIME_COUNT,j*SIMPLE_TIME_COUNT+SIMPLE_TIME_COUNT),param.getFunction()));
futureList.add(future);
}else{
Future<R> future=executorService.submit(new ExecThread(mainLatch,threadLatch,rollBack,resultList,param.getList().subList(j*SIMPLE_TIME_COUNT,param.getList().size()),param.getFunction()));
futureList.add(future);
}
}
}
setResult(executorService,returnList,futureList,resultList,
mainLatch,threadLatch,rollBack,times);
return returnList;
}
public static <R>List<R> execByIds(Function<String,R> execFun,String ids){
List<R> returnList=new ArrayList<>();
if(StrUtil.isEmpty(ids)){
@@ -117,4 +117,11 @@ public interface SysDeptMapper
public int deleteDeptById(Long deptId);
List<Long> selectUserDeptListByRoleId(@Param("roleId")Long roleId);
/**
* 批量新增
* @param sysDepts
* @return
*/
int batchSave(@Param("list")List<SysDept> sysDepts);
}
@@ -165,5 +165,10 @@ public interface SysUserMapper
List<SysUser> selectRoleUserByDeptId(@Param("deptId")Long deptId,@Param("roleId") Long roleId );
/**
* 批量新增用户
* @param addUsers
* @return
*/
int batchSave(@Param("list")List<SysUser> addUsers);
}
@@ -25,6 +25,8 @@ public class ArbitrateRecord extends BaseEntity {
private String verificaOpinion;
/** 审核裁决书意见 */
private String checkOpinion;
/** 仲裁员审核裁决书意见 */
private String arbitraCheckOpinion;
/** 裁决书附件id */
private Integer annexId;
@@ -38,6 +40,35 @@ public class ArbitrateRecord extends BaseEntity {
private Integer appliIsAbsen;
/** 被申请人质证意见 */
private String responDefenOpini;
/**
* 本案争议焦点
*/
private String caseFocus;
/**
* 本案事实
*/
private String caseFacts;
/**
* 被申请人对上述材料的质证意见
*/
private String respondentOpinion;
/**
* 申请人对上述材料的质证意见
*/
private String applicantOpinion;
/**
* 立案审查驳回原因
*/
private String caseCheckReject;
/**
* 仲裁员确认裁决书驳回
*/
private String arbitrateReject;
/**
* 部门长确认裁决书驳回
*/
private String deptorReject;
@@ -20,4 +20,6 @@ public class BatchCaseApplication {
* 1同意,0拒绝
*/
private Integer opinion;
/** 驳回原因 */
private String caseCheckReject;
}
@@ -61,6 +61,19 @@ public class CaseAffiliate extends BaseEntity {
*/
private String changeColumn;
/**
* 代理人邮箱
*/
private String agentEmail;
public String getAgentEmail() {
return agentEmail;
}
public void setAgentEmail(String agentEmail) {
this.agentEmail = agentEmail;
}
public String getChangeColumn() {
return changeColumn;
}
@@ -126,9 +139,6 @@ public class CaseAffiliate extends BaseEntity {
this.responSex = responSex;
}
/** 身份证号 */
@Excel(name = "身份证号")
private String identityNum;
File diff suppressed because it is too large Load Diff
@@ -38,6 +38,19 @@ public class CaseLogRecord extends BaseEntity {
* 角色名称
*/
private String roleName;
/**
* 下一个节点角色名称
*/
private String nextRoleName;
public String getNextRoleName() {
return nextRoleName;
}
public void setNextRoleName(String nextRoleName) {
this.nextRoleName = nextRoleName;
}
/**
* 节点名称
*/
@@ -0,0 +1,41 @@
package com.ruoyi.wisdomarbitrate.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import lombok.Data;
import java.util.Date;
/**
* 抓取规则
*/
@Data
public class FatchRule extends BaseEntity {
private static final long serialVersionUID = 1L;
private Long id;
private String batchNumber;
private String fileName;
private String startContent;
private String endContent;
private String column;
private String columnName;
private Integer isDefault;
private Long templateId;
private String databaseName;
/**
* 顺序,开始字段重复时,指定抓取第几个
*/
private Integer startContentRepeatOrder;
/**
* 结束字段重复时指定的顺序,默认1,只能>0填正整数
*/
private Integer endContentRepeatOrder;
/**
* 抓取方向,默认0,0-从前往后抓取,1-从后往前抓取
*/
private Integer fatchOrder;
}
@@ -3,6 +3,8 @@ package com.ruoyi.wisdomarbitrate.domain;
import com.ruoyi.common.core.domain.BaseEntity;
import lombok.Data;
import java.util.List;
@Data
public class TemplateManage extends BaseEntity {
private static final long serialVersionUID = 1L;
@@ -49,4 +51,7 @@ public class TemplateManage extends BaseEntity {
* 机构关联id
*/
private String identifyName;
List<FatchRule> fatchRules;
}
@@ -0,0 +1,45 @@
package com.ruoyi.wisdomarbitrate.domain.vo;
import lombok.Data;
/**
* 动态配置字段表
*/
@Data
public class ColumnValue {
private static final long serialVersionUID = 1L;
/**
* id
*/
private Long id;
/**
* 字段,同一个批号,column不可重复
*/
private String column;
/**
* 字段名
*/
private String name;
/**
* 字段值
*/
private String value;
/**
* 案件id
*/
private Long caseId;
/**
* 是否为自定义字段,0-否,1-是
*/
private Integer isDefault;
/**
* 案件日志表id
*/
private Long caseAppliLogId;
}
@@ -29,6 +29,9 @@ public class CompareCaseVO {
* 变化字段,多个用,拼接
*/
private String changeColumn;
/**
* 自定义字段变化字段,多个用,拼接
*/
private String columnValueChangeColumn;
}
@@ -0,0 +1,17 @@
package com.ruoyi.wisdomarbitrate.domain.vo;
import lombok.Data;
/**
* 模板抓取规则关联表
*/
@Data
public class TemplateFatchRule {
private static final long serialVersionUID = 1L;
private Long id;
private Long templateId;
private Long fatchRuleId;
}
@@ -30,4 +30,5 @@ public class ToDoCount {
private int caseApplyStored=0; // 待案件归档
private int caseApplyArchived=0; // 已归档
private int updateOnlineHearDate=0; // 待修改开庭时间
private int arbitratorApplyAwardConfirm=0; // 待仲裁员审核仲裁文书
}
@@ -44,4 +44,6 @@ public interface CaseApplicationLogMapper {
void batchDeleteLog(@Param("ids") List<Long> ids);
CaseApplication selectBeforeCase(@Param("caseId") Long caseId, @Param("version")Integer version);
Integer batchSave(@Param("list")List<CaseApplication> caseApplications);
}
@@ -118,17 +118,17 @@ public interface CaseApplicationMapper {
*/
void updateVersionById(@Param("id")Long id, @Param("version")Integer version);
/**
* 查询秘书案件
* @param caseApplication
* @return
*/
List<CaseApplication> selectSecretaryCase(CaseApplication caseApplication);
/**
* 查询申请人案件
* @param caseApplication
* 查询最大批号
* @return
*/
List<CaseApplication> selectApplicationCase(CaseApplication caseApplication);
Integer selectBatchNumberLike();
/**
* 批量新增案件
* @param caseApplications
* @return
*/
int batchSave(@Param("list")List<CaseApplication> caseApplications);
}
@@ -27,4 +27,5 @@ public interface CaseAttachLogMapper {
CaseAttach queryAnnexById(Integer annexId);
Integer batchSave(@Param("list")List<CaseAttach> caseAttaches);
}
@@ -10,6 +10,7 @@ import java.util.List;
@Mapper
public interface CaseAttachMapper {
int save(CaseAttach caseAttach);
int batchSave(@Param("list") List<CaseAttach> caseAttach);
List<CaseAttach> queryAnnexPathByCaseId(Long id);
@@ -32,4 +33,6 @@ public interface CaseAttachMapper {
* @param annexType
*/
void deleteByCasedIdAndType(@Param("caseAppliId")Long caseAppliId,@Param("annexType") int annexType,@Param("isBatchUpload") int isBatchUpload);
void deleteCaseAttachByCasedIdAndType(@Param("caseAppliId")Long caseAppliId,@Param("annexType") int annexType);
}
@@ -3,6 +3,7 @@ package com.ruoyi.wisdomarbitrate.mapper;
import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
import com.ruoyi.wisdomarbitrate.domain.CaseLogRecord;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.List;
@@ -13,4 +14,6 @@ public interface CaseLogRecordMapper {
List<CaseLogRecord> selectCaseLogRecordList(CaseLogRecord caseLogRecord);
int insertCaseLogRecord(CaseLogRecord caseLogRecord);
void batchInsertRecord(@Param("list")List<CaseLogRecord> list);
}
@@ -0,0 +1,29 @@
package com.ruoyi.wisdomarbitrate.mapper;
import com.ruoyi.wisdomarbitrate.domain.vo.ColumnValue;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* 动态配置字段表
*/
@Repository
public interface ColumnValueLogMapper {
/**
* 批量新增
*/
int batchSave(@Param("list") List<ColumnValue> list);
void batchUpdate(@Param("list") List<ColumnValue> list);
/**
* 根据案件id查询字段及值
* @param caseAppliLogId
* @return
*/
List<ColumnValue> listBycaseAppliLogId(@Param("caseAppliLogId") Long caseAppliLogId);
List<ColumnValue> queryColumnValueList(ColumnValue columnValue);
}
@@ -0,0 +1,37 @@
package com.ruoyi.wisdomarbitrate.mapper;
import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
import com.ruoyi.wisdomarbitrate.domain.FatchRule;
import com.ruoyi.wisdomarbitrate.domain.vo.ColumnValue;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* 动态配置字段表
*/
@Repository
public interface ColumnValueMapper {
/**
* 批量新增
*/
int batchSave(@Param("list") List<ColumnValue> list);
/**
* 根据案件id查询字段及值
* @param caseId
* @return
*/
List<ColumnValue> listByCaseId(@Param("caseId") Long caseId);
List<ColumnValue> queryColumnValueList(ColumnValue columnValue);
/**
* 批量修改
*/
void batchUpdate(@Param("list") List<ColumnValue> list);
int updateColumnValue(ColumnValue columnValue);
}
@@ -0,0 +1,32 @@
package com.ruoyi.wisdomarbitrate.mapper;
import com.ruoyi.wisdomarbitrate.domain.CaseAffiliate;
import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
import com.ruoyi.wisdomarbitrate.domain.FatchRule;
import com.ruoyi.wisdomarbitrate.domain.TemplateManage;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.List;
@Repository
public interface FatchRuleMapper {
/**
* 根据批次查询
*/
List<FatchRule> listByTemplateId(@Param("templateId")Long templateId);
List<FatchRule> selectFatchRuleList(FatchRule fatchRule);
List<FatchRule> selectFatchRuleListIsDefault(FatchRule fatchRule);
void deletebatchFatchRule(@Param("fatchRuleIds") List<Long> fatchRuleIds);
int insertFatchRule(FatchRule fatchRule);
List<FatchRule> selectColumnandComment(FatchRule fatchRuleselect);
FatchRule selectColumnbycomment(FatchRule fatchRule);
}
@@ -0,0 +1,19 @@
package com.ruoyi.wisdomarbitrate.mapper;
import com.ruoyi.wisdomarbitrate.domain.vo.TemplateFatchRule;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper
public interface TemplateFatchRuleMapper {
int selectTemplateFatchRulecount(TemplateFatchRule templateFatchRule);
List<TemplateFatchRule> selectTemplateFatchRuleList(TemplateFatchRule templateFatchRule);
void deleteTemplateFatchRule(Long id);
int insertTemplateFatchRule(TemplateFatchRule templateFatchRule);
}
@@ -32,4 +32,11 @@ public interface IAdjudicationService {
* @return
*/
AjaxResult emailByCaseId(Long id);
/**
* 批量生成裁决书
* @param ids
* @return
*/
AjaxResult batchDocument(List<Long> ids);
}
@@ -3,6 +3,7 @@ package com.ruoyi.wisdomarbitrate.service;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.exception.EsignDemoException;
import com.ruoyi.wisdomarbitrate.domain.*;
import com.ruoyi.wisdomarbitrate.domain.vo.ColumnValue;
import com.ruoyi.wisdomarbitrate.domain.vo.ReservedConferenceVO;
import com.ruoyi.wisdomarbitrate.domain.vo.SendRoomNoMessageVO;
import com.ruoyi.wisdomarbitrate.domain.vo.ToDoCount;
@@ -11,6 +12,7 @@ import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;
public interface ICaseApplicationService {
List<CaseApplication> selectCaseApplicationList(CaseApplication caseApplication);
@@ -43,7 +45,7 @@ public interface ICaseApplicationService {
AjaxResult checkArbitrateRecord(CaseApplication caseApplication);
int submitCaseApplicationCheck(List<Long> ids, Integer agreeOrNotCheck);
int submitCaseApplicationCheck(List<Long> ids, Integer agreeOrNotCheck,String caseCheckReject);
CaseApplication selectCaseApplicationConfirm(CaseApplication caseApplication);
@@ -112,7 +114,7 @@ public interface ICaseApplicationService {
AjaxResult deleteRoom( String roomId);
AjaxResult uploadCaseZipFile(MultipartFile file);
AjaxResult uploadCaseZipFile(MultipartFile file,Long templateId);
/**
* 根据附件id修改案件id
@@ -120,4 +122,17 @@ public interface ICaseApplicationService {
* @return
*/
AjaxResult updateCaseIdByAnnexId(CaseAttach caseAttach);
/**
* 仲裁员审核裁决书
* @param caseApplication
* @return
*/
AjaxResult arbitratorCheckArbitrateRecord(CaseApplication caseApplication);
AjaxResult creatTrialRecordnew(ArbitrateRecord arbitrateRecord);
AjaxResult editCaseApplicationDefineval(CaseApplication caseApplication);
CaseAttach downloadCaseZipFile(CaseApplication caseApplication);
}
@@ -65,4 +65,6 @@ public interface ICaseEvidenceService {
* @return 下拉树结构列表
*/
List<CaseEvidenceDirectoryVO> buildCaseEvidenceTreeSelect(List<CaseEvidenceDirectory> caseEvidenceDirectorys);
AjaxResult uploadRecord(MultipartFile file, Integer annexType, Long id, String username, Long userId);
}
@@ -4,6 +4,7 @@ import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.exception.EsignDemoException;
import com.ruoyi.wisdomarbitrate.domain.DeptIdentify;
import com.ruoyi.wisdomarbitrate.domain.FatchRule;
import com.ruoyi.wisdomarbitrate.domain.SealManage;
import com.ruoyi.wisdomarbitrate.domain.TemplateManage;
import com.ruoyi.wisdomarbitrate.domain.vo.SealListVO;
@@ -51,4 +52,18 @@ public interface IDeptIdentifyService {
AjaxResult bindHandler(DeptIdentify deptIdentify);
List<FatchRule> getFatchRuleByTemplateid(TemplateManage templateManage);
AjaxResult saveFatchRules(TemplateManage templateManage);
List<FatchRule> selectColumnandComment();
FatchRule selectColumnbycomment(FatchRule fatchRule);
/**
* 根据模板id查询模板字段列表
* @param templateManage
* @return
*/
List<FatchRule> getTemplateInfoById(TemplateManage templateManage);
}
@@ -1,19 +1,23 @@
package com.ruoyi.wisdomarbitrate.service.impl;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.deepoove.poi.data.PictureRenderData;
import com.ruoyi.common.constant.CaseApplicationConstants;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysDictData;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SmsUtils;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.*;
import com.ruoyi.common.utils.thread.MultipleThreadListParam;
import com.ruoyi.common.utils.thread.MultipleThreadWorkUtil;
import com.ruoyi.system.mapper.SysDictDataMapper;
import com.ruoyi.wisdomarbitrate.domain.vo.BookSendVO;
import com.ruoyi.wisdomarbitrate.domain.vo.ColumnValue;
import com.ruoyi.wisdomarbitrate.mapper.*;
import com.ruoyi.wisdomarbitrate.utils.CaseLogUtils;
import com.ruoyi.common.utils.EmailOutUtil;
import com.ruoyi.common.utils.WordUtil;
import com.ruoyi.wisdomarbitrate.domain.*;
import com.ruoyi.wisdomarbitrate.domain.vo.ArchivesDetailVO;
import com.ruoyi.wisdomarbitrate.domain.vo.LogisticsInfoVO;
@@ -24,23 +28,34 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.apache.poi.xwpf.usermodel.XWPFDocument;
import org.apache.poi.xwpf.usermodel.XWPFParagraph;
import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTBookmark;
import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTP;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.mail.MailSendException;
import org.springframework.mail.javamail.JavaMailSender;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import java.io.*;
import java.math.BigDecimal;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLEncoder;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.StandardCopyOption;
import java.text.NumberFormat;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.util.*;
import java.util.concurrent.CountDownLatch;
import java.util.function.Function;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import static com.ruoyi.common.utils.SecurityUtils.getUsername;
@@ -69,294 +84,515 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
private SendMailRecordMapper sendMailRecordMapper;
@Autowired
private SmsRecordMapper smsRecordMapper;
@Autowired
private TemplateManageMapper templateManageMapper;
@Autowired
private ColumnValueMapper columnValueMapper;
@Autowired
private FatchRuleMapper fatchRuleMapper;
@Autowired
private SysDictDataMapper dictDataMapper;
// 仲裁反请求模板内容
private final String counterclaim= "在《2022年版仲裁规则》第十八条第(一)项规定的期限内,被申请人向秘书处提交了" +
"《仲裁反请求申请书》及证据材料。仲裁委依据《2022年版仲裁规则》第十八条的规定受理了该仲裁反请求案申请。" +
"仲裁反请求案件受理后,秘书处向被申请人发送了仲裁反请求通知书及附件,向申请人发送了仲裁反请求通知书及附件、仲裁反请求申请书及附件。";
// 财产保全内容
String preservation = "本案受理后,申请人向仲裁委提交了财产保全申请,仲裁委根据《中华人民共和国仲裁法》" +
"第二十八条之规定,将该申请提交至法院。";
// 管辖权异议
String jurisdictionalObjection = "本案受理后,被申请人向仲裁委提交了《管辖异议申请书》,认为" +
",仲裁委经审理,当庭驳回了被申请人的管辖异议申请,并告知被申请人具体的事实和理由将在裁决书中一并列明。";
// 线上开庭时+线上仲裁
String onLineDate="{{onLineDate}}";
String onLine = "仲裁庭审阅了申请人提交的仲裁申请书、证据材料后,于"+onLineDate+"通过仲裁委智慧仲裁平台开庭审理了本案。";
// 开庭+线下仲裁
String offLineDate="{{offLineDate}}";
String offLine = "仲裁庭审阅了申请人提交的仲裁申请书、证据材料后,于 "+offLineDate+"在仲裁委所在地开庭审理了本案。";
//书面仲裁时
String writtenDate="{{writtenDate}}";
String written = "仲裁庭审阅了申请人提交的仲裁申请书、证据材料后,于"+writtenDate+"在仲裁委所在地开庭审理了本案。";
//开庭+缺席审理
String absent = "申请人的特别授权委托代理人{{agentName}}"+"出席了庭审。被申请人经依法送达开庭通知,无正当理由未出席庭审,故仲裁庭依据" +
"《2022年版仲裁规则》第四十条第(二)项的规定,对本案进行了缺席审理。庭审中,申请人陈述了仲裁请求事项及事实与理由,出示了证据材料并进行了说明,\" +\n" +
" \"发表了意见,回答了仲裁庭的提问,并作了最后陈述。因被申请人缺席庭审,故仲裁庭无法组织调解。"+"综上,仲裁庭依据《上海仲裁委员会仲裁规则》(2022年7月1日起施行的版本)" +
"第四十条第(二)项、第五十一条的规定,缺席裁决如下:";
// 开庭+出席
String attend="申请人的特别授权委托代理人{{agentName}}和被申请人本人出席了庭审。 ";
// 开庭+出席+被申提供证据
String onLineAttendFile="庭审中,申请人陈述了仲裁请求事项及所依据的事实与理由,被申请人进行了答辩;双方当事人均出示了证据材料并对对方的证据材料进行了质证;双方当事人均回答了仲裁庭的提问,进行了辩论,并分别作了最后陈述。双方当事人在仲裁庭的主持下进行了调解,但未能达成调解协议。 ";
// 开庭+出席+被申未提供证据
String onLineAttend="庭审中,申请人陈述了仲裁请求事项及所依据的事实与理由,被申请人进行了答辩;申请人出示了证据材料,被申请人对对方的证据材料进行了质证; 双方当事人均回答了仲裁庭的提问,进行了辩论,并分别作了最后陈述。双方当事人在仲裁庭的主持下进行了调解,但未能达成调解协议。 ";
// 被申请人出席答辩意见
String resAttendOpinion="\n(二)被申请人的答辩意见 \n(三)当事人提供的证据材料及对方的质证意见\n" +
"申请人为证明其主张的事实和理由,向仲裁庭提交了如下证据材料:\n{{applicantFile}}\n被申请人对上述材料的质证意见为:{{respondentOpinion}}\n";
// 被申请人出席+被申请人提供了资料
String resFile="被申请人向仲裁庭提交了如下证据材料:\n{{resFile}}" +
"申请人对上述材料的质证意见为:{{applicantOpinion}}";
// 被申请人缺席
String resAbsent="(二)当事人提供的证据材料\n" +
"申请人为证明其主张的事实和理由,向仲裁庭提交了如下证据材料:\n{{applicantFile}}";
// 日期格式化年月日
SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日");
@Override
@Transactional
public AjaxResult createDocument(CaseApplication caseApplication) {
public AjaxResult createDocument(CaseApplication caseApplicationReq) {
String templatePath = "";
String templateName = "";
String agentName = "";
String resName = "";
try {
Map<String, Object> datas = new HashMap<>();
Long id = caseApplication.getId();
if (id == null) {
return null;
}
Long id = caseApplicationReq.getId();
//获取案件详细信息
CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication);
//生成编码
String equipmentNo = getNewEquipmentNo();
datas.put("num", equipmentNo);
//获取仲裁记录表里的相关信息
ArbitrateRecord arbitrateRecord = new ArbitrateRecord();
arbitrateRecord.setCaseAppliId(id);
ArbitrateRecord arbitrateRecord1 = arbitrateRecordMapper.selectArbitrateRecord(arbitrateRecord);
//获取案件关联人信息
CaseApplication caseApplicationById = caseApplicationService.selectCaseApplication(caseApplicationReq);
if (caseApplicationById == null) {
return AjaxResult.error("案件不存在");
}
if (caseApplicationById.getTemplateId() == null) {
return AjaxResult.error("请先指定裁决书模板");
}
// 根据模板id查找对应的模板
TemplateManage templateManage = new TemplateManage();
templateManage.setId(caseApplicationById.getTemplateId());
List<TemplateManage> templateManages = templateManageMapper.selectTemplateList(templateManage);
if (CollectionUtil.isEmpty(templateManages)) {
return AjaxResult.error("请先指定裁决书模板");
}
templatePath = templateManages.get(0).getTemOrigPath();
if(StrUtil.isEmpty(templatePath)){
return AjaxResult.error("未找到该模板");
}
// todo 部署放开
if(templatePath!=null){
templatePath="/home/ruoyi/" +templatePath;
}
try {
File file = new File(templatePath);
} catch (Exception e) {
return AjaxResult.error("未找到该模板");
}
templateName = templateManages.get(0).getFileName();
// 查询案件相关表信息
CaseAffiliate caseAffiliate = new CaseAffiliate();
caseAffiliate.setCaseAppliId(id);
List<CaseAffiliate> caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate);
List<String> nameAgentList = new ArrayList<>();
if (caseAffiliates != null && caseAffiliates.size() > 0) {
for (CaseAffiliate affiliate : caseAffiliates) {
//获取身份类型
int identityType = affiliate.getIdentityType();
if (identityType == 1) { //申请人
datas.put("appName", affiliate.getName());
datas.put("appAddress", affiliate.getResidenAffili());
datas.put("appContactAddress", affiliate.getContactAddress());
datas.put("appLegalPerson", affiliate.getCompLegalPerson());
datas.put("appLegalPersonTitle", affiliate.getCompLegalperPost());
datas.put("appAgentName", affiliate.getNameAgent());
datas.put("appAgentTitle", affiliate.getAppliAgentTitle());
nameAgentList.add(affiliate.getNameAgent());
} else if (identityType == 2) { //被申请人
datas.put("resName", affiliate.getName());
datas.put("resAddress", affiliate.getResidenAffili());
String responSex = affiliate.getResponSex();
if (responSex.equals("0")) {
datas.put("resSex", "男");
} else if (responSex.equals("1")){
datas.put("resSex", "女");
}else {
datas.put("resSex", "未知");
}
Date responBirth = affiliate.getResponBirth();
if (responBirth != null) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
String responBirthStr = sdf.format(responBirth);
datas.put("resDateOfBirth", responBirthStr);
}
datas.put("resContactAddress", affiliate.getContactAddress());
nameAgentList.add(affiliate.getNameAgent());
}
//获取仲裁记录表里的相关信息
ArbitrateRecord arbitrateRecord = new ArbitrateRecord();
arbitrateRecord.setCaseAppliId(id);
ArbitrateRecord arbitrateRecordSelect = arbitrateRecordMapper.selectArbitrateRecord(arbitrateRecord);
// 在系统表中查询案件内置字段
SysDictData sysDictData = new SysDictData();
sysDictData.setDictType("case_built_type");
List<SysDictData> dictDataList = dictDataMapper.selectDictDataList(sysDictData);
// 根据模板id查询抓取规则,判断从主表取值还是从columnValue值取
List<FatchRule> fatchRuleList = fatchRuleMapper.listByTemplateId(caseApplicationById.getTemplateId());
// 抓取规则,0-内置字段,1-自定义字段
Map<Integer, List<FatchRule>> fatchRuleMap = new HashMap<>();
// 裁决书需要的字段和内容,占位符需要配置成中文
Map<String, String> valueMap = new HashMap<>();
// 如果未设置抓取规则,则从主表取数据,设置内置字段值
if (CollectionUtil.isNotEmpty(fatchRuleList)) {
fatchRuleMap = fatchRuleList.stream().collect(Collectors.groupingBy(FatchRule::getIsDefault));
}
// 自定义字段,从columnValue值取
if (fatchRuleMap.size()>0&&fatchRuleMap.containsKey(1)) {
// 根据案件id查询key-value表
List<ColumnValue> columnValueList = columnValueMapper.listByCaseId(caseApplicationReq.getId());
if (CollectionUtil.isNotEmpty(columnValueList)) {
columnValueList.forEach(columnValue -> valueMap.put(columnValue.getName(), columnValue.getValue()));
}
}
Date createTime = caseApplication1.getCreateTime();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
// 将日期格式化为字符串
String createTimeStr = sdf.format(createTime);
datas.put("submissionDate", createTimeStr);
Date registerDate = caseApplication1.getRegisterDate();
String registerDateStr = sdf.format(registerDate);
datas.put("acceptDate", registerDateStr);
//反请求
Integer adjudicaCounter = caseApplication1.getAdjudicaCounter();
String counterclaim = "在《2022年版仲裁规则》第十八条第(一)项规定的期限内,被申请人向秘书处提交了" +
"《仲裁反请求申请书》及证据材料。仲裁委依据《2022年版仲裁规则》第十八条的规定受理了该仲裁反请求案申请。" +
"仲裁反请求案件受理后,秘书处向被申请人发送了仲裁反请求通知书及附件,向申请人发送了仲裁反请求通知书及附件、仲裁反请求申请书及附件。";
if (adjudicaCounter == null) {
datas.put("counterclaim", null);
} else if (adjudicaCounter == 1) {
datas.put("counterclaim", counterclaim);
} else {
datas.put("counterclaim", null);
}
//财产保全
Integer properPreser = caseApplication1.getProperPreser();
String preservation = "本案受理后,申请人向仲裁委提交了财产保全申请,仲裁委根据《中华人民共和国仲裁法》" +
"第二十八条之规定,将该申请提交至法院。";
if (properPreser == null) {
datas.put("preservation", null);
} else if (properPreser == 1) {
datas.put("preservation", preservation);
} else {
datas.put("preservation", null);
}
//管辖权异议
Integer objectiJuris = caseApplication1.getObjectiJuris();
String jurisdictionalObjection = "本案受理后,被申请人向仲裁委提交了《管辖异议申请书》,认为" +
",仲裁委经审理,当庭驳回了被申请人的管辖异议申请,并告知被申请人具体的事实和理由将在裁决书中一并列明。";
if (objectiJuris == null) {
datas.put("jurisdictionalObjection", null);
} else if (objectiJuris == 1) {
datas.put("jurisdictionalObjection", jurisdictionalObjection);
} else {
datas.put("jurisdictionalObjection", null);
}
String arbitratorName = caseApplication1.getArbitratorName();
datas.put("arbitratorName", arbitratorName);
Integer arbitratMethod = caseApplication1.getArbitratMethod();
Date hearDate = caseApplication1.getHearDate();
if (hearDate != null) {
String hearDateStr = sdf.format(hearDate);
//线上开庭时
if (arbitratMethod == 1) {
String onLine1 = "仲裁庭审阅了申请人提交的仲裁申请书、证据材料后,于";
String onLine2 = "通过仲裁委智慧仲裁平台开庭审理了本案。";
datas.put("onLine1", onLine1);
datas.put("hearDate", hearDateStr);
datas.put("onLine2", onLine2);
} else {
//书面仲裁时
String written1 = "仲裁庭审阅了申请人提交的仲裁申请书、证据材料后,于";
String written2 = "在仲裁委所在地开庭审理了本案。";
datas.put("written1", written1);
datas.put("hearDate1", hearDateStr);
datas.put("written2", written2);
}
}
Integer isAbsence = caseApplication1.getIsAbsence();
if (isAbsence == null) {
datas.put("absent1", null);
datas.put("absent2", null);
datas.put("absent3", null);
datas.put("absent4", null);
datas.put("absent5", null);
datas.put("attend1", null);
datas.put("attend2", null);
datas.put("attend3", null);
datas.put("attend4", null);
datas.put("attend5", null);
datas.put("attend6", null);
datas.put("attend7", null);
datas.put("appAgentName1", null);
datas.put("appAgentName2", null);
datas.put("resAgentName", null);
} else if (isAbsence == 1) {
//缺席审理
String absent1 = "申请人的特别授权委托代理人";
String absent2 = "出席了庭审。被申请人经依法送达开庭通知,无正当理由未出席庭审,故仲裁庭依据" +
"《2022年版仲裁规则》第四十条第(二)项的规定,对本案进行了缺席审理。";
String absent3 = "庭审中,申请人陈述了仲裁请求事项及事实与理由,出示了证据材料并进行了说明," +
"发表了意见,回答了仲裁庭的提问,并作了最后陈述。因被申请人缺席庭审,故仲裁庭无法组织调解。";
String absent4 = "(二/三)当事人提供的证据材料\n" +
"申请人为证明其主张的事实和理由,向仲裁庭提交了如下证据材料:";
String absent5 = "综上,仲裁庭依据《上海仲裁委员会仲裁规则》(2022年7月1日起施行的版本)" +
"第四十条第(二)项、第五十一条的规定,缺席裁决如下:";
datas.put("absent1", absent1);
datas.put("absent2", absent2);
datas.put("absent3", absent3);
datas.put("absent4", absent4);
datas.put("absent5", absent5);
datas.put("appAgentName1", nameAgentList.get(0));
} else {
//出席审理
String attend1 = "申请人的特别授权委托代理人";
String attend2 = "和被申请人本人/的特别授权委托代理人";
String attend3 = "出席了庭审。";
String attend4 = "庭审中,申请人陈述了仲裁请求事项及所依据的事实与理由,被申请人进行了答辩;" +
"双方当事人均出示了证据材料并对对方的证据材料进行了质证;申请人出示了证据材料," +
"被申请人对对方的证据材料进行了质证;双方当事人均回答了仲裁庭的提问,进行了辩论," +
"并分别作了最后陈述。双方当事人在仲裁庭的主持下进行了调解,但未能达成调解协议。";
String attend5 = "(二)被申请人的答辩意见";
String attend6 = "(二/三)当事人提供的证据材料及对方的质证意见\n" +
"申请人为证明其主张的事实和理由,向仲裁庭提交了如下证据材料:";
String attend7 = "被申请人对上述材料的质证意见为:";
datas.put("attend1", attend1);
datas.put("attend2", attend2);
datas.put("attend3", attend3);
datas.put("attend4", attend4);
datas.put("attend5", attend5);
datas.put("attend6", attend6);
datas.put("attend7", attend7);
datas.put("responCrossOpin", caseApplication1.getResponCrossOpin());
datas.put("appAgentName2", nameAgentList.get(0));
datas.put("resAgentName", nameAgentList.get(1));
if (arbitratMethod == 1) {
//被申出席+开庭
String attend8 = "综上,仲裁庭依据《上海仲裁委员会仲裁规则》(2022年7月1日起施行的版本)" +
"第五十一条的规定,裁决如下:";
datas.put("attend8", attend8);
} else {
//被申出席+书面
String attend9 = "综上,仲裁庭依据《上海仲裁委员会仲裁规则》(2022年7月1日起施行的版本)" +
"第五十一条、第五十八条的规定,裁决如下:";
datas.put("attend9", attend9);
}
}
datas.put("claims", caseApplication1.getArbitratClaims());
datas.put("request", caseApplication1.getRequestRule());
CaseApplication caseApplication2 = caseApplicationService.selectCaseApplication(caseApplication);
List<CaseAttach> caseAttachList1 = caseApplication2.getCaseAttachList();
if (caseAttachList1 != null && caseAttachList1.size() > 0) {
for (CaseAttach caseAttach : caseAttachList1) {
if (caseAttach.getAnnexType() == 6) { //被申请人证据材料
String annexName = caseAttach.getAnnexName();
boolean isImageFile = Pattern.matches(".*\\.(jpg|png|gif|bmp)$", annexName);
if (isImageFile) {
String annexPath = "/home/ruoyi" + caseAttach.getAnnexPath();
System.out.println("路径是===========" + annexPath);
PictureRenderData pictureRenderData = WordUtil
.rebuildImageContent(100, 100, null, annexPath);
datas.put("resEvidenceMaterial", pictureRenderData);
}
} else if (caseAttach.getAnnexType() == 2) { //申请人证据材料
String annexName = caseAttach.getAnnexName();
boolean isImageFile = Pattern.matches(".*\\.(jpg|png|gif|bmp)$", annexName);
if (isImageFile) {
String annexPath = "/home/ruoyi" + caseAttach.getAnnexPath();
System.out.println("路径是===========" + annexPath);
PictureRenderData pictureRenderData = WordUtil
.rebuildImageContent(100, 100, null, annexPath);
//申请人证据材料
datas.put("appEvidenceMaterial", pictureRenderData);
}
}
}
}
datas.put("applicaCrossOpin", "被申请人证据不足,无法说明事实");
datas.put("factDetermi", "被申请人欠款属实");
datas.put("arbitrateThink", " 被申请人应按约定还款");
datas.put("rulingFollows", "被申请人依法偿还申请人欠款");
// 组装内置字段,在主表中查出内容
buildDefaultColumnValue(dictDataList,caseAffiliates,valueMap,caseApplicationById);
// 获取模板中的占位符key
List<String> bookmarkList = getBookmarkByDocx(templatePath);
if (CollectionUtil.isEmpty(bookmarkList)) {
return AjaxResult.success("请检查模板是否配置正确,未获取到占位符");
}
// 遍历书签,给书签赋值
replaceBookmark(bookmarkList,datas,valueMap);
// 根据条件替换书签
conditionReplaceBookmark(caseApplicationById,datas,agentName,resName,arbitrateRecordSelect);
// 裁决书生成时间
LocalDate now = LocalDate.now();
String year = Integer.toString(now.getYear());
datas.put("year", year);
datas.put("裁决书生成时间", year);
//生成编码
String equipmentNo = getNewEquipmentNo();
// 裁决书编号
datas.put("裁决书编号", equipmentNo);
// 仲裁费
datas.put("仲裁费", caseApplicationById.getFeePayable().toString());
// 案件创建时间
Date createTime = caseApplicationById.getCreateTime();
// 将日期格式化为字符串
String createTimeStr = sdf.format(createTime);
datas.put("案件创建时间", createTimeStr);
// 立案日期
Date registerDate = caseApplicationById.getRegisterDate();
String registerDateStr = sdf.format(registerDate);
datas.put("立案日期", registerDateStr);
String month = String.format("%02d", now.getMonthValue());
String day = String.format("%02d", now.getDayOfMonth());
String modalFilePath = "/data/arbitrate-document/template/新裁决书模板.docx";
// String modalFilePath = "D:/develop/新裁决书模板.docx";
// todo
String saveFolderPath = "/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day;
// String saveFolderPath = "D:/data/" + year + "/" + month + "/" + day;
// String saveFolderPath = "D:/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day;
String fileName = UUID.randomUUID().toString().replace("-", "") + ".docx";
// todo
String saveName = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName;
String resultFilePath = saveFolderPath + "/" + fileName;
// 创建日期目录
File saveFolder = new File(saveFolderPath);
if (!saveFolder.exists()) {
saveFolder.mkdirs();
}
Path sourcePath = new File(modalFilePath).toPath();
Path destinationPath = new File(resultFilePath).toPath();
Files.copy(sourcePath, destinationPath, StandardCopyOption.REPLACE_EXISTING);
String docFilePath = WordUtil.getDocFilePath(datas, modalFilePath, resultFilePath);
File file = new File(docFilePath);
if (file.exists()) {
InputStream in = new FileInputStream(file);
XWPFDocument xwpfDocument = new XWPFDocument(in);
WordUtil.changeText(xwpfDocument);
}
// String saveName = "D:/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day + "/" + fileName;
// 将word中的标签替换掉,生成新的word
String docFilePath = wordChangeText(templatePath,datas,saveFolderPath,fileName);
String savePath = docFilePath.substring(0, docFilePath.indexOf("/upload/") + 8);
CaseAttach caseAttach = CaseAttach.builder()
.caseAppliId(id)
.annexName(saveName)
.annexPath(savePath)
.annexType(3)
.build();
//保存到附件表里,先判断之前有没有,有的话更新,没有的话新增
List<CaseAttach> caseAttachList = caseAttachMapper.getCaseAttachByCaseIdAndType(caseAttach);
if (caseAttachList != null && caseAttachList.size() > 0) {
//之前已经生成过了,更新
int i = caseAttachMapper.updateCaseAttachBycaseid(caseAttach);
} else {
//之前没生成过,新增
int i = caseAttachMapper.save(caseAttach);
if (i > 0) {
if (arbitrateRecord1 != null) {
Integer annexId = caseAttach.getAnnexId();
//将附件id保存到仲裁记录表里面
arbitrateRecord1.setAnnexId(annexId);
arbitrateRecordMapper.updataArbitrateRecord(arbitrateRecord1);
}
}
}
//修改案件状态
caseApplication1.setCaseStatus(CaseApplicationConstants.VERPRIF_ARBITRATION);
caseApplicationMapper.submitCaseApplication(caseApplication1);
// 保存裁决书附件
saveArbitorFile(id, saveName, savePath, caseApplicationById, arbitrateRecordSelect);
return AjaxResult.success("裁决书已生成");
} catch (IOException e) {
return AjaxResult.error(e + "请检查文件路径是否有误");
}
}
/**
* 将word中的标签替换掉,生成新的word
* @param modalFilePath 裁决书模板路径
* @param datas 替换标签的内容
* @param saveFolderPath 保存路径
* @param fileName 保存文件名
* @return
* @throws IOException
*/
private String wordChangeText(String modalFilePath, Map<String, Object> datas, String saveFolderPath,String fileName) throws IOException {
String resultFilePath = saveFolderPath + "/" + fileName;
// 创建日期目录
File saveFolder = new File(saveFolderPath);
if (!saveFolder.exists()) {
saveFolder.mkdirs();
}
Path sourcePath = new File(modalFilePath).toPath();
Path destinationPath = new File(resultFilePath).toPath();
Files.copy(sourcePath, destinationPath, StandardCopyOption.REPLACE_EXISTING);
String docFilePath = WordUtil.getDocFilePath(datas, modalFilePath, resultFilePath);
File file = new File(docFilePath);
if (file.exists()) {
InputStream in = new FileInputStream(file);
XWPFDocument xwpfDocument = new XWPFDocument(in);
WordUtil.changeText(xwpfDocument);
}
return docFilePath;
}
/**
* 根据条件判断裁决书中是否需要该内容
* @param caseApplicationById 案件信息
* @param datas 替换标签值
* @param agentName 代理人名称
* @param resName 被申请人名称
* @param arbitrateRecordSelect 仲裁记录
*/
private void conditionReplaceBookmark(CaseApplication caseApplicationById, Map<String, Object> datas,String agentName,String resName, ArbitrateRecord arbitrateRecordSelect ) {
// 如果有仲裁反请求,该字段设置值
Integer adjudicaCounter = caseApplicationById.getAdjudicaCounter();
if (adjudicaCounter != null && adjudicaCounter == 1) {
datas.put("仲裁反请求", counterclaim);
}
//财产保全
Integer properPreser = caseApplicationById.getProperPreser();
if (properPreser != null && properPreser == 1) {
datas.put("财产保全", preservation);
}
//管辖权异议
Integer objectiJuris = caseApplicationById.getObjectiJuris();
if (objectiJuris != null && objectiJuris == 1) {
datas.put("管辖权异议", jurisdictionalObjection);
}
// 出席庭审人员角色名称
String attendName = "秘书、";
boolean isAbsenceFlag = caseApplicationById.getIsAbsence() != null && caseApplicationById.getIsAbsence().equals(0);
boolean appIsAbsenceFlag = caseApplicationById.getAppliIsAbsen() != null && caseApplicationById.getAppliIsAbsen().equals(0);
if (isAbsenceFlag || appIsAbsenceFlag) {
if (isAbsenceFlag) {
attendName += "申请代理人" + agentName + "、";
}
if (appIsAbsenceFlag) {
attendName += "被申请人" + resName;
}
if (attendName.endsWith("、")) {
attendName = attendName.replace("、", "");
}
datas.put("出席庭审人员", attendName);
}
// 仲裁员名称
datas.put("仲裁员姓名", caseApplicationById.getArbitratorName());
// 审理方式
Integer arbitratMethod = caseApplicationById.getArbitratMethod();
Date hearDate = caseApplicationById.getHearDate();
String hearDateStr = "";
if (hearDate != null) {
// 审理日期
hearDateStr = sdf.format(hearDate);
datas.put("审理日期", hearDateStr);
}
// todo 线上仲裁/线下仲裁方式未选择
//线上开庭时+线上仲裁
if (arbitratMethod!=null&&arbitratMethod == 1) {
String replace = onLine.replace(onLineDate, Optional.of(hearDateStr).orElse(""));
datas.put("线上开庭并线上仲裁", replace);
// 所有附件
List<CaseAttach> caseAttachList = caseApplicationById.getCaseAttachList();
Map<Integer, List<CaseAttach>> caseAttachMap = new HashMap<>();
if (caseAttachList != null && caseAttachList.size() > 0) {
caseAttachMap = caseAttachList.stream().collect(Collectors.groupingBy(CaseAttach::getAnnexType));
}
// 被申请人是否缺席
Integer isAbsence = caseApplicationById.getIsAbsence();
if (isAbsence != null && isAbsence == 1) {
// 被申请人缺席,开庭+缺席审理
String absentReplace = absent.replace("{{agentName}}", Optional.of(agentName).orElse(""));
// 被申请人缺席
String resAbsentReplace = resAbsent;
if (caseAttachMap != null && CollectionUtil.isNotEmpty(caseAttachMap.get(2))) {
List<CaseAttach> caseAttaches = caseAttachMap.get(2);
StringBuilder stringBuilder = new StringBuilder();
for (CaseAttach caseAttach : caseAttaches) {
stringBuilder.append(caseAttach.getAnnexName()).append("\n");
}
resAbsentReplace = resAttendOpinion.replace("{{applicantFile}}", stringBuilder.toString());
}
datas.put("开庭并缺席", absentReplace + resAbsentReplace);
} else {
// 被申出席
String attendReplace = attend.replace("{{agentName}}", Optional.ofNullable(agentName).orElse(""));
datas.put("开庭并出席", attendReplace);
// 被申请人证据
if (caseAttachMap != null && CollectionUtil.isNotEmpty(caseAttachMap.get(6))) {
// 开庭+出席+被申提供证据
// 开庭+出席+被申提供证据
String resFileReplace = resFile;
if (CollectionUtil.isNotEmpty(caseAttachMap.get(6))) {
List<CaseAttach> caseAttaches = caseAttachMap.get(6);
StringBuilder stringBuilder = new StringBuilder();
for (CaseAttach caseAttach : caseAttaches) {
stringBuilder.append(caseAttach.getAnnexName()).append("\n");
}
resFileReplace = resFile.replace("{{resFile}}", stringBuilder.toString()).replace("{{applicantOpinion}}", (arbitrateRecordSelect == null || arbitrateRecordSelect.getApplicantOpinion() == null ? "" : arbitrateRecordSelect.getApplicantOpinion()));
}
datas.put("开庭并出席并被申提供证据", onLineAttendFile + resFileReplace);
} else {
// 开庭+出席+被申未提供证据
datas.put("开庭并出席并被申未提供证据", onLineAttend);
}
// 被申请人出席答辩意见
String resAttendOpinionReplace = resAttendOpinion;
if (caseAttachMap != null && CollectionUtil.isNotEmpty(caseAttachMap.get(2))) {
List<CaseAttach> caseAttaches = caseAttachMap.get(2);
StringBuilder stringBuilder = new StringBuilder();
for (CaseAttach caseAttach : caseAttaches) {
stringBuilder.append(caseAttach.getAnnexName()).append("\n");
}
resAttendOpinionReplace = resAttendOpinion.replace("{{applicantFile}}", stringBuilder.toString()).replace("{{respondentOpinion}}", (arbitrateRecordSelect == null || arbitrateRecordSelect.getRespondentOpinion() == null) ? "" : arbitrateRecordSelect.getRespondentOpinion());
}
datas.put("被申请人出席答辩意见", resAttendOpinionReplace);
}
} else {
//书面仲裁时
String replace = written.replace(writtenDate, Optional.of(hearDateStr).orElse(""));
datas.put("书面仲裁", replace);
}
}
/**
* 给模板中的占位符赋值
* @param bookmarkList 书签
* @param datas 书签赋值
* @param valueMap 案件内容
*/
private void replaceBookmark(List<String> bookmarkList, Map<String, Object> datas, Map<String, String> valueMap) {
for (String bookmark : bookmarkList) {
if (valueMap.containsKey(bookmark)) {
if (bookmark.equals("仲裁请求")) {
// 请求仲裁庭裁决
String arbitratClaims = valueMap.get(bookmark);
if (StrUtil.isNotEmpty(arbitratClaims)) {
String replace = arbitratClaims.replace("甲方", "被申请人").replace("乙方", "申请人");
datas.put(bookmark, replace);
} else {
datas.put(bookmark, "");
}
} else if (bookmark.equals("本案事实")) {
// 查询本案事实如下
String mediationAgreement = valueMap.get(bookmark);
if (StrUtil.isNotEmpty(mediationAgreement)) {
String replace = mediationAgreement.replace("甲方", "被申请人").replace("乙方", "申请人");
datas.put(bookmark, replace);
} else {
datas.put(bookmark, "");
}
} else {
datas.put(bookmark, valueMap.get(bookmark));
}
}
}
}
/**
* 组装案件内置字段值,即主表和相关人员表信息
* @param dictDataList 内置字段
* @param caseAffiliates 关联人员
* @param valueMap 组装的值
*/
private void buildDefaultColumnValue(List<SysDictData> dictDataList, List<CaseAffiliate> caseAffiliates, Map<String, String> valueMap, CaseApplication caseApplication) {
if (CollectionUtil.isNotEmpty(dictDataList)) {
Map<Integer, CaseAffiliate> affiliateMap = caseAffiliates.stream().collect(Collectors.toMap(CaseAffiliate::getIdentityType, Function.identity(), (n1, n2) -> n2));
for (SysDictData dictData : dictDataList) {
if (StrUtil.isNotEmpty(dictData.getDictLabel())) {
if (dictData.getDictLabel().contains("被申请人")) {
CaseAffiliate affiliate = affiliateMap.get(2);
if (affiliate == null) {
continue;
}
// 被申请人
switch (dictData.getDictLabel()) {
case "被申请人姓名":
valueMap.put(dictData.getDictLabel(), affiliate.getName());
break;
case "被申请人身份证号":
valueMap.put(dictData.getDictLabel(), affiliate.getIdentityNum());
break;
case "被申请人住所":
valueMap.put(dictData.getDictLabel(), affiliate.getResidenAffili());
break;
case "被申请人联系电话":
valueMap.put(dictData.getDictLabel(), affiliate.getContactTelphone());
break;
case "被申请人电子邮件":
valueMap.put(dictData.getDictLabel(), affiliate.getEmail());
break;
case "被申请人性别":
if (dictData.getDictLabel().equals("被申请人性别")) {
String responSex = affiliate.getResponSex();
if (responSex.equals("0")) {
valueMap.put(dictData.getDictLabel(), "男");
} else {
valueMap.put(dictData.getDictLabel(), "女");
}
}
break;
case "被申请人出生年月日":
Date responBirth = affiliate.getResponBirth();
if (responBirth != null) {
valueMap.put(dictData.getDictLabel(), sdf.format(responBirth));
} else {
valueMap.put(dictData.getDictLabel(), "");
}
break;
default:
break;
}
} else if (dictData.getDictLabel().contains("申请人") || dictData.getDictLabel().contains("统一社会信用代码")
|| dictData.getDictLabel().contains("法定代表人") || dictData.getDictLabel().contains("法定代表人职位")
|| dictData.getDictLabel().contains("代理人")) {
CaseAffiliate affiliate = affiliateMap.get(1);
if (affiliate == null) {
continue;
}
// 申请人
switch (dictData.getDictLabel()) {
case "申请人姓名":
valueMap.put(dictData.getDictLabel(), affiliate.getName());
break;
case "统一社会信用代码":
valueMap.put(dictData.getDictLabel(), affiliate.getIdentityNum());
break;
case "法定代表人":
valueMap.put(dictData.getDictLabel(), affiliate.getCompLegalPerson());
break;
case "法定代表人职位":
valueMap.put(dictData.getDictLabel(), affiliate.getCompLegalperPost());
break;
case "申请人住所":
valueMap.put(dictData.getDictLabel(), affiliate.getResidenAffili());
break;
case "申请人联系地址":
valueMap.put(dictData.getDictLabel(), affiliate.getContactAddress());
break;
case "委托代理人姓名":
valueMap.put(dictData.getDictLabel(), affiliate.getNameAgent());
break;
case "委托代理人联系电话":
valueMap.put(dictData.getDictLabel(), affiliate.getContactTelphoneAgent());
break;
case "委托代理人电子邮件":
valueMap.put(dictData.getDictLabel(), affiliate.getAgentEmail());
break;
default:
break;
}
}else {
valueMap.put(dictData.getDictLabel(), ObjectFieldUtils.getValue(caseApplication, dictData.getDictValue()));
}
}else {
valueMap.put(dictData.getDictLabel(), ObjectFieldUtils.getValue(caseApplication, dictData.getDictValue()));
}
}
}
}
/**
* 保存裁决书附件
* @param id 案件id
* @param saveName 保存的文件名
* @param savePath 保存路径
* @param caseApplicationById 案件基本信息
* @param arbitrateRecordSelect 出裁决书生成记录
*/
private void saveArbitorFile(Long id, String saveName, String savePath, CaseApplication caseApplicationById, ArbitrateRecord arbitrateRecordSelect) {
CaseAttach caseAttach = CaseAttach.builder()
.caseAppliId(id)
.annexName(saveName)
.annexPath(savePath)
.annexType(3)
.build();
//保存到附件表里,先判断之前有没有,有的话更新,没有的话新增
List<CaseAttach> caseAttachList = caseAttachMapper.getCaseAttachByCaseIdAndType(caseAttach);
if (caseAttachList != null && caseAttachList.size() > 0) {
//之前已经生成过了,更新
int i = caseAttachMapper.updateCaseAttachBycaseid(caseAttach);
} else {
//之前没生成过,新增
int i = caseAttachMapper.save(caseAttach);
if (i > 0) {
if (arbitrateRecordSelect != null) {
Integer annexId = caseAttach.getAnnexId();
//将附件id保存到仲裁记录表里面
arbitrateRecordSelect.setAnnexId(annexId);
arbitrateRecordMapper.updataArbitrateRecord(arbitrateRecordSelect);
}
}
}
//修改案件状态
caseApplicationById.setCaseStatus(CaseApplicationConstants.VERPRIF_ARBITRATION);
caseApplicationMapper.submitCaseApplication(caseApplicationById);
}
@Override
@Transactional
public AjaxResult sendDocumentByEmail(Long id, String appEmail, String resEmail, String apptrackingNum, String restrackingNum) {
@@ -1019,6 +1255,33 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
}
return AjaxResult.success(bookSendVO);
}
private void setExecList(List<MultipleThreadListParam> execList, List<ColumnValue> columnValueList){
if(CollectionUtil.isNotEmpty(columnValueList)){
Function<List<ColumnValue>,Integer> function= columnValueMapper::batchSave;
execList.add(new MultipleThreadListParam(function,columnValueList));
}
}
@Transactional
@Override
public AjaxResult batchDocument(List<Long> ids) {
// todo 多线程生成裁决书
// List<MultipleThreadListParam> execList=new ArrayList<>();
// if(CollectionUtil.isNotEmpty(columnValueList)) {
// setExecList(execList, columnValueList);
// }
//
// if(CollectionUtil.isNotEmpty(execList)){
// MultipleThreadWorkUtil.execListFun(execList.toArray(new MultipleThreadListParam[execList.size()]));
// }
for (Long id : ids) {
CaseApplication caseApplication = new CaseApplication();
caseApplication.setId(id);
createDocument(caseApplication);
}
return AjaxResult.success();
}
public String getNewEquipmentNo() {
Object awardNum = redisCache.getCacheObject("awardNum");
@@ -1045,4 +1308,49 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
return s;
}
}
/**
* 根据裁决书模板获取所有的占位符,占位符必须是{{name}}格式
* @param path
* @return
*/
public List<String> getBookmarkByDocx(String path){
XWPFDocument xwpfDocument = null;
try {
log.error("path===="+path);
FileInputStream fileInputStream = new FileInputStream(path);
log.error("fileInputStream====");
xwpfDocument = new XWPFDocument(fileInputStream);
log.error("xwpfDocument===="+xwpfDocument);
} catch (IOException e) {
e.printStackTrace();
}
if(xwpfDocument==null){
return new ArrayList<>();
}
List<XWPFParagraph> paragraphs = xwpfDocument.getParagraphs();
if(CollectionUtil.isEmpty( xwpfDocument.getParagraphs())){
return new ArrayList<>();
}
String regex = "\\{\\{.*?\\}\\}"; // 定义占位符的正则表达式
Pattern pattern = Pattern.compile(regex);
List<String> bookmarkList=new ArrayList<>();
for (XWPFParagraph paragraph : paragraphs) {
String text = paragraph.getText();
if(StrUtil.isNotEmpty(text)) {
Matcher matcher = pattern.matcher(text);
while (matcher.find()) {
String placeholder = matcher.group();
String keyword = placeholder.substring(2, placeholder.length() - 2);
bookmarkList.add(keyword);
}
}
}
return bookmarkList;
}
}
@@ -12,6 +12,7 @@ import com.ruoyi.wisdomarbitrate.domain.CaseAffiliate;
import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
import com.ruoyi.wisdomarbitrate.domain.CaseAttach;
import com.ruoyi.wisdomarbitrate.domain.SmsSendRecord;
import com.ruoyi.wisdomarbitrate.domain.vo.ColumnValue;
import com.ruoyi.wisdomarbitrate.domain.vo.CompareCaseVO;
import com.ruoyi.wisdomarbitrate.domain.vo.UpdateSubmitVO;
import com.ruoyi.wisdomarbitrate.mapper.*;
@@ -50,9 +51,11 @@ public class CaseApplicationLogServiceImpl implements CaseApplicationLogService
private SmsRecordMapper smsRecordMapper;
@Autowired
private ICaseApplicationService caseApplicationService;
@Autowired
private ColumnValueLogMapper columnValueLogMapper;
// 对比两个版本修改的字段,基本字段对比
private static final String[] columns = {"caseName","caseSubjectAmount","loanStartDate", "loanEndDate","contractNumber","claimInterestOwed","claimLiquidDamag",
"claimPrinciOwed","arbitratClaims","properPreser","requestRule"};
"claimPrinciOwed","arbitratClaims","properPreser","requestRule","facts"};
// 人员字段对比
private static final String[] affiliateColumns = {"name", "identityNum","contactTelphone","contactAddress","workTelphone","workAddress","email",
"nameAgent", "identityNumAgent","contactTelphoneAgent","contactAddressAgent","residenAffili","compLegalPerson",
@@ -158,6 +161,16 @@ public class CaseApplicationLogServiceImpl implements CaseApplicationLogService
caseAttachMapper.updateCaseAttach(caseAttach);
}
}
// 更新自定义字段表
// 根据caseLogId查询自定义字段表
List<ColumnValue> columnValueList = columnValueLogMapper.listBycaseAppliLogId(caseApplicationLog.getCaseLogId());
if(CollectionUtil.isNotEmpty(columnValueList)){
for (ColumnValue columnValue : columnValueList) {
columnValue.setCaseAppliLogId(vo.getCaseId());
}
columnValueLogMapper.batchUpdate(columnValueList);
}
} else {
// 拒绝,将日志表改版本的状态改为拒绝
vo.setUpdateSubmitStatus(UpdateSubmitStatus.REFUSE.getCode());
@@ -231,10 +244,12 @@ public class CaseApplicationLogServiceImpl implements CaseApplicationLogService
CaseApplication caseApplication = new CaseApplication();
caseApplication.setCaseAppliId(vo.getCaseId());
caseApplication.setId(vo.getCaseId());
CaseApplication beforeCase= caseApplicationService.selectCaseApplication(caseApplication);
CaseApplication beforeCase = caseApplicationService.selectCaseApplication(caseApplication);
// 查询案件关联人员
afterCase.setCaseAffiliates(caseAffiliateLogMapper.selectCaseAffiliate(afterCase.getCaseLogId()));
// 查询自定义字段表
afterCase.setColumnValues(columnValueLogMapper.listBycaseAppliLogId(afterCase.getCaseLogId()));
// 查询附件
CaseAttach caseAttach = new CaseAttach();
caseAttach.setCaseAppliLogId(beforeCase.getCaseLogId());
@@ -242,7 +257,7 @@ public class CaseApplicationLogServiceImpl implements CaseApplicationLogService
caseAttachLogMapper.getCaseAttachByCaseIdAndType(caseAttach);
caseAttach.setCaseAppliLogId(afterCase.getCaseLogId());
List<CaseAttach> afterAttachList = caseAttachLogMapper.getCaseAttachByCaseIdAndType(caseAttach);
if(CollectionUtil.isNotEmpty(afterAttachList)){
if (CollectionUtil.isNotEmpty(afterAttachList)) {
for (CaseAttach attach : afterAttachList) {
String annexName = attach.getAnnexName();
String prefix = "/profile";
@@ -284,9 +299,49 @@ public class CaseApplicationLogServiceImpl implements CaseApplicationLogService
}
// 对比案件人员字段
compareAffilate(beforeCase,afterCase);
compareAffilate(beforeCase, afterCase);
// 对比申请人证据资料
compareCaseVO.setChangeColumn(compareApplicantFile(beforeCase,afterCase,changeColumn).toString());
compareCaseVO.setChangeColumn(compareApplicantFile(beforeCase, afterCase, changeColumn).toString());
// 对比自定义字段
//
List<ColumnValue> beforeColumnValues = beforeCase.getColumnValues();
List<ColumnValue> afterColumnValues = afterCase.getColumnValues();
StringBuilder columnValueChange = new StringBuilder();
if (CollectionUtil.isNotEmpty(beforeColumnValues) && CollectionUtil.isNotEmpty(afterColumnValues)) {
Map<String, String> beforeColumnValueMap = beforeColumnValues.stream().collect(Collectors.toMap(ColumnValue::getColumn, ColumnValue::getValue, (n1, n2) -> n2));
for (ColumnValue afterColumnValue : afterColumnValues) {
// 改变前字段不包含改变后字段
if (!beforeColumnValueMap.containsKey(afterColumnValue.getColumn())) {
columnValueChange.append(afterColumnValue.getColumn()).append(",");
} else {
// 都有这个字段,比较内容是否相同
// 修改后为空,修改前不为空
if (StrUtil.isEmpty(afterColumnValue.getValue()) && StrUtil.isNotEmpty(beforeColumnValueMap.get(afterColumnValue.getColumn()))) {
columnValueChange.append(afterColumnValue.getColumn()).append(",");
} else if (StrUtil.isNotEmpty(afterColumnValue.getValue()) && StrUtil.isEmpty(beforeColumnValueMap.get(afterColumnValue.getColumn()))) {
// 修改前为空,修改后不为空
columnValueChange.append(afterColumnValue.getColumn()).append(",");
} else if (StrUtil.isNotEmpty(afterColumnValue.getValue()) && StrUtil.isNotEmpty(beforeColumnValueMap.get(afterColumnValue.getColumn()))
&& !afterColumnValue.getValue().equals(beforeColumnValueMap.get(afterColumnValue.getColumn()))) {
// 修改前不为空,修改后不为空,内容不同
columnValueChange.append(afterColumnValue.getColumn()).append(",");
}
}
}
} else if (CollectionUtil.isEmpty(beforeColumnValues) && CollectionUtil.isNotEmpty(afterColumnValues)) {
for (ColumnValue afterColumnValue : afterColumnValues) {
columnValueChange.append(afterColumnValue.getColumn()).append(",");
}
} else if (CollectionUtil.isNotEmpty(beforeColumnValues) && CollectionUtil.isEmpty(afterColumnValues)) {
for (ColumnValue beforeColumn : beforeColumnValues) {
columnValueChange.append(beforeColumn.getColumn()).append(",");
}
}
compareCaseVO.setColumnValueChangeColumn(columnValueChange.toString());
return AjaxResult.success(compareCaseVO);
}
@@ -442,5 +497,16 @@ public class CaseApplicationLogServiceImpl implements CaseApplicationLogService
caseAttachMapper.updateCaseAttach(caseAttach);
}
}
// 根据caseLogId查询自定义字段表
List<ColumnValue> columnValueList = columnValueLogMapper.listBycaseAppliLogId(caseApplicationLog.getCaseLogId());
// 更新相关人员主表
if(CollectionUtil.isNotEmpty(columnValueList)){
for (ColumnValue columnValue : columnValueList) {
columnValue.setCaseAppliLogId(vo.getCaseId());
}
columnValueLogMapper.batchUpdate(columnValueList);
}
}
}
@@ -186,14 +186,14 @@ public class CaseArbitrateServiceImpl implements ICaseArbitrateService {
CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.GENERATED_ARBITRATION, "");
}
}
Boolean aBoolean1 = generateAward(caseId);
if (aBoolean1) {
// 生成裁决书
CaseApplication application = new CaseApplication();
application.setId(caseId);
adjudicationService.createDocument(application);
//修改案件状态
caseApplication1.setCaseStatus(CaseApplicationConstants.VERPRIF_ARBITRATION);
int i = caseApplicationMapper.submitCaseApplication(caseApplication1);
}else {
return AjaxResult.error("裁决书生成失败");
}
}
return AjaxResult.success("审理成功");
}
@@ -400,6 +400,44 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService {
return caseEvidenceDirectories.stream().map(CaseEvidenceDirectoryVO::new).collect(Collectors.toList());
}
@Override
@Transactional
public AjaxResult uploadRecord(MultipartFile file, Integer annexType, Long id, String username, Long userId) {
if (file.isEmpty()) {
return AjaxResult.error("请选择要上传的文件");
}
try {
String filePath = RuoYiConfig.getUploadPath();
// 上传
String fileName = FileUploadUtils.upload(filePath, file);
CaseAttach caseAttach = CaseAttach.builder().caseAppliId(id)
.annexName(fileName)
.annexPath(filePath)
.annexType(annexType)
.userId(userId)
.userName(username)
.build();
CaseApplication caseApplicationsel = new CaseApplication();
caseApplicationsel.setId(id);
caseApplicationsel.setAnnexType(7);
List<CaseAttach> caseAttachs = caseAttachMapper.queryCaseAttachList(caseApplicationsel);
if(caseAttachs!=null&&caseAttachs.size()>0){
caseAttachMapper.deleteCaseAttachByCasedIdAndType(id,7);
int count = caseAttachMapper.save(caseAttach);
}else {
int count = caseAttachMapper.save(caseAttach);
}
return AjaxResult.success("上传成功");
} catch (IOException e) {
e.printStackTrace();
}
return AjaxResult.error("上传失败");
}
/**
* 递归列表
*/
@@ -0,0 +1,328 @@
package com.ruoyi.wisdomarbitrate.service.impl;
import cn.hutool.core.util.IdcardUtil;
import cn.hutool.core.util.StrUtil;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.utils.SpringUtil;
import com.ruoyi.system.mapper.SysUserMapper;
import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.math.BigDecimal;
import java.util.Date;
import java.util.Map;
import java.util.regex.Pattern;
/**
* @author wangqiong
* @description excel导入校验
* @date 2023-12-11 11:45
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class CaseImportValid {
private CaseApplication caseApplication;
private Map<String, Long> deptMap;
// 手机号正则
private static final Pattern TELEPHONE_REGX = Pattern.compile("^1(3\\d|4[5-9]|5[0-35-9]|6[2567]|7[0-8]|8\\d|9[0-35-9])\\d{8}$");
// 邮箱正则
private static final Pattern EMAIL_PATTERN = Pattern.compile("^[a-zA-Z0-9_+&*-]+(?:\\.[a-zA-Z0-9_+&*-]+)*@(?:[a-zA-Z0-9-]+\\.)+[a-zA-Z]{2,7}$");
private static SysUserMapper sysUserMapper= SpringUtil.getBean(SysUserMapper.class);
/**
* 导入校验
*
* @param caseApplication
* @param
*/
public void importValid(CaseApplication caseApplication, Map<String, Long> deptMap) {
StringBuilder failureMsg = new StringBuilder();
caseApplication.setErrorMsg(failureMsg);
// 校验基本字段
validBaseColumn(caseApplication, failureMsg);
// 校验申请人信息
validApplicationColumn(caseApplication, failureMsg);
// 校验申请人代理信息
validApplicationAgentColumn(caseApplication, failureMsg, deptMap);
// 校验被申请人信息
validDebtorApplicationColumn(caseApplication, failureMsg);
// 校验被申请人代理信息
validDebtorApplicationAgentColumn(caseApplication, failureMsg);
}
/**
* 校验被申请人代理信息
*
* @param caseApplication
* @param failureMsg
*/
private void validDebtorApplicationAgentColumn(CaseApplication caseApplication, StringBuilder failureMsg) {
if (StrUtil.isEmpty(caseApplication.getDebtorNameAgent())) {
failureMsg.append("【被申请人主体信息-代理人姓名】字段不能为空;");
} else if (caseApplication.getDebtorNameAgent().length() > 50) {
failureMsg.append("【被申请人主体信息-代理人姓名】字段超出指定长度,最大长度为50;");
}
if (StrUtil.isEmpty(caseApplication.getDebtorIdentityNumAgent())) {
failureMsg.append("【被申请人主体信息-代理人身份证号】字段不能为空;");
} else if (!IdcardUtil.isValidCard((caseApplication.getDebtorIdentityNumAgent()))) {
failureMsg.append("【被申请人主体信息-代理人身份证号】不合法;");
}
String debtorContactTelphoneAgent = caseApplication.getDebtorContactTelphoneAgent();
if (StrUtil.isEmpty(debtorContactTelphoneAgent)) {
failureMsg.append("【被申请人主体信息-代理人联系电话】字段不能为空;");
} else if (!TELEPHONE_REGX.matcher(debtorContactTelphoneAgent).matches()) {
failureMsg.append("【被申请人主体信息-代理人联系电话】字段不合法;");
}
if (StrUtil.isEmpty(caseApplication.getDebtorContactAddressAgent())) {
failureMsg.append("【被申请人主体信息-代理人联系地址】字段不能为空;");
} else if (caseApplication.getDebtorContactAddressAgent().length() > 50) {
failureMsg.append("【被申请人主体信息-代理人联系地址】字段超出指定长度,最大长度为50;");
}
}
/**
* 校验被申请人信息
*
* @param caseApplication
* @param failureMsg
*/
private void validDebtorApplicationColumn(CaseApplication caseApplication, StringBuilder failureMsg) {
if (StrUtil.isEmpty(caseApplication.getDebtorName())) {
failureMsg.append("【被申请人主体信息-申请人姓名】字段不能为空;");
} else if (caseApplication.getDebtorName().length() > 50) {
failureMsg.append("【被申请人主体信息-申请人姓名】字段超出指定长度,最大长度为50;");
}
if (StrUtil.isEmpty(caseApplication.getDebtorIdentityNum())) {
failureMsg.append("【被申请人主体信息-身份证号】字段不能为空;");
} else if (!IdcardUtil.isValidCard(caseApplication.getDebtorIdentityNum())) {
failureMsg.append("【被申请人主体信息-身份证号】不合法;");
}
String debtorContactTelphone = caseApplication.getDebtorContactTelphone();
if (StrUtil.isEmpty(debtorContactTelphone)) {
failureMsg.append("【被申请人主体信息-联系电话】字段不能为空;");
} else if (!TELEPHONE_REGX.matcher(debtorContactTelphone).matches()) {
failureMsg.append("【被申请人主体信息-联系电话】字段不合法;");
}
if (StrUtil.isEmpty(caseApplication.getDebtorContactAddress())) {
failureMsg.append("【被申请人主体信息-联系地址】字段不能为空;");
} else if (caseApplication.getDebtorContactAddress().length() > 50) {
failureMsg.append("【被申请人主体信息-联系地址】字段超出指定长度,最大长度为50;");
}
String debtorWorkTelphone = caseApplication.getDebtorWorkTelphone();
if (StrUtil.isEmpty(debtorWorkTelphone)) {
failureMsg.append("【被申请人主体信息-单位电话】字段不能为空;");
} else if (!TELEPHONE_REGX.matcher(debtorWorkTelphone).matches()) {
failureMsg.append("【被申请人主体信息-单位电话】字段不合法;");
}
if (StrUtil.isEmpty(caseApplication.getDebtorWorkAddress())) {
failureMsg.append("【被申请人主体信息-单位地址】字段不能为空;");
} else if (caseApplication.getDebtorWorkAddress().length() > 50) {
failureMsg.append("【被申请人主体信息-单位地址】字段超出指定长度,最大长度为50;");
}
if (StrUtil.isEmpty(caseApplication.getResponSex())) {
failureMsg.append("【被申请人主体信息-性别】字段不能为空;");
} else if (caseApplication.getResponSex().length() > 1) {
failureMsg.append("【被申请人主体信息-性别】字段超出指定长度,最大长度为1;");
}
if (caseApplication.getResponBirth() == null) {
failureMsg.append("【被申请人主体信息-出生年月日】字段不合法;");
} else if (caseApplication.getResponBirth().after(new Date())) {
failureMsg.append("【被申请人主体信息-出生年月日】字段不合法,不能超过当前日期;");
}
if (StrUtil.isEmpty(caseApplication.getDebtorEmail())) {
failureMsg.append("【被申请人主体信息-邮箱】字段不能为空;");
} else if (!EMAIL_PATTERN.matcher(caseApplication.getDebtorEmail()).matches()) {
failureMsg.append("【被申请人主体信息-邮箱】字段不合法;");
}
}
/**
* 校验申请人代理信息
*
* @param caseApplication
* @param failureMsg
*/
private void validApplicationAgentColumn(CaseApplication caseApplication, StringBuilder failureMsg, Map<String, Long> deptMap) {
if (StrUtil.isEmpty(caseApplication.getNameAgent())) {
failureMsg.append("【申请人主体信息-代理人姓名】字段不能为空;");
} else if (caseApplication.getNameAgent().length() > 50) {
failureMsg.append("【申请人主体信息-代理人姓名】字段超出指定长度,最大长度为50;");
}
if (StrUtil.isEmpty(caseApplication.getIdentityNumAgent())) {
failureMsg.append("【申请人主体信息-代理人身份证号】字段不能为空;");
} else if (!IdcardUtil.isValidCard(caseApplication.getIdentityNumAgent())) {
failureMsg.append("【申请人主体信息-代理人身份证号】不合法;");
}
validAgentInfo(caseApplication, failureMsg, deptMap);
String contactTelphoneAgent = caseApplication.getContactTelphoneAgent();
if (StrUtil.isEmpty(contactTelphoneAgent)) {
failureMsg.append("【申请人主体信息-代理人联系电话】字段不能为空;");
} else if (!TELEPHONE_REGX.matcher(contactTelphoneAgent).matches()) {
failureMsg.append("【申请人主体信息-代理人联系电话】字段不合法;");
}
if (StrUtil.isEmpty(caseApplication.getContactAddressAgent())) {
failureMsg.append("【申请人主体信息-代理人联系地址】字段不能为空;");
} else if (caseApplication.getContactAddressAgent().length() > 50) {
failureMsg.append("【申请人主体信息-代理人联系地址】字段超出指定长度,最大长度为50;");
}
}
/**
* 校验代理人与组织机构关系
*
* @param caseApplication
* @param failureMsg
* @return
*/
private void validAgentInfo(CaseApplication caseApplication, StringBuilder failureMsg, Map<String, Long> deptMap) {
// 申请机构与代理人都不为空,校验代理人与组织机构关系(代理人必须在该部门下)
if (StrUtil.isNotEmpty(caseApplication.getName()) && StrUtil.isNotEmpty(caseApplication.getNameAgent())) {
String applicationOrganId = "";
// 申请机构已经存在
if (deptMap.containsKey(caseApplication.getName())) {
applicationOrganId = String.valueOf(deptMap.get(caseApplication.getName()));
}
// 根据代理人身份证去用户表查询
SysUser agentUser = sysUserMapper.selectUserByIdCard(caseApplication.getIdentityNumAgent());
// 代理人的部门和申请机构不匹配
if (null != agentUser && null != agentUser.getDeptId() && !String.valueOf(agentUser.getDeptId()).equals(applicationOrganId)) {
// return "该申请代理人已在"+agentUser.getDeptName()+"申请机构下存在,请检查填写信息是否正确";
if (null != agentUser.getDept() && StrUtil.isNotEmpty(agentUser.getDept().getDeptName())) {
failureMsg.append("该申请代理人已在【").append(agentUser.getDept().getDeptName()).append("】申请机构下存在,请检查填写信息是否正确");
} else {
failureMsg.append("该申请代理人已存在,与申请机构不匹配,请检查填写信息是否正确");
}
}
}
}
/**
* 校验申请人主题信息
*
* @param caseApplication
* @param failureMsg
*/
private void validApplicationColumn(CaseApplication caseApplication, StringBuilder failureMsg) {
if (StrUtil.isEmpty(caseApplication.getName())) {
failureMsg.append("【申请人主体信息-申请人(机构)】字段不能为空;");
} else if (caseApplication.getName().length() > 20) {
failureMsg.append("【申请人主体信息-申请人(机构)】字段超出指定长度,最大长度为20;");
}
if (StrUtil.isNotEmpty(caseApplication.getIdentityNum()) && caseApplication.getIdentityNum().length() > 50) {
failureMsg.append("【申请人主体信息-代码】字段超出指定长度,最大长度为50;");
}
String contactTelphone = caseApplication.getContactTelphone();
if (StrUtil.isEmpty(contactTelphone)) {
failureMsg.append("【申请人主体信息-联系电话】字段不能为空;");
} else if (!TELEPHONE_REGX.matcher(contactTelphone).matches()) {
failureMsg.append("【申请人主体信息-联系电话】字段不合法;");
}
if (StrUtil.isEmpty(caseApplication.getContactAddress())) {
failureMsg.append("【申请人主体信息-联系地址】字段不能为空;");
} else if (caseApplication.getName().length() > 50) {
failureMsg.append("【申请人主体信息-联系地址】字段超出指定长度,最大长度为50;");
}
String workTelphone = caseApplication.getWorkTelphone();
if (StrUtil.isEmpty(workTelphone)) {
failureMsg.append("【申请人主体信息-单位电话】字段不能为空;");
} else if (!TELEPHONE_REGX.matcher(workTelphone).matches()) {
failureMsg.append("【申请人主体信息-单位电话】字段不合法;");
}
if (StrUtil.isEmpty(caseApplication.getWorkAddress())) {
failureMsg.append("【申请人主体信息-单位地址】字段不能为空;");
} else if (caseApplication.getWorkAddress().length() > 50) {
failureMsg.append("【申请人主体信息-单位地址】字段超出指定长度,最大长度为50;");
}
if (StrUtil.isEmpty(caseApplication.getEmail())) {
failureMsg.append("【申请人主体信息-邮箱】字段不能为空;");
} else if (!EMAIL_PATTERN.matcher(caseApplication.getEmail()).matches()) {
failureMsg.append("【申请人主体信息-邮箱】字段不合法;");
}
}
/**
* 校验基本字段
*
* @param caseApplication
* @param failureMsg
*/
private void validBaseColumn(CaseApplication caseApplication, StringBuilder failureMsg) {
if (StrUtil.isEmpty(caseApplication.getCaseName())) {
failureMsg.append("【案件名称】字段不能为空;");
} else if (caseApplication.getCaseName().length() > 50) {
failureMsg.append("【案件名称】字段超出指定长度,最大长度为50;");
}
BigDecimal caseSubjectAmount = caseApplication.getCaseSubjectAmount();
if (null == caseSubjectAmount) {
failureMsg.append("【案件标的】字段不合法;");
} else {
if (caseSubjectAmount.compareTo(new BigDecimal("0")) < 0 || caseSubjectAmount.compareTo(new BigDecimal("99999999.99")) > 0) {
failureMsg.append("【案件标的】字段超出范围,范围为[0,100000000);");
}
if (caseSubjectAmount.scale() > 2) {
failureMsg.append("【案件标的】字段超出指定精度(10^-2);");
}
}
if (caseApplication.getLoanStartDate() == null) {
failureMsg.append("【借款开始日期】字段不合法;");
}
if (caseApplication.getLoanEndDate() == null) {
failureMsg.append("【借款结束日期】字段不合法;");
}
if (caseApplication.getLoanStartDate() != null && caseApplication.getLoanEndDate() != null && caseApplication.getLoanStartDate().after(caseApplication.getLoanEndDate())) {
failureMsg.append("【借款结束日期】不能早于【借款开始日期】;");
}
if (StrUtil.isEmpty(caseApplication.getContractNumber())) {
failureMsg.append("【合同编号】字段不能为空;");
} else if (caseApplication.getContractNumber().length() > 50) {
failureMsg.append("【合同编号】字段超出指定长度,最大长度为50;");
}
BigDecimal claimPrinciOwed = caseApplication.getClaimPrinciOwed();
if (null == claimPrinciOwed) {
failureMsg.append("【申请人主张欠本金】字段不合法;");
} else {
if (claimPrinciOwed.compareTo(new BigDecimal("0")) < 0 || claimPrinciOwed.compareTo(new BigDecimal("99999999.99")) > 0) {
failureMsg.append("【申请人主张欠本金】字段超出范围,范围为[0,100000000);");
}
if (claimPrinciOwed.scale() > 2) {
failureMsg.append("【申请人主张欠本金】字段超出指定精度(10^-2);");
}
}
BigDecimal claimInterestOwed = caseApplication.getClaimInterestOwed();
if (null == claimInterestOwed) {
failureMsg.append("【申请人主张欠利息】字段不合法;");
} else {
if (claimInterestOwed.compareTo(new BigDecimal("0")) < 0 || claimInterestOwed.compareTo(new BigDecimal("99999999.99")) > 0) {
failureMsg.append("【申请人主张欠利息】字段超出范围,范围为[0,100000000);");
}
if (claimInterestOwed.scale() > 2) {
failureMsg.append("【申请人主张欠利息】字段超出指定精度(10^-2);");
}
}
BigDecimal claimLiquidDamag = caseApplication.getClaimLiquidDamag();
if (null == claimLiquidDamag) {
failureMsg.append("【申请人主张违约金】字段不合法;");
} else {
if (claimLiquidDamag.compareTo(new BigDecimal("0")) < 0 || claimLiquidDamag.compareTo(new BigDecimal("99999999.99")) > 0) {
failureMsg.append("【申请人主张违约金】字段超出范围,范围为[0,100000000);");
}
if (claimLiquidDamag.scale() > 2) {
failureMsg.append("【申请人主张违约金】字段超出指定精度(10^-2);");
}
}
if (StrUtil.isEmpty(caseApplication.getArbitratClaims())) {
failureMsg.append("【申请人仲裁请求及事实和理由】字段不能为空;");
} else if (caseApplication.getArbitratClaims().length() > 10000) {
failureMsg.append("【申请人仲裁请求及事实和理由】字段超出指定长度,最大长度为10000;");
}
if (StrUtil.isNotEmpty(caseApplication.getArbitratClaims()) && caseApplication.getArbitratClaims().length() > 10000) {
failureMsg.append("【申请人请求仲裁庭裁决】字段超出指定长度,最大长度为10000;");
}
}
}
@@ -34,6 +34,9 @@ public class CaseLogRecordServiceImpl implements ICaseLogRecordService {
if(StrUtil.isNotEmpty(record.getContent())){
contentBuilder.append(record.getContent());
}
if(StrUtil.isNotEmpty(record.getNotes())){
contentBuilder.append(",").append(record.getNotes());
}
record.setContent(contentBuilder.toString());
});
@@ -0,0 +1,881 @@
package com.ruoyi.wisdomarbitrate.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.ruoyi.common.constant.CaseApplicationConstants;
import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.core.domain.entity.SysDept;
import com.ruoyi.common.core.domain.entity.SysRole;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.enums.UpdateSubmitStatus;
import com.ruoyi.common.utils.*;
import com.ruoyi.common.config.RuoYiConfig;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysDictData;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.file.FileUtils;
import com.ruoyi.common.utils.thread.MultipleThreadListParam;
import com.ruoyi.common.utils.thread.MultipleThreadWorkUtil;
import com.ruoyi.common.utils.thread.ThreadPoolUtil;
import com.ruoyi.system.domain.SysUserRole;
import com.ruoyi.system.mapper.*;
import com.ruoyi.wisdomarbitrate.domain.*;
import com.ruoyi.wisdomarbitrate.domain.vo.ColumnValue;
import com.ruoyi.wisdomarbitrate.mapper.*;
import com.ruoyi.wisdomarbitrate.utils.CaseLogUtils;
import com.ruoyi.wisdomarbitrate.utils.OCRUtils;
import com.ruoyi.wisdomarbitrate.utils.UnZipFileUtils;
import org.apache.pdfbox.pdmodel.PDDocument;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import java.io.*;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.function.Function;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import static com.ruoyi.common.core.domain.AjaxResult.error;
import static com.ruoyi.common.core.domain.AjaxResult.success;
import static com.ruoyi.common.utils.SecurityUtils.getUsername;
/**
* @author wangqiong
* @description 案件压缩包导入
* @date 2023-12-11 11:45
*/
@Service
public class CaseZipImportImpl {
@Autowired
private CaseApplicationServiceImpl caseApplicationService;
@Autowired
private FatchRuleMapper fatchRuleMapper;
@Autowired
private SysDictDataMapper dictDataMapper;
@Autowired
private CaseApplicationMapper caseApplicationMapper;
@Autowired
private SysDeptMapper sysDeptMapper;
@Autowired
private SysRoleMapper roleMapper;
@Autowired
private SysUserMapper userMapper;
@Autowired
private SysUserRoleMapper userRoleMapper;
@Autowired
private CaseApplicationLogMapper caseApplicationLogMapper;
@Autowired
private CaseAffiliateLogMapper caseAffiliateLogMapper;
@Autowired
private CaseAttachLogMapper caseAttachLogMapper;
@Autowired
private SmsRecordMapper smsRecordMapper;
@Autowired
private CaseAttachMapper caseAttachMapper;
@Autowired
private ColumnValueMapper columnValueMapper;
@Autowired
private ColumnValueLogMapper columnValueLogMapper;
@Autowired
private CaseAffiliateMapper caseAffiliateMapper;
// 申请人角色id
private long roleId;
private Integer maxCaseNum;
private Integer maxBatchNumber;
public AjaxResult zipImport(MultipartFile file, Long templateId) {
UUID uuid = UUID.randomUUID();
// todo
String targetPath = "/home/ruoyi/uploadPath/upload/unzipFile/" + uuid + "/";
// String targetPath = "D:/home/ruoyi/uploadPath/upload/unzipFile/"+uuid+ "/";
File zipFile = null;
InputStream ins = null;
try {
ins = file.getInputStream();
//上传的压缩包保存的路径
// todo
String savePath = "/home/ruoyi/uploadPath/upload/zipFile/";
// String savePath = "D:/home/ruoyi/uploadPath/upload/zipFile/";
String saveName = uuid + "_" + file.getOriginalFilename();
zipFile = new File(savePath + saveName);
inputChangeToFile(ins, zipFile);
} catch (IOException e) {
e.printStackTrace();
}
//解压缩上传的压缩包
boolean unzipSuccess = UnZipFileUtils.unZipFile(zipFile, targetPath);
if (!unzipSuccess) {
// 解压失败
return AjaxResult.error("解压失败");
}
// 查询抓取规则
// todo 批次需要再上传压缩包时用户填写
List<FatchRule> fatchRuleList = fatchRuleMapper.listByTemplateId(templateId);
if (CollectionUtil.isEmpty(fatchRuleList)) {
return error("未设置抓取规则");
}
File directory = new File(targetPath);
// fileMap<caseId, List<File>>
Map<Long, List<File>> fileMap = findAndConvertPDF(directory);
if (fileMap == null || fileMap.size() <= 0) {
// 解压失败
return AjaxResult.error("未获取到文件");
}
Map<String, String> fatchMap = new HashMap<>();
if (CollectionUtil.isNotEmpty(fatchRuleList)) {
Map<String, List<FatchRule>> fatchRuleMap = fatchRuleList.stream().collect(Collectors.groupingBy(FatchRule::getFileName));
// 根据抓取规则循环抓取
fileMap.forEach((key, fileList) -> {
if (CollectionUtil.isNotEmpty(fileList)) {
for (File caseFile : fileList) {
if (fatchRuleMap.containsKey(caseFile.getName())) {
// 抓取内容
List<FatchRule> fatchRules = fatchRuleMap.get(caseFile.getName());
getFatchContentList(caseFile, fatchMap, fatchRules, key);
}
}
}
});
}
if (fatchMap.size() <= 0) {
return error("从压缩包中未抓取到内容,请检查抓取字段配置");
}
// 尊敬的{1},您的代理的案件已接入仲裁系统,复制访问https://miniapp-3gpama6l759911ef-1321289474.tcloudbaseapp.com/jump-mp.html 进入小程序进行认证注册。如非本人操作,请忽略本短信
SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest();
request.setTemplateId("1956159");
// 新增的案件
List<CaseApplication> caseApplications = new ArrayList<>();
// 从抓取规则表取字段和字典表取基本字段,字典表的字段名塞到基本表,is_default=1自定义字段塞到columnValue
// 抓取规则,0-内置字段,1-自定义字段
Map<Integer, List<FatchRule>> fatchRuleMap = fatchRuleList.stream().collect(Collectors.groupingBy(FatchRule::getIsDefault));
// 在系统表中查询案件内置字段
SysDictData sysDictData = new SysDictData();
sysDictData.setDictType("case_built_type");
List<SysDictData> dictDataList = dictDataMapper.selectDictDataList(sysDictData);
// 查询所有的组织机构,组装成map
List<SysDept> deptList = sysDeptMapper.selectDeptList(new SysDept());
// 所有部门
Map<String, Long> deptMap = new HashMap<>();
if (CollectionUtil.isNotEmpty(deptList)) {
deptMap = deptList.stream().collect(Collectors.toMap(SysDept::getDeptName, SysDept::getDeptId, (oldV, newV) -> newV));
}
// 角色用户
List<SysUserRole> userRoleList = new ArrayList<>();
// 查询申请人角色id
roleId = roleMapper.selectRoleIdByName("申请人");
// 案件基本信息
caseApplications = new ArrayList<>();
// 自定义字段,组装columnValue表
List<ColumnValue> columnValueList = new ArrayList<>();
// 案件人员
List<CaseAffiliate> caseAffiliates = new ArrayList<>();
// 组装机构
List<SysDept> sysDepts = new ArrayList<>();
// 案件附件
List<CaseAttach> caseAttachs = new ArrayList<>();
//发送短信列表
List<SmsSendRecord> smsSendRecordList = new ArrayList<>();
// 短信记录
List<SmsUtils.SendSmsRequest> smsRequestList = new ArrayList<>();
/**
* 用户表已存在的用户
*/
List<SysUser> existUsers = userMapper.selectUserList(new SysUser());
Map<String, SysUser> userMap = new HashMap<>();
if (CollectionUtil.isNotEmpty(existUsers)) {
userMap = existUsers.stream().collect(Collectors.toMap(SysUser::getPhonenumber, Function.identity(), (n1, n2) -> n2));
}
//查询出当天的案件编号的最大值
String currentDay = DateUtils.dateTime();
String caseNum = "zc" + currentDay;
maxCaseNum = caseApplicationMapper.selectCaseNumLike(caseNum, caseNum.length());
// 需要新增的用户
List<SysUser> addUsers = new ArrayList<>();
for (Long caseId : fileMap.keySet()) {
if (CollectionUtil.isEmpty(fileMap.get(caseId))) {
continue;
}
CaseApplication caseApplication = new CaseApplication();
caseApplications.add(caseApplication);
caseApplication.setId(caseId);
caseApplication.setTemplateId(templateId);
caseApplication.setCaseStatus(CaseApplicationConstants.CASE_APPLICATION);
caseApplication.setCaseLogId(IdWorkerUtil.getId());
caseApplication.setUpdateSubmitStatus(UpdateSubmitStatus.UNCOMMITTED.getCode());
caseApplication.setCaseAppliId(caseApplication.getId());
//默认案件标的 todo 案件标的是什么,默认写死
caseApplication.setCaseSubjectAmount(new BigDecimal(100000));
//todo 暂时设置计费比率为0.01
BigDecimal feeRate = new BigDecimal(0.01);
BigDecimal feePayable = caseApplication.getCaseSubjectAmount().multiply(feeRate).setScale(2, BigDecimal.ROUND_HALF_UP);
caseApplication.setFeePayable(feePayable);
// 设置批号
if (StrUtil.isEmpty(caseApplication.getBatchNumber())) {
maxBatchNumber = caseApplicationMapper.selectBatchNumberLike();
if (maxBatchNumber == null) {
maxBatchNumber = 1;
caseApplication.setBatchNumber(maxBatchNumber.toString());
} else {
maxBatchNumber = maxBatchNumber + 1;
caseApplication.setBatchNumber(maxBatchNumber.toString());
}
}
// 设置编号
String maxCaseNumStr = generateCaseNum();
caseApplication.setCaseNum(maxCaseNumStr);
caseApplication.setCreateBy(getUsername());
caseApplication.setVersion(1);
// 组装案件内置字段主表内容
if (fatchRuleMap.size() > 0 && fatchRuleMap.containsKey(1)) {
List<FatchRule> columnRules = fatchRuleMap.get(1);
columnRules.forEach(columnRule -> {
ColumnValue columnValue = new ColumnValue();
columnValue.setColumn(columnRule.getColumn());
columnValue.setName(columnRule.getColumnName());
columnValue.setName(columnRule.getColumnName());
columnValue.setValue(fatchMap.get(columnRule.getColumnName() + Constants.PDFSTR + caseId));
columnValue.setIsDefault(1);
columnValue.setCaseId(caseId);
columnValue.setCaseAppliLogId(caseApplication.getCaseLogId());
columnValueList.add(columnValue);
});
}
caseApplication.setColumnValues(columnValueList);
// 组装内置字段
buildDefaultColumn(caseApplication, dictDataList, fatchMap, caseAffiliates, deptMap, sysDepts, userMap, addUsers, userRoleList, smsSendRecordList, smsRequestList);
for (File caseFile : fileMap.get(caseId)) {
String fileUrl = caseFile.getAbsolutePath();
if (StrUtil.isEmpty(fileUrl)) {
continue;
}
// 上传
String filePath = RuoYiConfig.getUploadPath();
CaseAttach caseAttach = new CaseAttach();
caseAttach.setCaseAppliId(caseApplication.getId());
caseAttach.setCaseAppliLogId(caseApplication.getCaseLogId());
caseAttach.setAnnexPath(filePath);
if (StrUtil.isNotEmpty(fileUrl)) {
String fileName = fileUrl.replace(filePath, "/profile/upload");
caseAttach.setAnnexName(fileName);
}
// 申请人提供的证据材料
caseAttach.setAnnexType(2);
caseAttachs.add(caseAttach);
if (fileUrl.contains("仲裁申请书")) {
CaseAttach applyFile = new CaseAttach();
BeanUtil.copyProperties(caseAttach, applyFile);
applyFile.setAnnexType(1);
caseAttachs.add(applyFile);
}
}
// 案件压缩包导入
caseApplication.setImportFlag(2);
// 组装短信
}
// 多线程执行
List<MultipleThreadListParam> execList = new ArrayList<>();
if (CollectionUtil.isNotEmpty(addUsers)) {
Function<List<SysUser>, Integer> function = userMapper::batchSave;
execList.add(new MultipleThreadListParam(function, addUsers));
}
if (CollectionUtil.isNotEmpty(userRoleList)) {
Function<List<SysUserRole>, Integer> function = userRoleMapper::batchUserRole;
execList.add(new MultipleThreadListParam(function, userRoleList));
}
if (CollectionUtil.isNotEmpty(sysDepts)) {
Function<List<SysDept>, Integer> function = sysDeptMapper::batchSave;
execList.add(new MultipleThreadListParam(function, sysDepts));
}
if (CollectionUtil.isNotEmpty(caseApplications)) {
Function<List<CaseApplication>, Integer> function = caseApplicationMapper::batchSave;
execList.add(new MultipleThreadListParam(function, caseApplications));
Function<List<CaseApplication>, Integer> functionLog = caseApplicationLogMapper::batchSave;
execList.add(new MultipleThreadListParam(functionLog, caseApplications));
}
if (CollectionUtil.isNotEmpty(caseAffiliates)) {
Function<List<CaseAffiliate>, Integer> function = caseAffiliateMapper::batchCaseAffiliate;
execList.add(new MultipleThreadListParam(function, caseAffiliates));
Function<List<CaseAffiliate>, Integer> functionLog = caseAffiliateLogMapper::batchCaseAffiliate;
execList.add(new MultipleThreadListParam(functionLog, caseAffiliates));
}
if (CollectionUtil.isNotEmpty(caseAttachs)) {
Function<List<CaseAttach>, Integer> function = caseAttachMapper::batchSave;
execList.add(new MultipleThreadListParam(function, caseAttachs));
Function<List<CaseAttach>, Integer> functionLog = caseAttachLogMapper::batchSave;
execList.add(new MultipleThreadListParam(functionLog, caseAttachs));
}
if (CollectionUtil.isNotEmpty(columnValueList)) {
Function<List<ColumnValue>, Integer> function = columnValueMapper::batchSave;
execList.add(new MultipleThreadListParam(function, columnValueList));
Function<List<ColumnValue>, Integer> functionLog = columnValueLogMapper::batchSave;
execList.add(new MultipleThreadListParam(functionLog, columnValueList));
}
if (CollectionUtil.isNotEmpty(execList)) {
MultipleThreadWorkUtil.execListFun(execList.toArray(new MultipleThreadListParam[execList.size()]));
}
if (CollectionUtil.isNotEmpty(caseApplications)) {
LoginUser loginUser = SecurityUtils.getLoginUser();
List<CaseLogRecord> logRecords = new ArrayList<>();
caseApplications.forEach(caseApplication -> {
CaseLogRecord operLog = new CaseLogRecord();
// 获取当前的用户
if (loginUser != null) {
SysUser user = loginUser.getUser();
operLog.setCreateBy(user.getUserName());
operLog.setCreateNickName(user.getNickName());
operLog.setUpdateBy(user.getUserName());
} else {
operLog.setCreateBy("admin");
operLog.setCreateNickName("管理员");
operLog.setUpdateBy("admin");
}
operLog.setCaseAppliId(caseApplication.getId());
operLog.setCaseNode(CaseApplicationConstants.CASE_APPLICATION);
logRecords.add(operLog);
}
);
// todo 发送短信
// ThreadPoolUtil.execute(() -> {
// CaseLogUtils.batchInsertCaseLog(logRecords);
// // 发送短信
// if (CollectionUtil.isNotEmpty(smsRequestList)) {
// for (SmsUtils.SendSmsRequest sendSmsRequest : smsRequestList) {
// Boolean aBoolean = SmsUtils.sendSms(request);
// }
// }
//
// }
//
// );
}
// 案件日志
return success("导入成功");
}
/**
* 获取自动编码
*
* @return
*/
public String generateCaseNum() {
// 自动编码格式 zc+yyyyMMdd+001
String currentDay = DateUtils.dateTime();
String caseNum = "zc" + currentDay;
if (null == maxCaseNum) {
maxCaseNum = 1;
caseNum = caseNum + "001";
} else {
maxCaseNum = maxCaseNum + 1;
caseNum = caseNum + String.format("%03d", maxCaseNum);
}
return caseNum;
}
public void inputChangeToFile(InputStream instream, File file) {
try {
OutputStream outStr = new FileOutputStream(file);
int bytesRead = 0;
byte[] buffer = new byte[8192];
while ((bytesRead = instream.read(buffer, 0, 1024)) != -1) {
outStr.write(buffer, 0, bytesRead);
}
outStr.flush();
outStr.close();
instream.close();
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* 查找文件
*
* @param directory
* @param
* @return
*/
public static Map<Long, List<File>> findAndConvertPDF(File directory) {
// caseMap<caseId,Map<fileName,filePath>>
Map<Long, List<File>> caseMap = new HashMap<>();
if (directory.isFile()) {
String path = "";
// 如果传入的参数是一个文件
path = directory.getAbsolutePath();
List<File> fileList = new ArrayList<>();
fileList.add(directory);
caseMap.put(IdWorkerUtil.getId(), fileList);
} else if (directory.isDirectory()) {
searchAndConvertPDF(directory, caseMap, 1, new HashMap<>());
} else {
return null;
}
return caseMap;
}
public static boolean isPDF(File file) {
String extension = FileUtils.getFileExtension(file);
return extension.equalsIgnoreCase("pdf");
}
/**
* 递归查找文件夹
*
* @param directory
* @param caseMap<caseId,List<file>>
* @param i 第几层文件夹
* @param fileMap<filePath,caseId>>
*/
public static void searchAndConvertPDF(File directory, Map<Long, List<File>> caseMap, int i, Map<String, Long> fileMap) {
File[] files = directory.listFiles();
// 约定压缩包第二层一个文件夹为一个案件
if (files != null) {
if (i == 2) {
for (File file : files) {
fileMap.put(file.getAbsolutePath(), IdWorkerUtil.getId());
}
}
i++;
for (File file : files) {
if (file.getName().contains("zip") || file.getName().contains("rar")) {
continue;
}
if (file.isFile()) {
for (Map.Entry<String, Long> entry : fileMap.entrySet()) {
// 为同一个案件
if (!file.getAbsolutePath().contains(entry.getKey())) {
continue;
}
List<File> fileList;
if (caseMap.containsKey(entry.getValue())) {
fileList = caseMap.get(entry.getValue());
} else {
fileList = new ArrayList<>();
}
fileList.add(file);
caseMap.put(entry.getValue(), fileList);
}
} else if (file.isDirectory()) {
// 如果是目录,递归查找
searchAndConvertPDF(file, caseMap, i, fileMap);
}
}
}
}
private static int getFileNumPage(String pdfUrl) {
File pdfFile = new File(pdfUrl);
int pageCount = 0;
try (PDDocument document = PDDocument.load(pdfFile)) {
pageCount = document.getNumberOfPages();
} catch (IOException e) {
e.printStackTrace();
}
return pageCount;
}
/**
* 获取模板和正文中替换符的内容
*
* @param a
* @param b
* @return
*/
public static List<String> getReplaceList(String a, String b) {
String aTmpe = filterString(a);
String bTmpe = filterString(b);
String regex = "(\\{[^}}]*})";
String[] ptTemplate = aTmpe.replaceAll(regex, "@=").split("@=");
String replace = "";
for (int i = 0; i < ptTemplate.length; i++) {
if (ptTemplate[i] == null || ptTemplate[i].equals(" ")) continue;
if (replace.equals("")) {
replace = bTmpe.replace(ptTemplate[i], "@=");
} else {
replace = replace.replace(ptTemplate[i], "@=");
}
}
List<String> aList = new ArrayList<>();
String[] split = replace.split("@=");
for (int i = 0; i < split.length; i++) {
if (split[i] == "" || split[i].equals("")) continue;
aList.add(split[i]);
}
return aList;
}
// 去掉内容中的换行符
public static String filterString(String str) {
if (str == null || str.equals("")) {
return null;
}
String regEx = "[\\r\\n]";
Pattern p = Pattern.compile(regEx);
Matcher m = p.matcher(str);
return m.replaceAll(" ").trim();
}
// 检索时,转换特殊字符
public static String escapeQueryChars(String s) {
if (StringUtils.isBlank(s)) {
return s;
}
StringBuilder sb = new StringBuilder();
for (int i = 0; i < s.length(); i++) {
char c = s.charAt(i);
// These characters are part of the query syntax and must be escaped
if (c == '\\' || c == '+' || c == '-' || c == '!' || c == '(' || c == ')'
|| c == ':' || c == '^' || c == '[' || c == ']' || c == '\"'
|| c == '{' || c == '}' || c == '~' || c == '*' || c == '?'
|| c == '|' || c == '&' || c == ';' || c == '/' || c == '.'
|| c == '$' || Character.isWhitespace(c)) {
sb.append('\\');
}
sb.append(c);
}
return sb.toString();
}
/**
* 组装内置字段
*
* @param caseApplication 案件信息
* @param dictDataList 内置字段
* @param fatchMap 抓取字段内容
*/
private void buildDefaultColumn(CaseApplication caseApplication, List<SysDictData> dictDataList, Map<String, String> fatchMap,
List<CaseAffiliate> caseAffiliates, Map<String, Long> deptMap, List<SysDept> sysDepts,
Map<String, SysUser> userMap, List<SysUser> addUsers, List<SysUserRole> userRoleList,
List<SmsSendRecord> smsSendRecords, List<SmsUtils.SendSmsRequest> smsRequestList) {
// 组装内置字段
if (CollectionUtil.isEmpty(dictDataList)) {
return;
}
// 被申请人
CaseAffiliate debtorAffiliate = new CaseAffiliate();
debtorAffiliate.setCaseAppliId(caseApplication.getId());
debtorAffiliate.setCaseAppliLogId(caseApplication.getCaseLogId());
// 申请人
CaseAffiliate affiliate = new CaseAffiliate();
affiliate.setCaseAppliLogId(caseApplication.getCaseLogId());
affiliate.setCaseAppliId(caseApplication.getId());
for (SysDictData dictData : dictDataList) {
if (StrUtil.isNotEmpty(dictData.getDictLabel())) {
if (dictData.getDictLabel().contains("被申请人")) {
// 组装被申请人内置自段
buildDebtorColumn(dictData, fatchMap, debtorAffiliate, caseApplication.getId());
} else if (dictData.getDictLabel().contains("申请人") || dictData.getDictLabel().contains("统一社会信用代码")
|| dictData.getDictLabel().contains("法定代表人") || dictData.getDictLabel().contains("委托代理人")) {
// 组装申请人内置自段
buildAffilcateColumn(dictData, fatchMap, affiliate, deptMap, sysDepts, userMap, addUsers, userRoleList, caseApplication.getId(), smsSendRecords, smsRequestList);
} else if (dictData.getDictLabel().contains("合同编号")) {
// 合同编号
String contractNumber = fatchMap.get("合同编号" + Constants.PDFSTR + caseApplication.getId());
if (StrUtil.isNotEmpty(contractNumber)) {
// 提取字母和数字
String regx = "[^a-zA-Z0-9]";
String replaceAll = contractNumber.replaceAll(regx, "");
caseApplication.setContractNumber(replaceAll.toUpperCase());
}
} else {
ObjectFieldUtils.setValue(caseApplication, dictData.getDictValue(), fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseApplication.getId()));
}
} else {
ObjectFieldUtils.setValue(caseApplication, dictData.getDictValue(), fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseApplication.getId()));
}
}
if (ObjectUtil.isNotEmpty(affiliate)) {
caseAffiliates.add(affiliate);
}
if (ObjectUtil.isNotEmpty(debtorAffiliate)) {
caseAffiliates.add(debtorAffiliate);
}
}
/**
* 组装申请人内置字段
*
* @param dictData 内置字段
* @param fatchMap 抓取内容
* @param affiliate 案件人员
*/
private void buildAffilcateColumn(SysDictData dictData, Map<String, String> fatchMap, CaseAffiliate affiliate,
Map<String, Long> deptMap, List<SysDept> sysDepts,
Map<String, SysUser> userMap, List<SysUser> addUsers, List<SysUserRole> userRoleList, Long caseId,
List<SmsSendRecord> smsSendRecords, List<SmsUtils.SendSmsRequest> smsRequestList) {
affiliate.setIdentityType(1);
// 申请人
switch (dictData.getDictLabel()) {
case "申请人姓名":
affiliate.setName((fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId)));
if (StrUtil.isNotEmpty(affiliate.getName())) {
// 组装申请机构
// 将组织机构id设为申请人名称
if (deptMap.containsKey(affiliate.getName())) {
affiliate.setApplicationOrganId(String.valueOf(deptMap.get(affiliate.getName())));
affiliate.setApplicationOrganName(affiliate.getName());
} else {
// 如果不存在则新增
SysDept dept = new SysDept();
dept.setParentId(0L);
dept.setDeptName(affiliate.getName());
dept.setAncestors("0");
dept.setOrderNum(1);
dept.setStatus("0");
dept.setDelFlag("0");
dept.setCreateBy(getUsername());
dept.setUpdateBy(getUsername());
dept.setDeptId(Long.valueOf(IdWorkerUtil.getId()));
sysDepts.add(dept);
deptMap.put(dept.getDeptName(), dept.getDeptId());
affiliate.setApplicationOrganId(String.valueOf(dept.getDeptId()));
affiliate.setApplicationOrganName(affiliate.getName());
}
}
break;
case "统一社会信用代码":
affiliate.setIdentityNum((fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId)));
break;
case "法定代表人":
affiliate.setCompLegalPerson(fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId));
break;
case "法定代表人职位":
affiliate.setCompLegalperPost((fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId)));
break;
case "申请人住所":
affiliate.setResidenAffili((fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId)));
break;
case "申请人联系地址":
affiliate.setContactAddress(fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId));
break;
case "委托代理人姓名":
affiliate.setNameAgent(fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId));
break;
case "委托代理人联系电话":
affiliate.setContactTelphoneAgent(fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId));
if (StrUtil.isNotEmpty(affiliate.getContactTelphoneAgent())) {
SysUser agentUser = null;
// 用户已存在
if (userMap.containsKey(affiliate.getContactTelphoneAgent())) {
agentUser = userMap.get(affiliate.getContactTelphoneAgent());
if (null != agentUser.getDeptId() && String.valueOf(agentUser.getDeptId()).equals(affiliate.getApplicationOrganId())) {
// 同步用户表和案件关联人表的手机号和名称
affiliate.setContactTelphoneAgent(agentUser.getPhonenumber());
affiliate.setNameAgent(agentUser.getNickName());
affiliate.setApplicantAgentUserId(String.valueOf(agentUser.getUserId()));
if (StrUtil.isNotEmpty(agentUser.getIdCard())) {
affiliate.setIdentityNumAgent(agentUser.getIdCard());
} else {
affiliate.setIdentityNumAgent(affiliate.getIdentityNumAgent());
}
List<Long> longList = new ArrayList<>();
// 新增角色为申请人
if (CollectionUtil.isNotEmpty(agentUser.getRoles())) {
longList = agentUser.getRoles().stream().map(SysRole::getRoleId).collect(Collectors.toList());
if (!longList.contains(roleId)) {
insertAgentUserRole(agentUser, roleId, userRoleList);
}
} else {
insertAgentUserRole(agentUser, roleId, userRoleList);
}
}
} else {
// 用户不存在,新增
agentUser = new SysUser();
agentUser.setUserId(Long.valueOf(IdWorkerUtil.getId()));
agentUser.setIdCard(affiliate.getIdentityNumAgent());
agentUser.setNickName(affiliate.getNameAgent());
agentUser.setUserName(affiliate.getContactTelphoneAgent());
agentUser.setPhonenumber(affiliate.getContactTelphoneAgent());
agentUser.setPassword(SecurityUtils.encryptPassword("abc123456"));
agentUser.setDeptId(Long.valueOf(affiliate.getApplicationOrganId()));
addUsers.add(agentUser);
userMap.put(agentUser.getPhonenumber(), agentUser);
insertAgentUserRole(agentUser, roleId, userRoleList);
}
if (addUsers != null) {
SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest();
request.setTemplateId("1956159");
request.setPhone(agentUser.getPhonenumber());
request.setTemplateParamSet(new String[]{agentUser.getNickName()});
SmsSendRecord smsSendRecord = new SmsSendRecord();
smsSendRecord.setCaseId(caseId);
CaseApplication caseApplication = new CaseApplication();
caseApplication.setId(caseId);
smsSendRecord.setCaseNum(caseApplication.getCaseNum());
smsSendRecord.setPhone(request.getPhone());
smsSendRecord.setSendTime(new Date());
String content = "尊敬的" + agentUser.getNickName() + ",您的代理的案件已接入仲裁系统,复制访问https://miniapp-3gpama6l759911ef-1321289474.tcloudbaseapp.com/jump-mp.html 进入小程序进行认证注册。如非本人操作,请忽略本短信";
smsSendRecord.setSendContent(content);
smsSendRecord.setCreateBy(getUsername());
smsSendRecords.add(smsSendRecord);
smsRequestList.add(request);
}
}
break;
case "委托代理人电子邮件":
affiliate.setAgentEmail(StrUtil.isNotEmpty(fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId)) ? fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId).replace("\n", "").replaceAll("\\s", "") : null);
break;
default:
break;
}
}
/**
* 新增角色为申请人
*
* @param agentUser
* @param roleId
*/
private void insertAgentUserRole(SysUser agentUser, Long roleId, List<SysUserRole> userRoleList) {
SysUserRole sysUserRole = new SysUserRole();
sysUserRole.setUserId(agentUser.getUserId());
sysUserRole.setRoleId(roleId);
userRoleList.add(sysUserRole);
}
/**
* 组装被申请人内置字段
*
* @param dictData 内置字段
* @param fatchMap 抓取内容
* @param debtorAffiliate 被申请人
*/
private void buildDebtorColumn(SysDictData dictData, Map<String, String> fatchMap, CaseAffiliate debtorAffiliate, Long caseId) {
debtorAffiliate.setIdentityType(2);
// 被申请人
switch (dictData.getDictLabel()) {
case "被申请人姓名":
debtorAffiliate.setName(fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId));
break;
case "被申请人身份证号":
String identityNum = fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId);
debtorAffiliate.setIdentityNum(fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId));
// 出生年月日,从身份证抓取
if (StrUtil.isNotEmpty(identityNum)) {
identityNum = identityNum.replace("\n", "");
Map<String, String> identityNumMap = IdCardUtils.getBirAgeSex(identityNum);
String birthday = identityNumMap.get("birthday");
if (StrUtil.isNotEmpty(birthday)) {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
Date birthdayDate = null;
try {
birthdayDate = simpleDateFormat.parse(birthday);
} catch (Exception e) {
e.printStackTrace();
}
debtorAffiliate.setResponBirth(birthdayDate);
}
//从身份证抓取性别
debtorAffiliate.setResponSex(identityNumMap.get("sexCode"));
}
break;
case "被申请人住所":
debtorAffiliate.setResidenAffili(fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId));
break;
case "被申请人联系电话":
debtorAffiliate.setContactTelphone(fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId));
break;
case "被申请人电子邮件":
debtorAffiliate.setEmail(StrUtil.isNotEmpty(fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId)) ? fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId).replace("\n", "").replaceAll("\\s", "") : null);
break;
default:
break;
}
}
/**
* 获取抓取内容
*
* @param fatchRules 抓取规则
*/
private void getFatchContentList(File caseFile, Map<String, String> fatchMap, List<FatchRule> fatchRules, Long caseId) {
String fileURL = caseFile.getAbsolutePath();
if (fileURL.endsWith("txt")) {
String readerFile = ReadFileUtils.readerTxtFile(fileURL);
OCRUtils.fatchRuleGetContent(readerFile, fatchRules, fatchMap, caseId);
} else if (fileURL.endsWith("doc") || fileURL.endsWith("docx")) {
// doc,docx,text识别内容
String readerFile = null;
try {
readerFile = ReadFileUtils.readWord(fileURL);
} catch (Exception e) {
e.printStackTrace();
}
OCRUtils.fatchRuleGetContent(readerFile, fatchRules, fatchMap, caseId);
} else if (fileURL.endsWith("pdf")) {
//获取文件的页数
int fileNumPage = getFileNumPage(fileURL);
//文件转成base64
String base64 = OCRUtils.pdfConvertBase64(fileURL);
if (base64 == null) {
throw new ServiceException("pdf转base64失败");
// return false;
}
StringBuilder ocrText = new StringBuilder(); // 创建一个StringBuilder对象
for (int i = 1; i <= fileNumPage; i++) {
//对接腾讯云接口.识别里面的数据
String text = OCRUtils.pdfIdentifyText(base64, i, fatchRules);
ocrText.append(text); // 拼接当前的字符串
// 根据抓取规则截取内容
OCRUtils.fatchRuleGetContent(ocrText.toString(), fatchRules, fatchMap, caseId);
}
}
}
}
@@ -1,5 +1,7 @@
package com.ruoyi.wisdomarbitrate.service.impl;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
@@ -10,23 +12,21 @@ import com.ruoyi.common.constant.FileTransformation;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.EsignHttpResponse;
import com.ruoyi.common.core.domain.entity.SysDept;
import com.ruoyi.common.core.domain.entity.SysDictData;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.exception.EsignDemoException;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.SealUtil;
import com.ruoyi.common.utils.file.FileUploadUtils;
import com.ruoyi.system.domain.SysUserPost;
import com.ruoyi.system.mapper.SysDeptMapper;
import com.ruoyi.system.mapper.SysDictDataMapper;
import com.ruoyi.system.mapper.SysUserMapper;
import com.ruoyi.system.mapper.SysUserPostMapper;
import com.ruoyi.wisdomarbitrate.domain.CaseAttach;
import com.ruoyi.wisdomarbitrate.domain.DeptIdentify;
import com.ruoyi.wisdomarbitrate.domain.SealManage;
import com.ruoyi.wisdomarbitrate.domain.TemplateManage;
import com.ruoyi.wisdomarbitrate.domain.*;
import com.ruoyi.wisdomarbitrate.domain.vo.SealListVO;
import com.ruoyi.wisdomarbitrate.mapper.CaseAttachMapper;
import com.ruoyi.wisdomarbitrate.mapper.DeptIdentifyMapper;
import com.ruoyi.wisdomarbitrate.mapper.SealManageMapper;
import com.ruoyi.wisdomarbitrate.mapper.TemplateManageMapper;
import com.ruoyi.wisdomarbitrate.domain.vo.TemplateFatchRule;
import com.ruoyi.wisdomarbitrate.mapper.*;
import com.ruoyi.wisdomarbitrate.service.IDeptIdentifyService;
import com.ruoyi.wisdomarbitrate.utils.SignAward;
import org.springframework.beans.BeanUtils;
@@ -34,11 +34,14 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;
import com.ruoyi.wisdomarbitrate.mapper.TemplateFatchRuleMapper;
import java.io.File;
import java.io.IOException;
import java.time.LocalDate;
import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import static com.ruoyi.common.utils.PageUtils.startPage;
import static com.ruoyi.common.utils.SecurityUtils.getUsername;
@@ -60,6 +63,12 @@ public class DeptIdentifyServiceImpl implements IDeptIdentifyService {
private TemplateManageMapper templateManageMapper;
@Autowired
private SysUserPostMapper sysUserPostMapper;
@Autowired
private TemplateFatchRuleMapper templateFatchRuleMapper;
@Autowired
private FatchRuleMapper fatchRuleMapper;
@Autowired
private SysDictDataMapper dictDataMapper;
@Override
@@ -530,6 +539,109 @@ public class DeptIdentifyServiceImpl implements IDeptIdentifyService {
return null;
}
@Override
public List<FatchRule> getFatchRuleByTemplateid(TemplateManage templateManage) {
FatchRule fatchRule = new FatchRule();
fatchRule.setTemplateId(templateManage.getId());
return fatchRuleMapper.selectFatchRuleList(fatchRule);
}
@Override
@Transactional
public AjaxResult saveFatchRules(TemplateManage templateManage) {
TemplateFatchRule templateFatchRule = new TemplateFatchRule();
templateFatchRule.setTemplateId(templateManage.getId());
templateFatchRuleMapper.deleteTemplateFatchRule(templateManage.getId());
List<FatchRule> fatchRules = templateManage.getFatchRules();
Map<Object, Long> columnmap = fatchRules.stream().collect(Collectors.groupingBy(fatchRule -> fatchRule.getColumn(), Collectors.counting()));
Stream<Object> columnStream = columnmap.entrySet().stream().filter(entry -> entry.getValue() > 1).map(entry -> entry.getKey());
List<String> strlist1 = new ArrayList<>();
columnStream.forEach(column -> {
strlist1.add(column.toString());
});
if(strlist1!=null&&strlist1.size()>0){
throw new ServiceException("字段' " + String.join(",", strlist1) + " '重复");
}
Map<Object, Long> columnNamemap = fatchRules.stream().collect(Collectors.groupingBy(fatchRule -> fatchRule.getColumnName(), Collectors.counting()));
Stream<Object> columnNameStream = columnNamemap.entrySet().stream().filter(entry -> entry.getValue() > 1).map(entry -> entry.getKey());
List<String> strlist2 = new ArrayList<>();
columnNameStream.forEach(column -> {
strlist2.add(column.toString());
});
if(strlist2!=null&&strlist2.size()>0){
throw new ServiceException("字段' " + String.join(",", strlist2) + " '重复");
}
if(fatchRules!=null&&fatchRules.size()>0){
for (FatchRule fatchRule : fatchRules) {
//保存抓取规则数据
fatchRuleMapper.insertFatchRule(fatchRule);
//保存模板抓取规则关联关系
Long fatchRuleId = fatchRule.getId();
if(fatchRuleId!=null){
templateFatchRule.setFatchRuleId(fatchRuleId);
templateFatchRuleMapper.insertTemplateFatchRule(templateFatchRule);
}
}
return AjaxResult.success("新增成功");
}
return AjaxResult.error();
}
@Override
public List<FatchRule> selectColumnandComment() {
List<FatchRule> fatchRules = new ArrayList<>();
FatchRule fatchRuleselect = new FatchRule();
fatchRuleselect.setDatabaseName("test_smart_arbitration");
fatchRules = fatchRuleMapper.selectColumnandComment(fatchRuleselect);
return fatchRules;
}
@Override
public FatchRule selectColumnbycomment(FatchRule fatchRule) {
fatchRule.setDatabaseName("test_smart_arbitration");
FatchRule fatchRulesel = fatchRuleMapper.selectColumnbycomment(fatchRule);
return fatchRulesel;
}
/**
* 根据模板id查询模板字段列表
* @param templateManage
* @return
*/
@Override
public List<FatchRule> getTemplateInfoById(TemplateManage templateManage) {
FatchRule fatchRule = new FatchRule();
fatchRule.setTemplateId(templateManage.getId());
List<FatchRule> fatchRuleList = fatchRuleMapper.selectFatchRuleList(fatchRule);
if(CollectionUtil.isEmpty(fatchRuleList)){
fatchRuleList=new ArrayList<>();
}
List<String> columnNameList = fatchRuleList.stream().map(FatchRule::getColumnName).collect(Collectors.toList());
// 在系统表中查询案件内置字段
SysDictData sysDictData = new SysDictData();
sysDictData.setDictType("case_built_type");
List<SysDictData> dictDataList = dictDataMapper.selectDictDataList(sysDictData);
if(CollectionUtil.isNotEmpty(dictDataList)){
for (SysDictData dictData : dictDataList) {
if(StrUtil.isEmpty(dictData.getDictLabel())||columnNameList.contains(dictData.getDictLabel())){
continue;
}
FatchRule rule=new FatchRule();
rule.setColumn(dictData.getDictValue());
rule.setColumnName(dictData.getDictLabel());
fatchRuleList.add(rule);
}
}
return fatchRuleList;
}
private String getFileExtension(String fileName) {
int lastDotIndex = fileName.lastIndexOf(".");
if (lastDotIndex > 0 && lastDotIndex < fileName.length() - 1) {
@@ -10,6 +10,7 @@ import com.ruoyi.wisdomarbitrate.mapper.CaseLogRecordMapper;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.List;
/**
* 案件记录日志文件
@@ -46,6 +47,14 @@ public class CaseLogUtils
operLog.setNotes(notes);
caseLogRecordMapper.insertCaseLogRecord(operLog);
}
/**
* 批量新增案件日志
* @param list
*/
public static void batchInsertCaseLog(List<CaseLogRecord> list ){
caseLogRecordMapper.batchInsertRecord(list);
}
}
@@ -1,30 +1,53 @@
package com.ruoyi.wisdomarbitrate.utils;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.StrUtil;
import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.wisdomarbitrate.domain.FatchRule;
import com.tencentcloudapi.bsca.v20210811.models.LicenseSummary;
import com.tencentcloudapi.common.Credential;
import com.tencentcloudapi.common.exception.TencentCloudSDKException;
import com.tencentcloudapi.common.profile.ClientProfile;
import com.tencentcloudapi.common.profile.HttpProfile;
import com.tencentcloudapi.ocr.v20181119.OcrClient;
import com.tencentcloudapi.ocr.v20181119.models.SmartStructuralOCRV2Request;
import com.tencentcloudapi.ocr.v20181119.models.SmartStructuralOCRV2Response;
import com.tencentcloudapi.ocr.v20181119.models.*;
import org.json.JSONArray;
import org.json.JSONObject;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Base64;
import java.util.List;
import java.util.*;
import java.util.stream.Collectors;
public class OCRUtils {
//API的SecretId
private static final String SECRET_ID = "AKIDeEf2A8uX1HSainvvnXAc3X9ZlhtyvkMp";
//API的SecretKey
private static final String SECRET_KEY = "QjphKo8zkHZigT8j9PVtFPJyfIvO3d6V";
// 仲裁申请书识别字段
private static final String[] applicantName = {"申请人", "统一社会信用代码", "负责人", "住所", "联系地址"
, "委托代理人", "联系电话", "电子邮件", "被申请人", "居民身份证号码", "仲裁请求", "事实和理由"};
// 贷款合同识别字段
private static final String[] contractName = {
"合同编号", "甲方(贷款人)", "或委托代理人签字:", "本合同的初始贷款年利率为", "乙方确认有效的电子信箱地址为"};
// 调解协议识别字段
private static final String[] accordName = {"金融消费纠纷基本情况", "经调解,双方自愿达成如下协议"};
// 授权委托书识别字段
private static final String[] powerAttorneyName = {"职务"};
public static String pdfIdentifyText(String imageBase64, Integer pageNumber) {
/**
* pdf识别成文字
*
* @param imageBase64
* @param pageNumber
* @param fatchRules 抓取规则
* @return
*/
public static String pdfIdentifyText(String imageBase64, Integer pageNumber, List<FatchRule> fatchRules) {
StringBuilder respStr = new StringBuilder();
try {
// 实例化一个认证对象,入参需要传入腾讯云账户 SecretId 和 SecretKey,此处还需注意密钥对的保密
// 代码泄露可能会导致 SecretId 和 SecretKey 泄露,并威胁账号下所有资源的安全性。以下代码示例仅供参考,建议采用更安全的方式来使用密钥,请参见:https://cloud.tencent.com/document/product/1278/85305
@@ -39,49 +62,34 @@ public class OCRUtils {
// 实例化要请求产品的client对象,clientProfile是可选的
OcrClient client = new OcrClient(cred, "ap-beijing", clientProfile);
// 实例化一个请求对象,每个接口都会对应一个request对象
SmartStructuralOCRV2Request req = new SmartStructuralOCRV2Request();
GeneralAccurateOCRRequest req = new GeneralAccurateOCRRequest();
req.setImageBase64(imageBase64);
req.setIsPdf(true);
req.setPdfPageNumber(pageNumber.longValue());
String[] itemNames1 = {"申请人", "统一社会信用代码", "负责人", "住所", "联系地址"
, "委托代理人", "联系电话", "电子邮件", "被申请人", "居民身份证号码", "仲裁请求", "事实和理由"};
req.setItemNames(itemNames1);
// 返回的resp是一个SmartStructuralOCRV2Response的实例,与请求对象对应
SmartStructuralOCRV2Response resp = client.SmartStructuralOCRV2(req);
GeneralAccurateOCRResponse resp = client.GeneralAccurateOCR(req);
// 输出json格式的字符串回包
System.out.println(SmartStructuralOCRV2Response.toJsonString(resp));
//解析数据
String s = SmartStructuralOCRV2Response.toJsonString(resp);
// 解析JSON数据
JSONObject jsonObject = new JSONObject(s);
JSONArray structuralList = jsonObject.getJSONArray("StructuralList");
// 遍历StructuralList中的Groups,获取Key对应的AutoName和Value对应的AutoConten
StringBuilder stringBuilder = new StringBuilder(); // 创建一个StringBuilder对象
for (int i = 0; i < structuralList.length(); i++) {
JSONArray groups = structuralList.getJSONObject(i).getJSONArray("Groups");
for (int j = 0; j < groups.length(); j++) {
JSONArray lines = groups.getJSONObject(j).getJSONArray("Lines");
for (int k = 0; k < lines.length(); k++) {
JSONObject line = lines.getJSONObject(k);
JSONObject key = line.getJSONObject("Key");
JSONObject value = line.getJSONObject("Value");
String autoName = key.getString("AutoName");
String autoContent = value.getString("AutoContent");
String text = autoName + ":" + autoContent;
if (stringBuilder.length() > 0) {
stringBuilder.append(","); // 在已有内容的情况下添加逗号分隔符
}
stringBuilder.append(text); // 拼接当前的字符串
}
}
System.out.println(GeneralAccurateOCRResponse.toJsonString(resp));
// 获取响应内容
TextDetection[] textDetections = resp.getTextDetections();
if (textDetections == null || textDetections.length == 0) {
return respStr.toString();
}
for (TextDetection textDetection : textDetections) {
respStr.append(textDetection.getDetectedText());
}
return stringBuilder.toString(); // 获取最终的拼接结果
} catch (TencentCloudSDKException e) {
System.out.println(e.toString());
throw new ServiceException("ocr识别失败");
}
return null;
if (respStr.toString().endsWith(String.valueOf(pageNumber))) {
int lastIndexOf = respStr.toString().lastIndexOf(String.valueOf(pageNumber));
return respStr.toString().substring(0, lastIndexOf);
}
return respStr.toString();
}
public static String pdfConvertBase64(String pathUrl){
public static String pdfConvertBase64(String pathUrl) {
try {
File file = new File(pathUrl);
FileInputStream fileInputStream = new FileInputStream(file);
@@ -96,4 +104,172 @@ public class OCRUtils {
return null;
}
/**
* 根据抓取规则获取内容
*
* @param ocrText ocr识别的text
* @param fatchRules 抓取规则
* @return
*/
public static void fatchRuleGetContent(String ocrText, List<FatchRule> fatchRules, Map<String, String> fatchMap) {
if (StrUtil.isEmpty(ocrText) || CollectionUtil.isEmpty(fatchRules)) {
return;
}
for (FatchRule fatchRule : fatchRules) {
// 从后往前抓取
if (fatchRule.getFatchOrder() != null && fatchRule.getFatchOrder() == 1) {
reverseSubstringText(ocrText, fatchRule, fatchMap,null);
} else {
// 从前往后抓取
substringText(ocrText, fatchRule, fatchMap,null);
}
}
}
/**
* 根据抓取规则获取内容
*
* @param ocrText ocr识别的text
* @param fatchRules 抓取规则
* @return
*/
public static void fatchRuleGetContent(String ocrText, List<FatchRule> fatchRules, Map<String, String> fatchMap, Long caseId) {
if (StrUtil.isEmpty(ocrText) || CollectionUtil.isEmpty(fatchRules)) {
return;
}
for (FatchRule fatchRule : fatchRules) {
// 从后往前抓取
if (fatchRule.getFatchOrder() != null && fatchRule.getFatchOrder() == 1) {
reverseSubstringText(ocrText, fatchRule, fatchMap, caseId);
} else {
// 从前往后抓取
substringText(ocrText, fatchRule, fatchMap, caseId);
}
}
}
/**
* 正向截取字段
*
* @param text
* @param fatchRule
* @param fatchMap
*/
private static void substringText(String text, FatchRule fatchRule, Map<String, String> fatchMap, Long caseId) {
String startContent = fatchRule.getStartContent();
String endContent = fatchRule.getEndContent();
// 开始为空结束为空
if (StrUtil.isEmpty(startContent) && StrUtil.isEmpty(endContent)) {
fatchMap.put(fatchRule.getColumnName()+Constants.PDFSTR+caseId, trimStr(text));
} else if (StrUtil.isNotEmpty(startContent) && StrUtil.isEmpty(endContent)) {
// 开始不为空结束为空
int startContIndex = StrUtil.ordinalIndexOf(text, startContent, fatchRule.getStartContentRepeatOrder());
if (startContIndex != -1 && text.length() >= (startContIndex + startContent.length())) {
String substring = text.substring(startContIndex + startContent.length());
// 去除\n
fatchMap.put(fatchRule.getColumnName()+Constants.PDFSTR+caseId, trimStr(substring));
}
} else if (StrUtil.isEmpty(startContent) && StrUtil.isNotEmpty(endContent)) {
// 开始为空结束不为空
int endContIndex = StrUtil.ordinalIndexOf(text, endContent, fatchRule.getEndContentRepeatOrder());
if (endContIndex != -1) {
String substring = text.substring(0, endContIndex);
fatchMap.put(fatchRule.getColumnName()+Constants.PDFSTR+caseId, trimStr(substring));
}
} else if (StrUtil.isNotEmpty(startContent) && StrUtil.isNotEmpty(endContent)) {
// 开始结束不为空
int startIndexOf = StrUtil.ordinalIndexOf(text, startContent, fatchRule.getStartContentRepeatOrder());
int endIndexOf = StrUtil.ordinalIndexOf(text, endContent, fatchRule.getEndContentRepeatOrder());
if (startIndexOf != -1 && endIndexOf != -1 && endIndexOf >= (startIndexOf + startContent.length()) && text.length() >= endIndexOf) {
String substring = text.substring(startIndexOf + startContent.length(), endIndexOf);
fatchMap.put(fatchRule.getColumnName()+Constants.PDFSTR+caseId, trimStr(substring));
}
}
}
/**
* 从后往前截取字符串
*
* @param text
* @param fatchRule
* @param fatchMap
*/
public static void reverseSubstringText(String text, FatchRule fatchRule, Map<String, String> fatchMap, Long caseId) {
// 反正字符串
String reverseText = StrUtil.reverse(text);
// 结束截取字段
String reverseEndContent = "";
// 开始截取字段
String reverseStartContent = "";
if (StrUtil.isNotEmpty(fatchRule.getEndContent())) {
reverseEndContent = StrUtil.reverse(fatchRule.getEndContent());
}
if (StrUtil.isNotEmpty(fatchRule.getStartContent())) {
reverseStartContent = StrUtil.reverse(fatchRule.getStartContent());
}
// 开始和结束截取都为空
if (StrUtil.isEmpty(reverseStartContent) && StrUtil.isEmpty(reverseEndContent)) {
fatchMap.put(fatchRule.getColumnName()+Constants.PDFSTR+caseId, trimStr(text));
} else if (StrUtil.isEmpty(reverseStartContent) && StrUtil.isNotEmpty(reverseEndContent)) {
// 开始为空,结束不为空
// 根据截取的序号查找出位置
int indexOf = StrUtil.ordinalIndexOf(reverseText, reverseEndContent, fatchRule.getEndContentRepeatOrder());
if (indexOf != -1) {
String substring = reverseText.substring(0, indexOf);
if (StrUtil.isNotEmpty(substring)) {
fatchMap.put(fatchRule.getColumnName()+Constants.PDFSTR+caseId, trimStr(StrUtil.reverse(substring)));
}
}
} else if (StrUtil.isNotEmpty(reverseStartContent) && StrUtil.isEmpty(reverseEndContent)) {
// 开始不为空,结束为空
int indexOf = StrUtil.ordinalIndexOf(reverseText, reverseStartContent, fatchRule.getStartContentRepeatOrder());
if (indexOf != -1 && (indexOf + reverseStartContent.length() <= text.length())) {
String substring = reverseText.substring(indexOf + reverseStartContent.length());
if (StrUtil.isNotEmpty(substring)) {
fatchMap.put(fatchRule.getColumnName()+Constants.PDFSTR+caseId, trimStr(StrUtil.reverse(substring)));
}
}
} else if (StrUtil.isNotEmpty(reverseStartContent) && StrUtil.isNotEmpty(reverseEndContent)) {
// 开始结束都不为空
int endIndexOf = StrUtil.ordinalIndexOf(reverseText, reverseEndContent, fatchRule.getEndContentRepeatOrder());
int startIndexOf = StrUtil.ordinalIndexOf(reverseText, reverseStartContent, fatchRule.getStartContentRepeatOrder());
if (startIndexOf != -1 && endIndexOf != -1 && endIndexOf >= (startIndexOf + reverseStartContent.length()) && text.length() >= endIndexOf) {
String substring = reverseText.substring(startIndexOf + reverseStartContent.length(), endIndexOf);
if (StrUtil.isNotEmpty(substring)) {
fatchMap.put(fatchRule.getColumnName()+Constants.PDFSTR+caseId, trimStr(StrUtil.reverse(substring)));
}
}
}
}
/**
* 去除末尾空格
*
* @param substring
* @return
*/
private static String trimStr(String substring) {
if (StrUtil.isNotEmpty(substring)) {
return StrUtil.trim(substring);
} else {
return "";
}
}
}
@@ -0,0 +1,48 @@
package com.ruoyi.wisdomarbitrate.utils;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.charset.Charset;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
public class ZipFileUtils {
public static void main(String[] args) {
String file1 = "F:\\testZip\\123.pdf";
String file2 = "F:\\testZip\\456.png";
String zipFileOutPath = "F:\\testZip\\outputfile123.zip";
try {
FileOutputStream zfous = new FileOutputStream(zipFileOutPath);
ZipOutputStream zipFileOutstream = new ZipOutputStream(zfous);
FileInputStream fis1 = new FileInputStream(file1);
FileInputStream fis2 = new FileInputStream(file2);
zipFile(file1, fis1, zipFileOutstream);
zipFile(file2, fis2, zipFileOutstream);
zipFileOutstream.close();
zfous.close();
System.out.println("文件成功打包成ZIP文件!");
} catch (IOException e) {
e.printStackTrace();
}
}
public static void zipFile(String zipfilePath, FileInputStream zipFileinsteam, ZipOutputStream zipfileOut)
throws IOException {
ZipEntry zipfileEntry = new ZipEntry(new File(zipfilePath).getName());
zipfileOut.putNextEntry(zipfileEntry);
// 从输入流读取数据并写入ZIP文件
byte[] bytes = new byte[1024];
int length;
while ((length = zipFileinsteam.read(bytes)) >= 0) {
zipfileOut.write(bytes, 0, length);
}
zipfileOut.closeEntry();
zipFileinsteam.close();
}
}
@@ -121,8 +121,41 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
sysdate()
);
</insert>
<update id="updateDept" parameterType="SysDept">
<insert id="batchSave">
insert into sys_dept(
dept_id,
parent_id,
dept_name,
dept_type,
ancestors,
order_num,
leader,
phone,
email,
status,
create_by,
create_time
)values
<foreach item="item" index="index" collection="list" separator=",">
(
#{item.deptId},
#{item.parentId},
#{item.deptName},
#{item.deptType},
#{item.ancestors},
#{item.orderNum},
#{item.leader},
#{item.phone},
#{item.email},
#{item.status},
#{item.createBy},
sysdate()
)
</foreach>;
</insert>
<update id="updateDept" parameterType="SysDept">
update sys_dept
<set>
<if test="parentId != null and parentId != 0">parent_id = #{parentId},</if>
@@ -59,8 +59,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</sql>
<select id="selectUserList" parameterType="SysUser" resultMap="SysUserResult">
select u.user_id, u.dept_id, u.nick_name, u.user_name,u.id_card, u.email, u.avatar, u.phonenumber, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name, d.leader from sys_user u
select u.user_id, u.dept_id, u.nick_name, u.user_name,u.id_card, u.email, u.avatar, u.phonenumber, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name,
d.leader , r.role_id, r.role_name, d.dept_id
from sys_user u
left join sys_dept d on u.dept_id = d.dept_id
left join sys_user_role ur on u.user_id = ur.user_id
left join sys_role r on r.role_id = ur.role_id
where u.del_flag = '0'
<if test="userId != null and userId != 0">
AND u.user_id = #{userId}
@@ -244,8 +248,44 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
sysdate()
)
</insert>
<update id="updateUser" parameterType="SysUser">
<insert id="batchSave">
insert into sys_user(
user_id,
dept_id,
user_name,
nick_name,
id_card,
email,
avatar,
phonenumber,
sex,
password,
status,
create_by,
remark,
create_time
)values
<foreach item="item" index="index" collection="list" separator=",">
(
#{item.userId},
#{item.deptId},
#{item.userName},
#{item.nickName},
#{item.idCard},
#{item.email},
#{item.avatar},
#{item.phonenumber},
#{item.sex},
#{item.password},
#{item.status},
#{item.createBy},
#{item.remark},
sysdate()
)
</foreach>;
</insert>
<update id="updateUser" parameterType="SysUser">
update sys_user
<set>
<if test="deptId != null and deptId != 0">dept_id = #{deptId},</if>
@@ -14,6 +14,10 @@
<result property="verificaOpinion" column="verifica_opinion" />
<result property="checkOpinion" column="check_opinion" />
<result property="annexId" column="annex_id" />
<result property="caseFocus" column="case_focus" />
<result property="caseFacts" column="case_facts" />
<result property="respondentOpinion" column="respondent_opinion" />
<result property="applicantOpinion" column="applicant_opinion" />
</resultMap>
@@ -28,7 +32,13 @@
<if test="arbitrateThink != null and arbitrateThink != ''">arbitrate_think,</if>
<if test="checkOpinion != null and checkOpinion != ''">check_opinion,</if>
<if test="caseCheckReject != null and caseCheckReject != ''">case_check_reject,</if>
<if test="arbitrateReject != null and arbitrateReject != ''">arbitrate_reject,</if>
<if test="createBy != null and createBy != ''">create_by,</if>
case_focus,
case_facts,
respondent_opinion,
applicant_opinion,
create_time
)values(
<if test="caseAppliId != null ">#{caseAppliId},</if>
@@ -39,7 +49,13 @@
<if test="verificaOpinion != null and verificaOpinion != ''">#{verificaOpinion},</if>
<if test="arbitrateThink != null and arbitrateThink != ''">#{arbitrateThink},</if>
<if test="checkOpinion != null and checkOpinion != ''">#{checkOpinion},</if>
<if test="caseCheckReject != null and caseCheckReject != ''">#{caseCheckReject},</if>
<if test="arbitrateReject != null and arbitrateReject != ''">#{arbitrateReject},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
#{caseFocus},
#{caseFacts},
#{respondentOpinion},
#{applicantOpinion},
sysdate()
)
</insert>
@@ -55,8 +71,16 @@
<if test="rulingFollows != null and rulingFollows != ''">ruling_follows = #{rulingFollows},</if>
<if test="verificaOpinion != null and verificaOpinion != ''">verifica_opinion = #{verificaOpinion},</if>
<if test="checkOpinion != null and checkOpinion != ''">check_opinion = #{checkOpinion},</if>
<if test="arbitraCheckOpinion != null and arbitraCheckOpinion != ''">arbitra_check_opinion = #{arbitraCheckOpinion},</if>
<if test="annexId != null ">annex_id = #{annexId},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
<if test="caseFocus != null and caseFocus != ''">case_focus = #{caseFocus},</if>
<if test="caseFacts != null and caseFacts != ''">case_facts = #{caseFacts},</if>
<if test="respondentOpinion != null and respondentOpinion != ''">respondent_opinion = #{respondentOpinion},</if>
<if test="applicantOpinion != null and applicantOpinion != ''">applicant_opinion = #{applicantOpinion},</if>
<if test="caseCheckReject != null and caseCheckReject != ''">case_check_reject = #{caseCheckReject},</if>
<if test="arbitrateReject != null and arbitrateReject != ''">arbitrate_reject = #{arbitrateReject},</if>
<if test="deptorReject != null and deptorReject != ''">deptor_reject = #{deptorReject},</if>
update_time = sysdate()
</set>
where id = #{id}
@@ -65,7 +89,8 @@
<select id="selectArbitrateRecord" parameterType="ArbitrateRecord" resultMap="ArbitrateRecordResult">
SELECT a.id ,a.case_appli_id ,a.eviden_determi ,a.fact_determi ,a.case_sketch ,a.arbitrate_think ,a.ruling_follows ,
a.verifica_opinion ,a.check_opinion,a.annex_id
a.verifica_opinion ,a.check_opinion,a.annex_id,a.case_focus,a.case_facts,a.respondent_opinion,a.applicant_opinion,
a.case_check_reject ,a.arbitrate_reject,a.deptor_reject
from arbitrate_record a
<where>
<if test="caseAppliId != null ">
@@ -33,6 +33,7 @@
<result property="email" column="email" />
<result property="sendEmail" column="send_email" />
<result property="applicantAgentUserId" column="applicant_agent_user_id" />
<result property="agentEmail" column="agent_email" />
</resultMap>
<select id="selectCaseAffiliate" parameterType="CaseAffiliate" resultMap="CaseAffiliateResult">
@@ -66,7 +67,7 @@
contact_address,work_address,work_telphone ,name_agent,identity_num_agent,contact_telphone_agent,
comp_legal_person,comp_legalper_post,respon_sex ,respon_birth,
residen_affili,appli_agent_title,
contact_address_agent,email , send_email,track_num,applicant_agent_user_id) values
contact_address_agent,email , send_email,track_num,applicant_agent_user_id,agent_email) values
<foreach item="item" index="index" collection="list" separator=",">
(#{item.caseAppliLogId},#{item.identityType},#{item.applicationOrganId},#{item.applicationOrganName},#{item.name},#{item.identityNum},#{item.contactTelphone},
#{item.contactAddress},#{item.workAddress},#{item.workTelphone}, #{item.nameAgent},#{item.identityNumAgent},#{item.contactTelphoneAgent},
@@ -76,9 +77,10 @@
#{item.email},
#{item.sendEmail},
#{item.trackNum},
#{item.applicantAgentUserId}
#{item.applicantAgentUserId},
#{item.agentEmail}
)
</foreach>
</foreach>;
</insert>
@@ -113,6 +115,9 @@
residen_affili=#{residenAffili},
appli_agent_title=#{appliAgentTitle}
<if test="agentEmail !=null and agentEmail!=''">
,agent_email=#{agentEmail}
</if>
where id = #{id}
</update>
@@ -33,6 +33,7 @@
<result property="email" column="email" />
<result property="sendEmail" column="send_email" />
<result property="applicantAgentUserId" column="applicant_agent_user_id" />
<result property="agentEmail" column="agent_email" />
</resultMap>
<select id="selectCaseAffiliate" parameterType="CaseAffiliate" resultMap="CaseAffiliateResult">
@@ -83,7 +84,7 @@
contact_address,work_address,work_telphone ,name_agent,identity_num_agent,contact_telphone_agent,
comp_legal_person,comp_legalper_post,respon_sex ,respon_birth,
residen_affili,appli_agent_title,
contact_address_agent,email, send_email,track_num,applicant_agent_user_id) values
contact_address_agent,email, send_email,track_num,applicant_agent_user_id,agent_email) values
<foreach item="item" index="index" collection="list" separator=",">
(#{item.caseAppliId},#{item.identityType},#{item.applicationOrganId},#{item.applicationOrganName},#{item.name},#{item.identityNum},#{item.contactTelphone},
#{item.contactAddress},#{item.workAddress},#{item.workTelphone}, #{item.nameAgent},#{item.identityNumAgent},#{item.contactTelphoneAgent},
@@ -93,7 +94,8 @@
#{item.email},
#{item.sendEmail},
#{item.trackNum},
#{item.applicantAgentUserId}
#{item.applicantAgentUserId},
#{item.agentEmail}
)
</foreach>
</insert>
@@ -128,6 +130,10 @@
respon_birth=#{responBirth},
residen_affili=#{residenAffili},
appli_agent_title=#{appliAgentTitle}
<if test="agentEmail !=null and agentEmail!=''">
,agent_email=#{agentEmail}
</if>
where id = #{id}
</update>
@@ -161,6 +167,10 @@
respon_birth=#{item.responBirth},
residen_affili=#{item.residenAffili},
appli_agent_title=#{item.appliAgentTitle}
<if test="agentEmail !=null and agentEmail!=''">
,agent_email=#{agentEmail}
</if>
</set>
where case_appli_id = #{caseAppliId} and identity_type= #{item.identityType};
</foreach>
@@ -49,9 +49,18 @@
<result property="version" column="version" />
<result property="updateSubmitStatus" column="update_submit_status" />
<result property="properPreser" column="proper_preser" />
<result property="interestRate" column="interest_rate" />
<result property="outstandingMoney" column="outstanding_money" />
<result property="facts" column="facts" />
<result property="partyA" column="party_a" />
<result property="disputes" column="disputes" />
<result property="loanType" column="loan_type" />
<result property="loanTerm" column="loan_term" />
<result property="mediationAgreement" column="mediation_agreement" />
</resultMap>
<insert id="insert" parameterType="com.ruoyi.wisdomarbitrate.domain.CaseApplication" useGeneratedKeys="true" keyProperty="id">
insert into case_application_log(
<if test="caseLogId != null ">id ,</if>
<if test="caseAppliId != null ">case_appli_id ,</if>
<if test="caseName != null and caseName != ''">case_name ,</if>
<if test="caseNum != null and caseNum != ''">case_num,</if>
@@ -71,8 +80,17 @@
<if test="version != null ">version,</if>
<if test="updateSubmitStatus != null ">update_submit_status,</if>
<if test="properPreser != null ">proper_preser,</if>
interest_rate,
outstanding_money,
facts,
party_a,
disputes,
loan_type,
loan_term,
mediation_agreement,
create_time
)values(
<if test="caseLogId != null ">#{id} ,</if>
<if test="caseAppliId != null">#{caseAppliId},</if>
<if test="caseName != null and caseName != ''">#{caseName},</if>
<if test="caseNum != null and caseNum != ''">#{caseNum},</if>
@@ -92,9 +110,79 @@
<if test="version != null ">#{version},</if>
<if test="updateSubmitStatus != null ">#{updateSubmitStatus},</if>
<if test="properPreser != null ">#{properPreser},</if>
#{interestRate},
#{outstandingMoney},
#{facts},
#{partyA},
#{disputes},
#{loanType},
#{loanTerm},
#{mediationAgreement},
sysdate()
)
</insert>
<insert id="batchSave">
insert into case_application_log(
id,
case_appli_id ,
case_name ,
case_num,
case_subject_amount,
arbitrat_claims,
request_rule,
loan_start_date,
loan_end_date,
claim_princi_owed,
claim_interest_owed,
claim_liquid_damag,
fee_payable,
contract_number,
create_by,
version,
update_submit_status,
proper_preser,
interest_rate,
outstanding_money,
facts,
party_a,
disputes,
loan_type,
loan_term,
mediation_agreement,
create_time
)values
<foreach item="item" index="index" collection="list" separator=",">
(
id=#{item.id},
#{item.caseAppliId},
#{item.caseName},
#{item.caseNum},
#{item.caseSubjectAmount},
#{item.arbitratClaims},
#{item.requestRule},
#{item.loanStartDate},
#{item.loanEndDate},
#{item.claimPrinciOwed},
#{item.claimInterestOwed},
#{item.claimLiquidDamag},
#{item.feePayable},
#{item.contractNumber},
#{item.createBy},
#{item.version},
#{item.updateSubmitStatus},
#{item.properPreser},
#{item.interestRate},
#{item.outstandingMoney},
#{item.facts},
#{item.partyA},
#{item.disputes},
#{item.loanType},
#{item.loanTerm},
#{item.mediationAgreement},
sysdate()
)
</foreach>
</insert>
<update id="updateStatus">
update case_application_log
@@ -121,7 +209,13 @@
#{id}
</foreach>
);
delete a from case_attach_log a
join case_application_log l on l.id=a.case_appli_log_id
where l.id in (
<foreach collection="ids" item="id" separator=",">
#{id}
</foreach>
);
delete from case_application_log l where l.id in (
<foreach collection="ids" item="id" separator=",">
#{id}
@@ -133,7 +227,14 @@
<select id="selectByCaseIdAndVersion" resultMap="CaseApplicationResult">
SELECT case_appli_id id,id caseLogId,case_appli_id caseAppliId ,case_name,case_num,case_subject_amount,arbitrat_claims,request_rule,loan_start_date,
loan_end_date,claim_princi_owed,claim_interest_owed,claim_liquid_damag,fee_payable,contract_number,
create_by,version,update_submit_status,create_time,proper_preser
create_by,version,update_submit_status,create_time,proper_preser, interest_rate,
outstanding_money,
facts,
party_a,
disputes,
loan_type,
loan_term,
mediation_agreement
FROM case_application_log
WHERE case_appli_id = #{caseAppliId} and version=#{version}
</select>
@@ -141,7 +242,14 @@
<select id="selectLatestCase" resultMap="CaseApplicationResult">
SELECT id caseLogId,case_appli_id caseAppliId ,case_name,case_num,case_subject_amount,arbitrat_claims,request_rule,loan_start_date,
loan_end_date,claim_princi_owed,claim_interest_owed,claim_liquid_damag,fee_payable,contract_number,
create_by,version,update_submit_status,create_time,proper_preser
create_by,version,update_submit_status,create_time,proper_preser, interest_rate,
outstanding_money,
facts,
party_a,
disputes,
loan_type,
loan_term,
mediation_agreement
FROM case_application_log
WHERE case_appli_id = #{caseAppliId} ORDER BY version DESC limit 1
</select>
@@ -159,7 +267,14 @@
<select id="selectBeforeCase" resultMap="CaseApplicationResult">
SELECT case_appli_id id,id caseLogId,case_appli_id caseAppliId ,case_name,case_num,case_subject_amount,arbitrat_claims,request_rule,loan_start_date,
loan_end_date,claim_princi_owed,claim_interest_owed,claim_liquid_damag,fee_payable,contract_number,
create_by,version,update_submit_status,create_time,proper_preser
create_by,version,update_submit_status,create_time,proper_preser, interest_rate,
outstanding_money,
facts,
party_a,
disputes,
loan_type,
loan_term,
mediation_agreement
FROM case_application_log
WHERE case_appli_id = #{caseId} and version &lt; #{version} and update_submit_status not in ( 4, 5 ) order by version desc limit 1
</select>
@@ -46,6 +46,10 @@
<result property="properPreser" column="proper_preser" />
<result property="adjudicaCounter" column="adjudica_counter" />
<result property="lockStatus" column="lock_status" />
<result property="facts" column="facts" />
<result property="batchNumber" column="batch_number" />
<result property="mediationAgreement" column="mediation_agreement" />
</resultMap>
@@ -55,7 +59,7 @@
t1.loan_start_date,t1.loan_end_date,t1.claim_princi_owed,t1.claim_interest_owed,t1.claim_liquid_damag,t1.fee_payable,
t1.begin_video_date,t1.online_video_person,t1.contract_number,t1.create_by,t1.create_time,t1.update_by,t1.update_time,
t1.arbitrator_name,t1.name,t1.application_organ_id,t1.applicantName,t1.arbitrator_id,t1.identity_num,t1.identity_type,
t1.filearbitra_url,t1.lock_status,t1.version,t1.updateSubmitStatus
t1.filearbitra_url,t1.lock_status,t1.version,t1.updateSubmitStatus,t1.batch_number
from(
<trim suffixOverrides="union">
<!--申请人,被申请人,仲裁员,部门长,财务,代理人案件-->
@@ -68,19 +72,20 @@
t.begin_video_date ,t.online_video_person ,t.contract_number ,t.create_by ,t.create_time ,
t.update_by ,t.update_time , t.arbitrator_name,t.name,t.application_organ_id,t.applicantName,
t.arbitrator_id,t.identity_num ,
t.identity_type,t.filearbitra_url,t.lock_status,t.version,t.updateSubmitStatus
t.identity_type,t.filearbitra_url,t.lock_status,t.version,t.updateSubmitStatus,t.batch_number
from(
select c.id ,'' AS caseLogId,c.case_num ,c.case_subject_amount ,c.register_date ,c.arbitrat_method ,
CASE c.arbitrat_method when 1 then '开庭审理' when 2 then '书面审理'
ELSE '无审理方式'
END arbitratMethodName,
c.case_status ,
CASE c.case_status when 0 then '立案申请' when 1 then '待立案审查' when 2 then '待缴费'
CASE c.case_status when 0 then '立案申请' when 1 then '待立案审查' when 2 then '待缴费'
when 3 then '待缴费确认' when 4 then '待案件质证' when 5 then '待组庭审核'
when 6 then '待组庭确定' when 7 then '待审核仲裁方式' when 8 then '待开庭审理'
when 9 then '待书面审理' when 10 then '待生成仲裁文书' when 11 then '待核验仲裁文书'
when 12 then '待审核仲裁文书' when 13 then '待仲裁文书签名' when 14 then '待仲裁文书用印'
when 12 then '待部门长审核仲裁文书' when 13 then '待仲裁文书签名' when 14 then '待仲裁文书用印'
when 15 then '待仲裁文书送达' when 16 then '待案件归档' when 17 then '已归档'
when 18 then '待仲裁员审核仲裁文书'
when 31 then '待修改开庭时间'
ELSE '无案件状态'
END caseStatusName,
@@ -91,7 +96,7 @@
c.update_by ,c.update_time , c.arbitrator_name,ca.name,ca.application_organ_id,ca.application_organ_name
as applicantName,
c.arbitrator_id,ca.identity_num ,ca.identity_type,c.filearbitra_url,c.lock_status,c.version,null as
updateSubmitStatus
updateSubmitStatus,c.batch_number
from case_application c
JOIN case_affiliate ca ON ca.case_appli_id = c.id
<!--查询条件-->
@@ -120,12 +125,15 @@
<!--根据角色和状态过滤-->
<!--被申请人-->
<if test="idCard != null and idCard != ''">
or (t.identity_num=#{idCard} AND t.identity_type=2 and (t.case_status=4 or t.case_status=17))
or (t.identity_num=#{idCard} AND t.identity_type=2
<!-- and (t.case_status=4 or t.case_status=17) -->
)
</if>
<!--仲裁员-->
<if test="userId != null and userId != ''">
or ( t.identity_type=1 and
t.case_status in (7,11,13,17)
<!-- or ( t.identity_type=1 and
t.case_status in (7,13,17,18) -->
or (t.identity_type=1
and
instr (t.arbitrator_id,#{userId})>0)
</if>
@@ -138,14 +146,17 @@
<!-- </if>-->
<!--部门长-->
<if test="deptHeadStatus != null and deptHeadStatus.size() > 0">
or (t.identity_type=1 and t.case_status in
or (t.identity_type=1)
<!--and t.case_status in
<foreach item="caseStatus" collection="deptHeadStatus" open="(" separator="," close=")">
#{caseStatus}
</foreach>)
</foreach>)-->
</if>
<!--财务-->
<if test="financeStatus != null and financeStatus != ''">
or (t.identity_type=1 and t.case_status =#{financeStatus})
or (t.identity_type=1
<!-- and t.case_status =#{financeStatus}-->
)
</if>
@@ -156,7 +167,8 @@
<foreach item="deptId" collection="agentDeptIds" open="(" separator="," close=")">#{deptId}
</foreach>
AND t.identity_type=1
and t.case_status in (0,9))
<!-- and t.case_status in (0,9)-->
)
</if>
</where>
@@ -171,12 +183,13 @@
ELSE '无审理方式'
END arbitratMethodName,
c.case_status ,
CASE c.case_status when 0 then '立案申请' when 1 then '待立案审查' when 2 then '待缴费'
CASE c.case_status when 0 then '立案申请' when 1 then '待立案审查' when 2 then '待缴费'
when 3 then '待缴费确认' when 4 then '待案件质证' when 5 then '待组庭审核'
when 6 then '待组庭确定' when 7 then '待审核仲裁方式' when 8 then '待开庭审理'
when 9 then '待书面审理' when 10 then '待生成仲裁文书' when 11 then '待核验仲裁文书'
when 12 then '待审核仲裁文书' when 13 then '待仲裁文书签名' when 14 then '待仲裁文书用印'
when 12 then '待部门长审核仲裁文书' when 13 then '待仲裁文书签名' when 14 then '待仲裁文书用印'
when 15 then '待仲裁文书送达' when 16 then '待案件归档' when 17 then '已归档'
when 18 then '待仲裁员审核仲裁文书'
when 31 then '待修改开庭时间'
ELSE '无案件状态'
END caseStatusName,
@@ -190,12 +203,13 @@
c.arbitrator_id,ca.identity_num , ca.identity_type,c.filearbitra_url,c.lock_status,(select version from
case_application_log where case_appli_id=c.id order by version desc limit 1) as version,(select
update_submit_status from case_application_log where case_appli_id=c.id order by version desc limit 1)
as updateSubmitStatus
as updateSubmitStatus,c.batch_number
from case_application c
JOIN case_affiliate ca ON ca.case_appli_id =c.id AND ca.identity_type = 1
<where>
(c.case_status &lt;= 10 or c.case_status=31) AND ca.identity_type=1
<!--(c.case_status &lt;= 10 or c.case_status=31) AND-->
ca.identity_type=1
<if test="applicationOrganId != null and applicationOrganId != ''">
AND ca.application_organ_id = #{applicationOrganId}
@@ -238,44 +252,14 @@
c.case_status,
CASE
c.case_status
WHEN 0 THEN
'立案申请'
WHEN 1 THEN
'待立案审查'
WHEN 2 THEN
'待缴费'
WHEN 3 THEN
'待缴费确认'
WHEN 4 THEN
'待案件质证'
WHEN 5 THEN
'待组庭审核'
WHEN 6 THEN
'待组庭确定'
WHEN 7 THEN
'待审核仲裁方式'
WHEN 8 THEN
'待开庭审理'
WHEN 9 THEN
'待书面审理'
WHEN 10 THEN
'待生成仲裁文书'
WHEN 11 THEN
'待核验仲裁文书'
WHEN 12 THEN
'待审核仲裁文书'
WHEN 13 THEN
'待仲裁文书签名'
WHEN 14 THEN
'待仲裁文书用印'
WHEN 15 THEN
'待仲裁文书送达'
WHEN 16 THEN
'待案件归档'
WHEN 17 THEN
'已归档'
WHEN 31 THEN
'待修改开庭时间' ELSE '无案件状态'
when 0 then '立案申请' when 1 then '待立案审查' when 2 then '待缴费'
when 3 then '待缴费确认' when 4 then '待案件质证' when 5 then '待组庭审核'
when 6 then '待组庭确定' when 7 then '待审核仲裁方式' when 8 then '待开庭审理'
when 9 then '待书面审理' when 10 then '待生成仲裁文书' when 11 then '待核验仲裁文书'
when 12 then '待部门长审核仲裁文书' when 13 then '待仲裁文书签名' when 14 then '待仲裁文书用印'
when 15 then '待仲裁文书送达' when 16 then '待案件归档' when 17 then '已归档'
when 18 then '待仲裁员审核仲裁文书'
when 31 then '待修改开庭时间' ELSE '无案件状态'
END caseStatusName,
c.hear_date,
c.arbitrat_claims,
@@ -299,7 +283,8 @@
c.arbitrator_id,ca.identity_num ,ca.identity_type,
c.filearbitra_url,
c.lock_status,c.version,
null as updateSubmitStatus
null as updateSubmitStatus,
c.batch_number
FROM
case_application c
JOIN case_affiliate ca ON ca.case_appli_id = c.id AND ca.identity_type = 1
@@ -315,7 +300,7 @@
WHERE
ca.identity_type=1
and c.case_status in (1,5,8,9,14,15,16,17,31)
<!-- and c.case_status in (1,5,8,9,11,14,15,16,17,31)-->
<!-- <if test="deptIds != null and deptIds.size() > 0">
and ca.application_organ_id in
@@ -365,44 +350,14 @@
c.case_status,
CASE
c.case_status
WHEN 0 THEN
'立案申请'
WHEN 1 THEN
'待立案审查'
WHEN 2 THEN
'待缴费'
WHEN 3 THEN
'待缴费确认'
WHEN 4 THEN
'待案件质证'
WHEN 5 THEN
'待组庭审核'
WHEN 6 THEN
'待组庭确定'
WHEN 7 THEN
'待审核仲裁方式'
WHEN 8 THEN
'待开庭审理'
WHEN 9 THEN
'待书面审理'
WHEN 10 THEN
'待生成仲裁文书'
WHEN 11 THEN
'待核验仲裁文书'
WHEN 12 THEN
'待审核仲裁文书'
WHEN 13 THEN
'待仲裁文书签名'
WHEN 14 THEN
'待仲裁文书用印'
WHEN 15 THEN
'待仲裁文书送达'
WHEN 16 THEN
'待案件归档'
WHEN 17 THEN
'已归档'
WHEN 31 THEN
'待修改开庭时间' ELSE '无案件状态'
when 0 then '立案申请' when 1 then '待立案审查' when 2 then '待缴费'
when 3 then '待缴费确认' when 4 then '待案件质证' when 5 then '待组庭审核'
when 6 then '待组庭确定' when 7 then '待审核仲裁方式' when 8 then '待开庭审理'
when 9 then '待书面审理' when 10 then '待生成仲裁文书' when 11 then '待核验仲裁文书'
when 12 then '待部门长审核仲裁文书' when 13 then '待仲裁文书签名' when 14 then '待仲裁文书用印'
when 15 then '待仲裁文书送达' when 16 then '待案件归档' when 17 then '已归档'
when 18 then '待仲裁员审核仲裁文书'
when 31 then '待修改开庭时间' ELSE '无案件状态'
END caseStatusName,
c.hear_date,
c.arbitrat_claims,
@@ -424,7 +379,7 @@
ca.application_organ_id ,
ca.application_organ_name AS applicantName,
c.arbitrator_id,ca.identity_num ,ca.identity_type,
c.filearbitra_url,c.lock_status,l.version,l.update_submit_status as updateSubmitStatus
c.filearbitra_url,c.lock_status,l.version,l.update_submit_status as updateSubmitStatus,c.batch_number
FROM
case_application c
JOIN case_application_log l ON c.id = l.case_appli_id
@@ -474,7 +429,12 @@
<if test="caseStatus != null">
AND tt2.case_status = #{caseStatus}
</if>
<if test="caseStatusList != null and caseStatusList.size() > 0">
and tt2.case_status in
<foreach item="caseStatus" collection="caseStatusList" open="(" separator="," close=")">
#{caseStatus}
</foreach>
</if>
</where>
</if>
@@ -491,12 +451,13 @@
ELSE '无审理方式'
END arbitratMethodName,
c.case_status ,
CASE c.case_status when 0 then '立案申请' when 1 then '待立案审查' when 2 then '待缴费'
CASE c.case_status when 0 then '立案申请' when 1 then '待立案审查' when 2 then '待缴费'
when 3 then '待缴费确认' when 4 then '待案件质证' when 5 then '待组庭审核'
when 6 then '待组庭确定' when 7 then '待审核仲裁方式' when 8 then '待开庭审理'
when 9 then '待书面审理' when 10 then '待生成仲裁文书' when 11 then '待核验仲裁文书'
when 12 then '待审核仲裁文书' when 13 then '待仲裁文书签名' when 14 then '待仲裁文书用印'
when 12 then '待部门长审核仲裁文书' when 13 then '待仲裁文书签名' when 14 then '待仲裁文书用印'
when 15 then '待仲裁文书送达' when 16 then '待案件归档' when 17 then '已归档'
when 18 then '待仲裁员审核仲裁文书'
when 31 then '待修改开庭时间'
ELSE '无案件状态'
END caseStatusName,
@@ -550,8 +511,9 @@
when 3 then '待缴费确认' when 4 then '待案件质证' when 5 then '待组庭审核'
when 6 then '待组庭确定' when 7 then '待审核仲裁方式' when 8 then '待开庭审理'
when 9 then '待书面审理' when 10 then '待生成仲裁文书' when 11 then '待核验仲裁文书'
when 12 then '待审核仲裁文书' when 13 then '待仲裁文书签名' when 14 then '待仲裁文书用印'
when 12 then '待部门长审核仲裁文书' when 13 then '待仲裁文书签名' when 14 then '待仲裁文书用印'
when 15 then '待仲裁文书送达' when 16 then '待案件归档' when 17 then '已归档'
when 18 then '待仲裁员审核仲裁文书'
when 31 then '待修改开庭时间'
ELSE '无案件状态'
END caseStatusName,
@@ -660,6 +622,7 @@
sum( case when t1.case_status=15 then 1 else 0 end) caseApplyAwardSend,
sum( case when t1.case_status=16 then 1 else 0 end) caseApplyStored,
sum( case when t1.case_status=17 then 1 else 0 end) caseApplyArchived,
sum( case when t1.case_status=18 then 1 else 0 end) arbitratorApplyAwardConfirm,
sum( case when t1.case_status=31 then 1 else 0 end) updateOnlineHearDate
from(
<trim suffixOverrides="union">
@@ -693,7 +656,7 @@
<!--仲裁员-->
<if test="userId != null and userId != ''">
or ( t.identity_type=1 and
t.case_status in (7,11,13,17)
t.case_status in (7,13,17,18)
and
instr (t.arbitrator_id,#{userId})>0)
</if>
@@ -788,7 +751,7 @@
WHERE
ca.identity_type=1
and c.case_status in (1,5,8,9,14,15,16,17,31)
and c.case_status in (1,5,8,9,11,14,15,16,17,31)
<!-- <if test="deptIds != null and deptIds.size() > 0">
and ca.application_organ_id in
<foreach item="item" collection="deptIds" open="(" separator="," close=")">
@@ -832,12 +795,13 @@
ELSE '无审理方式'
END arbitratMethodName,
c.case_status ,
CASE c.case_status when 0 then '立案申请' when 1 then '待立案审查' when 2 then '待缴费'
CASE c.case_status when 0 then '立案申请' when 1 then '待立案审查' when 2 then '待缴费'
when 3 then '待缴费确认' when 4 then '待案件质证' when 5 then '待组庭审核'
when 6 then '待组庭确定' when 7 then '待审核仲裁方式' when 8 then '待开庭审理'
when 9 then '待书面审理' when 10 then '待生成仲裁文书' when 11 then '待核验仲裁文书'
when 12 then '待审核仲裁文书' when 13 then '待仲裁文书签名' when 14 then '待仲裁文书用印'
when 12 then '待部门长审核仲裁文书' when 13 then '待仲裁文书签名' when 14 then '待仲裁文书用印'
when 15 then '待仲裁文书送达' when 16 then '待案件归档' when 17 then '已归档'
when 18 then '待仲裁员审核仲裁文书'
when 31 then '待修改开庭时间'
ELSE '无案件状态'
END caseStatusName,
@@ -847,7 +811,7 @@
c.update_by ,c.update_time , c.arbitrator_name,ca.application_organ_id applicationOrganId ,ca.application_organ_name as applicantName,c.filearbitra_url,(select version from
case_application_log where case_appli_id=c.id order by version desc limit 1) as version,(select
update_submit_status from case_application_log where case_appli_id=c.id order by version desc limit 1)
as updateSubmitStatus
as updateSubmitStatus,c.batch_number
from case_application c
JOIN case_affiliate ca ON ca.case_appli_id = c.id AND ca.identity_type=1
JOIN case_application_log l ON c.id = l.case_appli_id and c.version=l.version
@@ -894,6 +858,7 @@
sum( case when c.case_status=15 then 1 else 0 end) caseApplyAwardSend,
sum( case when c.case_status=16 then 1 else 0 end) caseApplyStored,
sum( case when c.case_status=17 then 1 else 0 end) caseApplyArchived,
sum( case when c.case_status=18 then 1 else 0 end) arbitratorApplyAwardConfirm,
sum( case when c.case_status=31 then 1 else 0 end) updateOnlineHearDate
FROM
case_application c
@@ -919,6 +884,7 @@
15,
16,
17,
18,
31
)
@@ -933,420 +899,9 @@
</if>
</where>
</select>
<select id="selectApplicationCase" resultMap="CaseApplicationResult">
SELECT
l.case_appli_id id,
l.id AS caseLogId,
l.version,
l.case_num,
l.case_subject_amount,
c.register_date,
c.arbitrat_method,
CASE
c.arbitrat_method
WHEN 1 THEN
'开庭审理'
WHEN 2 THEN
'书面审理' ELSE '无审理方式'
END arbitratMethodName,
c.case_status,
CASE
c.case_status
WHEN 0 THEN
'立案申请'
WHEN 1 THEN
'待立案审查'
WHEN 2 THEN
'待缴费'
WHEN 3 THEN
'待缴费确认'
WHEN 4 THEN
'待案件质证'
WHEN 5 THEN
'待组庭审核'
WHEN 6 THEN
'待组庭确定'
WHEN 7 THEN
'待审核仲裁方式'
WHEN 8 THEN
'待开庭审理'
WHEN 9 THEN
'待书面审理'
WHEN 10 THEN
'待生成仲裁文书'
WHEN 11 THEN
'待核验仲裁文书'
WHEN 12 THEN
'待审核仲裁文书'
WHEN 13 THEN
'待仲裁文书签名'
WHEN 14 THEN
'待仲裁文书用印'
WHEN 15 THEN
'待仲裁文书送达'
WHEN 16 THEN
'待案件归档'
WHEN 17 THEN
'已归档'
WHEN 31 THEN
'待修改开庭时间' ELSE '无案件状态'
END caseStatusName,
c.hear_date,
l.arbitrat_claims,
l.loan_start_date,
l.loan_end_date,
l.claim_princi_owed,
l.claim_interest_owed,
l.claim_liquid_damag,
l.fee_payable,
c.begin_video_date,
c.online_video_person,
l.contract_number,
l.create_by,
c.create_time,
c.lock_status,
l.update_by,
l.update_time,
c.arbitrator_name,
ca.application_organ_id applicationOrganId,
ca.application_organ_name AS applicantName,
c.filearbitra_url,l.update_submit_status as updateSubmitStatus,l.case_name
FROM
case_application c
JOIN case_application_log l ON c.id = l.case_appli_id
JOIN case_affiliate_log ca ON ca.case_appli_log_id = l.id
AND ca.identity_type = 1
WHERE
ca.identity_type=1
<if test="applicationOrganId != null and applicationOrganId != ''">
or ( t.application_organ_id = #{applicationOrganId} AND t.identity_type=1
<!--暂时改为可以查询到生成裁决书之前所有的案件状态-->
and (t.case_status &lt;= 10 or t.case_status=31))
<!-- and t.case_status in (0,2,17))-->
</if>
<if test="caseStatus != null">
AND c.case_status = #{caseStatus}
</if>
<if test="lockStatus != null">
AND c.lock_status = #{lockStatus}
</if>
<if test="caseNum != null and caseNum != ''">
AND c.case_num = #{caseNum}
</if>
<if test="nameId != null and nameId != ''">
AND ca.application_organ_id=#{nameId} AND ca.identity_type=1
</if>
<!-- <if test="caseStatusList != null and caseStatusList.size() > 0">-->
<!-- and c.case_status in (1,5)-->
<!-- </if>-->
<!-- 查询该案件的最新记录 -->
AND l.version = (
SELECT
max( version ) version
FROM
case_application_log
WHERE case_appli_id = t.id
update_submit_status IN ( 1, 2 ))
order by c.create_time desc,c.case_num desc
</select>
<select id="selectSecretaryCase" parameterType="CaseApplication" resultMap="CaseApplicationResult">
SELECT
t.id,
t.caseLogId,
max( version ) version,
t.case_num,
t.case_subject_amount,
t.register_date,
t.arbitrat_method,
t.caseStatusName,
t.hear_date,
t.arbitrat_claims,
t.loan_start_date,
t.loan_end_date,
t.claim_princi_owed,
t.claim_interest_owed,
t.claim_liquid_damag,
t.fee_payable,
t.begin_video_date,
t.online_video_person,
t.contract_number,
t.create_by,
t.create_time,
t.lock_status,
t.update_by,
t.update_time,
t.arbitrator_name,
t.applicationOrganId,
t.applicantName,
t.filearbitra_url,
t.updateSubmitStatus,t.case_name
FROM
(
<!-- 查询案件主表 -->
SELECT
c.id,
'' AS caseLogId,
c.version,
c.case_num,
c.case_subject_amount,
c.register_date,
c.arbitrat_method,
CASE
c.arbitrat_method
WHEN 1 THEN
'开庭审理'
WHEN 2 THEN
'书面审理' ELSE '无审理方式'
END arbitratMethodName,
c.case_status,
CASE
c.case_status
WHEN 0 THEN
'立案申请'
WHEN 1 THEN
'待立案审查'
WHEN 2 THEN
'待缴费'
WHEN 3 THEN
'待缴费确认'
WHEN 4 THEN
'待案件质证'
WHEN 5 THEN
'待组庭审核'
WHEN 6 THEN
'待组庭确定'
WHEN 7 THEN
'待审核仲裁方式'
WHEN 8 THEN
'待开庭审理'
WHEN 9 THEN
'待书面审理'
WHEN 10 THEN
'待生成仲裁文书'
WHEN 11 THEN
'待核验仲裁文书'
WHEN 12 THEN
'待审核仲裁文书'
WHEN 13 THEN
'待仲裁文书签名'
WHEN 14 THEN
'待仲裁文书用印'
WHEN 15 THEN
'待仲裁文书送达'
WHEN 16 THEN
'待案件归档'
WHEN 17 THEN
'已归档'
WHEN 31 THEN
'待修改开庭时间' ELSE '无案件状态'
END caseStatusName,
c.hear_date,
c.arbitrat_claims,
c.loan_start_date,
c.loan_end_date,
c.claim_princi_owed,
c.claim_interest_owed,
c.claim_liquid_damag,
c.fee_payable,
c.begin_video_date,
c.online_video_person,
c.contract_number,
c.create_by,
c.create_time,
c.lock_status,
c.update_by,
c.update_time,
c.arbitrator_name,
ca.application_organ_id applicationOrganId,
ca.application_organ_name AS applicantName,
c.filearbitra_url,null as updateSubmitStatus,c.case_name
FROM
case_application c
JOIN case_affiliate ca ON ca.case_appli_id = c.id AND ca.identity_type = 1
JOIN case_application_log l on l.case_appli_id=c.id and l.update_submit_status not in(1, 2) and l.version = (
SELECT
max( version ) version
FROM
case_application_log
WHERE case_appli_id = c.id
update_submit_status IN ( 1, 2 ))
WHERE
ca.identity_type=1 and c.case_status in (1,5)
<if test="deptIds != null and deptIds.size() > 0">
and ca.application_organ_id in
<foreach item="item" collection="deptIds" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="caseStatus != null">
AND c.case_status = #{caseStatus}
</if>
<if test="lockStatus != null">
AND c.lock_status = #{lockStatus}
</if>
<if test="caseNum != null and caseNum != ''">
AND c.case_num = #{caseNum}
</if>
<if test="nameId != null and nameId != ''">
AND ca.application_organ_id=#{nameId} AND ca.identity_type=1
</if>
UNION
<!-- 查询案件记录表修改提交申请和撤销申请的案件 -->
SELECT
l.case_appli_id id,
l.id AS caseLogId,
l.version,
l.case_num,
l.case_subject_amount,
c.register_date,
c.arbitrat_method,
CASE
c.arbitrat_method
WHEN 1 THEN
'开庭审理'
WHEN 2 THEN
'书面审理' ELSE '无审理方式'
END arbitratMethodName,
c.case_status,
CASE
c.case_status
WHEN 0 THEN
'立案申请'
WHEN 1 THEN
'待立案审查'
WHEN 2 THEN
'待缴费'
WHEN 3 THEN
'待缴费确认'
WHEN 4 THEN
'待案件质证'
WHEN 5 THEN
'待组庭审核'
WHEN 6 THEN
'待组庭确定'
WHEN 7 THEN
'待审核仲裁方式'
WHEN 8 THEN
'待开庭审理'
WHEN 9 THEN
'待书面审理'
WHEN 10 THEN
'待生成仲裁文书'
WHEN 11 THEN
'待核验仲裁文书'
WHEN 12 THEN
'待审核仲裁文书'
WHEN 13 THEN
'待仲裁文书签名'
WHEN 14 THEN
'待仲裁文书用印'
WHEN 15 THEN
'待仲裁文书送达'
WHEN 16 THEN
'待案件归档'
WHEN 17 THEN
'已归档'
WHEN 31 THEN
'待修改开庭时间' ELSE '无案件状态'
END caseStatusName,
c.hear_date,
l.arbitrat_claims,
l.loan_start_date,
l.loan_end_date,
l.claim_princi_owed,
l.claim_interest_owed,
l.claim_liquid_damag,
l.fee_payable,
c.begin_video_date,
c.online_video_person,
l.contract_number,
l.create_by,
c.create_time,
c.lock_status,
l.update_by,
l.update_time,
c.arbitrator_name,
ca.application_organ_id applicationOrganId,
ca.application_organ_name AS applicantName,
c.filearbitra_url,l.update_submit_status as updateSubmitStatus,l.case_name
FROM
case_application c
JOIN case_application_log l ON c.id = l.case_appli_id
JOIN case_affiliate_log ca ON ca.case_appli_log_id = l.id
AND ca.identity_type = 1
WHERE
l.update_submit_status IN ( 1, 2 ) and ca.identity_type=1
<if test="deptIds != null and deptIds.size() > 0">
and ca.application_organ_id in
<foreach item="item" collection="deptIds" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="caseStatus != null">
AND c.case_status = #{caseStatus}
</if>
<if test="lockStatus != null">
AND c.lock_status = #{lockStatus}
</if>
<if test="caseNum != null and caseNum != ''">
AND c.case_num = #{caseNum}
</if>
<if test="nameId != null and nameId != ''">
AND ca.application_organ_id=#{nameId} AND ca.identity_type=1
</if>
<!-- <if test="caseStatusList != null and caseStatusList.size() > 0">-->
<!-- and c.case_status in (1,5)-->
<!-- </if>-->
<!-- 查询该案件的最新记录 -->
AND l.version = (
SELECT
max( version ) version
FROM
case_application_log
WHERE
update_submit_status IN ( 1, 2 ))
) t
GROUP BY
t.id,
t.caseLogId,
t.version,
t.case_num,
t.case_subject_amount,
t.register_date,
t.arbitrat_method,
t.caseStatusName,
t.hear_date,
t.arbitrat_claims,
t.loan_start_date,
t.loan_end_date,
t.claim_princi_owed,
t.claim_interest_owed,
t.claim_liquid_damag,
t.fee_payable,
t.begin_video_date,
t.online_video_person,
t.contract_number,
t.create_by,
t.create_time,
t.lock_status,
t.update_by,
t.update_time,
t.arbitrator_name,
t.applicationOrganId,
t.applicantName,
t.filearbitra_url,
t.updateSubmitStatus,
t.case_name
ORDER BY
t.create_time DESC,
t.case_num DESC
</select>
<insert id="insertCaseApplication" parameterType="CaseApplication" useGeneratedKeys="true" keyProperty="id">
insert into case_application(
<if test="id != null''">id ,</if>
<if test="caseName != null and caseName != ''">case_name ,</if>
<if test="caseNum != null and caseNum != ''">case_num,</if>
<if test="caseSubjectAmount != null">case_subject_amount,</if>
@@ -1374,8 +929,13 @@
<if test="createBy != null and createBy != ''">create_by,</if>
<if test="importFlag != null ">import_flag,</if>
<if test="version != null ">version,</if>
<if test="templateId != null ">template_id,</if>
facts,
mediation_agreement,
batch_number,
create_time
)values(
<if test="id != null''">#{id} ,</if>
<if test="caseName != null and caseName != ''">#{caseName},</if>
<if test="caseNum != null and caseNum != ''">#{caseNum},</if>
<if test="caseSubjectAmount != null">#{caseSubjectAmount},</if>
@@ -1403,9 +963,89 @@
<if test="createBy != null and createBy != ''">#{createBy},</if>
<if test="importFlag != null ">#{importFlag},</if>
<if test="version != null ">#{version},</if>
<if test="templateId != null ">#{templateId},</if>
#{facts},
#{mediationAgreement},
#{batchNumber},
sysdate()
)
</insert>
<insert id="batchSave">
insert into case_application(
id,
case_name ,
case_num,
case_subject_amount,
register_date,
arbitrat_method,
case_status,
hear_date,
arbitrat_claims,
request_rule,
loan_start_date,
loan_end_date,
claim_princi_owed,
claim_interest_owed,
claim_liquid_damag,
fee_payable,
begin_video_date,
online_video_person,
contract_number,
adjudica_counter,
proper_preser,
create_by,
import_flag,
version,
template_id,
facts,
mediation_agreement,
batch_number,
create_time
)values
<foreach item="item" index="index" collection="list" separator=",">
(
#{item.id},
#{item.caseName},
#{item.caseNum},
#{item.caseSubjectAmount},
sysdate(),
#{item.arbitratMethod},
#{item.caseStatus},
#{item.hearDate},
#{item.arbitratClaims},
#{item.requestRule},
#{item.loanStartDate},
#{item.loanEndDate},
#{item.claimPrinciOwed},
#{item.claimInterestOwed},
#{item.claimLiquidDamag},
#{item.feePayable},
#{item.beginVideoDate},
#{item.onlineVideoPerson},
#{item.contractNumber},
#{item.adjudicaCounter},
#{item.properPreser},
#{item.createBy},
#{item.importFlag},
#{item.version},
#{item.templateId},
#{item.facts},
#{item.mediationAgreement},
#{item.batchNumber},
sysdate()
)
</foreach>;
</insert>
<update id="updataCaseApplication" parameterType="CaseApplication">
update case_application
@@ -1435,7 +1075,9 @@
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
<if test="caseNum != null and caseNum != ''">case_num = #{caseNum},</if>
<if test="version != null and version != ''">version = #{version},</if>
<if test="version != null ">version = #{version},</if>
<if test="facts != null and facts != ''">facts = #{facts},</if>
<if test="mediationAgreement != null and mediationAgreement != ''">mediation_agreement = #{mediationAgreement},</if>
update_time = sysdate()
</set>
where id = #{id}
@@ -1505,19 +1147,24 @@
END arbitratMethodName,
c.case_name,
c.case_status ,
CASE c.case_status when 0 then '立案申请' when 1 then '待立案审查' when 2 then '待缴费'
CASE c.case_status when 0 then '立案申请' when 1 then '待立案审查' when 2 then '待缴费'
when 3 then '待缴费确认' when 4 then '待案件质证' when 5 then '待组庭审核'
when 6 then '待组庭确定' when 7 then '待审核仲裁方式' when 8 then '待开庭审理'
when 9 then '待书面审理' when 10 then '待生成仲裁文书' when 11 then '待核验仲裁文书'
when 12 then '待审核仲裁文书' when 13 then '待仲裁文书签名' when 14 then '待仲裁文书用印'
when 15 then '待仲裁文书送达' when 16 then '待案件归档'
when 12 then '待部门长审核仲裁文书' when 13 then '待仲裁文书签名' when 14 then '待仲裁文书用印'
when 15 then '待仲裁文书送达' when 16 then '待案件归档' when 17 then '已归档'
when 18 then '待仲裁员审核仲裁文书'
when 31 then '待修改开庭时间'
ELSE '无案件状态'
END caseStatusName,
c.hear_date ,c.arbitrat_claims ,
c.loan_start_date ,c.loan_end_date ,c.claim_princi_owed ,c.claim_interest_owed ,c.claim_liquid_damag ,c.fee_payable ,
c.begin_video_date ,c.online_video_person ,c.contract_number ,c.create_by ,c.create_time ,c.request_rule,c.adjudica_counter,c.proper_preser,
c.is_absence ,c.respon_cross_opin ,c.applica_cross_opin ,c.respon_defen_opini ,
c.update_by ,c.update_time,c.arbitrator_id,c.arbitrator_name,ca.application_organ_id applicationOrganId ,ca.application_organ_name as applicantName
c.update_by ,c.update_time,c.arbitrator_id,c.arbitrator_name,ca.application_organ_id applicationOrganId ,ca.application_organ_name as applicantName,
c.batch_number,
c.facts,
c.mediation_agreement,c.template_id templateId
from case_application c
LEFT JOIN case_affiliate ca ON ca.case_appli_id = c.id and ca.identity_type=1
@@ -1534,19 +1181,24 @@
ELSE '无审理方式'
END arbitratMethodName,
c.case_status ,
CASE c.case_status when 0 then '立案申请' when 1 then '待立案审查' when 2 then '待缴费'
CASE c.case_status when 0 then '立案申请' when 1 then '待立案审查' when 2 then '待缴费'
when 3 then '待缴费确认' when 4 then '待案件质证' when 5 then '待组庭审核'
when 6 then '待组庭确定' when 7 then '待审核仲裁方式' when 8 then '待开庭审理'
when 9 then '待书面审理' when 10 then '待生成仲裁文书' when 11 then '待核验仲裁文书'
when 12 then '待审核仲裁文书' when 13 then '待仲裁文书签名' when 14 then '待仲裁文书用印'
when 15 then '待仲裁文书送达' when 16 then '待案件归档'
when 12 then '待部门长审核仲裁文书' when 13 then '待仲裁文书签名' when 14 then '待仲裁文书用印'
when 15 then '待仲裁文书送达' when 16 then '待案件归档' when 17 then '已归档'
when 18 then '待仲裁员审核仲裁文书'
when 31 then '待修改开庭时间'
ELSE '无案件状态'
END caseStatusName,
c.hear_date ,c.arbitrat_claims ,
c.loan_start_date ,c.loan_end_date ,c.claim_princi_owed ,c.claim_interest_owed ,c.claim_liquid_damag ,c.fee_payable ,
c.begin_video_date ,c.online_video_person ,c.contract_number ,c.create_by ,c.create_time ,c.request_rule,c.adjudica_counter,c.proper_preser,
c.is_absence ,c.respon_cross_opin ,c.applica_cross_opin ,c.respon_defen_opini ,
c.update_by ,c.update_time,c.arbitrator_id,c.arbitrator_name,ca.application_organ_id applicationOrganId ,ca.application_organ_name as applicantName
c.update_by ,c.update_time,c.arbitrator_id,c.arbitrator_name,ca.application_organ_id applicationOrganId ,ca.application_organ_name as applicantName,
c.batch_number,
c.facts,
c.mediation_agreement,c.template_id templateId
from case_application c
LEFT JOIN case_affiliate ca ON ca.case_appli_id = c.id and ca.identity_type=1
@@ -1565,15 +1217,17 @@
ELSE '无审理方式'
END arbitratMethodName,
c.case_status ,
CASE c.case_status when 0 then '立案申请' when 1 then '待立案审查' when 2 then '待缴费'
when 3 then '待缴费确认' when 4 then '待案件质证' when 5 then '待组庭审核'
when 6 then '待组庭确定' when 7 then '待审核仲裁方式' when 8 then '待开庭审理'
when 9 then '待书面审理' when 10 then '待生成仲裁文书' when 11 then '待核验仲裁文书'
when 12 then '待审核仲裁文书' when 13 then '待仲裁文书签名' when 14 then '待仲裁文书用印'
when 15 then '待仲裁文书送达' when 16 then '待案件归档'
CASE c.case_status when 0 then '立案申请' when 1 then '待立案审查' when 2 then '待缴费'
when 3 then '待缴费确认' when 4 then '待案件质证' when 5 then '待组庭审核'
when 6 then '待组庭确定' when 7 then '待审核仲裁方式' when 8 then '待开庭审理'
when 9 then '待书面审理' when 10 then '待生成仲裁文书' when 11 then '待核验仲裁文书'
when 12 then '待部门长审核仲裁文书' when 13 then '待仲裁文书签名' when 14 then '待仲裁文书用印'
when 15 then '待仲裁文书送达' when 16 then '待案件归档' when 17 then '已归档'
when 18 then '待仲裁员审核仲裁文书'
when 31 then '待修改开庭时间'
ELSE '无案件状态'
END caseStatusName,
c.hear_date ,c.arbitrat_claims ,
c.hear_date ,c.arbitrat_claims , c.batch_number,c.facts,c.mediation_agreement,c.template_id templateId,
c.loan_start_date ,c.loan_end_date ,c.claim_princi_owed ,c.claim_interest_owed ,c.claim_liquid_damag ,c.fee_payable ,
c.begin_video_date ,c.online_video_person ,c.contract_number ,c.create_by ,c.create_time ,
c.update_by ,c.update_time,c.arbitrator_id,c.arbitrator_name,
@@ -1587,7 +1241,7 @@
</select>
<select id="selectCaseNumLike" resultType="java.lang.Integer">
select max(substring(case_num, #{length}+1,12)+1) as maxCaseNum
select max(substring(case_num, #{length}+1,12)) as maxCaseNum
from case_application where case_num like CONCAT(#{caseNum},'%') ;
</select>
<select id="selectArbitratorList" resultType="java.lang.String">
@@ -1602,7 +1256,10 @@
select max(room_id+1) as maxRoomId
from reserved_conference ;
</select>
<select id="selectBatchNumberLike" resultType="java.lang.Integer">
select max(batch_number) as maxBatchNumber
from case_application ;
</select>
</mapper>
@@ -19,6 +19,13 @@
INSERT INTO case_attach_log (case_appli_log_id, annex_id,annex_name, annex_path , annex_type,note,use_id,use_account,seal_status)
VALUES (#{caseAppliLogId},#{annexId}, #{annexName}, #{annexPath},#{annexType},#{note},#{userId},#{userName},#{sealStatus})
</insert>
<insert id="batchSave">
INSERT INTO case_attach_log (case_appli_log_id, annex_id,annex_name, annex_path , annex_type,note,use_id,use_account,seal_status)
VALUES
<foreach item="item" index="index" collection="list" separator=",">
(#{item.caseAppliLogId},#{item.annexId}, #{item.annexName}, #{item.annexPath},#{item.annexType},#{item.note},#{item.userId},#{item.userName},#{item.sealStatus})
</foreach>
</insert>
<delete id="deleteByFileIds">
delete from case_attach_log
where annex_id in
@@ -18,6 +18,15 @@
INSERT INTO case_attach (case_appli_id, annex_name, annex_path , annex_type,note,use_id,use_account,seal_status,is_batch_upload)
VALUES (#{caseAppliId}, #{annexName}, #{annexPath},#{annexType},#{note},#{userId},#{userName},#{sealStatus},#{isBatchUpload})
</insert>
<insert id="batchSave" useGeneratedKeys="true" keyProperty="annexId">
INSERT INTO case_attach (case_appli_id, annex_name, annex_path , annex_type,note,use_id,use_account,seal_status,is_batch_upload)
VALUES
<foreach item="item" index="index" collection="list" separator=",">
(#{item.caseAppliId}, #{item.annexName}, #{item.annexPath},#{item.annexType},#{item.note},#{item.userId},#{item.userName},#{item.sealStatus},#{item.isBatchUpload})
</foreach>
</insert>
<delete id="deleteByFileIds">
delete from case_attach
where annex_id in
@@ -53,6 +62,12 @@
</where>
</select>
<delete id="deleteCaseAttachByCasedIdAndType">
delete from case_attach
where case_appli_id = #{caseAppliId}
and annex_type = #{annexType}
</delete>
<select id="queryCaseAttachList" resultMap="CaseAttachResult">
select annex_id,case_appli_id,annex_name,annex_path,annex_type,note,use_id,use_account
from case_attach
@@ -20,17 +20,26 @@
#{caseAppliId},#{caseNode},sysdate(),#{notes},#{createBy},#{createNickName},sysdate(),#{updateBy},sysdate()
)
</insert>
<insert id="batchInsertRecord">
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
<foreach item="item" index="index" collection="list" separator=",">
(
#{item.caseAppliId},#{item.caseNode},sysdate(),#{item.notes},#{item.createBy},#{item.createNickName},sysdate(),#{item.updateBy},sysdate()
)
</foreach>
</insert>
<select id="selectCaseLogRecordList" resultType="com.ruoyi.wisdomarbitrate.domain.CaseLogRecord">
select cl.case_node caseNode ,cl.case_node_time caseNodeTime ,cl.notes ,cl.id ,cl.case_appli_id caseAppliId,
cl.create_by createBy,cl.create_nick_name createNickName,cl.create_time createTime,cl.update_by updateBy,cl.update_time updateTime,
CASE cl.case_node when 0 then '立案申请' when 1 then '提交立案申请' when 2 then '立案审查'
when 3 then '支付成功' when 4 then '缴费确认' when 5 then '案件质证'
when 6 then '组庭审核' when 7 then '组庭确认' when 8 then '当前仲裁方式为开庭审理'
when 9 then '当前仲裁方式为书面审理' when 10 then '书面审理' when 11 then '生成裁決书'
when 12 then '核验裁决书' when 13 then '同意裁决书' when 14 then '签名成功'
when 9 then '当前仲裁方式为书面审理' when 10 then '书面审理' when 11 then '秘书审核裁决书'
when 12 then '部门长核验裁决书' when 13 then '同意裁决书' when 14 then '签名成功'
when 15 then '用印成功' when 16 then '送达仲裁文书' when 17 then '案件归档'
when 26 then '证据确认成功'
when 31 then '修改开庭时间'
when 18 then '仲裁员审核仲裁文书'
ELSE '无案件状态'
END content,
CASE cl.case_node when 0 then '申请人' when 1 then '申请人' when 2 then '法律顾问'
@@ -0,0 +1,50 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.wisdomarbitrate.mapper.ColumnValueLogMapper">
<resultMap id="BaseResultMap" type="com.ruoyi.wisdomarbitrate.domain.vo.ColumnValue" >
<result column="id" property="id" />
<result column="column" property="column" />
<result column="name" property="name" />
<result column="value" property="value" />
<result column="case_appli_log_id" property="caseAppliLogId" />
</resultMap>
<insert id="batchSave">
INSERT INTO column_value_log ( `COLUMN`, `NAME`, `VALUE`, case_appli_log_id,is_default )
values
<foreach item="item" index="index" collection="list" separator=",">
(#{item.column},#{item.name},#{item.value},#{item.caseAppliLogId},#{item.isDefault})
</foreach>
</insert>
<select id="listBycaseAppliLogId" resultMap="BaseResultMap">
select * from column_value_log where case_appli_log_id=#{caseAppliLogId}
</select>
<update id="batchUpdate">
<foreach collection="list" item="item" >
update column_value_log
<set>
<if test="item.value != null and item.value != ''">
`VALUE` = #{item.value},
</if>
`id`=#{item.id}
</set>
where `COLUMN`=#{item.column} and `NAME`=#{item.name} and case_appli_log_id=#{item.caseAppliLogId};
</foreach>
</update>
<select id="queryColumnValueList" parameterType="ColumnValue" resultMap="BaseResultMap">
select * from column_value_log c
<where>
<if test="caseAppliLogId != null">
AND c.case_appli_log_id = #{caseAppliLogId}
</if>
<if test="isDefault != null">
AND c.is_default = #{isDefault}
</if>
</where>
</select>
</mapper>
@@ -0,0 +1,62 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.wisdomarbitrate.mapper.ColumnValueMapper">
<resultMap id="BaseResultMap" type="com.ruoyi.wisdomarbitrate.domain.vo.ColumnValue" >
<result column="id" property="id" />
<result column="column" property="column" />
<result column="name" property="name" />
<result column="value" property="value" />
<result column="case_id" property="caseId" />
<result column="is_default" property="isDefault" />
</resultMap>
<insert id="batchSave">
INSERT INTO column_value ( `COLUMN`, `NAME`, `VALUE`, case_id,is_default )
values
<foreach item="item" index="index" collection="list" separator=",">
(#{item.column},#{item.name},#{item.value},#{item.caseId},#{item.isDefault})
</foreach>
</insert>
<update id="batchUpdate">
<foreach collection="list" item="item" >
update column_value
<set>
<if test="item.value != null and item.value != ''">
`VALUE` = #{item.value},
</if>
</set>
where id=#{item.id};
</foreach>
</update>
<update id="updateColumnValue" parameterType="ColumnValue">
update column_value
<set>
<if test="value != null and value != ''">
`VALUE` = #{value},
</if>
</set>
where id=#{id}
</update>
<select id="listByCaseId" resultMap="BaseResultMap">
select * from column_value where case_id=#{caseId}
</select>
<select id="queryColumnValueList" parameterType="ColumnValue" resultMap="BaseResultMap">
select * from column_value c
<where>
<if test="caseId != null">
AND c.case_id = #{caseId}
</if>
<if test="isDefault != null">
AND c.is_default = #{isDefault}
</if>
</where>
</select>
</mapper>
@@ -0,0 +1,116 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.wisdomarbitrate.mapper.FatchRuleMapper">
<resultMap id="BaseResultMap" type="com.ruoyi.wisdomarbitrate.domain.FatchRule" >
<result column="id" property="id" />
<result column="batch_number" property="batchNumber" />
<result column="file_name" property="fileName" />
<result column="start_content" property="startContent" />
<result column="end_content" property="endContent" />
<result column="column" property="column" />
<result column="column_name" property="columnName" />
<result column="is_default" property="isDefault" />
<result column="start_content_repeat_order" property="startContentRepeatOrder" />
<result column="end_content_repeat_order" property="endContentRepeatOrder" />
<result column="fatch_order" property="fatchOrder" />
</resultMap>
<select id="listByTemplateId" resultMap="BaseResultMap">
select f.id ,f.file_name ,f.start_content ,f.end_content ,
f.`column` , ifnull(f.is_default,0) is_default ,f.`column_name`,ifnull(f.start_content_repeat_order,1) start_content_repeat_order,ifnull(f.end_content_repeat_order,1) end_content_repeat_order,ifnull(f.fatch_order,0) fatch_order
from fatch_rule f join template_fatch_rule tfr on f.id=tfr.fatch_rule_id
where tfr.template_id=#{templateId}
</select>
<select id="selectFatchRuleList" parameterType="FatchRule" resultMap="BaseResultMap">
SELECT f.id ,f.file_name ,f.start_content ,f.end_content ,
f.`column` ,f.is_default ,f.`column_name`,f.start_content_repeat_order,f.end_content_repeat_order,f.fatch_order
FROM template_fatch_rule tf
left join template_manage t on tf.template_id = t.id
LEFT JOIN fatch_rule f on tf.fatch_rule_id = f.id
<where>
<if test="templateId != null">
AND tf.template_id = #{templateId}
</if>
</where>
</select>
<select id="selectColumnandComment" parameterType="FatchRule" resultMap="BaseResultMap">
select
a.COLUMN_name as `column`,
a.COLumn_comment as column_name
from
information_schema.COLUMNS a
where
TABLE_schema = #{databaseName}
and TABLE_name in('case_application','case_affiliate')
and COLUMN_NAME not in('id','case_appli_id','case_num','case_subject_amount',
'register_date','arbitrat_method','case_status','hear_date','begin_video_date',
'online_video_person','create_time','update_by','update_time','create_by',
'arbitrator_id','arbitrator_name','pended_trial_arbitorid','pending_appoint_arbotrar',
'case_name','case_result','is_agree_pend_tral','objection_add_eviden','open_court_hear',
'paid_expenses','filearbitra_url','pay_type','adjudica_counter','proper_preser','objecti_juris',
'is_absence','respon_cross_opin','applica_cross_opin','respon_defen_opini','appli_is_absen',
'lock_status','room_id','import_flag','version','batch_number','template_id','applicant_agent_user_id','contract_number','identity_type','application_organ_id')
</select>
<select id="selectColumnbycomment" parameterType="FatchRule" resultMap="BaseResultMap">
select
COLUMN_NAME
from
information_schema.COLUMNS
where
TABLE_schema = #{databaseName}
and TABLE_name in('case_application','case_affiliate')
and COLumn_comment = #{columnName}
</select>
<select id="selectFatchRuleListIsDefault" parameterType="FatchRule" resultMap="BaseResultMap">
SELECT f.id ,f.file_name ,f.start_content ,f.end_content ,
f.`column` ,f.is_default ,f.`column_name`
FROM fatch_rule f
<where>
<if test="isDefault != null">
AND f.is_default = #{isDefault}
</if>
</where>
</select>
<delete id="deletebatchFatchRule">
delete from fatch_rule where id in
<foreach collection="fatchRuleIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</delete>
<insert id="insertFatchRule" parameterType="FatchRule" useGeneratedKeys="true" keyProperty="id">
insert into fatch_rule(
<if test="fileName != null and fileName != ''">file_name,</if>
<if test="startContent != null and startContent != ''">start_content,</if>
<if test="endContent != null and endContent != ''">end_content,</if>
<if test="column != null and column != ''">`column`,</if>
<if test="columnName != null and columnName != ''">`column_name`,</if>
<if test="isDefault != null">is_default,</if>
start_content_repeat_order,end_content_repeat_order,fatch_order
)values(
<if test="fileName != null and fileName != ''">#{fileName},</if>
<if test="startContent != null and startContent != ''">#{startContent},</if>
<if test="endContent != null and endContent != ''">#{endContent},</if>
<if test="column != null and column != ''">#{column},</if>
<if test="columnName != null and columnName != ''">#{columnName},</if>
<if test="isDefault != null">#{isDefault},</if>
#{startContentRepeatOrder},#{endContentRepeatOrder},#{fatchOrder}
)
</insert>
</mapper>
@@ -0,0 +1,49 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.wisdomarbitrate.mapper.TemplateFatchRuleMapper">
<resultMap id="BaseResultMap" type="com.ruoyi.wisdomarbitrate.domain.vo.TemplateFatchRule" >
<result column="id" property="id" />
<result column="template_id" property="templateId" />
<result column="fatch_rule_id" property="fatchRuleId" />
</resultMap>
<select id="selectTemplateFatchRulecount" parameterType="TemplateFatchRule" resultType="Integer">
select count(1) from template_fatch_rule t
<where>
<if test="templateId != null">
AND t.template_id = #{templateId}
</if>
</where>
</select>
<select id="selectTemplateFatchRuleList" parameterType="TemplateFatchRule" resultMap="BaseResultMap">
SELECT t.id ,t.template_id ,t.fatch_rule_id
from template_fatch_rule t
<where>
<if test="templateId != null">
AND t.template_id = #{templateId}
</if>
</where>
</select>
<delete id="deleteTemplateFatchRule" parameterType="Long">
delete from template_fatch_rule where template_id=#{id}
</delete>
<insert id="insertTemplateFatchRule" parameterType="TemplateFatchRule" useGeneratedKeys="true" keyProperty="id">
insert into template_fatch_rule(
<if test="templateId != null">template_id,</if>
<if test="fatchRuleId != null">fatch_rule_id</if>
)values(
<if test="templateId != null">#{templateId},</if>
<if test="fatchRuleId != null">#{fatchRuleId}</if>
)
</insert>
</mapper>