93 Commits
Author SHA1 Message Date
qitz 74112dc93b Merge branch 'dev' of http://git.xayunmei.com/SH-Arbitrate/Arbitrate-Backend into qtz5 2024-03-22 10:06:30 +08:00
qitz 08717e84be 优化新增功能 2024-03-22 10:06:10 +08:00
wangqiong123andGitea 8d732fb8fb Merge branch 'wq' of SH-Arbitrate/Arbitrate-Backend into dev 2024-02-28 09:40:24 +08:00
18792927508 5240926cd7 视频会议调用调解系统 2024-02-28 09:36:31 +08:00
qtzandGitea 16d6d1c29d Merge branch 'qtz5' of SH-Arbitrate/Arbitrate-Backend into dev 2024-02-06 15:59:52 +08:00
qitz b0e0123c4a Merge branch 'dev' of http://git.xayunmei.com/SH-Arbitrate/Arbitrate-Backend into qtz5 2024-02-06 15:56:21 +08:00
qitz abb96916e3 优化新增功能 2024-02-06 15:56:03 +08:00
qtzandGitea e3bdb44192 Merge branch 'qtz5' of SH-Arbitrate/Arbitrate-Backend into dev 2024-01-19 17:28:42 +08:00
qitz ff175c98df Merge branch 'dev' of http://git.xayunmei.com/SH-Arbitrate/Arbitrate-Backend into qtz5 2024-01-19 17:26:09 +08:00
qitz 5c434e576f 优化用印功能 2024-01-19 17:25:40 +08:00
wangqiong123andGitea 6b5e91c4d7 Merge branch 'wq' of SH-Arbitrate/Arbitrate-Backend into dev 2024-01-19 10:47:36 +08:00
18792927508 5f622b0641 视频回调 2024-01-19 10:45:17 +08:00
qtzandGitea 9bfcc02a48 Merge branch 'qtz5' of SH-Arbitrate/Arbitrate-Backend into dev 2024-01-10 13:44:44 +08:00
qitz a3a3fa17f1 Merge branch 'dev' of http://git.xayunmei.com/SH-Arbitrate/Arbitrate-Backend into qtz5 2024-01-10 13:41:35 +08:00
qitz f38d6997bc 优化公章列表查询 2024-01-10 13:41:18 +08:00
qtzandGitea 13e3503af4 Merge branch 'qtz5' of SH-Arbitrate/Arbitrate-Backend into dev 2024-01-10 11:39:27 +08:00
qitz 70af2e822b Merge branch 'dev' of http://git.xayunmei.com/SH-Arbitrate/Arbitrate-Backend into qtz5 2024-01-10 11:35:53 +08:00
qitz 71a228c625 修改送达裁决书功能 2024-01-10 11:35:28 +08:00
qtzandGitea 9f79c901ca Merge branch 'qtz5' of SH-Arbitrate/Arbitrate-Backend into dev 2024-01-09 11:45:16 +08:00
qitz fa782834e7 Merge branch 'dev' of http://git.xayunmei.com/SH-Arbitrate/Arbitrate-Backend into qtz5 2024-01-09 11:41:50 +08:00
qitz 088bd41d0b 优化批量送达裁决书功能 2024-01-09 11:41:16 +08:00
qtzandGitea f6b1403e3c Merge branch 'qtz5' of SH-Arbitrate/Arbitrate-Backend into dev 2024-01-08 14:51:20 +08:00
qitz da105d20e4 Merge branch 'dev' of http://git.xayunmei.com/SH-Arbitrate/Arbitrate-Backend into qtz5 2024-01-08 14:47:49 +08:00
qitz 293dd52e8c 优化案件列表查询 2024-01-08 14:47:19 +08:00
qtzandGitea eeb6757ec8 Merge branch 'qtz5' of SH-Arbitrate/Arbitrate-Backend into dev 2024-01-05 17:55:55 +08:00
qitz 6960564dde Merge branch 'dev' of http://git.xayunmei.com/SH-Arbitrate/Arbitrate-Backend into qtz5 2024-01-05 17:53:28 +08:00
qitz fb8366fa78 优化批量列表查询 2024-01-05 17:53:02 +08:00
qtzandGitea 31dc8e4032 Merge branch 'qtz5' of SH-Arbitrate/Arbitrate-Backend into dev 2024-01-05 16:35:11 +08:00
qitz 6caf44a9ec Merge branch 'dev' of http://git.xayunmei.com/SH-Arbitrate/Arbitrate-Backend into qtz5 2024-01-05 16:31:46 +08:00
qitz 95cacd287b 批量送达裁决书功能 2024-01-05 16:31:22 +08:00
qtzandGitea fdf48d2f14 Merge branch 'qtz5' of SH-Arbitrate/Arbitrate-Backend into dev 2024-01-05 14:49:01 +08:00
qitz b24fc351ea Merge branch 'dev' of http://git.xayunmei.com/SH-Arbitrate/Arbitrate-Backend into qtz5 2024-01-05 14:45:44 +08:00
qitz 11e6c91cc6 实现批量签名用印功能 2024-01-05 14:45:10 +08:00
qtzandGitea fd04248c4b Merge branch 'qtz5' of SH-Arbitrate/Arbitrate-Backend into dev 2024-01-04 18:02:31 +08:00
qitz 1f9cea5d3e Merge branch 'dev' of http://git.xayunmei.com/SH-Arbitrate/Arbitrate-Backend into qtz5 2024-01-04 17:59:11 +08:00
qitz 4be8bcab6d 实现批量审核仲裁方式 2024-01-04 17:58:44 +08:00
qtzandGitea cf6b0e7d70 Merge branch 'qtz5' of SH-Arbitrate/Arbitrate-Backend into dev 2024-01-04 16:16:35 +08:00
qitz ff2a7dd781 实现批量部门长审核裁决书 2024-01-04 16:11:49 +08:00
wangqiong123andGitea f99cf25adf Merge branch 'wq' of SH-Arbitrate/Arbitrate-Backend into dev 2024-01-04 10:04:46 +08:00
18792927508 1ea9767674 压缩包导入修改 2024-01-04 10:01:59 +08:00
qtzandGitea 2253984352 Merge branch 'qtz5' of SH-Arbitrate/Arbitrate-Backend into dev 2024-01-03 18:00:33 +08:00
qitz b14d46803c Merge branch 'dev' of http://git.xayunmei.com/SH-Arbitrate/Arbitrate-Backend into qtz5 2024-01-03 17:56:31 +08:00
qitz 82b6431be9 实现批量组庭功能 2024-01-03 17:55:35 +08:00
qtzandGitea 6cb1ecab7b Merge branch 'qtz5' of SH-Arbitrate/Arbitrate-Backend into dev 2024-01-03 13:52:37 +08:00
qitz 061bdc6312 Merge branch 'dev' of http://git.xayunmei.com/SH-Arbitrate/Arbitrate-Backend into qtz5 2024-01-03 13:49:30 +08:00
qitz f980592507 优化批量缴费功能 2024-01-03 13:49:01 +08:00
qtzandGitea 1d0e12ee18 Merge branch 'qtz5' of SH-Arbitrate/Arbitrate-Backend into dev 2024-01-03 09:37:41 +08:00
qitz d5b6cddd8f Merge branch 'dev' of http://git.xayunmei.com/SH-Arbitrate/Arbitrate-Backend into qtz5 2024-01-03 09:33:57 +08:00
qitz e4931d1499 优化缴费功能 2024-01-03 09:33:26 +08:00
qtzandGitea 7748d4e558 Merge branch 'qtz5' of SH-Arbitrate/Arbitrate-Backend into dev 2024-01-02 16:45:32 +08:00
qitz 7d5ee5cffd Merge branch 'dev' of http://git.xayunmei.com/SH-Arbitrate/Arbitrate-Backend into qtz5 2024-01-02 16:42:08 +08:00
qitz 48da135874 批量缴费 2024-01-02 16:41:36 +08:00
qtzandGitea 8be09de49c Merge branch 'qtz5' of SH-Arbitrate/Arbitrate-Backend into dev 2024-01-02 14:15:19 +08:00
qitz 2aff2e8d7d Merge branch 'dev' of http://git.xayunmei.com/SH-Arbitrate/Arbitrate-Backend into qtz5 2024-01-02 14:11:25 +08:00
qitz 06320d99ca 批量审查 2024-01-02 14:10:53 +08:00
qtzandGitea 7cd6c52db5 Merge branch 'qtz5' of SH-Arbitrate/Arbitrate-Backend into dev 2024-01-02 10:00:50 +08:00
qitz 455f3265ec Merge branch 'dev' of http://git.xayunmei.com/SH-Arbitrate/Arbitrate-Backend into qtz5 2024-01-02 09:57:36 +08:00
qitz 33774c51fb 优化批量提交 2024-01-02 09:57:04 +08:00
qtzandGitea c68c91e0b3 Merge branch 'qtz5' of SH-Arbitrate/Arbitrate-Backend into dev 2023-12-29 17:29:36 +08:00
qitz 53c64c36da Merge branch 'dev' of http://git.xayunmei.com/SH-Arbitrate/Arbitrate-Backend into qtz5 2023-12-29 17:24:05 +08:00
qitz 7a38c4e8a5 实现批量管理查询批量和批量提交 2023-12-29 17:23:09 +08:00
wangqiong123andGitea 66d66e5156 Merge branch 'wq' of SH-Arbitrate/Arbitrate-Backend into dev 2023-12-28 10:33:27 +08:00
18792927508 20517eaaaa bug修改 2023-12-28 10:30:45 +08:00
qitz deea55b1e9 Merge branch 'dev' of http://git.xayunmei.com/SH-Arbitrate/Arbitrate-Backend into qtz5 2023-12-27 14:40:48 +08:00
qitz 31a9287a8f 1 2023-12-27 14:40:26 +08:00
wangqiong123andGitea 4cd04ef10e Merge branch 'wq' of SH-Arbitrate/Arbitrate-Backend into dev 2023-12-27 14:39:35 +08:00
18792927508 afb6b2a4b5 bug修改 2023-12-27 14:38:03 +08:00
qtzandGitea a12083d93c Merge branch 'qtz5' of SH-Arbitrate/Arbitrate-Backend into dev 2023-12-27 14:03:58 +08:00
qitz f66af56144 优化查询案件列表 2023-12-27 13:58:02 +08:00
wangqiong123andGitea 0d71663935 Merge branch 'wq' of SH-Arbitrate/Arbitrate-Backend into dev 2023-12-25 16:04:49 +08:00
qitz 753039d5e9 Merge branch 'dev' of http://git.xayunmei.com/SH-Arbitrate/Arbitrate-Backend into qtz5 2023-12-25 16:04:45 +08:00
qitz 743040d813 优化下载zip 2023-12-25 16:04:29 +08:00
18792927508 9f8e21383d 1 2023-12-25 16:03:10 +08:00
wangqiong123andGitea 4e85bf306b Merge branch 'wq' of SH-Arbitrate/Arbitrate-Backend into dev 2023-12-21 09:17:57 +08:00
18792927508 1da61f526d 案件bug修复 2023-12-21 09:16:26 +08:00
wangqiong123andGitea c7970e884f Merge branch 'wq' of SH-Arbitrate/Arbitrate-Backend into dev 2023-12-20 09:17:46 +08:00
18792927508 20c95700ab 案件 2023-12-20 09:15:28 +08:00
qtzandGitea 547394f8d6 Merge branch 'qtz5' of SH-Arbitrate/Arbitrate-Backend into dev 2023-12-19 14:06:08 +08:00
qitz a671da2f11 Merge branch 'dev' of http://git.xayunmei.com/SH-Arbitrate/Arbitrate-Backend into qtz5 2023-12-19 14:02:23 +08:00
qitz 60561da44d 优化生成案件编号规则功能 2023-12-19 14:01:56 +08:00
qtzandGitea e5138339a8 Merge branch 'qtz5' of SH-Arbitrate/Arbitrate-Backend into dev 2023-12-15 17:30:36 +08:00
qitz 45f30d2dbc Merge branch 'dev' of http://git.xayunmei.com/SH-Arbitrate/Arbitrate-Backend into qtz5 2023-12-15 17:26:14 +08:00
qitz 8aa82b28be 实现案件编号规则功能 2023-12-15 17:25:40 +08:00
wangqiong123andGitea 23847cf918 Merge branch 'wq' of SH-Arbitrate/Arbitrate-Backend into dev 2023-12-15 10:58:52 +08:00
18792927508 c6d0cb9579 案件修改 2023-12-15 10:57:16 +08:00
qtzandGitea e590293b33 Merge branch 'qtz5' of SH-Arbitrate/Arbitrate-Backend into dev 2023-12-14 15:55:50 +08:00
qitz e1fa902c59 Merge branch 'dev' of http://git.xayunmei.com/SH-Arbitrate/Arbitrate-Backend into qtz5 2023-12-14 15:51:40 +08:00
qitz 5eb7b070fd 实现组庭审核时仲裁员待办案件数据显示 2023-12-14 15:51:09 +08:00
qtzandGitea fbf10a1ed9 Merge branch 'qtz5' of SH-Arbitrate/Arbitrate-Backend into dev 2023-12-13 16:01:37 +08:00
qitz 0e96b4d8f4 Merge branch 'dev' of http://git.xayunmei.com/SH-Arbitrate/Arbitrate-Backend into qtz5 2023-12-13 15:58:56 +08:00
qitz 61f8638635 增加是否书面审理 2023-12-13 15:58:38 +08:00
qtzandGitea 6c9a09f29a Merge branch 'qtz5' of SH-Arbitrate/Arbitrate-Backend into dev 2023-12-13 11:46:48 +08:00
qitz 2787aa38c6 优化驳回原因功能 2023-12-13 11:44:20 +08:00
56 changed files with 4948 additions and 1049 deletions
@@ -1,11 +1,16 @@
package com.ruoyi.web.controller.wisdomarbitrate;
import cn.hutool.core.collection.CollectionUtil;
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;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.exception.EsignDemoException;
import com.ruoyi.wisdomarbitrate.StringIdsReq;
import com.ruoyi.wisdomarbitrate.domain.BatchCaseApplication;
import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
import com.ruoyi.wisdomarbitrate.domain.SealSignRecord;
import com.ruoyi.wisdomarbitrate.domain.vo.BookSendVO;
import com.ruoyi.wisdomarbitrate.domain.vo.LogisticsInfoVO;
import com.ruoyi.wisdomarbitrate.service.IAdjudicationService;
@@ -14,6 +19,7 @@ import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.io.IOException;
import java.util.List;
@RestController
@@ -22,7 +28,65 @@ public class AdjudicationController extends BaseController {
@Autowired
private IAdjudicationService adjudicationService;
/**
* 根据签署流程id查询批量签名链接
*/
// @PreAuthorize("@ss.hasPermi('caseManagement:list:selectSignUrl')")
@PostMapping("/selectBatchSignUrl")
public AjaxResult selectBatchSignUrl(@RequestBody StringIdsReq idsReq) {
if(CollectionUtil.isEmpty(idsReq.getIds())|| StrUtil.isEmpty(idsReq.getPsnAccount())){
return error("参数校验失败");
}
SealSignRecord sealSignRecordselect = adjudicationService.selectBatchSignUrl(idsReq);
return success(sealSignRecordselect);
}
/**
* 根据批号查询批量签名链接
*/
@PostMapping("/getSignUrlBatch")
public AjaxResult getSignUrlBatch(@RequestBody StringIdsReq idsReq) {
if(StrUtil.isEmpty(idsReq.getBatchNumber().toString())|| StrUtil.isEmpty(idsReq.getPsnAccount())){
return error("参数校验失败");
}
SealSignRecord sealSignRecordselect = adjudicationService.getSignUrlBatch(idsReq);
return success(sealSignRecordselect);
}
/**
* 根据签署流程id查询批量用印链接
*/
// @PreAuthorize("@ss.hasPermi('caseManagement:list:selectSignUrl')")
@PostMapping("/selectBatchSealUrl")
public AjaxResult selectBatchSealUrl(@RequestBody StringIdsReq idsReq) {
if(CollectionUtil.isEmpty(idsReq.getIds())|| StrUtil.isEmpty(idsReq.getPsnAccount())){
return error("参数校验失败");
}
SealSignRecord sealSignRecordselect = adjudicationService.selectBatchSealUrl(idsReq);
return success(sealSignRecordselect);
}
/**
* 根据仲裁员手机号分页查询待签名/待用印的案件
*/
// @PreAuthorize("@ss.hasPermi('caseManagement:list:selectSignUrl')")
@GetMapping("/pageSignAdjudicate")
public TableDataInfo pageSignAdjudicate(@RequestParam(value = "personAccount",required = false) String personAccount, @RequestParam("caseStatus") Integer caseStatus) {
startPage();
List<CaseApplication> list = adjudicationService.selectSealSigning(personAccount,caseStatus);
return getDataTable(list);
}
/**
* 根据批号查询批量用印链接
*/
@PostMapping("/getSealUrlBatch")
public AjaxResult getSealUrlBatch(@RequestBody StringIdsReq idsReq) {
if(StrUtil.isEmpty(idsReq.getBatchNumber().toString())|| StrUtil.isEmpty(idsReq.getPsnAccount())){
return error("参数校验失败");
}
SealSignRecord sealSignRecordselect = adjudicationService.getSealUrlBatch(idsReq);
return success(sealSignRecordselect);
}
/**
@@ -37,6 +101,18 @@ public class AdjudicationController extends BaseController {
}
return adjudicationService.createDocument(caseApplication);
}
/**
* 批量生成裁决书
* @param caseApplication
* @return
*/
@PostMapping("/batchDocument")
public AjaxResult batchDocument(@Validated @RequestBody BatchCaseApplication caseApplication){
if (CollectionUtil.isEmpty(caseApplication.getIds())) {
return AjaxResult.error("参数校验失败");
}
return adjudicationService.batchDocument(caseApplication.getIds());
}
/**
* 重新生成裁决书
@@ -81,6 +157,7 @@ public class AdjudicationController extends BaseController {
return adjudicationService.signature(caseApplication);
}
/**
* 归档(暂时只改案件状态)
* @param batchCaseApplication
@@ -95,6 +172,19 @@ public class AdjudicationController extends BaseController {
return adjudicationService.caseFile(batchCaseApplication.getIds());
}
/**
* 批量归档(暂时只改案件状态)
* @param batchCaseApplication
* @return
*/
@PostMapping("/caseFileBatch")
public AjaxResult caseFileBatch(@RequestBody CaseApplication caseApplication){
if(StrUtil.isEmpty(caseApplication.getBatchNumber().toString())){
return error("参数校验失败");
}
return adjudicationService.caseFileBatch(caseApplication.getBatchNumber());
}
/**
* 送达(不包含发送电子邮件)
* @param bookSendVO
@@ -105,6 +195,20 @@ public class AdjudicationController extends BaseController {
public AjaxResult service(@RequestBody BookSendVO bookSendVO){
return adjudicationService.service(bookSendVO.getId(),bookSendVO.getAppEmail(),bookSendVO.getResEmail(),bookSendVO.getApptrackingNum(),bookSendVO.getRestrackingNum());
}
/**
* 批量送达仲裁书
* @param caseApplication
* @return
*/
@PostMapping("/serviceBatch")
public AjaxResult serviceBatch(@Validated @RequestBody CaseApplication caseApplication) throws EsignDemoException, IOException {
if(StrUtil.isEmpty(caseApplication.getBatchNumber().toString())){
return error("参数校验失败");
}
return adjudicationService.serviceBatch(caseApplication.getBatchNumber());
}
/**
* 用印(暂时只改案件状态)
* @param caseApplication
@@ -0,0 +1,54 @@
package com.ruoyi.web.controller.wisdomarbitrate;
import cn.hutool.json.JSONUtil;
import com.ruoyi.common.annotation.Anonymous;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.CheckSignatuerUtils;
import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
import com.ruoyi.wisdomarbitrate.domain.vo.CaseApplicationVO;
import com.ruoyi.wisdomarbitrate.service.ICaseApplicationService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/callArbitrateCaseApplication")
public class ArbitrateApplicationController extends BaseController {
@Autowired
private ICaseApplicationService caseApplicationService;
/**
* 新增立案数据
*/
@Anonymous
@PostMapping("/generateCaseApplication")
public AjaxResult generateCaseApplication(@Validated @RequestBody CaseApplicationVO caseApplicationVO) throws Exception {
String paramsbody = JSONUtil.toJsonStr(caseApplicationVO);
boolean checkResult= CheckSignatuerUtils.checkSignuter(paramsbody);
if(checkResult){
CaseApplication caseApplication = new CaseApplication();
BeanUtils.copyProperties(caseApplicationVO,caseApplication);
caseApplication.setCreateBy(getUsername());
return toAjax(caseApplicationService.insertcaseApplication1(caseApplication));
}else {
return AjaxResult.error("签名验证失败");
}
}
}
@@ -2,34 +2,29 @@ package com.ruoyi.web.controller.wisdomarbitrate;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.StrUtil;
import com.alipay.api.internal.util.file.IOUtils;
import com.ruoyi.common.annotation.Anonymous;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.constant.FileTransformation;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.exception.EsignDemoException;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.WxAppletNotifyUtils;
import com.ruoyi.util.FileUtil;
import com.ruoyi.wisdomarbitrate.domain.*;
import com.ruoyi.wisdomarbitrate.domain.vo.ReservedConferenceVO;
import com.ruoyi.wisdomarbitrate.domain.vo.SendRoomNoMessageVO;
import com.ruoyi.wisdomarbitrate.domain.vo.ToDoCount;
import com.ruoyi.wisdomarbitrate.service.IAdjudicationService;
import com.ruoyi.wisdomarbitrate.service.ICaseApplicationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import com.ruoyi.common.utils.poi.ExcelUtil;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.InputStream;
import java.io.*;
import java.net.URL;
import java.net.URLEncoder;
import java.util.List;
@@ -40,6 +35,8 @@ import java.util.List;
public class CaseApplicationController extends BaseController {
@Autowired
private ICaseApplicationService caseApplicationService;
@Autowired
private IAdjudicationService adjudicationService;
/**
@@ -56,6 +53,16 @@ public class CaseApplicationController extends BaseController {
return getDataTable(list);
}
/**
* 查询批量管理案件列表
*/
@GetMapping("/listBatch")
public TableDataInfo listBatch(CaseApplication caseApplication) {
startPage();
List<CaseApplication> list = caseApplicationService.selectCaseApplicationListBatchByRole(caseApplication);
return getDataTable(list);
}
/**
* 根据角色查询待办数量
* @return
@@ -116,6 +123,19 @@ public class CaseApplicationController extends BaseController {
return toAjax(caseApplicationService.submitCaseApplication(batchCaseApplication.getIds()));
}
/**
* 批量提交立案申请
*/
@Log(title = "批量提交立案申请", businessType = BusinessType.UPDATE)
@PostMapping("/submitCaseApplicationBatch")
public AjaxResult submitCaseApplicationBatch(@RequestBody BatchCaseApplication batchCaseApplication) {
if(StringUtils.isEmpty(batchCaseApplication.getBatchNumber())){
return error("参数校验失败");
}
return toAjax(caseApplicationService.submitCaseApplicationBatch(batchCaseApplication.getBatchNumber()));
}
/**
@@ -171,6 +191,7 @@ public class CaseApplicationController extends BaseController {
return success(sealSignRecordselect);
}
/**
* 查询用印链接
*/
@@ -263,6 +284,25 @@ public class CaseApplicationController extends BaseController {
return toAjax(caseApplicationService.pendTralSure(caseApplication));
}
/**
* 批量组庭审核
*/
// @PreAuthorize("@ss.hasPermi('caseManagement:list:checkgroup')")
@Log(title = "批量组庭审核", businessType = BusinessType.UPDATE)
@PostMapping("/pendTralCheckBatch")
public AjaxResult pendTralCheckBatch(@Validated @RequestBody CaseApplication caseApplication) {
return toAjax(caseApplicationService.pendTralCheckBatch(caseApplication));
}
/**
* 批量组庭确认
*/
@Log(title = "批量组庭确认", businessType = BusinessType.UPDATE)
@PostMapping("/pendTralSureBatch")
public AjaxResult pendTralSureBatch(@Validated @RequestBody CaseApplication caseApplication) {
return toAjax(caseApplicationService.pendTralSureBatch(caseApplication));
}
/**
* 修改开庭时间
*/
@@ -303,6 +343,35 @@ public class CaseApplicationController extends BaseController {
return caseApplicationService.arbitratorCheckArbitrateRecord(caseApplication);
}
/**
* 批量操作仲裁员审核裁决书
*/
@Log(title = "批量操作仲裁员审核裁决书", businessType = BusinessType.UPDATE)
@PostMapping("/arbitrator/checkArbitrateRecordBatch")
public AjaxResult arbitratorCheckArbitrateRecordBatch(@Validated @RequestBody CaseApplication caseApplication) {
return caseApplicationService.arbitratorCheckArbitrateRecordBatch(caseApplication);
}
/**
* 批量部门长审核裁决书
*/
@Log(title = "批量部门长审核裁决书", businessType = BusinessType.UPDATE)
@PostMapping("/checkArbitrateRecordBatch")
public AjaxResult checkArbitrateRecordBatch(@Validated @RequestBody CaseApplication caseApplication) {
return caseApplicationService.checkArbitrateRecordBatch(caseApplication);
}
/**
* 批量核验裁决书
*/
@Log(title = "批量核验裁决书", businessType = BusinessType.UPDATE)
@PostMapping("/verificationArbitrateRecordBatch")
public AjaxResult verificationArbitrateRecordBatch(@Validated @RequestBody CaseApplication caseApplication) {
return toAjax(caseApplicationService.verificationArbitrateRecordBatch(caseApplication));
}
/**
* 是否指派仲裁员
@@ -337,6 +406,18 @@ public class CaseApplicationController extends BaseController {
return success(caseApplicationselect);
}
/**
* 批量提交立案审查
*/
@Log(title = "批量提交立案审查", businessType = BusinessType.UPDATE)
@PostMapping("/submitCaseApplicationCheckBatch")
public AjaxResult submitCaseApplicationCheckBatch(@RequestBody BatchCaseApplication batchCaseApplication) {
if(StringUtils.isEmpty(batchCaseApplication.getBatchNumber()) || batchCaseApplication.getAgreeOrNotCheck()==null){
return error("参数校验失败");
}
return success(caseApplicationService.submitCaseApplicationCheckBatch(batchCaseApplication.getBatchNumber(),batchCaseApplication.getAgreeOrNotCheck(),batchCaseApplication.getCaseCheckReject()));
}
/**
* 下载案件压缩包
*/
@@ -348,6 +429,9 @@ public class CaseApplicationController extends BaseController {
}
/**
* 发送房间号短信
*/
@@ -30,8 +30,18 @@ public class CaseArbitrateController extends BaseController {
@PutMapping("/method")
// @PreAuthorize("@ss.hasPermi('caseManagement:list:checkarbitrationway')")
public AjaxResult examineArbitrateMethod(@Validated @RequestBody CaseApplication caseApplication
, Integer opinion){
return caseArbitrateService.examineArbitrateMethod(caseApplication,opinion);
, Integer opinion, Integer arbitratMethod){
return caseArbitrateService.examineArbitrateMethod(caseApplication,opinion,arbitratMethod);
}
/**
* 批量审核仲裁方式
* @param caseApplication
* @return
*/
@PostMapping("/methodBatch")
public AjaxResult examineArbitrateMethodBatch(@Validated @RequestBody CaseApplication caseApplication){
return caseArbitrateService.examineArbitrateMethodBatch(caseApplication);
}
/**
@@ -44,4 +54,14 @@ public class CaseArbitrateController extends BaseController {
return caseArbitrateService.writtenHear(caseIds);
}
/**
* 批量书面审理
* @param
* @return
*/
@PostMapping("/writtenHearBatch")
public AjaxResult writtenHearBatch(@Validated @RequestBody CaseApplication caseApplication){
return caseArbitrateService.writtenHearBatch(caseApplication);
}
}
@@ -0,0 +1,74 @@
package com.ruoyi.web.controller.wisdomarbitrate;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.wisdomarbitrate.domain.CaseNumRule;
import com.ruoyi.wisdomarbitrate.domain.TemplateManual;
import com.ruoyi.wisdomarbitrate.service.ICaseNumRuleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@RestController
@RequestMapping("/caseNumRule")
public class CaseNumRuleController extends BaseController {
@Autowired
private ICaseNumRuleService caseNumRuleService;
/**
* 新增案件编号规则
* @param caseNumRule
* @return
*/
@PostMapping("/insertCaseNumRule")
public AjaxResult insertCaseNumRule(@RequestBody CaseNumRule caseNumRule){
caseNumRule.setCreateBy(getUsername());
return caseNumRuleService.insertCaseNumRule(caseNumRule);
}
/**
* 修改案件编号规则
* @param caseNumRule
* @return
*/
@PostMapping("/updateCaseNumRule")
public AjaxResult updateCaseNumRule(@RequestBody CaseNumRule caseNumRule){
return caseNumRuleService.updateCaseNumRule(caseNumRule);
}
/**
* 删除案件编号规则
* @param caseNumRule
* @return
*/
@PostMapping("/deleteCaseNumRule")
public AjaxResult deleteCaseNumRule(@RequestBody CaseNumRule caseNumRule){
return caseNumRuleService.deleteCaseNumRule(caseNumRule);
}
/**
* 查询案件编号规则
*/
@GetMapping("/list")
public TableDataInfo list(CaseNumRule caseNumRule) {
startPage();
List<CaseNumRule> list = caseNumRuleService.selectCaseNumRule(caseNumRule);
return getDataTable(list);
}
}
@@ -1,6 +1,9 @@
package com.ruoyi.web.controller.wisdomarbitrate;
import cn.hutool.core.collection.CollectionUtil;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.wisdomarbitrate.domain.BatchCaseApplication;
import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
import com.ruoyi.wisdomarbitrate.domain.dto.CaseConfirmPayDTO;
import com.ruoyi.wisdomarbitrate.service.ICasePaymentService;
@@ -9,6 +12,9 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.List;
/**
* 缴费支付
*/
@@ -41,15 +47,38 @@ public class CasePaymentController {
return paymentService.confirmPay(payDTO);
}
/**
* 批量缴费
* @param casePayDTO 缴费传入参数
* @return 统一响应结果
*/
@PostMapping("/casePayBatch")
public AjaxResult casePayBatch(@Validated @RequestBody CasePayDTO casePayDTO) {
return paymentService.casePayBatch(casePayDTO);
}
/**
* 批量缴费
* @param payDTO 缴费传入参数
* @return 统一响应结果
*/
@PostMapping("/confirmPayBatch")
public AjaxResult confirmPayBatch(@Validated @RequestBody CasePayDTO payDTO) {
return paymentService.confirmPayBatch(payDTO);
}
/**
* 缴费确认
* @param caseApplication
* @param batchCaseApplication
* @return
*/
// @PreAuthorize("@ss.hasPermi('paymentManagement:list:payconfirm')")
@PutMapping("/confirm")
public AjaxResult confirmPayment(@Validated @RequestBody CaseApplication caseApplication) {
return paymentService.confirmPayment(caseApplication);
public AjaxResult confirmPayment(@Validated @RequestBody BatchCaseApplication batchCaseApplication) {
if(CollectionUtil.isEmpty(batchCaseApplication.getIds())){
return AjaxResult.error("参数校验失败");
}
return paymentService.confirmPayment(batchCaseApplication.getIds());
}
/**
* 缴费列表查询
@@ -60,4 +89,22 @@ public class CasePaymentController {
public AjaxResult casePayList(CasePayDTO casePayDTO) {
return paymentService.casePayList(casePayDTO);
}
@PostMapping("/listBatch")
public AjaxResult casePayListBatch(@Validated @RequestBody CasePayDTO casePayDTO) {
return paymentService.casePayListBatch(casePayDTO);
}
/**
* 批量缴费确认
* @param batchCaseApplication
* @return
*/
@PostMapping("/confirmBatch")
public AjaxResult confirmPaymentBatch(@Validated @RequestBody BatchCaseApplication batchCaseApplication) {
if(StringUtils.isEmpty(batchCaseApplication.getBatchNumber())){
return AjaxResult.error("参数校验失败");
}
return paymentService.confirmPaymentBatch(batchCaseApplication.getBatchNumber());
}
}
@@ -222,14 +222,13 @@ public class DeptIdentifyController extends BaseController {
/**
* 根据模板id查询模板字段列表
* @param templateManage
* @param id
* @return
*/
@GetMapping("/getTemplateInfoById")
public AjaxResult getTemplateInfoById(@RequestBody TemplateManage templateManage){
if(templateManage.getId()==null){
return error("参数校验错误");
}
public AjaxResult getTemplateInfoById(@RequestParam("id") Long id){
TemplateManage templateManage = new TemplateManage();
templateManage.setId(id);
List<FatchRule> fatchRuleList = deptIdentifyService.getTemplateInfoById(templateManage);
return AjaxResult.success(fatchRuleList);
}
@@ -38,6 +38,18 @@ public class SysUser extends BaseEntity
/** 用户昵称 */
@Excel(name = "用户名称")
private String nickName;
/** 用户昵称和待办数量 */
private String nickNameAndNum;
public String getNickNameAndNum() {
return nickNameAndNum;
}
public void setNickNameAndNum(String nickNameAndNum) {
this.nickNameAndNum = nickNameAndNum;
}
/** 用户身份证号 */
@Excel(name = "身份证号")
private String idCard;
@@ -0,0 +1,58 @@
package com.ruoyi.common.utils;
import cn.hutool.core.io.IoUtil;
import cn.hutool.crypto.digest.HMac;
import cn.hutool.crypto.digest.HmacAlgorithm;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
public class CheckSignatuerUtils {
public static String getSign(String paramsbody, String accessSec, long timestamp) {
String paramsStr = getParamsStr(paramsbody, timestamp);
return generateSign(paramsStr, accessSec);
}
public static String getParamsStr(String paramsbody,long timestamp) {
StringBuilder strbuild = new StringBuilder();
if (StringUtils.isNotBlank(paramsbody)) {
strbuild.append(paramsbody).append('#');
}
strbuild.append("#timestamp=").append(timestamp);
return strbuild.toString();
}
public static String generateSign(String paramsStr, String accessSec) {
HMac hMac = new HMac(HmacAlgorithm.HmacSHA256, accessSec.getBytes(StandardCharsets.UTF_8));
return hMac.digestHex(paramsStr);
}
public static boolean checkSignuter(String paramsbody) throws Exception {
HttpServletRequest reqParam = ((ServletRequestAttributes) (RequestContextHolder.currentRequestAttributes())).getRequest();
String timestampstr = reqParam.getHeader("timestampstr");
String signstr = reqParam.getHeader("signstr");
String accessSec = "mCFMA6ffe938v79m";
String newSignuter = getSign(paramsbody, accessSec,Long.parseLong(timestampstr));
if (StringUtils.equals(signstr, newSignuter)) {
return true;
}else {
return false;
}
}
}
@@ -1,6 +1,8 @@
package com.ruoyi.common.utils;
import com.ruoyi.common.utils.uuid.UUID;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
@@ -14,18 +16,17 @@ import org.springframework.stereotype.Component;
import javax.activation.DataHandler;
import javax.mail.*;
import javax.mail.internet.*;
import javax.mail.search.*;
import javax.mail.util.ByteArrayDataSource;
import javax.validation.constraints.NotNull;
import java.io.File;
import java.io.IOException;
import java.io.*;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.security.Security;
import java.util.Date;
import java.util.List;
import java.util.Properties;
import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Stream;
/**
* @ClassName EmailInUtil
@@ -48,10 +49,12 @@ public class EmailOutUtil {
// private static String fromOut;
@Value("${spring.mail.host}")
private String hostOut;
@Value("${spring.mail.username}")
private String usernameOut;
@Value("${spring.mail.password}")
private String passwordOut;
// @Value("${spring.mail.username}")
// private String usernameOut;
private String usernameOut="wq18792927508@163.com";
// @Value("${spring.mail.password}")
// private String passwordOut;
private String passwordOut= "WDFHKSEMCKVRELEA";
@Value("${spring.mail.port}")
private Integer portOut;
@@ -98,6 +101,7 @@ public class EmailOutUtil {
String messageContent = "<html><body><p style=\"font-family: Arial, sans-serif; font-size: 18px;\">"+message+"。</p></body></html>";
MimeBodyPart messageBodyPart = new MimeBodyPart();
messageBodyPart.setContent(messageContent, "text/html;charset=utf-8");
messageBodyPart.setContentID(UUID.randomUUID().toString());
Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());
final String SSL_FACTORY = "javax.net.ssl.SSLSocketFactory";
//设置邮件会话参数
@@ -158,7 +162,7 @@ public class EmailOutUtil {
}
//调用Transport的send方法去发送邮件
Transport.send(msg);
} catch (Exception e) {
}catch (Exception e) {
e.printStackTrace();
return Boolean.FALSE;
}
@@ -269,4 +273,164 @@ public class EmailOutUtil {
}
return flag;
}
public void buildReceiveConnect() throws Exception {
//POP3主机名
String host = "pop3.163.com";
//设置传输协议
String protocol = "pop3";
//用户账号
String username = "wq18792927508@163.com";
//密码或者授权码
String password = "WDFHKSEMCKVRELEA";
/*
* 获取Session
*/
Properties props = new Properties();
//协议
props.setProperty("mail.store.protocol", protocol);
//POP3主机名
props.setProperty("mail.pop3.host", host);
props.setProperty("mail.smtp.auth", "true");
props.setProperty("mail.pop3.default-encoding", "UTF-8");
Session session = Session.getDefaultInstance(props, new Authenticator() {
@Override
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(usernameOut, passwordOut);
}
});
URLName urlName = new URLName(protocol, host, 110, null, username, password);
Store store = session.getStore(urlName);
store.connect(username, password);
Folder folder = store.getFolder("INBOX");
folder.open(Folder.READ_ONLY);
}
/**
* 接收邮件
*/
public List<String> receiverMail() {
List<String> messageIds=new ArrayList<>();
// session.setDebug(true);
try {
//POP3主机名
String host = "pop3.163.com";
//设置传输协议
String protocol = "pop3";
//用户账号
String username = "wq18792927508@163.com";
//密码或者授权码
String password = "WDFHKSEMCKVRELEA";
/*
* 获取Session
*/
Properties props = new Properties();
//协议
props.setProperty("mail.store.protocol", protocol);
//POP3主机名
props.setProperty("mail.pop3.host", host);
props.setProperty("mail.smtp.auth", "true");
props.setProperty("mail.pop3.default-encoding", "UTF-8");
Session session = Session.getDefaultInstance(props, new Authenticator() {
@Override
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(usernameOut, passwordOut);
}
});
URLName urlName = new URLName(protocol, host, 110, null, username, password);
Store store = session.getStore(urlName);
store.connect(username, password);
Folder folder = store.getFolder("INBOX");
folder.open(Folder.READ_ONLY);
SearchTerm orTerm = new SubjectTerm("退信");
// Message[] messages = folder.search(orTerm);
Date endTime= new Date();
long oneDayMillis=24*60*60*1000L;
Date startTime=new Date(endTime.getTime()-oneDayMillis);
// SearchTerm comparisonTermGe = new SentDateTerm(ComparisonTerm.GE, startTime);
// SearchTerm comparisonTermLe = new SentDateTerm(ComparisonTerm.LE, endTime);
// SearchTerm comparisonAndTerm = new AndTerm(comparisonTermGe, comparisonTermLe);
// SearchTerm searchTerm = new AndTerm(comparisonAndTerm, orTerm);
Message[] messages = folder.search(orTerm);
if (messages != null) {
Arrays.stream(messages).forEach(message -> {
String messageId="";
try {
messageId = EmailUtil.getMessageId(message,session);
} catch (Exception e) {
e.printStackTrace();
}
messageIds.add(messageId);
});
}
folder.close(false);
store.close();
} catch (Exception e) {
return messageIds;
}
return messageIds;
}
public void analyseMail(Session session, Object content) throws Exception {
if (content instanceof Multipart) {
Multipart multipart = (Multipart) content;
for (int i = 0; i < multipart.getCount(); i++) {
BodyPart bodyPart = multipart.getBodyPart(i);
// if (bodyPart.isMimeType("message/rfc822")) { if(bodyPart.getContentType().startsWith("Message/Rfc822"));
// MimeMessage mimeMessage = new MimeMessage(session, bodyPart.getInputStream());
// }
if(bodyPart.isMimeType("Message/Rfc822")){
MimeMessage mimeMessage = new MimeMessage(session, bodyPart.getInputStream());
}
}
}
}
public static String getMessageId(Part part) throws Exception {
if (!part.isMimeType("multipart/*")) {
return "";
}
Multipart multipart = (Multipart) part.getContent();
for (int i = 0; i < multipart.getCount(); i++) {
BodyPart bodyPart = multipart.getBodyPart(i);
if (part.isMimeType("message/rfc822")) {
return getMessageId((Part) part.getContent());
}
InputStream inputStream = bodyPart.getInputStream();
try (BufferedReader br = new BufferedReader(new InputStreamReader(inputStream))) {
String strLine;
while ((strLine = br.readLine()) != null) {
if (strLine.startsWith("Message_Id:")) {
String[] split = strLine.split("Message_Id:");
return split.length > 1 ? split[1].trim() : null;
}
}
}
}
return "";
}
//检查退信邮件
// Folder folder = ...; //打开收件箱
// Message[] messages = folder.getMessages();
// for (Message message : messages) {
// if (message.getSubject().contains("Delivery Status Notification")) {
// System.out.println("Delivery failed for recipient: " + message.getRecipients()[0]);
// }
// }
}
@@ -0,0 +1,68 @@
package com.ruoyi.common.utils;
import lombok.extern.slf4j.Slf4j;
import javax.mail.*;
import javax.mail.internet.MimeMessage;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
@Slf4j
public final class EmailUtil {
private static final String multipart = "multipart/*";
public static String getMessageId(Part part, Session session) throws Exception {
if (!part.isMimeType(multipart)) {
return "";
}
Multipart multipart = (Multipart) part.getContent();
for (int i = 0; i < multipart.getCount(); i++) {
BodyPart bodyPart = multipart.getBodyPart(i);
if(bodyPart.getContentType().contains("Message/Rfc822")){
MimeMessage mimeMessage = new MimeMessage(session, bodyPart.getInputStream());
if(mimeMessage.getSubject()!=null&&mimeMessage.getSubject().contains("裁决书")){
String[] split = mimeMessage.getSubject().split("裁决书");
if(split.length>0){
return split[0];
}
}
}
} return "";
}
public static boolean isContainAttachment(Part part) {
boolean attachFlag = false;
try {
if (part.isMimeType(multipart)) {
Multipart mp = (Multipart) part.getContent();
for (int i = 0; i < mp.getCount(); i++) {
BodyPart mpart = mp.getBodyPart(i);
String disposition = mpart.getDisposition();
if ((disposition != null) && ((disposition.equals(Part.ATTACHMENT)) || (disposition.equals(Part.INLINE))))
attachFlag = true;
else if (mpart.isMimeType(multipart)) {
attachFlag = isContainAttachment((Part) mpart);
} else {
String contype = mpart.getContentType();
if (contype.toLowerCase().contains("application"))
attachFlag = true;
if (contype.toLowerCase().contains("name"))
attachFlag = true;
}
}
} else if (part.isMimeType("message/rfc822")) {
attachFlag = isContainAttachment((Part) part.getContent());
}
} catch (MessagingException | IOException e) {
e.printStackTrace();
}
return attachFlag;
}
}
@@ -72,6 +72,7 @@ public class SmsUtils {
* 模板参数: 模板参数的个数需要与 TemplateId 对应模板的变量个数保持一致,若无模板参数,则设置为空
*/
private String[] templateParamSet;
private Long caseId;
}
}
@@ -10,6 +10,7 @@ import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysDept;
import com.ruoyi.system.mapper.*;
import com.ruoyi.wisdomarbitrate.domain.Arbitrator;
import com.ruoyi.wisdomarbitrate.mapper.CaseApplicationMapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@@ -61,6 +62,9 @@ public class SysUserServiceImpl implements ISysUserService {
@Autowired
private ISysConfigService configService;
@Autowired
private CaseApplicationMapper caseApplicationMapper;
@Autowired
protected Validator validator;
@@ -78,7 +82,19 @@ public class SysUserServiceImpl implements ISysUserService {
@Override
public List<SysUser> selectUserListByAdRole(Arbitrator arbitrator) {
return userMapper.selectUserListByAdRole(arbitrator);
List<SysUser> sysUsers = userMapper.selectUserListByAdRole(arbitrator);
if(sysUsers!=null&&sysUsers.size()>0){
for(SysUser sysUser: sysUsers){
Long userId = sysUser.getUserId();
int casenum = caseApplicationMapper.selectCasenum(userId.toString());
String nickName = sysUser.getNickName();
String nickNamenew = nickName + "(待办案件数量" + casenum + "个)";
sysUser.setNickNameAndNum(nickNamenew);
}
}
return sysUsers;
}
/**
@@ -0,0 +1,26 @@
package com.ruoyi.wisdomarbitrate;
import lombok.Data;
import java.util.List;
@Data
public class StringIdsReq {
private List<String> ids;
/**
* 签署人账号(即仲裁员手机号)
*/
private String psnAccount;
/**
* 签署人id
*/
private String psnId ;
/**
* 机构账户
*/
private String orgId ;
/**
* 批号
*/
private Integer batchNumber;
}
@@ -22,4 +22,10 @@ public class BatchCaseApplication {
private Integer opinion;
/** 驳回原因 */
private String caseCheckReject;
/**
* 批号
*/
private String batchNumber;
}
@@ -50,6 +50,19 @@ public class CaseApplication extends BaseEntity {
/** 案件状态 */
private Integer caseStatus;
private String caseStatusstr;
/** 申请人是否书面审理 */
private Integer applicantIsWrittenHear;
/** 被申请人是否书面审理 */
private Integer respondentIsWrittenHear;
/** 开庭方式是否一致 */
private Integer arbitraMethodIssame;
/** 仲裁方式说明 */
private String arbitratMethodIllustrate;
/** 案件申请表ID */
private Long caseAppliId;
@@ -395,9 +408,15 @@ public class CaseApplication extends BaseEntity {
/**
* 批号
*/
private String batchNumber;
private Integer batchNumber;
/**
* 自定义字段
*/
private List<ColumnValue> columnValues;
/**
* 待办状态,0待办,1已办
*/
private Integer pendingStatus;
/** e签宝流程id */
private String signFlowId;
}
@@ -0,0 +1,28 @@
package com.ruoyi.wisdomarbitrate.domain;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import lombok.Data;
@Data
public class CaseNumRule extends BaseEntity {
/** ID */
private Long id;
/** 类型 */
private Integer ruleType;
/** 前缀 */
private String prefixstr;
/** 时间格式 */
private Integer dateFormat;
/** 机构名称 */
private String deptName;
/** 机构名称首字符拼写 */
private String deptNameFirchar;
/** 当前编号 */
private String currentNum;
}
@@ -1,7 +1,13 @@
package com.ruoyi.wisdomarbitrate.domain;
import com.ruoyi.common.core.domain.BaseEntity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@NoArgsConstructor
@AllArgsConstructor
public class SealSignRecord extends BaseEntity {
private static final long serialVersionUID = 1L;
@@ -25,15 +31,6 @@ public class SealSignRecord extends BaseEntity {
private String orgnizeNamepsnName;
String fileDownloadUrl;
public String getFileDownloadUrl() {
return fileDownloadUrl;
}
public void setFileDownloadUrl(String fileDownloadUrl) {
this.fileDownloadUrl = fileDownloadUrl;
}
/** 流程状态 */
private Integer signFlowStatus;
/** 签名状态 */
@@ -44,171 +41,11 @@ public class SealSignRecord extends BaseEntity {
/** 签名链接 */
private String signUrl;
public String getSignUrl() {
return signUrl;
}
public void setSignUrl(String signUrl) {
this.signUrl = signUrl;
}
public String getSealUrl() {
return sealUrl;
}
public void setSealUrl(String sealUrl) {
this.sealUrl = sealUrl;
}
/** 用印链接 */
private String sealUrl;
private Long caseAppliId;
public Long getCaseAppliId() {
return caseAppliId;
}
public void setCaseAppliId(Long caseAppliId) {
this.caseAppliId = caseAppliId;
}
public Integer getPsnsignStatus() {
return psnsignStatus;
}
public void setPsnsignStatus(Integer psnsignStatus) {
this.psnsignStatus = psnsignStatus;
}
public Integer getOrgsignStatus() {
return orgsignStatus;
}
public void setOrgsignStatus(Integer orgsignStatus) {
this.orgsignStatus = orgsignStatus;
}
public Integer getSignFlowStatus() {
return signFlowStatus;
}
public void setSignFlowStatus(Integer signFlowStatus) {
this.signFlowStatus = signFlowStatus;
}
public String getFileid() {
return fileid;
}
public void setFileid(String fileid) {
this.fileid = fileid;
}
public String getFilename() {
return filename;
}
public void setFilename(String filename) {
this.filename = filename;
}
public String getSignFlowid() {
return signFlowid;
}
public void setSignFlowid(String signFlowid) {
this.signFlowid = signFlowid;
}
public String getPensonAccount() {
return pensonAccount;
}
public void setPensonAccount(String pensonAccount) {
this.pensonAccount = pensonAccount;
}
public String getPensonName() {
return pensonName;
}
public void setPensonName(String pensonName) {
this.pensonName = pensonName;
}
public String getOrgnizeName() {
return orgnizeName;
}
public void setOrgnizeName(String orgnizeName) {
this.orgnizeName = orgnizeName;
}
public String getOrgnizeNamePsnAccount() {
return orgnizeNamePsnAccount;
}
public void setOrgnizeNamePsnAccount(String orgnizeNamePsnAccount) {
this.orgnizeNamePsnAccount = orgnizeNamePsnAccount;
}
public String getOrgnizeNamepsnName() {
return orgnizeNamepsnName;
}
public void setOrgnizeNamepsnName(String orgnizeNamepsnName) {
this.orgnizeNamepsnName = orgnizeNamepsnName;
}
public String getPositionPagepsn() {
return positionPagepsn;
}
public void setPositionPagepsn(String positionPagepsn) {
this.positionPagepsn = positionPagepsn;
}
public double getPositionXpsn() {
return positionXpsn;
}
public void setPositionXpsn(double positionXpsn) {
this.positionXpsn = positionXpsn;
}
public double getPositionYpsn() {
return positionYpsn;
}
public void setPositionYpsn(double positionYpsn) {
this.positionYpsn = positionYpsn;
}
public String getPositionPageorg() {
return positionPageorg;
}
public void setPositionPageorg(String positionPageorg) {
this.positionPageorg = positionPageorg;
}
public double getPositionXorg() {
return positionXorg;
}
public void setPositionXorg(double positionXorg) {
this.positionXorg = positionXorg;
}
public double getPositionYorg() {
return positionYorg;
}
public void setPositionYorg(double positionYorg) {
this.positionYorg = positionYorg;
}
/** 签名位置页数 */
private String positionPagepsn;
/** 签名位置x坐标 */
@@ -223,13 +60,5 @@ public class SealSignRecord extends BaseEntity {
private double positionYorg;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
}
@@ -25,4 +25,5 @@ public class CaseConfirmPayDTO {
* 缴费凭证
*/
private List<CaseAttach> payOrderList;
}
@@ -38,6 +38,9 @@ public class CaseEvidenceDTO {
/** 是否管辖异议申请 */
private Integer objectiJuris;
/** 被申请人是否书面审理 */
private Integer respondentIsWrittenHear;
/**
* 案件仲裁员
@@ -35,4 +35,8 @@ public class CasePayDTO {
* 缴费凭证
*/
private List<CaseAttach> payOrderList;
/**
* 批号
*/
private String batchNumber;
}
@@ -0,0 +1,419 @@
package com.ruoyi.wisdomarbitrate.domain.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.wisdomarbitrate.domain.CaseAffiliate;
import com.ruoyi.wisdomarbitrate.domain.CaseAttach;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
@Data
public class CaseApplicationVO {
private static final long serialVersionUID = 1L;
/**
* 查询案件时区分是否待办案件,0待办案件,1已办案件
*/
private String selectCaseStatus;
/** ID */
private Long id;
/** 案件名称 */
@Excel(name = "案件名称")
private String caseName;
/** 案件编号 */
// @Excel(name = "案件编号")
private String caseNum;
/** 案件标的 */
@Excel(name = "案件标的")
private BigDecimal caseSubjectAmount;
/**
* 模板id
*/
private Long templateId;
/** 立案日期 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date registerDate;
/** 仲裁方式 */
private Integer arbitratMethod;
/**
* 是否导入,0手动录入,1导入,默认0
*/
private Integer importFlag;
/** 仲裁方式名称 */
private String arbitratMethodName;
/** 案件状态 */
private Integer caseStatus;
private String caseStatusstr;
/** 申请人是否书面审理 */
private Integer applicantIsWrittenHear;
/** 被申请人是否书面审理 */
private Integer respondentIsWrittenHear;
/** 开庭方式是否一致 */
private Integer arbitraMethodIssame;
/** 仲裁方式说明 */
private String arbitratMethodIllustrate;
/** 案件申请表ID */
private Long caseAppliId;
/** 开庭日期 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date hearDate;
/** 借款开始日期 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "借款开始日期")
private Date loanStartDate;
/** 借款结束日期 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "借款结束日期")
private Date loanEndDate;
/** 合同编号 */
@Excel(name = "合同编号")
private String contractNumber;
/** 申请人主张欠本金 */
@Excel(name = "申请人主张欠本金")
private BigDecimal claimPrinciOwed;
/** 申请人主张欠利息 */
@Excel(name = "申请人主张欠利息")
private BigDecimal claimInterestOwed;
/** 申请人主张违约金 */
@Excel(name = "申请人主张违约金")
private BigDecimal claimLiquidDamag;
/** 申请人请求仲裁庭裁决 */
@Excel(name = "申请人请求仲裁庭裁决",width = 36)
private String requestRule;
/** 是否财产保全申请 */
@Excel(name = "是否财产保全申请",width = 26,combo= {"是","否"},readConverterExp = "0=否,1=是")
private Integer properPreser;
/** 申请人仲裁请求及事实和理由 */
@Excel(name = "申请人仲裁请求及事实和理由",width = 36)
private String arbitratClaims;
/** 仲裁应缴费用 */
private BigDecimal feePayable;
/** 开始在线视频时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date beginVideoDate;
/** 在线视频人员 */
private String onlineVideoPerson;
/** 仲裁员id */
private String arbitratorId;
/** 仲裁员名称 */
private String arbitratorName;
/** 案件描述 */
private String caseDescribe;
/** 裁决书URL */
private String filearbitraUrl;
/** 是否同意组庭 */
private Integer isAgreePendTral;
/** 是否有异议需要举证 */
private Integer objectionAddEviden;
/** 是否需要开庭审理 */
private Integer openCourtHear;
/** 是否仲裁反请求 */
private Integer adjudicaCounter;
/**
* 仲裁反请求原因
*/
private String adjudicaCounterReason;
/** 被申请人是否缺席 */
private Integer isAbsence;
/** 是否管辖异议申请 */
private Integer objectiJuris;
/** 被申请人质证意见 */
private String responCrossOpin;
/** 被申请人的答辩意见 */
private String responDefenOpini;
/** 申请人是否缺席 */
private Integer appliIsAbsen;
/** 申请人质证意见 */
private String applicaCrossOpin;
/** 支付状态 */
private Integer paymentStatus;
/** 支付状态描述 */
private String paymentStatusName;
/**
* 支付方式code,0线上支付,1线下支付
*/
private Integer payTypeCode;
/**
* 支付方式name,0线上支付,1线下支付
*/
private String payTypeName;
// 导入校验失败信息
private StringBuilder errorMsg;
/**
* 是否锁定,0-否,1-是
*/
private Integer lockStatus;
/** 案件状态名称 */
private String caseStatusName;
/** 是否同意审核 */
private Integer agreeOrNotCheck;
/** 申请人名称 */
private String applicantName;
/** 被申请人名称 */
private String respondentName;
/**
* 用户身份证号
*/
private String idCard;
/**
* 用户id
*/
private String userId;
/**
* 登录用户用户名
*/
private String loginUserName;
private List<Long> deptIds;
/**
* 部门长状态
*/
private List<Integer> deptHeadStatus;
/**
* 代理人角色有关部门
*/
private List<Long> agentDeptIds;
/**
* 财务状态
*/
private Integer financeStatus;
/**
* 是否是被申请人,仲裁员,部门长,财务,代理人,0-否,1-是
*/
private Integer isOtherRole;
/**
* 案件日志id
*/
private Long caseLogId;
/** 仲裁结果 */
private String caseResult;
/** 案件关联人信息 */
private List<CaseAffiliate> caseAffiliates;
private List<Integer> caseStatusList;
private List<Integer> annexTypeList;
private Integer annexType;
/**
* 案件附件列表
*/
private List<CaseAttach> caseAttachList;
/**
* 申请人主体信息
*/
/** 姓名 */
@Excel(name = "申请人主体信息-申请人(机构)",width = 26)
private String name;
/** 身份证号 */
@Excel(name = "申请人主体信息-代码",width = 26)
private String identityNum;
/** 申请人主体信息-法定代表人 */
@Excel(name = "申请人主体信息-法定代表人",width = 26)
private String compLegalPerson;
/** 申请人主体信息-法定代表人 */
@Excel(name = "申请人主体信息-法定代表人职位",width = 26)
private String compLegalperPost;
/**
* 申请人主体信息-申请人(机构)id
*/
private String nameId;
/** 联系电话 */
@Excel(name = "申请人主体信息-联系电话",width = 26)
private String contactTelphone;
/** 联系地址 */
@Excel(name = "申请人主体信息-联系地址",width = 26)
private String contactAddress;
/** 单位电话 */
@Excel(name = "申请人主体信息-单位电话",width = 26)
private String workTelphone;
/** 单位地址 */
@Excel(name = "申请人主体信息-单位地址",width = 26)
private String workAddress;
/** 申请人住所 */
@Excel(name = "申请人主体信息-住所",width = 26)
private String residenAffiliAppli;
/** 申请人邮箱 */
@Excel(name = "申请人主体信息-邮箱",width = 26)
private String email;
/** 代理人姓名 */
@Excel(name = "申请人主体信息-代理人姓名",width = 26)
private String nameAgent;
/** 身份证号 */
@Excel(name = "申请人主体信息-代理人身份证号",width = 26)
private String identityNumAgent;
/** 联系电话 */
@Excel(name = "申请人主体信息-代理人联系电话",width = 26)
private String contactTelphoneAgent;
/** 联系地址 */
@Excel(name = "申请人主体信息-代理人联系地址",width = 26)
private String contactAddressAgent;
/** 申请人代理人职称 */
@Excel(name = "申请人主体信息-代理人职称",width = 26)
private String appliAgentTitle;
/**
* 被申请人主体信息
*/
/** 姓名 */
@Excel(name = "被申请人主体信息-申请人姓名",width = 26)
private String debtorName;
/** 身份证号 */
@Excel(name = "被申请人主体信息-身份证号",width = 26)
private String debtorIdentityNum;
/** 被申请人主体信息-性别 */
@Excel(name = "被申请人主体信息-性别",width = 26,combo= {"男","女"},readConverterExp = "0=男,1=女")
private String responSex;
/** 被申请人主体信息-出生年月日 */
@Excel(name = "被申请人主体信息-出生年月日",width = 26)
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date responBirth;
/** 联系电话 */
@Excel(name = "被申请人主体信息-联系电话",width = 26)
private String debtorContactTelphone;
/** 联系地址 */
@Excel(name = "被申请人主体信息-联系地址",width = 26)
private String debtorContactAddress;
/** 被申请人住所 */
@Excel(name = "被申请人主体信息-住所",width = 26)
private String residenAffiliRespon;
/** 单位电话 */
@Excel(name = "被申请人主体信息-单位电话",width = 26)
private String debtorWorkTelphone;
/** 单位地址 */
@Excel(name = "被申请人主体信息-单位地址",width = 26)
private String debtorWorkAddress;
/** 邮箱 */
@Excel(name = "被申请人主体信息-邮箱",width = 26)
private String debtorEmail;
/** 代理人姓名 */
@Excel(name = "被申请人主体信息-代理人姓名",width = 26)
private String debtorNameAgent;
/** 身份证号 */
@Excel(name = "被申请人主体信息-代理人身份证号",width = 26)
private String debtorIdentityNumAgent;
/** 联系电话 */
@Excel(name = "被申请人主体信息-代理人联系电话",width = 26)
private String debtorContactTelphoneAgent;
/** 联系地址 */
@Excel(name = "被申请人主体信息-代理人联系地址",width = 26)
private String debtorContactAddressAgent;
/**
* 申请机构id
*/
private String applicationOrganId;
/**
* 版本号
*/
private Integer version;
/**
* 修改案件的提交状态,0-未提交,1-已提交,2-同意,3-拒绝,4-撤销
*/
private Integer updateSubmitStatus;
/** 合同名称 */
private String contractName;
/**
* 事实和理由
*/
private String facts;
/**
* 合同甲方
*/
private String partyA;
/**
* 利率
*/
private String interestRate;
/**
* 待还金额
*/
private String outstandingMoney;
/**
* 调解达成协议内容
*/
private String mediationAgreement;
/**
* 金融消费纠纷基本情况
*/
private String disputes;
/**
* 贷款类型
*/
private String loanType;
/**
* 贷款期限
*/
private String loanTerm;
/**
* 本案争议焦点
*/
private String caseFocus;
/**
* 本案事实
*/
private String caseFacts;
/**
* 被申请人对上述材料的质证意见
*/
private String respondentOpinion;
/**
* 申请人对上述材料的质证意见
*/
private String applicantOpinion;
/**
* 批号
*/
private Integer batchNumber;
/**
* 待办状态,0待办,1已办
*/
private Integer pendingStatus;
/** e签宝流程id */
private String signFlowId;
}
@@ -4,14 +4,15 @@ import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
import com.ruoyi.wisdomarbitrate.domain.CaseApplicationPay;
import lombok.Data;
import java.math.BigDecimal;
import java.util.List;
@Data
public class CasePayListVO {
/**
* 订单总金额 单位:分
* 订单总金额
*/
private int totalFee;
private BigDecimal totalFee;
/**
* 案件总条数
@@ -38,7 +38,7 @@ public interface CaseApplicationLogMapper {
Integer selectMaxVersionBySecret(@Param("caseAppliId")Long id);
/**
* 根据案件id删除案件记录表和案件关联人日志表
* 删除日志
* @param ids
*/
void batchDeleteLog(@Param("ids") List<Long> ids);
@@ -46,4 +46,11 @@ public interface CaseApplicationLogMapper {
CaseApplication selectBeforeCase(@Param("caseId") Long caseId, @Param("version")Integer version);
Integer batchSave(@Param("list")List<CaseApplication> caseApplications);
/**
* 根据案件id查询所有的日志id
* @param ids
* @return
*/
List<Long> selectLogsByCaseIds(@Param("ids")List<Long> ids);
}
@@ -131,4 +131,12 @@ public interface CaseApplicationMapper {
* @return
*/
int batchSave(@Param("list")List<CaseApplication> caseApplications);
int selectCasenum(@Param("userId") String userId);
List<CaseApplication> selectAdminCaseApplicationListBatch(CaseApplication caseApplication);
List<CaseApplication> listCaseApplicationByBatchNumber(CaseApplication caseApplication);
List<CaseApplication> selectAdminCaseApplicationListBatch1(CaseApplication caseApplication);
}
@@ -0,0 +1,20 @@
package com.ruoyi.wisdomarbitrate.mapper;
import com.ruoyi.wisdomarbitrate.domain.CaseNumRule;
import java.util.List;
public interface CaseNumRuleMapper {
int insertCaseNumRule(CaseNumRule caseNumRule);
int updateCaseNumRule(CaseNumRule caseNumRule);
int deleteCaseNumRule(CaseNumRule caseNumRule);
List<CaseNumRule> selectCaseNumRules(CaseNumRule caseNumRule);
int countCaseNumRule(CaseNumRule caseNumRule);
CaseNumRule selectCaseNumRule(CaseNumRule caseNumRule);
}
@@ -2,10 +2,12 @@ package com.ruoyi.wisdomarbitrate.mapper;
import com.ruoyi.wisdomarbitrate.domain.CasePaymentRecord;
import java.util.List;
public interface CasePaymentRecordMapper {
int saveRecord(CasePaymentRecord casePaymentRecord);
CasePaymentRecord queryRecord(String orderNumber);
List<CasePaymentRecord> queryRecord(String orderNumber);
void update(CasePaymentRecord casePaymentRecord);
@@ -2,17 +2,33 @@ package com.ruoyi.wisdomarbitrate.mapper;
import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
import com.ruoyi.wisdomarbitrate.domain.SealSignRecord;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface SealSignRecordMapper {
List<SealSignRecord> selectSealSignRecord(SealSignRecord sealSignRecord);
/**
* 查询已签署和签署中的文件
* @param sealSignRecord
* @return
*/
List<SealSignRecord> selectSealSignRecordbyStat(SealSignRecord sealSignRecord);
/**
* 差询等待签署,签署中的案件
* @param penSonAccount 签署人员
* @return
*/
List<CaseApplication> selectSealSigning(@Param("penSonAccount") String penSonAccount, @Param("caseStatus") Integer caseStatus);
int updataSealSignRecord(SealSignRecord sealSignRecord);
void insertSealSignRecord(SealSignRecord sealSignRecord);
List<CaseApplication> selectsignFlow(@Param("batchNumber") Integer batchNumber,@Param("caseStatus") Integer caseStatus);
}
@@ -2,6 +2,7 @@ package com.ruoyi.wisdomarbitrate.mapper;
import com.ruoyi.wisdomarbitrate.domain.SmsSendRecord;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@@ -11,4 +12,11 @@ public interface SmsRecordMapper {
int saveSmsSendRecord(SmsSendRecord smsSendRecord);
List<SmsSendRecord> getSmsSendRecord(SmsSendRecord smsSendRecord);
/**
* 批量新增
* @param smsSendRecordList
* @return
*/
int batchSaveSmsSendRecord(@Param("list") List<SmsSendRecord> smsSendRecordList);
}
@@ -1,10 +1,14 @@
package com.ruoyi.wisdomarbitrate.service;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.exception.EsignDemoException;
import com.ruoyi.wisdomarbitrate.StringIdsReq;
import com.ruoyi.wisdomarbitrate.domain.BatchCaseApplication;
import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
import com.ruoyi.wisdomarbitrate.domain.SealSignRecord;
import com.ruoyi.wisdomarbitrate.domain.vo.LogisticsInfoVO;
import java.io.IOException;
import java.util.List;
public interface IAdjudicationService {
@@ -39,4 +43,28 @@ public interface IAdjudicationService {
* @return
*/
AjaxResult batchDocument(List<Long> ids);
/**
* 根据签署流程id查询批量签名链接
* @param idsReq
* @return
*/
SealSignRecord selectBatchSignUrl( StringIdsReq idsReq);
/**
* 根据仲裁员手机号分页查询等待签署,签署中的裁决书
* @param personAccount
* @return
*/
List<CaseApplication> selectSealSigning(String personAccount,Integer caseStatus);
SealSignRecord selectBatchSealUrl(StringIdsReq idsReq);
SealSignRecord getSignUrlBatch(StringIdsReq idsReq);
SealSignRecord getSealUrlBatch(StringIdsReq idsReq);
AjaxResult caseFileBatch(Integer batchNumber);
AjaxResult serviceBatch(Integer batchNumber) throws EsignDemoException, IOException;
}
@@ -21,6 +21,8 @@ public interface ICaseApplicationService {
int insertcaseApplication(CaseApplication caseApplication);
int insertcaseApplication1(CaseApplication caseApplication);
int selectCaseApplicationCount(CaseApplication caseApplication);
AjaxResult editCaseApplication(CaseApplication caseApplication);
@@ -135,4 +137,20 @@ public interface ICaseApplicationService {
AjaxResult editCaseApplicationDefineval(CaseApplication caseApplication);
CaseAttach downloadCaseZipFile(CaseApplication caseApplication);
List<CaseApplication> selectCaseApplicationListBatchByRole(CaseApplication caseApplication);
int submitCaseApplicationBatch(String batchNumber);
int submitCaseApplicationCheckBatch(String batchNumber, Integer agreeOrNotCheck, String caseCheckReject);
int pendTralCheckBatch(CaseApplication caseApplication);
int pendTralSureBatch(CaseApplication caseApplication);
int verificationArbitrateRecordBatch(CaseApplication caseApplication);
AjaxResult arbitratorCheckArbitrateRecordBatch(CaseApplication caseApplication);
AjaxResult checkArbitrateRecordBatch(CaseApplication caseApplication);
}
@@ -13,5 +13,9 @@ public interface ICaseArbitrateService {
AjaxResult writtenHear(CaseIds caseIds);
AjaxResult examineArbitrateMethod(CaseApplication caseApplication, Integer opinion);
AjaxResult examineArbitrateMethod(CaseApplication caseApplication, Integer opinion, Integer arbitratMethod);
AjaxResult examineArbitrateMethodBatch(CaseApplication caseApplication);
AjaxResult writtenHearBatch(CaseApplication caseApplication);
}
@@ -0,0 +1,20 @@
package com.ruoyi.wisdomarbitrate.service;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.wisdomarbitrate.domain.CaseNumRule;
import java.util.List;
public interface ICaseNumRuleService {
AjaxResult insertCaseNumRule(CaseNumRule caseNumRule);
AjaxResult updateCaseNumRule(CaseNumRule caseNumRule);
AjaxResult deleteCaseNumRule(CaseNumRule caseNumRule);
List<CaseNumRule> selectCaseNumRule(CaseNumRule caseNumRule);
}
@@ -6,13 +6,15 @@ import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
import com.ruoyi.wisdomarbitrate.domain.dto.CaseConfirmPayDTO;
import com.ruoyi.wisdomarbitrate.domain.dto.CasePayDTO;
import java.util.List;
public interface ICasePaymentService {
/**
* 案件缴费
*/
AjaxResult casePay(CasePayDTO casePayDTO);
AjaxResult confirmPayment(CaseApplication caseApplication);
AjaxResult confirmPayment( List<Long> ids);
/**
* 确认缴费
@@ -24,4 +26,11 @@ public interface ICasePaymentService {
AjaxResult casePayList(CasePayDTO casePayDTO);
AjaxResult confirmPayBatch(CasePayDTO payDTO);
AjaxResult casePayListBatch(CasePayDTO casePayDTO);
AjaxResult confirmPaymentBatch(String batchNumber);
AjaxResult casePayBatch(CasePayDTO casePayDTO);
}
@@ -5,15 +5,24 @@ import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.deepoove.poi.data.PictureRenderData;
import com.google.gson.Gson;
import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import com.ruoyi.common.constant.CaseApplicationConstants;
import com.ruoyi.common.constant.FileTransformation;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.EsignHttpResponse;
import com.ruoyi.common.core.domain.entity.SysDictData;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.exception.EsignDemoException;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.*;
import com.ruoyi.common.utils.file.SaaSAPIFileUtils;
import com.ruoyi.common.utils.thread.MultipleThreadListParam;
import com.ruoyi.common.utils.thread.MultipleThreadWorkUtil;
import com.ruoyi.system.mapper.SysDictDataMapper;
import com.ruoyi.wisdomarbitrate.StringIdsReq;
import com.ruoyi.wisdomarbitrate.domain.vo.BookSendVO;
import com.ruoyi.wisdomarbitrate.domain.vo.ColumnValue;
import com.ruoyi.wisdomarbitrate.mapper.*;
@@ -24,6 +33,7 @@ import com.ruoyi.wisdomarbitrate.domain.vo.LogisticsInfoVO;
import com.ruoyi.wisdomarbitrate.service.IAdjudicationService;
import com.ruoyi.wisdomarbitrate.service.ICaseApplicationService;
import com.ruoyi.wisdomarbitrate.service.ICaseLogRecordService;
import com.ruoyi.wisdomarbitrate.utils.SignAward;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
@@ -57,6 +67,7 @@ import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import static com.ruoyi.common.utils.PageUtils.startPage;
import static com.ruoyi.common.utils.SecurityUtils.getUsername;
@Service
@@ -92,9 +103,14 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
private FatchRuleMapper fatchRuleMapper;
@Autowired
private SysDictDataMapper dictDataMapper;
@Autowired
private SealManageMapper sealManageMapper;
@Autowired
private SealSignRecordMapper sealSignRecordMapper;
// 仲裁反请求模板内容
private final String counterclaim= "在《2022年版仲裁规则》第十八条第(一)项规定的期限内,被申请人向秘书处提交了" +
private final String counterclaim = "在《2022年版仲裁规则》第十八条第(一)项规定的期限内,被申请人向秘书处提交了" +
"《仲裁反请求申请书》及证据材料。仲裁委依据《2022年版仲裁规则》第十八条的规定受理了该仲裁反请求案申请。" +
"仲裁反请求案件受理后,秘书处向被申请人发送了仲裁反请求通知书及附件,向申请人发送了仲裁反请求通知书及附件、仲裁反请求申请书及附件。";
// 财产保全内容
@@ -104,36 +120,37 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
String jurisdictionalObjection = "本案受理后,被申请人向仲裁委提交了《管辖异议申请书》,认为" +
",仲裁委经审理,当庭驳回了被申请人的管辖异议申请,并告知被申请人具体的事实和理由将在裁决书中一并列明。";
// 线上开庭时+线上仲裁
String onLineDate="{{onLineDate}}";
String onLine = "仲裁庭审阅了申请人提交的仲裁申请书、证据材料后,于"+onLineDate+"通过仲裁委智慧仲裁平台开庭审理了本案。";
String onLineDate = "{{onLineDate}}";
String onLine = "仲裁庭审阅了申请人提交的仲裁申请书、证据材料后,于" + onLineDate + "通过仲裁委智慧仲裁平台开庭审理了本案。";
// 开庭+线下仲裁
String offLineDate="{{offLineDate}}";
String offLine = "仲裁庭审阅了申请人提交的仲裁申请书、证据材料后,于 "+offLineDate+"在仲裁委所在地开庭审理了本案。";
String offLineDate = "{{offLineDate}}";
String offLine = "仲裁庭审阅了申请人提交的仲裁申请书、证据材料后,于 " + offLineDate + "在仲裁委所在地开庭审理了本案。";
//书面仲裁时
String writtenDate="{{writtenDate}}";
String written = "仲裁庭审阅了申请人提交的仲裁申请书、证据材料后,于"+writtenDate+"在仲裁委所在地开庭审理了本案。";
String writtenDate = "{{writtenDate}}";
String written = "仲裁庭审阅了申请人提交的仲裁申请书、证据材料后,于" + writtenDate + "在仲裁委所在地开庭审理了本案。仲裁庭审阅了申请人提交的仲裁申请书、证据材料后,根据《2022年版仲裁规则》第五十八条的规定对本案进行了书面审理。 ";
//开庭+缺席审理
String absent = "申请人的特别授权委托代理人{{agentName}}"+"出席了庭审。被申请人经依法送达开庭通知,无正当理由未出席庭审,故仲裁庭依据" +
String absent = "申请人的特别授权委托代理人{{agentName}}" + "出席了庭审。被申请人经依法送达开庭通知,无正当理由未出席庭审,故仲裁庭依据" +
"《2022年版仲裁规则》第四十条第(二)项的规定,对本案进行了缺席审理。庭审中,申请人陈述了仲裁请求事项及事实与理由,出示了证据材料并进行了说明,\" +\n" +
" \"发表了意见,回答了仲裁庭的提问,并作了最后陈述。因被申请人缺席庭审,故仲裁庭无法组织调解。"+"综上,仲裁庭依据《上海仲裁委员会仲裁规则》(2022年7月1日起施行的版本)" +
" \"发表了意见,回答了仲裁庭的提问,并作了最后陈述。因被申请人缺席庭审,故仲裁庭无法组织调解。" + "综上,仲裁庭依据《上海仲裁委员会仲裁规则》(2022年7月1日起施行的版本)" +
"第四十条第(二)项、第五十一条的规定,缺席裁决如下:";
// 开庭+出席
String attend="申请人的特别授权委托代理人{{agentName}}和被申请人本人出席了庭审。 ";
String attend = "申请人的特别授权委托代理人{{agentName}}和被申请人本人出席了庭审。 ";
// 开庭+出席+被申提供证据
String onLineAttendFile="庭审中,申请人陈述了仲裁请求事项及所依据的事实与理由,被申请人进行了答辩;双方当事人均出示了证据材料并对对方的证据材料进行了质证;双方当事人均回答了仲裁庭的提问,进行了辩论,并分别作了最后陈述。双方当事人在仲裁庭的主持下进行了调解,但未能达成调解协议。 ";
String onLineAttendFile = "庭审中,申请人陈述了仲裁请求事项及所依据的事实与理由,被申请人进行了答辩;双方当事人均出示了证据材料并对对方的证据材料进行了质证;双方当事人均回答了仲裁庭的提问,进行了辩论,并分别作了最后陈述。双方当事人在仲裁庭的主持下进行了调解,但未能达成调解协议。 ";
// 开庭+出席+被申未提供证据
String onLineAttend="庭审中,申请人陈述了仲裁请求事项及所依据的事实与理由,被申请人进行了答辩;申请人出示了证据材料,被申请人对对方的证据材料进行了质证; 双方当事人均回答了仲裁庭的提问,进行了辩论,并分别作了最后陈述。双方当事人在仲裁庭的主持下进行了调解,但未能达成调解协议。 ";
String onLineAttend = "庭审中,申请人陈述了仲裁请求事项及所依据的事实与理由,被申请人进行了答辩;申请人出示了证据材料,被申请人对对方的证据材料进行了质证; 双方当事人均回答了仲裁庭的提问,进行了辩论,并分别作了最后陈述。双方当事人在仲裁庭的主持下进行了调解,但未能达成调解协议。 ";
// 被申请人出席答辩意见
String resAttendOpinion="\n(二)被申请人的答辩意见 \n(三)当事人提供的证据材料及对方的质证意见\n" +
String resAttendOpinion = "\n(二)被申请人的答辩意见 \n(三)当事人提供的证据材料及对方的质证意见\n" +
"申请人为证明其主张的事实和理由,向仲裁庭提交了如下证据材料:\n{{applicantFile}}\n被申请人对上述材料的质证意见为:{{respondentOpinion}}\n";
// 被申请人出席+被申请人提供了资料
String resFile="被申请人向仲裁庭提交了如下证据材料:\n{{resFile}}" +
String resFile = "被申请人向仲裁庭提交了如下证据材料:\n{{resFile}}" +
"申请人对上述材料的质证意见为:{{applicantOpinion}}";
// 被申请人缺席
String resAbsent="(二)当事人提供的证据材料\n" +
String resAbsent = "(二)当事人提供的证据材料\n" +
"申请人为证明其主张的事实和理由,向仲裁庭提交了如下证据材料:\n{{applicantFile}}";
// 日期格式化年月日
SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日");
@Override
@Transactional
public AjaxResult createDocument(CaseApplication caseApplicationReq) {
@@ -161,13 +178,13 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
return AjaxResult.error("请先指定裁决书模板");
}
templatePath = templateManages.get(0).getTemOrigPath();
if(StrUtil.isEmpty(templatePath)){
if (StrUtil.isEmpty(templatePath)) {
return AjaxResult.error("未找到该模板");
}
// todo 部署放开
if(templatePath!=null){
templatePath="/home/ruoyi/" +templatePath;
if (templatePath != null) {
templatePath = "/home/ruoyi/" + templatePath;
}
try {
File file = new File(templatePath);
@@ -198,7 +215,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
fatchRuleMap = fatchRuleList.stream().collect(Collectors.groupingBy(FatchRule::getIsDefault));
}
// 自定义字段,从columnValue值取
if (fatchRuleMap.size()>0&&fatchRuleMap.containsKey(1)) {
if (fatchRuleMap.size() > 0 && fatchRuleMap.containsKey(1)) {
// 根据案件id查询key-value表
List<ColumnValue> columnValueList = columnValueMapper.listByCaseId(caseApplicationReq.getId());
if (CollectionUtil.isNotEmpty(columnValueList)) {
@@ -206,7 +223,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
}
}
// 组装内置字段,在主表中查出内容
buildDefaultColumnValue(dictDataList,caseAffiliates,valueMap,caseApplicationById);
buildDefaultColumnValue(dictDataList, caseAffiliates, valueMap, caseApplicationById);
// 获取模板中的占位符key
List<String> bookmarkList = getBookmarkByDocx(templatePath);
@@ -214,9 +231,9 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
return AjaxResult.success("请检查模板是否配置正确,未获取到占位符");
}
// 遍历书签,给书签赋值
replaceBookmark(bookmarkList,datas,valueMap);
replaceBookmark(bookmarkList, datas, valueMap);
// 根据条件替换书签
conditionReplaceBookmark(caseApplicationById,datas,agentName,resName,arbitrateRecordSelect);
conditionReplaceBookmark(caseApplicationById, datas, agentName, resName, arbitrateRecordSelect);
// 裁决书生成时间
LocalDate now = LocalDate.now();
String year = Integer.toString(now.getYear());
@@ -226,7 +243,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
// 裁决书编号
datas.put("裁决书编号", equipmentNo);
// 仲裁费
datas.put("仲裁费", caseApplicationById.getFeePayable().toString());
datas.put("仲裁费", caseApplicationById.getFeePayable() != null ? caseApplicationById.getFeePayable().toString() : "");
// 案件创建时间
Date createTime = caseApplicationById.getCreateTime();
// 将日期格式化为字符串
@@ -248,7 +265,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
String saveName = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName;
// String saveName = "D:/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day + "/" + fileName;
// 将word中的标签替换掉,生成新的word
String docFilePath = wordChangeText(templatePath,datas,saveFolderPath,fileName);
String docFilePath = wordChangeText(templatePath, datas, saveFolderPath, fileName);
String savePath = docFilePath.substring(0, docFilePath.indexOf("/upload/") + 8);
// 保存裁决书附件
@@ -262,6 +279,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
/**
* 将word中的标签替换掉,生成新的word
*
* @param modalFilePath 裁决书模板路径
* @param datas 替换标签的内容
* @param saveFolderPath 保存路径
@@ -269,7 +287,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
* @return
* @throws IOException
*/
private String wordChangeText(String modalFilePath, Map<String, Object> datas, String saveFolderPath,String fileName) 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);
@@ -291,13 +309,14 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
/**
* 根据条件判断裁决书中是否需要该内容
*
* @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 ) {
private void conditionReplaceBookmark(CaseApplication caseApplicationById, Map<String, Object> datas, String agentName, String resName, ArbitrateRecord arbitrateRecordSelect) {
// 如果有仲裁反请求,该字段设置值
Integer adjudicaCounter = caseApplicationById.getAdjudicaCounter();
if (adjudicaCounter != null && adjudicaCounter == 1) {
@@ -344,7 +363,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
}
// todo 线上仲裁/线下仲裁方式未选择
//线上开庭时+线上仲裁
if (arbitratMethod!=null&&arbitratMethod == 1) {
if (arbitratMethod != null && arbitratMethod == 1) {
String replace = onLine.replace(onLineDate, Optional.of(hearDateStr).orElse(""));
datas.put("线上开庭并线上仲裁", replace);
// 所有附件
@@ -418,6 +437,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
/**
* 给模板中的占位符赋值
*
* @param bookmarkList 书签
* @param datas 书签赋值
* @param valueMap 案件内容
@@ -454,6 +474,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
/**
* 组装案件内置字段值,即主表和相关人员表信息
*
* @param dictDataList 内置字段
* @param caseAffiliates 关联人员
* @param valueMap 组装的值
@@ -479,6 +500,9 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
case "被申请人住所":
valueMap.put(dictData.getDictLabel(), affiliate.getResidenAffili());
break;
case "被申请人联系地址":
valueMap.put(dictData.getDictLabel(), affiliate.getContactAddress());
break;
case "被申请人联系电话":
valueMap.put(dictData.getDictLabel(), affiliate.getContactTelphone());
break;
@@ -486,14 +510,12 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
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();
@@ -545,10 +567,10 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
default:
break;
}
}else {
} else {
valueMap.put(dictData.getDictLabel(), ObjectFieldUtils.getValue(caseApplication, dictData.getDictValue()));
}
}else {
} else {
valueMap.put(dictData.getDictLabel(), ObjectFieldUtils.getValue(caseApplication, dictData.getDictValue()));
}
@@ -558,6 +580,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
/**
* 保存裁决书附件
*
* @param id 案件id
* @param saveName 保存的文件名
* @param savePath 保存路径
@@ -590,6 +613,10 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
}
//修改案件状态
caseApplicationById.setCaseStatus(CaseApplicationConstants.VERPRIF_ARBITRATION);
Integer arbitratMethod = caseApplicationById.getArbitratMethod();
if(arbitratMethod==1){
caseApplicationById.setLockStatus(1);
}
caseApplicationMapper.submitCaseApplication(caseApplicationById);
}
@@ -724,6 +751,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
}
@Override
@Transactional
public AjaxResult signature(CaseApplication caseApplication) {
//更改案件状态(暂时)
caseApplication.setCaseStatus(CaseApplicationConstants.ARBITRATED_SEAL);
@@ -735,6 +763,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
}
@Override
@Transactional
public AjaxResult caseFile(List<Long> ids) {
try {
for (Long id : ids) {
@@ -771,7 +800,8 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
int startIndex = prefix.length();
String path = caseAttach.getAnnexPath() + annexName.substring(startIndex);
File file = new File(path);
if(!file.exists()){
// todo 部署放开
if (!file.exists()) {
return AjaxResult.error("未生成裁决书");
}
@@ -798,43 +828,72 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
}
}
}
//发送邮件
boolean b = sendCaseEmail(caseApplication1, appEmail, resEmail,caseAttachList);
//申请人发送邮件
boolean appEmailFlag = sendCaseEmail(caseApplication1, appEmail, caseAttachList);
SendMailRecord sendMailRecord = new SendMailRecord();
sendMailRecord.setCaseId(id);
sendMailRecord.setMailAddress(appEmail);
sendMailRecord.setMailContent("您好,审核后的裁决书在附件中请查阅");
// sendMailRecord.setMailContent("您好,您的{"+caseApplication1.getCaseNum()+"}案件,审核后的裁决书在附件中请查阅");
sendMailRecord.setMailName("签署后的裁决书");
sendMailRecord.setSendTime(new Date());
sendMailRecord.setCreateBy(getUsername());
if (b) {
if (appEmailFlag) {
sendMailRecord.setSendStatus(1);
} else {
sendMailRecord.setSendStatus(0);
}
sendMailRecordMapper.saveSendMailRecord(sendMailRecord);
// 被申请人发送邮件
boolean resEmailFlag = sendCaseEmail(caseApplication1, resEmail, caseAttachList);
SendMailRecord sendMailRecord1 = new SendMailRecord();
sendMailRecord1.setCaseId(id);
sendMailRecord1.setMailAddress(resEmail);
// sendMailRecord.setMailContent("您好,您的{"+caseApplication1.getCaseNum()+"}案件,审核后的裁决书在附件中请查阅");
sendMailRecord1.setMailContent("您好,审核后的裁决书在附件中请查阅");
sendMailRecord1.setMailName("签署后的裁决书");
sendMailRecord1.setSendTime(new Date());
sendMailRecord1.setCreateBy(getUsername());
if (b) {
if (resEmailFlag) {
sendMailRecord1.setSendStatus(1);
}else {
sendMailRecord1.setSendStatus(0);
}
sendMailRecordMapper.saveSendMailRecord(sendMailRecord1);
if(!appEmailFlag&&!resEmailFlag){
throw new ServiceException("裁决书发送失败");
}
if(!appEmailFlag){
throw new ServiceException("申请人裁决书发送失败");
}
if(!resEmailFlag){
throw new ServiceException("被申请人裁决书发送失败");
}
// 发送短信
if(CollectionUtil.isNotEmpty(caseAffiliates)) {
if (appEmailFlag||resEmailFlag) {
if (CollectionUtil.isNotEmpty(caseAffiliates)) {
SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest();
request.setTemplateId("1990362");
for (CaseAffiliate affiliate : caseAffiliates) {
String telphone=null;
if(appEmailFlag&&affiliate.getIdentityType()==1){
telphone = affiliate.getContactTelphone();
}else if(resEmailFlag&&affiliate.getIdentityType()==2){
telphone = affiliate.getContactTelphone();
}
if(StrUtil.isEmpty(telphone)){
continue;
}
request.setPhone(affiliate.getContactTelphone());
request.setPhone(telphone);
// if(affiliate.getIdentityType() == 1) {
// request.setTemplateParamSet(new String[]{caseAffiliate.getName(), caseApplication1.getCaseNum(), appEmail});
// }else {
// request.setTemplateParamSet(new String[]{caseAffiliate.getName(), caseApplication1.getCaseNum(), resEmail});
// }
request.setTemplateParamSet(new String[]{caseAffiliate.getName(), caseApplication1.getCaseNum()});
request.setTemplateParamSet(new String[]{affiliate.getName(), caseApplication1.getCaseNum()});
Boolean aBoolean = SmsUtils.sendSms(request);
// 保存短信发送记录
@@ -850,7 +909,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
// }else {
// smsSendRecord.setSendContent("尊敬的" + caseAffiliate.getName() + "用户,您的" + caseApplication1.getCaseNum() + "仲裁案件,裁决书已送达至" +resEmail+"邮箱,请知晓,如非本人操作,请忽略本短信。");
// }
smsSendRecord.setSendContent("尊敬的" + caseAffiliate.getName() + "用户,您的" + caseApplication1.getCaseNum() + "仲裁案件,裁决书已送达,请知晓,如非本人操作,请忽略本短信。");
smsSendRecord.setSendContent("尊敬的" + affiliate.getName() + "用户,您的" + caseApplication1.getCaseNum() + "仲裁案件,裁决书已送达,请知晓,如非本人操作,请忽略本短信。");
smsSendRecord.setCreateBy(getUsername());
@@ -866,10 +925,8 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
}
} else {
sendMailRecord1.setSendStatus(0);
}
sendMailRecordMapper.saveSendMailRecord(sendMailRecord1);
// 新增日志
CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CASE_FILING, "");
@@ -881,10 +938,8 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
* 通过邮件发送裁决书文件
*
* @param caseApplication1
* @param appEmail
* @param resEmail
*/
private boolean sendCaseEmail(CaseApplication caseApplication1, String appEmail, String resEmail, List<CaseAttach> caseAttachList) {
private boolean sendCaseEmail(CaseApplication caseApplication1, String email, List<CaseAttach> caseAttachList) {
List<File> fileList = new ArrayList<>();
File file = null;
if (caseAttachList != null && caseAttachList.size() > 0) {
@@ -894,7 +949,9 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
String prefix = "/profile/upload/";
int startIndex = prefix.length();
String path = caseAttach.getAnnexPath() + annexName.substring(startIndex);
// todo 部署放开
file = new File(path);
// file = new File("D:\\home\\ruoyi\\uploadPath\\upload\\2023\\09\\b10b20d66cfa44df8995c3999e3b6266.pdf");
fileList.add(file);
System.out.println("文件长度==================:" + file.length());
}
@@ -903,9 +960,19 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
if (file != null && file.exists()) {
try {
Boolean aBoolean = emailOutUtil.sendEmil(appEmail, "您好,审核后的裁决书在附件中请查阅", "签署后的裁决书", fileList, null);
Boolean aBoolean1 = emailOutUtil.sendEmil(resEmail, "您好,审核后的裁决书在附件中请查阅", "签署后的裁决书", fileList, null);
if (aBoolean && aBoolean1) {
Boolean aBoolean = emailOutUtil.sendEmil(email, "您好,审核后的裁决书在附件中请查阅", "签署后的裁决书", fileList, null);
// String appUid = UUID.randomUUID().toString();
// Boolean aBoolean = emailOutUtil.sendEmil(email, "您好,您的{"+caseApplication1.getCaseNum()+"}案件,审核后的裁决书在附件中请查阅", appUid +"裁决书", fileList, null);
// // Thread.sleep(20);
// 收到退信的所有id,即发送失败的uuid
// emailOutUtil.receiverMail();
// Thread.sleep(3);
// List<String> messageIds = emailOutUtil.receiverMail();
// if (aBoolean&&(CollectionUtil.isEmpty(messageIds)||!messageIds.contains(appUid))) {
// return Boolean.TRUE;
// }
if (aBoolean) {
return Boolean.TRUE;
}
} catch (Exception e) {
@@ -1255,13 +1322,15 @@ 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));
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) {
@@ -1283,6 +1352,442 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
return AjaxResult.success();
}
/**
* 根据签署流程id查询批量签名链接
*
* @param idsReq
* @return
*/
@Override
public SealSignRecord selectBatchSignUrl(StringIdsReq idsReq) {
SealSignRecord signRecord = new SealSignRecord();
try {
EsignHttpResponse identityInfo = SignAward.identityInfo(idsReq);
Gson gson = new Gson();
if (StrUtil.isNotEmpty(identityInfo.getBody())) {
JsonObject identityInfoJsonObject = gson.fromJson(identityInfo.getBody(), JsonObject.class);
if (identityInfoJsonObject != null && !identityInfoJsonObject.get("data").isJsonNull()) {
JsonObject identityInfoData = identityInfoJsonObject.getAsJsonObject("data");
if (identityInfoData != null && !identityInfoData.get("psnId").isJsonNull()) {
idsReq.setPsnId(identityInfoData.get("psnId").getAsString());
}
}
}
if (StrUtil.isEmpty(idsReq.getPsnId())) {
throw new ServiceException("该用户未认证");
}
EsignHttpResponse batchSignUrl = SignAward.batchSignUrl(idsReq);
if (StrUtil.isNotEmpty(batchSignUrl.getBody())) {
JsonObject signUrlJsonObject = gson.fromJson(batchSignUrl.getBody(), JsonObject.class);
if (signUrlJsonObject != null && !signUrlJsonObject.get("data").isJsonNull()) {
JsonObject signUrlData = signUrlJsonObject.getAsJsonObject("data");
if (signUrlData != null && !signUrlData.get("batchSignUrlWithoutLogin").isJsonNull()) {
// 免登录批量签链接(链接有效期2小时)
String url = signUrlData.get("batchSignUrlWithoutLogin").getAsString();
// batchSignUrl 需登录批量签链接(链接有效期2小时),batchSignShortUrl需登录批量签短链接(链接有效期2小时),batchSignShortUrlWithoutLogin免登录批量签短链接(链接有效期2小时)
signRecord.setSignUrl(url);
}
}
}
} catch (EsignDemoException e) {
e.printStackTrace();
}
return signRecord;
}
@Override
public SealSignRecord selectBatchSealUrl(StringIdsReq idsReq) {
SealSignRecord signRecord = new SealSignRecord();
try {
EsignHttpResponse identityInfo = SignAward.identityInfo(idsReq);
Gson gson = new Gson();
if (StrUtil.isNotEmpty(identityInfo.getBody())) {
JsonObject identityInfoJsonObject = gson.fromJson(identityInfo.getBody(), JsonObject.class);
if(identityInfoJsonObject!=null&&!identityInfoJsonObject.get("data").isJsonNull()) {
JsonObject identityInfoData = identityInfoJsonObject.getAsJsonObject("data");
if (identityInfoData != null && !identityInfoData.get("psnId") .isJsonNull()) {
idsReq.setPsnId(identityInfoData.get("psnId").getAsString());
}
}
}
if (StrUtil.isEmpty(idsReq.getPsnId())) {
throw new ServiceException("该用户未认证");
}
EsignHttpResponse batchSignUrl = SignAward.batchSignUrl(idsReq);
if (StrUtil.isNotEmpty(batchSignUrl.getBody())) {
JsonObject signUrlJsonObject = gson.fromJson(batchSignUrl.getBody(), JsonObject.class);
if (signUrlJsonObject != null && !signUrlJsonObject.get("data").isJsonNull()) {
JsonObject signUrlData = signUrlJsonObject.getAsJsonObject("data");
if (signUrlData != null&& !signUrlData.get("batchSignUrlWithoutLogin").isJsonNull()) {
// 免登录批量签链接(链接有效期2小时)
String url = signUrlData.get("batchSignUrlWithoutLogin").getAsString();
// batchSignUrl 需登录批量签链接(链接有效期2小时),batchSignShortUrl需登录批量签短链接(链接有效期2小时),batchSignShortUrlWithoutLogin免登录批量签短链接(链接有效期2小时)
signRecord.setSignUrl(url);
}
}
}
} catch (EsignDemoException e) {
e.printStackTrace();
}
return signRecord;
}
@Override
public SealSignRecord getSignUrlBatch(StringIdsReq idsReq) {
SealSignRecord signRecord = new SealSignRecord();
try {
EsignHttpResponse identityInfo = SignAward.identityInfo(idsReq);
Gson gson = new Gson();
if (StrUtil.isNotEmpty(identityInfo.getBody())) {
JsonObject identityInfoJsonObject = gson.fromJson(identityInfo.getBody(), JsonObject.class);
if (identityInfoJsonObject != null && !identityInfoJsonObject.get("data").isJsonNull()) {
JsonObject identityInfoData = identityInfoJsonObject.getAsJsonObject("data");
if (identityInfoData != null && !identityInfoData.get("psnId").isJsonNull()) {
idsReq.setPsnId(identityInfoData.get("psnId").getAsString());
}
}
}
if (StrUtil.isEmpty(idsReq.getPsnId())) {
throw new ServiceException("该用户未认证");
}
Integer batchNumber = idsReq.getBatchNumber();
Integer caseStatus = CaseApplicationConstants.SIGN_ARBITRATION;
List<CaseApplication> caseApplications = sealSignRecordMapper.selectsignFlow(batchNumber,caseStatus);
if (caseApplications != null && caseApplications.size() > 0) {
List<String> signFlowIds = caseApplications.stream().map(CaseApplication::getSignFlowId).collect(Collectors.toList());
idsReq.setIds(signFlowIds);
EsignHttpResponse batchSignUrl = SignAward.batchSignUrl(idsReq);
if (StrUtil.isNotEmpty(batchSignUrl.getBody())) {
JsonObject signUrlJsonObject = gson.fromJson(batchSignUrl.getBody(), JsonObject.class);
if (signUrlJsonObject != null && !signUrlJsonObject.get("data").isJsonNull()) {
JsonObject signUrlData = signUrlJsonObject.getAsJsonObject("data");
if (signUrlData != null && !signUrlData.get("batchSignUrlWithoutLogin").isJsonNull()) {
// 免登录批量签链接(链接有效期2小时)
String url = signUrlData.get("batchSignUrlWithoutLogin").getAsString();
// batchSignUrl 需登录批量签链接(链接有效期2小时),batchSignShortUrl需登录批量签短链接(链接有效期2小时),batchSignShortUrlWithoutLogin免登录批量签短链接(链接有效期2小时)
signRecord.setSignUrl(url);
}
}
}
}else{
throw new ServiceException("这个批号没有批量签名的案件");
}
} catch (EsignDemoException e) {
e.printStackTrace();
}
return signRecord;
}
@Override
public SealSignRecord getSealUrlBatch(StringIdsReq idsReq) {
SealSignRecord signRecord = new SealSignRecord();
try {
EsignHttpResponse identityInfo = SignAward.identityInfo(idsReq);
Gson gson = new Gson();
if (StrUtil.isNotEmpty(identityInfo.getBody())) {
JsonObject identityInfoJsonObject = gson.fromJson(identityInfo.getBody(), JsonObject.class);
if(identityInfoJsonObject!=null&&!identityInfoJsonObject.get("data").isJsonNull()) {
JsonObject identityInfoData = identityInfoJsonObject.getAsJsonObject("data");
if (identityInfoData != null && !identityInfoData.get("psnId") .isJsonNull()) {
idsReq.setPsnId(identityInfoData.get("psnId").getAsString());
}
}
}
if (StrUtil.isEmpty(idsReq.getPsnId())) {
throw new ServiceException("该用户未认证");
}
Integer batchNumber = idsReq.getBatchNumber();
Integer caseStatus = CaseApplicationConstants.ARBITRATED_SEAL;
List<CaseApplication> caseApplications = sealSignRecordMapper.selectsignFlow(batchNumber,caseStatus);
if (caseApplications != null && caseApplications.size() > 0) {
List<String> signFlowIds = caseApplications.stream().map(CaseApplication::getSignFlowId).collect(Collectors.toList());
idsReq.setIds(signFlowIds);
EsignHttpResponse batchSignUrl = SignAward.batchSignUrl(idsReq);
if (StrUtil.isNotEmpty(batchSignUrl.getBody())) {
JsonObject signUrlJsonObject = gson.fromJson(batchSignUrl.getBody(), JsonObject.class);
if (signUrlJsonObject != null && !signUrlJsonObject.get("data").isJsonNull()) {
JsonObject signUrlData = signUrlJsonObject.getAsJsonObject("data");
if (signUrlData != null&& !signUrlData.get("batchSignUrlWithoutLogin").isJsonNull()) {
// 免登录批量签链接(链接有效期2小时)
String url = signUrlData.get("batchSignUrlWithoutLogin").getAsString();
// batchSignUrl 需登录批量签链接(链接有效期2小时),batchSignShortUrl需登录批量签短链接(链接有效期2小时),batchSignShortUrlWithoutLogin免登录批量签短链接(链接有效期2小时)
signRecord.setSignUrl(url);
}
}
}
}else{
throw new ServiceException("这个批号没有批量用印的案件");
}
} catch (EsignDemoException e) {
e.printStackTrace();
}
return signRecord;
}
@Override
@Transactional
public AjaxResult caseFileBatch(Integer batchNumber) {
CaseApplication caseApplicationsel = new CaseApplication();
caseApplicationsel.setBatchNumber(batchNumber);
caseApplicationsel.setCaseStatus(CaseApplicationConstants.CASE_FILING);
List<CaseApplication> caseApplications1 = caseApplicationMapper.listCaseApplicationByBatchNumber(caseApplicationsel);
if (caseApplications1 != null && caseApplications1.size() > 0) {
List<Long> ids = caseApplications1.stream().map(CaseApplication::getId).collect(Collectors.toList());
try {
for (Long id : ids) {
CaseApplication caseApplication = new CaseApplication();
caseApplication.setId(id);
//更改案件状态(暂时)
caseApplication.setCaseStatus(CaseApplicationConstants.CASE_ARCHIVED);
caseApplicationMapper.submitCaseApplication(caseApplication);
// 新增日志
CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CASE_ARCHIVED, "");
}
} catch (Exception e) {
return AjaxResult.error(e.getMessage());
}
}else{
throw new ServiceException("这个批号没有批量归档的案件");
}
return AjaxResult.success("归档成功");
}
@Override
@Transactional
public AjaxResult serviceBatch(Integer batchNumber) throws EsignDemoException, IOException {
CaseApplication caseApplicationsel = new CaseApplication();
caseApplicationsel.setBatchNumber(batchNumber);
caseApplicationsel.setCaseStatus(CaseApplicationConstants.ARBITRATION_DELIVERY);
List<CaseApplication> caseApplications1 = caseApplicationMapper.listCaseApplicationByBatchNumber(caseApplicationsel);
if (caseApplications1 != null && caseApplications1.size() > 0) {
List<Long> ids = caseApplications1.stream().map(CaseApplication::getId).collect(Collectors.toList());
for (Long id : ids) {
CaseApplication caseApplication = new CaseApplication();
caseApplication.setId(id);
CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication);
if (caseApplication1 == null) {
return AjaxResult.error("未查询到相关案件");
}
List<CaseAttach> caseAttachList = caseAttachMapper.queryCaseAttachList(caseApplication1);
if (caseAttachList != null && caseAttachList.size() > 0) {
for (CaseAttach caseAttach : caseAttachList) {
if (caseAttach.getAnnexType() == 3) {
String annexName = caseAttach.getAnnexName();
String prefix = "/profile/upload/";
int startIndex = prefix.length();
String path = caseAttach.getAnnexPath() + annexName.substring(startIndex);
File file = new File(path);
// todo 部署放开
if (!file.exists()) {
Gson gson = new Gson();
SealSignRecord sealSignRecord = new SealSignRecord();
sealSignRecord.setCaseAppliId(id);
List<SealSignRecord> sealSignRecords = sealSignRecordMapper.selectSealSignRecord(sealSignRecord);
if (sealSignRecords != null && sealSignRecords.size() > 0) {
String signFlowid = sealSignRecords.get(0).getSignFlowid();
EsignHttpResponse fileDownload = SaaSAPIFileUtils.fileDownloadUrl(signFlowid);
JsonObject fileDownloadJsonObject = gson.fromJson(fileDownload.getBody(), JsonObject.class);
JsonObject fileDownloadData = fileDownloadJsonObject.getAsJsonObject("data");
JsonArray filesArray = fileDownloadData.get("files").getAsJsonArray();
if (filesArray != null && filesArray.size() > 0) {
JsonObject fileObject = (JsonObject) filesArray.get(0);
String fileDownloadUrl = fileObject.get("downloadUrl").toString();
String filearbitraUrl = fileDownloadUrl.substring(1, fileDownloadUrl.length() - 1);
LocalDate now = LocalDate.now();
String year = Integer.toString(now.getYear());
String month = String.format("%02d", now.getMonthValue());
String day = String.format("%02d", now.getDayOfMonth());
String saveFolderPath = "/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day;
String fileName = UUID.randomUUID().toString().replace("-", "") + ".pdf";
String saveName = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName;
String savePath = "/home/ruoyi/uploadPath/upload/";
// 创建日期目录
File saveFolder = new File(saveFolderPath);
if (!saveFolder.exists()) {
saveFolder.mkdirs();
}
String resultFilePath = saveFolderPath + "/" + fileName;
File resultFilePathFile = new File(resultFilePath);
if (!resultFilePathFile.exists()) {
resultFilePathFile.createNewFile();
}
boolean downLoadFile = FileTransformation.downLoadFileByUrl(filearbitraUrl, resultFilePath);
if (downLoadFile) {
CaseAttach caseAttach1 = new CaseAttach();
caseAttach1.setCaseAppliId(id);
caseAttach1.setAnnexType(3);
caseAttach1.setAnnexPath(savePath);
caseAttach1.setAnnexName(saveName);
caseAttachMapper.updateCaseAttachBycaseid(caseAttach1);
caseAttach.setAnnexPath(savePath);
caseAttach.setAnnexName(saveName);
}
}
}
}
}
}
}
//修改案件状态
caseApplication1.setCaseStatus(CaseApplicationConstants.CASE_FILING);
caseApplicationMapper.submitCaseApplication(caseApplication1);
String appEmail = "";
String resEmail = "";
CaseAffiliate caseAffiliate = new CaseAffiliate();
caseAffiliate.setCaseAppliId(id);
List<CaseAffiliate> caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate);
if (caseAffiliates != null && caseAffiliates.size() > 0) {
for (CaseAffiliate affiliate : caseAffiliates) {
if (affiliate.getIdentityType() == 1) { //申请人
appEmail = affiliate.getEmail();
} else {
resEmail = affiliate.getEmail();
}
}
}
//申请人发送邮件
boolean appEmailFlag = sendCaseEmail(caseApplication1, appEmail, caseAttachList);
SendMailRecord sendMailRecord = new SendMailRecord();
sendMailRecord.setCaseId(id);
sendMailRecord.setMailAddress(appEmail);
sendMailRecord.setMailContent("您好,审核后的裁决书在附件中请查阅");
// sendMailRecord.setMailContent("您好,您的{"+caseApplication1.getCaseNum()+"}案件,审核后的裁决书在附件中请查阅");
sendMailRecord.setMailName("签署后的裁决书");
sendMailRecord.setSendTime(new Date());
sendMailRecord.setCreateBy(getUsername());
if (appEmailFlag) {
sendMailRecord.setSendStatus(1);
} else {
sendMailRecord.setSendStatus(0);
}
sendMailRecordMapper.saveSendMailRecord(sendMailRecord);
// 被申请人发送邮件
boolean resEmailFlag = sendCaseEmail(caseApplication1, resEmail, caseAttachList);
SendMailRecord sendMailRecord1 = new SendMailRecord();
sendMailRecord1.setCaseId(id);
sendMailRecord1.setMailAddress(resEmail);
// sendMailRecord.setMailContent("您好,您的{"+caseApplication1.getCaseNum()+"}案件,审核后的裁决书在附件中请查阅");
sendMailRecord1.setMailContent("您好,审核后的裁决书在附件中请查阅");
sendMailRecord1.setMailName("签署后的裁决书");
sendMailRecord1.setSendTime(new Date());
sendMailRecord1.setCreateBy(getUsername());
if (resEmailFlag) {
sendMailRecord1.setSendStatus(1);
}else {
sendMailRecord1.setSendStatus(0);
}
sendMailRecordMapper.saveSendMailRecord(sendMailRecord1);
if(!appEmailFlag&&!resEmailFlag){
throw new ServiceException("裁决书发送失败");
}
if(!appEmailFlag){
throw new ServiceException("申请人裁决书发送失败");
}
if(!resEmailFlag){
throw new ServiceException("被申请人裁决书发送失败");
}
// 发送短信
if (appEmailFlag||resEmailFlag) {
if (CollectionUtil.isNotEmpty(caseAffiliates)) {
SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest();
request.setTemplateId("1990362");
for (CaseAffiliate affiliate : caseAffiliates) {
String telphone=null;
if(appEmailFlag&&affiliate.getIdentityType()==1){
telphone = affiliate.getContactTelphone();
}else if(resEmailFlag&&affiliate.getIdentityType()==2){
telphone = affiliate.getContactTelphone();
}
if(StrUtil.isEmpty(telphone)){
continue;
}
request.setPhone(telphone);
// if(affiliate.getIdentityType() == 1) {
// request.setTemplateParamSet(new String[]{caseAffiliate.getName(), caseApplication1.getCaseNum(), appEmail});
// }else {
// request.setTemplateParamSet(new String[]{caseAffiliate.getName(), caseApplication1.getCaseNum(), resEmail});
// }
request.setTemplateParamSet(new String[]{affiliate.getName(), caseApplication1.getCaseNum()});
Boolean aBoolean = SmsUtils.sendSms(request);
// 保存短信发送记录
SmsSendRecord smsSendRecord = new SmsSendRecord();
smsSendRecord.setCaseId(caseAffiliate.getCaseAppliId());
smsSendRecord.setCaseNum(caseApplication1.getCaseNum());
smsSendRecord.setPhone(request.getPhone());
smsSendRecord.setSendTime(new Date());
// // 尊敬的{1}用户,您的{2}仲裁案件,裁决书已送达,请知晓,如非本人操作,请忽略本短信。
// if(affiliate.getIdentityType() == 1) {
// smsSendRecord.setSendContent("尊敬的" + caseAffiliate.getName() + "用户,您的" + caseApplication1.getCaseNum() + "仲裁案件,裁决书已送达至" +appEmail+"邮箱,请知晓,如非本人操作,请忽略本短信。");
// }else {
// smsSendRecord.setSendContent("尊敬的" + caseAffiliate.getName() + "用户,您的" + caseApplication1.getCaseNum() + "仲裁案件,裁决书已送达至" +resEmail+"邮箱,请知晓,如非本人操作,请忽略本短信。");
// }
smsSendRecord.setSendContent("尊敬的" + affiliate.getName() + "用户,您的" + caseApplication1.getCaseNum() + "仲裁案件,裁决书已送达,请知晓,如非本人操作,请忽略本短信。");
smsSendRecord.setCreateBy(getUsername());
if (aBoolean) {
smsSendRecord.setSendStatus(1);
} else {
smsSendRecord.setSendStatus(0);
}
smsRecordMapper.saveSmsSendRecord(smsSendRecord);
}
}
// 新增日志
CaseLogUtils.insertCaseLog(caseApplication1.getId(), CaseApplicationConstants.CASE_FILING, "");
}
}
}else{
throw new ServiceException("这个批号没有批量送达裁决书的案件");
}
return AjaxResult.success("仲裁文书送达成功");
}
/**
* 根据仲裁员手机号分页查询等待签署,签署中的裁决书
*
* @param personAccount 仲裁员手机号
* @return
*/
@Override
public List<CaseApplication> selectSealSigning(String personAccount, Integer caseStatus) {
return sealSignRecordMapper.selectSealSigning(personAccount, caseStatus);
}
public String getNewEquipmentNo() {
Object awardNum = redisCache.getCacheObject("awardNum");
if (awardNum == null) {
@@ -1311,33 +1816,34 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
/**
* 根据裁决书模板获取所有的占位符,占位符必须是{{name}}格式
*
* @param path
* @return
*/
public List<String> getBookmarkByDocx(String path){
public List<String> getBookmarkByDocx(String path) {
XWPFDocument xwpfDocument = null;
try {
log.error("path===="+path);
log.error("path====" + path);
FileInputStream fileInputStream = new FileInputStream(path);
log.error("fileInputStream====");
xwpfDocument = new XWPFDocument(fileInputStream);
log.error("xwpfDocument===="+xwpfDocument);
log.error("xwpfDocument====" + xwpfDocument);
} catch (IOException e) {
e.printStackTrace();
}
if(xwpfDocument==null){
if (xwpfDocument == null) {
return new ArrayList<>();
}
List<XWPFParagraph> paragraphs = xwpfDocument.getParagraphs();
if(CollectionUtil.isEmpty( xwpfDocument.getParagraphs())){
if (CollectionUtil.isEmpty(xwpfDocument.getParagraphs())) {
return new ArrayList<>();
}
String regex = "\\{\\{.*?\\}\\}"; // 定义占位符的正则表达式
Pattern pattern = Pattern.compile(regex);
List<String> bookmarkList=new ArrayList<>();
List<String> bookmarkList = new ArrayList<>();
for (XWPFParagraph paragraph : paragraphs) {
String text = paragraph.getText();
if(StrUtil.isNotEmpty(text)) {
if (StrUtil.isNotEmpty(text)) {
Matcher matcher = pattern.matcher(text);
while (matcher.find()) {
@@ -1351,6 +1857,4 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
}
}
@@ -5,6 +5,7 @@ import com.deepoove.poi.data.PictureRenderData;
import com.ruoyi.common.constant.CaseApplicationConstants;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.WordUtil;
import com.ruoyi.wisdomarbitrate.domain.*;
import com.ruoyi.wisdomarbitrate.mapper.*;
@@ -58,19 +59,17 @@ public class CaseArbitrateServiceImpl implements ICaseArbitrateService {
@Override
@Transactional
public AjaxResult examineArbitrateMethod(CaseApplication caseApplication, Integer opinion) {
public AjaxResult examineArbitrateMethod(CaseApplication caseApplication, Integer opinion, Integer arbitratMethodNow) {
//查询案件详细信息
CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication);
if (caseApplication1 == null) {
return AjaxResult.success();
}
Integer arbitratMethod = caseApplication1.getArbitratMethod();
if (arbitratMethod == null) {
return AjaxResult.error("请先指定仲裁方式");
}
Integer arbitratMethodOriral = caseApplication.getArbitratMethod();
String caseNum = caseApplication1.getCaseNum();
if (opinion == 0) { //拒绝
if (arbitratMethod == 2) {
if (arbitratMethodOriral == 2) {
caseApplication1.setArbitratMethod(1); // 更改仲裁方式
//修改案件状态修改开庭时间
caseApplication1.setCaseStatus(CaseApplicationConstants.MODIFY_HEARDATE);
@@ -87,15 +86,35 @@ public class CaseArbitrateServiceImpl implements ICaseArbitrateService {
CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.PENDING_WRIITEN_HEAR, "");
}
} else {
if (arbitratMethod == 2) {
} else if (opinion == 1 ) {
if (arbitratMethodOriral == 2) {
//修改案件状态为待书面审理
caseApplication1.setArbitratMethod(2);
caseApplication1.setCaseStatus(CaseApplicationConstants.PENDING_WRIITEN_HEAR);
// 新增日志
CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.PENDING_WRIITEN_HEAR, "");
} else {
//修改案件状态为待修改开庭时间
caseApplication1.setArbitratMethod(1);
caseApplication1.setCaseStatus(CaseApplicationConstants.MODIFY_HEARDATE);
//修改案件状态为待修改开庭时间
// caseApplication1.setCaseStatus(CaseApplicationConstants.MODIFY_HEARDATE);
// 新增日志
CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.MODIFY_HEARDATE, "");
}
}else if (opinion == 2) {
if (arbitratMethodNow == 2) {
//修改案件状态为待书面审理
caseApplication1.setArbitratMethod(2);
caseApplication1.setCaseStatus(CaseApplicationConstants.PENDING_WRIITEN_HEAR);
// 新增日志
CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.PENDING_WRIITEN_HEAR, "");
} else {
//修改案件状态为待修改开庭时间
caseApplication1.setArbitratMethod(1);
caseApplication1.setCaseStatus(CaseApplicationConstants.MODIFY_HEARDATE);
//修改案件状态为待修改开庭时间
// caseApplication1.setCaseStatus(CaseApplicationConstants.MODIFY_HEARDATE);
@@ -104,6 +123,7 @@ public class CaseArbitrateServiceImpl implements ICaseArbitrateService {
}
}
caseApplication1.setLockStatus(1);
int i = caseApplicationMapper.submitCaseApplication(caseApplication1);
if (i > 0) {
String arbitratMethodStr = caseApplication1.getArbitratMethod() == 1 ? "开庭审理" : "书面审理";
@@ -145,6 +165,121 @@ public class CaseArbitrateServiceImpl implements ICaseArbitrateService {
return AjaxResult.success();
}
@Override
@Transactional
public AjaxResult examineArbitrateMethodBatch(CaseApplication caseApplication) {
CaseApplication caseApplicationsel = new CaseApplication();
caseApplicationsel.setBatchNumber(caseApplication.getBatchNumber());
caseApplicationsel.setCaseStatus(CaseApplicationConstants.CHECK_ARBITRATION_METHOD);
List<CaseApplication> caseApplications1 = caseApplicationMapper.listCaseApplicationByBatchNumber(caseApplicationsel);
if (caseApplications1 != null && caseApplications1.size() > 0) {
for(CaseApplication caseApplicationse:caseApplications1){
String caseNum = caseApplicationse.getCaseNum();
Integer arbitratMethod = caseApplication.getArbitratMethod();
if (arbitratMethod == 1) {
caseApplicationse.setArbitratMethod(1);
caseApplicationse.setCaseStatus(CaseApplicationConstants.MODIFY_HEARDATE);
// 新增日志
CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.MODIFY_HEARDATE, "");
}else if (arbitratMethod == 2) {
//修改案件状态为待书面审理
caseApplicationse.setArbitratMethod(2);
caseApplicationse.setCaseStatus(CaseApplicationConstants.PENDING_WRIITEN_HEAR);
// 新增日志
CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.PENDING_WRIITEN_HEAR, "");
}
int i = caseApplicationMapper.submitCaseApplication(caseApplicationse);
if (i > 0) {
String arbitratMethodStr = caseApplicationse.getArbitratMethod() == 1 ? "开庭审理" : "书面审理";
//发送短信通知
SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest();
CaseAffiliate caseAffiliate = new CaseAffiliate();
caseAffiliate.setCaseAppliId(caseApplicationse.getId());
List<CaseAffiliate> caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate); //获取案件关联人信息
if (caseAffiliates != null && caseAffiliates.size() > 0) {
for (CaseAffiliate affiliate : caseAffiliates) {
request.setTemplateId("1931000");
request.setPhone(affiliate.getContactTelphone());
// 这个值,要看你的模板中是否预留了占位符,如果没有则不需要设置
// 1931000 尊敬的{1}用户,您的{2}仲裁案件,仲裁方式已确定为{3},请知晓,如非本人操作,请忽略本短信。
String name = affiliate.getName();
request.setTemplateParamSet(new String[]{name, caseNum, arbitratMethodStr});
Boolean aBoolean = SmsUtils.sendSms(request);
//保存短信发送记录
SmsSendRecord smsSendRecord = new SmsSendRecord();
smsSendRecord.setCaseId(caseApplicationse.getId());
smsSendRecord.setCaseNum(caseApplicationse.getCaseNum());
smsSendRecord.setPhone(request.getPhone());
smsSendRecord.setSendTime(new Date());
String content = "尊敬的" + name + "用户,您的" + caseNum + "仲裁案件,仲裁方式已确定为" + arbitratMethodStr + ",请知晓,如非本人操作,请忽略本短信。";
smsSendRecord.setSendContent(content);
smsSendRecord.setCreateBy(getUsername());
if (aBoolean){
smsSendRecord.setSendStatus(1);
}else {
smsSendRecord.setSendStatus(0);
}
smsRecordMapper.saveSmsSendRecord(smsSendRecord);
}
}
}
}
}else{
throw new ServiceException("这个批号没有批量审核仲裁方式的案件");
}
return AjaxResult.success();
}
@Override
@Transactional
public AjaxResult writtenHearBatch(CaseApplication caseApplicationparam) {
CaseApplication caseApplicationsel = new CaseApplication();
caseApplicationsel.setBatchNumber(caseApplicationparam.getBatchNumber());
caseApplicationsel.setCaseStatus(CaseApplicationConstants.PENDING_WRIITEN_HEAR);
List<CaseApplication> caseApplications1 = caseApplicationMapper.listCaseApplicationByBatchNumber(caseApplicationsel);
if (caseApplications1 != null && caseApplications1.size() > 0) {
List<Long> ids = caseApplications1.stream().map(CaseApplication::getId).collect(Collectors.toList());
for (Long caseId : ids) {
//查询案件详情
CaseApplication caseApplication = new CaseApplication();
caseApplication.setId(caseId);
CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication);
//案件日志表里添加数据
CaseLogRecord caseLogRecord = new CaseLogRecord();
caseLogRecord.setCaseAppliId(caseApplication1.getId());
caseLogRecord.setCaseNode(caseApplication1.getCaseStatus());
caseLogRecord.setCreateBy(getUsername());
caseLogRecordMapper.insertCaseLogRecord(caseLogRecord);
// 新增日志
CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.VERPRIF_ARBITRATION, "");
// 生成裁决书
CaseApplication application = new CaseApplication();
application.setId(caseId);
adjudicationService.createDocument(application);
//修改案件状态
caseApplication1.setCaseStatus(CaseApplicationConstants.VERPRIF_ARBITRATION);
int i = caseApplicationMapper.submitCaseApplication(caseApplication1);
}
}else{
throw new ServiceException("这个批号没有批量书面审理的案件");
}
return AjaxResult.success();
}
@Override
@Transactional
public AjaxResult writtenHear(CaseIds caseIds) {
@@ -79,22 +79,42 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService {
//根据案件id查询案件证据材料
List<CaseAttach> evidenceMaterialList = caseAttachMapper.queryAnnexPathByCaseId(id);
if (evidenceMaterialList != null && evidenceMaterialList.size() > 0) {
// for (CaseAttach caseAttach : evidenceMaterialList) {
// //根据附件类型决定返回的路径
// Integer annexType = caseAttach.getAnnexType();
// if (annexType != 1){
// String path = caseAttach.getAnnexName();
// String prefix = "/profile";
// int startIndex = path.indexOf(prefix);
// startIndex += prefix.length();
// String extractedPath = "/uploadPath" + path.substring(startIndex);
// caseAttach.setAnnexPath(extractedPath);
// }else {
// String annexPath = caseAttach.getAnnexPath();
// String result = annexPath.replace("/home/ruoyi", "");
// caseAttach.setAnnexPath(result);
// }
// }
for (CaseAttach caseAttach : evidenceMaterialList) {
//根据附件类型决定返回的路径
Integer annexType = caseAttach.getAnnexType();
if (annexType != 1){
String path = caseAttach.getAnnexName();
String annexName = caseAttach.getAnnexName();
String prefix = "/profile";
int startIndex = path.indexOf(prefix);
int startIndex = annexName.indexOf(prefix);
if(startIndex!=-1) {
startIndex += prefix.length();
String extractedPath = "/uploadPath" + path.substring(startIndex);
caseAttach.setAnnexPath(extractedPath);
}else {
String annexPath = caseAttach.getAnnexPath();
String result = annexPath.replace("/home/ruoyi", "");
caseAttach.setAnnexPath(result);
String annexPath = "/uploadPath" + annexName.substring(startIndex);
caseAttach.setAnnexPath(annexPath);
}
int startIndexnew = annexName.lastIndexOf("/");
if (startIndexnew != -1) {
String annexNamenew = annexName.substring(startIndexnew + 1);
caseAttach.setAnnexName(annexNamenew);
}
}
}
caseDetailVO.setEvidenceMaterialList(evidenceMaterialList);
}
@@ -202,6 +222,7 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService {
}
@Override
@Transactional
public AjaxResult caseCrossexamination(CaseEvidenceDTO caseEvidenceDTO) {
//查询案件详细信息
CaseApplication caseApplication = new CaseApplication();
@@ -211,11 +232,10 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService {
caseApplication1.setAdjudicaCounterReason(caseEvidenceDTO.getAdjudicaCounterReason());
int caseStatus = caseApplication1.getCaseStatus();
caseApplication1.setObjectionAddEviden(caseEvidenceDTO.getObjectionAddEviden());
//默认书面审理
caseApplication1.setOpenCourtHear(0);
caseApplication1.setPendingAppointArbotrar(caseEvidenceDTO.getPendingAppointArbotrar());
caseApplication1.setAdjudicaCounter(caseEvidenceDTO.getAdjudicaCounter());
caseApplication1.setObjectiJuris(caseEvidenceDTO.getObjectiJuris());
caseApplication1.setRespondentIsWrittenHear(caseEvidenceDTO.getRespondentIsWrittenHear());
List<Arbitrator> arbitrators = caseEvidenceDTO.getArbitrators();
if (arbitrators != null && arbitrators.size() > 0) {
List<Long> ids = arbitrators.stream().map(Arbitrator::getId).collect(Collectors.toList());
@@ -227,15 +247,8 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService {
}
//修改案件状态
caseApplication1.setCaseStatus(CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL_SUBMMIT);
//选择仲裁方式
if (caseEvidenceDTO.getOpenCourtHear() == null){
//没选默认书面审理
caseApplication1.setArbitratMethod(2); //书面审理
}else if (caseEvidenceDTO.getOpenCourtHear() == 1){
caseApplication1.setArbitratMethod(1);
} else {
caseApplication1.setArbitratMethod(2); //书面审理
}
int i = caseApplicationMapper.submitCaseApplication(caseApplication1);
if (i > 0) {
// 新增日志
@@ -0,0 +1,72 @@
package com.ruoyi.wisdomarbitrate.service.impl;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.wisdomarbitrate.domain.CaseNumRule;
import com.ruoyi.wisdomarbitrate.mapper.CaseNumRuleMapper;
import com.ruoyi.wisdomarbitrate.service.ICaseNumRuleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
@Service
public class CaseNumRuleServiceImpl implements ICaseNumRuleService {
@Autowired
private CaseNumRuleMapper caseNumRuleMapper;
@Override
@Transactional
public AjaxResult insertCaseNumRule(CaseNumRule caseNumRule) {
int countCaseNumRule = caseNumRuleMapper.countCaseNumRule(caseNumRule);
if (countCaseNumRule>0){
return AjaxResult.error("不能新增相同案件编号规则");
}
int i = caseNumRuleMapper.insertCaseNumRule(caseNumRule);
if (i>0){
return AjaxResult.success("新增成功");
}
return AjaxResult.error("新增失败");
}
@Override
@Transactional
public AjaxResult updateCaseNumRule(CaseNumRule caseNumRule) {
int countCaseNumRule = caseNumRuleMapper.countCaseNumRule(caseNumRule);
if (countCaseNumRule>0){
return AjaxResult.error("不能修改相同案件编号规则");
}
int i = caseNumRuleMapper.updateCaseNumRule(caseNumRule);
if (i > 0) {
return AjaxResult.success("修改成功");
}
return AjaxResult.error("新增失败");
}
@Override
@Transactional
public AjaxResult deleteCaseNumRule(CaseNumRule caseNumRule) {
int i = caseNumRuleMapper.deleteCaseNumRule(caseNumRule);
if (i > 0) {
return AjaxResult.success("删除成功");
}
return AjaxResult.error();
}
@Override
public List<CaseNumRule> selectCaseNumRule(CaseNumRule caseNumRule) {
return caseNumRuleMapper.selectCaseNumRules(caseNumRule);
}
}
@@ -9,6 +9,7 @@ import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.wisdomarbitrate.domain.*;
import com.ruoyi.wisdomarbitrate.domain.dto.CaseConfirmPayDTO;
import com.ruoyi.wisdomarbitrate.domain.vo.CasePayListVO;
@@ -20,6 +21,7 @@ import com.ruoyi.dto.PayRequest;
import com.ruoyi.dto.PayResponse;
import com.ruoyi.wisdomarbitrate.domain.dto.CasePayDTO;
import com.ruoyi.wisdomarbitrate.service.ICasePaymentService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -28,6 +30,7 @@ import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
import static com.ruoyi.common.utils.SecurityUtils.getUsername;
@@ -90,26 +93,30 @@ public class CasePaymentServiceImpl implements ICasePaymentService {
@Transactional
public AjaxResult callback(String orderNumber) {
//查询记录
CasePaymentRecord casePaymentRecord = casePaymentRecordMapper.queryRecord(orderNumber);
if (casePaymentRecord == null) {
return AjaxResult.error("未查询到相关记录");
}
List<CasePaymentRecord> casePaymentRecords = casePaymentRecordMapper.queryRecord(orderNumber);
if(casePaymentRecords!=null&&casePaymentRecords.size()>0){
for (CasePaymentRecord casePaymentRecord:casePaymentRecords){
Long caseId = casePaymentRecord.getCaseId();
//更改记录表里的支付状态和支付时间
casePaymentRecord.setPaymentStatus(1);
casePaymentRecord.setPaymentTime(new Date());
casePaymentRecord.setUpdateTime(new Date());
casePaymentRecordMapper.update(casePaymentRecord);
}
}else {
return AjaxResult.error("未查询到相关记录");
}
return AjaxResult.success("支付成功");
}
@Override
@Transactional
public AjaxResult confirmPayment(CaseApplication caseApplication) {
public AjaxResult confirmPayment( List<Long> ids) {
for (Long id : ids) {
CaseApplication caseApplication = new CaseApplication();
caseApplication.setId(id);
caseApplication.setCaseStatus(CaseApplicationConstants.CASE_CROSSEXAMI);
int i = caseApplicationMapper.submitCaseApplication(caseApplication);
if (i > 0) {
caseApplicationMapper.submitCaseApplication(caseApplication);
//发送短信通知
SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest();
CaseAffiliate caseAffiliate = new CaseAffiliate();
@@ -122,7 +129,7 @@ public class CasePaymentServiceImpl implements ICasePaymentService {
//查询案件详细信息
CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication);
if (caseApplication1 == null) {
return AjaxResult.error();
continue;
}
String caseName = "仲裁"; //这里案件名称表里未定义,暂时写死
String caseNum = caseApplication1.getCaseNum();
@@ -150,12 +157,13 @@ public class CasePaymentServiceImpl implements ICasePaymentService {
}
smsRecordMapper.saveSmsSendRecord(smsSendRecord);
} else { //被申请人
Boolean aBoolean = SmsUtils.sendSms(request);
request.setPhone(affiliate.getContactTelphone());
request.setTemplateId("1952840");
// 1952840 尊敬的{1}用户,您的{2}案件{3}已成功受理,请点击链接:https://miniapp-3gpama6l759911ef-1321289474.tcloudbaseapp.com/jump-mp.html 选择是否应诉。如非本人操作,请忽略本短信
String name = affiliate.getName();
request.setTemplateParamSet(new String[]{name, caseName, caseNum});
Boolean aBoolean = SmsUtils.sendSms(request);
//保存短信发送记录
SmsSendRecord smsSendRecord = new SmsSendRecord();
smsSendRecord.setCaseId(caseApplication.getId());
@@ -181,12 +189,11 @@ public class CasePaymentServiceImpl implements ICasePaymentService {
casePaymentRecordMapper.update(casePaymentRecord);
// 新增日志
CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CASE_CROSSEXAMI, "");
}
}
return AjaxResult.success();
}
}
return AjaxResult.error("暂无需要确认的缴费清单");
}
@Transactional
@Override
@@ -248,9 +255,8 @@ public class CasePaymentServiceImpl implements ICasePaymentService {
caseApplication.setId(caseId);
CaseApplication caseApplication1 = caseApplicationService.selectCaseApplication(caseApplication);
BigDecimal feePayable = caseApplication1.getFeePayable();
feePayable = feePayable.multiply(new BigDecimal(100));
sum = sum.add(feePayable);
listVO.setTotalFee(sum.intValue());
listVO.setTotalFee(sum);
caseApplicationPay.setCaseAppName(caseApplication1.getApplicantName());
caseApplicationPay.setCaseResName(caseApplication1.getRespondentName());
caseApplicationPay.setCaseNum(caseApplication1.getCaseNum());
@@ -267,5 +273,219 @@ public class CasePaymentServiceImpl implements ICasePaymentService {
return AjaxResult.success(listVO);
}
@Override
@Transactional
public AjaxResult confirmPayBatch(CasePayDTO payDTO) {
String batchNumber = payDTO.getBatchNumber();
CaseApplication caseApplicationsel = new CaseApplication();
caseApplicationsel.setBatchNumber(Integer.parseInt(batchNumber));
caseApplicationsel.setCaseStatus(CaseApplicationConstants.PENDING_PAYMENT);
List<CaseApplication> caseApplications = caseApplicationMapper.listCaseApplicationByBatchNumber(caseApplicationsel);
List<Long> caseIds = caseApplications.stream().map(CaseApplication::getId).collect(Collectors.toList());
if(caseApplications!=null&&caseApplications.size()>0){
if (payDTO.getPayType() != null) {
payDTO.setCaseIds(caseIds);
// 修改支付方式
CaseConfirmPayDTO caseConfirmPayDTO = new CaseConfirmPayDTO();
BeanUtils.copyProperties(payDTO, caseConfirmPayDTO);
caseApplicationMapper.updatePayType(caseConfirmPayDTO);
}
for (Long caseId : caseIds) {
if (CollectionUtil.isNotEmpty(payDTO.getPayOrderList())) {
for (CaseAttach caseAttach : payDTO.getPayOrderList()) {
caseAttach.setCaseAppliId(caseId);
caseAttachMapper.updateCaseAttach(caseAttach);
}
}
// 修改节点状态
//根据案件id查询案件信息
CaseApplication caseApplication = new CaseApplication();
caseApplication.setId(caseId);
CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication);
caseApplication1.setCaseStatus(CaseApplicationConstants.PENDING_PAYMENT_CONFIRM);
//修改案件状态
int i = caseApplicationMapper.submitCaseApplication(caseApplication1);
if (i > 0) {
// 修改支付状态
CasePaymentRecord paymentRecord = new CasePaymentRecord();
paymentRecord.setPayType(payDTO.getPayType());
paymentRecord.setCaseId(caseId);
paymentRecord.setPaymentStatus(1);
casePaymentRecordMapper.saveRecord(paymentRecord);
// 新增日志
CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.PENDING_PAYMENT_CONFIRM, "");
}
}
}else{
throw new ServiceException("这个批号没有批量缴费的案件");
}
return AjaxResult.success("确认缴费成功");
}
@Override
public AjaxResult casePayListBatch(CasePayDTO casePayDTO) {
String batchNumber = casePayDTO.getBatchNumber();
CaseApplication caseApplicationsel = new CaseApplication();
caseApplicationsel.setBatchNumber(Integer.parseInt(batchNumber));
// caseApplicationsel.setCaseStatus(CaseApplicationConstants.PENDING_PAYMENT);
List<CaseApplication> caseApplications = caseApplicationMapper.listCaseApplicationByBatchNumber(caseApplicationsel);
CasePayListVO listVO = new CasePayListVO();
BigDecimal sum = new BigDecimal(0);
if(caseApplications!=null&&caseApplications.size()>0){
for(CaseApplication caseApplication:caseApplications){
BigDecimal feePayable = caseApplication.getFeePayable();
sum = sum.add(feePayable);
}
listVO.setTotalFee(sum);
}
if (sum.compareTo(BigDecimal.ZERO) == 0) {
return AjaxResult.error("没有可支付的费用");
}
return AjaxResult.success(listVO);
}
@Override
@Transactional
public AjaxResult confirmPaymentBatch(String batchNumber) {
CaseApplication caseApplicationsel = new CaseApplication();
caseApplicationsel.setBatchNumber(Integer.parseInt(batchNumber));
caseApplicationsel.setCaseStatus(CaseApplicationConstants.PENDING_PAYMENT_CONFIRM);
List<CaseApplication> caseApplications = caseApplicationMapper.listCaseApplicationByBatchNumber(caseApplicationsel);
if (caseApplications != null && caseApplications.size() > 0) {
List<Long> caseIds = caseApplications.stream().map(CaseApplication::getId).collect(Collectors.toList());
for (Long caseId : caseIds) {
CaseApplication caseApplication = new CaseApplication();
caseApplication.setId(caseId);
caseApplication.setCaseStatus(CaseApplicationConstants.CASE_CROSSEXAMI);
caseApplicationMapper.submitCaseApplication(caseApplication);
//发送短信通知
SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest();
CaseAffiliate caseAffiliate = new CaseAffiliate();
caseAffiliate.setCaseAppliId(caseApplication.getId());
List<CaseAffiliate> caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate); //获取案件关联人信息
if (caseAffiliates != null && caseAffiliates.size() > 0) {
for (CaseAffiliate affiliate : caseAffiliates) {
//获取身份类型
int identityType = affiliate.getIdentityType();
//查询案件详细信息
CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication);
if (caseApplication1 == null) {
continue;
}
String caseName = "仲裁"; //这里案件名称表里未定义,暂时写死
String caseNum = caseApplication1.getCaseNum();
if (identityType == 1) { //申请人
request.setPhone(affiliate.getContactTelphone());
request.setTemplateId("1928003"); //传入申请人模板id
// 这个值,要看你的模板中是否预留了占位符,如果没有则不需要设置
// 模板id:1928003 普通短信 案件受理通知
String name = affiliate.getName();
request.setTemplateParamSet(new String[]{name, caseName, caseNum});
Boolean aBoolean = SmsUtils.sendSms(request);
//保存短信发送记录
SmsSendRecord smsSendRecord = new SmsSendRecord();
smsSendRecord.setCaseId(caseApplication.getId());
smsSendRecord.setCaseNum(caseNum);
smsSendRecord.setPhone(request.getPhone());
smsSendRecord.setSendTime(new Date());
String content = "尊敬的" + name + "用户,您的" + caseName + "案件" + caseNum + "已成功受理。";
smsSendRecord.setSendContent(content);
smsSendRecord.setCreateBy(getUsername());
if (aBoolean) {
smsSendRecord.setSendStatus(1);
} else {
smsSendRecord.setSendStatus(0);
}
smsRecordMapper.saveSmsSendRecord(smsSendRecord);
} else { //被申请人
request.setPhone(affiliate.getContactTelphone());
request.setTemplateId("1952840");
// 1952840 尊敬的{1}用户,您的{2}案件{3}已成功受理,请点击链接:https://miniapp-3gpama6l759911ef-1321289474.tcloudbaseapp.com/jump-mp.html 选择是否应诉。如非本人操作,请忽略本短信
String name = affiliate.getName();
request.setTemplateParamSet(new String[]{name, caseName, caseNum});
Boolean aBoolean = SmsUtils.sendSms(request);
//保存短信发送记录
SmsSendRecord smsSendRecord = new SmsSendRecord();
smsSendRecord.setCaseId(caseApplication.getId());
smsSendRecord.setCaseNum(caseNum);
smsSendRecord.setPhone(request.getPhone());
smsSendRecord.setSendTime(new Date());
String content = "尊敬的" + name + "用户,您的" + caseName + "案件" + caseNum + "已成功受理,请点击链接:https://miniapp-3gpama6l759911ef-1321289474.tcloudbaseapp.com/jump-mp.html 选择是否应诉。如非本人操作,请忽略本短信";
smsSendRecord.setSendContent(content);
smsSendRecord.setCreateBy(getUsername());
if (aBoolean) {
smsSendRecord.setSendStatus(1);
} else {
smsSendRecord.setSendStatus(0);
}
smsRecordMapper.saveSmsSendRecord(smsSendRecord);
}
}
//更改记录表里的支付状态和支付时间
CasePaymentRecord casePaymentRecord = new CasePaymentRecord();
casePaymentRecord.setPaymentStatus(1);
casePaymentRecord.setCaseId(caseId);
casePaymentRecord.setPaymentTime(new Date());
casePaymentRecord.setUpdateTime(new Date());
casePaymentRecordMapper.update(casePaymentRecord);
// 新增日志
CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CASE_CROSSEXAMI, "");
}
}
}else{
throw new ServiceException("这个批号没有批量缴费确认的案件");
}
return AjaxResult.success();
}
@Override
@Transactional
public AjaxResult casePayBatch(CasePayDTO casePayDTO) {
PayRequest payRequest = new PayRequest();
payRequest.setBody("案件缴费");
payRequest.setOrderSn(System.currentTimeMillis() + "");
payRequest.setTotalFee(casePayDTO.getTotalFee());
PayResponse response = elegentPay.requestPay(payRequest, casePayDTO.getTradeType(), casePayDTO.getPlatform());
if (response.getCode_url() == null) {
return AjaxResult.error();
}
String batchNumber = casePayDTO.getBatchNumber();
if(StringUtils.isEmpty(batchNumber) ){
return AjaxResult.error("请检查参数是否有误");
}
CaseApplication caseApplicationsel = new CaseApplication();
caseApplicationsel.setBatchNumber(Integer.parseInt(batchNumber));
caseApplicationsel.setCaseStatus(CaseApplicationConstants.PENDING_PAYMENT);
List<CaseApplication> caseApplications = caseApplicationMapper.listCaseApplicationByBatchNumber(caseApplicationsel);
if(caseApplications!=null&&caseApplications.size()>0){
List<Long> caseIds = caseApplications.stream().map(CaseApplication::getId).collect(Collectors.toList());
for (Long caseId : caseIds) {
//缴费记录表里新增数据
CasePaymentRecord casePaymentRecord = new CasePaymentRecord();
casePaymentRecord.setCaseId(caseId);
casePaymentRecord.setOrderNumber(payRequest.getOrderSn());
casePaymentRecord.setPaymentStatus(0);
casePaymentRecord.setCreateTime(new Date());
int count = casePaymentRecordMapper.saveRecord(casePaymentRecord);
if (count < 1) {
return AjaxResult.error();
}
}
}
return AjaxResult.success(response);
}
}
@@ -25,18 +25,22 @@ 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.task.CaseZipImportTask;
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.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;
import java.io.*;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
import java.util.function.Function;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@@ -70,8 +74,6 @@ public class CaseZipImportImpl {
@Autowired
private SysUserRoleMapper userRoleMapper;
@Autowired
private CaseApplicationLogMapper caseApplicationLogMapper;
@Autowired
private CaseAffiliateLogMapper caseAffiliateLogMapper;
@Autowired
private CaseAttachLogMapper caseAttachLogMapper;
@@ -85,11 +87,14 @@ public class CaseZipImportImpl {
private ColumnValueLogMapper columnValueLogMapper;
@Autowired
private CaseAffiliateMapper caseAffiliateMapper;
@Autowired
private CaseApplicationLogMapper caseApplicationLogMapper;
// 申请人角色id
private long roleId;
private Integer maxCaseNum;
private Integer maxBatchNumber;
@Transactional
public AjaxResult zipImport(MultipartFile file, Long templateId) {
UUID uuid = UUID.randomUUID();
// todo
@@ -113,51 +118,14 @@ public class CaseZipImportImpl {
boolean unzipSuccess = UnZipFileUtils.unZipFile(zipFile, targetPath);
if (!unzipSuccess) {
// 解压失败
return AjaxResult.error("解压失败");
throw new ServiceException("解压失败");
}
// 查询抓取规则
// todo 批次需要再上传压缩包时用户填写
List<FatchRule> fatchRuleList = fatchRuleMapper.listByTemplateId(templateId);
if (CollectionUtil.isEmpty(fatchRuleList)) {
return error("未设置抓取规则");
throw new ServiceException("未设置抓取规则");
}
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");
@@ -170,25 +138,8 @@ public class CaseZipImportImpl {
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<>();
/**
* 用户表已存在的用户
*/
@@ -201,64 +152,123 @@ public class CaseZipImportImpl {
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);
// 抓取内容
Map<String, String> fatchMap = new HashMap<>();
// 从抓取规则表取字段和字典表取基本字段,字典表的字段名塞到基本表,is_default=1自定义字段塞到columnValue
// 抓取规则,0-内置字段,1-自定义字段
Map<String, List<FatchRule>> fatchRuleMap = fatchRuleList.stream().collect(Collectors.groupingBy(FatchRule::getFileName));
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();
File directory = new File(targetPath);
if (!directory.exists()) {
throw new ServiceException("文件不存在");
}
// 找出案件文件夹
if (!directory.isDirectory() || directory.listFiles() == null) {
throw new ServiceException("未找到文件夹");
}
Integer 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);
}
File[] files = directory.listFiles();
CaseZipImportTask caseZipImportTask = null;
try {
caseZipImportTask = new CaseZipImportTask(this, templateId, fatchRuleList, fatchMap, fatchRuleMap, userMap, dictDataList, files , deptMap, SecurityUtils.getLoginUser(),maxBatchNumber);
} catch (Exception e) {
return error("导入失败");
}
Future<List<CaseApplication>> future = ThreadPoolUtil.submit(caseZipImportTask);
try {
if(future.get()!=null){
return success("导入成功");
}
} catch (InterruptedException e) {
e.printStackTrace();
return success("导入失败");
} catch (ExecutionException e) {
e.printStackTrace();
return success("导入失败");
}
return error("导入失败");
}
@Transactional
public CaseApplication buildCaseInfo(File file, Long templateId, List<FatchRule> fatchRuleList, Map<String, List<FatchRule>> fatchRuleMap, Map<String, String> fatchMap, Map<String, SysUser> userMap, List<SysDictData> dictDataList, Map<String, Long> deptMap,LoginUser loginUser, Integer maxBatchNumber) {
// fileMap<caseId, List<File>>
Map<String, String> fileMap = findFile(file, fatchRuleList);
if (fileMap != null && fileMap.size()> 0) {
// 根据抓取规则循环抓取
for (Map.Entry<String, List<FatchRule>> entry : fatchRuleMap.entrySet()) {
getFatchContent(fileMap, entry.getKey(), fatchMap, entry.getValue());
}
if (fatchMap.size() > 0) {
// 尊敬的{1},您的代理的案件已接入仲裁系统,复制访问https://miniapp-3gpama6l759911ef-1321289474.tcloudbaseapp.com/jump-mp.html 进入小程序进行认证注册。如非本人操作,请忽略本短信
SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest();
request.setTemplateId("1956159");
// 新增的案件
// 组装案件内置字段主表内容
CaseApplication caseApplication = new CaseApplication();
caseApplication.setId(IdWorkerUtil.getId());
caseApplication.setTemplateId(templateId);
Map<Integer, List<FatchRule>> defaultRuleMap = fatchRuleList.stream().collect(Collectors.groupingBy(FatchRule::getIsDefault));
// 自定义字段,组装columnValue表
List<ColumnValue> columnValueList = new ArrayList<>();
if (defaultRuleMap.size() > 0 && defaultRuleMap.containsKey(1)) {
List<FatchRule> columnRules = defaultRuleMap.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.setValue(fatchMap.get(columnRule.getColumnName()));
columnValue.setIsDefault(1);
columnValue.setCaseId(caseId);
columnValue.setCaseAppliLogId(caseApplication.getCaseLogId());
columnValue.setCaseId(caseApplication.getId());
columnValueList.add(columnValue);
});
}
caseApplication.setColumnValues(columnValueList);
}
// 角色用户
List<SysUserRole> userRoleList = 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> addUsers = new ArrayList<>();
caseApplication.setCaseStatus(CaseApplicationConstants.CASE_APPLICATION);
caseApplication.setCaseLogId(IdWorkerUtil.getId());
caseApplication.setUpdateSubmitStatus(UpdateSubmitStatus.UNCOMMITTED.getCode());
caseApplication.setCaseAppliId(caseApplication.getId());
// 设置批号
caseApplication.setBatchNumber(maxBatchNumber);
// 设置编号
String maxCaseNumStr = generateCaseNum();
caseApplication.setCaseNum(maxCaseNumStr);
caseApplication.setCreateBy(loginUser!=null?loginUser.getUsername():"admin");
caseApplication.setVersion(1);
// 组装案件内置字段主表内容
// 组装内置字段
buildDefaultColumn(caseApplication, dictDataList, fatchMap, caseAffiliates, deptMap, sysDepts, userMap, addUsers, userRoleList, smsSendRecordList, smsRequestList);
for (File caseFile : fileMap.get(caseId)) {
String fileUrl = caseFile.getAbsolutePath();
buildDefaultColumn(caseApplication, dictDataList, fatchMap, deptMap, sysDepts, userMap, addUsers, userRoleList, smsSendRecordList, smsRequestList);
// 组装附件
for (Map.Entry<String, String> entry : fileMap.entrySet()) {
String fileUrl = entry.getValue();
if (StrUtil.isEmpty(fileUrl)) {
continue;
}
@@ -267,7 +277,6 @@ public class CaseZipImportImpl {
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");
@@ -282,96 +291,221 @@ public class CaseZipImportImpl {
applyFile.setAnnexType(1);
caseAttachs.add(applyFile);
}
}
// 案件压缩包导入
caseApplication.setImportFlag(2);
// 组装短信
}
caseApplication.setCaseAttachList(caseAttachs);
// 案件压缩包导入
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()]));
// }
// 多线程执行
ThreadPoolUtil.execute(() -> {
try {
caseApplicationMapper.insertCaseApplication(caseApplication);
caseApplicationLogMapper.insert(caseApplication);
// 多线程执行
List<MultipleThreadListParam> execList = new ArrayList<>();
if (CollectionUtil.isNotEmpty(addUsers)) {
Function<List<SysUser>, Integer> function = userMapper::batchSave;
execList.add(new MultipleThreadListParam(function, addUsers));
userMapper.batchSave(addUsers);
}
if (CollectionUtil.isNotEmpty(userRoleList)) {
Function<List<SysUserRole>, Integer> function = userRoleMapper::batchUserRole;
execList.add(new MultipleThreadListParam(function, userRoleList));
userRoleMapper.batchUserRole(userRoleList);
}
if (CollectionUtil.isNotEmpty(sysDepts)) {
Function<List<SysDept>, Integer> function = sysDeptMapper::batchSave;
execList.add(new MultipleThreadListParam(function, sysDepts));
sysDeptMapper.batchSave(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(caseApplication.getCaseAffiliates())) {
caseAffiliateMapper.batchCaseAffiliate(caseApplication.getCaseAffiliates());
caseAffiliateLogMapper.batchCaseAffiliate(caseApplication.getCaseAffiliates());
}
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));
caseAttachMapper.batchSave(caseAttachs);
caseAttachLogMapper.batchSave(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));
columnValueMapper.batchSave(columnValueList);
columnValueLogMapper.batchSave(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());
// 新增日志
CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CASE_APPLICATION, "",loginUser);
// 发送短信
if (CollectionUtil.isNotEmpty(smsRequestList)) {
Map<Long, SmsSendRecord> sendRecordMap = null;
if (CollectionUtil.isNotEmpty(smsSendRecordList)) {
sendRecordMap = smsSendRecordList.stream().collect(Collectors.toMap(SmsSendRecord::getCaseId, Function.identity()));
for (SmsUtils.SendSmsRequest sendSmsRequest : smsRequestList) {
Boolean aBoolean = SmsUtils.sendSms(request);
if (sendRecordMap != null && sendRecordMap.containsKey(sendSmsRequest.getCaseId())) {
if (aBoolean) {
sendRecordMap.get(sendSmsRequest.getCaseId()).setSendStatus(1);
} else {
operLog.setCreateBy("admin");
operLog.setCreateNickName("管理员");
operLog.setUpdateBy("admin");
sendRecordMap.get(sendSmsRequest.getCaseId()).setSendStatus(0);
}
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("导入成功");
smsRecordMapper.batchSaveSmsSendRecord(smsSendRecordList);
}
}
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException("导入失败,请检查抓取规则是否正确");
}
});
return caseApplication;
}
}
return null;
}
/**
* 获取抓取内容
*
* @param andConvertPDF 文件路径map
* @param mapKey 文件名
* @param map 抓取内容map
* @param fatchRules 抓取规则
*/
private void getFatchContent(Map<String, String> andConvertPDF, String mapKey, Map<String, String> map, List<FatchRule> fatchRules) {
String fileURL =null;
for (Map.Entry<String, String> entry : andConvertPDF.entrySet()) {
if(entry.getKey().contains(mapKey)){
fileURL=entry.getValue();
}
}
if (StrUtil.isEmpty(fileURL)) {
return;
}
if (fileURL.endsWith("txt")) {
String readerFile = ReadFileUtils.readerTxtFile(fileURL);
OCRUtils.fatchRuleGetContent(readerFile, fatchRules, map);
} 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, map);
} 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, map);
}
}
/**
* 查找文件
*
* @param directory
* @param fatchRuleList
* @return
*/
private Map<String, String> findFile(File directory, List<FatchRule> fatchRuleList) {
Map<String, String> filePathMap = new HashMap<>();
if (directory.isFile()) {
String path = "";
// 如果传入的参数是一个文件
path = directory.getAbsolutePath();
filePathMap.put(directory.getName(), path);
} else if (directory.isDirectory()) {
searchAndConvertPDF(directory, filePathMap);
} else {
return null;
}
return filePathMap;
}
/**
* 递归查找文件夹
*
* @param directory
* @param filePathMap
*/
public static void searchAndConvertPDF(File directory, Map<String, String> filePathMap) {
File[] files = directory.listFiles();
if (files != null) {
for (File file : files) {
if (file.getName().contains("zip") || file.getName().contains("rar")) {
continue;
}
if (file.isFile()) {
filePathMap.put(file.getName(), file.getAbsolutePath());
} else if (file.isDirectory()) {
// 如果是目录,递归查找
searchAndConvertPDF(file, filePathMap);
}
}
}
}
/**
@@ -575,13 +709,14 @@ public class CaseZipImportImpl {
* @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, 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;
}
List<CaseAffiliate> caseAffiliates = new ArrayList<>();
// 被申请人
CaseAffiliate debtorAffiliate = new CaseAffiliate();
debtorAffiliate.setCaseAppliId(caseApplication.getId());
@@ -598,22 +733,38 @@ public class CaseZipImportImpl {
} 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);
buildAffilcateColumn(dictData, fatchMap, affiliate, deptMap, sysDepts, userMap, addUsers, userRoleList, caseApplication, smsSendRecords, smsRequestList);
} else if (dictData.getDictLabel().contains("合同编号")) {
// 合同编号
String contractNumber = fatchMap.get("合同编号" + Constants.PDFSTR + caseApplication.getId());
String contractNumber = fatchMap.get("合同编号" );
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 if (dictData.getDictLabel().contains("案件标的")) {
String caseSubjectAmount = fatchMap.get(dictData.getDictLabel());
if(StrUtil.isNotEmpty(caseSubjectAmount)) {
try {
BigDecimal bigDecimal = new BigDecimal(caseSubjectAmount);
caseApplication.setCaseSubjectAmount(bigDecimal);
// todo 案件标的名字要改,字典配置中也要改
//todo 暂时设置计费比率为0.01
BigDecimal feeRate = new BigDecimal(0.01);
BigDecimal feePayable = caseApplication.getCaseSubjectAmount().multiply(feeRate).setScale(2, BigDecimal.ROUND_HALF_UP);
caseApplication.setFeePayable(feePayable);
} catch (Exception e) {
}
}
} else {
ObjectFieldUtils.setValue(caseApplication, dictData.getDictValue(), fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseApplication.getId()));
ObjectFieldUtils.setValue(caseApplication, dictData.getDictValue(), fatchMap.get(dictData.getDictLabel() ));
}
} else {
ObjectFieldUtils.setValue(caseApplication, dictData.getDictValue(), fatchMap.get(dictData.getDictLabel() ));
}
@@ -624,7 +775,7 @@ public class CaseZipImportImpl {
if (ObjectUtil.isNotEmpty(debtorAffiliate)) {
caseAffiliates.add(debtorAffiliate);
}
caseApplication.setCaseAffiliates(caseAffiliates);
}
@@ -637,7 +788,7 @@ public class CaseZipImportImpl {
*/
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,
Map<String, SysUser> userMap, List<SysUser> addUsers, List<SysUserRole> userRoleList, CaseApplication caseApplication,
List<SmsSendRecord> smsSendRecords, List<SmsUtils.SendSmsRequest> smsRequestList) {
affiliate.setIdentityType(1);
@@ -645,7 +796,7 @@ public class CaseZipImportImpl {
// 申请人
switch (dictData.getDictLabel()) {
case "申请人姓名":
affiliate.setName((fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId)));
affiliate.setName((fatchMap.get(dictData.getDictLabel())));
if (StrUtil.isNotEmpty(affiliate.getName())) {
// 组装申请机构
// 将组织机构id设为申请人名称
@@ -673,25 +824,25 @@ public class CaseZipImportImpl {
}
break;
case "统一社会信用代码":
affiliate.setIdentityNum((fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId)));
affiliate.setIdentityNum((fatchMap.get(dictData.getDictLabel())));
break;
case "法定代表人":
affiliate.setCompLegalPerson(fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId));
affiliate.setCompLegalPerson(fatchMap.get(dictData.getDictLabel()));
break;
case "法定代表人职位":
affiliate.setCompLegalperPost((fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId)));
affiliate.setCompLegalperPost((fatchMap.get(dictData.getDictLabel())));
break;
case "申请人住所":
affiliate.setResidenAffili((fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId)));
affiliate.setResidenAffili((fatchMap.get(dictData.getDictLabel())));
break;
case "申请人联系地址":
affiliate.setContactAddress(fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId));
affiliate.setContactAddress(fatchMap.get(dictData.getDictLabel()));
break;
case "委托代理人姓名":
affiliate.setNameAgent(fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId));
affiliate.setNameAgent(fatchMap.get(dictData.getDictLabel()));
break;
case "委托代理人联系电话":
affiliate.setContactTelphoneAgent(fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId));
affiliate.setContactTelphoneAgent(fatchMap.get(dictData.getDictLabel()));
if (StrUtil.isNotEmpty(affiliate.getContactTelphoneAgent())) {
SysUser agentUser = null;
// 用户已存在
@@ -736,14 +887,15 @@ public class CaseZipImportImpl {
}
if (addUsers != null) {
SysUser finalAgentUser = agentUser;
if (CollectionUtil.isNotEmpty(smsRequestList) && smsRequestList.stream().noneMatch(smsSendRecord -> smsSendRecord.getPhone().equals(finalAgentUser.getPhonenumber()))) {
SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest();
request.setTemplateId("1956159");
request.setPhone(agentUser.getPhonenumber());
request.setTemplateParamSet(new String[]{agentUser.getNickName()});
smsRequestList.add(request);
SmsSendRecord smsSendRecord = new SmsSendRecord();
smsSendRecord.setCaseId(caseId);
CaseApplication caseApplication = new CaseApplication();
caseApplication.setId(caseId);
smsSendRecord.setCaseId(caseApplication.getId());
smsSendRecord.setCaseNum(caseApplication.getCaseNum());
smsSendRecord.setPhone(request.getPhone());
smsSendRecord.setSendTime(new Date());
@@ -751,16 +903,18 @@ public class CaseZipImportImpl {
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);
affiliate.setAgentEmail(StrUtil.isNotEmpty(fatchMap.get(dictData.getDictLabel())) ? fatchMap.get(dictData.getDictLabel()).replace("\n", "").replaceAll("\\s", "") : null);
break;
default:
ObjectFieldUtils.setValue(caseApplication, dictData.getDictValue(), fatchMap.get(dictData.getDictLabel() ));
break;
}
}
@@ -793,11 +947,11 @@ public class CaseZipImportImpl {
// 被申请人
switch (dictData.getDictLabel()) {
case "被申请人姓名":
debtorAffiliate.setName(fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId));
debtorAffiliate.setName(fatchMap.get(dictData.getDictLabel() ));
break;
case "被申请人身份证号":
String identityNum = fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId);
debtorAffiliate.setIdentityNum(fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId));
String identityNum = fatchMap.get(dictData.getDictLabel() );
debtorAffiliate.setIdentityNum(fatchMap.get(dictData.getDictLabel() ));
// 出生年月日,从身份证抓取
if (StrUtil.isNotEmpty(identityNum)) {
identityNum = identityNum.replace("\n", "");
@@ -819,13 +973,13 @@ public class CaseZipImportImpl {
break;
case "被申请人住所":
debtorAffiliate.setResidenAffili(fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId));
debtorAffiliate.setResidenAffili(fatchMap.get(dictData.getDictLabel() ));
break;
case "被申请人联系电话":
debtorAffiliate.setContactTelphone(fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId));
debtorAffiliate.setContactTelphone(fatchMap.get(dictData.getDictLabel() ));
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);
debtorAffiliate.setEmail(StrUtil.isNotEmpty(fatchMap.get(dictData.getDictLabel() )) ? fatchMap.get(dictData.getDictLabel() ).replace("\n", "").replaceAll("\\s", "") : null);
break;
default:
@@ -291,12 +291,14 @@ public class DeptIdentifyServiceImpl implements IDeptIdentifyService {
if (annexId != null) {
//根据附件id查询路径
CaseAttach caseAttach = caseAttachMapper.queryAnnexById(annexId);
if(caseAttach!=null){
String annexName = caseAttach.getAnnexName();
String prefix = "/profile";
int startIndex = annexName.indexOf(prefix);
startIndex += prefix.length();
String annexPath = "/uploadPath" + annexName.substring(startIndex);
sealManage1.setAnnexPath(annexPath);
}
} else {
sealManage1.setAnnexPath(null);
}
@@ -7,6 +7,7 @@ import com.ruoyi.wisdomarbitrate.mapper.TemplateManualMapper;
import com.ruoyi.wisdomarbitrate.service.ITemplateService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
@Service
@@ -14,6 +15,7 @@ public class TemplateServiceImpl implements ITemplateService {
@Autowired
private TemplateManualMapper templateManualMapper;
@Override
@Transactional
public AjaxResult insertTemplate(TemplateManual templateManual) {
int i = templateManualMapper.insertTemplateManual(templateManual);
if (i>0){
@@ -23,6 +25,7 @@ public class TemplateServiceImpl implements ITemplateService {
}
@Override
@Transactional
public AjaxResult deleteTemplate(Long id) {
TemplateManual templateManual = new TemplateManual();
templateManual.setId(id);
@@ -35,6 +38,7 @@ public class TemplateServiceImpl implements ITemplateService {
}
@Override
@Transactional
public AjaxResult updateTemplate(TemplateManual templateManual) {
int i = templateManualMapper.updateTemplateManual(templateManual);
if (i > 0) {
@@ -3,6 +3,7 @@ package com.ruoyi.wisdomarbitrate.service.impl;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HttpUtil;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
@@ -134,10 +135,27 @@ public class VideoServiceImpl implements VideoService {
String mediaId = jsonObject3.getString("MediaId");
// 建立相关的数据库用来存储音视频录制地址并和相关的业务ID绑定,用于后续下载
try {
downloadImage(fileId,videoUrl,roomId);
// 调解系统roomId>4294967294L/2
if(StrUtil.isNotEmpty(roomId)) {
log.debug("roomId:" + roomId);
if (Long.valueOf(roomId) > 4294967294L / 2) {
log.debug("调用调解系统:" );
log.debug("回调jsonObject:"+jsonObject );
// 调用调解系统
cn.hutool.json.JSONObject params = JSONUtil.createObj();
params.set("roomId",roomId);
params.set("fileId",fileId);
params.set("videoUrl",videoUrl);
String post = HttpUtil.post("http://121.40.189.20:7001/video/videoRollBack", params.toJSONString(2));
throw new RuntimeException(post);
} else {
downloadImage(fileId, videoUrl, roomId);
}
}
} catch (IOException e) {
throw new RuntimeException(e);
throw new RuntimeException("roomId:"+roomId);
}
}
@@ -174,6 +192,8 @@ public class VideoServiceImpl implements VideoService {
return success(caseAttachList);
}
/**
* 开启腾讯云录制
* @param roomId
@@ -0,0 +1,72 @@
package com.ruoyi.wisdomarbitrate.task;
import com.ruoyi.common.core.domain.entity.SysDictData;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
import com.ruoyi.wisdomarbitrate.domain.FatchRule;
import com.ruoyi.wisdomarbitrate.service.impl.CaseZipImportImpl;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.Callable;
/**
* @description rbd调用xfta计算任务类
* @Author mingYang
* @Date 2021/11/12 15:35
* @Version V1.0
**/
public class CaseZipImportTask implements Callable<List<CaseApplication>> {
private CaseZipImportImpl caseZipImportImpl;
private Long templateId;
private List<FatchRule> fatchRuleList;
private Map<String, String> fatchMap;
private Map<String, List<FatchRule>> fatchRuleMap;
private Map<String, SysUser> userMap;
private List<SysDictData> dictDataList;
private File[] files;
private Map<String, Long> deptMap;
private LoginUser loginUser;
private Integer maxBatchNumber;
public CaseZipImportTask(CaseZipImportImpl caseZipImportImpl, Long templateId, List<FatchRule> fatchRuleList, Map<String, String> fatchMap, Map<String, List<FatchRule>> fatchRuleMap, Map<String, SysUser> userMap, List<SysDictData> dictDataList, File[] files, Map<String, Long> deptMap, LoginUser loginUser,Integer maxBatchNumber) {
this.caseZipImportImpl = caseZipImportImpl;
this.templateId = templateId;
this.fatchRuleList = fatchRuleList;
this.fatchMap = fatchMap;
this.fatchRuleMap = fatchRuleMap;
this.userMap = userMap;
this.dictDataList = dictDataList;
this.files = files;
this.deptMap = deptMap;
this.loginUser = loginUser;
this.maxBatchNumber = maxBatchNumber;
}
@Override
public List<CaseApplication> call() {
List<CaseApplication> caseApplications = new ArrayList<>();
try {
for (File file1 : files) {
if (file1.isDirectory() && file1.listFiles() != null) {
for (File file2 : file1.listFiles()) {
CaseApplication caseApplication = caseZipImportImpl.buildCaseInfo(file2, templateId, fatchRuleList, fatchRuleMap, fatchMap, userMap, dictDataList, deptMap, loginUser,maxBatchNumber);
if (caseApplication != null) {
caseApplications.add(caseApplication);
}
}
}
}
} catch (Exception e) {
throw new RuntimeException("导入失败");
}
return caseApplications;
}
}
@@ -47,6 +47,30 @@ public class CaseLogUtils
operLog.setNotes(notes);
caseLogRecordMapper.insertCaseLogRecord(operLog);
}
/**
* 新增案件日志
* @param caseAppliId 案件id,不能为空
* @param caseNode 案件节点,不能为空
* @param notes 备注
*/
public static void insertCaseLog(@NotNull Long caseAppliId, @NotEmpty Integer caseNode, String notes ,LoginUser loginUser ){
CaseLogRecord operLog = new CaseLogRecord();
// 获取当前的用户
if(loginUser!=null) {
SysUser sysUser = userMapper.selectUserById(loginUser.getUserId());
operLog.setCreateBy(sysUser.getUserName());
operLog.setCreateNickName(sysUser.getNickName());
operLog.setUpdateBy(sysUser.getUserName());
}else {
operLog.setCreateBy("admin");
operLog.setCreateNickName("管理员");
operLog.setUpdateBy("admin");
}
operLog.setCaseAppliId(caseAppliId);
operLog.setCaseNode(caseNode);
operLog.setNotes(notes);
caseLogRecordMapper.insertCaseLogRecord(operLog);
}
/**
* 批量新增案件日志
* @param list
@@ -167,14 +167,14 @@ public class OCRUtils {
String endContent = fatchRule.getEndContent();
// 开始为空结束为空
if (StrUtil.isEmpty(startContent) && StrUtil.isEmpty(endContent)) {
fatchMap.put(fatchRule.getColumnName()+Constants.PDFSTR+caseId, trimStr(text));
fatchMap.put(fatchRule.getColumnName(), 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));
fatchMap.put(fatchRule.getColumnName(), trimStr(substring));
}
} else if (StrUtil.isEmpty(startContent) && StrUtil.isNotEmpty(endContent)) {
@@ -182,7 +182,7 @@ public class OCRUtils {
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));
fatchMap.put(fatchRule.getColumnName(), trimStr(substring));
}
} else if (StrUtil.isNotEmpty(startContent) && StrUtil.isNotEmpty(endContent)) {
// 开始结束不为空
@@ -191,7 +191,7 @@ public class OCRUtils {
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));
fatchMap.put(fatchRule.getColumnName(), trimStr(substring));
}
}
@@ -221,7 +221,7 @@ public class OCRUtils {
}
// 开始和结束截取都为空
if (StrUtil.isEmpty(reverseStartContent) && StrUtil.isEmpty(reverseEndContent)) {
fatchMap.put(fatchRule.getColumnName()+Constants.PDFSTR+caseId, trimStr(text));
fatchMap.put(fatchRule.getColumnName(), trimStr(text));
} else if (StrUtil.isEmpty(reverseStartContent) && StrUtil.isNotEmpty(reverseEndContent)) {
// 开始为空,结束不为空
// 根据截取的序号查找出位置
@@ -229,7 +229,7 @@ public class OCRUtils {
if (indexOf != -1) {
String substring = reverseText.substring(0, indexOf);
if (StrUtil.isNotEmpty(substring)) {
fatchMap.put(fatchRule.getColumnName()+Constants.PDFSTR+caseId, trimStr(StrUtil.reverse(substring)));
fatchMap.put(fatchRule.getColumnName(), trimStr(StrUtil.reverse(substring)));
}
}
} else if (StrUtil.isNotEmpty(reverseStartContent) && StrUtil.isEmpty(reverseEndContent)) {
@@ -238,7 +238,7 @@ public class OCRUtils {
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)));
fatchMap.put(fatchRule.getColumnName(), trimStr(StrUtil.reverse(substring)));
}
}
@@ -249,7 +249,7 @@ public class OCRUtils {
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)));
fatchMap.put(fatchRule.getColumnName(), trimStr(StrUtil.reverse(substring)));
}
}
}
@@ -1,5 +1,7 @@
package com.ruoyi.wisdomarbitrate.utils;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.google.gson.Gson;
import com.google.gson.JsonArray;
@@ -11,6 +13,7 @@ import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.EsignApplicaConfig;
import com.ruoyi.common.utils.EsignHttpHelper;
import com.ruoyi.common.utils.SealUtil;
import com.ruoyi.wisdomarbitrate.StringIdsReq;
import com.ruoyi.wisdomarbitrate.domain.DeptIdentify;
import com.ruoyi.wisdomarbitrate.domain.SealSignRecord;
@@ -252,7 +255,7 @@ public class SignAward {
/* " \"availableSealIds\": [\n" +
" \"" + availableSealId + "\"\n" +
" ],\n" +*/
" \"availableSealIds\": " + new Gson().toJson(sealIdList) + ",\n" +
// " \"availableSealIds\": " + new Gson().toJson(sealIdList) + ",\n" +
" \"signFieldPosition\": {\n" +
" \"positionPage\": \"" + positionPageorg + "\",\n" +
@@ -305,6 +308,50 @@ public class SignAward {
//发起接口请求
return EsignHttpHelper.doCommHttp(eSignHost, apiaddr, requestType, jsonParm, header, false);
}
/**
* 获取批量签页面链接
*
* @return
* @throws EsignDemoException
*/
public static EsignHttpResponse batchSignUrl(StringIdsReq idsReq) throws EsignDemoException {
List<String> signFlowIds = idsReq.getIds();
String psnAccount = idsReq.getPsnAccount();
String apiaddr = "/v3/sign-flow/batch-sign-url";
JSONObject paramObj = new JSONObject();
paramObj.put("operatorId",idsReq.getPsnId());
paramObj.put("signFlowIds",signFlowIds);
paramObj.put("clientType","PC");
String jsonParm = JSON.toJSONString(paramObj);
//请求方法
EsignRequestType requestType = EsignRequestType.POST;
//生成请求签名鉴权方式的Header
Map<String, String> header = EsignHttpHelper.signAndBuildSignAndJsonHeader(eSignAppId, eSignAppSecret, jsonParm, requestType.name(), apiaddr, false);
//发起接口请求
return EsignHttpHelper.doCommHttp(eSignHost, apiaddr, requestType, jsonParm, header, false);
}
/**
* 根据手机号获取账户id
*
* @return
* @throws EsignDemoException
*/
public static EsignHttpResponse identityInfo(StringIdsReq idsReq) throws EsignDemoException {
List<String> signFlowIds = idsReq.getIds();
String psnAccount = idsReq.getPsnAccount();
String apiaddr = "/v3/persons/identity-info?psnAccount=" +psnAccount;
String jsonParm = "{}";
//请求方法
EsignRequestType requestType = EsignRequestType.GET;
//生成请求签名鉴权方式的Header
Map<String, String> header = EsignHttpHelper.signAndBuildSignAndJsonHeader(eSignAppId, eSignAppSecret, jsonParm, requestType.name(), apiaddr, false);
//发起接口请求
return EsignHttpHelper.doCommHttp(eSignHost, apiaddr, requestType, jsonParm, header, false);
}
/**
* 获取合同文件用印链接
@@ -37,7 +37,12 @@
</resultMap>
<select id="selectCaseAffiliate" parameterType="CaseAffiliate" resultMap="CaseAffiliateResult">
select c.*,s.user_id
select distinct (c.id),
c.case_appli_id, c.identity_type,c.application_organ_id,c.application_organ_name,c.name,c.identity_num,c.contact_telphone,
c.contact_address,c.work_address,c.work_telphone ,c.name_agent,c.identity_num_agent,c.contact_telphone_agent,
c.comp_legal_person,c.comp_legalper_post,c.respon_sex ,c.respon_birth,
c.residen_affili,appli_agent_title,
c.contact_address_agent,c.email, c.send_email,c.track_num,c.applicant_agent_user_id,c.agent_email,s.user_id
from case_affiliate c
left join sys_user s on c.identity_num=s.id_card
<where>
@@ -47,7 +52,12 @@
</where>
</select>
<select id="selectCaseAffiliateByCaseIds" resultMap="CaseAffiliateResult">
select c.*,s.user_id
select (c.id),
c.case_appli_id, c.identity_type,c.application_organ_id,c.application_organ_name,c.name,c.identity_num,c.contact_telphone,
c.contact_address,c.work_address,c.work_telphone ,c.name_agent,c.identity_num_agent,c.contact_telphone_agent,
c.comp_legal_person,c.comp_legalper_post,c.respon_sex ,c.respon_birth,
c.residen_affili,appli_agent_title,
c.contact_address_agent,c.email, c.send_email,c.track_num,c.applicant_agent_user_id,c.agent_email,s.user_id
from case_affiliate c
left join sys_user s on c.identity_num=s.id_card
<where>
@@ -202,25 +202,27 @@
WHERE id = #{id}
</delete>
<delete id="batchDeleteLog">
delete a from case_affiliate_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}
delete from case_application_log l where l.id in
<foreach collection="ids" item="item" open="(" separator="," close=")">
#{item}
</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}
;
delete from case_affiliate_log l where l.case_appli_log_id in
<foreach collection="ids" item="item" open="(" separator="," close=")">
#{item}
</foreach>
);
delete from case_application_log l where l.id in (
<foreach collection="ids" item="id" separator=",">
#{id}
;
delete from case_attach_log l where l.case_appli_log_id in
<foreach collection="ids" item="item" open="(" separator="," close=")">
#{item}
</foreach>
);
;
delete from column_value_log l where l.case_appli_log_id in
<foreach collection="ids" item="item" open="(" separator="," close=")">
#{item}
</foreach>
;
</delete>
@@ -278,6 +280,12 @@
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>
<select id="selectLogsByCaseIds" resultType="java.lang.Long">
select id from case_application_log where case_appli_id in
<foreach collection="ids" item="item" separator="," open="(" close=")">
#{item}
</foreach>
</select>
</mapper>
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,105 @@
<?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.CaseNumRuleMapper">
<resultMap id="BaseResultMap" type="com.ruoyi.wisdomarbitrate.domain.CaseNumRule" >
<result column="id" property="id" />
<result column="rule_type" property="ruleType" />
<result column="prefixstr" property="prefixstr" />
<result column="date_format" property="dateFormat" />
<result column="dept_name" property="deptName" />
<result column="current_num" property="currentNum" />
<result column="dept_name_firchar" property="deptNameFirchar" />
</resultMap>
<insert id="insertCaseNumRule" parameterType="CaseNumRule" useGeneratedKeys="true" keyProperty="id">
insert into case_num_rule(
<if test="ruleType != null">rule_type,</if>
<if test="prefixstr != null and prefixstr != '' ">prefixstr,</if>
<if test="dateFormat != null">date_format,</if>
<if test="deptName != null and deptName != '' ">dept_name,</if>
<if test="currentNum != null and currentNum != '' ">current_num,</if>
<if test="deptNameFirchar != null and deptNameFirchar != '' ">dept_name_firchar,</if>
create_by,
create_time
)values(
<if test="ruleType != null">#{ruleType},</if>
<if test="prefixstr != null and prefixstr != '' ">#{prefixstr},</if>
<if test="dateFormat != null">#{dateFormat},</if>
<if test="deptName != null and deptName != '' ">#{deptName},</if>
<if test="currentNum != null and currentNum != '' ">#{currentNum},</if>
<if test="deptNameFirchar != null and deptNameFirchar != '' ">#{deptNameFirchar},</if>
#{createBy},
sysdate()
)
</insert>
<update id="updateCaseNumRule" parameterType="CaseNumRule">
update case_num_rule
<set>
<if test="ruleType != null">rule_type = #{ruleType},</if>
<if test="prefixstr != null and prefixstr != '' ">prefixstr = #{prefixstr},</if>
<if test="dateFormat != null ">date_format = #{dateFormat},</if>
<if test="deptName != null and deptName != '' ">dept_name = #{deptName},</if>
<if test="currentNum != null and currentNum != '' ">current_num = #{currentNum},</if>
<if test="deptNameFirchar != null and deptNameFirchar != '' ">dept_name_firchar = #{deptNameFirchar},</if>
</set>
<where>
<if test="id != null">
AND id = #{id}
</if>
</where>
</update>
<delete id="deleteCaseNumRule" parameterType="CaseNumRule">
delete from case_num_rule where id = #{id}
</delete>
<select id="selectCaseNumRules" parameterType="CaseNumRule" resultMap="BaseResultMap">
SELECT id, rule_type ,prefixstr , date_format,dept_name,dept_name_firchar,current_num
FROM case_num_rule
<where>
<if test="deptNameFirchar != null and deptNameFirchar != ''">
AND dept_name_firchar = #{deptNameFirchar}
</if>
</where>
order by create_time desc
</select>
<select id="countCaseNumRule" resultType="Integer">
select count(1) from case_num_rule c
<where>
<if test="prefixstr != null and prefixstr != '' ">
AND c.prefixstr = #{prefixstr}
</if>
<if test="ruleType != null ">
AND c.rule_type = #{ruleType}
</if>
<if test="dateFormat != null ">
AND c.date_format = #{dateFormat}
</if>
<if test="deptName != null and deptName != '' ">
AND c.dept_name = #{deptName}
</if>
<if test="deptNameFirchar != null and deptNameFirchar != '' ">
AND c.dept_name_firchar = #{deptNameFirchar}
</if>
</where>
</select>
<select id="selectCaseNumRule" parameterType="CaseNumRule" resultMap="BaseResultMap">
SELECT id, rule_type ,prefixstr , date_format,dept_name,dept_name_firchar,current_num
FROM case_num_rule
<where>
<if test="id != null ">
AND id = #{id}
</if>
</where>
</select>
</mapper>
@@ -27,13 +27,20 @@
<if test="updateTime != null ">update_time = #{updateTime},</if>
<if test="payType != null ">pay_type = #{payType},</if>
</set>
where id = #{id}
<where>
<if test="caseId != null ">
AND case_id = #{caseId}
</if>
<if test="id != null ">
AND id = #{id}
</if>
</where>
</update>
<select id="queryRecord" resultType="com.ruoyi.wisdomarbitrate.domain.CasePaymentRecord" resultMap="CasePaymentRecordResult">
select c.id ,c.case_id ,c.order_number ,c.payment_time ,c.create_time ,c.update_time ,c.payment_status
from case_payment_record c
<where>
<if test="orderNumber != null ">
<if test="orderNumber != null and orderNumber != '' ">
AND c.order_number = #{orderNumber}
</if>
</where>
@@ -42,10 +42,60 @@
</select>
<select id="selectSealSignRecordbyStat" parameterType="SealSignRecord" resultMap="SealSignRecordResult">
SELECT s.id ,s.case_appli_id ,s.file_id ,s.sign_flow_id
from seal_sign_record s
SELECT s.id ,s.case_appli_id ,s.file_id ,s.sign_flow_id,s.sign_flow_status
from seal_sign_record s join case_application c on s.case_appli_id=c.id
where s.sign_flow_status in (1,2)
</select>
<select id="selectSealSigning" resultType="com.ruoyi.wisdomarbitrate.domain.CaseApplication">
SELECT s.sign_flow_id signFlowId,c.id id,c.case_status caseStatus,
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.case_subject_amount caseSubjectAmount,c.case_num caseNum,c.hear_date hearDate,
ca.application_organ_id applicationOrganId ,ca.application_organ_name as applicantName,
c.arbitrat_method arbitratMethod ,
CASE c.arbitrat_method when 1 then '开庭审理' when 2 then '书面审理'
ELSE '无审理方式'
END arbitratMethodName,
c.arbitrator_id arbitratorId,
c.arbitrator_name arbitratorName
from seal_sign_record s
join case_application c on s.case_appli_id=c.id
JOIN case_affiliate ca ON ca.case_appli_id = c.id and ca.identity_type=1
<!-- where s.sign_flow_status in (0,1,2)-->
<where>
<if test="penSonAccount != null and penSonAccount!='' ">
AND s.penson_account = #{penSonAccount}
</if>
<if test="caseStatus != null and caseStatus!='' ">
AND c.case_status = #{caseStatus}
</if>
</where>
order by c.case_num desc
</select>
<select id="selectsignFlow" resultType="com.ruoyi.wisdomarbitrate.domain.CaseApplication">
SELECT s.sign_flow_id signFlowId,c.id id,c.case_status caseStatus,
c.arbitrator_id arbitratorId,
c.arbitrator_name arbitratorName
from seal_sign_record s
join case_application c on s.case_appli_id=c.id
WHERE c.lock_status = 0
<if test="batchNumber != null">
AND c.batch_number = #{batchNumber}
</if>
<if test="caseStatus != null">
AND c.case_status = #{caseStatus}
</if>
</select>
<update id="updataSealSignRecord" parameterType="SealSignRecord">
update seal_sign_record
@@ -39,6 +39,31 @@
sysdate()
)
</insert>
<insert id="batchSaveSmsSendRecord">
insert into sms_send_record(
case_appli_id,
case_num,
phone,
send_time,
send_content,
create_by,
send_status,
create_time
)values
<foreach item="item" index="index" collection="list" separator=",">
(
#{item.caseId},
#{item.caseNum},
#{item.phone},
#{item.sendTime},
#{item.sendContent},
#{item.createBy},
#{item.sendStatus},
sysdate()
)
</foreach>
</insert>
<select id="getSmsSendRecord" parameterType="SmsSendRecord" resultMap="SmsSendRecordResult">
@@ -79,6 +79,7 @@
</if>
AND del_flag =0
</where>
ORDER BY create_time DESC
</select>
</mapper>