Commit 3ce699ec zshaohui

功能优化提交

1 个父辈 5a8408ac
......@@ -47,7 +47,7 @@ public class LuxsanApi extends DefaultSmfApiListener {
LuxsanApiResult apiResult = JSONObject.parseObject(resultStr, LuxsanApiResult.class);
if (LuxsanApiEnum.ERROR.equals(apiResult.getMSGTY())) {
throw new ValidateException("smfcore.api.error", "接口请求失败[{0}]", new String[]{apiResult.getMSGTX()});
return null;
}
List<QueryBinResult> resultList = JSONObject.parseArray(apiResult.getDATA(), QueryBinResult.class);
......@@ -56,7 +56,7 @@ public class LuxsanApi extends DefaultSmfApiListener {
}
} catch (ApiException e) {
log.error("queryBin请求失败:" + e.getMessage());
log.info("queryBin请求失败:" + e.getMessage());
throw new ValidateException("smfcore.api.error", "接口请求失败[{0}]", new String[]{e.getMessage()});
}
throw new ValidateException("smfcore.api.error", "接口请求失败[{0}]", new String[]{"未找到对应的储位信息"});
......
......@@ -78,13 +78,17 @@ public class BinCacheUtil {
public static Map<String, String> binCodeCacheMap(String warehouseCode) {
Map<String, String> cacheMap = new HashMap<>();
List<QueryBinResult> resultList = LuxsanApi.queryBin(new QueryBinRequest(CommonUtil.plantCode, BinEnum.STORAGE_TYPE_C, BinEnum.BIN_STATUS_0, warehouseCode));
for (QueryBinResult result : resultList) {
cacheMap.put(result.getBIN_CODE(), result.getWAREHOUSE_CODE());
if (resultList != null && !resultList.isEmpty()) {
for (QueryBinResult result : resultList) {
cacheMap.put(result.getBIN_CODE(), result.getWAREHOUSE_CODE());
}
}
List<QueryBinResult> useBinResultList = LuxsanApi.queryBin(new QueryBinRequest(CommonUtil.plantCode, BinEnum.STORAGE_TYPE_C, BinEnum.BIN_STATUS_1, warehouseCode));
for (QueryBinResult result : useBinResultList) {
cacheMap.put(result.getBIN_CODE(), result.getWAREHOUSE_CODE());
if (useBinResultList != null && !useBinResultList.isEmpty()) {
for (QueryBinResult result : useBinResultList) {
cacheMap.put(result.getBIN_CODE(), result.getWAREHOUSE_CODE());
}
}
return cacheMap;
}
......@@ -114,7 +118,7 @@ public class BinCacheUtil {
//判断当前工作的料箱能不能放入
if (StringUtils.isNotEmpty(binListStr)) {
log.info("正在工作的料格为:" + binListStr);
log.info(barcode+"正在工作的料格为:" + binListStr);
String[] binStr = binListStr.split(",");
List<String> binCodeList = getValidBinList(stackerBarcode, Arrays.asList(binStr));
......@@ -146,7 +150,7 @@ public class BinCacheUtil {
//如果不为空,返回
if (validBinList != null && !validBinList.isEmpty()) {
log.info("获取到可用料格为:" + JSON.toJSONString(validBinList));
log.info(barcode+"获取到可用料格为:" + JSON.toJSONString(validBinList));
String resultStr = validBinList.get(0);
boxCode = BoxHandleUtil.getBoxStr(resultStr, false);
boxLoc = source;
......@@ -165,7 +169,7 @@ public class BinCacheUtil {
for (DataLog dataLog : allTasks) {
if (dataLog.isCheckOutTask() && !dataLog.isCancel() && !dataLog.isFinished()) {
if (source.equals(dataLog.getCurrentLoc())) {
log.info("找到当前工位上的料箱为:" + dataLog.getBarcode() + ",位置为:" + dataLog.getCurrentLoc());
log.info(barcode+"找到当前工位上的料箱为:" + dataLog.getBarcode() + ",位置为:" + dataLog.getCurrentLoc());
emptyBoxList.add(dataLog.getBarcode());
}
}
......@@ -205,7 +209,7 @@ public class BinCacheUtil {
//如果不为空,返回
if (validBinList != null && !validBinList.isEmpty()) {
log.info("获取到可用料格为:" + JSON.toJSONString(validBinList));
log.info(barcode+"获取到可用料格为:" + JSON.toJSONString(validBinList));
String resultStr = validBinList.get(0);
boxCode = BoxHandleUtil.getBoxStr(resultStr, false);
boxLoc = source;
......@@ -232,7 +236,7 @@ public class BinCacheUtil {
&& !TaskCurrentLoc.In2_FeedingInlet.equals(dataLog.getCurrentLoc())
) {
if (TaskCurrentLoc.In_FeedingInlet.equals(dataLog.getLoc()) || source.equals(dataLog.getLoc()) ) {
log.info("查找出来呼叫空箱的箱子为:" + dataLog.getBarcode());
log.info(barcode+"查找出来呼叫空箱的箱子为:" + dataLog.getBarcode());
callEmptyBoxList.add(dataLog.getBarcode());
}
}
......@@ -281,7 +285,7 @@ public class BinCacheUtil {
List<DataLog> taskList = taskService.getAllTasks();
for (DataLog dataLog : taskList) {
if (dataLog.getBarcode().equals(boxStr) && dataLog.isCheckOutTask() && !dataLog.isCancel()) {
log.info("获取到可用料格为:" + JSON.toJSONString(validBinList));
log.info(barcode+"获取到可用料格为:" + JSON.toJSONString(validBinList));
String loc = "";
if (StringUtils.isEmpty(dataLog.getLoc())) {
loc = source;
......
......@@ -107,9 +107,10 @@ public class AgvDeviceController {
return ResultBean.newErrorResult(-1, "smfcore.taskStatusHasUpdate", "任务{0}已经修改状态", new String[]{task.getBarcode()});
}
task.setStatus(statusStr);
//3.判断是出库,还是入库任务
if (task.isPutInTask()) {
task.setStatus(statusStr);
if (OP_STATUS.FINISHED.name().equals(statusStr)) {
finishedPutInTask(task);
......@@ -124,14 +125,20 @@ public class AgvDeviceController {
} else {
//4.如果是出库任务
if (OP_STATUS.EXECUTING.name().equals(statusStr)) {
task.setStatus(statusStr);
taskService.updateQueueTask(task);
} else {
if (!task.isOutFromPos()) {
finishedOutTask(task);
//WipBoxHandleUtil.outFromPos(task);
task.setOutFromPos(true);
taskService.moveTaskToFinished(task);
taskService.updateFinishedTask(task);
}
if (!OP_STATUS.FINISHED.name().equals(statusStr)){
task.setStatus(statusStr);
taskService.updateFinishedTask(task);
}
}
......
package com.neotel.smfcore.custom.luxsan.factory_c.wipstor.controller;
import com.alibaba.fastjson.JSON;
import com.google.common.collect.Lists;
import com.neotel.smfcore.common.bean.ReelLockPosInfo;
import com.neotel.smfcore.common.bean.ResultBean;
......@@ -289,6 +290,7 @@ public class LineController {
resultMap.put("plantCode",orderItem.getPlantCode());
}
}
log.info(boxId+"返回数据为:"+ JSON.toJSONString(resultMap));
return ResultBean.newOkResult(resultMap);
}
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!