Merge branch 'wq1' of SH-Arbitrate/Mediation-Backend into dev
This commit was merged in pull request #132.
This commit is contained in:
@@ -5,9 +5,11 @@ 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.SysRole;
|
||||
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.common.utils.StringUtils;
|
||||
import com.ruoyi.framework.web.service.SysLoginService;
|
||||
import com.ruoyi.framework.web.service.SysPermissionService;
|
||||
import com.ruoyi.framework.web.service.TokenService;
|
||||
@@ -22,6 +24,8 @@ import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
@@ -83,11 +87,20 @@ public class SysLoginController {
|
||||
public AjaxResult getInfo() {
|
||||
SysUser user = SecurityUtils.getLoginUser().getUser();
|
||||
// 角色集合
|
||||
Set<String> roles = permissionService.getRolePermission(user);
|
||||
List<SysRole> roles = permissionService.getRolePermission(user);
|
||||
Set<String> permsSet = new HashSet<>();
|
||||
for (SysRole perm : roles)
|
||||
{
|
||||
if (StringUtils.isNotNull(perm))
|
||||
{
|
||||
permsSet.addAll(Arrays.asList(perm.getRoleKey().trim().split(",")));
|
||||
}
|
||||
}
|
||||
user.setRoles(roles);
|
||||
// 权限集合
|
||||
Set<String> permissions = permissionService.getMenuPermission(user);
|
||||
//查询用户角色关联的案件状态
|
||||
Set<Integer> caseStatus = caseFlowService.getCaseStatusIdByRoleKey(roles);
|
||||
Set<Integer> caseStatus = caseFlowService.getCaseStatusIdByRoleKey(permsSet);
|
||||
AjaxResult ajax = AjaxResult.success();
|
||||
ajax.put("user", user);
|
||||
ajax.put("roles", roles);
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject;
|
||||
import com.ruoyi.common.annotation.Anonymous;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.AttachmentOperateTypeEnum;
|
||||
import com.ruoyi.common.enums.DocumentTypeEnum;
|
||||
import com.ruoyi.common.enums.PushCaseStatusEnum;
|
||||
import com.ruoyi.system.service.impl.BeiMingInterfaceService;
|
||||
import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseFileInfo;
|
||||
@@ -62,7 +63,7 @@ public class TestApiController {
|
||||
public AjaxResult testfile() {
|
||||
// File file = new File("D:/WorkDoc/TJ/File/证据1.png");
|
||||
File file = new File("D:/WorkDoc/TJ/File/证据3.png");
|
||||
MsCaseFileInfo jsonObject1 = beiMingInterfaceService.pushAttachmentInfo("BWT_MEDIATION", "86251b190e3a40f3942v215d1762c663", file, "BWT_MEDIATION", "zc2024032700012", AttachmentOperateTypeEnum.ADD);
|
||||
MsCaseFileInfo jsonObject1 = beiMingInterfaceService.pushAttachmentInfo("BWT_MEDIATION", "86251b190e3a40f3942v215d1762c663", file, "BWT_MEDIATION", "zc2024032700012", AttachmentOperateTypeEnum.ADD, DocumentTypeEnum.EVEDENT_AGREEMENT);
|
||||
System.out.println("fanhui:" + jsonObject1.toString());
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
@@ -6,8 +6,8 @@ spring:
|
||||
druid:
|
||||
# 主库数据源
|
||||
master:
|
||||
# url: jdbc:mysql://121.40.189.20:3306/mediation_system?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&useSSL=true&serverTimezone=Asia/Shanghai&useSSL=false
|
||||
url: jdbc:mysql://121.40.189.20:3306/mediation_system_prod?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&useSSL=true&serverTimezone=Asia/Shanghai&useSSL=false
|
||||
url: jdbc:mysql://121.40.189.20:3306/mediation_system?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&useSSL=true&serverTimezone=Asia/Shanghai&useSSL=false
|
||||
# url: jdbc:mysql://121.40.189.20:3306/mediation_system_prod?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&useSSL=true&serverTimezone=Asia/Shanghai&useSSL=false
|
||||
username: root
|
||||
password: YMzc157#
|
||||
# 从库数据源
|
||||
|
||||
@@ -18,7 +18,7 @@ ruoyi:
|
||||
# 开发环境配置
|
||||
server:
|
||||
# 测试环境6001,开发环境7001
|
||||
port: 7001
|
||||
port: 6001
|
||||
servlet:
|
||||
# 应用的访问路径
|
||||
context-path: /
|
||||
@@ -72,8 +72,8 @@ spring:
|
||||
host: 121.40.189.20
|
||||
# 端口,默认为6379
|
||||
port: 6389
|
||||
# 数据库索引
|
||||
database: 0
|
||||
# 数据库索引,测试环境1,正式环境0
|
||||
database: 1
|
||||
# 密码
|
||||
password:
|
||||
# 连接超时时间
|
||||
@@ -198,6 +198,11 @@ signSealCallbackConfig:
|
||||
onlyOfficeConfig:
|
||||
# url: http://172.16.0.254:9090/files/upload
|
||||
url: http://121.40.189.20:9090/files/upload
|
||||
# 北明
|
||||
BMConfig:
|
||||
userName: BWT_MEDIATION
|
||||
password: 86251b190e3a40f3942v215d1762c663
|
||||
syncSource: BWT_MEDIATION
|
||||
#jodconverter:
|
||||
# local:
|
||||
# host: 121.40.189.20
|
||||
|
||||
@@ -200,7 +200,7 @@
|
||||
<dependency>
|
||||
<groupId>com.tencentcloudapi</groupId>
|
||||
<artifactId>tencentcloud-sdk-java</artifactId>
|
||||
<version>3.1.876</version>
|
||||
<version>3.1.962</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
|
||||
@@ -64,6 +64,43 @@ public class SysDept extends BaseEntity
|
||||
* 法定代表人
|
||||
*/
|
||||
private String compLegalPerson;
|
||||
/**
|
||||
* 住所
|
||||
*/
|
||||
private String home;
|
||||
/**
|
||||
* 联系地址
|
||||
*/
|
||||
private String address;
|
||||
/**
|
||||
*
|
||||
* 国籍,0-国内,1-国外
|
||||
*/
|
||||
private Integer nationality;
|
||||
|
||||
public String getAddress() {
|
||||
return address;
|
||||
}
|
||||
|
||||
public void setAddress(String address) {
|
||||
this.address = address;
|
||||
}
|
||||
|
||||
public Integer getNationality() {
|
||||
return nationality;
|
||||
}
|
||||
|
||||
public String getHome() {
|
||||
return home;
|
||||
}
|
||||
|
||||
public void setHome(String home) {
|
||||
this.home = home;
|
||||
}
|
||||
|
||||
public void setNationality(Integer nationality) {
|
||||
this.nationality = nationality;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
|
||||
@@ -4,22 +4,16 @@ import com.documents4j.api.DocumentType;
|
||||
import com.documents4j.api.IConverter;
|
||||
import com.documents4j.job.LocalConverter;
|
||||
import com.itextpdf.text.Document;
|
||||
import com.itextpdf.text.Font;
|
||||
import com.itextpdf.text.PageSize;
|
||||
import com.itextpdf.text.pdf.BaseFont;
|
||||
import com.itextpdf.text.pdf.PdfWriter;
|
||||
import com.itextpdf.tool.xml.XMLWorkerFontProvider;
|
||||
import com.itextpdf.tool.xml.XMLWorkerHelper;
|
||||
import com.ruoyi.common.config.RuoYiConfig;
|
||||
import com.tencentcloudapi.teo.v20220901.models.CC;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.io.*;
|
||||
import java.nio.charset.Charset;
|
||||
import java.nio.file.Files;
|
||||
|
||||
import static cn.hutool.core.util.ClassLoaderUtil.getClassLoader;
|
||||
|
||||
/**
|
||||
* @author wangqiong
|
||||
* @description pdf转换工具类
|
||||
@@ -44,7 +38,7 @@ public class PdfUtils {
|
||||
document.setMarginMirroring(false);
|
||||
document.open();
|
||||
// 解决PDF中文不显示
|
||||
String fontPath = "/D:/simsun.ttf"; //字体文件路径
|
||||
String fontPath = "/home/ruoyi/uploadPath/songfont/simsun.ttf"; //字体文件路径
|
||||
XMLWorkerFontProvider provider = new XMLWorkerFontProvider(XMLWorkerFontProvider.DONTLOOKFORFONTS);
|
||||
provider.register(fontPath);//注册字体
|
||||
log.error("注册字体");
|
||||
|
||||
+14
-9
@@ -1,15 +1,17 @@
|
||||
package com.ruoyi.framework.web.service;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import com.ruoyi.common.core.domain.entity.SysRole;
|
||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||
import com.ruoyi.system.service.ISysMenuService;
|
||||
import com.ruoyi.system.service.ISysRoleService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* 用户权限处理
|
||||
@@ -31,13 +33,16 @@ public class SysPermissionService
|
||||
* @param user 用户信息
|
||||
* @return 角色权限信息
|
||||
*/
|
||||
public Set<String> getRolePermission(SysUser user)
|
||||
public List<SysRole> getRolePermission(SysUser user)
|
||||
{
|
||||
Set<String> roles = new HashSet<String>();
|
||||
List<SysRole> roles = new ArrayList<>();
|
||||
// 管理员拥有所有权限
|
||||
if (user.isAdmin())
|
||||
{
|
||||
roles.add("admin");
|
||||
SysRole sysRole = new SysRole();
|
||||
sysRole.setRoleId(1L);
|
||||
sysRole.setRoleKey("admin");
|
||||
roles.add(sysRole);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
+16
-16
@@ -45,20 +45,20 @@
|
||||
<version>2.1.5</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<configuration>
|
||||
<excludes>
|
||||
<exclude>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
</exclude>
|
||||
</excludes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
<!-- <build>-->
|
||||
<!-- <plugins>-->
|
||||
<!-- <plugin>-->
|
||||
<!-- <groupId>org.springframework.boot</groupId>-->
|
||||
<!-- <artifactId>spring-boot-maven-plugin</artifactId>-->
|
||||
<!-- <configuration>-->
|
||||
<!-- <excludes>-->
|
||||
<!-- <exclude>-->
|
||||
<!-- <groupId>org.projectlombok</groupId>-->
|
||||
<!-- <artifactId>lombok</artifactId>-->
|
||||
<!-- </exclude>-->
|
||||
<!-- </excludes>-->
|
||||
<!-- </configuration>-->
|
||||
<!-- </plugin><plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-compiler-plugin</artifactId><configuration><source>9</source><target>9</target></configuration></plugin>-->
|
||||
<!-- </plugins>-->
|
||||
<!-- </build>-->
|
||||
</project>
|
||||
@@ -2,6 +2,7 @@ package com.ruoyi.system.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.ruoyi.common.enums.AttachmentOperateTypeEnum;
|
||||
import com.ruoyi.common.enums.DocumentTypeEnum;
|
||||
import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseFileInfo;
|
||||
import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseStatusInfo;
|
||||
|
||||
@@ -70,7 +71,7 @@ public interface BeiMingInterface {
|
||||
* @param caseNo 案件编号
|
||||
* @return
|
||||
*/
|
||||
MsCaseFileInfo pushAttachmentInfo(String username, String password, File file, String syncSource, String caseNo, AttachmentOperateTypeEnum operateTypeEnum);
|
||||
MsCaseFileInfo pushAttachmentInfo(String username, String password, File file, String syncSource, String caseNo, AttachmentOperateTypeEnum operateTypeEnum, DocumentTypeEnum documentTypeEnum);
|
||||
|
||||
/**
|
||||
* 删除附件
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package com.ruoyi.system.service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import com.ruoyi.common.core.domain.entity.SysRole;
|
||||
import com.ruoyi.system.domain.SysUserRole;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 角色业务层
|
||||
*
|
||||
@@ -34,7 +34,7 @@ public interface ISysRoleService
|
||||
* @param userId 用户ID
|
||||
* @return 权限列表
|
||||
*/
|
||||
public Set<String> selectRolePermissionByUserId(Long userId);
|
||||
public List<SysRole> selectRolePermissionByUserId(Long userId);
|
||||
|
||||
/**
|
||||
* 查询所有角色
|
||||
|
||||
+3
-2
@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.databind.node.ObjectNode;
|
||||
import com.ruoyi.common.enums.AttachmentOperateTypeEnum;
|
||||
import com.ruoyi.common.enums.DocumentTypeEnum;
|
||||
import com.ruoyi.common.exception.ServiceException;
|
||||
import com.ruoyi.system.domain.entity.log.MsRequestLog;
|
||||
import com.ruoyi.system.service.BeiMingInterface;
|
||||
@@ -335,7 +336,7 @@ public class BeiMingInterfaceService implements BeiMingInterface {
|
||||
*/
|
||||
@Transactional
|
||||
@Override
|
||||
public MsCaseFileInfo pushAttachmentInfo(String username, String password, File file, String syncSource, String caseNo,AttachmentOperateTypeEnum operateTypeEnum) {
|
||||
public MsCaseFileInfo pushAttachmentInfo(String username, String password, File file, String syncSource, String caseNo, AttachmentOperateTypeEnum operateTypeEnum, DocumentTypeEnum documentTypeEnum) {
|
||||
JSONObject result = new JSONObject();
|
||||
MsCaseFileInfo fileInfo=null;
|
||||
//1.获取token
|
||||
@@ -354,7 +355,7 @@ public class BeiMingInterfaceService implements BeiMingInterface {
|
||||
System.out.println("fileId====:" + fileId);
|
||||
if (fileId != null) {
|
||||
//3.同步附件更新信息
|
||||
fileInfo = MsCaseFileInfo.builder().fileId(fileId).fileName(file.getName()).abutmentId(fileId).abutmentCaseId(caseNo).documentSubject("EVEDENT").documentType("EVEDENT_METERIAL").build();
|
||||
fileInfo = MsCaseFileInfo.builder().fileId(fileId).fileName(file.getName()).abutmentId(fileId).abutmentCaseId(caseNo).documentSubject("EVEDENT").documentType(documentTypeEnum.getCode()).build();
|
||||
result = syncAttachmentInfo(token, username, operateTypeEnum.getCode(), caseNo, fileInfo);
|
||||
// 更新到附件表将fileId
|
||||
// result = syncAttachmentInfo(token, username, AttachmentOperateTypeEnum.UPD.getCode(), caseNo, fileInfo);
|
||||
|
||||
@@ -5,6 +5,8 @@ import com.ruoyi.system.mapper.log.MsRequestLogMapper;
|
||||
import com.ruoyi.system.service.MsRequestLogService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* @Classname MsRequestLogServiceImpl
|
||||
@@ -17,6 +19,7 @@ import org.springframework.stereotype.Service;
|
||||
public class MsRequestLogServiceImpl implements MsRequestLogService {
|
||||
@Autowired
|
||||
private MsRequestLogMapper logMapper;
|
||||
@Transactional(propagation = Propagation.REQUIRES_NEW)
|
||||
@Override
|
||||
public void insert(MsRequestLog requestLog) {
|
||||
logMapper.insert(requestLog);
|
||||
|
||||
@@ -93,18 +93,11 @@ public class SysRoleServiceImpl implements ISysRoleService
|
||||
* @return 权限列表
|
||||
*/
|
||||
@Override
|
||||
public Set<String> selectRolePermissionByUserId(Long userId)
|
||||
public List<SysRole> selectRolePermissionByUserId(Long userId)
|
||||
{
|
||||
List<SysRole> perms = roleMapper.selectRolePermissionByUserId(userId);
|
||||
Set<String> permsSet = new HashSet<>();
|
||||
for (SysRole perm : perms)
|
||||
{
|
||||
if (StringUtils.isNotNull(perm))
|
||||
{
|
||||
permsSet.addAll(Arrays.asList(perm.getRoleKey().trim().split(",")));
|
||||
}
|
||||
}
|
||||
return permsSet;
|
||||
|
||||
return perms;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+1
@@ -107,6 +107,7 @@ public class WeChatUserServiceImpl implements WeChatUserService {
|
||||
}else if(!codeCache.equals(ientityAuthentication.getVerifyCode())){
|
||||
return AjaxResult.warn("验证码校验失败");
|
||||
}
|
||||
// 根据用户名或者邮箱或者手机号查询系统用户表中是否存在该用户
|
||||
SysUser sysUserName=sysUserMapper.checkUserNameUnique(ientityAuthentication.getUserName());
|
||||
if(sysUserName!=null){
|
||||
return AjaxResult.warn("账号已存在");
|
||||
|
||||
+81
-24
@@ -259,6 +259,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
||||
if(CollectionUtil.isEmpty(list)){
|
||||
return;
|
||||
}
|
||||
isMediatorRole=false;
|
||||
// 查询申请人和被申请人
|
||||
List<Long> caseIds = list.stream().map(MsCaseApplicationVO::getId).collect(Collectors.toList());
|
||||
|
||||
@@ -271,6 +272,9 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
||||
}
|
||||
|
||||
for (MsCaseApplicationVO vo : list) {
|
||||
if(vo.getMediatorId()!=null&&vo.getMediatorId()==loginUserId){
|
||||
isMediatorRole=true;
|
||||
}
|
||||
// 设置申请人和被申请人
|
||||
if(affiliateMap!=null && affiliateMap.containsKey(vo.getId())){
|
||||
List<MsCaseAffiliate> affiliates = affiliateMap.get(vo.getId());
|
||||
@@ -291,12 +295,19 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
||||
|
||||
}
|
||||
}
|
||||
if(StrUtil.isNotEmpty(affiliate.getRoleName()) && affiliate.getRoleName().equals("申请人")
|
||||
&& affiliate.getRoleType()!=null && affiliate.getRoleType()==1){
|
||||
applicantName.append(affiliate.getName()).append(Constants.CN_SPLIT_COMMA);
|
||||
if(vo.getOrganizeFlag()==null || vo.getOrganizeFlag()!=1) {
|
||||
if (StrUtil.isNotEmpty(affiliate.getRoleName()) && affiliate.getRoleName().equals("申请人")
|
||||
&& affiliate.getRoleType() != null && affiliate.getRoleType() == 1&&StrUtil.isNotEmpty(affiliate.getName())) {
|
||||
applicantName.append(affiliate.getName()).append(Constants.CN_SPLIT_COMMA);
|
||||
}
|
||||
}else {
|
||||
// 组织机构
|
||||
if ( affiliate.getRoleType() != null && affiliate.getRoleType() == 1&&StrUtil.isNotEmpty(affiliate.getApplicantOrgName())) {
|
||||
applicantName.append(affiliate.getApplicantOrgName()).append(Constants.CN_SPLIT_COMMA);
|
||||
}
|
||||
}
|
||||
if(StrUtil.isNotEmpty(affiliate.getRoleName()) && affiliate.getRoleName().equals("被申请人")
|
||||
&& affiliate.getRoleType()!=null && affiliate.getRoleType()==3){
|
||||
&& affiliate.getRoleType()!=null && affiliate.getRoleType()==3&&StrUtil.isNotEmpty(affiliate.getName())){
|
||||
respondentName.append(affiliate.getName()).append(Constants.CN_SPLIT_COMMA);
|
||||
}
|
||||
|
||||
@@ -585,6 +596,9 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
||||
if (caseApplication.getId() == null) {
|
||||
caseApplication.setId(IdWorkerUtil.getId());
|
||||
}
|
||||
if(caseApplication.getOrganizeFlag()==null){
|
||||
caseApplication.setOrganizeFlag(0);
|
||||
}
|
||||
caseApplication.setCaseStatusName(caseFlow.getCaseStatusName());
|
||||
caseApplication.setCaseFlowId(caseFlow.getId());
|
||||
caseApplication.setCreateTime(new Date());
|
||||
@@ -680,7 +694,8 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
||||
*/
|
||||
@Transactional
|
||||
public void setCaseAfflicate(MsCaseApplicationVO caseApplication, MsCaseAffiliate affiliate,int groupOrder) {
|
||||
if(affiliate==null || StrUtil.isEmpty(affiliate.getEmail()) || StrUtil.isEmpty(affiliate.getName())){
|
||||
boolean b = caseApplication.getOrganizeFlag() != 1 && affiliate.getRoleType() == 1 && StrUtil.isEmpty(affiliate.getEmail());
|
||||
if(affiliate==null ||b|| StrUtil.isEmpty(affiliate.getName())){
|
||||
return;
|
||||
}
|
||||
affiliate.setGroupOrder(groupOrder);
|
||||
@@ -739,6 +754,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
||||
} else {
|
||||
// 申请机构
|
||||
if (affiliate.getRoleType() == 1) {
|
||||
affiliate.setOperatorFlag(0);
|
||||
// 申请人,从缓存中判断部门是否存在
|
||||
Object deptCache = redisCache.getCacheObject(CacheConstants.DEPT_KEY + affiliate.getName());
|
||||
if (ObjectUtil.isEmpty(deptCache)) {
|
||||
@@ -751,12 +767,27 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
||||
dept.setStatus("0");
|
||||
dept.setDelFlag("0");
|
||||
dept.setCode(affiliate.getCode());
|
||||
dept.setHome(affiliate.getHome());
|
||||
dept.setAddress(affiliate.getAddress());
|
||||
dept.setCompLegalPerson(affiliate.getCompLegalPerson());
|
||||
dept.setCreateBy(getUsername());
|
||||
dept.setUpdateBy(getUsername());
|
||||
dept.setCreateTime(new Date());
|
||||
dept.setNationality(affiliate.getNationality());
|
||||
sysDeptMapper.insertDept(dept);
|
||||
// 更新缓存
|
||||
redisCache.setCacheObject(CacheConstants.DEPT_KEY + dept.getDeptName(), dept.getDeptId());
|
||||
}else {
|
||||
// 更新部门
|
||||
SysDept dept = new SysDept();
|
||||
dept.setDeptId((Long) deptCache);
|
||||
dept.setCode(affiliate.getCode());
|
||||
dept.setCompLegalPerson(affiliate.getCompLegalPerson());
|
||||
dept.setUpdateBy(getUsername());
|
||||
dept.setUpdateTime(new Date());
|
||||
dept.setNationality(affiliate.getNationality());
|
||||
dept.setHome(affiliate.getHome());
|
||||
dept.setAddress(affiliate.getAddress());
|
||||
sysDeptMapper.updateDept(dept);
|
||||
}
|
||||
affiliate.setApplicantDeptId(redisCache.getCacheObject(CacheConstants.DEPT_KEY + affiliate.getName()));
|
||||
} else {
|
||||
@@ -779,13 +810,13 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
||||
if(StrUtil.isEmpty(affiliate.getEmail())){
|
||||
return;
|
||||
}
|
||||
Object userEmailCache = redisCache.getCacheObject(CacheConstants.USER_EMAIL_KEY + affiliate.getEmail());
|
||||
// Object userEmailCache = redisCache.getCacheObject(CacheConstants.USER_EMAIL_KEY + affiliate.getEmail());
|
||||
SysUser user=null;
|
||||
if(ObjectUtil.isEmpty(userEmailCache)){
|
||||
// if(ObjectUtil.isEmpty(userEmailCache)){
|
||||
user = sysUserMapper.selectUserByUserName(affiliate.getEmail());
|
||||
}else {
|
||||
user=(SysUser)userEmailCache;
|
||||
}
|
||||
// }else {
|
||||
// user=(SysUser)userEmailCache;
|
||||
// }
|
||||
|
||||
|
||||
// 判断该用户是否存在
|
||||
@@ -951,6 +982,9 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
||||
if (msCaseAffiliateVO==null) {
|
||||
return AjaxResult.error("案件相关人员未填写");
|
||||
}
|
||||
if(caseApplication.getOrganizeFlag()==null){
|
||||
caseApplication.setOrganizeFlag(0);
|
||||
}
|
||||
// 计算仲裁费用
|
||||
caseApplication.setCaseSubjectAmount(new BigDecimal("30000"));
|
||||
setFeePayableMethod(caseApplication);
|
||||
@@ -1507,7 +1541,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
||||
}
|
||||
String templatePath = "/home/ruoyi" + caseAttach.getAnnexPath();
|
||||
File file = new File(templatePath.replace("/profile", "/uploadPath"));
|
||||
MsCaseFileInfo caseFileInfo = beiMingInterfaceService.pushAttachmentInfo(BMUserName, BMPassword, file, BMSyncSource, caseApplication.getCaseNum(),AttachmentOperateTypeEnum.ADD);
|
||||
MsCaseFileInfo caseFileInfo = beiMingInterfaceService.pushAttachmentInfo(BMUserName, BMPassword, file, BMSyncSource, caseApplication.getCaseNum(),AttachmentOperateTypeEnum.ADD,DocumentTypeEnum.EVEDENT_METERIAL);
|
||||
// 更新附件表
|
||||
if(caseFileInfo!=null && StrUtil.isNotEmpty(caseFileInfo.getFileId())){
|
||||
caseAttach.setOtherSysFileId(caseFileInfo.getFileId());
|
||||
@@ -1905,7 +1939,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
||||
// selectedMediatorIds = selectedMediators.stream().map(MsCaseMediator::getMediatorId).collect(Collectors.toList());
|
||||
// }
|
||||
for (MsCaseAffiliate affiliate : affiliates) {
|
||||
if(affiliate.getUserId().equals(loginUser.getUser().getUserId())){
|
||||
if(affiliate.getUserId()!=null && affiliate.getUserId().equals(loginUser.getUser().getUserId())){
|
||||
if( affiliate.getRoleType()==null){
|
||||
continue;
|
||||
}
|
||||
@@ -1971,7 +2005,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
||||
return AjaxResult.error("未找到案件相关人员");
|
||||
}
|
||||
for (MsCaseAffiliate affiliate : affiliates) {
|
||||
if(affiliate.getUserId().equals(user.getUserId())){
|
||||
if((affiliate.getUserId()!=null && affiliate.getUserId().equals(user.getUserId()))){
|
||||
if( affiliate.getRoleType()==null){
|
||||
continue;
|
||||
}
|
||||
@@ -2370,8 +2404,8 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
||||
public SysUser getUserInfo() {
|
||||
SysUser sysUser =new SysUser();
|
||||
|
||||
if(StrUtil.isNotEmpty(SecurityUtils.getUsername())){
|
||||
sysUser = sysUserMapper.selectUserByUserName(getUsername());
|
||||
if(SecurityUtils.getUserId()!=null){
|
||||
sysUser = sysUserMapper.selectUserById(SecurityUtils.getUserId());
|
||||
|
||||
}
|
||||
return sysUser;
|
||||
@@ -2671,7 +2705,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
||||
|
||||
//发送签名链接短信,尊敬的{1}用户,您的{2}调解案件,签名链接{3},请点击链接签名,如非本人操作,请忽略本短信
|
||||
SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest();
|
||||
request.setTemplateId("2115975");
|
||||
request.setTemplateId("2116857");
|
||||
// todo
|
||||
// 申请人发送短信
|
||||
request.setPhone(applicantAffiliateOpt.get().getPhone());
|
||||
@@ -2698,7 +2732,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
||||
String urlResponnew = urlRespon.substring(urlRespon.lastIndexOf("/") + 1);
|
||||
|
||||
SmsUtils.SendSmsRequest request1 = new SmsUtils.SendSmsRequest();
|
||||
request1.setTemplateId("2115975");
|
||||
request1.setTemplateId("2116857");
|
||||
request1.setPhone(resAffiliateOpt.get().getPhone());
|
||||
request1.setTemplateParamSet(new String[]{resAffiliateOpt.get().getName(), application.getCaseNum(), urlResponnew});
|
||||
Boolean aBoolean1 = SmsUtils.sendSms(request1);
|
||||
@@ -2722,7 +2756,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
||||
String urlResponnewMedi = urlResponMedi.substring(urlResponMedi.lastIndexOf("/") + 1);
|
||||
|
||||
SmsUtils.SendSmsRequest requestMedi = new SmsUtils.SendSmsRequest();
|
||||
requestMedi.setTemplateId("2115975");
|
||||
requestMedi.setTemplateId("2116857");
|
||||
requestMedi.setPhone(sealSignRecord.getPensonAccountMedi());
|
||||
requestMedi.setTemplateParamSet(new String[]{sealSignRecord.getPensonNameMedi(), application.getCaseNum(), urlResponnewMedi});
|
||||
Boolean aBooleanMedi = SmsUtils.sendSms(requestMedi);
|
||||
@@ -3104,7 +3138,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
||||
for (MsCaseAttach msCaseAttach : msCaseAttaches) {
|
||||
String templatePath = "/home/ruoyi" + msCaseAttach.getAnnexPath();
|
||||
File file = new File(templatePath.replace("/profile", "/uploadPath"));
|
||||
MsCaseFileInfo caseFileInfo = beiMingInterfaceService.pushAttachmentInfo(BMUserName, BMPassword, file, BMSyncSource, application.getCaseNum(),AttachmentOperateTypeEnum.ADD);
|
||||
MsCaseFileInfo caseFileInfo = beiMingInterfaceService.pushAttachmentInfo(BMUserName, BMPassword, file, BMSyncSource, application.getCaseNum(),AttachmentOperateTypeEnum.ADD,DocumentTypeEnum.EVEDENT_AGREEMENT);
|
||||
// 更新附件表
|
||||
if(caseFileInfo!=null && StrUtil.isNotEmpty(caseFileInfo.getFileId())){
|
||||
msCaseAttach.setOtherSysFileId(caseFileInfo.getFileId());
|
||||
@@ -3363,6 +3397,9 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
||||
.build();
|
||||
|
||||
}
|
||||
//保存到附件表里,先删除之前的在保存
|
||||
msCaseAttachMapper.deleteCaseAttachByCasedIdAndType(caseAttach.getCaseAppliId(), annexType);
|
||||
msCaseAttachMapper.save(caseAttach);
|
||||
}
|
||||
|
||||
}else {
|
||||
@@ -3372,12 +3409,32 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
||||
.annexPath(resultFilePath.replace(RuoYiConfig.getProfile(),Constants.RESOURCE_PREFIX))
|
||||
.annexType(annexType)
|
||||
.build();
|
||||
}
|
||||
//保存到附件表里,先删除之前的在保存
|
||||
if(caseAttach != null) {
|
||||
msCaseAttachMapper.deleteCaseAttachByCasedIdAndType(caseAttach.getCaseAppliId(), annexType);
|
||||
// 查找已经存在的附件
|
||||
List<MsCaseAttach> existAttach = msCaseAttachMapper.listCaseAttachByCaseIdAndType(application.getId(), annexType);
|
||||
if(CollectionUtil.isNotEmpty(existAttach)){
|
||||
// todo 对接北明,同步案件状态,删除
|
||||
for (MsCaseAttach msCaseAttach : existAttach) {
|
||||
if(StrUtil.isEmpty(msCaseAttach.getOtherSysFileId())||StrUtil.isEmpty(msCaseAttach.getAnnexPath())){
|
||||
continue;
|
||||
}
|
||||
beiMingInterfaceService.deleteAttachmentInfo(application.getCaseNum(), msCaseAttach.getOtherSysFileId(), FileUtil.getName(msCaseAttach.getAnnexPath()));
|
||||
}
|
||||
}
|
||||
msCaseAttachMapper.deleteCaseAttachByCasedIdAndType(caseAttach.getCaseAppliId(), annexType);
|
||||
if(StrUtil.isEmpty(application.getCaseSource())) {
|
||||
// 北明推送
|
||||
String path = "/home/ruoyi" + caseAttach.getAnnexPath();
|
||||
File file = new File(path.replace("/profile", "/uploadPath"));
|
||||
MsCaseFileInfo caseFileInfo = beiMingInterfaceService.pushAttachmentInfo(BMUserName, BMPassword, file, BMSyncSource, application.getCaseNum(), AttachmentOperateTypeEnum.ADD, DocumentTypeEnum.EVEDENT_APPLY_BOOK);
|
||||
|
||||
// 更新附件表
|
||||
if (caseFileInfo != null && StrUtil.isNotEmpty(caseFileInfo.getFileId())) {
|
||||
caseAttach.setOtherSysFileId(caseFileInfo.getFileId());
|
||||
}
|
||||
}
|
||||
msCaseAttachMapper.save(caseAttach);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+31
-31
@@ -15,10 +15,7 @@ import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.domain.entity.EsignHttpResponse;
|
||||
import com.ruoyi.common.core.domain.entity.SysRole;
|
||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||
import com.ruoyi.common.enums.AnnexTypeEnum;
|
||||
import com.ruoyi.common.enums.AttachmentOperateTypeEnum;
|
||||
import com.ruoyi.common.enums.PushCaseStatusEnum;
|
||||
import com.ruoyi.common.enums.YesOrNoEnum;
|
||||
import com.ruoyi.common.enums.*;
|
||||
import com.ruoyi.common.exception.EsignDemoException;
|
||||
import com.ruoyi.common.exception.ServiceException;
|
||||
import com.ruoyi.common.utils.EmailOutUtil;
|
||||
@@ -27,6 +24,7 @@ import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.utils.file.SaaSAPIFileUtils;
|
||||
import com.ruoyi.system.domain.entity.flow.MsCaseFlow;
|
||||
import com.ruoyi.system.domain.vo.flow.MsCaseFlowVO;
|
||||
import com.ruoyi.system.mapper.SysRoleMapper;
|
||||
import com.ruoyi.system.mapper.SysUserMapper;
|
||||
import com.ruoyi.system.mapper.flow.MsCaseFlowMapper;
|
||||
import com.ruoyi.system.service.impl.BeiMingInterfaceService;
|
||||
@@ -110,6 +108,8 @@ public class MsSignSealServiceImpl implements MsSignSealService {
|
||||
|
||||
@Autowired
|
||||
private SendMailRecordMapper sendMailRecordMapper;
|
||||
@Autowired
|
||||
private SysRoleMapper roleMapper;
|
||||
// 北明配置
|
||||
@Value("${BMConfig.userName}")
|
||||
private String BMUserName;
|
||||
@@ -550,36 +550,37 @@ public class MsSignSealServiceImpl implements MsSignSealService {
|
||||
if(CollectionUtil.isEmpty(affiliates)){
|
||||
return AjaxResult.error("未找到案件相关人员");
|
||||
}
|
||||
SysUser user = sysUserMapper.selectUserById(SecurityUtils.getLoginUser().getUser().getUserId());
|
||||
List<SysRole> roles = user.getRoles();
|
||||
if(CollectionUtil.isEmpty(roles)){
|
||||
return AjaxResult.error("该用户未绑定角色");
|
||||
}
|
||||
long mediatorCount = roles.stream().filter(sysRole -> sysRole.getRoleName().equals("调解员")).count();
|
||||
List<MsCaseAffiliate> operatorList = affiliates.stream().filter(msCaseAffiliate -> msCaseAffiliate.getOperatorFlag() != null
|
||||
&& msCaseAffiliate.getOperatorFlag() == 1
|
||||
&& StrUtil.isNotEmpty(msCaseAffiliate.getPhone())).collect(Collectors.toList());
|
||||
Optional<MsCaseAffiliate> appOpt =null;
|
||||
Optional<MsCaseAffiliate> resOpt =null;
|
||||
if(CollectionUtil.isNotEmpty(operatorList)){
|
||||
appOpt = operatorList.stream().filter(msCaseAffiliate -> msCaseAffiliate.getRoleType() != null
|
||||
appOpt = operatorList.stream().filter(msCaseAffiliate -> msCaseAffiliate.getRoleType() != null && msCaseAffiliate.getUserId()!=null
|
||||
&& (msCaseAffiliate.getRoleType() == 1 || msCaseAffiliate.getRoleType() == 2))
|
||||
.findFirst();
|
||||
resOpt = operatorList.stream().filter(msCaseAffiliate -> msCaseAffiliate.getRoleType() != null
|
||||
resOpt = operatorList.stream().filter(msCaseAffiliate -> msCaseAffiliate.getRoleType() != null&& msCaseAffiliate.getUserId()!=null
|
||||
&& (msCaseAffiliate.getRoleType() == 3 || msCaseAffiliate.getRoleType() == 4))
|
||||
.findFirst();
|
||||
}
|
||||
|
||||
if(appOpt==null || !appOpt.isPresent()){
|
||||
return AjaxResult.error("未找到案件申请操作人");
|
||||
}
|
||||
if(resOpt==null || !resOpt.isPresent()){
|
||||
return AjaxResult.error("未找到案件被申请操作人");
|
||||
}
|
||||
MsCaseApplication caseApplication = msCaseApplicationMapper.selectByPrimaryKey(caseId);
|
||||
Integer organizeFlag = caseApplication.getOrganizeFlag();
|
||||
SysUser user = new SysUser();
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
user.setUserId(userId);
|
||||
List<SysUser> listSysUser = userMapper.selectUserList(user);
|
||||
List<SysRole> allSysRole = new ArrayList<>();
|
||||
for(SysUser sysUser :listSysUser){
|
||||
List<SysRole> roles = sysUser.getRoles();
|
||||
allSysRole.addAll(roles);
|
||||
}
|
||||
List<String> roleNames = allSysRole.stream().map(SysRole::getRoleName).collect(Collectors.toList());
|
||||
if(roleNames.contains("申请人")){
|
||||
if(appOpt==null || !appOpt.isPresent()){
|
||||
return AjaxResult.error("未找到案件申请操作人");
|
||||
}
|
||||
|
||||
if(appOpt.get().getUserId()!=null && appOpt.get().getUserId().equals(userId)){
|
||||
// 申请人链接
|
||||
SealSignRecord sealSignRecordres = new SealSignRecord();
|
||||
MsSealSignRecord mssealSignRecord = new MsSealSignRecord();
|
||||
mssealSignRecord.setCaseAppliId(caseId);
|
||||
@@ -605,10 +606,9 @@ public class MsSignSealServiceImpl implements MsSignSealService {
|
||||
}
|
||||
|
||||
|
||||
}else if(roleNames.contains("被申请人")){
|
||||
if(resOpt==null || !resOpt.isPresent()){
|
||||
return AjaxResult.error("未找到案件申请操作人");
|
||||
}
|
||||
}
|
||||
if(resOpt.get().getUserId()!=null && resOpt.get().getUserId().equals(userId)){
|
||||
|
||||
SealSignRecord sealSignRecordres = new SealSignRecord();
|
||||
MsSealSignRecord mssealSignRecord = new MsSealSignRecord();
|
||||
mssealSignRecord.setCaseAppliId(caseId);
|
||||
@@ -630,7 +630,8 @@ public class MsSignSealServiceImpl implements MsSignSealService {
|
||||
}else {
|
||||
return AjaxResult.error();
|
||||
}
|
||||
}else if(roleNames.contains("调解员")){
|
||||
}
|
||||
if(mediatorCount>0){
|
||||
SealSignRecord sealSignRecordres = new SealSignRecord();
|
||||
MsSealSignRecord mssealSignRecord = new MsSealSignRecord();
|
||||
mssealSignRecord.setCaseAppliId(caseId);
|
||||
@@ -859,7 +860,7 @@ public class MsSignSealServiceImpl implements MsSignSealService {
|
||||
if(StrUtil.isEmpty(caseApplicationselect.getCaseSource()) ) {
|
||||
String templatePath = "/home/ruoyi" + savePath;
|
||||
File file = new File(templatePath.replace("/profile", "/uploadPath"));
|
||||
MsCaseFileInfo caseFileInfo = beiMingInterfaceService.pushAttachmentInfo(BMUserName, BMPassword, file, BMSyncSource, caseApplicationselect.getCaseNum(), AttachmentOperateTypeEnum.ADD);
|
||||
MsCaseFileInfo caseFileInfo = beiMingInterfaceService.pushAttachmentInfo(BMUserName, BMPassword, file, BMSyncSource, caseApplicationselect.getCaseNum(), AttachmentOperateTypeEnum.ADD, DocumentTypeEnum.EVEDENT_AGREEMENT);
|
||||
// 更新附件表
|
||||
if(caseFileInfo!=null && StrUtil.isNotEmpty(caseFileInfo.getFileId())){
|
||||
caseAttach.setOtherSysFileId(caseFileInfo.getFileId());
|
||||
@@ -954,7 +955,7 @@ public class MsSignSealServiceImpl implements MsSignSealService {
|
||||
if(StrUtil.isEmpty(caseApplicationselect.getCaseSource()) ) {
|
||||
String templatePath = "/home/ruoyi" + savePath;
|
||||
File file = new File(templatePath.replace("/profile", "/uploadPath"));
|
||||
MsCaseFileInfo caseFileInfo = beiMingInterfaceService.pushAttachmentInfo(BMUserName, BMPassword, file, BMSyncSource, caseApplicationselect.getCaseNum(), AttachmentOperateTypeEnum.ADD);
|
||||
MsCaseFileInfo caseFileInfo = beiMingInterfaceService.pushAttachmentInfo(BMUserName, BMPassword, file, BMSyncSource, caseApplicationselect.getCaseNum(), AttachmentOperateTypeEnum.ADD,DocumentTypeEnum.EVEDENT_AGREEMENT);
|
||||
// 更新附件表
|
||||
if(caseFileInfo!=null && StrUtil.isNotEmpty(caseFileInfo.getFileId())){
|
||||
caseAttach.setOtherSysFileId(caseFileInfo.getFileId());
|
||||
@@ -1041,20 +1042,19 @@ public class MsSignSealServiceImpl implements MsSignSealService {
|
||||
caseAttach.setAnnexType(7);
|
||||
caseAttach.setAnnexPath(savePath);
|
||||
caseAttach.setAnnexName(saveName);
|
||||
caseAttachMapper.save(caseAttach);
|
||||
|
||||
// todo 对接北明,调用上传附件接口
|
||||
|
||||
if(StrUtil.isEmpty(caseApplicationselect.getCaseSource()) ) {
|
||||
String templatePath = "/home/ruoyi" + savePath;
|
||||
File file = new File(templatePath.replace("/profile", "/uploadPath"));
|
||||
MsCaseFileInfo caseFileInfo = beiMingInterfaceService.pushAttachmentInfo(BMUserName, BMPassword, file, BMSyncSource, caseApplicationselect.getCaseNum(), AttachmentOperateTypeEnum.ADD);
|
||||
|
||||
MsCaseFileInfo caseFileInfo = beiMingInterfaceService.pushAttachmentInfo(BMUserName, BMPassword, file, BMSyncSource, caseApplicationselect.getCaseNum(), AttachmentOperateTypeEnum.ADD,DocumentTypeEnum.EVEDENT_AGREEMENT);
|
||||
// 更新附件表
|
||||
if(caseFileInfo!=null && StrUtil.isNotEmpty(caseFileInfo.getFileId())){
|
||||
caseAttach.setOtherSysFileId(caseFileInfo.getFileId());
|
||||
msCaseAttachMapper.updateCaseAttachBycaseid(caseAttach);
|
||||
}
|
||||
}
|
||||
caseAttachMapper.save(caseAttach);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+57
@@ -1,6 +1,8 @@
|
||||
package com.ruoyi.wisdomarbitrate.service.mscase.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.io.FileUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.http.HttpUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
@@ -9,15 +11,19 @@ import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.domain.entity.SysRole;
|
||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||
import com.ruoyi.common.enums.AnnexTypeEnum;
|
||||
import com.ruoyi.common.enums.AttachmentOperateTypeEnum;
|
||||
import com.ruoyi.common.enums.DocumentTypeEnum;
|
||||
import com.ruoyi.common.exception.ServiceException;
|
||||
import com.ruoyi.common.utils.PdfUtils;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.system.mapper.SysRoleMapper;
|
||||
import com.ruoyi.system.mapper.SysUserMapper;
|
||||
import com.ruoyi.system.service.impl.BeiMingInterfaceService;
|
||||
import com.ruoyi.wisdomarbitrate.domain.dto.mscase.ReservedConference;
|
||||
import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseApplication;
|
||||
import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAttach;
|
||||
import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseApplicationVO;
|
||||
import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseFileInfo;
|
||||
import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsReservedConferenceVO;
|
||||
import com.ruoyi.wisdomarbitrate.mapper.mscase.MsCaseApplicationMapper;
|
||||
import com.ruoyi.wisdomarbitrate.mapper.mscase.MsCaseAttachMapper;
|
||||
@@ -39,6 +45,7 @@ import tk.mybatis.mapper.entity.Example;
|
||||
|
||||
import javax.crypto.Mac;
|
||||
import javax.crypto.spec.SecretKeySpec;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.*;
|
||||
@@ -78,6 +85,15 @@ public class VideoConferenceServiceImpl implements VideoConferenceService {
|
||||
private ReservedConferenceMapper reservedConferenceMapper;
|
||||
@Autowired
|
||||
private SysUserMapper sysUserMapper;
|
||||
// 北明配置
|
||||
@Value("${BMConfig.userName}")
|
||||
private String BMUserName;
|
||||
@Value("${BMConfig.password}")
|
||||
private String BMPassword;
|
||||
@Value("${BMConfig.syncSource}")
|
||||
private String BMSyncSource;
|
||||
@Autowired
|
||||
BeiMingInterfaceService beiMingInterfaceService;
|
||||
|
||||
/**
|
||||
视频回调
|
||||
@@ -399,6 +415,11 @@ public class VideoConferenceServiceImpl implements VideoConferenceService {
|
||||
@Transactional
|
||||
@Override
|
||||
public AjaxResult htmlToPDF(MsReservedConferenceVO reservedConferenceVO) {
|
||||
// 查询案件
|
||||
MsCaseApplication caseApplication = caseApplicationMapper.selectByPrimaryKey(reservedConferenceVO.getCaseId());
|
||||
if(caseApplication==null){
|
||||
return AjaxResult.error("案件不存在");
|
||||
}
|
||||
String currentFileName = System.currentTimeMillis() + ".pdf";
|
||||
String fileName = null;
|
||||
try {
|
||||
@@ -413,12 +434,35 @@ public class VideoConferenceServiceImpl implements VideoConferenceService {
|
||||
// 绑定案件
|
||||
if(convertFlag){
|
||||
// 删除之前的庭审笔录
|
||||
if(StrUtil.isEmpty(caseApplication.getCaseSource())){
|
||||
List<MsCaseAttach> existAttach = caseAttachMapper.listCaseAttachByCaseIdAndType(reservedConferenceVO.getCaseId(), AnnexTypeEnum.MEDIATE.getCode());
|
||||
if(CollectionUtil.isNotEmpty(existAttach)){
|
||||
// todo 对接北明,同步案件状态,删除
|
||||
for (MsCaseAttach msCaseAttach : existAttach) {
|
||||
if(StrUtil.isEmpty(msCaseAttach.getOtherSysFileId())||StrUtil.isEmpty(msCaseAttach.getAnnexPath())){
|
||||
continue;
|
||||
}
|
||||
beiMingInterfaceService.deleteAttachmentInfo(caseApplication.getCaseNum(), msCaseAttach.getOtherSysFileId(), FileUtil.getName(msCaseAttach.getAnnexPath()));
|
||||
}
|
||||
}
|
||||
}
|
||||
caseAttachMapper.deleteCaseAttachByCasedIdAndType(reservedConferenceVO.getCaseId(),AnnexTypeEnum.MEDIATE.getCode());
|
||||
MsCaseAttach caseAttach = MsCaseAttach.builder().caseAppliId(reservedConferenceVO.getCaseId())
|
||||
.annexName(currentFileName)
|
||||
.annexPath(fileName)
|
||||
.annexType(AnnexTypeEnum.MEDIATE.getCode())
|
||||
.build();
|
||||
// todo 对接北明,调用上传附件接口
|
||||
|
||||
if(StrUtil.isEmpty(caseApplication.getCaseSource()) ) {
|
||||
String templatePath = "/home/ruoyi" + caseAttach.getAnnexPath();
|
||||
File file = new File(templatePath.replace("/profile", "/uploadPath"));
|
||||
MsCaseFileInfo caseFileInfo = beiMingInterfaceService.pushAttachmentInfo(BMUserName, BMPassword, file, BMSyncSource, caseApplication.getCaseNum(), AttachmentOperateTypeEnum.ADD,DocumentTypeEnum.EVEDENT_MEDIATION_RECORD);
|
||||
// 更新附件表
|
||||
if(caseFileInfo!=null && StrUtil.isNotEmpty(caseFileInfo.getFileId())){
|
||||
caseAttach.setOtherSysFileId(caseFileInfo.getFileId());
|
||||
}
|
||||
}
|
||||
caseAttachMapper.save(caseAttach);
|
||||
return AjaxResult.success();
|
||||
}else {
|
||||
@@ -460,7 +504,20 @@ public class VideoConferenceServiceImpl implements VideoConferenceService {
|
||||
.annexPath(annexName)
|
||||
.annexType(AnnexTypeEnum.MEETING_VIDEO.getCode())
|
||||
.build();
|
||||
// todo 对接北明,调用上传附件接口
|
||||
|
||||
if(StrUtil.isEmpty(caseApplication.getCaseSource()) ) {
|
||||
String templatePath = "/home/ruoyi" + caseAttach.getAnnexPath();
|
||||
File file = new File(templatePath.replace("/profile", "/uploadPath"));
|
||||
MsCaseFileInfo caseFileInfo = beiMingInterfaceService.pushAttachmentInfo(BMUserName, BMPassword, file, BMSyncSource, caseApplication.getCaseNum(), AttachmentOperateTypeEnum.ADD, DocumentTypeEnum.EVEDENT_MEDIATION_VIDEO);
|
||||
|
||||
// 更新附件表
|
||||
if(caseFileInfo!=null && StrUtil.isNotEmpty(caseFileInfo.getFileId())){
|
||||
caseAttach.setOtherSysFileId(caseFileInfo.getFileId());
|
||||
}
|
||||
}
|
||||
caseAttachMapper.save(caseAttach);
|
||||
|
||||
return annexName;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -115,6 +115,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
<if test="code != null and code != ''">code,</if>
|
||||
<if test="compLegalPerson != null and compLegalPerson != ''">comp_legal_person,</if>
|
||||
<if test="home != null and home != ''">home,</if>
|
||||
<if test="address != null and address != ''">address,</if>
|
||||
<if test="nationality != null ">nationality,</if>
|
||||
create_time
|
||||
)values(
|
||||
<if test="deptId != null and deptId != 0">#{deptId},</if>
|
||||
@@ -130,6 +133,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
<if test="code != null and code != ''">#{code},</if>
|
||||
<if test="compLegalPerson != null and compLegalPerson != ''">#{compLegalPerson},</if>
|
||||
<if test="home != null and home != ''">#{home},</if>
|
||||
<if test="address != null and address != ''">#{address},</if>
|
||||
<if test="nationality != null ">#{nationality},</if>
|
||||
sysdate()
|
||||
);
|
||||
</insert>
|
||||
@@ -148,6 +154,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
create_by,
|
||||
code,
|
||||
comp_legal_person,
|
||||
nationality,
|
||||
home,
|
||||
address,
|
||||
create_time
|
||||
)values
|
||||
<foreach item="item" index="index" collection="list" separator=",">
|
||||
@@ -165,6 +174,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
#{item.createBy},
|
||||
#{item.code},
|
||||
#{item.compLegalPerson},
|
||||
#{item.nationality},
|
||||
#{item.home},
|
||||
#{item.address},
|
||||
sysdate()
|
||||
)
|
||||
</foreach>;
|
||||
@@ -186,6 +198,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||
<if test="code != null and code != ''">code = #{code},</if>
|
||||
<if test="compLegalPerson != null and compLegalPerson != ''">comp_legal_person = #{compLegalPerson},</if>
|
||||
<if test="home != null and home != ''">home = #{home},</if>
|
||||
<if test="address != null and address != ''">address = #{address},</if>
|
||||
<if test="nationality != null ">nationality = #{nationality},</if>
|
||||
update_time = sysdate()
|
||||
</set>
|
||||
where dept_id = #{deptId}
|
||||
|
||||
+14
-4
@@ -39,8 +39,13 @@
|
||||
group by a.case_appli_id
|
||||
</select>
|
||||
<select id="selectByCaseId" resultType="com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAffiliate">
|
||||
select c.id caseAppliId,a.id,a.role_type roleType,a.group_order groupOrder,a.operator_flag operatorFlag,d.code,d.comp_legal_person compLegalPerson,u.nick_name name,u.id_card idCard,u.phonenumber phone,
|
||||
u.email,u.home,u.address,u.sex,u.nationality,u.id_type idType,u.birth,a.user_id userId
|
||||
select c.id caseAppliId,a.id,a.role_type roleType,a.group_order groupOrder,a.operator_flag operatorFlag,d.code,d.comp_legal_person compLegalPerson,u.id_card idCard,u.phonenumber phone,
|
||||
u.email,
|
||||
(case when a.user_id is null then d.dept_name else u.nick_name end) name,
|
||||
(case when a.user_id is null then d.home else u.home end) home,
|
||||
(case when a.user_id is null then d.address else u.address end) address,
|
||||
(case when a.user_id is null then d.nationality else u.nationality end) nationality,
|
||||
u.sex,u.id_type idType,u.birth,a.user_id userId,c.organize_flag organizeFlag,c.case_source caseSource,d.dept_name applicantOrgName
|
||||
FROM
|
||||
ms_case_application c
|
||||
JOIN ms_case_affiliate a ON a.case_appli_id=#{id} and c.id = a.case_appli_id
|
||||
@@ -52,8 +57,13 @@
|
||||
GROUP BY a.id
|
||||
</select>
|
||||
<select id="selectUserRoleByCaseIds" resultType="com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAffiliate">
|
||||
select c.id caseAppliId,a.id,a.role_type roleType,a.group_order groupOrder,a.operator_flag operatorFlag,d.code,d.comp_legal_person compLegalPerson,u.nick_name name,u.id_card idCard,u.phonenumber phone,
|
||||
u.email,u.home,u.address,u.sex,u.nationality,u.id_type idType,u.birth,r.role_name roleName,d.dept_name applicantOrgName,a.user_id userId
|
||||
select c.id caseAppliId,a.id,a.role_type roleType,a.group_order groupOrder,a.operator_flag operatorFlag,d.code,d.comp_legal_person compLegalPerson,u.id_card idCard,u.phonenumber phone,
|
||||
u.email,
|
||||
(case when a.user_id is null then d.dept_name else u.nick_name end) name,
|
||||
(case when a.user_id is null then d.home else u.home end) home,
|
||||
(case when a.user_id is null then d.address else u.address end) address,
|
||||
(case when a.user_id is null then d.nationality else u.nationality end) nationality,
|
||||
u.sex,u.id_type idType,u.birth,r.role_name roleName,d.dept_name applicantOrgName,a.user_id userId,a.applicant_dept_id applicantDeptId,c.organize_flag organizeFlag,c.case_source caseSource
|
||||
FROM
|
||||
ms_case_application c
|
||||
JOIN ms_case_affiliate a ON c.id = a.case_appli_id
|
||||
|
||||
+2
-2
@@ -110,7 +110,7 @@
|
||||
<select id="list" resultType="com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseApplicationVO">
|
||||
select t.* from(
|
||||
SELECT
|
||||
c.id,c.media_result mediaResult,c.room_id roomId,0 AS pendingStatus,
|
||||
c.id,c.organize_flag organizeFlag,c.case_source caseSource,c.media_result mediaResult,c.room_id roomId,0 AS pendingStatus,
|
||||
c.case_flow_id caseFlowId,c.batch_number batchNumber,c.case_num caseNum,
|
||||
u1.nick_name mediatorName,c.hear_date hearDate,c.case_status_name caseStatusName,c.create_time createTime,
|
||||
c.mediation_method mediationMethod,
|
||||
@@ -120,7 +120,7 @@
|
||||
c.id
|
||||
union
|
||||
SELECT
|
||||
c.id,c.media_result mediaResult,c.room_id roomId,1 AS pendingStatus,
|
||||
c.id,c.organize_flag organizeFlag,c.case_source caseSource,c.media_result mediaResult,c.room_id roomId,1 AS pendingStatus,
|
||||
c.case_flow_id caseFlowId,c.batch_number batchNumber,c.case_num caseNum,
|
||||
u1.nick_name mediatorName,c.hear_date hearDate,c.case_status_name caseStatusName,c.create_time createTime,
|
||||
c.mediation_method mediationMethod,
|
||||
|
||||
Reference in New Issue
Block a user