问题修复

This commit is contained in:
luoliming 2024-03-30 13:51:39 +08:00
parent 41dcf17772
commit af9f32fd8a
3 changed files with 17 additions and 20 deletions

View File

@ -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<Boolean> projectTypeInit(@RequestBody List<Long> 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<Boolean> 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<Boolean> convertToPBom(@RequestBody EBomToPBomParamDTO paramDto) throws ExecutionException, InterruptedException {
VUtils.isTure(CollUtil.isEmpty(paramDto.getBomRowIds())).throwMessage("请选择要转换的物料");

View File

@ -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():"";
}

View File

@ -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<BomNewEbomParentMapper,
for (Long bomRowId : bomRowIds) {
List<BomNewEbomParentVO> 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<BomNewEbomParentMapper,
BomNewEbomParentEntity root = this.getById(paramDto.getBomRowId());
LogRecordContext.putVariable("bom", root);
VUtils.isTure(Objects.isNull(root)).throwMessage("Bom不存在");
LogRecordContext.putVariable("gvbom", root);
//初始化虚拟包-判断枚举不是手工生成虚拟包的情况
checkAndInitVirtualPackageEnum(paramDto, root);
Boolean flag = true;
@ -696,7 +698,7 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
BomNewEbomParentVO parent = Convert.convert(BomNewEbomParentVO.class, this.getById(bomRowId));
VUtils.isTure(Objects.isNull(parent)).throwMessage("Bom版本不存在" + bomRowId.toString());
LogRecordContext.putVariable("bom", parent);
LogRecordContext.putVariable("CToPbom", parent);
List<BomNewEbomParentVO> 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<BomNewEbomParentMapper,
public void exportBom(List<Long> bomRowIds, HttpServletResponse response) throws IOException {
final ListSheet<EbomExcelVO> listSheet = new ListSheet<EbomExcelVO>() {
Long n = 0L;
Long pages = 1L;
@Override
protected List<EbomExcelVO> more() {
List<BomNewEbomParentVO> child = getChildBatch(bomRowIds);
return n++ < pages ? Convert.toList(EbomExcelVO.class, child) : null;
}
};
final ListSheet<EbomExcelVO> listSheet = new ListSheet<>(Convert.toList(EbomExcelVO.class, child));
EecExcelUtil.eecExcel("bom列表", listSheet, response);
}