Commit 42452084 sunke

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

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