fix(pbom): 解决导入到SAP时发货包作为根节点时找不到直发包的问题

This commit is contained in:
曹鹏飞 2024-08-05 23:10:34 +08:00
parent 37856ae888
commit 09c2b1c8ee
1 changed files with 4 additions and 2 deletions

View File

@ -40,6 +40,7 @@ public class BomNewPbomExportToSAPImpl implements IBomNewPbomExportToSAP {
//是否是 一次性订单/配件销售订单
private boolean isForSale = false;
private boolean is21 = false;
private boolean is31 = false;
private final String dateYMD = DateUtil.format(new Date(), "yyyyMMdd");
private final Map<Long, List<T1ExtDTO>> cmap = new HashMap<>();
@ -59,6 +60,7 @@ public class BomNewPbomExportToSAPImpl implements IBomNewPbomExportToSAP {
public List<OperationErrorMsgVO> export(Long rootBomRowId) {
BomNewPbomParentEntity root = bomNewPbomParentService.getById(rootBomRowId);
is21 = root.getMaterialNo().startsWith("21");
is31 = root.getMaterialNo().startsWith("31");
List<BomNewPbomChildEntity> rcs = bomNewPbomChildService.lambdaQuery()
.eq(BomNewPbomChildEntity::getParentRowId, root.getRowId())
.orderByAsc(BomNewPbomChildEntity::getOrderNumber)
@ -77,7 +79,7 @@ public class BomNewPbomExportToSAPImpl implements IBomNewPbomExportToSAP {
List<OperationErrorMsgVO> liErrMsg = null;
try {
Long ddpRowId = null;
if (is21) {
if (!is31) {
//选出直发包
ddpRowId = getZFBBomRowId(rcs);
}
@ -85,7 +87,7 @@ public class BomNewPbomExportToSAPImpl implements IBomNewPbomExportToSAP {
BomNewPbomParentEntity cp = getParent(it);
addToT1(convert(cp, it, root.getMaterialNo(), false));
if (Objects.nonNull(cp)) {
if (is21) {
if (!is31) {
buildChildrenForSap(ddpRowId, cp, it, false);
} else {
//选出直发包