ebom编辑部分导出异常

This commit is contained in:
jing's 2024-03-31 15:14:05 +08:00
parent e7154dc542
commit 178ed71853
3 changed files with 14 additions and 9 deletions

View File

@ -183,8 +183,8 @@ public class EbomApi extends BaseApi {
extra = "{{#exportParam.toString()}}", type = "Ebom-编辑导出") extra = "{{#exportParam.toString()}}", type = "Ebom-编辑导出")
public void editExportBom(@RequestBody EbomEditExportDTO exportParam , HttpServletResponse response) throws IOException { public void editExportBom(@RequestBody EbomEditExportDTO exportParam , HttpServletResponse response) throws IOException {
VUtils.isTure(CollUtil.isEmpty(exportParam.getList()) && exportParam.getBomRowId()<=0).throwMessage("请选择要导出的物料行"); VUtils.isTure(CollUtil.isEmpty(exportParam.getList()) && exportParam.getBomRowId()<=0).throwMessage("请选择要导出的物料行");
EecExcelUtil.setResponseExcelHeader(response, "bom列表");
bomNewEbomParentService.editExportBom(exportParam, response); bomNewEbomParentService.editExportBom(exportParam, response.getOutputStream());
} }

View File

@ -1,5 +1,6 @@
package com.nflg.product.bomnew.pojo.vo; package com.nflg.product.bomnew.pojo.vo;
import cn.hutool.core.util.ObjectUtil;
import com.nflg.product.bomnew.constant.EBomExceptionStatusEnum; import com.nflg.product.bomnew.constant.EBomExceptionStatusEnum;
import com.nflg.product.bomnew.constant.EBomStatusEnum; import com.nflg.product.bomnew.constant.EBomStatusEnum;
import com.nflg.product.bomnew.constant.MateiralStateEnum; import com.nflg.product.bomnew.constant.MateiralStateEnum;
@ -19,7 +20,10 @@ public class EbomExcelEditVO {
private String errorStatus; private String errorStatus;
public String getErrorStatus(){ public String getErrorStatus(){
return EnumUtils.getValueEnum(EBomExceptionStatusEnum.class, this.status).getDescription(); if(ObjectUtil.isNull(this.exceptionStatus)){
return "";
}
return EnumUtils.getValueEnum(EBomExceptionStatusEnum.class, this.exceptionStatus).getDescription();
} }
private Integer exceptionStatus; private Integer exceptionStatus;
@ExcelColumn(value ="序号",colIndex = 1) @ExcelColumn(value ="序号",colIndex = 1)
@ -79,16 +83,16 @@ public class EbomExcelEditVO {
@ExcelColumn(value ="类别",colIndex = 13) @ExcelColumn(value ="类别",colIndex = 13)
private String categoryName; private String categoryName;
@ExcelColumn(value ="创建日期",colIndex = 14) @ExcelColumn(value ="创建日期",format = "yyyy-MM-dd hh:mm:ss",colIndex = 14)
private LocalDateTime createdTime; private LocalDateTime createdTime;
@ExcelColumn(value ="修改日期",colIndex = 15) @ExcelColumn(value ="修改日期",format = "yyyy-MM-dd hh:mm:ss",colIndex = 15)
private LocalDateTime modifTime; private LocalDateTime modifTime;
@ExcelColumn(value ="有效起始日",colIndex = 16) @ExcelColumn(value ="有效起始日",format = "yyyy-MM-dd hh:mm:ss",colIndex = 16)
private String startTime; private String startTime;
public LocalDateTime getStartTime(){ public LocalDateTime getStartTime(){
return createdTime; return createdTime;
} }
@ExcelColumn(value ="版本过期时间",colIndex = 17) @ExcelColumn(value ="版本过期时间",format = "yyyy-MM-dd hh:mm:ss",colIndex = 17)
private LocalDateTime expireEndTime; private LocalDateTime expireEndTime;
@ExcelColumn(value ="物料状态",colIndex = 18) @ExcelColumn(value ="物料状态",colIndex = 18)
@ -97,7 +101,7 @@ public class EbomExcelEditVO {
private Integer materialState; private Integer materialState;
public String getMaterialStateStr() { public String getMaterialStateStr() {
return EnumUtils.getValueEnum(MateiralStateEnum.class, this.status).getDescription(); return EnumUtils.getValueEnum(MateiralStateEnum.class, this.materialState).getDescription();
} }

View File

@ -47,6 +47,7 @@ import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.io.OutputStream;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.*; import java.util.*;
@ -837,7 +838,7 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
} }
public void editExportBom(EbomEditExportDTO param, HttpServletResponse response) throws IOException { public void editExportBom(EbomEditExportDTO param, OutputStream response) throws IOException {
List<BomNewEbomParentVO> result=param.getList(); List<BomNewEbomParentVO> result=param.getList();
if(CollUtil.isEmpty(param.getList())){ if(CollUtil.isEmpty(param.getList())){
result=getChild(param.getBomRowId()); result=getChild(param.getBomRowId());