Merge branch 'refs/heads/feature/DM/nflg-bom' into feature/DM/nflg-bom-transition
This commit is contained in:
commit
546a75a3f9
|
|
@ -254,9 +254,9 @@ public class DQBomApi extends BaseApi {
|
||||||
* @param query 查询条件
|
* @param query 查询条件
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@PostMapping("queryMaterial")
|
@PostMapping("queryMaterials")
|
||||||
@ApiOperation("批量查询物料信息")
|
@ApiOperation("批量查询物料信息")
|
||||||
public ResultVO<List<BaseMaterialVO>> queryMaterial(@Valid @RequestBody QueryMaterialsQuery query) {
|
public ResultVO<List<BaseMaterialVO>> queryMaterials(@Valid @RequestBody @NotEmpty List<QueryMaterialsQuery> query) {
|
||||||
return ResultVO.success(dQBomService.queryMaterials(query));
|
return ResultVO.success(dQBomService.queryMaterials(query));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -452,9 +452,14 @@ public class EbomApi extends BaseApi {
|
||||||
return ResultVO.success(bomNewEbomParentService.getSource(rowId));
|
return ResultVO.success(bomNewEbomParentService.getSource(rowId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量查询物料信息
|
||||||
|
* @param query query
|
||||||
|
* @return 物料信息
|
||||||
|
*/
|
||||||
@PostMapping("queryMaterials")
|
@PostMapping("queryMaterials")
|
||||||
@ApiOperation("批量查询物料信息")
|
@ApiOperation("批量查询物料信息")
|
||||||
public ResultVO<List<BaseMaterialVO>> queryMaterials(@Valid @RequestBody QueryMaterialsQuery query) {
|
public ResultVO<List<BaseMaterialVO>> queryMaterials(@Valid @RequestBody @NotEmpty List<QueryMaterialsQuery> query) {
|
||||||
return ResultVO.success(bomNewEbomParentService.queryMaterials(query));
|
return ResultVO.success(bomNewEbomParentService.queryMaterials(query));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,10 +5,6 @@ import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.experimental.Accessors;
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
import javax.validation.constraints.NotEmpty;
|
|
||||||
import javax.validation.constraints.NotNull;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author 曹鹏飞
|
* @author 曹鹏飞
|
||||||
* @date 2024/5/25 14:17:04
|
* @date 2024/5/25 14:17:04
|
||||||
|
|
@ -19,16 +15,14 @@ import java.util.List;
|
||||||
public class QueryMaterialsQuery {
|
public class QueryMaterialsQuery {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 数据类别,0-物料编号;1-图号
|
* 图号
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "数据类别,0-物料编号;1-图号")
|
@ApiModelProperty(value = "图号")
|
||||||
@NotNull
|
private String drawingNo;
|
||||||
private Integer type;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 物料编号或者图号
|
* 物料编码
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "物料编号或者图号")
|
@ApiModelProperty(value = "物料编码")
|
||||||
@NotEmpty
|
private String materialNo;
|
||||||
private List<String> keys;
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -385,6 +385,7 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
||||||
|
|
||||||
if (parentEntity.getStatus().equals(EBomStatusEnum.PUBLISHED.getValue())) {
|
if (parentEntity.getStatus().equals(EBomStatusEnum.PUBLISHED.getValue())) {
|
||||||
child.setStatus(EBomStatusEnum.BORROWED_PARTS.getValue());
|
child.setStatus(EBomStatusEnum.BORROWED_PARTS.getValue());
|
||||||
|
child.setBomRowId(0L);
|
||||||
}
|
}
|
||||||
// //非本人则为借用件
|
// //非本人则为借用件
|
||||||
// else if (!parentEntity.getCreatedBy().equals(child.getCreatedBy())) {
|
// else if (!parentEntity.getCreatedBy().equals(child.getCreatedBy())) {
|
||||||
|
|
@ -2344,14 +2345,24 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<BaseMaterialVO> queryMaterials(QueryMaterialsQuery query) {
|
public List<BaseMaterialVO> queryMaterials(List<QueryMaterialsQuery> query) {
|
||||||
if (query.getType() == 0) {
|
List<BaseMaterialVO> datas = new ArrayList<>();
|
||||||
return SpringUtil.getBean(MaterialMainMapper.class).getMaterialBaseInfo(query.getKeys());
|
List<String> keys = query.stream().map(QueryMaterialsQuery::getMaterialNo)
|
||||||
} else if (query.getType() == 1) {
|
.filter(StrUtil::isNotBlank)
|
||||||
return SpringUtil.getBean(MaterialMainMapper.class).getMaterialByDrawingNo(query.getKeys());
|
.distinct()
|
||||||
} else {
|
.collect(Collectors.toList());
|
||||||
throw new NflgBusinessException(STATE.BusinessError, "无效的类别");
|
if (CollUtil.isNotEmpty(keys)) {
|
||||||
|
datas.addAll(SpringUtil.getBean(MaterialMainMapper.class).getMaterialBaseInfo(keys));
|
||||||
}
|
}
|
||||||
|
keys = query.stream()
|
||||||
|
.filter(it -> StrUtil.isBlank(it.getMaterialNo()) && StrUtil.isNotBlank(it.getDrawingNo()))
|
||||||
|
.map(QueryMaterialsQuery::getDrawingNo)
|
||||||
|
.distinct()
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
if (CollUtil.isNotEmpty(keys)) {
|
||||||
|
datas.addAll(SpringUtil.getBean(MaterialMainMapper.class).getMaterialByDrawingNo(keys));
|
||||||
|
}
|
||||||
|
return datas;
|
||||||
}
|
}
|
||||||
|
|
||||||
public BomNewEbomParentEntity getLatestByMaterialNo(String materialNo) {
|
public BomNewEbomParentEntity getLatestByMaterialNo(String materialNo) {
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,6 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.nflg.product.base.core.conmon.util.SessionUtil;
|
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.constant.*;
|
||||||
import com.nflg.product.bomnew.mapper.master.MaterialMainMapper;
|
import com.nflg.product.bomnew.mapper.master.MaterialMainMapper;
|
||||||
import com.nflg.product.bomnew.pojo.dto.sap.impart2.ImportSapParamDTO;
|
import com.nflg.product.bomnew.pojo.dto.sap.impart2.ImportSapParamDTO;
|
||||||
|
|
@ -26,7 +25,6 @@ import com.nflg.product.bomnew.util.BomUtil;
|
||||||
import com.nflg.product.bomnew.util.VUtils;
|
import com.nflg.product.bomnew.util.VUtils;
|
||||||
import com.nflg.product.bomnew.util.VersionUtil;
|
import com.nflg.product.bomnew.util.VersionUtil;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import nflg.product.common.constant.STATE;
|
|
||||||
import nflg.product.common.vo.ResultVO;
|
import nflg.product.common.vo.ResultVO;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
@ -668,13 +666,23 @@ public class DQBomService {
|
||||||
return datas;
|
return datas;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<BaseMaterialVO> queryMaterials(QueryMaterialsQuery query) {
|
public List<BaseMaterialVO> queryMaterials(List<QueryMaterialsQuery> query) {
|
||||||
if (query.getType() == 0) {
|
List<BaseMaterialVO> datas = new ArrayList<>();
|
||||||
return SpringUtil.getBean(MaterialMainMapper.class).getMaterialBaseInfo(query.getKeys());
|
List<String> keys = query.stream().map(QueryMaterialsQuery::getMaterialNo)
|
||||||
} else if (query.getType() == 1) {
|
.filter(StrUtil::isNotBlank)
|
||||||
return SpringUtil.getBean(MaterialMainMapper.class).getMaterialByDrawingNo(query.getKeys());
|
.distinct()
|
||||||
} else {
|
.collect(Collectors.toList());
|
||||||
throw new NflgBusinessException(STATE.BusinessError, "无效的类别");
|
if (CollUtil.isNotEmpty(keys)) {
|
||||||
|
datas.addAll(SpringUtil.getBean(MaterialMainMapper.class).getMaterialBaseInfo(keys));
|
||||||
}
|
}
|
||||||
|
keys = query.stream()
|
||||||
|
.filter(it -> StrUtil.isBlank(it.getMaterialNo()) && StrUtil.isNotBlank(it.getDrawingNo()))
|
||||||
|
.map(QueryMaterialsQuery::getDrawingNo)
|
||||||
|
.distinct()
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
if (CollUtil.isNotEmpty(keys)) {
|
||||||
|
datas.addAll(SpringUtil.getBean(MaterialMainMapper.class).getMaterialByDrawingNo(keys));
|
||||||
|
}
|
||||||
|
return datas;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -93,8 +93,8 @@ public class EBomToPBomFor31 extends EBomToPbomBase {
|
||||||
}
|
}
|
||||||
hasConvert.add(hasConvertKey);
|
hasConvert.add(hasConvertKey);
|
||||||
//构建变更明细
|
//构建变更明细
|
||||||
buildUpgradeChangeDetail(vo, VirtualPackageTypeEnum.DIRECT_DELIVERY_PACKAGE);
|
// buildUpgradeChangeDetail(vo, VirtualPackageTypeEnum.DIRECT_DELIVERY_PACKAGE);
|
||||||
buildUpgradeChangeDetail(vo, VirtualPackageTypeEnum.PRE_ASSEMBLY_PACKAGE);
|
// buildUpgradeChangeDetail(vo, VirtualPackageTypeEnum.PRE_ASSEMBLY_PACKAGE);
|
||||||
|
|
||||||
//子级
|
//子级
|
||||||
List<BomNewEbomParentVO> child = result.stream().filter(u -> u.getParentRowId().equals(vo.getBomRowId())).distinct().collect(Collectors.toList());
|
List<BomNewEbomParentVO> child = result.stream().filter(u -> u.getParentRowId().equals(vo.getBomRowId())).distinct().collect(Collectors.toList());
|
||||||
|
|
@ -109,7 +109,7 @@ public class EBomToPBomFor31 extends EBomToPbomBase {
|
||||||
//合并子级
|
//合并子级
|
||||||
for (BomNewEbomParentVO eb : mergeChild) {
|
for (BomNewEbomParentVO eb : mergeChild) {
|
||||||
BomNewPbomChildEntity childEnt = new BomNewPbomChildEntity();
|
BomNewPbomChildEntity childEnt = new BomNewPbomChildEntity();
|
||||||
BeanUtil.copyProperties(eb, childEnt);
|
BeanUtil.copyProperties(eb, childEnt,"sourceRowId");
|
||||||
childEnt.setRowId(IdWorker.getId());
|
childEnt.setRowId(IdWorker.getId());
|
||||||
childEnt.setParentRowId(parentEnt.getRowId());
|
childEnt.setParentRowId(parentEnt.getRowId());
|
||||||
childEnt.setFacCode(facCode);
|
childEnt.setFacCode(facCode);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue