diff --git a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/api/user/EbomApi.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/api/user/EbomApi.java index df550ff2..b81e0f1d 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/api/user/EbomApi.java +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/api/user/EbomApi.java @@ -110,7 +110,7 @@ public class EbomApi extends BaseApi { @PostMapping("projectTypeInit") @ApiOperation("项目类别自动赋值") - @LogRecord(success = "项目类别自动赋值:物料编码:{{#bom.materialNo}} 版本:{{#bom.currentVersion}},操作结果:{{#_ret}}", + @LogRecord(success = "项目类别自动赋值:物料编码:{{#InitPTypeBom.materialNo}} 版本:{{#InitPTypeBom.currentVersion}},操作结果:{{#_ret}}", bizNo = "{{#bomRowIds.toString()}}", type = "项目类别自动赋值") public ResultVO projectTypeInit(@RequestBody List bomRowIds) throws ExecutionException, InterruptedException { VUtils.isTure(CollUtil.isEmpty(bomRowIds)).throwMessage("请选择要自动赋值的行"); @@ -122,7 +122,7 @@ public class EbomApi extends BaseApi { @PostMapping("generateVirtualPackage") @ApiOperation("生成虚拟包") - @LogRecord(success = "生成虚拟包:物料编码:{{#bom.materialNo}} 版本:{{#bom.currentVersion}},操作结果:{{#_ret}}", + @LogRecord(success = "生成虚拟包:物料编码:{{#gvbom.materialNo}} 版本:{{#gvbom.currentVersion}},操作结果:{{#_ret}}", bizNo = "{{#paramDto.bomRowId}}", type = "生成虚拟包") public ResultVO generateVirtualPackage(@RequestBody VirtualPackageParamDto paramDto) { VUtils.isTure(CollUtil.isEmpty(paramDto.getVirtualPackageValue())).throwMessage("请选择要生成的虚拟包"); @@ -140,7 +140,7 @@ public class EbomApi extends BaseApi { @PostMapping("convertToPBom") @ApiOperation("转PBom") - @LogRecord(success = "转PBom:物料编码:{{#bom.materialNo}} 版本:{{#bom.currentVersion}},操作结果:{{#_ret}}", + @LogRecord(success = "转PBom:物料编码:{{#CToPbom.materialNo}} 版本:{{#CToPbom.currentVersion}},操作结果:{{#_ret}}", bizNo = "{{#paramDto.bomRowIds.toString()}}", type = "转PBom") public ResultVO convertToPBom(@RequestBody EBomToPBomParamDTO paramDto) throws ExecutionException, InterruptedException { VUtils.isTure(CollUtil.isEmpty(paramDto.getBomRowIds())).throwMessage("请选择要转换的物料"); diff --git a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/pojo/vo/EbomExcelVO.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/pojo/vo/EbomExcelVO.java index ef3e6c6e..fd089dcf 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/pojo/vo/EbomExcelVO.java +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/pojo/vo/EbomExcelVO.java @@ -12,6 +12,7 @@ import org.ttzero.excel.annotation.ExcelColumn; import java.math.BigDecimal; import java.util.Map; +import java.util.Objects; /** * eBOM 导出模版 @@ -46,16 +47,18 @@ public class EbomExcelVO { public String getStatusName() { - return EnumUtils.getValueEnum(EBomStatusEnum.class, this.status).getDescription(); + return Objects.nonNull(this.status)? EnumUtils.getValueEnum(EBomStatusEnum.class, this.status).getDescription():""; } @ExcelColumn("异常状态") private String errorStatus; - public String getErrorStatus(){ - return EnumUtils.getValueEnum(EBomExceptionStatusEnum.class, this.status).getDescription(); - } + private Integer exceptionStatus; + public String getErrorStatus(){ + return Objects.nonNull(exceptionStatus)? EnumUtils.getValueEnum(EBomExceptionStatusEnum.class, this.getExceptionStatus()).getDescription():""; + } + diff --git a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/BomNewEbomParentService.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/BomNewEbomParentService.java index 5e96a9b8..0664404d 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/BomNewEbomParentService.java +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/BomNewEbomParentService.java @@ -41,6 +41,7 @@ import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.ttzero.excel.entity.ListSheet; +import org.ttzero.excel.entity.Workbook; import javax.annotation.Resource; import javax.servlet.http.HttpServletResponse; @@ -436,7 +437,7 @@ public class BomNewEbomParentService extends ServiceImpl data = getBomTree(bomRowId); BomNewEbomParentVO parent = Convert.convert(BomNewEbomParentVO.class, this.getById(bomRowId)); - LogRecordContext.putVariable("bom", parent); + LogRecordContext.putVariable("InitPTypeBom", parent); //初始化物料信息 materialMainService.intiMaterialInfo(data); productTypeInitDo(parent, data); @@ -648,7 +649,8 @@ public class BomNewEbomParentService extends ServiceImpl bomTree = getBomTree(bomRowId); VUtils.isTure(CollUtil.isEmpty(bomTree)).throwMessage("该BOM不存在下级,无需转换:" + bomRowId.toString()); parent.setBomRowId(parent.getRowId()); @@ -852,17 +854,9 @@ public class BomNewEbomParentService extends ServiceImpl bomRowIds, HttpServletResponse response) throws IOException { - final ListSheet listSheet = new ListSheet() { - Long n = 0L; - Long pages = 1L; - - @Override - protected List more() { - List child = getChildBatch(bomRowIds); - return n++ < pages ? Convert.toList(EbomExcelVO.class, child) : null; - } - }; + List child = getChildBatch(bomRowIds); + final ListSheet listSheet = new ListSheet<>(Convert.toList(EbomExcelVO.class, child)); EecExcelUtil.eecExcel("bom列表", listSheet, response); }