From 74205424049d169a8d3bbabb74b4c8c9adf1ec99 Mon Sep 17 00:00:00 2001
From: zhuo <2089219845@qq.com>
Date: 星期六, 15 二月 2025 16:05:51 +0800
Subject: [PATCH] 设备列表查询接口修改

---
 cnas-server/src/main/java/com/yuanchu/mom/service/impl/DeviceServiceImpl.java | 1119 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 1,094 insertions(+), 25 deletions(-)

diff --git a/cnas-server/src/main/java/com/yuanchu/mom/service/impl/DeviceServiceImpl.java b/cnas-server/src/main/java/com/yuanchu/mom/service/impl/DeviceServiceImpl.java
index 453ff9a..f1723fd 100644
--- a/cnas-server/src/main/java/com/yuanchu/mom/service/impl/DeviceServiceImpl.java
+++ b/cnas-server/src/main/java/com/yuanchu/mom/service/impl/DeviceServiceImpl.java
@@ -1,33 +1,48 @@
 package com.yuanchu.mom.service.impl;
 
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson2.JSON;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.deepoove.poi.XWPFTemplate;
+import com.deepoove.poi.config.Configure;
 import com.yuanchu.mom.common.GetLook;
 import com.yuanchu.mom.common.PrintChina;
-import com.yuanchu.mom.dto.DeviceDto;
+import com.yuanchu.mom.dto.*;
 import com.yuanchu.mom.exception.ErrorException;
-import com.yuanchu.mom.mapper.DeviceMapper;
-import com.yuanchu.mom.mapper.StructureItemParameterMapper;
-import com.yuanchu.mom.pojo.DataConfig;
-import com.yuanchu.mom.pojo.Device;
-import com.yuanchu.mom.pojo.StructureItemParameter;
+import com.yuanchu.mom.mapper.*;
+import com.yuanchu.mom.pojo.*;
 import com.yuanchu.mom.service.DataConfigService;
 import com.yuanchu.mom.service.DeviceService;
+import com.yuanchu.mom.service.DocumentService;
 import com.yuanchu.mom.utils.DataAcquisition;
+import com.yuanchu.mom.utils.HackLoopTableRenderPolicy;
 import com.yuanchu.mom.utils.QueryWrappers;
 import com.yuanchu.mom.vo.Result;
 import lombok.AllArgsConstructor;
+import org.apache.logging.log4j.util.Strings;
+import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 
 import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.net.URLEncoder;
