Merge remote-tracking branch 'origin/feature/DM/nflg-bom' into feature/DM/nflg-bom

This commit is contained in:
大米 2024-04-16 17:44:45 +08:00
commit e9875cac3c
11 changed files with 118 additions and 88 deletions

View File

@ -246,15 +246,14 @@ public class PBomApi extends BaseApi {
@ApiOperation("分工厂-保存") @ApiOperation("分工厂-保存")
@LogRecord(success = "PBom-分工厂-保存。操作结果:{{#_ret}}", bizNo = "",type = "PBom-分工厂-保存") @LogRecord(success = "PBom-分工厂-保存。操作结果:{{#_ret}}", bizNo = "",type = "PBom-分工厂-保存")
public ResultVO<Boolean> saveAllocationFactory(@Valid @RequestBody List<SaveAllocationFactoryDTO> params){ public ResultVO<Boolean> saveAllocationFactory(@Valid @RequestBody List<SaveAllocationFactoryDTO> params){
return ResultVO.success();
return ResultVO.success(bomNewPbomParentService.saveAllocationFactory(params)); //return ResultVO.success(bomNewPbomParentService.saveAllocationFactory(params));
} }
@PostMapping("saveAllocationFactoryNew") @PostMapping("saveAllocationFactoryNew")
@ApiOperation("分工厂-批量保存保存") @ApiOperation("分工厂-批量保存保存")
@LogRecord(success = "PBom-分工厂-保存。操作结果:{{#_ret}}", bizNo = "",type = "PBom-分工厂-保存") @LogRecord(success = "PBom-分工厂-保存。操作结果:{{#_ret}}", bizNo = "",type = "PBom-分工厂-保存")
public ResultVO<Boolean> saveAllocationFactory(@Valid @RequestBody AllocationFactoryParam params){ public ResultVO<Boolean> saveAllocationFactory(@Valid @RequestBody AllocationFactoryParam params){
return ResultVO.success(bomNewPbomParentService.saveAllocationFactoryNew(params)); return ResultVO.success(bomNewPbomParentService.saveAllocationFactoryNew(params));
} }

View File

@ -1,9 +1,10 @@
package com.nflg.product.bomnew.pojo.dto; package com.nflg.product.bomnew.pojo.dto;
import com.nflg.product.bomnew.service.BomNewLogService;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.List; import java.util.List;
/** /**
@ -12,8 +13,10 @@ import java.util.List;
@Data @Data
public class AllocationFactoryParam { public class AllocationFactoryParam {
@NotEmpty
List<SaveAllocationFactoryDTO> data; List<SaveAllocationFactoryDTO> data;
@ApiModelProperty("是否设置下级 0-否 1-是") @ApiModelProperty("是否设置下级 0-否 1-是")
@NotNull
private Integer setSubNode; private Integer setSubNode;
} }

View File

@ -4,6 +4,7 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import java.util.List;
/** /**
* 保存分工厂参数 * 保存分工厂参数
@ -21,4 +22,7 @@ public class SaveAllocationFactoryDTO {
@ApiModelProperty("生产工厂") @ApiModelProperty("生产工厂")
@NotNull(message = "生产工厂不能为空") @NotNull(message = "生产工厂不能为空")
private String productionFactoryCode; private String productionFactoryCode;
@ApiModelProperty("所有父级的rowId")
private List<Long> allParentRowIds;
} }

View File

@ -1,6 +1,5 @@
package com.nflg.product.bomnew.pojo.vo; package com.nflg.product.bomnew.pojo.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
@ -8,8 +7,6 @@ import lombok.experimental.Accessors;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
import java.util.Collections; import java.util.Collections;
@ -328,6 +325,8 @@ public class BomNewEbomParentVO extends BaseMaterialVO implements Serializable {
@ApiModelProperty(value = "异常确认标记") @ApiModelProperty(value = "异常确认标记")
private String exceptionTag; private String exceptionTag;
@ApiModelProperty(value = "待复核根节点")
private Integer rootIsForWaitReview;
private List<BomNewEbomParentVO> childNodes = Collections.emptyList(); private List<BomNewEbomParentVO> childNodes = Collections.emptyList();

View File

@ -1,52 +1,47 @@
package com.nflg.product.bomnew.pojo.vo; package com.nflg.product.bomnew.pojo.vo;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.LocalDateTimeUtil;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import lombok.Data; import lombok.Data;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.time.LocalDate; import java.util.HashSet;
import java.util.List; import java.util.List;
import java.util.Set;
/** /**
* t_bom_new_pbom_parent * t_bom_new_pbom_parent
*
*
* @author makejava * @author makejava
* @since 2024-01-01 10:39:59 * @since 2024-01-01 10:39:59
*/ */
@Data @Data
@Accessors(chain = true) @Accessors(chain = true)
@ApiModel(value="com-nflg-product-bomnew-pojo-new-vo-BomNewPbomParentEntityVO") @ApiModel(value = "com-nflg-product-bomnew-pojo-new-vo-BomNewPbomParentEntityVO")
public class BomNewPbomParentVO extends BaseMaterialVO implements Serializable { public class BomNewPbomParentVO extends BaseMaterialVO implements Serializable {
/** /**
* 主键行ID-雪花 * 主键行ID-雪花
*/ */
@ApiModelProperty(value = "主键行ID-雪花") @ApiModelProperty(value = "主键行ID-雪花")
private Long rowId=0L; private Long rowId = 0L;
@ApiModelProperty("Bom行ID") @ApiModelProperty("Bom行ID")
private Long bomRowId=0L; private Long bomRowId = 0L;
@ApiModelProperty("父级行id") @ApiModelProperty("父级行id")
private Long parentRowId=0L; private Long parentRowId = 0L;
/** /**
* 批号-来自plm-临时 * 批号-来自plm-临时
*/ */
@ApiModelProperty(value = "批号-来自plm-临时") @ApiModelProperty(value = "批号-来自plm-临时")
private String batchNo; private String batchNo;
/** /**
* 工厂编码 * 工厂编码
*/ */
@ -54,7 +49,6 @@ public class BomNewPbomParentVO extends BaseMaterialVO implements Serializable {
private String facCode; private String facCode;
/** /**
* 排序号 * 排序号
*/ */
@ -62,100 +56,97 @@ public class BomNewPbomParentVO extends BaseMaterialVO implements Serializable {
private String orderNumber; private String orderNumber;
/** /**
* 单重 * 单重
*/ */
@ApiModelProperty(value = "单重") @ApiModelProperty(value = "单重")
private BigDecimal unitWeight; private BigDecimal unitWeight;
/** /**
* 总重 * 总重
*/ */
@ApiModelProperty(value = "总重") @ApiModelProperty(value = "总重")
private BigDecimal totalWeight; private BigDecimal totalWeight;
/** /**
* 版本号 * 版本号
*/ */
@ApiModelProperty(value = "版本号") @ApiModelProperty(value = "版本号")
private String currentVersion; private String currentVersion;
/** /**
* 数量 * 数量
*/ */
@ApiModelProperty(value = "数量") @ApiModelProperty(value = "数量")
private BigDecimal num; private BigDecimal num;
/** /**
* 是否跟节点 0- 1- * 是否跟节点 0- 1-
*/ */
@ApiModelProperty(value = "是否跟节点 0-否 1-是") @ApiModelProperty(value = "是否跟节点 0-否 1-是")
private Integer rootIs; private Integer rootIs;
/** /**
* 是否应该有BOM 0- 1- * 是否应该有BOM 0- 1-
*/ */
@ApiModelProperty(value = "是否应该有BOM 0-否 1-是") @ApiModelProperty(value = "是否应该有BOM 0-否 1-是")
private Integer shouldBomExist; private Integer shouldBomExist;
/** /**
* 超级物料 0- 1- * 超级物料 0- 1-
*/ */
@ApiModelProperty(value = "超级物料 0-否 1-是") @ApiModelProperty(value = "超级物料 0-否 1-是")
private Integer superMaterialStatus; private Integer superMaterialStatus;
/** /**
* 是否有BOM: 0- 1- * 是否有BOM: 0- 1-
*/ */
@ApiModelProperty(value = "是否有BOM: 0-否 1-是") @ApiModelProperty(value = "是否有BOM: 0-否 1-是")
private Integer bomExist=0; private Integer bomExist = 0;
/** /**
* 是否最新版0- 1- * 是否最新版0- 1-
*/ */
@ApiModelProperty(value = "是否最新版0-否 1-是") @ApiModelProperty(value = "是否最新版0-否 1-是")
private Integer lastVersionIs; private Integer lastVersionIs;
/** /**
* 1=待处理2=暂存 3=已处理 * 1=待处理2=暂存 3=已处理
*/ */
@ApiModelProperty(value = "1=待处理、2=暂存 3=已处理") @ApiModelProperty(value = "1=待处理、2=暂存 3=已处理")
private Integer editStatus; private Integer editStatus;
/** /**
* BOM状态1=待发布 2=待分配工厂 3=已分配工厂 4=已发布 * BOM状态1=待发布 2=待分配工厂 3=已分配工厂 4=已发布
*/ */
@ApiModelProperty(value = "BOM状态1=待发布 2-借用件 4=已发布 8=待分配工厂 16=已分配工厂") @ApiModelProperty(value = "BOM状态1=待发布 2-借用件 4=已发布 8=待分配工厂 16=已分配工厂")
private Integer status; private Integer status;
/** /**
* 是否用户跟节点 0- 1- * 是否用户跟节点 0- 1-
*/ */
@ApiModelProperty(value = "是否用户跟节点 0-否 1-是") @ApiModelProperty(value = "是否用户跟节点 0-否 1-是")
private Integer userRootIs; private Integer userRootIs;
/** /**
* 是否虚拟包 0- 1- * 是否虚拟包 0- 1-
*/ */
@ApiModelProperty(value = "是否虚拟包 0-否 1-是") @ApiModelProperty(value = "是否虚拟包 0-否 1-是")
private Integer virtualPackageIs; private Integer virtualPackageIs;
/** /**
* 来源行ID(EBOM中的行ID) * 来源行ID(EBOM中的行ID)
*/ */
@ApiModelProperty(value = "来源行ID(EBOM中的行ID)") @ApiModelProperty(value = "来源行ID(EBOM中的行ID)")
private Long sourceRowId; private Long sourceRowId;
/** /**
* 设计人员编码 * 设计人员编码
*/ */
@ApiModelProperty(value = "设计人员编码") @ApiModelProperty(value = "设计人员编码")
private String deviseUserCode; private String deviseUserCode;
/** /**
* 设计人员名称 * 设计人员名称
*/ */
@ -174,37 +165,37 @@ public class BomNewPbomParentVO extends BaseMaterialVO implements Serializable {
*/ */
@ApiModelProperty(value = "工艺人员名称") @ApiModelProperty(value = "工艺人员名称")
private String technologyUserName; private String technologyUserName;
/** /**
* 创建人编码 * 创建人编码
*/ */
@ApiModelProperty(value = "创建人编码") @ApiModelProperty(value = "创建人编码")
private String createdBy; private String createdBy;
/** /**
* 创建时间 * 创建时间
*/ */
@ApiModelProperty(value = "创建时间") @ApiModelProperty(value = "创建时间")
private LocalDateTime createdTime; private LocalDateTime createdTime;
/** /**
* 创建人员所属岗位 0-设计人员 1-工艺人员 2-其他 * 创建人员所属岗位 0-设计人员 1-工艺人员 2-其他
*/ */
@ApiModelProperty(value = "创建人员所属岗位 0-设计人员 1-工艺人员 2-其他") @ApiModelProperty(value = "创建人员所属岗位 0-设计人员 1-工艺人员 2-其他")
private Integer createdJob; private Integer createdJob;
/** /**
* 发布时间 * 发布时间
*/ */
@ApiModelProperty(value = "发布时间") @ApiModelProperty(value = "发布时间")
private LocalDateTime releaseTime; private LocalDateTime releaseTime;
/** /**
* 发布人 * 发布人
*/ */
@ApiModelProperty(value = "发布人") @ApiModelProperty(value = "发布人")
private String releaseUserName; private String releaseUserName;
/** /**
* 版本过期时间=下个版本的创建时间 * 版本过期时间=下个版本的创建时间
*/ */
@ -212,7 +203,7 @@ public class BomNewPbomParentVO extends BaseMaterialVO implements Serializable {
private LocalDateTime expireEndTime; private LocalDateTime expireEndTime;
public LocalDateTime getExpireEndTime() { public LocalDateTime getExpireEndTime() {
return expireEndTime==null? LocalDateTime.of(9999,12,31,23,59,59):expireEndTime; return expireEndTime == null ? LocalDateTime.of(9999, 12, 31, 23, 59, 59) : expireEndTime;
} }
/** /**
@ -220,37 +211,37 @@ public class BomNewPbomParentVO extends BaseMaterialVO implements Serializable {
*/ */
@ApiModelProperty(value = "备注") @ApiModelProperty(value = "备注")
private String remark; private String remark;
/** /**
* 设计维护部门名称 * 设计维护部门名称
*/ */
@ApiModelProperty(value = "设计维护部门名称") @ApiModelProperty(value = "设计维护部门名称")
private String deptName; private String deptName;
/** /**
* bom树的高度 * bom树的高度
*/ */
@ApiModelProperty(value = "bom树的高度") @ApiModelProperty(value = "bom树的高度")
private Integer levelNum; private Integer levelNum;
/** /**
* 升版说明 * 升版说明
*/ */
@ApiModelProperty(value = "升版说明") @ApiModelProperty(value = "升版说明")
private String changeDesc; private String changeDesc;
/** /**
* 通知单号 * 通知单号
*/ */
@ApiModelProperty(value = "通知单号") @ApiModelProperty(value = "通知单号")
private String noticeNums; private String noticeNums;
/** /**
* 订单号 * 订单号
*/ */
@ApiModelProperty(value = "订单号") @ApiModelProperty(value = "订单号")
private String orderNo; private String orderNo;
/** /**
* 修改时间 * 修改时间
*/ */
@ -275,14 +266,15 @@ public class BomNewPbomParentVO extends BaseMaterialVO implements Serializable {
private String levelNo; private String levelNo;
// @ApiModelProperty("物料一级分类编码") // @ApiModelProperty("物料一级分类编码")
// private String relCategoryCode; // private String relCategoryCode;
@ApiModelProperty("子级") @ApiModelProperty("子级")
List<BomNewPbomParentVO> childNodes; List<BomNewPbomParentVO> childNodes;
@ApiModelProperty("所有父级的rowId")
private Set<Long> allParentRowIds = new HashSet<>();
private static final long serialVersionUID = 1L;
private static final long serialVersionUID = 1L;
} }

View File

@ -1322,7 +1322,10 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
List<Long> rowIds = dto.getRowIdList(); List<Long> rowIds = dto.getRowIdList();
List<BomNewEbomParentEntity> bomNewEbomParentEntityList = this.lambdaQuery().in(BomNewEbomParentEntity::getRowId, rowIds).eq(BomNewEbomParentEntity::getUserRootIs, 1).list(); List<BomNewEbomParentEntity> bomNewEbomParentEntityList = this.lambdaQuery()
.in(BomNewEbomParentEntity::getRowId, rowIds)
.and(a -> a.eq(BomNewEbomParentEntity::getUserRootIs, 1).or().eq(BomNewEbomParentEntity::getRootIsForWaitReview, 1))
.list();
if (CollUtil.isEmpty(bomNewEbomParentEntityList)) { if (CollUtil.isEmpty(bomNewEbomParentEntityList)) {
// return ResultVO.error("下级BOM无法进行复核"); // return ResultVO.error("下级BOM无法进行复核");

View File

@ -2,6 +2,7 @@ package com.nflg.product.bomnew.service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.nflg.product.bomnew.constant.EBomConstant;
import com.nflg.product.bomnew.mapper.master.BomNewPbomChildMapper; import com.nflg.product.bomnew.mapper.master.BomNewPbomChildMapper;
import com.nflg.product.bomnew.pojo.entity.BomNewPbomChildEntity; import com.nflg.product.bomnew.pojo.entity.BomNewPbomChildEntity;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -26,4 +27,12 @@ public class BomNewPbomChildService extends ServiceImpl<BomNewPbomChildMapper, B
public void setParentRowId(List<Long> rowIds, Long parentRowId) { public void setParentRowId(List<Long> rowIds, Long parentRowId) {
this.getBaseMapper().setParentRowId(rowIds, parentRowId); this.getBaseMapper().setParentRowId(rowIds, parentRowId);
} }
public boolean setParentFactoryCode1010(List<Long> allParentRowIds) {
return this.lambdaUpdate()
.in(BomNewPbomChildEntity::getRowId, allParentRowIds)
.set(BomNewPbomChildEntity::getProductionFactoryCode, EBomConstant.MAIN_FACTORY_CODE_1010)
.set(BomNewPbomChildEntity::getProductionFactoryCodeInputType, 2)
.update();
}
} }

View File

@ -595,10 +595,8 @@ public class BomNewPbomParentService extends ServiceImpl<BomNewPbomParentMapper,
* @param * @param
* @param countLevelNum 是否标记层级 0- 1- * @param countLevelNum 是否标记层级 0- 1-
* @return * @return
* @throws ExecutionException
* @throws InterruptedException
*/ */
public List<BomNewPbomParentVO> getAllBom(Long rowId, Integer countLevelNum) throws ExecutionException, InterruptedException { public List<BomNewPbomParentVO> getAllBom(Long rowId, Integer countLevelNum) {
List<BomNewPbomParentVO> bomDetail = this.getBaseMapper().getParentChild(rowId); List<BomNewPbomParentVO> bomDetail = this.getBaseMapper().getParentChild(rowId);
AtomicInteger levelNum = new AtomicInteger(1); AtomicInteger levelNum = new AtomicInteger(1);
PBomDetailTask detailTask = new PBomDetailTask(bomDetail, countLevelNum, levelNum); PBomDetailTask detailTask = new PBomDetailTask(bomDetail, countLevelNum, levelNum);
@ -645,13 +643,26 @@ public class BomNewPbomParentService extends ServiceImpl<BomNewPbomParentMapper,
return CTreePBomUtils.toTree(bomRowId, allBom, BomNewPbomParentVO::getParentRowId, BomNewPbomParentVO::getBomRowId); return CTreePBomUtils.toTree(bomRowId, allBom, BomNewPbomParentVO::getParentRowId, BomNewPbomParentVO::getBomRowId);
} }
public List<BomNewPbomParentVO> getAllocationFactoryBomTree(AllocationFactoryBomQuery param) throws ExecutionException, InterruptedException { public List<BomNewPbomParentVO> getAllocationFactoryBomTree(AllocationFactoryBomQuery param) {
List<BomNewPbomParentVO> allBom = getAllBom(param.getBomRowId(), 1); List<BomNewPbomParentVO> allBom = getAllBom(param.getBomRowId(), 1);
materialMainService.intiMaterialInfo(allBom, EBomConstant.EBOM_IGNORED_FIELDS_INIT_MATERIAL_DEFAULT); materialMainService.intiMaterialInfo(allBom, EBomConstant.EBOM_IGNORED_FIELDS_INIT_MATERIAL_DEFAULT);
return CTreePBomUtils.toTree(param.getBomRowId(), allBom, BomNewPbomParentVO::getParentRowId, BomNewPbomParentVO::getBomRowId); List<BomNewPbomParentVO> tree = CTreePBomUtils.toTree(param.getBomRowId(), allBom, BomNewPbomParentVO::getParentRowId, BomNewPbomParentVO::getBomRowId);
initParentRowIds(null, tree);
return tree;
} }
public List<BomNewPbomParentVO> getAllocationFactoryBom(AllocationFactoryBomQuery param) throws ExecutionException, InterruptedException { private void initParentRowIds(BomNewPbomParentVO parent, List<BomNewPbomParentVO> children) {
if (CollUtil.isEmpty(children)) return;
children.forEach(c -> {
if (parent != null) {
c.setAllParentRowIds(Sets.newHashSet(parent.getAllParentRowIds()));
c.getAllParentRowIds().add(parent.getRowId());
}
initParentRowIds(c, c.getChildNodes());
});
}
public List<BomNewPbomParentVO> getAllocationFactoryBom(AllocationFactoryBomQuery param) {
List<BomNewPbomParentVO> allBom = getAllBom(param.getBomRowId(), 1); List<BomNewPbomParentVO> allBom = getAllBom(param.getBomRowId(), 1);
materialMainService.intiMaterialInfo(allBom, EBomConstant.EBOM_IGNORED_FIELDS_INIT_MATERIAL_DEFAULT); materialMainService.intiMaterialInfo(allBom, EBomConstant.EBOM_IGNORED_FIELDS_INIT_MATERIAL_DEFAULT);
return allBom; return allBom;
@ -676,25 +687,28 @@ public class BomNewPbomParentService extends ServiceImpl<BomNewPbomParentMapper,
public Boolean saveAllocationFactoryNew(AllocationFactoryParam params) { public Boolean saveAllocationFactoryNew(AllocationFactoryParam params) {
VUtils.isTure(CollUtil.isEmpty(params.getData())).throwMessage("分配工厂数据为空"); VUtils.isTure(CollUtil.isEmpty(params.getData())).throwMessage("分配工厂数据为空");
//按分配的工厂分组 //按分配的工厂分组
VUtils.isTure(params.getSetSubNode().equals(0)
&& params.getData().stream().anyMatch(u -> u.getProductionFactoryCode().equals(EBomConstant.XIAN_TAO_FACTORY_CODE_1020)))
.throwMessage("仙桃工厂(1020)下的子级必须也是仙桃");
if( params.getSetSubNode().equals(0) ){ if( params.getSetSubNode().equals(0) ){
return saveAllocationFactory(params.getData()); return saveAllocationFactory(params.getData());
}else { }else {
params.getData().forEach(k->{ params.getData().forEach(k -> {
try { AllocationFactoryBomQuery query = new AllocationFactoryBomQuery();
AllocationFactoryBomQuery query=new AllocationFactoryBomQuery(); query.setBomRowId(k.getBomRowId());
query.setBomRowId(k.getBomRowId());
List<BomNewPbomParentVO> allBom = this.getAllocationFactoryBom(query); List<BomNewPbomParentVO> allBom = this.getAllocationFactoryBom(query);
List<Long> rowIds =new ArrayList<>(); List<Long> rowIds = new ArrayList<>();
rowIds.add(k.getRowId()); rowIds.add(k.getRowId());
rowIds.addAll(allBom.stream().map(u -> u.getRowId()).collect(Collectors.toList())); rowIds.addAll(allBom.stream().map(BomNewPbomParentVO::getRowId).collect(Collectors.toList()));
if(CollUtil.isNotEmpty(rowIds)) { if (CollUtil.isNotEmpty(rowIds)) {
pbomChildService.getBaseMapper().setProductionFactoryCode(k.getProductionFactoryCode(), rowIds); pbomChildService.getBaseMapper().setProductionFactoryCode(k.getProductionFactoryCode(), rowIds);
} }
} catch (ExecutionException e) {
e.printStackTrace(); if (k.getProductionFactoryCode().equals(EBomConstant.MAIN_FACTORY_CODE_1010)) {
} catch (InterruptedException e) { //设置所有父级节点为1010
e.printStackTrace(); pbomChildService.setParentFactoryCode1010(k.getAllParentRowIds());
} }
}); });
} }

View File

@ -116,9 +116,13 @@ public class PBomDetailTask extends RecursiveTask<List<BomNewPbomParentVO>> {
} }
if (CollUtil.isNotEmpty(bomDetail)) { if (CollUtil.isNotEmpty(bomDetail)) {
List<Long> childBowIds = bomDetail.stream().filter(u -> u.getBomRowId() > 0).map(u -> u.getBomRowId()).collect(Collectors.toList()); List<Long> childBowIds = bomDetail.stream().map(BomNewPbomParentVO::getBomRowId).filter(bomRowId -> bomRowId > 0).collect(Collectors.toList());
if (CollUtil.isNotEmpty(childBowIds)) { if (CollUtil.isNotEmpty(childBowIds)) {
List<BomNewPbomChildEntity> children = SpringUtil.getBean(BomNewPbomChildService.class).lambdaQuery().in(BomNewPbomChildEntity::getParentRowId, childBowIds).list(); List<BomNewPbomChildEntity> children = SpringUtil.getBean(BomNewPbomChildService.class)
.lambdaQuery()
.in(BomNewPbomChildEntity::getParentRowId, childBowIds)
.orderByAsc(BomNewPbomChildEntity::getOrderNumber)
.list();
List<BomNewPbomParentVO> bom = Convert.toList(BomNewPbomParentVO.class, children); List<BomNewPbomParentVO> bom = Convert.toList(BomNewPbomParentVO.class, children);
PBomDetailTask task = new PBomDetailTask(bom, countLevelState,levelNum); PBomDetailTask task = new PBomDetailTask(bom, countLevelState,levelNum);

View File

@ -106,10 +106,10 @@
</if> </if>
<if test="dataType==0" > <if test="dataType==0" >
<if test="technicianIs==0 "> <if test="technicianIs==0 ">
and created_by=#{createdBy} and status in (1,3) created_by=#{createdBy} and status in (1,3)
</if> </if>
<if test="technicianIs==1 "> <if test="technicianIs==1 ">
and (created_by=#{createdBy} or status=2 ) (created_by=#{createdBy} or status=2 )
</if> </if>
</if> </if>

View File

@ -138,7 +138,10 @@
</select> </select>
<select id="getParentChild" resultType="com.nflg.product.bomnew.pojo.vo.BomNewPbomParentVO"> <select id="getParentChild" resultType="com.nflg.product.bomnew.pojo.vo.BomNewPbomParentVO">
select * from t_bom_new_pbom_child where parent_row_id=#{parentRowId} select *
from t_bom_new_pbom_child
where parent_row_id = #{parentRowId}
order by order_number
</select> </select>
<!--bom发布--> <!--bom发布-->
<update id="bomRelease"> <update id="bomRelease">