|
@@ -0,0 +1,636 @@
|
|
|
+package com.rongwei.bscommon.sys.utils;
|
|
|
+
|
|
|
+import com.alibaba.fastjson.JSONArray;
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.rongwei.bsentity.dto.luckysheet.AssembleCellParam;
|
|
|
+import com.rongwei.bsentity.dto.project.ProjectSummaryParamExcelDto;
|
|
|
+import com.rongwei.bsentity.dto.project.SheetInfoParam;
|
|
|
+
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+public class LuckySheet4SummaryHelp {
|
|
|
+
|
|
|
+ /**
|
|
|
+ * {
|
|
|
+ * "c": 0,
|
|
|
+ * "r": 0,
|
|
|
+ * "v": {
|
|
|
+ * "m": "1002000938马士基埃及桥吊项目整改文字版",
|
|
|
+ * "v": "1002000938马士基埃及桥吊项目整改文字版",
|
|
|
+ * "bg": "rgb(51, 102, 255)",
|
|
|
+ * "bl": 1,
|
|
|
+ * "ct": {
|
|
|
+ * "t": "g",
|
|
|
+ * "fa": "General"
|
|
|
+ * },
|
|
|
+ * "fc": "rgb(0, 0, 0)",
|
|
|
+ * "ff": 5,
|
|
|
+ * "fs": 16,
|
|
|
+ * "ht": 0,
|
|
|
+ * "it": 0,
|
|
|
+ * "mc": {
|
|
|
+ * "c": 0,
|
|
|
+ * "r": 0,
|
|
|
+ * "cs": 58,
|
|
|
+ * "rs": 1
|
|
|
+ * },
|
|
|
+ * "vt": 0* }
|
|
|
+ * }
|
|
|
+ *
|
|
|
+ * @param fileName
|
|
|
+ * @param colSize
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public static JSONArray assembleFirstTitle(String fileName, int colSize) {
|
|
|
+
|
|
|
+ AssembleCellParam cellParam = AssembleCellParam.builder()
|
|
|
+ .fontsize(16)
|
|
|
+ .startRowPos(0)
|
|
|
+ .startColPos(0)
|
|
|
+ .rowSize(1)
|
|
|
+ .colSize(colSize)
|
|
|
+ .value(fileName)
|
|
|
+ .build();
|
|
|
+ return assembleMergeTitle(cellParam);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * {
|
|
|
+ * "c": 0,
|
|
|
+ * "r": 1,
|
|
|
+ * "v": {
|
|
|
+ * "m": "总序号",
|
|
|
+ * "v": "总序号",
|
|
|
+ * "bg": "rgb(204, 255, 204)",
|
|
|
+ * "bl": 0,
|
|
|
+ * "ct": {
|
|
|
+ * "t": "g",
|
|
|
+ * "fa": "General"
|
|
|
+ * },
|
|
|
+ * "fc": "rgb(0, 0, 0)",
|
|
|
+ * "ff": 5,
|
|
|
+ * "fs": 11,
|
|
|
+ * "ht": 0,
|
|
|
+ * "it": 0,
|
|
|
+ * "mc": {
|
|
|
+ * "c": 0,
|
|
|
+ * "r": 1,
|
|
|
+ * "cs": 1,
|
|
|
+ * "rs": 2
|
|
|
+ * },
|
|
|
+ * "vt": 0
|
|
|
+ * }
|
|
|
+ * }
|
|
|
+ *
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public static JSONArray assembleCommonCol1() {
|
|
|
+
|
|
|
+ JSONArray result = new JSONArray();
|
|
|
+
|
|
|
+ String[] cols = { "总序号","监理编号","部位","内容" };
|
|
|
+
|
|
|
+ for(int m = 0, n = cols.length; m < n; m++) {
|
|
|
+ //一级标题
|
|
|
+ JSONObject remark2 = new JSONObject();
|
|
|
+ remark2.put("c", m);
|
|
|
+ remark2.put("r", 1);
|
|
|
+ JSONObject remark2v = new JSONObject();
|
|
|
+ remark2v.put("m", cols[m]);
|
|
|
+ remark2v.put("v", cols[m]);
|
|
|
+ remark2v.put("bg", "rgb(204, 255, 204)");
|
|
|
+ remark2v.put("bl", 1);
|
|
|
+ remark2v.put("fc", "rgb(0, 0, 0)");
|
|
|
+ remark2v.put("ff", 5);
|
|
|
+ remark2v.put("fs", 11);
|
|
|
+ remark2v.put("ht", 0);
|
|
|
+ remark2v.put("it", 0);
|
|
|
+ remark2v.put("vt", 1);
|
|
|
+
|
|
|
+ JSONObject ct = new JSONObject();
|
|
|
+ ct.put("t", "g");
|
|
|
+ ct.put("fa", "General");
|
|
|
+ remark2v.put("ct", ct);
|
|
|
+
|
|
|
+ JSONObject mc = new JSONObject();
|
|
|
+ mc.put("c", m);
|
|
|
+ mc.put("r", 1);
|
|
|
+ mc.put("cs", 1);
|
|
|
+ mc.put("rs", 2);
|
|
|
+ remark2v.put("mc", mc);
|
|
|
+
|
|
|
+ remark2.put("v", remark2v);
|
|
|
+ result.add(remark2);
|
|
|
+ }
|
|
|
+
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 第三行开头
|
|
|
+ *
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public static JSONArray assembleCommonRow2Col1() {
|
|
|
+
|
|
|
+ JSONArray result = new JSONArray();
|
|
|
+
|
|
|
+ for(int m = 0; m < 4; m++) {
|
|
|
+ JSONObject temp = new JSONObject();
|
|
|
+
|
|
|
+ JSONObject mc2 = new JSONObject();
|
|
|
+ mc2.put("c", m);
|
|
|
+ mc2.put("r", 1);
|
|
|
+
|
|
|
+ JSONObject v = new JSONObject();
|
|
|
+ v.put("mc", mc2);
|
|
|
+
|
|
|
+ temp.put("c", m);
|
|
|
+ temp.put("r", 2);
|
|
|
+ temp.put("v", v);
|
|
|
+ result.add(temp);
|
|
|
+ }
|
|
|
+
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 状态 提出日期 整改期限 提出者 备注1 备注2
|
|
|
+ * {
|
|
|
+ * "c": 57,
|
|
|
+ * "r": 2,
|
|
|
+ * "v": {
|
|
|
+ * "m": "备注2",
|
|
|
+ * "v": "备注2",
|
|
|
+ * "bl": 1,
|
|
|
+ * "ct": {
|
|
|
+ * "t": "g",
|
|
|
+ * "fa": "General"
|
|
|
+ * },
|
|
|
+ * "fc": "rgb(0, 0, 0)",
|
|
|
+ * "ff": 5,
|
|
|
+ * "fs": 11,
|
|
|
+ * "ht": 0,
|
|
|
+ * "it": 0,
|
|
|
+ * "vt": 1
|
|
|
+ * }
|
|
|
+ * }
|
|
|
+ *
|
|
|
+ * @param startColPosition 起始位置
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public static JSONArray assembleCommonCol2(int startColPosition) {
|
|
|
+ String[] cols = {"状态","提出日期","整改期限","提出者","备注1","备注2"};
|
|
|
+ return assembleSingleTitle(startColPosition, 2, cols);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 第二行最后六个
|
|
|
+ * {
|
|
|
+ * "c": 56,
|
|
|
+ * "r": 1,
|
|
|
+ * "v": {
|
|
|
+ * "m": "",
|
|
|
+ * "bg": "rgb(204, 255, 204)",
|
|
|
+ * "bl": 1,
|
|
|
+ * "fc": "rgb(0, 0, 0)",
|
|
|
+ * "ff": 5,
|
|
|
+ * "fs": 11,
|
|
|
+ * "ht": 0,
|
|
|
+ * "it": 0,
|
|
|
+ * "vt": 0
|
|
|
+ * }
|
|
|
+ * }
|
|
|
+ *
|
|
|
+ * @param startColPosition
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public static JSONArray assembleCommonRow1Col2(int startColPosition) {
|
|
|
+
|
|
|
+ JSONArray result = new JSONArray();
|
|
|
+
|
|
|
+ for(int m = 0, n = 6; m < n; m++) {
|
|
|
+ //备注2
|
|
|
+ JSONObject remark2 = new JSONObject();
|
|
|
+ remark2.put("c", startColPosition + m);
|
|
|
+ remark2.put("r", 1);
|
|
|
+
|
|
|
+ JSONObject remark2v = new JSONObject();
|
|
|
+ remark2v.put("m", "");
|
|
|
+ remark2v.put("bl", 1);
|
|
|
+ remark2v.put("fc", "rgb(0, 0, 0)");
|
|
|
+ remark2v.put("ff", 5);
|
|
|
+ remark2v.put("fs", 11);
|
|
|
+ remark2v.put("ht", 0);
|
|
|
+ remark2v.put("it", 0);
|
|
|
+ remark2v.put("vt", 0);
|
|
|
+
|
|
|
+ remark2.put("v", remark2v);
|
|
|
+ result.add(remark2);
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 机号一级标题
|
|
|
+ *
|
|
|
+ * @param startColPosition
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public static JSONArray genDeviceNumberFirstTitle(String cellName, int startColPosition) {
|
|
|
+ AssembleCellParam cellParam = AssembleCellParam.builder()
|
|
|
+ .fontsize(11)
|
|
|
+ .startRowPos(1)
|
|
|
+ .startColPos(startColPosition)
|
|
|
+ .rowSize(1)
|
|
|
+ .colSize(4)
|
|
|
+ .value(cellName)
|
|
|
+ .build();
|
|
|
+ return assembleMergeTitle(cellParam);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 生成机号标题
|
|
|
+ *
|
|
|
+ * @param startColPosition
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public static JSONArray assembleDeviceNumberSecondTitle(int startColPosition) {
|
|
|
+ String[] cols = {"状态", "施工部门", "责任部门", "完成日期"};
|
|
|
+ return assembleSingleTitle(startColPosition, 2,cols);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 生成单个单元格
|
|
|
+ *
|
|
|
+ * @param startColPosition
|
|
|
+ * @param cols
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public static JSONArray assembleSingleTitle(int startColPosition, int startRowPosition, String[] cols) {
|
|
|
+
|
|
|
+ JSONArray result = new JSONArray();
|
|
|
+
|
|
|
+ for(int m = 0, n = cols.length; m < n; m++) {
|
|
|
+ //备注2
|
|
|
+ JSONObject remark2 = new JSONObject();
|
|
|
+ remark2.put("c", startColPosition + m);
|
|
|
+ remark2.put("r", startRowPosition);
|
|
|
+ JSONObject remark2v = new JSONObject();
|
|
|
+ remark2v.put("m", cols[m]);
|
|
|
+ remark2v.put("v", cols[m]);
|
|
|
+ remark2v.put("bl", 1);
|
|
|
+ remark2v.put("fc", "rgb(0, 0, 0)");
|
|
|
+ remark2v.put("ff", 5);
|
|
|
+ remark2v.put("fs", 11);
|
|
|
+ remark2v.put("ht", 0);
|
|
|
+ remark2v.put("it", 0);
|
|
|
+ remark2v.put("vt", 1);
|
|
|
+ JSONObject ct = new JSONObject();
|
|
|
+ ct.put("t", "g");
|
|
|
+ ct.put("fa", "General");
|
|
|
+ remark2v.put("ct", ct);
|
|
|
+ remark2.put("v", remark2v);
|
|
|
+ result.add(remark2);
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 组装合并单元格
|
|
|
+ *
|
|
|
+ * @param param
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public static JSONArray assembleMergeTitle(AssembleCellParam param) {
|
|
|
+ JSONArray result = new JSONArray();
|
|
|
+ //一级标题
|
|
|
+ JSONObject remark2 = new JSONObject();
|
|
|
+ remark2.put("c", param.getStartColPos());
|
|
|
+ remark2.put("r", param.getStartRowPos());
|
|
|
+ JSONObject remark2v = new JSONObject();
|
|
|
+ remark2v.put("m", param.getValue());
|
|
|
+ remark2v.put("v", param.getValue());
|
|
|
+ remark2v.put("bl", 1);
|
|
|
+ remark2v.put("fc", "rgb(0, 0, 0)");
|
|
|
+ remark2v.put("ff", 5);
|
|
|
+ remark2v.put("fs", param.getFontsize());
|
|
|
+ remark2v.put("ht", 0);
|
|
|
+ remark2v.put("it", 0);
|
|
|
+ remark2v.put("vt", 1);
|
|
|
+ JSONObject ct = new JSONObject();
|
|
|
+ ct.put("t", "g");
|
|
|
+ ct.put("fa", "General");
|
|
|
+ remark2v.put("ct", ct);
|
|
|
+
|
|
|
+ JSONObject mc = new JSONObject();
|
|
|
+ mc.put("c", param.getStartColPos());
|
|
|
+ mc.put("r", param.getStartRowPos());
|
|
|
+ mc.put("cs", param.getColSize());
|
|
|
+ mc.put("rs", param.getRowSize());
|
|
|
+ remark2v.put("mc", mc);
|
|
|
+
|
|
|
+ remark2.put("v", remark2v);
|
|
|
+ result.add(remark2);
|
|
|
+
|
|
|
+ /**
|
|
|
+ * {
|
|
|
+ * "c": 1,
|
|
|
+ * "r": 0,
|
|
|
+ * "v": {
|
|
|
+ * "mc": {
|
|
|
+ * "c": 0,
|
|
|
+ * "r": 0
|
|
|
+ * }
|
|
|
+ * }
|
|
|
+ * }
|
|
|
+ */
|
|
|
+ for(int m = 1; m < param.getColSize(); m++) {
|
|
|
+ JSONObject temp = new JSONObject();
|
|
|
+
|
|
|
+ JSONObject mc2 = new JSONObject();
|
|
|
+ mc2.put("c", param.getStartColPos());
|
|
|
+ mc2.put("r", param.getStartRowPos());
|
|
|
+
|
|
|
+ JSONObject v = new JSONObject();
|
|
|
+ v.put("mc", mc2);
|
|
|
+
|
|
|
+ temp.put("c", m + param.getStartColPos());
|
|
|
+ temp.put("r", param.getStartRowPos());
|
|
|
+ temp.put("v", v);
|
|
|
+ result.add(temp);
|
|
|
+ }
|
|
|
+
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取空的sheet对象
|
|
|
+ *
|
|
|
+ * {
|
|
|
+ * "row": 84,
|
|
|
+ * "name": "Sheet2",
|
|
|
+ * "chart": [],
|
|
|
+ * "color": "",
|
|
|
+ * "index": "2",
|
|
|
+ * "order": 1,
|
|
|
+ * "column": 60,
|
|
|
+ * "config": {},
|
|
|
+ * "status": 0,
|
|
|
+ * "celldata": [],
|
|
|
+ * "ch_width": 4748,
|
|
|
+ * "rowsplit": [],
|
|
|
+ * "rh_height": 1790,
|
|
|
+ * "scrollTop": 0,
|
|
|
+ * "scrollLeft": 0,
|
|
|
+ * "visibledatarow": [],
|
|
|
+ * "visibledatacolumn": [],
|
|
|
+ * "jfgird_select_save": [{
|
|
|
+ * "row": [4, 4],
|
|
|
+ * "top": 85,
|
|
|
+ * "left": 0,
|
|
|
+ * "width": 73,
|
|
|
+ * "column": [0, 0],
|
|
|
+ * "height": 19,
|
|
|
+ * "top_move": 85,
|
|
|
+ * "left_move": 0,
|
|
|
+ * "row_focus": 4,
|
|
|
+ * "width_move": 73,
|
|
|
+ * "height_move": 19,
|
|
|
+ * "column_focus": 0
|
|
|
+ * }],
|
|
|
+ * "jfgrid_selection_range": {}
|
|
|
+ * }
|
|
|
+ *
|
|
|
+ * @param param
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public static JSONObject getEmptySheet(SheetInfoParam param) {
|
|
|
+ JSONObject obj = new JSONObject();
|
|
|
+ obj.put("row", 84);
|
|
|
+ obj.put("name", param.getSheetName());
|
|
|
+ obj.put("chart", new JSONArray());
|
|
|
+ obj.put("color", "");
|
|
|
+ obj.put("index", param.getIndex());
|
|
|
+ obj.put("order", param.getOrder());
|
|
|
+ obj.put("column", 60);
|
|
|
+ obj.put("config", new JSONObject());
|
|
|
+ obj.put("status", 0);
|
|
|
+ obj.put("celldata", new JSONArray());
|
|
|
+ obj.put("ch_width", 4748);
|
|
|
+ obj.put("rowsplit", new JSONArray());
|
|
|
+ obj.put("rh_height", 1790);
|
|
|
+ obj.put("scrollTop", 0);
|
|
|
+ obj.put("scrollLeft", 0);
|
|
|
+ obj.put("dataVerification", new JSONObject());
|
|
|
+ obj.put("visibledatarow", new JSONArray());
|
|
|
+ obj.put("visibledatacolumn", new JSONArray());
|
|
|
+
|
|
|
+ /**
|
|
|
+ * {
|
|
|
+ * "row": [4, 4],
|
|
|
+ * "top": 85,
|
|
|
+ * "left": 0,
|
|
|
+ * "width": 73,
|
|
|
+ * "column": [0, 0],
|
|
|
+ * "height": 19,
|
|
|
+ * "top_move": 85,
|
|
|
+ * "left_move": 0,
|
|
|
+ * "row_focus": 4,
|
|
|
+ * "width_move": 73,
|
|
|
+ * "height_move": 19,
|
|
|
+ * "column_focus": 0
|
|
|
+ * }
|
|
|
+ */
|
|
|
+ JSONObject selectSave = new JSONObject();
|
|
|
+ selectSave.put("row", new String[]{"4", "4"});
|
|
|
+ selectSave.put("top", 85);
|
|
|
+ selectSave.put("left", 0);
|
|
|
+ selectSave.put("width", 73);
|
|
|
+ selectSave.put("column", new String[]{"0", "0"});
|
|
|
+ selectSave.put("height", 19);
|
|
|
+ selectSave.put("top_move", 85);
|
|
|
+ selectSave.put("left_move", 0);
|
|
|
+ selectSave.put("row_focus", 4);
|
|
|
+ selectSave.put("width_move", 73);
|
|
|
+ selectSave.put("height_move", 19);
|
|
|
+ selectSave.put("column_focus", 0);
|
|
|
+
|
|
|
+ JSONArray selectSaves = new JSONArray();
|
|
|
+ selectSaves.add(selectSave);
|
|
|
+
|
|
|
+ obj.put("jfgird_select_save", selectSaves);
|
|
|
+ obj.put("jfgrid_selection_range", new JSONObject());
|
|
|
+
|
|
|
+ return obj;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取合并配置
|
|
|
+ * "0_0": {
|
|
|
+ * "c": 0,
|
|
|
+ * "r": 0,
|
|
|
+ * "cs": 58,
|
|
|
+ * "rs": 1
|
|
|
+ * },
|
|
|
+ *
|
|
|
+ * @param deviceNumberList
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public static JSONObject getMergeConfig(List<String> deviceNumberList) {
|
|
|
+ JSONObject result = new JSONObject();
|
|
|
+
|
|
|
+ int colSize = deviceNumberList.size() * 4 + 10;
|
|
|
+
|
|
|
+ //第一行 标题
|
|
|
+ JSONObject row0Title = new JSONObject();
|
|
|
+ row0Title.put("c", 0);
|
|
|
+ row0Title.put("r", 0);
|
|
|
+ row0Title.put("cs", colSize);
|
|
|
+ row0Title.put("rs", 1);
|
|
|
+ result.put("0_0", row0Title);
|
|
|
+
|
|
|
+ //第二行 前4列
|
|
|
+ JSONObject row1Col0Title = new JSONObject();
|
|
|
+ row1Col0Title.put("c", 0);
|
|
|
+ row1Col0Title.put("r", 1);
|
|
|
+ row1Col0Title.put("cs", 1);
|
|
|
+ row1Col0Title.put("rs", 2);
|
|
|
+ result.put("1_0", row1Col0Title);
|
|
|
+
|
|
|
+ JSONObject row1Col1Title = new JSONObject();
|
|
|
+ row1Col1Title.put("c", 1);
|
|
|
+ row1Col1Title.put("r", 1);
|
|
|
+ row1Col1Title.put("cs", 1);
|
|
|
+ row1Col1Title.put("rs", 2);
|
|
|
+ result.put("1_1", row1Col1Title);
|
|
|
+
|
|
|
+ JSONObject row1Col2Title = new JSONObject();
|
|
|
+ row1Col2Title.put("c", 2);
|
|
|
+ row1Col2Title.put("r", 1);
|
|
|
+ row1Col2Title.put("cs", 1);
|
|
|
+ row1Col2Title.put("rs", 2);
|
|
|
+ result.put("1_2", row1Col2Title);
|
|
|
+
|
|
|
+ JSONObject row1Col3Title = new JSONObject();
|
|
|
+ row1Col3Title.put("c", 3);
|
|
|
+ row1Col3Title.put("r", 1);
|
|
|
+ row1Col3Title.put("cs", 1);
|
|
|
+ row1Col3Title.put("rs", 2);
|
|
|
+ result.put("1_3", row1Col3Title);
|
|
|
+
|
|
|
+ //第二行机号
|
|
|
+ for(int m = 0, n = deviceNumberList.size(); m < n; m++) {
|
|
|
+ JSONObject deviceNumObj = new JSONObject();
|
|
|
+ int colPos = 4 + m * 4;
|
|
|
+ deviceNumObj.put("c", colPos);
|
|
|
+ deviceNumObj.put("r", 1);
|
|
|
+ deviceNumObj.put("cs", 4);
|
|
|
+ deviceNumObj.put("rs", 1);
|
|
|
+ result.put("1_".concat(String.valueOf(colPos)), deviceNumObj);
|
|
|
+ }
|
|
|
+
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * {
|
|
|
+ * "value": {
|
|
|
+ * "b": {
|
|
|
+ * "color": "rgb(0, 0, 0)",
|
|
|
+ * "style": 1
|
|
|
+ * },
|
|
|
+ * "l": {
|
|
|
+ * "color": "rgb(0, 0, 0)",
|
|
|
+ * "style": 1
|
|
|
+ * },
|
|
|
+ * "t": {
|
|
|
+ * "color": "rgb(0, 0, 0)",
|
|
|
+ * "style": 1
|
|
|
+ * },
|
|
|
+ * "col_index": 0,
|
|
|
+ * "row_index": 0
|
|
|
+ * },
|
|
|
+ * "rangeType": "cell"
|
|
|
+ * }
|
|
|
+ *
|
|
|
+ * @param deviceNumberList
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public static JSONArray getBorderInfo(List<String> deviceNumberList) {
|
|
|
+ JSONArray result = new JSONArray();
|
|
|
+
|
|
|
+ //计算列行
|
|
|
+ int rowsSize = 3, colsSize = 10 + deviceNumberList.size() * 4;
|
|
|
+
|
|
|
+ //行
|
|
|
+ for(int m = 0; m < rowsSize; m++) {
|
|
|
+ for(int n = 0; n < colsSize; n++) {
|
|
|
+ JSONObject value = new JSONObject();
|
|
|
+ JSONObject b = new JSONObject();
|
|
|
+ b.put("color", "rgb(0, 0, 0)");
|
|
|
+ b.put("style", 1);
|
|
|
+ value.put("b", b);
|
|
|
+
|
|
|
+ JSONObject l = new JSONObject();
|
|
|
+ l.put("color", "rgb(0, 0, 0)");
|
|
|
+ l.put("style", 1);
|
|
|
+ value.put("l", l);
|
|
|
+
|
|
|
+ JSONObject t = new JSONObject();
|
|
|
+ t.put("color", "rgb(0, 0, 0)");
|
|
|
+ t.put("style", 1);
|
|
|
+ value.put("t", t);
|
|
|
+
|
|
|
+ value.put("col_index", n);
|
|
|
+ value.put("row_index", m);
|
|
|
+
|
|
|
+ JSONObject obj = new JSONObject();
|
|
|
+ obj.put("rangeType", "cell");
|
|
|
+ obj.put("value", value);
|
|
|
+ result.add(obj);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 数据校验
|
|
|
+ *
|
|
|
+ * @param paramExcelDto
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public static JSONObject getDataVerification(ProjectSummaryParamExcelDto paramExcelDto) {
|
|
|
+ JSONObject result = new JSONObject();
|
|
|
+ for(int m = 0, n = paramExcelDto.getDeviceNumberList().size(); m <= n; m++) {
|
|
|
+ int colPos = 4 + m * 4;
|
|
|
+ for(int startRows = 3, endRows = 200; startRows < endRows; startRows++) {
|
|
|
+ /**
|
|
|
+ * "3_4": {
|
|
|
+ * "type": "dropdown",
|
|
|
+ * "remote": false,
|
|
|
+ * "value1": "OK,X,√",
|
|
|
+ * "value2": "",
|
|
|
+ * "checked": false,
|
|
|
+ * "hintShow": false,
|
|
|
+ * "hintText": "",
|
|
|
+ * "prohibitInput": false
|
|
|
+ * }
|
|
|
+ */
|
|
|
+ JSONObject statusObj = new JSONObject();
|
|
|
+ statusObj.put("type", "dropdown");
|
|
|
+ statusObj.put("remote", false);
|
|
|
+ statusObj.put("value1", "OK,X,√");
|
|
|
+ statusObj.put("value2", "");
|
|
|
+ statusObj.put("checked", false);
|
|
|
+ statusObj.put("hintShow", false);
|
|
|
+ statusObj.put("hintText", "");
|
|
|
+ statusObj.put("prohibitInput", false);
|
|
|
+ result.put(String.valueOf(startRows).concat("_").concat(String.valueOf(colPos)), statusObj);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+}
|