Parcourir la source

9.25修复问题改动代码

hejinbo il y a 2 ans
Parent
révision
3be770a718

+ 47
- 39
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java Voir le fichier

@@ -1,6 +1,7 @@
1 1
 package com.ruoyi.wisdomarbitrate.service.impl;
2 2
 
3 3
 import com.deepoove.poi.config.Configure;
4
+import com.ruoyi.common.constant.CaseApplicationConstants;
4 5
 import com.ruoyi.common.core.domain.AjaxResult;
5 6
 import com.ruoyi.common.utils.WordUtil;
6 7
 import com.ruoyi.wisdomarbitrate.domain.*;
@@ -37,7 +38,6 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
37 38
     public AjaxResult createDocument(CaseApplication caseApplication) {
38 39
         try {
39 40
             Map<String, Object> datas = new HashMap<>();
40
-            Adjudication adjudication = new Adjudication();
41 41
             Long id = caseApplication.getId();
42 42
             if (id == null){
43 43
                 return null;
@@ -59,14 +59,12 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
59 59
                     int identityType = affiliate.getIdentityType();
60 60
                     if (identityType == 1) {    //申请人
61 61
                         datas.put("appName", affiliate.getName());
62
-                        datas.put("appSex", null);
63 62
                         datas.put("appIDNo", affiliate.getIdentityNum());
64 63
                         datas.put("appAddress", affiliate.getContactAddress());
65 64
                         datas.put("appAgentName", affiliate.getNameAgent());
66 65
                         datas.put("appAgentIDNo",affiliate.getIdentityNumAgent());
67 66
                     }else if (identityType == 2){  //被申请人
68 67
                         datas.put("resName", affiliate.getName());
69
-                        datas.put("resSex", null);
70 68
                         datas.put("resIDNo", affiliate.getIdentityNum());
71 69
                         datas.put("resAddress", affiliate.getContactAddress());
72 70
                         datas.put("resAgentName", affiliate.getNameAgent());
@@ -77,35 +75,38 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
77 75
             String arbitratorName = caseApplication1.getArbitratorName();
78 76
             datas.put("caseName",caseApplication1.getCaseName());
79 77
             datas.put("arbitratorName",arbitratorName);
80
-            LocalDate localDate = caseApplication1.getHearDate()
81
-                    .toInstant()
82
-                    .atZone(ZoneId.systemDefault())
83
-                    .toLocalDate();
84
-            datas.put("hearYear",  localDate.getYear());
85
-            datas.put("hearMonths",  localDate.getMonthValue());
86
-            datas.put("hearDay",  localDate.getDayOfMonth());
87
-            datas.put("appArbitrationClaims", null);
88
-            datas.put("appEvidenceName", null);
89
-            datas.put("appProveFacts", null);
90
-            datas.put("resDefenseContentToApp", null);
91
-            datas.put("resArbitrationClaims", null);
92
-            datas.put("resEvidenceName", null);
93
-            datas.put("resProveFacts", null);
94
-            datas.put("appDefenseContentToRes", null);
95
-            datas.put("evidenDetermi", arbitrateRecord1.getEvidenDetermi());
96
-            datas.put("factDetermi", arbitrateRecord1.getFactDetermi());
97
-            datas.put("caseSketch", arbitrateRecord1.getCaseSketch());
98
-            datas.put("arbitrateThink", arbitrateRecord1.getArbitrateThink());
99
-            datas.put("legalProvisions", null);
100
-            datas.put("rulingFollows", arbitrateRecord1.getRulingFollows());
101
-            datas.put("umpire", null);
102
-            if (arbitratorName.contains(",")){
78
+            Date hearDate = caseApplication1.getHearDate();
79
+            if (hearDate != null) {
80
+                LocalDate localDate = hearDate.toInstant()
81
+                        .atZone(ZoneId.systemDefault())
82
+                        .toLocalDate();
83
+                datas.put("hearYear",  localDate.getYear());
84
+                datas.put("hearMonths",  localDate.getMonthValue());
85
+                datas.put("hearDay",  localDate.getDayOfMonth());
86
+            }else {
87
+                datas.put("hearYear",  null);
88
+                datas.put("hearMonths",  null);
89
+                datas.put("hearDay",  null);
90
+            }
91
+            datas.put("appArbitrationClaims",  caseApplication1.getArbitratClaims());
92
+            if (arbitrateRecord1!=null){
93
+                datas.put("evidenDetermi", arbitrateRecord1.getEvidenDetermi());
94
+                datas.put("factDetermi", arbitrateRecord1.getFactDetermi());
95
+                datas.put("caseSketch", arbitrateRecord1.getCaseSketch());
96
+                datas.put("arbitrateThink", arbitrateRecord1.getArbitrateThink());
97
+                datas.put("rulingFollows", arbitrateRecord1.getRulingFollows());
98
+            }
99
+            datas.put("legalProvisions", "仲裁法");
100
+            if (arbitratorName==null){
101
+                datas.put("arbitratorName1", null);
102
+                datas.put("arbitratorName2", null);
103
+            }else if (arbitratorName.contains(",")){
103 104
                 String[] nameArray = arbitratorName.split(",");
104 105
                 String firstName = nameArray[0];
105 106
                 String secondName = nameArray[1];
106 107
                 datas.put("arbitratorName1", firstName);
107 108
                 datas.put("arbitratorName2", secondName);
108
-            }else {
109
+            } else {
109 110
                 String secondName = "";
110 111
                 datas.put("arbitratorName1", arbitratorName);
111 112
                 datas.put("arbitratorName2", secondName);
@@ -114,19 +115,24 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
114 115
             datas.put("year", now.getYear());
115 116
             datas.put("months", now.getMonthValue());
116 117
             datas.put("day", now.getDayOfMonth());
117
-            datas.put("clerk", null);
118 118
             String modalFilePath = "/data/arbitrate-document/template/仲裁裁决书模板.docx";
119
-
120
-            String currentDateStr = now.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
121
-            String saveFolderPath = "/data/arbitrate-document/formal/" + currentDateStr;
119
+            //String modalFilePath = "D:/develop/仲裁裁决书模板 (2).docx";
120
+            String saveFolderPath = "/data/arbitrate-document/formal/" + now.getYear() + "/" + now.getMonthValue() + "/" + now.getDayOfMonth();
121
+            //String saveFolderPath = "D:/data/" + now.getYear() + "/" + now.getMonthValue() + "/" + now.getDayOfMonth();
122
+            String fileName = UUID.randomUUID().toString().replace("-", "") + ".docx";
123
+            String resultFilePath = saveFolderPath + "/" + fileName;
122 124
             // 创建日期目录
123 125
             File saveFolder = new File(saveFolderPath);
124 126
             if (!saveFolder.exists()) {
125 127
                 saveFolder.mkdirs();
126 128
             }
127
-            String fileName = UUID.randomUUID().toString().replace("-", "") + ".docx";
128
-            String resultFilePath = saveFolderPath+ fileName;
129
-            String docFilePath = WordUtil.getDocFilePath(datas, modalFilePath, resultFilePath);
129
+            Path sourcePath = new File(modalFilePath).toPath();
130
+            Path destinationPath = new File(resultFilePath).toPath();
131
+            Files.copy(sourcePath, destinationPath, StandardCopyOption.REPLACE_EXISTING);
132
+            String docFilePath = WordUtil.getDocFilePath(datas,modalFilePath,resultFilePath);
133
+            //修改案件状态
134
+            caseApplication1.setCaseStatus(CaseApplicationConstants.VERPRIF_ARBITRATION);
135
+            caseApplicationMapper.submitCaseApplication(caseApplication1);
130 136
             //将裁决书保存到附件表里
131 137
             CaseAttach caseAttach = CaseAttach.builder()
132 138
                     .caseAppliId(id)
@@ -136,12 +142,14 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
136 142
                     .build();
137 143
             int i = caseAttachMapper.save(caseAttach);
138 144
             if (i>0){
139
-                Integer annexId = caseAttach.getAnnexId();
140
-                //将附件id保存到仲裁记录表里面
141
-                arbitrateRecord1.setAnnexId(annexId);
142
-                arbitrateRecordMapper.updataArbitrateRecord(arbitrateRecord1);
145
+                if (arbitrateRecord1!=null){
146
+                    Integer annexId = caseAttach.getAnnexId();
147
+                    //将附件id保存到仲裁记录表里面
148
+                    arbitrateRecord1.setAnnexId(annexId);
149
+                    arbitrateRecordMapper.updataArbitrateRecord(arbitrateRecord1);
150
+                }
143 151
             }
144
-            return AjaxResult.success("裁决书保存路径为" + docFilePath);
152
+            return AjaxResult.success("裁决书已生成");
145 153
         } catch (IOException e) {
146 154
             e.printStackTrace();
147 155
         }

+ 47
- 16
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseArbitrateServiceImpl.java Voir le fichier

@@ -42,12 +42,22 @@ public class CaseArbitrateServiceImpl implements ICaseArbitrateService {
42 42
         if (opinion==0){   //拒绝
43 43
             if (arbitratMethod == 2){
44 44
                 caseApplication1.setArbitratMethod(1);  // 更改仲裁方式
45
+                //修改案件状态为待开庭审理
46
+                caseApplication1.setCaseStatus(CaseApplicationConstants.PENDING_OPENCOURT_HEAR);
45 47
             }else {
46 48
                 caseApplication1.setArbitratMethod(2);
49
+                //修改案件状态为待书面审理
50
+                caseApplication1.setCaseStatus(CaseApplicationConstants.PENDING_WRIITEN_HEAR);
51
+            }
52
+        }else {
53
+            if (arbitratMethod == 2){
54
+                //修改案件状态为待书面审理
55
+                caseApplication1.setCaseStatus(CaseApplicationConstants.PENDING_WRIITEN_HEAR);
56
+            }else {
57
+                //修改案件状态为待开庭审理
58
+                caseApplication1.setCaseStatus(CaseApplicationConstants.PENDING_OPENCOURT_HEAR);
47 59
             }
48 60
         }
49
-        //修改案件状态为待开庭
50
-        caseApplication1.setCaseStatus(CaseApplicationConstants.PENDING_OPENCOURT_HEAR);
51 61
         int i = caseApplicationMapper.submitCaseApplication(caseApplication1);
52 62
         if (i > 0) {
53 63
             String arbitratMethodStr = caseApplication1.getArbitratMethod() == 1 ? "开庭审理" : "书面审理";
@@ -92,21 +102,42 @@ public class CaseArbitrateServiceImpl implements ICaseArbitrateService {
92 102
         if (createBy!=null){
93 103
             arbitrateRecord.setCreateBy(createBy);
94 104
         }
95
-        //提交仲裁结果
96
-        int i =  arbitrateRecordMapper.insertArbitrateRecord(arbitrateRecord);
97
-        if (i>0){
98
-            //案件日志表里添加数据
99
-            CaseLogRecord caseLogRecord = new CaseLogRecord();
100
-            caseLogRecord.setCaseAppliId(caseApplication1.getId());
101
-            caseLogRecord.setCaseNode(caseApplication1.getCaseStatus());
102
-            if (createBy!=null){
103
-                caseLogRecord.setCreateBy(createBy);
105
+        //先判断案件是否已经提交过仲裁结果
106
+        ArbitrateRecord arbitrateRecord1 = arbitrateRecordMapper.selectArbitrateRecord(arbitrateRecord);
107
+        if (arbitrateRecord1!=null){
108
+            int i = arbitrateRecordMapper.updataArbitrateRecord(arbitrateRecord);
109
+            if (i>0){
110
+                //案件日志表里添加数据
111
+                CaseLogRecord caseLogRecord = new CaseLogRecord();
112
+                caseLogRecord.setCaseAppliId(caseApplication1.getId());
113
+                caseLogRecord.setCaseNode(caseApplication1.getCaseStatus());
114
+                if (createBy!=null){
115
+                    caseLogRecord.setCreateBy(createBy);
116
+                }
117
+                caseLogRecordMapper.insertCaseLogRecord(caseLogRecord);
118
+                //修改案件状态
119
+                caseApplication.setCaseStatus(CaseApplicationConstants.GENERATED_ARBITRATION);
120
+                caseApplicationMapper.submitCaseApplication(caseApplication);
121
+                return AjaxResult.success("提交成功");
122
+            }
123
+        }else {
124
+            //提交仲裁结果
125
+            int i =  arbitrateRecordMapper.insertArbitrateRecord(arbitrateRecord);
126
+
127
+            if (i>0){
128
+                //案件日志表里添加数据
129
+                CaseLogRecord caseLogRecord = new CaseLogRecord();
130
+                caseLogRecord.setCaseAppliId(caseApplication1.getId());
131
+                caseLogRecord.setCaseNode(caseApplication1.getCaseStatus());
132
+                if (createBy!=null){
133
+                    caseLogRecord.setCreateBy(createBy);
134
+                }
135
+                caseLogRecordMapper.insertCaseLogRecord(caseLogRecord);
136
+                //修改案件状态
137
+                caseApplication.setCaseStatus(CaseApplicationConstants.GENERATED_ARBITRATION);
138
+                caseApplicationMapper.submitCaseApplication(caseApplication);
139
+                return AjaxResult.success("提交成功");
104 140
             }
105
-            caseLogRecordMapper.insertCaseLogRecord(caseLogRecord);
106
-            //修改案件状态
107
-            caseApplication.setCaseStatus(CaseApplicationConstants.GENERATED_ARBITRATION);
108
-            caseApplicationMapper.submitCaseApplication(caseApplication);
109
-            return AjaxResult.success("提交成功");
110 141
         }
111 142
         return AjaxResult.error("暂无需要提交仲裁结果的案件");
112 143
     }

+ 1
- 1
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CasePaymentServiceImpl.java Voir le fichier

@@ -85,7 +85,7 @@ public class CasePaymentServiceImpl implements ICasePaymentService {
85 85
         caseApplication1.setCaseStatus(CaseApplicationConstants.PENDING_PAYMENT_CONFIRM);
86 86
         //修改案件状态
87 87
         caseApplicationMapper.submitCaseApplication(caseApplication1);
88
-        return AjaxResult.success();
88
+        return AjaxResult.success("支付成功");
89 89
     }
90 90
 
91 91
     @Override