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 查询条件
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("queryMaterial")
|
||||
@PostMapping("queryMaterials")
|
||||
@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));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -452,9 +452,14 @@ public class EbomApi extends BaseApi {
|
|||
return ResultVO.success(bomNewEbomParentService.getSource(rowId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量查询物料信息
|
||||
* @param query query
|
||||
* @return 物料信息
|
||||
*/
|
||||
@PostMapping("queryMaterials")
|
||||
@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));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,10 +5,6 @@ import io.swagger.annotations.ApiModelProperty;
|
|||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author 曹鹏飞
|
||||
* @date 2024/5/25 14:17:04
|
||||
|
|
@ -19,16 +15,14 @@ import java.util.List;
|
|||
public class QueryMaterialsQuery {
|
||||
|
||||
/**
|
||||
* 数据类别,0-物料编号;1-图号
|
||||
* 图号
|
||||
*/
|
||||
@ApiModelProperty(value = "数据类别,0-物料编号;1-图号")
|
||||
@NotNull
|
||||
private Integer type;
|
||||
@ApiModelProperty(value = "图号")
|
||||
private String drawingNo;
|
||||
|
||||
/**
|
||||
* 物料编号或者图号
|
||||
* 物料编码
|
||||
*/
|
||||
@ApiModelProperty(value = "物料编号或者图号")
|
||||
@NotEmpty
|
||||
private List<String> keys;
|
||||
@ApiModelProperty(value = "物料编码")
|
||||
private String materialNo;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -385,6 +385,7 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
|||
|
||||
if (parentEntity.getStatus().equals(EBomStatusEnum.PUBLISHED.getValue())) {
|
||||
child.setStatus(EBomStatusEnum.BORROWED_PARTS.getValue());
|
||||
child.setBomRowId(0L);
|
||||
}
|
||||
// //非本人则为借用件
|
||||
// else if (!parentEntity.getCreatedBy().equals(child.getCreatedBy())) {
|
||||
|
|
@ -2344,14 +2345,24 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
|||
return null;
|
||||
}
|
||||
|
||||
public List<BaseMaterialVO> queryMaterials(QueryMaterialsQuery query) {
|
||||
if (query.getType() == 0) {
|
||||
return SpringUtil.getBean(MaterialMainMapper.class).getMaterialBaseInfo(query.getKeys());
|
||||
} else if (query.getType() == 1) {
|
||||
return SpringUtil.getBean(MaterialMainMapper.class).getMaterialByDrawingNo(query.getKeys());
|
||||
} else {
|
||||
throw new NflgBusinessException(STATE.BusinessError, "无效的类别");
|
||||
public List<BaseMaterialVO> queryMaterials(List<QueryMaterialsQuery> query) {
|
||||
List<BaseMaterialVO> datas = new ArrayList<>();
|
||||
List<String> keys = query.stream().map(QueryMaterialsQuery::getMaterialNo)
|
||||
.filter(StrUtil::isNotBlank)
|
||||
.distinct()
|
||||
.collect(Collectors.toList());
|
||||
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) {
|
||||
|
|
|
|||
|
|
@ -11,7 +11,6 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|||
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
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.MaterialMainMapper;
|
||||
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.VersionUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import nflg.product.common.constant.STATE;
|
||||
import nflg.product.common.vo.ResultVO;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
|
@ -668,13 +666,23 @@ public class DQBomService {
|
|||
return datas;
|
||||
}
|
||||
|
||||
public List<BaseMaterialVO> queryMaterials(QueryMaterialsQuery query) {
|
||||
if (query.getType() == 0) {
|
||||
return SpringUtil.getBean(MaterialMainMapper.class).getMaterialBaseInfo(query.getKeys());
|
||||
} else if (query.getType() == 1) {
|
||||
return SpringUtil.getBean(MaterialMainMapper.class).getMaterialByDrawingNo(query.getKeys());
|
||||
} else {
|
||||
throw new NflgBusinessException(STATE.BusinessError, "无效的类别");
|
||||
public List<BaseMaterialVO> queryMaterials(List<QueryMaterialsQuery> query) {
|
||||
List<BaseMaterialVO> datas = new ArrayList<>();
|
||||
List<String> keys = query.stream().map(QueryMaterialsQuery::getMaterialNo)
|
||||
.filter(StrUtil::isNotBlank)
|
||||
.distinct()
|
||||
.collect(Collectors.toList());
|
||||
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);
|
||||
//构建变更明细
|
||||
buildUpgradeChangeDetail(vo, VirtualPackageTypeEnum.DIRECT_DELIVERY_PACKAGE);
|
||||
buildUpgradeChangeDetail(vo, VirtualPackageTypeEnum.PRE_ASSEMBLY_PACKAGE);
|
||||
// buildUpgradeChangeDetail(vo, VirtualPackageTypeEnum.DIRECT_DELIVERY_PACKAGE);
|
||||
// buildUpgradeChangeDetail(vo, VirtualPackageTypeEnum.PRE_ASSEMBLY_PACKAGE);
|
||||
|
||||
//子级
|
||||
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) {
|
||||
BomNewPbomChildEntity childEnt = new BomNewPbomChildEntity();
|
||||
BeanUtil.copyProperties(eb, childEnt);
|
||||
BeanUtil.copyProperties(eb, childEnt,"sourceRowId");
|
||||
childEnt.setRowId(IdWorker.getId());
|
||||
childEnt.setParentRowId(parentEnt.getRowId());
|
||||
childEnt.setFacCode(facCode);
|
||||
|
|
|
|||
Loading…
Reference in New Issue