退回设计 设计复核调整
This commit is contained in:
parent
17293e495d
commit
e59cc27d2a
|
|
@ -23,4 +23,7 @@ public class BomNewEBomRevertDTO {
|
|||
|
||||
@ApiModelProperty("必填,行id列表")
|
||||
private List<Long> rowIdList;
|
||||
@ApiModelProperty("退回描述")
|
||||
private String revertDesc;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -296,6 +296,11 @@ public class BomNewEbomParentEntity implements Serializable {
|
|||
@ApiModelProperty(value = "退回人")
|
||||
private String revertUserName;
|
||||
|
||||
@TableField(value = "revert_desc")
|
||||
@ApiModelProperty(value = "退回原因")
|
||||
private String revertDesc;
|
||||
|
||||
|
||||
/**
|
||||
* 版本过期时间=下个版本的创建时间
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1130,43 +1130,44 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
|||
throw new NflgBusinessException(STATE.BusinessError, StrUtil.format("物料编号 {} 状态为已发布PBOM,无法退回设计", StrUtil.join(",", materialNoList)));
|
||||
|
||||
}
|
||||
|
||||
revertList.clear();
|
||||
//忽略叶子节点 和 工艺人员
|
||||
revertList.addAll(bomTreeList.stream()
|
||||
.filter(u -> u.getBomRowId() > 0 && !Objects.equals(UserJobEnum.ENGINEER.getValue(),u.getCreatedJob()))
|
||||
.map(BomNewEbomParentVO::getBomRowId).collect(Collectors.toList()));
|
||||
}
|
||||
|
||||
|
||||
if (CollectionUtil.isNotEmpty(revertList)) {
|
||||
//parent表状态
|
||||
UpdateWrapper<BomNewEbomParentEntity> updateWrapper = new UpdateWrapper<>();
|
||||
updateWrapper.lambda()
|
||||
.set(BomNewEbomParentEntity::getRevertTime, LocalDateTime.now())
|
||||
.set(BomNewEbomParentEntity::getRevertUserName, SessionUtil.getUserName())
|
||||
.set(BomNewEbomParentEntity::getStatus, EBomStatusEnum.RETURNED.getValue())
|
||||
.set(BomNewEbomParentEntity::getEditStatus, EbomEditStatusEnum.HANDLER_CREATED.getValue())
|
||||
.in(BomNewEbomParentEntity::getRowId, revertList);
|
||||
|
||||
//child 表状态
|
||||
UpdateWrapper<BomNewEbomChildEntity> childWrapper = new UpdateWrapper<>();
|
||||
childWrapper.lambda()
|
||||
.set(BomNewEbomChildEntity::getModifyTime, LocalDateTime.now())
|
||||
.set(BomNewEbomChildEntity::getEditStatus, EbomEditStatusEnum.HANDLER_CREATED.getValue())
|
||||
.in(BomNewEbomChildEntity::getParentRowId, revertList);
|
||||
if (CollectionUtil.isNotEmpty(revertList)) {
|
||||
//parent表状态
|
||||
UpdateWrapper<BomNewEbomParentEntity> updateWrapper = new UpdateWrapper<>();
|
||||
updateWrapper.lambda()
|
||||
.set(BomNewEbomParentEntity::getRevertTime, LocalDateTime.now())
|
||||
.set(BomNewEbomParentEntity::getRevertUserName, SessionUtil.getUserName())
|
||||
.set(BomNewEbomParentEntity::getRevertDesc,dto.getRevertDesc())
|
||||
.set(BomNewEbomParentEntity::getStatus, EBomStatusEnum.RETURNED.getValue())
|
||||
.set(BomNewEbomParentEntity::getEditStatus, EbomEditStatusEnum.HANDLER_CREATED.getValue())
|
||||
.in(BomNewEbomParentEntity::getRowId, revertList);
|
||||
|
||||
//child 表状态
|
||||
UpdateWrapper<BomNewEbomChildEntity> childWrapper = new UpdateWrapper<>();
|
||||
childWrapper.lambda()
|
||||
.set(BomNewEbomChildEntity::getModifyTime, LocalDateTime.now())
|
||||
.set(BomNewEbomChildEntity::getEditStatus, EbomEditStatusEnum.HANDLER_CREATED.getValue())
|
||||
.in(BomNewEbomChildEntity::getParentRowId, revertList);
|
||||
|
||||
this.update(updateWrapper );
|
||||
ebomChildService.update(childWrapper) ;
|
||||
|
||||
this.update(updateWrapper );
|
||||
if (!ebomChildService.update(childWrapper)) {
|
||||
throw new NflgBusinessException(STATE.Error, "退回设计失败");
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
VUtils.isTure(true).throwMessage("没有需要退回设计的物料");
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1185,7 +1186,7 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
|||
|
||||
List<Long> rowIds = dto.getRowIdList();
|
||||
|
||||
List<BomNewEbomParentEntity> bomNewEbomParentEntityList = this.lambdaQuery().in(BomNewEbomParentEntity::getUserRootIs, rowIds).eq(BomNewEbomParentEntity::getUserRootIs, 1).list();
|
||||
List<BomNewEbomParentEntity> bomNewEbomParentEntityList = this.lambdaQuery().in(BomNewEbomParentEntity::getRowId, rowIds).eq(BomNewEbomParentEntity::getUserRootIs, 1).list();
|
||||
|
||||
if (CollUtil.isEmpty(bomNewEbomParentEntityList)) {
|
||||
// return ResultVO.error("下级BOM无法进行复核");
|
||||
|
|
@ -1477,7 +1478,7 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
|||
|
||||
LogRecordContext.putVariable("bom", parentEntity);
|
||||
|
||||
VUtils.isTure(Objects.isNull(parentEntity)).throwMessage("该节点不存在,请检查参数是否正确");
|
||||
VUtils.isTure(Objects.isNull(parentEntity)).throwMessage("选择节点不是顶层");
|
||||
|
||||
//设计人员只能删自己
|
||||
checkUserRoleAuth(parentEntity.getCreatedBy());
|
||||
|
|
@ -1486,10 +1487,10 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
|||
// }
|
||||
|
||||
//待复核和已退回才能删除
|
||||
// VUtils.isTure(!(parentEntity.getStatus().equals(EBomStatusEnum.WAIT_CHECK.getValue())
|
||||
// || parentEntity.getStatus().equals(EBomStatusEnum.RETURNED.getValue())))
|
||||
// .throwMessage(EBomStatusEnum.findByValue(parentEntity.getStatus()).getDescription() + "状态不能删除");
|
||||
|
||||
VUtils.isTure(!(parentEntity.getStatus().equals(EBomStatusEnum.WAIT_CHECK.getValue())
|
||||
|| parentEntity.getStatus().equals(EBomStatusEnum.RETURNED.getValue())))
|
||||
.throwMessage(EBomStatusEnum.findByValue(parentEntity.getStatus()).getDescription() + "状态不能删除");
|
||||
|
||||
EBomDel eBomDel = new EBomDel(bomRowId);
|
||||
eBomDel.classifyBom();
|
||||
|
|
@ -1501,11 +1502,9 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
|||
.map(BomNewEbomParentVO::getBomRowId) .collect(Collectors.toList());
|
||||
|
||||
|
||||
//取bom信息删除
|
||||
//取bom信息删除 parent child删除
|
||||
this.getBaseMapper().delBatch(bomRowIdList);
|
||||
QueryWrapper<BomNewEbomChildEntity > delChildQuery=new QueryWrapper<>();
|
||||
delChildQuery.lambda().in(BomNewEbomChildEntity::getParentRowId,bomRowIdList);
|
||||
SpringUtil.getBean(BomNewEbomChildService.class).getBaseMapper().delete(delChildQuery);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ public class EBomDel {
|
|||
|
||||
//设计人员: 自己创建的直接删除
|
||||
//工艺岗位,只能删除自己在EBOM中创建的数据
|
||||
// 原始bom导入过来的只能 设计人员自己删,工艺不能删
|
||||
// 原始bom导入过来的只能 设计人员自己删,工艺不能删;双角色可以删自己数据
|
||||
//设计人员在Ebom中创建的数据 工艺人员可以删除?
|
||||
if(roleList.contains(EBomConstant.DESIGNER)){
|
||||
delEBom = bomTreeAll.stream().filter(u -> u.getBomRowId() > 0
|
||||
|
|
@ -62,7 +62,7 @@ public class EBomDel {
|
|||
|
||||
|
||||
//借用件不能删除,原始bom转换只能删自己
|
||||
if(roleList.contains(EBomConstant.DESIGNER)){
|
||||
// if(roleList.contains(EBomConstant.DESIGNER)){
|
||||
revertOBom = bomTreeAll.stream().filter(u -> u.getBomRowId() > 0
|
||||
&& (u.getSource().equals(EBomSourceEnum.FROM_BOM.getValue())
|
||||
&& u.getCreatedBy().equals(SessionUtil.getUserCode())
|
||||
|
|
@ -72,7 +72,7 @@ public class EBomDel {
|
|||
if (CollectionUtil.isNotEmpty(revertOBom)) {
|
||||
delEBom.addAll(revertOBom);
|
||||
}
|
||||
}
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -81,11 +81,16 @@ public class EBomEdit {
|
|||
parent.setStatus(SpringUtil.getBean(UserRoleService.class).technician() ? EBomStatusEnum.CHECKED.getValue() : EBomStatusEnum.WAIT_CHECK.getValue());
|
||||
parent.setCreatedJob(SpringUtil.getBean(UserRoleService.class).technician() ? UserJobEnum.ENGINEER.getValue() : UserJobEnum.DESIGNER.getValue());
|
||||
|
||||
|
||||
parent.setCreatedTime(LocalDateTime.now());
|
||||
parent.setModifyTime(LocalDateTime.now());
|
||||
|
||||
parent.setExpireEndTime( LocalDateTime.parse("9999-12-31 23:59:59", DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss") ));
|
||||
|
||||
|
||||
Integer rootIs =SpringUtil.getBean(BomNewEbomParentService.class).getBaseMapper().checkIsRoot(parent.getMaterialNo());
|
||||
Integer userRootIs = SpringUtil.getBean(BomNewEbomParentService.class).getBaseMapper().checkIsUserRoot(parent.getMaterialNo(), parent.getCreatedBy());
|
||||
parent.setRootIs(rootIs);
|
||||
parent.setUserRootIs(userRootIs);
|
||||
return parent;
|
||||
}
|
||||
|
||||
|
|
@ -102,13 +107,11 @@ public class EBomEdit {
|
|||
|
||||
void createRootBom(BomNewEBomParentEditDTO createDTO) {
|
||||
|
||||
checkHadBom(createDTO.getParent().getMaterialNo());
|
||||
// checkHadBom(createDTO.getParent().getMaterialNo());
|
||||
|
||||
parentEntity = createParentBomInfo(createDTO.getParent());
|
||||
parentEntity.setEditStatus(createDTO.getOpType());
|
||||
|
||||
parentEntity.setRootIs(1);
|
||||
parentEntity.setUserRootIs(1);
|
||||
createDTO.getDatas().forEach(k -> {
|
||||
k.setParentRowId(parentEntity.getRowId());
|
||||
});
|
||||
|
|
@ -288,7 +291,7 @@ public class EBomEdit {
|
|||
//缺bom
|
||||
if (dto.getParent().getBomRowId() == null || dto.getParent().getBomRowId().longValue() == 0) {
|
||||
|
||||
checkHadBom(dto.getParent().getMaterialNo());
|
||||
// checkHadBom(dto.getParent().getMaterialNo());
|
||||
dto.getParent().setBomRowId(dto.getParent().getRowId());
|
||||
parentEntity = createParentBomInfo(dto.getParent());
|
||||
|
||||
|
|
|
|||
|
|
@ -39,6 +39,8 @@
|
|||
<result column="audit_user_name" property="auditUserName" jdbcType="VARCHAR"/>
|
||||
<result column="release_time" property="releaseTime" jdbcType="TIMESTAMP"/>
|
||||
<result column="release_user_name" property="releaseUserName" jdbcType="VARCHAR"/>
|
||||
<result column="revert_desc" property="revertDesc" jdbcType="VARCHAR"/>
|
||||
|
||||
<result column="revert_time" property="revertTime" jdbcType="TIMESTAMP"/>
|
||||
<result column="revert_user_name" property="revertUserName" jdbcType="VARCHAR"/>
|
||||
<result column="expire_end_time" property="expireEndTime" jdbcType="TIMESTAMP"/>
|
||||
|
|
@ -59,7 +61,7 @@
|
|||
status, user_root_is, exception_status,virtual_package_is, source_row_id, devise_user_code, devise_name,
|
||||
created_by, created_time, created_job, audit_time, audit_user_name, release_time, release_user_name,
|
||||
revert_time, revert_user_name, expire_end_time, convert_to_ebom_time, remark, dept_name, level_num, change_desc,
|
||||
notice_nums, modify_time
|
||||
notice_nums, modify_time,revert_desc
|
||||
</sql>
|
||||
|
||||
<sql id="whr">
|
||||
|
|
|
|||
Loading…
Reference in New Issue