fix: 电气bom优化
This commit is contained in:
parent
25ea8efdf4
commit
beedcbeb27
|
|
@ -15,6 +15,7 @@ import com.nflg.product.bomnew.pojo.vo.*;
|
|||
import com.nflg.product.bomnew.service.DQBomImportService;
|
||||
import com.nflg.product.bomnew.service.DQBomService;
|
||||
import com.nflg.product.bomnew.util.EecExcelUtil;
|
||||
import com.nflg.product.bomnew.util.VUtils;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import nflg.product.common.vo.ResultVO;
|
||||
|
|
@ -139,7 +140,7 @@ public class DQBomApi extends BaseApi {
|
|||
@PostMapping("checkException")
|
||||
@ApiOperation("异常检查")
|
||||
public ResultVO<String> checkException(@Valid @RequestBody @NotEmpty List<Long> bomRowIds) {
|
||||
dQBomService.checkException(bomRowIds.get(0));
|
||||
bomRowIds.forEach(dQBomService::checkException);
|
||||
return ResultVO.success();
|
||||
}
|
||||
|
||||
|
|
@ -151,7 +152,7 @@ public class DQBomApi extends BaseApi {
|
|||
@PostMapping("deleteBom")
|
||||
@ApiOperation("删除bom")
|
||||
public ResultVO<String> deleteBom(@Valid @RequestBody @NotEmpty List<Long> rootBomRowIds) {
|
||||
dQBomService.deleteBom(rootBomRowIds.get(0));
|
||||
rootBomRowIds.forEach(dQBomService::deleteBom);
|
||||
return ResultVO.success();
|
||||
}
|
||||
|
||||
|
|
@ -163,6 +164,7 @@ public class DQBomApi extends BaseApi {
|
|||
@PostMapping("exportBom")
|
||||
@ApiOperation("导出bom")
|
||||
public void exportBom(@Valid @RequestBody @NotEmpty List<Long> rootBomRowIds, HttpServletResponse response) throws IOException {
|
||||
VUtils.isTure(rootBomRowIds.size() > 1).throwMessage("每次只能导出1条");
|
||||
List<DQbomExcelVO> data = dQBomService.exportBom(rootBomRowIds.get(0));
|
||||
EecExcelUtil.export(response, data, DQbomExcelVO.class, "电气专用bom");
|
||||
}
|
||||
|
|
@ -175,7 +177,7 @@ public class DQBomApi extends BaseApi {
|
|||
@PostMapping("convertToPbom")
|
||||
@ApiOperation("生成pbom")
|
||||
public ResultVO convertToPbom(@Valid @RequestBody @NotEmpty List<Long> rootBomRowIds) {
|
||||
dQBomService.convertToPbom(rootBomRowIds.get(0));
|
||||
rootBomRowIds.forEach(dQBomService::convertToPbom);
|
||||
return ResultVO.success();
|
||||
}
|
||||
|
||||
|
|
@ -211,6 +213,7 @@ public class DQBomApi extends BaseApi {
|
|||
@PostMapping("importToSAP")
|
||||
@ApiOperation("导入到SAP")
|
||||
public ResultVO<Boolean> importToSAP(@Valid @RequestBody @NotEmpty List<Long> rootBomRowIds) {
|
||||
VUtils.isTure(rootBomRowIds.size() > 1).throwMessage("每次只能导入1条");
|
||||
return dQBomService.importToSAP(rootBomRowIds.get(0));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -130,7 +130,8 @@ public class BomNewDQbomExceptionCheckService {
|
|||
// } else if (parent.getMaterialNo().startsWith(BomConstant.NO_TEMPORARY_PREFIX)) {
|
||||
// status = EBomExceptionStatusEnum.EXCEPT_NO_4;
|
||||
} else {
|
||||
BaseMaterialVO materialVO = materialVOS.stream().filter(v -> v.getMaterialNo().equals(parent.getMaterialNo()))
|
||||
BaseMaterialVO materialVO = materialVOS.stream()
|
||||
.filter(v -> v.getMaterialNo().equals(parent.getMaterialNo()))
|
||||
.findFirst()
|
||||
.orElse(null);
|
||||
if (materialVO == null) {
|
||||
|
|
|
|||
|
|
@ -375,6 +375,10 @@ public class DQBomImportService {
|
|||
dQbomExcelVO.setNum(BigDecimal.ONE);
|
||||
}
|
||||
}
|
||||
if (StrUtil.equals(dQbomExcelVO.getMaterialNo(), "9000000000")) {
|
||||
dQbomExcelVO.setProjectType("T");
|
||||
}
|
||||
dQbomExcelVO.setCurrentVersion("");
|
||||
|
||||
excelContextTL.get().add(dQbomExcelVO);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -224,8 +224,9 @@ public class DQBomService {
|
|||
|
||||
if (Objects.isNull(query.getParent()) || query.getParent().getBomRowId() == 0) {
|
||||
//新增父级节点
|
||||
BomNewDQbomParentEntity oldParent = dQBomParentService.lambdaQuery().eq(BomNewDQbomParentEntity::getMaterialNo, query.getParent().getMaterialNo())
|
||||
.eq(BomNewDQbomParentEntity::getLastVersionIs, 1)
|
||||
BomNewDQbomParentEntity oldParent = dQBomParentService.lambdaQuery()
|
||||
.eq(BomNewDQbomParentEntity::getMaterialNo, query.getParent().getMaterialNo())
|
||||
.eq(BomNewDQbomParentEntity::getStatus, DQBomStatusEnum.WAIT_CONVERT.getValue())
|
||||
.one();
|
||||
VUtils.isTure(oldParent != null && !oldParent.getCreatedBy().equals(SessionUtil.getUserCode()))
|
||||
.throwMessage("父级已被其他人创建");
|
||||
|
|
@ -380,7 +381,7 @@ public class DQBomService {
|
|||
t1.setMATNR(d.getParentMaterialNo());
|
||||
t1.setIDNRK(d.getMaterialNo());
|
||||
t1.setMEINS(d.getMaterialUnit());
|
||||
t1.setMENGE("1");
|
||||
t1.setMENGE(d.getNum().toString());
|
||||
t1.setPOSTP(d.getProjectType());
|
||||
t1.setDATUM(dateYMD);
|
||||
t1s.add(t1);
|
||||
|
|
|
|||
Loading…
Reference in New Issue