Commit 5958c8d6 authored by xinglei's avatar xinglei

*)修改导出报表bug

parent a3cfa3e0
...@@ -1332,47 +1332,91 @@ public class CheckServiceImpl implements ICheckService { ...@@ -1332,47 +1332,91 @@ public class CheckServiceImpl implements ICheckService {
String pointName = StringUtil.setStr(checkInputBo.getPlanTaskId(), checkInputBo.getPointName()); String pointName = StringUtil.setStr(checkInputBo.getPlanTaskId(), checkInputBo.getPointName());
String classifyName = StringUtil.setStr(checkInputBo.getPlanTaskId(), checkInputBo.getClassifyName()); String classifyName = StringUtil.setStr(checkInputBo.getPlanTaskId(), checkInputBo.getClassifyName());
String beginTime = checkInputBo.getBeginTime(); String beginTime = checkInputBo.getBeginTime();
String checkDate = checkInputBo.getCheckDate();
if (flag1) { if (ObjectUtils.isEmpty(beginTime)){
lastDate = beginTime; if (flag1) {
flag1 = false; lastDate = checkDate;
} flag1 = false;
if (i != 0 && (null == lastDate ? null == beginTime : lastDate.equals(beginTime))) { }
endRow1++; if (i != 0 && (lastDate.equals(checkDate))) {
endRow1++;
} else {
//两者不相同时,融合之前相同的行
if (endRow1 > startRow1) {
sheet.addMergedRegion(new CellRangeAddress(startRow1, endRow1, 0, 0));
}
startRow1 = temNum1;
endRow1 = startRow1;
lastDate = checkDate;
}
temNum1++;
if (i == checkInfoList.size() - 1 && startRow1 != endRow1) {
//融合最后相同的行
sheet.addMergedRegion(new CellRangeAddress(startRow1, endRow1, 0, 0));
}
pointName = StringUtil.setStr(checkInputBo.getCheckDate(), checkInputBo.getPointName());
if (flag2) {
lastPointName = pointName;
flag2 = false;
}
if (i != 0 && lastPointName.equals(pointName)) {
endRow2++;
} else {
//两者不相同时,融合之前相同的行
if (endRow2 > startRow2) {
sheet.addMergedRegion(new CellRangeAddress(startRow2, endRow2, 1, 1));
}
startRow2 = temNum2;
endRow2 = startRow2;
lastPointName = pointName;
}
temNum2++;
if (i == checkInfoList.size() - 1 && startRow2 != endRow2) {
//融合最后相同的行
sheet.addMergedRegion(new CellRangeAddress(startRow2, endRow2, 1, 1));
}
} else { } else {
//两者不相同时,融合之前相同的行 if (flag1) {
if (endRow1 > startRow1) { lastDate = beginTime;
flag1 = false;
}
if (i != 0 && (lastDate.equals(beginTime))) {
endRow1++;
} else {
//两者不相同时,融合之前相同的行
if (endRow1 > startRow1) {
sheet.addMergedRegion(new CellRangeAddress(startRow1, endRow1, 0, 0));
}
startRow1 = temNum1;
endRow1 = startRow1;
lastDate = beginTime;
}
temNum1++;
if (i == checkInfoList.size() - 1 && startRow1 != endRow1) {
//融合最后相同的行
sheet.addMergedRegion(new CellRangeAddress(startRow1, endRow1, 0, 0)); sheet.addMergedRegion(new CellRangeAddress(startRow1, endRow1, 0, 0));
} }
startRow1 = temNum1;
endRow1 = startRow1;
lastDate = beginTime;
}
temNum1++;
if (i == checkInfoList.size() - 1 && startRow1 != endRow1) {
//融合最后相同的行
sheet.addMergedRegion(new CellRangeAddress(startRow1, endRow1, 0, 0));
}
if (flag2) { if (flag2) {
lastPointName = pointName; lastPointName = pointName;
flag2 = false; flag2 = false;
} }
if (i != 0 && lastPointName.equals(pointName)) { if (i != 0 && lastPointName.equals(pointName)) {
endRow2++; endRow2++;
} else { } else {
//两者不相同时,融合之前相同的行 //两者不相同时,融合之前相同的行
if (endRow2 > startRow2) { if (endRow2 > startRow2) {
sheet.addMergedRegion(new CellRangeAddress(startRow2, endRow2, 1, 1));
}
startRow2 = temNum2;
endRow2 = startRow2;
lastPointName = pointName;
}
temNum2++;
if (i == checkInfoList.size() - 1 && startRow2 != endRow2) {
//融合最后相同的行
sheet.addMergedRegion(new CellRangeAddress(startRow2, endRow2, 1, 1)); sheet.addMergedRegion(new CellRangeAddress(startRow2, endRow2, 1, 1));
} }
startRow2 = temNum2;
endRow2 = startRow2;
lastPointName = pointName;
}
temNum2++;
if (i == checkInfoList.size() - 1 && startRow2 != endRow2) {
//融合最后相同的行
sheet.addMergedRegion(new CellRangeAddress(startRow2, endRow2, 1, 1));
} }
if (flag3) { if (flag3) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment