|
@@ -12,6 +12,18 @@ import java.util.stream.Collectors;
|
|
|
|
|
|
public class LuckySheet4SummaryHelp {
|
|
|
|
|
|
+ /**
|
|
|
+ * 机号下班组
|
|
|
+ */
|
|
|
+ public static final String[] MACHINE_TITLE_COLS = {"状态", "施工部门", "施工分包商/班组", "责任部门", "责任分包商/班组", "完成日期"};
|
|
|
+
|
|
|
+ public static final String[] MAIN_TITLE_FIRST = { "总序号","监理编号","部位","内容" };
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 主标题下第二部门
|
|
|
+ */
|
|
|
+ public static final String[] MAIN_TITLE_SECOND = {"总状态","提出日期","整改期限","提出者","备注1","备注2"};
|
|
|
+
|
|
|
/**
|
|
|
* {
|
|
|
* "c": 0,
|
|
@@ -90,16 +102,14 @@ public class LuckySheet4SummaryHelp {
|
|
|
|
|
|
JSONArray result = new JSONArray();
|
|
|
|
|
|
- String[] cols = { "总序号","监理编号","部位","内容" };
|
|
|
-
|
|
|
- for(int m = 0, n = cols.length; m < n; m++) {
|
|
|
+ for(int m = 0, n = MAIN_TITLE_FIRST.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("m", MAIN_TITLE_FIRST[m]);
|
|
|
+ remark2v.put("v", MAIN_TITLE_FIRST[m]);
|
|
|
remark2v.put("bg", "rgb(204, 255, 204)");
|
|
|
remark2v.put("bl", 1);
|
|
|
remark2v.put("fc", "rgb(0, 0, 0)");
|
|
@@ -137,7 +147,7 @@ public class LuckySheet4SummaryHelp {
|
|
|
|
|
|
JSONArray result = new JSONArray();
|
|
|
|
|
|
- for(int m = 0; m < 4; m++) {
|
|
|
+ for(int m = 0; m < MAIN_TITLE_FIRST.length; m++) {
|
|
|
JSONObject temp = new JSONObject();
|
|
|
|
|
|
JSONObject mc2 = new JSONObject();
|
|
@@ -182,8 +192,7 @@ public class LuckySheet4SummaryHelp {
|
|
|
* @return
|
|
|
*/
|
|
|
public static JSONArray assembleCommonCol2(int startColPosition) {
|
|
|
- String[] cols = {"总状态","提出日期","整改期限","提出者","备注1","备注2"};
|
|
|
- return assembleSingleTitle(startColPosition, 2, cols);
|
|
|
+ return assembleSingleTitle(startColPosition, 2, MAIN_TITLE_SECOND);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -245,7 +254,7 @@ public class LuckySheet4SummaryHelp {
|
|
|
.startRowPos(1)
|
|
|
.startColPos(startColPosition)
|
|
|
.rowSize(1)
|
|
|
- .colSize(4)
|
|
|
+ .colSize(MACHINE_TITLE_COLS.length)
|
|
|
.value(cellName)
|
|
|
.build();
|
|
|
return assembleMergeTitle(cellParam);
|
|
@@ -258,8 +267,7 @@ public class LuckySheet4SummaryHelp {
|
|
|
* @return
|
|
|
*/
|
|
|
public static JSONArray assembleDeviceNumberSecondTitle(int startColPosition) {
|
|
|
- String[] cols = {"状态", "施工部门", "责任部门", "完成日期"};
|
|
|
- return assembleSingleTitle(startColPosition, 2,cols);
|
|
|
+ return assembleSingleTitle(startColPosition, 2, MACHINE_TITLE_COLS);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -482,7 +490,9 @@ public class LuckySheet4SummaryHelp {
|
|
|
public static JSONObject getMergeConfig(List<String> deviceNumberList) {
|
|
|
JSONObject result = new JSONObject();
|
|
|
|
|
|
- int colSize = deviceNumberList.size() * 4 + 10;
|
|
|
+ int colSize = deviceNumberList.size() * MACHINE_TITLE_COLS.length
|
|
|
+ + MAIN_TITLE_FIRST.length
|
|
|
+ + MAIN_TITLE_SECOND.length;
|
|
|
|
|
|
//第一行 标题
|
|
|
JSONObject row0Title = new JSONObject();
|
|
@@ -493,41 +503,22 @@ public class LuckySheet4SummaryHelp {
|
|
|
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 = MAIN_TITLE_FIRST.length; m < n; m++) {
|
|
|
+ JSONObject row1Col0Title = new JSONObject();
|
|
|
+ row1Col0Title.put("c", m);
|
|
|
+ row1Col0Title.put("r", 1);
|
|
|
+ row1Col0Title.put("cs", 1);
|
|
|
+ row1Col0Title.put("rs", 2);
|
|
|
+ result.put("1_".concat(String.valueOf(m)), row1Col0Title);
|
|
|
+ }
|
|
|
|
|
|
//第二行机号
|
|
|
for(int m = 0, n = deviceNumberList.size(); m < n; m++) {
|
|
|
JSONObject deviceNumObj = new JSONObject();
|
|
|
- int colPos = 4 + m * 4;
|
|
|
+ int colPos = MAIN_TITLE_FIRST.length + m * MACHINE_TITLE_COLS.length;
|
|
|
deviceNumObj.put("c", colPos);
|
|
|
deviceNumObj.put("r", 1);
|
|
|
- deviceNumObj.put("cs", 4);
|
|
|
+ deviceNumObj.put("cs", MACHINE_TITLE_COLS.length);
|
|
|
deviceNumObj.put("rs", 1);
|
|
|
result.put("1_".concat(String.valueOf(colPos)), deviceNumObj);
|
|
|
}
|
|
@@ -563,7 +554,9 @@ public class LuckySheet4SummaryHelp {
|
|
|
JSONArray result = new JSONArray();
|
|
|
|
|
|
//计算列行
|
|
|
- int rowsSize = 3, colsSize = 10 + deviceNumberList.size() * 4;
|
|
|
+ int rowsSize = 3, colsSize = deviceNumberList.size() * MACHINE_TITLE_COLS.length
|
|
|
+ + MAIN_TITLE_FIRST.length
|
|
|
+ + MAIN_TITLE_SECOND.length;;
|
|
|
|
|
|
//行
|
|
|
for(int m = 0; m < rowsSize; m++) {
|
|
@@ -613,7 +606,7 @@ public class LuckySheet4SummaryHelp {
|
|
|
String departChose = StringUtils.join(departList, ",");
|
|
|
|
|
|
for(int m = 0, n = paramExcelDto.getDeviceNumberList().size() - 1; m <= n; m++) {
|
|
|
- int colPos = 4 + m * 4;
|
|
|
+ int colPos = MAIN_TITLE_FIRST.length + m * MACHINE_TITLE_COLS.length;
|
|
|
// int departColPos = 4 + 4 * m;
|
|
|
for(int startRows = 3, endRows = 200; startRows < endRows; startRows++) {
|
|
|
|
|
@@ -652,12 +645,12 @@ public class LuckySheet4SummaryHelp {
|
|
|
|
|
|
//责任部门
|
|
|
JSONObject depart2Obj = getNewDataVerification(departChose);
|
|
|
- result.put(String.valueOf(startRows).concat("_").concat(String.valueOf(colPos + 2)), depart2Obj);
|
|
|
+ result.put(String.valueOf(startRows).concat("_").concat(String.valueOf(colPos + 3)), depart2Obj);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
//总状态
|
|
|
- int statusColIndex = 4 + paramExcelDto.getDeviceNumberList().size() * 4;
|
|
|
+ int statusColIndex = MAIN_TITLE_FIRST.length + paramExcelDto.getDeviceNumberList().size() * MACHINE_TITLE_COLS.length;
|
|
|
for(int startRows = 3, endRows = 200; startRows < endRows; startRows++) {
|
|
|
JSONObject statusObj = getNewDataVerification("OK,X,√");
|
|
|
result.put(String.valueOf(startRows).concat("_").concat(String.valueOf(statusColIndex)), statusObj);
|