|
@@ -529,9 +529,11 @@ public class TTrainingController extends BaseController {
|
|
|
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
//苯乙烯 Excel 渲染
|
|
|
private void replaceExcel(SXSSFWorkbook wb, Long trainingId) {
|
|
|
- Sheet sheet = wb.getSheet("sheet1");
|
|
|
+ Sheet sheet = wb.getSheet("CTAM");
|
|
|
TTraining tTraining = tTrainingMapper.selectTTrainingById(trainingId);
|
|
|
TStaffmgr tStaffmgr = new TStaffmgr();
|
|
|
tStaffmgr.setActualposts(tTraining.getPosition());
|
|
@@ -562,6 +564,58 @@ public class TTrainingController extends BaseController {
|
|
|
}
|
|
|
staffmgrList.addAll(staffmgrs);
|
|
|
}
|
|
|
+ replaceSheet(wb,"CTAM",staffmgrList);
|
|
|
+ replaceSheet(wb,"CTMM",staffmgrList);
|
|
|
+ replaceSheet(wb,"CTSL",staffmgrList);
|
|
|
+ replaceSheet(wb,"白班",staffmgrList);
|
|
|
+ replaceSheet(wb,"班组",staffmgrList);
|
|
|
+ }
|
|
|
+
|
|
|
+ //苯乙烯 Excel 渲染
|
|
|
+ private void replaceSheet(SXSSFWorkbook wb,String sheetName,List<TStaffmgr> staffmgrList) {
|
|
|
+ List<SysDictData> dictList = iSysDictTypeService.selectDictDataByType("STAFF_UNIT");
|
|
|
+ Sheet sheet = wb.getSheet(sheetName);
|
|
|
+ List<TStaffmgr> staffmgrs = new ArrayList<>();
|
|
|
+ if ("CTAM".equals(sheetName)) {
|
|
|
+ for (TStaffmgr t: staffmgrList
|
|
|
+ ) {
|
|
|
+ if ( t.getUnit().equals("22")){
|
|
|
+ staffmgrs.add(t);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if ("CTMM".equals(sheetName)) {
|
|
|
+ for (TStaffmgr t: staffmgrList
|
|
|
+ ) {
|
|
|
+ if ( t.getUnit().equals("24")){
|
|
|
+ staffmgrs.add(t);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if ("CTSL".equals(sheetName)) {
|
|
|
+ for (TStaffmgr t: staffmgrList
|
|
|
+ ) {
|
|
|
+ if ( t.getUnit().equals("16")){
|
|
|
+ staffmgrs.add(t);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if ("白班".equals(sheetName)) {
|
|
|
+ for (TStaffmgr t: staffmgrList
|
|
|
+ ) {
|
|
|
+ if ( t.getTeam().equals("18") && t.getUnit().equals("20")){
|
|
|
+ staffmgrs.add(t);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if ("班组".equals(sheetName)) {
|
|
|
+ for (TStaffmgr t: staffmgrList
|
|
|
+ ) {
|
|
|
+ if ( t.getTeam().equals("10") ||t.getTeam().equals("12") ||t.getTeam().equals("14") ||t.getTeam().equals("16") ){
|
|
|
+ staffmgrs.add(t);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
//设置style
|
|
|
CellStyle cellStyle = wb.createCellStyle();
|
|
|
//设置水平对齐方式
|
|
@@ -586,27 +640,27 @@ public class TTrainingController extends BaseController {
|
|
|
headerFont.setFontHeightInPoints((short) 11);
|
|
|
cellStyle.setFont(headerFont);
|
|
|
int rowIndex = 7;//初始行数
|
|
|
- for (int i = 0; i < staffmgrList.size(); i++) { //加载签名数据
|
|
|
+ for (int i = 0; i < staffmgrs.size(); i++) { //加载签名数据
|
|
|
Row row = sheet.createRow(rowIndex);
|
|
|
row.setHeight((short) 400);
|
|
|
row.createCell(0).setCellValue(i + 1);
|
|
|
row.getCell(0).setCellStyle(cellStyle);
|
|
|
- row.createCell(1).setCellValue(DictUtils.getDictVale(dictList, staffmgrList.get(i).getUnit()));
|
|
|
+ row.createCell(1).setCellValue(DictUtils.getDictVale(dictList, staffmgrs.get(i).getUnit()));
|
|
|
row.getCell(1).setCellStyle(cellStyle);
|
|
|
- row.createCell(2).setCellValue(staffmgrList.get(i).getStaffid());
|
|
|
+ row.createCell(2).setCellValue(staffmgrs.get(i).getStaffid());
|
|
|
row.getCell(2).setCellStyle(cellStyle);
|
|
|
- row.createCell(3).setCellValue(staffmgrList.get(i).getName());
|
|
|
+ row.createCell(3).setCellValue(staffmgrs.get(i).getName());
|
|
|
row.getCell(3).setCellStyle(cellStyle);
|
|
|
row.createCell(4).setCellStyle(cellStyle);
|
|
|
row.createCell(5).setCellStyle(cellStyle);
|
|
|
- if (i + 1 < staffmgrList.size()) {
|
|
|
+ if (i + 1 < staffmgrs.size()) {
|
|
|
row.createCell(6).setCellValue(i + 2);
|
|
|
row.getCell(6).setCellStyle(cellStyle);
|
|
|
- row.createCell(7).setCellValue(DictUtils.getDictVale(dictList, staffmgrList.get(i + 1).getUnit()));
|
|
|
+ row.createCell(7).setCellValue(DictUtils.getDictVale(dictList, staffmgrs.get(i + 1).getUnit()));
|
|
|
row.getCell(7).setCellStyle(cellStyle);
|
|
|
- row.createCell(8).setCellValue(staffmgrList.get(i + 1).getStaffid());
|
|
|
+ row.createCell(8).setCellValue(staffmgrs.get(i + 1).getStaffid());
|
|
|
row.getCell(8).setCellStyle(cellStyle);
|
|
|
- row.createCell(9).setCellValue(staffmgrList.get(i + 1).getName());
|
|
|
+ row.createCell(9).setCellValue(staffmgrs.get(i + 1).getName());
|
|
|
row.getCell(9).setCellStyle(cellStyle);
|
|
|
row.createCell(10).setCellStyle(cellStyle);
|
|
|
row.createCell(11).setCellStyle(cellStyle);
|
|
@@ -652,6 +706,7 @@ public class TTrainingController extends BaseController {
|
|
|
rowLast.createCell(9).setCellStyle(cellStyle);
|
|
|
rowLast.createCell(10).setCellStyle(cellStyle);
|
|
|
rowLast.createCell(11).setCellStyle(cellStyle);
|
|
|
+
|
|
|
}
|
|
|
|
|
|
/**
|