From 8e235b61359ccfbc698346937dc0768f6641d5f2 Mon Sep 17 00:00:00 2001 From: qitz <18810291185@163.com> Date: Fri, 8 Mar 2024 11:05:35 +0800 Subject: [PATCH 01/15] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=B0=83=E8=A7=A3?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/MsCaseApplicationServiceImpl.java | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) 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 974c55b..5cc602d 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 @@ -2485,11 +2485,9 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService { CaseLogUtils.insertCaseLog(application.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(),""); application.setCaseFlowId(caseFlow.getId()); application.setCaseStatusName(caseFlow.getCaseStatusName()); + application.setMediaResult(mediaResult); msCaseApplicationMapper.updateByPrimaryKey(application); } - - application.setMediaResult(mediaResult); - msCaseApplicationMapper.updateByPrimaryKeySelective(application); return AjaxResult.success(); }else if(mediaResult.intValue()==3){ //未达成调解但不再争议 @@ -2500,14 +2498,12 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService { if(caseFlow != null){ application.setCaseFlowId(caseFlow.getId()); application.setCaseStatusName(caseFlow.getCaseStatusName()); + application.setMediaResult(mediaResult); msCaseApplicationMapper.updateByPrimaryKey(application); // 新增日志 CaseLogUtils.insertCaseLog(application.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(),""); } - - application.setMediaResult(mediaResult); - msCaseApplicationMapper.updateByPrimaryKeySelective(application); return AjaxResult.success(); }else if(mediaResult.intValue()==4){ //未达成调解但同意引入仲裁 @@ -2532,6 +2528,19 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService { .header("signstr", signStr) .body(paramsbody) .execute(); + // 修改案件状态为结束 + Example flowExample = new Example(MsCaseFlow.class); + flowExample.createCriteria().andEqualTo("caseStatusName", "结束"); + MsCaseFlow caseFlow = caseFlowMapper.selectOneByExample(flowExample); + if(caseFlow != null){ + // 新增日志 + CaseLogUtils.insertCaseLog(application.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(),""); + application.setCaseFlowId(caseFlow.getId()); + application.setCaseStatusName(caseFlow.getCaseStatusName()); + application.setMediaResult(mediaResult); + msCaseApplicationMapper.updateByPrimaryKey(application); + } + return AjaxResult.success(); }else if(mediaResult.intValue()==5){ // 达成和解 -- 2.54.0 From df108c15ebf257a089d1068f4ef855796ca97c80 Mon Sep 17 00:00:00 2001 From: qitz <18810291185@163.com> Date: Mon, 11 Mar 2024 10:03:52 +0800 Subject: [PATCH 02/15] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=AD=BE=E5=90=8D?= =?UTF-8?q?=E7=94=A8=E5=8D=B0=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/entity/dept/MsSealSignRecord.java | 21 +++++++++++++++++++ .../dept/MsSealSignRecordMapper.xml | 4 ++++ 2 files changed, 25 insertions(+) diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/entity/dept/MsSealSignRecord.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/entity/dept/MsSealSignRecord.java index 2bfa6f9..ddb7722 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/entity/dept/MsSealSignRecord.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/entity/dept/MsSealSignRecord.java @@ -144,6 +144,27 @@ public class MsSealSignRecord { @Column(name = "position_ypsn_medi") private double positionYpsnMedi; + /** + * 申请人签名状态 + */ + @Column(name = "sign_status_apply") + private Integer signStatusApply; + /** + * 被申请人签名状态 + */ + @Column(name = "sign_status_response") + private Integer signStatusResponse; + /** + * 调解员签名状态 + */ + @Column(name = "sign_status_mediator") + private Integer signStatusMediator; + /** + * 用印状态 + */ + @Column(name = "seal_status") + private Integer sealStatus; + } \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/dept/MsSealSignRecordMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/dept/MsSealSignRecordMapper.xml index 25f189d..b204a97 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/dept/MsSealSignRecordMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/dept/MsSealSignRecordMapper.xml @@ -23,6 +23,10 @@ + + + + -- 2.54.0 From 13422f5c2d36c25eb78ba88c67edf0cec6b08b4c Mon Sep 17 00:00:00 2001 From: 18792927508 <1322446236@qq.com> Date: Tue, 12 Mar 2024 14:56:51 +0800 Subject: [PATCH 03/15] =?UTF-8?q?=E6=96=B0=E5=A2=9E=EF=BC=8C=E5=8D=95?= =?UTF-8?q?=E7=82=B9=E7=99=BB=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/flow/CaseFlowController.java | 12 +- .../controller/system/SysLoginController.java | 44 +++- .../mscase/MsCaseApplicationController.java | 24 +- .../common/core/domain/entity/SysUser.java | 24 +- .../common/core/domain/model/LoginBody.java | 24 ++ .../framework/config/SecurityConfig.java | 2 +- .../web/service/SysLoginService.java | 126 ++++++++-- .../framework/web/service/TokenService.java | 35 ++- .../system/domain/vo/flow/MsBaseCaseFlow.java | 28 +++ .../system/mapper/flow/MsCaseFlowMapper.java | 4 + .../system/service/flow/CaseFlowService.java | 8 + .../service/flow/CaseFlowServiceImpl.java | 8 + .../service/impl/SysUserServiceImpl.java | 3 + .../miniprogress/IdentityAuthentication.java | 25 +- .../domain/entity/mscase/MsCaseAffiliate.java | 10 + .../domain/vo/mscase/MsCaseApplicationVO.java | 8 +- .../domain/vo/mscase/MsCaseBatchInsertVO.java | 19 ++ .../mapper/mscase/MsCaseLogRecordMapper.java | 10 + .../impl/WeChatUserServiceImpl.java | 2 + .../mscase/MsCaseApplicationService.java | 18 +- .../impl/MsCaseApplicationServiceImpl.java | 233 ++++++++++++------ .../resources/mapper/system/SysUserMapper.xml | 10 +- 22 files changed, 541 insertions(+), 136 deletions(-) create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/flow/MsBaseCaseFlow.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/mscase/MsCaseBatchInsertVO.java diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/flow/CaseFlowController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/flow/CaseFlowController.java index 238479a..48aab39 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/flow/CaseFlowController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/flow/CaseFlowController.java @@ -5,10 +5,7 @@ import com.ruoyi.system.domain.vo.flow.MsCaseFlowSearchVO; import com.ruoyi.system.domain.vo.flow.MsCaseFlowVO; import com.ruoyi.system.service.flow.CaseFlowService; import org.springframework.beans.factory.annotation.Autowired; -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.*; import static com.ruoyi.common.core.domain.AjaxResult.success; @@ -28,6 +25,13 @@ public class CaseFlowController { public Object queryCaseFlowInfo(@RequestBody MsCaseFlowSearchVO caseFlowSearchVO) { return caseFlowService.queryCaseFlowInfo(caseFlowSearchVO); } + /** + * 查询案件流程信息 + */ + @GetMapping("/selectCaseFlow") + public AjaxResult selectCaseFlow() { + return caseFlowService.selectCaseFlow(); + } /** * 新增或编辑案件流程节点信息 diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java index 9d82d1a..e42104d 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java @@ -1,8 +1,17 @@ package com.ruoyi.web.controller.system; -import java.util.List; -import java.util.Set; - +import cn.hutool.core.util.StrUtil; +import cn.hutool.crypto.digest.MD5; +import com.ruoyi.common.constant.Constants; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.domain.entity.SysMenu; +import com.ruoyi.common.core.domain.entity.SysUser; +import com.ruoyi.common.core.domain.model.LoginBody; +import com.ruoyi.common.utils.SecurityUtils; +import com.ruoyi.framework.web.service.SysLoginService; +import com.ruoyi.framework.web.service.SysPermissionService; +import com.ruoyi.framework.web.service.TokenService; +import com.ruoyi.system.service.ISysMenuService; import com.ruoyi.system.service.ISysUserService; import com.ruoyi.system.service.flow.CaseFlowService; import com.ruoyi.wisdomarbitrate.domain.dto.miniprogress.IdentityAuthentication; @@ -12,15 +21,9 @@ import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RestController; -import com.ruoyi.common.constant.Constants; -import com.ruoyi.common.core.domain.AjaxResult; -import com.ruoyi.common.core.domain.entity.SysMenu; -import com.ruoyi.common.core.domain.entity.SysUser; -import com.ruoyi.common.core.domain.model.LoginBody; -import com.ruoyi.common.utils.SecurityUtils; -import com.ruoyi.framework.web.service.SysLoginService; -import com.ruoyi.framework.web.service.SysPermissionService; -import com.ruoyi.system.service.ISysMenuService; + +import java.util.List; +import java.util.Set; /** * 登录验证 @@ -43,6 +46,8 @@ public class SysLoginController { private ISysUserService sysUserService; @Autowired private CaseFlowService caseFlowService; + @Autowired + private TokenService tokenService; /** * 登录方法 * @@ -102,4 +107,19 @@ public class SysLoginController { List menus = menuService.selectMenuTreeByUserId(userId); return AjaxResult.success(menuService.buildMenus(menus)); } + /**sso登录接口*/ + @PostMapping("login/sso") + public AjaxResult loginSSO( @RequestBody LoginBody loginBody){ + if(StrUtil.isEmpty(loginBody.getUsername()) || StrUtil.isEmpty(loginBody.getTicket()) + || StrUtil.isEmpty(loginBody.getRoleName()) ){ + return AjaxResult.error("参数错误"); + } + return loginService.loginSSO(loginBody); + + } + + public static void main(String[] args) { + System.out.println( MD5.create().digestHex("BMceshi" )); + } } + diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/mscase/MsCaseApplicationController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/mscase/MsCaseApplicationController.java index 12291b8..5ce9196 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/mscase/MsCaseApplicationController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/mscase/MsCaseApplicationController.java @@ -79,8 +79,18 @@ public class MsCaseApplicationController extends BaseController { if(caseApplication.getAffiliate()==null||caseApplication.getAffiliate().getOrganizeFlag()==null){ error("参数校验失败"); } + AjaxResult ajaxResult = AjaxResult.success(); + ajaxResult.put("caseNum",caseApplicationService.insert(caseApplication)); + return ajaxResult; + } + /** + * 批量新增案件 + */ + @PostMapping("/batchInsert") + public AjaxResult batchInsert(@RequestBody MsCaseBatchInsertVO list ) + { - return success(caseApplicationService.insert(caseApplication)); + return caseApplicationService.batchInsert(list); } /** @@ -90,10 +100,10 @@ public class MsCaseApplicationController extends BaseController { public AjaxResult getInfoByIdCard(@RequestParam(value = "idCard" ,required = false) String idCard) { if(StrUtil.isEmpty(idCard)){ - error("身份证号不能为空"); + return error("身份证号不能为空"); } if(!IdcardUtil.isValidCard(idCard)){ - error("身份证不合法,请输入正确的身份证号"); + return error("身份证不合法,请输入正确的身份证号"); } AjaxResult ajax = AjaxResult.success(); Map identityNumMap = IdCardUtils.getBirAgeSex(idCard); @@ -140,12 +150,12 @@ public class MsCaseApplicationController extends BaseController { * 根据id查询案件 */ @GetMapping("/selectById") - public AjaxResult selectById(@RequestParam Long id ) + public AjaxResult selectById(@RequestParam(required = false) Long id ,@RequestParam(required = false) String caseNum ) { - if(id==null){ - error("id不能为空"); + if(id==null && caseNum==null ){ + error("参数校验失败"); } - return success(caseApplicationService.selectById(id)); + return success(caseApplicationService.selectById(id,caseNum)); } /** * 案件压缩包导入 diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java index 0c2b92c..eb193fc 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java @@ -63,8 +63,12 @@ public class SysUser extends BaseEntity /** 用户身份证号 */ - @Excel(name = "身份证号") private String idCard; + /** 身份类别,0-身份证,1-护照,默认0 */ + private Integer idType; + /** 国籍,0-国内,1-国外,默认0 */ + + private Integer nationality; /** 用户邮箱 */ @Excel(name = "用户邮箱") @@ -136,6 +140,22 @@ public class SysUser extends BaseEntity this.userId = userId; } + public Integer getIdType() { + return idType; + } + + public void setIdType(Integer idType) { + this.idType = idType; + } + + public Integer getNationality() { + return nationality; + } + + public void setNationality(Integer nationality) { + this.nationality = nationality; + } + public Long getUserId() { return userId; @@ -361,6 +381,8 @@ public class SysUser extends BaseEntity .append("deptIds", getDeptIds()) .append("userName", getUserName()) .append("idCard", getIdCard()) + .append("idType", getIdType()) + .append("nationality", getNationality()) .append("nickName", getNickName()) .append("email", getEmail()) .append("phonenumber", getPhonenumber()) diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/model/LoginBody.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/model/LoginBody.java index b5bc8c8..4672a3d 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/model/LoginBody.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/model/LoginBody.java @@ -26,12 +26,36 @@ public class LoginBody * 唯一标识 */ private String uuid; + /** + * 密文:BM+用户名用MD5加密 + */ + private String ticket; + /** + * 角色名,申请人,被申请人,委托代理人 + */ + private String roleName; + + public String getRoleName() { + return roleName; + } + + public void setRoleName(String roleName) { + this.roleName = roleName; + } public String getUsername() { return username; } + public String getTicket() { + return ticket; + } + + public void setTicket(String ticket) { + this.ticket = ticket; + } + public void setUsername(String username) { this.username = username; diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java index aa522ae..e2fa163 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java @@ -111,7 +111,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter // 过滤请求 .authorizeRequests() // 对于登录login 注册register 验证码captchaImage 允许匿名访问 - .antMatchers("/login", "/register", "/captchaImage","/uploadPath/**","/websocket/**").permitAll() + .antMatchers("/login","/login/sso", "/register", "/captchaImage","/uploadPath/**","/websocket/**").permitAll() // 静态资源,可匿名访问 .antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll() .antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**").permitAll() diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysLoginService.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysLoginService.java index 67267b7..9cb1ac1 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysLoginService.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysLoginService.java @@ -1,33 +1,35 @@ package com.ruoyi.framework.web.service; -import javax.annotation.Resource; +import cn.hutool.crypto.digest.MD5; +import com.ruoyi.common.constant.CacheConstants; +import com.ruoyi.common.constant.Constants; +import com.ruoyi.common.constant.UserConstants; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.domain.entity.SysUser; +import com.ruoyi.common.core.domain.model.LoginBody; +import com.ruoyi.common.core.domain.model.LoginUser; +import com.ruoyi.common.core.redis.RedisCache; +import com.ruoyi.common.exception.ServiceException; +import com.ruoyi.common.exception.user.*; +import com.ruoyi.common.utils.DateUtils; +import com.ruoyi.common.utils.MessageUtils; +import com.ruoyi.common.utils.SecurityUtils; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.common.utils.ip.IpUtils; +import com.ruoyi.framework.manager.AsyncManager; +import com.ruoyi.framework.manager.factory.AsyncFactory; +import com.ruoyi.framework.security.context.AuthenticationContextHolder; +import com.ruoyi.system.mapper.SysRoleMapper; +import com.ruoyi.system.service.ISysConfigService; +import com.ruoyi.system.service.ISysUserService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.authentication.AuthenticationManager; import org.springframework.security.authentication.BadCredentialsException; import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; import org.springframework.security.core.Authentication; import org.springframework.stereotype.Component; -import com.ruoyi.common.constant.CacheConstants; -import com.ruoyi.common.constant.Constants; -import com.ruoyi.common.constant.UserConstants; -import com.ruoyi.common.core.domain.entity.SysUser; -import com.ruoyi.common.core.domain.model.LoginUser; -import com.ruoyi.common.core.redis.RedisCache; -import com.ruoyi.common.exception.ServiceException; -import com.ruoyi.common.exception.user.BlackListException; -import com.ruoyi.common.exception.user.CaptchaException; -import com.ruoyi.common.exception.user.CaptchaExpireException; -import com.ruoyi.common.exception.user.UserNotExistsException; -import com.ruoyi.common.exception.user.UserPasswordNotMatchException; -import com.ruoyi.common.utils.DateUtils; -import com.ruoyi.common.utils.MessageUtils; -import com.ruoyi.common.utils.StringUtils; -import com.ruoyi.common.utils.ip.IpUtils; -import com.ruoyi.framework.manager.AsyncManager; -import com.ruoyi.framework.manager.factory.AsyncFactory; -import com.ruoyi.framework.security.context.AuthenticationContextHolder; -import com.ruoyi.system.service.ISysConfigService; -import com.ruoyi.system.service.ISysUserService; + +import javax.annotation.Resource; /** * 登录校验方法 @@ -51,6 +53,8 @@ public class SysLoginService @Autowired private ISysConfigService configService; + @Autowired + private SysRoleMapper roleMapper; /** * 登录验证 @@ -63,7 +67,6 @@ public class SysLoginService */ public String login(String username, String password, String code, String uuid) { - // 验证码校验 validateCaptcha(username, code, uuid); // 登录前置校验 loginPreCheck(username, password); @@ -99,6 +102,45 @@ public class SysLoginService // 生成token return tokenService.createToken(loginUser); } + /** + * 无需验证码登录 + * 重写login方法将验证码模块去掉 + * @param username + * @param password + * @param uuid + * @return + */ + public String loginNoCaptcha(String username, String password, String uuid) + { + // 用户验证 + Authentication authentication = null; + try + { + UsernamePasswordAuthenticationToken authenticationToken = new UsernamePasswordAuthenticationToken(username, password); + AuthenticationContextHolder.setContext(authenticationToken); + // 该方法会去调用UserDetailsServiceImpl.loadUserByUsername + authentication = authenticationManager.authenticate(authenticationToken); + } + catch (Exception e) + { + if (e instanceof BadCredentialsException) + { + AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.password.not.match"))); + throw new UserPasswordNotMatchException(); + } + else + { + AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, e.getMessage())); + throw new ServiceException(e.getMessage()); + } + } + AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_SUCCESS, MessageUtils.message("user.login.success"))); + LoginUser loginUser = (LoginUser) authentication.getPrincipal(); + recordLoginInfo(loginUser.getUserId()); + // 生成token + return tokenService.createToken(loginUser); + } + /** * 校验验证码 @@ -178,4 +220,42 @@ public class SysLoginService sysUser.setLoginDate(DateUtils.getNowDate()); userService.updateUserProfile(sysUser); } + + public AjaxResult loginSSO(LoginBody loginBody) { + // MD5加密并和Ticket比对 + String currentTicket = MD5.create().digestHex("BM" + loginBody.getUsername()); + if(!currentTicket.equals(loginBody.getTicket())){ + return AjaxResult.error("ticket校验失败"); + } + AjaxResult ajax = AjaxResult.success(); + String username = loginBody.getUsername(); + // 根据用户名获取用户信息,如果用户不存在则新增用户 + SysUser user = userService.selectUserByUserName(username); + if(user==null){ + // 新增用户 + user = new SysUser(); + user.setUserName(username); + user.setPassword(SecurityUtils.encryptPassword("abc123456")); + user.setNickName(username); + // 代理人角色相当于申请人角色 + if(loginBody.getRoleName().contains("代理人")){ + loginBody.setRoleName("申请人"); + } + // 根据角色名查询角色id + Long roleIdByName = roleMapper.selectRoleIdByName(loginBody.getRoleName()); + if(roleIdByName==null){ + return AjaxResult.error("角色不存在"); + } + user.setRoleIds( new Long[]{roleIdByName}); + userService.insertUser(user); + + }// 生成token + LoginUser loginUser = new LoginUser(); + loginUser.setUser(user); + loginUser.setUserId(user.getUserId()); + String token = tokenService.createToken(loginUser); + ajax.put("userName", user.getUserName()); + ajax.put(Constants.TOKEN, token); + return ajax; + } } diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/TokenService.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/TokenService.java index aa112da..5d4e6ff 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/TokenService.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/TokenService.java @@ -1,14 +1,5 @@ package com.ruoyi.framework.web.service; -import java.util.HashMap; -import java.util.Map; -import java.util.concurrent.TimeUnit; -import javax.servlet.http.HttpServletRequest; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Component; import com.ruoyi.common.constant.CacheConstants; import com.ruoyi.common.constant.Constants; import com.ruoyi.common.core.domain.model.LoginUser; @@ -22,6 +13,16 @@ import eu.bitwalker.useragentutils.UserAgent; import io.jsonwebtoken.Claims; import io.jsonwebtoken.Jwts; import io.jsonwebtoken.SignatureAlgorithm; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Component; + +import javax.servlet.http.HttpServletRequest; +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.TimeUnit; /** * token验证处理 @@ -119,6 +120,8 @@ public class TokenService refreshToken(loginUser); Map claims = new HashMap<>(); + claims.put("userName",loginUser.getUsername()); + claims.put("userId",loginUser.getUserId()); claims.put(Constants.LOGIN_USER_KEY, token); return createToken(claims); } @@ -207,14 +210,24 @@ public class TokenService Claims claims = parseToken(token); return claims.getSubject(); } - + /** + * 从令牌中获取用户名 + * + * @param token 令牌 + * @return 用户名 + */ + public String getUserNameFromToken(String token) + { + Claims claims = parseToken(token); + return claims.get("userName").toString(); + } /** * 获取请求token * * @param request * @return token */ - private String getToken(HttpServletRequest request) + public String getToken(HttpServletRequest request) { String token = request.getHeader(header); if (StringUtils.isNotEmpty(token) && token.startsWith(Constants.TOKEN_PREFIX)) diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/flow/MsBaseCaseFlow.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/flow/MsBaseCaseFlow.java new file mode 100644 index 0000000..3f4b0a1 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/flow/MsBaseCaseFlow.java @@ -0,0 +1,28 @@ +package com.ruoyi.system.domain.vo.flow; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + + +@AllArgsConstructor +@NoArgsConstructor +@Builder +@Data +public class MsBaseCaseFlow { + /** + * 主键id + */ + private Integer id; + + /** + * 顺序 + */ + private Integer sort; + + /** + * 案件状态名称 + */ + private String caseStatusName; +} \ No newline at end of file diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/flow/MsCaseFlowMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/flow/MsCaseFlowMapper.java index df4f96b..cae7a7f 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/flow/MsCaseFlowMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/flow/MsCaseFlowMapper.java @@ -1,6 +1,7 @@ package com.ruoyi.system.mapper.flow; import com.ruoyi.system.domain.entity.flow.MsCaseFlow; +import com.ruoyi.system.domain.vo.flow.MsBaseCaseFlow; import com.ruoyi.system.domain.vo.flow.MsCaseFlowVO; import org.apache.ibatis.annotations.Select; import tk.mybatis.mapper.common.Mapper; @@ -25,4 +26,7 @@ public interface MsCaseFlowMapper extends Mapper { @Select("SELECT r.role_name as roleName ,f.node_name as nodeName ,f.case_status_name as caseStatusName FROM ms_case_flow f left join ms_case_flow_role_related fr on f.id = fr.flow_id left join ms_sys_role r on fr.roleid = r.role_id WHERE f.id = #{caseFlowId} ") List selectFlowRole(Integer caseFlowId); + @Select("select f1.id,f1.case_status_name caseStatusName,f1.sort from ms_case_flow f1 order by f1.sort") + + List selectCaseFlow(); } \ No newline at end of file diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/flow/CaseFlowService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/flow/CaseFlowService.java index 16d3bd3..27c8b38 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/flow/CaseFlowService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/flow/CaseFlowService.java @@ -1,5 +1,6 @@ package com.ruoyi.system.service.flow; +import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.system.domain.vo.flow.MsCaseFlowSearchVO; import com.ruoyi.system.domain.vo.flow.MsCaseFlowVO; @@ -12,6 +13,11 @@ public interface CaseFlowService { * @return */ Object queryCaseFlowInfo(MsCaseFlowSearchVO caseFlowSearchVO); + /** + * 查询案件流程信息 + * @return + */ + AjaxResult selectCaseFlow(); /** * 新增或编辑案件流程节点信息 @@ -40,4 +46,6 @@ public interface CaseFlowService { * @return */ Set getCaseStatusIdByRoleKey(Set roles); + + } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/flow/CaseFlowServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/flow/CaseFlowServiceImpl.java index 5636c6a..ff8ffbb 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/flow/CaseFlowServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/flow/CaseFlowServiceImpl.java @@ -2,10 +2,12 @@ package com.ruoyi.system.service.flow; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; +import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.entity.SysRole; import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.system.domain.entity.flow.MsCaseFlow; import com.ruoyi.system.domain.entity.flow.MsCaseFlowRoleRelated; +import com.ruoyi.system.domain.vo.flow.MsBaseCaseFlow; import com.ruoyi.system.domain.vo.flow.MsCaseFlowSearchVO; import com.ruoyi.system.domain.vo.flow.MsCaseFlowVO; import com.ruoyi.system.mapper.SysRoleMapper; @@ -95,6 +97,12 @@ public class CaseFlowServiceImpl implements CaseFlowService { } } + @Override + public AjaxResult selectCaseFlow() { + List caseFlows = msCaseFlowMapper.selectCaseFlow(); + return AjaxResult.success(caseFlows); + } + /** * 查询流程信息相关的角色信息 * diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java index 72d7d19..cbf225b 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java @@ -8,6 +8,7 @@ import com.ruoyi.common.core.domain.entity.SysRole; import com.ruoyi.common.core.domain.entity.SysUser; import com.ruoyi.common.core.domain.entity.SysUserDept; import com.ruoyi.common.exception.ServiceException; +import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.SecurityUtils; import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.bean.BeanValidators; @@ -241,6 +242,8 @@ public class SysUserServiceImpl implements ISysUserService { @Transactional public AjaxResult insertUser(SysUser user) { // 新增用户信息 + user.setCreateBy("admin"); + user.setCreateTime(DateUtils.getNowDate()); int rows = userMapper.insertUser(user); // 新增用户部门关联 if(CollectionUtil.isNotEmpty(user.getDeptIds())) { diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/dto/miniprogress/IdentityAuthentication.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/dto/miniprogress/IdentityAuthentication.java index d448c21..7eca08b 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/dto/miniprogress/IdentityAuthentication.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/dto/miniprogress/IdentityAuthentication.java @@ -1,7 +1,6 @@ package com.ruoyi.wisdomarbitrate.domain.dto.miniprogress; import com.fasterxml.jackson.annotation.JsonFormat; -import com.ruoyi.common.annotation.Excel; import com.ruoyi.common.core.domain.BaseEntity; import lombok.Data; @@ -20,6 +19,14 @@ public class IdentityAuthentication extends BaseEntity { private String name; /** 身份证号 */ private String identityNo; + /** + * 身份类别,0-身份证,1-护照,默认0 + */ + private Integer idType; + /** + * 国籍,0-国内,1-国外,默认0 + */ + private Integer nationality; /** * 短信验证码 */ @@ -104,6 +111,22 @@ public class IdentityAuthentication extends BaseEntity { return userId; } + public Integer getIdType() { + return idType; + } + + public void setIdType(Integer idType) { + this.idType = idType; + } + + public Integer getNationality() { + return nationality; + } + + public void setNationality(Integer nationality) { + this.nationality = nationality; + } + public void setUserId(Long userId) { this.userId = userId; } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/entity/mscase/MsCaseAffiliate.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/entity/mscase/MsCaseAffiliate.java index 6fa4b38..437a075 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/entity/mscase/MsCaseAffiliate.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/entity/mscase/MsCaseAffiliate.java @@ -154,4 +154,14 @@ public class MsCaseAffiliate { */ @Column(name = "is_sign_respon") private Integer isSignRespon; + /** + * 身份类别,0-身份证,1-护照,默认0 + */ + @Column(name = "id_type") + private Integer idType; + /** + * 国籍,0-国内,1-国外,默认0 + */ + @Column(name = "nationality") + private Integer nationality; } \ 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 f8a5593..e814d11 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 @@ -1,5 +1,6 @@ package com.ruoyi.wisdomarbitrate.domain.vo.mscase; +import com.fasterxml.jackson.annotation.JsonFormat; import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAffiliate; import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseApplication; import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAttach; @@ -7,6 +8,7 @@ import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; +import java.util.Date; import java.util.List; /** @@ -77,6 +79,10 @@ public class MsCaseApplicationVO extends MsCaseApplication { * 签名按钮显示,0-显示,1-不显示 */ private Integer signButtonFlag; - + /** + * 结束时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai") + private Date endTime; } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/mscase/MsCaseBatchInsertVO.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/mscase/MsCaseBatchInsertVO.java new file mode 100644 index 0000000..b1fe839 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/mscase/MsCaseBatchInsertVO.java @@ -0,0 +1,19 @@ +package com.ruoyi.wisdomarbitrate.domain.vo.mscase; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Classname MsCaseBatchInsertVO + * @Description 批量新增案件 + * @Version 1.0.0 + * @Date 2024/3/11 10:04 + * @Created wangqiong + */ +@Data +public class MsCaseBatchInsertVO implements Serializable { + private static final long serialVersionUID = 1L; + private List list; +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/mscase/MsCaseLogRecordMapper.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/mscase/MsCaseLogRecordMapper.java index d262e57..3b924bd 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/mscase/MsCaseLogRecordMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/mscase/MsCaseLogRecordMapper.java @@ -6,6 +6,7 @@ import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Select; import tk.mybatis.mapper.common.Mapper; +import java.util.Date; import java.util.List; public interface MsCaseLogRecordMapper extends Mapper { @@ -33,4 +34,13 @@ public interface MsCaseLogRecordMapper extends Mapper { @Select("SELECT group_concat( DISTINCT t.createNickName) createNickName,t.nodeName content,t.nodeId,t.sort ,t.caseStatusName FROM (SELECT l.create_nick_name createNickName ,f.node_name nodeName,f.node_id nodeId, f.sort, f.case_status_name caseStatusName FROM ms_case_log_record l left join ms_case_flow f on l.case_node = f.node_id WHERE l.case_appli_id = #{caseAppliId} and f.node_name is not null ) t group by t.nodeName,t.nodeId,t.sort ,t.caseStatusName order by t.sort ") List selectCaseLogRecordListCaseProgress(Long caseAppliId); + + /** + * 根据案件id查询结束时间 + * @param caseAppliId + * @param caseStatusName + * @return + */ + @Select("SELECT create_time endTime FROM ms_case_log_record where case_appli_id=#{caseAppliId} and case_status_name=#{caseStatusName} order by create_time desc limit 1") + Date selectEndTimeByCaseId(@Param("caseAppliId") Long caseAppliId, @Param("caseStatusName") String caseStatusName); } \ No newline at end of file diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/miniprogress/impl/WeChatUserServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/miniprogress/impl/WeChatUserServiceImpl.java index 21ffb4e..20f9ec5 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/miniprogress/impl/WeChatUserServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/miniprogress/impl/WeChatUserServiceImpl.java @@ -161,6 +161,8 @@ public class WeChatUserServiceImpl implements WeChatUserService { sysUser.setPhonenumber(ientityAuthentication.getPhone()); sysUser.setEmail(ientityAuthentication.getEmail()); sysUser.setCreateBy(ientityAuthentication.getUserName()); + sysUser.setIdType(ientityAuthentication.getIdType()); + sysUser.setNationality(ientityAuthentication.getNationality()); sysUser.setPassword(SecurityUtils.encryptPassword(ientityAuthentication.getPassWord())); int row = sysUserMapper.insertUser(sysUser); if(row<1) { diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/MsCaseApplicationService.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/MsCaseApplicationService.java index a9b451b..5fba594 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/MsCaseApplicationService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/MsCaseApplicationService.java @@ -40,14 +40,27 @@ public interface MsCaseApplicationService { * @param id * @return */ - MsCaseApplicationVO selectById(Long id); + MsCaseApplicationVO selectById(Long id ,String caseNum ); /** * 新增案件 * @param caseApplication * @return */ - int insert(MsCaseApplicationVO caseApplication); + String insert(MsCaseApplicationVO caseApplication); + + /** + * 新增案件 + * @param caseApplication + * @param caseFlow + */ + String insert(MsCaseApplicationVO caseApplication, MsCaseFlow caseFlow); + /** + * 批量新增案件 + * @param vo + * @return + */ + AjaxResult batchInsert(MsCaseBatchInsertVO vo); /** * 新增用户 * @param affiliate @@ -243,4 +256,5 @@ public interface MsCaseApplicationService { */ List getSmsSendRecord(SmsSendRecord smsSendRecord); + } 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 5cc602d..e0d6f45 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 @@ -158,22 +158,20 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService { */ @Override public List list(MsCaseApplicationReq req) { - // admin查询所有案件 - if (StrUtil.equals(SecurityUtils.getUsername(), "admin")) { - startPage(); - List list = msCaseApplicationMapper.list(req, null); - for (MsCaseApplicationVO vo : list) { - vo.setSignButtonFlag(0); - } - return list; - } + // 根据用户查询角色 LoginUser loginUser = SecurityUtils.getLoginUser(); // 根据id查询用户 SysUser sysUser = sysUserMapper.selectUserById(loginUser.getUserId()); List roles = loginUser.getUser().getRoles(); - if (CollectionUtil.isEmpty(roles)) { - throw new ServiceException("该用户未指定角色"); + if (StrUtil.equals(SecurityUtils.getUsername(), "admin")||CollectionUtil.isEmpty(roles)) { + // 如果角色为空,按admin处理,查所有案件 + startPage(); + List list = msCaseApplicationMapper.list(req, null); + for (MsCaseApplicationVO vo : list) { + vo.setSignButtonFlag(0); + } + return list; } req.setUserName(SecurityUtils.getUsername()); req.setContactTelphoneAgent(sysUser.getPhonenumber()); @@ -353,10 +351,29 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService { return vo; } + /** + * 根据案件id或者案件编号查询详情 + * @param id + * @param caseNum + * @param + * @return + */ @Override - public MsCaseApplicationVO selectById(Long id) { + public MsCaseApplicationVO selectById(Long id,String caseNum ) { + // 根据案件id或者案件编号查询详情 MsCaseApplicationVO vo = new MsCaseApplicationVO(); - MsCaseApplication caseApplication = msCaseApplicationMapper.selectByPrimaryKey(id); + MsCaseApplication caseApplication = null; + if(id!=null) { + caseApplication = msCaseApplicationMapper.selectByPrimaryKey(id); + }else { + // 根据案件编号查 + Example example = new Example(MsCaseApplication.class); + example.createCriteria().andEqualTo("caseNum", caseNum); + caseApplication = msCaseApplicationMapper.selectOneByExample(example); + } + if(caseApplication==null){ + return vo; + } BeanUtil.copyProperties(caseApplication, vo); // 查询案件相关人员 MsCaseAffiliate caseAffiliate = msCaseAffiliateMapper.selectByPrimaryKey(id); @@ -369,6 +386,8 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService { vo.setColumnValueList(columnValueVOS); // 查询拒绝原因 vo.setReason(auditMapper.selectByCaseId(id,caseApplication.getCaseFlowId())); + // todo 在日志表查詢结束时间返回 + vo.setEndTime(caseLogRecordMapper.selectEndTimeByCaseId(caseApplication.getId(),"结束")); return vo; } @@ -380,21 +399,36 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService { */ @Transactional @Override - public int insert(MsCaseApplicationVO caseApplication) { + public String insert(MsCaseApplicationVO caseApplication) { + + + // todo 第三方调用该接口,未绑定角色,暂时不根据角色查询流程,根据角色获取案件流程 + /** List caseFlows= selectCaseFlows(); + if (CollectionUtil.isEmpty(caseFlows)) { + throw new ServiceException("该角色未绑定案件流程"); + } + */ + // 设置模板id,根据机构代码查询模板 + Long templateId = getTemplate(); + caseApplication.setTemplateId(templateId); + // 获取第一个流程节点 + MsCaseFlow caseFlow = getCaseFlow(); + return insert(caseApplication,caseFlow); + + } + + /** + * 新增案件 + * @param caseApplication + * @param caseFlow + * @return + */ + @Transactional + @Override + public String insert(MsCaseApplicationVO caseApplication, MsCaseFlow caseFlow) { if (caseApplication.getId() == null) { caseApplication.setId(IdWorkerUtil.getId()); } - - // 根据角色获取案件流程 - List caseFlows= selectCaseFlows(); - if (CollectionUtil.isEmpty(caseFlows)) { - throw new ServiceException("该角色为绑定案件流程"); - } - // 设置模板id,根据机构代码查询模板 - Long templateId = templateManageMapper.selectByCreditCode(creditCode); - caseApplication.setTemplateId(templateId); - - MsCaseFlow caseFlow = caseFlows.get(0); caseApplication.setCaseStatusName(caseFlow.getCaseStatusName()); caseApplication.setCaseFlowId(caseFlow.getId()); caseApplication.setCreateTime(new Date()); @@ -416,51 +450,51 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService { if (msCaseApplicationMapper.insertSelective(caseApplication) > 0) { List caseAttachList = caseApplication.getCaseAttachList(); // 保存案件相关人员 - // 设置申请机构 - if (StrUtil.isNotEmpty(affiliate.getApplicationName())&&affiliate.getOrganizeFlag()==1) { - // 组装申请机构 - // insertDept(affiliate); - // 新增申请机构和代理人 - caseApplicationService.insertAgentUser(affiliate); - }else if(StrUtil.isNotEmpty(affiliate.getApplicationName())&&affiliate.getOrganizeFlag()==0){ - // 查询申请人角色id - Long roleId = roleMapper.selectRoleIdByName("申请人"); - caseApplicationService.insertApplicantUser(affiliate,false,roleId); - caseApplicationService.insertApplicantUser(affiliate,true,roleId); + // 设置申请机构 + if (StrUtil.isNotEmpty(affiliate.getApplicationName())&&affiliate.getOrganizeFlag()==1) { + // 组装申请机构 + // insertDept(affiliate); + // 新增申请机构和代理人 + caseApplicationService.insertAgentUser(affiliate); + }else if(StrUtil.isNotEmpty(affiliate.getApplicationName())&&affiliate.getOrganizeFlag()==0){ + // 查询申请人角色id + Long roleId = roleMapper.selectRoleIdByName("申请人"); + caseApplicationService.insertApplicantUser(affiliate,false,roleId); + caseApplicationService.insertApplicantUser(affiliate,true,roleId); - } - // 压缩包导入,则根据身份证号获取性别和出生日期 - if (caseApplication.isImportFlag() && StrUtil.isNotEmpty(affiliate.getRespondentIdentityNum())) { - setBirthByIdentityNum(affiliate); - } - if (StrUtil.isNotEmpty(affiliate.getAgentEmail())) { - affiliate.setAgentEmail(affiliate.getAgentEmail().replace("\n", "").replaceAll("\\s", "")); - } - if (StrUtil.isNotEmpty(affiliate.getRespondentEmail())) { - affiliate.setRespondentEmail(affiliate.getRespondentEmail().replace("\n", "").replaceAll("\\s", "")); - } - msCaseAffiliateMapper.insert(affiliate); - // 批量生成调解申请书 - MsCaseApplicationReq req = new MsCaseApplicationReq(); - req.setCaseFlowId(caseFlow.getId()); - if(!caseApplication.isImportFlag()) { - req.setId(caseApplication.getId()); - }else { - // 压缩包导入 - req.setBatchNumber(caseApplication.getBatchNumber()); - } - // 生成调解申请书 - if(affiliate.getOrganizeFlag()==0){ - // 自然人 - req.setTemplateType(TemplateTypeEnum.PERSON_MEDIATION_APPLICATION.getCode()); - }else { - // 机构 - req.setTemplateType(TemplateTypeEnum.MEDIATION_APPLICATION.getCode()); - } - req.setTemplateId(String.valueOf(templateId)); - - caseApplicationService.generateApplication(req); + } + // 压缩包导入,则根据身份证号获取性别和出生日期 + if (caseApplication.isImportFlag() && StrUtil.isNotEmpty(affiliate.getRespondentIdentityNum())) { + setBirthByIdentityNum(affiliate); + } + if (StrUtil.isNotEmpty(affiliate.getAgentEmail())) { + affiliate.setAgentEmail(affiliate.getAgentEmail().replace("\n", "").replaceAll("\\s", "")); + } + if (StrUtil.isNotEmpty(affiliate.getRespondentEmail())) { + affiliate.setRespondentEmail(affiliate.getRespondentEmail().replace("\n", "").replaceAll("\\s", "")); + } + msCaseAffiliateMapper.insert(affiliate); + // 批量生成调解申请书 + MsCaseApplicationReq req = new MsCaseApplicationReq(); + req.setCaseFlowId(caseFlow.getId()); + if(!caseApplication.isImportFlag()) { + req.setId(caseApplication.getId()); + }else { + // 压缩包导入 + req.setBatchNumber(caseApplication.getBatchNumber()); + } + // 生成调解申请书 + if(affiliate.getOrganizeFlag()==0){ + // 自然人 + req.setTemplateType(TemplateTypeEnum.PERSON_MEDIATION_APPLICATION.getCode()); + }else { + // 机构 + req.setTemplateType(TemplateTypeEnum.MEDIATION_APPLICATION.getCode()); + } + req.setTemplateId(String.valueOf(caseApplication.getTemplateId())); + // todo 部署放开 + caseApplicationService.generateApplication(req); // 保存案件附件 if (CollectionUtil.isNotEmpty(caseAttachList)) { for (MsCaseAttach caseAttach : caseAttachList) { @@ -482,10 +516,61 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService { columnValueMapper.batchSave(columnValueList); } CaseLogUtils.insertCaseLog(caseApplication.getId(), 0, "新增案件", ""); - return 1; + return caseApplication.getCaseNum(); } - return 0; + return ""; + } + + /** + * 获取第一个流程节点 + * @return + */ + private MsCaseFlow getCaseFlow() { + + // 查询所有流程节点 + Example flowExample = new Example(MsCaseFlow.class); + flowExample.setOrderByClause("sort asc"); + List caseFlows = caseFlowMapper.selectByExample(flowExample); + if (CollectionUtil.isEmpty(caseFlows)) { + throw new ServiceException("请先配置流程"); + } + return caseFlows.get(0); + } + + /** + * 获取模板id + * @return + */ + private Long getTemplate() { + + return templateManageMapper.selectByCreditCode(creditCode); + } + + /** + * 批量新增 + * @param vo + * @return + */ + @Transactional + @Override + public AjaxResult batchInsert(MsCaseBatchInsertVO vo) { + if(CollectionUtil.isEmpty(vo.getList())){ + return AjaxResult.error("案件不能为空"); + } + // 设置模板id,根据机构代码查询模板 + Long templateId = getTemplate(); + // 获取第一个流程节点 + MsCaseFlow caseFlow = getCaseFlow(); + List caseNumList = new ArrayList<>(); + for (MsCaseApplicationVO caseApplicationVO : vo.getList()) { + caseApplicationVO.setTemplateId(templateId); + String caseNum = caseApplicationService.insert(caseApplicationVO, caseFlow); + caseNumList.add(caseNum); + } + AjaxResult success = AjaxResult.success(); + success.put("caseNumList",caseNumList); + return success; } /** @@ -518,6 +603,8 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService { sysUser.setNickName(name); sysUser.setPhonenumber(phone); sysUser.setPassword(SecurityUtils.encryptPassword("abc123456")); + sysUser.setIdType(affiliate.getIdType()); + sysUser.setNationality(affiliate.getNationality()); sysUser.setCreateBy(SecurityUtils.getUsername()); userMapper.insertUser(sysUser); userRoleMapper.insertUserRole(sysUser.getUserId(), roleId); @@ -565,7 +652,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService { example.createCriteria().andIn("roleid", roles.stream().map(SysRole::getRoleId).collect(Collectors.toList())); List caseFlowRoleRelatedList = caseFlowRoleRelatedMapper.selectByExample(example); if (CollectionUtil.isEmpty(caseFlowRoleRelatedList)) { - throw new ServiceException("该角色为绑定案件流程"); + throw new ServiceException("该角色未绑定案件流程"); } Example flowExample = new Example(MsCaseFlow.class); flowExample.setOrderByClause("sort asc"); @@ -1672,7 +1759,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService { if (CollectionUtil.isEmpty(users)) { return AjaxResult.error("暂无调解员"); } - // todo 根据角色查询是否已经选择了调解员进行回显 + // 根据角色查询是否已经选择了调解员进行回显 List userIds = users.stream().map(SysUser::getUserId).collect(Collectors.toList()); // 状态为未结束的是待办数量,结束的是已办数量 Map> caseMap=null; @@ -3887,6 +3974,8 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService { agentUser.setNickName(affiliate.getNameAgent()); agentUser.setPhonenumber(affiliate.getContactTelphoneAgent()); agentUser.setPassword(SecurityUtils.encryptPassword("abc123456")); + agentUser.setNationality(affiliate.getNationality()); + agentUser.setIdType(affiliate.getIdType()); // agentUser.setDeptId(Long.valueOf(affiliate.getApplicationId())); userMapper.insertUser(agentUser); userRoleMapper.insertUserRole(agentUser.getUserId(), roleId); diff --git a/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml index a51e431..b303ede 100644 --- a/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml @@ -9,6 +9,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + @@ -50,7 +52,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select u.user_id, u.user_name, u.nick_name,u.specialty, u.id_card,u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, - r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status,u.id_card + r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status,u.id_card,u.id_type,u.nationality from ms_sys_user u left join ms_sys_user_role ur on u.user_id = ur.user_id left join ms_sys_role r on r.role_id = ur.role_id @@ -200,6 +202,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" user_name, nick_name, id_card, + id_type, + nationality, email, avatar, phonenumber, @@ -216,6 +220,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{userName}, #{nickName}, #{idCard}, + #{idType}, + #{nationality}, #{email}, #{avatar}, #{phonenumber}, @@ -272,6 +278,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" user_name = #{userName}, nick_name = #{nickName}, id_card = #{idCard}, + id_type = #{idType}, + nationality = #{nationality}, email = #{email}, phonenumber = #{phonenumber}, sex = #{sex}, -- 2.54.0 From 619734469ddb48d9c114f4adc9e52eecc916f372 Mon Sep 17 00:00:00 2001 From: qitz <18810291185@163.com> Date: Wed, 13 Mar 2024 14:41:46 +0800 Subject: [PATCH 04/15] =?UTF-8?q?=E5=AE=9E=E7=8E=B0=E7=AD=BE=E7=BD=B2?= =?UTF-8?q?=E5=9B=9E=E8=B0=83=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mscase/MsSignSealController.java | 20 ++ .../src/main/resources/application.yml | 3 + .../service/mscase/MsSignSealService.java | 3 + .../mscase/impl/MsSignSealServiceImpl.java | 287 ++++++++++++++++++ .../wisdomarbitrate/utils/DigesdateUtils.java | 51 ++++ .../utils/FixSelectFlowDetailUtils.java | 2 +- .../wisdomarbitrate/utils/SignAward.java | 6 +- .../utils/SignVerifyUtils.java | 99 ++++++ 8 files changed, 469 insertions(+), 2 deletions(-) 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/wisdomarbitrate/mscase/MsSignSealController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/mscase/MsSignSealController.java index 69098d0..8e96a71 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 @@ -2,6 +2,8 @@ package com.ruoyi.web.controller.wisdomarbitrate.mscase; import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.util.StrUtil; +import cn.hutool.json.JSONUtil; +import com.ruoyi.common.annotation.Anonymous; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.exception.EsignDemoException; @@ -10,6 +12,8 @@ import com.ruoyi.wisdomarbitrate.domain.dto.mscase.SealSignRecord; import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseApplicationVO; import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseLogRecordVO; import com.ruoyi.wisdomarbitrate.service.mscase.MsSignSealService; +import com.ruoyi.wisdomarbitrate.utils.SignVerifyUtils; +import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.PostMapping; @@ -57,6 +61,22 @@ public class MsSignSealController extends BaseController { return success(sealUrlRecordselect); } + /** + * 签名用印回调 + */ + @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"); + } + + } + /** * 查询案件进度 */ diff --git a/ruoyi-admin/src/main/resources/application.yml b/ruoyi-admin/src/main/resources/application.yml index aa0993a..0199305 100644 --- a/ruoyi-admin/src/main/resources/application.yml +++ b/ruoyi-admin/src/main/resources/application.yml @@ -191,6 +191,9 @@ organizeConfig: # 引入仲裁系统url配置 arbitrateConfig: url: http://121.40.189.20:9001/callArbitrateCaseApplication/generateCaseApplication +# 回调通知 +signSealCallbackConfig: + url: http://121.40.189.20:6001/mssignSeal/signSeaalCaseApplicaCallback #jodconverter: # local: # host: 121.40.189.20 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 8ed426d..82f07d4 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 @@ -7,6 +7,7 @@ import com.ruoyi.wisdomarbitrate.domain.dto.mscase.SealSignRecord; import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseApplicationVO; import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseLogRecordVO; +import java.io.IOException; import java.util.List; public interface MsSignSealService { @@ -34,4 +35,6 @@ public interface MsSignSealService { AjaxResult msCaseSignUrlApplyAPP(MsSignSealDTO dto) throws EsignDemoException; AjaxResult msCaseSignUrlResAPP(MsSignSealDTO dto) throws EsignDemoException; + + AjaxResult signSeaalCaseApplicaCallback(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 b1f26c8..82433af 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 @@ -60,6 +60,7 @@ import tk.mybatis.mapper.entity.Example; import javax.annotation.Resource; import java.io.File; +import java.io.IOException; import java.time.LocalDate; import java.util.*; import java.util.stream.Collectors; @@ -83,6 +84,8 @@ public class MsSignSealServiceImpl implements MsSignSealService { MsCaseFlowMapper caseFlowMapper; @Autowired private SysUserMapper userMapper; + @Autowired + private MsCaseAttachMapper caseAttachMapper; @Autowired private SysUserMapper sysUserMapper; @@ -1008,6 +1011,290 @@ public class MsSignSealServiceImpl implements MsSignSealService { return AjaxResult.success(sealSignRecordres); } + @Override + @Transactional(rollbackFor = Exception.class) + public AjaxResult signSeaalCaseApplicaCallback(String reqbodystr) throws EsignDemoException, IOException { + + System.out.println("请求参数reqbodystr:----------->>>>>>"+reqbodystr); + + JSONObject jsonObjectCallback = JSONObject.parseObject(reqbodystr); + Gson gson = new Gson(); + if (jsonObjectCallback != null) { + 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"); + + System.out.println("请求参数signResult:----------->>>>>>"+signResult); + System.out.println("请求参数action:---------->>>>>>"+action); + System.out.println("请求参数signFlowId:---------->>>>>>"+signFlowId); + System.out.println("请求参数accountMobile:---------->>>>>>"+accountMobile); + + Example msSealSignRecordExample = new Example(MsSealSignRecord.class); + msSealSignRecordExample.createCriteria().andEqualTo("signFlowId", signFlowId); + MsSealSignRecord sealSignRecordsel = sealSignRecordMapper.selectOneByExample(msSealSignRecordExample); + + String pensonAccountApply = sealSignRecordsel.getPensonAccount(); + String orgnNamePsnAcc = sealSignRecordsel.getOrgnNamePsnAcc(); + String pensonAccountRes = sealSignRecordsel.getPensonAccountRes(); + String pensonAccountMedi = sealSignRecordsel.getPensonAccountMedi(); + + Integer signStatusApply = sealSignRecordsel.getSignStatusApply(); + Integer signStatusResponse = sealSignRecordsel.getSignStatusResponse(); + Integer signStatusMediator = sealSignRecordsel.getSignStatusMediator(); + Integer sealStatus = sealSignRecordsel.getSealStatus(); + + Long caseAppliId = sealSignRecordsel.getCaseAppliId(); + MsCaseApplication caseApplicationselect = msCaseApplicationMapper.selectByPrimaryKey(caseAppliId); + Integer mediaResult = caseApplicationselect.getMediaResult(); + + if("SIGN_MISSON_COMPLETE".equals(action) && signResult==2){ + if(mediaResult.intValue()==1){ + //调解 + if(StringUtils.isNotEmpty(accountMobile)&&accountMobile.equals(pensonAccountApply)){ + //申请人签名 + sealSignRecordsel.setSignStatusApply(1); + sealSignRecordMapper.updateByPrimaryKeySelective(sealSignRecordsel); + if(signStatusResponse!=null&&signStatusResponse.intValue()==1&& + signStatusMediator!=null&&signStatusMediator.intValue()==1){ + // 根据流程id查找下一个流程节点 + MsCaseFlow nextFlow = caseFlowMapper.nextFlow(caseApplicationselect.getCaseFlowId().intValue()); + MsCaseApplication application = new MsCaseApplication(); + application.setId(caseApplicationselect.getId()); + application.setCaseFlowId(nextFlow.getId()); + application.setCaseStatusName(nextFlow.getCaseStatusName()); + caseApplicationMapper.updateByPrimaryKeySelective(application); + + //修改"签署用印记录表"的状态为待用印 + sealSignRecordsel.setSignFlowStatus(2); + sealSignRecordMapper.updateByPrimaryKeySelective(sealSignRecordsel); + } + }else if(StringUtils.isNotEmpty(accountMobile)&&accountMobile.equals(pensonAccountRes)){ + //被申请人签名 + sealSignRecordsel.setSignStatusResponse(1); + sealSignRecordMapper.updateByPrimaryKeySelective(sealSignRecordsel); + if(signStatusApply!=null&&signStatusApply.intValue()==1&& + signStatusMediator!=null&&signStatusMediator.intValue()==1){ + // 根据流程id查找下一个流程节点 + MsCaseFlow nextFlow = caseFlowMapper.nextFlow(caseApplicationselect.getCaseFlowId().intValue()); + MsCaseApplication application = new MsCaseApplication(); + application.setId(caseApplicationselect.getId()); + application.setCaseFlowId(nextFlow.getId()); + application.setCaseStatusName(nextFlow.getCaseStatusName()); + caseApplicationMapper.updateByPrimaryKeySelective(application); + + //修改"签署用印记录表"的状态为待用印 + sealSignRecordsel.setSignFlowStatus(2); + sealSignRecordMapper.updateByPrimaryKeySelective(sealSignRecordsel); + } + }else if(StringUtils.isNotEmpty(accountMobile)&&accountMobile.equals(pensonAccountMedi)){ + //调解员签名 + sealSignRecordsel.setSignStatusMediator(1); + sealSignRecordMapper.updateByPrimaryKeySelective(sealSignRecordsel); + if(signStatusApply!=null&&signStatusApply.intValue()==1&& + signStatusResponse!=null&&signStatusResponse.intValue()==1){ + // 根据流程id查找下一个流程节点 + MsCaseFlow nextFlow = caseFlowMapper.nextFlow(caseApplicationselect.getCaseFlowId().intValue()); + MsCaseApplication application = new MsCaseApplication(); + application.setId(caseApplicationselect.getId()); + application.setCaseFlowId(nextFlow.getId()); + application.setCaseStatusName(nextFlow.getCaseStatusName()); + caseApplicationMapper.updateByPrimaryKeySelective(application); + + //修改"签署用印记录表"的状态为待用印 + sealSignRecordsel.setSignFlowStatus(2); + sealSignRecordMapper.updateByPrimaryKeySelective(sealSignRecordsel); + } + }else if(StringUtils.isNotEmpty(accountMobile)&&accountMobile.equals(orgnNamePsnAcc)){ + sealSignRecordsel.setSealStatus(1); + sealSignRecordsel.setSignFlowStatus(3); + sealSignRecordMapper.updateByPrimaryKeySelective(sealSignRecordsel); + + // 根据流程id查找下一个流程节点 + MsCaseFlow nextFlow = caseFlowMapper.nextFlow(caseApplicationselect.getCaseFlowId().intValue()); + MsCaseApplication application = new MsCaseApplication(); + application.setId(caseApplicationselect.getId()); + application.setCaseFlowId(nextFlow.getId()); + application.setCaseStatusName(nextFlow.getCaseStatusName()); + caseApplicationMapper.updateByPrimaryKeySelective(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(); + 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/"; + String saveName = fileName; + String savePath = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName; + + // 创建日期目录 + 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) { + MsCaseAttach caseAttach = new MsCaseAttach(); + caseAttach.setCaseAppliId(caseAppliId); + caseAttach.setAnnexType(7); + caseAttach.setAnnexPath(savePath); + caseAttach.setAnnexName(saveName); + caseAttachMapper.updateCaseAttachBycaseid(caseAttach); + } + + } + } + + }else if(mediaResult.intValue()==5){ + //和解 + if(StringUtils.isNotEmpty(accountMobile)&&accountMobile.equals(pensonAccountApply)){ + //申请人签名 + sealSignRecordsel.setSignStatusApply(1); + sealSignRecordMapper.updateByPrimaryKeySelective(sealSignRecordsel); + if(signStatusResponse!=null&&signStatusResponse.intValue()==1){ + MsCaseFlow nextFlow = caseFlowMapper.nextFlow1(caseApplicationselect.getCaseFlowId().intValue()); + MsCaseApplication application = new MsCaseApplication(); + application.setId(caseApplicationselect.getId()); + application.setCaseFlowId(nextFlow.getId()); + application.setCaseStatusName(nextFlow.getCaseStatusName()); + caseApplicationMapper.updateByPrimaryKeySelective(application); + + //修改"签署用印记录表"的状态为完成 + sealSignRecordsel.setSignFlowStatus(3); + sealSignRecordMapper.updateByPrimaryKeySelective(sealSignRecordsel); + + //下载审核完成的调解书 + 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(); + 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/"; + String saveName = fileName; + String savePath = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName; + + // 创建日期目录 + 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) { + MsCaseAttach caseAttach = new MsCaseAttach(); + caseAttach.setCaseAppliId(caseAppliId); + caseAttach.setAnnexType(7); + caseAttach.setAnnexPath(savePath); + caseAttach.setAnnexName(saveName); + caseAttachMapper.updateCaseAttachBycaseid(caseAttach); + } + + } + } + }else if(StringUtils.isNotEmpty(accountMobile)&&accountMobile.equals(pensonAccountRes)){ + //被申请人签名 + sealSignRecordsel.setSignStatusResponse(1); + sealSignRecordMapper.updateByPrimaryKeySelective(sealSignRecordsel); + if(signStatusApply!=null&&signStatusApply.intValue()==1){ + MsCaseFlow nextFlow = caseFlowMapper.nextFlow1(caseApplicationselect.getCaseFlowId().intValue()); + MsCaseApplication application = new MsCaseApplication(); + application.setId(caseApplicationselect.getId()); + application.setCaseFlowId(nextFlow.getId()); + application.setCaseStatusName(nextFlow.getCaseStatusName()); + caseApplicationMapper.updateByPrimaryKeySelective(application); + + //修改"签署用印记录表"的状态为完成 + sealSignRecordsel.setSignFlowStatus(3); + sealSignRecordMapper.updateByPrimaryKeySelective(sealSignRecordsel); + + //下载审核完成的调解书 + 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(); + 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/"; + String saveName = fileName; + String savePath = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName; + + // 创建日期目录 + 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) { + MsCaseAttach caseAttach = new MsCaseAttach(); + caseAttach.setCaseAppliId(caseAppliId); + caseAttach.setAnnexType(7); + caseAttach.setAnnexPath(savePath); + caseAttach.setAnnexName(saveName); + caseAttachMapper.updateCaseAttachBycaseid(caseAttach); + } + + } + } + } + } + } + + }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..4d60115 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/DigesdateUtils.java @@ -0,0 +1,51 @@ +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'); + }else { + 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 2ba57da..8435211 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 @@ -243,7 +243,7 @@ public class FixSelectFlowDetailUtils { /* 定时查询签署流程详情 */ - @Scheduled(cron = "0/10 * * * * ?") +// @Scheduled(cron = "0/10 * * * * ?") @Transactional public void fixExecuteSelectFlowDetailUtils() { Gson gson = new Gson(); diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/SignAward.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/SignAward.java index 91990d3..f213fb7 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/SignAward.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/SignAward.java @@ -12,6 +12,7 @@ import com.ruoyi.common.utils.SealUtil; import com.ruoyi.wisdomarbitrate.domain.dto.dept.DeptIdentify; import com.ruoyi.wisdomarbitrate.domain.dto.mscase.SealSignRecord; import com.ruoyi.wisdomarbitrate.domain.vo.base.StringIdsReq; +import org.springframework.beans.factory.annotation.Value; import java.util.List; import java.util.Map; @@ -22,6 +23,9 @@ public class SignAward { private static String eSignAppId = EsignApplicaConfig.EsignAppId; private static String eSignAppSecret = EsignApplicaConfig.EsignAppSecret; + @Value("${signSealCallbackConfig.url}") + private static String signSealCallbackUrl; + public static void main(String[] args) throws EsignDemoException { Gson gson = new Gson(); @@ -351,7 +355,7 @@ public class SignAward { " \"signConfig\": {\n" + " \"availableSignClientTypes\": \"1\"\n" + " },\n" + - + " \"notifyUrl\": \"" + signSealCallbackUrl + "\",\n" + " \"autoFinish\": true\n" + " },\n" + 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..a5e6168 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/SignVerifyUtils.java @@ -0,0 +1,99 @@ +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); + + System.out.println("请求参数timestampreq:----------->>>>>>"+timestampreq); + System.out.println("请求参数reqQuerystr:---------->>>>>>"+reqQuerystr); + System.out.println("请求参数reqbodystr:---------->>>>>>"+reqbodystr); + System.out.println("加密出来的签名值:----------->>>>>>"+newDisgSignuter); + System.out.println("header里面的签名值:---------->>>>>>"+orialsignature); + + 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; + } + System.out.println("获取请求字符串是:---"+httpreqQuery); + 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; + } + + + + + + + + + + + + + +} -- 2.54.0 From 92c619f1232b76ff85cc2c27e537ffe839fb0454 Mon Sep 17 00:00:00 2001 From: 18792927508 <1322446236@qq.com> Date: Wed, 13 Mar 2024 14:52:04 +0800 Subject: [PATCH 05/15] onlyoffice --- .../mscase/MsCaseApplicationController.java | 13 +++ .../src/main/resources/application.yml | 6 +- .../domain/entity/mscase/MsCaseAttach.java | 6 +- .../mscase/MsCaseApplicationService.java | 13 ++- .../impl/MsCaseApplicationServiceImpl.java | 101 +++++++++++++++--- .../mscase/MsCaseAttachMapper.xml | 18 ++-- 6 files changed, 126 insertions(+), 31 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/mscase/MsCaseApplicationController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/mscase/MsCaseApplicationController.java index 5ce9196..5ad30ad 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/mscase/MsCaseApplicationController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/mscase/MsCaseApplicationController.java @@ -412,4 +412,17 @@ public class MsCaseApplicationController extends BaseController { List list = caseApplicationService.getSmsSendRecord(smsSendRecord); return getDataTable(list); } + /** + * 保存onlyOffice在线编辑的文件 + * @param + * @return + */ + @GetMapping("/saveOnlyOfficeFile") + public AjaxResult saveOnlyOfficeFile( @RequestBody MsCaseAttach caseAttach) { + if(caseAttach.getCaseAppliId()==null||StrUtil.isEmpty(caseAttach.getOnlyOfficeFileId())||StrUtil.isEmpty(caseAttach.getAnnexPath())){ + return error("参数校验失败"); + } + + return caseApplicationService.saveOnlyOfficeFile(caseAttach); + } } diff --git a/ruoyi-admin/src/main/resources/application.yml b/ruoyi-admin/src/main/resources/application.yml index 0199305..c5f02d1 100644 --- a/ruoyi-admin/src/main/resources/application.yml +++ b/ruoyi-admin/src/main/resources/application.yml @@ -18,7 +18,7 @@ ruoyi: # 开发环境配置 server: # 测试环境6001,开发环境7001 - port: 7001 + port: 6001 servlet: # 应用的访问路径 context-path: / @@ -194,6 +194,10 @@ arbitrateConfig: # 回调通知 signSealCallbackConfig: url: http://121.40.189.20:6001/mssignSeal/signSeaalCaseApplicaCallback +# onlyOffice系统url配置 +onlyOfficeConfig: +# url: http://172.16.0.254:9090/files/upload + url: http://121.40.189.20:9090/files/upload #jodconverter: # local: # host: 121.40.189.20 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 d4b9c46..b0c4c49 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 @@ -73,8 +73,8 @@ public class MsCaseAttach { private Long sealStatus; /** - * 是否是证据上传,0-否,1-是 + * onlyOffice附件id */ - @Column(name = "is_batch_upload") - private Long isBatchUpload; + @Column(name = "only_office_file_id") + private String onlyOfficeFileId; } \ No newline at end of file diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/MsCaseApplicationService.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/MsCaseApplicationService.java index 5fba594..5a488f5 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/MsCaseApplicationService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/MsCaseApplicationService.java @@ -1,5 +1,6 @@ package com.ruoyi.wisdomarbitrate.service.mscase; +import com.alibaba.fastjson.JSONArray; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.entity.SysDictData; import com.ruoyi.common.core.domain.entity.SysUser; @@ -219,6 +220,11 @@ public interface MsCaseApplicationService { * @param dictDataList 内置字段 */ void createMediateApplication(MsCaseApplication application, MsCaseAffiliate affiliate, String templatePath, List bookmarkList, List dictDataList, Integer templateType) ; + /** + * 调解书上传到onlyoffice服务器 + * @param annexPath + */ + JSONArray uploadOnlyOffice(String annexPath); /** * 案件受理 * @param application @@ -255,6 +261,11 @@ public interface MsCaseApplicationService { * @return */ List getSmsSendRecord(SmsSendRecord smsSendRecord); + /** + * 保存onlyOffice在线编辑的文件 + * @param + * @return + */ - + AjaxResult saveOnlyOfficeFile(MsCaseAttach caseAttach); } 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 e0d6f45..4893459 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 @@ -5,6 +5,7 @@ import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.util.StrUtil; import cn.hutool.http.HttpRequest; import cn.hutool.http.HttpResponse; +import cn.hutool.http.HttpUtil; import cn.hutool.json.JSONUtil; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; @@ -47,7 +48,6 @@ import com.ruoyi.wisdomarbitrate.mapper.template.FatchRuleMapper; import com.ruoyi.wisdomarbitrate.mapper.template.TemplateManageMapper; import com.ruoyi.wisdomarbitrate.service.mscase.MsCaseApplicationService; import com.ruoyi.wisdomarbitrate.utils.*; - import org.apache.pdfbox.pdmodel.PDDocument; import org.apache.poi.xwpf.usermodel.XWPFDocument; import org.springframework.beans.BeanUtils; @@ -92,6 +92,8 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService { @Value("${arbitrateConfig.url}") private String arbitrateUrl; + @Value("${onlyOfficeConfig.url}") + private String onlyOfficeUrl; @Autowired MsCaseApplicationService caseApplicationService; @Autowired @@ -1548,7 +1550,6 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService { .annexType(annexType) .useId(SecurityUtils.getUserId()) .useAccount(SecurityUtils.getUsername()) - .isBatchUpload(1L) .build(); int count = msCaseAttachMapper.save(caseAttach); if (count > 0 ) { @@ -2154,6 +2155,25 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService { public List getSmsSendRecord(SmsSendRecord smsSendRecord) { return smsRecordMapper.getSmsSendRecord(smsSendRecord); } + /** + * 保存onlyOffice在线编辑的文件 + * @param + * @return + */ + @Transactional + @Override + public AjaxResult saveOnlyOfficeFile(MsCaseAttach caseAttach) { + if(StrUtil.isEmpty(caseAttach.getAnnexName())){ + caseAttach.setAnnexName("调解书"); + caseAttach.setAnnexType(AnnexTypeEnum.MEDIATE_BOOK.getCode()); + caseAttach.setUseId(getUserInfo().getUserId()); + caseAttach.setUseAccount(getUserInfo().getUserName()); + // 先删除之前的在新增 + msCaseAttachMapper.deleteCaseAttachByCasedIdAndType(caseAttach.getCaseAppliId(), caseAttach.getAnnexType()); + msCaseAttachMapper.save(caseAttach); + } + return AjaxResult.success(); + } /** * 查询预约信息 @@ -2224,10 +2244,11 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService { if (caseAttachList != null && caseAttachList.size() > 0) { for (MsCaseAttach caseAttach : caseAttachList) { if (caseAttach.getAnnexType() == AnnexTypeEnum.MEDIATE_BOOK.getCode()) { - String prefix = "/profile"; - int startIndex = prefix.length(); + // String prefix = "/profile"; + // int startIndex = prefix.length(); String annexPath = caseAttach.getAnnexPath(); - String path = "/home/ruoyi/uploadPath/" + annexPath.substring(startIndex+1); + // String path = "/home/ruoyi/uploadPath/" + annexPath.substring(startIndex+1); + String path = annexPath; //获取文件上传地址 EsignHttpResponse response = SaaSAPIFileUtils.getUploadUrl(path); String body = response.getBody(); @@ -2635,10 +2656,11 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService { if (caseAttachList != null && caseAttachList.size() > 0) { for (MsCaseAttach caseAttach : caseAttachList) { if (caseAttach.getAnnexType() == AnnexTypeEnum.MEDIATE_BOOK.getCode()) { - String prefix = "/profile"; - int startIndex = prefix.length(); + // String prefix = "/profile"; + // int startIndex = prefix.length(); String annexPath = caseAttach.getAnnexPath(); - String path = "/home/ruoyi/uploadPath/" + annexPath.substring(startIndex+1); +// String path = "/home/ruoyi/uploadPath/" + annexPath.substring(startIndex+1); + String path = annexPath; //获取文件上传地址 EsignHttpResponse response = SaaSAPIFileUtils.getUploadUrl(path); String body = response.getBody(); @@ -3729,15 +3751,62 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService { // 将word中的标签替换掉,生成新的word wordChangeText(templatePath, bookmarkValueMap,saveFolderPath,resultFilePath); - MsCaseAttach caseAttach = MsCaseAttach.builder() - .caseAppliId(application.getId()) - .annexName(orgFileName+".docx") - .annexPath(resultFilePath.replace(RuoYiConfig.getProfile(),Constants.RESOURCE_PREFIX)) - .annexType(annexType) - .build(); + MsCaseAttach caseAttach = null; + String annexPath=resultFilePath.replace(RuoYiConfig.getProfile(),Constants.RESOURCE_PREFIX); + // 如果是调解书或者调解协议上传到onlyoffice服务器 + if(annexType != null && annexType.equals(AnnexTypeEnum.MEDIATE_BOOK.getCode())){ + JSONArray jsonArray = caseApplicationService.uploadOnlyOffice(annexPath); + if(jsonArray!=null && jsonArray.size() > 0){ + for (Object obj : jsonArray) { + JSONObject jsonObject = (JSONObject) obj; + caseAttach= MsCaseAttach.builder() + .caseAppliId(application.getId()) + .annexName(jsonObject.getString("fileName")) + .annexPath(jsonObject.getString("filePath")) + .annexType(annexType) + .onlyOfficeFileId(jsonObject.getString("fileId")) + .build(); + + } + } + + } //保存到附件表里,先删除之前的在保存 - msCaseAttachMapper.deleteCaseAttachByCasedIdAndType(caseAttach.getCaseAppliId(), annexType); - msCaseAttachMapper.save(caseAttach); + if(caseAttach != null) { + msCaseAttachMapper.deleteCaseAttachByCasedIdAndType(caseAttach.getCaseAppliId(), annexType); + msCaseAttachMapper.save(caseAttach); + } + } + + /** + * 调解书上传到onlyoffice服务器 + * @param annexPath + */ + @Override + @Transactional + public JSONArray uploadOnlyOffice(String annexPath) { + annexPath=annexPath.replace("/profile","/home/ruoyi/uploadPath"); + File file = new File(annexPath); + if (file.exists()) { + // 调用onlyoffice +// String url = "http://121.40.189.20:9090/files/upload"; + try { + Map params = new HashMap<>(); + params.put("file", file); + String postResult = HttpUtil.post(onlyOfficeUrl, params); + if(StrUtil.isNotEmpty(postResult)){ + // 转为jsonArray + JSONArray jsonArray = JSONArray.parseArray(postResult); + + return jsonArray; + } + } catch (Exception e) { + throw new ServiceException("上传OnlyOffice服务器失败"); + } + }else { + throw new ServiceException("文件不存在"); + } +return null; } /** 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 587e500..23a8c3f 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/mscase/MsCaseAttachMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/mscase/MsCaseAttachMapper.xml @@ -13,18 +13,19 @@ + - INSERT INTO ms_case_attach (case_appli_id, annex_name, annex_path , annex_type,note,use_id,use_account,seal_status,is_batch_upload) - VALUES (#{caseAppliId}, #{annexName}, #{annexPath},#{annexType},#{note},#{useId},#{useAccount},#{sealStatus},#{isBatchUpload}) + 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,is_batch_upload) + 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 - (#{item.caseAppliId}, #{item.annexName}, #{item.annexPath},#{item.annexType},#{item.note},#{item.useId},#{item.useAccount},#{item.sealStatus},#{item.isBatchUpload}) + (#{item.caseAppliId}, #{item.annexName}, #{item.annexPath},#{item.annexType},#{item.note},#{item.useId},#{item.useAccount},#{item.sealStatus},#{item.onlyOfficeFileId}) @@ -38,19 +39,16 @@ delete from ms_case_attach where case_appli_id = #{caseAppliId} and annex_type = #{annexType} - - AND is_batch_upload = #{isBatchUpload} - - select annex_id,case_appli_id,annex_name,annex_path,annex_type,note,use_id,use_account + select * from ms_case_attach -- 2.54.0 From d7d48a3ff38df62a2c56699176dd4e7a5cf97b12 Mon Sep 17 00:00:00 2001 From: qitz <18810291185@163.com> Date: Thu, 14 Mar 2024 10:46:47 +0800 Subject: [PATCH 06/15] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=9B=9E=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ruoyi/wisdomarbitrate/utils/DigesdateUtils.java | 9 ++------- .../com/ruoyi/wisdomarbitrate/utils/SignVerifyUtils.java | 6 ++++++ 2 files changed, 8 insertions(+), 7 deletions(-) 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 index 4d60115..f3f87d0 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/DigesdateUtils.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/DigesdateUtils.java @@ -33,11 +33,9 @@ public class DigesdateUtils { String stmpHex; for (int n = 0; byteArrayData != null && n < byteArrayData.length; n++) { stmpHex = Integer.toHexString(byteArrayData[n] & 0XFF); - if (stmpHex.length() == 1){ + if (stmpHex.length() == 1) hashBuilder.append('0'); - }else { - hashBuilder.append(stmpHex); - } + hashBuilder.append(stmpHex); } return hashBuilder.toString(); } @@ -45,7 +43,4 @@ public class DigesdateUtils { - - - } 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 index a5e6168..a0b7258 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/SignVerifyUtils.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/SignVerifyUtils.java @@ -2,6 +2,9 @@ package com.ruoyi.wisdomarbitrate.utils; import com.ruoyi.common.utils.EsignApplicaConfig; import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.wisdomarbitrate.service.miniprogress.impl.IdentityAuthenticationServiceImpl; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.web.context.request.RequestContextHolder; import org.springframework.web.context.request.ServletRequestAttributes; @@ -17,6 +20,7 @@ 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"); @@ -40,6 +44,8 @@ public class SignVerifyUtils { } } + + public static String getHttpreqQuery() { HttpServletRequest httprequest = ((ServletRequestAttributes) (RequestContextHolder.currentRequestAttributes())).getRequest(); List reqNames= new ArrayList(); -- 2.54.0 From abeca57c83490cfce6897015d9ead048e752f554 Mon Sep 17 00:00:00 2001 From: qitz <18810291185@163.com> Date: Thu, 14 Mar 2024 16:13:22 +0800 Subject: [PATCH 07/15] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=AD=BE=E7=BD=B2?= =?UTF-8?q?=E5=9B=9E=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/mscase/impl/MsSignSealServiceImpl.java | 8 -------- .../com/ruoyi/wisdomarbitrate/utils/SignVerifyUtils.java | 6 ------ 2 files changed, 14 deletions(-) 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 82433af..daf8014 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 @@ -1014,9 +1014,6 @@ public class MsSignSealServiceImpl implements MsSignSealService { @Override @Transactional(rollbackFor = Exception.class) public AjaxResult signSeaalCaseApplicaCallback(String reqbodystr) throws EsignDemoException, IOException { - - System.out.println("请求参数reqbodystr:----------->>>>>>"+reqbodystr); - JSONObject jsonObjectCallback = JSONObject.parseObject(reqbodystr); Gson gson = new Gson(); if (jsonObjectCallback != null) { @@ -1028,11 +1025,6 @@ public class MsSignSealServiceImpl implements MsSignSealService { JSONObject psnAccount = operator.getJSONObject("psnAccount"); String accountMobile = psnAccount.getString("accountMobile"); - System.out.println("请求参数signResult:----------->>>>>>"+signResult); - System.out.println("请求参数action:---------->>>>>>"+action); - System.out.println("请求参数signFlowId:---------->>>>>>"+signFlowId); - System.out.println("请求参数accountMobile:---------->>>>>>"+accountMobile); - Example msSealSignRecordExample = new Example(MsSealSignRecord.class); msSealSignRecordExample.createCriteria().andEqualTo("signFlowId", signFlowId); MsSealSignRecord sealSignRecordsel = sealSignRecordMapper.selectOneByExample(msSealSignRecordExample); 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 index a0b7258..73830f5 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/SignVerifyUtils.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/SignVerifyUtils.java @@ -31,11 +31,6 @@ public class SignVerifyUtils { String signOriaData = timestampreq + reqQuerystr + reqbodystr; String newDisgSignuter= DigesdateUtils.getSignStr(signOriaData, eSignAppSecret); - System.out.println("请求参数timestampreq:----------->>>>>>"+timestampreq); - System.out.println("请求参数reqQuerystr:---------->>>>>>"+reqQuerystr); - System.out.println("请求参数reqbodystr:---------->>>>>>"+reqbodystr); - System.out.println("加密出来的签名值:----------->>>>>>"+newDisgSignuter); - System.out.println("header里面的签名值:---------->>>>>>"+orialsignature); if (StringUtils.equals(orialsignature, newDisgSignuter)) { return true; @@ -59,7 +54,6 @@ public class SignVerifyUtils { String reqvalue = httprequest.getParameter(reqName); httpreqQuery += reqvalue == null ? "" : reqvalue; } - System.out.println("获取请求字符串是:---"+httpreqQuery); return httpreqQuery; } -- 2.54.0 From 1cece4a0d16af2135663c3b6293a24f6eb54daa7 Mon Sep 17 00:00:00 2001 From: 18792927508 <1322446236@qq.com> Date: Thu, 14 Mar 2024 17:16:38 +0800 Subject: [PATCH 08/15] =?UTF-8?q?=E5=9C=A8=E7=BA=BF=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/ruoyi/RuoYiApplication.java | 17 +++++++++++++++++ .../ruoyi/common/constant/CacheConstants.java | 4 ++++ .../mscase/MsCaseApplicationService.java | 2 +- .../impl/MsCaseApplicationServiceImpl.java | 8 ++++---- 4 files changed, 26 insertions(+), 5 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java b/ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java index 63ee852..61b4e13 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java @@ -1,11 +1,19 @@ package com.ruoyi; +import cn.hutool.core.collection.CollectionUtil; +import com.ruoyi.common.constant.CacheConstants; +import com.ruoyi.common.core.domain.entity.SysUser; +import com.ruoyi.common.core.redis.RedisCache; +import com.ruoyi.common.utils.spring.SpringUtils; +import com.ruoyi.system.mapper.SysUserMapper; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; import org.springframework.scheduling.annotation.EnableScheduling; import springfox.documentation.swagger2.annotations.EnableSwagger2; +import java.util.List; + /** * 启动程序 * @@ -30,5 +38,14 @@ public class RuoYiApplication " | | \\ `' /| `-' / \n" + " | | \\ / \\ / \n" + " ''-' `'-' `-..-' "); + // 启动成功后,查询用户表,将用户信息存到redis + RedisCache redisCache = SpringUtils.getBean(RedisCache.class); + SysUserMapper userMapper = SpringUtils.getBean(SysUserMapper.class); + List sysUsers = userMapper.selectUserListByIds(null); + if(CollectionUtil.isNotEmpty(sysUsers)){ + for (SysUser sysUser : sysUsers) { + redisCache.setCacheObject(CacheConstants.USER_KEY+sysUser.getUserId(),sysUser); + } + } } } diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/constant/CacheConstants.java b/ruoyi-common/src/main/java/com/ruoyi/common/constant/CacheConstants.java index 2e806c6..dab65a0 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/constant/CacheConstants.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/constant/CacheConstants.java @@ -46,4 +46,8 @@ public class CacheConstants * 案件 redis key */ public static final String CASE_KEY = "case_codes:"; + /** + * 所有用户 redis key + */ + public static final String USER_KEY = "user_key:"; } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/MsCaseApplicationService.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/MsCaseApplicationService.java index 5a488f5..c3c8d03 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/MsCaseApplicationService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/MsCaseApplicationService.java @@ -224,7 +224,7 @@ public interface MsCaseApplicationService { * 调解书上传到onlyoffice服务器 * @param annexPath */ - JSONArray uploadOnlyOffice(String annexPath); + JSONArray uploadOnlyOffice(String annexPath,Long id); /** * 案件受理 * @param application 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 4893459..a23af9b 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 @@ -3755,7 +3755,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService { String annexPath=resultFilePath.replace(RuoYiConfig.getProfile(),Constants.RESOURCE_PREFIX); // 如果是调解书或者调解协议上传到onlyoffice服务器 if(annexType != null && annexType.equals(AnnexTypeEnum.MEDIATE_BOOK.getCode())){ - JSONArray jsonArray = caseApplicationService.uploadOnlyOffice(annexPath); + JSONArray jsonArray = caseApplicationService.uploadOnlyOffice(annexPath,application.getId()); if(jsonArray!=null && jsonArray.size() > 0){ for (Object obj : jsonArray) { JSONObject jsonObject = (JSONObject) obj; @@ -3784,13 +3784,13 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService { */ @Override @Transactional - public JSONArray uploadOnlyOffice(String annexPath) { + public JSONArray uploadOnlyOffice(String annexPath,Long caseId) { annexPath=annexPath.replace("/profile","/home/ruoyi/uploadPath"); File file = new File(annexPath); if (file.exists()) { // 调用onlyoffice -// String url = "http://121.40.189.20:9090/files/upload"; try { + onlyOfficeUrl= onlyOfficeUrl+ "?caseId="+caseId; Map params = new HashMap<>(); params.put("file", file); String postResult = HttpUtil.post(onlyOfficeUrl, params); @@ -3806,7 +3806,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService { }else { throw new ServiceException("文件不存在"); } -return null; + return null; } /** -- 2.54.0 From dd776e6fabf2e975441f28a875ef08efe2e78d29 Mon Sep 17 00:00:00 2001 From: 18792927508 <1322446236@qq.com> Date: Fri, 15 Mar 2024 09:18:18 +0800 Subject: [PATCH 09/15] =?UTF-8?q?=E4=BF=9D=E5=AD=98=E9=99=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wisdomarbitrate/mscase/MsCaseApplicationController.java | 2 +- .../service/mscase/impl/MsCaseApplicationServiceImpl.java | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/mscase/MsCaseApplicationController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/mscase/MsCaseApplicationController.java index 5ad30ad..ac45155 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/mscase/MsCaseApplicationController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/mscase/MsCaseApplicationController.java @@ -417,7 +417,7 @@ public class MsCaseApplicationController extends BaseController { * @param * @return */ - @GetMapping("/saveOnlyOfficeFile") + @PostMapping("/saveOnlyOfficeFile") public AjaxResult saveOnlyOfficeFile( @RequestBody MsCaseAttach caseAttach) { if(caseAttach.getCaseAppliId()==null||StrUtil.isEmpty(caseAttach.getOnlyOfficeFileId())||StrUtil.isEmpty(caseAttach.getAnnexPath())){ return error("参数校验失败"); 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 a23af9b..49d852a 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 @@ -2163,15 +2163,16 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService { @Transactional @Override public AjaxResult saveOnlyOfficeFile(MsCaseAttach caseAttach) { - if(StrUtil.isEmpty(caseAttach.getAnnexName())){ + if(StrUtil.isEmpty(caseAttach.getAnnexName())) { caseAttach.setAnnexName("调解书"); + } caseAttach.setAnnexType(AnnexTypeEnum.MEDIATE_BOOK.getCode()); caseAttach.setUseId(getUserInfo().getUserId()); caseAttach.setUseAccount(getUserInfo().getUserName()); // 先删除之前的在新增 msCaseAttachMapper.deleteCaseAttachByCasedIdAndType(caseAttach.getCaseAppliId(), caseAttach.getAnnexType()); msCaseAttachMapper.save(caseAttach); - } + return AjaxResult.success(); } -- 2.54.0 From fb36d28f5652877ec546b254192d5c4d89299c44 Mon Sep 17 00:00:00 2001 From: qitz <18810291185@163.com> Date: Fri, 15 Mar 2024 10:08:29 +0800 Subject: [PATCH 10/15] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=AD=BE=E7=BD=B2?= =?UTF-8?q?=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mscase/impl/MsSignSealServiceImpl.java | 51 +++++++++++++++++++ .../wisdomarbitrate/utils/SignAward.java | 2 +- 2 files changed, 52 insertions(+), 1 deletion(-) 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 daf8014..eb94d57 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 @@ -1033,6 +1033,11 @@ public class MsSignSealServiceImpl implements MsSignSealService { String orgnNamePsnAcc = sealSignRecordsel.getOrgnNamePsnAcc(); String pensonAccountRes = sealSignRecordsel.getPensonAccountRes(); String pensonAccountMedi = sealSignRecordsel.getPensonAccountMedi(); + String pensonName = sealSignRecordsel.getPensonName(); + String orgnNamePsnName = sealSignRecordsel.getOrgnNamePsnName(); + String pensonNameRes = sealSignRecordsel.getPensonNameRes(); + String pensonNameMedi = sealSignRecordsel.getPensonNameMedi(); + Date dateOperate = new Date(operateTime); Integer signStatusApply = sealSignRecordsel.getSignStatusApply(); Integer signStatusResponse = sealSignRecordsel.getSignStatusResponse(); @@ -1042,6 +1047,10 @@ public class MsSignSealServiceImpl implements MsSignSealService { Long caseAppliId = sealSignRecordsel.getCaseAppliId(); MsCaseApplication caseApplicationselect = msCaseApplicationMapper.selectByPrimaryKey(caseAppliId); Integer mediaResult = caseApplicationselect.getMediaResult(); + 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){ @@ -1050,6 +1059,13 @@ public class MsSignSealServiceImpl implements MsSignSealService { //申请人签名 sealSignRecordsel.setSignStatusApply(1); sealSignRecordMapper.updateByPrimaryKeySelective(sealSignRecordsel); + MsCaseLogRecord operLog = new MsCaseLogRecord(); + operLog.setCreateNickName(pensonName); + operLog.setCaseStatusName(caseStatusName); + operLog.setCaseAppliId(caseAppliId); + operLog.setCaseNode(caseNode); + operLog.setCreateTime(dateOperate); + caseLogRecordMapper.insert(operLog); if(signStatusResponse!=null&&signStatusResponse.intValue()==1&& signStatusMediator!=null&&signStatusMediator.intValue()==1){ // 根据流程id查找下一个流程节点 @@ -1068,6 +1084,13 @@ public class MsSignSealServiceImpl implements MsSignSealService { //被申请人签名 sealSignRecordsel.setSignStatusResponse(1); sealSignRecordMapper.updateByPrimaryKeySelective(sealSignRecordsel); + MsCaseLogRecord operLog = new MsCaseLogRecord(); + operLog.setCreateNickName(pensonNameRes); + operLog.setCaseStatusName(caseStatusName); + operLog.setCaseAppliId(caseAppliId); + operLog.setCaseNode(caseNode); + operLog.setCreateTime(dateOperate); + caseLogRecordMapper.insert(operLog); if(signStatusApply!=null&&signStatusApply.intValue()==1&& signStatusMediator!=null&&signStatusMediator.intValue()==1){ // 根据流程id查找下一个流程节点 @@ -1086,6 +1109,13 @@ public class MsSignSealServiceImpl implements MsSignSealService { //调解员签名 sealSignRecordsel.setSignStatusMediator(1); sealSignRecordMapper.updateByPrimaryKeySelective(sealSignRecordsel); + MsCaseLogRecord operLog = new MsCaseLogRecord(); + operLog.setCreateNickName(pensonNameMedi); + operLog.setCaseStatusName(caseStatusName); + operLog.setCaseAppliId(caseAppliId); + operLog.setCaseNode(caseNode); + operLog.setCreateTime(dateOperate); + caseLogRecordMapper.insert(operLog); if(signStatusApply!=null&&signStatusApply.intValue()==1&& signStatusResponse!=null&&signStatusResponse.intValue()==1){ // 根据流程id查找下一个流程节点 @@ -1104,6 +1134,13 @@ public class MsSignSealServiceImpl implements MsSignSealService { sealSignRecordsel.setSealStatus(1); sealSignRecordsel.setSignFlowStatus(3); sealSignRecordMapper.updateByPrimaryKeySelective(sealSignRecordsel); + MsCaseLogRecord operLog = new MsCaseLogRecord(); + operLog.setCreateNickName(orgnNamePsnName); + operLog.setCaseStatusName(caseStatusName); + operLog.setCaseAppliId(caseAppliId); + operLog.setCaseNode(caseNode); + operLog.setCreateTime(dateOperate); + caseLogRecordMapper.insert(operLog); // 根据流程id查找下一个流程节点 MsCaseFlow nextFlow = caseFlowMapper.nextFlow(caseApplicationselect.getCaseFlowId().intValue()); @@ -1163,6 +1200,13 @@ public class MsSignSealServiceImpl implements MsSignSealService { //申请人签名 sealSignRecordsel.setSignStatusApply(1); sealSignRecordMapper.updateByPrimaryKeySelective(sealSignRecordsel); + MsCaseLogRecord operLog = new MsCaseLogRecord(); + operLog.setCreateNickName(pensonName); + operLog.setCaseStatusName(caseStatusName); + operLog.setCaseAppliId(caseAppliId); + operLog.setCaseNode(caseNode); + operLog.setCreateTime(dateOperate); + caseLogRecordMapper.insert(operLog); if(signStatusResponse!=null&&signStatusResponse.intValue()==1){ MsCaseFlow nextFlow = caseFlowMapper.nextFlow1(caseApplicationselect.getCaseFlowId().intValue()); MsCaseApplication application = new MsCaseApplication(); @@ -1222,6 +1266,13 @@ public class MsSignSealServiceImpl implements MsSignSealService { //被申请人签名 sealSignRecordsel.setSignStatusResponse(1); sealSignRecordMapper.updateByPrimaryKeySelective(sealSignRecordsel); + MsCaseLogRecord operLog = new MsCaseLogRecord(); + operLog.setCreateNickName(pensonNameRes); + operLog.setCaseStatusName(caseStatusName); + operLog.setCaseAppliId(caseAppliId); + operLog.setCaseNode(caseNode); + operLog.setCreateTime(dateOperate); + caseLogRecordMapper.insert(operLog); if(signStatusApply!=null&&signStatusApply.intValue()==1){ MsCaseFlow nextFlow = caseFlowMapper.nextFlow1(caseApplicationselect.getCaseFlowId().intValue()); MsCaseApplication application = new MsCaseApplication(); diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/SignAward.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/SignAward.java index f213fb7..76bbf20 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/SignAward.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/SignAward.java @@ -355,7 +355,7 @@ public class SignAward { " \"signConfig\": {\n" + " \"availableSignClientTypes\": \"1\"\n" + " },\n" + - " \"notifyUrl\": \"" + signSealCallbackUrl + "\",\n" + +// " \"notifyUrl\": \"" + signSealCallbackUrl + "\",\n" + " \"autoFinish\": true\n" + " },\n" + -- 2.54.0 From a9bf9379ba784ed2e18bf57c46f90e3e17abd980 Mon Sep 17 00:00:00 2001 From: 18792927508 <1322446236@qq.com> Date: Fri, 15 Mar 2024 17:37:56 +0800 Subject: [PATCH 11/15] =?UTF-8?q?=E8=B0=83=E8=8A=82=E7=94=B3=E8=AF=B7?= =?UTF-8?q?=E4=B9=A6=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mscase/impl/MsCaseApplicationServiceImpl.java | 9 ++++++++- 1 file changed, 8 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 49d852a..db9f4b3 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 @@ -3771,6 +3771,13 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService { } } + }else { + caseAttach = MsCaseAttach.builder() + .caseAppliId(application.getId()) + .annexName(orgFileName+".docx") + .annexPath(resultFilePath.replace(RuoYiConfig.getProfile(),Constants.RESOURCE_PREFIX)) + .annexType(annexType) + .build(); } //保存到附件表里,先删除之前的在保存 if(caseAttach != null) { @@ -3791,7 +3798,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService { if (file.exists()) { // 调用onlyoffice try { - onlyOfficeUrl= onlyOfficeUrl+ "?caseId="+caseId; + onlyOfficeUrl= onlyOfficeUrl+ "/"+String.valueOf(caseId); Map params = new HashMap<>(); params.put("file", file); String postResult = HttpUtil.post(onlyOfficeUrl, params); -- 2.54.0 From 8a7cf059fd1a6f3a1284f0bb7fac7d0eb346ff7c Mon Sep 17 00:00:00 2001 From: 18792927508 <1322446236@qq.com> Date: Fri, 15 Mar 2024 17:46:50 +0800 Subject: [PATCH 12/15] =?UTF-8?q?=E5=9C=A8=E7=BA=BF=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/mscase/impl/MsCaseApplicationServiceImpl.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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 db9f4b3..eb01875 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 @@ -3798,10 +3798,9 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService { if (file.exists()) { // 调用onlyoffice try { - onlyOfficeUrl= onlyOfficeUrl+ "/"+String.valueOf(caseId); Map params = new HashMap<>(); params.put("file", file); - String postResult = HttpUtil.post(onlyOfficeUrl, params); + String postResult = HttpUtil.post(onlyOfficeUrl+ "/"+String.valueOf(caseId), params); if(StrUtil.isNotEmpty(postResult)){ // 转为jsonArray JSONArray jsonArray = JSONArray.parseArray(postResult); -- 2.54.0 From 4502b8128f6bd7ab581937fd1ccdeae4e4a3f5d6 Mon Sep 17 00:00:00 2001 From: qitz <18810291185@163.com> Date: Mon, 18 Mar 2024 09:58:01 +0800 Subject: [PATCH 13/15] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/mscase/impl/MsSignSealServiceImpl.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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 eb94d57..364fe0f 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 @@ -569,7 +569,13 @@ public class MsSignSealServiceImpl implements MsSignSealService { caseNodeTime= DateUtil.format(record.getCreateTime(), DatePattern.NORM_DATETIME_FORMATTER); } Integer caseNode = record.getCaseNode(); - contentBuilder.append(Optional.ofNullable(record.getCreateNickName()).orElse("")).append("(").append(record.getCreateBy()).append(")").append("于").append(caseNodeTime); + String createBy = record.getCreateBy(); + if(StrUtil.isNotEmpty(createBy)){ + contentBuilder.append(Optional.ofNullable(record.getCreateNickName()).orElse("")).append("(").append(record.getCreateBy()).append(")").append("于").append(caseNodeTime); + }else{ + contentBuilder.append(Optional.ofNullable(record.getCreateNickName()).orElse("")).append("于").append(caseNodeTime); + } + if(StrUtil.isNotEmpty(record.getContent())){ contentBuilder.append(record.getContent()); }else if(caseNode.intValue() == 0){ -- 2.54.0 From 1256a9dd50043b911d05476f398d2dcc6bebd461 Mon Sep 17 00:00:00 2001 From: 18792927508 <1322446236@qq.com> Date: Mon, 18 Mar 2024 14:12:45 +0800 Subject: [PATCH 14/15] =?UTF-8?q?=E8=BA=AB=E4=BB=BD=E7=B1=BB=E5=88=AB?= =?UTF-8?q?=E5=AD=97=E5=85=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/SysDictDataController.java | 37 ++++++++++++------- .../mscase/MsCaseApplicationController.java | 1 + 2 files changed, 24 insertions(+), 14 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictDataController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictDataController.java index 59becaf..782b7f4 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictDataController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictDataController.java @@ -1,19 +1,6 @@ package com.ruoyi.web.controller.system; -import java.util.ArrayList; -import java.util.List; -import javax.servlet.http.HttpServletResponse; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.annotation.Anonymous; import com.ruoyi.common.annotation.Log; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; @@ -24,6 +11,14 @@ import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.system.service.ISysDictDataService; import com.ruoyi.system.service.ISysDictTypeService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.ArrayList; +import java.util.List; /** * 数据字典信息 @@ -82,6 +77,20 @@ public class SysDictDataController extends BaseController } return success(data); } + /** + * 根据字典类型查询字典数据信息,跳过token + */ + @Anonymous + @GetMapping(value = "/type/skipToken/{dictType}") + public AjaxResult skipToken(@PathVariable String dictType) + { + List data = dictTypeService.selectDictDataByType(dictType); + if (StringUtils.isNull(data)) + { + data = new ArrayList(); + } + return success(data); + } /** * 新增字典类型 diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/mscase/MsCaseApplicationController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/mscase/MsCaseApplicationController.java index ac45155..23462d6 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/mscase/MsCaseApplicationController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/mscase/MsCaseApplicationController.java @@ -73,6 +73,7 @@ public class MsCaseApplicationController extends BaseController { /** * 新增案件 */ + // todo 重复提交校验 @PostMapping("/insert") public AjaxResult insert(@RequestBody MsCaseApplicationVO caseApplication ) { -- 2.54.0 From 7977c89ab452c96828bad1087c1ac4c242ede788 Mon Sep 17 00:00:00 2001 From: 18792927508 <1322446236@qq.com> Date: Tue, 19 Mar 2024 18:17:04 +0800 Subject: [PATCH 15/15] =?UTF-8?q?bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/application.yml | 4 +- .../impl/MsCaseApplicationServiceImpl.java | 48 +++++++++++++++---- .../mscase/impl/MsCasePaymentServiceImpl.java | 4 +- .../mscase/impl/MsSignSealServiceImpl.java | 8 ++-- 4 files changed, 47 insertions(+), 17 deletions(-) diff --git a/ruoyi-admin/src/main/resources/application.yml b/ruoyi-admin/src/main/resources/application.yml index c5f02d1..2dc7d5f 100644 --- a/ruoyi-admin/src/main/resources/application.yml +++ b/ruoyi-admin/src/main/resources/application.yml @@ -18,7 +18,7 @@ ruoyi: # 开发环境配置 server: # 测试环境6001,开发环境7001 - port: 6001 + port: 7001 servlet: # 应用的访问路径 context-path: / @@ -193,7 +193,7 @@ arbitrateConfig: url: http://121.40.189.20:9001/callArbitrateCaseApplication/generateCaseApplication # 回调通知 signSealCallbackConfig: - url: http://121.40.189.20:6001/mssignSeal/signSeaalCaseApplicaCallback + url: http://121.40.189.20:7001/mssignSeal/signSeaalCaseApplicaCallback # onlyOffice系统url配置 onlyOfficeConfig: # url: http://172.16.0.254:9090/files/upload 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 eb01875..b24e5bf 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 @@ -1865,7 +1865,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService { // 申请人预约 if (vo.getMiniProgressFlag() == null || vo.getMiniProgressFlag().equals( YesOrNoEnum.NO.getCode())) { // 新增日志 - CaseLogUtils.insertCaseLog(vo.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(), "申请人选择调解员"); + CaseLogUtils.insertCaseLog(vo.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(), null); if (StrUtil.isEmpty(msCaseAffiliate.getRespondentIdentityNum())) { return AjaxResult.error("被申请人身份证为空"); @@ -1876,7 +1876,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService { } else { // 被申请人预约 // 新增日志 - CaseLogUtils.insertCaseLog(vo.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(), "被申请人选择调解员"); + CaseLogUtils.insertCaseLog(vo.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(), null); // 判断申请人是否预约 caseApplicationService. isReservation( vo,userIds); @@ -2225,6 +2225,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService { if (currentFlow == null) { throw new ServiceException("未找到当前流程节点"); } + Integer mediaResult = req.getMediaResult(); MsCaseAffiliate caseAffiliate = msCaseAffiliateMapper.selectByPrimaryKey(req.getId()); if (application.getMediationMethod().equals("1")) { // 线上调解 @@ -2237,9 +2238,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService { msCaseAttachMapper.updateCaseAttach(attach); } } - Integer mediaResult = req.getMediaResult(); - if(mediaResult!=null){ - if(mediaResult.intValue()==1){ + if(mediaResult ==1){ //达成调解 List caseAttachList = msCaseAttachMapper.queryAnnexPathByCaseId(req.getId()); if (caseAttachList != null && caseAttachList.size() > 0) { @@ -2898,7 +2897,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService { } } - } + } else { // 线下调解 List attachList = req.getAttachList(); @@ -2911,14 +2910,45 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService { attach.setCaseAppliId(req.getId()); msCaseAttachMapper.updateCaseAttach(attach); } - // msCaseAttachMapper.batchSave(attachList); // 修改案件状态为待送达 Example flowExample = new Example(MsCaseFlow.class); - flowExample.createCriteria().andEqualTo("caseStatusName", "待送达"); + if(mediaResult ==1 || mediaResult == 5){ + // 达成调解,达成和解,案件状态改为待送达 + flowExample.createCriteria().andEqualTo("caseStatusName", "待送达"); + } else if(mediaResult == 2 || mediaResult == 3){ + // 未达成调解,未达成调解但不在争议改为结束状态 + flowExample.createCriteria().andEqualTo("caseStatusName", "结束"); + } + else if(mediaResult == 4){ + // 未达成调解但同意引入仲裁系统,改为结束状态,并调仲裁新增接口 + flowExample.createCriteria().andEqualTo("caseStatusName", "结束"); + String accessSec = "mCFMA6ffe938v79m"; + MsCaseApplicationVO applicationVO = new MsCaseApplicationVO(); + BeanUtils.copyProperties(application,applicationVO); + + CaseApplicationVO caseApplicationVO = new CaseApplicationVO(); + BeanUtils.copyProperties(applicationVO,caseApplicationVO); + boolean importFlag = applicationVO.isImportFlag(); + if(importFlag==true){ + caseApplicationVO.setImportFlag(1); + }else { + caseApplicationVO.setImportFlag(0); + } + String paramsbody = JSONUtil.toJsonStr(caseApplicationVO); + long timestamp = System.currentTimeMillis(); + String signStr = SignCheckUtils.getSign(paramsbody, accessSec, timestamp); + String urlstr = arbitrateUrl; + HttpResponse httpResponse = HttpRequest.post(urlstr) + .header("timestampstr", String.valueOf(timestamp)) + .header("signstr", signStr) + .body(paramsbody) + .execute(); + } MsCaseFlow caseFlow = caseFlowMapper.selectOneByExample(flowExample); if(caseFlow != null){ application.setCaseFlowId(caseFlow.getId()); application.setCaseStatusName(caseFlow.getCaseStatusName()); + application.setMediaResult(mediaResult); msCaseApplicationMapper.updateByPrimaryKey(application); // 新增日志 CaseLogUtils.insertCaseLog(application.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(),""); @@ -2927,7 +2957,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService { } - return AjaxResult.error(); + return AjaxResult.success(); } /** diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/MsCasePaymentServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/MsCasePaymentServiceImpl.java index a5b571b..262359a 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/MsCasePaymentServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/MsCasePaymentServiceImpl.java @@ -350,7 +350,7 @@ public class MsCasePaymentServiceImpl implements MsCasePaymentService { } // 新增日志 if (dto.getYesOrNo().equals(YesOrNoEnum.YES.getCode())) { - CaseLogUtils.insertCaseLog(application.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(), "确认已缴费"); + CaseLogUtils.insertCaseLog(application.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(), null); }else { CaseLogUtils.insertCaseLog(application.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(), "拒绝确认缴费,拒绝原因为:"+dto.getReason()); } @@ -509,7 +509,7 @@ public class MsCasePaymentServiceImpl implements MsCasePaymentService { application.setCaseFlowId(nextFlow.getId()); application.setCaseStatusName(nextFlow.getCaseStatusName()); caseApplicationMapper.updateByPrimaryKeySelective(application); - CaseLogUtils.insertCaseLog(application.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(),"确认缴费"); + CaseLogUtils.insertCaseLog(application.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(),null); } 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..b07fd0e 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 @@ -411,7 +411,7 @@ public class MsSignSealServiceImpl implements MsSignSealService { application.setCaseFlowId(nextFlow.getId()); application.setCaseStatusName(nextFlow.getCaseStatusName()); caseApplicationMapper.updateByPrimaryKeySelective(application); - CaseLogUtils.insertCaseLog(application.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(),"用印申请"); + CaseLogUtils.insertCaseLog(application.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(),null); } } else { // 单独 @@ -421,7 +421,7 @@ public class MsSignSealServiceImpl implements MsSignSealService { application.setCaseFlowId(nextFlow.getId()); application.setCaseStatusName(nextFlow.getCaseStatusName()); caseApplicationMapper.updateByPrimaryKeySelective(application); - CaseLogUtils.insertCaseLog(application.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(),"用印申请"); + CaseLogUtils.insertCaseLog(application.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(),null); } return AjaxResult.success("用印申请成功"); @@ -786,7 +786,7 @@ public class MsSignSealServiceImpl implements MsSignSealService { caseApplicationselect.setCaseFlowId(nextFlow.getId()); caseApplicationselect.setCaseStatusName(nextFlow.getCaseStatusName()); caseApplicationMapper.updateByPrimaryKeySelective(caseApplicationselect); - CaseLogUtils.insertCaseLog(caseApplicationselect.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(),"签收"); + CaseLogUtils.insertCaseLog(caseApplicationselect.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(),null); } // if (dto.getIsSignRespon() != null && dto.getIsSignRespon().intValue() == 1) { // caseAffiliate.setIsSignRespon(1); @@ -810,7 +810,7 @@ public class MsSignSealServiceImpl implements MsSignSealService { caseApplicationselect.setCaseFlowId(nextFlow.getId()); caseApplicationselect.setCaseStatusName(nextFlow.getCaseStatusName()); caseApplicationMapper.updateByPrimaryKeySelective(caseApplicationselect); - CaseLogUtils.insertCaseLog(caseApplicationselect.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(),"签收"); + CaseLogUtils.insertCaseLog(caseApplicationselect.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(),null); } return AjaxResult.success("签收成功"); -- 2.54.0