Merge branch 'wq' of SH-Arbitrate/Arbitrate-Backend into dev

This commit was merged in pull request #355.
This commit is contained in:
2024-05-14 16:55:24 +08:00
committed by Gitea
17 changed files with 320 additions and 95 deletions
@@ -1,10 +1,20 @@
package com.ruoyi; package com.ruoyi;
import cn.hutool.core.collection.CollectionUtil;
import com.ruoyi.common.constant.CacheConstants;
import com.ruoyi.common.core.domain.entity.SysRole;
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.SysRoleMapper;
import com.ruoyi.system.mapper.SysUserMapper;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.scheduling.annotation.EnableScheduling; import org.springframework.scheduling.annotation.EnableScheduling;
import java.util.List;
/** /**
* 启动程序 * 启动程序
* *
@@ -24,5 +34,22 @@ public class RuoYiApplication
" / /_/ / / / /_/ / / / / /_/ / / /__/ /_/ / / \n" + " / /_/ / / / /_/ / / / / /_/ / / /__/ /_/ / / \n" +
"/___/_/ /_/\\____/_/ /_/\\__, / \\___/\\__,_/_/ \n" + "/___/_/ /_/\\____/_/ /_/\\__, / \\___/\\__,_/_/ \n" +
" /____/ "); " /____/ ");
// 启动成功后,查询用户表,将用户信息存到redis
RedisCache redisCache = SpringUtils.getBean(RedisCache.class);
SysUserMapper userMapper = SpringUtils.getBean(SysUserMapper.class);
List<SysUser> sysUsers = userMapper.selectUserListByIds(null);
if(CollectionUtil.isNotEmpty(sysUsers)){
for (SysUser sysUser : sysUsers) {
redisCache.setCacheObject(CacheConstants.USER_KEY+sysUser.getUserId(),sysUser);
}
}
// 初始化角色redis
SysRoleMapper roleMapper = SpringUtils.getBean(SysRoleMapper.class);
List<SysRole> roles = roleMapper.selectRoleList(new SysRole());
if(CollectionUtil.isNotEmpty(roles)){
for (SysRole role : roles) {
redisCache.setCacheObject(CacheConstants.ROLE_KEY+role.getRoleName(),role.getRoleId());
}
}
} }
} }
@@ -585,4 +585,17 @@ public class CaseApplicationController extends BaseController {
} }
return caseApplicationService.updateCaseIdByAnnexId(caseAttach); return caseApplicationService.updateCaseIdByAnnexId(caseAttach);
} }
/**
* 保存onlyOffice在线编辑的文件
* @param
* @return
*/
@PostMapping("/saveOnlyOfficeFile")
public AjaxResult saveOnlyOfficeFile( @RequestBody CaseAttach caseAttach) {
if(caseAttach.getCaseAppliId()==null||StrUtil.isEmpty(caseAttach.getOnlyOfficeFileId())||StrUtil.isEmpty(caseAttach.getAnnexPath())){
return error("参数校验失败");
}
return caseApplicationService.saveOnlyOfficeFile(caseAttach);
}
} }
@@ -6,6 +6,7 @@ import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.wisdomarbitrate.domain.CaseApplication; import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
import com.ruoyi.wisdomarbitrate.domain.CaseAttach;
import com.ruoyi.wisdomarbitrate.domain.CaseEvidenceDirectory; import com.ruoyi.wisdomarbitrate.domain.CaseEvidenceDirectory;
import com.ruoyi.wisdomarbitrate.domain.dto.CaseEvidenceDTO; import com.ruoyi.wisdomarbitrate.domain.dto.CaseEvidenceDTO;
import com.ruoyi.wisdomarbitrate.domain.vo.CaseEvidenceVO; import com.ruoyi.wisdomarbitrate.domain.vo.CaseEvidenceVO;
@@ -101,16 +102,16 @@ public class CaseEvidenceController extends BaseController {
/** /**
* 删除附件 * 删除附件
* @param fileIds * @param caseAttach
* @return * @return
*/ */
@PostMapping("/deleteFile") @PostMapping("/deleteFile")
public AjaxResult deleteFile( @RequestParam("fileIds") List<Integer> fileIds){ public AjaxResult deleteFile(@RequestBody CaseAttach caseAttach){
if(CollectionUtil.isEmpty(fileIds)){ if(CollectionUtil.isEmpty(caseAttach.getFileIds())){
return error("附件id不能为空"); return error("附件id不能为空");
} }
return toAjax(caseEvidenceService.deleteFile( fileIds)); return success(caseEvidenceService.deleteFile( caseAttach.getFileIds()));
} }
@@ -6,7 +6,8 @@ spring:
druid: druid:
# 主库数据源 # 主库数据源
master: master:
url: jdbc:mysql://121.40.189.20:3306/test_smart_arbitration?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=Asia/Shanghai&useSSL=false url: jdbc:mysql://121.40.189.20:3306/test_smart_arbitration?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&useSSL=true&serverTimezone=Asia/Shanghai&useSSL=false
# url: jdbc:mysql://121.40.189.20:3306/smart_arbitration?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&useSSL=true&serverTimezone=Asia/Shanghai&useSSL=false
username: root username: root
password: YMzc157# password: YMzc157#
# 从库数据源 # 从库数据源
+14 -6
View File
@@ -17,7 +17,7 @@ ruoyi:
# 开发环境配置 # 开发环境配置
server: server:
# 服务器的HTTP端口,默认为8080 # 服务器的HTTP端口,默认为8001,正式9001
port: 8001 port: 8001
servlet: servlet:
# 应用的访问路径 # 应用的访问路径
@@ -58,9 +58,9 @@ spring:
servlet: servlet:
multipart: multipart:
# 单个文件大小 # 单个文件大小
max-file-size: 50MB max-file-size: 1000MB
# 设置总上传的文件大小 # 设置总上传的文件大小
max-request-size: 500MB max-request-size: 10000MB
# 服务模块 # 服务模块
devtools: devtools:
restart: restart:
@@ -72,8 +72,8 @@ spring:
host: 121.40.189.20 host: 121.40.189.20
# 端口,默认为6379 # 端口,默认为6379
port: 6389 port: 6389
# 数据库索引 # 数据库索引,2-正式,3-测试
database: 0 database: 3
# 密码 # 密码
password: password:
# 连接超时时间 # 连接超时时间
@@ -121,7 +121,7 @@ token:
# 令牌密钥 # 令牌密钥
secret: abcdefghijklmnopqrstuvwxyz secret: abcdefghijklmnopqrstuvwxyz
# 令牌有效期(默认30分钟) # 令牌有效期(默认30分钟)
expireTime: 30 expireTime: 1200
# MyBatis配置 # MyBatis配置
mybatis: mybatis:
@@ -183,6 +183,14 @@ imConfig:
secretId: AKID3xfHgroY4MQHvLXUXMwIQL1UjmbBX1Tv secretId: AKID3xfHgroY4MQHvLXUXMwIQL1UjmbBX1Tv
# 腾讯云密钥 # 腾讯云密钥
secretKey: INDrIXcT8YmomZBcsy0oNirnU0LTN4X7 secretKey: INDrIXcT8YmomZBcsy0oNirnU0LTN4X7
# onlyOffice系统url配置
onlyOfficeConfig:
# url: http://172.16.0.254:9090/files/upload
url: http://121.40.189.20:9090/files/upload
# 调解机构代码配置
organizeConfig:
# creditCode
creditCode: 910000058386410044
#jodconverter: #jodconverter:
# local: # local:
# host: 121.40.189.20 # host: 121.40.189.20
@@ -42,4 +42,16 @@ public class CacheConstants
*/ */
public static final String PWD_ERR_CNT_KEY = "pwd_err_cnt:"; public static final String PWD_ERR_CNT_KEY = "pwd_err_cnt:";
public static final String WE_CHAT_SMS_VERIFY_CODE_KEY="we_chat_sms_verify_code:"; public static final String WE_CHAT_SMS_VERIFY_CODE_KEY="we_chat_sms_verify_code:";
/**
* 所有用户 redis key
*/
public static final String USER_KEY = "user_key:";
/**
* 用户邮箱 redis key
*/
// public static final String USER_EMAIL_KEY = "user_email_key:";
/**
* 角色 redis key
*/
public static final String ROLE_KEY = "role_key:";
} }
@@ -6,6 +6,8 @@ import lombok.Builder;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import java.util.List;
@Builder @Builder
@Data @Data
@AllArgsConstructor @AllArgsConstructor
@@ -59,5 +61,9 @@ public class CaseAttach {
* 是否是证据上传,0-否,1-是 * 是否是证据上传,0-否,1-是
*/ */
private Integer isBatchUpload; private Integer isBatchUpload;
/**
* 附件ids
*/
private List<Long> fileIds;
} }
@@ -37,4 +37,8 @@ public class CaseEvidenceVO {
*/ */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date scheduleStartTime; private Date scheduleStartTime;
/**
* 案件编号
*/
private String caseStatusName;
} }
@@ -21,7 +21,7 @@ public interface CaseAttachMapper {
int updateCaseAttachBycaseid(CaseAttach caseAttach); int updateCaseAttachBycaseid(CaseAttach caseAttach);
int deleteByFileIds(@Param("ids") List<Integer> fileIds); int deleteByFileIds(@Param("ids") List<Long> fileIds);
List<CaseAttach> getCaseAttachByCaseIdAndType(CaseAttach caseAttach); List<CaseAttach> getCaseAttachByCaseIdAndType(CaseAttach caseAttach);
@@ -161,4 +161,11 @@ public interface ICaseApplicationService {
* @param annexPath * @param annexPath
*/ */
JSONArray uploadOnlyOffice(String annexPath, Long id); JSONArray uploadOnlyOffice(String annexPath, Long id);
/**
* 保存onlyOffice在线编辑的文件
* @param
* @return
*/
AjaxResult saveOnlyOfficeFile(CaseAttach caseAttach);
} }
@@ -36,7 +36,7 @@ public interface ICaseEvidenceService {
AjaxResult fileList(Long caseAppliId, List<Integer> annexTypeList); AjaxResult fileList(Long caseAppliId, List<Integer> annexTypeList);
int deleteFile( List<Integer> fileIds); int deleteFile( List<Long> fileIds);
List<CaseEvidenceDirectoryVO> selectEvidenceTreeList(CaseEvidenceDirectory caseEvidenceDirectory); List<CaseEvidenceDirectoryVO> selectEvidenceTreeList(CaseEvidenceDirectory caseEvidenceDirectory);
@@ -63,6 +63,8 @@ import java.util.regex.Pattern;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import java.util.zip.ZipOutputStream; import java.util.zip.ZipOutputStream;
import static cn.hutool.system.SystemUtil.getUserInfo;
import static com.google.common.io.Files.getFileExtension;
import static com.ruoyi.common.core.domain.AjaxResult.error; import static com.ruoyi.common.core.domain.AjaxResult.error;
import static com.ruoyi.common.core.domain.AjaxResult.success; import static com.ruoyi.common.core.domain.AjaxResult.success;
import static com.ruoyi.common.utils.PageUtils.startPage; import static com.ruoyi.common.utils.PageUtils.startPage;
@@ -3945,7 +3947,30 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
caseAttachMapper.updateCaseAttach(caseAttach); caseAttachMapper.updateCaseAttach(caseAttach);
return success(); return success();
} }
/**
* 保存onlyOffice在线编辑的文件
* @param
* @return
*/
@Transactional
@Override
public AjaxResult saveOnlyOfficeFile(CaseAttach caseAttach) {
if(StrUtil.isNotEmpty(caseAttach.getAnnexPath())){
String replace = caseAttach.getAnnexPath().replace("/home/ruoyi/uploadPath/", "/profile/");
caseAttach.setAnnexName(replace);
}
caseAttach.setAnnexPath("/home/ruoyi/uploadPath/onlyoffice/");
caseAttach.setAnnexType(3);
caseAttach.setUserId(SecurityUtils.getUserId());
caseAttach.setUserName(SecurityUtils.getUsername());
// 先删除之前的在新增
caseAttachMapper.deleteCaseAttachByCasedIdAndType(caseAttach.getCaseAppliId(), caseAttach.getAnnexType());
caseAttachMapper.save(caseAttach);
return AjaxResult.success();
}
} }
@@ -1,7 +1,10 @@
package com.ruoyi.wisdomarbitrate.service.impl; package com.ruoyi.wisdomarbitrate.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.ruoyi.common.config.RuoYiConfig; import com.ruoyi.common.config.RuoYiConfig;
import com.ruoyi.common.constant.CaseApplicationConstants; import com.ruoyi.common.constant.CaseApplicationConstants;
import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.AjaxResult;
@@ -11,9 +14,11 @@ import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.utils.SecurityUtils; import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.SmsUtils; import com.ruoyi.common.utils.SmsUtils;
import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.file.FileUtils;
import com.ruoyi.common.utils.spring.SpringUtils; import com.ruoyi.common.utils.spring.SpringUtils;
import com.ruoyi.system.mapper.SysUserMapper; import com.ruoyi.system.mapper.SysUserMapper;
import com.ruoyi.wisdomarbitrate.domain.vo.CaseEvidenceDirectoryVO; import com.ruoyi.wisdomarbitrate.domain.vo.CaseEvidenceDirectoryVO;
import com.ruoyi.wisdomarbitrate.service.ICaseApplicationService;
import com.ruoyi.wisdomarbitrate.utils.CaseLogUtils; import com.ruoyi.wisdomarbitrate.utils.CaseLogUtils;
import com.ruoyi.common.utils.file.FileUploadUtils; import com.ruoyi.common.utils.file.FileUploadUtils;
import com.ruoyi.wisdomarbitrate.domain.*; import com.ruoyi.wisdomarbitrate.domain.*;
@@ -32,6 +37,7 @@ import java.io.IOException;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static com.google.common.io.Files.getFileExtension;
import static com.ruoyi.common.utils.SecurityUtils.getUsername; import static com.ruoyi.common.utils.SecurityUtils.getUsername;
@Service @Service
@@ -50,6 +56,8 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService {
private SysUserMapper sysUserMapper; private SysUserMapper sysUserMapper;
@Autowired @Autowired
private SmsRecordMapper smsRecordMapper; private SmsRecordMapper smsRecordMapper;
@Autowired
private ICaseApplicationService caseApplicationService;
@Override @Override
@Transactional @Transactional
@@ -134,15 +142,39 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService {
String filePath = RuoYiConfig.getUploadPath(); String filePath = RuoYiConfig.getUploadPath();
// 上传 // 上传
String fileName = FileUploadUtils.upload(filePath, file); String fileName = FileUploadUtils.upload(filePath, file);
CaseAttach caseAttach = CaseAttach.builder().caseAppliId(id) String suffix = getFileExtension(fileName);
.annexName(fileName) if(StrUtil.isNotEmpty(suffix)&& suffix.contains("doc")){
.annexPath(filePath) // 上传到onlyoffice
.annexType(annexType) JSONArray jsonArray = caseApplicationService.uploadOnlyOffice(fileName,id);
.userId(userId) if(jsonArray!=null && jsonArray.size() > 0) {
.userName(userName) for (Object obj : jsonArray) {
.build(); JSONObject jsonObject = (JSONObject) obj;
int count = caseAttachMapper.save(caseAttach); CaseAttach caseAttach = CaseAttach.builder()
if (count > 0 && annexType != null && annexType != 8) { .caseAppliId(id)
.annexType(annexType)
.annexName(jsonObject.get("fileName")!=null?jsonObject.getString("fileName"):"")
.onlyOfficeFileId(jsonObject.getString("fileId"))
.build();
if(jsonObject.get("filePath")!=null){
String officePath = jsonObject.getString("filePath");
String replace = officePath.replace("/home/ruoyi/uploadPath/", "/profile/");
caseAttach.setAnnexPath(replace);
}
caseAttachMapper.save(caseAttach);
}
}
}else {
CaseAttach caseAttach = CaseAttach.builder().caseAppliId(id)
.annexName(fileName)
.annexPath(filePath)
.annexType(annexType)
.userId(userId)
.userName(userName)
.build();
int count = caseAttachMapper.save(caseAttach);
}
if ( annexType != null && annexType != 8) {
if (id != null) { if (id != null) {
//修改案件状态 //修改案件状态
CaseApplication caseApplication = new CaseApplication(); CaseApplication caseApplication = new CaseApplication();
@@ -151,18 +183,7 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService {
caseApplicationMapper.submitCaseApplication(caseApplication); caseApplicationMapper.submitCaseApplication(caseApplication);
} }
} }
CaseAttach caseAttachselect = new CaseAttach(); return AjaxResult.success();
caseAttachselect.setAnnexId(caseAttach.getAnnexId());
String annexName = caseAttach.getAnnexName();
if(StrUtil.isNotEmpty(annexName)) {
int startIndexnew = annexName.lastIndexOf("/");
if (startIndexnew != -1) {
String annexNamenew = annexName.substring(startIndexnew + 1);
caseAttach.setAnnexName(annexNamenew);
}
}
caseAttachselect.setAnnexType(caseAttach.getAnnexType());
return AjaxResult.success("上传成功", caseAttachselect);
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
} }
@@ -265,27 +286,44 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService {
@Transactional @Transactional
@Override @Override
public AjaxResult batchUpload(MultipartFile[] files, Integer annexType, Long id, String userName, Long userId) { public AjaxResult batchUpload(MultipartFile[] files, Integer annexType, Long id, String userName, Long userId) {
List<CaseAttach> successList = new ArrayList<>();
try { try {
String filePath = RuoYiConfig.getUploadPath(); String filePath = RuoYiConfig.getUploadPath();
for (MultipartFile file : files) { for (MultipartFile file : files) {
// 上传 // 上传
String fileName = FileUploadUtils.upload(filePath, file); String fileName = FileUploadUtils.upload(filePath, file);
CaseAttach caseAttach = CaseAttach.builder().caseAppliId(id) String suffix = getFileExtension(fileName);
.annexName(fileName) if (StrUtil.isNotEmpty(suffix) && suffix.contains("doc")) {
.annexPath(filePath) // 上传onlyoffice
.annexType(annexType) JSONArray jsonArray = caseApplicationService.uploadOnlyOffice(fileName,id);
.userId(userId) if(jsonArray!=null && jsonArray.size() > 0) {
.userName(userName) for (Object obj : jsonArray) {
.isBatchUpload(1) JSONObject jsonObject = (JSONObject) obj;
.build(); CaseAttach caseAttach = CaseAttach.builder()
int count = caseAttachMapper.save(caseAttach); .caseAppliId(id)
if (count > 0 && annexType != null && annexType != 8) { .annexType(annexType)
CaseAttach caseAttachselect = new CaseAttach(); .annexName(jsonObject.get("fileName")!=null?jsonObject.getString("fileName"):"")
caseAttachselect.setAnnexId(caseAttach.getAnnexId());
caseAttachselect.setAnnexName(caseAttach.getAnnexName()); .onlyOfficeFileId(jsonObject.getString("fileId"))
caseAttachselect.setAnnexType(caseAttach.getAnnexType()); .build();
successList.add(caseAttachselect); if(jsonObject.get("filePath")!=null){
String officePath = jsonObject.getString("filePath");
String replace = officePath.replace("/home/ruoyi/uploadPath/", "/profile/");
caseAttach.setAnnexPath(replace);
}
caseAttachMapper.save(caseAttach);
}
}
}else {
CaseAttach caseAttach = CaseAttach.builder().caseAppliId(id)
.annexName(fileName)
.annexPath(filePath)
.annexType(annexType)
.userId(userId)
.userName(userName)
.isBatchUpload(1)
.build();
int count = caseAttachMapper.save(caseAttach);
} }
} }
@@ -333,7 +371,7 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService {
} }
return AjaxResult.success("上传成功", successList); return AjaxResult.success("上传成功");
} }
@@ -363,7 +401,7 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService {
} }
@Override @Override
public int deleteFile(List<Integer> fileIds) { public int deleteFile(List<Long> fileIds) {
return caseAttachMapper.deleteByFileIds(fileIds); return caseAttachMapper.deleteByFileIds(fileIds);
} }
@@ -4,6 +4,8 @@ import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.ruoyi.common.constant.CaseApplicationConstants; import com.ruoyi.common.constant.CaseApplicationConstants;
import com.ruoyi.common.constant.Constants; import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.core.domain.entity.SysDept; import com.ruoyi.common.core.domain.entity.SysDept;
@@ -47,6 +49,7 @@ import java.util.regex.Matcher;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static com.google.common.io.Files.getFileExtension;
import static com.ruoyi.common.core.domain.AjaxResult.error; import static com.ruoyi.common.core.domain.AjaxResult.error;
import static com.ruoyi.common.core.domain.AjaxResult.success; import static com.ruoyi.common.core.domain.AjaxResult.success;
import static com.ruoyi.common.utils.SecurityUtils.getUsername; import static com.ruoyi.common.utils.SecurityUtils.getUsername;
@@ -93,6 +96,8 @@ public class CaseZipImportImpl {
// 申请人角色id // 申请人角色id
private long roleId; private long roleId;
private Integer maxCaseNum; private Integer maxCaseNum;
@Autowired
private CaseZipImportImpl caseZipImportImpl;
@Transactional @Transactional
@@ -164,22 +169,39 @@ public class CaseZipImportImpl {
} }
File[] files = directory.listFiles(); File[] files = directory.listFiles();
CaseZipImportTask caseZipImportTask = null; // todo
try { List<CaseApplication> caseApplications = new ArrayList<>();
caseZipImportTask = new CaseZipImportTask(this, templateId, fatchRuleList, fatchRuleMap, userMap, dictDataList, files , deptMap, SecurityUtils.getLoginUser()); for (File file1 : files) {
} catch (Exception e) { if (file1.isDirectory() && file1.listFiles() != null) {
for (File file2 : file1.listFiles()) {
CaseApplication caseApplication = caseZipImportImpl.buildCaseInfo(file2, templateId, fatchRuleList, fatchRuleMap, userMap, dictDataList, deptMap, SecurityUtils.getLoginUser());
if (caseApplication != null) {
caseApplications.add(caseApplication);
}
}
}
}
if (CollectionUtil.isEmpty(caseApplications)) {
return error("导入失败"); return error("导入失败");
} }
Future<List<CaseApplication>> future = ThreadPoolUtil.submit(caseZipImportTask); // CaseZipImportTask caseZipImportTask = null;
try { // try {
if(future.get()!=null){ // caseZipImportTask = new CaseZipImportTask(this, templateId, fatchRuleList, fatchRuleMap, userMap, dictDataList, files , deptMap, SecurityUtils.getLoginUser());
return success("导入成功"); // } catch (Exception e) {
} // return error("导入失败");
} catch (InterruptedException | ExecutionException e) { // }
e.printStackTrace(); // Future<List<CaseApplication>> future = ThreadPoolUtil.submit(caseZipImportTask);
return error(e.getMessage()); // try {
} // if(future.get()!=null){
return error("导入失败"); // return success("导入成功");
// }
// } catch (InterruptedException | ExecutionException e) {
// e.printStackTrace();
// return error(e.getMessage());
// }
return success("导入成功");
} }
@@ -207,8 +229,8 @@ public class CaseZipImportImpl {
if (fatchMap.size() > 0) { if (fatchMap.size() > 0) {
// 尊敬的{1},您的代理的案件已接入仲裁系统,复制访问https://miniapp-3gpama6l759911ef-1321289474.tcloudbaseapp.com/jump-mp.html 进入小程序进行认证注册。如非本人操作,请忽略本短信 // 尊敬的{1},您的代理的案件已接入仲裁系统,复制访问https://miniapp-3gpama6l759911ef-1321289474.tcloudbaseapp.com/jump-mp.html 进入小程序进行认证注册。如非本人操作,请忽略本短信
SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest(); // SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest();
request.setTemplateId("1956159"); // request.setTemplateId("1956159");
// 新增的案件 // 新增的案件
// 组装案件内置字段主表内容 // 组装案件内置字段主表内容
@@ -268,26 +290,58 @@ public class CaseZipImportImpl {
if (StrUtil.isEmpty(fileUrl)) { if (StrUtil.isEmpty(fileUrl)) {
continue; continue;
} }
// 上传 String suffix = getFileExtension(fileUrl);
String filePath = RuoYiConfig.getUploadPath(); if (StrUtil.isNotEmpty(suffix) && suffix.contains("doc")) {
// 上传onlyoffice
JSONArray jsonArray = caseApplicationService.uploadOnlyOffice(fileUrl,caseApplication.getId());
if(jsonArray!=null && jsonArray.size() > 0) {
for (Object obj : jsonArray) {
JSONObject jsonObject = (JSONObject) obj;
CaseAttach caseAttach = CaseAttach.builder()
.caseAppliId(caseApplication.getId())
.annexName(jsonObject.get("fileName")!=null?jsonObject.getString("fileName"):"")
CaseAttach caseAttach = new CaseAttach(); .onlyOfficeFileId(jsonObject.getString("fileId"))
caseAttach.setCaseAppliId(caseApplication.getId()); .build();
caseAttach.setAnnexPath(filePath); if(jsonObject.get("filePath")!=null){
if (StrUtil.isNotEmpty(fileUrl)) { String officePath = jsonObject.getString("filePath");
String fileName = fileUrl.replace(filePath, "/profile/upload"); String replace = officePath.replace("/home/ruoyi/uploadPath/", "/profile/");
caseAttach.setAnnexName(fileName); caseAttach.setAnnexPath(replace);
}
// 申请人提供的证据材料
caseAttach.setAnnexType(2);
caseAttachs.add(caseAttach);
if (fileUrl.contains("仲裁申请书")) {
CaseAttach applyFile = new CaseAttach();
BeanUtil.copyProperties(caseAttach, applyFile);
applyFile.setAnnexType(1);
caseAttachs.add(applyFile);
}
}
if(fileUrl.contains("申请书")){
CaseAttach applyFile = new CaseAttach();
BeanUtil.copyProperties(caseAttach, applyFile);
applyFile.setAnnexType(1);
caseAttachs.add(applyFile);
}
caseAttach.setAnnexType(2);
caseAttachs.add(caseAttach);
}
}
} else {
// 上传
String filePath = RuoYiConfig.getUploadPath();
CaseAttach caseAttach = new CaseAttach();
caseAttach.setCaseAppliId(caseApplication.getId());
caseAttach.setAnnexPath(filePath);
if (StrUtil.isNotEmpty(fileUrl)) {
String fileName = fileUrl.replace(filePath, "/profile/upload");
caseAttach.setAnnexName(fileName);
}
// 申请人提供的证据材料
caseAttach.setAnnexType(2);
caseAttachs.add(caseAttach);
if (fileUrl.contains("申请书")) {
CaseAttach applyFile = new CaseAttach();
BeanUtil.copyProperties(caseAttach, applyFile);
applyFile.setAnnexType(1);
caseAttachs.add(applyFile);
}
}
} }
caseApplication.setCaseAttachList(caseAttachs); caseApplication.setCaseAttachList(caseAttachs);
// 案件压缩包导入 // 案件压缩包导入
@@ -300,8 +354,9 @@ public class CaseZipImportImpl {
// } // }
// 多线程执行 // 多线程执行
ThreadPoolUtil.execute(() -> { // ThreadPoolUtil.execute(() -> {
try { try {
caseApplicationMapper.insertCaseApplication(caseApplication); caseApplicationMapper.insertCaseApplication(caseApplication);
// 新增日志 // 新增日志
CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CASE_APPLICATION, "",loginUser); CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CASE_APPLICATION, "",loginUser);
@@ -337,10 +392,10 @@ public class CaseZipImportImpl {
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
throw new RuntimeException("导入失败,请检查抓取规则是否正确"); throw new RuntimeException("案件导入失败");
} }
}); // });
return caseApplication; return caseApplication;
} }
} }
@@ -10,6 +10,7 @@ import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.EsignHttpResponse; import com.ruoyi.common.core.domain.entity.EsignHttpResponse;
import com.ruoyi.common.exception.EsignDemoException; import com.ruoyi.common.exception.EsignDemoException;
import com.ruoyi.common.utils.EmailOutUtil; import com.ruoyi.common.utils.EmailOutUtil;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.file.SaaSAPIFileUtils; import com.ruoyi.common.utils.file.SaaSAPIFileUtils;
import com.ruoyi.system.mapper.SysUserMapper; import com.ruoyi.system.mapper.SysUserMapper;
@@ -162,7 +163,11 @@ public class MsSignSealServiceImpl implements MsSignSealService {
caseAttach.setAnnexType(3); caseAttach.setAnnexType(3);
caseAttach.setAnnexPath(savePath); caseAttach.setAnnexPath(savePath);
caseAttach.setAnnexName(saveName); caseAttach.setAnnexName(saveName);
caseAttachMapper.updateCaseAttachBycaseid(caseAttach); caseAttach.setUserName(SecurityUtils.getUsername());
caseAttach.setUserId(SecurityUtils.getUserId());
// 删除已存在的
caseAttachMapper.deleteCaseAttachByCasedIdAndType(caseAppliId, 3);
caseAttachMapper.save(caseAttach);
} }
} }
@@ -1113,7 +1113,7 @@
c.batch_number, c.batch_number,
c.facts, c.facts,
c.appli_iswrit_hear,c.respon_isWrit_hear, c.appli_iswrit_hear,c.respon_isWrit_hear,
c.mediation_agreement,c.template_id templateId c.mediation_agreement,c.template_id templateId,c.appli_iswrit_hear,c.respon_isWrit_hear
from case_application c from case_application c
LEFT JOIN case_affiliate ca ON ca.case_appli_id = c.id and ca.identity_type=1 LEFT JOIN case_affiliate ca ON ca.case_appli_id = c.id and ca.identity_type=1
@@ -7,12 +7,24 @@
<id property="id" column="id" /> <id property="id" column="id" />
<result property="caseNum" column="case_num" /> <result property="caseNum" column="case_num" />
<result property="caseStatus" column="case_status" /> <result property="caseStatus" column="case_status" />
<result property="caseStatus" column="case_status" />
<result property="roomId" column="room_id" /> <result property="roomId" column="room_id" />
<result property="scheduleStartTime" column="schedule_start_time" /> <result property="caseStatusName" column="caseStatusName" />
</resultMap> </resultMap>
<select id="getCaseListByRespondent" resultType="CaseEvidenceVO" resultMap="CaseEvidenceVOResult"> <select id="getCaseListByRespondent" resultType="CaseEvidenceVO" resultMap="CaseEvidenceVOResult">
select t.* from( select t.* from(
select c.id id, c.case_num,c.case_status,rc.room_id,rc.schedule_start_time select c.id id,c.create_time, c.case_num,c.case_status,
CASE c.case_status when 0 then '立案申请' when 1 then '待立案审查' when 2 then '待缴费'
when 3 then '待缴费确认' when 4 then '待案件质证' when 5 then '待组庭审核'
when 6 then '待组庭确定' when 7 then '待审核仲裁方式' when 8 then '待开庭审理'
when 9 then '待书面审理' when 10 then '待生成裁决书' when 11 then '待核验裁决书'
when 12 then '待部门长审核裁决书' when 13 then '待裁决书签名' when 14 then '待裁决书用印'
when 15 then '待裁决书送达' when 16 then '待案件归档' when 17 then '已归档'
when 18 then '待仲裁员审核裁决书'
when 31 then '待修改开庭时间'
ELSE ''
END caseStatusName,
rc.room_id,rc.schedule_start_time
from case_application as c join case_affiliate as d on c.id = d.case_appli_id from case_application as c join case_affiliate as d on c.id = d.case_appli_id
left join reserved_conference rc on rc.case_id=c.id left join reserved_conference rc on rc.case_id=c.id
where c.id = d.case_appli_id where c.id = d.case_appli_id
@@ -33,7 +45,18 @@
</if> </if>
union union
<!-- 已办案件 --> <!-- 已办案件 -->
select c.id id, c.case_num,c.case_status,rc.room_id,rc.schedule_start_time select c.id id, c.create_time,c.case_num,c.case_status,
CASE c.case_status when 0 then '立案申请' when 1 then '待立案审查' when 2 then '待缴费'
when 3 then '待缴费确认' when 4 then '待案件质证' when 5 then '待组庭审核'
when 6 then '待组庭确定' when 7 then '待审核仲裁方式' when 8 then '待开庭审理'
when 9 then '待书面审理' when 10 then '待生成裁决书' when 11 then '待核验裁决书'
when 12 then '待部门长审核裁决书' when 13 then '待裁决书签名' when 14 then '待裁决书用印'
when 15 then '待裁决书送达' when 16 then '待案件归档' when 17 then '已归档'
when 18 then '待仲裁员审核裁决书'
when 31 then '待修改开庭时间'
ELSE ''
END caseStatusName,
rc.room_id,rc.schedule_start_time
from case_log_record r from case_log_record r
join case_application c on r.case_appli_id=c.id join case_application c on r.case_appli_id=c.id
JOIN case_affiliate ca ON ca.case_appli_id = c.id JOIN case_affiliate ca ON ca.case_appli_id = c.id
@@ -62,6 +85,6 @@
</foreach> </foreach>
</if> </if>
) )
) t ) t order by t.create_time desc
</select> </select>
</mapper> </mapper>