From afae2409d65e0c044b8119b3fd8f57e438c18a08 Mon Sep 17 00:00:00 2001
From: fei <791364011@qq.com>
Date: 星期日, 09 十一月 2025 21:29:24 +0800
Subject: [PATCH] 修改了大量的代码块

---
 ruoyi-admin/src/main/java/com/ruoyi/web/controller/archive/ArchiveRecordsController.java |  141 ++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 133 insertions(+), 8 deletions(-)

diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/archive/ArchiveRecordsController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/archive/ArchiveRecordsController.java
index 7741b33..41aa1c2 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/archive/ArchiveRecordsController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/archive/ArchiveRecordsController.java
@@ -1,17 +1,28 @@
 package com.ruoyi.web.controller.archive;
 
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collections;
 import java.util.List;
 import javax.servlet.http.HttpServletResponse;
 
+import cn.hutool.core.bean.BeanUtil;
 import com.ruoyi.common.config.RuoYiConfig;
 import com.ruoyi.common.core.text.Convert;
 import com.ruoyi.common.utils.ServletUtils;
 import com.ruoyi.common.utils.file.FileUploadUtils;
 import com.ruoyi.common.utils.file.FileUtils;
+import com.ruoyi.common.utils.poi.ExcelExp;
+import com.ruoyi.common.utils.poi.ExcelUtilManySheetFour;
+import com.ruoyi.common.utils.poi.ExcelUtilManySheetSecond;
 import com.ruoyi.domain.ArchiveRecords;
-import com.ruoyi.domain.vo.AnalysisResult;
+import com.ruoyi.domain.DocumentMaterials;
+import com.ruoyi.domain.vo.*;
 import com.ruoyi.framework.config.ServerConfig;
 import com.ruoyi.service.IArchiveRecordsService;
