hejinbo 2 лет назад
Родитель
Сommit
106ccce871

+ 27
- 20
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseArbitrateServiceImpl.java Просмотреть файл

@@ -50,6 +50,7 @@ public class CaseArbitrateServiceImpl implements ICaseArbitrateService {
50 50
     private IAdjudicationService adjudicationService;
51 51
     @Autowired
52 52
     private RedisCache redisCache;
53
+
53 54
     @Override
54 55
     @Transactional
55 56
     public AjaxResult examineArbitrateMethod(CaseApplication caseApplication, Integer opinion) {
@@ -185,7 +186,7 @@ public class CaseArbitrateServiceImpl implements ICaseArbitrateService {
185 186
             //开庭审理,需要生成裁决书和庭审笔录
186 187
             Boolean aBoolean = generateTrialTranscripts(arbitrateRecord);
187 188
             Boolean aBoolean1 = generateAward(arbitrateRecord);
188
-            if (aBoolean && aBoolean1){
189
+            if (aBoolean && aBoolean1) {
189 190
                 //修改案件状态
190 191
                 caseApplication1.setCaseStatus(CaseApplicationConstants.VERPRIF_ARBITRATION);
191 192
                 int i = caseApplicationMapper.submitCaseApplication(caseApplication1);
@@ -196,7 +197,7 @@ public class CaseArbitrateServiceImpl implements ICaseArbitrateService {
196 197
         } else if (arbitratMethod == 2) {
197 198
             //书面审理,只生成裁决书
198 199
             Boolean aBoolean = generateAward(arbitrateRecord);
199
-            if (aBoolean){
200
+            if (aBoolean) {
200 201
                 //修改案件状态
201 202
                 caseApplication1.setCaseStatus(CaseApplicationConstants.VERPRIF_ARBITRATION);
202 203
                 int i = caseApplicationMapper.submitCaseApplication(caseApplication1);
@@ -272,10 +273,10 @@ public class CaseArbitrateServiceImpl implements ICaseArbitrateService {
272 273
             datas.put("year", year);
273 274
             datas.put("months", month);
274 275
             datas.put("day", day);
275
-           // String modalFilePath = "/data/arbitrate-document/template/仲裁裁决书模板.docx";
276
-            String modalFilePath = "D:/develop/仲裁裁决书模板 (2).docx";
277
-           // String saveFolderPath = "/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day;
278
-           String saveFolderPath = "D:/data/" + now.getYear() + "/" + now.getMonthValue() + "/" + now.getDayOfMonth();
276
+            String modalFilePath = "/data/arbitrate-document/template/仲裁裁决书模板.docx";
277
+            //String modalFilePath = "D:/develop/仲裁裁决书模板 (2).docx";
278
+            String saveFolderPath = "/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day;
279
+            //String saveFolderPath = "D:/data/" + now.getYear() + "/" + now.getMonthValue() + "/" + now.getDayOfMonth();
279 280
             String fileName = UUID.randomUUID().toString().replace("-", "") + ".docx";
280 281
             String saveName = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName;
281 282
             String resultFilePath = saveFolderPath + "/" + fileName;
@@ -296,13 +297,14 @@ public class CaseArbitrateServiceImpl implements ICaseArbitrateService {
296 297
                     .annexType(7)
297 298
                     .build();
298 299
             //保存到附件表里,先判断之前有没有,有的话更新,没有的话新增
299
-            Long caseAppliId = id;
300
-            Integer annexType = 7;
301
-            List<CaseAttach> caseAttach1 = caseAttachMapper.getCaseAttachByCaseIdAndType(caseAttach);
302
-            if (caseAttach1 != null ) {
300
+            CaseAttach caseAttach1 = new CaseAttach();
301
+            caseAttach1.setAnnexType(7);
302
+            caseAttach1.setCaseAppliId(id);
303
+            List<CaseAttach> caseAttachList = caseAttachMapper.getCaseAttachByCaseIdAndType(caseAttach1);
304
+            if (caseAttachList != null && caseAttachList.size() > 0) {
303 305
                 //之前已经生成过了,更新
304 306
                 caseAttachMapper.updateCaseAttachBycaseid(caseAttach);
305
-            }else {
307
+            } else {
306 308
                 //之前没生成过,新增
307 309
                 int i = caseAttachMapper.save(caseAttach);
308 310
                 ArbitrateRecord arbitrateRecord1 = arbitrateRecordMapper.selectArbitrateRecord(arbitrateRecord);
@@ -322,11 +324,12 @@ public class CaseArbitrateServiceImpl implements ICaseArbitrateService {
322 324
             return Boolean.FALSE;
323 325
         }
324 326
     }
327
+
325 328
     //生成仲裁文书
326
-    private Boolean generateAward(ArbitrateRecord arbitrateRecord){
329
+    private Boolean generateAward(ArbitrateRecord arbitrateRecord) {
327 330
         try {
328 331
             Map<String, Object> datas = new HashMap<>();
329
-            Long id = arbitrateRecord.getId();
332
+            Long id = arbitrateRecord.getCaseAppliId();
330 333
             if (id == null) {
331 334
                 return null;
332 335
             }
@@ -524,10 +527,10 @@ public class CaseArbitrateServiceImpl implements ICaseArbitrateService {
524 527
             datas.put("year", year);
525 528
             String month = String.format("%02d", now.getMonthValue());
526 529
             String day = String.format("%02d", now.getDayOfMonth());
527
-            //String modalFilePath = "/data/arbitrate-document/template/新裁决书模板.docx";
528
-            String modalFilePath = "D:/develop/新裁决书模板.docx";
529
-            //String saveFolderPath = "/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day;
530
-            String saveFolderPath = "D:/data/" + year + "/" + month + "/" + day;
530
+            String modalFilePath = "/data/arbitrate-document/template/新裁决书模板.docx";
531
+            //String modalFilePath = "D:/develop/新裁决书模板.docx";
532
+            String saveFolderPath = "/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day;
533
+            //String saveFolderPath = "D:/data/" + year + "/" + month + "/" + day;
531 534
             String fileName = UUID.randomUUID().toString().replace("-", "") + ".docx";
532 535
             String saveName = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName;
533 536
             String resultFilePath = saveFolderPath + "/" + fileName;
@@ -554,11 +557,14 @@ public class CaseArbitrateServiceImpl implements ICaseArbitrateService {
554 557
                     .annexType(3)
555 558
                     .build();
556 559
             //保存到附件表里,先判断之前有没有,有的话更新,没有的话新增
557
-            List<CaseAttach> caseAttachList = caseAttachMapper.getCaseAttachByCaseIdAndType(caseAttach);
558
-            if (caseAttachList != null ) {
560
+            CaseAttach caseAttach1 = new CaseAttach();
561
+            caseAttach1.setAnnexType(3);
562
+            caseAttach1.setCaseAppliId(id);
563
+            List<CaseAttach> caseAttachList = caseAttachMapper.getCaseAttachByCaseIdAndType(caseAttach1);
564
+            if (caseAttachList != null && caseAttachList.size() > 0) {
559 565
                 //之前已经生成过了,更新
560 566
                 caseAttachMapper.updateCaseAttachBycaseid(caseAttach);
561
-            }else {
567
+            } else {
562 568
                 //之前没生成过,新增
563 569
                 int i = caseAttachMapper.save(caseAttach);
564 570
                 if (i > 0) {
@@ -575,6 +581,7 @@ public class CaseArbitrateServiceImpl implements ICaseArbitrateService {
575 581
             return Boolean.FALSE;
576 582
         }
577 583
     }
584
+
578 585
     public String getNewEquipmentNo() {
579 586
         Object awardNum = redisCache.getCacheObject("awardNum");
580 587
         if (awardNum == null) {