|
|
|
@ -448,6 +448,7 @@ public class InventoryMoveServiceImpl implements InventoryMoveService { |
|
|
|
* 同步单个分组到IFS |
|
|
|
*/ |
|
|
|
private void syncSingleGroupToIFS(MoveGroup group) { |
|
|
|
String jsonBody = null; |
|
|
|
try { |
|
|
|
Map<String, Object> params = new HashMap<>(); |
|
|
|
params.put("ifsDBName", ifsDBName); |
|
|
|
@ -478,7 +479,7 @@ public class InventoryMoveServiceImpl implements InventoryMoveService { |
|
|
|
params.put("UnatachFromHandlingUnit", "FALSE"); |
|
|
|
|
|
|
|
ObjectMapper objectMapper = new ObjectMapper(); |
|
|
|
String jsonBody = objectMapper.writeValueAsString(params); |
|
|
|
jsonBody = objectMapper.writeValueAsString(params); |
|
|
|
log.info("IFS请求接口名称:{},请求参数: {}","MoveInventoryPartV2", jsonBody); |
|
|
|
String ifsResponse = HttpUtils.doPost(ifsUrl + "MoveInventoryPartV2", jsonBody, null); |
|
|
|
|
|
|
|
@ -495,6 +496,14 @@ public class InventoryMoveServiceImpl implements InventoryMoveService { |
|
|
|
} |
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
ErrorLogUtils.logInterface(group.site, |
|
|
|
"IFS接口", |
|
|
|
"标签移库", |
|
|
|
"IFS", |
|
|
|
"MoveInventoryPartV2", |
|
|
|
group.partNo+";"+group.lotBatchNo+";"+ group.totalQty+";"+(group.wdr != null ? group.wdr : "*"), |
|
|
|
jsonBody, |
|
|
|
e.getMessage(),e.getMessage()); |
|
|
|
log.error("IFS移库同步异常 - 物料: {}, 批次: {}", group.partNo, group.lotBatchNo, e); |
|
|
|
String errorMessage = IfsErrorMessageUtils.extractOracleErrorMessage(e.getMessage()); |
|
|
|
throw new XJException("IFS移库失败,响应: " + errorMessage); |
|
|
|
@ -512,55 +521,7 @@ public class InventoryMoveServiceImpl implements InventoryMoveService { |
|
|
|
String jsonBody = null; |
|
|
|
String ifsResponse = null; |
|
|
|
|
|
|
|
//校验库存是否被预留 后面要删除 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 获取该站点指定物料的库存信息 |
|
|
|
// List<IfsInventoryPartInStock> inventoryList=new ArrayList<>(); |
|
|
|
// try { |
|
|
|
// inventoryList = ifsApiService.getInventoryPartInStock(group.site, group.partNo); |
|
|
|
// } catch (JsonProcessingException e) { |
|
|
|
// throw new RuntimeException(e); |
|
|
|
// } |
|
|
|
// |
|
|
|
// log.info("获取站点{}物料{}的库存信息,共{}条记录", group.site, group.partNo, inventoryList.size()); |
|
|
|
// |
|
|
|
// IfsInventoryPartInStock matchedStock = findMatchingStock(inventoryList, group); |
|
|
|
// boolean failedFlag=false; |
|
|
|
// if (matchedStock == null) { |
|
|
|
// failedFlag=true; |
|
|
|
// } |
|
|
|
// |
|
|
|
// |
|
|
|
// if (matchedStock != null) { |
|
|
|
// BigDecimal reservedQty = new BigDecimal(matchedStock.getQtyReserved()); |
|
|
|
// if(reservedQty.compareTo(new BigDecimal(0))>0){ |
|
|
|
// failedFlag=true; |
|
|
|
// } |
|
|
|
// } |
|
|
|
// if(failedFlag){ |
|
|
|
// log.warn("IFS移库同步失败 - 物料: {}, 批次: {}, 在库位:{}的库存被预留,无法移库", |
|
|
|
// group.partNo, group.lotBatchNo,group.sourceLocationNo); |
|
|
|
// // 记录到错误日志表 - rqrq |
|
|
|
// ifsCallErrorLogService.logIfsError( |
|
|
|
// group.site, |
|
|
|
// "MoveInventoryPartV2", |
|
|
|
// "库存移库(栈板)", |
|
|
|
// group.partNo, |
|
|
|
// group.lotBatchNo, |
|
|
|
// group.sourceLocationNo, |
|
|
|
// group.destLocationNo, |
|
|
|
// group.totalQty, |
|
|
|
// group.expiredDate, |
|
|
|
// "ifs库存被预留或者查不到库存,无法移库", |
|
|
|
// "ifs库存被预留或者查不到库存,无法移库", |
|
|
|
// "ifs库存被预留或者查不到库存,无法移库" |
|
|
|
// ); |
|
|
|
// return; |
|
|
|
// } |
|
|
|
|
|
|
|
//校验库存预留结束 |
|
|
|
String username="CCL_AGV_USER"; |
|
|
|
try { |
|
|
|
username = ((SysUserEntity) SecurityUtils.getSubject().getPrincipal()).getUsername(); |
|
|
|
|