|
@@ -1,12 +1,389 @@
|
|
|
package com.factory.web.service.impl;
|
|
|
|
|
|
+import cn.hutool.core.collection.CollUtil;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
+import com.factory.base.entity.aggregates.ResponseBean;
|
|
|
+import com.factory.base.entity.constant.CacheConstant;
|
|
|
+import com.factory.base.entity.constant.SystemConstant;
|
|
|
+import com.factory.user.service.UserInfoService;
|
|
|
+import com.factory.web.entity.excel.Utility;
|
|
|
+import com.factory.web.entity.pm.OnsiteApprovalPlan;
|
|
|
+import com.factory.web.entity.pm.OnsiteCalendar;
|
|
|
+import com.factory.web.entity.pm.req.SearchPmCheckRecordListReq;
|
|
|
+import com.factory.web.entity.pm.req.SearchPmPlanReq;
|
|
|
+import com.factory.web.entity.pm.res.PmCheckRecordItemListRes;
|
|
|
+import com.factory.web.entity.pm.res.PmCheckRecordListRes;
|
|
|
+import com.factory.web.entity.pm.res.PmCheckRecordRes;
|
|
|
+import com.factory.web.entity.pm.res.PmPlanRes;
|
|
|
import com.factory.web.mapper.FileMapper;
|
|
|
import com.factory.web.service.FileService;
|
|
|
+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.Row;
|
|
|
+import org.apache.poi.ss.usermodel.Sheet;
|
|
|
+import org.apache.poi.ss.usermodel.Workbook;
|
|
|
+import org.apache.poi.ss.util.CellRangeAddress;
|
|
|
+import org.apache.poi.xssf.streaming.SXSSFWorkbook;
|
|
|
+import org.apache.poi.xssf.usermodel.XSSFCellStyle;
|
|
|
+import org.apache.poi.xssf.usermodel.XSSFClientAnchor;
|
|
|
+import org.apache.poi.xssf.usermodel.XSSFDrawing;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
+import javax.imageio.ImageIO;
|
|
|
+import javax.servlet.http.HttpServletRequest;
|
|
|
+import java.awt.image.BufferedImage;
|
|
|
+import java.io.ByteArrayInputStream;
|
|
|
+import java.io.ByteArrayOutputStream;
|
|
|
+import java.io.IOException;
|
|
|
+import java.util.*;
|
|
|
+
|
|
|
@Service
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
-public class FileServiceImpl extends ServiceImpl<FileMapper, FileEntry> implements FileService {
|
|
|
+public class FileServiceImpl extends ServiceImpl<FileMapper, FileEntry> implements FileService {
|
|
|
+
|
|
|
+ @Value("${download.excel.imgid}")
|
|
|
+ private String imgId;
|
|
|
+ @Value("${download.excel.companyname}")
|
|
|
+ private String companyName;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ PreventMistakeService preventMistakeService;
|
|
|
+ @Autowired
|
|
|
+ UserInfoService userInfoService;
|
|
|
+
|
|
|
+ public Workbook onsiteControlledExcel(SearchPmCheckRecordListReq param, HttpServletRequest request, boolean iscontroll) throws IOException {
|
|
|
+ HashMap<Integer, String> nmMap = new HashMap<>();
|
|
|
+ SearchPmPlanReq req = SearchPmPlanReq.builder().bentelerPlanId(param.getBentelerPlanId()).build();
|
|
|
+ PmPlanRes plan = preventMistakeService.getPmPlan(req);
|
|
|
+ ResponseBean<List<PmCheckRecordListRes>> checks = preventMistakeService.getPmCheckRecordList(param);
|
|
|
+ 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);
|
|
|
+ FileEntry file = this.getById(Long.parseLong(imgId));
|
|
|
+ ByteArrayInputStream inb = new ByteArrayInputStream(file.getFile());
|
|
|
+ BufferedImage bufferImg = ImageIO.read(inb);
|
|
|
+ String[] data = getOnsiteTitle1Data();
|
|
|
+ createOnsiteTitle1(wb, sheet, cellStyle, 0, data, bufferImg);
|
|
|
+ inb.close();
|
|
|
+ data = getOnsiteTitle2Data(plan);
|
|
|
+ createOnsiteTitle2(sheet, cellStyle, 1, data);
|
|
|
+ data = getOnsiteTitle3Data(plan, param, iscontroll);
|
|
|
+ createOnsiteTitle3(sheet, cellStyle, 2, data);
|
|
|
+ createItemInfoTitle(sheet, cellStyle, 3);
|
|
|
+ List<String[]> dsl = getItemInfoDate(plan, checks.getData(), param, iscontroll, nmMap);
|
|
|
+ int rowindex = createItemInfo(sheet, cellStyle, 4, dsl);
|
|
|
+ data = getOperaterTitleData(nmMap);
|
|
|
+ createOperaterTitle(sheet, cellStyle, rowindex + 1, data);
|
|
|
+ data = getOnsiteTitle4Data();
|
|
|
+ createOnsiteTitle4(sheet, cellStyleLeft, rowindex + 2, data);
|
|
|
+ data = getOnsiteTitle5Data(plan, approve.getData());
|
|
|
+ createOnsiteTitle5(sheet, cellStyle, rowindex + 3, data);
|
|
|
+ return wb;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ private List<String[]> getItemInfoDate(PmPlanRes plan, List<PmCheckRecordListRes> check, SearchPmCheckRecordListReq param, boolean iscontroll, HashMap<Integer, String> nmMap) {
|
|
|
+ List<String[]> rs = new ArrayList<>();
|
|
|
+ if (iscontroll) {
|
|
|
+ String[] datas = inidata();
|
|
|
+ rs.add(datas);
|
|
|
+ } else {
|
|
|
+ Optional<OnsiteCalendar> cal = plan.getOnsiteCalendarList().stream().filter(s -> s.getTypeFlag() == param.getTypeFlag()).findFirst();
|
|
|
+ String userNm = getUserName(cal.get() == null ? null : cal.get().getUserId());
|
|
|
+ String[] datas = null;
|
|
|
+ for (PmCheckRecordListRes res : check) {
|
|
|
+ for (PmCheckRecordItemListRes item : res.getItemList()) {
|
|
|
+ datas = inidata();
|
|
|
+ datas[0] = param.getTypeFlag() == 0 ? "日" : param.getTypeFlag() == 1 ? "周" : "月";
|
|
|
+ datas[1] = res.getWsName();
|
|
|
+ datas[2] = item.getItemContent();
|
|
|
+ for (PmCheckRecordRes r : item.getCheckRecordList()) {
|
|
|
+ int day = r.getTaskTime().getDayOfMonth();
|
|
|
+ if (r.getResult().equals("0") || r.getResult().equals("1")) {
|
|
|
+ datas[2 + day] = "√";
|
|
|
+ nmMap.put(day, userNm);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ rs.add(datas);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return rs;
|
|
|
+ }
|
|
|
+
|
|
|
+ private String[] inidata() {
|
|
|
+ String[] datas = new String[34];
|
|
|
+ for (int i = 0; i < datas.length; i++) {
|
|
|
+ datas[i] = "";
|
|
|
+ }
|
|
|
+
|
|
|
+ return datas;
|
|
|
+ }
|
|
|
+
|
|
|
+ private String getUserName(Long userid) {
|
|
|
+ String userNm = SystemConstant.EMPTY_STRING;
|
|
|
+ if (userid != null) {
|
|
|
+ String name = userInfoService.getNameById(userid);
|
|
|
+ if (name != null) {
|
|
|
+ userNm = name;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return userNm;
|
|
|
+ }
|
|
|
+
|
|
|
+ private String[] getOnsiteTitle5Data(PmPlanRes plan, List<OnsiteApprovalPlan> approvals) {
|
|
|
+ Optional<OnsiteApprovalPlan> u1 = null;
|
|
|
+ Optional<OnsiteApprovalPlan> u2 = null;
|
|
|
+ u1 = approvals.stream().filter(s -> s.getApprovalLevel() == 1).findFirst();
|
|
|
+ u2 = approvals.stream().filter(s -> s.getApprovalLevel() == 2).findFirst();
|
|
|
+ return new String[]{
|
|
|
+ String.format("Edited By:%s", getUserName(plan.getCreatedUserId())),
|
|
|
+ String.format("Checked By:%s", getUserName(u1 != null ? u1.get().getApprovalUserId() : null)),
|
|
|
+ String.format("Approved By:%s", getUserName(u2 != null ? u2.get().getApprovalUserId() : null)),
|
|
|
+ };
|
|
|
+ }
|
|
|
+
|
|
|
+ private String[] getOnsiteTitle4Data() {
|
|
|
+ return new String[]{"防错点检在每班开班后按规定频次进行,防错点检不合格,不允许进行批量生产。防错系统维修后,需重新进行防错点检;若防错短时间内无法修复,需填写特殊放行申请《0702,QM,201-2》及按照不合格品管理流程进行追溯。\n" +
|
|
|
+ "检查结果记录方法The Method of filling form: 符合: 打√ 不符合打×, 立即通知倒班主任及维修人员,在点检表背面记录异常。"};
|
|
|
+ }
|
|
|
+
|
|
|
+ private String[] getOperaterTitleData(HashMap<Integer, String> nmMap) {
|
|
|
+ String[] data = inidata();
|
|
|
+ data[0] = "点检人";
|
|
|
+ for (int i = 3; i < data.length; i++) {
|
|
|
+ int index=i-2;
|
|
|
+ if(nmMap.containsKey(index)){
|
|
|
+ data[i]=nmMap.get(index);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return data;
|
|
|
+ }
|
|
|
+
|
|
|
+ private String[] getOnsiteTitle3Data(PmPlanRes plan, SearchPmCheckRecordListReq param, boolean iscontroll) {
|
|
|
+ Optional<OnsiteCalendar> cal = plan.getOnsiteCalendarList().stream().filter(s -> s.getTypeFlag() == param.getTypeFlag()).findFirst();
|
|
|
+ String[] dates = param.getYearMonth().split("\\-");
|
|
|
+ String setter = String.format("Setter/Jumper:%s", "");
|
|
|
+ if (!iscontroll) {
|
|
|
+ setter = String.format("Setter/Jumper:%s", getUserName(cal.get() == null ? null : cal.get().getUserId()));
|
|
|
+ }
|
|
|
+ return new String[]{
|
|
|
+ String.format("Production line:%s", plan.getOnsiteTitle() != null ? plan.getOnsiteTitle().getProductionLine() : ""),
|
|
|
+ String.format("Shift:%s", cal.get().getShift()),
|
|
|
+ setter,
|
|
|
+ String.format("Year:%s", dates[0]),
|
|
|
+ String.format("Month:%s", dates[1])
|
|
|
+ };
|
|
|
+ }
|
|
|
+
|
|
|
+ private String[] getOnsiteTitle2Data(PmPlanRes plan) {
|
|
|
+ String[] data;
|
|
|
+ data = new String[]{companyName,
|
|
|
+ plan.getBentelerPlanName()
|
|
|
+ };
|
|
|
+ return data;
|
|
|
+ }
|
|
|
+
|
|
|
+ private static void createOnsiteTitle3(Sheet sheet, XSSFCellStyle cellStyle, int rowIndex, String[] data) {
|
|
|
+ Row row = sheet.createRow(rowIndex);
|
|
|
+ row.setHeight((short) (25.5 * 20));
|
|
|
+ CellRangeAddress cra = new CellRangeAddress(rowIndex, rowIndex, 0, 2);
|
|
|
+ sheet.addMergedRegion(cra);
|
|
|
+ cra = new CellRangeAddress(rowIndex, rowIndex, 3, 6);
|
|
|
+ sheet.addMergedRegion(cra);
|
|
|
+ cra = new CellRangeAddress(rowIndex, rowIndex, 7, 20);
|
|
|
+ sheet.addMergedRegion(cra);
|
|
|
+ cra = new CellRangeAddress(rowIndex, rowIndex, 21, 27);
|
|
|
+ sheet.addMergedRegion(cra);
|
|
|
+ cra = new CellRangeAddress(rowIndex, rowIndex, 28, 36);
|
|
|
+ sheet.addMergedRegion(cra);
|
|
|
+ for (int i = 0; i < 37; i++) {
|
|
|
+ row.createCell(i).setCellStyle(cellStyle);
|
|
|
+ }
|
|
|
+ Utility.addCellValForStr(row.getCell(0), data[0], cellStyle);
|
|
|
+ Utility.addCellValForStr(row.getCell(3), data[1], cellStyle);
|
|
|
+ Utility.addCellValForStr(row.getCell(7), data[2], cellStyle);
|
|
|
+ Utility.addCellValForStr(row.getCell(21), data[3], cellStyle);
|
|
|
+ Utility.addCellValForStr(row.getCell(28), data[4], cellStyle);
|
|
|
+ }
|
|
|
+
|
|
|
+ private static void createOnsiteTitle4(Sheet sheet, XSSFCellStyle cellStyle, int rowIndex, String[] data) {
|
|
|
+ Row row = sheet.createRow(rowIndex);
|
|
|
+ row.setHeight((short) (33.25 * 20));
|
|
|
+ CellRangeAddress cra = new CellRangeAddress(rowIndex, rowIndex, 0, 36);
|
|
|
+ sheet.addMergedRegion(cra);
|
|
|
+ for (int i = 0; i < 37; i++) {
|
|
|
+ row.createCell(i).setCellStyle(cellStyle);
|
|
|
+ }
|
|
|
+ Utility.addCellValForStr(row.getCell(0), data[0], cellStyle);
|
|
|
+ }
|
|
|
+
|
|
|
+ private static void createOnsiteTitle5(Sheet sheet, XSSFCellStyle cellStyle, int rowIndex, String[] data) {
|
|
|
+ Row row = sheet.createRow(rowIndex);
|
|
|
+ row.setHeight((short) (25 * 20));
|
|
|
+ CellRangeAddress cra = new CellRangeAddress(rowIndex, rowIndex, 0, 5);
|
|
|
+ sheet.addMergedRegion(cra);
|
|
|
+ cra = new CellRangeAddress(rowIndex, rowIndex, 6, 21);
|
|
|
+ sheet.addMergedRegion(cra);
|
|
|
+ cra = new CellRangeAddress(rowIndex, rowIndex, 22, 36);
|
|
|
+ sheet.addMergedRegion(cra);
|
|
|
+ for (int i = 0; i < 37; i++) {
|
|
|
+ row.createCell(i).setCellStyle(cellStyle);
|
|
|
+ }
|
|
|
+ Utility.addCellValForStr(row.getCell(0), data[0], cellStyle);
|
|
|
+ Utility.addCellValForStr(row.getCell(6), data[1], cellStyle);
|
|
|
+ Utility.addCellValForStr(row.getCell(22), data[2], cellStyle);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ private static void createOperaterTitle(Sheet sheet, XSSFCellStyle cellStyle, int rowIndex, String[] data) {
|
|
|
+ Row row = sheet.createRow(rowIndex);
|
|
|
+ row.setHeight((short) (25 * 20));
|
|
|
+ CellRangeAddress cra = new CellRangeAddress(rowIndex, rowIndex, 0, 2);
|
|
|
+ sheet.addMergedRegion(cra);
|
|
|
+ cra = new CellRangeAddress(rowIndex, rowIndex, 34, 36);
|
|
|
+ sheet.addMergedRegion(cra);
|
|
|
+
|
|
|
+ for (int i = 0; i < 37; i++) {
|
|
|
+ row.createCell(i).setCellStyle(cellStyle);
|
|
|
+ }
|
|
|
+
|
|
|
+ for (int i = 3; i < data.length; i++) {
|
|
|
+ Utility.addCellValForStr(row.getCell(i), data[i], cellStyle);
|
|
|
+ }
|
|
|
+ Utility.addCellValForStr(row.getCell(0), data[0], cellStyle);
|
|
|
+ }
|
|
|
+
|
|
|
+ private static void createItemInfoTitle(Sheet sheet, XSSFCellStyle cellStyle, int rowIndex) {
|
|
|
+ List<String> head = new ArrayList<>();
|
|
|
+ HashMap<Integer, Integer> cwMap = new HashMap<>();
|
|
|
+ head.addAll(Arrays.asList("频次", "OP", "点检内容"));
|
|
|
+ cwMap.put(0, (short) 6.6 * 256);
|
|
|
+ cwMap.put(1, (short) 6.6 * 256);
|
|
|
+ cwMap.put(2, (short) 38.7 * 256);
|
|
|
+ for (int i = 1; i <= 31; i++) {
|
|
|
+ head.add(i + "");
|
|
|
+ cwMap.put(i + 2, (short) 4 * 256);
|
|
|
+ }
|
|
|
+ head.add("防错维修后点检");
|
|
|
+ cwMap.put(34, (short) 8 * 256);
|
|
|
+ cwMap.put(35, (short) 8 * 256);
|
|
|
+ cwMap.put(36, (short) 3.5 * 256);
|
|
|
+ CellRangeAddress cra = new CellRangeAddress(rowIndex, rowIndex, 34, 36);
|
|
|
+ sheet.addMergedRegion(cra);
|
|
|
+ Row row = sheet.createRow(rowIndex);
|
|
|
+ row.setHeight((short) (23.75 * 20));
|
|
|
+ for (int i = 0; i < head.size() + 2; i++) {
|
|
|
+ sheet.setColumnWidth((short) i, (short) cwMap.get(i).intValue());
|
|
|
+ row.createCell(i).setCellStyle(cellStyle);
|
|
|
+ }
|
|
|
+ for (int i = 0; i < head.size(); i++) {
|
|
|
+ Utility.addCellValForStr(row.getCell(i), head.get(i), cellStyle);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private static int createItemInfo(Sheet sheet, XSSFCellStyle cellStyle, int rowIndex, List<String[]> datas) {
|
|
|
+ int index = 0;
|
|
|
+ Row row = null;
|
|
|
+ for (String[] data : datas) {
|
|
|
+ if (index != 0) {
|
|
|
+ rowIndex++;
|
|
|
+ }
|
|
|
+ CellRangeAddress cra = new CellRangeAddress(rowIndex, rowIndex, 34, 36);
|
|
|
+ sheet.addMergedRegion(cra);
|
|
|
+ row = sheet.createRow(rowIndex);
|
|
|
+ row.setHeight((short) (23.75 * 20));
|
|
|
+ for (int i = 0; i < 37; i++) {
|
|
|
+ row.createCell(i).setCellStyle(cellStyle);
|
|
|
+ }
|
|
|
+ for (int i = 0; i < data.length; i++) {
|
|
|
+ Utility.addCellValForStr(row.getCell(i), data[i], cellStyle);
|
|
|
+ }
|
|
|
+ index++;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ return rowIndex;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ private static void createOnsiteTitle2(Sheet sheet, XSSFCellStyle cellStyle, int rowIndex, String[] data) {
|
|
|
+ Row row = sheet.createRow(rowIndex);
|
|
|
+ row.setHeight((short) (39.5 * 20));
|
|
|
+ CellRangeAddress cra = new CellRangeAddress(rowIndex, rowIndex, 0, 2);
|
|
|
+ sheet.addMergedRegion(cra);
|
|
|
+ cra = new CellRangeAddress(rowIndex, rowIndex, 3, 20);
|
|
|
+ sheet.addMergedRegion(cra);
|
|
|
+ for (int i = 0; i < 37; i++) {
|
|
|
+ row.createCell(i).setCellStyle(cellStyle);
|
|
|
+ }
|
|
|
+
|
|
|
+ Utility.addCellValForStr(row.getCell(0), data[0], cellStyle);
|
|
|
+ Utility.addCellValForStr(row.getCell(3), data[1], cellStyle);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取头数据1
|
|
|
+ *
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ private String[] getOnsiteTitle1Data() {
|
|
|
+ String[] data = new String[]{
|
|
|
+ "Benteler Automotive (shenyang) Co. , Ltd",
|
|
|
+ "Pokayoke Checking Sheet for Production",
|
|
|
+ "模板编号: T.0702.Eng.022.An.02\n" +
|
|
|
+ "发布日期: 2020-10-26\n" +
|
|
|
+ "模板版本: 11\n" +
|
|
|
+ "部门:工程部\n" +
|
|
|
+ "上一版本: 2019-11-01"
|
|
|
+ };
|
|
|
+ return data;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 生成最上面的头信心
|
|
|
+ *
|
|
|
+ * @param wb
|
|
|
+ * @param sheet
|
|
|
+ * @param cellStyle
|
|
|
+ * @param rowIndex
|
|
|
+ * @param data
|
|
|
+ * @param bufferImg
|
|
|
+ * @throws IOException
|
|
|
+ */
|
|
|
+ private void createOnsiteTitle1(Workbook wb, Sheet sheet, XSSFCellStyle cellStyle, int rowIndex, String[] data, BufferedImage bufferImg) throws IOException {
|
|
|
+ Row row = sheet.createRow(rowIndex);
|
|
|
+ row.setHeight((short) (34 * 20));
|
|
|
+ CellRangeAddress cra = new CellRangeAddress(rowIndex, rowIndex, 0, 2);
|
|
|
+ sheet.addMergedRegion(cra);
|
|
|
+ cra = new CellRangeAddress(rowIndex, rowIndex, 3, 20);
|
|
|
+ sheet.addMergedRegion(cra);
|
|
|
+ cra = new CellRangeAddress(rowIndex, rowIndex + 1, 21, 27);
|
|
|
+ sheet.addMergedRegion(cra);
|
|
|
+ cra = new CellRangeAddress(rowIndex, rowIndex + 1, 28, 36);
|
|
|
+ sheet.addMergedRegion(cra);
|
|
|
+ for (int i = 0; i < 37; i++) {
|
|
|
+ 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));
|
|
|
+ ByteArrayOutputStream byteArrayOut = new ByteArrayOutputStream();
|
|
|
+ ImageIO.write(bufferImg, "png", byteArrayOut);
|
|
|
+ XSSFDrawing patriarch = (XSSFDrawing) sheet.createDrawingPatriarch();
|
|
|
+ XSSFClientAnchor anchor = new XSSFClientAnchor(10, 10, 255, 255,
|
|
|
+ (short) 28, 0, (short) 36, 2);
|
|
|
+ patriarch.createPicture(anchor, wb.addPicture(byteArrayOut
|
|
|
+ .toByteArray(), HSSFWorkbook.PICTURE_TYPE_PNG)); // 插入图片
|
|
|
+ byteArrayOut.close();
|
|
|
+ }
|
|
|
}
|