package com.ruoyi.requier.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.conditions.query.QueryWrapper; 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.ruoyi.basic.mapper.StructureItemParameterMapper; import com.ruoyi.basic.pojo.StructureItemParameter; import com.ruoyi.common.core.domain.Result; import com.ruoyi.common.core.domain.entity.SysDictData; import com.ruoyi.common.core.domain.entity.User; import com.ruoyi.common.utils.DictUtils; import com.ruoyi.common.utils.QueryWrappers; import com.ruoyi.common.utils.SecurityUtils; import com.ruoyi.framework.exception.ErrorException; import com.ruoyi.requier.dto.ADto; import com.ruoyi.requier.dto.BDto; import com.ruoyi.requier.dto.DeviceDto; import com.ruoyi.requier.mapper.DeviceMapper; import com.ruoyi.requier.pojo.DataConfig; import com.ruoyi.requier.pojo.Device; import com.ruoyi.requier.pojo.DeviceMetricRecord; import com.ruoyi.requier.service.DataConfigService; import com.ruoyi.requier.service.DeviceService; import com.ruoyi.requier.util.DataAcquisition; import com.ruoyi.system.mapper.UserMapper; import lombok.AllArgsConstructor; import org.apache.commons.lang3.StringUtils; import org.apache.logging.log4j.util.Strings; 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.time.LocalDateTime; import java.time.ZoneId; import java.util.*; import java.util.stream.Collectors; /** * 设备(Device)表服务实现类 */ @Service @AllArgsConstructor public class DeviceServiceImpl extends ServiceImpl implements DeviceService { private DeviceMapper deviceMapper; private UserMapper userMapper; private StructureItemParameterMapper structureItemParameterMapper; @Autowired private DataConfigService dataConfigService; @Autowired private QrShowServiceImpl qrShowService; @Override public List selectUserList() { List users = userMapper.selectList(new LambdaQueryWrapper().like(User::getDepartLimsId, "1")); return users; } @Override public List selectUserListByDepartLimsId(String departLimsId) { List users = userMapper.selectList(new LambdaQueryWrapper().like(User::getDepartLimsId, departLimsId)); return users; } @Override public IPage selectDeviceParameter(Page page, DeviceDto itemParameter, Boolean laboratoryNameIsNull) { IPage iPage = deviceMapper.selectDeviceParameterPage(page, QueryWrappers.queryWrappers(itemParameter), laboratoryNameIsNull); return iPage; } @Override public int addDeviceParameter(Device itemParameter) { return deviceMapper.insert(itemParameter); } @Override public int delDeviceParameter(Integer id) { return deviceMapper.deleteById(id); } @Transactional(rollbackFor = Exception.class) @Override public int upDeviceParameter(Device itemParameter) { // 删除数采集配置数据 dataConfigService.deleteDataConfig(); // 需要同时更改 device表 return deviceMapper.updateById(itemParameter); } @Override public List selectEquipmentOverview() { return deviceMapper.selectEquipmentOverview(new Page(1, 10), QueryWrappers.queryWrappers(new Device())); } @Override public List authorizedPerson() { return deviceMapper.authorizedPerson(); } @Override public List search(Integer status, String deviceName, String specificationModel, String largeCategory) { return deviceMapper.search(status, deviceName, specificationModel, largeCategory); } @Override public List selectDevicePrincipal() { return deviceMapper.selectDevicePrincipal(); } @Override public List selectDeviceByCategory(String inspectionItem, String inspectionItemSubclass,String sonLaboratory) { // Integer userId = getLook.selectPowerByMethodAndUserId(null).get("userId"); // User user = Optional.ofNullable(userMapper.selectById(userId)).orElse(new User()); // String departLimsId = user.getDepartLimsId(); // if(departLimsId.isEmpty()){ // // } List id; try { id = structureItemParameterMapper.selectList(Wrappers.lambdaQuery() .eq(StructureItemParameter::getInspectionItem, inspectionItem) .eq(ObjectUtils.isNotEmpty(inspectionItemSubclass),StructureItemParameter::getInspectionItemSubclass, inspectionItemSubclass) .eq(ObjectUtils.isNotEmpty(sonLaboratory),StructureItemParameter::getSonLaboratory,sonLaboratory) .select(StructureItemParameter::getId)).stream().map(StructureItemParameter::getId).collect(Collectors.toList()); // if () { //// id = structureItemParameterMapper.selectOne(Wrappers.lambdaQuery() //// .eq(StructureItemParameter::getInspectionItem, inspectionItem) //// .last("limit 1").select(StructureItemParameter::getId)).getId(); // // // }else { //// id = structureItemParameterMapper.selectOne(Wrappers.lambdaQuery() //// .eq(StructureItemParameter::getInspectionItem, inspectionItem) //// .eq(StructureItemParameter::getInspectionItemSubclass, inspectionItemSubclass) //// .last("limit 1").select(StructureItemParameter::getId)).getId(); // id = structureItemParameterMapper.selectList(Wrappers.lambdaQuery() // .eq(StructureItemParameter::getInspectionItem, inspectionItem) // // .select(StructureItemParameter::getId)).stream().map(StructureItemParameter::getId).collect(Collectors.toList()); // } } catch (Exception e) { return null; } List devices = deviceMapper.selectList(Wrappers.lambdaQuery() .eq(Device::getDeviceStatus, 0) .isNotNull(Device::getInsProductIds)); List devices2 = new ArrayList<>(); for (Device device : devices) { String[] ids = device.getInsProductIds().split(","); for (String i : ids) { if (ObjectUtils.isNotEmpty(i)) { if (id.contains(Integer.parseInt(i))) { devices2.add(device); break; } } } } return devices2; } @Override public DeviceDto selectDeviceByCode(Integer id) { DeviceDto deviceDto = deviceMapper.selectDeviceByCode(id); List 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(Objects.nonNull(calibrate.getNextCalibrationDate())){ deviceDto.setCalibrationServices(calibrate.getUnitOfMeasure()); deviceDto.setNextCalibrationDate(calibrate.getNextCalibrationDate().toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime()); deviceDto.setLastCalibrationDate(calibrate.getCalibrationDate().toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime()); } // 到了停用日期,自动将状态改为停用 if(Objects.nonNull(deviceDto.getNextCalibrationDate()) && LocalDateTime.now().isAfter(deviceDto.getNextCalibrationDate())) { List enums = DictUtils.getDictCache("设备状态"); List status = enums.stream().filter(item -> item.getDictValue().equals("停用")).collect(Collectors.toList()); deviceDto.setDeviceStatus(Integer.parseInt(status.get(0).getDictValue())); deviceMapper.updateById(deviceDto); } return deviceDto; } /** * * @param request 取请求中的ip * @param id 检验样品 主键id * @param entrustCode 委托编号 * @param sampleCode 样品编号 * @param fiberOpticRibbon 光纤带编号 * @return */ @Override public Result dataAcquisition(HttpServletRequest request, Integer id, String entrustCode, String sampleCode, String fiberOpticRibbon) { // 防止回环地址变为IPv6 String ip = DataAcquisition.getIp(request); List device = baseMapper.selectList(Wrappers.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("未给该IP:" + ip + "配置设备,无法进行数采!"); } List> 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 list1 = new ArrayList<>(); inspectionItemSubclass.forEach(i -> { List list = dataConfigService.list(Wrappers.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); }); List collect = list1.stream().distinct().collect(Collectors.toList()); // 3、采集,取数据 Map map = DataAcquisition.dataAcquisitionEntrance(collect, device.get(0), entrustCode, sampleCode, ip, fiberOpticRibbon); // 4、造循环次数,参与公式计算 if (ObjectUtils.isNotEmpty(map)) { Map frequency = DataAcquisition.createFrequency(entrustCode, sampleCode,fiberOpticRibbon, map); return Result.success(frequency); } else { return Result.success(null); } } @Override public List menu() { //查询所有设备信息 List devices = baseMapper.selectList(null); List name = devices.stream().map(Device::getDeviceName).collect(Collectors.toList()); //查询所有用户信息 List users = userMapper.selectList(null); List 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: \"沟通和宣贯\",\n" + "\t\t\ti: \"font icon-erjidaohang\",\n" + "\t\t\tu: \"\",\n" + "\t\t\tg: \"G沟通和宣贯\",\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: \"设备档案\",\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 aDtos = JSONArray.parseArray(menu, ADto.class); List 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> treeDevice(String deviceName) { List> listMap = deviceMapper.treeDevice(deviceName); return listMap; } @Override public Result determineWhetherToCollectData(String managementNumber, HttpServletRequest request) { String ip = DataAcquisition.getIp(request); List device = baseMapper.selectList(Wrappers.lambdaQuery() .eq(Device::getIp, ip)); if (ObjectUtils.isEmpty(device)) { return Result.success(false); } if (ObjectUtils.isEmpty(device.get(0).getFileType()) || ObjectUtils.isEmpty(device.get(0).getCollectUrl())) { return Result.success(false); } else { return Result.success(true); } } @Override public void exportData(DeviceDto deviceDto, HttpServletResponse response){ //查询导出的费用统计数据 // String dates = deviceDto.getDates(); // String[] split = dates.replaceAll("\\[", "").replaceAll("]", "").replaceAll("\"", "").split(","); // deviceDto.setDates(null); // List deviceDtos = deviceMapper.selectList(QueryWrappers.queryWrappers(deviceDto).ge("create_time", split[0]).le("create_time", split[1] + " 23:59:59")); // deviceDtos = deviceDtos.stream().map(dto -> { // Set uniqueTags = new HashSet<>(); // if (dto.getInspectionItem().contains(",")) { // for (String s : dto.getInspectionItem().split(",")) { // uniqueTags.add(s.split("@")[0]); // } // } else { // uniqueTags.add(dto.getInspectionItem().split("@")[0]); // } // dto.setInspectionItem(uniqueTags.toString()); // return dto; // }).collect(Collectors.toList()); // // response.setContentType("application/vnd.ms-excel"); // response.setCharacterEncoding("UTF-8"); // // 这里URLEncoder.encode可以防止中文乱码 当然和easyexcel没有关系 // String fileName = URLEncoder.encode("样品费用统计导出", "UTF-8"); // response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx"); // Map> groupByCompany = // deviceDtos.stream().filter(e -> StrUtil.isNotEmpty(e.getCompany())) // .collect(Collectors.groupingBy(CostStatisticsDto::getCompany)); // try { // // 新建ExcelWriter // // 新建ExcelWriter // ExcelWriter excelWriter = // EasyExcel.write(response.getOutputStream()) // .registerWriteHandler(new SimpleColumnWidthStyleStrategy(25)) // .build(); // for (Map.Entry> companyDataEntry : groupByCompany.entrySet()) { // String sheetName = companyDataEntry.getKey(); // List dataList = companyDataEntry.getValue(); // WriteSheet mainSheet = EasyExcel.writerSheet(sheetName) // .head(CostStatisticsDto.class) // .registerWriteHandler(new SimpleColumnWidthStyleStrategy(25)) // .build(); // excelWriter.write(dataList, mainSheet); // } // // 关闭流 // excelWriter.finish(); // } catch (IOException e) { // throw new RuntimeException("导出失败"); // } } }