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

This commit is contained in:
大米 2024-06-18 10:37:33 +08:00
commit 5d74b9e8d0
10 changed files with 661 additions and 549 deletions

View File

@ -0,0 +1,63 @@
package com.nflg.product.bomnew.advice;
import cn.hutool.core.util.StrUtil;
import com.nflg.product.bomnew.util.JsonUtil;
import lombok.extern.slf4j.Slf4j;
import nflg.product.common.constant.STATE;
import nflg.product.common.util.JwtUtil;
import nflg.product.common.vo.ResultVO;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.core.MethodParameter;
import org.springframework.http.HttpInputMessage;
import org.springframework.http.converter.HttpMessageConverter;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.servlet.mvc.method.annotation.RequestBodyAdvice;
import java.lang.reflect.Type;
/**
* @author 曹鹏飞
* @date 2024/6/18 09:41:31
*/
@Slf4j
@ControllerAdvice
@RefreshScope
public class LoggingRequestBodyAdvice implements RequestBodyAdvice {
@Value("${logging.http.detailed:false}")
private Boolean enableHttpDetailed;
@Override
public boolean supports(MethodParameter methodParameter, Type type, Class<? extends HttpMessageConverter<?>> aClass) {
return enableHttpDetailed;
}
@Override
public HttpInputMessage beforeBodyRead(HttpInputMessage httpInputMessage, MethodParameter methodParameter, Type type, Class<? extends HttpMessageConverter<?>> aClass) {
return httpInputMessage;
}
@Override
public Object afterBodyRead(Object o, HttpInputMessage httpInputMessage, MethodParameter methodParameter, Type type, Class<? extends HttpMessageConverter<?>> aClass) {
try {
log.info("请求参数: {}", JsonUtil.toJson(o));
log.info("请求头: {}", JsonUtil.toJson(httpInputMessage.getHeaders()));
String token = httpInputMessage.getHeaders().getFirst("Authorization");
if (StrUtil.isNotBlank(token)) {
ResultVO result = JwtUtil.parse(token);
if (result.getState().equals(STATE.Success.getState())) {
log.info("请求用户: {}", JsonUtil.toJson(result.getData()));
}
}
} catch (Exception ex) {
log.error("读取请求体出错", ex);
}
return o;
}
@Override
public Object handleEmptyBody(Object o, HttpInputMessage httpInputMessage, MethodParameter methodParameter, Type type, Class<? extends HttpMessageConverter<?>> aClass) {
return o;
}
}

View File

@ -0,0 +1,41 @@
package com.nflg.product.bomnew.advice;
import com.nflg.product.bomnew.util.JsonUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.core.MethodParameter;
import org.springframework.http.MediaType;
import org.springframework.http.converter.HttpMessageConverter;
import org.springframework.http.server.ServerHttpRequest;
import org.springframework.http.server.ServerHttpResponse;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.servlet.mvc.method.annotation.ResponseBodyAdvice;
/**
* @author 曹鹏飞
* @date 2024/6/18 09:42:06
*/
@Slf4j
@ControllerAdvice
@RefreshScope
public class LoggingResponseBodyAdvice implements ResponseBodyAdvice<Object> {
@Value("${logging.http.detailed:false}")
private Boolean enableHttpDetailed;
@Override
public boolean supports(MethodParameter methodParameter, Class<? extends HttpMessageConverter<?>> aClass) {
return enableHttpDetailed;
}
@Override
public Object beforeBodyWrite(Object o, MethodParameter methodParameter, MediaType mediaType, Class<? extends HttpMessageConverter<?>> aClass, ServerHttpRequest serverHttpRequest, ServerHttpResponse serverHttpResponse) {
try {
log.info("响应数据: {}", JsonUtil.toJson(o));
} catch (Exception ex) {
log.error("读取响应数据出错", ex);
}
return o;
}
}

View File

