|
|
|
@ -1,17 +1,22 @@
|
|
|
|
|
package com.op.plan.controller;
|
|
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import javax.servlet.ServletOutputStream;
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
|
|
|
|
|
import com.alibaba.fastjson2.JSONObject;
|
|
|
|
|
import com.op.common.core.domain.ExcelCol;
|
|
|
|
|
import com.op.common.core.exception.ServiceException;
|
|
|
|
|
import com.op.common.core.utils.poi.ExcelMapUtil;
|
|
|
|
|
import com.op.plan.domain.ProLine;
|
|
|
|
|
import com.op.plan.domain.ProOrder;
|
|
|
|
|
import com.op.plan.domain.ProOrderWorkorderBatch;
|
|
|
|
|
import com.op.plan.domain.dto.SplitOrderDTO;
|
|
|
|
|
import com.op.plan.service.IProWetMaterialPlanDetailService;
|
|
|
|
|
import com.op.plan.service.IProWetMaterialPlanService;
|
|
|
|
|
import org.apache.poi.xssf.streaming.SXSSFWorkbook;
|
|
|
|
|
import org.aspectj.weaver.loadtime.Aj;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
|
@ -167,6 +172,45 @@ public class ProOrderWorkorderController extends BaseController {
|
|
|
|
|
util.exportExcel(response, list, "生产工单数据");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@RequiresPermissions("mes:pro:workorder:powExport")
|
|
|
|
|
@Log(title = "排查计划导出", businessType = BusinessType.EXPORT)
|
|
|
|
|
@PostMapping("/powExport")
|
|
|
|
|
public void powExport(HttpServletResponse response, ProOrderWorkorder proOrderWorkorder) {
|
|
|
|
|
List<HashMap> list = proOrderWorkorderService.getPowExportData(proOrderWorkorder);
|
|
|
|
|
|
|
|
|
|
String titleRow1 = "生产排产单";
|
|
|
|
|
//表格结构数据
|
|
|
|
|
ArrayList<ExcelCol> excelCols = new ArrayList<>();
|
|
|
|
|
excelCols.add(new ExcelCol("序号", "xh", 10));
|
|
|
|
|
excelCols.add(new ExcelCol("原订单编码", "orderCode", 25));
|
|
|
|
|
excelCols.add(new ExcelCol("订单编码", "workorderSap", 25));
|
|
|
|
|
excelCols.add(new ExcelCol("物料编码", "materialCode", 25));
|
|
|
|
|
excelCols.add(new ExcelCol("物料描述", "materialDesc", 25));
|
|
|
|
|
excelCols.add(new ExcelCol("数量", "quality", 20));
|
|
|
|
|
excelCols.add(new ExcelCol("批号1", "batch1", 35));
|
|
|
|
|
excelCols.add(new ExcelCol("批号2", "batch2", 35));
|
|
|
|
|
excelCols.add(new ExcelCol("批号3", "batch3", 35));
|
|
|
|
|
excelCols.add(new ExcelCol("批号4", "batch4", 35));
|
|
|
|
|
String titleName = "生产排产信息";
|
|
|
|
|
SXSSFWorkbook workbook = null;
|
|
|
|
|
try {
|
|
|
|
|
//设置响应头
|
|
|
|
|
response.setHeader("Content-disposition",
|
|
|
|
|
"attachment; filename=" + titleName);
|
|
|
|
|
response.setContentType("application/octet-stream;charset=UTF-8");
|
|
|
|
|
ServletOutputStream outputStream = response.getOutputStream();
|
|
|
|
|
//调用工具类
|
|
|
|
|
workbook = ExcelMapUtil.initWorkbook(titleName, titleRow1, excelCols, list);
|
|
|
|
|
workbook.write(outputStream);
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
} finally {
|
|
|
|
|
if (workbook != null) {
|
|
|
|
|
workbook.dispose();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 获取生产工单详细信息
|
|
|
|
|
*/
|
|
|
|
|