Commit 31cae63a zshaohui

1.对接MES,不对接WMS

1 个父辈 f9313f24
......@@ -198,7 +198,7 @@ public class DeviceController {
}
//判断库别是否为空
Barcode reelBarcode = lizhenApi.fetchReel(barcode);
/*Barcode reelBarcode = lizhenApi.fetchReel(barcode);
if (reelBarcode == null){
throw new ValidateException("", barcode.getBarcode()+"未找到对应的库别信息");
}
......@@ -215,7 +215,7 @@ public class DeviceController {
if (StringUtils.isNotEmpty(reelBarcode.getLabelId())) {
barcode.setLabelId(reelBarcode.getLabelId());
}
}*/
//判断虚拟仓有没有存在,如果有,把虚拟仓库位置空
StoragePos storagePos = storagePosManager.getByBarcode(barcode.getBarcode());
......@@ -339,7 +339,7 @@ public class DeviceController {
Storage theStorage = dataCache.getStorageById(pos.getStorageId());
barcode.setWarehouseCode(warehouseCode);
//barcode.setWarehouseCode(warehouseCode);
barcode = barcodeManager.save(barcode);
resultMap.put("result", "0");
......
......@@ -154,14 +154,14 @@ public class LizhenApi extends DefaultSmfApiListener {
if (barcodeInfoUrl == null) {
return null;
}
log.info("获取MES物料数量入参为:" + barcode.getBarcode());
log.info(barcode.getBarcode()+"获取MES物料数量入参为:" + barcode.getBarcode()+"地址为:"+barcodeInfoUrl);
String result = "";
try {
result = HttpHelper.postJson(barcodeInfoUrl, barcode.getBarcode());
} catch (ApiException e) {
e.printStackTrace();
}
log.info("获取MES物料数量出参为:" + result);
log.info(barcode.getBarcode()+"获取MES物料数量出参为:" + result);
JSONObject resultJson = JsonUtil.toObj(result, JSONObject.class);
Integer status = resultJson.getInteger("status");
if (status != null) {
......@@ -285,6 +285,38 @@ public class LizhenApi extends DefaultSmfApiListener {
public void inTaskStatusChange(String inNotifyUrl, DataLog task) {
if (task.isFinished()){
Barcode barcode = barcodeManager.findByBarcode(task.getBarcode());
Map<String,Object> paramMap = new HashMap<>();
paramMap.put("pickingid","");
paramMap.put("reelno",barcode.getBarcode());
paramMap.put("werks",CommonUtil.plantCode);
paramMap.put("ipn",barcode.getPartNumber());
paramMap.put("batch","");
paramMap.put("datecode",barcode.getDateCode());
paramMap.put("vendor",barcode.getProvider());
paramMap.put("lot",barcode.getBatch());
paramMap.put("qty",barcode.getAmount());
paramMap.put("vendor_code",barcode.getProviderNumber());
//paramMap.put("barcode",barcode.getFullCode());
paramMap.put("user_id","");
List<Map<String,Object>> paramList = new ArrayList<>();
paramList.add(paramMap);
Map<String,Object> dataMap = new HashMap<>();
dataMap.put("DATA",paramList);
String param = JSONObject.toJSONString(dataMap);
log.info(barcode.getBarcode()+"入库成功,通知MES保存物料入参为:" + param+"地址为:"+ inNotifyUrl);
try {
String result = HttpHelper.postJson(inNotifyUrl, dataMap);
log.info(barcode.getBarcode()+"入库成功,通知MES保存物料出参为:" + result);
} catch (ApiException e) {
e.printStackTrace();
log.info(barcode.getBarcode()+"入库成功,通知MES保存物料异常:" + e.getMessage());
}
/*Barcode barcode = barcodeManager.findByBarcode(task.getBarcode());
log.info(barcode.getBarcode()+"是否通知过:"+barcode.isAskPutIn());
//if (!barcode.isAskPutIn()){
Storage storage = dataCache.getStorageById(task.getStorageId());
......@@ -298,7 +330,7 @@ public class LizhenApi extends DefaultSmfApiListener {
if (pos != null){
pos.setBarcode(barcode);
storagePosManager.save(pos);
}
}*/
//}
}
}
......@@ -343,7 +375,8 @@ public class LizhenApi extends DefaultSmfApiListener {
}
public String towerIssue(DataLog task) {
Map<String, Object> paramMap = new HashMap<>();
return "";
/*Map<String, Object> paramMap = new HashMap<>();
paramMap.put("PLANT_CODE", CommonUtil.plantCode);
if (StringUtils.isEmpty(task.getPickingId())){
......@@ -375,7 +408,7 @@ public class LizhenApi extends DefaultSmfApiListener {
e.printStackTrace();
log.info(task.getBarcode() + "出库通知,调用Tower发料,异常为:" + e.getMessage());
return e.getMessage();
}
}*/
}
......@@ -556,7 +589,8 @@ public class LizhenApi extends DefaultSmfApiListener {
public Barcode fetchReel(Barcode barcode) {
Map<String, Object> paramMap = new HashMap<>();
return barcode;
/*Map<String, Object> paramMap = new HashMap<>();
paramMap.put("reel_code", barcode.getBarcode());
log.info(barcode.getBarcode() + "fetchReel调用参数为:" + JSON.toJSONString(paramMap));
try {
......@@ -596,7 +630,7 @@ public class LizhenApi extends DefaultSmfApiListener {
} catch (Exception e) {
log.info(barcode.getBarcode()+"fetchReel调用失败:"+e.getMessage());
throw new ValidateException("",barcode.getBarcode()+"接口请求失败:"+e.getMessage());
}
}*/
//return null;
}
......@@ -659,7 +693,8 @@ public class LizhenApi extends DefaultSmfApiListener {
public String towerCheck(DataLog task) {
Map<String, Object> paramMap = new HashMap<>();
return "";
/*Map<String, Object> paramMap = new HashMap<>();
paramMap.put("PLANT_CODE", CommonUtil.plantCode);
if (StringUtils.isEmpty(task.getPickingId())) {
......@@ -691,7 +726,7 @@ public class LizhenApi extends DefaultSmfApiListener {
e.printStackTrace();
log.info(task.getBarcode() + "出库通知,调用Tower发料检验,异常为:" + e.getMessage());
return e.getMessage();
}
}*/
}
......
api:
plantCode: W339
name: Lizhen
inCheckUrl: http://10.68.25.40:8001/Npm/WmsCheckReelfob #禁用料接口
inCheckUrl: http://10.68.25.42:8001/Npm/WmsCheckReelfob #禁用料接口
outNotifyUrl: http://10.68.30.22:8082/api/mlb/TowerIssue
inNotifyUrl: http://10.68.30.22:8082/api/mlb/BackToWarehouse
inNotifyUrl: http://10.68.25.42:8001/Sct/SaveReelInfo
getBarcode: http://10.68.27.83/smf-core/thirdBarcode/getBarcode
fetchReel: http://10.68.30.22:8082/api/mlb/FetchReel
#批量禁用料
batchCheckReel: http://10.68.27.68:8001/Npm/CheckReelBatch
batchCheckReel: http://10.68.25.42:8001/Npm/CheckReelBatch
#Tower发料检查
towerCheck: http://10.68.30.22:8082/api/mlb/TowerCheck
\ No newline at end of file
towerCheck: http://10.68.30.22:8082/api/mlb/TowerCheck
#获取MES数量
barcodeInfoUrl: http://10.68.25.42:8001/Sct/GetReelInfo
\ No newline at end of file
......@@ -3,10 +3,13 @@ api:
name: Lizhen
inCheckUrl: http://10.68.21.21:8001/Npm/WmsCheckReelfob #禁用料接口
outNotifyUrl: http://10.42.220.171:8082/api/mlb/TowerIssue
inNotifyUrl: http://10.42.220.171:8082/api/mlb/BackToWarehouse
inNotifyUrl: http://10.68.25.42:8001/Sct/SaveReelInfo
getBarcode: http://10.68.27.83/smf-core/thirdBarcode/getBarcode
fetchReel: http://10.42.220.171:8082/api/mlb/FetchReel
#批量禁用料
batchCheckReel: http://10.68.27.68:8001/Npm/CheckReelBatch
#Tower发料检查
towerCheck: http://10.42.220.171:8082/api/mlb/TowerCheck
\ No newline at end of file
towerCheck: http://10.42.220.171:8082/api/mlb/TowerCheck
#获取MES数量
barcodeInfoUrl: http://10.68.25.42:8001/Sct/GetReelInfo
\ No newline at end of file
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!