Commit ad402fe0 LN

删除料仓时,必须先手动删除所有库位

1 个父辈 273e7d13
......@@ -230,7 +230,7 @@ public class NLPShelfHandler extends BaseDeviceHandler{
queueTask.setStatus(OP_STATUS.EXECUTING.name());
taskService.updateQueueTask(queueTask);
statusBean.addData("open", queueTask.getPosName() + "=" + color.name());
log.info("库位[" + queueTask.getPosName() + "]+亮灯:" + color.name());
log.info("库位[" + queueTask.getPosName() + "]["+queueTask.getBarcode()+"]+亮灯:" + color.name());
}
}
// else if(queueTask.isCancel()){
......@@ -457,8 +457,8 @@ public class NLPShelfHandler extends BaseDeviceHandler{
try {
outResult = posName;
super.finishedOutPos(cid,posName);
String msg = queueTask.getBarcode()+ "从"+ posName+"出库成功";
log.error(msg);
String msg = queueTask.getBarcode()+ "从"+ posName+"出库成功,颜色["+queueTask.getLightColor()+"]";
log.info(msg);
WebSocketServer.sendMsg("",new SocketMsg(msg, MsgType.INFO,"smfclient.nlp.outputOk",new String[]{queueTask.getBarcode(),posName}));
break;
......@@ -512,7 +512,8 @@ public class NLPShelfHandler extends BaseDeviceHandler{
List<String> outTaskPosList = new ArrayList<>();
Collection<DataLog> queueTasks = taskService.getQueueTasks(cid);
for (DataLog task : queueTasks) {
if(task.isCheckOutTask()){
//只发执行中的任务
if(task.isCheckOutTask()&&task.isExecuting()){
String rgb = task.getLightColor();
ORDER_COLOR color = ORDER_COLOR.fromRgb(rgb);
if(color == null){
......@@ -538,6 +539,9 @@ public class NLPShelfHandler extends BaseDeviceHandler{
public ResultBean checkAll(HttpServletRequest request){
String cid = request.getParameter("cid");
Storage storage = dataCache.getStorage(cid);
if(storage == null){
return ResultBean.newErrorResult(-1,"smfcore.shelfNotExist", "{0}对应的料架不存在",new String[]{cid} );
}
List<StoragePos> allPos = storagePosManager.findNotEmptyByStorageId(storage.getId());
List<String> posList = new ArrayList<>();
for (StoragePos pos : allPos) {
......
......@@ -253,12 +253,15 @@ public class StorageController {
Query query = new Query(Criteria.where("storageId").is(storage.getId()));
List<StoragePos> posList = storagePosManager.findByQuery(query);
if(posList!=null) {
if(posList.size()>0){
throw new ValidateException("smfcore.posNotDel","删除失败,请先删除料仓[{0}]的所有库位",new String[]{ storage.getName() });
}
for (StoragePos pos : posList
) {
if (pos.getBarcode() == null || pos.getBarcode().equals("")) {
} else {
throw new ValidateException("smfcore.posIsused","料仓[{0}]的库位[{1}}]有料[{2}],删除失败",new String[]{ storage.getName() ,pos.getPosName(),pos.getBarcode().getBarcode()});
throw new ValidateException("smfcore.posIsused","删除失败,料仓[{0}]的库位[{1}}]有料[{2}]",new String[]{ storage.getName() ,pos.getPosName(),pos.getBarcode().getBarcode()});
// throw new BadRequestException("料仓[" + storage.getName() + "]的库位[" + pos.getPosName() + "]有料[" + pos.getBarcode() + "],删除失败");
}
}
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!