|
|
@@ -1,6 +1,7 @@
|
|
1
|
1
|
package com.ruoyi.wisdomarbitrate.service.impl;
|
|
2
|
2
|
|
|
3
|
3
|
import com.ruoyi.common.config.RuoYiConfig;
|
|
|
4
|
+import com.ruoyi.common.constant.CaseApplicationConstants;
|
|
4
|
5
|
import com.ruoyi.common.core.domain.AjaxResult;
|
|
5
|
6
|
import com.ruoyi.common.utils.file.FileUploadUtils;
|
|
6
|
7
|
import com.ruoyi.wisdomarbitrate.domain.CaseAffiliate;
|
|
|
@@ -19,6 +20,9 @@ import org.springframework.stereotype.Service;
|
|
19
|
20
|
import org.springframework.web.multipart.MultipartFile;
|
|
20
|
21
|
|
|
21
|
22
|
import java.io.IOException;
|
|
|
23
|
+import java.time.LocalDate;
|
|
|
24
|
+import java.time.LocalDateTime;
|
|
|
25
|
+import java.time.format.DateTimeFormatter;
|
|
22
|
26
|
import java.util.Arrays;
|
|
23
|
27
|
import java.util.List;
|
|
24
|
28
|
|
|
|
@@ -38,50 +42,55 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService {
|
|
38
|
42
|
}*/
|
|
39
|
43
|
|
|
40
|
44
|
@Override
|
|
41
|
|
- public AjaxResult getCaseDetailsById(Long id) {
|
|
|
45
|
+ public AjaxResult getCaseDetailsById(Long id,String userName) {
|
|
42
|
46
|
CaseApplication caseApplication = new CaseApplication();
|
|
43
|
47
|
caseApplication.setId(id);
|
|
44
|
48
|
CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication);
|
|
45
|
|
- if (caseApplication1!=null){
|
|
|
49
|
+ if (caseApplication1 != null) {
|
|
46
|
50
|
CaseDetailVO caseDetailVO = new CaseDetailVO();
|
|
47
|
|
- BeanUtils.copyProperties(caseApplication1,caseDetailVO);
|
|
48
|
|
- //查询案件证据材料
|
|
49
|
|
- // List <CaseAttach> evidenceMaterialList = caseAttachMapper.queryAnnexPathByCaseId(id);
|
|
|
51
|
+ BeanUtils.copyProperties(caseApplication1, caseDetailVO);
|
|
50
|
52
|
CaseAffiliate caseAffiliate = new CaseAffiliate();
|
|
51
|
53
|
caseAffiliate.setCaseAppliId(id);
|
|
52
|
54
|
List<CaseAffiliate> caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate);
|
|
53
|
55
|
for (CaseAffiliate affiliate : caseAffiliates) {
|
|
54
|
|
- if (affiliate.getIdentityType() == 1){ //申请人
|
|
|
56
|
+ String name = affiliate.getName();
|
|
|
57
|
+ //判断当前登录人和案件关联人姓名是否一致
|
|
|
58
|
+ if (name.equals(userName)) { //一致,将案件关联人的身份类型赋给当前登录人
|
|
|
59
|
+ caseDetailVO.setIdentityType(affiliate.getIdentityType());
|
|
|
60
|
+ }
|
|
|
61
|
+ if (affiliate.getIdentityType() == 1) { //申请人
|
|
55
|
62
|
caseDetailVO.setApplicantName(affiliate.getName());
|
|
56
|
|
- }else {
|
|
|
63
|
+ } else {
|
|
57
|
64
|
caseDetailVO.setRespondentName(affiliate.getName());
|
|
58
|
65
|
}
|
|
|
66
|
+ //根据案件id查询案件证据材料
|
|
|
67
|
+ List<CaseAttach> evidenceMaterialList = caseAttachMapper.queryAnnexPathByCaseId(id);
|
|
|
68
|
+ caseDetailVO.setEvidenceMaterialList(evidenceMaterialList);
|
|
59
|
69
|
}
|
|
60
|
70
|
return AjaxResult.success(caseDetailVO);
|
|
61
|
71
|
}
|
|
62
|
|
-
|
|
63
|
72
|
return null;
|
|
64
|
73
|
}
|
|
65
|
74
|
|
|
66
|
75
|
@Override
|
|
67
|
|
- public AjaxResult uploadEvidence(MultipartFile file , Integer annexType, Long id) {
|
|
|
76
|
+ public AjaxResult uploadEvidence(MultipartFile file, Integer annexType, Long id, String userName, Long userId) {
|
|
|
77
|
+
|
|
68
|
78
|
if (file.isEmpty()) {
|
|
69
|
79
|
return AjaxResult.error("请选择要上传的文件");
|
|
70
|
80
|
}
|
|
71
|
81
|
try {
|
|
72
|
|
- String filePath = RuoYiConfig.getUploadPath();
|
|
73
|
|
- // 获取文件原始名称
|
|
74
|
|
- String fileName = file.getOriginalFilename();
|
|
75
|
|
- String fileSavePath = filePath + "/" + fileName;
|
|
76
|
|
- // 上传并返回新文件名称
|
|
77
|
|
- String fileNewName = FileUploadUtils.upload(filePath,file);
|
|
|
82
|
+ String filePath = RuoYiConfig.getUploadPath();
|
|
|
83
|
+ // 上传
|
|
|
84
|
+ String fileName = FileUploadUtils.upload(filePath, file);
|
|
78
|
85
|
CaseAttach caseAttach = CaseAttach.builder().caseAppliId(id)
|
|
79
|
|
- .annexName(fileNewName)
|
|
80
|
|
- .annexPath(fileSavePath)
|
|
|
86
|
+ .annexName(fileName)
|
|
|
87
|
+ .annexPath(filePath)
|
|
81
|
88
|
.annexType(annexType)
|
|
|
89
|
+ .userId(userId)
|
|
|
90
|
+ .userName(userName)
|
|
82
|
91
|
.build();
|
|
83
|
92
|
int count = caseAttachMapper.save(caseAttach);
|
|
84
|
|
- if (count>0){
|
|
|
93
|
+ if (count > 0) {
|
|
85
|
94
|
//修改案件状态
|
|
86
|
95
|
CaseApplication caseApplication = new CaseApplication();
|
|
87
|
96
|
caseApplication.setId(id);
|
|
|
@@ -104,21 +113,31 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService {
|
|
104
|
113
|
@Override
|
|
105
|
114
|
public List<CaseEvidenceVO> getCaseListAll(String identityNum) {
|
|
106
|
115
|
List<Integer> caseStatusList = Arrays.asList(3, 4, 5, 9);
|
|
107
|
|
- return getCaseEvidenceVOList(identityNum,caseStatusList,null);
|
|
|
116
|
+ return getCaseEvidenceVOList(identityNum, caseStatusList, null);
|
|
|
117
|
+ }
|
|
|
118
|
+
|
|
|
119
|
+ @Override
|
|
|
120
|
+ public AjaxResult evidenceConfirmation(CaseApplication caseApplication) {
|
|
|
121
|
+ caseApplication.setCaseStatus(CaseApplicationConstants.PENDING_APPOINT_ARBOTRATAR);
|
|
|
122
|
+ int i = caseApplicationMapper.submitCaseApplication(caseApplication);
|
|
|
123
|
+ if (i>0){
|
|
|
124
|
+ return AjaxResult.success("证据确认成功");
|
|
|
125
|
+ }
|
|
|
126
|
+ return AjaxResult.error("暂无需要确认的证据");
|
|
108
|
127
|
}
|
|
109
|
128
|
|
|
110
|
|
- private List<CaseEvidenceVO> getCaseEvidenceVOList(String identityNum ,List<Integer> caseStatusList, Integer identityType){
|
|
111
|
|
- List<CaseEvidenceVO> caseListByRespondent = caseEvidenceMapper.getCaseListByRespondent(identityNum, caseStatusList,identityType);
|
|
112
|
|
- if (caseListByRespondent!= null && caseListByRespondent.size()>0){
|
|
|
129
|
+ private List<CaseEvidenceVO> getCaseEvidenceVOList(String identityNum, List<Integer> caseStatusList, Integer identityType) {
|
|
|
130
|
+ List<CaseEvidenceVO> caseListByRespondent = caseEvidenceMapper.getCaseListByRespondent(identityNum, caseStatusList, identityType);
|
|
|
131
|
+ if (caseListByRespondent != null && caseListByRespondent.size() > 0) {
|
|
113
|
132
|
for (CaseEvidenceVO caseEvidenceVO : caseListByRespondent) {
|
|
114
|
133
|
//根据案件id查询姓名
|
|
115
|
134
|
CaseAffiliate caseAffiliate = new CaseAffiliate();
|
|
116
|
135
|
caseAffiliate.setCaseAppliId(caseEvidenceVO.getId());
|
|
117
|
136
|
List<CaseAffiliate> caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate);
|
|
118
|
137
|
for (CaseAffiliate affiliate : caseAffiliates) {
|
|
119
|
|
- if (affiliate.getIdentityType() == 1){ //申请人
|
|
|
138
|
+ if (affiliate.getIdentityType() == 1) { //申请人
|
|
120
|
139
|
caseEvidenceVO.setApplicantName(affiliate.getName());
|
|
121
|
|
- }else {
|
|
|
140
|
+ } else {
|
|
122
|
141
|
caseEvidenceVO.setRespondentName(affiliate.getName());
|
|
123
|
142
|
}
|
|
124
|
143
|
}
|