Commit f6ad602a zshaohui

1.下架任务创建时,如果当前库位有异常,返回ng

2.出库时,逻辑修改
1 个父辈 1f4d9263
......@@ -377,13 +377,13 @@ public class NLPShelfHandler extends BaseDeviceHandler{
outResult = noReelPosName;
boolean accept = hikVisionApi.acceptTaskStatus(queueTask);
if (accept){
super.finishedOutPos(storage.getCid(),noReelPosName);
super.finishedOutPos(queueTask.getCid(),noReelPosName);
String msg = queueTask.getBarcode()+ "从"+ noReelPosName+"出库成功";
log.info(msg);
break;
}
} catch (Exception e) {
log.error("库位:" + noReelPosName+"出库出错",e);
log.error("库位:" + noReelPosName+"出库出错",e.getMessage());
break;
}
}
......
......@@ -103,7 +103,7 @@ public class HikVisionController {
return ApiResponse.apiResponse(reqCode, ResponseCode.REQUEST_ERROR.getCode(), "", "smfcore.shelfNotExist", new String[]{shelfCode}, "{0}对应的料架不存在");
}
boolean hasErrorPos = hasErrorPos(storage.getCid());
boolean hasErrorPos = hasErrorPos(storage.getCid(),"");
if (hasErrorPos){
return ApiResponse.apiResponse(reqCode,ResponseCode.REQUEST_ERROR.getCode(),"","",new String[]{},"当前货架状态异常,无法发起上架任务");
}
......@@ -220,12 +220,6 @@ public class HikVisionController {
return ApiResponse.apiResponse(reqCode, ResponseCode.REQUEST_ERROR.getCode(), "", "smfcore.shelfNotExist", new String[]{info.getShelfCode()}, "{0}对应的料架不存在");
}
boolean hasErrorPos = hasErrorPos(storage.getCid());
if (hasErrorPos){
return ApiResponse.apiResponse(reqCode,ResponseCode.REQUEST_ERROR.getCode(),"","",new String[]{},"当前物料唯一码货位异常,无法发起下架任务");
}
//判断是否已经生成任务
int count = dataLogManager.countByReqCode(reqCode);
if (count > 0) {
......@@ -237,6 +231,12 @@ public class HikVisionController {
if (pos == null) {
return ApiResponse.apiResponse(reqCode, ResponseCode.REQUEST_ERROR.getCode(), "", "", null, info.getUniqueCode() + "不在库位中");
}
boolean hasErrorPos = hasErrorPos(storage.getCid(),pos.getPosName());
if (hasErrorPos){
return ApiResponse.apiResponse(reqCode,ResponseCode.REQUEST_ERROR.getCode(),"","",new String[]{},info.getUniqueCode()+":当前物料唯一码货位异常,无法发起下架任务");
}
//判断
if (!storage.getId().equals(pos.getStorageId())) {
return ApiResponse.apiResponse(reqCode, ResponseCode.REQUEST_ERROR.getCode(), "", "smfcore.shelfNotExist", new String[]{info.getUniqueCode()}, "{0}对应的料架不存在");
......@@ -511,7 +511,7 @@ public class HikVisionController {
}
private boolean hasErrorPos(String cid) {
private boolean hasErrorPos(String cid,String posName) {
List<List<String>> deviceData = DevicesStatusUtil.getDeviceData(cid);
if (deviceData != null && deviceData.size() == 2) {
List<String> hasReelPosErrorList = deviceData.get(0);
......@@ -525,7 +525,15 @@ public class HikVisionController {
if (pos.isUsed()) {
continue;
}
return true;
if (StringUtils.isNotBlank(posName)) {
if (posName.equals(pos.getPosName())) {
log.info(posName+"对应的货架位异常");
return true;
}
} else {
log.info(posName+"对应的货架位异常");
return true;
}
}
}
......@@ -540,7 +548,15 @@ public class HikVisionController {
if (!pos.isUsed()) {
continue;
}
return true;
if (StringUtils.isNotBlank(posName)) {
if (posName.equals(pos.getPosName())) {
log.info(posName+"对应的货架位异常");
return true;
}
} else {
log.info(posName+"对应的货架位异常");
return true;
}
}
}
}
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!