diff --git a/src/main/java/com/gaotao/modules/api/service/impl/IfsApiIssueAndReturnServiceImpl.java b/src/main/java/com/gaotao/modules/api/service/impl/IfsApiIssueAndReturnServiceImpl.java index e0cca57..664cddd 100644 --- a/src/main/java/com/gaotao/modules/api/service/impl/IfsApiIssueAndReturnServiceImpl.java +++ b/src/main/java/com/gaotao/modules/api/service/impl/IfsApiIssueAndReturnServiceImpl.java @@ -312,21 +312,19 @@ public class IfsApiIssueAndReturnServiceImpl implements IfsApiIssueAndReturnServ params.put("domainUserID", domainUserID); params.put("ifsSiteID", otherTransactionIfsDto.getIfsSiteID()); params.put("ifsPartNo", otherTransactionIfsDto.getIfsPartNo()); + params.put("ifsConfigurationID", "*"); params.put("ifsLocationNo", otherTransactionIfsDto.getIfsLocationNo()); params.put("ifsLotBatchNo", otherTransactionIfsDto.getIfsLotBatchNo()); params.put("ifsSerialNo", otherTransactionIfsDto.getIfsSerialNo()); - params.put("ifsWdrNo", otherTransactionIfsDto.getIfsWdrNo()); params.put("ifsEngChgLevel", otherTransactionIfsDto.getIfsEngChgLevel()); - params.put("ifsActivitySeq", otherTransactionIfsDto.getIfsActivitySeq()); + params.put("ifsWdrNo", otherTransactionIfsDto.getIfsWdrNo()); params.put("ifsHandlingUntitID", otherTransactionIfsDto.getIfsHandlingUntitID()); - params.put("ifsQuantity", otherTransactionIfsDto.getIfsQuantity()); - params.put("ifsTransactionType", otherTransactionIfsDto.getIfsTransactionType()); - params.put("ifsReason", otherTransactionIfsDto.getIfsReason()); - params.put("ifsOperator", otherTransactionIfsDto.getIfsOperator()); + params.put("ifsQtyReceived", otherTransactionIfsDto.getIfsQuantity()); + params.put("ifsPartOwnershipDb", "COMPANY OWNED"); ObjectMapper objectMapper = new ObjectMapper(); String jsonBody = objectMapper.writeValueAsString(params); - String ifsResponse = HttpUtils.doPost(ifsUrl + "OtherInbound", jsonBody, null); + String ifsResponse = HttpUtils.doPost(ifsUrl + "ReceiveInventoryPart", jsonBody, null); return ifsResponse; } catch (Exception e) { diff --git a/src/main/java/com/gaotao/modules/other/service/impl/OtherInboundServiceImpl.java b/src/main/java/com/gaotao/modules/other/service/impl/OtherInboundServiceImpl.java index ad80285..f4b42e0 100644 --- a/src/main/java/com/gaotao/modules/other/service/impl/OtherInboundServiceImpl.java +++ b/src/main/java/com/gaotao/modules/other/service/impl/OtherInboundServiceImpl.java @@ -87,32 +87,28 @@ public class OtherInboundServiceImpl implements OtherInboundService { List detailList = genOtherInboundTransAndChangeStock(transRequest, "IN"); // 6. 调用IFS接口同步入库信息 -// for (TransDetail detail : detailList) { -// OtherTransactionIfsDto ifsDto = new OtherTransactionIfsDto(); -// ifsDto.setIfsSiteID(dto.getSite()); -// ifsDto.setIfsPartNo(detail.getPartNo()); -// ifsDto.setIfsLocationNo(detail.getLocationId()); -// ifsDto.setIfsLotBatchNo(detail.getBatchNo()); -// ifsDto.setIfsSerialNo("*"); -// ifsDto.setIfsWdrNo(detail.getWdrNo()); -// ifsDto.setIfsEngChgLevel("1"); -// ifsDto.setIfsActivitySeq(BigDecimal.ZERO); -// ifsDto.setIfsHandlingUntitID(BigDecimal.ZERO); -// ifsDto.setIfsQuantity(detail.getTransQty()); -// ifsDto.setIfsTransactionType("IN"); -// ifsDto.setIfsReason(dto.getInboundReason()); -// ifsDto.setIfsOperator(dto.getOperatorName()); -// -// try { -// String ifsResponse = ifsApiIssueAndReturnService.addOtherInbound(ifsDto); -// // 检查IFS响应,如果失败可能需要回滚事务 -// if (!"IFSUpdated".equals(ifsResponse) && !"\"IFSUpdated\"".equals(ifsResponse)) { -// throw new XJException("IFS同步失败,响应: " + ifsResponse); -// } -// } catch (Exception ifsException) { -// throw new XJException("其它入库IFS同步失败: " + ifsException.getMessage()); -// } -// } + for (TransDetail detail : detailList) { + OtherTransactionIfsDto ifsDto = new OtherTransactionIfsDto(); + ifsDto.setIfsSiteID(dto.getSite()); + ifsDto.setIfsPartNo(detail.getPartNo()); + ifsDto.setIfsLocationNo(detail.getLocationId()); + ifsDto.setIfsLotBatchNo(detail.getBatchNo()); + ifsDto.setIfsSerialNo("*"); + ifsDto.setIfsWdrNo(detail.getWdrNo()); + ifsDto.setIfsEngChgLevel("1"); + ifsDto.setIfsHandlingUntitID(BigDecimal.ZERO); + ifsDto.setIfsQuantity(detail.getTransQty()); + + try { + String ifsResponse = ifsApiIssueAndReturnService.addOtherInbound(ifsDto); + // 检查IFS响应,如果失败可能需要回滚事务 + if (!"IFSUpdated".equals(ifsResponse) && !"\"IFSUpdated\"".equals(ifsResponse)) { + throw new XJException("IFS同步失败,响应: " + ifsResponse); + } + } catch (Exception ifsException) { + throw new XJException("其它入库IFS同步失败: " + ifsException.getMessage()); + } + } // 7. 更新HandlingUnit状态 updateHandlingUnitStatus(handlingUnits, detailList, currentUser);