转EBOM时- PBOM发布报错修复
This commit is contained in:
parent
b7e9efecb7
commit
19ce8eabc0
|
|
@ -36,6 +36,7 @@ import java.io.IOException;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
|
||||
/**
|
||||
|
|
@ -288,11 +289,18 @@ public class PBomApi extends BaseApi {
|
|||
|
||||
@PostMapping("realesePbom")
|
||||
@ApiOperation("发布Pbom")
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@LogRecord(success = "发布PBom,物料编码:{{#bom.materialNo}}-版本:{{#bom.currentVersion}} 操作结果:{{#_ret}}", bizNo = "{{#bomRowId}}",type = "发布PBom")
|
||||
public ResultVO<List<OperationErrorMsgVO>> realesePbom(@Valid @RequestBody @NotNull PbomImportToSAPQuery query) {
|
||||
bomNewPbomParentService.realesePbom(query.getRootBomRowId());
|
||||
BomNewPbomParentEntity parent = bomNewPbomParentService.realesePbom(query.getRootBomRowId());
|
||||
BomNewPbomParentEntity parentEnt = bomNewPbomParentService.getById(query.getRootBomRowId());
|
||||
if(Objects.isNull(parentEnt)){
|
||||
parentEnt = bomNewPbomParentService.lambdaQuery().eq(BomNewPbomParentEntity::getMaterialNo, parent.getMaterialNo())
|
||||
.eq(BomNewPbomParentEntity::getFacCode, parent.getFacCode())
|
||||
.last(" order by current_version desc limit 1").one();
|
||||
query.setRootBomRowId(parentEnt.getRowId());
|
||||
}
|
||||
return ResultVO.success(bomNewPbomParentService.importToSAP2(query));
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1116,7 +1116,7 @@ public class BomNewPbomParentService extends ServiceImpl<BomNewPbomParentMapper,
|
|||
* @param bomRowId
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean realesePbom(Long bomRowId) {
|
||||
public BomNewPbomParentEntity realesePbom(Long bomRowId) {
|
||||
BomNewPbomParentEntity parent = this.getById(bomRowId);
|
||||
VUtils.isTure(parent.getStatus() >= PBomStatusEnum.PUBLISH.getValue()).throwMessage("pbom已发布无需在发布,请刷新数据");
|
||||
LogRecordContext.putVariable("bom", parent);
|
||||
|
|
@ -1178,7 +1178,7 @@ public class BomNewPbomParentService extends ServiceImpl<BomNewPbomParentMapper,
|
|||
log.error("realesePbom", ex);
|
||||
throw new NflgBusinessException(STATE.BusinessError, "发布Pbom失败:" + ex.getMessage());
|
||||
}
|
||||
return true;
|
||||
return parent;
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue