Commit 42452084 sunke

感应料架第一盘未入库时扫第二盘自动取消第一盘的入库任务

物料分组出库时,如果库位已有任务,忽略
1 个父辈 d08b3718
...@@ -15,13 +15,13 @@ public class LineBoxHandler extends BaseDeviceHandler { ...@@ -15,13 +15,13 @@ public class LineBoxHandler extends BaseDeviceHandler {
@Override @Override
public StatusBean handleClientRequest(StatusBean statusBean, HttpServletRequest request) { public StatusBean handleClientRequest(StatusBean statusBean, HttpServletRequest request) {
statusBean.setClientIp(request.getRemoteHost());
String cid = statusBean.getCid(); String cid = statusBean.getCid();
Storage storage = dataCache.getStorage(cid); Storage storage = dataCache.getStorage(cid);
if (storage == null) { if (storage == null) {
log.error("料仓cid: [" + cid + "]不存在"); log.error("料仓cid: [" + cid + "]不存在");
return null; return null;
} }
statusBean.setClientIp(request.getRemoteHost());
handleMsg(statusBean); handleMsg(statusBean);
statusBean = saveAlarmAndHumidity(statusBean); statusBean = saveAlarmAndHumidity(statusBean);
statusBean = handleInOutFinished(statusBean); statusBean = handleInOutFinished(statusBean);
......
...@@ -82,12 +82,14 @@ public class NLPShelfHandler extends BaseDeviceHandler { ...@@ -82,12 +82,14 @@ public class NLPShelfHandler extends BaseDeviceHandler {
for (DataLog queueTask : queueTasks) { for (DataLog queueTask : queueTasks) {
if (queueTask.isPutInTask() && (queueTask.isWait() || queueTask.isExecuting())) { if (queueTask.isPutInTask() && (queueTask.isWait() || queueTask.isExecuting())) {
if (!Strings.isNullOrEmpty(groupId) && queueTask.getGroupId().equals(groupId)) { if (!Strings.isNullOrEmpty(groupId) && queueTask.getGroupId().equals(groupId)) {
log.info("codeIn [" + code + "][" + groupId + "]入库失败:条码[" + queueTask.getBarcode() + "]的任务还未结束 "); log.info("codeIn [" + code + "][" + groupId + "]入库时取消条码[" + queueTask.getBarcode() + "]的未完成入库任务");
return ResultBean.newErrorResult(-1,"smfcore.unfinished","the task of [{0}] is unfinished",new String[]{queueTask.getBarcode()}); //return ResultBean.newErrorResult(-1,"smfcore.unfinished","the task of [{0}] is unfinished",new String[]{queueTask.getBarcode()});
taskService.cancelTask(queueTask.getId());
} }
if (!Strings.isNullOrEmpty(storageId) && queueTask.getStorageId().equals(storageId)) { if (!Strings.isNullOrEmpty(storageId) && queueTask.getStorageId().equals(storageId)) {
log.info("codeIn [" + code + "][" + storageId + "]入库失败:料架[" + queueTask.getStorageId() + "]的任务还未结束 "); log.info("codeIn [" + code + "][" + storageId + "]入库时取消料架[" + queueTask.getStorageId() + "]的未完成入库任务");
return ResultBean.newErrorResult(-1,"smfcore.unfinished","the task of [{0}] is unfinished",new String[]{queueTask.getStorageName()}); //return ResultBean.newErrorResult(-1,"smfcore.unfinished","the task of [{0}] is unfinished",new String[]{queueTask.getStorageName()});
taskService.cancelTask(queueTask.getId());
} }
} }
} }
......
...@@ -273,19 +273,21 @@ public class MaterialController { ...@@ -273,19 +273,21 @@ public class MaterialController {
} }
for (String posId : posIds) { for (String posId : posIds) {
try{
StoragePos pos = storagePosManager.get(posId); StoragePos pos = storagePosManager.get(posId);
if (pos == null) { if (pos != null) {
throw new ValidateException("smfcore.valueNotExist", "{0}[{1}]不存在", new String[]{"posId", posId});
}
Storage storage = dataCache.getStorageById(pos.getStorageId()); Storage storage = dataCache.getStorageById(pos.getStorageId());
if (storage == null) { if (storage == null) {
throw new ValidateException("smfcore.valueNotExist", "{0}[{1}]不存在", new String[]{"storageId", pos.getStorageId()}); log.error("storageId["+pos.getStorageId()+"]不存在,忽略posId="+posId+"的任务");
} }else{
log.info("出库料仓【" + storage.getName() + "_" + storage.getCid() + "】位置仓位【" + pos.getPosName() + "】"); log.info("出库料仓【" + storage.getName() + "_" + storage.getCid() + "】位置仓位【" + pos.getPosName() + "】");
String outResult = taskService.checkout(storage, pos, true, SecurityUtils.getCurrentUsername()); taskService.checkout(storage, pos, true, SecurityUtils.getCurrentUsername());
if (!Strings.isNullOrEmpty(outResult)) { }
throw new ValidateException("smfcore.error", outResult); }else{
log.error("posId["+posId+"]不存在,忽略posId="+posId+"的任务");
}
}catch (Exception e){
log.error("标签出库库位"+posId+"时出错"+e.getMessage());
} }
} }
} else { } else {
...@@ -296,24 +298,23 @@ public class MaterialController { ...@@ -296,24 +298,23 @@ public class MaterialController {
List<StoragePos> posList = storagePosManager.findByQuery(query); List<StoragePos> posList = storagePosManager.findByQuery(query);
if (posList.size() <= 0) { if (posList.size() <= 0) {
//未找到出库信息 //未找到出库信息
throw new ValidateException("smfcore.label.noReel","未找到可出库的物料"); log.info("出库标签["+labelId+"]时未找到可出库的物料");
} }
for (StoragePos pos : posList for (StoragePos pos : posList) {
) { try{
Storage storage = dataCache.getStorageById(pos.getStorageId()); Storage storage = dataCache.getStorageById(pos.getStorageId());
if (storage == null) { if (storage == null) {
throw new ValidateException("smfcore.valueNotExist", "{0}[{1}]不存在", new String[]{"storageId", pos.getStorageId()}); log.error("storageId["+pos.getStorageId()+"]不存在,忽略posId="+pos.getId()+"的任务");
} }
log.info("出库料仓【" + storage.getName() + "_" + storage.getCid() + "】位置仓位【" + pos.getPosName() + "】"); log.info("出库料仓【" + storage.getName() + "_" + storage.getCid() + "】位置仓位【" + pos.getPosName() + "】");
String outResult = taskService.checkout(storage, pos, true, SecurityUtils.getCurrentUsername()); taskService.checkout(storage, pos, true, SecurityUtils.getCurrentUsername());
if (!Strings.isNullOrEmpty(outResult)) { }catch (Exception e){
throw new ValidateException("smfcore.error", outResult); log.error("标签出库库位"+pos.getPosName()+"时出错"+e.getMessage());
} }
} }
} }
return ResultBean.newOkResult("ok"); return ResultBean.newOkResult("ok");
} }
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!