From 809e457480c7348580502a925433571650861494 Mon Sep 17 00:00:00 2001 From: 18792927508 <1322446236@qq.com> Date: Mon, 22 Apr 2024 16:08:05 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E4=B8=8B=E8=BD=BD=E8=B0=83?= =?UTF-8?q?=E8=A7=A3=E4=B9=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/common/CommonController.java | 3 ++ .../IdentityAuthenticationController.java | 29 ++++++++-- .../mscase/MsVideoConferenceController.java | 11 +++- .../src/main/resources/application.yml | 3 ++ .../domain/entity/mscase/MsCaseAttach.java | 5 ++ .../domain/vo/mscase/MsCaseApplicationVO.java | 4 ++ .../dept/impl/DeptIdentifyServiceImpl.java | 10 ++-- .../IdentityAuthenticationService.java | 10 +++- .../IdentityAuthenticationServiceImpl.java | 40 ++++++++++++-- .../impl/MsCaseApplicationServiceImpl.java | 53 +++++++++++++++---- .../mscase/impl/MsSignSealServiceImpl.java | 3 ++ .../impl/VideoConferenceServiceImpl.java | 3 ++ .../utils/FixSelectFlowDetailUtils.java | 4 ++ .../mscase/MsCaseAttachMapper.xml | 9 ++-- 14 files changed, 153 insertions(+), 34 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CommonController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CommonController.java index eadfe28..b0c72a2 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CommonController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CommonController.java @@ -23,6 +23,8 @@ import javax.servlet.http.HttpServletResponse; import java.util.ArrayList; import java.util.List; +import static com.google.common.io.Files.getFileExtension; + /** * 通用请求处理 * @@ -116,6 +118,7 @@ public class CommonController .annexType(annexType) .useId(SecurityUtils.getUserId()) .useAccount(SecurityUtils.getUsername()) + .suffix(getFileExtension(path)) .build(); msCaseAttachMapper.save(caseAttach); return caseAttach.getAnnexId(); diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/miniprogress/IdentityAuthenticationController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/miniprogress/IdentityAuthenticationController.java index b8fbd93..faa938a 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/miniprogress/IdentityAuthenticationController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/miniprogress/IdentityAuthenticationController.java @@ -1,5 +1,6 @@ package com.ruoyi.web.controller.wisdomarbitrate.miniprogress; +import cn.hutool.core.util.StrUtil; import com.alibaba.fastjson.JSONObject; import com.ruoyi.common.annotation.Anonymous; import com.ruoyi.common.core.controller.BaseController; @@ -8,10 +9,7 @@ import com.ruoyi.wisdomarbitrate.domain.dto.miniprogress.IdentityAuthentication; import com.ruoyi.wisdomarbitrate.service.miniprogress.IdentityAuthenticationService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; @RestController @RequestMapping("/identityAuthentication") @@ -25,7 +23,25 @@ public class IdentityAuthenticationController extends BaseController { @Anonymous @PostMapping("/selectIdentityAuthenticaEIDtoken") public AjaxResult selectIdentityAuthenticaEIDtoken() { - JSONObject tokenResult = identityAuthenticationService.selectIdentityAuthenticaEIDtoken(); + JSONObject tokenResult = identityAuthenticationService.selectIdentityAuthenticaEIDtoken(false); + return success(tokenResult); + } + /** + * 获取PC端EIDtoken + */ + @Anonymous + @PostMapping("/selectPCIdentityAuthenticaEIDtoken") + public AjaxResult selectPCIdentityAuthenticaEIDtoken() { + JSONObject tokenResult = identityAuthenticationService.selectIdentityAuthenticaEIDtoken(true); + return success(tokenResult); + } + /** + * H5轮询获取E证通Token状态 + */ + @Anonymous + @GetMapping("/selectPCEIDtokenStatus") + public AjaxResult selectPCEIDtokenStatus(@RequestParam String eidToken) { + JSONObject tokenResult = identityAuthenticationService.selectPCEIDtokenStatus(eidToken); return success(tokenResult); } @@ -35,6 +51,9 @@ public class IdentityAuthenticationController extends BaseController { @Anonymous @PostMapping("/selectIdentityAuthenticaRespon") public AjaxResult selectIdentityAuthenticaRespon(@Validated @RequestBody IdentityAuthentication ientityAuthentication) { + if(StrUtil.isEmpty(ientityAuthentication.getEidToken())){ + return error("EIDtoken不能为空"); + } AjaxResult checkResult = identityAuthenticationService.selectIdentityAuthenticaRespon(ientityAuthentication); return checkResult; } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/mscase/MsVideoConferenceController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/mscase/MsVideoConferenceController.java index fdce1cb..2716d94 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/mscase/MsVideoConferenceController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/mscase/MsVideoConferenceController.java @@ -27,6 +27,8 @@ import javax.servlet.http.HttpServletRequest; import javax.validation.Valid; import java.util.Objects; +import static com.google.common.io.Files.getFileExtension; + /** * 视频会议控制层 * @Author wangqiong @@ -69,6 +71,11 @@ public class MsVideoConferenceController extends BaseController { String filePath = RuoYiConfig.getUploadPath(); // 上传并返回新文件名称 String fileName = FileUploadUtils.upload(filePath, file); + String suffix = getFileExtension(fileName); + if(StrUtil.isNotEmpty(suffix)&& suffix.contains("doc")){ + // 上传到onlyoffice + officeFlag=1; + } String url = serverConfig.getUrl() + fileName; if(officeFlag != null && officeFlag == 1){ // officeFlag,fileName为annexPath @@ -83,7 +90,7 @@ public class MsVideoConferenceController extends BaseController { JSONObject jsonObject = (JSONObject) obj; caseAttach = MsCaseAttach.builder() .caseAppliId(caseId) - .annexName(jsonObject.getString("fileName")) + .annexName(jsonObject.get("fileName")!=null?jsonObject.getString("fileName"):"") .annexType(annexType) .onlyOfficeFileId(jsonObject.getString("fileId")) .build(); @@ -93,6 +100,7 @@ public class MsVideoConferenceController extends BaseController { caseAttach.setAnnexPath(replace); } + caseAttach.setSuffix( (getFileExtension(caseAttach.getAnnexPath()))); msCaseAttachMapper.save(caseAttach); } if(caseAttach==null){ @@ -136,6 +144,7 @@ public class MsVideoConferenceController extends BaseController { .annexType(annexType) .useId(SecurityUtils.getUserId()) .useAccount(SecurityUtils.getUsername()) + .suffix(getFileExtension(path)) .build(); msCaseAttachMapper.save(caseAttach); diff --git a/ruoyi-admin/src/main/resources/application.yml b/ruoyi-admin/src/main/resources/application.yml index 466e02e..874bdff 100644 --- a/ruoyi-admin/src/main/resources/application.yml +++ b/ruoyi-admin/src/main/resources/application.yml @@ -172,7 +172,10 @@ elegent: identityAuthentication: credentialSecretId: AKID3xfHgroY4MQHvLXUXMwIQL1UjmbBX1Tv credentialSecretKey: INDrIXcT8YmomZBcsy0oNirnU0LTN4X7 +# 小程序端人脸核身商户id merchantId: 0NSJ2309281116194321 +# pc端人脸核身商户id + pcMerchantId: 0NSJ2309281116194321 privateKeyHexDecodeinfo: 4c3b311bf7b98969994e85928e069574a1e95777f24d1c510679cc3c2f460faf # 腾讯云即时通信相关配置 imConfig: diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/entity/mscase/MsCaseAttach.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/entity/mscase/MsCaseAttach.java index 287db7b..ec3d3d9 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/entity/mscase/MsCaseAttach.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/entity/mscase/MsCaseAttach.java @@ -82,4 +82,9 @@ public class MsCaseAttach { */ @Column(name = "other_sys_file_id") private String otherSysFileId; + /** + * 附件后缀 + */ + @Column(name = "suffix") + private String suffix; } \ No newline at end of file diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/mscase/MsCaseApplicationVO.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/mscase/MsCaseApplicationVO.java index 107ca6a..4e444ce 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/mscase/MsCaseApplicationVO.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/mscase/MsCaseApplicationVO.java @@ -95,5 +95,9 @@ public class MsCaseApplicationVO extends MsCaseApplication { * 是否财务,部门长,秘书,0-否,1-是 */ private Integer otherFlag; + /** + * 调解书上传下载按钮权限,调解员,顾问在调节之后,送达之前显示,0-否,1-是 + */ + private Integer mediationFileFlag=0; } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/dept/impl/DeptIdentifyServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/dept/impl/DeptIdentifyServiceImpl.java index 296faae..0008281 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/dept/impl/DeptIdentifyServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/dept/impl/DeptIdentifyServiceImpl.java @@ -47,6 +47,7 @@ import java.util.function.Function; import java.util.stream.Collectors; import java.util.stream.Stream; +import static com.google.common.io.Files.getFileExtension; import static com.ruoyi.common.utils.SecurityUtils.getUsername; @Service @@ -256,6 +257,7 @@ public class DeptIdentifyServiceImpl implements IDeptIdentifyService { caseAttach.setAnnexType(AnnexTypeEnum.SEAL_PICTURE.getCode()); //10代表印章图片 caseAttach.setAnnexPath(savePath); caseAttach.setAnnexName(saveName); + caseAttach.setSuffix(getFileExtension(savePath)); int i1 = msCaseAttachMapper.save(caseAttach); if (i1 > 0) { //将附件id保存到公章管理表里 @@ -668,11 +670,5 @@ public class DeptIdentifyServiceImpl implements IDeptIdentifyService { return ajax; } - private String getFileExtension(String fileName) { - int lastDotIndex = fileName.lastIndexOf("."); - if (lastDotIndex > 0 && lastDotIndex < fileName.length() - 1) { - return fileName.substring(lastDotIndex + 1); - } - return ""; - } + } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/miniprogress/IdentityAuthenticationService.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/miniprogress/IdentityAuthenticationService.java index d53b3eb..66e9aad 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/miniprogress/IdentityAuthenticationService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/miniprogress/IdentityAuthenticationService.java @@ -19,10 +19,10 @@ public interface IdentityAuthenticationService { /** * 获取Eidtoken - * + * isPC 是否PC端 * @return */ - JSONObject selectIdentityAuthenticaEIDtoken(); + JSONObject selectIdentityAuthenticaEIDtoken(boolean isPC); /** * 小程序人脸核身后查询身份认证结果 @@ -31,4 +31,10 @@ public interface IdentityAuthenticationService { * @return */ AjaxResult selectIdentityAuthenticaRespon(IdentityAuthentication ientityAuthentication); + + /** + * H5轮询获取EIDtoken状态 + * @return + */ + JSONObject selectPCEIDtokenStatus(String eidToken); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/miniprogress/impl/IdentityAuthenticationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/miniprogress/impl/IdentityAuthenticationServiceImpl.java index 9a3de7a..04c46e8 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/miniprogress/impl/IdentityAuthenticationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/miniprogress/impl/IdentityAuthenticationServiceImpl.java @@ -8,6 +8,7 @@ import cn.hutool.crypto.symmetric.SymmetricCrypto; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.exception.ServiceException; import com.ruoyi.system.mapper.SysUserMapper; import com.ruoyi.wisdomarbitrate.domain.dto.miniprogress.IdentityAuthentication; import com.ruoyi.wisdomarbitrate.mapper.miniprogress.IdentityAuthenticationMapper; @@ -39,6 +40,8 @@ public class IdentityAuthenticationServiceImpl implements IdentityAuthentication private String credentialSecretKey; @Value("${identityAuthentication.merchantId}") private String merchantId; + @Value("${identityAuthentication.pcMerchantId}") + private String pcMerchantId; @Value("${identityAuthentication.privateKeyHexDecodeinfo}") private String privateKeyHexDecodeinfo; @@ -87,7 +90,7 @@ public class IdentityAuthenticationServiceImpl implements IdentityAuthentication * @return */ @Override - public JSONObject selectIdentityAuthenticaEIDtoken() { + public JSONObject selectIdentityAuthenticaEIDtoken(boolean isPC) { JSONObject objJSON = new JSONObject(); objJSON.put("EidToken", ""); try { @@ -102,7 +105,11 @@ public class IdentityAuthenticationServiceImpl implements IdentityAuthentication FaceidClient client = new FaceidClient(cred, "", clientProfile); // 实例化一个请求对象,每个接口都会对应一个request对象 GetEidTokenRequest req = new GetEidTokenRequest(); - req.setMerchantId(merchantId); + if(true){ + req.setMerchantId(merchantId); + }else { + req.setMerchantId(pcMerchantId); + } // 返回的resp是一个GetEidTokenResponse的实例,与请求对象对应 GetEidTokenResponse resp = client.GetEidToken(req); // 输出json格式的字符串回包 @@ -138,7 +145,7 @@ public class IdentityAuthenticationServiceImpl implements IdentityAuthentication } /** - * 小程序人脸核身后查询身份认证结果 + * 人脸核身后查询身份认证结果 * * @param ientityAuthentication * @return @@ -224,7 +231,32 @@ public class IdentityAuthenticationServiceImpl implements IdentityAuthentication return AjaxResult.success(); } - + @Override + public JSONObject selectPCEIDtokenStatus(String eidToken) { + JSONObject objJSON = null; + try { + Credential cred = new Credential(credentialSecretId, credentialSecretKey); + // 实例化一个http选项,可选的,没有特殊需求可以跳过 + HttpProfile httpProfile = new HttpProfile(); + httpProfile.setEndpoint("faceid.tencentcloudapi.com"); + // 实例化一个client选项,可选的,没有特殊需求可以跳过 + ClientProfile clientProfile = new ClientProfile(); + clientProfile.setHttpProfile(httpProfile); + // 实例化要请求产品的client对象,clientProfile是可选的 + FaceidClient client = new FaceidClient(cred, "", clientProfile); + // 实例化一个请求对象,每个接口都会对应一个request对象 + GetEidResultRequest req = new GetEidResultRequest(); + req.setEidToken(eidToken); + // 返回的resp是一个GetEidResultResponse的实例,与请求对象对应 + GetEidResultResponse resp = client.GetEidResult(req); + // 输出json格式的字符串回包,Status String 枚举:init:token未验证 doing: 验证中 finished: 验证完成 timeout: token已超时 + String s = GetEidResultResponse.toJsonString(resp); + objJSON = JSON.parseObject(s); + } catch (TencentCloudSDKException e) { + throw new ServiceException("获取E证通Token状态失败"); + } + return objJSON; + } } 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 bbe159a..34a0791 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 @@ -79,6 +79,7 @@ import java.util.concurrent.ExecutorService; import java.util.function.Function; import java.util.stream.Collectors; +import static com.google.common.io.Files.getFileExtension; import static com.ruoyi.common.utils.BookMarkUtil.getBookmarkByDocx; import static com.ruoyi.common.utils.PageUtils.startPage; import static com.ruoyi.common.utils.SecurityUtils.getUsername; @@ -193,8 +194,13 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService { */ @Override public List list(MsCaseApplicationReq req) { - // 是否调解员 - boolean isMediatorRole=false; + // 查询所有流程 + Example allFlowExample = new Example(MsCaseFlow.class); + allFlowExample.setOrderByClause("sort asc"); + List allCaseFlows = caseFlowMapper.selectByExample(allFlowExample); + if (CollectionUtil.isEmpty(allCaseFlows)) { + throw new ServiceException("未配置案件流程"); + } // 根据用户查询角色 LoginUser loginUser = SecurityUtils.getLoginUser(); // 根据id查询用户 @@ -205,7 +211,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService { startPage(); List list = msCaseApplicationMapper.list(req, null,null); // 设置申请人被申请人及签名按钮限 - setAfflicate(isMediatorRole,list,loginUser.getUserId(),roles); + setAfflicate(new HashMap<>(),list,loginUser.getUserId(),roles); return list; } if(CollectionUtil.isEmpty(roles) ){ @@ -227,6 +233,9 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService { throw new ServiceException("该角色为绑定案件流程"); } List caseFlowIds = caseFlows.stream().map(MsCaseFlow::getId).collect(Collectors.toList()); + // 流程名称分组 + Map flowNameMap = allCaseFlows.stream().collect(Collectors.toMap(MsCaseFlow::getCaseStatusName, MsCaseFlow::getSort, (k1, k2) -> k2)); + // 是否查询所有 boolean isSelectAll = false; @@ -240,7 +249,6 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService { roleIds=null; } if(StrUtil.equals(role.getRoleName(),"调解员")) { - isMediatorRole=true; req.setMediatorId(String.valueOf(sysUser.getUserId())); } } @@ -257,25 +265,26 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService { // 查询案件列表 List list = msCaseApplicationMapper.list(req, caseFlowIds,roleIds); // 设置申请人被申请人及签名按钮限 - setAfflicate(isMediatorRole,list,loginUser.getUserId(),roles); + setAfflicate(flowNameMap,list,loginUser.getUserId(),roles); return list; } /** * 设置申请人被申请人及签名按钮限 - * @param isMediatorRole 是否调解员 + * @param * @param list * @param loginUserId 当前登录用户id */ - private void setAfflicate(boolean isMediatorRole,List list,Long loginUserId, List roles ) { + private void setAfflicate( Map flowNameMap,List list,Long loginUserId, List roles ) { if(CollectionUtil.isEmpty(list)){ return; } - isMediatorRole=false; + // 是否调解员 + boolean isMediatorRole=false; // 查询申请人和被申请人 List caseIds = list.stream().map(MsCaseApplicationVO::getId).collect(Collectors.toList()); - - + Integer mediatorSort = flowNameMap.get("待调解"); + Integer sendSort = flowNameMap.get("待送达"); List affiliateList = msCaseAffiliateMapper.selectUserRoleByCaseIds(caseIds); // 根据案件id分组 Map> affiliateMap=null; @@ -362,6 +371,13 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService { }else { vo.setSignButtonFlag(0); } + // 调解员,并且在待调节后,送达前,显示 + if(mediatorSort!=null && sendSort!=null && isMediatorRole + && null!=flowNameMap.get(vo.getCaseStatusName()) + && flowNameMap.get(vo.getCaseStatusName())>mediatorSort + && flowNameMap.get(vo.getCaseStatusName())<=sendSort){ + vo.setMediationFileFlag(1); + } for (SysRole role : roles) { if(StrUtil.isNotEmpty(role.getRoleName())){ if(StrUtil.contains(role.getRoleName(),"财务") @@ -371,6 +387,10 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService { ){ vo.setOtherFlag(1); } + if(role.getRoleName().equals("法律顾问")){ + // 顾问可以上传下载调解书 + vo.setMediationFileFlag(1); + } } } @@ -413,6 +433,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService { if (CollectionUtil.isEmpty(allCaseFlows)) { throw new ServiceException("未配置案件流程"); } + List caseFlows = allCaseFlows; MsCaseApplicationReq req = new MsCaseApplicationReq(); if (StrUtil.equals(SecurityUtils.getUsername(), "admin")) { @@ -690,6 +711,9 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService { if (CollectionUtil.isNotEmpty(caseAttachList)) { for (MsCaseAttach caseAttach : caseAttachList) { caseAttach.setCaseAppliId(caseApplication.getId()); + if(StrUtil.isNotEmpty(caseAttach.getAnnexPath())){ + caseAttach.setSuffix(getFileExtension(caseAttach.getAnnexPath())); + } } if(!caseApplication.isImportFlag()) { // 修改案件附件 @@ -1522,6 +1546,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService { .annexType(annexType) .useId(SecurityUtils.getUserId()) .useAccount(SecurityUtils.getUsername()) + .suffix(getFileExtension(path)) .build(); int count = msCaseAttachMapper.save(caseAttach); if (count > 0 ) { @@ -2399,7 +2424,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService { @Override public AjaxResult saveOnlyOfficeFile(MsCaseAttach caseAttach) { if(StrUtil.isEmpty(caseAttach.getAnnexName())) { - caseAttach.setAnnexName("调解书"); + caseAttach.setAnnexName("调解书.docx"); } if(StrUtil.isNotEmpty(caseAttach.getAnnexPath())) { String replace = caseAttach.getAnnexPath().replace("/home/ruoyi/uploadPath", "/profile"); @@ -2408,6 +2433,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService { caseAttach.setAnnexType(AnnexTypeEnum.MEDIATE_BOOK.getCode()); caseAttach.setUseId(getUserInfo().getUserId()); caseAttach.setUseAccount(getUserInfo().getUserName()); + caseAttach.setSuffix(getFileExtension(caseAttach.getAnnexPath())); // 先删除之前的在新增 msCaseAttachMapper.deleteCaseAttachByCasedIdAndType(caseAttach.getCaseAppliId(), caseAttach.getAnnexType()); msCaseAttachMapper.save(caseAttach); @@ -2415,6 +2441,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService { return AjaxResult.success(); } + /** * 查询预约信息 * @param id @@ -3434,6 +3461,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService { } } + caseAttach.setSuffix(getFileExtension(caseAttach.getAnnexPath())); //保存到附件表里,先删除之前的在保存 msCaseAttachMapper.deleteCaseAttachByCasedIdAndType(caseAttach.getCaseAppliId(), annexType); @@ -3471,6 +3499,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService { caseAttach.setOtherSysFileId(caseFileInfo.getFileId()); } } + caseAttach.setSuffix(getFileExtension(caseAttach.getAnnexPath())); msCaseAttachMapper.save(caseAttach); } @@ -3479,6 +3508,8 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService { } + + /** * 调解书上传到onlyoffice服务器 * @param annexPath 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 549f36b..92b3dd3 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 @@ -76,6 +76,7 @@ import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutorService; import java.util.stream.Collectors; +import static com.google.common.io.Files.getFileExtension; import static com.ruoyi.common.core.domain.AjaxResult.success; @Slf4j @Service @@ -1144,6 +1145,7 @@ public class MsSignSealServiceImpl implements MsSignSealService { caseAttach.setAnnexType(AnnexTypeEnum.MEDIATE_BOOK.getCode()); caseAttach.setAnnexPath(savePath); caseAttach.setAnnexName(saveName); + caseAttach.setSuffix(getFileExtension(caseAttach.getAnnexPath())); log.info("调解书保存======="+downLoadFile); caseAttachMapper.save(caseAttach); // 对接北明,调用上传附件接口 @@ -1225,6 +1227,7 @@ public class MsSignSealServiceImpl implements MsSignSealService { caseAttach.setAnnexType(AnnexTypeEnum.SEAL_PICTURE.getCode()); //10代表印章图片 caseAttach.setAnnexPath(savePath); caseAttach.setAnnexName(saveName); + caseAttach.setSuffix(getFileExtension(caseAttach.getAnnexPath())); int i1 = caseAttachMapper.save(caseAttach); if (i1 > 0) { //将附件id保存到公章管理表里 diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/VideoConferenceServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/VideoConferenceServiceImpl.java index 88eda66..297684c 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/VideoConferenceServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/VideoConferenceServiceImpl.java @@ -59,6 +59,7 @@ import java.nio.file.Paths; import java.util.*; import java.util.stream.Collectors; +import static com.google.common.io.Files.getFileExtension; import static com.ruoyi.common.core.domain.AjaxResult.error; import static com.ruoyi.common.core.domain.AjaxResult.success; import static com.ruoyi.common.utils.file.FileUploadUtils.getAbsoluteFile; @@ -554,6 +555,7 @@ public class VideoConferenceServiceImpl implements VideoConferenceService { caseAttach.setOtherSysFileId(caseFileInfo.getFileId()); } } + caseAttach.setSuffix(getFileExtension(caseAttach.getAnnexPath())); caseAttachMapper.save(caseAttach); return AjaxResult.success(); }else { @@ -607,6 +609,7 @@ public class VideoConferenceServiceImpl implements VideoConferenceService { caseAttach.setOtherSysFileId(caseFileInfo.getFileId()); } } + caseAttach.setSuffix(getFileExtension(caseAttach.getAnnexPath())); caseAttachMapper.save(caseAttach); return annexName; 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 8435211..e4320e5 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 @@ -36,6 +36,8 @@ import java.util.List; import java.util.UUID; import java.util.stream.Collectors; +import static com.google.common.io.Files.getFileExtension; + @Component public class FixSelectFlowDetailUtils { @Autowired @@ -121,6 +123,7 @@ public class FixSelectFlowDetailUtils { caseAttach.setAnnexType(AnnexTypeEnum.SEAL_PICTURE.getCode()); //10代表印章图片 caseAttach.setAnnexPath(savePath); caseAttach.setAnnexName(saveName); + caseAttach.setSuffix(getFileExtension(caseAttach.getAnnexPath())); int i1 = caseAttachMapper.save(caseAttach); if (i1 > 0) { //将印章信息保存到公章管理表里 @@ -217,6 +220,7 @@ public class FixSelectFlowDetailUtils { caseAttach.setAnnexPath(savePath); caseAttach.setAnnexName(saveName); int i1 = caseAttachMapper.save(caseAttach); + caseAttach.setSuffix(getFileExtension(caseAttach.getAnnexPath())); if (i1 > 0) { //将附件id保存到公章管理表里 Long annexId1 = caseAttach.getAnnexId(); diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/mscase/MsCaseAttachMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/mscase/MsCaseAttachMapper.xml index 9779bc3..33bb852 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/mscase/MsCaseAttachMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/mscase/MsCaseAttachMapper.xml @@ -15,18 +15,19 @@ + - INSERT INTO ms_case_attach (case_appli_id, annex_name, annex_path , annex_type,note,use_id,use_account,seal_status,only_office_file_id) - VALUES (#{caseAppliId}, #{annexName}, #{annexPath},#{annexType},#{note},#{useId},#{useAccount},#{sealStatus},#{onlyOfficeFileId}) + INSERT INTO ms_case_attach (case_appli_id, annex_name, annex_path , annex_type,note,use_id,use_account,seal_status,only_office_file_id,suffix) + VALUES (#{caseAppliId}, #{annexName}, #{annexPath},#{annexType},#{note},#{useId},#{useAccount},#{sealStatus},#{onlyOfficeFileId},#{suffix}) - INSERT INTO ms_case_attach (case_appli_id, annex_name, annex_path , annex_type,note,use_id,use_account,seal_status,only_office_file_id) + INSERT INTO ms_case_attach (case_appli_id, annex_name, annex_path , annex_type,note,use_id,use_account,seal_status,only_office_file_id,suffix) VALUES - (#{item.caseAppliId}, #{item.annexName}, #{item.annexPath},#{item.annexType},#{item.note},#{item.useId},#{item.useAccount},#{item.sealStatus},#{item.onlyOfficeFileId}) + (#{item.caseAppliId}, #{item.annexName}, #{item.annexPath},#{item.annexType},#{item.note},#{item.useId},#{item.useAccount},#{item.sealStatus},#{item.onlyOfficeFileId},#{item.suffix}) -- 2.54.0