From cf42c93c6d885db762a5ffa642647304a8c17870 Mon Sep 17 00:00:00 2001 From: qitz <18810291185@163.com> Date: Wed, 20 Mar 2024 09:14:17 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=8D=B0=E7=AB=A0=E5=AE=A1=E6=A0=B8?= =?UTF-8?q?=E5=9B=9E=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mscase/MsSignSealController.java | 16 ++++ .../mapper/dept/DeptIdentifyMapper.java | 2 + .../service/mscase/MsSignSealService.java | 2 + .../mscase/impl/MsSignSealServiceImpl.java | 82 ++++++++++++++++++- .../wisdomarbitrate/dept/SealManageMapper.xml | 3 + 5 files changed, 103 insertions(+), 2 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/mscase/MsSignSealController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/mscase/MsSignSealController.java index 8e96a71..adee87e 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/mscase/MsSignSealController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/mscase/MsSignSealController.java @@ -77,6 +77,22 @@ public class MsSignSealController extends BaseController { } + /** + * 印章审核回调 + */ + @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-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/dept/DeptIdentifyMapper.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/dept/DeptIdentifyMapper.java index 8b44eae..25c7fd7 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/dept/DeptIdentifyMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/dept/DeptIdentifyMapper.java @@ -3,6 +3,7 @@ package com.ruoyi.wisdomarbitrate.mapper.dept; import com.ruoyi.wisdomarbitrate.domain.dto.dept.DeptIdentify; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; +import tk.mybatis.mapper.entity.Example; import java.util.List; @@ -24,4 +25,5 @@ public interface DeptIdentifyMapper { * @return */ String selectById(@Param("id") Long identifyId); + } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/MsSignSealService.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/MsSignSealService.java index 82f07d4..e364b3c 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/MsSignSealService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/MsSignSealService.java @@ -37,4 +37,6 @@ public interface MsSignSealService { AjaxResult msCaseSignUrlResAPP(MsSignSealDTO dto) throws EsignDemoException; 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/mscase/impl/MsSignSealServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/MsSignSealServiceImpl.java index 364fe0f..d003a81 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/MsSignSealServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/MsSignSealServiceImpl.java @@ -1056,8 +1056,6 @@ public class MsSignSealServiceImpl implements MsSignSealService { MsCaseFlow currentFlow = caseFlowMapper.selectByPrimaryKey(caseApplicationselect.getCaseFlowId()); Integer caseNode = currentFlow.getNodeId(); String caseStatusName = currentFlow.getCaseStatusName(); - - if("SIGN_MISSON_COMPLETE".equals(action) && signResult==2){ if(mediaResult.intValue()==1){ //调解 @@ -1344,6 +1342,86 @@ public class MsSignSealServiceImpl implements MsSignSealService { 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) { + MsCaseAttach caseAttach = new MsCaseAttach(); + caseAttach.setAnnexType(AnnexTypeEnum.SEAL_PICTURE.getCode()); //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/resources/mapper/wisdomarbitrate/dept/SealManageMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/dept/SealManageMapper.xml index 8d16767..ad5a113 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/dept/SealManageMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/dept/SealManageMapper.xml @@ -23,6 +23,9 @@ AND seal_status = #{sealStatus} + + AND seal_id = #{sealId} + From 653f8143722ad434e217dec2fd38bb49b4a25ddb Mon Sep 17 00:00:00 2001 From: 18792927508 <1322446236@qq.com> Date: Wed, 20 Mar 2024 13:59:25 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E8=B0=83=E8=A7=A3=E5=91=98=E7=AD=BE?= =?UTF-8?q?=E5=90=8D=E6=8C=89=E9=92=AE=E6=9D=83=E9=99=90=E8=BF=94=E5=9B=9E?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/mscase/impl/MsCaseApplicationServiceImpl.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/MsCaseApplicationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/MsCaseApplicationServiceImpl.java index b24e5bf..9dc3503 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/MsCaseApplicationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/MsCaseApplicationServiceImpl.java @@ -235,7 +235,8 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService { if (CollectionUtil.isNotEmpty(list)) { // 判断调解员签名按钮权限,0-显示,1-不显示 for (MsCaseApplicationVO vo : list) { - if (isMediatorRole && vo.getMediaResult()!=null && vo.getMediaResult()==5) { + // 如果是调解员并且是和解协议并且是代签名状态,不显示 + if (isMediatorRole && vo.getMediaResult()!=null && vo.getMediaResult()==5 && vo.getCaseStatusName().equals("待签名")) { // 是调解员并且是和解协议,不显示 vo.setSignButtonFlag(1); @@ -2965,6 +2966,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService { * @param req * @return */ + @Transactional @Override public AjaxResult confirmMeetingResult(MsCaseApplicationReq req) { // 查询案件是否存在 @@ -2989,6 +2991,9 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService { } AjaxResult result = caseApplicationService.generateApplication(req); + // 修改案件结果 + application.setMediaResult(req.getMediaResult()); + msCaseApplicationMapper.updateByPrimaryKeySelective(application); return AjaxResult.success(); }