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 71191be..4ab8ac6 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 @@ -302,6 +302,15 @@ public class CaseApplicationController extends BaseController { return toAjax(caseApplicationService.pendTralCheckBatch(caseApplication)); } + /** + * 批量组庭确认 + */ + @Log(title = "批量组庭确认", businessType = BusinessType.UPDATE) + @PostMapping("/pendTralSureBatch") + public AjaxResult pendTralSureBatch(@Validated @RequestBody CaseApplication caseApplication) { + return toAjax(caseApplicationService.pendTralSureBatch(caseApplication)); + } + /** * 修改开庭时间 */ @@ -342,6 +351,35 @@ public class CaseApplicationController extends BaseController { return caseApplicationService.arbitratorCheckArbitrateRecord(caseApplication); } + /** + * 批量操作仲裁员审核裁决书 + */ + @Log(title = "批量操作仲裁员审核裁决书", businessType = BusinessType.UPDATE) + @PostMapping("/arbitrator/checkArbitrateRecordBatch") + public AjaxResult arbitratorCheckArbitrateRecordBatch(@Validated @RequestBody CaseApplication caseApplication) { + + return caseApplicationService.arbitratorCheckArbitrateRecordBatch(caseApplication); + } + + /** + * 批量部门长审核裁决书 + */ + @Log(title = "批量部门长审核裁决书", businessType = BusinessType.UPDATE) + @PostMapping("/checkArbitrateRecordBatch") + public AjaxResult checkArbitrateRecordBatch(@Validated @RequestBody CaseApplication caseApplication) { + + return caseApplicationService.checkArbitrateRecordBatch(caseApplication); + } + + /** + * 批量核验裁决书 + */ + @Log(title = "批量核验裁决书", businessType = BusinessType.UPDATE) + @PostMapping("/verificationArbitrateRecordBatch") + public AjaxResult verificationArbitrateRecordBatch(@Validated @RequestBody CaseApplication caseApplication) { + return toAjax(caseApplicationService.verificationArbitrateRecordBatch(caseApplication)); + } + /** * 是否指派仲裁员 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 9bcfe59..03c5eec 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 @@ -143,4 +143,12 @@ public interface ICaseApplicationService { int submitCaseApplicationCheckBatch(String batchNumber, Integer agreeOrNotCheck, String caseCheckReject); int pendTralCheckBatch(CaseApplication caseApplication); + + int pendTralSureBatch(CaseApplication caseApplication); + + int verificationArbitrateRecordBatch(CaseApplication caseApplication); + + AjaxResult arbitratorCheckArbitrateRecordBatch(CaseApplication caseApplication); + + AjaxResult checkArbitrateRecordBatch(CaseApplication caseApplication); } 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 4eefd8b..7005ca1 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 @@ -2733,6 +2733,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { } } } + }else{ + throw new ServiceException("这个批号没有批量审查的案件"); } return rows; } @@ -2753,6 +2755,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { throw new ServiceException("案件编号"+caseNumsstr+"在案件质证节点,请先进行案件质证,然后再批量组庭审核"); } + + CaseApplication caseApplication1 = new CaseApplication(); caseApplication1.setBatchNumber(caseApplication.getBatchNumber()); caseApplication1.setCaseStatus(CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL_SUBMMIT); @@ -2793,10 +2797,346 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL, ""); } + }else{ + throw new ServiceException("这个批号没有批量组庭审核的案件"); } return rows; } + @Override + @Transactional + public int pendTralSureBatch(CaseApplication caseApplication) { + Integer isAgreePendTral = caseApplication.getIsAgreePendTral(); + int rows = 0; + CaseApplication caseApplication1 = new CaseApplication(); + caseApplication1.setBatchNumber(caseApplication.getBatchNumber()); + caseApplication1.setCaseStatus(CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL); + List caseApplications = caseApplicationMapper.listCaseApplicationByBatchNumber(caseApplication1); + if (caseApplications != null && caseApplications.size() > 0) { + for(CaseApplication caseApplicationse:caseApplications){ + caseApplicationse.setCaseStatus(CaseApplicationConstants.CHECK_ARBITRATION_METHOD); + caseApplicationse.setIsAgreePendTral(isAgreePendTral); + if (isAgreePendTral != null && isAgreePendTral == 1) { + rows += caseApplicationMapper.submitCaseApplication(caseApplicationse); + } else { + List arbitrators = caseApplication.getArbitrators(); + // 仲裁员信息 + if (arbitrators != null && arbitrators.size() > 0) { + 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(",")); + caseApplicationse.setArbitratorId(idstr); + caseApplicationse.setArbitratorName(arbitratorNamestr); + rows += caseApplicationMapper.submitCaseApplication(caseApplicationse); + } + } + + SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest(); + request.setTemplateId("2033619"); + sendHearDateMessage(caseApplicationse, request, "2033619"); + // 新增日志 + insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CHECK_ARBITRATION_METHOD, ""); + + } + }else{ + throw new ServiceException("这个批号没有批量组庭审核的案件"); + } + return rows; + } + + @Override + @Transactional + public int verificationArbitrateRecordBatch(CaseApplication caseApplication) { + CaseApplication caseApplication1 = new CaseApplication(); + caseApplication1.setBatchNumber(caseApplication.getBatchNumber()); + caseApplication1.setCaseStatus(CaseApplicationConstants.VERPRIF_ARBITRATION); + List caseApplications = caseApplicationMapper.listCaseApplicationByBatchNumber(caseApplication1); + int rows = 0; + if (caseApplications != null && caseApplications.size() > 0) { + for(CaseApplication caseApplicationse:caseApplications){ + // 秘书核验裁决书,流转到待仲裁员审核仲裁文书 + caseApplicationse.setCaseStatus(CaseApplicationConstants.HEAD_CHECK_ARBITRATION); + rows += caseApplicationMapper.submitCaseApplication(caseApplicationse); +// ArbitrateRecord arbitrateRecord = caseApplication.getArbitrateRecord(); +// arbitrateRecordMapper.updataArbitrateRecord(arbitrateRecord); + // 新增日志 + insertCaseLog(caseApplicationse.getId(), CaseApplicationConstants.HEAD_CHECK_ARBITRATION, ""); + } + }else{ + throw new ServiceException("这个批号没有批量核验裁决书的案件"); + } + + return rows; + } + + @Override + @Transactional + public AjaxResult arbitratorCheckArbitrateRecordBatch(CaseApplication caseApplication) { + int rows = 0; + Integer agreeOrNotCheck = caseApplication.getAgreeOrNotCheck(); + + CaseApplication caseApplicationsel = new CaseApplication(); + caseApplicationsel.setBatchNumber(caseApplication.getBatchNumber()); + caseApplicationsel.setCaseStatus(CaseApplicationConstants.HEAD_CHECK_ARBITRATION); + List caseApplications1 = caseApplicationMapper.listCaseApplicationByBatchNumber(caseApplicationsel); + if (caseApplications1 != null && caseApplications1.size() > 0) { + for(CaseApplication caseApplicationse:caseApplications1){ + if (agreeOrNotCheck.intValue() == 1) { + caseApplicationse.setCaseStatus(CaseApplicationConstants.CHECK_ARBITRATION); + + rows += caseApplicationMapper.submitCaseApplication(caseApplicationse); + // 新增日志 + insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CHECK_ARBITRATION, ""); + } else if (agreeOrNotCheck.intValue() == 2) {//拒绝审核 + ArbitrateRecord arbitrateRecord = caseApplication.getArbitrateRecord(); + ArbitrateRecord arbitrateRecordnew = caseApplicationse.getArbitrateRecord(); + if(arbitrateRecordnew!=null){ + arbitrateRecordnew.setCheckOpinion(arbitrateRecord.getCheckOpinion()); + arbitrateRecordnew.setArbitrateReject(arbitrateRecord.getArbitrateReject()); + arbitrateRecordnew.setCaseAppliId(caseApplicationse.getId()); + arbitrateRecordMapper.updataArbitrateRecord(arbitrateRecordnew); + }else { + ArbitrateRecord arbitrateRecordnew1 = new ArbitrateRecord(); + arbitrateRecordnew1.setCheckOpinion(arbitrateRecord.getCheckOpinion()); + arbitrateRecordnew1.setArbitrateReject(arbitrateRecord.getArbitrateReject()); + arbitrateRecordnew1.setCaseAppliId(caseApplicationse.getId()); + arbitrateRecordMapper.insertArbitrateRecord(arbitrateRecordnew1); + } + caseApplicationse.setCaseStatus(CaseApplicationConstants.VERPRIF_ARBITRATION); + + rows += caseApplicationMapper.submitCaseApplication(caseApplicationse); + String notes=""; + if(caseApplication.getArbitrateRecord()!=null&&StrUtil.isNotEmpty(caseApplication.getArbitrateRecord().getArbitrateReject())){ + notes="仲裁员驳回仲裁文书,驳回原因:"+caseApplication.getArbitrateRecord().getArbitrateReject(); + } + // 新增日志 + insertCaseLog(caseApplication.getId(), CaseApplicationConstants.VERPRIF_ARBITRATION, notes); + } + } + + }else{ + throw new ServiceException("这个批号没有批量仲裁员审核裁决书的案件"); + } + + return success(rows); + } + + @Override + @Transactional + public AjaxResult checkArbitrateRecordBatch(CaseApplication caseApplication) { + Integer agreeOrNotCheck = caseApplication.getAgreeOrNotCheck(); + int rows = 0; + CaseApplication caseApplicationsel = new CaseApplication(); + caseApplicationsel.setBatchNumber(caseApplication.getBatchNumber()); + caseApplicationsel.setCaseStatus(CaseApplicationConstants.CHECK_ARBITRATION); + List caseApplications1 = caseApplicationMapper.listCaseApplicationByBatchNumber(caseApplicationsel); + if (caseApplications1 != null && caseApplications1.size() > 0) { + for(CaseApplication caseApplicationse:caseApplications1){ + if (agreeOrNotCheck.intValue() == 1) { + try { + //获取当前案件的裁决书 + CaseApplication caseApplication2 = caseApplicationService.selectCaseApplication(caseApplicationse); + List caseAttachList = caseApplication2.getCaseAttachList(); + if (caseAttachList != null && caseAttachList.size() > 0) { + for (CaseAttach caseAttach : caseAttachList) { + if (caseAttach.getAnnexType() == 3) { + String annexPath = caseAttach.getAnnexPath(); + String path = "/home/ruoyi" + annexPath; + // System.out.println("这是查询到的裁决书路径" + path); + // String path = "D:\\home\\新裁决书模板.docx"; + //获取文件上传地址 + EsignHttpResponse response = SaaSAPIFileUtils.getUploadUrl(path); + String body = response.getBody(); + if (body != null) { + JSONObject jsonObject = JSONObject.parseObject(body); + String fileId = jsonObject.getJSONObject("data").getString("fileId"); + String fileUploadUrl = jsonObject.getJSONObject("data").getString("fileUploadUrl"); + //上传文件流 + EsignHttpResponse response1 = SaaSAPIFileUtils.uploadFile(fileUploadUrl, path); + JSONObject jsonObject1 = JSONObject.parseObject(response1.getBody()); + if (jsonObject1.getIntValue("errCode") == 0) { + //查看文件上传状态 + Thread.sleep(3000); + EsignHttpResponse response2 = SaaSAPIFileUtils.getFileStatus(fileId); + JSONObject jsonObject2 = JSONObject.parseObject(response2.getBody()); + JSONObject data = jsonObject2.getJSONObject("data"); + int fileStatus = data.getIntValue("fileStatus"); + if (fileStatus == 2 || fileStatus == 5) { + String fileName = data.getString("fileName"); + //上传成功,获取文件签名印章位置 + SealSignRecord sealSignRecord = new SealSignRecord(); + sealSignRecord.setFileid(fileId); + EsignHttpResponse positions = SignAward.getPositions(sealSignRecord); + Gson gson = new Gson(); + JsonObject positionsJsonObject = gson.fromJson(positions.getBody(), JsonObject.class); + JsonObject positionsData = positionsJsonObject.getAsJsonObject("data"); + String keywordPositions = positionsData.get("keywordPositions").toString(); + //发起签署 + sealSignRecord.setFilename(fileName); + String arbitratorId = caseApplication2.getArbitratorId(); + if (arbitratorId != null) { + SysUser sysUser = sysUserMapper.selectUserById(Long.valueOf(arbitratorId)); + if (sysUser == null) { + return AjaxResult.error(); + } + sealSignRecord.setPensonAccount(sysUser.getPhonenumber()); + sealSignRecord.setPensonName(sysUser.getNickName()); + } + + DeptIdentify deptIdentify = new DeptIdentify(); + deptIdentify.setIsUse(1); + DeptIdentify deptIdentifyselect = new DeptIdentify(); + List deptIdentifysnew = deptIdentifyMapper.selectDeptIdentify(deptIdentify); + if (deptIdentifysnew != null && deptIdentifysnew.size() > 0) { + deptIdentifyselect = deptIdentifysnew.get(0); + sealSignRecord.setOrgnizeName(deptIdentifyselect.getIdentifyName()); + sealSignRecord.setOrgnizeNamePsnAccount(deptIdentifyselect.getOperPhone()); + sealSignRecord.setOrgnizeNamepsnName(deptIdentifyselect.getOperName()); + } else { + return AjaxResult.error("没有用印时的机构名称及经办人信息"); + } + + //解析文件签名印章位置 + JSONArray jsonArray = JSONArray.parseArray(keywordPositions); + for (int i = 0; i < jsonArray.size(); i++) { + JSONObject jsonObject3 = jsonArray.getJSONObject(i); + String keyword = jsonObject3.getString("keyword"); + if (keyword.equals("仲裁员:")) { + //签名 + JSONArray positionsArray = jsonObject3.getJSONArray("positions"); + // 遍历 positionsArray 中的每个元素 + for (int j = 0; j < positionsArray.size(); j++) { + JSONObject positionObj = positionsArray.getJSONObject(j); + int pageNum = positionObj.getIntValue("pageNum"); + sealSignRecord.setPositionPagepsn(String.valueOf(pageNum)); + JSONArray coordinatesArray = positionObj.getJSONArray("coordinates"); + JSONObject coordinateObj = coordinatesArray.getJSONObject(0); + double positionX = coordinateObj.getDoubleValue("positionX"); + double positionY = coordinateObj.getDoubleValue("positionY"); + sealSignRecord.setPositionXpsn(positionX + 90); + sealSignRecord.setPositionYpsn(positionY); + } + } else { + //用印 + JSONArray positionsArray = jsonObject3.getJSONArray("positions"); + // 遍历 positionsArray 中的每个元素 + for (int j = 0; j < positionsArray.size(); j++) { + JSONObject positionObj = positionsArray.getJSONObject(j); + int pageNum = positionObj.getIntValue("pageNum"); + sealSignRecord.setPositionPageorg(String.valueOf(pageNum)); + JSONArray coordinatesArray = positionObj.getJSONArray("coordinates"); + JSONObject coordinateObj = coordinatesArray.getJSONObject(0); + double positionX = coordinateObj.getDoubleValue("positionX"); + double positionY = coordinateObj.getDoubleValue("positionY"); + sealSignRecord.setPositionXorg(positionX + 90); + sealSignRecord.setPositionYorg(positionY); + } + } + } + /*DeptIdentify deptIdentify1 = new DeptIdentify(); + deptIdentify1.setSealStatus(1); // 印章状态为启用 + //根据机构名称查询部门id + SysDept sysDept = new SysDept(); + sysDept.setDeptName(sealSignRecord.getOrgnizeName()); + List sysDepts = deptMapper.selectDeptList(sysDept); + if (sysDepts != null && sysDepts.size() > 0) { + Long deptId = sysDepts.get(0).getDeptId(); + deptIdentify1.setDeptId(deptId); + } + List deptIdentifies = deptIdentifyMapper.selectDeptIdentifylistother(deptIdentify1); + List sealIds = new ArrayList<>(); + if (deptIdentifies != null && deptIdentifies.size() > 0) { + for (DeptIdentify identify : deptIdentifies) { + String sealId = identify.getSealId(); + sealIds.add(sealId); + } + }*/ + String orgnizeName = sealSignRecord.getOrgnizeName(); //机构名称 + String orgnizeNamepsnName = sealSignRecord.getOrgnizeNamepsnName(); //机构经办人姓名 + String orgnizeNamePsnAccount = sealSignRecord.getOrgnizeNamePsnAccount(); //机构经办人联系方式 + //查询机构信息 + DeptIdentify deptIdentify1 = new DeptIdentify(); + deptIdentify1.setIdentifyName(orgnizeName); + deptIdentify1.setOperName(orgnizeNamepsnName); + deptIdentify1.setOperPhone(orgnizeNamePsnAccount); + List deptIdentifies = deptIdentifyMapper.selectDeptIdentify(deptIdentify1); + if (deptIdentifies != null && deptIdentifies.size() > 0) { + Long id = deptIdentifies.get(0).getId(); + SealManage sealManage = new SealManage(); + sealManage.setIdentifyId(id); + List sealIdList = new ArrayList<>(); + List selectSealList = sealManageMapper.selectSealList(sealManage); + if (selectSealList != null && selectSealList.size() > 0) { + for (SealManage manage : selectSealList) { + Integer sealStatus = manage.getSealStatus(); + Integer isUse = manage.getIsUse(); + if (sealStatus == 1 && isUse ==1) { + sealIdList.add(manage.getSealId()); + } + } + EsignHttpResponse response3 = SignAward.createByFile(sealSignRecord, sealIdList); + + JSONObject jsonObject3 = JSONObject.parseObject(response3.getBody()); + if (jsonObject3 != null) { + if (jsonObject3.getIntValue("code") == 0) { + //获取签署流程ID + JSONObject data1 = jsonObject3.getJSONObject("data"); + String signFlowId = data1.getString("signFlowId"); + //保存案件id,文件id,文件名称.流程id到签署用印记录表里 + sealSignRecord.setCaseAppliId(caseApplicationse.getId()); + sealSignRecord.setSignFlowid(signFlowId); + sealSignRecord.setSignFlowStatus(1);//待签名 + sealSignRecordMapper.insertSealSignRecord(sealSignRecord); + } else { + throw new ServiceException(jsonObject3.getString("message")); + } + } else { + return AjaxResult.error(); + } + + } + + + } else { + return AjaxResult.error(); + } + } + } + } + break; + } + } + } + } catch (EsignDemoException e) { + e.printStackTrace(); + } catch (InterruptedException e) { + e.printStackTrace(); + } + caseApplicationse.setCaseStatus(CaseApplicationConstants.SIGN_ARBITRATION); + // 新增日志 + insertCaseLog(caseApplicationse.getId(), CaseApplicationConstants.SIGN_ARBITRATION, ""); + rows += caseApplicationMapper.submitCaseApplication(caseApplicationse); + } else if (agreeOrNotCheck.intValue() == 2) { + caseApplicationse.setCaseStatus(CaseApplicationConstants.HEAD_CHECK_ARBITRATION); + String notes=""; + if(caseApplication.getArbitrateRecord()!=null&&StrUtil.isNotEmpty(caseApplication.getArbitrateRecord().getDeptorReject())){ + notes="部门长驳回仲裁文书,驳回原因:"+caseApplication.getArbitrateRecord().getDeptorReject(); + } + // 新增日志 + insertCaseLog(caseApplicationse.getId(), CaseApplicationConstants.HEAD_CHECK_ARBITRATION, notes); + + rows = caseApplicationMapper.submitCaseApplication(caseApplicationse); + + } + + } + + } + return success(rows); + + } + private String getColumnstr(String columnname) { String columnstr = ""; switch (columnname) { 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 5d240c7..968ef42 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 @@ -320,6 +320,8 @@ public class CasePaymentServiceImpl implements ICasePaymentService { } + }else{ + throw new ServiceException("这个批号没有批量缴费的案件"); } return AjaxResult.success("确认缴费成功"); @@ -440,6 +442,8 @@ public class CasePaymentServiceImpl implements ICasePaymentService { } } + }else{ + throw new ServiceException("这个批号没有批量缴费确认的案件"); } return AjaxResult.success(); }