|
|
@@ -553,6 +553,265 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
|
|
553
|
553
|
}
|
|
554
|
554
|
return AjaxResult.success(archivesDetailVO);
|
|
555
|
555
|
}
|
|
|
556
|
+
|
|
|
557
|
+ @Override
|
|
|
558
|
+ @Transactional
|
|
|
559
|
+ public AjaxResult regenerationDocument(CaseApplication caseApplication) {
|
|
|
560
|
+ try {
|
|
|
561
|
+ Map<String, Object> datas = new HashMap<>();
|
|
|
562
|
+ Long id = caseApplication.getId();
|
|
|
563
|
+ if (id == null) {
|
|
|
564
|
+ return null;
|
|
|
565
|
+ }
|
|
|
566
|
+ //获取案件详细信息
|
|
|
567
|
+ CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication);
|
|
|
568
|
+ //生成编码
|
|
|
569
|
+ String equipmentNo = getNewEquipmentNo();
|
|
|
570
|
+ datas.put("num",equipmentNo);
|
|
|
571
|
+ //获取仲裁记录相关信息
|
|
|
572
|
+ ArbitrateRecord arbitrateRecord1 = caseApplication.getArbitrateRecord();
|
|
|
573
|
+
|
|
|
574
|
+ //获取案件关联人信息
|
|
|
575
|
+ CaseAffiliate caseAffiliate = new CaseAffiliate();
|
|
|
576
|
+ caseAffiliate.setCaseAppliId(id);
|
|
|
577
|
+ List<CaseAffiliate> caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate);
|
|
|
578
|
+ List<String> nameAgentList = new ArrayList<>();
|
|
|
579
|
+ if (caseAffiliates != null && caseAffiliates.size() > 0) {
|
|
|
580
|
+ for (CaseAffiliate affiliate : caseAffiliates) {
|
|
|
581
|
+ //获取身份类型
|
|
|
582
|
+ int identityType = affiliate.getIdentityType();
|
|
|
583
|
+ if (identityType == 1) { //申请人
|
|
|
584
|
+ datas.put("appName", affiliate.getName());
|
|
|
585
|
+ datas.put("appAddress", affiliate.getResidenAffili());
|
|
|
586
|
+ datas.put("appContactAddress", affiliate.getContactAddress());
|
|
|
587
|
+ datas.put("appLegalPerson", affiliate.getCompLegalPerson());
|
|
|
588
|
+ datas.put("appLegalPersonTitle", affiliate.getCompLegalperPost());
|
|
|
589
|
+ datas.put("appAgentName", affiliate.getNameAgent());
|
|
|
590
|
+ datas.put("appAgentTitle", affiliate.getAppliAgentTitle());
|
|
|
591
|
+ nameAgentList.add(affiliate.getNameAgent());
|
|
|
592
|
+ } else if (identityType == 2) { //被申请人
|
|
|
593
|
+ datas.put("resName", affiliate.getName());
|
|
|
594
|
+ datas.put("resAddress", affiliate.getResidenAffili());
|
|
|
595
|
+ datas.put("resSex", affiliate.getResponSex());
|
|
|
596
|
+ Date responBirth = affiliate.getResponBirth();
|
|
|
597
|
+ if(responBirth!=null){
|
|
|
598
|
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
599
|
+ String responBirthStr = sdf.format(responBirth);
|
|
|
600
|
+ datas.put("resDateOfBirth",responBirthStr);
|
|
|
601
|
+ }
|
|
|
602
|
+ datas.put("resContactAddress", affiliate.getContactAddress());
|
|
|
603
|
+ nameAgentList.add(affiliate.getNameAgent());
|
|
|
604
|
+ }
|
|
|
605
|
+ }
|
|
|
606
|
+ }
|
|
|
607
|
+ Date createTime = caseApplication1.getCreateTime();
|
|
|
608
|
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
609
|
+ // 将日期格式化为字符串
|
|
|
610
|
+ String createTimeStr = sdf.format(createTime);
|
|
|
611
|
+ datas.put("submissionDate", createTimeStr);
|
|
|
612
|
+ Date registerDate = caseApplication1.getRegisterDate();
|
|
|
613
|
+ String registerDateStr = sdf.format(registerDate);
|
|
|
614
|
+ datas.put("acceptDate",registerDateStr);
|
|
|
615
|
+ //反请求
|
|
|
616
|
+ Integer adjudicaCounter = caseApplication1.getAdjudicaCounter();
|
|
|
617
|
+ String counterclaim = "在《2022年版仲裁规则》第十八条第(一)项规定的期限内,被申请人向秘书处提交了" +
|
|
|
618
|
+ "《仲裁反请求申请书》及证据材料。仲裁委依据《2022年版仲裁规则》第十八条的规定受理了该仲裁反请求案申请。" +
|
|
|
619
|
+ "仲裁反请求案件受理后,秘书处向被申请人发送了仲裁反请求通知书及附件,向申请人发送了仲裁反请求通知书及附件、仲裁反请求申请书及附件。";
|
|
|
620
|
+ if (adjudicaCounter == null){
|
|
|
621
|
+ datas.put("counterclaim", null);
|
|
|
622
|
+ }else if (adjudicaCounter == 1){
|
|
|
623
|
+ datas.put("counterclaim", counterclaim);
|
|
|
624
|
+ } else {
|
|
|
625
|
+ datas.put("counterclaim", null);
|
|
|
626
|
+ }
|
|
|
627
|
+ //财产保全
|
|
|
628
|
+ Integer properPreser = caseApplication1.getProperPreser();
|
|
|
629
|
+ String preservation = "本案受理后,申请人向仲裁委提交了财产保全申请,仲裁委根据《中华人民共和国仲裁法》" +
|
|
|
630
|
+ "第二十八条之规定,将该申请提交至XXX市XXX区法院。";
|
|
|
631
|
+ if (properPreser == null) {
|
|
|
632
|
+ datas.put("preservation", null);
|
|
|
633
|
+ } else if(properPreser == 1) {
|
|
|
634
|
+ datas.put("preservation", preservation);
|
|
|
635
|
+ } else {
|
|
|
636
|
+ datas.put("preservation", null);
|
|
|
637
|
+ }
|
|
|
638
|
+ //管辖权异议
|
|
|
639
|
+ Integer objectiJuris = caseApplication1.getObjectiJuris();
|
|
|
640
|
+ String jurisdictionalObjection = "本案受理后,被申请人向仲裁委提交了《XX管辖异议申请书》,认为XXXXXX" +
|
|
|
641
|
+ ",仲裁委经审理,当庭驳回了被申请人的管辖异议申请,并告知被申请人具体的事实和理由将在裁决书中一并列明。";
|
|
|
642
|
+ if (objectiJuris == null){
|
|
|
643
|
+ datas.put("jurisdictionalObjection", null);
|
|
|
644
|
+ }
|
|
|
645
|
+ else if (objectiJuris == 1) {
|
|
|
646
|
+ datas.put("jurisdictionalObjection", jurisdictionalObjection);
|
|
|
647
|
+ } else {
|
|
|
648
|
+ datas.put("jurisdictionalObjection", null);
|
|
|
649
|
+ }
|
|
|
650
|
+ String arbitratorName = caseApplication1.getArbitratorName();
|
|
|
651
|
+ datas.put("arbitratorName", arbitratorName);
|
|
|
652
|
+ Integer arbitratMethod = caseApplication1.getArbitratMethod();
|
|
|
653
|
+ Date hearDate = caseApplication1.getHearDate();
|
|
|
654
|
+ String hearDateStr = "";
|
|
|
655
|
+ if(hearDate!=null){
|
|
|
656
|
+ hearDateStr = sdf.format(hearDate);
|
|
|
657
|
+ }
|
|
|
658
|
+ //线上开庭时
|
|
|
659
|
+ if (arbitratMethod == 1) {
|
|
|
660
|
+ String onLine1 = "仲裁庭审阅了申请人提交的仲裁申请书、证据材料后,于";
|
|
|
661
|
+ String onLine2 = "通过仲裁委智慧仲裁平台开庭审理了本案。";
|
|
|
662
|
+ datas.put("onLine1", onLine1);
|
|
|
663
|
+ datas.put("hearDate", hearDateStr);
|
|
|
664
|
+ datas.put("onLine2", onLine2);
|
|
|
665
|
+ } else {
|
|
|
666
|
+ //书面仲裁时
|
|
|
667
|
+ String written1 = "仲裁庭审阅了申请人提交的仲裁申请书、证据材料后,于";
|
|
|
668
|
+ String written2 = "在仲裁委所在地开庭审理了本案。";
|
|
|
669
|
+ datas.put("written1", written1);
|
|
|
670
|
+ datas.put("hearDate1", hearDateStr);
|
|
|
671
|
+ datas.put("written2", written2);
|
|
|
672
|
+ }
|
|
|
673
|
+ Integer isAbsence = caseApplication1.getIsAbsence();
|
|
|
674
|
+ if (isAbsence==null){
|
|
|
675
|
+ datas.put("absent1", null);
|
|
|
676
|
+ datas.put("absent2", null);
|
|
|
677
|
+ datas.put("absent3", null);
|
|
|
678
|
+ datas.put("absent4", null);
|
|
|
679
|
+ datas.put("absent5", null);
|
|
|
680
|
+ datas.put("attend1", null);
|
|
|
681
|
+ datas.put("attend2", null);
|
|
|
682
|
+ datas.put("attend3", null);
|
|
|
683
|
+ datas.put("attend4", null);
|
|
|
684
|
+ datas.put("attend5", null);
|
|
|
685
|
+ datas.put("attend6", null);
|
|
|
686
|
+ datas.put("attend7", null);
|
|
|
687
|
+ datas.put("appAgentName1", null);
|
|
|
688
|
+ datas.put("appAgentName2", null);
|
|
|
689
|
+ datas.put("resAgentName", null);
|
|
|
690
|
+ }
|
|
|
691
|
+ else if (isAbsence == 1) {
|
|
|
692
|
+ //缺席审理
|
|
|
693
|
+ String absent1 = "申请人的特别授权委托代理人";
|
|
|
694
|
+ String absent2 = "出席了庭审。被申请人经依法送达开庭通知,无正当理由未出席庭审,故仲裁庭依据" +
|
|
|
695
|
+ "《2022年版仲裁规则》第四十条第(二)项的规定,对本案进行了缺席审理。";
|
|
|
696
|
+ String absent3 = "庭审中,申请人陈述了仲裁请求事项及事实与理由,出示了证据材料并进行了说明," +
|
|
|
697
|
+ "发表了意见,回答了仲裁庭的提问,并作了最后陈述。因被申请人缺席庭审,故仲裁庭无法组织调解。";
|
|
|
698
|
+ String absent4 = "(二/三)当事人提供的证据材料\n" +
|
|
|
699
|
+ "申请人为证明其主张的事实和理由,向仲裁庭提交了如下证据材料:";
|
|
|
700
|
+ String absent5 = "综上,仲裁庭依据《上海仲裁委员会仲裁规则》(2022年7月1日起施行的版本)" +
|
|
|
701
|
+ "第四十条第(二)项、第五十一条的规定,缺席裁决如下:";
|
|
|
702
|
+ datas.put("absent1", absent1);
|
|
|
703
|
+ datas.put("absent2", absent2);
|
|
|
704
|
+ datas.put("absent3", absent3);
|
|
|
705
|
+ datas.put("absent4", absent4);
|
|
|
706
|
+ datas.put("absent5", absent5);
|
|
|
707
|
+ datas.put("appAgentName1", nameAgentList.get(0));
|
|
|
708
|
+ } else {
|
|
|
709
|
+ //出席审理
|
|
|
710
|
+ String attend1 = "申请人的特别授权委托代理人";
|
|
|
711
|
+ String attend2 = "和被申请人本人/的特别授权委托代理人";
|
|
|
712
|
+ String attend3 = "出席了庭审。";
|
|
|
713
|
+ String attend4 = "庭审中,申请人陈述了仲裁请求事项及所依据的事实与理由,被申请人进行了答辩;" +
|
|
|
714
|
+ "双方当事人均出示了证据材料并对对方的证据材料进行了质证;申请人出示了证据材料," +
|
|
|
715
|
+ "被申请人对对方的证据材料进行了质证;双方当事人均回答了仲裁庭的提问,进行了辩论," +
|
|
|
716
|
+ "并分别作了最后陈述。双方当事人在仲裁庭的主持下进行了调解,但未能达成调解协议。";
|
|
|
717
|
+ String attend5 = "(二)被申请人的答辩意见";
|
|
|
718
|
+ String attend6 = "(二/三)当事人提供的证据材料及对方的质证意见\n" +
|
|
|
719
|
+ "申请人为证明其主张的事实和理由,向仲裁庭提交了如下证据材料:";
|
|
|
720
|
+ String attend7 = "被申请人对上述材料的质证意见为:";
|
|
|
721
|
+ datas.put("attend1", attend1);
|
|
|
722
|
+ datas.put("attend2", attend2);
|
|
|
723
|
+ datas.put("attend3", attend3);
|
|
|
724
|
+ datas.put("attend4", attend4);
|
|
|
725
|
+ datas.put("attend5", attend5);
|
|
|
726
|
+ datas.put("attend6", attend6);
|
|
|
727
|
+ datas.put("attend7", attend7);
|
|
|
728
|
+ datas.put("responCrossOpin", caseApplication1.getResponCrossOpin());
|
|
|
729
|
+ datas.put("appAgentName2", nameAgentList.get(0));
|
|
|
730
|
+ datas.put("resAgentName", nameAgentList.get(1));
|
|
|
731
|
+ if (arbitratMethod == 1) {
|
|
|
732
|
+ //被申出席+开庭
|
|
|
733
|
+ String attend8 = "综上,仲裁庭依据《上海仲裁委员会仲裁规则》(2022年7月1日起施行的版本)" +
|
|
|
734
|
+ "第五十一条的规定,裁决如下:";
|
|
|
735
|
+ datas.put("attend8", attend8);
|
|
|
736
|
+ } else {
|
|
|
737
|
+ //被申出席+书面
|
|
|
738
|
+ String attend9 = "综上,仲裁庭依据《上海仲裁委员会仲裁规则》(2022年7月1日起施行的版本)" +
|
|
|
739
|
+ "第五十一条、第五十八条的规定,裁决如下:";
|
|
|
740
|
+ datas.put("attend9", attend9);
|
|
|
741
|
+ }
|
|
|
742
|
+ }
|
|
|
743
|
+ datas.put("claims", caseApplication1.getArbitratClaims());
|
|
|
744
|
+ datas.put("request", caseApplication1.getRequestRule());
|
|
|
745
|
+ //申请人证据材料
|
|
|
746
|
+ datas.put("appEvidenceMaterial", null);
|
|
|
747
|
+ //被申请人证据材料
|
|
|
748
|
+ datas.put("resEvidenceMaterial", null);
|
|
|
749
|
+ datas.put("applicaCrossOpin", caseApplication1.getApplicaCrossOpin());
|
|
|
750
|
+ if (arbitrateRecord1 != null) {
|
|
|
751
|
+ datas.put("factDetermi", arbitrateRecord1.getFactDetermi());
|
|
|
752
|
+ datas.put("arbitrateThink", arbitrateRecord1.getArbitrateThink());
|
|
|
753
|
+ datas.put("rulingFollows", arbitrateRecord1.getRulingFollows());
|
|
|
754
|
+ }
|
|
|
755
|
+ LocalDate now = LocalDate.now();
|
|
|
756
|
+ String year = Integer.toString(now.getYear());
|
|
|
757
|
+ datas.put("year", year);
|
|
|
758
|
+ String month = String.format("%02d", now.getMonthValue());
|
|
|
759
|
+ String day = String.format("%02d", now.getDayOfMonth());
|
|
|
760
|
+ String modalFilePath = "/data/arbitrate-document/template/新裁决书模板.docx";
|
|
|
761
|
+// String modalFilePath = "D:/develop/新裁决书模板.docx";
|
|
|
762
|
+ String saveFolderPath = "/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day;
|
|
|
763
|
+// String saveFolderPath = "D:/data/" + year + "/" + month + "/" + day;
|
|
|
764
|
+ String fileName = UUID.randomUUID().toString().replace("-", "") + ".docx";
|
|
|
765
|
+ String saveName = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName;
|
|
|
766
|
+ String resultFilePath = saveFolderPath + "/" + fileName;
|
|
|
767
|
+ // 创建日期目录
|
|
|
768
|
+ File saveFolder = new File(saveFolderPath);
|
|
|
769
|
+ if (!saveFolder.exists()) {
|
|
|
770
|
+ saveFolder.mkdirs();
|
|
|
771
|
+ }
|
|
|
772
|
+ Path sourcePath = new File(modalFilePath).toPath();
|
|
|
773
|
+ Path destinationPath = new File(resultFilePath).toPath();
|
|
|
774
|
+ Files.copy(sourcePath, destinationPath, StandardCopyOption.REPLACE_EXISTING);
|
|
|
775
|
+ String docFilePath = WordUtil.getDocFilePath(datas, modalFilePath, resultFilePath);
|
|
|
776
|
+ String savePath = docFilePath.substring(0, docFilePath.indexOf("/upload/") + 8);
|
|
|
777
|
+
|
|
|
778
|
+
|
|
|
779
|
+ //将裁决书更新到附件表里
|
|
|
780
|
+ CaseAttach caseAttach = CaseAttach.builder()
|
|
|
781
|
+ .caseAppliId(id)
|
|
|
782
|
+ .annexName(saveName)
|
|
|
783
|
+ .annexPath(savePath)
|
|
|
784
|
+ .annexType(3)
|
|
|
785
|
+ .build();
|
|
|
786
|
+ int i = caseAttachMapper.updateCaseAttachBycaseid(caseAttach);
|
|
|
787
|
+
|
|
|
788
|
+
|
|
|
789
|
+ if (i > 0) {
|
|
|
790
|
+ if (arbitrateRecord1 != null) {
|
|
|
791
|
+ //将仲裁记录更新到仲裁记录表
|
|
|
792
|
+ arbitrateRecordMapper.updataArbitrateRecord(arbitrateRecord1);
|
|
|
793
|
+ }
|
|
|
794
|
+ }
|
|
|
795
|
+
|
|
|
796
|
+ String annexName = caseAttach.getAnnexName();
|
|
|
797
|
+ String prefix = "/profile";
|
|
|
798
|
+ int startIndex = annexName.indexOf(prefix);
|
|
|
799
|
+ startIndex += prefix.length();
|
|
|
800
|
+ String annexPath = "/uploadPath" + annexName.substring(startIndex);
|
|
|
801
|
+ caseAttach.setAnnexPath(annexPath);
|
|
|
802
|
+ int startIndexnew = annexName.lastIndexOf("/");
|
|
|
803
|
+ if(startIndexnew!=-1){
|
|
|
804
|
+ String annexNamenew = annexName.substring(startIndexnew+1);
|
|
|
805
|
+ caseAttach.setAnnexName(annexNamenew);
|
|
|
806
|
+ }
|
|
|
807
|
+
|
|
|
808
|
+ return AjaxResult.success(caseAttach);
|
|
|
809
|
+ } catch (IOException e) {
|
|
|
810
|
+ e.printStackTrace();
|
|
|
811
|
+ return AjaxResult.error("重新生成裁决书异常");
|
|
|
812
|
+ }
|
|
|
813
|
+ }
|
|
|
814
|
+
|
|
556
|
815
|
public String getNewEquipmentNo() {
|
|
557
|
816
|
Object awardNum = redisCache.getCacheObject("awardNum");
|
|
558
|
817
|
if (awardNum == null) {
|