获取证据目录列表
This commit is contained in:
+30
@@ -3,7 +3,9 @@ package com.ruoyi.wisdomarbitrate.service;
|
||||
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
|
||||
import com.ruoyi.wisdomarbitrate.domain.CaseEvidenceDirectory;
|
||||
import com.ruoyi.wisdomarbitrate.domain.dto.CaseEvidenceDTO;
|
||||
import com.ruoyi.wisdomarbitrate.domain.vo.CaseEvidenceDirectoryVO;
|
||||
import com.ruoyi.wisdomarbitrate.domain.vo.CaseEvidenceVO;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
@@ -35,4 +37,32 @@ public interface ICaseEvidenceService {
|
||||
AjaxResult fileList(Long caseAppliId, List<Integer> annexTypeList);
|
||||
|
||||
int deleteFile( List<Integer> fileIds);
|
||||
|
||||
List<CaseEvidenceDirectoryVO> selectEvidenceTreeList(CaseEvidenceDirectory caseEvidenceDirectory);
|
||||
|
||||
|
||||
/**
|
||||
* 查询证据目录数据
|
||||
*
|
||||
* @param caseEvidenceDirectory 证据目录信息
|
||||
* @return 证据目录信息集合
|
||||
*/
|
||||
List<CaseEvidenceDirectory> selectCaseEvidenceList(CaseEvidenceDirectory caseEvidenceDirectory);
|
||||
|
||||
|
||||
/**
|
||||
* 构建前端所需要树结构
|
||||
*
|
||||
* @param caseEvidenceDirectorys 证据列表
|
||||
* @return 树结构列表
|
||||
*/
|
||||
List<CaseEvidenceDirectory> buildCaseEvidenceTree(List<CaseEvidenceDirectory> caseEvidenceDirectorys);
|
||||
|
||||
/**
|
||||
* 构建前端所需要下拉树结构
|
||||
*
|
||||
* @param caseEvidenceDirectorys 证据目录列表
|
||||
* @return 下拉树结构列表
|
||||
*/
|
||||
List<CaseEvidenceDirectoryVO> buildCaseEvidenceTreeSelect(List<CaseEvidenceDirectory> caseEvidenceDirectorys);
|
||||
}
|
||||
|
||||
+110
-34
@@ -7,6 +7,8 @@ import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.domain.model.LoginUser;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.utils.spring.SpringUtils;
|
||||
import com.ruoyi.wisdomarbitrate.domain.vo.CaseEvidenceDirectoryVO;
|
||||
import com.ruoyi.wisdomarbitrate.utils.CaseLogUtils;
|
||||
import com.ruoyi.common.utils.file.FileUploadUtils;
|
||||
import com.ruoyi.wisdomarbitrate.domain.*;
|
||||
@@ -24,6 +26,7 @@ import org.springframework.web.multipart.MultipartFile;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -39,6 +42,8 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService {
|
||||
private CaseAttachMapper caseAttachMapper;
|
||||
@Autowired
|
||||
private CaseLogRecordMapper caseLogRecordMapper;
|
||||
@Autowired
|
||||
private CaseEvidenceDirectoryMapper caseEvidenceDirectoryMapper;
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
@@ -103,8 +108,8 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService {
|
||||
.userName(userName)
|
||||
.build();
|
||||
int count = caseAttachMapper.save(caseAttach);
|
||||
if (count > 0 && annexType!=null && annexType!=8) {
|
||||
if(id!=null){
|
||||
if (count > 0 && annexType != null && annexType != 8) {
|
||||
if (id != null) {
|
||||
//修改案件状态
|
||||
CaseApplication caseApplication = new CaseApplication();
|
||||
caseApplication.setId(id);
|
||||
@@ -115,7 +120,7 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService {
|
||||
caseAttachselect.setAnnexId(caseAttach.getAnnexId());
|
||||
caseAttachselect.setAnnexName(caseAttach.getAnnexName());
|
||||
caseAttachselect.setAnnexType(caseAttach.getAnnexType());
|
||||
return AjaxResult.success("上传成功",caseAttachselect);
|
||||
return AjaxResult.success("上传成功", caseAttachselect);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
@@ -125,19 +130,19 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService {
|
||||
}
|
||||
|
||||
|
||||
@Autowired
|
||||
IdentityAuthenticationMapper identityAuthenticationMapper;
|
||||
@Autowired
|
||||
IdentityAuthenticationMapper identityAuthenticationMapper;
|
||||
|
||||
@Override
|
||||
public List<CaseEvidenceVO> getCaseListAll(String identityNum) {
|
||||
if(StringUtils.isBlank(identityNum)){
|
||||
if (StringUtils.isBlank(identityNum)) {
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
String username = loginUser.getUsername();
|
||||
IdentityAuthentication authentication=new IdentityAuthentication();
|
||||
IdentityAuthentication authentication = new IdentityAuthentication();
|
||||
authentication.setUserName(username);
|
||||
IdentityAuthentication authentication1 = identityAuthenticationMapper.selectIdentityAuthentication(authentication);
|
||||
if(authentication1!=null){
|
||||
identityNum = authentication1.getIdentityNo();
|
||||
if (authentication1 != null) {
|
||||
identityNum = authentication1.getIdentityNo();
|
||||
}
|
||||
}
|
||||
List<Integer> caseStatusList = Arrays.asList(CaseApplicationConstants.CASE_CROSSEXAMI);
|
||||
@@ -150,7 +155,7 @@ IdentityAuthenticationMapper identityAuthenticationMapper;
|
||||
int i = caseApplicationMapper.submitCaseApplication(caseApplication);
|
||||
if (i > 0) {
|
||||
// 新增日志
|
||||
CaseLogUtils.insertCaseLog(caseApplication.getId(),CaseApplicationConstants.PENDING_TRIAL,"");
|
||||
CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.PENDING_TRIAL, "");
|
||||
|
||||
return AjaxResult.success("证据确认成功");
|
||||
}
|
||||
@@ -182,25 +187,26 @@ IdentityAuthenticationMapper identityAuthenticationMapper;
|
||||
//修改案件状态
|
||||
caseApplication1.setCaseStatus(CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL_SUBMMIT);
|
||||
//选择仲裁方式
|
||||
if (caseEvidenceDTO.getOpenCourtHear()==1){ //开庭审理
|
||||
if (caseEvidenceDTO.getOpenCourtHear() == 1) { //开庭审理
|
||||
caseApplication1.setArbitratMethod(1);
|
||||
}else {
|
||||
} else {
|
||||
caseApplication1.setArbitratMethod(2); //书面审理
|
||||
}
|
||||
int i = caseApplicationMapper.submitCaseApplication(caseApplication1);
|
||||
if (i > 0) {
|
||||
// 新增日志
|
||||
CaseLogUtils.insertCaseLog(caseApplication.getId(),CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL_SUBMMIT,"");
|
||||
CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL_SUBMMIT, "");
|
||||
|
||||
return AjaxResult.success("提交成功");
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public AjaxResult batchUpload(MultipartFile[] files, Integer annexType, Long id, String userName, Long userId) {
|
||||
List<CaseAttach> successList= new ArrayList<>();
|
||||
List<CaseAttach> successList = new ArrayList<>();
|
||||
try {
|
||||
String filePath = RuoYiConfig.getUploadPath();
|
||||
for (MultipartFile file : files) {
|
||||
@@ -214,8 +220,8 @@ IdentityAuthenticationMapper identityAuthenticationMapper;
|
||||
.userName(userName)
|
||||
.build();
|
||||
int count = caseAttachMapper.save(caseAttach);
|
||||
if (count > 0 && annexType!=null && annexType!=8) {
|
||||
if(id!=null){
|
||||
if (count > 0 && annexType != null && annexType != 8) {
|
||||
if (id != null) {
|
||||
//修改案件状态
|
||||
CaseApplication caseApplication = new CaseApplication();
|
||||
caseApplication.setId(id);
|
||||
@@ -236,41 +242,111 @@ IdentityAuthenticationMapper identityAuthenticationMapper;
|
||||
return AjaxResult.error("上传失败");
|
||||
}
|
||||
|
||||
return AjaxResult.success("上传成功",successList);
|
||||
return AjaxResult.success("上传成功", successList);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult fileList(Long caseAppliId, List<Integer> annexTypeList) {
|
||||
public AjaxResult fileList(Long caseAppliId, List<Integer> annexTypeList) {
|
||||
CaseApplication caseApplication = new CaseApplication();
|
||||
caseApplication.setId(caseAppliId);
|
||||
caseApplication.setAnnexTypeList(annexTypeList);
|
||||
List<CaseAttach> caseAttachList = caseAttachMapper.queryCaseAttachList(caseApplication);
|
||||
if(CollectionUtil.isNotEmpty(caseAttachList)){
|
||||
for (CaseAttach caseAttach : caseAttachList) {
|
||||
String annexName = caseAttach.getAnnexName();
|
||||
String prefix = "/profile";
|
||||
int startIndex = annexName.indexOf(prefix);
|
||||
startIndex += prefix.length();
|
||||
String annexPath = "/uploadPath" + annexName.substring(startIndex);
|
||||
caseAttach.setAnnexPath(annexPath);
|
||||
int startIndexnew = annexName.lastIndexOf("/");
|
||||
if(startIndexnew!=-1){
|
||||
String annexNamenew = annexName.substring(startIndexnew+1);
|
||||
caseAttach.setAnnexName(annexNamenew);
|
||||
}
|
||||
if (CollectionUtil.isNotEmpty(caseAttachList)) {
|
||||
for (CaseAttach caseAttach : caseAttachList) {
|
||||
String annexName = caseAttach.getAnnexName();
|
||||
String prefix = "/profile";
|
||||
int startIndex = annexName.indexOf(prefix);
|
||||
startIndex += prefix.length();
|
||||
String annexPath = "/uploadPath" + annexName.substring(startIndex);
|
||||
caseAttach.setAnnexPath(annexPath);
|
||||
int startIndexnew = annexName.lastIndexOf("/");
|
||||
if (startIndexnew != -1) {
|
||||
String annexNamenew = annexName.substring(startIndexnew + 1);
|
||||
caseAttach.setAnnexName(annexNamenew);
|
||||
}
|
||||
return AjaxResult.success(caseAttachList);
|
||||
}
|
||||
return AjaxResult.success(caseAttachList);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteFile( List<Integer> fileIds) {
|
||||
|
||||
public int deleteFile(List<Integer> fileIds) {
|
||||
return caseAttachMapper.deleteByFileIds(fileIds);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CaseEvidenceDirectoryVO> selectEvidenceTreeList(CaseEvidenceDirectory caseEvidenceDirectory) {
|
||||
List<CaseEvidenceDirectory> caseEvidenceDirectorys = SpringUtils.getAopProxy(this).selectCaseEvidenceList(caseEvidenceDirectory);
|
||||
return buildCaseEvidenceTreeSelect(caseEvidenceDirectorys);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CaseEvidenceDirectory> selectCaseEvidenceList(CaseEvidenceDirectory caseEvidenceDirectory) {
|
||||
return caseEvidenceDirectoryMapper.selectList(caseEvidenceDirectory);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CaseEvidenceDirectory> buildCaseEvidenceTree(List<CaseEvidenceDirectory> caseEvidenceDirectorys) {
|
||||
List<CaseEvidenceDirectory> returnList = new ArrayList<>();
|
||||
List<Long> tempList = caseEvidenceDirectorys.stream().map(CaseEvidenceDirectory::getId).collect(Collectors.toList());
|
||||
for (CaseEvidenceDirectory caseEvidenceDirectory : caseEvidenceDirectorys) {
|
||||
// 如果是顶级节点, 遍历该父节点的所有子节点
|
||||
if (!tempList.contains(caseEvidenceDirectory.getParentId())) {
|
||||
recursionFn(caseEvidenceDirectorys, caseEvidenceDirectory);
|
||||
returnList.add(caseEvidenceDirectory);
|
||||
}
|
||||
}
|
||||
if (returnList.isEmpty())
|
||||
{
|
||||
returnList = caseEvidenceDirectorys;
|
||||
}
|
||||
return returnList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CaseEvidenceDirectoryVO> buildCaseEvidenceTreeSelect(List<CaseEvidenceDirectory> caseEvidenceDirectorys) {
|
||||
List<CaseEvidenceDirectory> caseEvidenceDirectories = buildCaseEvidenceTree(caseEvidenceDirectorys);
|
||||
return caseEvidenceDirectories.stream().map(CaseEvidenceDirectoryVO::new).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
/**
|
||||
* 递归列表
|
||||
*/
|
||||
private void recursionFn(List<CaseEvidenceDirectory> list, CaseEvidenceDirectory t) {
|
||||
// 得到子节点列表
|
||||
List<CaseEvidenceDirectory> childList = getChildList(list, t);
|
||||
t.setChildren(childList);
|
||||
for (CaseEvidenceDirectory tChild : childList) {
|
||||
if (hasChild(list, tChild)) {
|
||||
recursionFn(list, tChild);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 得到子节点列表
|
||||
*/
|
||||
private List<CaseEvidenceDirectory> getChildList(List<CaseEvidenceDirectory> list, CaseEvidenceDirectory t) {
|
||||
List<CaseEvidenceDirectory> tlist = new ArrayList<>();
|
||||
Iterator<CaseEvidenceDirectory> it = list.iterator();
|
||||
while (it.hasNext()) {
|
||||
CaseEvidenceDirectory n = it.next();
|
||||
if (StringUtils.isNotNull(n.getParentId()) && n.getParentId().longValue() == t.getId().longValue()) {
|
||||
tlist.add(n);
|
||||
}
|
||||
}
|
||||
return tlist;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断是否有子节点
|
||||
*/
|
||||
private boolean hasChild(List<CaseEvidenceDirectory> list, CaseEvidenceDirectory t) {
|
||||
return getChildList(list, t).size() > 0;
|
||||
}
|
||||
|
||||
private List<CaseEvidenceVO> getCaseEvidenceVOList(String identityNum, List<Integer> caseStatusList, Integer identityType) {
|
||||
List<CaseEvidenceVO> caseListByRespondent = caseEvidenceMapper.getCaseListByRespondent(identityNum, caseStatusList, identityType);
|
||||
if (caseListByRespondent != null && caseListByRespondent.size() > 0) {
|
||||
|
||||
Reference in New Issue
Block a user