pbom
This commit is contained in:
parent
43ddc86057
commit
7f8363978d
|
|
@ -0,0 +1,14 @@
|
|||
package com.nflg.product.bomnew.mapper.master;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.nflg.product.bomnew.pojo.entity.BomNewPbomChildEntity;
|
||||
import com.nflg.product.bomnew.pojo.entity.BomNewPbomChildFormalEntity;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public interface BomNewPbomChildFormalMapper extends BaseMapper<BomNewPbomChildFormalEntity> {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
package com.nflg.product.bomnew.mapper.master;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.nflg.product.bomnew.pojo.entity.BomNewPbomParentEntity;
|
||||
import com.nflg.product.bomnew.pojo.entity.BomNewPbomParentFormalEntity;
|
||||
import com.nflg.product.bomnew.pojo.query.BomNewPbomParentQuery;
|
||||
import com.nflg.product.bomnew.pojo.vo.BomNewEbomParentFormalVO;
|
||||
import com.nflg.product.bomnew.pojo.vo.BomNewPbomParentFormalVO;
|
||||
import com.nflg.product.bomnew.pojo.vo.BomNewPbomParentVO;
|
||||
import com.nflg.product.bomnew.pojo.vo.BomNewPbomWorkExcelVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
||||
*/
|
||||
public interface BomNewPbomParentFormalMapper extends BaseMapper<BomNewPbomParentFormalEntity> {
|
||||
|
||||
|
||||
List<BomNewPbomParentFormalVO> getParentChild(@Param("rowId") Long rowId);
|
||||
|
||||
List<BomNewPbomParentFormalVO> getParentChildBatch(@Param("rowIds") List<Long> rowIds);
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
package com.nflg.product.bomnew.pojo.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value = "com-nflg-product-bomnew-pojo-new-entity-BomNewPbomChildFormalEntity")
|
||||
@TableName(value = "t_bom_new_pbom_child_formal")
|
||||
public class BomNewPbomChildFormalEntity extends BomNewPbomChildEntity {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
package com.nflg.product.bomnew.pojo.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value = "com-nflg-product-bomnew-pojo-new-entity-BomNewPbomParentFormalEntity")
|
||||
@TableName(value = "t_bom_new_pbom_parent_formal")
|
||||
public class BomNewPbomParentFormalEntity extends BomNewPbomParentEntity {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,284 @@
|
|||
package com.nflg.product.bomnew.pojo.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* t_bom_new_pbom_parent
|
||||
*
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-01-01 10:39:59
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value="com-nflg-product-bomnew-pojo-new-vo-BomNewPbomParentEntityVO")
|
||||
public class BomNewPbomParentFormalVO extends BaseMaterialVO implements Serializable {
|
||||
|
||||
/**
|
||||
* 主键行ID-雪花
|
||||
*/
|
||||
@ApiModelProperty(value = "主键行ID-雪花")
|
||||
private Long rowId=0L;
|
||||
|
||||
|
||||
@ApiModelProperty("Bom行ID")
|
||||
private Long bomRowId=0L;
|
||||
|
||||
|
||||
@ApiModelProperty("父级行id")
|
||||
private Long parentRowId=0L;
|
||||
/**
|
||||
* 批号-来自plm-临时
|
||||
*/
|
||||
@ApiModelProperty(value = "批号-来自plm-临时")
|
||||
private String batchNo;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 工厂编码
|
||||
*/
|
||||
@ApiModelProperty(value = "工厂编码")
|
||||
private String facCode;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 排序号
|
||||
*/
|
||||
@ApiModelProperty(value = "排序号")
|
||||
private String orderNumber;
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 单重
|
||||
*/
|
||||
@ApiModelProperty(value = "单重")
|
||||
private BigDecimal unitWeight;
|
||||
|
||||
/**
|
||||
* 总重
|
||||
*/
|
||||
@ApiModelProperty(value = "总重")
|
||||
private BigDecimal totalWeight;
|
||||
|
||||
/**
|
||||
* 版本号
|
||||
*/
|
||||
@ApiModelProperty(value = "版本号")
|
||||
private String currentVersion;
|
||||
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
@ApiModelProperty(value = "数量")
|
||||
private BigDecimal num;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 是否跟节点 0-否 1-是
|
||||
*/
|
||||
@ApiModelProperty(value = "是否跟节点 0-否 1-是")
|
||||
private Integer rootIs;
|
||||
|
||||
/**
|
||||
* 是否应该有BOM 0-否 1-是
|
||||
*/
|
||||
@ApiModelProperty(value = "是否应该有BOM 0-否 1-是")
|
||||
private Integer shouldBomExist;
|
||||
|
||||
/**
|
||||
* 超级物料 0-否 1-是
|
||||
*/
|
||||
@ApiModelProperty(value = "超级物料 0-否 1-是")
|
||||
private Integer superMaterialStatus;
|
||||
|
||||
/**
|
||||
* 是否有BOM: 0-否 1-是
|
||||
*/
|
||||
@ApiModelProperty(value = "是否有BOM: 0-否 1-是")
|
||||
private Integer bomExist=0;
|
||||
|
||||
/**
|
||||
* 是否最新版:0-否 1-是
|
||||
*/
|
||||
@ApiModelProperty(value = "是否最新版:0-否 1-是")
|
||||
private Integer lastVersionIs;
|
||||
|
||||
/**
|
||||
* 1=待处理、2=暂存 3=已处理
|
||||
*/
|
||||
@ApiModelProperty(value = "1=待处理、2=暂存 3=已处理")
|
||||
private Integer editStatus;
|
||||
|
||||
/**
|
||||
* BOM状态:1=待发布 2=待分配工厂 3=已分配工厂 4=已发布
|
||||
*/
|
||||
@ApiModelProperty(value = "BOM状态:1=待发布 2-借用件 4=已发布 8=待分配工厂 16=已分配工厂")
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 是否用户跟节点 0-否 1-是
|
||||
*/
|
||||
@ApiModelProperty(value = "是否用户跟节点 0-否 1-是")
|
||||
private Integer userRootIs;
|
||||
|
||||
/**
|
||||
* 是否虚拟包 0-否 1-是
|
||||
*/
|
||||
@ApiModelProperty(value = "是否虚拟包 0-否 1-是")
|
||||
private Integer virtualPackageIs;
|
||||
|
||||
/**
|
||||
* 来源行ID(EBOM中的行ID)
|
||||
*/
|
||||
@ApiModelProperty(value = "来源行ID(EBOM中的行ID)")
|
||||
private Long sourceRowId;
|
||||
|
||||
/**
|
||||
* 设计人员编码
|
||||
*/
|
||||
@ApiModelProperty(value = "设计人员编码")
|
||||
private String deviseUserCode;
|
||||
|
||||
/**
|
||||
* 设计人员名称
|
||||
*/
|
||||
@ApiModelProperty(value = "设计人员名称")
|
||||
private String deviseName;
|
||||
|
||||
/**
|
||||
* 工艺人员编码
|
||||
*/
|
||||
@ApiModelProperty(value = "工艺人员编码")
|
||||
private String technologyUserCode;
|
||||
|
||||
|
||||
/**
|
||||
* 工艺人员名称
|
||||
*/
|
||||
@ApiModelProperty(value = "工艺人员名称")
|
||||
private String technologyUserName;
|
||||
|
||||
/**
|
||||
* 创建人编码
|
||||
*/
|
||||
@ApiModelProperty(value = "创建人编码")
|
||||
private String createdBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private LocalDateTime createdTime;
|
||||
|
||||
/**
|
||||
* 创建人员所属岗位 0-设计人员 1-工艺人员 2-其他
|
||||
*/
|
||||
@ApiModelProperty(value = "创建人员所属岗位 0-设计人员 1-工艺人员 2-其他")
|
||||
private Integer createdJob;
|
||||
|
||||
/**
|
||||
* 发布时间
|
||||
*/
|
||||
@ApiModelProperty(value = "发布时间")
|
||||
private LocalDateTime releaseTime;
|
||||
|
||||
/**
|
||||
* 发布人
|
||||
*/
|
||||
@ApiModelProperty(value = "发布人")
|
||||
private String releaseUserName;
|
||||
|
||||
/**
|
||||
* 版本过期时间=下个版本的创建时间
|
||||
*/
|
||||
@ApiModelProperty(value = "版本过期时间=下个版本的创建时间")
|
||||
private LocalDateTime expireEndTime;
|
||||
|
||||
public LocalDateTime getExpireEndTime() {
|
||||
return expireEndTime==null? LocalDateTime.of(9999,12,31,23,59,59):expireEndTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@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 String orderNo;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@ApiModelProperty(value = "修改时间")
|
||||
private LocalDateTime modifyTime;
|
||||
|
||||
@ApiModelProperty("生产工厂")
|
||||
private String productionFactoryCode;
|
||||
|
||||
@ApiModelProperty("生产工厂设置方式 0-默认 1-规则匹配 2-手工")
|
||||
private Integer productionFactoryCodeInputType;
|
||||
|
||||
@ApiModelProperty("是否虚拟件 0-否 1-是")
|
||||
private Integer virtualPartIs;
|
||||
|
||||
@ApiModelProperty("虚拟件类型 0-非虚拟包 1-发货包 2-制作包 4-直发包 8-发货前装配包")
|
||||
private Integer virtualPartType;
|
||||
|
||||
@ApiModelProperty("层级数字")
|
||||
private BigDecimal levelNumber;
|
||||
|
||||
private String levelNo;
|
||||
|
||||
|
||||
// @ApiModelProperty("物料一级分类编码")
|
||||
// private String relCategoryCode;
|
||||
|
||||
|
||||
@ApiModelProperty("子级")
|
||||
List<BomNewPbomParentFormalVO> childNodes;
|
||||
|
||||
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
package com.nflg.product.bomnew.service;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.nflg.product.bomnew.mapper.master.BomNewPbomChildFormalMapper;
|
||||
import com.nflg.product.bomnew.mapper.master.BomNewPbomChildMapper;
|
||||
import com.nflg.product.bomnew.pojo.entity.BomNewPbomChildEntity;
|
||||
import com.nflg.product.bomnew.pojo.entity.BomNewPbomChildFormalEntity;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
||||
|
||||
@Service
|
||||
public class BomNewPbomChildFormalService extends ServiceImpl<BomNewPbomChildFormalMapper , BomNewPbomChildFormalEntity > {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,55 @@
|
|||
package com.nflg.product.bomnew.service;
|
||||
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.extra.spring.SpringUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.Sets;
|
||||
import com.nflg.product.base.core.conmon.util.SessionUtil;
|
||||
import com.nflg.product.base.core.exception.NflgBusinessException;
|
||||
import com.nflg.product.bomnew.constant.*;
|
||||
import com.nflg.product.bomnew.mapper.master.BomNewPbomParentFormalMapper;
|
||||
import com.nflg.product.bomnew.mapper.master.BomNewPbomParentMapper;
|
||||
import com.nflg.product.bomnew.pojo.dto.*;
|
||||
import com.nflg.product.bomnew.pojo.dto.sap.impart2.ImportSapParamDTO;
|
||||
import com.nflg.product.bomnew.pojo.entity.*;
|
||||
import com.nflg.product.bomnew.pojo.query.BomNewPbomParentQuery;
|
||||
import com.nflg.product.bomnew.pojo.vo.*;
|
||||
import com.nflg.product.bomnew.service.domain.PBom.*;
|
||||
import com.nflg.product.bomnew.service.domain.Sap;
|
||||
import com.nflg.product.bomnew.util.*;
|
||||
import nflg.product.common.constant.STATE;
|
||||
import nflg.product.common.vo.ResultVO;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.ttzero.excel.entity.Workbook;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.concurrent.ForkJoinPool;
|
||||
import java.util.concurrent.ForkJoinTask;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
|
||||
@Service
|
||||
public class BomNewPbomParentFormalService extends ServiceImpl<BomNewPbomParentFormalMapper , BomNewPbomParentFormalEntity> {
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -7,13 +7,12 @@ import cn.hutool.extra.spring.SpringUtil;
|
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.nflg.product.bomnew.constant.ReportConstant;
|
||||
import com.nflg.product.bomnew.pojo.entity.BomNewEbomChildFormalEntity;
|
||||
import com.nflg.product.bomnew.pojo.entity.BomNewPbomChildFormalEntity;
|
||||
import com.nflg.product.bomnew.pojo.query.ChildBomReportQuery;
|
||||
import com.nflg.product.bomnew.pojo.query.ReverseReportQuery;
|
||||
import com.nflg.product.bomnew.pojo.vo.BomNewEbomParentFormalVO;
|
||||
import com.nflg.product.bomnew.pojo.vo.ForwardReportVO;
|
||||
import com.nflg.product.bomnew.pojo.vo.ReportBomVO;
|
||||
import com.nflg.product.bomnew.pojo.vo.ReportBomVersionVO;
|
||||
import com.nflg.product.bomnew.pojo.vo.*;
|
||||
import com.nflg.product.bomnew.service.domain.EBom.EBomForwardReport;
|
||||
import com.nflg.product.bomnew.service.domain.PBom.PBomForwardReport;
|
||||
import com.nflg.product.bomnew.util.VUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
|
@ -40,7 +39,8 @@ public class ForwardReportService {
|
|||
|
||||
//PBOM
|
||||
if (query.getBomType().compareTo(ReportConstant.BomTypeEnum.PBOM.getValue()) == 0) {
|
||||
return null;
|
||||
PBomForwardReport eBomForwardReport = new PBomForwardReport(query);
|
||||
return eBomForwardReport.bomVersion();
|
||||
}
|
||||
//MBOM
|
||||
if (query.getBomType().compareTo(ReportConstant.BomTypeEnum.MBOM.getValue()) == 0) {
|
||||
|
|
@ -66,12 +66,11 @@ public class ForwardReportService {
|
|||
|
||||
return chilidEBomList(query);
|
||||
|
||||
|
||||
}
|
||||
|
||||
//PBOM
|
||||
if (query.getBomType().compareTo(ReportConstant.BomTypeEnum.PBOM.getValue()) == 0) {
|
||||
|
||||
return chilidPBomList(query);
|
||||
}
|
||||
//MBOM
|
||||
if (query.getBomType().compareTo(ReportConstant.BomTypeEnum.MBOM.getValue()) == 0) {
|
||||
|
|
@ -109,9 +108,10 @@ public class ForwardReportService {
|
|||
|
||||
|
||||
List<ForwardReportVO> chilidEBomList(ChildBomReportQuery query) {
|
||||
QueryWrapper<BomNewEbomChildFormalEntity> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.lambda().eq(BomNewEbomChildFormalEntity::getParentRowId, query.getBomRowId());
|
||||
List<BomNewEbomChildFormalEntity> list = SpringUtil.getBean(BomNewEbomChildFormalService.class).list(queryWrapper);
|
||||
// QueryWrapper<BomNewEbomChildFormalEntity> queryWrapper = new QueryWrapper<>();
|
||||
// queryWrapper.lambda().eq(BomNewEbomChildFormalEntity::getParentRowId, query.getBomRowId());
|
||||
// List<BomNewEbomChildFormalEntity> list = SpringUtil.getBean(BomNewEbomChildFormalService.class).list(queryWrapper);
|
||||
List<BomNewEbomParentFormalVO> list = SpringUtil.getBean(BomNewEbomParentFormalService .class).getBaseMapper().getParentChild(query.getBomRowId());
|
||||
|
||||
|
||||
List<ForwardReportVO> childBomLit = Convert.convert(
|
||||
|
|
@ -121,6 +121,18 @@ public class ForwardReportService {
|
|||
return childBomLit;
|
||||
}
|
||||
|
||||
List<ForwardReportVO> chilidPBomList(ChildBomReportQuery query) {
|
||||
List<BomNewPbomParentFormalVO> list = SpringUtil.getBean(BomNewPbomParentFormalService .class).getBaseMapper().getParentChild(query.getBomRowId());
|
||||
List<ForwardReportVO> childBomLit = Convert.convert(
|
||||
new TypeReference<List<ForwardReportVO>>() {
|
||||
|
||||
}, list);
|
||||
return childBomLit;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
ReportBomVO queryOriginalBom(ReverseReportQuery query) {
|
||||
return null;
|
||||
}
|
||||
|
|
@ -132,7 +144,10 @@ public class ForwardReportService {
|
|||
}
|
||||
|
||||
ReportBomVO queryPBom(ReverseReportQuery query) {
|
||||
return null;
|
||||
|
||||
PBomForwardReport pBomForwardReport=new PBomForwardReport(query);
|
||||
return pBomForwardReport.genReport();
|
||||
|
||||
}
|
||||
|
||||
ReportBomVO queryMBom(ReverseReportQuery query) {
|
||||
|
|
|
|||
|
|
@ -57,6 +57,7 @@ public class EBomFormalTreeTask extends RecursiveTask<List<BomNewEbomParentForma
|
|||
if (parentEntityMap.containsKey(detailVO.getBomRowId())) {
|
||||
BomNewEbomParentFormalEntity ebomParentEntity = parentEntityMap.get(detailVO.getBomRowId());
|
||||
detailVO.setChildBomRowId(ebomParentEntity.getRowId());
|
||||
detailVO.setCreatedTime(ebomParentEntity.getCreatedTime());
|
||||
// detailVO.setBomRowId(ebomParentEntity.getRowId());
|
||||
detailVO.setSourceRowId(ebomParentEntity.getSourceRowId());
|
||||
detailVO.setCurrentVersion(ebomParentEntity.getCurrentVersion());
|
||||
|
|
|
|||
|
|
@ -110,10 +110,14 @@ public EBomForwardReport(){
|
|||
ForwardReportVO forwardReportVO = Convert.convert(ForwardReportVO.class, parentFormal);
|
||||
forwardReportVO.setCreatedTime(parentFormal.getConvertToEbomTime());
|
||||
reportBomVO.setParent(forwardReportVO);
|
||||
QueryWrapper<BomNewEbomChildFormalEntity> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.lambda().eq(BomNewEbomChildFormalEntity::getParentRowId, parentFormal.getRowId());
|
||||
// QueryWrapper<BomNewEbomChildFormalEntity> queryWrapper = new QueryWrapper<>();
|
||||
// queryWrapper.lambda().eq(BomNewEbomChildFormalEntity::getParentRowId, parentFormal.getRowId());
|
||||
//
|
||||
// List<BomNewEbomChildFormalEntity> list = SpringUtil.getBean(BomNewEbomChildFormalService.class).list(queryWrapper);
|
||||
//
|
||||
List<BomNewEbomParentFormalVO> list = SpringUtil.getBean(BomNewEbomParentFormalService.class).getBaseMapper().getParentChild(parentFormal.getRowId());
|
||||
|
||||
|
||||
List<BomNewEbomChildFormalEntity> list = SpringUtil.getBean(BomNewEbomChildFormalService.class).list(queryWrapper);
|
||||
if (CollectionUtil.isEmpty(list)) {
|
||||
reportBomVO.setChildNodes(new ArrayList<>());
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,106 @@
|
|||
package com.nflg.product.bomnew.service.domain.PBom;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.extra.spring.SpringUtil;
|
||||
import com.nflg.product.bomnew.pojo.entity.BomNewEbomParentFormalEntity;
|
||||
import com.nflg.product.bomnew.pojo.vo.BomNewEbomParentFormalVO;
|
||||
import com.nflg.product.bomnew.pojo.vo.BomNewPbomChildVO;
|
||||
import com.nflg.product.bomnew.pojo.vo.BomNewPbomParentFormalVO;
|
||||
import com.nflg.product.bomnew.service.BomNewEbomParentFormalService;
|
||||
import com.nflg.product.bomnew.service.BomNewPbomParentFormalService;
|
||||
import com.nflg.product.bomnew.util.ListCommonUtil;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.RecursiveTask;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
public class PBomFormalTreeTask extends RecursiveTask<List<BomNewPbomParentFormalVO>> {
|
||||
|
||||
private List<BomNewPbomParentFormalVO> bomDetail;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public static int levelNum=1;
|
||||
|
||||
List<BomNewPbomParentFormalVO> result = new ArrayList<>();
|
||||
|
||||
public PBomFormalTreeTask(List<BomNewPbomParentFormalVO> inBomDetail) {
|
||||
bomDetail = inBomDetail;
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理BOM明细中未选择Bom版本的明细;使用最新版
|
||||
*/
|
||||
public void handlerChildBomVersionDetail() {
|
||||
|
||||
|
||||
for (BomNewPbomParentFormalVO vo:
|
||||
bomDetail ) {
|
||||
vo.setLevelNum(levelNum);
|
||||
}
|
||||
|
||||
List<Long> bomRowIds=bomDetail.stream().filter(u -> u.getBomRowId()>0 ).map(BomNewPbomParentFormalVO::getBomRowId).collect(Collectors.toList());
|
||||
|
||||
if (CollUtil.isNotEmpty(bomRowIds)) {
|
||||
|
||||
List<BomNewEbomParentFormalEntity > bomlist = SpringUtil.getBean(BomNewEbomParentFormalService.class ).lambdaQuery().in(BomNewEbomParentFormalEntity::getRowId, bomRowIds).list();
|
||||
Map<Long, BomNewEbomParentFormalEntity> parentEntityMap = ListCommonUtil.listToMap(bomlist, BomNewEbomParentFormalEntity::getRowId);
|
||||
for (BomNewPbomParentFormalVO detailVO : bomDetail) {
|
||||
if (parentEntityMap.containsKey(detailVO.getBomRowId())) {
|
||||
BomNewEbomParentFormalEntity ebomParentEntity = parentEntityMap.get(detailVO.getBomRowId());
|
||||
detailVO.setCreatedTime(ebomParentEntity.getCreatedTime());
|
||||
// detailVO.setBomRowId(ebomParentEntity.getRowId());
|
||||
detailVO.setSourceRowId(ebomParentEntity.getSourceRowId());
|
||||
detailVO.setCurrentVersion(ebomParentEntity.getCurrentVersion());
|
||||
detailVO.setDeviseUserCode(ebomParentEntity.getDeviseUserCode());
|
||||
detailVO.setDeptName(ebomParentEntity.getDeptName());
|
||||
detailVO.setDeviseName(ebomParentEntity.getDeviseName());
|
||||
detailVO.setBomExist(ebomParentEntity.getBomExist());
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 递归调用零部件BOM
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
protected List<BomNewPbomParentFormalVO > compute() {
|
||||
|
||||
handlerChildBomVersionDetail();
|
||||
// 最新 BOM 版本
|
||||
result.addAll(bomDetail);
|
||||
|
||||
if (CollUtil.isNotEmpty(bomDetail)) {
|
||||
levelNumAdd();
|
||||
List<Long> childBowIds = bomDetail.stream().filter(u-> u.getBomRowId()!=null && u.getBomRowId() > 0).map(u->u.getBomRowId()).collect(Collectors.toList());
|
||||
if(CollUtil.isNotEmpty(childBowIds)) {
|
||||
List<BomNewPbomParentFormalVO> bom = SpringUtil.getBean(BomNewPbomParentFormalService.class).getBaseMapper().getParentChildBatch(childBowIds);
|
||||
PBomFormalTreeTask task = new PBomFormalTreeTask(bom);
|
||||
task.fork();
|
||||
bomDetail.addAll(task.join());
|
||||
return bomDetail;
|
||||
}
|
||||
|
||||
}
|
||||
return result;
|
||||
|
||||
|
||||
}
|
||||
|
||||
public synchronized void levelNumAdd(){
|
||||
levelNum++;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,334 @@
|
|||
package com.nflg.product.bomnew.service.domain.PBom;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.lang.TypeReference;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.extra.spring.SpringUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.nflg.product.base.core.exception.NflgBusinessException;
|
||||
import com.nflg.product.bomnew.constant.ReportConstant;
|
||||
import com.nflg.product.bomnew.pojo.entity.BomNewEbomChildFormalEntity;
|
||||
import com.nflg.product.bomnew.pojo.entity.BomNewEbomParentFormalEntity;
|
||||
import com.nflg.product.bomnew.pojo.entity.BomNewPbomChildFormalEntity;
|
||||
import com.nflg.product.bomnew.pojo.entity.BomNewPbomParentFormalEntity;
|
||||
import com.nflg.product.bomnew.pojo.query.ReverseReportQuery;
|
||||
import com.nflg.product.bomnew.pojo.vo.*;
|
||||
import com.nflg.product.bomnew.service.BomNewEbomChildFormalService;
|
||||
import com.nflg.product.bomnew.service.BomNewEbomParentFormalService;
|
||||
import com.nflg.product.bomnew.service.BomNewPbomChildFormalService;
|
||||
import com.nflg.product.bomnew.service.BomNewPbomParentFormalService;
|
||||
import com.nflg.product.bomnew.service.domain.EBom.EBomFormalTreeTask;
|
||||
import com.nflg.product.bomnew.util.VersionUtil;
|
||||
import nflg.product.common.constant.STATE;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.ForkJoinPool;
|
||||
import java.util.concurrent.ForkJoinTask;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* pbom报表统计
|
||||
*/
|
||||
public class PBomForwardReport {
|
||||
|
||||
ReverseReportQuery query;
|
||||
|
||||
public PBomForwardReport(ReverseReportQuery query) {
|
||||
this.query = query;
|
||||
}
|
||||
|
||||
|
||||
QueryWrapper<BomNewPbomParentFormalEntity> buildQuery() {
|
||||
QueryWrapper<BomNewPbomParentFormalEntity> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.lambda().eq(BomNewPbomParentFormalEntity::getMaterialNo, query.getMaterialNo());
|
||||
|
||||
if (StrUtil.isNotBlank(query.getDrawingNo())) {
|
||||
queryWrapper.lambda().eq(BomNewPbomParentFormalEntity::getDrawingNo, query.getDrawingNo());
|
||||
}
|
||||
|
||||
if (StrUtil.isNotBlank(query.getFacCode())) {
|
||||
queryWrapper.lambda().eq(BomNewPbomParentFormalEntity::getFacCode, query.getFacCode());
|
||||
}
|
||||
|
||||
if (query.getVersionStrategy().compareTo(ReportConstant.VersionStrategyEnum.NEW.getValue()) == 0) {
|
||||
|
||||
queryWrapper.lambda().eq(BomNewPbomParentFormalEntity::getCurrentVersion, getMaxVersion());
|
||||
|
||||
} else {
|
||||
queryWrapper.lambda().eq(BomNewPbomParentFormalEntity::getCurrentVersion, query.getBomVersion());
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (StrUtil.isNotBlank(query.getStartDate()) && StrUtil.isNotBlank(query.getEndDate())) {
|
||||
queryWrapper.lambda().between(BomNewPbomParentFormalEntity::getReleaseTime, query.getStartDate(), query.getEndDate());
|
||||
}
|
||||
return queryWrapper;
|
||||
}
|
||||
|
||||
|
||||
BomNewPbomParentFormalEntity getParent() {
|
||||
QueryWrapper<BomNewPbomParentFormalEntity> queryWrapper = buildQuery();
|
||||
List<BomNewPbomParentFormalEntity> list = SpringUtil.getBean(BomNewPbomParentFormalService.class).list(queryWrapper);
|
||||
if (CollectionUtil.isEmpty(list)) {
|
||||
throw new NflgBusinessException(STATE.BusinessError, StrUtil.format("未查到物料编码为{}的数据信息", query.getMaterialNo()));
|
||||
}
|
||||
BomNewPbomParentFormalEntity parentFormal = list.get(0);
|
||||
parentFormal.setLevelNum(null);
|
||||
parentFormal.setOrderNumber(null);
|
||||
return parentFormal;
|
||||
}
|
||||
|
||||
/**
|
||||
* 最大的版本号
|
||||
* @return
|
||||
*/
|
||||
public String getMaxVersion() {
|
||||
ReportBomVersionVO reportBomVersionVO = bomVersion();
|
||||
if (reportBomVersionVO.getVList().size() == 1) {
|
||||
return reportBomVersionVO.getVList().get(0).getVersion();
|
||||
}
|
||||
|
||||
String maxVersion = reportBomVersionVO.getVList().get(0).getVersion();
|
||||
for (int index = 1; index < reportBomVersionVO.getVList().size(); index++) {
|
||||
String version = reportBomVersionVO.getVList().get(index).getVersion();
|
||||
if (VersionUtil.compare(version, maxVersion) > 0) {
|
||||
maxVersion = version;
|
||||
}
|
||||
}
|
||||
return maxVersion;
|
||||
}
|
||||
|
||||
/**
|
||||
* 单层
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
ReportBomVO singleReport() {
|
||||
|
||||
BomNewPbomParentFormalEntity parentFormal = getParent();
|
||||
ReportBomVO reportBomVO = new ReportBomVO();
|
||||
|
||||
ForwardReportVO forwardReportVO = Convert.convert(ForwardReportVO.class, parentFormal);
|
||||
forwardReportVO.setCreatedTime(parentFormal.getReleaseTime());
|
||||
reportBomVO.setParent(forwardReportVO);
|
||||
|
||||
// QueryWrapper<BomNewPbomChildFormalEntity> queryWrapper = new QueryWrapper<>();
|
||||
// queryWrapper.lambda().eq(BomNewPbomChildFormalEntity::getParentRowId, parentFormal.getRowId());
|
||||
// List<BomNewPbomChildFormalEntity> list = SpringUtil.getBean(BomNewPbomChildFormalService.class).list(queryWrapper);
|
||||
|
||||
List<BomNewPbomParentFormalVO> list = SpringUtil.getBean(BomNewPbomParentFormalService.class).getBaseMapper().getParentChild(parentFormal.getRowId());
|
||||
|
||||
if (CollectionUtil.isEmpty(list)) {
|
||||
reportBomVO.setChildNodes(new ArrayList<>());
|
||||
} else {
|
||||
List<ForwardReportVO> nodeList = Convert.convert(new TypeReference<List<ForwardReportVO>>() {
|
||||
}, list);
|
||||
for (ForwardReportVO vo :
|
||||
nodeList) {
|
||||
vo.setCreatedTime(reportBomVO.getParent().getCreatedTime());
|
||||
|
||||
}
|
||||
reportBomVO.setChildNodes(nodeList);
|
||||
}
|
||||
reportBomVO.setBomType(query.getBomType());
|
||||
reportBomVO.setQueryType(query.getQueryType());
|
||||
return reportBomVO;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 版本
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public ReportBomVersionVO bomVersion() {
|
||||
QueryWrapper<BomNewPbomParentFormalEntity> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.lambda().eq(BomNewPbomParentFormalEntity::getMaterialNo, query.getMaterialNo());
|
||||
|
||||
if (StrUtil.isNotBlank(query.getDrawingNo())) {
|
||||
queryWrapper.lambda().eq(BomNewPbomParentFormalEntity::getDrawingNo, query.getDrawingNo());
|
||||
}
|
||||
|
||||
if (StrUtil.isNotBlank(query.getFacCode())) {
|
||||
queryWrapper.lambda().eq(BomNewPbomParentFormalEntity::getFacCode, query.getFacCode());
|
||||
}
|
||||
|
||||
queryWrapper.lambda().orderByAsc(BomNewPbomParentFormalEntity::getCurrentVersion);
|
||||
|
||||
|
||||
|
||||
List<BomNewPbomParentFormalEntity> list = SpringUtil.getBean(BomNewPbomParentFormalService.class).list(queryWrapper);
|
||||
if (CollectionUtil.isEmpty(list)) {
|
||||
throw new NflgBusinessException(STATE.BusinessError, StrUtil.format("未查到物料编码{}版本信息", query.getMaterialNo()));
|
||||
}
|
||||
|
||||
BomNewPbomParentFormalEntity item0 = list.get(0);
|
||||
ReportBomVersionVO reportBomVersionVO = new ReportBomVersionVO();
|
||||
reportBomVersionVO.setMaterialDesc(item0.getMaterialDesc());
|
||||
reportBomVersionVO.setVList(new ArrayList<>());
|
||||
for (BomNewPbomParentFormalEntity entity :
|
||||
list) {
|
||||
ReportBomVersionVO.QueryBomVersionVO versionVO = new ReportBomVersionVO.QueryBomVersionVO();
|
||||
versionVO.setVersion(entity.getCurrentVersion());
|
||||
reportBomVersionVO.getVList().add(versionVO);
|
||||
}
|
||||
return reportBomVersionVO;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* bomid下所有数据
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<BomNewPbomParentFormalVO> bomDetailList(Long bomRowId) {
|
||||
List<BomNewPbomParentFormalVO> childList = SpringUtil.getBean(BomNewPbomParentFormalService.class).getBaseMapper().getParentChild(bomRowId);
|
||||
PBomFormalTreeTask task = new PBomFormalTreeTask(childList);
|
||||
ForkJoinPool pool = new ForkJoinPool();
|
||||
ForkJoinTask<List<BomNewPbomParentFormalVO>> submit = pool.submit(task);
|
||||
|
||||
List<BomNewPbomParentFormalVO> bomList = submit.join();
|
||||
return bomList;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 多层
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
ReportBomVO multiReport() {
|
||||
BomNewPbomParentFormalEntity parentFormal = getParent();
|
||||
ReportBomVO reportBomVO = new ReportBomVO();
|
||||
reportBomVO.setBomType(query.getBomType());
|
||||
reportBomVO.setQueryType(query.getQueryType());
|
||||
|
||||
ForwardReportVO forwardReportVO = Convert.convert(ForwardReportVO.class, parentFormal);
|
||||
forwardReportVO.setCreatedTime(parentFormal.getReleaseTime());
|
||||
reportBomVO.setParent(forwardReportVO);
|
||||
|
||||
|
||||
List<BomNewPbomParentFormalVO> bomList = bomDetailList(parentFormal.getRowId());
|
||||
|
||||
List<ForwardReportVO> convertBomList = Convert.convert(new TypeReference<List<ForwardReportVO>>() {
|
||||
}, bomList);
|
||||
|
||||
|
||||
sumLevel(convertBomList);
|
||||
//转化为树结构
|
||||
List<ForwardReportVO> rootList = listToTree(convertBomList, parentFormal.getRowId());
|
||||
|
||||
reportBomVO.setChildNodes(rootList);
|
||||
return reportBomVO;
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 汇总
|
||||
* 1. 查询所有不含子级的物料信息,并对数据进行汇总。
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
ReportBomVO sumReport() {
|
||||
|
||||
BomNewPbomParentFormalEntity parentFormal = getParent();
|
||||
ReportBomVO reportBomVO = new ReportBomVO();
|
||||
reportBomVO.setBomType(query.getBomType());
|
||||
reportBomVO.setQueryType(query.getQueryType());
|
||||
|
||||
ForwardReportVO forwardReportVO = Convert.convert(ForwardReportVO.class, parentFormal);
|
||||
forwardReportVO.setCreatedTime(parentFormal.getReleaseTime());
|
||||
reportBomVO.setParent(forwardReportVO);
|
||||
List<BomNewPbomParentFormalVO> bomList = bomDetailList(parentFormal.getRowId());
|
||||
List<ForwardReportVO> convertBomList = Convert.convert(new TypeReference<List<ForwardReportVO>>() {
|
||||
}, bomList);
|
||||
|
||||
sumLevel(convertBomList);
|
||||
|
||||
//无子级的数据
|
||||
List<ForwardReportVO> leafList = convertBomList.stream().filter(item -> (item.getBomRowId() == null || item.getBomRowId().longValue() ==0)).collect(Collectors.toList());
|
||||
//相同物料合并统计
|
||||
Map<String, List<ForwardReportVO>> materialNoListMap = leafList.stream().collect(Collectors.groupingBy(ForwardReportVO::getMaterialNo));
|
||||
List<ForwardReportVO> sumList = new ArrayList<>();
|
||||
materialNoListMap.forEach((key, valueList) -> {
|
||||
if (CollectionUtil.isNotEmpty(valueList)) {
|
||||
ForwardReportVO item0 = valueList.get(0);
|
||||
//相同物料合并数量
|
||||
if (valueList.size() > 1) {
|
||||
for (int index = 1; index < valueList.size(); index++) {
|
||||
item0.setNum(item0.getNum().add(valueList.get(index).getNum()));
|
||||
}
|
||||
}
|
||||
sumList.add(item0);
|
||||
}
|
||||
});
|
||||
|
||||
reportBomVO.setChildNodes(sumList);
|
||||
return reportBomVO;
|
||||
}
|
||||
|
||||
/**
|
||||
* 各层汇总
|
||||
*1.按层分组 和 parent分组
|
||||
* 2.下层数量=下层数量*上层数量
|
||||
* @param bomList
|
||||
*/
|
||||
void sumLevel(List<ForwardReportVO> bomList) {
|
||||
//分层统计,避免使用遍历树统计
|
||||
Map<Integer, List<ForwardReportVO>> listMap = bomList.stream().collect(Collectors.groupingBy(ForwardReportVO::getLevelNum));
|
||||
Map<Long, List<ForwardReportVO>> bomParentMap = bomList.stream().collect(Collectors.groupingBy(ForwardReportVO::getParentRowId));
|
||||
listMap.forEach((key, value) -> {
|
||||
value.forEach(parent -> {
|
||||
List<ForwardReportVO> dataList = bomParentMap.get(parent.getBomRowId());
|
||||
if (CollectionUtil.isNotEmpty(dataList)) {
|
||||
for (ForwardReportVO data :
|
||||
dataList) {
|
||||
data.setNum(parent.getNum().multiply(data.getNum()));
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
List<ForwardReportVO> listToTree(List<ForwardReportVO> bomList, Long parentRowId) {
|
||||
Map<Long, List<ForwardReportVO>> listMap = bomList.stream().collect(Collectors.groupingBy(ForwardReportVO::getParentRowId));
|
||||
bomList.forEach(item -> {
|
||||
item.setChildNodes(listMap.get(item.getBomRowId()));
|
||||
});
|
||||
List<ForwardReportVO> rootList = bomList.stream().filter(item -> Objects.equals(parentRowId, item.getParentRowId())).collect(Collectors.toList());
|
||||
return rootList;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public ReportBomVO genReport() {
|
||||
//单层
|
||||
if (query.getQueryType().compareTo(ReportConstant.QueryTypeEnum.SINGLE.getValue()) == 0) {
|
||||
return singleReport();
|
||||
}
|
||||
//多层
|
||||
if (query.getQueryType().compareTo(ReportConstant.QueryTypeEnum.MULTI.getValue()) == 0) {
|
||||
return multiReport();
|
||||
}
|
||||
//汇总
|
||||
if (query.getQueryType().compareTo(ReportConstant.QueryTypeEnum.SUM.getValue()) == 0) {
|
||||
return sumReport();
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -63,7 +63,7 @@
|
|||
</sql>
|
||||
|
||||
<select id="getParentChildBatch" resultType="com.nflg.product.bomnew.pojo.vo.BomNewEbomParentFormalVO">
|
||||
select *
|
||||
select *,bom_version_row_id as bom_row_id
|
||||
from t_bom_new_ebom_child_formal
|
||||
where parent_row_id in
|
||||
<foreach collection="rowIds" item="rowId" open="(" separator="," close=")">
|
||||
|
|
@ -71,7 +71,7 @@
|
|||
</foreach>
|
||||
</select>
|
||||
<select id="getParentChild" resultType="com.nflg.product.bomnew.pojo.vo.BomNewEbomParentFormalVO">
|
||||
select *
|
||||
select *,bom_version_row_id as bom_row_id
|
||||
from t_bom_new_ebom_child
|
||||
where parent_row_id = #{rowId}
|
||||
order by order_number
|
||||
|
|
|
|||
|
|
@ -0,0 +1,46 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.nflg.product.bomnew.mapper.master.BomNewPbomChildFormalMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.nflg.product.bomnew.pojo.entity.BomNewPbomChildFormalEntity">
|
||||
<!--@mbg.generated-->
|
||||
<!--@Table t_bom_new_pbom_child_fromal -->
|
||||
<id column="row_id" property="rowId" jdbcType="BIGINT"/>
|
||||
<result column="parent_row_id" property="parentRowId" jdbcType="BIGINT"/>
|
||||
<result column="identity_no" property="identityNo" jdbcType="VARCHAR"/>
|
||||
<result column="fac_code" property="facCode" jdbcType="VARCHAR"/>
|
||||
<result column="order_number" property="orderNumber" jdbcType="VARCHAR"/>
|
||||
<result column="drawing_no" property="drawingNo" jdbcType="VARCHAR"/>
|
||||
<result column="material_no" property="materialNo" jdbcType="VARCHAR"/>
|
||||
<result column="material_name" property="materialName" jdbcType="VARCHAR"/>
|
||||
<result column="material_desc" property="materialDesc" jdbcType="VARCHAR"/>
|
||||
<result column="material_texture" property="materialTexture" jdbcType="VARCHAR"/>
|
||||
<result column="material_unit" property="materialUnit" jdbcType="VARCHAR"/>
|
||||
<result column="material_category_code" property="materialCategoryCode" jdbcType="VARCHAR"/>
|
||||
<result column="unit_weight" property="unitWeight" jdbcType="DECIMAL"/>
|
||||
<result column="num" property="num" jdbcType="DECIMAL"/>
|
||||
<result column="total_weight" property="totalWeight" jdbcType="DECIMAL"/>
|
||||
<result column="project_type" property="projectType" jdbcType="VARCHAR"/>
|
||||
<result column="production_factory_code" property="productionFactoryCode" jdbcType="VARCHAR"/>
|
||||
<result column="production_factory_code_input_type" property="productionFactoryCodeInputType" jdbcType="INTEGER"/>
|
||||
<result column="set_production_factory_time" property="setProductionFactoryTime" jdbcType="TIMESTAMP"/>
|
||||
<result column="super_material_status" property="superMaterialStatus" jdbcType="INTEGER"/>
|
||||
<result column="virtual_part_is" property="virtualPartIs" jdbcType="INTEGER"/>
|
||||
<result column="created_by" property="createdBy" jdbcType="VARCHAR"/>
|
||||
<result column="created_time" property="createdTime" jdbcType="TIMESTAMP"/>
|
||||
<result column="modify_time" property="modifyTime" jdbcType="TIMESTAMP"/>
|
||||
<result column="source_row_id" property="sourceRowId" jdbcType="BIGINT"/>
|
||||
<result column="remark" property="remark" jdbcType="VARCHAR"/>
|
||||
<result column="source_parent_material_no" property="sourceParentMaterialNo" jdbcType="VARCHAR"/>
|
||||
<result column="virtual_part_type" property="virtualPartType" jdbcType="INTEGER"/>
|
||||
<result column="virtual_part_root_material_no" property="virtualPartRootMaterialNo"/>
|
||||
<result column="bom_version_row_id" property="bomVersionRowId" jdbcType="BIGINT" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
<!--@mbg.generated-->
|
||||
row_id, parent_row_id, identity_no, fac_code, order_number, drawing_no, material_no, material_name, material_desc, material_texture, material_unit, material_category_code, unit_weight, num, total_weight, project_type, production_factory_code,production_factory_code_input_type, set_production_factory_time, super_material_status, virtual_part_is, created_by, created_time, modify_time, source_row_id, remark, source_parent_material_no ,virtual_part_type ,virtual_part_root_material_no ,bom_version_row_id
|
||||
</sql>
|
||||
|
||||
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,77 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.nflg.product.bomnew.mapper.master.BomNewPbomParentFormalMapper">
|
||||
<resultMap id="BaseResultMap" type="com.nflg.product.bomnew.pojo.entity.BomNewPbomParentFormalEntity">
|
||||
<!--@mbg.generated-->
|
||||
<!--@Table t_bom_new_pbom_parent_formal -->
|
||||
<id column="row_id" property="rowId" jdbcType="BIGINT"/>
|
||||
<result column="batch_no" property="batchNo" jdbcType="VARCHAR"/>
|
||||
<result column="drawing_no" property="drawingNo" jdbcType="VARCHAR"/>
|
||||
<result column="fac_code" property="facCode" jdbcType="VARCHAR"/>
|
||||
<result column="material_no" property="materialNo" jdbcType="VARCHAR"/>
|
||||
<result column="order_number" property="orderNumber" jdbcType="VARCHAR"/>
|
||||
<result column="material_name" property="materialName" jdbcType="VARCHAR"/>
|
||||
<result column="material_desc" property="materialDesc" jdbcType="VARCHAR"/>
|
||||
<result column="material_texture" property="materialTexture" jdbcType="VARCHAR"/>
|
||||
<result column="material_unit" property="materialUnit" jdbcType="VARCHAR"/>
|
||||
<result column="unit_weight" property="unitWeight" jdbcType="DECIMAL"/>
|
||||
<result column="total_weight" property="totalWeight" jdbcType="DECIMAL"/>
|
||||
<result column="current_version" property="currentVersion" jdbcType="VARCHAR"/>
|
||||
<result column="num" property="num" jdbcType="DECIMAL"/>
|
||||
<result column="project_type" property="projectType" jdbcType="VARCHAR"/>
|
||||
<result column="root_is" property="rootIs" jdbcType="INTEGER"/>
|
||||
<result column="should_bom_exist" property="shouldBomExist" jdbcType="INTEGER"/>
|
||||
<result column="super_material_status" property="superMaterialStatus" jdbcType="INTEGER"/>
|
||||
<result column="bom_exist" property="bomExist" jdbcType="INTEGER"/>
|
||||
<result column="last_version_is" property="lastVersionIs" jdbcType="INTEGER"/>
|
||||
<result column="edit_status" property="editStatus" jdbcType="INTEGER"/>
|
||||
<result column="status" property="status" jdbcType="INTEGER"/>
|
||||
<result column="user_root_is" property="userRootIs" jdbcType="INTEGER"/>
|
||||
<result column="virtual_package_is" property="virtualPackageIs" jdbcType="INTEGER"/>
|
||||
<result column="source_row_id" property="sourceRowId" jdbcType="BIGINT"/>
|
||||
<result column="devise_user_code" property="deviseUserCode" jdbcType="VARCHAR"/>
|
||||
<result column="devise_name" property="deviseName" jdbcType="VARCHAR"/>
|
||||
<result column="technology_user_code" property="technologyUserCode" />
|
||||
<result column="technology_user_name" property="technologyUserName" />
|
||||
<result column="created_by" property="createdBy" jdbcType="VARCHAR"/>
|
||||
<result column="created_time" property="createdTime" jdbcType="TIMESTAMP"/>
|
||||
<result column="created_job" property="createdJob" jdbcType="INTEGER"/>
|
||||
<result column="release_time" property="releaseTime" jdbcType="TIMESTAMP"/>
|
||||
<result column="release_user_name" property="releaseUserName" jdbcType="VARCHAR"/>
|
||||
<result column="last_convert_mbom_user_name" property="lastConvertMbomUserName" jdbcType="VARCHAR"/>
|
||||
<result column="last_convert_mbom_time" property="lastConvertMbomTime" jdbcType="TIMESTAMP" />
|
||||
<result column="expire_end_time" property="expireEndTime" jdbcType="TIMESTAMP"/>
|
||||
<result column="remark" property="remark" jdbcType="VARCHAR"/>
|
||||
<result column="dept_name" property="deptName" jdbcType="VARCHAR"/>
|
||||
<result column="level_num" property="levelNum" jdbcType="INTEGER"/>
|
||||
<result column="change_desc" property="changeDesc" jdbcType="VARCHAR"/>
|
||||
<result column="notice_nums" property="noticeNums" jdbcType="VARCHAR"/>
|
||||
<result column="order_no" property="orderNo" jdbcType="VARCHAR"/>
|
||||
<result column="modify_time" property="modifyTime" jdbcType="TIMESTAMP"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
<!--@mbg.generated-->
|
||||
row_id, batch_no, drawing_no, fac_code, material_no, order_number, material_name, material_desc,
|
||||
material_texture, material_unit, unit_weight, total_weight, current_version, num, project_type, root_is,
|
||||
should_bom_exist, super_material_status, bom_exist, last_version_is, edit_status, status, user_root_is,
|
||||
virtual_package_is, source_row_id, devise_user_code, devise_name,technology_user_code,technology_user_name, created_by, created_time, created_job,
|
||||
release_time, release_user_name,last_convert_mbom_user_name,last_convert_mbom_time, expire_end_time, remark, dept_name, level_num, change_desc, notice_nums,
|
||||
order_no, modify_time
|
||||
</sql>
|
||||
|
||||
<select id="getParentChildBatch" resultType="com.nflg.product.bomnew.pojo.vo.BomNewPbomParentFormalVO">
|
||||
select *,bom_version_row_id as bom_row_id
|
||||
from t_bom_new_pbom_child_formal
|
||||
where parent_row_id in
|
||||
<foreach collection="rowIds" item="rowId" open="(" separator="," close=")">
|
||||
#{rowId}
|
||||
</foreach>
|
||||
</select>
|
||||
<select id="getParentChild" resultType="com.nflg.product.bomnew.pojo.vo.BomNewPbomParentFormalVO">
|
||||
select *,bom_version_row_id as bom_row_id
|
||||
from t_bom_new_pbom_child_formal
|
||||
where parent_row_id = #{rowId}
|
||||
order by order_number
|
||||
</select>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue