Merge branch 'refs/heads/feature/DM/nflg-bom-dq' into sit
This commit is contained in:
commit
a18ed8ce98
|
|
@ -1,6 +1,8 @@
|
||||||
package com.nflg.product.bomnew.pojo.vo;
|
package com.nflg.product.bomnew.pojo.vo;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.google.common.collect.ImmutableMap;
|
import com.google.common.collect.ImmutableMap;
|
||||||
|
import com.nflg.product.bomnew.constant.BomConstant;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.experimental.Accessors;
|
import lombok.experimental.Accessors;
|
||||||
|
|
@ -33,12 +35,26 @@ public class BomNewPbomWorkExcelVO implements Serializable {
|
||||||
@ExcelColumn(value = "物料编码")
|
@ExcelColumn(value = "物料编码")
|
||||||
private String materialNo;
|
private String materialNo;
|
||||||
|
|
||||||
|
public String getMaterialNo() {
|
||||||
|
if (StrUtil.equals(projectType, BomConstant.PROJECT_TYPE_TEMPORARY)) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
return materialNo;
|
||||||
|
}
|
||||||
|
|
||||||
@ExcelColumn("物料名称")
|
@ExcelColumn("物料名称")
|
||||||
private String materialName;
|
private String materialName;
|
||||||
|
|
||||||
@ExcelColumn(value = "图号")
|
@ExcelColumn(value = "图号")
|
||||||
private String drawingNo;
|
private String drawingNo;
|
||||||
|
|
||||||
|
public String getDrawingNo() {
|
||||||
|
if (StrUtil.equals(projectType, BomConstant.PROJECT_TYPE_TEMPORARY)) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
return drawingNo;
|
||||||
|
}
|
||||||
|
|
||||||
@ExcelColumn(value = "版本号")
|
@ExcelColumn(value = "版本号")
|
||||||
private String currentVersion;
|
private String currentVersion;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -304,7 +304,7 @@ public class DQBomService {
|
||||||
public void deleteBom(Long rowId) {
|
public void deleteBom(Long rowId) {
|
||||||
BomNewDQbomParentEntity root = dQBomParentService.getById(rowId);
|
BomNewDQbomParentEntity root = dQBomParentService.getById(rowId);
|
||||||
VUtils.isTure(Objects.isNull(root)).throwMessage("bom不存在");
|
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");
|
VUtils.isTure(root.getStatus().equals(DQBomStatusEnum.PUBLISHED.getValue())).throwMessage("不能删除已发布的bom");
|
||||||
|
|
||||||
Set<Long> liChildren = new HashSet<>();
|
Set<Long> liChildren = new HashSet<>();
|
||||||
|
|
@ -314,8 +314,12 @@ public class DQBomService {
|
||||||
children.forEach(c -> {
|
children.forEach(c -> {
|
||||||
delete(liParents, liChildren, c);
|
delete(liParents, liChildren, c);
|
||||||
});
|
});
|
||||||
dQBomParentService.getBaseMapper().deleteBatchIds(liParents);
|
if (CollUtil.isNotEmpty(liParents)) {
|
||||||
dQBomChildService.getBaseMapper().deleteBatchIds(liChildren);
|
dQBomParentService.getBaseMapper().deleteBatchIds(liParents);
|
||||||
|
}
|
||||||
|
if (CollUtil.isNotEmpty(liChildren)) {
|
||||||
|
dQBomChildService.getBaseMapper().deleteBatchIds(liChildren);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void delete(Set<Long> parents, Set<Long> children, BomNewDQbomVO bom) {
|
private void delete(Set<Long> parents, Set<Long> children, BomNewDQbomVO bom) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue