fix(pbom): 发起变更时,将原物料设置为last_version_is=0
This commit is contained in:
parent
6ebeb26432
commit
65acfcf94a
|
|
@ -0,0 +1,22 @@
|
|||
package com.nflg.product.bomnew.constant;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* @author 曹鹏飞
|
||||
* @date 2024/6/27 09:25:44
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum PbomSourceEnum implements ValueEnum<Integer> {
|
||||
|
||||
FROM_EBOM(1, "EBOM转换"),
|
||||
FROM_DQBOM(2, "DQBOM转换"),
|
||||
FROM_SAP(3, "从SAP导入"),
|
||||
FROM_COPY(4, "复制"),
|
||||
FROM_CHANGE(5, "变更");
|
||||
|
||||
private final Integer value;
|
||||
private final String description;
|
||||
}
|
||||
|
|
@ -7,6 +7,7 @@ import cn.hutool.extra.spring.SpringUtil;
|
|||
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||
import com.nflg.product.base.core.conmon.util.SessionUtil;
|
||||
import com.nflg.product.bomnew.constant.PBomStatusEnum;
|
||||
import com.nflg.product.bomnew.constant.PbomSourceEnum;
|
||||
import com.nflg.product.bomnew.pojo.entity.BomNewPbomChildEntity;
|
||||
import com.nflg.product.bomnew.pojo.entity.BomNewPbomParentEntity;
|
||||
import com.nflg.product.bomnew.pojo.vo.BomNewPbomParentVO;
|
||||
|
|
@ -91,12 +92,21 @@ public class PBomUpgrade {
|
|||
pbomParent.setCurrentVersion(VersionUtil.getNextVersion(parentVO.getCurrentVersion()));
|
||||
pbomParent.setModifyTime(LocalDateTime.now());
|
||||
pbomParent.setDeptRowId(SessionUtil.getDepartRowId());
|
||||
pbomParent.setSource(PbomSourceEnum.FROM_CHANGE.getValue());
|
||||
if (rootIs) {
|
||||
pbomParent.setRootIs(1);
|
||||
pbomParent.setUserRootIs(1);
|
||||
}
|
||||
this.parentResult.add(pbomParent);
|
||||
|
||||
//设置旧版本的状态
|
||||
SpringUtil.getBean(BomNewPbomParentService.class)
|
||||
.lambdaUpdate()
|
||||
.eq(BomNewPbomParentEntity::getRowId, parentVO.getBomRowId())
|
||||
.set(BomNewPbomParentEntity::getLastVersionIs, 0)
|
||||
.set(BomNewPbomParentEntity::getModifyTime, LocalDateTime.now())
|
||||
.update();
|
||||
|
||||
buildChild(parentVO, pbomParent);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue