From a0765e814de4526fdd4d949d7e34fcd7e8529ced Mon Sep 17 00:00:00 2001 From: Crunchy <3114200645@qq.com> Date: 星期五, 02 八月 2024 23:11:07 +0800 Subject: [PATCH] 数采调整·完成 --- cnas-server/src/main/java/com/yuanchu/mom/service/impl/DeviceServiceImpl.java | 1042 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 1,017 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 9e25d22..c78ea55 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,5 +1,8 @@ package com.yuanchu.mom.service.impl; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; import com.baomidou.mybatisplus.core.toolkit.Wrappers; @@ -7,13 +10,17 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.yuanchu.mom.common.GetLook; import com.yuanchu.mom.common.PrintChina; +import com.yuanchu.mom.dto.ADto; +import com.yuanchu.mom.dto.BDto; import com.yuanchu.mom.dto.DeviceDto; import com.yuanchu.mom.exception.ErrorException; import com.yuanchu.mom.mapper.DeviceMapper; import com.yuanchu.mom.mapper.StructureItemParameterMapper; +import com.yuanchu.mom.mapper.UserMapper; import com.yuanchu.mom.pojo.DataConfig; import com.yuanchu.mom.pojo.Device; import com.yuanchu.mom.pojo.StructureItemParameter; +import com.yuanchu.mom.pojo.User; import com.yuanchu.mom.service.DataConfigService; import com.yuanchu.mom.service.DeviceService; import com.yuanchu.mom.utils.DataAcquisition; @@ -22,12 +29,16 @@ import lombok.AllArgsConstructor; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import javax.script.ScriptEngine; +import javax.script.ScriptEngineManager; import javax.servlet.http.HttpServletRequest; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.math.BigDecimal; +import java.util.*; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import java.util.stream.Collectors; /** * 璁惧(Device)琛ㄦ湇鍔″疄鐜扮被 @@ -39,6 +50,8 @@ private GetLook getLook; private DeviceMapper deviceMapper; + + private UserMapper userMapper; private StructureItemParameterMapper structureItemParameterMapper; @@ -66,8 +79,11 @@ return deviceMapper.deleteById(id); } + @Transactional(rollbackFor = Exception.class) @Override public int upDeviceParameter(Device itemParameter) { + // 鍒犻櫎鏁伴噰闆嗛厤缃暟鎹� + dataConfigService.deleteDataConfig(); return deviceMapper.updateById(itemParameter); } @@ -116,11 +132,6 @@ String[] ids = device.getInsProductIds().split(","); for (String i : ids) { if (i.equals(id + "")) { - if (ObjectUtils.isEmpty(device.getFileType()) || ObjectUtils.isEmpty(device.getCollectUrl())) { - device.setIsItADataAcquisitionDevice(false); - } else { - device.setIsItADataAcquisitionDevice(true); - } devices2.add(device); break; } @@ -136,28 +147,1009 @@ @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) { + String str = ""; + for (Device device1 : device) { + str += device1.getDeviceName() + "锛�"; + } + throw new ErrorException("IP锛�" + ip + "閰嶇疆浜嗚澶囧涓澶囷細" + str + "锛屾棤娉曡繘琛屾暟閲囷紒"); + } if (ObjectUtils.isEmpty(device)) { throw new ErrorException("鏈粰璇P锛�" + ip + "閰嶇疆璁惧锛屾棤娉曡繘琛屾暟閲囷紒"); } - List<String> inspectionItemSubclass = baseMapper.getInspectionItemSubclass(id); - Map<String, String> hashMap = new HashMap<>(); - device.forEach(i -> { - if (ObjectUtils.isEmpty(i.getFileType()) || ObjectUtils.isEmpty(i.getCollectUrl())) { - throw new ErrorException("鏈粰璇ワ細" + i.getDeviceName() + "璁惧閰嶇疆閲囬泦璺緞鎴栨枃浠跺悗缂�锛�"); - } - List<DataConfig> list = dataConfigService.list(Wrappers.<DataConfig>lambdaQuery() - .eq(DataConfig::getDeviceId, i.getId()) - .in(DataConfig::getInsProductItem, inspectionItemSubclass) - .orderBy(false, false, DataConfig::getId)); - hashMap.putAll(DataAcquisition.dataAcquisitionEntrance(request, list, i, entrustCode, sampleCode, ip)); + List<Map<String, Object>> inspectionItemSubclass = baseMapper.getInspectionItemSubclass(id); + 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() + .eq(DataConfig::getDeviceId, device.get(0).getId()) + .eq(DataConfig::getInspectionItem, i.get("inspection_item")) + .eq(DataConfig::getInspectionItemSubclass, i.get("inspection_item_subclass")) + .orderBy(false, false, DataConfig::getId)); + list1.addAll(list); }); - String frequency = DataAcquisition.createFrequency(entrustCode, sampleCode); - hashMap.put("frequency", frequency); - return Result.success(hashMap); + // 3銆侀噰闆嗭紝鍙栨暟鎹紝鍙備笌鍏紡璁$畻 + Map<String, Object> map = DataAcquisition.dataAcquisitionEntrance(list1, device.get(0), entrustCode, sampleCode, ip); + // 4銆侀�犲惊鐜鏁� + if (ObjectUtils.isNotEmpty(map)) { + return Result.success(DataAcquisition.createFrequency(entrustCode, sampleCode, map)); + } else { + return Result.success(null); + } + } + + @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); + /* Map<String, List<Device>> listMap = devices.stream() + .collect(Collectors.groupingBy(device -> + device.getLargeCategory() != null ? device.getLargeCategory() : "鍏朵粬" + ));*/ + return listMap; + } + + @Override + public Result<?> determineWhetherToCollectData(String managementNumber, HttpServletRequest request) { + String ip = DataAcquisition.getIp(request); + Device device = baseMapper.selectOne(Wrappers.<Device>lambdaQuery() + .eq(Device::getManagementNumber, managementNumber) + .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 Object formulaCalculation(Map<String, Object> map) { + map.forEach((key, value) -> { + Map<String, Object> jsonObject = JSONObject.parseObject(JSON.toJSONString(map.get(key)), Map.class); + for (Map.Entry<String, Object> entry : jsonObject.entrySet()) { + String sonKey = entry.getKey(); + Object sonValue = entry.getValue(); + if (!sonKey.equals("frequency")) { + Map<String, Object> formulaData = JSONObject.parseObject(JSON.toJSONString(sonValue), Map.class); + if (formulaData.containsKey("result") && formulaData.containsKey("isCalculation") && + formulaData.containsKey("formula")) { + String formula = formulaData.get("formula").toString(); + Boolean isCalculation = Boolean.valueOf(formulaData.get("isCalculation").toString()); + if (isCalculation) { + List<Object> resultList = new ArrayList<>(); + try { + resultList = JSONObject.parseArray(JSON.toJSONString(formulaData.get("result")), Object.class); + } catch (Exception e) { + Object result = formulaData.get("result").toString(); + resultList.add(result); + } + ArrayList<Object> list = new ArrayList<>(); + resultList.forEach(i -> { + List<Object> strings = Arrays.asList(i.toString().split(",")); + String result = calculationFormula(strings, formula); + list.add(result); + }); + formulaData.put("isCalculation", false); + formulaData.put("result", list); + } + } + jsonObject.put(sonKey, formulaData); + } + } + map.put(key, jsonObject); + }); + return map; + } + + public String calculationFormula(List<Object> list, String formula) { + //棣栧厛灏唋ist杞崲涓篵igdecmic + List<BigDecimal> bigDecimalList = list.stream() + .map(obj -> { + return new BigDecimal((obj).toString()); + }).collect(Collectors.toList()); + System.out.println(bigDecimalList); + + //灏嗕腑鏂囩殑(杞崲鑻辨枃鐨�()) + formula = formula.replace("锛�", "(") + .replace("锛�", ")") + .replace("锛�", ","); + //鐒跺悗鎻愬彇鍏紡 + String strs = formula.substring(0, formula.indexOf("(")); + String upperStr = strs.toUpperCase(); + if (upperStr.matches(".*\\d.*")) { + upperStr = ""; + } + System.out.println(upperStr); + //鐒跺悗鑾峰彇鏈�澶栭潰鎷彿閲岄潰鐨勫��,鍐嶆牴鎹�","鍒嗗壊 + int start = formula.indexOf("("); + int end = -1; + int a = 0; + for (int i = start; i < formula.length(); i++) { + char c = formula.charAt(i); + if (c == '(') { + a++; + } else if (c == ')') { + a--; + if (a == 0) { + end = i; + } + } + } + if (start == -1 || end == -1) { + throw new ErrorException("鍏紡鎷彿涓嶅尮閰�: " + formula); + } + + String argumentsStr = formula.substring(start + 1, end); + List<String> arguments = new ArrayList<>(); + int bracketCount = 0; + StringBuilder currentArgument = new StringBuilder(); + for (char c : argumentsStr.toCharArray()) { + if (c == ',' && bracketCount == 0) { + arguments.add(currentArgument.toString()); + currentArgument.setLength(0); + } else { + if (c == '(') bracketCount++; + if (c == ')') bracketCount--; + currentArgument.append(c); + } + } + arguments.add(currentArgument.toString()); + String[] bracketStrs = arguments.toArray(new String[0]); + List<BigDecimal> results = new ArrayList<>(); + for (String expr : bracketStrs) { + System.out.println("鏇挎崲鍓�" + expr); + Pattern pattern = Pattern.compile("([A-Z])(\\d+)"); + Matcher matcher = pattern.matcher(expr); + StringBuffer sb = new StringBuffer(); + while (matcher.find()) { + String letter = matcher.group(1); + int index = Integer.parseInt(matcher.group(2)) - 1; // 灏�1-based杞负0-based + if (index < bigDecimalList.size()) { + matcher.appendReplacement(sb, bigDecimalList.get(index).toString()); + } else { + throw new RuntimeException("鍏紡涓殑涓嬫爣 " + index + " 瓒呭嚭鑼冨洿"); + } + } + matcher.appendTail(sb); + System.out.println("鏇挎崲鍚�" + sb.toString()); + + // 璁$畻琛ㄨ揪寮� + ScriptEngine engine = new ScriptEngineManager().getEngineByName("JavaScript"); + try { + Object result = engine.eval(sb.toString()); + results.add(new BigDecimal(result.toString())); + } catch (Exception e) { + throw new IllegalArgumentException("鏃犳硶璁$畻鍏紡: " + sb, e); + } + } + // 鏍规嵁鍑芥暟鍚嶇О杩涜鐩稿簲璁$畻 + BigDecimal finalResult; + if (upperStr.equals("") || upperStr == null) { + finalResult = results.get(0); + } else { + switch (upperStr) { + case "MAX": + finalResult = results.stream().max(BigDecimal::compareTo) + .orElseThrow(() -> new IllegalArgumentException("鏃犳硶璁$畻MAX鍊�")); + break; + case "MIN": + finalResult = results.stream().min(BigDecimal::compareTo) + .orElseThrow(() -> new IllegalArgumentException("鏃犳硶璁$畻MIN鍊�")); + break; + case "SUM": + finalResult = results.stream().reduce(BigDecimal.ZERO, BigDecimal::add); + break; + case "ABS": + finalResult = results.stream().map(BigDecimal::abs).reduce(BigDecimal.ZERO, BigDecimal::add); + break; + case "AVERAGE": + finalResult = results.stream().reduce(BigDecimal.ZERO, BigDecimal::divide) + .divide(BigDecimal.valueOf(results.size()), 2, BigDecimal.ROUND_HALF_UP); + break; + case "MEDIAN": + int size = results.size(); + if (size % 2 == 1) { + finalResult = results.get(size / 2); + } else { + BigDecimal sum = results.get(size / 2 - 1).add(results.get(size / 2)); + finalResult = sum.divide(BigDecimal.valueOf(2), 2, BigDecimal.ROUND_HALF_UP); + } + break; + default: + throw new UnsupportedOperationException("鏆備笉鏀寔鍑芥暟: " + upperStr); + } + } + System.out.println(results); + System.out.println("璁$畻缁撴灉: " + finalResult); + + return finalResult.toString(); + // 鍚﹀垯锛氭病鏈夊叕寮忎唬琛ㄤ笉闇�瑕佽绠楋紝鐩存帴鎻愬彇List閲岄潰鐨勬暟鎹� } } -- Gitblit v1.9.3