|
@@ -21,6 +21,7 @@ import com.factory.web.service.pm.PreventMistakeService;
|
|
|
import org.apache.poi.hssf.usermodel.HSSFCellStyle;
|
|
|
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
|
|
import org.apache.poi.ss.formula.functions.Index;
|
|
|
+import org.apache.poi.ss.usermodel.HorizontalAlignment;
|
|
|
import org.apache.poi.ss.usermodel.Row;
|
|
|
import org.apache.poi.ss.usermodel.Sheet;
|
|
|
import org.apache.poi.ss.usermodel.Workbook;
|
|
@@ -64,8 +65,8 @@ public class FileServiceImpl extends ServiceImpl<FileMapper, FileEntry> implemen
|
|
|
ResponseBean<List<OnsiteApprovalPlan>> approve = preventMistakeService.getPmPlanApprovalList(req);
|
|
|
Workbook wb = new SXSSFWorkbook(500);
|
|
|
Sheet sheet = Utility.createSheet(wb, "防错检查");
|
|
|
- XSSFCellStyle cellStyle = Utility.getTitleCellStyle(wb, (short) 10, HSSFCellStyle.ALIGN_CENTER);
|
|
|
- XSSFCellStyle cellStyleLeft = Utility.getTitleCellStyle(wb, (short) 10, HSSFCellStyle.ALIGN_LEFT);
|
|
|
+ XSSFCellStyle cellStyle = Utility.getTitleCellStyle(wb, (short) 10, HorizontalAlignment.CENTER);
|
|
|
+ XSSFCellStyle cellStyleLeft = Utility.getTitleCellStyle(wb, (short) 10, HorizontalAlignment.LEFT);
|
|
|
FileEntry file = this.getById(Long.parseLong(imgId));
|
|
|
ByteArrayInputStream inb = new ByteArrayInputStream(file.getFile());
|
|
|
BufferedImage bufferImg = ImageIO.read(inb);
|
|
@@ -95,7 +96,7 @@ public class FileServiceImpl extends ServiceImpl<FileMapper, FileEntry> implemen
|
|
|
String[] datas = inidata();
|
|
|
rs.add(datas);
|
|
|
} else {
|
|
|
- Optional<OnsiteCalendar> cal = plan.getOnsiteCalendarList().stream().filter(s -> s.getTypeFlag() == param.getTypeFlag()).findFirst();
|
|
|
+ Optional<OnsiteCalendar> cal = plan.getOnsiteCalendarList().stream().filter(s -> s.getTypeFlag() .equals(param.getTypeFlag()) ).findFirst();
|
|
|
String userNm = getUserName(cal.get() == null ? null : cal.get().getUserId());
|
|
|
String[] datas = null;
|
|
|
for (PmCheckRecordListRes res : check) {
|
|
@@ -169,7 +170,7 @@ public class FileServiceImpl extends ServiceImpl<FileMapper, FileEntry> implemen
|
|
|
}
|
|
|
|
|
|
private String[] getOnsiteTitle3Data(PmPlanRes plan, SearchPmCheckRecordListReq param, boolean iscontroll) {
|
|
|
- Optional<OnsiteCalendar> cal = plan.getOnsiteCalendarList().stream().filter(s -> s.getTypeFlag() == param.getTypeFlag()).findFirst();
|
|
|
+ Optional<OnsiteCalendar> cal = plan.getOnsiteCalendarList().stream().filter(s -> s.getTypeFlag() .equals(param.getTypeFlag()) ).findFirst();
|
|
|
String[] dates = param.getYearMonth().split("\\-");
|
|
|
String setter = String.format("Setter/Jumper:%s", "");
|
|
|
if (!iscontroll) {
|
|
@@ -375,8 +376,8 @@ public class FileServiceImpl extends ServiceImpl<FileMapper, FileEntry> implemen
|
|
|
row.createCell(i).setCellStyle(cellStyle);
|
|
|
}
|
|
|
Utility.addCellValForStr(row.getCell(0), data[0], cellStyle);
|
|
|
- Utility.addCellValForStr(row.getCell(3), data[1], Utility.getTitleCellStyle(wb, (short) 15, HSSFCellStyle.ALIGN_CENTER));
|
|
|
- Utility.addCellValForStr(row.getCell(21), data[2], Utility.getTitleCellStyle(wb, (short) 10, HSSFCellStyle.ALIGN_LEFT));
|
|
|
+ Utility.addCellValForStr(row.getCell(3), data[1], Utility.getTitleCellStyle(wb, (short) 15, HorizontalAlignment.CENTER));
|
|
|
+ Utility.addCellValForStr(row.getCell(21), data[2], Utility.getTitleCellStyle(wb, (short) 10, HorizontalAlignment.LEFT));
|
|
|
ByteArrayOutputStream byteArrayOut = new ByteArrayOutputStream();
|
|
|
ImageIO.write(bufferImg, "png", byteArrayOut);
|
|
|
XSSFDrawing patriarch = (XSSFDrawing) sheet.createDrawingPatriarch();
|