Merge branch 'refs/heads/feature/DM/nflg-bom-dq' into sit

This commit is contained in:
曹鹏飞 2024-04-29 08:42:48 +08:00
commit a18ed8ce98
2 changed files with 23 additions and 3 deletions

View File

@ -1,6 +1,8 @@
package com.nflg.product.bomnew.pojo.vo;
import cn.hutool.core.util.StrUtil;
import com.google.common.collect.ImmutableMap;
import com.nflg.product.bomnew.constant.BomConstant;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
@ -33,12 +35,26 @@ public class BomNewPbomWorkExcelVO implements Serializable {
@ExcelColumn(value = "物料编码")
private String materialNo;
public String getMaterialNo() {
if (StrUtil.equals(projectType, BomConstant.PROJECT_TYPE_TEMPORARY)) {
return "";
}
return materialNo;
}
@ExcelColumn("物料名称")
private String materialName;
@ExcelColumn(value = "图号")
private String drawingNo;
public String getDrawingNo() {
if (StrUtil.equals(projectType, BomConstant.PROJECT_TYPE_TEMPORARY)) {
return "";
}
return drawingNo;
}
@ExcelColumn(value = "版本号")
private String currentVersion;

View File

@ -304,7 +304,7 @@ public class DQBomService {
public void deleteBom(Long rowId) {
BomNewDQbomParentEntity root = dQBomParentService.getById(rowId);
VUtils.isTure(Objects.isNull(root)).throwMessage("bom不存在");
VUtils.isTure(!SessionUtil.getUserCode().equals(root.getCreatedBy())).throwMessage("不能删除他人创建的bom");
// VUtils.isTure(!SessionUtil.getUserCode().equals(root.getCreatedBy())).throwMessage("不能删除他人创建的bom");
VUtils.isTure(root.getStatus().equals(DQBomStatusEnum.PUBLISHED.getValue())).throwMessage("不能删除已发布的bom");
Set<Long> liChildren = new HashSet<>();
@ -314,8 +314,12 @@ public class DQBomService {
children.forEach(c -> {
delete(liParents, liChildren, c);
});
dQBomParentService.getBaseMapper().deleteBatchIds(liParents);
dQBomChildService.getBaseMapper().deleteBatchIds(liChildren);
if (CollUtil.isNotEmpty(liParents)) {
dQBomParentService.getBaseMapper().deleteBatchIds(liParents);
}
if (CollUtil.isNotEmpty(liChildren)) {
dQBomChildService.getBaseMapper().deleteBatchIds(liChildren);
}
}
private void delete(Set<Long> parents, Set<Long> children, BomNewDQbomVO bom) {