Browse Source

2025-09-28

pda 其它入库 其它出库
master
fengyuan_yang 4 months ago
parent
commit
f2334e4786
  1. 54
      src/main/java/com/gaotao/modules/other/service/impl/OtherOutboundServiceImpl.java

54
src/main/java/com/gaotao/modules/other/service/impl/OtherOutboundServiceImpl.java

@ -66,33 +66,33 @@ public class OtherOutboundServiceImpl implements OtherOutboundService {
// 5. 调用通用的出入库方法生成记录和变更库存 // 5. 调用通用的出入库方法生成记录和变更库存
List<TransDetail> detailList = transHeaderService.genTransAndChangeInventoryStock(transRequest, "OUT"); List<TransDetail> detailList = transHeaderService.genTransAndChangeInventoryStock(transRequest, "OUT");
// 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("OUT");
ifsDto.setIfsReason(dto.getOutboundReason());
ifsDto.setIfsOperator(dto.getOperatorName());
try {
String ifsResponse = ifsApiIssueAndReturnService.addOtherOutbound(ifsDto);
// 检查IFS响应如果失败可能需要回滚事务
if (!"IFSUpdated".equals(ifsResponse) && !"\"IFSUpdated\"".equals(ifsResponse)) {
throw new XJException("IFS同步失败,响应: " + ifsResponse);
}
} catch (Exception ifsException) {
throw new XJException("其它出库IFS同步失败: " + ifsException.getMessage());
}
}
// // 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("OUT");
// ifsDto.setIfsReason(dto.getOutboundReason());
// ifsDto.setIfsOperator(dto.getOperatorName());
//
// try {
// String ifsResponse = ifsApiIssueAndReturnService.addOtherOutbound(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