| | |
| | | // 返回最大值,确保高度不低于默认高度 |
| | | 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())); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | |