|
@@ -2,7 +2,6 @@ package com.ruoyi.project.training.bccnew.controller;
|
|
|
|
|
|
import com.deepoove.poi.XWPFTemplate;
|
|
|
import com.deepoove.poi.data.*;
|
|
|
-import com.deepoove.poi.data.style.BorderStyle;
|
|
|
import com.ruoyi.common.utils.file.FileUploadUtils;
|
|
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
|
|
import com.ruoyi.framework.aspectj.lang.annotation.Log;
|
|
@@ -316,7 +315,7 @@ public class TTsNewController extends BaseController {
|
|
|
params.put("traineeSignature", Pictures.ofLocal(fileName(apprentice.getSignUrl())).size(100, 40).create());
|
|
|
params.put("tutor", Texts.of(mentor.getNickName()).create());
|
|
|
params.put("trainee", Texts.of(apprentice.getNickName()).create());
|
|
|
- String[][] planList = null;
|
|
|
+ RowRenderData[] planList = null;
|
|
|
String post = "";
|
|
|
Long planType = tTsNew.getPlanType();
|
|
|
Long newId = tTsNew.getNewId();
|
|
@@ -325,48 +324,48 @@ public class TTsNewController extends BaseController {
|
|
|
TTsLjplan ljplan = new TTsLjplan();
|
|
|
ljplan.setNewId(newId);
|
|
|
List<TTsLjplan> tTsLjplans = tTsLjplanService.selectTTsLjplanListByNewId(ljplan);
|
|
|
- planList = new String[tTsLjplans.size()+1][];
|
|
|
- planList[0] = new String[] { "Training Plan 详细计划", "Planned Training Date 计划培训日期", "Training Topics 培训主题", "Expected Training Requirement 培训预期达到的要求" };
|
|
|
+ planList = new RowRenderData[tTsLjplans.size()+1];
|
|
|
+ planList[0] = Rows.create("Training Plan 详细计划", "Planned Training Date 计划培训日期", "Training Topics 培训主题", "Expected Training Requirement 培训预期达到的要求");
|
|
|
int i = 0;
|
|
|
for (TTsLjplan plan : tTsLjplans) {
|
|
|
i++;
|
|
|
- planList[i] = new String[] { plan.getDetailPlan(), "", plan.getTopic(), "学习结束考核,且考试成绩达到80分以上" };
|
|
|
+ planList[i] = Rows.create(plan.getDetailPlan(), "", plan.getTopic(), "学习结束考核,且考试成绩达到80分以上");
|
|
|
}
|
|
|
} else if (planType == 2L) {
|
|
|
post = "压缩";
|
|
|
TTsYsplan ysplan = new TTsYsplan();
|
|
|
ysplan.setNewId(newId);
|
|
|
List<TTsYsplan> tTsYsplans = tTsYsplanService.selectTTsYsplanListByNewId(ysplan);
|
|
|
- planList = new String[tTsYsplans.size()+1][];
|
|
|
- planList[0] = new String[] { "Training Plan 详细计划", "Planned Training Date 计划培训日期", "Training Topics 培训主题", "Expected Training Requirement 培训预期达到的要求" };
|
|
|
+ planList = new RowRenderData[tTsYsplans.size()+1];
|
|
|
+ planList[0] = Rows.create("Training Plan 详细计划", "Planned Training Date 计划培训日期", "Training Topics 培训主题", "Expected Training Requirement 培训预期达到的要求");
|
|
|
int i = 0;
|
|
|
for (TTsYsplan plan : tTsYsplans) {
|
|
|
i++;
|
|
|
- planList[i] = new String[] { plan.getDetailPlan(), "", plan.getTopic(), "学习结束考核,且考试成绩达到80分以上" };
|
|
|
+ planList[i] = Rows.create(plan.getDetailPlan(), "", plan.getTopic(), "学习结束考核,且考试成绩达到80分以上");
|
|
|
}
|
|
|
} else if (planType == 3L) {
|
|
|
post = "分离";
|
|
|
TTsFlplan flplan = new TTsFlplan();
|
|
|
flplan.setNewId(newId);
|
|
|
List<TTsFlplan> tTsFlplans = tTsFlplanService.selectTTsFlplanListByNewId(flplan);
|
|
|
- planList = new String[tTsFlplans.size()+1][];
|
|
|
- planList[0] = new String[] { "Training Plan 详细计划", "Planned Training Date 计划培训日期", "Training Topics 培训主题", "Expected Training Requirement 培训预期达到的要求" };
|
|
|
+ planList = new RowRenderData[tTsFlplans.size()+1];
|
|
|
+ planList[0] = Rows.create("Training Plan 详细计划", "Planned Training Date 计划培训日期", "Training Topics 培训主题", "Expected Training Requirement 培训预期达到的要求");
|
|
|
int i = 0;
|
|
|
for (TTsFlplan plan : tTsFlplans) {
|
|
|
i++;
|
|
|
- planList[i] = new String[] { plan.getDetailPlan(), "", plan.getTopic(), "学习结束考核,且考试成绩达到80分以上" };
|
|
|
+ planList[i] = Rows.create(plan.getDetailPlan(), "", plan.getTopic(), "学习结束考核,且考试成绩达到80分以上");
|
|
|
}
|
|
|
} else if (planType == 4L) {
|
|
|
post = "芳烃";
|
|
|
TTsFtplan ftplan = new TTsFtplan();
|
|
|
ftplan.setNewId(newId);
|
|
|
List<TTsFtplan> tTsFtplans = tTsFtplanService.selectTTsFtplanListByNewId(ftplan);
|
|
|
- planList = new String[tTsFtplans.size()+1][];
|
|
|
- planList[0] = new String[] { "Training Plan 详细计划", "Planned Training Date 计划培训日期", "Training Topics 培训主题", "Expected Training Requirement 培训预期达到的要求" };
|
|
|
+ planList = new RowRenderData[tTsFtplans.size()+1];
|
|
|
+ planList[0] = Rows.create("Training Plan 详细计划", "Planned Training Date 计划培训日期", "Training Topics 培训主题", "Expected Training Requirement 培训预期达到的要求");
|
|
|
int i = 0;
|
|
|
for (TTsFtplan plan : tTsFtplans) {
|
|
|
i++;
|
|
|
- planList[i] = new String[] { plan.getDetailPlan(), "", plan.getTopic(), "学习结束考核,且考试成绩达到80分以上" };
|
|
|
+ planList[i] = Rows.create(plan.getDetailPlan(), "", plan.getTopic(), "学习结束考核,且考试成绩达到80分以上");
|
|
|
}
|
|
|
}
|
|
|
params.put("tutorPost", Texts.of(post).create());
|
|
@@ -396,7 +395,7 @@ public class TTsNewController extends BaseController {
|
|
|
params.put("traineeSignature", Pictures.ofLocal(fileName(apprentice.getSignUrl())).size(100, 40).create());
|
|
|
params.put("tutor", Texts.of(mentor.getNickName()).create());
|
|
|
params.put("trainee", Texts.of(apprentice.getNickName()).create());
|
|
|
- String[][] planList = null;
|
|
|
+ RowRenderData[] planList = null;
|
|
|
String post = "";
|
|
|
Long planType = tTsNew.getPlanType();
|
|
|
Long newId = tTsNew.getNewId();
|
|
@@ -405,57 +404,62 @@ public class TTsNewController extends BaseController {
|
|
|
TTsLjplan ljplan = new TTsLjplan();
|
|
|
ljplan.setNewId(newId);
|
|
|
List<TTsLjplan> tTsLjplans = tTsLjplanService.selectTTsLjplanListByNewId(ljplan);
|
|
|
- planList = new String[tTsLjplans.size()+2][];
|
|
|
- planList[0] = new String[] { "", "Training Topics 培训主题", "Training Date 培训日期", "Training Effectiveness Evaluation* 培训效果评价*", "Training Effectiveness Acknowledgement 培训效果确认", "", "Mentor comment 导师意见" };
|
|
|
- planList[1] = new String[] { "", "", "", "", "Trainee 学徒", "Tutor 导师", "Proceed to next topic or not 是否转至下一主题" };
|
|
|
+ planList = new RowRenderData[tTsLjplans.size()+2];
|
|
|
+ planList[0] = Rows.create("Training Topics 培训主题", "", "Training Date 培训日期", "Training Effectiveness Evaluation* 培训效果评价*", "Training Effectiveness Acknowledgement 培训效果确认", "", "Mentor comment 导师意见");
|
|
|
+ planList[1] = Rows.create("", "", "", "", "Trainee 学徒", "Tutor 导师", "Proceed to next topic or not 是否转至下一主题");
|
|
|
int i = 1;
|
|
|
for (TTsLjplan plan : tTsLjplans) {
|
|
|
i++;
|
|
|
- planList[i] = new String[] { plan.getDetailPlan(), plan.getTopic(), "", "", "", "", "" };
|
|
|
+ planList[i] = Rows.create(plan.getDetailPlan(), plan.getTopic(), "", "", "", "", "");
|
|
|
}
|
|
|
} else if (planType == 2L) {
|
|
|
post = "压缩";
|
|
|
TTsYsplan ysplan = new TTsYsplan();
|
|
|
ysplan.setNewId(newId);
|
|
|
List<TTsYsplan> tTsYsplans = tTsYsplanService.selectTTsYsplanListByNewId(ysplan);
|
|
|
- planList = new String[tTsYsplans.size()+2][];
|
|
|
- planList[0] = new String[] { "", "Training Topics 培训主题", "Training Date 培训日期", "Training Effectiveness Evaluation* 培训效果评价*", "Training Effectiveness Acknowledgement 培训效果确认", "", "Mentor comment 导师意见" };
|
|
|
- planList[1] = new String[] { "", "", "", "", "Trainee 学徒", "Tutor 导师", "Proceed to next topic or not 是否转至下一主题" };
|
|
|
+ planList = new RowRenderData[tTsYsplans.size()+2];
|
|
|
+ planList[0] = Rows.create("Training Topics 培训主题", "", "Training Date 培训日期", "Training Effectiveness Evaluation* 培训效果评价*", "Training Effectiveness Acknowledgement 培训效果确认", "", "Mentor comment 导师意见");
|
|
|
+ planList[1] = Rows.create("", "", "", "", "Trainee 学徒", "Tutor 导师", "Proceed to next topic or not 是否转至下一主题");
|
|
|
int i = 1;
|
|
|
for (TTsYsplan plan : tTsYsplans) {
|
|
|
i++;
|
|
|
- planList[i] = new String[] { plan.getDetailPlan(), plan.getTopic(), "", "", "", "", "" };
|
|
|
+ planList[i] = Rows.create(plan.getDetailPlan(), plan.getTopic(), "", "", "", "", "");
|
|
|
}
|
|
|
} else if (planType == 3L) {
|
|
|
post = "分离";
|
|
|
TTsFlplan flplan = new TTsFlplan();
|
|
|
flplan.setNewId(newId);
|
|
|
List<TTsFlplan> tTsFlplans = tTsFlplanService.selectTTsFlplanListByNewId(flplan);
|
|
|
- planList = new String[tTsFlplans.size()+2][];
|
|
|
- planList[0] = new String[] { "", "Training Topics 培训主题", "Training Date 培训日期", "Training Effectiveness Evaluation* 培训效果评价*", "Training Effectiveness Acknowledgement 培训效果确认", "", "Mentor comment 导师意见" };
|
|
|
- planList[1] = new String[] { "", "", "", "", "Trainee 学徒", "Tutor 导师", "Proceed to next topic or not 是否转至下一主题" };
|
|
|
+ planList = new RowRenderData[tTsFlplans.size()+2];
|
|
|
+ planList[0] = Rows.create("Training Topics 培训主题", "", "Training Date 培训日期", "Training Effectiveness Evaluation* 培训效果评价*", "Training Effectiveness Acknowledgement 培训效果确认", "", "Mentor comment 导师意见");
|
|
|
+ planList[1] = Rows.create("", "", "", "", "Trainee 学徒", "Tutor 导师", "Proceed to next topic or not 是否转至下一主题");
|
|
|
int i = 1;
|
|
|
for (TTsFlplan plan : tTsFlplans) {
|
|
|
i++;
|
|
|
- planList[i] = new String[] { plan.getDetailPlan(), plan.getTopic(), "", "", "", "", "" };
|
|
|
+ planList[i] = Rows.create(plan.getDetailPlan(), plan.getTopic(), "", "", "", "", "");
|
|
|
}
|
|
|
} else if (planType == 4L) {
|
|
|
post = "芳烃";
|
|
|
TTsFtplan ftplan = new TTsFtplan();
|
|
|
ftplan.setNewId(newId);
|
|
|
List<TTsFtplan> tTsFtplans = tTsFtplanService.selectTTsFtplanListByNewId(ftplan);
|
|
|
- planList = new String[tTsFtplans.size()+2][];
|
|
|
- planList[0] = new String[] { "", "Training Topics 培训主题", "Training Date 培训日期", "Training Effectiveness Evaluation* 培训效果评价*", "Training Effectiveness Acknowledgement 培训效果确认", "", "Mentor comment 导师意见" };
|
|
|
- planList[1] = new String[] { "", "", "", "", "Trainee 学徒", "Tutor 导师", "Proceed to next topic or not 是否转至下一主题" };
|
|
|
+ planList = new RowRenderData[tTsFtplans.size()+2];
|
|
|
+ planList[0] = Rows.create("Training Topics 培训主题", "", "Training Date 培训日期", "Training Effectiveness Evaluation* 培训效果评价*", "Training Effectiveness Acknowledgement 培训效果确认", "", "Mentor comment 导师意见");
|
|
|
+ planList[1] = Rows.create("", "", "", "", "Trainee 学徒", "Tutor 导师", "Proceed to next topic or not 是否转至下一主题");
|
|
|
int i = 1;
|
|
|
for (TTsFtplan plan : tTsFtplans) {
|
|
|
i++;
|
|
|
- planList[i] = new String[] { plan.getDetailPlan(), plan.getTopic(), "", "", "", "", "" };
|
|
|
+ planList[i] = Rows.create(plan.getDetailPlan(), plan.getTopic(), "", "", "", "", "");
|
|
|
}
|
|
|
}
|
|
|
params.put("tutorPost", Texts.of(post).create());
|
|
|
params.put("traineePost", Texts.of(post).create());
|
|
|
- params.put("planList", Tables.of(planList).create());
|
|
|
+ MergeCellRule rule = MergeCellRule.builder()
|
|
|
+ .map(MergeCellRule.Grid.of(0, 0), MergeCellRule.Grid.of(1, 1))
|
|
|
+ .map(MergeCellRule.Grid.of(0, 2), MergeCellRule.Grid.of(1, 2))
|
|
|
+ .map(MergeCellRule.Grid.of(0, 4), MergeCellRule.Grid.of(0, 5))
|
|
|
+ .map(MergeCellRule.Grid.of(0, 3), MergeCellRule.Grid.of(1, 3)).build();
|
|
|
+ params.put("planList", Tables.of(planList).mergeRule(rule).create());
|
|
|
// 渲染文本
|
|
|
return params;
|
|
|
}
|