+import com.ruoyi.service.IDocumentMaterialsService;
+import com.ruoyi.service.impl.BarcodeService;
+import com.sun.xml.internal.messaging.saaj.util.ByteOutputStream;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
@@ -39,9 +50,11 @@
 {
     @Autowired
     private IArchiveRecordsService archiveRecordsService;
+    @Autowired
+    private BarcodeService barcodeService;
 
-
-
+    @Autowired
+    private IDocumentMaterialsService iDocumentMaterialsService;
     /**
      * 鏌ヨ妗f瀹屾垚鎯呭喌
      */
@@ -95,7 +108,10 @@
     {
         List<ArchiveRecords> list = archiveRecordsService.selectArchiveRecordsList(archiveRecords);
         ExcelUtil<ArchiveRecords> util = new ExcelUtil<ArchiveRecords>(ArchiveRecords.class);
+        //util.showColumn();
         util.exportExcel(response, list, "妗f璁板綍鏁版嵁");
+       // response.getB
+      //  response.
     }
 
     /**
@@ -121,7 +137,17 @@
     @PostMapping
     public AjaxResult add(@RequestBody ArchiveRecords archiveRecords)
     {
-        return toAjax(archiveRecordsService.insertArchiveRecords(archiveRecords));
+        int res = archiveRecordsService.insertArchiveRecords(archiveRecords);
+        System.out.println(res);
+        if(res==0) {
+            System.out.println(res);
+
+            return new AjaxResult(0, "妗f鍙峰凡缁忓瓨鍦ㄤ簡锛�");
+        }
+        else
+            return new AjaxResult(200, "娣诲姞鎴愬姛浜嗭紒");
+
+
     }
 
     /**
@@ -134,7 +160,15 @@
     {
         return toAjax(archiveRecordsService.updateArchiveRecords(archiveRecords));
     }
-
+    @PreAuthorize("@ss.hasPermi('system:records:edit')")
+    @Log(title = "妗f璁板綍", businessType = BusinessType.UPDATE)
+    @PostMapping(value = "/updateSByIds")
+    public AjaxResult updateStatusByIds(@RequestBody Long[] ids)
+    {
+        System.out.println(ids);
+        System.out.println("090sdfsdf");
+        return new AjaxResult(0, archiveRecordsService.updateStatusByIds(ids)+"");
+    }
     /**
      * 鍒犻櫎妗f璁板綍
      */
@@ -156,9 +190,100 @@
 
     @PreAuthorize("@ss.hasPermi('system:records:edit')")
     @Log(title = "淇敼鐘舵��", businessType = BusinessType.IMPORT)
-    @GetMapping(value = "/updateStatusById/{id}")
-    public AjaxResult updateStatusById(@PathVariable("id") String id)
+    @GetMapping(value = "/updateStatusById/{status}/{id}")
+    public AjaxResult updateStatusById(@PathVariable("status") String status,@PathVariable("id") String id)
     {
-        return new AjaxResult(200, archiveRecordsService.updateArchiveById(Long.parseLong(id))+"");
+        return new AjaxResult(200, archiveRecordsService.updateArchiveById(status, Long.parseLong(id))+"");
+    }
+
+
+
+    @PostMapping("/model")
+    public void getExportModel(HttpServletResponse response){
+        List<ArchiveRecordModelExp> list = Collections.singletonList(new ArchiveRecordModelExp());
+        ExcelUtil<ArchiveRecordModelExp> util = new ExcelUtil<>(ArchiveRecordModelExp.class);
+        util.exportExcel(response,list,"妗f淇℃伅瀵煎叆妯℃澘");
+    }
+
+
+    @PostMapping("/modelOther")
+    public void getExportModelOther(HttpServletResponse response){
+        List<ArchiveRecordModelOther> list = Collections.singletonList(new ArchiveRecordModelOther());
+        ExcelUtil<ArchiveRecordModelOther> util = new ExcelUtil<>(ArchiveRecordModelOther.class);
+        util.exportExcel(response,list,"妗f淇℃伅瀵煎叆妯℃澘");
+    }
+
+    @PreAuthorize("@ss.hasPermi('system:records:list')")
+    @Log(title = "鏄惁鍏佽鎻愪氦", businessType = BusinessType.IMPORT)
+    @GetMapping(value = "/whether/{recordId}")
+    public AjaxResult whether(@PathVariable("recordId") Long recordId)
+    {
+        return AjaxResult.success( archiveRecordsService.whether(recordId));
+    }
+
+    @PostMapping(value={"/recordFileList/{includeQrCode}/{selectedSignatures}/{selectedAnnotations}", "/recordFileList/{includeQrCode}", "/recordFileList/{includeQrCode}/{selectedSignatures}","/recordFileList/{includeQrCode}/{selectedAnnotations}"})
+    //瀵煎嚭excle
+    public void getSpecialArchiveInfo(HttpServletResponse response, @RequestParam("recordId")Long recordId, @PathVariable(name = "includeQrCode",required = false) boolean includeQrCode, @PathVariable(name = "selectedSignatures",required = false) int[] selectedSignatures, @PathVariable(name = "selectedAnnotations",required = false) int[] selectedAnnotations) throws IOException {
+        System.out.println("uuuuuuuuuuuuuuuuuuusssss88888888888888");
+//        System.out.println(selectedSignatures[0]);
+//        System.out.println(selectedAnnotations[0]);
+        System.out.println(includeQrCode);
+        //浜岀淮鐮佹槸鍚︾敓鎴�
+        String code = "2024050000029250";
+        byte [] bt = barcodeService.generateBarcodeImage(code);
+        //绛惧悕閫夋嫨
+        String [] sig = {"涓氬姟绉戝绉讳氦浜�:","瀹℃壒绉戠Щ浜や汉:","妗f鏁寸悊鍏徃:"};
+        List<String> arrLis = new ArrayList<>();
+        if(selectedSignatures!=null){
+            for(int si: selectedSignatures)
+            {
+                arrLis.add(sig[si-1]);
+            }
+        }
+        //娉ㄩ�夋嫨
+        String [] ann = { "鏈竻鍗曠敱妗f褰㈡垚閮ㄩ棬瀹屾垚",
+                "鏂囦欢绫诲瀷蹇呴』褰曞叆锛屽寘鎷粨璁烘潗鏂欍�佽繃绋嬫潗鏂欍�佺敵璇锋潗鏂欙紝鍏朵粬鏉愭枡",
+                "鍏紑灞炴�у繀椤诲綍鍏ワ紝涓诲姩鍏紑銆佷緷鐢宠鍏紑銆佸厤浜堝叕寮�",
+                "淇濈鏈熼檺:30骞存垨姘镐箙",
+                "椤靛彿鎸夌収姝e紡褰曞叆椤电爜涓哄噯"};
+        List<String> arrAn = new ArrayList<>();
+        if(selectedAnnotations!=null) {
+            for (int ar : selectedAnnotations) {
+                arrAn.add(ann[ar - 1]);
+            }
+        }
+        List<DocumentMaterialsFileList> arsi = new ArrayList<>();
+//        DocumentMaterials documentMaterials = new DocumentMaterials();
+//        documentMaterials.setRecordId(recordId);
+        List<DocumentMaterialsFileList> lst = iDocumentMaterialsService.selectDocumentMaterialsFileList(recordId);
+
+
+
+        // 澶嶅埗灞炴�у埌SmallObject鍒楄〃
+        for (DocumentMaterialsFileList bigObject : lst) {
+            DocumentMaterialsFileList smallObject = new DocumentMaterialsFileList();
+            BeanUtil.copyProperties(bigObject, smallObject); // 澶嶅埗灞炴��
+            arsi.add(smallObject);
+        }
+
+      //  arsi.add(aIV);
+        ExcelExp e3 = new ExcelExp("鏂囦欢鏉愭枡绉讳氦鐩綍娓呭崟",arsi, DocumentMaterialsFileList.class);
+       // ExcelExp e4 = new ExcelExp("妗堝嵎灏侀潰",  arsi, recordId1, imgr1,sedcode, ArchiveInfoVo.class);
+        List<ExcelExp> mysheet1 = new ArrayList<ExcelExp>();
+        mysheet1.add(e3);
+       // mysheet1.add(e4);
+        //ByteOutputStream bos2 = new ByteOutputStream();
+        ExcelUtilManySheetFour<List<ExcelExp>> util3 = new ExcelUtilManySheetFour<List<ExcelExp>>(mysheet1);
+
+
+        //鎷垮埌caseTitle鍜宨nquiryNumber
+        String inquiryNumber = "";
+        String caseTitle = "";
+        if(!arsi.isEmpty())
+        {
+            inquiryNumber = arsi.get(0).getInquiryNumber();
+            caseTitle = arsi.get(0).getCaseTitle();
+        }
+        util3.exportExcelManySheet(response, mysheet1, includeQrCode,bt, arrLis, arrAn, inquiryNumber, caseTitle);
     }
 }

--
Gitblit v1.9.1