| | |
| | | for (File f : files) { |
| | | // 根据文件名查询id |
| | | String name = f.getName(); |
| | | InsReport insReport = insReportMapper.selectOne(Wrappers.<InsReport>lambdaQuery().like(InsReport::getCode, f.getName().replace(".docx", "").replace("JCZX", "JCZX/"))); |
| | | InsReport insReport = insReportMapper.selectOne(Wrappers.<InsReport>lambdaQuery().like(InsReport::getCode, f.getName().replace(".docx", ""))); |
| | | if (ObjectUtils.isEmpty(insReport)) { |
| | | throw new ErrorException("没有找到 " + f.getName() + " 这个文件对应的报告数据"); |
| | | } |
| | |
| | | List<SampleProductDto> samples = insSampleMapper.selectSampleProductListByOrderId(orderId); |
| | | String sampleCode = samples.get(0).getSampleCode(); |
| | | InsReport insReport = new InsReport(); |
| | | insReport.setCode(insOrder.getEntrustCode()); |
| | | insReport.setCode(insOrder.getEntrustCode().replace("WT","TXJC")); |
| | | insReport.setInsOrderId(orderId); |
| | | List<Map<String, Object>> tables = new ArrayList<>(); |
| | | Set<String> standardMethod = new HashSet<>(); |
| | |
| | | models.add(s.getModel()); |
| | | standardMethod.addAll(standardMethodListMapper.selectList(Wrappers.<StandardMethodList>lambdaQuery() |
| | | .in(StandardMethodList::getId,Arrays.stream(s.getStandardMethodListId().replaceAll("[\\[\\]]", "").split(",")) |
| | | .map(String::trim).map(Integer::parseInt).collect(Collectors.toList()))).stream().map(StandardMethodList::getCode).distinct().collect(Collectors.toList())); |
| | | .map(String::trim).map(Integer::parseInt).collect(Collectors.toList()))).stream().map(aa->{return aa.getCode()+" "+aa.getName();}).distinct().collect(Collectors.toList())); |
| | | //总数 |
| | | Long productCount = insProductMapper.selectCount(Wrappers.<InsProduct>lambdaQuery() |
| | | .eq(InsProduct::getInsSampleId, s.getId())); |
| | |
| | | } |
| | | StringBuilder standardMethod2 = new StringBuilder(); |
| | | for (String s : standardMethod) { |
| | | standardMethod2.append("、").append(s); |
| | | standardMethod2.append(";\n").append(s); |
| | | } |
| | | standardMethod2.append(";\n").append("GB/T 9410-2008 《移动通信天线通用技术规范》"); |
| | | standardMethod2.replace(0, 1, ""); |
| | | tables.forEach(table -> { |
| | | table.put("tableSize", tables.size() + 1); |
| | |
| | | } |
| | | // 返回最大值,确保高度不低于默认高度 |
| | | return Math.max(estimatedHeight, defaultHeight); |
| | | } |
| | | |
| | | private void getTemplateThing(Set<Integer> set, Map<Integer, String> map2, List<InsProduct> insProducts) { |
| | | for (InsProduct product : insProducts) { |
| | | if (product.getTemplateId() == null) { |
| | | product.setTemplate(new ArrayList<>()); |
| | | continue; |
| | | } |
| | | String thing = null; |
| | | if (product.getTemplateId() != null && set.add(product.getTemplateId())) { |
| | | map2.put(product.getTemplateId(), standardTemplateService.getStandTempThingById(product.getTemplateId()) + ""); |
| | | thing = map2.get(product.getTemplateId()); |
| | | } |
| | | if (StrUtil.isNotEmpty(thing)) { |
| | | JSONObject sheet = JSON.parseObject(JSON.toJSONString(JSON.parseArray(JSON.toJSONString(JSON.parseObject(thing).get("data"))).get(0))); |
| | | JSONObject config = JSON.parseObject(JSON.toJSONString(sheet.get("config"))); |
| | | List<JSONObject> cellData = JSON.parseArray(JSON.toJSONString(sheet.get("celldata")), JSONObject.class); |
| | | Map<String, Object> style = new HashMap<>(); |
| | | style.put("rowlen", config.get("rowlen")); |
| | | style.put("columnlen", config.get("columnlen")); |
| | | product.setTemplate(cellData); |
| | | product.setStyle(style); |
| | | product.setTemplateName(standardTemplateService.getStandTempNameById(product.getTemplateId())); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |