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

This commit is contained in:
曹鹏飞 2024-03-31 19:45:36 +08:00
commit c593a6341e
6 changed files with 47 additions and 13 deletions

View File

@ -183,8 +183,8 @@ public class EbomApi extends BaseApi {
extra = "{{#exportParam.toString()}}", type = "Ebom-编辑导出") extra = "{{#exportParam.toString()}}", type = "Ebom-编辑导出")
public void editExportBom(@RequestBody EbomEditExportDTO exportParam , HttpServletResponse response) throws IOException { public void editExportBom(@RequestBody EbomEditExportDTO exportParam , HttpServletResponse response) throws IOException {
VUtils.isTure(CollUtil.isEmpty(exportParam.getList()) && exportParam.getBomRowId()<=0).throwMessage("请选择要导出的物料行"); VUtils.isTure(CollUtil.isEmpty(exportParam.getList()) && exportParam.getBomRowId()<=0).throwMessage("请选择要导出的物料行");
EecExcelUtil.setResponseExcelHeader(response, "bom列表");
bomNewEbomParentService.editExportBom(exportParam, response); bomNewEbomParentService.editExportBom(exportParam, response.getOutputStream());
} }
@ -343,10 +343,10 @@ public class EbomApi extends BaseApi {
void checkDeleteRule(BomNewEBomParentEditDTO dto){ void checkDeleteRule(BomNewEBomParentEditDTO dto){
if(CollUtil.isNotEmpty(dto.getDelDatas()) && CollUtil.isNotEmpty(dto.getDelDatas())){ if(CollUtil.isNotEmpty(dto.getDelDatas()) && CollUtil.isNotEmpty(dto.getDatas())){
List<Long> delList=dto.getDelDatas().stream().map(BomNewEbomParentVO::getRowId).collect(Collectors.toList()); List<Long> delList=dto.getDelDatas().stream().map(BomNewEbomParentVO::getRowId).collect(Collectors.toList());
List<Long> dataList=dto.getDelDatas().stream().filter(u-> ObjectUtil.isNotNull(u.getRowId())&& u.getRowId().longValue()>0).map(BomNewEbomParentVO::getRowId).collect(Collectors.toList()); List<Long> dataList=dto.getDatas().stream().filter(u-> ObjectUtil.isNotNull(u.getRowId())&& u.getRowId().longValue()>0).map(BomNewEbomParentVO::getRowId).collect(Collectors.toList());
// 删除编辑出现相同(互斥) // 删除编辑出现相同(互斥)
List<Long> sameList= CollectionUtil.intersection(delList,dataList).stream().collect(Collectors.toList());; List<Long> sameList= CollectionUtil.intersection(delList,dataList).stream().collect(Collectors.toList());;

View File

@ -181,6 +181,11 @@ public class BomNewEbomChildEntity implements Serializable {
@ApiModelProperty(value = "异常状态1=正常、2=冻结/完全弃用异常、3=递归异常、4=数据不完整异常、5=超级物料异常、6=重复异常") @ApiModelProperty(value = "异常状态1=正常、2=冻结/完全弃用异常、3=递归异常、4=数据不完整异常、5=超级物料异常、6=重复异常")
private Integer exceptionStatus; private Integer exceptionStatus;
@TableField(value = "exception_tag")
@ApiModelProperty(value = "异常确认标记")
private String exceptionTag;
/** /**
* 来源1-原BOM转换 2-EXCE导入 3-MDM创建 * 来源1-原BOM转换 2-EXCE导入 3-MDM创建
*/ */
@ -214,6 +219,12 @@ public class BomNewEbomChildEntity implements Serializable {
@ApiModelProperty("BOM-版本Row_id(parent表row_id 关联)") @ApiModelProperty("BOM-版本Row_id(parent表row_id 关联)")
private Long bomVersionRowId; private Long bomVersionRowId;
private static final long serialVersionUID = -14147430944632372L; private static final long serialVersionUID = -14147430944632372L;
} }

View File

@ -324,6 +324,11 @@ public class BomNewEbomParentVO extends BaseMaterialVO implements Serializable {
@ApiModelProperty("生成虚拟包的跟节点物料编码") @ApiModelProperty("生成虚拟包的跟节点物料编码")
private String virtualPartRootMaterialNo; private String virtualPartRootMaterialNo;
@ApiModelProperty(value = "异常确认标记")
private String exceptionTag;
private List<BomNewEbomParentVO> childNodes = Collections.emptyList(); private List<BomNewEbomParentVO> childNodes = Collections.emptyList();
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;

View File

@ -1,5 +1,6 @@
package com.nflg.product.bomnew.pojo.vo; package com.nflg.product.bomnew.pojo.vo;
import cn.hutool.core.util.ObjectUtil;
import com.nflg.product.bomnew.constant.EBomExceptionStatusEnum; import com.nflg.product.bomnew.constant.EBomExceptionStatusEnum;
import com.nflg.product.bomnew.constant.EBomStatusEnum; import com.nflg.product.bomnew.constant.EBomStatusEnum;
import com.nflg.product.bomnew.constant.MateiralStateEnum; import com.nflg.product.bomnew.constant.MateiralStateEnum;
@ -19,7 +20,10 @@ public class EbomExcelEditVO {
private String errorStatus; private String errorStatus;
public String getErrorStatus(){ public String getErrorStatus(){
return EnumUtils.getValueEnum(EBomExceptionStatusEnum.class, this.status).getDescription(); if(ObjectUtil.isNull(this.exceptionStatus)){
return "";
}
return EnumUtils.getValueEnum(EBomExceptionStatusEnum.class, this.exceptionStatus).getDescription();
} }
private Integer exceptionStatus; private Integer exceptionStatus;
@ExcelColumn(value ="序号",colIndex = 1) @ExcelColumn(value ="序号",colIndex = 1)
@ -79,16 +83,16 @@ public class EbomExcelEditVO {
@ExcelColumn(value ="类别",colIndex = 13) @ExcelColumn(value ="类别",colIndex = 13)
private String categoryName; private String categoryName;
@ExcelColumn(value ="创建日期",colIndex = 14) @ExcelColumn(value ="创建日期",format = "yyyy-MM-dd hh:mm:ss",colIndex = 14)
private LocalDateTime createdTime; private LocalDateTime createdTime;
@ExcelColumn(value ="修改日期",colIndex = 15) @ExcelColumn(value ="修改日期",format = "yyyy-MM-dd hh:mm:ss",colIndex = 15)
private LocalDateTime modifTime; private LocalDateTime modifTime;
@ExcelColumn(value ="有效起始日",colIndex = 16) @ExcelColumn(value ="有效起始日",format = "yyyy-MM-dd hh:mm:ss",colIndex = 16)
private String startTime; private String startTime;
public LocalDateTime getStartTime(){ public LocalDateTime getStartTime(){
return createdTime; return createdTime;
} }
@ExcelColumn(value ="版本过期时间",colIndex = 17) @ExcelColumn(value ="版本过期时间",format = "yyyy-MM-dd hh:mm:ss",colIndex = 17)
private LocalDateTime expireEndTime; private LocalDateTime expireEndTime;
@ExcelColumn(value ="物料状态",colIndex = 18) @ExcelColumn(value ="物料状态",colIndex = 18)
@ -97,7 +101,7 @@ public class EbomExcelEditVO {
private Integer materialState; private Integer materialState;
public String getMaterialStateStr() { public String getMaterialStateStr() {
return EnumUtils.getValueEnum(MateiralStateEnum.class, this.status).getDescription(); return EnumUtils.getValueEnum(MateiralStateEnum.class, this.materialState).getDescription();
} }

View File

@ -47,6 +47,7 @@ import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.io.OutputStream;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.*; import java.util.*;
@ -837,7 +838,7 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
} }
public void editExportBom(EbomEditExportDTO param, HttpServletResponse response) throws IOException { public void editExportBom(EbomEditExportDTO param, OutputStream response) throws IOException {
List<BomNewEbomParentVO> result=param.getList(); List<BomNewEbomParentVO> result=param.getList();
if(CollUtil.isEmpty(param.getList())){ if(CollUtil.isEmpty(param.getList())){
result=getChild(param.getBomRowId()); result=getChild(param.getBomRowId());
@ -1119,8 +1120,18 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
throw new NflgBusinessException(STATE.BusinessError, StrUtil.format("物料编号 {} 状态为已发布PBOM无法退回设计", StrUtil.join(",", materialNoList))); throw new NflgBusinessException(STATE.BusinessError, StrUtil.format("物料编号 {} 状态为已发布PBOM无法退回设计", StrUtil.join(",", materialNoList)));
} }
List<BomNewEbomParentVO> waitCheckList = bomTreeList.stream().filter(item -> EBomStatusEnum.WAIT_CHECK.getValue().equals(item.getStatus())).collect(Collectors.toList());
if (CollectionUtil.isNotEmpty(waitCheckList)) {
List<String> materialNoList = waitCheckList.stream().map(BomNewEbomParentVO::getMaterialNo).collect(Collectors.toList());
throw new NflgBusinessException(STATE.BusinessError, StrUtil.format("物料编号 {} 状态为待复核,无法退回设计", StrUtil.join(",", materialNoList)));
}
revertList.clear(); revertList.clear();
//忽略叶子节点 工艺人员 //忽略叶子节点 工艺人员不退回设计
revertList.addAll(bomTreeList.stream() revertList.addAll(bomTreeList.stream()
.filter(u -> u.getBomRowId() > 0 && !Objects.equals(UserJobEnum.ENGINEER.getValue(),u.getCreatedJob())) .filter(u -> u.getBomRowId() > 0 && !Objects.equals(UserJobEnum.ENGINEER.getValue(),u.getCreatedJob()))
.map(BomNewEbomParentVO::getBomRowId).collect(Collectors.toList())); .map(BomNewEbomParentVO::getBomRowId).collect(Collectors.toList()));
@ -1237,6 +1248,7 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
.set(BomNewEbomParentEntity::getAuditUserName, SessionUtil.getUserName()) .set(BomNewEbomParentEntity::getAuditUserName, SessionUtil.getUserName())
.set(BomNewEbomParentEntity::getStatus, EBomStatusEnum.CHECKED.getValue()) .set(BomNewEbomParentEntity::getStatus, EBomStatusEnum.CHECKED.getValue())
.set(BomNewEbomParentEntity::getEditStatus, EbomEditStatusEnum.HANDLER_FINISHED.getValue()) .set(BomNewEbomParentEntity::getEditStatus, EbomEditStatusEnum.HANDLER_FINISHED.getValue())
.set(BomNewEbomParentEntity::getRevertDesc,"")
.in(BomNewEbomParentEntity::getRowId, updateReviewIdList); .in(BomNewEbomParentEntity::getRowId, updateReviewIdList);
//child表状态变更 //child表状态变更

View File

@ -26,6 +26,8 @@
<result column="modify_time" property="modifyTime" jdbcType="TIMESTAMP"/> <result column="modify_time" property="modifyTime" jdbcType="TIMESTAMP"/>
<result column="edit_status" property="editStatus" jdbcType="INTEGER"/> <result column="edit_status" property="editStatus" jdbcType="INTEGER"/>
<result column="exception_status" property="exceptionStatus" jdbcType="INTEGER"/> <result column="exception_status" property="exceptionStatus" jdbcType="INTEGER"/>
<result column="exception_tag" property="exceptionTag" jdbcType="VARCHAR"/>
<result column="source" property="source" jdbcType="INTEGER"/> <result column="source" property="source" jdbcType="INTEGER"/>
<result column="source_row_id" property="sourceRowId" jdbcType="BIGINT"/> <result column="source_row_id" property="sourceRowId" jdbcType="BIGINT"/>
<result column="remark" property="remark" jdbcType="VARCHAR"/> <result column="remark" property="remark" jdbcType="VARCHAR"/>
@ -39,7 +41,7 @@
row_id, parent_row_id, identity_no, order_number, drawing_no, material_no, material_name, material_desc, row_id, parent_row_id, identity_no, order_number, drawing_no, material_no, material_name, material_desc,
material_texture, material_unit, material_category_code, unit_weight, num, total_weight, project_type, material_texture, material_unit, material_category_code, unit_weight, num, total_weight, project_type,
project_type_input_type, created_by,virtual_part_is, created_time, modify_time, edit_status, exception_status, source, project_type_input_type, created_by,virtual_part_is, created_time, modify_time, edit_status, exception_status, source,
source_row_id, remark,virtual_part_type,virtual_part_root_material_no,bom_version_row_id source_row_id, remark,virtual_part_type,virtual_part_root_material_no,bom_version_row_id,exception_tag
</sql> </sql>