Browse Source

1、导出功能完善-填充常规参数

master
Aug 6 months ago
parent
commit
46faa289a2
1 changed files with 94 additions and 0 deletions
  1. +94
    -0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/apiService/impl/ExcelServiceImpl.java

+ 94
- 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/apiService/impl/ExcelServiceImpl.java View File

@ -188,12 +188,94 @@ public class ExcelServiceImpl implements ExcelService {
}
//常规参数
public int generalParam(Sheet sheet, WorkorderTemplate template, int stepNum, int generalNum){
//常规参数信息
WorkorderGeneralStepone generalStepone = template.getWorkorderStepList().get(stepNum).getWorkorderGeneralSteponeList().get(generalNum);
//设置跨行跨列
sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, 9));
sheet.addMergedRegion(new CellRangeAddress(2, 3, 6, 6));
sheet.addMergedRegion(new CellRangeAddress(2, 3, 7, 7));
//第一行
Row row1 = sheet.createRow(0);
//第一行第一列
Cell cell11 = row1.createCell(0);
cell11.setCellValue("中试压缩机试作工序卡1(选配)");
//第二行
Row row2 = sheet.createRow(1);
//第二行第n列
Cell cell21 = row2.createCell(0);
cell21.setCellValue("委托担当");
Cell cell22 = row2.createCell(1);
cell22.setCellValue(template.getResponsibler());
Cell cell23 = row2.createCell(2);
cell23.setCellValue("指示书/流程编号:");
Cell cell24 = row2.createCell(3);
cell24.setCellValue(template.getTaskNo());
Cell cell25 = row2.createCell(4);
cell25.setCellValue("机种名");
Cell cell26 = row2.createCell(5);
cell26.setCellValue(template.getModel());
Cell cell27 = row2.createCell(6);
cell27.setCellValue("数量");
Cell cell28 = row2.createCell(7);
cell28.setCellValue(template.getNumber());
Cell cell29 = row2.createCell(8);
cell29.setCellValue("页数");
Cell cell210 = row2.createCell(9);
cell210.setCellValue("1/4");
//第三行
Row row3 = sheet.createRow(2);
//第三行第n列
Cell cell31 = row3.createCell(0);
cell31.setCellValue("气缸料号1");
Cell cell32 = row3.createCell(1);
cell32.setCellValue(generalStepone.getCylinder1());
Cell cell33 = row3.createCell(2);
cell33.setCellValue("活塞料号1");
Cell cell34 = row3.createCell(3);
cell34.setCellValue(generalStepone.getPiston1());
Cell cell35 = row3.createCell(4);
cell35.setCellValue("划片料号1");
Cell cell36 = row3.createCell(5);
cell36.setCellValue(generalStepone.getScribing1());
Cell cell37 = row3.createCell(6);
cell37.setCellValue("中试作业员1");
Cell cell38 = row3.createCell(7);
cell38.setCellValue(generalStepone.getOperator());
//第四行
Row row4 = sheet.createRow(3);
//第四行第n列
Cell cell41 = row4.createCell(0);
cell41.setCellValue("气缸料号2");
Cell cell42 = row4.createCell(1);
cell42.setCellValue(generalStepone.getCylinder2());
Cell cell43 = row4.createCell(2);
cell43.setCellValue("活塞料号2");
Cell cell44 = row4.createCell(3);
cell44.setCellValue(generalStepone.getPiston2());
Cell cell45 = row4.createCell(4);
cell45.setCellValue("划片料号2");
Cell cell46 = row4.createCell(5);
cell46.setCellValue(generalStepone.getScribing2());
Cell cell47 = row4.createCell(6);
cell47.setCellValue("中试作业员2");
Cell cell48 = row4.createCell(7);
cell48.setCellValue(generalStepone.getOperator());
return sheet.getLastRowNum();
}
//工作簿
public void sheet(Workbook workbook, String templateId) {
WorkorderTemplate template = getExportData(templateId);
int stepCount = template.getWorkorderStepList().size();//工序卡数量
for (int stepNum = 0; stepNum < stepCount; stepNum++) {
int lineNum = 0;//写入单元行
int firstLine= 0;//合并单元起始行
String stepName = template.getWorkorderStepList().get(stepNum).getName();//工序卡名称
@ -201,6 +283,18 @@ public class ExcelServiceImpl implements ExcelService {
int processCount = template.getWorkorderStepList().get(stepNum).getWorkorderProcessList().size();//工序数量
//工序卡1
String stepId = template.getWorkorderStepList().get(stepNum).getId();//工序卡id
//常规参数-工序卡1
int generalOneCount = template.getWorkorderStepList().get(stepNum).getWorkorderGeneralSteponeList().size();//常规参数数量
for (int generalNum = 0; generalNum < generalOneCount; generalNum++) {
String g_stepId = template.getWorkorderStepList().get(stepNum).getWorkorderGeneralSteponeList().get(generalNum).getStepId();
if(g_stepId.equals(stepId)){
lineNum = generalParam(sheet, template, stepNum, generalNum) + 1;
firstLine = lineNum;
}
}
//检查项目参数
for (int processNum = 0; processNum < processCount; processNum++) {
//工序
String p_stepId = template.getWorkorderStepList().get(stepNum).getWorkorderProcessList().get(processNum).getStepId();//关联工序卡id


Loading…
Cancel
Save