Browse Source

2025-09-28

pda 其它入库 其它出库
master
fengyuan_yang 4 months ago
parent
commit
b098fb3187
  1. 12
      src/main/java/com/gaotao/modules/api/service/impl/IfsApiIssueAndReturnServiceImpl.java
  2. 48
      src/main/java/com/gaotao/modules/other/service/impl/OtherInboundServiceImpl.java

12
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("domainUserID", domainUserID);
params.put("ifsSiteID", otherTransactionIfsDto.getIfsSiteID()); params.put("ifsSiteID", otherTransactionIfsDto.getIfsSiteID());
params.put("ifsPartNo", otherTransactionIfsDto.getIfsPartNo()); params.put("ifsPartNo", otherTransactionIfsDto.getIfsPartNo());
params.put("ifsConfigurationID", "*");
params.put("ifsLocationNo", otherTransactionIfsDto.getIfsLocationNo()); params.put("ifsLocationNo", otherTransactionIfsDto.getIfsLocationNo());
params.put("ifsLotBatchNo", otherTransactionIfsDto.getIfsLotBatchNo()); params.put("ifsLotBatchNo", otherTransactionIfsDto.getIfsLotBatchNo());
params.put("ifsSerialNo", otherTransactionIfsDto.getIfsSerialNo()); params.put("ifsSerialNo", otherTransactionIfsDto.getIfsSerialNo());
params.put("ifsWdrNo", otherTransactionIfsDto.getIfsWdrNo());
params.put("ifsEngChgLevel", otherTransactionIfsDto.getIfsEngChgLevel()); params.put("ifsEngChgLevel", otherTransactionIfsDto.getIfsEngChgLevel());
params.put("ifsActivitySeq", otherTransactionIfsDto.getIfsActivitySeq());
params.put("ifsWdrNo", otherTransactionIfsDto.getIfsWdrNo());
params.put("ifsHandlingUntitID", otherTransactionIfsDto.getIfsHandlingUntitID()); 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(); ObjectMapper objectMapper = new ObjectMapper();
String jsonBody = objectMapper.writeValueAsString(params); String jsonBody = objectMapper.writeValueAsString(params);
String ifsResponse = HttpUtils.doPost(ifsUrl + "OtherInbound", jsonBody, null);
String ifsResponse = HttpUtils.doPost(ifsUrl + "ReceiveInventoryPart", jsonBody, null);
return ifsResponse; return ifsResponse;
} catch (Exception e) { } catch (Exception e) {

48
src/main/java/com/gaotao/modules/other/service/impl/OtherInboundServiceImpl.java

@ -87,32 +87,28 @@ public class OtherInboundServiceImpl implements OtherInboundService {
List<TransDetail> detailList = genOtherInboundTransAndChangeStock(transRequest, "IN"); List<TransDetail> detailList = genOtherInboundTransAndChangeStock(transRequest, "IN");
// 6. 调用IFS接口同步入库信息 // 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状态 // 7. 更新HandlingUnit状态
updateHandlingUnitStatus(handlingUnits, detailList, currentUser); updateHandlingUnitStatus(handlingUnits, detailList, currentUser);

Loading…
Cancel
Save