Compare commits
2 Commits
f685ea4cea
...
862efcfabd
| Author | SHA1 | Date | |
|---|---|---|---|
| 862efcfabd | |||
| d51b555fa2 |
@@ -30,6 +30,7 @@ import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
@@ -142,12 +143,17 @@ public class ApsPlanSheetServiceImpl implements IApsPlanSheetService {
|
||||
Long planSheetId = req.getPlanSheetId();
|
||||
if (planSheetId != null) {
|
||||
ApsPlanSheetVo planSheet = queryById(planSheetId);
|
||||
t0.setCellValue(planSheet.getPlanDate().toString() + "————" + planSheet.getLineName() + "————" + planSheet.getPlanCode());
|
||||
// 格式化日期
|
||||
String dateStr = "";
|
||||
if (planSheet.getPlanDate() != null) {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
dateStr = sdf.format(planSheet.getPlanDate());
|
||||
}
|
||||
t0.setCellValue(dateStr + "————" + planSheet.getLineName() + "————" + planSheet.getPlanCode());
|
||||
} else {
|
||||
t0.setCellValue("快速排产表");
|
||||
}
|
||||
sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, 38));
|
||||
|
||||
// 1. 先创建标题样式
|
||||
CellStyle titleStyle = wb.createCellStyle();
|
||||
titleStyle.setAlignment(HorizontalAlignment.CENTER);
|
||||
titleStyle.setVerticalAlignment(VerticalAlignment.CENTER);
|
||||
@@ -155,7 +161,19 @@ public class ApsPlanSheetServiceImpl implements IApsPlanSheetService {
|
||||
titleFont.setBold(true);
|
||||
titleFont.setFontHeightInPoints((short) 15);
|
||||
titleStyle.setFont(titleFont);
|
||||
t0.setCellStyle(titleStyle);
|
||||
|
||||
// 2. 合并区域
|
||||
CellRangeAddress titleRegion = new CellRangeAddress(0, 0, 0, 40);
|
||||
sheet.addMergedRegion(titleRegion);
|
||||
|
||||
// 3. 给【整个合并区域】设置样式
|
||||
for (int i = titleRegion.getFirstColumn(); i <= titleRegion.getLastColumn(); i++) {
|
||||
Cell cell = title.getCell(i);
|
||||
if (cell == null) {
|
||||
cell = title.createCell(i);
|
||||
}
|
||||
cell.setCellStyle(titleStyle);
|
||||
}
|
||||
|
||||
String[] headers = new String[]{
|
||||
"产线", "排产日期", "排产单号", "排产类型", "排产人", "修改人", "计划备注",
|
||||
|
||||
Reference in New Issue
Block a user