@ -22,194 +22,194 @@ import java.time.LocalDateTime;
@Accessors(chain = true)
@ApiModel(value = "com-nflg-product-bomnew-pojo-new-entity-BomNewEbomChildFormalEntity")
@TableName(value = "t_bom_new_ebom_child_formal")
public class BomNewEbomChildFormalEntity implements Serializable {
public class BomNewEbomChildFormalEntity extends BomNewEbomChildEntity {
/**
* 主键-雪花
*/
@TableId(value = "row_id", type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "主键-雪花")
private Long rowId;
/**
* 父行ID
*/
@TableField(value = "parent_row_id")
@ApiModelProperty(value = "父行ID")
private Long parentRowId;
/**
* 父级id_子级ID(原父节点ID)
*/
@TableField(value = "identity_no")
@ApiModelProperty(value = "父级id_子级ID(原父节点ID)")
private String identityNo;
/**
* 排序号
*/
@TableField(value = "order_number")
@ApiModelProperty(value = "排序号")
private String orderNumber;
/**
* 图号
*/
@TableField(value = "drawing_no")
@ApiModelProperty(value = "图号")
private String drawingNo;
/**
* 物料编码
*/
@TableField(value = "material_no")
@ApiModelProperty(value = "物料编码")
private String materialNo;
/**
* 物料名称
*/
@TableField(value = "material_name")
@ApiModelProperty(value = "物料名称")
private String materialName;
/**
* 物料描述
*/
@TableField(value = "material_desc")
@ApiModelProperty(value = "物料描述")
private String materialDesc;
/**
* 材质
*/
@TableField(value = "material_texture")
@ApiModelProperty(value = "材质")
private String materialTexture;
/**
* 单位
*/
@TableField(value = "material_unit")
@ApiModelProperty(value = "单位")
private String materialUnit;
/**
* 物料分类编码
*/
@TableField(value = "material_category_code")
@ApiModelProperty(value = "物料分类编码")
private String materialCategoryCode;
/**
* 单重
*/
@TableField(value = "unit_weight")
@ApiModelProperty(value = "单重")
private BigDecimal unitWeight;
/**
* 数量
*/
@TableField(value = "num")
@ApiModelProperty(value = "数量")
private BigDecimal num;
/**
* 总重
*/
@TableField(value = "total_weight")
@ApiModelProperty(value = "总重")
private BigDecimal totalWeight;
/**
* 项目类别
*/
@TableField(value = "project_type")
@ApiModelProperty(value = "项目类别")
private String projectType;
/**
* 项目类别输入方式: 0-自动匹配 1-手工录入 2-来自物料主数据 3-来自历史统计
*/
@TableField(value = "project_type_input_type")
@ApiModelProperty(value = "项目类别输入方式: 0-自动匹配 1-手工录入 2-来自物料主数据 3-来自历史统计")
private Integer projectTypeInputType;
/**
* 创建人工号
*/
@TableField(value = "created_by")
@ApiModelProperty(value = "创建人工号")
private String createdBy;
/**
* 是否虚拟件 0- 1-
*/
@TableField(value = "virtual_part_is")
@ApiModelProperty(value = "是否虚拟件 0-否 1-是")
private Integer virtualPartIs;
/**
* 创建时间
*/
@TableField(value = "created_time")
@ApiModelProperty(value = "创建时间")
private LocalDateTime createdTime;
/**
* 更新时间
*/
@TableField(value = "modify_time")
@ApiModelProperty(value = "更新时间")
private LocalDateTime modifyTime;
/**
* 处理状态1=待处理2=已处理
*/
@TableField(value = "edit_status")
@ApiModelProperty(value = "处理状态1=待处理、2=已处理")
private Integer editStatus;
/**
* 异常状态1=正常2=冻结/完全弃用异常3=递归异常4=数据不完整异常5=超级物料异常6=重复异常
*/
@TableField(value = "exception_status")
@ApiModelProperty(value = "异常状态1=正常、2=冻结/完全弃用异常、3=递归异常、4=数据不完整异常、5=超级物料异常、6=重复异常")
private Integer exceptionStatus;
/**
* 来源1-原BOM转换 2-EXCE导入 3-MDM创建
*/
@TableField(value = "source")
@ApiModelProperty(value = "来源1-原BOM转换 2-EXCE导入 3-MDM创建")
private Integer source;
/**
* 来源行ID(原始BOM中的行ID)
*/
@TableField(value = "source_row_id")
@ApiModelProperty(value = "来源行ID(原始BOM中的行ID)")
private Long sourceRowId;
/**
* 备注
*/
@TableField(value = "remark")
@ApiModelProperty(value = "备注")
private String remark;
@TableField(value = "virtual_part_type")
@ApiModelProperty(value = "0-非虚拟包 1-发货包 2-制作包 4-直发包 8-发货前装配包")
private Integer virtualPartType;
@TableField(value = "virtual_part_root_material_no")
@ApiModelProperty(value = "生成虚拟包跟物料编码")
private String virtualPartRootMaterialNo;
@TableField(value = "bom_version_row_id")
@ApiModelProperty("BOM-版本Row_id(parent表row_id 关联)")
private Long bomVersionRowId;
// /**
// * 主键-雪花
// */
// @TableId(value = "row_id", type = IdType.ASSIGN_ID)
// @ApiModelProperty(value = "主键-雪花")
// private Long rowId;
//
// /**
// * 父行ID
// */
// @TableField(value = "parent_row_id")
// @ApiModelProperty(value = "父行ID")
// private Long parentRowId;
//
// /**
// * 父级id_子级ID(原父节点ID)
// */
// @TableField(value = "identity_no")
// @ApiModelProperty(value = "父级id_子级ID(原父节点ID)")
// private String identityNo;
//
// /**
// * 排序号
// */
// @TableField(value = "order_number")
// @ApiModelProperty(value = "排序号")
// private String orderNumber;
//
// /**
// * 图号
// */
// @TableField(value = "drawing_no")
// @ApiModelProperty(value = "图号")
// private String drawingNo;
//
// /**
// * 物料编码
// */
// @TableField(value = "material_no")
// @ApiModelProperty(value = "物料编码")
// private String materialNo;
//
// /**
// * 物料名称
// */
// @TableField(value = "material_name")
// @ApiModelProperty(value = "物料名称")
// private String materialName;
//
// /**
// * 物料描述
// */
// @TableField(value = "material_desc")
// @ApiModelProperty(value = "物料描述")
// private String materialDesc;
//
// /**
// * 材质
// */
// @TableField(value = "material_texture")
// @ApiModelProperty(value = "材质")
// private String materialTexture;
//
// /**
// * 单位
// */
// @TableField(value = "material_unit")
// @ApiModelProperty(value = "单位")
// private String materialUnit;
//
// /**
// * 物料分类编码
// */
// @TableField(value = "material_category_code")
// @ApiModelProperty(value = "物料分类编码")
// private String materialCategoryCode;
//
// /**
// * 单重
// */
// @TableField(value = "unit_weight")
// @ApiModelProperty(value = "单重")
// private BigDecimal unitWeight;
//
// /**
// * 数量
// */
// @TableField(value = "num")
// @ApiModelProperty(value = "数量")
// private BigDecimal num;
//
// /**
// * 总重
// */
// @TableField(value = "total_weight")
// @ApiModelProperty(value = "总重")
// private BigDecimal totalWeight;
//
// /**
// * 项目类别
// */
// @TableField(value = "project_type")
// @ApiModelProperty(value = "项目类别")
// private String projectType;
//
// /**
// * 项目类别输入方式: 0-自动匹配 1-手工录入 2-来自物料主数据 3-来自历史统计
// */
// @TableField(value = "project_type_input_type")
// @ApiModelProperty(value = "项目类别输入方式: 0-自动匹配 1-手工录入 2-来自物料主数据 3-来自历史统计")
// private Integer projectTypeInputType;
//
// /**
// * 创建人工号
// */
// @TableField(value = "created_by")
// @ApiModelProperty(value = "创建人工号")
// private String createdBy;
//
// /**
// * 是否虚拟件 0- 1-
// */
// @TableField(value = "virtual_part_is")
// @ApiModelProperty(value = "是否虚拟件 0-否 1-是")
// private Integer virtualPartIs;
//
// /**
// * 创建时间
// */
// @TableField(value = "created_time")
// @ApiModelProperty(value = "创建时间")
// private LocalDateTime createdTime;
//
// /**
// * 更新时间
// */
// @TableField(value = "modify_time")
// @ApiModelProperty(value = "更新时间")
// private LocalDateTime modifyTime;
//
// /**
// * 处理状态1=待处理2=已处理
// */
// @TableField(value = "edit_status")
// @ApiModelProperty(value = "处理状态1=待处理、2=已处理")
// private Integer editStatus;
//
// /**
// * 异常状态1=正常2=冻结/完全弃用异常3=递归异常4=数据不完整异常5=超级物料异常6=重复异常
// */
// @TableField(value = "exception_status")
// @ApiModelProperty(value = "异常状态1=正常、2=冻结/完全弃用异常、3=递归异常、4=数据不完整异常、5=超级物料异常、6=重复异常")
// private Integer exceptionStatus;
//
// /**
// * 来源1-原BOM转换 2-EXCE导入 3-MDM创建
// */
// @TableField(value = "source")
// @ApiModelProperty(value = "来源1-原BOM转换 2-EXCE导入 3-MDM创建")
// private Integer source;
//
// /**
// * 来源行ID(原始BOM中的行ID)
// */
// @TableField(value = "source_row_id")
// @ApiModelProperty(value = "来源行ID(原始BOM中的行ID)")
// private Long sourceRowId;
//
// /**
// * 备注
// */
// @TableField(value = "remark")
// @ApiModelProperty(value = "备注")
// private String remark;
//
// @TableField(value = "virtual_part_type")
// @ApiModelProperty(value = "0-非虚拟包 1-发货包 2-制作包 4-直发包 8-发货前装配包")
// private Integer virtualPartType;
//
// @TableField(value = "virtual_part_root_material_no")
// @ApiModelProperty(value = "生成虚拟包跟物料编码")
// private String virtualPartRootMaterialNo;
//
// @TableField(value = "bom_version_row_id")
// @ApiModelProperty("BOM-版本Row_id(parent表row_id 关联)")
// private Long bomVersionRowId;

View File

@ -21,339 +21,339 @@ import java.time.LocalDateTime;
@Accessors(chain = true)
@ApiModel(value = "com-nflg-product-bomnew-pojo-new-entity-BomNewEbomParentFormalEntity")
@TableName(value = "t_bom_new_ebom_parent_formal")
public class BomNewEbomParentFormalEntity implements Serializable {
/**
* 主键行ID-雪花
*/
@TableId(value = "row_id", type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "主键行ID-雪花")
private Long rowId;
/**
* 批号-来自plm-临时
*/
@TableField(value = "batch_no")
@ApiModelProperty(value = "批号-来自plm-临时")
private String batchNo;
/**
* 图号
*/
@TableField(value = "drawing_no")
@ApiModelProperty(value = "图号")
private String drawingNo;
/**
* 物料编码
*/
@TableField(value = "material_no")
@ApiModelProperty(value = "物料编码")
private String materialNo;
/**
* 排序号
*/
@TableField(value = "order_number")
@ApiModelProperty(value = "排序号")
private String orderNumber;
/**
* 物料名称
*/
@TableField(value = "material_name")
@ApiModelProperty(value = "物料名称")
private String materialName;
/**
* 物料描述
*/
@TableField(value = "material_desc")
@ApiModelProperty(value = "物料描述")
private String materialDesc;
/**
* 材质材料
*/
@TableField(value = "material_texture")
@ApiModelProperty(value = "材质,材料")
private String materialTexture;
/**
* 单位
*/
@TableField(value = "material_unit")
@ApiModelProperty(value = "单位")
private String materialUnit;
/**
* 原始单位-来自cad
*/
@TableField(value = "material_original_unit")
@ApiModelProperty(value = "原始单位-来自cad")
private String materialOriginalUnit;
/**
* 单重
*/
@TableField(value = "unit_weight")
@ApiModelProperty(value = "单重")
private BigDecimal unitWeight;
/**
* 总重
*/
@TableField(value = "total_weight")
@ApiModelProperty(value = "总重")
private BigDecimal totalWeight;
/**
* 版本号
*/
@TableField(value = "current_version")
@ApiModelProperty(value = "版本号")
private String currentVersion;
/**
* 数量
*/
@TableField(value = "num")
@ApiModelProperty(value = "数量")
private BigDecimal num;
/**
* 来源1-原BOM转换 2-EXCE导入 3-MDM创建
*/
@TableField(value = "source")
@ApiModelProperty(value = "来源1-原BOM转换 2-EXCE导入 3-MDM创建")
private Integer source;
/**
* 是否跟节点 0- 1-
*/
@TableField(value = "root_is")
@ApiModelProperty(value = "是否跟节点 0-否 1-是")
private Integer rootIs;
/**
* 是否应该有BOM 0- 1-
*/
@TableField(value = "should_bom_exist")
@ApiModelProperty(value = "是否应该有BOM 0-否 1-是")
private Integer shouldBomExist;
/**
* 超级物料 0- 1-
*/
@TableField(value = "super_material_status")
@ApiModelProperty(value = "超级物料 0-否 1-是")
private Integer superMaterialStatus;
/**
* 是否有BOM: 0- 1-
*/
@TableField(value = "bom_exist")
@ApiModelProperty(value = "是否有BOM: 0-否 1-是")
private Integer bomExist;
/**
* 是否最新版0- 1-
*/
@TableField(value = "last_version_is")
@ApiModelProperty(value = "是否最新版0-否 1-是")
private Integer lastVersionIs;
/**
* 1=待处理2=已处理
*/
@TableField(value = "edit_status")
@ApiModelProperty(value = "1=待处理、2=已处理")
private Integer editStatus;
/**
* 1=待复核2=已复核3=已退回4=定版已发布PBOM
*/
@TableField(value = "status")
@ApiModelProperty(value = "1=待复核、2=已复核、3=已退回、4=定版已发布PBOM")
private Integer status;
/**
* 是否用户跟节点 0- 1-
*/
@TableField(value = "user_root_is")
@ApiModelProperty(value = "是否用户跟节点 0-否 1-是")
private Integer userRootIs;
/**
* 已生成的虚拟包 0- 1-发货包 2-制作包 4-直发包 8-发货前装配包
*/
@TableField(value = "virtrual_package_enum")
@ApiModelProperty(value = "已生成的虚拟包 0-无 1-发货包 2-制作包 4-直发包 8-发货前装配包")
private Integer virtrualPackageEnum;
/**
* -1=初始状态 1=正常 2=冻结/完全弃用异常物料的状态冻结或者完全弃用的状态 3=递归异常出现子级包含父级的异常情况打在子级物料中的那个父级物料编码4=数据不完整异常物料编号或数量没有填写 5=超级物料异常超级物料待说明 6=重复异常当前层级包含了相同的物料信息
* 7=物料主数据不存在当前的物料信息在主数据平台不存在 8=项目类别为空
* 9=项目赋值异常当父级物料的项目类型为Q时子级中不能存在项目类别为Q的物料
* <p>
* 10=项目赋值异常当父级物料的项目类型为F时子级中不能存在项目类型为F的物料
* <p>
* 11=未填写变更原因和技术通知单
* <p>
* 12=数量需要用户确认
* <p>
* 13=项目类型需要用户确认
*/
@TableField(value = "exception_status")
@ApiModelProperty(value = "-1=初始状态 1=正常 2=冻结/完全弃用异常:物料的状态冻结或者完全弃用的状态 3=递归异常出现子级包含父级的异常情况打在子级物料中的那个父级物料编码4=数据不完整异常:物料编号或数量没有填写 5=超级物料异常:超级物料待说明 6=重复异常:当前层级包含了相同的物料信息 7= 物料主数据不存在:当前的物料信息在主数据平台不存在 8=项目类别为空 9=项目赋值异常当父级物料的项目类型为Q时子级中不能存在项目类别为Q的物料 10=项目赋值异常当父级物料的项目类型为F时子级中不能存在项目类型为F的物料 11=未填写变更原因和技术通知单 12=数量需要用户确认 13=项目类型需要用户确认")
private Integer exceptionStatus;
/**
* 是否虚拟包 0- 1-
*/
@TableField(value = "virtual_package_is")
@ApiModelProperty(value = "是否虚拟包 0-否 1-是")
private Integer virtualPackageIs;
/**
* 来源行ID(原始BOM中的行ID)
*/
@TableField(value = "source_row_id")
@ApiModelProperty(value = "来源行ID(原始BOM中的行ID)")
private Long sourceRowId;
/**
* 设计人员编码
*/
@TableField(value = "devise_user_code")
@ApiModelProperty(value = "设计人员编码")
private String deviseUserCode;
/**
* 设计人员名称
*/
@TableField(value = "devise_name")
@ApiModelProperty(value = "设计人员名称")
private String deviseName;
/**
* 创建人编码
*/
@TableField(value = "created_by")
@ApiModelProperty(value = "创建人编码")
private String createdBy;
/**
* 创建时间
*/
@TableField(value = "created_time")
@ApiModelProperty(value = "创建时间")
private LocalDateTime createdTime;
/**
* 创建人员所属岗位 0-设计人员 1-工艺人员 2-其他
*/
@TableField(value = "created_job")
@ApiModelProperty(value = "创建人员所属岗位 0-设计人员 1-工艺人员 2-其他")
private Integer createdJob;
/**
* 复核时间
*/
@TableField(value = "audit_time")
@ApiModelProperty(value = "复核时间")
private LocalDateTime auditTime;
/**
* 复核人
*/
@TableField(value = "audit_user_name")
@ApiModelProperty(value = "复核人")
private String auditUserName;
/**
* 发布时间
*/
@TableField(value = "release_time")
@ApiModelProperty(value = "发布时间")
private LocalDateTime releaseTime;
/**
* 发布人
*/
@TableField(value = "release_user_name")
@ApiModelProperty(value = "发布人")
private String releaseUserName;
/**
* 退回时间
*/
@TableField(value = "revert_time")
@ApiModelProperty(value = "退回时间")
private LocalDateTime revertTime;
/**
* 退回人
*/
@TableField(value = "revert_user_name")
@ApiModelProperty(value = "退回人")
private String revertUserName;
/**
* 版本过期时间=下个版本的创建时间
*/
@TableField(value = "expire_end_time")
@ApiModelProperty(value = "版本过期时间=下个版本的创建时间")
private LocalDateTime expireEndTime;
/**
* 转换pbom时间
*/
@TableField(value = "convert_to_ebom_time")
@ApiModelProperty(value = "转换pbom时间")
private LocalDateTime convertToEbomTime;
/**
* 备注
*/
@TableField(value = "remark")
@ApiModelProperty(value = "备注")
private String remark;
/**
* 设计维护部门名称
*/
@TableField(value = "dept_name")
@ApiModelProperty(value = "设计维护部门名称")
private String deptName;
/**
* bom树的高度
*/
@TableField(value = "level_num")
@ApiModelProperty(value = "bom树的高度")
private Integer levelNum;
/**
* 升版说明
*/
@TableField(value = "change_desc")
@ApiModelProperty(value = "升版说明")
private String changeDesc;
/**
* 通知单号
*/
@TableField(value = "notice_nums")
@ApiModelProperty(value = "通知单号")
private String noticeNums;
/**
* 修改时间
*/
@TableField(value = "modify_time")
@ApiModelProperty(value = "修改时间")
private LocalDateTime modifyTime;
private static final long serialVersionUID = 265246823929418418L;
public class BomNewEbomParentFormalEntity extends BomNewEbomParentEntity {
//
// /**
// * 主键行ID-雪花
// */
// @TableId(value = "row_id", type = IdType.ASSIGN_ID)
// @ApiModelProperty(value = "主键行ID-雪花")
// private Long rowId;
//
// /**
// * 批号-来自plm-临时
// */
// @TableField(value = "batch_no")
// @ApiModelProperty(value = "批号-来自plm-临时")
// private String batchNo;
//
// /**
// * 图号
// */
// @TableField(value = "drawing_no")
// @ApiModelProperty(value = "图号")
// private String drawingNo;
//
// /**
// * 物料编码
// */
// @TableField(value = "material_no")
// @ApiModelProperty(value = "物料编码")
// private String materialNo;
//
// /**
// * 排序号
// */
// @TableField(value = "order_number")
// @ApiModelProperty(value = "排序号")
// private String orderNumber;
//
// /**
// * 物料名称
// */
// @TableField(value = "material_name")
// @ApiModelProperty(value = "物料名称")
// private String materialName;
//
// /**
// * 物料描述
// */
// @TableField(value = "material_desc")
// @ApiModelProperty(value = "物料描述")
// private String materialDesc;
//
// /**
// * 材质材料
// */
// @TableField(value = "material_texture")
// @ApiModelProperty(value = "材质,材料")
// private String materialTexture;
//
// /**
// * 单位
// */
// @TableField(value = "material_unit")
// @ApiModelProperty(value = "单位")
// private String materialUnit;
//
// /**
// * 原始单位-来自cad
// */
// @TableField(value = "material_original_unit")
// @ApiModelProperty(value = "原始单位-来自cad")
// private String materialOriginalUnit;
//
// /**
// * 单重
// */
// @TableField(value = "unit_weight")
// @ApiModelProperty(value = "单重")
// private BigDecimal unitWeight;
//
// /**
// * 总重
// */
// @TableField(value = "total_weight")
// @ApiModelProperty(value = "总重")
// private BigDecimal totalWeight;
//
// /**
// * 版本号
// */
// @TableField(value = "current_version")
// @ApiModelProperty(value = "版本号")
// private String currentVersion;
//
// /**
// * 数量
// */
// @TableField(value = "num")
// @ApiModelProperty(value = "数量")
// private BigDecimal num;
//
// /**
// * 来源1-原BOM转换 2-EXCE导入 3-MDM创建
// */
// @TableField(value = "source")
// @ApiModelProperty(value = "来源1-原BOM转换 2-EXCE导入 3-MDM创建")
// private Integer source;
//
// /**
// * 是否跟节点 0- 1-
// */
// @TableField(value = "root_is")
// @ApiModelProperty(value = "是否跟节点 0-否 1-是")
// private Integer rootIs;
//
// /**
// * 是否应该有BOM 0- 1-
// */
// @TableField(value = "should_bom_exist")
// @ApiModelProperty(value = "是否应该有BOM 0-否 1-是")
// private Integer shouldBomExist;
//
// /**
// * 超级物料 0- 1-
// */
// @TableField(value = "super_material_status")
// @ApiModelProperty(value = "超级物料 0-否 1-是")
// private Integer superMaterialStatus;
//
// /**
// * 是否有BOM: 0- 1-
// */
// @TableField(value = "bom_exist")
// @ApiModelProperty(value = "是否有BOM: 0-否 1-是")
// private Integer bomExist;
//
// /**
// * 是否最新版0- 1-
// */
// @TableField(value = "last_version_is")
// @ApiModelProperty(value = "是否最新版0-否 1-是")
// private Integer lastVersionIs;
//
// /**
// * 1=待处理2=已处理
// */
// @TableField(value = "edit_status")
// @ApiModelProperty(value = "1=待处理、2=已处理")
// private Integer editStatus;
//
// /**
// * 1=待复核2=已复核3=已退回4=定版已发布PBOM
// */
// @TableField(value = "status")
// @ApiModelProperty(value = "1=待复核、2=已复核、3=已退回、4=定版已发布PBOM")
// private Integer status;
//
// /**
// * 是否用户跟节点 0- 1-
// */
// @TableField(value = "user_root_is")
// @ApiModelProperty(value = "是否用户跟节点 0-否 1-是")
// private Integer userRootIs;
//
// /**
// * 已生成的虚拟包 0- 1-发货包 2-制作包 4-直发包 8-发货前装配包
// */
// @TableField(value = "virtrual_package_enum")
// @ApiModelProperty(value = "已生成的虚拟包 0-无 1-发货包 2-制作包 4-直发包 8-发货前装配包")
// private Integer virtrualPackageEnum;
//
// /**
// * -1=初始状态 1=正常 2=冻结/完全弃用异常物料的状态冻结或者完全弃用的状态 3=递归异常出现子级包含父级的异常情况打在子级物料中的那个父级物料编码4=数据不完整异常物料编号或数量没有填写 5=超级物料异常超级物料待说明 6=重复异常当前层级包含了相同的物料信息
// * 7=物料主数据不存在当前的物料信息在主数据平台不存在 8=项目类别为空
// * 9=项目赋值异常当父级物料的项目类型为Q时子级中不能存在项目类别为Q的物料
// * <p>
// * 10=项目赋值异常当父级物料的项目类型为F时子级中不能存在项目类型为F的物料
// * <p>
// * 11=未填写变更原因和技术通知单
// * <p>
// * 12=数量需要用户确认
// * <p>
// * 13=项目类型需要用户确认
// */
// @TableField(value = "exception_status")
// @ApiModelProperty(value = "-1=初始状态 1=正常 2=冻结/完全弃用异常:物料的状态冻结或者完全弃用的状态 3=递归异常出现子级包含父级的异常情况打在子级物料中的那个父级物料编码4=数据不完整异常:物料编号或数量没有填写 5=超级物料异常:超级物料待说明 6=重复异常:当前层级包含了相同的物料信息 7= 物料主数据不存在:当前的物料信息在主数据平台不存在 8=项目类别为空 9=项目赋值异常当父级物料的项目类型为Q时子级中不能存在项目类别为Q的物料 10=项目赋值异常当父级物料的项目类型为F时子级中不能存在项目类型为F的物料 11=未填写变更原因和技术通知单 12=数量需要用户确认 13=项目类型需要用户确认")
// private Integer exceptionStatus;
//
// /**
// * 是否虚拟包 0- 1-
// */
// @TableField(value = "virtual_package_is")
// @ApiModelProperty(value = "是否虚拟包 0-否 1-是")
// private Integer virtualPackageIs;
//
// /**
// * 来源行ID(原始BOM中的行ID)
// */
// @TableField(value = "source_row_id")
// @ApiModelProperty(value = "来源行ID(原始BOM中的行ID)")
// private Long sourceRowId;
//
// /**
// * 设计人员编码
// */
// @TableField(value = "devise_user_code")
// @ApiModelProperty(value = "设计人员编码")
// private String deviseUserCode;
//
// /**
// * 设计人员名称
// */
// @TableField(value = "devise_name")
// @ApiModelProperty(value = "设计人员名称")
// private String deviseName;
//
// /**
// * 创建人编码
// */
// @TableField(value = "created_by")
// @ApiModelProperty(value = "创建人编码")
// private String createdBy;
//
// /**
// * 创建时间
// */
// @TableField(value = "created_time")
// @ApiModelProperty(value = "创建时间")
// private LocalDateTime createdTime;
//
// /**
// * 创建人员所属岗位 0-设计人员 1-工艺人员 2-其他
// */
// @TableField(value = "created_job")
// @ApiModelProperty(value = "创建人员所属岗位 0-设计人员 1-工艺人员 2-其他")
// private Integer createdJob;
//
// /**
// * 复核时间
// */
// @TableField(value = "audit_time")
// @ApiModelProperty(value = "复核时间")
// private LocalDateTime auditTime;
//
// /**
// * 复核人
// */
// @TableField(value = "audit_user_name")
// @ApiModelProperty(value = "复核人")
// private String auditUserName;
//
// /**
// * 发布时间
// */
// @TableField(value = "release_time")
// @ApiModelProperty(value = "发布时间")
// private LocalDateTime releaseTime;
//
// /**
// * 发布人
// */
// @TableField(value = "release_user_name")
// @ApiModelProperty(value = "发布人")
// private String releaseUserName;
//
// /**
// * 退回时间
// */
// @TableField(value = "revert_time")
// @ApiModelProperty(value = "退回时间")
// private LocalDateTime revertTime;
//
// /**
// * 退回人
// */
// @TableField(value = "revert_user_name")
// @ApiModelProperty(value = "退回人")
// private String revertUserName;
//
// /**
// * 版本过期时间=下个版本的创建时间
// */
// @TableField(value = "expire_end_time")
// @ApiModelProperty(value = "版本过期时间=下个版本的创建时间")
// private LocalDateTime expireEndTime;
//
// /**
// * 转换pbom时间
// */
// @TableField(value = "convert_to_ebom_time")
// @ApiModelProperty(value = "转换pbom时间")
// private LocalDateTime convertToEbomTime;
//
// /**
// * 备注
// */
// @TableField(value = "remark")
// @ApiModelProperty(value = "备注")
// private String remark;
//
// /**
// * 设计维护部门名称
// */
// @TableField(value = "dept_name")
// @ApiModelProperty(value = "设计维护部门名称")
// private String deptName;
//
// /**
// * bom树的高度
// */
// @TableField(value = "level_num")
// @ApiModelProperty(value = "bom树的高度")
// private Integer levelNum;
//
// /**
// * 升版说明
// */
// @TableField(value = "change_desc")
// @ApiModelProperty(value = "升版说明")
// private String changeDesc;
//
// /**
// * 通知单号
// */
// @TableField(value = "notice_nums")
// @ApiModelProperty(value = "通知单号")
// private String noticeNums;
//
// /**
// * 修改时间
// */
// @TableField(value = "modify_time")
// @ApiModelProperty(value = "修改时间")
// private LocalDateTime modifyTime;
//
// private static final long serialVersionUID = 265246823929418418L;
}

View File

@ -162,7 +162,7 @@ public class BomNewEbomParentFormalVO extends BaseMaterialVO implements Serializ
* 来源行ID(原始BOM中的行ID)
*/
@ApiModelProperty(value = "来源行ID(原始BOM中的行ID)")
private Long sourceRowId;
private String sourceRowId;
/**
* 设计人员编码

View File

@ -144,7 +144,7 @@ public class BomNewPbomParentFormalVO extends BaseMaterialVO implements Serializ
* 来源行ID(EBOM中的行ID)
*/
@ApiModelProperty(value = "来源行ID(EBOM中的行ID)")
private Long sourceRowId;
private String sourceRowId;
/**
* 设计人员编码

View File

@ -1932,10 +1932,10 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
checkUserRoleAuth(dto.getParent().getCreatedBy());
//暂存数据为空后面不处理
if (CollUtil.isEmpty(dto.getDatas())) {
return dto.getParent();
}
// //暂存数据为空后面不处理
// if (CollUtil.isEmpty(dto.getDatas())) {
// return dto.getParent();
// }
EBomEdit eBomEdit = new EBomEdit(EBomSourceEnum.FROM_MDM.getValue());
@ -2511,6 +2511,9 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
//转移后删除
this.getBaseMapper().delEBomHistory(childParentRowIds);
} else {
this.getBaseMapper().insertEBomFormalParent(exceptRowIds);
this.getBaseMapper().insertEBomFormalChild(exceptRowIds);
}
}
}

View File

@ -84,41 +84,34 @@ public class CheckEBomException {
*/
public void initException() {
//初始化物料信息
List<BaseMaterialVO> materialBaseInfo = SpringUtil.getBean(MaterialMainService.class).intiMaterialInfo(allBomDetail, EBomConstant.EBOM_IGNORED_FIELDS_INIT_MATERIAL_DEFAULT);
checkException(materialBaseInfo);
// List<BaseMaterialVO> materialBaseInfo = SpringUtil.getBean(MaterialMainService.class).intiMaterialInfo(allBomDetail, EBomConstant.EBOM_IGNORED_FIELDS_INIT_MATERIAL_DEFAULT);
checkException();
}
public void initException(List<Integer> unCheckException) {
//初始化物料信息
List<BaseMaterialVO> materialBaseInfo = SpringUtil.getBean(MaterialMainService.class).intiMaterialInfo(allBomDetail, EBomConstant.EBOM_IGNORED_FIELDS_INIT_MATERIAL_DEFAULT);
// List<BaseMaterialVO> materialBaseInfo = SpringUtil.getBean(MaterialMainService.class).intiMaterialInfo(allBomDetail, EBomConstant.EBOM_IGNORED_FIELDS_INIT_MATERIAL_DEFAULT);
this.unCheckExcept=unCheckException;
checkException(materialBaseInfo);
checkException();
}
public void initException(String... ignorePropertyList) {
List<BaseMaterialVO> materialBaseInfo = SpringUtil.getBean(MaterialMainService.class).intiMaterialInfo(allBomDetail, ignorePropertyList);
checkException(materialBaseInfo);
// List<BaseMaterialVO> materialBaseInfo = SpringUtil.getBean(MaterialMainService.class).intiMaterialInfo(allBomDetail, ignorePropertyList);
checkException();
}
public void checkException(List<BaseMaterialVO> materialBaseInfo) {
public void checkException() {
for (BomNewEbomParentVO vo : allBomDetail) {
// if(Objects.isNull(vo.getExceptionStatus())) {
//忽略不检查的如14
if (CollectionUtil.isNotEmpty(unCheckExcept)
&& vo.getExceptionStatus() != null
&& unCheckExcept.contains(vo.getExceptionStatus())) {
continue;
}
// BaseMaterialVO mainVO = materialBaseInfo.stream()
// .filter(u -> StrUtil.equals(u.getMaterialNo(), vo.getMaterialNo()))
// .findFirst()
// .orElse(null);
vo.setExceptionStatus(EBomExceptionStatusEnum.OK.getValue());
// }
if (StrUtil.equals(BomConstant.PROJECT_TYPE_TEMPORARY, vo.getProjectType(), true)) {
if (StrUtil.isBlank(vo.getMaterialDesc())) {
vo.setExceptionStatus(EBomExceptionStatusEnum.EXCEPT_NO_4.getValue());
@ -137,7 +130,6 @@ public class CheckEBomException {
vo.setExceptionStatus(EBomExceptionStatusEnum.EXCEPT_NO_8.getValue());
} else if ((!StrUtil.equals("KG", StringUtil.toUpperCase(vo.getMaterialUnit()))
&& !StrUtil.equals(StringUtil.toUpperCase(vo.getMaterialUnit()), "PC"))
//|| (!Objects.isNull(mainVO) && !StrUtil.equals(vo.getMaterialUnit(), mainVO.getMaterialUnit()))) {
&& (StrUtil.isBlank(vo.getExceptionTag()) || (!vo.getExceptionTag().contains("16")) && !vo.getExceptionTag().contains("12"))
&& Objects.equals(vo.getSource(), EBomSourceEnum.FROM_BOM.getValue())) {
vo.setExceptionStatus(EBomExceptionStatusEnum.EXCEPT_NO_12.getValue());

View File

@ -14,6 +14,7 @@ import com.nflg.product.bomnew.constant.*;
import com.nflg.product.bomnew.pojo.dto.BomNewEBomParentEditDTO;
import com.nflg.product.bomnew.pojo.entity.BomNewEbomChildEntity;
import com.nflg.product.bomnew.pojo.entity.BomNewEbomParentEntity;
import com.nflg.product.bomnew.pojo.entity.MaterialMainEntity;
import com.nflg.product.bomnew.pojo.vo.BaseMaterialVO;
import com.nflg.product.bomnew.pojo.vo.BomNewEbomParentVO;
import com.nflg.product.bomnew.service.BomNewEbomChildService;
@ -21,6 +22,7 @@ import com.nflg.product.bomnew.service.BomNewEbomParentService;
import com.nflg.product.bomnew.service.MaterialMainService;
import com.nflg.product.bomnew.service.UserRoleService;
import com.nflg.product.bomnew.util.ListCommonUtil;
import com.nflg.product.bomnew.util.MaterialshouldBomExistUtil;
import com.nflg.product.bomnew.util.VUtils;
import com.nflg.product.bomnew.util.VersionUtil;
import lombok.Getter;
@ -75,6 +77,11 @@ public class EBomEdit {
parent.setStatus(EBomStatusEnum.WAIT_CHECK.getValue());
parent.setNum(new BigDecimal(1));
parent.setBomExist(1);
MaterialMainEntity materialMainEntity = SpringUtil.getBean(MaterialMainService.class).lambdaQuery()
.eq(MaterialMainEntity::getMaterialNo, parent.getMaterialNo())
.one();
parent.setShouldBomExist(MaterialshouldBomExistUtil.checkShouldBomExist(materialMainEntity.getMaterialCategoryCode()
, materialMainEntity.getMaterialGetType()) ? 1 : 0);
parent.setLastVersionIs(1);
parent.setEditStatus(EbomEditStatusEnum.HANDLER_CREATED.getValue());
parent.setExceptionStatus(EBomExceptionStatusEnum.OK.getValue());
@ -132,6 +139,7 @@ public class EBomEdit {
parentEntity.setRootIs(parentEntity.getMaterialNo().startsWith("31") ? 1 : 0);
parentEntity.setUserRootIs(1);
parentEntity.setDeptRowId(SessionUtil.getDepartRowId());
parentEntity.setBomExist(CollUtil.isEmpty(createDTO.getDatas()) ? 0 : 1);
createDTO.getDatas().forEach(k -> {
k.setParentRowId(parentEntity.getRowId());
@ -274,9 +282,9 @@ public class EBomEdit {
throw new NflgBusinessException(STATE.Error, "parent 数据不能为空");
}
if (CollUtil.isEmpty(dto.getDatas())) {
throw new NflgBusinessException(STATE.Error, "datas 数据不能为空");
}
// if (CollUtil.isEmpty(dto.getDatas())) {
// throw new NflgBusinessException(STATE.Error, "datas 数据不能为空");
// }
List<String> materialNos = dto.getDatas().stream().map(u -> u.getMaterialNo()).collect(Collectors.toList());
if(materialNos.contains(dto.getParent().getMaterialNo())){
@ -356,6 +364,7 @@ public class EBomEdit {
parentEntity.setModifyTime(LocalDateTime.now());
}
parentEntity.setEditStatus(dto.getOpType());
parentEntity.setBomExist(CollUtil.isEmpty(dto.getDatas()) ? 0 : 1);
//提交
if (Objects.equals(dto.getOpType(), EbomEditStatusEnum.HANDLER_FINISHED.getValue())) {
//工艺人员

View File

@ -1,5 +1,6 @@
package com.nflg.product.base.core.exception;
import cn.hutool.core.util.StrUtil;
import lombok.extern.slf4j.Slf4j;
import nflg.product.common.constant.STATE;
import nflg.product.common.vo.ResultVO;
@ -51,7 +52,7 @@ public class BaseGlobalExceptionHandle {
public ResultVO<String> handleDuplicateKeyException(DuplicateKeyException e) {
log.error(e.getMessage(), e);
//return ResultVO.error("已存在该记录,请勿重复操作");
return ResultVO.error("已存在该记录,请勿重复操作");
return ResultVO.error("数据库存在重复数据");
}
@ -59,8 +60,11 @@ public class BaseGlobalExceptionHandle {
@ResponseBody
public ResultVO<String> handleException(Exception e) {
log.error(e.getMessage(), e);
//return ResultVO.error("操作失败,请联系系统管理员");
return ResultVO.error("操作失败,请联系系统管理员");
if (StrUtil.isNotBlank(e.getMessage()) && e.getMessage().contains("Deadlock")) {
return ResultVO.error("操作失败,请重试");
} else {
return ResultVO.error("操作失败,请联系系统管理员");
}
}
/**