Merge branch 'refs/heads/feature/DM/nflg-bom-dq' into feature/mobilebroken/update-material
This commit is contained in:
commit
cd137991e8
|
|
@ -7,10 +7,7 @@ import com.google.common.collect.ImmutableList;
|
|||
import com.mzt.logapi.context.LogRecordContext;
|
||||
import com.mzt.logapi.starter.annotation.LogRecord;
|
||||
import com.nflg.product.base.core.api.BaseApi;
|
||||
import com.nflg.product.bomnew.pojo.query.BomExceptionQuery;
|
||||
import com.nflg.product.bomnew.pojo.query.BomNewDQbomPageQuery;
|
||||
import com.nflg.product.bomnew.pojo.query.BomNewDQbomQuery;
|
||||
import com.nflg.product.bomnew.pojo.query.BomNewDQbomSaveQuery;
|
||||
import com.nflg.product.bomnew.pojo.query.*;
|
||||
import com.nflg.product.bomnew.pojo.vo.*;
|
||||
import com.nflg.product.bomnew.service.DQBomImportService;
|
||||
import com.nflg.product.bomnew.service.DQBomService;
|
||||
|
|
@ -251,4 +248,26 @@ public class DQBomApi extends BaseApi {
|
|||
, HttpServletResponse response) throws IOException {
|
||||
EecExcelUtil.export(response, messages, OperationErrorMsgVO.class, "错误信息");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量查询物料信息
|
||||
* @param query 查询条件
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("queryMaterials")
|
||||
@ApiOperation("批量查询物料信息")
|
||||
public ResultVO<List<QueryMaterialsVO>> queryMaterials(@Valid @RequestBody @NotEmpty List<QueryMaterialsQuery> query) {
|
||||
return ResultVO.success(dQBomService.queryMaterials(query));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询物料信息
|
||||
* @param query 查询条件
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("queryMaterial")
|
||||
@ApiOperation("查询物料信息")
|
||||
public ResultVO<QueryMaterialsVO> queryMaterial(@Valid @RequestBody @NotEmpty QueryMaterialsQuery query) {
|
||||
return ResultVO.success(dQBomService.queryMaterial(query));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,28 @@
|
|||
package com.nflg.product.bomnew.pojo.query;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* @author 曹鹏飞
|
||||
* @date 2024/5/25 14:17:04
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value = "com-nflg-product-bomnew-pojo-new-query-QueryMaterialsQuery")
|
||||
public class QueryMaterialsQuery {
|
||||
|
||||
/**
|
||||
* 图号
|
||||
*/
|
||||
@ApiModelProperty(value = "图号")
|
||||
private String drawingNo;
|
||||
|
||||
/**
|
||||
* 物料编码
|
||||
*/
|
||||
@ApiModelProperty(value = "物料编码")
|
||||
private String materialNo;
|
||||
}
|
||||
|
|
@ -0,0 +1,70 @@
|
|||
package com.nflg.product.bomnew.pojo.vo;
|
||||
|
||||
import com.nflg.product.base.core.conmon.util.SessionUtil;
|
||||
import com.nflg.product.bomnew.constant.EBomStatusEnum;
|
||||
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.time.format.DateTimeFormatter;
|
||||
|
||||
/**
|
||||
* @author 曹鹏飞
|
||||
* @date 2024/5/26 16:38:29
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class QueryMaterialsVO extends BaseMaterialVO implements Serializable {
|
||||
|
||||
/**
|
||||
* 设计人员名称
|
||||
*/
|
||||
@ApiModelProperty(value = "设计人员名称")
|
||||
private String deviseName = SessionUtil.getRealName();
|
||||
|
||||
/**
|
||||
* 设计维护部门名称
|
||||
*/
|
||||
@ApiModelProperty(value = "设计维护部门名称")
|
||||
private String deptName = SessionUtil.getFullDeptName();
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private LocalDateTime createdTime = LocalDateTime.now();
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@ApiModelProperty(value = "修改时间")
|
||||
private LocalDateTime modifyTime;
|
||||
|
||||
/**
|
||||
* 版本过期时间=下个版本的创建时间
|
||||
*/
|
||||
@ApiModelProperty(value = "版本过期时间=下个版本的创建时间")
|
||||
private LocalDateTime expireEndTime = LocalDateTime.parse("9999-12-31 23:59:59", DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
|
||||
|
||||
/**
|
||||
* 1=待复核、2=已复核、3=已退回、4=定版(已发布PBOM)
|
||||
*/
|
||||
@ApiModelProperty(value = "1=待复核、2=已复核、3=已退回、4=定版(已发布PBOM)99=借用件 100=引用件")
|
||||
private Integer status = EBomStatusEnum.CHECKED.getValue();
|
||||
|
||||
/**
|
||||
* 是否有BOM: 0-否 1-是
|
||||
*/
|
||||
@ApiModelProperty(value = "是否有BOM: 0-否 1-是")
|
||||
private Integer bomExist = 0;
|
||||
|
||||
@ApiModelProperty("单重1")
|
||||
private BigDecimal unitWeight;
|
||||
|
||||
public BigDecimal getUnitWeight() {
|
||||
return getMaterialWeight();
|
||||
}
|
||||
}
|
||||
|
|
@ -12,16 +12,14 @@ 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.bomnew.constant.*;
|
||||
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.T1DTO;
|
||||
import com.nflg.product.bomnew.pojo.entity.BomNewDQbomChildEntity;
|
||||
import com.nflg.product.bomnew.pojo.entity.BomNewDQbomParentEntity;
|
||||
import com.nflg.product.bomnew.pojo.entity.BomNewPbomChildEntity;
|
||||
import com.nflg.product.bomnew.pojo.entity.BomNewPbomParentEntity;
|
||||
import com.nflg.product.bomnew.pojo.query.BomExceptionQuery;
|
||||
import com.nflg.product.bomnew.pojo.query.BomNewDQbomPageQuery;
|
||||
import com.nflg.product.bomnew.pojo.query.BomNewDQbomQuery;
|
||||
import com.nflg.product.bomnew.pojo.query.BomNewDQbomSaveQuery;
|
||||
import com.nflg.product.bomnew.pojo.query.*;
|
||||
import com.nflg.product.bomnew.pojo.vo.*;
|
||||
import com.nflg.product.bomnew.util.BomUtil;
|
||||
import com.nflg.product.bomnew.util.VUtils;
|
||||
|
|
@ -667,4 +665,37 @@ public class DQBomService {
|
|||
}
|
||||
return datas;
|
||||
}
|
||||
|
||||
public List<QueryMaterialsVO> 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 Convert.toList(QueryMaterialsVO.class, datas);
|
||||
}
|
||||
|
||||
public QueryMaterialsVO queryMaterial(QueryMaterialsQuery query) {
|
||||
List<BaseMaterialVO> vos = null;
|
||||
if (StrUtil.isNotBlank(query.getMaterialNo())) {
|
||||
vos = SpringUtil.getBean(MaterialMainMapper.class).getMaterialBaseInfo(Collections.singletonList(query.getMaterialNo()));
|
||||
} else if (StrUtil.isNotBlank(query.getDrawingNo())) {
|
||||
vos = SpringUtil.getBean(MaterialMainMapper.class).getMaterialByDrawingNo(Collections.singletonList(query.getDrawingNo()));
|
||||
}
|
||||
if (CollUtil.isNotEmpty(vos)) {
|
||||
return Convert.convert(QueryMaterialsVO.class, vos.get(0));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue