导入数据结构
This commit is contained in:
parent
2752ef5f7e
commit
6ac310c0d0
|
|
@ -10,8 +10,10 @@ import com.nflg.product.base.core.api.BaseApi;
|
|||
import com.nflg.product.base.core.conmon.util.SessionUtil;
|
||||
import com.nflg.product.bomnew.pojo.dto.*;
|
||||
import com.nflg.product.bomnew.pojo.entity.BomNewEbomParentEntity;
|
||||
import com.nflg.product.bomnew.pojo.query.BomNewEbomMaterialQuery;
|
||||
import com.nflg.product.bomnew.pojo.query.BomNewEbomParentQuery;
|
||||
import com.nflg.product.bomnew.pojo.query.OriginalBomQuery;
|
||||
import com.nflg.product.bomnew.pojo.vo.BaseMaterialVO;
|
||||
import com.nflg.product.bomnew.pojo.vo.BomNewEbomEditDetailVO;
|
||||
import com.nflg.product.bomnew.pojo.vo.BomNewEbomParentVO;
|
||||
import com.nflg.product.bomnew.pojo.vo.BomOriginalListVO;
|
||||
|
|
@ -28,6 +30,7 @@ import io.swagger.annotations.Api;
|
|||
import io.swagger.annotations.ApiOperation;
|
||||
import nflg.product.common.constant.STATE;
|
||||
import nflg.product.common.vo.ResultVO;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.ttzero.excel.entity.ListSheet;
|
||||
|
|
@ -145,12 +148,12 @@ public class EbomApi extends BaseApi {
|
|||
|
||||
@GetMapping("createBomImport")
|
||||
@ApiOperation("创建EBOM-导入")
|
||||
public ResultVO<List<BomNewOriginalExcelDTO>> createBomImport(@RequestParam(value = "file") MultipartFile file) throws IOException {
|
||||
public ResultVO<List<BomNewEBomImportExcelDTO>> createBomImport(@RequestParam(value = "file") MultipartFile file) throws IOException {
|
||||
if (file != null && !file.getOriginalFilename().endsWith("xls") && !file.getOriginalFilename().endsWith("xlsx")) {
|
||||
return ResultVO.error("请上传Excel文件");
|
||||
}
|
||||
List<BomNewOriginalExcelDTO> result = EecExcelUtil.getExcelContext(file.getInputStream(), BomNewOriginalExcelDTO.class);
|
||||
materialMainService.intiMaterialInfo(result, BomNewOriginalExcelDTO::getMaterialNo);
|
||||
List<BomNewEBomImportExcelDTO> result = EecExcelUtil.getExcelContext(file.getInputStream(), BomNewEBomImportExcelDTO.class);
|
||||
materialMainService.intiMaterialInfo(result, BomNewEBomImportExcelDTO::getMaterialNo);
|
||||
return ResultVO.success(result);
|
||||
}
|
||||
|
||||
|
|
@ -168,7 +171,7 @@ public class EbomApi extends BaseApi {
|
|||
}
|
||||
|
||||
@PostMapping("createParentBom")
|
||||
@ApiOperation("创建BOM")
|
||||
@ApiOperation("创建根节点BOM")
|
||||
public ResultVO<Boolean> createParentBom(@RequestBody BomNewEBomCreateDTO createDTO) {
|
||||
VUtils.isTure(StrUtil.isBlank(createDTO.getMaterialNo())).throwMessage("物料编码不能为空");
|
||||
//子级物料编码不能为空
|
||||
|
|
@ -180,7 +183,6 @@ public class EbomApi extends BaseApi {
|
|||
}
|
||||
|
||||
|
||||
|
||||
@PostMapping("revertDesign")
|
||||
@ApiOperation("退回到设计")
|
||||
public ResultVO<Boolean> revertDesign(@RequestBody BomNewEBomRevertDTO dto) {
|
||||
|
|
@ -207,17 +209,30 @@ public class EbomApi extends BaseApi {
|
|||
}
|
||||
|
||||
|
||||
|
||||
@GetMapping("editDetail")
|
||||
@ApiOperation("编辑物料列表")
|
||||
public ResultVO<BomNewEbomEditDetailVO> editDetail(@RequestParam("bomRowId") Long bomRowId) {
|
||||
|
||||
ResultVO resultVO=new ResultVO();
|
||||
ResultVO resultVO = new ResultVO();
|
||||
resultVO.setData(bomNewEbomParentService.editDetail(bomRowId));
|
||||
return resultVO;
|
||||
return resultVO;
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("queryMaterial")
|
||||
@ApiOperation("查询物料信息")
|
||||
public ResultVO<BaseMaterialVO> queryMaterial(@RequestBody BomNewEbomMaterialQuery query) {
|
||||
if (StringUtils.isEmpty(query.getDrawingNo()) && StringUtils.isEmpty(query.getMaterialNo())) {
|
||||
return ResultVO.error(STATE.Error, "图号或物料编码不能为空");
|
||||
}
|
||||
|
||||
return ResultVO.success(bomNewEbomParentService.queryMaterial(query));
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,2 +1,17 @@
|
|||
package com.nflg.product.bomnew.pojo.dto;public class BomNewEBomParentCreateDTO {
|
||||
package com.nflg.product.bomnew.pojo.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class BomNewEBomParentCreateDTO {
|
||||
|
||||
@ApiModelProperty("操作类型 1-暂存 2-提交")
|
||||
private Integer opType=1;
|
||||
@ApiModelProperty("列表数据")
|
||||
private List<BomNewEbomParentDTO> datas;
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,12 +6,18 @@ import lombok.Data;
|
|||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class BomNewEBomParentCreateDTO {
|
||||
public class BomNewEBomParentEditDTO extends BomNewEBomParentCreateDTO{
|
||||
@ApiModelProperty("上层")
|
||||
private BomNewEbomParentDTO parent;
|
||||
|
||||
|
||||
|
||||
@ApiModelProperty("删除的列表")
|
||||
private List<BomNewEbomParentDTO> delDatas;
|
||||
|
||||
|
||||
|
||||
|
||||
@ApiModelProperty("操作类型 1-暂存 2-提交")
|
||||
private Integer opType=1;
|
||||
@ApiModelProperty("列表数据")
|
||||
private List<BomNewEbomParentDTO> datas;
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue