From 44129c7cd05bef1bf4b7b12ea25276314ed7310b Mon Sep 17 00:00:00 2001 From: 18792927508 <1322446236@qq.com> Date: Fri, 10 May 2024 17:48:42 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=86=E9=A2=91=EF=BC=8C=E7=94=A8=E5=8D=B0?= =?UTF-8?q?=E5=9B=9E=E8=B0=83=EF=BC=8C=E8=A3=81=E5=86=B3=E4=B9=A6=E5=A4=84?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/system/SysDeptController.java | 2 +- .../AdjudicationController.java | 34 +- .../CaseApplicationController.java | 14 +- .../wisdomarbitrate/MsSignSealController.java | 56 ++ .../com/ruoyi/common/constant/Constants.java | 2 + .../domain/CaseApplication.java | 4 +- .../domain/SealSignRecord.java | 8 + .../mapper/CaseApplicationMapper.java | 7 + .../mapper/CaseAttachMapper.java | 8 + .../mapper/CaseEvidenceMapper.java | 2 + .../mapper/SealSignRecordMapper.java | 7 + .../service/ICaseApplicationService.java | 2 +- .../service/MsSignSealService.java | 15 + .../service/impl/AdjudicationServiceImpl.java | 29 +- .../impl/CaseApplicationServiceImpl.java | 850 +++++++----------- .../impl/CaseArbitrateServiceImpl.java | 47 +- .../service/impl/CaseEvidenceServiceImpl.java | 63 +- .../impl/CaseLogRecordServiceImpl.java | 8 +- .../service/impl/CasePaymentServiceImpl.java | 14 +- .../service/impl/MsSignSealServiceImpl.java | 268 ++++++ .../wisdomarbitrate/utils/DigesdateUtils.java | 46 + .../utils/FixSelectFlowDetailUtils.java | 4 +- .../utils/SignVerifyUtils.java | 96 ++ .../wisdomarbitrate/CaseApplicationMapper.xml | 9 + .../wisdomarbitrate/CaseAttachMapper.xml | 7 +- .../wisdomarbitrate/CaseEvidenceMapper.xml | 38 +- .../wisdomarbitrate/CaseLogRecordMapper.xml | 16 +- .../wisdomarbitrate/SealSignRecordMapper.xml | 13 +- 28 files changed, 998 insertions(+), 671 deletions(-) create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/MsSignSealController.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/MsSignSealService.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/MsSignSealServiceImpl.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/DigesdateUtils.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/SignVerifyUtils.java diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDeptController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDeptController.java index 59e7588..ca6e9fe 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDeptController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDeptController.java @@ -37,7 +37,7 @@ public class SysDeptController extends BaseController /** * 获取部门列表 */ - @PreAuthorize("@ss.hasPermi('system:dept:list')") +// @PreAuthorize("@ss.hasPermi('system:dept:list')") @GetMapping("/list") public AjaxResult list(SysDept dept) { diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/AdjudicationController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/AdjudicationController.java index d604b3a..5460b45 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/AdjudicationController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/AdjudicationController.java @@ -159,16 +159,7 @@ public class AdjudicationController extends BaseController { return AjaxResult.success(logisticsInfo); } - /** - * 签名(暂时只改案件状态) - * @param caseApplication - * @return - */ - @PostMapping("/signature") -// @PreAuthorize("@ss.hasPermi('awardManagement:list:sign')") - public AjaxResult signature(@Validated @RequestBody CaseApplication caseApplication){ - return adjudicationService.signature(caseApplication); - } + /** @@ -222,16 +213,7 @@ public class AdjudicationController extends BaseController { return adjudicationService.serviceBatch(caseApplication.getBatchNumber()); } - /** - * 用印(暂时只改案件状态) - * @param caseApplication - * @return - */ - @PostMapping("/stamp") -// @PreAuthorize("@ss.hasPermi('awardManagement:list:signprint')") - public AjaxResult stamp(@Validated @RequestBody CaseApplication caseApplication){ - return adjudicationService.stamp(caseApplication); - } + /** * 档案详情查询 @@ -255,13 +237,15 @@ public class AdjudicationController extends BaseController { } /** * 开庭审理提交,只改变案件状态为CaseApplicationConstants.VERPRIF_ARBITRATION - * @param id 案件id + * @param caseApplication 案件 * @return */ - @GetMapping("/changeCaseStatus") - public AjaxResult changeCaseStatus(@RequestParam("id") Long id){ - - return adjudicationService.changeCaseStatus(id, CaseApplicationConstants.VERPRIF_ARBITRATION); + @PostMapping("/changeCaseStatus") + public AjaxResult changeCaseStatus(@RequestBody CaseApplication caseApplication){ + if(caseApplication.getId()==null){ + return error("参数校验失败"); + } + return adjudicationService.changeCaseStatus(caseApplication.getId(), CaseApplicationConstants.VERPRIF_ARBITRATION); } } 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 6bb50da..19c7d73 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 @@ -271,7 +271,7 @@ public class CaseApplicationController extends BaseController { @Log(title = "组庭审核", businessType = BusinessType.UPDATE) @PostMapping("/pendTralCheck") public AjaxResult pendTralCheck(@Validated @RequestBody CaseApplication caseApplication) { - if(StrUtil.isEmpty(caseApplication.getArbitratorId())|| StrUtil.isEmpty(caseApplication.getArbitratorName())){ + if(CollectionUtil.isEmpty(caseApplication.getArbitrators())){ return error("请选择仲裁员"); } return caseApplicationService.pendTralCheck(caseApplication); @@ -454,19 +454,9 @@ public class CaseApplicationController extends BaseController { return success(schemeUrl); } - /** - * 生成庭审笔录 - * @param arbitrateRecord - * @return - */ - @PostMapping("/creatTrialRecord") -// @PreAuthorize("@ss.hasPermi('caseManagement:list:creatTrialRecord')") - public AjaxResult creatTrialRecord(@Validated @RequestBody ArbitrateRecord arbitrateRecord){ - return caseApplicationService.creatTrialRecord(arbitrateRecord); - } /** - * 记录庭审笔录 + * 确认会议结果 * @param arbitrateRecord * @return */ diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/MsSignSealController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/MsSignSealController.java new file mode 100644 index 0000000..33d4e80 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/MsSignSealController.java @@ -0,0 +1,56 @@ +package com.ruoyi.web.controller.wisdomarbitrate; + +import com.ruoyi.common.annotation.Anonymous; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.wisdomarbitrate.service.MsSignSealService; +import com.ruoyi.wisdomarbitrate.utils.SignVerifyUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @Classname MsSignSealController + * @Description TODO + * @Version 1.0.0 + * @Date 2024/5/10 15:07 + * @Created wangqiong + */ +@RestController +@RequestMapping("/mssignSeal") +public class MsSignSealController extends BaseController { + @Autowired + private MsSignSealService msSignSealService; + /** + * 签名用印回调 + */ + @Anonymous + @PostMapping("/signSeaalCaseApplicaCallback") + public AjaxResult signSeaalCaseApplicaCallback() throws Exception { + boolean checkResult= SignVerifyUtils.checkSignuter(); + if(checkResult){ + String reqbodystr =SignVerifyUtils.getRequestBody(); + return msSignSealService.signSeaalCaseApplicaCallback(reqbodystr); + }else { + return AjaxResult.error("error"); + } + + } + + /** + * 印章审核回调 + */ + @Anonymous + @PostMapping("/sealCheckCallback") + public AjaxResult sealCheckCallback() throws Exception { + boolean checkResult= SignVerifyUtils.checkSignuter(); + if(checkResult){ + String reqbodystr =SignVerifyUtils.getRequestBody(); + return msSignSealService.sealCheckCallback(reqbodystr); + }else { + return AjaxResult.error("error"); + } + + } +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/constant/Constants.java b/ruoyi-common/src/main/java/com/ruoyi/common/constant/Constants.java index e46e514..64540ce 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/constant/Constants.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/constant/Constants.java @@ -154,4 +154,6 @@ public class Constants */ public static final String[] JOB_ERROR_STR = { "java.net.URL", "javax.naming.InitialContext", "org.yaml.snakeyaml", "org.springframework", "org.apache", "com.ruoyi.common.utils.file", "com.ruoyi.common.config" }; + // 中文逗号分隔符 + public static final String CN_SPLIT_COMMA = ","; } 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 f45db4b..8e27c69 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 @@ -39,7 +39,7 @@ public class CaseApplication extends BaseEntity { /** 立案日期 */ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date registerDate; - /** 仲裁方式 */ + /** 仲裁方式 ,1-开庭,2-书面*/ private Integer arbitratMethod; /** * 是否导入,0手动录入,1导入,默认0 @@ -211,7 +211,7 @@ public class CaseApplication extends BaseEntity { */ private Integer financeStatus; /** - * 是否是被申请人,仲裁员,部门长,财务,代理人,0-否,1-是 + * 是否查询全部节点 */ private Integer isOtherRole; /** diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/SealSignRecord.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/SealSignRecord.java index e4e0267..00b2748 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/SealSignRecord.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/SealSignRecord.java @@ -58,6 +58,14 @@ public class SealSignRecord extends BaseEntity { private double positionXorg; /** 印章位置y坐标 */ private double positionYorg; + /** + * 仲裁员签名状态,1-签名 + */ + private Integer signStatusArbitor; + /** + * 用印状态,1用印 + */ + private Integer sealStatus; 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 189815f..630dd6a 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 @@ -149,4 +149,11 @@ public interface CaseApplicationMapper { List list(@Param("caseApplication") CaseApplication caseApplication, @Param("caseStatusList") List caseStatusList, @Param("roleNames") List roleNames); + + /** + * 查询当前案件节点 + * @param id + * @return + */ + Integer selectCaseApplicationCaseStatus(@Param("id") Long id); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAttachMapper.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAttachMapper.java index 7e0d475..e59296f 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAttachMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAttachMapper.java @@ -35,4 +35,12 @@ public interface CaseAttachMapper { void deleteByCasedIdAndType(@Param("caseAppliId")Long caseAppliId,@Param("annexType") int annexType,@Param("isBatchUpload") int isBatchUpload); void deleteCaseAttachByCasedIdAndType(@Param("caseAppliId")Long caseAppliId,@Param("annexType") int annexType); + + /** + * 删除存在的附件不包括该附件 + * @param caseId 附件 + * @param type 附件类型 + * @param annexId 附件id + */ + void deleteCaseAttach(@Param("caseId")Long caseId, @Param("type")int type,@Param("annexId") Long annexId); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseEvidenceMapper.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseEvidenceMapper.java index 5f0a4a2..61d6c8d 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseEvidenceMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseEvidenceMapper.java @@ -12,5 +12,7 @@ public interface CaseEvidenceMapper { List getCaseListByRespondent(@Param(value = "identityNum" ) String identityNum , @Param(value = "caseStatusList") List caseStatusList , @Param(value = "identityType" ) Integer identityType + , @Param(value = "phone" ) String phone + , @Param(value = "loginUserName" ) String loginUserName ); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/SealSignRecordMapper.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/SealSignRecordMapper.java index 7c9ab06..210fa95 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/SealSignRecordMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/SealSignRecordMapper.java @@ -31,4 +31,11 @@ public interface SealSignRecordMapper { void insertSealSignRecord(SealSignRecord sealSignRecord); List selectsignFlow(@Param("batchNumber") Integer batchNumber,@Param("caseStatus") Integer caseStatus); + + /** + * 根据签署流程id查询签署记录 + * @param signFlowId + * @return + */ + SealSignRecord selectSealByFlowId(@Param("signFlowId") String signFlowId); } 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 7f146b4..9194c3d 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 @@ -57,7 +57,7 @@ public interface ICaseApplicationService { SealSignRecord selectSealUrl(CaseApplication caseApplication) throws EsignDemoException; - AjaxResult creatTrialRecord(ArbitrateRecord arbitrateRecord); + CaseApplication selectSignSealUrl(CaseApplication caseApplication) throws EsignDemoException; diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/MsSignSealService.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/MsSignSealService.java new file mode 100644 index 0000000..de171f9 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/MsSignSealService.java @@ -0,0 +1,15 @@ +package com.ruoyi.wisdomarbitrate.service; + +import com.google.gson.Gson; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.exception.EsignDemoException; +import com.ruoyi.wisdomarbitrate.domain.CaseApplication; + +import java.io.IOException; +import java.util.List; + +public interface MsSignSealService { + AjaxResult signSeaalCaseApplicaCallback(String reqbodystr) throws EsignDemoException, IOException; + + AjaxResult sealCheckCallback(String reqbodystr) throws EsignDemoException, IOException; +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java index f5bf0e1..f9544e9 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java @@ -60,6 +60,7 @@ import java.util.regex.Pattern; import java.util.stream.Collectors; import static com.ruoyi.common.utils.SecurityUtils.getUsername; +import static com.ruoyi.wisdomarbitrate.utils.CaseLogUtils.insertCaseLog; @Service @Slf4j @@ -730,11 +731,13 @@ public class AdjudicationServiceImpl implements IAdjudicationService { @Override @Transactional public AjaxResult signature(CaseApplication caseApplication) { + // 查询当前案件节点 + Integer currentStatus= caseApplicationMapper.selectCaseApplicationCaseStatus(caseApplication.getId()); //更改案件状态(暂时) caseApplication.setCaseStatus(CaseApplicationConstants.ARBITRATED_SEAL); caseApplicationMapper.submitCaseApplication(caseApplication); // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.ARBITRATED_SEAL, ""); + CaseLogUtils.insertCaseLog(caseApplication.getId(),currentStatus, ""); return AjaxResult.success("签名成功,案件状态已改为待裁决书用印"); } @@ -746,11 +749,13 @@ public class AdjudicationServiceImpl implements IAdjudicationService { for (Long id : ids) { CaseApplication caseApplication = new CaseApplication(); caseApplication.setId(id); + // 查询当前案件节点 + Integer currentStatus= caseApplicationMapper.selectCaseApplicationCaseStatus(caseApplication.getId()); //更改案件状态(暂时) caseApplication.setCaseStatus(CaseApplicationConstants.CASE_ARCHIVED); caseApplicationMapper.submitCaseApplication(caseApplication); // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CASE_ARCHIVED, ""); + CaseLogUtils.insertCaseLog(caseApplication.getId(),currentStatus, ""); } } catch (Exception e) { return AjaxResult.error(e.getMessage()); @@ -771,6 +776,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService { if (caseApplication1 == null) { return AjaxResult.error("未查询到相关案件"); } + Integer currentNode=caseApplication1.getCaseStatus(); List caseAttachList = caseAttachMapper.queryCaseAttachList(caseApplication1); Boolean isExistPdf = false; if (caseAttachList != null && caseAttachList.size() > 0) { @@ -953,7 +959,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService { // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CASE_FILING, ""); + CaseLogUtils.insertCaseLog(caseApplication.getId(), currentNode, ""); return AjaxResult.success("裁决书送达成功"); } @@ -1010,11 +1016,12 @@ public class AdjudicationServiceImpl implements IAdjudicationService { @Override public AjaxResult stamp(CaseApplication caseApplication) { + Integer caseStatus = caseApplicationMapper.selectCaseApplicationCaseStatus(caseApplication.getId()); //更改案件状态(暂时) caseApplication.setCaseStatus(CaseApplicationConstants.ARBITRATION_DELIVERY); caseApplicationMapper.submitCaseApplication(caseApplication); // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.ARBITRATION_DELIVERY, ""); + CaseLogUtils.insertCaseLog(caseApplication.getId(), caseStatus, ""); return AjaxResult.success("用印成功,案件状态已改为待裁决书送达"); } @@ -1552,13 +1559,14 @@ public class AdjudicationServiceImpl implements IAdjudicationService { List ids = caseApplications1.stream().map(CaseApplication::getId).collect(Collectors.toList()); try { for (Long id : ids) { + Integer currentStatus = caseApplicationMapper.selectCaseApplicationCaseStatus(id); CaseApplication caseApplication = new CaseApplication(); caseApplication.setId(id); //更改案件状态(暂时) caseApplication.setCaseStatus(CaseApplicationConstants.CASE_ARCHIVED); caseApplicationMapper.submitCaseApplication(caseApplication); // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CASE_ARCHIVED, ""); + CaseLogUtils.insertCaseLog(caseApplication.getId(), currentStatus, ""); } } catch (Exception e) { return AjaxResult.error(e.getMessage()); @@ -1587,6 +1595,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService { if (caseApplication1 == null) { return AjaxResult.error("未查询到相关案件"); } + Integer currentCaseNode=caseApplication1.getCaseStatus(); List caseAttachList = caseAttachMapper.queryCaseAttachList(caseApplication1); if (caseAttachList != null && caseAttachList.size() > 0) { @@ -1767,7 +1776,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService { } // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication1.getId(), CaseApplicationConstants.CASE_FILING, ""); + CaseLogUtils.insertCaseLog(caseApplication1.getId(), currentCaseNode, ""); } @@ -1902,7 +1911,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService { // 保存裁决书附件 saveArbitorFile(req.getId(), saveName, savePath, caseApplicationById, arbitrateRecordSelect,null); - return AjaxResult.success("裁决书已生成"); + return AjaxResult.success(); } @Transactional @@ -1911,10 +1920,14 @@ public class AdjudicationServiceImpl implements IAdjudicationService { if (id == null || caseStatus == null) { return AjaxResult.error("参数校验失败"); } + Integer currentStatus = caseApplicationMapper.selectCaseApplicationCaseStatus(id); CaseApplication caseApplication = new CaseApplication(); caseApplication.setId(id); caseApplication.setCaseStatus(caseStatus); + caseApplicationMapper.submitCaseApplication(caseApplication); + // 新增日志 + insertCaseLog(id,currentStatus , ""); return AjaxResult.success(); } @@ -1971,7 +1984,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService { xwpfDocument = new XWPFDocument(fileInputStream); log.error("xwpfDocument====" + xwpfDocument); } catch (IOException e) { - e.printStackTrace(); + throw new ServiceException("系统找不到指定的文件。"); } if (xwpfDocument == null) { return new ArrayList<>(); 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 1ecc523..42cbad5 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 @@ -1,6 +1,7 @@ package com.ruoyi.wisdomarbitrate.service.impl; +import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.util.StrUtil; import com.alibaba.fastjson.JSONArray; @@ -11,6 +12,7 @@ import com.google.gson.JsonObject; import com.ruoyi.common.annotation.DataScope; import com.ruoyi.common.constant.CaseApplicationConstants; +import com.ruoyi.common.constant.Constants; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.entity.*; import com.ruoyi.common.core.domain.model.LoginUser; @@ -29,6 +31,7 @@ import com.ruoyi.wisdomarbitrate.domain.vo.ToDoCount; import com.ruoyi.wisdomarbitrate.domain.*; import com.ruoyi.wisdomarbitrate.domain.vo.SendRoomNoMessageVO; import com.ruoyi.wisdomarbitrate.mapper.*; +import com.ruoyi.wisdomarbitrate.service.IAdjudicationService; import com.ruoyi.wisdomarbitrate.service.ICaseApplicationService; import com.ruoyi.wisdomarbitrate.utils.SignAward; import com.ruoyi.wisdomarbitrate.utils.UnZipFileUtils; @@ -124,6 +127,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { @Autowired private CaseZipImportImpl caseZipImportImpl; + @Autowired + IAdjudicationService adjudicationService; // 手机号正则 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}$"); // 邮箱正则 @@ -407,6 +412,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { } // 查看所有权限 if("超级管理员".equals(role.getRoleName())){ + caseApplication.setIsOtherRole(1); caseApplications = caseApplicationMapper.list(caseApplication,caseStatusList,null); setArbitorMethod(caseApplications); return caseApplications; @@ -425,20 +431,24 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { caseStatusList.add(9); } if("仲裁员".equals(role.getRoleName())){ + caseApplication.setIsOtherRole(1); Integer[] array = {7,8,9,13,18}; caseStatusList.addAll(Arrays.asList(array)); caseApplication.setArbitratorId(String.valueOf(sysUser.getUserId())); } if ("仲裁委".equals(role.getRoleName()) || "部门长".equals(role.getRoleName())) { + caseApplication.setIsOtherRole(1); // 组庭确定,部门长审核裁决书 caseStatusList.add(CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL); caseStatusList.add(CaseApplicationConstants.CHECK_ARBITRATION); } if ("财务".equals(role.getRoleName())) { + caseApplication.setIsOtherRole(1); caseStatusList.add(CaseApplicationConstants.PENDING_PAYMENT_CONFIRM); } if ("法律顾问".equals(role.getRoleName()) || "秘书".equals(role.getRoleName()) ) { + caseApplication.setIsOtherRole(1); Integer[] array = {1,5,8,9,11,14,15,16,31}; caseStatusList.addAll(Arrays.asList(array)); } @@ -497,79 +507,6 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { @Override public ToDoCount selectToDoCount() { - -// // 获取登录用户 -// LoginUser loginUser = getLoginUser(); -// SysUser user = loginUser.getUser(); -// Long userId = user.getUserId(); -// -// // 查询登录人信息 -// SysUser sysUser = sysUserMapper.selectUserById(userId); -// List roles = sysUser.getRoles(); -// // 没有角色不能查看案件列表 -// if (CollectionUtil.isEmpty(roles)) { -// throw new ServiceException("该用户没有角色权限"); -// } -// 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 ("仲裁委".equals(role.getRoleName()) -// || "部门长".equals(role.getRoleName())) { -// caseApplication.setIsOtherRole(1); -// caseStatusList.add(CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL); -// caseStatusList.add(CaseApplicationConstants.CHECK_ARBITRATION); -// // caseStatusList.add(CaseApplicationConstants.ARBITRATED_SEAL); -// caseApplication.setDeptHeadStatus(caseStatusList); -// } -// if ("仲裁员".equals(role.getRoleName())) { -// caseApplication.setIsOtherRole(1); -// caseApplication.setUserId(String.valueOf(userId)); -// } -// if ("财务".equals(role.getRoleName())) { -// caseApplication.setIsOtherRole(1); -// caseApplication.setFinanceStatus(CaseApplicationConstants.PENDING_PAYMENT_CONFIRM); -// } -// if ("法律顾问".equals(role.getRoleName())) { -// // 查询角色有关的用户部门 -// // List deptIds = sysDeptMapper.selectUserDeptListByRoleId(role.getRoleId()); -// List deptIds = new ArrayList<>(); -// deptIds.add(sysUser.getDeptId()); -// caseApplication.setDeptIds(deptIds); -// } -// if ("申请人".equals(role.getRoleName())) { -// caseApplication.setIsOtherRole(1); -// // 查询角色有关的用户部门 -// caseApplication.setApplicationOrganId(String.valueOf(sysUser.getDeptId())); -// } -// if ("被申请人".equals(role.getRoleName())) { -// caseApplication.setIsOtherRole(1); -// // -// caseApplication.setIdCard(String.valueOf(sysUser.getIdCard())); -// } -// if ("代理人".equals(role.getRoleName())) { -// caseApplication.setIsOtherRole(1); -// // 查询角色有关的用户部门 -// // List agentDeptIds = sysDeptMapper.selectUserDeptListByRoleId(role.getRoleId()); -// List agentDeptIds = new ArrayList<>(); -// agentDeptIds.add(sysUser.getDeptId()); -// caseApplication.setAgentDeptIds(agentDeptIds); -// } -// } -// -// -// // 根据条件查询申请人,被申请人,仲裁员,法律顾问案件 -// ToDoCount toDoCount = caseApplicationMapper.selectTodoCountByRole(caseApplication); -// if (toDoCount == null) { -// return new ToDoCount(); -// } LoginUser loginUser = getLoginUser(); SysUser user = loginUser.getUser(); Long userId = user.getUserId(); @@ -595,6 +532,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { } // 查看所有权限 if("超级管理员".equals(role.getRoleName())){ + caseApplication.setIsOtherRole(1); toDoCount = caseApplicationMapper.selectTodoCountByRole(caseApplication,caseStatusList,null); if(toDoCount==null){ toDoCount=new ToDoCount(); @@ -616,20 +554,24 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { caseStatusList.add(9); } if("仲裁员".equals(role.getRoleName())){ + caseApplication.setIsOtherRole(1); Integer[] array = {7,8,9,13,18}; caseStatusList.addAll(Arrays.asList(array)); caseApplication.setArbitratorId(String.valueOf(sysUser.getUserId())); } if ("仲裁委".equals(role.getRoleName()) || "部门长".equals(role.getRoleName())) { + caseApplication.setIsOtherRole(1); // 组庭确定,部门长审核裁决书 caseStatusList.add(CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL); caseStatusList.add(CaseApplicationConstants.CHECK_ARBITRATION); } if ("财务".equals(role.getRoleName())) { + caseApplication.setIsOtherRole(1); caseStatusList.add(CaseApplicationConstants.PENDING_PAYMENT_CONFIRM); } if ("法律顾问".equals(role.getRoleName()) || "秘书".equals(role.getRoleName()) ) { + caseApplication.setIsOtherRole(1); Integer[] array = {1,5,8,9,11,14,15,16,31}; caseStatusList.addAll(Arrays.asList(array)); } @@ -647,26 +589,68 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { Long id = caseApplication.getId(); CaseLogRecord caseLogRecord = new CaseLogRecord(); caseLogRecord.setCaseAppliId(id); - List records = caseLogRecordMapper.selectCaseLogRecordList(caseLogRecord); CaseApplication caseApplicationselect = caseApplicationMapper.selectCaseApplication(caseApplication); // 当前案件节点 Integer caseStatus = caseApplicationselect.getCaseStatus(); - if (caseStatus.intValue() != 0) { - CaseLogRecord caseLogRecordin = getInCasenode(caseStatus); - records.add(caseLogRecordin); + List allCaseNode= getAllCaseNode(caseApplicationselect.getArbitratMethod()); + if(caseApplicationselect.getArbitratMethod()!=null){ + if(caseApplicationselect.getArbitratMethod().equals(1)) { + // 开庭审理 + allCaseNode.removeIf(record -> record.getCaseNode().equals(9)); + } + if(caseApplicationselect.getArbitratMethod().equals(2)) { + // 书面审理 + allCaseNode.removeIf(record -> record.getCaseNode().equals(8) || record.getCaseNode().equals(31)); + } } - - List recordsnofinish = getNofinishCasenode(caseStatus); - records.addAll(recordsnofinish); - datas.put("allCasenode", records); + datas.put("allCasenode", allCaseNode); datas.put("caseStatus", caseStatus); return success(datas); } + /** + * 获取所有案件节点 + * arbitratMethod : 1:开庭诉讼,2:书面诉讼 + * @return + */ + private List getAllCaseNode(Integer arbitratMethod) { + List allCaseNode = new ArrayList<>(); + allCaseNode.add(getLastNodeRecord(null, "立案申请", 0, "申请人将提交案件","下一节点角色:法律顾问")); + allCaseNode.add(getLastNodeRecord(null, "立案审查", 1, "法律顾问将立案审查","下一节点角色:申请人")); + allCaseNode.add(getLastNodeRecord(null, "缴费", 2, "申请人将缴费","下一节点角色:财务")); + allCaseNode.add(getLastNodeRecord(null, "缴费确认", 3, "财务将缴费确认","下一节点角色:被申请人")); + allCaseNode.add(getLastNodeRecord(null, "案件质证", 4, "被申请人将案件质证","下一节点角色:法律顾问")); + allCaseNode.add(getLastNodeRecord(null, "组庭审核", 5, "法律顾问将组庭审核","下一节点角色:部门长")); + allCaseNode.add(getLastNodeRecord(null, "组庭确定", 6, "部门长将组庭确定","下一节点角色:仲裁员")); + allCaseNode.add(getLastNodeRecord(null, "审核仲裁方式", 7, "仲裁员将审核仲裁方式","下一节点角色:法律顾问")); + if(arbitratMethod==null) { + allCaseNode.add(getLastNodeRecord(null, "修改开庭时间", 31, "法律顾问将修改开庭时间", "下一节点角色:法律顾问,仲裁员")); + allCaseNode.add(getLastNodeRecord(null, "开庭审理", 8, "法律顾问,仲裁员,申请人,被申请人将开庭审理", "下一节点角色:法律顾问")); + allCaseNode.add(getLastNodeRecord(null, "书面审理", 9, "仲裁员将书面审理", "下一节点角色:法律顾问")); + }else if(arbitratMethod.equals(1)){ + // 开庭 + allCaseNode.add(getLastNodeRecord(null, "修改开庭时间", 31, "法律顾问将修改开庭时间", "下一节点角色:法律顾问")); + allCaseNode.add(getLastNodeRecord(null, "开庭审理", 8, "法律顾问,仲裁员,申请人,被申请人将开庭审理", "下一节点角色:法律顾问")); + }else if(arbitratMethod.equals(2)){ + // 书面 + allCaseNode.add(getLastNodeRecord(null, "书面审理", 9, "仲裁员将书面审理", "下一节点角色:法律顾问")); + } + allCaseNode.add(getLastNodeRecord(null, "核验裁决书", 11, "法律顾问将核验裁决书","下一节点角色:仲裁员")); + allCaseNode.add(getLastNodeRecord(null, "仲裁员审核裁决书", 18, "仲裁员将审核裁决书","下一节点角色:部门长")); + allCaseNode.add(getLastNodeRecord(null, "部门长审核裁决书", 12, "部门长将审核裁决书","下一节点角色:仲裁员")); + allCaseNode.add(getLastNodeRecord(null, "裁决书签名", 13, "仲裁员将进行裁决书签名","下一节点角色:部门长")); + allCaseNode.add(getLastNodeRecord(null, "裁决书用印", 14, "部门长将进行裁决书用印","下一节点角色:法律顾问")); + allCaseNode.add(getLastNodeRecord(null, "裁决书送达", 15, "法律顾问将送达裁决书","下一节点角色:法律顾问")); + allCaseNode.add(getLastNodeRecord(null, "案件归档", 16, "法律顾问将进行案件归档","")); + allCaseNode.add(getLastNodeRecord(null, "案件已归档", 17, "","")); + return allCaseNode; + } + @Override @Transactional public int updateHeardate(CaseApplication caseApplication) { + Integer currentStatus = caseApplicationMapper.selectCaseApplicationCaseStatus(caseApplication.getId()); // caseApplication.setCaseStatus(CaseApplicationConstants.PENDING_OPENCOURT_HEAR); caseApplication.setCaseStatus(CaseApplicationConstants.PENDING_OPENCOURT_HEAR); caseApplication.setLockStatus(1); @@ -679,7 +663,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { // 发送开庭日期通知短信 sendHearDateMessage(caseApplication, request, "1975139"); // 新增日志 - insertCaseLog(caseApplication.getId(), CaseApplicationConstants.PENDING_OPENCOURT_HEAR, ""); + insertCaseLog(caseApplication.getId(), currentStatus, ""); return rows; } @@ -732,12 +716,9 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { if (allFilestr != null && allFilestr.size() > 0) { for (String filestr : allFilestr) { List allindex = new ArrayList<>(); -// int indexKey = filestr.indexOf("\\"); int indexKey = filestr.indexOf("/"); -// System.out.println("filestr:------------"+filestr); allindex.add(indexKey); while (indexKey != -1) { -// indexKey = filestr.indexOf("\\", indexKey + 1); indexKey = filestr.indexOf("/", indexKey + 1); allindex.add(indexKey); } @@ -888,242 +869,174 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { return smsRecordMapper.getSmsSendRecord(smsSendRecord); } - private List getNofinishCasenode(Integer caseStatus) { - CaseLogRecord caseLogRecord1 = new CaseLogRecord(); - caseLogRecord1.setCaseNodeName("立案审查"); - caseLogRecord1.setCaseNode(1); - caseLogRecord1.setContent("法律顾问将进行立案审查"); - CaseLogRecord caseLogRecord2 = new CaseLogRecord(); - caseLogRecord2.setCaseNode(2); - caseLogRecord2.setCaseNodeName("缴费"); - caseLogRecord2.setContent("申请人将进行缴费"); - CaseLogRecord caseLogRecord3 = new CaseLogRecord(); - caseLogRecord3.setCaseNode(3); - caseLogRecord3.setCaseNodeName("缴费确认"); - caseLogRecord3.setContent("财务将进行缴费确认"); - CaseLogRecord caseLogRecord4 = new CaseLogRecord(); - caseLogRecord4.setCaseNode(4); - caseLogRecord4.setCaseNodeName("案件质证"); - caseLogRecord4.setContent("被申请人将进行案件质证"); - CaseLogRecord caseLogRecord5 = new CaseLogRecord(); - caseLogRecord5.setCaseNode(5); - caseLogRecord5.setCaseNodeName("组庭审核"); - caseLogRecord5.setContent("法律顾问将进行组庭审核"); - CaseLogRecord caseLogRecord6 = new CaseLogRecord(); - caseLogRecord6.setCaseNode(6); - caseLogRecord6.setCaseNodeName("修改开庭时间"); - caseLogRecord6.setContent("部门长将修改开庭时间"); + /** + * 获取日志中该节点最新一条记录 + * @param caseNodeRecordMap 日志记录案件状态分组 + * @param caseNodeName 节点名称 + * @param caseNode 案件节点 + * @param content 内容 + * @return + */ + private CaseLogRecord getLastNodeRecord(Map> caseNodeRecordMap, String caseNodeName, int caseNode, String content,String nextRoleName) { + CaseLogRecord lastNodeRecord = new CaseLogRecord(); + if(caseNodeRecordMap!=null && caseNodeRecordMap.containsKey(caseNode)){ + // List nodeRecordList = caseNodeRecordMap.get(caseNode); + // 取出该节点最新一条数据 + // lastNodeRecord = nodeRecordList.get(nodeRecordList.size() - 1); - CaseLogRecord caseLogRecord7 = new CaseLogRecord(); - caseLogRecord6.setCaseNode(7); - caseLogRecord6.setCaseNodeName("组庭确定"); - caseLogRecord6.setContent("部门长将进行组庭确定"); - - CaseLogRecord caseLogRecord8 = new CaseLogRecord(); - caseLogRecord7.setCaseNode(8); - caseLogRecord7.setCaseNodeName("审核仲裁方式"); - caseLogRecord7.setContent("仲裁员将进行审核仲裁方式"); - CaseLogRecord caseLogRecord9 = new CaseLogRecord(); - caseLogRecord8.setCaseNode(9); - caseLogRecord8.setCaseNodeName("开庭审理"); - caseLogRecord8.setContent("仲裁员,申请人,被申请人,法律顾问将进行开庭审理"); - CaseLogRecord caseLogRecord11 = new CaseLogRecord(); - caseLogRecord9.setCaseNode(11); - caseLogRecord9.setCaseNodeName("书面审理"); - caseLogRecord9.setContent("仲裁员将进行书面审理"); - CaseLogRecord caseLogRecord12 = new CaseLogRecord(); - caseLogRecord11.setCaseNode(12); - caseLogRecord11.setCaseNodeName("核验裁决书"); - caseLogRecord11.setContent("法律顾问将进行核验裁决书"); - CaseLogRecord caseLogRecord13 = new CaseLogRecord(); - caseLogRecord12.setCaseNode(13); - caseLogRecord12.setCaseNodeName("确认裁决书"); - caseLogRecord12.setContent("仲裁员将进行确认裁决书"); - CaseLogRecord caseLogRecord14 = new CaseLogRecord(); - caseLogRecord13.setCaseNode(14); - caseLogRecord13.setCaseNodeName("裁决书签名"); - caseLogRecord13.setContent("仲裁员将进行裁决书签名"); - CaseLogRecord caseLogRecord15 = new CaseLogRecord(); - caseLogRecord14.setCaseNode(15); - caseLogRecord14.setCaseNodeName("裁决书用印"); - caseLogRecord14.setContent("部门长将进行裁决书用印"); - CaseLogRecord caseLogRecord16 = new CaseLogRecord(); - caseLogRecord15.setCaseNode(16); - caseLogRecord15.setCaseNodeName("裁决书送达"); - caseLogRecord15.setContent("法律顾问将进行裁决书送达"); - caseLogRecord16.setCaseNode(17); - caseLogRecord16.setCaseNodeName("案件归档"); - caseLogRecord16.setContent("法律顾问将进行案件归档"); - - - List caseLogRecords = new ArrayList<>(); - switch (caseStatus.toString()) { - case "0": - caseLogRecords.add(caseLogRecord1); - caseLogRecords.add(caseLogRecord2); - caseLogRecords.add(caseLogRecord3); - caseLogRecords.add(caseLogRecord4); - caseLogRecords.add(caseLogRecord5); - caseLogRecords.add(caseLogRecord6); - caseLogRecords.add(caseLogRecord7); - caseLogRecords.add(caseLogRecord8); - caseLogRecords.add(caseLogRecord9); - caseLogRecords.add(caseLogRecord11); - caseLogRecords.add(caseLogRecord12); - caseLogRecords.add(caseLogRecord13); - caseLogRecords.add(caseLogRecord14); - caseLogRecords.add(caseLogRecord15); - caseLogRecords.add(caseLogRecord16); - break; - case "1": - caseLogRecords.add(caseLogRecord2); - caseLogRecords.add(caseLogRecord3); - caseLogRecords.add(caseLogRecord4); - caseLogRecords.add(caseLogRecord5); - caseLogRecords.add(caseLogRecord6); - caseLogRecords.add(caseLogRecord7); - caseLogRecords.add(caseLogRecord8); - caseLogRecords.add(caseLogRecord9); - caseLogRecords.add(caseLogRecord11); - caseLogRecords.add(caseLogRecord12); - caseLogRecords.add(caseLogRecord13); - caseLogRecords.add(caseLogRecord14); - caseLogRecords.add(caseLogRecord15); - caseLogRecords.add(caseLogRecord16); - break; - case "2": - caseLogRecords.add(caseLogRecord3); - caseLogRecords.add(caseLogRecord4); - caseLogRecords.add(caseLogRecord5); - caseLogRecords.add(caseLogRecord6); - caseLogRecords.add(caseLogRecord7); - caseLogRecords.add(caseLogRecord8); - caseLogRecords.add(caseLogRecord9); - caseLogRecords.add(caseLogRecord11); - caseLogRecords.add(caseLogRecord12); - caseLogRecords.add(caseLogRecord13); - caseLogRecords.add(caseLogRecord14); - caseLogRecords.add(caseLogRecord15); - caseLogRecords.add(caseLogRecord16); - break; - case "3": - caseLogRecords.add(caseLogRecord4); - caseLogRecords.add(caseLogRecord5); - caseLogRecords.add(caseLogRecord6); - caseLogRecords.add(caseLogRecord7); - caseLogRecords.add(caseLogRecord8); - caseLogRecords.add(caseLogRecord9); - caseLogRecords.add(caseLogRecord11); - caseLogRecords.add(caseLogRecord12); - caseLogRecords.add(caseLogRecord13); - caseLogRecords.add(caseLogRecord14); - caseLogRecords.add(caseLogRecord15); - caseLogRecords.add(caseLogRecord16); - - break; - case "4": - caseLogRecords.add(caseLogRecord5); - caseLogRecords.add(caseLogRecord6); - caseLogRecords.add(caseLogRecord7); - caseLogRecords.add(caseLogRecord8); - caseLogRecords.add(caseLogRecord9); - caseLogRecords.add(caseLogRecord11); - caseLogRecords.add(caseLogRecord12); - caseLogRecords.add(caseLogRecord13); - caseLogRecords.add(caseLogRecord14); - caseLogRecords.add(caseLogRecord15); - caseLogRecords.add(caseLogRecord16); - - break; - case "5": - caseLogRecords.add(caseLogRecord6); - caseLogRecords.add(caseLogRecord7); - caseLogRecords.add(caseLogRecord8); - caseLogRecords.add(caseLogRecord9); - caseLogRecords.add(caseLogRecord11); - caseLogRecords.add(caseLogRecord12); - caseLogRecords.add(caseLogRecord13); - caseLogRecords.add(caseLogRecord14); - caseLogRecords.add(caseLogRecord15); - caseLogRecords.add(caseLogRecord16); - - break; - case "6": - caseLogRecords.add(caseLogRecord7); - caseLogRecords.add(caseLogRecord8); - caseLogRecords.add(caseLogRecord9); - caseLogRecords.add(caseLogRecord11); - caseLogRecords.add(caseLogRecord12); - caseLogRecords.add(caseLogRecord13); - caseLogRecords.add(caseLogRecord14); - caseLogRecords.add(caseLogRecord15); - caseLogRecords.add(caseLogRecord16); - - break; - case "7": - caseLogRecords.add(caseLogRecord8); - caseLogRecords.add(caseLogRecord9); - caseLogRecords.add(caseLogRecord11); - caseLogRecords.add(caseLogRecord12); - caseLogRecords.add(caseLogRecord13); - caseLogRecords.add(caseLogRecord14); - caseLogRecords.add(caseLogRecord15); - caseLogRecords.add(caseLogRecord16); - - break; - case "8": - case "9": - caseLogRecords.add(caseLogRecord11); - caseLogRecords.add(caseLogRecord12); - caseLogRecords.add(caseLogRecord13); - caseLogRecords.add(caseLogRecord14); - caseLogRecords.add(caseLogRecord15); - caseLogRecords.add(caseLogRecord16); - break; - - case "11": - caseLogRecords.add(caseLogRecord12); - caseLogRecords.add(caseLogRecord13); - caseLogRecords.add(caseLogRecord14); - caseLogRecords.add(caseLogRecord15); - caseLogRecords.add(caseLogRecord16); - - break; - case "12": - caseLogRecords.add(caseLogRecord13); - caseLogRecords.add(caseLogRecord14); - caseLogRecords.add(caseLogRecord15); - caseLogRecords.add(caseLogRecord16); - - break; - case "13": - caseLogRecords.add(caseLogRecord14); - caseLogRecords.add(caseLogRecord15); - caseLogRecords.add(caseLogRecord16); - - break; - case "14": - caseLogRecords.add(caseLogRecord15); - caseLogRecords.add(caseLogRecord16); - - break; - case "15": - caseLogRecords.add(caseLogRecord16); - - break; - default: - List caseLogRecords1 = new ArrayList<>(); } - - return caseLogRecords; - - + lastNodeRecord.setCaseNodeName(caseNodeName); + lastNodeRecord.setCaseNode(caseNode); + lastNodeRecord.setContent(content); + lastNodeRecord.setNextRoleName(nextRoleName); + return lastNodeRecord; } + /** + * 获取已完成节点流程 + * @param caseStatus 当前案件状态 + + * @return + */ private CaseLogRecord getInCasenode(Integer caseStatus) { CaseLogRecord caseLogRecord = new CaseLogRecord(); + switch (caseStatus.toString()) { + case "0": + caseLogRecord.setCaseNodeName("案件提交"); + caseLogRecord.setCaseNode(0); + caseLogRecord.setContent("申请人正在进行案件提交"); + caseLogRecord.setNextRoleName("下一节点角色:法律顾问"); + break; + case "1": + caseLogRecord.setCaseNodeName("立案审查"); + caseLogRecord.setCaseNode(1); + caseLogRecord.setContent("法律顾问正在进行立案审查"); + caseLogRecord.setNextRoleName("下一节点角色:申请人"); + break; + case "2": + caseLogRecord.setCaseNodeName("缴费"); + caseLogRecord.setCaseNode(2); + caseLogRecord.setContent("申请人正在进行缴费"); + caseLogRecord.setNextRoleName("下一节点角色:财务"); + break; + case "3": + caseLogRecord.setCaseNodeName("缴费确认"); + caseLogRecord.setCaseNode(3); + caseLogRecord.setContent("财务正在进行缴费确认"); + caseLogRecord.setNextRoleName("下一节点角色:被申请人"); + break; + case "4": + caseLogRecord.setCaseNodeName("案件质证"); + caseLogRecord.setCaseNode(4); + caseLogRecord.setContent("被申请人将进行案件质证"); + caseLogRecord.setNextRoleName("下一节点角色:法律顾问"); + break; + case "5": + caseLogRecord.setCaseNodeName("组庭审核"); + caseLogRecord.setCaseNode(5); + caseLogRecord.setContent("法律顾问正在进行组庭审核"); + caseLogRecord.setNextRoleName("下一节点角色:部门长"); + break; + case "6": + caseLogRecord.setCaseNodeName("组庭确定"); + caseLogRecord.setCaseNode(6); + caseLogRecord.setContent("部门长正在进行组庭确定"); + caseLogRecord.setNextRoleName("下一节点角色:法律顾问"); + break; + case "7": + caseLogRecord.setCaseNodeName("审核仲裁方式"); + caseLogRecord.setCaseNode(7); + caseLogRecord.setContent("仲裁员正在进行审核仲裁方式"); + caseLogRecord.setNextRoleName("下一节点角色:秘书顾问"); + break; + case "8": + caseLogRecord.setCaseNodeName("开庭审理"); + caseLogRecord.setCaseNode(8); + caseLogRecord.setContent("仲裁员正在进行开庭审理"); + caseLogRecord.setNextRoleName("下一节点角色:仲裁员"); + break; + case "9": + caseLogRecord.setCaseNodeName("书面审理"); + caseLogRecord.setCaseNode(9); + caseLogRecord.setContent("仲裁员正在进行书面审理"); + caseLogRecord.setNextRoleName("下一节点角色:仲裁员"); + break; + case "11": + caseLogRecord.setCaseNodeName("核验裁决书"); + caseLogRecord.setCaseNode(11); + caseLogRecord.setContent("法律顾问正在进行核验裁决书"); + caseLogRecord.setNextRoleName("下一节点角色:仲裁员"); + break; + case "18": + caseLogRecord.setCaseNodeName("仲裁员审核裁决书"); + caseLogRecord.setCaseNode(11); + caseLogRecord.setContent("仲裁员正在进行审核裁决书"); + caseLogRecord.setNextRoleName("下一节点角色:部门长"); + break; + case "12": + caseLogRecord.setCaseNodeName("确认裁决书"); + caseLogRecord.setCaseNode(18); + caseLogRecord.setContent("部门长正在进行确认裁决书"); + caseLogRecord.setNextRoleName("下一节点角色:仲裁员"); + break; + case "13": + caseLogRecord.setCaseNodeName("裁决书签名"); + caseLogRecord.setCaseNode(13); + caseLogRecord.setContent("仲裁员正在进行裁决书签名"); + caseLogRecord.setNextRoleName("下一节点角色:法律顾问"); + break; + case "14": + caseLogRecord.setCaseNodeName("裁决书用印"); + caseLogRecord.setCaseNode(14); + caseLogRecord.setContent("部门长正在进行裁决书用印"); + caseLogRecord.setNextRoleName("下一节点角色:法律顾问"); + break; + case "15": + caseLogRecord.setCaseNodeName("裁决书送达"); + caseLogRecord.setCaseNode(15); + caseLogRecord.setContent("法律顾问正在进行裁决书送达"); + caseLogRecord.setNextRoleName("下一节点角色:法律顾问"); + break; + case "16": + caseLogRecord.setCaseNodeName("案件归档"); + caseLogRecord.setCaseNode(16); + caseLogRecord.setContent("法律顾问正在进行案件归档"); + break; + case "17": + caseLogRecord.setCaseNodeName("案件已归档"); + caseLogRecord.setCaseNode(17); + caseLogRecord.setContent(""); + break; + case "31": + caseLogRecord.setCaseNodeName("修改开庭时间"); + caseLogRecord.setCaseNode(31); + caseLogRecord.setContent("顾问正在修改开庭时间"); + break; + default: + caseLogRecord.setCaseNodeName(""); + caseLogRecord.setContent(""); + + } + return caseLogRecord; + } + /** + * 获取节点流程 + * @param caseStatus 当前案件状态 + + * @return + */ + private CaseLogRecord getInCasenode1(Integer caseStatus) { + CaseLogRecord caseLogRecord = new CaseLogRecord(); + + switch (caseStatus.toString()) { + case "0": + caseLogRecord.setCaseNodeName("案件提交"); + caseLogRecord.setCaseNode(0); + caseLogRecord.setContent("申请人正在进行案件提交"); + caseLogRecord.setNextRoleName("下一节点角色:法律顾问"); + break; case "1": caseLogRecord.setCaseNodeName("立案审查"); caseLogRecord.setCaseNode(1); @@ -1213,6 +1126,11 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { caseLogRecord.setCaseNode(16); caseLogRecord.setContent("法律顾问正在进行案件归档"); break; + case "31": + caseLogRecord.setCaseNodeName("修改开庭时间"); + caseLogRecord.setCaseNode(31); + caseLogRecord.setContent("顾问正在修改开庭时间"); + break; default: caseLogRecord.setCaseNodeName(""); caseLogRecord.setContent(""); @@ -1220,7 +1138,6 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { } return caseLogRecord; } - @Override public List selectCaseApplicationList(CaseApplication caseApplication) { return caseApplicationMapper.selectAdminCaseApplicationList(caseApplication); @@ -1381,6 +1298,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { @Override @Transactional public int insertcaseApplication1(CaseApplication caseApplication) { + Integer currentStatus = caseApplicationMapper.selectCaseApplicationCaseStatus(caseApplication.getId()); caseApplication.setCaseStatus(CaseApplicationConstants.CASE_APPLICATION); //根据仲裁费用计费规则计算应缴费用 //暂时设置计费比率为0.01 @@ -1455,7 +1373,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { caseAttachMapper.batchSave(caseAttachList); } // 新增日志 - insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CASE_APPLICATION, ""); + insertCaseLog(caseApplication.getId(), currentStatus, ""); // 新增案件日志表 caseApplication.setCaseAppliId(caseApplication.getId()); @@ -1769,6 +1687,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { @Override @Transactional public int submitCaseApplication(List ids) { + int rows = 0; // 查询案件信息,做必填校验,校验不通过,提示,不能提交 StringBuilder errorMsg = new StringBuilder(); @@ -1780,6 +1699,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { // 转换为Map>形式 Map> caseAffiliateMap = caseAffiliates.stream().collect(Collectors.groupingBy(CaseAffiliate::getCaseAppliId)); for (Long id : ids) { + Integer currentStatus = caseApplicationMapper.selectCaseApplicationCaseStatus(id); // 必填校验 CaseApplication caseApplication = applicationMap.get(id); // 基本字段校验 @@ -1827,7 +1747,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { application.setCaseStatus(CaseApplicationConstants.CASE_CHECK); rows += caseApplicationMapper.submitCaseApplication(application); // 新增日志 - insertCaseLog(application.getId(), CaseApplicationConstants.CASE_CHECK, ""); + insertCaseLog(application.getId(), currentStatus, ""); } } return rows; @@ -1896,8 +1816,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { deptMap.put(String.valueOf(sysDept.getDeptId()), sysDept.getDeptName()); } } - StringBuffer applicantName = new StringBuffer(); - StringBuffer respondentName = new StringBuffer(); + StringBuilder applicantName = new StringBuilder(); + StringBuilder respondentName = new StringBuilder(); for (int i = 0; i < caseAffiliatListeselect.size(); i++) { CaseAffiliate caseAffiliateselect = caseAffiliatListeselect.get(i); int identityType = caseAffiliateselect.getIdentityType(); @@ -1905,14 +1825,14 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { if (StrUtil.isNotEmpty(caseAffiliateselect.getName()) && deptMap.containsKey(caseAffiliateselect.getName())) { caseAffiliateselect.setName(deptMap.get(caseAffiliateselect.getName())); } - applicantName.append(caseAffiliateselect.getName()).append(","); + applicantName.append(caseAffiliateselect.getName()).append(Constants.CN_SPLIT_COMMA); ; } else if (identityType == 2) { - respondentName.append(caseAffiliateselect.getName()).append(","); + respondentName.append(caseAffiliateselect.getName()).append(Constants.CN_SPLIT_COMMA); } } - caseApplicationselect.setApplicantName(applicantName.toString()); - caseApplicationselect.setRespondentName(respondentName.toString()); + caseApplicationselect.setApplicantName(removeLastComma(applicantName.toString(), Constants.CN_SPLIT_COMMA)); + caseApplicationselect.setRespondentName(removeLastComma(respondentName.toString(), Constants.CN_SPLIT_COMMA)); caseApplicationselect.setCaseAffiliates(caseAffiliatListeselect); caseApplicationselect.setArbitrateRecord(arbitrateRecordselect); if(arbitrateRecordselect!=null){ @@ -1924,7 +1844,21 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { } return caseApplicationselect; } - + /** + * 去除字符串末尾特殊字符 + * @param input 字符串 + * @param str 去除字符串末尾的特殊字符 + * @return + */ + public String removeLastComma(String input,String str) { + if(StrUtil.isEmpty(input)){ + return input; + } + if (input.endsWith(str)) { + return input.substring(0, input.length() - 1); + } + return input; // 如果没有末尾逗号,则直接返回原字符串 + } @Override @Transactional public String importCaseApplication(List caseApplicationList, String operName) { @@ -2073,45 +2007,39 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { @Override @Transactional public AjaxResult pendTralCheck(CaseApplication caseApplication) { - Integer isAgreePendTral = caseApplication.getIsAgreePendTral(); - caseApplication.setCaseStatus(CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL); - int rows = 0; + CaseApplication caseApplicationselect = caseApplicationMapper.selectCaseApplication(caseApplication); + if(caseApplicationselect==null){ + throw new ServiceException("案件不存在"); + } + Integer currentStatus = caseApplicationMapper.selectCaseApplicationCaseStatus(caseApplication.getId()); + for (Arbitrator arbitrator : caseApplication.getArbitrators()) { - CaseApplication caseApplicationselect = caseApplicationMapper.selectCaseApplication(caseApplication); - if(caseApplicationselect==null){ - throw new ServiceException("案件不存在"); + caseApplication.setCaseStatus(CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL); + + if(arbitrator.getId()==null || StrUtil.isEmpty(arbitrator.getArbitratorName())){ + return AjaxResult.warn("请选择仲裁员"); } + caseApplication.setArbitratorId(String.valueOf(arbitrator.getId())); + caseApplication.setArbitratorName(arbitrator.getArbitratorName()); caseApplication.setLockStatus(1); - rows = caseApplicationMapper.submitCaseApplication(caseApplication); - - // List arbitrators = caseApplication.getArbitrators(); - -// if( StringUtils.isEmpty(arbitratorId) && StringUtils.isEmpty(arbitratorName)){ -// List ids = arbitrators.stream().map(Arbitrator::getId).collect(Collectors.toList()); -// List arbitratorNames = arbitrators.stream().map(Arbitrator::getArbitratorName).collect(Collectors.toList()); -// String idstr = ids.stream().map(Object::toString).collect(Collectors.joining(",")); -// String arbitratorNamestr = arbitratorNames.stream().map(Object::toString).collect(Collectors.joining(",")); -// caseApplication.setArbitratorId(idstr); -// caseApplication.setArbitratorName(arbitratorNamestr); -// caseApplication.setLockStatus(1); -// rows = caseApplicationMapper.submitCaseApplication(caseApplication); -// } - + caseApplicationMapper.submitCaseApplication(caseApplication); + } // 新增日志 - insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL, ""); + insertCaseLog(caseApplication.getId(), currentStatus, ""); return success(); } @Override @Transactional public int verificationArbitrateRecord(CaseApplication caseApplication) { + Integer currentStatus = caseApplicationMapper.selectCaseApplicationCaseStatus(caseApplication.getId()); // 秘书核验裁决书,流转到待仲裁员审核裁决书 caseApplication.setCaseStatus(CaseApplicationConstants.HEAD_CHECK_ARBITRATION); int rows = caseApplicationMapper.submitCaseApplication(caseApplication); ArbitrateRecord arbitrateRecord = caseApplication.getArbitrateRecord(); arbitrateRecordMapper.updataArbitrateRecord(arbitrateRecord); // 新增日志 - insertCaseLog(caseApplication.getId(), CaseApplicationConstants.HEAD_CHECK_ARBITRATION, ""); + insertCaseLog(caseApplication.getId(), currentStatus, ""); return rows; } @@ -2125,6 +2053,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { @Transactional public AjaxResult checkArbitrateRecord(CaseApplication caseApplication) { int rows = 0; + Integer currentStatus = caseApplicationMapper.selectCaseApplicationCaseStatus(caseApplication.getId()); ArbitrateRecord arbitrateRecord = caseApplication.getArbitrateRecord(); arbitrateRecordMapper.updataArbitrateRecord(arbitrateRecord); Integer agreeOrNotCheck = caseApplication.getAgreeOrNotCheck(); @@ -2310,7 +2239,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { } caseApplication.setCaseStatus(CaseApplicationConstants.SIGN_ARBITRATION); // 新增日志 - insertCaseLog(caseApplication.getId(), CaseApplicationConstants.SIGN_ARBITRATION, ""); + insertCaseLog(caseApplication.getId(),currentStatus , ""); rows = caseApplicationMapper.submitCaseApplication(caseApplication); } else if (agreeOrNotCheck.intValue() == 2) {//拒绝审核 @@ -2320,7 +2249,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { notes="部门长驳回裁决书,驳回原因:"+caseApplication.getArbitrateRecord().getDeptorReject(); } // 新增日志 - insertCaseLog(caseApplication.getId(), CaseApplicationConstants.HEAD_CHECK_ARBITRATION, notes); + insertCaseLog(caseApplication.getId(),currentStatus , notes); rows = caseApplicationMapper.submitCaseApplication(caseApplication); } @@ -2336,6 +2265,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { @Override @Transactional public AjaxResult arbitratorCheckArbitrateRecord(CaseApplication caseApplication) { + Integer currentStatus = caseApplicationMapper.selectCaseApplicationCaseStatus(caseApplication.getId()); // 同意后状态改为待部门长审核裁决书(CHECK_ARBITRATION = 12),拒绝改为待秘书核验裁决书(VERPRIF_ARBITRATION = 11) int rows = 0; Integer agreeOrNotCheck = caseApplication.getAgreeOrNotCheck(); @@ -2344,7 +2274,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { rows = caseApplicationMapper.submitCaseApplication(caseApplication); // 新增日志 - insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CHECK_ARBITRATION, ""); + insertCaseLog(caseApplication.getId(), currentStatus, ""); } else if (agreeOrNotCheck.intValue() == 2) {//拒绝审核 ArbitrateRecord arbitrateRecord = caseApplication.getArbitrateRecord(); if(arbitrateRecord.getId()!=null){ @@ -2360,7 +2290,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { notes="仲裁员驳回裁决书,驳回原因:"+caseApplication.getArbitrateRecord().getArbitrateReject(); } // 新增日志 - insertCaseLog(caseApplication.getId(), CaseApplicationConstants.VERPRIF_ARBITRATION, notes); + insertCaseLog(caseApplication.getId(), currentStatus, notes); } return success(); } @@ -2373,6 +2303,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { //提交立案审查 int rows = 0; for (Long id : ids) { + Integer currentStatus = caseApplicationMapper.selectCaseApplicationCaseStatus(id); String notes=""; CaseApplication caseApplication = new CaseApplication(); caseApplication.setId(id); @@ -2381,13 +2312,13 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { caseApplication.setCaseStatus(CaseApplicationConstants.PENDING_PAYMENT); rows += caseApplicationMapper.submitCaseApplication(caseApplication); // 新增日志 - insertCaseLog(caseApplication.getId(), CaseApplicationConstants.PENDING_PAYMENT, notes); + insertCaseLog(caseApplication.getId(), currentStatus, notes); } else if (agreeOrNotCheck == 2) {//拒绝审核 notes="驳回立案申请,驳回原因:"+caseCheckReject; caseApplication.setCaseStatus(CaseApplicationConstants.CASE_APPLICATION); rows += caseApplicationMapper.submitCaseApplication(caseApplication); // 新增日志 - insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CASE_APPLICATION, notes); + insertCaseLog(caseApplication.getId(), currentStatus, notes); ArbitrateRecord arbitrateRecordsel = new ArbitrateRecord(); arbitrateRecordsel.setCaseAppliId(id); ArbitrateRecord arbitrateRecordnew = arbitrateRecordMapper.selectArbitrateRecord(arbitrateRecordsel); @@ -2599,187 +2530,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { return sealSignRecordReslt; } - @Override - @Transactional - public AjaxResult creatTrialRecord(ArbitrateRecord arbitrateRecordselect) { - //生成仲裁结果 - CaseApplication caseApplicationselect = new CaseApplication(); - caseApplicationselect.setId(arbitrateRecordselect.getCaseAppliId()); - CaseApplication caseApplication = caseApplicationMapper.selectCaseApplication(caseApplicationselect); - String createBy = caseApplication.getCreateBy(); - if (createBy != null) { - arbitrateRecordselect.setCreateBy(createBy); - } - // - CaseApplication caseApplicationupdate = new CaseApplication(); - caseApplicationupdate.setId(arbitrateRecordselect.getCaseAppliId()); - caseApplicationupdate.setIsAbsence(arbitrateRecordselect.getIsAbsence()); - caseApplicationupdate.setAppliIsAbsen(arbitrateRecordselect.getAppliIsAbsen()); - caseApplicationupdate.setRespondentOpinion(arbitrateRecordselect.getRespondentOpinion()); - caseApplicationupdate.setApplicantOpinion(arbitrateRecordselect.getApplicantOpinion()); - caseApplicationupdate.setCaseFacts(arbitrateRecordselect.getCaseFacts()); - caseApplicationupdate.setCaseFocus(arbitrateRecordselect.getCaseFocus()); - caseApplicationMapper.submitCaseApplication(caseApplicationupdate); - //先判断案件是否已经提交过仲裁结果 - ArbitrateRecord arbitrateRecordsele = arbitrateRecordMapper.selectArbitrateRecord(arbitrateRecordselect); - if (arbitrateRecordsele != null) { - int i = arbitrateRecordMapper.updataArbitrateRecord(arbitrateRecordselect); - if (i > 0) { - //案件日志表里添加数据 - CaseLogRecord caseLogRecord = new CaseLogRecord(); - caseLogRecord.setCaseAppliId(caseApplication.getId()); - caseLogRecord.setCaseNode(caseApplication.getCaseStatus()); - if (createBy != null) { - caseLogRecord.setCreateBy(createBy); - } - caseLogRecordMapper.insertCaseLogRecord(caseLogRecord); - - // 新增日志 - insertCaseLog(caseApplication.getId(), CaseApplicationConstants.GENERATED_ARBITRATION, ""); - - - } - } else { - //提交仲裁结果 - int i = arbitrateRecordMapper.insertArbitrateRecord(arbitrateRecordselect); - - if (i > 0) { - //案件日志表里添加数据 - CaseLogRecord caseLogRecord = new CaseLogRecord(); - caseLogRecord.setCaseAppliId(caseApplication.getId()); - caseLogRecord.setCaseNode(caseApplication.getCaseStatus()); - if (createBy != null) { - caseLogRecord.setCreateBy(createBy); - } - caseLogRecordMapper.insertCaseLogRecord(caseLogRecord); - - // 新增日志 - insertCaseLog(caseApplication.getId(), CaseApplicationConstants.GENERATED_ARBITRATION, ""); - - } - } - - //生成庭审笔录 - try { - Map datas = new HashMap<>(); - Long id = caseApplication.getId(); - if (id == null) { - return null; - } - - //获取仲裁记录表里的相关信息 - ArbitrateRecord arbitrateRecord = new ArbitrateRecord(); - arbitrateRecord.setCaseAppliId(id); - ArbitrateRecord arbitrateRecord1 = arbitrateRecordMapper.selectArbitrateRecord(arbitrateRecord); - - //获取案件关联人信息 - CaseAffiliate caseAffiliate = new CaseAffiliate(); - caseAffiliate.setCaseAppliId(id); - List caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate); - if (caseAffiliates != null && caseAffiliates.size() > 0) { - for (CaseAffiliate affiliate : caseAffiliates) { - //获取身份类型 - int identityType = affiliate.getIdentityType(); - if (identityType == 1) { //申请人 - datas.put("appName", affiliate.getName()); - datas.put("appIDNo", affiliate.getIdentityNum()); - datas.put("appAddress", affiliate.getContactAddress()); - datas.put("appAgentName", affiliate.getNameAgent()); - datas.put("appAgentIDNo", affiliate.getIdentityNumAgent()); - } else if (identityType == 2) { //被申请人 - datas.put("resName", affiliate.getName()); - datas.put("resIDNo", affiliate.getIdentityNum()); - datas.put("resAddress", affiliate.getContactAddress()); - datas.put("resAgentName", affiliate.getNameAgent()); - datas.put("resAgentIDNo", affiliate.getIdentityNumAgent()); - } - } - } - String arbitratorName = caseApplication.getArbitratorName(); - datas.put("caseName", caseApplication.getCaseName()); - datas.put("caseNum", caseApplication.getCaseNum()); - datas.put("arbitratorName", arbitratorName); - Date hearDate = caseApplication.getHearDate(); - if (hearDate != null) { - LocalDate localDate = hearDate.toInstant() - .atZone(ZoneId.systemDefault()) - .toLocalDate(); - datas.put("hearYear", localDate.getYear()); - datas.put("hearMonths", localDate.getMonthValue()); - datas.put("hearDay", localDate.getDayOfMonth()); - } else { - datas.put("hearYear", null); - datas.put("hearMonths", null); - datas.put("hearDay", null); - } - datas.put("appArbitrationClaims", caseApplication.getArbitratClaims()); - datas.put("evidenDetermi", "认定为申请人证据充足"); - datas.put("factDetermi", "被申请人欠款属实"); - datas.put("caseSketch", "申请人所求通过"); - datas.put("arbitrateThink", "被申请人应按约定还款"); - datas.put("rulingFollows", "被申请人依法偿还申请人欠款"); - datas.put("legalProvisions", "仲裁法"); - LocalDate now = LocalDate.now(); - String year = Integer.toString(now.getYear()); - String month = String.format("%02d", now.getMonthValue()); - String day = String.format("%02d", now.getDayOfMonth()); - datas.put("year", year); - datas.put("months", month); - datas.put("day", day); - String modalFilePath = "/data/arbitrate-document/template/仲裁裁决书模板.docx"; -// String modalFilePath = "D:/develop/仲裁裁决书模板 (2).docx"; - String saveFolderPath = "/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day; -// String saveFolderPath = "D:/data/" + now.getYear() + "/" + now.getMonthValue() + "/" + now.getDayOfMonth(); - String fileName = UUID.randomUUID().toString().replace("-", "") + ".docx"; - String saveName = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName; - String resultFilePath = saveFolderPath + "/" + fileName; - // 创建日期目录 - File saveFolder = new File(saveFolderPath); - if (!saveFolder.exists()) { - saveFolder.mkdirs(); - } - Path sourcePath = new File(modalFilePath).toPath(); - Path destinationPath = new File(resultFilePath).toPath(); - Files.copy(sourcePath, destinationPath, StandardCopyOption.REPLACE_EXISTING); - String docFilePath = WordUtil.getDocFilePath(datas, modalFilePath, resultFilePath); - String savePath = docFilePath.substring(0, docFilePath.indexOf("/upload/") + 8); - -// String savePath = saveFolderPath; -// saveName = fileName; - - caseApplication.setAnnexType(7); - List caseAttachs = caseAttachMapper.queryCaseAttachList(caseApplication); - if (caseAttachs != null && caseAttachs.size() > 0) { - CaseAttach caseAttach = CaseAttach.builder() - .caseAppliId(id) - .annexName(saveName) - .annexPath(savePath) - .annexType(7) - .build(); - int i = caseAttachMapper.updateCaseAttachBycaseid(caseAttach); - - } else { - //将庭审笔录保存到附件表里 - CaseAttach caseAttach = CaseAttach.builder() - .caseAppliId(id) - .annexName(saveName) - .annexPath(savePath) - .annexType(7) - .build(); - int i = caseAttachMapper.save(caseAttach); - - } - - //获取案件详细信息 - CaseApplication caseApplicationSelct = selectCaseApplication(caseApplication); - return success(caseApplicationSelct); - } catch (IOException e) { - e.printStackTrace(); - return AjaxResult.error("生成庭审笔录异常"); - } - - } @Override @Transactional @@ -2800,7 +2551,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { //提交仲裁结果 int i = arbitrateRecordMapper.insertArbitrateRecord(arbitrateRecordselect); } - return success(); + // 生成裁决书 + return adjudicationService.caseJudgment(caseApplicationupdate); } @@ -3045,6 +2797,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { @Override @Transactional public int submitCaseApplicationBatch(String batchNumber) { + int rows = 0; CaseApplication caseApplicationsel = new CaseApplication(); caseApplicationsel.setBatchNumber(Integer.parseInt(batchNumber)); @@ -3057,6 +2810,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { // 转换为Map>形式 Map> caseAffiliateMap = caseAffiliates.stream().collect(Collectors.groupingBy(CaseAffiliate::getCaseAppliId)); for (Long id : ids) { + Integer currentStatus = caseApplicationMapper.selectCaseApplicationCaseStatus(id); // 查询案件信息,做必填校验,校验不通过,提示,不能提交 StringBuilder errorMsg = new StringBuilder(); // 必填校验 @@ -3106,7 +2860,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { application.setCaseStatus(CaseApplicationConstants.CASE_CHECK); rows += caseApplicationMapper.submitCaseApplication(application); // 新增日志 - insertCaseLog(application.getId(), CaseApplicationConstants.CASE_CHECK, ""); + insertCaseLog(application.getId(),currentStatus , ""); } }else{ @@ -3127,6 +2881,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { List ids = caseApplications.stream().map(CaseApplication::getId).collect(Collectors.toList()); if(caseApplications!=null&&caseApplications.size()>0){ for (Long id : ids) { + Integer currentStatus = caseApplicationMapper.selectCaseApplicationCaseStatus(id); String notes=""; CaseApplication caseApplication = new CaseApplication(); caseApplication.setId(id); @@ -3136,14 +2891,14 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { caseApplication.setCaseStatus(CaseApplicationConstants.PENDING_PAYMENT); rows += caseApplicationMapper.submitCaseApplication(caseApplication); // 新增日志 - insertCaseLog(caseApplication.getId(), CaseApplicationConstants.PENDING_PAYMENT, notes); + insertCaseLog(caseApplication.getId(), currentStatus, notes); } else if (agreeOrNotCheck == 2) { //拒绝审核 notes="驳回立案申请,驳回原因:"+caseCheckReject; caseApplication.setCaseStatus(CaseApplicationConstants.CASE_APPLICATION); rows += caseApplicationMapper.submitCaseApplication(caseApplication); // 新增日志 - insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CASE_APPLICATION, notes); + insertCaseLog(caseApplication.getId(), currentStatus, notes); ArbitrateRecord arbitrateRecordsel = new ArbitrateRecord(); arbitrateRecordsel.setCaseAppliId(id); ArbitrateRecord arbitrateRecordnew = arbitrateRecordMapper.selectArbitrateRecord(arbitrateRecordsel); @@ -3226,6 +2981,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { List caseApplications1 = caseApplicationMapper.listCaseApplicationByBatchNumber(caseApplication1); if (caseApplications1 != null && caseApplications1.size() > 0) { for(CaseApplication caseApplicationse:caseApplications1){ + Integer currentStatus = caseApplicationMapper.selectCaseApplicationCaseStatus(caseApplicationse.getId()); //同意组庭 if (isAgreePendTral != null && isAgreePendTral == 1) { @@ -3257,7 +3013,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { } } // 新增日志 - insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL, ""); + insertCaseLog(caseApplication.getId(), currentStatus, ""); } }else{ @@ -3277,6 +3033,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { List caseApplications = caseApplicationMapper.listCaseApplicationByBatchNumber(caseApplication1); if (caseApplications != null && caseApplications.size() > 0) { for(CaseApplication caseApplicationse:caseApplications){ + Integer currentStatus = caseApplicationMapper.selectCaseApplicationCaseStatus(caseApplicationse.getId()); caseApplicationse.setCaseStatus(CaseApplicationConstants.CHECK_ARBITRATION_METHOD); caseApplicationse.setIsAgreePendTral(isAgreePendTral); if (isAgreePendTral != null && isAgreePendTral == 1) { @@ -3299,7 +3056,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { request.setTemplateId("2033619"); sendHearDateMessage(caseApplicationse, request, "2033619"); // 新增日志 - insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CHECK_ARBITRATION_METHOD, ""); + insertCaseLog(caseApplication.getId(),currentStatus , ""); } }else{ @@ -3318,13 +3075,14 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { int rows = 0; if (caseApplications != null && caseApplications.size() > 0) { for(CaseApplication caseApplicationse:caseApplications){ + Integer currentStatus = caseApplicationMapper.selectCaseApplicationCaseStatus(caseApplicationse.getId()); // 秘书核验裁决书,流转到待仲裁员审核裁决书 caseApplicationse.setCaseStatus(CaseApplicationConstants.HEAD_CHECK_ARBITRATION); rows += caseApplicationMapper.submitCaseApplication(caseApplicationse); // ArbitrateRecord arbitrateRecord = caseApplication.getArbitrateRecord(); // arbitrateRecordMapper.updataArbitrateRecord(arbitrateRecord); // 新增日志 - insertCaseLog(caseApplicationse.getId(), CaseApplicationConstants.HEAD_CHECK_ARBITRATION, ""); + insertCaseLog(caseApplicationse.getId(), currentStatus, ""); } }else{ throw new ServiceException("这个批号没有批量核验裁决书的案件"); @@ -3345,12 +3103,13 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { List caseApplications1 = caseApplicationMapper.listCaseApplicationByBatchNumber(caseApplicationsel); if (caseApplications1 != null && caseApplications1.size() > 0) { for(CaseApplication caseApplicationse:caseApplications1){ + Integer currentStatus = caseApplicationMapper.selectCaseApplicationCaseStatus(caseApplicationse.getId()); if (agreeOrNotCheck.intValue() == 1) { caseApplicationse.setCaseStatus(CaseApplicationConstants.CHECK_ARBITRATION); rows += caseApplicationMapper.submitCaseApplication(caseApplicationse); // 新增日志 - insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CHECK_ARBITRATION, ""); + insertCaseLog(caseApplication.getId(),currentStatus, ""); } else if (agreeOrNotCheck.intValue() == 2) {//拒绝审核 ArbitrateRecord arbitrateRecord = caseApplication.getArbitrateRecord(); @@ -3374,7 +3133,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { notes="仲裁员驳回裁决书,驳回原因:"+caseApplication.getArbitrateRecord().getArbitrateReject(); } // 新增日志 - insertCaseLog(caseApplication.getId(), CaseApplicationConstants.VERPRIF_ARBITRATION, notes); + insertCaseLog(caseApplication.getId(), currentStatus, notes); } } @@ -3396,6 +3155,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { List caseApplications1 = caseApplicationMapper.listCaseApplicationByBatchNumber(caseApplicationsel); if (caseApplications1 != null && caseApplications1.size() > 0) { for(CaseApplication caseApplicationse:caseApplications1){ + Integer currentStatus = caseApplicationMapper.selectCaseApplicationCaseStatus(caseApplicationse.getId()); if (agreeOrNotCheck.intValue() == 1) { try { //获取当前案件的裁决书 @@ -3578,7 +3338,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { } caseApplicationse.setCaseStatus(CaseApplicationConstants.SIGN_ARBITRATION); // 新增日志 - insertCaseLog(caseApplicationse.getId(), CaseApplicationConstants.SIGN_ARBITRATION, ""); + insertCaseLog(caseApplicationse.getId(),currentStatus, ""); rows += caseApplicationMapper.submitCaseApplication(caseApplicationse); } else if (agreeOrNotCheck.intValue() == 2) { caseApplicationse.setCaseStatus(CaseApplicationConstants.HEAD_CHECK_ARBITRATION); @@ -3587,7 +3347,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { notes="部门长驳回裁决书,驳回原因:"+caseApplication.getArbitrateRecord().getDeptorReject(); } // 新增日志 - insertCaseLog(caseApplicationse.getId(), CaseApplicationConstants.HEAD_CHECK_ARBITRATION, notes); + insertCaseLog(caseApplicationse.getId(), currentStatus, notes); rows = caseApplicationMapper.submitCaseApplication(caseApplicationse); @@ -3714,7 +3474,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { @Transactional public int pendTralSure(CaseApplication caseApplication) { // caseApplication.setCaseStatus(CaseApplicationConstants.CHECK_ARBITRATION_METHOD); - + Integer currentStatus = caseApplicationMapper.selectCaseApplicationCaseStatus(caseApplication.getId()); caseApplication.setCaseStatus(CaseApplicationConstants.CHECK_ARBITRATION_METHOD); caseApplication.setLockStatus(1); Integer isAgreePendTral = caseApplication.getIsAgreePendTral(); @@ -3742,7 +3502,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { // 发送开庭日期通知短信 sendHearDateMessage(caseApplication, request, "2033619"); // 新增日志 - insertCaseLog(caseApplication.getId(), CaseApplicationConstants.MODIFY_HEARDATE, ""); + insertCaseLog(caseApplication.getId(), currentStatus, ""); return rows; diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseArbitrateServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseArbitrateServiceImpl.java index 499233f..fc4b082 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseArbitrateServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseArbitrateServiceImpl.java @@ -65,6 +65,7 @@ public class CaseArbitrateServiceImpl implements ICaseArbitrateService { if (caseApplication1 == null) { return AjaxResult.success(); } + Integer currentStatus = caseApplication1.getCaseStatus(); Integer arbitratMethodOriral = caseApplication.getArbitratMethod(); String caseNum = caseApplication1.getCaseNum(); @@ -76,14 +77,14 @@ public class CaseArbitrateServiceImpl implements ICaseArbitrateService { //修改案件状态为待修改开庭时间 // caseApplication1.setCaseStatus(CaseApplicationConstants.MODIFY_HEARDATE); // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.MODIFY_HEARDATE, ""); + CaseLogUtils.insertCaseLog(caseApplication.getId(), currentStatus, ""); } else { caseApplication1.setArbitratMethod(2); //修改案件状态为待书面审理 caseApplication1.setCaseStatus(CaseApplicationConstants.PENDING_WRIITEN_HEAR); // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.PENDING_WRIITEN_HEAR, ""); + CaseLogUtils.insertCaseLog(caseApplication.getId(), currentStatus, ""); } } else if (opinion == 1 ) { @@ -92,16 +93,14 @@ public class CaseArbitrateServiceImpl implements ICaseArbitrateService { caseApplication1.setArbitratMethod(2); caseApplication1.setCaseStatus(CaseApplicationConstants.PENDING_WRIITEN_HEAR); // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.PENDING_WRIITEN_HEAR, ""); + CaseLogUtils.insertCaseLog(caseApplication.getId(), currentStatus, ""); } else { //修改案件状态为待修改开庭时间 caseApplication1.setArbitratMethod(1); caseApplication1.setCaseStatus(CaseApplicationConstants.MODIFY_HEARDATE); - //修改案件状态为待修改开庭时间 -// caseApplication1.setCaseStatus(CaseApplicationConstants.MODIFY_HEARDATE); // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.MODIFY_HEARDATE, ""); + CaseLogUtils.insertCaseLog(caseApplication.getId(),currentStatus, ""); } }else if (opinion == 2) { @@ -110,16 +109,14 @@ public class CaseArbitrateServiceImpl implements ICaseArbitrateService { caseApplication1.setArbitratMethod(2); caseApplication1.setCaseStatus(CaseApplicationConstants.PENDING_WRIITEN_HEAR); // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.PENDING_WRIITEN_HEAR, ""); + CaseLogUtils.insertCaseLog(caseApplication.getId(), currentStatus, ""); } else { //修改案件状态为待修改开庭时间 caseApplication1.setArbitratMethod(1); caseApplication1.setCaseStatus(CaseApplicationConstants.MODIFY_HEARDATE); - //修改案件状态为待修改开庭时间 -// caseApplication1.setCaseStatus(CaseApplicationConstants.MODIFY_HEARDATE); // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.MODIFY_HEARDATE, ""); + CaseLogUtils.insertCaseLog(caseApplication.getId(), currentStatus, ""); } } @@ -174,20 +171,21 @@ public class CaseArbitrateServiceImpl implements ICaseArbitrateService { List caseApplications1 = caseApplicationMapper.listCaseApplicationByBatchNumber(caseApplicationsel); if (caseApplications1 != null && caseApplications1.size() > 0) { for(CaseApplication caseApplicationse:caseApplications1){ + Integer currentStatus = caseApplicationMapper.selectCaseApplicationCaseStatus(caseApplicationse.getId()); 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, ""); + CaseLogUtils.insertCaseLog(caseApplication.getId(), currentStatus, ""); }else if (arbitratMethod == 2) { //修改案件状态为待书面审理 caseApplicationse.setArbitratMethod(2); caseApplicationse.setCaseStatus(CaseApplicationConstants.PENDING_WRIITEN_HEAR); // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.PENDING_WRIITEN_HEAR, ""); + CaseLogUtils.insertCaseLog(caseApplication.getId(), currentStatus, ""); } int i = caseApplicationMapper.submitCaseApplication(caseApplicationse); @@ -255,13 +253,8 @@ public class CaseArbitrateServiceImpl implements ICaseArbitrateService { 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, ""); + CaseLogUtils.insertCaseLog(caseApplication.getId(), caseApplication1.getCaseStatus(), ""); // 生成裁决书 CaseApplication application = new CaseApplication(); @@ -297,28 +290,18 @@ public class CaseArbitrateServiceImpl implements ICaseArbitrateService { if (arbitrateRecord1 != null) { int i = arbitrateRecordMapper.updataArbitrateRecord(arbitrateRecord); if (i > 0) { - //案件日志表里添加数据 - CaseLogRecord caseLogRecord = new CaseLogRecord(); - caseLogRecord.setCaseAppliId(caseApplication1.getId()); - caseLogRecord.setCaseNode(caseApplication1.getCaseStatus()); - caseLogRecord.setCreateBy(getUsername()); - caseLogRecordMapper.insertCaseLogRecord(caseLogRecord); + // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.GENERATED_ARBITRATION, ""); + CaseLogUtils.insertCaseLog(caseApplication.getId(), caseApplication1.getCaseStatus(), ""); } } else { //提交仲裁结果 int i = arbitrateRecordMapper.insertArbitrateRecord(arbitrateRecord); if (i > 0) { - //案件日志表里添加数据 - CaseLogRecord caseLogRecord = new CaseLogRecord(); - caseLogRecord.setCaseAppliId(caseApplication1.getId()); - caseLogRecord.setCaseNode(caseApplication1.getCaseStatus()); - caseLogRecord.setCreateBy(getUsername()); - caseLogRecordMapper.insertCaseLogRecord(caseLogRecord); + // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.GENERATED_ARBITRATION, ""); + CaseLogUtils.insertCaseLog(caseApplication.getId(), caseApplication1.getCaseStatus(), ""); } } // 生成裁决书 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 b1694c6..aecff46 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 @@ -182,7 +182,7 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService { IdentityAuthentication authentication = new IdentityAuthentication(); LoginUser loginUser = SecurityUtils.getLoginUser(); // 查询该用户的角色 - // 查询登录人身份证号 + // 查询登录人手机号 SysUser sysUser = sysUserMapper.selectUserById(loginUser.getUserId()); String username = sysUser.getUserName(); List roles = sysUser.getRoles(); @@ -196,25 +196,27 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService { } } } - if(adMinFlag!=1) { - authentication.setUserName(username); - IdentityAuthentication authentication1 = identityAuthenticationMapper.selectIdentityAuthentication(authentication); - if (authentication1 != null) { - identityNum = authentication1.getIdentityNo(); - } - } - +// if(adMinFlag!=1) { +// authentication.setUserName(username); +// IdentityAuthentication authentication1 = identityAuthenticationMapper.selectIdentityAuthentication(authentication); +// if (authentication1 != null) { +// identityNum = authentication1.getIdentityNo(); +// } +// } + String phone=sysUser.getPhonenumber(); List caseStatusList = Arrays.asList(caseStatus); - return getCaseEvidenceVOList(identityNum, caseStatusList, 2); +// return getCaseEvidenceVOList(identityNum, caseStatusList, 2); + return getCaseEvidenceVOListByPhone(phone, caseStatusList, 2); } @Override public AjaxResult evidenceConfirmation(CaseApplication caseApplication) { + Integer currentStatus = caseApplicationMapper.selectCaseApplicationCaseStatus(caseApplication.getId()); caseApplication.setCaseStatus(CaseApplicationConstants.PENDING_TRIAL); int i = caseApplicationMapper.submitCaseApplication(caseApplication); if (i > 0) { // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.PENDING_TRIAL, ""); + CaseLogUtils.insertCaseLog(caseApplication.getId(),currentStatus, ""); return AjaxResult.success("证据确认成功"); } @@ -252,7 +254,7 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService { int i = caseApplicationMapper.submitCaseApplication(caseApplication1); if (i > 0) { // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL_SUBMMIT, ""); + CaseLogUtils.insertCaseLog(caseApplication.getId(), caseStatus, ""); return AjaxResult.success("提交成功"); } @@ -430,18 +432,8 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService { .userId(userId) .userName(username) .build(); - - CaseApplication caseApplicationsel = new CaseApplication(); - caseApplicationsel.setId(id); - caseApplicationsel.setAnnexType(7); - List caseAttachs = caseAttachMapper.queryCaseAttachList(caseApplicationsel); - if(caseAttachs!=null&&caseAttachs.size()>0){ - caseAttachMapper.deleteCaseAttachByCasedIdAndType(id,7); - int count = caseAttachMapper.save(caseAttach); - }else { - int count = caseAttachMapper.save(caseAttach); - } - + caseAttachMapper.deleteCaseAttachByCasedIdAndType(id,annexType); + int count = caseAttachMapper.save(caseAttach); return AjaxResult.success("上传成功"); } catch (IOException e) { e.printStackTrace(); @@ -488,7 +480,7 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService { } private List getCaseEvidenceVOList(String identityNum, List caseStatusList, Integer identityType) { - List caseListByRespondent = caseEvidenceMapper.getCaseListByRespondent(identityNum, caseStatusList, identityType); + List caseListByRespondent = caseEvidenceMapper.getCaseListByRespondent(identityNum, caseStatusList, identityType,null,SecurityUtils.getUsername()); // todo 返回房间号和开庭时间 if (caseListByRespondent != null && caseListByRespondent.size() > 0) { for (CaseEvidenceVO caseEvidenceVO : caseListByRespondent) { @@ -508,4 +500,25 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService { } return null; } + private List getCaseEvidenceVOListByPhone(String phone, List caseStatusList, Integer identityType) { + List caseListByRespondent = caseEvidenceMapper.getCaseListByRespondent(null, caseStatusList, identityType,phone,SecurityUtils.getUsername()); + // todo 返回房间号和开庭时间 + if (caseListByRespondent != null && caseListByRespondent.size() > 0) { + for (CaseEvidenceVO caseEvidenceVO : caseListByRespondent) { + //根据案件id查询姓名 + CaseAffiliate caseAffiliate = new CaseAffiliate(); + caseAffiliate.setCaseAppliId(caseEvidenceVO.getId()); + List caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate); + for (CaseAffiliate affiliate : caseAffiliates) { + if (affiliate.getIdentityType() == 1) { //申请人 + caseEvidenceVO.setApplicantName(affiliate.getName()); + } else { + caseEvidenceVO.setRespondentName(affiliate.getName()); + } + } + } + return caseListByRespondent; + } + return null; + } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseLogRecordServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseLogRecordServiceImpl.java index 78ff7f5..a4d0544 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseLogRecordServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseLogRecordServiceImpl.java @@ -4,12 +4,15 @@ import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.date.DatePattern; import cn.hutool.core.date.DateUtil; import cn.hutool.core.util.StrUtil; +import com.ruoyi.wisdomarbitrate.domain.CaseApplication; import com.ruoyi.wisdomarbitrate.domain.CaseLogRecord; +import com.ruoyi.wisdomarbitrate.mapper.CaseApplicationMapper; import com.ruoyi.wisdomarbitrate.mapper.CaseLogRecordMapper; import com.ruoyi.wisdomarbitrate.service.ICaseLogRecordService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.ArrayList; import java.util.List; import java.util.Optional; @@ -17,10 +20,13 @@ import java.util.Optional; public class CaseLogRecordServiceImpl implements ICaseLogRecordService { @Autowired private CaseLogRecordMapper caseLogRecordMapper; - + @Autowired + private CaseApplicationMapper applicationMapper; @Override public List selectCaseLogRecordList(CaseLogRecord caseLogRecord) { + CaseApplication caseApplicationReq = new CaseApplication(); + caseApplicationReq.setId(caseLogRecord.getCaseAppliId()); List records = caseLogRecordMapper.selectCaseLogRecordList(caseLogRecord); if(CollectionUtil.isNotEmpty(records)){ records.forEach(record->{ diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CasePaymentServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CasePaymentServiceImpl.java index b5e2939..71764bf 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CasePaymentServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CasePaymentServiceImpl.java @@ -118,6 +118,8 @@ public class CasePaymentServiceImpl implements ICasePaymentService { for (Long id : batchCaseApplication.getIds()) { CaseApplication caseApplication = new CaseApplication(); caseApplication.setId(id); + // 查询当前案件节点 + Integer currentStatus= caseApplicationMapper.selectCaseApplicationCaseStatus(id); if(batchCaseApplication.getAgreeOrNotCheck().equals(1)){ // 同意,更新案件状态为案件质证 caseApplication.setCaseStatus(CaseApplicationConstants.CASE_CROSSEXAMI); @@ -222,9 +224,9 @@ public class CasePaymentServiceImpl implements ICasePaymentService { casePaymentRecordMapper.update(casePaymentRecord); // 新增日志 if(batchCaseApplication.getAgreeOrNotCheck().equals(1)) { - CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CASE_CROSSEXAMI, ""); + CaseLogUtils.insertCaseLog(caseApplication.getId(), currentStatus, ""); }else { - CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.PENDING_PAYMENT, "拒绝原因:"+batchCaseApplication.getCaseCheckReject()); + CaseLogUtils.insertCaseLog(caseApplication.getId(), currentStatus, "拒绝原因:"+batchCaseApplication.getCaseCheckReject()); } } } @@ -247,6 +249,8 @@ public class CasePaymentServiceImpl implements ICasePaymentService { if (CollectionUtil.isNotEmpty(payDTO.getPayOrderList())) { for (CaseAttach caseAttach : payDTO.getPayOrderList()) { caseAttach.setCaseAppliId(caseId); + // 先删除该案件缴费凭证,类型为8,在新增 + caseAttachMapper.deleteCaseAttach(caseId,8,caseAttach.getAnnexId()); caseAttachMapper.updateCaseAttach(caseAttach); } } @@ -255,6 +259,7 @@ public class CasePaymentServiceImpl implements ICasePaymentService { CaseApplication caseApplication = new CaseApplication(); caseApplication.setId(caseId); CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication); + Integer currentStatus=caseApplication1.getCaseStatus(); caseApplication1.setCaseStatus(CaseApplicationConstants.PENDING_PAYMENT_CONFIRM); //修改案件状态 int i = caseApplicationMapper.submitCaseApplication(caseApplication1); @@ -266,7 +271,7 @@ public class CasePaymentServiceImpl implements ICasePaymentService { paymentRecord.setPaymentStatus(1); casePaymentRecordMapper.saveRecord(paymentRecord); // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.PENDING_PAYMENT_CONFIRM, ""); + CaseLogUtils.insertCaseLog(caseApplication.getId(), currentStatus ,""); } } @@ -399,6 +404,7 @@ public class CasePaymentServiceImpl implements ICasePaymentService { if (caseApplications != null && caseApplications.size() > 0) { List caseIds = caseApplications.stream().map(CaseApplication::getId).collect(Collectors.toList()); for (Long caseId : caseIds) { + Integer currentStatus = caseApplicationMapper.selectCaseApplicationCaseStatus(caseId); CaseApplication caseApplication = new CaseApplication(); caseApplication.setId(caseId); caseApplication.setCaseStatus(CaseApplicationConstants.CASE_CROSSEXAMI); @@ -475,7 +481,7 @@ public class CasePaymentServiceImpl implements ICasePaymentService { casePaymentRecord.setUpdateTime(new Date()); casePaymentRecordMapper.update(casePaymentRecord); // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CASE_CROSSEXAMI, ""); + CaseLogUtils.insertCaseLog(caseApplication.getId(), currentStatus, ""); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/MsSignSealServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/MsSignSealServiceImpl.java new file mode 100644 index 0000000..73a3e00 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/MsSignSealServiceImpl.java @@ -0,0 +1,268 @@ +package com.ruoyi.wisdomarbitrate.service.impl; + + +import com.alibaba.fastjson.JSONObject; +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonObject; +import com.ruoyi.common.constant.FileTransformation; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.domain.entity.EsignHttpResponse; +import com.ruoyi.common.exception.EsignDemoException; +import com.ruoyi.common.utils.EmailOutUtil; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.common.utils.file.SaaSAPIFileUtils; +import com.ruoyi.system.mapper.SysUserMapper; +import com.ruoyi.wisdomarbitrate.domain.*; +import com.ruoyi.wisdomarbitrate.mapper.*; +import com.ruoyi.wisdomarbitrate.service.MsSignSealService; +import com.ruoyi.wisdomarbitrate.utils.SignAward; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import java.io.File; +import java.io.IOException; +import java.time.LocalDate; +import java.util.*; +import static com.ruoyi.common.core.domain.AjaxResult.error; + + +@Slf4j +@Service +public class MsSignSealServiceImpl implements MsSignSealService { + + + @Autowired + private CaseApplicationMapper caseApplicationMapper; + @Autowired + private SealSignRecordMapper sealSignRecordMapper; + @Autowired + private CaseAttachMapper caseAttachMapper; + @Autowired + private DeptIdentifyMapper deptIdentifyMapper; + @Autowired + private SealManageMapper sealManageMapper; + @Autowired + private CaseLogRecordMapper caseLogRecordMapper; + + /** + * 签署流程回调,即签名用印回调 + * + * @param reqbodystr + * @return + * @throws EsignDemoException + * @throws IOException + */ + @Override + @Transactional(rollbackFor = Exception.class) + public AjaxResult signSeaalCaseApplicaCallback(String reqbodystr) throws EsignDemoException, IOException { + JSONObject jsonObjectCallback = JSONObject.parseObject(reqbodystr); + Gson gson = new Gson(); + if (jsonObjectCallback != null) { + log.info("签名回调======" + jsonObjectCallback); + int signResult = jsonObjectCallback.getIntValue("signResult"); + String action = jsonObjectCallback.getString("action"); + String signFlowId = jsonObjectCallback.getString("signFlowId"); + Long operateTime = jsonObjectCallback.getLongValue("operateTime"); + JSONObject operator = jsonObjectCallback.getJSONObject("operator"); + JSONObject psnAccount = operator.getJSONObject("psnAccount"); + String accountMobile = psnAccount.getString("accountMobile"); + + SealSignRecord sealSignRecordsel = sealSignRecordMapper.selectSealByFlowId(signFlowId); + if (sealSignRecordsel == null) { + return error("未找到签署流程"); + } + + String pensonAccount = sealSignRecordsel.getPensonAccount(); + String orgnNamePsnAcc = sealSignRecordsel.getOrgnizeNamePsnAccount(); + String pensonName = sealSignRecordsel.getPensonName(); + String orgnNamePsnName = sealSignRecordsel.getOrgnizeNamepsnName(); + Date dateOperate = new Date(operateTime); + Long caseAppliId = sealSignRecordsel.getCaseAppliId(); + CaseApplication req = new CaseApplication(); + req.setId(caseAppliId); + + if ("SIGN_MISSON_COMPLETE".equals(action) && signResult == 2) { + if (StringUtils.isNotEmpty(accountMobile) && accountMobile.equals(pensonAccount)) { + //申请人签名 + sealSignRecordsel.setSignStatusArbitor(1); + sealSignRecordMapper.updataSealSignRecord(sealSignRecordsel); + CaseLogRecord operLog = new CaseLogRecord(); + operLog.setCreateNickName(pensonName); + operLog.setCaseAppliId(caseAppliId); + operLog.setCaseNode(13); + operLog.setCreateTime(dateOperate); + caseLogRecordMapper.insertCaseLogRecord(operLog); + + CaseApplication application = new CaseApplication(); + application.setId(caseAppliId); + // 修改状态为待用印 + application.setCaseStatus(14); + caseApplicationMapper.updataCaseApplication(application); + + + } else if (StringUtils.isNotEmpty(accountMobile) && accountMobile.equals(orgnNamePsnAcc)) { + //用印 + sealSignRecordsel.setSealStatus(1); + + sealSignRecordMapper.updataSealSignRecord(sealSignRecordsel); + CaseLogRecord operLog = new CaseLogRecord(); + operLog.setCreateNickName(orgnNamePsnName); + operLog.setCaseNode(14); + operLog.setCaseAppliId(caseAppliId); + operLog.setCreateTime(dateOperate); + caseLogRecordMapper.insertCaseLogRecord(operLog); + CaseApplication application = new CaseApplication(); + application.setId(caseAppliId); + // 案件状态为待送达 + application.setCaseStatus(15); + caseApplicationMapper.updataCaseApplication(application); + //下载审核完成的裁决书, + 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(); + ///修改"签署用印记录表"的状态为完成 + sealSignRecordsel.setSignFlowStatus(3); + sealSignRecordsel.setFileDownloadUrl(fileDownloadUrl.substring(1, fileDownloadUrl.length() - 1)); + sealSignRecordMapper.updataSealSignRecord(sealSignRecordsel); + + String filearbitraUrl = fileDownloadUrl.substring(1, fileDownloadUrl.length() - 1); + application.setFilearbitraUrl(filearbitraUrl); + caseApplicationMapper.submitCaseApplication(application); + + 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(); + } + + String fileDownloadUrlnew = fileDownloadUrl.substring(1, fileDownloadUrl.length() - 1); + boolean downLoadFile = FileTransformation.downLoadFileByUrl(fileDownloadUrlnew, resultFilePath); + if (downLoadFile) { + CaseAttach caseAttach = new CaseAttach(); + caseAttach.setCaseAppliId(caseAppliId); + caseAttach.setAnnexType(3); + caseAttach.setAnnexPath(savePath); + caseAttach.setAnnexName(saveName); + caseAttachMapper.updateCaseAttachBycaseid(caseAttach); + } + + } + + + } + + } + + } else { + return AjaxResult.error("error"); + } + return AjaxResult.success("success"); + } + + + + + @Override + @Transactional(rollbackFor = Exception.class) + public AjaxResult sealCheckCallback(String reqbodystr) throws EsignDemoException, IOException { + JSONObject jsonObjectCallback = JSONObject.parseObject(reqbodystr); + Gson gson = new Gson(); + if (jsonObjectCallback != null) { + int auditStatus = jsonObjectCallback.getIntValue("auditStatus"); + String action = jsonObjectCallback.getString("action"); + String orgId = jsonObjectCallback.getString("orgId"); + String sealId = jsonObjectCallback.getString("sealId"); + + SealManage sealManage = new SealManage(); + DeptIdentify deptIdentify1 = new DeptIdentify(); + deptIdentify1.setOrgId(orgId); + List deptIdentifies = deptIdentifyMapper.selectDeptIdentify(deptIdentify1); + if (deptIdentifies != null && deptIdentifies.size() > 0) { + Long iddeptIdent = deptIdentifies.get(0).getId(); + SealManage sealManageSel = new SealManage(); + sealManageSel.setIdentifyId(iddeptIdent); + sealManageSel.setSealId(sealId); + List sealIdList = new ArrayList<>(); + List selectSealList = sealManageMapper.selectSealList(sealManageSel); + if (selectSealList != null && selectSealList.size() > 0) { + sealManage = selectSealList.get(0); + } + } + + if ("SEAL_AUDIT".equals(action) && auditStatus == 1) { + EsignHttpResponse response = SignAward.getOrgSeal(orgId, sealId); + JSONObject jsonObject = JSONObject.parseObject(response.getBody()); + int code = jsonObject.getIntValue("code"); + if (code == 0) { + JSONObject data = jsonObject.getJSONObject("data"); + int sealStatus = data.getIntValue("sealStatus"); + if (sealStatus == 1) {//印章状态 1已启用,2待审核,3审核不通过,4 挂起 + //已启用证明审核通过,下载到数据库 + String sealImageDownloadUrl = data.getString("sealImageDownloadUrl"); + 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("-", "") + ".jpg"; + 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(sealImageDownloadUrl, resultFilePath); + if (downLoadFile) { + CaseAttach caseAttach = new CaseAttach(); + caseAttach.setAnnexType(10); //10代表印章图片 + caseAttach.setAnnexPath(savePath); + caseAttach.setAnnexName(saveName); + int i1 = caseAttachMapper.save(caseAttach); + if (i1 > 0) { + //将附件id保存到公章管理表里 + Long annexId1 = caseAttach.getAnnexId(); + sealManage.setAnnexId(annexId1); + sealManage.setSealStatus(1); + sealManage.setIsUse(0); + sealManageMapper.updateSealManage(sealManage); + } + } + } + } + } + } else { + return AjaxResult.error("error"); + } + return AjaxResult.success("success"); + } + + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/DigesdateUtils.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/DigesdateUtils.java new file mode 100644 index 0000000..f3f87d0 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/DigesdateUtils.java @@ -0,0 +1,46 @@ +package com.ruoyi.wisdomarbitrate.utils; + +import javax.crypto.Mac; +import javax.crypto.spec.SecretKeySpec; +import java.io.UnsupportedEncodingException; +import java.security.InvalidKeyException; +import java.security.NoSuchAlgorithmException; + +public class DigesdateUtils { + + public static String getSignStr(String paramsStr, String accessSec ) { + Mac macDiges = null; + try { + macDiges = Mac.getInstance("HmacSHA256"); + SecretKeySpec accessSecKey = new SecretKeySpec(accessSec.getBytes("UTF-8"), "HmacSHA256"); + macDiges.init(accessSecKey); + macDiges.update(paramsStr.getBytes("UTF-8")); + } catch (NoSuchAlgorithmException e) { + e.printStackTrace(); + return null; + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + return null; + } catch (InvalidKeyException e) { + e.printStackTrace(); + return null; + } + return byteTrasferhex(macDiges.doFinal()); + } + + public static String byteTrasferhex(byte[] byteArrayData) { + StringBuilder hashBuilder = new StringBuilder(); + String stmpHex; + for (int n = 0; byteArrayData != null && n < byteArrayData.length; n++) { + stmpHex = Integer.toHexString(byteArrayData[n] & 0XFF); + if (stmpHex.length() == 1) + hashBuilder.append('0'); + hashBuilder.append(stmpHex); + } + return hashBuilder.toString(); + } + + + + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/FixSelectFlowDetailUtils.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/FixSelectFlowDetailUtils.java index f176afc..913e297 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/FixSelectFlowDetailUtils.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/FixSelectFlowDetailUtils.java @@ -43,7 +43,7 @@ public class FixSelectFlowDetailUtils { /* 定时查询签署流程详情 */ - @Scheduled(cron = "0/10 * * * * ?") +// @Scheduled(cron = "0/10 * * * * ?") @Transactional public void fixExecuteSelectFlowDetailUtils() { Gson gson = new Gson(); @@ -277,7 +277,7 @@ public class FixSelectFlowDetailUtils { /** * 定时查询印章审核状态 */ - @Scheduled(cron = "0/30 * * * * ?") +// @Scheduled(cron = "0/30 * * * * ?") @Transactional public void searchForInstitutionalSeal() { try { diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/SignVerifyUtils.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/SignVerifyUtils.java new file mode 100644 index 0000000..b344dad --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/SignVerifyUtils.java @@ -0,0 +1,96 @@ +package com.ruoyi.wisdomarbitrate.utils; + +import com.ruoyi.common.utils.EsignApplicaConfig; +import com.ruoyi.common.utils.StringUtils; +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.io.UnsupportedEncodingException; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Enumeration; +import java.util.List; + +public class SignVerifyUtils { + private static String eSignAppSecret = EsignApplicaConfig.EsignAppSecret; + + + + public static boolean checkSignuter() throws Exception { + HttpServletRequest httprequest = ((ServletRequestAttributes) (RequestContextHolder.currentRequestAttributes())).getRequest(); + String orialsignature = httprequest.getHeader("X-Tsign-Open-SIGNATURE"); + String timestampreq = httprequest.getHeader("X-Tsign-Open-TIMESTAMP"); + String reqQuerystr =getHttpreqQuery(); + //获取请求参数 + String reqbodystr =getRequestBody(); + String signOriaData = timestampreq + reqQuerystr + reqbodystr; + String newDisgSignuter= DigesdateUtils.getSignStr(signOriaData, eSignAppSecret); + + + if (StringUtils.equals(orialsignature, newDisgSignuter)) { + return true; + }else { + return false; + } + } + + + + public static String getHttpreqQuery() { + HttpServletRequest httprequest = ((ServletRequestAttributes) (RequestContextHolder.currentRequestAttributes())).getRequest(); + List reqNames= new ArrayList(); + Enumeration httpreqEle =httprequest.getParameterNames(); + while (httpreqEle.hasMoreElements()){ + reqNames.add(httpreqEle.nextElement()); + } + Collections.sort(reqNames); + String httpreqQuery = ""; + for (String reqName : reqNames) { + String reqvalue = httprequest.getParameter(reqName); + httpreqQuery += reqvalue == null ? "" : reqvalue; + } + return httpreqQuery; + } + + public static String getRequestBody() { + HttpServletRequest httprequest = ((ServletRequestAttributes) (RequestContextHolder.currentRequestAttributes())).getRequest(); + String requestBody = ""; + int reqContentLen = httprequest.getContentLength(); + if (reqContentLen < 0) { + return null; + } + byte bufByteArray[] = new byte[reqContentLen]; + try { + for (int i = 0; i < reqContentLen;) { + int lengthReadInputStream = httprequest.getInputStream().read(bufByteArray, i, reqContentLen - i); + if (lengthReadInputStream == -1) { + break; + } + i += lengthReadInputStream; + } + } catch (IOException e) { + e.printStackTrace(); + } + try { + requestBody = new String(bufByteArray, "UTF-8"); + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + } + return requestBody; + } + + + + + + + + + + + + + +} diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml index ea552c2..e7704b2 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml @@ -1291,6 +1291,11 @@ and c.arbitrator_id=#{caseApplication.arbitratorId} + + + and ca.identity_type=1 + + + + diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAttachMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAttachMapper.xml index af5aa3a..a5ec19d 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAttachMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAttachMapper.xml @@ -119,6 +119,9 @@ - - + + delete from case_attach + where case_appli_id = #{caseId} + and annex_type = #{type} and annex_id!=#{annexId} + \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseEvidenceMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseEvidenceMapper.xml index 445d757..7bed4fe 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseEvidenceMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseEvidenceMapper.xml @@ -11,7 +11,8 @@ \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseLogRecordMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseLogRecordMapper.xml index 13801b5..bd37136 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseLogRecordMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseLogRecordMapper.xml @@ -31,15 +31,17 @@ - SELECT s.id ,s.case_appli_id ,s.file_id ,s.sign_flow_id,s.penson_account ,s.orgnize_name ,s.orgn_name_psn_acc + SELECT s.* from seal_sign_record s @@ -42,7 +44,7 @@ @@ -102,9 +104,14 @@ sign_flow_status = #{signFlowStatus}, file_download_url = #{fileDownloadUrl} + sign_status_arbitor = #{signStatusArbitor} + seal_status = #{sealStatus} where id = #{id} + \ No newline at end of file -- 2.54.0