From 11aab5bc31412f2969e5942339b828d147cab58d Mon Sep 17 00:00:00 2001 From: 18792927508 <1322446236@qq.com> Date: Wed, 22 Nov 2023 13:58:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=94=B3=E8=AF=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CaseApplicationController.java | 9 +- .../CaseApplicationLogController.java | 93 ++ .../common/enums/UpdateSubmitStatus.java | 37 + .../com/ruoyi/common/enums/YesOrNoEnum.java | 33 + .../common/utils/thread/ThreadPoolUtil.java | 112 ++ .../ruoyi/system/mapper/SysUserMapper.java | 8 + .../wisdomarbitrate/domain/CaseAffiliate.java | 24 + .../domain/CaseApplication.java | 58 + .../domain/dto/CaseApplicationLogDTO.java | 255 +++++ .../wisdomarbitrate/domain/vo/ToDoCount.java | 38 +- .../domain/vo/UpdateSubmitVO.java | 34 + .../mapper/CaseAffiliateLogMapper.java | 25 + .../mapper/CaseAffiliateMapper.java | 6 + .../mapper/CaseApplicationLogMapper.java | 46 + .../mapper/CaseApplicationMapper.java | 22 + .../service/CaseApplicationLogService.java | 57 + .../service/ICaseApplicationService.java | 2 +- .../impl/CaseApplicationLogServiceImpl.java | 155 +++ .../impl/CaseApplicationServiceImpl.java | 258 +++-- .../service/impl/CaseEvidenceServiceImpl.java | 56 +- .../service/impl/VideoServiceImpl.java | 2 +- .../resources/mapper/system/SysUserMapper.xml | 7 + .../CaseAffiliateLogMapper.xml | 125 +++ .../wisdomarbitrate/CaseAffiliateMapper.xml | 29 +- .../CaseApplicationLogMapper.xml | 158 +++ .../wisdomarbitrate/CaseApplicationMapper.xml | 987 +++++++++++++++++- 26 files changed, 2470 insertions(+), 166 deletions(-) create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationLogController.java create mode 100644 ruoyi-common/src/main/java/com/ruoyi/common/enums/UpdateSubmitStatus.java create mode 100644 ruoyi-common/src/main/java/com/ruoyi/common/enums/YesOrNoEnum.java create mode 100644 ruoyi-common/src/main/java/com/ruoyi/common/utils/thread/ThreadPoolUtil.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/dto/CaseApplicationLogDTO.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/UpdateSubmitVO.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAffiliateLogMapper.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseApplicationLogMapper.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/CaseApplicationLogService.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationLogServiceImpl.java create mode 100644 ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAffiliateLogMapper.xml create mode 100644 ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationLogMapper.xml diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java index 0a21f06..77a2caf 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java @@ -53,7 +53,6 @@ public class CaseApplicationController extends BaseController { } startPage(); List list = caseApplicationService.selectCaseApplicationListByRole(caseApplication); -// List list = caseApplicationService.selectCaseApplicationList(caseApplication); return getDataTable(list); } @@ -91,7 +90,7 @@ public class CaseApplicationController extends BaseController { public AjaxResult editCaseApplication(@Validated @RequestBody CaseApplication caseApplication) { caseApplication.setUpdateBy(getUsername()); - return success(caseApplicationService.editCaseApplication(caseApplication)); + return caseApplicationService.editCaseApplication(caseApplication); } /** @@ -123,11 +122,14 @@ public class CaseApplicationController extends BaseController { } /** - * 查询立案信息 + * 查询立案信息 todo 必须传version */ // @PreAuthorize("@ss.hasPermi('caseManagement:list:detail')") @PostMapping("/selectCaseApplication") public AjaxResult selectCaseApplication(@Validated @RequestBody CaseApplication caseApplication) { + if(caseApplication.getVersion()==null){ + return error("参数校验失败"); + } CaseApplication caseApplicationselect = caseApplicationService.selectCaseApplication(caseApplication); return success(caseApplicationselect); } @@ -428,4 +430,5 @@ public class CaseApplicationController extends BaseController { return success(caseApplicationService.reserveConferenceList(caseId)); } + } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationLogController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationLogController.java new file mode 100644 index 0000000..47aecc0 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationLogController.java @@ -0,0 +1,93 @@ +package com.ruoyi.web.controller.wisdomarbitrate; + +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.wisdomarbitrate.domain.CaseApplication; +import com.ruoyi.wisdomarbitrate.domain.vo.UpdateSubmitVO; +import com.ruoyi.wisdomarbitrate.service.CaseApplicationLogService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.bind.annotation.PostMapping; + +import static com.ruoyi.common.core.domain.AjaxResult.success; + +/** + * @author wangqiong + * @description 案件日志 + * @date 2023-11-17 13:58 + */ +@RestController +@RequestMapping (value = "/caseApplicationLog") +public class CaseApplicationLogController { + + @Autowired + private CaseApplicationLogService caseApplicationLogService; + + /** + * 新增 + * @author wangqiong + * @date 2023/11/17 + **/ + @PostMapping("/insert") + public AjaxResult insert(@RequestBody CaseApplication caseApplicationLog){ + return success(caseApplicationLogService.insert(caseApplicationLog)); + } + + /** + * 刪除 + * @author wangqiong + * @date 2023/11/17 + **/ + @PostMapping("/delete") + public AjaxResult delete(Long id){ + return success(caseApplicationLogService.delete(id)); + } + /** + * 修改的案件提交到秘书 + * @author wangqiong + * @date 2023/11/17 + **/ + @PostMapping("/submit") + public AjaxResult submit(@RequestBody UpdateSubmitVO vo){ + if(vo.getCaseId()==null || vo.getVersion()==null){ + return AjaxResult.error("参数校验错误"); + } + return caseApplicationLogService.submit(vo); + } + + /** + * 修改撤销申请 + * @author wangqiong + * @date 2023/11/17 + **/ + @PostMapping("/revoke") + public AjaxResult revoke(@RequestBody UpdateSubmitVO vo){ + if(vo.getCaseId()==null || vo.getVersion()==null){ + return AjaxResult.error("参数校验错误"); + } + // todo 需确定 + return caseApplicationLogService.revoke(vo); + } + + /** + * 查询 根据主键 id 查询 + * @author wangqiong + * @date 2023/11/17 + **/ + @GetMapping("/selectByCaseIdAndVersion") + public AjaxResult selectByCaseIdAndVersion(@RequestParam(value = "caseId") Long caseId,@RequestParam(value = "version")Integer version ){ + return success(caseApplicationLogService.selectByCaseIdAndVersion(caseId,version)); + } + /** + * 秘书审核修改的案件 + * @author wangqiong + * @date 2023/11/17 + **/ + @PostMapping("/updateAudit") + public AjaxResult updateAudit(@RequestBody UpdateSubmitVO vo){ + if(vo.getCaseId()==null || vo.getVersion()==null || vo.getIsAgree()==null || vo.getUpdateSubmitStatus()==null){ + return AjaxResult.error("参数校验错误"); + } + return caseApplicationLogService.updateAudit(vo); + } + +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/enums/UpdateSubmitStatus.java b/ruoyi-common/src/main/java/com/ruoyi/common/enums/UpdateSubmitStatus.java new file mode 100644 index 0000000..2a720b3 --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/enums/UpdateSubmitStatus.java @@ -0,0 +1,37 @@ +package com.ruoyi.common.enums; + +/** + * @author wangqiong + * @description 修改案件的提交状态 + * @date 2023-11-17 14:05 + */ +public enum UpdateSubmitStatus +{ + UNCOMMITTED(0, "未提交"), + COMMITTED(1, "已提交"), + AGREE(2, "同意已修改的案件"), + REFUSE(3, "拒绝已修改的案件"), + REVOKE(4, "撤销"), + AGREE_REVOKE(5, "同意撤销修改"), + REFUSE_REVOKE(6, "拒绝撤销修改"), + ; + + private final Integer code; + private final String text; + + UpdateSubmitStatus(Integer code, String text) + { + this.code = code; + this.text = text; + } + + public Integer getCode() + { + return code; + } + + public String getText() + { + return text; + } +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/enums/YesOrNoEnum.java b/ruoyi-common/src/main/java/com/ruoyi/common/enums/YesOrNoEnum.java new file mode 100644 index 0000000..412c338 --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/enums/YesOrNoEnum.java @@ -0,0 +1,33 @@ +package com.ruoyi.common.enums; + +/** + * @author wangqiong + * @description 是否枚举 + * @date 2023-11-17 14:05 + */ +public enum YesOrNoEnum +{ + NO(0, "否"), + YES(1, "是"), + + ; + + private final Integer code; + private final String text; + + YesOrNoEnum(Integer code, String text) + { + this.code = code; + this.text = text; + } + + public Integer getCode() + { + return code; + } + + public String getText() + { + return text; + } +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/thread/ThreadPoolUtil.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/thread/ThreadPoolUtil.java new file mode 100644 index 0000000..c91b31c --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/thread/ThreadPoolUtil.java @@ -0,0 +1,112 @@ +package com.ruoyi.common.utils.thread; + +import lombok.extern.slf4j.Slf4j; + +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.*; + +/** + * @description 线程池工具类 + * @Author wangqiong + * @Date 2023/11/7 15:41 + * @Version V1.0 + **/ +@Slf4j +public class ThreadPoolUtil { + /** cpu核心数 */ + private static int corePoolSize = (Runtime.getRuntime().availableProcessors()); + /**创建固定大小线程池*/ + private static ExecutorService executors = new ThreadPoolExecutor( + corePoolSize, + corePoolSize, + 0L, + TimeUnit.MILLISECONDS, + new LinkedBlockingQueue<>()); + + /** + * 异步任务 + * @param task + */ + public static void execute(Runnable task){ + executors.execute(task); + } + + /** + * 可获取返回结果的任务且可设置超时时间 + * @param task + * @param timeout + * @param + * @return + */ + public static T execute(Callable task, long timeout){ + Future future = executors.submit(task); + T result = null; + try { + result = future.get(timeout, TimeUnit.SECONDS); + } catch (InterruptedException e) { + future.cancel(true); + log.error("ThreadPoolUtil.InterruptedException. e:{}", e); + } catch (ExecutionException e) { + future.cancel(true); + log.error("ThreadPoolUtil.ExecutionException. e:{}", e); + } catch (TimeoutException e) { + future.cancel(true); + log.error("ThreadPoolUtil.TimeoutException. e:{}", e); + } + return result; + } + + /** + * 可获取返回结果的任务 + * @param task + * @return + */ + public static Future submit(Callable task){ + return executors.submit(task); + } + + /** + * 可获取返回结果的任务 + * @param tasks + * @param + * @return + */ + public static List submit(Callable... tasks){ + List> list=new ArrayList<>(); + List resultList=new ArrayList<>(); + if(tasks==null||tasks.length==0){ + return resultList; + } + for(Callable task:tasks){ + list.add(executors.submit(task)); + } + for(Future future:list){ + try { + resultList.add(future.get()); + } catch (InterruptedException e) { + future.cancel(true); + log.error("ThreadPoolUtil.InterruptedException. e:{}", e); + } catch (ExecutionException e) { + future.cancel(true); + log.error("ThreadPoolUtil.ExecutionException. e:{}", e); + } + } + return resultList; + } + + /** + * 执行完所有返回 + * @param tasks + */ + public static void submit(Runnable ...tasks){ + if(tasks==null||tasks.length==0){ + return; + } + List futureList=new ArrayList<>(); + for (Runnable task : tasks) { + futureList.add(CompletableFuture.runAsync(task,executors)); + } + CompletableFuture.allOf(futureList.toArray(new CompletableFuture[futureList.size()])).join(); + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java index d80077a..9c1402b 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java @@ -148,4 +148,12 @@ public interface SysUserMapper * @return */ SysUser selectUserByIdCard(@Param("idCard")String identityNo); + + /** + * 根据部门和角色查询用户 + * @param applicationOrganId + * @param roleName + * @return + */ + List selectByDeptIdAndRole(@Param("deptId")String applicationOrganId, @Param("roleName")String roleName); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseAffiliate.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseAffiliate.java index b582cb9..757a725 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseAffiliate.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseAffiliate.java @@ -13,6 +13,10 @@ public class CaseAffiliate extends BaseEntity { private Long id; /** 案件申请id */ private Long caseAppliId; + /** + * 案件申请日志id + */ + private Long caseAppliLogId; /** 身份类型 */ private int identityType; /** 姓名 */ @@ -48,6 +52,26 @@ public class CaseAffiliate extends BaseEntity { */ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date responBirth; + /** + * 版本号 + */ + private Integer version; + + public Long getCaseAppliLogId() { + return caseAppliLogId; + } + + public void setCaseAppliLogId(Long caseAppliLogId) { + this.caseAppliLogId = caseAppliLogId; + } + + public Integer getVersion() { + return version; + } + + public void setVersion(Integer version) { + this.version = version; + } public String getEmail() { return email; diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java index 5af38f8..924418c 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java @@ -73,6 +73,16 @@ public class CaseApplication extends BaseEntity { /** 案件状态 */ private Integer caseStatus; + /** 案件申请表ID */ + private Long caseAppliId; + + public Long getCaseAppliId() { + return caseAppliId; + } + + public void setCaseAppliId(Long caseAppliId) { + this.caseAppliId = caseAppliId; + } public Integer getCaseStatus() { return caseStatus; @@ -402,6 +412,30 @@ public class CaseApplication extends BaseEntity { * 财务状态 */ private Integer financeStatus; + /** + * 是否是被申请人,仲裁员,部门长,财务,代理人,0-否,1-是 + */ + private Integer isOtherRole; + /** + * 案件日志id + */ + private Long caseLogId; + + public Long getCaseLogId() { + return caseLogId; + } + + public void setCaseLogId(Long caseLogId) { + this.caseLogId = caseLogId; + } + + public Integer getIsOtherRole() { + return isOtherRole; + } + + public void setIsOtherRole(Integer isOtherRole) { + this.isOtherRole = isOtherRole; + } public List getAgentDeptIds() { return agentDeptIds; @@ -775,6 +809,30 @@ public class CaseApplication extends BaseEntity { * 申请机构id */ private String applicationOrganId; + /** + * 版本号 + */ + private Integer version; + /** + * 修改案件的提交状态,0-未提交,1-已提交,2-同意,3-拒绝,4-撤销 + */ + private Integer updateSubmitStatus; + + public Integer getVersion() { + return version; + } + + public void setVersion(Integer version) { + this.version = version; + } + + public Integer getUpdateSubmitStatus() { + return updateSubmitStatus; + } + + public void setUpdateSubmitStatus(Integer updateSubmitStatus) { + this.updateSubmitStatus = updateSubmitStatus; + } public String getEmail() { return email; diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/dto/CaseApplicationLogDTO.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/dto/CaseApplicationLogDTO.java new file mode 100644 index 0000000..b66aa79 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/dto/CaseApplicationLogDTO.java @@ -0,0 +1,255 @@ +package com.ruoyi.wisdomarbitrate.domain.dto; + +import lombok.Data; + +import java.util.Date; + +/** + * @author wangqiong + * @description 案件日志 + * @date 2023-11-17 14:01 + */ +@Data +public class CaseApplicationLogDTO { + private static final long serialVersionUID = 1L; + + /** + * id + */ + private Long id; + + /** + * 案件编号 + */ + private String caseNum; + + /** + * 案件标的 + */ + private Double caseSubjectAmount; + + /** + * 立案日期 + */ + private Date registerDate; + + /** + * 仲裁方式,视频仲裁(1)、书面仲裁(2) + */ + private Long arbitratMethod; + + /** + * 案件状态,立案申请(0)、待立案审查(1)、 待缴费(2)、待缴费确认(3)、 待案件质证(4)、 + */ + private Integer caseStatus; + + /** + * 开庭日期 + */ + private Date hearDate; + + /** + * 申请人仲裁请求及事实和理由 + */ + private String arbitratClaims; + + /** + * 借款开始日期 + */ + private Date loanStartDate; + + /** + * 借款结束日期 + */ + private Date loanEndDate; + + /** + * 申请人主张欠本金 + */ + private Double claimPrinciOwed; + + /** + * 申请人主张欠利息 + */ + private Double claimInterestOwed; + + /** + * 申请人主张违约金 + */ + private Double claimLiquidDamag; + + /** + * 仲裁应缴费用 + */ + private Double feePayable; + + /** + * 开始在线视频时间 + */ + private Date beginVideoDate; + + /** + * 在线视频人员 + */ + private String onlineVideoPerson; + + /** + * 合同编号 + */ + private String contractNumber; + + /** + * 创建时间 + */ + private Date createTime; + + /** + * 更新者 + */ + private String updateBy; + + /** + * 更新时间 + */ + private Date updateTime; + + /** + * 创建者 + */ + private String createBy; + + /** + * 仲裁员id + */ + private String arbitratorId; + + /** + * 仲裁员名称 + */ + private String arbitratorName; + + /** + * 已确认组庭的仲裁员id + */ + private String pendedTrialArbitorid; + + /** + * 是否指派仲裁员,1是,2否 + */ + private Integer pendingAppointArbotrar; + + /** + * 案件名称 + */ + private String caseName; + + /** + * 案件描述 + */ + private String caseDescribe; + + /** + * 仲裁结果 + */ + private String caseResult; + + /** + * 是否同意组庭,0否,1是 + */ + private Integer isAgreePendTral; + + /** + * 是否有异议需要举证,1是,0否 + */ + private Integer objectionAddEviden; + + /** + * 是否需要开庭审理,1是,0否 + */ + private Integer openCourtHear; + + /** + * paid_expenses + */ + private Double paidExpenses; + + /** + * 裁决书URL + */ + private String filearbitraUrl; + + /** + * 支付方式(0线上支付,1线下支付) + */ + private String payType; + + /** + * 申请人请求仲裁庭裁决 + */ + private String requestRule; + + /** + * 是否仲裁反请求,1是,0否 + */ + private Integer adjudicaCounter; + + /** + * 是否财产保全申请,1是,0否 + */ + private Integer properPreser; + + /** + * 是否管辖异议申请,1是,0否 + */ + private Integer objectiJuris; + + /** + * 被申请人是否缺席,1是,0否 + */ + private Integer isAbsence; + + /** + * 被申请人质证意见 + */ + private String responCrossOpin; + + /** + * 申请人质证意见 + */ + private String applicaCrossOpin; + + /** + * 被申请人的答辩意见 + */ + private String responDefenOpini; + + /** + * 申请人是否缺席,1是,0否 + */ + private Integer appliIsAbsen; + + /** + * 是否锁定,0-否,1-是 + */ + private Integer lockStatus; + + /** + * 视频会议房间号id,多个用逗号拼接 + */ + private String roomId; + + /** + * 是否导入,0手动录入,1导入,默认0 + */ + private Integer importFlag; + + /** + * 版本号 + */ + private Long version; + + /** + * 修改案件的提交状态,0-未提交,1-已提交,2-同意,3,拒绝 + */ + private Integer updateSubmitStatus; +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/ToDoCount.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/ToDoCount.java index a3c46a1..b16db6f 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/ToDoCount.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/ToDoCount.java @@ -10,24 +10,24 @@ import lombok.Data; @Data public class ToDoCount { - private int caseApply; // 立案申请 - private int caseApplyCheck; // 待立案审查 - private int caseApplyPay; // 待缴费 - private int caseApplyPayCheck; // 待缴费确认 - private int caseApplyEvidence; //待案件质证 - private int caseApplyGroupCheck; // 待组庭审核 - private int caseApplyGroupConfirm; // 待组庭确定 + private int caseApply=0; // 立案申请 + private int caseApplyCheck=0; // 待立案审查 + private int caseApplyPay=0; // 待缴费 + private int caseApplyPayCheck=0; // 待缴费确认 + private int caseApplyEvidence=0; //待案件质证 + private int caseApplyGroupCheck=0; // 待组庭审核 + private int caseApplyGroupConfirm=0; // 待组庭确定 // private int caseApplyGroupNotice; - private int caseApplyArbitrateWay; // 待审核仲裁方式 - private int caseApplyGroupOnline; // 待开庭审理 - private int caseApplyGroupOffline; // 待书面审理 - private int caseApplyAward; // 待生成仲裁文书 - private int caseApplyAwardCheck; // 待核验仲裁文书 - private int caseApplyAwardConfirm; // 待审核仲裁文书 - private int caseApplyAwardSign; // 待仲裁文书签名 - private int caseApplyAwardSeal; // 待仲裁文书用印 - private int caseApplyAwardSend; // 待仲裁文书送达 - private int caseApplyStored; // 待案件归档 - private int caseApplyArchived; // 已归档 - private int updateOnlineHearDate; // 待修改开庭时间 + private int caseApplyArbitrateWay=0; // 待审核仲裁方式 + private int caseApplyGroupOnline=0; // 待开庭审理 + private int caseApplyGroupOffline=0; // 待书面审理 + private int caseApplyAward=0; // 待生成仲裁文书 + private int caseApplyAwardCheck=0; // 待核验仲裁文书 + private int caseApplyAwardConfirm=0; // 待审核仲裁文书 + private int caseApplyAwardSign=0; // 待仲裁文书签名 + private int caseApplyAwardSeal=0; // 待仲裁文书用印 + private int caseApplyAwardSend=0; // 待仲裁文书送达 + private int caseApplyStored=0; // 待案件归档 + private int caseApplyArchived=0; // 已归档 + private int updateOnlineHearDate=0; // 待修改开庭时间 } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/UpdateSubmitVO.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/UpdateSubmitVO.java new file mode 100644 index 0000000..14898e0 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/UpdateSubmitVO.java @@ -0,0 +1,34 @@ +package com.ruoyi.wisdomarbitrate.domain.vo; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 修改案件提交至秘书 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class UpdateSubmitVO { + /** + * 案件id + */ + private Long caseId; + /** + * 版本号 + */ + private Integer version; + /** + * 修改案件的提交状态,0-未提交,1-已提交,2-同意已修改的案件,3-拒绝已修改的案件,4-撤销,5-同意撤销,6-拒绝撤销 + */ + private Integer updateSubmitStatus; + /** + * 是否同意,0-否,1-是 + */ + private Integer isAgree; + + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAffiliateLogMapper.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAffiliateLogMapper.java new file mode 100644 index 0000000..8d904d0 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAffiliateLogMapper.java @@ -0,0 +1,25 @@ +package com.ruoyi.wisdomarbitrate.mapper; + +import com.ruoyi.wisdomarbitrate.domain.CaseAffiliate; +import com.ruoyi.wisdomarbitrate.domain.CaseApplication; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import java.util.List; +@Repository +public interface CaseAffiliateLogMapper { + + + int batchCaseAffiliate(List caseAffiliates); + + + void deletecaseAffiliate(CaseApplication caseApplication); + void batchDeletecaseAffiliate(@Param("ids") List ids); + + + List selectCaseAffiliate(CaseAffiliate caseAffiliate); + CaseAffiliate selectCaseAffiliateByIdentityType(@Param("caseAppliLogId") Long caseAppliLogId, @Param("identityType")int identityType); + + int updataCaseAffiliate(CaseAffiliate caseAffiliate); + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAffiliateMapper.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAffiliateMapper.java index b58c080..0b08c42 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAffiliateMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAffiliateMapper.java @@ -29,4 +29,10 @@ public interface CaseAffiliateMapper { * @return */ List emailByCaseId(@Param("caseAppliId")Long id); + + /** + * 批量修改 + * @param affiliateLogList + */ + void updataCaseAffiliateByCaseId(@Param("caseAppliId")Long caseAppliId,@Param("list") List affiliateLogList); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseApplicationLogMapper.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseApplicationLogMapper.java new file mode 100644 index 0000000..d6b1c52 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseApplicationLogMapper.java @@ -0,0 +1,46 @@ +package com.ruoyi.wisdomarbitrate.mapper; + +import com.ruoyi.wisdomarbitrate.domain.CaseApplication; +import com.ruoyi.wisdomarbitrate.domain.vo.UpdateSubmitVO; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * @author wangqiong + * @description 案件日志 + * @date 2023-11-17 14:05 + */ +@Repository +public interface CaseApplicationLogMapper { + int insert(CaseApplication caseApplicationLog); + + int deleteById(Long id); + + + + CaseApplication selectByCaseIdAndVersion(@Param("caseAppliId")long caseAppliId,@Param("version") int version); + + Integer selectMaxVersionByCaseId(@Param("caseAppliId")long caseAppliId); + + /** + * 修改日志表状态 + * @param vo + */ + void updateStatus(UpdateSubmitVO vo); + + /** + * 根据案件id查询秘书角色最新版本号 + * @param id + * @return + */ + Integer selectMaxVersionBySecret(@Param("caseAppliId")Long id); + + /** + * 根据案件id删除案件记录表和案件关联人日志表 + * @param ids + */ + void batchDeleteLog(@Param("ids") List ids); + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseApplicationMapper.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseApplicationMapper.java index 678590e..dd1a7a8 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseApplicationMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseApplicationMapper.java @@ -12,6 +12,7 @@ import java.util.List; public interface CaseApplicationMapper { List selectCaseApplicationList(CaseApplication caseApplication); + List selectCaseApplicationList1(CaseApplication caseApplication); int selectCaseApplicationCount(CaseApplication caseApplication); @@ -109,4 +110,25 @@ public interface CaseApplicationMapper { * @return */ Integer selectMaxRoomId(); + + /** + * 修改案件版本号 + * @param id + * @param version + */ + void updateVersionById(@Param("id")Long id, @Param("version")Integer version); + + /** + * 查询秘书案件 + * @param caseApplication + * @return + */ + List selectSecretaryCase(CaseApplication caseApplication); + + /** + * 查询申请人案件 + * @param caseApplication + * @return + */ + List selectApplicationCase(CaseApplication caseApplication); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/CaseApplicationLogService.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/CaseApplicationLogService.java new file mode 100644 index 0000000..3a87094 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/CaseApplicationLogService.java @@ -0,0 +1,57 @@ +package com.ruoyi.wisdomarbitrate.service; + +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.wisdomarbitrate.domain.CaseApplication; +import com.ruoyi.wisdomarbitrate.domain.vo.UpdateSubmitVO; + +/** + * @author wangqiong + * @description 案件日志 + * @date 2023-11-17 13:58 + */ +public interface CaseApplicationLogService { + /** + * 新增案件日志 + * @param caseApplicationLog + * @return + */ + int insert(CaseApplication caseApplicationLog); + + /** + * 根据案件日志id删除案件日志 + * @param id + * @return + */ + int delete(Long id); + + /** + * 根据案件id和版本号查询案件日志 + * @param id + * @param version + * @return + */ + CaseApplication selectByCaseIdAndVersion(Long id, int version); + + /** + * 修改的案件提交到秘书 + * @param vo + * @return + */ + AjaxResult submit(UpdateSubmitVO vo); + + /** + * 修改撤销申请 + * @param vo + * @return + */ + AjaxResult revoke(UpdateSubmitVO vo); + + /** + * 秘书审核修改的案件 + * @param vo + * @return + */ + AjaxResult updateAudit(UpdateSubmitVO vo); + + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseApplicationService.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseApplicationService.java index b55f3e3..fc50c1e 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseApplicationService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseApplicationService.java @@ -21,7 +21,7 @@ public interface ICaseApplicationService { int selectCaseApplicationCount(CaseApplication caseApplication); - int editCaseApplication(CaseApplication caseApplication); + AjaxResult editCaseApplication(CaseApplication caseApplication); int submitCaseApplication( List ids); diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationLogServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationLogServiceImpl.java new file mode 100644 index 0000000..b48eddb --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationLogServiceImpl.java @@ -0,0 +1,155 @@ +package com.ruoyi.wisdomarbitrate.service.impl; + +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.enums.UpdateSubmitStatus; +import com.ruoyi.common.enums.YesOrNoEnum; +import com.ruoyi.wisdomarbitrate.domain.CaseAffiliate; +import com.ruoyi.wisdomarbitrate.domain.CaseApplication; +import com.ruoyi.wisdomarbitrate.domain.vo.UpdateSubmitVO; +import com.ruoyi.wisdomarbitrate.mapper.CaseAffiliateLogMapper; +import com.ruoyi.wisdomarbitrate.mapper.CaseAffiliateMapper; +import com.ruoyi.wisdomarbitrate.mapper.CaseApplicationLogMapper; +import com.ruoyi.wisdomarbitrate.mapper.CaseApplicationMapper; +import com.ruoyi.wisdomarbitrate.service.CaseApplicationLogService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; +import java.util.Objects; + +/** + * @author wangqiong + * @description 案件日志 + * @date 2023-11-17 14:05 + */ +@Service +public class CaseApplicationLogServiceImpl implements CaseApplicationLogService { + @Autowired + private CaseApplicationLogMapper caseApplicationLogMapper; + @Autowired + private CaseApplicationMapper caseApplicationMapper; + @Autowired + private CaseAffiliateLogMapper caseAffiliateLogMapper; + @Autowired + private CaseAffiliateMapper caseAffiliateMapper; + @Override + public int insert(CaseApplication caseApplicationLog) { + return caseApplicationLogMapper.insert(caseApplicationLog); + } + + @Override + public int delete(Long id) { + return caseApplicationLogMapper.deleteById(id); + } + + + + @Override + public CaseApplication selectByCaseIdAndVersion(Long id, int version) { + return caseApplicationLogMapper.selectByCaseIdAndVersion(id,version); + } + /** + * 修改的案件提交到秘书 + * @param vo + * @return + */ + @Override + public AjaxResult submit(UpdateSubmitVO vo) { + vo.setUpdateSubmitStatus(UpdateSubmitStatus.COMMITTED.getCode()); + // 修改日志表提交状态 + caseApplicationLogMapper.updateStatus(vo); + return AjaxResult.success(); + } + + @Override + public AjaxResult revoke(UpdateSubmitVO vo) { + vo.setUpdateSubmitStatus(UpdateSubmitStatus.REVOKE.getCode()); + // 修改日志表提交状态 + caseApplicationLogMapper.updateStatus(vo); + return AjaxResult.success(); + } + + /** + * 秘书审核修改的案件 + * @param vo + * @return + */ + @Transactional + @Override + public AjaxResult updateAudit(UpdateSubmitVO vo) { + if (Objects.equals(vo.getUpdateSubmitStatus(), UpdateSubmitStatus.COMMITTED.getCode())) { + // 审核修改提交状态 + if (Objects.equals(vo.getIsAgree(), YesOrNoEnum.YES.getCode())) { + // 如果版本号为1,则直接返回 + if(vo.getVersion() <= 1){ + return AjaxResult.success(); + } + // 同意,查询日志记录表本版本数据,将数据更新到主表,并将日志表改版本的状态改为同意 + // 查询日志记录表本版本数据 + CaseApplication caseApplicationLog = caseApplicationLogMapper.selectByCaseIdAndVersion(vo.getCaseId(), vo.getVersion()); + if (caseApplicationLog == null) { + return AjaxResult.error("未找到该案件"); + } + // 将日志表改版本的状态改为同意 + vo.setUpdateSubmitStatus(UpdateSubmitStatus.AGREE.getCode()); + caseApplicationLogMapper.updateStatus(vo); + // 根据caseLogId查询相关人员表 + CaseAffiliate caseAffiliate = new CaseAffiliate(); + caseAffiliate.setCaseAppliLogId(caseApplicationLog.getCaseLogId()); + List affiliateLogList = caseAffiliateLogMapper.selectCaseAffiliate(caseAffiliate); + caseApplicationLog.setId(caseApplicationLog.getCaseAppliId()); + // 更新案件主表 + caseApplicationMapper.updataCaseApplication(caseApplicationLog); + + // 更新相关人员主表 + caseAffiliateMapper.updataCaseAffiliateByCaseId(caseApplicationLog.getCaseAppliId(), affiliateLogList); + } else { + // 拒绝,将日志表改版本的状态改为拒绝 + vo.setUpdateSubmitStatus(UpdateSubmitStatus.REFUSE.getCode()); + caseApplicationLogMapper.updateStatus(vo); + // 修改案件表的版本号 + // caseApplicationMapper.updateVersionById(vo.getCaseId(),vo.getVersion()); + + } + return AjaxResult.success(); + } + // todo 需确定 +// else if (Objects.equals(vo.getUpdateSubmitStatus(), UpdateSubmitStatus.REVOKE.getCode())) { +// // 如果版本号为1,则直接返回 +// if(vo.getVersion() <= 1){ +// return AjaxResult.success(); +// } +// // 审核修改撤销状态 +// if (Objects.equals(vo.getIsAgree(), YesOrNoEnum.YES.getCode())) { +// // 同意撤销,查询日志记录表上个版本数据,将数据更新到主表,并将日志表改版本的状态改为同意撤销 +// // 查询日志记录表上个版本未被拒绝数据 +// CaseApplication caseApplicationLog = caseApplicationLogMapper.selectByCaseIdAndVersion(vo.getCaseId(), vo.getVersion()-1); +// if (caseApplicationLog == null) { +// return AjaxResult.error("未找到该案件"); +// } +// // 将日志表改版本的状态改为拒绝 +// vo.setUpdateSubmitStatus(UpdateSubmitStatus.AGREE_REVOKE.getCode()); +// caseApplicationLogMapper.updateStatus(vo); +// // 根据caseLogId查询相关人员表 +// CaseAffiliate caseAffiliate = new CaseAffiliate(); +// caseAffiliate.setCaseAppliLogId(caseApplicationLog.getCaseLogId()); +// List affiliateLogList = caseAffiliateLogMapper.selectCaseAffiliate(caseAffiliate); +// caseApplicationLog.setId(caseApplicationLog.getCaseAppliId()); +// // 更新案件主表 +// caseApplicationMapper.updataCaseApplication(caseApplicationLog); +// +// // 更新相关人员主表 +// caseAffiliateMapper.updataCaseAffiliateByCaseId(caseApplicationLog.getCaseAppliId(), affiliateLogList); +// } else { +// // 拒绝撤销,将日志表改版本的状态改为拒绝撤销 +// vo.setUpdateSubmitStatus(UpdateSubmitStatus.REFUSE_REVOKE.getCode()); +// caseApplicationLogMapper.updateStatus(vo); +// // 修改案件表的版本号 +// // caseApplicationMapper.updateVersionById(vo.getCaseId(),vo.getVersion()); +// } +// return AjaxResult.success(); +// } + return AjaxResult.success(); + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java index b451aa9..1457f90 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java @@ -2,6 +2,7 @@ package com.ruoyi.wisdomarbitrate.service.impl; import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.util.IdcardUtil; import cn.hutool.core.util.StrUtil; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; @@ -14,11 +15,13 @@ import com.ruoyi.common.constant.CaseApplicationConstants; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.entity.*; import com.ruoyi.common.core.domain.model.LoginUser; +import com.ruoyi.common.enums.UpdateSubmitStatus; 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.core.domain.entity.SysUser; +import com.ruoyi.common.utils.thread.ThreadPoolUtil; import com.ruoyi.system.domain.SysUserRole; import com.ruoyi.system.mapper.SysDeptMapper; import com.ruoyi.system.mapper.SysRoleMapper; @@ -59,9 +62,11 @@ import java.util.*; import java.util.regex.Pattern; import java.util.stream.Collectors; +import static com.ruoyi.common.core.domain.AjaxResult.success; import static com.ruoyi.common.utils.PageUtils.startPage; import static com.ruoyi.common.utils.SecurityUtils.getLoginUser; import static com.ruoyi.common.utils.SecurityUtils.getUsername; +import static com.ruoyi.wisdomarbitrate.utils.CaseLogUtils.insertCaseLog; @Service @@ -107,13 +112,17 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { @Autowired private SealManageMapper sealManageMapper; + @Autowired + private CaseApplicationLogMapper caseApplicationLogMapper; + @Autowired + private CaseAffiliateLogMapper caseAffiliateLogMapper; // 手机号正则 private static final Pattern TELEPHONE_REGX = Pattern.compile("^1(3\\d|4[5-9]|5[0-35-9]|6[2567]|7[0-8]|8\\d|9[0-35-9])\\d{8}$"); // 邮箱正则 private static final Pattern EMAIL_PATTERN = Pattern.compile("^[a-zA-Z0-9_+&*-]+(?:\\.[a-zA-Z0-9_+&*-]+)*@(?:[a-zA-Z0-9-]+\\.)+[a-zA-Z]{2,7}$"); // 身份证号码正则表达式 - private static final String ID_REGEX = "^(\\d{14}|\\d{17})(\\d|[Xx])$"; + private static final String ID_REGEX = "^(\\\\d{15}$|\\\\d{18}$|\\\\d{17}([0-9]|X))$"; /** * 数据权限:1.每个人不同的角色,而每个角色可以操作不同的案件状态 @@ -148,40 +157,47 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { } for (SysRole role : roles) { + if(StrUtil.isEmpty(role.getRoleName())){ + continue; + } // 超级管理员和仲裁委(部门长)案件,可查看所有案件 √ - if (role.getRoleName().equals("超级管理员") + if ("超级管理员".equals(role.getRoleName()) ) { return caseApplicationMapper.selectAdminCaseApplicationList(caseApplication); } - if (role.getRoleName().equals("仲裁委") - || role.getRoleName().equals("部门长")) { + if ("仲裁委".equals(role.getRoleName()) + || "部门长".equals(role.getRoleName())) { List caseStatusList = new ArrayList<>(); caseStatusList.add(CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL); caseStatusList.add(CaseApplicationConstants.ARBITRATED_SEAL); caseApplication.setDeptHeadStatus(caseStatusList); + caseApplication.setIsOtherRole(1); } - if (role.getRoleName().equals("仲裁员")) { + if ("仲裁员".equals(role.getRoleName())) { caseApplication.setUserId(String.valueOf(userId)); + caseApplication.setIsOtherRole(1); } - if (role.getRoleName().equals("财务")) { + if ("财务".equals(role.getRoleName())) { + caseApplication.setIsOtherRole(1); caseApplication.setFinanceStatus(CaseApplicationConstants.PENDING_PAYMENT_CONFIRM); } - if (role.getRoleName().equals("法律顾问")) { + if ("法律顾问".equals(role.getRoleName())) { // 查询角色有关的用户部门 - // List deptIds = sysDeptMapper.selectUserDeptListByRoleId(role.getRoleId()); List deptIds = new ArrayList<>(); deptIds.add(sysUser.getDeptId()); caseApplication.setDeptIds(deptIds); } - if (role.getRoleName().equals("申请人")) { + if ("申请人".equals(role.getRoleName())) { // 查询有关的用户部门 caseApplication.setApplicationOrganId(String.valueOf(sysUser.getDeptId())); } - if (role.getRoleName().equals("被申请人")) { + if ("被申请人".equals(role.getRoleName())) { + caseApplication.setIsOtherRole(1); // caseApplication.setIdCard(String.valueOf(sysUser.getIdCard())); } - if (role.getRoleName().equals("代理人")) { + if ("代理人".equals(role.getRoleName())) { + caseApplication.setIsOtherRole(1); // 查询角色有关的用户部门 // List agentDeptIds = sysDeptMapper.selectUserDeptListByRoleId(role.getRoleId()); List agentDeptIds = new ArrayList<>(); @@ -192,7 +208,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { // 根据条件查询申请人,被申请人,仲裁员,法律顾问案件 - return caseApplicationMapper.selectCaseApplicationList(caseApplication); +// return caseApplicationMapper.selectCaseApplicationList(caseApplication); + return caseApplicationMapper.selectCaseApplicationList1(caseApplication); } } @@ -215,40 +232,47 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { CaseApplication caseApplication = new CaseApplication(); List caseStatusList = new ArrayList<>(); for (SysRole role : roles) { + if(StrUtil.isEmpty(role.getRoleName())){ + continue; + } // 超级管理员和仲裁委(部门长)案件,可查看所有案件 √ if (role.getRoleName().equals("超级管理员") ) { return caseApplicationMapper.selectAdminCaseToDoCount(); } - if (role.getRoleName().equals("仲裁委") - || role.getRoleName().equals("部门长")) { - + if ("仲裁委".equals(role.getRoleName()) + || "部门长".equals(role.getRoleName())) { + caseApplication.setIsOtherRole(1); caseStatusList.add(CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL); caseStatusList.add(CaseApplicationConstants.ARBITRATED_SEAL); caseApplication.setDeptHeadStatus(caseStatusList); } - if (role.getRoleName().equals("仲裁员")) { + if ("仲裁员".equals(role.getRoleName())) { + caseApplication.setIsOtherRole(1); caseApplication.setUserId(String.valueOf(userId)); } - if (role.getRoleName().equals("财务")) { + if ("财务".equals(role.getRoleName())) { + caseApplication.setIsOtherRole(1); caseApplication.setFinanceStatus(CaseApplicationConstants.PENDING_PAYMENT_CONFIRM); } - if (role.getRoleName().equals("法律顾问")) { + if ("法律顾问".equals(role.getRoleName())) { // 查询角色有关的用户部门 // List deptIds = sysDeptMapper.selectUserDeptListByRoleId(role.getRoleId()); List deptIds = new ArrayList<>(); deptIds.add(sysUser.getDeptId()); caseApplication.setDeptIds(deptIds); } - if (role.getRoleName().equals("申请人")) { + if ("申请人".equals(role.getRoleName())) { // 查询角色有关的用户部门 caseApplication.setApplicationOrganId(String.valueOf(sysUser.getDeptId())); } - if (role.getRoleName().equals("被申请人")) { + if ("被申请人".equals(role.getRoleName())) { + caseApplication.setIsOtherRole(1); // caseApplication.setIdCard(String.valueOf(sysUser.getIdCard())); } - if (role.getRoleName().equals("代理人")) { + if ("代理人".equals(role.getRoleName())) { + caseApplication.setIsOtherRole(1); // 查询角色有关的用户部门 // List agentDeptIds = sysDeptMapper.selectUserDeptListByRoleId(role.getRoleId()); List agentDeptIds = new ArrayList<>(); @@ -259,7 +283,11 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { // 根据条件查询申请人,被申请人,仲裁员,法律顾问案件 - return caseApplicationMapper.selectTodoCountByRole(caseApplication); + ToDoCount toDoCount = caseApplicationMapper.selectTodoCountByRole(caseApplication); + if(toDoCount==null){ + return new ToDoCount(); + } + return toDoCount; } @Override @@ -280,7 +308,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { records.addAll(recordsnofinish); datas.put("allCasenode", records); datas.put("caseStatus", caseStatus); - return AjaxResult.success(datas); + return success(datas); } @@ -298,7 +326,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { // 发送开庭日期通知短信 sendHearDateMessage(caseApplication, request, "1975139"); // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.PENDING_OPENCOURT_HEAR, ""); + insertCaseLog(caseApplication.getId(), CaseApplicationConstants.PENDING_OPENCOURT_HEAR, ""); return rows; } @@ -511,7 +539,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { } } - return AjaxResult.success(); + return success(); } @@ -846,6 +874,11 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { } + /** + * 新增案件 + * @param caseApplication + * @return + */ @Override @Transactional public int insertcaseApplication(CaseApplication caseApplication) { @@ -860,8 +893,12 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { String caseNum = generateCaseNum(); caseApplication.setCaseNum(caseNum); caseApplication.setCreateBy(getUsername()); + caseApplication.setVersion(1); // 新增立案信息 int rows = caseApplicationMapper.insertCaseApplication(caseApplication); + if(rows==0){ + return rows; + } List caseAffiliates = caseApplication.getCaseAffiliates(); Map deptMap = new HashMap<>(); // 判断申请机构 @@ -876,6 +913,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { Long roleId = roleMapper.selectRoleIdByName("申请人"); for (CaseAffiliate caseAffiliate : caseAffiliates) { caseAffiliate.setCaseAppliId(caseApplication.getId()); + caseAffiliate.setCaseAppliLogId(caseApplication.getId()); if (caseAffiliate.getIdentityType() == 1 && StrUtil.isNotEmpty(caseAffiliate.getName())) { // 将组织机构id设为申请人名称 if (deptMap.containsKey(caseAffiliate.getName())) { @@ -918,7 +956,19 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { } } // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CASE_APPLICATION, ""); + insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CASE_APPLICATION, ""); + // 异步新增案件日志 + ThreadPoolUtil.execute(() -> { + caseApplication.setCaseAppliId(caseApplication.getId()); + caseApplication.setUpdateSubmitStatus(UpdateSubmitStatus.UNCOMMITTED.getCode()); + int insertRow = caseApplicationLogMapper.insert(caseApplication); + if (insertRow != 0 && CollectionUtil.isNotEmpty(caseAffiliates)) { + caseAffiliates.forEach(caseAffiliate -> caseAffiliate.setCaseAppliLogId(caseApplication.getId())); + // 插入案件日志人员相关表 + caseAffiliateLogMapper.batchCaseAffiliate(caseAffiliates); + } + }); + return rows; } @@ -950,15 +1000,17 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { @Override @Transactional - public int editCaseApplication(CaseApplication caseApplication) { + public AjaxResult editCaseApplication(CaseApplication caseApplication) { //根据仲裁费用计费规则计算应缴费用 //暂时设置计费比率为0.01 BigDecimal feeRate = new BigDecimal("0.01"); BigDecimal feePayable = caseApplication.getCaseSubjectAmount().multiply(feeRate).setScale(2, RoundingMode.HALF_UP); caseApplication.setFeePayable(feePayable); caseApplication.setUpdateBy(getUsername()); - - int rows = caseApplicationMapper.updataCaseApplication(caseApplication); + // int rows = caseApplicationMapper.updataCaseApplication(caseApplication); +// if(rows==0){ +// return rows; +// } List caseAffiliates = caseApplication.getCaseAffiliates(); if (caseAffiliates != null && caseAffiliates.size() > 0) { // 查询所有的组织机构,组装成map @@ -1001,7 +1053,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { } - caseAffiliateMapper.updataCaseAffiliate(caseAffiliate); + // caseAffiliateMapper.updataCaseAffiliate(caseAffiliate); } } @@ -1013,8 +1065,29 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { } } + // 根据案件id查询最新版本号 + Integer maxVersion = caseApplicationLogMapper.selectMaxVersionByCaseId(caseApplication.getId()); + if (maxVersion == null) { + maxVersion = 1; + } + caseApplication.setVersion(maxVersion+1); + // 将修改提交状态改为未提交 + caseApplication.setUpdateSubmitStatus(UpdateSubmitStatus.UNCOMMITTED.getCode()); + // 修改案件表的版本号 + // caseApplicationMapper.updateVersionById(caseApplication.getId(),caseApplication.getVersion()); - return rows; + // 异步新增案件日志 + ThreadPoolUtil.execute(() -> { + caseApplication.setCaseAppliId(caseApplication.getId()); + int insertRow = caseApplicationLogMapper.insert(caseApplication); + if (insertRow != 0 && CollectionUtil.isNotEmpty(caseAffiliates)) { + caseAffiliates.forEach(caseAffiliate -> caseAffiliate.setCaseAppliLogId(caseApplication.getId())); + // 插入案件日志人员相关表 + caseAffiliateLogMapper.batchCaseAffiliate(caseAffiliates); + } + }); + + return success(); } @@ -1132,7 +1205,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { application.setCaseStatus(CaseApplicationConstants.CASE_CHECK); rows += caseApplicationMapper.submitCaseApplication(application); // 新增日志 - CaseLogUtils.insertCaseLog(application.getId(), CaseApplicationConstants.CASE_CHECK, ""); + insertCaseLog(application.getId(), CaseApplicationConstants.CASE_CHECK, ""); } return rows; } @@ -1140,16 +1213,17 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { @Override @Transactional public int deletecaseApplicationByIds(List ids) { - + int rows = caseApplicationMapper.batchDeletecaseApplication(ids); caseAffiliateMapper.batchDeletecaseAffiliate(ids); - return caseApplicationMapper.batchDeletecaseApplication(ids); + caseApplicationLogMapper.batchDeleteLog(ids); + return rows; } @Override public CaseApplication selectCaseApplication(CaseApplication caseApplication) { - CaseApplication caseApplicationselect = caseApplicationMapper.selectCaseApplication(caseApplication); - CaseAffiliate caseAffiliate = new CaseAffiliate(); - caseAffiliate.setCaseAppliId(caseApplication.getId()); + CaseApplication caseApplicationselect=caseApplicationLogMapper.selectByCaseIdAndVersion(caseApplication.getId(),caseApplication.getVersion()); + caseApplicationselect.setId(caseApplication.getId()); + ArbitrateRecord arbitrateRecord = new ArbitrateRecord(); arbitrateRecord.setCaseAppliId(caseApplication.getId()); @@ -1178,8 +1252,9 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { } } caseApplicationselect.setCaseAttachList(caseAttachList); - - List caseAffiliatListeselect = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate); + CaseAffiliate caseAffiliateLog = new CaseAffiliate(); + caseAffiliateLog.setCaseAppliLogId(caseApplication.getCaseLogId()); + List caseAffiliatListeselect = caseAffiliateLogMapper.selectCaseAffiliate(caseAffiliateLog); if (caseAffiliatListeselect != null) { // 查询组织机构 List sysDepts = sysDeptMapper.selectDeptList(new SysDept()); @@ -1219,6 +1294,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { StringBuilder failureMsg = new StringBuilder(); StringBuilder successMsg = new StringBuilder(); int successNum = 0; + List caseAffiliateLogList=new ArrayList<>(); if (caseApplicationList != null && caseApplicationList.size() > 0) { // 1,查询所有的组织机构,组装成map List deptList = sysDeptMapper.selectDeptList(new SysDept()); @@ -1254,14 +1330,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { } } if (caseApplicationListinsert.size() > 0) { -// List caseApplicationListinsertDiffer = caseApplicationListinsert.stream().collect( -// collectingAndThen( -// toCollection(() -> new TreeSet<>(Comparator.comparing(CaseApplication::getCaseNum))), -// ArrayList::new)); - - //对不重复的立案对象集合的立案对象重新组装对应的案件关联人信息 -// if(caseApplicationListinsertDiffer!=null&&caseApplicationListinsertDiffer.size()>0){ List caseApplicationNewList = null; for (int i = 0; i < caseApplicationListinsert.size(); i++) { caseApplicationNewList = new ArrayList<>(); @@ -1290,9 +1359,13 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { // 新增立案信息 caseApplicationItera.setCaseStatus(CaseApplicationConstants.CASE_APPLICATION); caseApplicationItera.setCreateBy(getUsername()); + caseApplicationItera.setImportFlag(1); int rows = caseApplicationMapper.insertCaseApplication(caseApplicationItera); + if(rows==0){ + continue; + } // 新增日志 - CaseLogUtils.insertCaseLog(caseApplicationItera.getId(), CaseApplicationConstants.CASE_APPLICATION, ""); + insertCaseLog(caseApplicationItera.getId(), CaseApplicationConstants.CASE_APPLICATION, ""); List caseAffiliates = caseApplicationItera.getCaseAffiliates(); if (caseAffiliates != null && caseAffiliates.size() > 0) { @@ -1302,16 +1375,31 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { } caseAffiliateMapper.batchCaseAffiliate(caseAffiliates); } + // 新增案件记录 + caseApplicationItera.setCaseAppliId(caseApplicationItera.getId()); + caseApplicationItera.setUpdateSubmitStatus(UpdateSubmitStatus.UNCOMMITTED.getCode()); + caseApplicationItera.setVersion(1); + int insertRow = caseApplicationLogMapper.insert(caseApplicationItera); + if(insertRow>0){ + caseAffiliates.forEach(caseAffiliate -> caseAffiliate.setCaseAppliLogId(caseApplicationItera.getId())); + caseAffiliateLogList.addAll(caseAffiliates); + } successNum++; successMsg.append("
").append(successNum).append("、立案编号 ").append(caseApplicationItera.getCaseNum()).append(" 导入成功"); } -// } } } + // 异步新增案件日志 + ThreadPoolUtil.execute(() -> { + if ( CollectionUtil.isNotEmpty(caseAffiliateLogList)) { + // 插入案件日志人员相关表 + caseAffiliateLogMapper.batchCaseAffiliate(caseAffiliateLogList); + } + }); } else { @@ -1342,48 +1430,6 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { validDebtorApplicationAgentColumn(caseApplication, failureMsg); } - /** - * 验证身份证号码是否合法 - * @param idCard - * @return - */ - public static boolean validateIdCard(String idCard) { - if (idCard == null || idCard.trim().isEmpty()) { - return false; - } - - if (!Pattern.matches(ID_REGEX, idCard)) { - return false; - } - - // 根据身份证号码的长度,采取不同的校验位计算方式 - if (idCard.length() == 15) { - // 旧版身份证校验位计算 - int sum = 0; - int[] weights = {7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8}; - String idDigits = idCard.substring(0, 14); - for (int i = 0; i < idDigits.length(); i++) { - sum += Integer.parseInt(idDigits.substring(i, i + 1)) * weights[i]; - } - int checkCode = 11 - (sum % 11); - if (checkCode == 10) { - checkCode = 0; - } - return idCard.substring(idCard.length() - 1).equals(String.valueOf(checkCode)); - } else if (idCard.length() == 18) { - // 新版身份证校验位计算 - int sum = 0; - int[] weights = {6, 7, 8, 4, 5, 6, 3, 2, 1, 0, 9, 7, 3, 4, 5, 6, 2, 8}; - String idDigits = idCard.substring(0, 17); - for (int i = 0; i < idDigits.length(); i++) { - sum += Integer.parseInt(idDigits.substring(i, i + 1)) * weights[i]; - } - int checkCode = sum % 10; - return idCard.substring(idCard.length() - 1).equals(String.valueOf(checkCode)); - } - - return false; - } /** * 校验被申请人代理信息 * @@ -1398,7 +1444,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { } if (StrUtil.isEmpty(caseApplication.getDebtorIdentityNumAgent())) { failureMsg.append("【被申请人主体信息-代理人身份证号】字段不能为空;"); - } else if (!validateIdCard(caseApplication.getDebtorIdentityNumAgent())) { + } else if (! IdcardUtil.isValidCard((caseApplication.getDebtorIdentityNumAgent()))) { failureMsg.append("【被申请人主体信息-代理人身份证号】不合法;"); } String debtorContactTelphoneAgent = caseApplication.getDebtorContactTelphoneAgent(); @@ -1428,7 +1474,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { } if (StrUtil.isEmpty(caseApplication.getDebtorIdentityNum())) { failureMsg.append("【被申请人主体信息-身份证号】字段不能为空;"); - } else if (!validateIdCard(caseApplication.getDebtorIdentityNum())) { + } else if (! IdcardUtil.isValidCard(caseApplication.getDebtorIdentityNum())) { failureMsg.append("【被申请人主体信息-身份证号】不合法;"); } String debtorContactTelphone = caseApplication.getDebtorContactTelphone(); @@ -1485,7 +1531,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { } if (StrUtil.isEmpty(caseApplication.getIdentityNumAgent())) { failureMsg.append("【申请人主体信息-代理人身份证号】字段不能为空;"); - } else if (!validateIdCard(caseApplication.getIdentityNumAgent())) { + } else if (!IdcardUtil.isValidCard(caseApplication.getIdentityNumAgent())) { failureMsg.append("【申请人主体信息-代理人身份证号】不合法;"); } validAgentInfo(caseApplication, failureMsg, deptMap); @@ -1701,7 +1747,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { } } // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL, ""); + insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL, ""); return rows; } @@ -1713,7 +1759,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { ArbitrateRecord arbitrateRecord = caseApplication.getArbitrateRecord(); arbitrateRecordMapper.updataArbitrateRecord(arbitrateRecord); // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CHECK_ARBITRATION, ""); + insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CHECK_ARBITRATION, ""); return rows; } @@ -1906,18 +1952,18 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { } caseApplication.setCaseStatus(CaseApplicationConstants.SIGN_ARBITRATION); // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.SIGN_ARBITRATION, ""); + insertCaseLog(caseApplication.getId(), CaseApplicationConstants.SIGN_ARBITRATION, ""); rows = caseApplicationMapper.submitCaseApplication(caseApplication); } else if (agreeOrNotCheck.intValue() == 2) {//拒绝审核 caseApplication.setCaseStatus(CaseApplicationConstants.VERPRIF_ARBITRATION); // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.VERPRIF_ARBITRATION, ""); + insertCaseLog(caseApplication.getId(), CaseApplicationConstants.VERPRIF_ARBITRATION, ""); rows = caseApplicationMapper.submitCaseApplication(caseApplication); } - return AjaxResult.success(); + return success(); } @Override @@ -1937,7 +1983,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { rows += caseApplicationMapper.submitCaseApplication(caseApplication); } // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.PENDING_PAYMENT, ""); + insertCaseLog(caseApplication.getId(), CaseApplicationConstants.PENDING_PAYMENT, ""); } @@ -2144,7 +2190,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { caseLogRecordMapper.insertCaseLogRecord(caseLogRecord); // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.GENERATED_ARBITRATION, ""); + insertCaseLog(caseApplication.getId(), CaseApplicationConstants.GENERATED_ARBITRATION, ""); } @@ -2163,7 +2209,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { caseLogRecordMapper.insertCaseLogRecord(caseLogRecord); // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.GENERATED_ARBITRATION, ""); + insertCaseLog(caseApplication.getId(), CaseApplicationConstants.GENERATED_ARBITRATION, ""); } } @@ -2281,7 +2327,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { //获取案件详细信息 CaseApplication caseApplicationSelct = selectCaseApplication(caseApplication); - return AjaxResult.success(caseApplicationSelct); + return success(caseApplicationSelct); } catch (IOException e) { e.printStackTrace(); return AjaxResult.error("生成庭审笔录异常"); @@ -2344,7 +2390,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { // 发送开庭日期通知短信 sendHearDateMessage(caseApplication, request, "1947342"); // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.MODIFY_HEARDATE, ""); + insertCaseLog(caseApplication.getId(), CaseApplicationConstants.MODIFY_HEARDATE, ""); return rows; @@ -2682,7 +2728,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { ReservedConference conference = new ReservedConference(reservedConferenceVO.getCaseId(), roomId, reservedConferenceVO.getScheduleStartTime(), reservedConferenceVO.getScheduleEndTime(),1); reservedConferenceMapper.insert(conference); - return AjaxResult.success("预约会议成功"); + return success("预约会议成功"); case 42002: return AjaxResult.error("预定会议无效"); @@ -2770,8 +2816,10 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { @Override public AjaxResult deleteRoom(String roomId) { - return AjaxResult.success( reservedConferenceMapper.deleteByRoomId(roomId)); + return success( reservedConferenceMapper.deleteByRoomId(roomId)); } + + } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseEvidenceServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseEvidenceServiceImpl.java index 2c73aab..546eb05 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseEvidenceServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseEvidenceServiceImpl.java @@ -1,6 +1,7 @@ package com.ruoyi.wisdomarbitrate.service.impl; import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.util.StrUtil; import com.ruoyi.common.config.RuoYiConfig; import com.ruoyi.common.constant.CaseApplicationConstants; import com.ruoyi.common.core.domain.AjaxResult; @@ -8,6 +9,7 @@ import com.ruoyi.common.core.domain.entity.SysRole; import com.ruoyi.common.core.domain.entity.SysUser; import com.ruoyi.common.core.domain.model.LoginUser; import com.ruoyi.common.utils.SecurityUtils; +import com.ruoyi.common.utils.SmsUtils; import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.spring.SpringUtils; import com.ruoyi.system.mapper.SysUserMapper; @@ -27,12 +29,11 @@ import org.springframework.transaction.annotation.Transactional; import org.springframework.web.multipart.MultipartFile; import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Iterator; -import java.util.List; +import java.util.*; import java.util.stream.Collectors; +import static com.ruoyi.common.utils.SecurityUtils.getUsername; + @Service public class CaseEvidenceServiceImpl implements ICaseEvidenceService { @Autowired @@ -47,6 +48,8 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService { private CaseEvidenceDirectoryMapper caseEvidenceDirectoryMapper; @Autowired private SysUserMapper sysUserMapper; + @Autowired + private SmsRecordMapper smsRecordMapper; @Override @Transactional @@ -246,13 +249,6 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService { .build(); int count = caseAttachMapper.save(caseAttach); if (count > 0 && annexType != null && annexType != 8) { -// if (id != null) { -// //修改案件状态 -// CaseApplication caseApplication = new CaseApplication(); -// caseApplication.setId(id); -// caseApplication.setCaseStatus(4); -// caseApplicationMapper.submitCaseApplication(caseApplication); -// } CaseAttach caseAttachselect = new CaseAttach(); caseAttachselect.setAnnexId(caseAttach.getAnnexId()); caseAttachselect.setAnnexName(caseAttach.getAnnexName()); @@ -266,6 +262,44 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService { e.printStackTrace(); return AjaxResult.error("上传失败"); } + // 给秘书发送短信 + // 根据caseid查询该案件的法律顾问,根据案件id查申请表,查到申请机构id,然后拿申请机构id查询在哪个人下并且角色要是法律顾问 + CaseAffiliate caseAffiliate = caseAffiliateMapper.selectCaseAffiliateByIdentityType(id, 1); + if(caseAffiliate!= null && StrUtil.isNotEmpty(caseAffiliate.getApplicationOrganId())){ + List userList= sysUserMapper.selectByDeptIdAndRole(caseAffiliate.getApplicationOrganId(),"法律顾问"); + if(CollectionUtil.isNotEmpty(userList)){ + // 新增短信记录 + SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest(); + // 1992106 普通短信 修改证据资料通知 尊敬的{1}用户,您的{2}仲裁案件,有新的证据上传,请知晓,如非本人操作,请忽略本短信。 + request.setTemplateId("1992106"); + CaseApplication caseApplication = new CaseApplication(); + caseApplication.setId(id); + caseApplication = caseApplicationMapper.selectCaseApplication(caseApplication); + for (SysUser user : userList) { + request.setPhone(user.getPhonenumber()); + request.setTemplateParamSet(new String[]{user.getNickName(),caseApplication.getCaseNum()}); + Boolean aBoolean = SmsUtils.sendSms(request); + //保存短信发送记录 + SmsSendRecord smsSendRecord = new SmsSendRecord(); + smsSendRecord.setCaseId(caseAffiliate.getCaseAppliId()); + + smsSendRecord.setCaseNum(caseApplication.getCaseNum()); + smsSendRecord.setPhone(request.getPhone()); + smsSendRecord.setSendTime(new Date()); + String content = "尊敬的" + user.getNickName() + ",您的"+caseApplication.getCaseNum()+"仲裁案件,有新的证据上传,请知晓,如非本人操作,请忽略本短信。"; + smsSendRecord.setSendContent(content); + smsSendRecord.setCreateBy(getUsername()); + if (aBoolean) { + smsSendRecord.setSendStatus(1); + } else { + smsSendRecord.setSendStatus(0); + } + smsRecordMapper.saveSmsSendRecord(smsSendRecord); + } + + } + } + return AjaxResult.success("上传成功", successList); diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/VideoServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/VideoServiceImpl.java index f85cf48..21e152d 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/VideoServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/VideoServiceImpl.java @@ -209,7 +209,7 @@ public class VideoServiceImpl implements VideoService { recordParams.setOutputFormat(0L); // 0:(默认)输出文件为hls格式。1:输出文件格式为hls+mp4。2:输出文件格式为hls+aac MixLayoutParams mixLayoutParams = new MixLayoutParams(); // 布局模式: 1:悬浮布局;2:屏幕分享布局;3:九宫格布局(默认);4:自定义布局; - mixLayoutParams.setMixLayoutMode(1L); + mixLayoutParams.setMixLayoutMode(3L); req.setMixLayoutParams(mixLayoutParams); StorageParams storageParams1 = new StorageParams(); diff --git a/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml index a812f0f..4fa0070 100644 --- a/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml @@ -194,6 +194,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" left join sys_role r on r.role_id = ur.role_id where u.id_card = #{idCard} and u.del_flag = '0' and u.status='0' order by u.create_time limit 1 + diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAffiliateLogMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAffiliateLogMapper.xml new file mode 100644 index 0000000..9a9b753 --- /dev/null +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAffiliateLogMapper.xml @@ -0,0 +1,125 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + insert into case_affiliate_log(case_appli_log_id, identity_type,application_organ_id,application_organ_name,name,identity_num,contact_telphone, + contact_address,work_address,work_telphone ,name_agent,identity_num_agent,contact_telphone_agent, + comp_legal_person,comp_legalper_post,respon_sex ,respon_birth, + residen_affili,appli_agent_title, + contact_address_agent,email ) values + + (#{item.caseAppliLogId},#{item.identityType},#{item.applicationOrganId},#{item.applicationOrganName},#{item.name},#{item.identityNum},#{item.contactTelphone}, + #{item.contactAddress},#{item.workAddress},#{item.workTelphone}, #{item.nameAgent},#{item.identityNumAgent},#{item.contactTelphoneAgent}, + #{item.compLegalPerson},#{item.compLegalperPost},#{item.responSex}, #{item.responBirth}, + #{item.residenAffili},#{item.appliAgentTitle}, + #{item.contactAddressAgent}, + #{item.email}) + + + + + + + update case_affiliate_log + set + case_appli_log_id=#{caseAppliLogId}, + identity_type= #{identityType}, + application_organ_id= #{applicationOrganId}, + application_organ_name= #{applicationOrganName}, + name = #{name}, + identity_num = #{identityNum}, + contact_telphone = #{contactTelphone}, + contact_address = #{contactAddress}, + work_address = #{workAddress}, + work_telphone = #{workTelphone}, + + name_agent = #{nameAgent}, + identity_num_agent = #{identityNumAgent}, + contact_telphone_agent = #{contactTelphoneAgent}, + contact_address_agent = #{contactAddressAgent}, + send_email = #{sendEmail}, + residen_affili = #{residenAffili}, + email= #{email}, + track_num = #{trackNum} + + where id = #{id} + + + + + delete from case_affiliate_log where case_appli_log_id = #{caseAppliLogId} + + + + delete from case_affiliate_log where case_appli_log_id in + + #{item} + + + + + \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAffiliateMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAffiliateMapper.xml index 58761cb..39342c7 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAffiliateMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAffiliateMapper.xml @@ -56,7 +56,7 @@ AND c.case_appli_id = #{caseAppliId} - + AND c.identity_type = #{identityType} @@ -112,6 +112,33 @@ where id = #{id} + + + + update case_affiliate + + + application_organ_id= #{item.applicationOrganId}, + application_organ_name= #{item.applicationOrganName}, + name = #{name}, + identity_num = #{item.identityNum}, + contact_telphone = #{item.contactTelphone}, + contact_address = #{item.contactAddress}, + work_address = #{item.workAddress}, + work_telphone = #{item.workTelphone}, + + name_agent = #{item.nameAgent}, + identity_num_agent = #{item.identityNumAgent}, + contact_telphone_agent = #{item.contactTelphoneAgent}, + contact_address_agent = #{item.contactAddressAgent}, + send_email = #{item.sendEmail}, + residen_affili = #{item.residenAffili}, + email= #{item.email}, + track_num = #{item.trackNum} + + where case_appli_id = #{caseAppliId} and identity_type= #{item.identityType}; + + delete from case_affiliate where case_appli_id = #{id} diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationLogMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationLogMapper.xml new file mode 100644 index 0000000..2b3b9e5 --- /dev/null +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationLogMapper.xml @@ -0,0 +1,158 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + insert into case_application_log( + case_appli_id , + case_name , + case_num, + case_subject_amount, + + arbitrat_claims, + request_rule, + loan_start_date, + loan_end_date, + claim_princi_owed, + + claim_interest_owed, + claim_liquid_damag, + fee_payable, + contract_number, + create_by, + version, + update_submit_status, + create_time + )values( + #{caseAppliId}, + #{caseName}, + #{caseNum}, + #{caseSubjectAmount}, + + #{arbitratClaims}, + #{requestRule}, + #{loanStartDate}, + #{loanEndDate}, + #{claimPrinciOwed}, + + #{claimInterestOwed}, + #{claimLiquidDamag}, + #{feePayable}, + #{contractNumber}, + #{createBy}, + #{version}, + #{updateSubmitStatus}, + sysdate() + ) + + + update case_application_log + + + update_submit_status=#{updateSubmitStatus}, + + + + AND case_appli_id=#{caseId} + AND version=#{version} + + + + + + DELETE FROM case_application_log + WHERE id = #{id} + + + delete a from case_affiliate_log a + join case_application_log l on l.id=a.case_appli_log_id + where l.id in ( + + #{id} + + ); + + delete from case_application_log l where l.id in ( + + #{id} + + ); + + + + + + + + + + + \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml index 4fd040e..aa4520a 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml @@ -47,6 +47,403 @@ + + + + + @@ -315,7 +833,7 @@ c.hear_date ,c.arbitrat_claims , c.loan_start_date ,c.loan_end_date ,c.claim_princi_owed ,c.claim_interest_owed ,c.claim_liquid_damag ,c.fee_payable , c.begin_video_date ,c.online_video_person ,c.contract_number ,c.create_by ,c.create_time ,c.lock_status, - c.update_by ,c.update_time , c.arbitrator_name,ca.application_organ_id applicationOrganId ,ca.application_organ_name as applicantName,c.filearbitra_url + c.update_by ,c.update_time , c.arbitrator_name,ca.application_organ_id applicationOrganId ,ca.application_organ_name as applicantName,c.filearbitra_url,c.version from case_application c JOIN case_affiliate ca ON ca.case_appli_id = c.id AND ca.identity_type=1 @@ -399,7 +917,418 @@ + + insert into case_application( case_name , @@ -428,6 +1357,7 @@ create_by, import_flag, + version, create_time )values( #{caseName}, @@ -456,6 +1386,7 @@ #{createBy}, #{importFlag}, + #{version}, sysdate() ) @@ -488,6 +1419,7 @@ update_by = #{updateBy}, case_num = #{caseNum}, + version = #{version}, update_time = sysdate() where id = #{id} @@ -529,6 +1461,9 @@ update case_application set room_id=#{roomId} where id = #{caseId} + + update case_application set version = #{version} where id = #{id} + delete from case_application where id = #{id} @@ -647,4 +1582,6 @@ order by c.create_time desc limit 1 from reserved_conference ; + +