diff --git a/report-core/src/main/java/com/anjiplus/template/gaea/business/modules/reportexcel/service/impl/ReportExcelServiceImpl.java b/report-core/src/main/java/com/anjiplus/template/gaea/business/modules/reportexcel/service/impl/ReportExcelServiceImpl.java index 1551f51d9484ec40a8e4e1c7803ae5ebe4cf1b00..37efe3dfa500330da02fdb16754ae40bcbb74c19 100644 --- a/report-core/src/main/java/com/anjiplus/template/gaea/business/modules/reportexcel/service/impl/ReportExcelServiceImpl.java +++ b/report-core/src/main/java/com/anjiplus/template/gaea/business/modules/reportexcel/service/impl/ReportExcelServiceImpl.java @@ -819,30 +819,43 @@ public class ReportExcelServiceImpl implements ReportExcelService { String cellV2 = cellObject.getJSONObject("v").getString("v"); String auto = cellObject.getJSONObject("v").getString("auto"); JSONObject mc = cellObject.getJSONObject("v").getJSONObject("mc"); - if(cellV2.contains("#{") && cellV2.contains("}") ){ + if (cellV2.contains("#{") && cellV2.contains("}")) { //动态单元格 - if(mc != null){ + if (mc != null) { return CellType.DYNAMIC_MERGE; - }else{ + } else { return CellType.DYNAMIC; } - }else{ + } else { //静态单元格 - if(mc != null && "1".equals(auto)){ + if (mc != null && "1".equals(auto)) { return CellType.STATIC_MERGE_AUTO; - }else { - if("1".equals(auto)){ + } else { + if ("1".equals(auto)) { return CellType.STATIC_AUTO; - }else if(mc != null){ + } else if (mc != null) { return CellType.STATIC_MERGE; - }else{ + } else { return CellType.STATIC; } } } - }else{ - return CellType.BLACK; +// }else{ +// return CellType.BLACK; +// } + } + /** + * 合并单元格 + */ + if(null != cellV1 && cellV1.containsKey("ct")&& cellV1.containsKey("mc")){ + JSONObject ct = cellV1.getJSONObject("ct"); + JSONObject mc = cellV1.getJSONObject("mc"); + JSONArray s = ct.getJSONArray("s"); + if(!ct.isEmpty() && !mc.isEmpty() && !s.isEmpty()){ + return CellType.STATIC_MERGE; + } } + return CellType.BLACK; } /**