Commit 3ce699ec zshaohui

功能优化提交

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