+import java.text.SimpleDateFormat;
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.stream.Collectors;
 
 /**
  * 璁惧(Device)琛ㄦ湇鍔″疄鐜扮被
@@ -40,18 +55,38 @@
 
     private DeviceMapper deviceMapper;
 
+    private EnumServiceImpl enumService;
+
+    private UserMapper userMapper;
+
     private StructureItemParameterMapper structureItemParameterMapper;
 
     @Autowired
     private DataConfigService dataConfigService;
 
+    private QrShowServiceImpl qrShowService;
+
+    private InsSampleMapper insSampleMapper;
+
+    private DocumentService documentService;
+
+    private DeviceMetricRecordMapper deviceMetricRecordMapper;
+
+    private DeviceMaintenanceMapper deviceMaintenanceMapper;
+
     @Override
-    public Map<String, Object> selectDeviceParameter(Page page, DeviceDto itemParameter) {
+    public List<User> selectUserList() {
+        List<User> users = userMapper.selectList(new LambdaQueryWrapper<User>().like(User::getDepartLimsId, "1"));
+        return users;
+    }
+
+    @Override
+    public Map<String, Object> selectDeviceParameter(Page page, DeviceDto itemParameter,Boolean laboratoryNameIsNull) {
         Map<String, Object> map = new HashMap<>();
         map.put("head", PrintChina.printChina(DeviceDto.class));
         Map<String, Integer> map1 = getLook.selectPowerByMethodAndUserId("selectDeviceParameter");
         if (map1.get("look") == 1) itemParameter.setCreateUser(map1.get("userId"));
-        IPage<DeviceDto> iPage = deviceMapper.selectDeviceParameterPage(page, QueryWrappers.queryWrappers(itemParameter));
+        IPage<DeviceDto> iPage = deviceMapper.selectDeviceParameterPage(page, QueryWrappers.queryWrappers(itemParameter),laboratoryNameIsNull);
         map.put("body", iPage);
         return map;
     }
@@ -66,8 +101,11 @@
         return deviceMapper.deleteById(id);
     }
 
+    @Transactional(rollbackFor = Exception.class)
     @Override
     public int upDeviceParameter(Device itemParameter) {
+        // 鍒犻櫎鏁伴噰闆嗛厤缃暟鎹�
+        dataConfigService.deleteDataConfig();
         return deviceMapper.updateById(itemParameter);
     }
 
@@ -93,17 +131,25 @@
 
     @Override
     public List<Device> selectDeviceByCategory(String inspectionItem, String inspectionItemSubclass) {
-        Integer id;
+        List<Integer> id;
         try {
             if (ObjectUtils.isEmpty(inspectionItemSubclass)) {
-                id = structureItemParameterMapper.selectOne(Wrappers.<StructureItemParameter>lambdaQuery()
+//                id = structureItemParameterMapper.selectOne(Wrappers.<StructureItemParameter>lambdaQuery()
+//                        .eq(StructureItemParameter::getInspectionItem, inspectionItem)
+//                        .last("limit 1").select(StructureItemParameter::getId)).getId();
+                id = structureItemParameterMapper.selectList(Wrappers.<StructureItemParameter>lambdaQuery()
                         .eq(StructureItemParameter::getInspectionItem, inspectionItem)
-                        .last("limit 1").select(StructureItemParameter::getId)).getId();
+                        .select(StructureItemParameter::getId)).stream().map(StructureItemParameter::getId).collect(Collectors.toList());
+
             }else {
-                id = structureItemParameterMapper.selectOne(Wrappers.<StructureItemParameter>lambdaQuery()
+//                id = structureItemParameterMapper.selectOne(Wrappers.<StructureItemParameter>lambdaQuery()
+//                        .eq(StructureItemParameter::getInspectionItem, inspectionItem)
+//                        .eq(StructureItemParameter::getInspectionItemSubclass, inspectionItemSubclass)
+//                        .last("limit 1").select(StructureItemParameter::getId)).getId();
+                id = structureItemParameterMapper.selectList(Wrappers.<StructureItemParameter>lambdaQuery()
                         .eq(StructureItemParameter::getInspectionItem, inspectionItem)
                         .eq(StructureItemParameter::getInspectionItemSubclass, inspectionItemSubclass)
-                        .last("limit 1").select(StructureItemParameter::getId)).getId();
+                        .select(StructureItemParameter::getId)).stream().map(StructureItemParameter::getId).collect(Collectors.toList());
             }
         } catch (Exception e) {
             return null;
@@ -115,9 +161,11 @@
         for (Device device : devices) {
             String[] ids = device.getInsProductIds().split(",");
             for (String i : ids) {
-                if (i.equals(id + "")) {
-                    devices2.add(device);
-                    break;
+                if (ObjectUtils.isNotEmpty(i)) {
+                    if (id.contains(Integer.parseInt(i))) {
+                        devices2.add(device);
+                        break;
+                    }
                 }
             }
         }
@@ -125,19 +173,50 @@
     }
 
     @Override
-    public Device selectDeviceByCode(String code) {
-        return deviceMapper.selectOne(Wrappers.<Device>lambdaQuery().eq(Device::getFactoryNo, code).last("limit 1"));
+    public Device selectDeviceByCode(Integer id) {
+        DeviceDto deviceDto = deviceMapper.selectDeviceByCode(id);
+        List<Integer> ids = new ArrayList<>();
+        if (Strings.isNotEmpty(deviceDto.getAuthorizedPerson())) {
+            if (deviceDto.getAuthorizedPerson().equals("null")) {
+                deviceDto.setAuthorizedPerson("[]");
+            }
+            ids = JSON.parseArray(deviceDto.getAuthorizedPerson(), Integer.class);
+        }
+        String name = "";
+        if (!ids.isEmpty()) {
+            name = userMapper.selectBatchIds(ids).stream().map(User::getName).collect(Collectors.joining(","));
+        }
+        deviceDto.setAuthorizedPersonName(name);
+        //鏌ヨ璁惧鏍″噯淇℃伅
+        DeviceMetricRecord calibrate = qrShowService.getDeviceMetricRecord(id, "calibrate");
+        //deviceDto.setCalibrationDate(qrShowService.formatDate(calibrate.getCalibrationDate(),"yyyy-MM-dd"));
+        deviceDto.setCalibrateNo(calibrate.getCertificateSerialNumber());
+
+        // 鍒颁簡鍋滅敤鏃ユ湡锛岃嚜鍔ㄥ皢鐘舵�佹敼涓哄仠鐢�
+        if (deviceDto.getNextCalibrationDate() != null) {
+            if (LocalDateTime.now().isAfter(deviceDto.getNextCalibrationDate())) {
+                List<Enums> enums = enumService.selectEnumByCategory("璁惧鐘舵��");
+                List<Enums> status = enums.stream().filter(item -> item.getLabel().equals("鍋滅敤")).collect(Collectors.toList());
+                deviceDto.setDeviceStatus(Integer.parseInt(status.get(0).getValue()));
+                deviceMapper.updateById(deviceDto);
+            }
+        }
+        return deviceDto;
     }
 
     @Override
     public Result<?> dataAcquisition(HttpServletRequest request, Integer id, String entrustCode, String sampleCode) {
-        String ipAddress = request.getRemoteAddr();
         // 闃叉鍥炵幆鍦板潃鍙樹负IPv6
-        String ip =  ipAddress.equals("0:0:0:0:0:0:0:1") ? "127.0.0.1" : ipAddress;
+        String ip = DataAcquisition.getIp(request);
         List<Device> device = baseMapper.selectList(Wrappers.<Device>lambdaQuery()
                 .eq(Device::getIp, ip));
+        // 1銆佹楠�
         if(device.size() > 1) {
-            throw new ErrorException("IP锛�" + ip + "閰嶇疆浜嗚澶囧涓澶囷紝鏃犳硶杩涜鏁伴噰锛�");
+            String str = "";
+            for (Device device1 : device) {
+                str += device1.getDeviceName() + "锛�";
+            }
+            throw new ErrorException("IP锛�" + ip + "閰嶇疆浜嗚澶囧涓澶囷細" + str + "锛屾棤娉曡繘琛屾暟閲囷紒");
         }
         if (ObjectUtils.isEmpty(device)) {
             throw new ErrorException("鏈粰璇P锛�" + ip + "閰嶇疆璁惧锛屾棤娉曡繘琛屾暟閲囷紒");
@@ -146,6 +225,7 @@
         if (ObjectUtils.isEmpty(device.get(0).getFileType()) || ObjectUtils.isEmpty(device.get(0).getCollectUrl())) {
             throw new ErrorException("鏈粰璇ワ細" + device.get(0).getDeviceName() + "璁惧閰嶇疆閲囬泦璺緞鎴栨枃浠跺悗缂�锛�");
         }
+        // 2銆佸彇璁惧鍏宠仈鐨勬楠岄」锛屾楠屽瓙椤�
         List<DataConfig> list1 = new ArrayList<>();
         inspectionItemSubclass.forEach(i -> {
              List<DataConfig> list = dataConfigService.list(Wrappers.<DataConfig>lambdaQuery()
@@ -155,11 +235,1000 @@
                 .orderBy(false, false, DataConfig::getId));
             list1.addAll(list);
         });
-        Map<String, String> map = DataAcquisition.dataAcquisitionEntrance(list1, device.get(0), entrustCode, sampleCode, ip);
+        List<DataConfig> collect = list1.stream().distinct().collect(Collectors.toList());
+        // 3銆侀噰闆嗭紝鍙栨暟鎹�
+        Map<String, Object> map = DataAcquisition.dataAcquisitionEntrance(collect, device.get(0), entrustCode, sampleCode, ip);
+        // 4銆侀�犲惊鐜鏁帮紝鍙備笌鍏紡璁$畻
         if (ObjectUtils.isNotEmpty(map)) {
-            String frequency = DataAcquisition.createFrequency(entrustCode, sampleCode);
-            map.put("frequency", frequency);
+            Map<String, Object> frequency = DataAcquisition.createFrequency(entrustCode, sampleCode, map);
+            return Result.success(frequency);
+        } else {
+            return Result.success(null);
         }
-        return Result.success(map);
+    }
+
+    @Override
+    public List<ADto> menu() {
+        //鏌ヨ鎵�鏈夎澶囦俊鎭�
+        List<Device> devices = baseMapper.selectList(null);
+        List<String> name = devices.stream().map(Device::getDeviceName).collect(Collectors.toList());
+
+        //鏌ヨ鎵�鏈夌敤鎴蜂俊鎭�
+        List<User> users = userMapper.selectList(null);
+        List<String> collect = users.stream().map(User::getName).collect(Collectors.toList());
+        String menu="[\n" +
+                "\t{\n" +
+                "\t\tk: 0,\n" +
+                "\t\tv: \"涓汉棣栭〉\",\n" +
+                "\t\ti: \"font icon-shouyefill\",\n" +
+                "\t\tself: true,\n" +
+                "\t\tc: [{\n" +
+                "\t\t\tk: 0,\n" +
+                "\t\t\tv: \"涓汉棣栭〉\",\n" +
+                "\t\t\ti: \"font icon-shouyefill\",\n" +
+                "\t\t\tu: \"index-index\"\n" +
+                "\t\t}]\n" +
+                "\t},\n" +
+                "\t{\n" +
+                "\t\tv: \"涓氬姟绠$悊\",\n" +
+                "\t\ti: \"font icon-kexueyanjiuheshiyankaifa\",\n" +
+                "\t\tp: \"selectInsOrderParameter selectInsOrderPlanList pageInsReport costStatistics selectWarehouse\",\n" +
+                "\t\tc: [\n" +
+                "      {\n" +
+                "        v: \"鍘熸潗鏂欐楠屼笅鍗昞",\n" +
+                "        i: \"font icon-erjidaohang\",\n" +
+                "        u: \"b1-material-inspection-order\",\n" +
+                "        p: \"selectInsOrderParameter\"\n" +
+                "      },\n" +
+                "      {\n" +
+                "\t\t\tv: \"妫�楠屼笅鍗昞",\n" +
+                "\t\t\ti: \"font icon-erjidaohang\",\n" +
+                "\t\t\tu: \"b1-inspection-order\",\n" +
+                "\t\t\tp: \"selectInsOrderParameter\"\n" +
+                "\t\t}, {\n" +
+                "\t\t\tv: \"妫�楠屼换鍔",\n" +
+                "\t\t\ti: \"font icon-erjidaohang\",\n" +
+                "\t\t\tu: \"b1-inspect-order-plan\",\n" +
+                "\t\t\tp: \"selectInsOrderPlanList\"\n" +
+                "\t\t}, {\n" +
+                "\t\t\tv: \"鎶ュ憡缂栧埗\",\n" +
+                "\t\t\ti: \"font icon-erjidaohang\",\n" +
+                "\t\t\tu: \"b1-report-preparation\",\n" +
+                "\t\t\tp: \"pageInsReport\"\n" +
+                "\t\t}, {\n" +
+                "\t\t\tv: \"璐圭敤缁熻\",\n" +
+                "\t\t\ti: \"font icon-erjidaohang\",\n" +
+                "\t\t\tu: \"b1-expenses\",\n" +
+                "\t\t\tp: \"costStatistics\"\n" +
+                "\t\t}, {\n" +
+                "\t\t\tv: \"鏍峰搧绠$悊\",\n" +
+                "\t\t\ti: \"font icon-erjidaohang\",\n" +
+                "\t\t\tu: \"b1-sample\",\n" +
+                "\t\t\tp: \"selectWarehouse\"\n" +
+                "\t\t},{\n" +
+                "\t\t\tv: \"涓嶅悎鏍肩鐞哱",\n" +
+                "\t\t\ti: \"font icon-erjidaohang\",\n" +
+                "\t\t\tu: \"b1-unpass\",\n" +
+                "\t\t\tp: \"\"\n" +
+                "\t\t}\n" +
+                "\t]\n" +
+                "\t},\n" +
+                "\t{\n" +
+                "\t\tv: \"鏍囧噯闆哱",\n" +
+                "\t\ti: \"font icon-biaozhunji\",\n" +
+                "\t\tp: \"selectStandardTreeList selectStandardTemplatePageList\",\n" +
+                "\t\tc: [{\n" +
+                "\t\t\tv: \"鏍囧噯搴揬",\n" +
+                "\t\t\ti: \"font icon-erjidaohang\",\n" +
+                "\t\t\tu: \"b2-standard\",\n" +
+                "\t\t\tp: \"selectStandardTreeList\"\n" +
+                "\t\t}, {\n" +
+                "\t\t\tv: \"鍘熷璁板綍妯℃澘\",\n" +
+                "\t\t\ti: \"font icon-erjidaohang\",\n" +
+                "\t\t\tu: \"b2-standard-template\",\n" +
+                "\t\t\tp: \"selectStandardTemplatePageList\"\n" +
+                "\t\t}]\n" +
+                "\t},\n" +
+                "\t{\n" +
+                "\t\tv: \"缁╂晥绠$悊\",\n" +
+                "\t\ti: \"font icon-jixiaoguanli\",\n" +
+                "\t\tp: \"\",\n" +
+                "\t\tc: [{\n" +
+                "\t\t\tv: \"宸ユ椂绠$悊\",\n" +
+                "\t\t\ti: \"font icon-erjidaohang\",\n" +
+                "\t\t\tu: \"b3-work-time-management\",\n" +
+                "\t\t\tp: \"selectAuxiliaryWorkingHours\"\n" +
+                "\t\t}, {\n" +
+                "\t\t\tv: \"浜哄憳鑰冨嫟\",\n" +
+                "\t\t\ti: \"font icon-erjidaohang\",\n" +
+                "\t\t\tu: \"\",\n" +
+                "\t\t\tp: \"\"\n" +
+                "\t\t}, {\n" +
+                "\t\t\tv: \"浜哄憳鑰冭瘎\",\n" +
+                "\t\t\ti: \"font icon-erjidaohang\",\n" +
+                "\t\t\tu: \"b3-personnel-evaluation\",\n" +
+                "\t\t\tp: \"\"\n" +
+                "\t\t}, {\n" +
+                "\t\t\tv: \"浜哄憳鑰冩牳\",\n" +
+                "\t\t\ti: \"font icon-erjidaohang\",\n" +
+                "\t\t\tu: \"\",\n" +
+                "\t\t\tp: \"\"\n" +
+                "\t\t}, {\n" +
+                "\t\t\tv: \"鎶�鑳界瓑绾",\n" +
+                "\t\t\ti: \"font icon-erjidaohang\",\n" +
+                "\t\t\tu: \"\",\n" +
+                "\t\t\tp: \"\"\n" +
+                "\t\t}, {\n" +
+                "\t\t\tv: \"宸ヨ祫缁撶畻\",\n" +
+                "\t\t\ti: \"font icon-erjidaohang\",\n" +
+                "\t\t\tu: \"\",\n" +
+                "\t\t\tp: \"\"\n" +
+                "\t\t}, {\n" +
+                "\t\t\tv: \"鐝\",\n" +
+                "\t\t\ti: \"font icon-erjidaohang\",\n" +
+                "\t\t\tu: \"b3-classes\",\n" +
+                "\t\t\tp: \"performanceShiftPage performanceShiftPageYear\"\n" +
+                "\t\t}]\n" +
+                "\t},\n" +
+                "\t{\n" +
+                "\t\tv: \"缁熻鍥捐〃\",\n" +
+                "\t\ti: \"font icon-tongjitubiao\",\n" +
+                "\t\tp: \"\",\n" +
+                "\t\tc: [{\n" +
+                "\t\t\tv: \"瀹為獙瀹よ绱燶",\n" +
+                "\t\t\ti: \"font icon-erjidaohang\",\n" +
+                "\t\t\tu: \"\",\n" +
+                "\t\t\tp: \"\"\n" +
+                "\t\t}, {\n" +
+                "\t\t\tv: \"姣忔棩涓氬姟缁熻\",\n" +
+                "\t\t\ti: \"font icon-erjidaohang\",\n" +
+                "\t\t\tu: \"b4-daily-business-statistics\",\n" +
+                "\t\t\tp: \"businessStatisticsByDay\"\n" +
+                "\t\t}, {\n" +
+                "\t\t\tv: \"妫�娴嬮」鐩粺璁",\n" +
+                "\t\t\ti: \"font icon-erjidaohang\",\n" +
+                "\t\t\tu: \"b4-inspection-item-statistics\",\n" +
+                "\t\t\tp: \"testProductByDay\"\n" +
+                "\t\t}, {\n" +
+                "\t\t\tv: \"鏍峰搧缂洪櫡鎸囨暟\",\n" +
+                "\t\t\ti: \"font icon-erjidaohang\",\n" +
+                "\t\t\tu: \"b4-sample-defects\",\n" +
+                "\t\t\tp: \"selectSampleDefects\"\n" +
+                "\t\t}, {\n" +
+                "\t\t\tv: \"鑰楁潗缁熻\",\n" +
+                "\t\t\ti: \"font icon-erjidaohang\",\n" +
+                "\t\t\tu: \"\",\n" +
+                "\t\t\tp: \"\"\n" +
+                "\t\t}, {\n" +
+                "\t\t\tv: \"浜哄憳宸ヤ綔鎶ヨ〃\",\n" +
+                "\t\t\ti: \"font icon-erjidaohang\",\n" +
+                "\t\t\tu: \"\",\n" +
+                "\t\t\tp: \"\"\n" +
+                "\t\t}]\n" +
+                "\t},\n" +
+                "\t{\n" +
+                "\t\tv: \"鐢靛瓙鐪嬫澘\",\n" +
+                "\t\ti: \"font icon-dianzikanban-fan\",\n" +
+                "\t\tp: \"\",\n" +
+                "\t\tc: [{\n" +
+                "\t\t\tv: \"瀹㈡埛鎺ュ緟\",\n" +
+                "\t\t\ti: \"font icon-erjidaohang\",\n" +
+                "\t\t\tu: \"\",\n" +
+                "\t\t\tp: \"\"\n" +
+                "\t\t}, {\n" +
+                "\t\t\tv: \"浠诲姟灞曠ず\",\n" +
+                "\t\t\ti: \"font icon-erjidaohang\",\n" +
+                "\t\t\tu: \"\",\n" +
+                "\t\t\tp: \"\"\n" +
+                "\t\t}, {\n" +
+                "\t\t\tv: \"璁惧鐘舵�佸強楗卞拰搴",\n" +
+                "\t\t\ti: \"font icon-erjidaohang\",\n" +
+                "\t\t\tu: \"\",\n" +
+                "\t\t\tp: \"\"\n" +
+                "\t\t}]\n" +
+                "\t},\n" +
+                "\t{\n" +
+                "\t\tv: \"绯荤粺鍔熻兘\",\n" +
+                "\t\ti: \"el-icon-s-tools\",\n" +
+                "\t\tp: \"\",\n" +
+                "\t\tc: [{\n" +
+                "\t\t\tv: \"鏁版嵁瀛楀吀\",\n" +
+                "\t\t\ti: \"el-icon-s-tools\",\n" +
+                "\t\t\tu: \"enums\",\n" +
+                "\t\t\tp: \"selectEnumList\"\n" +
+                "\t\t}, {\n" +
+                "\t\t\tv: \"瑙掕壊绠$悊\",\n" +
+                "\t\t\ti: \"el-icon-s-tools\",\n" +
+                "\t\t\tu: \"role-manage\",\n" +
+                "\t\t\tp: \"selectRoleLists\"\n" +
+                "\t\t}, {\n" +
+                "\t\t\tv: \"鐢ㄦ埛绠$悊\",\n" +
+                "\t\t\ti: \"el-icon-s-tools\",\n" +
+                "\t\t\tu: \"person-manage\",\n" +
+                "\t\t\tp: \"selectUserList\"\n" +
+                "\t\t}, {\n" +
+                "\t\t\tv: \"瀹㈡埛绠$悊\",\n" +
+                "\t\t\ti: \"el-icon-s-tools\",\n" +
+                "\t\t\tu: \"custom_manage\",\n" +
+                "\t\t\tp: \"selectCustomPageList\"\n" +
+                "\t\t}, {\n" +
+                "\t\t\tv: \"绯荤粺鏃ュ織\",\n" +
+                "\t\t\ti: \"el-icon-s-tools\",\n" +
+                "\t\t\tu: \"system-log\",\n" +
+                "\t\t\tp: \"\"\n" +
+                "\t\t}, {\n" +
+                "\t\t\tv: \"娑堟伅璇︽儏\",\n" +
+                "\t\t\ti: \"el-icon-s-tools\",\n" +
+                "\t\t\tu: \"notice-detail\",\n" +
+                "\t\t\tp: \"abcd\"\n" +
+                "\t\t}]\n" +
+                "\t},\n" +
+                "\t{\n" +
+                "\t\tv: \"4 閫氱敤瑕佹眰\",\n" +
+                "\t\ti: \"font icon-tongyongyaoqiu\",\n" +
+                "\t\tp: \"\",\n" +
+                "\t\tc: [{\n" +
+                "\t\t\t\tv: \"閫氱敤瑕佹眰\",\n" +
+                "\t\t\t\ti: \"font icon-erjidaohang\",\n" +
+                "\t\t\t\tu: \"\",\n" +
+                "\t\t\t\tg: \"4 閫氱敤瑕佹眰\",\n" +
+                "\t\t\t\tp: \"\"\n" +
+                "\t\t\t},\n" +
+                "\t\t\t{\n" +
+                "\t\t\t\tv: \"鍏鎬",\n" +
+                "\t\t\t\ti: \"font icon-erjidaohang\",\n" +
+                "\t\t\t\tu: \"\",\n" +
+                "\t\t\t\tg: \"4.1 鍏鎬",\n" +
+                "\t\t\t\tp: \"\"\n" +
+                "\t\t\t},\n" +
+                "\t\t\t{\n" +
+                "\t\t\t\tv: \"淇濆瘑鎬",\n" +
+                "\t\t\t\ti: \"font icon-erjidaohang\",\n" +
+                "\t\t\t\tu: \"\",\n" +
+                "\t\t\t\tg: \"4.2 淇濆瘑鎬",\n" +
+                "\t\t\t\tp: \"\"\n" +
+                "\t\t\t}\n" +
+                "\t\t]\n" +
+                "\t},\n" +
+                "\t{\n" +
+                "\t\tv: \"5 缁撴瀯瑕佹眰\",\n" +
+                "\t\ti: \"font icon-jiegouyaoqiu\",\n" +
+                "\t\tp: \"\",\n" +
+                "\t\tc: [{\n" +
+                "\t\t\tv: \"瀹為獙瀹ょ殑娉曞緥鍦颁綅\",\n" +
+                "\t\t\ti: \"font icon-erjidaohang\",\n" +
+                "\t\t\tu: \"\",\n" +
+                "\t\t\tg: \"A瀹為獙瀹ょ殑娉曞緥鍦颁綅\",\n" +
+                "\t\t\tp: \"\"\n" +
+                "\t\t}, {\n" +
+                "\t\t\tv: \"鍏ㄦ潈璐熻矗鐨勭鐞嗗眰\",\n" +
+                "\t\t\ti: \"font icon-erjidaohang\",\n" +
+                "\t\t\tu: \"\",\n" +
+                "\t\t\tg: \"B鍏ㄦ潈璐熻矗鐨勭鐞嗗眰\",\n" +
+                "\t\t\tp: \"\"\n" +
+                "\t\t}, {\n" +
+                "\t\t\tv: \"瀹為獙瀹よ祫璐╘",\n" +
+                "\t\t\ti: \"font icon-erjidaohang\",\n" +
+                "\t\t\tu: \"a5-laboratory-qualifications\",\n" +
+                "\t\t\tg: \"C鑳藉姏鑼冨洿鍜岃祫璐╘",\n" +
+                "\t\t\tp: \"getCertificationDetail\"\n" +
+                "\t\t}, {\n" +
+                "\t\t\tv: \"鑳藉姏鑼冨洿\",\n" +
+                "\t\t\ti: \"font icon-erjidaohang\",\n" +
+                "\t\t\tu: \"a5-capacity-scope\",\n" +
+                "\t\t\tg: \"C鑳藉姏鑼冨洿鍜岃祫璐╘",\n" +
+                "\t\t\tp: \"selectItemParameterList selectTestObjectList\"\n" +
+                "\t\t}, {\n" +
+                "\t\t\tv: \"鍦烘墍鎴栬鏂絓",\n" +
+                "\t\t\ti: \"font icon-erjidaohang\",\n" +
+                "\t\t\tu: \"a5-laboratory-management\",\n" +
+                "\t\t\tg: \"D鍦烘墍鎴栬鏂絓",\n" +
+                "\t\t\tp: \"selectItemParameter\"\n" +
+                "\t\t}, {\n" +
+                "\t\t\tv: \"缁勭粐鐩稿叧鏂囦欢\",\n" +
+                "\t\t\ti: \"font icon-erjidaohang\",\n" +
+                "\t\t\tu: \"\",\n" +
+                "\t\t\tg: \"E缁勭粐鐩稿叧鏂囦欢\",\n" +
+                "\t\t\tp: \"\"\n" +
+                "\t\t}, {\n" +
+                "\t\t\tv: \"浜哄憳宀椾綅浠昏亴\",\n" +
+                "\t\t\ti: \"font icon-erjidaohang\",\n" +
+                "\t\t\tu: \"\",\n" +
+                "\t\t\tg: \"F浜哄憳宀椾綅浠昏亴\",\n" +
+                "\t\t\tp: \"\"\n" +
+                "\t\t}, {\n" +
+                "\t\t\tv: \"娌熼�氬拰瀹h疮\",\n" +
+                "\t\t\ti: \"font icon-erjidaohang\",\n" +
+                "\t\t\tu: \"\",\n" +
+                "\t\t\tg: \"G娌熼�氬拰瀹h疮\",\n" +
+                "\t\t\tp: \"\"\n" +
+                "\t\t}]\n" +
+                "\t}, {\n" +
+                "\t\tv: \"6 璧勬簮瑕佹眰\",\n" +
+                "\t\ti: \"font icon-ziyuanyaoqiu\",\n" +
+                "\t\tp: \"\",\n" +
+                "\t\tc: [{\n" +
+                "\t\t\tv: \"鎬诲垯\",\n" +
+                "\t\t\ti: \"font icon-erjidaohang\",\n" +
+                "\t\t\tu: \"\",\n" +
+                "\t\t\tg: \"6.1 鎬诲垯\",\n" +
+                "\t\t\tp: \"\"\n" +
+                "\t\t}, {\n" +
+                "\t\t\tv: \"浜哄憳鎬昏\",\n" +
+                "\t\t\ti: \"font icon-erjidaohang\",\n" +
+                "\t\t\tu: \"a6-personnel-overview\",\n" +
+                "\t\t\tg: \"6.2 浜哄憳\",\n" +
+                "\t\t\tp: \"selectPersonnelOverview\"\n" +
+                "\t\t}, {\n" +
+                "\t\t\tv: \"浜哄憳鏄庣粏\",\n" +
+                "\t\t\ti: \"font icon-erjidaohang\",\n" +
+                "\t\t\tu: \"a6-personnel-detail\",\n" +
+                "\t\t\tg: \"6.2 浜哄憳\",\n" +
+                "\t\t\tp: \"selectDepartmentLim\"\n" +
+                "\t\t}, {\n" +
+                "\t\t\tv: \"浜哄憳鍩硅\",\n" +
+                "\t\t\ti: \"font icon-erjidaohang\",\n" +
+                "\t\t\tu: \"\",\n" +
+                "\t\t\tg: \"6.2 浜哄憳\",\n" +
+                "\t\t\tp: \"\"\n" +
+                "\t\t}, {\n" +
+                "\t\t\tv: \"浜哄憳鐩戠潱\",\n" +
+                "\t\t\ti: \"font icon-erjidaohang\",\n" +
+                "\t\t\tu: \"\",\n" +
+                "\t\t\tg: \"6.2 浜哄憳\",\n" +
+                "\t\t\tp: \"\"\n" +
+                "\t\t}, {\n" +
+                "\t\t\tv: \"宀椾綅鑱岃矗\",\n" +
+                "\t\t\ti: \"font icon-erjidaohang\",\n" +
+                "\t\t\tu: \"\",\n" +
+                "\t\t\tg: \"6.2 浜哄憳\",\n" +
+                "\t\t\tp: \"\"\n" +
+                "\t\t}, {\n" +
+                "\t\t\tv: \"浜哄憳鍩烘湰淇℃伅\",\n" +
+                "\t\t\ti: \"font icon-erjidaohang\",\n" +
+                "\t\t\tu: \"\",\n" +
+                "\t\t\tg: \"6.2 浜哄憳\",\n" +
+                "\t\t\tp: \"\"\n" +
+                "\t\t}, {\n" +
+                "\t\t\tv: \"宸ヤ綔灞ュ巻\",\n" +
+                "\t\t\ti: \"font icon-erjidaohang\",\n" +
+                "\t\t\tu: \"\",\n" +
+                "\t\t\tg: \"6.2 浜哄憳\",\n" +
+                "\t\t\tp: \"\"\n" +
+                "\t\t}, {\n" +
+                "\t\t\tv: \"濂栨儵璁板綍\",\n" +
+                "\t\t\ti: \"font icon-erjidaohang\",\n" +
+                "\t\t\tu: \"\",\n" +
+                "\t\t\tg: \"6.2 浜哄憳\",\n" +
+                "\t\t\tp: \"\"\n" +
+                "\t\t}, {\n" +
+                "\t\t\tv: \"鍩硅璁板綍\",\n" +
+                "\t\t\ti: \"font icon-erjidaohang\",\n" +
+                "\t\t\tu: \"\",\n" +
+                "\t\t\tg: \"6.2 浜哄憳\",\n" +
+                "\t\t\tp: \"\"\n" +
+                "\t\t}, {\n" +
+                "\t\t\tv: \"鐩戠潱璁板綍\",\n" +
+                "\t\t\ti: \"font icon-erjidaohang\",\n" +
+                "\t\t\tu: \"\",\n" +
+                "\t\t\tg: \"6.2 浜哄憳\",\n" +
+                "\t\t\tp: \"\"\n" +
+                "\t\t}, {\n" +
+                "\t\t\tv: \"浠昏亴鎺堟潈璁板綍\",\n" +
+                "\t\t\ti: \"font icon-erjidaohang\",\n" +
+                "\t\t\tu: \"\",\n" +
+                "\t\t\tg: \"6.2 浜哄憳\",\n" +
+                "\t\t\tp: \"\"\n" +
+                "\t\t}, {\n" +
+                "\t\t\tv: \"浜哄憳鑳藉姏鐩戞帶璁板綍\",\n" +
+                "\t\t\ti: \"font icon-erjidaohang\",\n" +
+                "\t\t\tu: \"\",\n" +
+                "\t\t\tg: \"6.2 浜哄憳\",\n" +
+                "\t\t\tp: \"\"\n" +
+                "\t\t}, {\n" +
+                "\t\t\tv: \"娌熼�氳褰昞",\n" +
+                "\t\t\ti: \"font icon-erjidaohang\",\n" +
+                "\t\t\tu: \"\",\n" +
+                "\t\t\tg: \"6.2 浜哄憳\",\n" +
+                "\t\t\tp: \"\"\n" +
+                "\t\t}, {\n" +
+                "\t\t\tv: \"澶栨潵浜哄憳绠$悊\",\n" +
+                "\t\t\ti: \"font icon-erjidaohang\",\n" +
+                "\t\t\tu: \"a6-external-personnel-management\",\n" +
+                "\t\t\tg: \"6.3 璁炬柦鍜岀幆澧冩潯浠禱",\n" +
+                "\t\t\tp: \"\"\n" +
+                "\t\t}, {\n" +
+                "\t\t\tv: \"瀹為獙瀹よ鏂藉満鎵�淇℃伅\",\n" +
+                "\t\t\ti: \"font icon-erjidaohang\",\n" +
+                "\t\t\tu: \"\",\n" +
+                "\t\t\tg: \"6.3 璁炬柦鍜岀幆澧冩潯浠禱",\n" +
+                "\t\t\tp: \"\"\n" +
+                "\t\t}, {\n" +
+                "\t\t\tv: \"璁炬柦鍜岀幆澧冩潯浠惰姹俓",\n" +
+                "\t\t\ti: \"font icon-erjidaohang\",\n" +
+                "\t\t\tu: \"\",\n" +
+                "\t\t\tg: \"6.3 璁炬柦鍜岀幆澧冩潯浠禱",\n" +
+                "\t\t\tp: \"\"\n" +
+                "\t\t}, {\n" +
+                "\t\t\tv: \"鐜鏉′欢寮曠敤\",\n" +
+                "\t\t\ti: \"font icon-erjidaohang\",\n" +
+                "\t\t\tu: \"\",\n" +
+                "\t\t\tg: \"6.3 璁炬柦鍜岀幆澧冩潯浠禱",\n" +
+                "\t\t\tp: \"\"\n" +
+                "\t\t}, {\n" +
+                "\t\t\tv: \"瀹夊叏鍖轰唬琛ㄦ鏌",\n" +
+                "\t\t\ti: \"font icon-erjidaohang\",\n" +
+                "\t\t\tu: \"\",\n" +
+                "\t\t\tg: \"6.3 璁炬柦鍜岀幆澧冩潯浠禱",\n" +
+                "\t\t\tp: \"\"\n" +
+                "\t\t}, {\n" +
+                "\t\t\tv: \"瀹夊叏鍐呭姟\",\n" +
+                "\t\t\ti: \"font icon-erjidaohang\",\n" +
+                "\t\t\tu: \"\",\n" +
+                "\t\t\tg: \"6.3 璁炬柦鍜岀幆澧冩潯浠禱",\n" +
+                "\t\t\tp: \"\"\n" +
+                "\t\t}, {\n" +
+                "\t\t\tv: \"搴熺墿澶勭悊浜ゆ帴璁板綍\",\n" +
+                "\t\t\ti: \"font icon-erjidaohang\",\n" +
+                "\t\t\tu: \"a6-waste-handover\",\n" +
+                "\t\t\tg: \"6.3 璁炬柦鍜岀幆澧冩潯浠禱",\n" +
+                "\t\t\tp: \"\"\n" +
+                "\t\t}, {\n" +
+                "\t\t\tv: \"璁惧鎬昏\",\n" +
+                "\t\t\ti: \"font icon-erjidaohang\",\n" +
+                "\t\t\tu: \"a6-device-overview\",\n" +
+                "\t\t\tg: \"6.4 璁惧\",\n" +
+                "\t\t\tp: \"selectDeviceParameter\"\n" +
+                "\t\t}, {\n" +
+                "\t\t\tv: \"璁惧宸ュ叿鏄庣粏\",\n" +
+                "\t\t\ti: \"font icon-erjidaohang\",\n" +
+                "\t\t\tu: \"a6-device-management\",\n" +
+                "\t\t\tg: \"6.4 璁惧\",\n" +
+                "\t\t\tp: \"selectDeviceParameter\"\n" +
+                "\t\t}, {\n" +
+                "\t\t\tv: \"璧勬簮棰勫畾\",\n" +
+                "\t\t\ti: \"font icon-erjidaohang\",\n" +
+                "\t\t\tu: \"\",\n" +
+                "\t\t\tg: \"6.4 璁惧\",\n" +
+                "\t\t\tp: \"\"\n" +
+                "\t\t}, {\n" +
+                "\t\t\tv: \"浣滀笟鎸囧涔",\n" +
+                "\t\t\ti: \"font icon-erjidaohang\",\n" +
+                "\t\t\tu: \"\",\n" +
+                "\t\t\tg: \"6.4 璁惧\",\n" +
+                "\t\t\tp: \"\"\n" +
+                "\t\t}, {\n" +
+                "\t\t\tv: \"璁惧杩愯鎬昏\",\n" +
+                "\t\t\ti: \"font icon-erjidaohang\",\n" +
+                "\t\t\tu: \"\",\n" +
+                "\t\t\tg: \"6.4 璁惧\",\n" +
+                "\t\t\tp: \"\"\n" +
+                "\t\t}, {\n" +
+                "\t\t\tv: \"璁惧妗f\",\n" +
+                "\t\t\ti: \"font icon-erjidaohang\",\n" +
+                "\t\t\tu: \"\",\n" +
+                "\t\t\tg: \"6.4 璁惧\",\n" +
+                "\t\t\tp: \"\"\n" +
+                "\t\t}, {\n" +
+                "\t\t\tv: \"璁惧楠屾敹\",\n" +
+                "\t\t\ti: \"font icon-erjidaohang\",\n" +
+                "\t\t\tu: \"\",\n" +
+                "\t\t\tg: \"6.4 璁惧\",\n" +
+                "\t\t\tp: \"\"\n" +
+                "\t\t}, {\n" +
+                "\t\t\tv: \"璁惧鏍″噯\",\n" +
+                "\t\t\ti: \"font icon-erjidaohang\",\n" +
+                "\t\t\tu: \"\",\n" +
+                "\t\t\tg: \"6.4 璁惧\",\n" +
+                "\t\t\tp: \"\"\n" +
+                "\t\t}, {\n" +
+                "\t\t\tv: \"璁惧鏍告煡\",\n" +
+                "\t\t\ti: \"font icon-erjidaohang\",\n" +
+                "\t\t\tu: \"\",\n" +
+                "\t\t\tg: \"6.4 璁惧\",\n" +
+                "\t\t\tp: \"\"\n" +
+                "\t\t}, {\n" +
+                "\t\t\tv: \"璁惧缁存姢\",\n" +
+                "\t\t\ti: \"font icon-erjidaohang\",\n" +
+                "\t\t\tu: \"\",\n" +
+                "\t\t\tg: \"6.4 璁惧\",\n" +
+                "\t\t\tp: \"\"\n" +
+                "\t\t}, {\n" +
+                "\t\t\tv: \"璁惧鍊熺敤\",\n" +
+                "\t\t\ti: \"font icon-erjidaohang\",\n" +
+                "\t\t\tu: \"\",\n" +
+                "\t\t\tg: \"6.4 璁惧\",\n" +
+                "\t\t\tp: \"\"\n" +
+                "\t\t}, {\n" +
+                "\t\t\tv: \"璁惧鏁呴殰\",\n" +
+                "\t\t\ti: \"font icon-erjidaohang\",\n" +
+                "\t\t\tu: \"\",\n" +
+                "\t\t\tg: \"6.4 璁惧\",\n" +
+                "\t\t\tp: \"\"\n" +
+                "\t\t}, {\n" +
+                "\t\t\tv: \"浣跨敤璁板綍\",\n" +
+                "\t\t\ti: \"font icon-erjidaohang\",\n" +
+                "\t\t\tu: \"\",\n" +
+                "\t\t\tg: \"6.4 璁惧\",\n" +
+                "\t\t\tp: \"\"\n" +
+                "\t\t}, {\n" +
+                "\t\t\tv: \"璁惧鍋滅敤/鍚敤\",\n" +
+                "\t\t\ti: \"font icon-erjidaohang\",\n" +
+                "\t\t\tu: \"\",\n" +
+                "\t\t\tg: \"6.4 璁惧\",\n" +
+                "\t\t\tp: \"\"\n" +
+                "\t\t}, {\n" +
+                "\t\t\tv: \"閲忓�兼函婧愯鍒抃",\n" +
+                "\t\t\ti: \"font icon-erjidaohang\",\n" +
+                "\t\t\tu: \"\",\n" +
+                "\t\t\tg: \"6.5 璁¢噺婧簮鎬",\n" +
+                "\t\t\tp: \"\"\n" +
+                "\t\t}, {\n" +
+                "\t\t\tv: \"鏍囧噯鐗╄川娓呭崟\",\n" +
+                "\t\t\ti: \"font icon-erjidaohang\",\n" +
+                "\t\t\tu: \"a6-standard-material-list\",\n" +
+                "\t\t\tg: \"6.5 璁¢噺婧簮鎬",\n" +
+                "\t\t\tp: \"\"\n" +
+                "\t\t}, {\n" +
+                "\t\t\tv: \"鏍囧噯鐗╄川楠屾敹\",\n" +
+                "\t\t\ti: \"font icon-erjidaohang\",\n" +
+                "\t\t\tu: \"\",\n" +
+                "\t\t\tg: \"6.5 璁¢噺婧簮鎬",\n" +
+                "\t\t\tp: \"\"\n" +
+                "\t\t}, {\n" +
+                "\t\t\tv: \"鏍囧噯鐗╄川棰嗙敤\",\n" +
+                "\t\t\ti: \"font icon-erjidaohang\",\n" +
+                "\t\t\tu: \"a6-standard-material-requisition\",\n" +
+                "\t\t\tg: \"6.5 璁¢噺婧簮鎬",\n" +
+                "\t\t\tp: \"\"\n" +
+                "\t\t}, {\n" +
+                "\t\t\tv: \"杩囨湡鏍囨牱澶勭疆\",\n" +
+                "\t\t\ti: \"font icon-erjidaohang\",\n" +
+                "\t\t\tu: \"\",\n" +
+                "\t\t\tg: \"6.5 璁¢噺婧簮鎬",\n" +
+                "\t\t\tp: \"\"\n" +
+                "\t\t}, {\n" +
+                "\t\t\tv: \"鏈嶅姟鍜屼緵搴斿搧閲囪喘\",\n" +
+                "\t\t\ti: \"font icon-erjidaohang\",\n" +
+                "\t\t\tu: \"\",\n" +
+                "\t\t\tg: \"6.6 澶栭儴鎻愪緵鐨勪骇鍝佸拰鏈嶅姟\",\n" +
+                "\t\t\tp: \"\"\n" +
+                "\t\t},{\n" +
+                "\t\t\tv: \"渚涘簲鍟嗙鐞哱",\n" +
+                "\t\t\ti: \"font icon-erjidaohang\",\n" +
+                "\t\t\tu: \"\",\n" +
+                "\t\t\tg: \"6.6 澶栭儴鎻愪緵鐨勪骇鍝佸拰鏈嶅姟\",\n" +
+                "\t\t\tp: \"\"\n" +
+                "\t\t}]\n" +
+                "\t},\n" +
+                "\t{\n" +
+                "\t\tv: \"7 杩囩▼瑕佹眰\",\n" +
+                "\t\ti: \"font icon-guochengyaoqiu\",\n" +
+                "\t\tp: \"\",\n" +
+                "\t\tc: [{\n" +
+                "\t\t\tv: \"妫�楠屽鎵樺崟\",\n" +
+                "\t\t\ti: \"font icon-erjidaohang\",\n" +
+                "\t\t\tu: \"\",\n" +
+                "\t\t\tg: \"7.1 瑕佹眰銆佹爣涔﹀拰鍚堝悓璇勫\",\n" +
+                "\t\t\tp: \"\"\n" +
+                "\t\t}, {\n" +
+                "\t\t\tv: \"鍚堝悓璇勫\",\n" +
+                "\t\t\ti: \"font icon-erjidaohang\",\n" +
+                "\t\t\tu: \"\",\n" +
+                "\t\t\tg: \"7.1 瑕佹眰銆佹爣涔﹀拰鍚堝悓璇勫\",\n" +
+                "\t\t\tp: \"\"\n" +
+                "\t\t}, {\n" +
+                "\t\t\tv: \"瀹為獙瀹ょ殑妫�娴嬭兘鍔涙。妗圽",\n" +
+                "\t\t\ti: \"font icon-erjidaohang\",\n" +
+                "\t\t\tu: \"a7-standard-method\",\n" +
+                "\t\t\tg: \"7.2 鏂规硶鐨勯�夋嫨銆侀獙璇佸拰纭\",\n" +
+                "\t\t\tp: \"selectStandardMethodList\"\n" +
+                "\t\t}, {\n" +
+                "\t\t\tv: \"鏍囧噯鏌ユ柊\",\n" +
+                "\t\t\ti: \"font icon-erjidaohang\",\n" +
+                "\t\t\tu: \"\",\n" +
+                "\t\t\tg: \"7.2 鏂规硶鐨勯�夋嫨銆侀獙璇佸拰纭\",\n" +
+                "\t\t\tp: \"\"\n" +
+                "\t\t}, {\n" +
+                "\t\t\tv: \"鏍囧噯鏂规硶鐨勫彉鏇碶",\n" +
+                "\t\t\ti: \"font icon-erjidaohang\",\n" +
+                "\t\t\tu: \"\",\n" +
+                "\t\t\tg: \"7.2 鏂规硶鐨勯�夋嫨銆侀獙璇佸拰纭\",\n" +
+                "\t\t\tp: \"\"\n" +
+                "\t\t}, {\n" +
+                "\t\t\tv: \"鏂规硶楠岃瘉\",\n" +
+                "\t\t\ti: \"font icon-erjidaohang\",\n" +
+                "\t\t\tu: \"\",\n" +
+                "\t\t\tg: \"7.2 鏂规硶鐨勯�夋嫨銆侀獙璇佸拰纭\",\n" +
+                "\t\t\tp: \"\"\n" +
+                "\t\t}, {\n" +
+                "\t\t\tv: \"鎶芥牱\",\n" +
+                "\t\t\ti: \"font icon-erjidaohang\",\n" +
+                "\t\t\tu: \"\",\n" +
+                "\t\t\tg: \"7.3 鎶芥牱\",\n" +
+                "\t\t\tp: \"\"\n" +
+                "\t\t}, {\n" +
+                "\t\t\tv: \"妫�娴嬫垨鏍″噯鐗╁搧鐨勫缃甛",\n" +
+                "\t\t\ti: \"font icon-erjidaohang\",\n" +
+                "\t\t\tu: \"\",\n" +
+                "\t\t\tg: \"7.4 妫�娴嬫垨鏍″噯鐗╁搧鐨勫缃甛",\n" +
+                "\t\t\tp: \"\"\n" +
+                "\t\t}, {\n" +
+                "\t\t\tv: \"鎶�鏈褰昞",\n" +
+                "\t\t\ti: \"font icon-erjidaohang\",\n" +
+                "\t\t\tu: \"\",\n" +
+                "\t\t\tg: \"7.5 鎶�鏈褰昞",\n" +
+                "\t\t\tp: \"\"\n" +
+                "\t\t}, {\n" +
+                "\t\t\tv: \"娴嬮噺涓嶇‘瀹氬害鐨勮瘎瀹歕",\n" +
+                "\t\t\ti: \"font icon-erjidaohang\",\n" +
+                "\t\t\tu: \"\",\n" +
+                "\t\t\tg: \"7.6 娴嬮噺涓嶇‘瀹氬害鐨勮瘎瀹歕",\n" +
+                "\t\t\tp: \"\"\n" +
+                "\t\t}, {\n" +
+                "\t\t\tv: \"纭繚缁撴灉鏈夋晥鎬",\n" +
+                "\t\t\ti: \"font icon-erjidaohang\",\n" +
+                "\t\t\tu: \"\",\n" +
+                "\t\t\tg: \"7.7 纭繚缁撴灉鏈夋晥鎬",\n" +
+                "\t\t\tp: \"\"\n" +
+                "\t\t}, {\n" +
+                "\t\t\tv: \"鎶ュ憡缁撴灉\",\n" +
+                "\t\t\ti: \"font icon-erjidaohang\",\n" +
+                "\t\t\tu: \"\",\n" +
+                "\t\t\tg: \"7.8 鎶ュ憡缁撴灉\",\n" +
+                "\t\t\tp: \"\"\n" +
+                "\t\t}, {\n" +
+                "\t\t\tv: \"鎶曡瘔璇︽儏\",\n" +
+                "\t\t\ti: \"font icon-erjidaohang\",\n" +
+                "\t\t\tu: \"\",\n" +
+                "\t\t\tg: \"7.9 鎶曡瘔\",\n" +
+                "\t\t\tp: \"\"\n" +
+                "\t\t}, {\n" +
+                "\t\t\tv: \"鎶曡瘔鎯呭喌姹囨�昏〃\",\n" +
+                "\t\t\ti: \"font icon-erjidaohang\",\n" +
+                "\t\t\tu: \"\",\n" +
+                "\t\t\tg: \"7.9 鎶曡瘔\",\n" +
+                "\t\t\tp: \"\"\n" +
+                "\t\t}, {\n" +
+                "\t\t\tv: \"涓嶇鍚堥」\",\n" +
+                "\t\t\ti: \"font icon-erjidaohang\",\n" +
+                "\t\t\tu: \"\",\n" +
+                "\t\t\tg: \"7.10 涓嶇鍚堝伐浣淺",\n" +
+                "\t\t\tp: \"\"\n" +
+                "\t\t}, {\n" +
+                "\t\t\tv: \"涓嶇鍚堥」鐨勫垎甯僜",\n" +
+                "\t\t\ti: \"font icon-erjidaohang\",\n" +
+                "\t\t\tu: \"\",\n" +
+                "\t\t\tg: \"7.10 涓嶇鍚堝伐浣淺",\n" +
+                "\t\t\tp: \"\"\n" +
+                "\t\t}, {\n" +
+                "\t\t\tv: \"鏁版嵁鎺у埗鍜屼俊鎭鐞哱",\n" +
+                "\t\t\ti: \"font icon-erjidaohang\",\n" +
+                "\t\t\tu: \"\",\n" +
+                "\t\t\tg: \"7.11 鏁版嵁鎺у埗鍜屼俊鎭鐞哱",\n" +
+                "\t\t\tp: \"\"\n" +
+                "\t\t}]\n" +
+                "\t},\n" +
+                "\t{\n" +
+                "\t\tv: \"8 浣撶郴绠$悊瑕佹眰\",\n" +
+                "\t\ti: \"font icon-guanlitixiyaoqiu\",\n" +
+                "\t\tp: \"\",\n" +
+                "\t\tc: [{\n" +
+                "\t\t\tv: \"鏂瑰紡\",\n" +
+                "\t\t\ti: \"font icon-erjidaohang\",\n" +
+                "\t\t\tu: \"\",\n" +
+                "\t\t\tg: \"8.1 鏂瑰紡\",\n" +
+                "\t\t\tp: \"\"\n" +
+                "\t\t}, {\n" +
+                "\t\t\tv: \"绠$悊浣撶郴鏂囦欢\",\n" +
+                "\t\t\ti: \"font icon-erjidaohang\",\n" +
+                "\t\t\tu: \"\",\n" +
+                "\t\t\tg: \"8.2 绠$悊浣撶郴鏂囦欢\",\n" +
+                "\t\t\tp: \"\"\n" +
+                "\t\t}, {\n" +
+                "\t\t\tv: \"鏂囦欢娓呭崟\",\n" +
+                "\t\t\ti: \"font icon-erjidaohang\",\n" +
+                "\t\t\tu: \"\",\n" +
+                "\t\t\tg: \"8.3 绠$悊浣撶郴鏂囦欢鐨勬帶鍒禱",\n" +
+                "\t\t\tp: \"\"\n" +
+                "\t\t}, {\n" +
+                "\t\t\tv: \"鏂囦欢鍙楁帶\",\n" +
+                "\t\t\ti: \"font icon-erjidaohang\",\n" +
+                "\t\t\tu: \"\",\n" +
+                "\t\t\tg: \"8.3 绠$悊浣撶郴鏂囦欢鐨勬帶鍒禱",\n" +
+                "\t\t\tp: \"\"\n" +
+                "\t\t}, {\n" +
+                "\t\t\tv: \"鏂囦欢鍙戞斁鍥炴敹\",\n" +
+                "\t\t\ti: \"font icon-erjidaohang\",\n" +
+                "\t\t\tu: \"\",\n" +
+                "\t\t\tg: \"8.3 绠$悊浣撶郴鏂囦欢鐨勬帶鍒禱",\n" +
+                "\t\t\tp: \"\"\n" +
+                "\t\t}, {\n" +
+                "\t\t\tv: \"鏂囦欢鍙樻洿\",\n" +
+                "\t\t\ti: \"font icon-erjidaohang\",\n" +
+                "\t\t\tu: \"\",\n" +
+                "\t\t\tg: \"8.3 绠$悊浣撶郴鏂囦欢鐨勬帶鍒禱",\n" +
+                "\t\t\tp: \"\"\n" +
+                "\t\t}, {\n" +
+                "\t\t\tv: \"鏂囦欢浣滃簾\",\n" +
+                "\t\t\ti: \"font icon-erjidaohang\",\n" +
+                "\t\t\tu: \"\",\n" +
+                "\t\t\tg: \"8.3 绠$悊浣撶郴鏂囦欢鐨勬帶鍒禱",\n" +
+                "\t\t\tp: \"\"\n" +
+                "\t\t}, {\n" +
+                "\t\t\tv: \"璁板綍鐨勬帶鍒禱",\n" +
+                "\t\t\ti: \"font icon-erjidaohang\",\n" +
+                "\t\t\tu: \"\",\n" +
+                "\t\t\tg: \"8.4 璁板綍鐨勬帶鍒禱",\n" +
+                "\t\t\tp: \"\"\n" +
+                "\t\t}, {\n" +
+                "\t\t\tv: \"搴斿椋庨櫓鍜屾満閬囩殑鎺柦\",\n" +
+                "\t\t\ti: \"font icon-erjidaohang\",\n" +
+                "\t\t\tu: \"\",\n" +
+                "\t\t\tg: \"8.5 搴斿椋庨櫓鍜屾満閬囩殑鎺柦\",\n" +
+                "\t\t\tp: \"\"\n" +
+                "\t\t}, {\n" +
+                "\t\t\tv: \"瀹㈡埛鍩烘湰淇℃伅绠$悊\",\n" +
+                "\t\t\ti: \"font icon-erjidaohang\",\n" +
+                "\t\t\tu: \"\",\n" +
+                "\t\t\tg: \"8.6 鏀硅繘\",\n" +
+                "\t\t\tp: \"\"\n" +
+                "\t\t}, {\n" +
+                "\t\t\tv: \"瀹㈡埛婊℃剰搴",\n" +
+                "\t\t\ti: \"font icon-erjidaohang\",\n" +
+                "\t\t\tu: \"\",\n" +
+                "\t\t\tg: \"8.6 鏀硅繘\",\n" +
+                "\t\t\tp: \"\"\n" +
+                "\t\t}, {\n" +
+                "\t\t\tv: \"绾犳鎺柦\",\n" +
+                "\t\t\ti: \"font icon-erjidaohang\",\n" +
+                "\t\t\tu: \"\",\n" +
+                "\t\t\tg: \"8.7 绾犳鎺柦\",\n" +
+                "\t\t\tp: \"\"\n" +
+                "\t\t}, {\n" +
+                "\t\t\tv: \"鍐呭绠$悊\",\n" +
+                "\t\t\ti: \"font icon-erjidaohang\",\n" +
+                "\t\t\tu: \"\",\n" +
+                "\t\t\tg: \"8.8 鍐呭绠$悊\",\n" +
+                "\t\t\tp: \"\"\n" +
+                "\t\t}, {\n" +
+                "\t\t\tv: \"绠$悊璇勫\",\n" +
+                "\t\t\ti: \"font icon-erjidaohang\",\n" +
+                "\t\t\tu: \"\",\n" +
+                "\t\t\tg: \"8.9 绠$悊璇勫\",\n" +
+                "\t\t\tp: \"\"\n" +
+                "\t\t}]\n" +
+                "\t}\n" +
+                "]";
+        List<ADto> aDtos = JSONArray.parseArray(menu, ADto.class);
+        List<BDto> bDtos = aDtos.get(9).getC();
+        for (String s : name) {
+            BDto bDto = new BDto();
+            bDto.setV(s);
+            bDto.setI("font icon-erjidaohang");
+            bDto.setU("a6-device-overview");
+            bDto.setG("6.4 璁惧");
+            bDto.setP("selectDeviceParameter");
+            bDtos.add(bDto);
+        }
+        for (String s : collect) {
+            BDto bDto = new BDto();
+            bDto.setV(s);
+            bDto.setI("font icon-erjidaohang");
+            bDto.setU("a6-personnel-overview");
+            bDto.setG("6.2 浜哄憳");
+            bDto.setP("selectPersonnelOverview");
+            bDtos.add(bDto);
+        }
+
+        return aDtos;
+    }
+
+    @Override
+    public List<Map<String, Object>> treeDevice(String deviceName) {
+        List<Map<String, Object>>  listMap = deviceMapper.treeDevice(deviceName);
+        return listMap;
+    }
+
+    @Override
+    public Result<?> determineWhetherToCollectData(String managementNumber, HttpServletRequest request) {
+        String ip = DataAcquisition.getIp(request);
+        Device device = baseMapper.selectOne(Wrappers.<Device>lambdaQuery()
+                .eq(Device::getIp, ip));
+        if (ObjectUtils.isEmpty(device)) {
+            return Result.success(false);
+        }
+        if (ObjectUtils.isEmpty(device.getFileType()) || ObjectUtils.isEmpty(device.getCollectUrl())) {
+            return Result.success(false);
+        } else {
+            return Result.success(true);
+        }
+    }
+
+    @Override
+    public void exportDeviceFile(Integer deviceId, HttpServletResponse response) {
+
+        // 璁惧淇℃伅
+        Device device = baseMapper.selectById(deviceId);
+        // 璁惧妗f
+        List<Document> documentList = documentService.list(Wrappers.<Document>lambdaQuery().eq(Document::getDeviceId, deviceId));
+        // 璁惧鏍″噯琛�
+        List<DeviceMetricRecord> deviceMetricRecordList = deviceMetricRecordMapper.selectList(Wrappers.<DeviceMetricRecord>lambdaQuery().eq(DeviceMetricRecord::getDeviceId, deviceId));
+        // 璁惧缁翠慨琛�
+        List<DeviceMaintenance> deviceMaintenanceList = deviceMaintenanceMapper.selectList(Wrappers.<DeviceMaintenance>lambdaQuery().eq(DeviceMaintenance::getDeviceId, deviceId));
+
+
+        // 杩斿洖缁檞ord鐨勬暟鎹垪琛� 鍒嗕负宸﹀彸涓ゅ垪鏁版嵁
+        List<DocumentExportWordDto> documentExportWordDtoList = new ArrayList<>();
+        // 缁欐。妗堝姞搴忓彿 骞跺乏鍙冲垎涓哄乏鍙充袱鍒楀湪word涓樉绀�
+        extracted(documentList, documentExportWordDtoList);
+
+
+        // 灏嗘牎鍑嗚〃鍜岀淮淇〃鏀惧叆涓�涓璞′腑鏂逛究word琛ㄦ牸涓樉绀�
+        List<DeviceMetricRecordAndMaintenanceDto> deviceMetricRecordAndMaintenanceDtoList = getDeviceMetricRecordAndMaintenanceDtoList(deviceMetricRecordList, deviceMaintenanceList);
+
+
+        // 鑾峰彇璺緞
+        InputStream inputStream = this.getClass().getResourceAsStream("/static/word/device-document.docx");
+        Configure configure = Configure.builder()
+                .bind("document", new HackLoopTableRenderPolicy())
+                .bind("deviceMetricRecordAndMaintenanceDtoList", new HackLoopTableRenderPolicy())
+                .build();
+        XWPFTemplate template = XWPFTemplate.compile(inputStream, configure).render(
+                new HashMap<String, Object>() {{
+                    put("device", device);
+                    put("document", documentExportWordDtoList); // 妗f
+                    put("deviceMetricRecordAndMaintenanceDtoList", deviceMetricRecordAndMaintenanceDtoList); // 鏍″噯琛� 鍜� 缁翠慨琛�
+                }});
+
+        try {
+            response.setContentType("application/msword");
+            String fileName = URLEncoder.encode(
+                    device.getDeviceName() + "妗f", "UTF-8");
+            response.setHeader("Content-disposition",
+                    "attachment;filename=" + fileName + ".docx");
+            OutputStream os = response.getOutputStream();
+            template.write(os);
+            os.flush();
+            os.close();
+        } catch (Exception e) {
+            e.printStackTrace();
+            throw new RuntimeException("瀵煎嚭澶辫触");
+        }
+    }
+
+    private List<DeviceMetricRecordAndMaintenanceDto> getDeviceMetricRecordAndMaintenanceDtoList(List<DeviceMetricRecord> deviceMetricRecordList, List<DeviceMaintenance> deviceMaintenanceList) {
+        // 璁惧鏍″噯琛ㄥ拰璁惧缁翠慨琛ㄧ殑闆嗗悎
+        List<DeviceMetricRecordAndMaintenanceDto> deviceMetricRecordAndMaintenanceDtoList = new ArrayList<>();
+        // 璁惧鏍″噯琛ㄥ拰璁惧缁翠慨琛ㄧ殑闀垮害鍙兘涓嶄竴鏍� 鍙栨渶澶у�� 涓嶅鐨勭敤绌烘暟鎹~鍏�
+        int metricRecordSize = deviceMetricRecordList.size();
+        int maintenanceSize = deviceMaintenanceList.size();
+        int size = Math.max(metricRecordSize, maintenanceSize);
+        // 缁� 鏍¢獙鍜岀淮淇璞� 璧嬪��
+        for (int i = 0; i < size; i++) {
+            // 鏍¢獙鍜岀淮淇璞�
+            DeviceMetricRecordAndMaintenanceDto deviceMetricRecordAndMaintenanceDto = new DeviceMetricRecordAndMaintenanceDto();
+            // 璁剧疆搴忓彿
+            deviceMetricRecordAndMaintenanceDto.setIndex(i + 1);
+
+            // 鏍″噯琛ㄦ暟鎹�
+            if (metricRecordSize > i) {
+                // 璁剧疆鏃ユ湡鏍煎紡
+                SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+                // 鑾峰彇璁惧鏍″噯琛ㄦ暟鎹�
+                DeviceMetricRecord deviceMetricRecord = deviceMetricRecordList.get(i);
+                // 璁剧疆鏍″噯鏃ユ湡
+                deviceMetricRecordAndMaintenanceDto.setCalibrationDateString(sdf.format(deviceMetricRecord.getCalibrationDate()));
+                // 璁剧疆璇佷功缂栧彿
+                deviceMetricRecordAndMaintenanceDto.setCertificateNumber(deviceMetricRecord.getCertificateSerialNumber());
+                // 璁剧疆鏈夋晥鏈�
+                deviceMetricRecordAndMaintenanceDto.setValidityDateString(sdf.format(deviceMetricRecord.getNextCalibrationDate()));
+                // 璁剧疆鏍″噯鏈夋晥鏃ユ湡
+                deviceMetricRecordAndMaintenanceDto.setValidityDateString(sdf.format(deviceMetricRecord.getConfirmDate()));
+                // 璁剧疆妫�楠岀粨鏋�
+                deviceMetricRecordAndMaintenanceDto.setJudgement(deviceMetricRecord.getStatus());
+            }
+
+            // 缁翠慨琛ㄦ暟鎹�
+            if (maintenanceSize > i) {
+                // 鑾峰彇璁惧缁翠慨琛ㄦ暟鎹�
+                DeviceMaintenance deviceMaintenance = deviceMaintenanceList.get(i);
+                DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
+                // 缁翠慨鏃ユ湡
+                deviceMetricRecordAndMaintenanceDto.setMaintenanceDateString(deviceMaintenance.getDate().format(dateTimeFormatter));
+                // 澶勭悊鏂规硶
+                deviceMetricRecordAndMaintenanceDto.setHandlingMethod(deviceMaintenance.getContent());
+                // 澶囨敞
+                deviceMetricRecordAndMaintenanceDto.setComments(deviceMaintenance.getComments());
+            }
+
+            deviceMetricRecordAndMaintenanceDtoList.add(deviceMetricRecordAndMaintenanceDto);
+        }
+        return deviceMetricRecordAndMaintenanceDtoList;
+    }
+
+    /**
+     * 缁欐。妗堝姞搴忓彿 骞跺乏鍙冲垎涓哄乏鍙充袱鍒楀湪word涓樉绀�
+     *
+     * @param documentList              妗f鍒楄〃
+     * @param documentExportWordDtoList 杩斿洖缁檞ord鐨勬暟鎹垪琛�
+     */
+    private static void extracted(List<Document> documentList, List<DocumentExportWordDto> documentExportWordDtoList) {
+        // 缁欐。妗堝姞搴忓彿   骞朵笖鍒嗕负宸﹀彸涓や釜鍒楄〃鍦╳ord涓樉绀�
+        for (int i = 0; i < documentList.size(); i++) {
+            // 鍒涘缓word琛ㄦ牸涓竴琛岀殑鏁版嵁瀵硅薄
+            DocumentExportWordDto documentExportWordDto = new DocumentExportWordDto();
+            // 鑾峰彇妗f淇℃伅
+            Document document = documentList.get(i);
+            // 鏍煎紡鍖栨棩鏈�
+            DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
+            // 鏍规嵁搴忓彿 鍒嗗埆鍔犲叆涓や釜鍒楄〃
+            if (i % 2 == 0) {
+                // 濂囨暟鍦ㄥ乏鍒�
+                documentExportWordDto.setIndex1(i + 1);
+                documentExportWordDto.setName1(document.getName());
+                documentExportWordDto.setQuantity1(document.getQuantity());
+                documentExportWordDto.setPageCount1(document.getPageCount());
+                documentExportWordDto.setArchiveDateString1(document.getProvideDate().format(dateTimeFormatter));
+            } else {
+                // 鍋舵暟鍦ㄥ彸鍒�
+                documentExportWordDto.setIndex2(i + 1);
+                documentExportWordDto.setName2(document.getName());
+                documentExportWordDto.setQuantity2(document.getQuantity());
+                documentExportWordDto.setPageCount2(document.getPageCount());
+                documentExportWordDto.setArchiveDateString2(document.getProvideDate().format(dateTimeFormatter));
+            }
+            // 鎶婁竴琛屾暟鎹璞″姞鍏ュ垪琛�
+            documentExportWordDtoList.add(documentExportWordDto);
+        }
+    }
+
+    @Override
+    public void exportEquipmentDetails(HttpServletResponse response) {
+        List<Device> deviceList = baseMapper.selectList(null);
+        List<DeviceExport> deviceExportList = new ArrayList<>();
+
+        int index = 1;
+        for (Device device : deviceList) {
+            Integer equipmentManager = device.getEquipmentManager();
+            String equipmentManagerName = null;
+            if (equipmentManager != null) {
+                User user = userMapper.selectById(equipmentManager);
+                if (user != null) {
+                    equipmentManagerName = user.getName();
+                }
+            }
+            DeviceExport deviceExport = new DeviceExport();
+            BeanUtils.copyProperties(device, deviceExport);
+            deviceExport.setIndex(index);
+            deviceExport.setEquipmentManagerName(equipmentManagerName);
+            deviceExportList.add(deviceExport);
+            index++;
+        }
+
+        // 鑾峰彇璺緞
+        InputStream inputStream = this.getClass().getResourceAsStream("/static/word/quipment-details.docx");
+        Configure configure = Configure.builder()
+                .bind("deviceList", new HackLoopTableRenderPolicy())
+                .build();
+        XWPFTemplate template = XWPFTemplate.compile(inputStream, configure).render(
+                new HashMap<String, Object>() {{
+                    put("deviceList", deviceExportList);
+                }});
+
+        try {
+            response.setContentType("application/msword");
+            String fileName = URLEncoder.encode(
+                    "浠櫒璁惧涓�瑙堣〃", "UTF-8");
+            response.setHeader("Content-disposition",
+                    "attachment;filename=" + fileName + ".docx");
+            OutputStream os = response.getOutputStream();
+            template.write(os);
+            os.flush();
+            os.close();
+        } catch (Exception e) {
+            e.printStackTrace();
+            throw new RuntimeException("瀵煎嚭澶辫触");
+        }
     }
 }

--
Gitblit v1.9.3