Merge remote-tracking branch 'origin/feature/DM/nflg-bom' into feature/DM/nflg-bom
This commit is contained in:
commit
506cf0adea
|
|
@ -12,6 +12,7 @@ import com.nflg.product.bomnew.constant.MBomConstantEnum;
|
|||
import com.nflg.product.bomnew.constant.ValueEnum;
|
||||
import com.nflg.product.bomnew.pojo.dto.BomNewMBomChildDTO;
|
||||
import com.nflg.product.bomnew.pojo.dto.BomNewMbomApplyBackMaterialDTO;
|
||||
import com.nflg.product.bomnew.pojo.dto.BomNewMbomDetailDTO;
|
||||
import com.nflg.product.bomnew.pojo.dto.BomNewMbomSuperStatusDTO;
|
||||
import com.nflg.product.bomnew.pojo.query.BomNewMbomBackMaterialQuery;
|
||||
import com.nflg.product.bomnew.pojo.query.BomNewMbomParentQuery;
|
||||
|
|
@ -71,6 +72,28 @@ public class MBomApi extends BaseApi {
|
|||
return ResultVO.success(bomNewMbomParentService.workListPage(query));
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("getParentInfo")
|
||||
@ApiOperation("获取上层信息")
|
||||
public ResultVO< BomNewMbomMiddleVO > getParentInfo(@RequestBody BomNewMbomDetailDTO dto) {
|
||||
|
||||
if(Objects.isNull(dto.getParentRowId())){
|
||||
throw new NflgBusinessException(STATE.ParamErr, "parentRowId 不能为空");
|
||||
}
|
||||
|
||||
if(dto.getParentRowId()>0){
|
||||
return ResultVO.success(bomNewMbomDetailService.getDetailById(dto.getParentRowId()));
|
||||
}
|
||||
if(Objects.isNull(dto.getBomRowId()) || dto.getBomRowId().longValue()<=0){
|
||||
throw new NflgBusinessException(STATE.ParamErr, "bomRowId 不能为空");
|
||||
}
|
||||
|
||||
return ResultVO.success(bomNewMbomParentService.getParentById(dto.getBomRowId()));
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@PostMapping("sapFormalListPage")
|
||||
@ApiOperation("Sap明细表")
|
||||
public ResultVO<Page<BomNewMbomMiddleVO>> sapFormalListPage(@RequestBody BomNewMbomParentQuery query) {
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@ package com.nflg.product.bomnew.mapper.master;
|
|||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.nflg.product.bomnew.pojo.entity.BomNewMbomDetailEntity;
|
||||
import com.nflg.product.bomnew.pojo.vo.BomNewMbomMiddleVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* t_bom_new_mbom_detail 表数据库访问层
|
||||
|
|
@ -12,4 +14,6 @@ import com.nflg.product.bomnew.pojo.entity.BomNewMbomDetailEntity;
|
|||
* @since 2024-01-01 10:53:17
|
||||
*/
|
||||
public interface BomNewMbomDetailMapper extends BaseMapper<BomNewMbomDetailEntity> {
|
||||
|
||||
BomNewMbomMiddleVO getDetailById(@Param("rowId") Long rowId );
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,12 +22,7 @@ import java.time.LocalDate;
|
|||
@ApiModel(value="com-nflg-product-bomnew-pojo-new-dto-BomNewMbomDetailEntityDTO")
|
||||
public class BomNewMbomDetailDTO implements Serializable {
|
||||
|
||||
/**
|
||||
* 主键行ID-雪花
|
||||
*/
|
||||
@ApiModelProperty(value = "主键行ID-雪花")
|
||||
private Long rowId;
|
||||
|
||||
|
||||
/**
|
||||
* bom版本行ID,和mbom_parent表row_id关联
|
||||
*/
|
||||
|
|
@ -40,155 +35,5 @@ public class BomNewMbomDetailDTO implements Serializable {
|
|||
@ApiModelProperty(value = "父级行ID")
|
||||
private Long parentRowId;
|
||||
|
||||
/**
|
||||
* 图号
|
||||
*/
|
||||
@ApiModelProperty(value = "图号")
|
||||
private String drawingNo;
|
||||
|
||||
/**
|
||||
* 工厂编码
|
||||
*/
|
||||
@ApiModelProperty(value = "工厂编码")
|
||||
private String facCode;
|
||||
|
||||
/**
|
||||
* 物料编码
|
||||
*/
|
||||
@ApiModelProperty(value = "物料编码")
|
||||
private String materialNo;
|
||||
|
||||
/**
|
||||
* 排序号
|
||||
*/
|
||||
@ApiModelProperty(value = "排序号")
|
||||
private String orderNumber;
|
||||
|
||||
/**
|
||||
* 物料名称
|
||||
*/
|
||||
@ApiModelProperty(value = "物料名称")
|
||||
private String materialName;
|
||||
|
||||
/**
|
||||
* 物料描述
|
||||
*/
|
||||
@ApiModelProperty(value = "物料描述")
|
||||
private String materialDesc;
|
||||
|
||||
/**
|
||||
* 材质,材料
|
||||
*/
|
||||
@ApiModelProperty(value = "材质,材料")
|
||||
private String materialTexture;
|
||||
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
@ApiModelProperty(value = "单位")
|
||||
private String materialUnit;
|
||||
|
||||
/**
|
||||
* 单重
|
||||
*/
|
||||
@ApiModelProperty(value = "单重")
|
||||
private BigDecimal unitWeight;
|
||||
|
||||
/**
|
||||
* 总重
|
||||
*/
|
||||
@ApiModelProperty(value = "总重")
|
||||
private BigDecimal totalWeight;
|
||||
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
@ApiModelProperty(value = "数量")
|
||||
private BigDecimal num;
|
||||
|
||||
/**
|
||||
* 项目类别
|
||||
*/
|
||||
@ApiModelProperty(value = "项目类别")
|
||||
private String projectType;
|
||||
|
||||
/**
|
||||
* 超级物料 0-否 1-是
|
||||
*/
|
||||
@ApiModelProperty(value = "超级物料 0-否 1-是")
|
||||
private Integer superMaterialStatus;
|
||||
|
||||
/**
|
||||
* 是否虚拟件 0-否 1-是
|
||||
*/
|
||||
@ApiModelProperty(value = "是否虚拟件 0-否 1-是")
|
||||
private Integer virtualPartIs;
|
||||
|
||||
/**
|
||||
* 来源行ID(PBOM中child的row_id)
|
||||
*/
|
||||
@ApiModelProperty(value = "来源行ID(PBOM中child的row_id)")
|
||||
private Long sourceRowId;
|
||||
|
||||
/**
|
||||
* 设计人员编码
|
||||
*/
|
||||
@ApiModelProperty(value = "设计人员编码")
|
||||
private String deviseUserCode;
|
||||
|
||||
/**
|
||||
* 设计人员名称
|
||||
*/
|
||||
@ApiModelProperty(value = "设计人员名称")
|
||||
private String deviseName;
|
||||
|
||||
/**
|
||||
* 创建人编码
|
||||
*/
|
||||
@ApiModelProperty(value = "创建人编码")
|
||||
private String createdBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private LocalDateTime createdTime;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 设计维护部门名称
|
||||
*/
|
||||
@ApiModelProperty(value = "设计维护部门名称")
|
||||
private String deptName;
|
||||
|
||||
/**
|
||||
* bom树的高度
|
||||
*/
|
||||
@ApiModelProperty(value = "bom树的高度")
|
||||
private Integer levelNum;
|
||||
|
||||
/**
|
||||
* 升版说明
|
||||
*/
|
||||
@ApiModelProperty(value = "升版说明")
|
||||
private String changeDesc;
|
||||
|
||||
/**
|
||||
* 通知单号
|
||||
*/
|
||||
@ApiModelProperty(value = "通知单号")
|
||||
private String noticeNums;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@ApiModelProperty(value = "修改时间")
|
||||
private LocalDateTime modifyTime;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1284,9 +1284,9 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
|||
BomNewEbomParentVO parent = Convert.convert(BomNewEbomParentVO.class
|
||||
, eBomEdit.parentEntities.get(0));
|
||||
|
||||
if (dto.getParent().getRootIs() == null || dto.getParent().getRootIs() == 0) {
|
||||
allBom.add(parent);
|
||||
}
|
||||
// if (dto.getParent().getRootIs() == null || dto.getParent().getRootIs() == 0) {
|
||||
// allBom.add(parent);
|
||||
// }
|
||||
|
||||
CheckEBomException checkEBomException = new CheckEBomException(allBom);
|
||||
checkEBomException.checkContainExcept(checkStatus);
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ import com.nflg.product.bomnew.pojo.entity.BomNewMbomParentEntity;
|
|||
import com.nflg.product.bomnew.pojo.vo.BomNewMbomDetailVO;
|
||||
import com.nflg.product.bomnew.pojo.vo.BomNewMbomMiddleVO;
|
||||
import nflg.product.common.constant.STATE;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
|
@ -34,6 +35,17 @@ import java.util.Objects;
|
|||
public class BomNewMbomDetailService extends ServiceImpl<BomNewMbomDetailMapper, BomNewMbomDetailEntity> {
|
||||
|
||||
|
||||
|
||||
public BomNewMbomMiddleVO getDetailById( Long parentRowId ){
|
||||
|
||||
|
||||
return this.getBaseMapper().getDetailById(parentRowId);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public List<BomNewMbomMiddleVO> superSaterialList(Long rowId) {
|
||||
|
||||
BomNewMbomParentEntity parent = SpringUtil.getBean(BomNewMbomParentService.class).getById(rowId);
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ import com.nflg.product.bomnew.pojo.entity.BomNewMbomParentEntity;
|
|||
import com.nflg.product.bomnew.pojo.query.BomNewMbomParentQuery;
|
||||
import com.nflg.product.bomnew.pojo.vo.BomNewMbomMiddleVO;
|
||||
import com.nflg.product.bomnew.service.domain.MBom.IndexListTree;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
|
@ -29,6 +30,13 @@ import java.util.stream.Collectors;
|
|||
public class BomNewMbomParentService extends ServiceImpl<BomNewMbomParentMapper, BomNewMbomParentEntity> {
|
||||
|
||||
|
||||
public BomNewMbomMiddleVO getParentById( Long rowId ){
|
||||
|
||||
return this.getBaseMapper().getParentById(rowId);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 工作明细
|
||||
*
|
||||
|
|
|
|||
|
|
@ -38,5 +38,10 @@
|
|||
<sql id="Base_Column_List">
|
||||
<!--@mbg.generated-->
|
||||
row_id, bom_row_id, parent_row_id, drawing_no, fac_code, material_no, order_number, material_name, material_desc, material_texture, material_unit, unit_weight, total_weight, num, project_type, super_material_status, virtual_part_is, source_row_id, devise_user_code, devise_name, created_by, created_time, remark, dept_name, level_num, change_desc, notice_nums, modify_time </sql>
|
||||
|
||||
<select id="getDetailById" resultType="com.nflg.product.bomnew.pojo.vo.BomNewMbomMiddleVO">
|
||||
select t1.*
|
||||
from t_bom_new_mbom_detail as t1
|
||||
where t1.row_id = #{rowId}
|
||||
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -115,6 +115,10 @@
|
|||
order by t1.order_number
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<select id="getParentById" resultType="com.nflg.product.bomnew.pojo.vo.BomNewMbomMiddleVO">
|
||||
select t1.*,(SELECT count(1) from t_bom_new_mbom_detail where parent_row_id=0 and bom_row_id=t1.row_id) as bom_exist
|
||||
from t_bom_new_mbom_parent as t1
|
||||
|
|
@ -124,6 +128,10 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<select id="indexListPage" resultType="com.nflg.product.bomnew.pojo.vo.BomNewMbomMiddleVO">
|
||||
SELECT max(t1.row_id) as row_id ,t1.bom_row_id from t_bom_new_mbom_detail t1 left JOIN
|
||||
t_bom_new_mbom_parent t2
|
||||
|
|
|
|||
Loading…
Reference in New Issue