Commit 411a7e2b LN

增加空出库处理接口

1 个父辈 bda962e0
......@@ -751,7 +751,7 @@ public class BaseDeviceHandler implements IDeviceHandler {
/**
* 出仓位完成
*/
private void updateCheckoutData(DataLog task, OP_STATUS outBoxStatus) throws ValidateException {
protected void updateCheckoutData(DataLog task, OP_STATUS outBoxStatus) throws ValidateException {
//从队列里面移除操作
taskService.removeQueueTask(task);
......
......@@ -33,6 +33,7 @@ import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
......@@ -745,62 +746,42 @@ public class RobotBoxHandler extends BaseDeviceHandler {
}
}
@ApiOperation("任务空出处理")
@PostMapping(value = "/service/store/robotBox/emptyOut")
@ResponseBody
@AnonymousAccess
public ResultBean emptyOut(HttpServletRequest request) {
String barcode = request.getParameter("barcode");
try {
log.info("emptyOut: 条码["+barcode + "] ");
DataLog opTask = null;
List<DataLog> allTasks = taskService.getAllTasks();
for (DataLog task : allTasks) {
if (task.isFinished() || task.isPutInTask()) {
continue;
}
if (ObjectUtil.isNotEmpty(barcode) && task.getBarcode().equals(barcode)) {
opTask = task;
break;
}
}
if(opTask==null){
//空出未找到任务
log.info("emptyOut: 条码["+barcode + "] 空出处理失败:任务不存在");
return ResultBean.newErrorResult(301, "smfcore.task.notExist", "任务不存在");
}
updateCheckoutData(opTask,OP_STATUS.FINISHED);
log.info("emptyOut: 条码["+opTask.getBarcode() + "],库位号["+opTask.getPosName()+"]空出完成,结束任务,标记任务为空出");
opTask.setEmptyOperate(true);
taskService.updateFinishedTask(opTask);
return ResultBean.newOkResult(opTask.getPosName());
} catch (Exception e) {
return ResultBean.newErrorResult(202, "smfcore.emptyOut.fail", "任务空出处理[{0}]失败:{1}", new String[]{barcode, e.getMessage()});
}
}
// @ApiOperation("机器人定时获取任务")
// @PostMapping(value = "/service/store/robotBox/getRobotTask")
// @ResponseBody
// @AnonymousAccess
// public ResultBean getRobotTask(HttpServletRequest request) {
// Collection<DataLog> datalogs = taskService.getAllTasks();
// //先查找已在机器人的
//// for (DataLog task : datalogs) {
//// if (task.isInRobot()) {
//// //获取任务失败,还有未完成的任务
//// return ResultBean.newErrorResult(1, "smfcore.task.lastNotEnd", "上个任务未结束{0}{1}", new String[]{task.getPosName(), task.getBarcode()});
//// }
//// }
// //查找出库已经到门口的
// for (DataLog task : datalogs) {
// if (task.isCheckOutTask()) {
// if (task.isBoxdoor()) {
// return returnTaskResult(task);
// }
//
// }
// }
//
// return ResultBean.newErrorResult(-1, "", "");
// }
// @ApiOperation("获取指定任务信息")
// @PostMapping(value = "/service/store/robotBox/getBoxDoorStatus")
// @ResponseBody
// @AnonymousAccess
// public ResultBean getBoxDoorStatus(HttpServletRequest request) {
// String cid = request.getParameter("cid");
// //判断仓门口状态,0=空闲,返回其他表示仓门口有料或机器人正在取料
// Storage storage = dataCache.getStorage(cid);
// if (storage == null) {
// return ResultBean.newErrorResult(99, "smfcore.robotBox.notFound", "未找到机器人料仓[{0}]", new String[]{cid});
// }
// if (!storage.isRobotBox()) {
// return ResultBean.newErrorResult(99, "smfcore.robotBox.notFound", "未找到机器人料仓[{0}]", new String[]{cid});
// }
// Collection<DataLog> tasks = taskService.getQueueTasks();
// for (DataLog task : tasks) {
// if (task.getStorageId().equals(storage.getId())) {
// if (task.isBoxdoor()) {
// return ResultBean.newErrorResult(-1, "smfcore.robotBox.boxHasTask", "任务[{0}][{1}]类型{2}状态{3}", new String[]{task.getPosName(), task.getBarcode(), task.getType() + "", task.getStatus()});
// }
//// else if(task.isPutInTask()&&task.isInRobot()){
//// return ResultBean.newErrorResult(-1, "smfcore.robotBox.boxHasTask", "任务[{0}][{1}]类型{2}状态{3}", new String[]{task.getPosName(), task.getBarcode(),task.getType()+"", task.getStatus()});
//// }
// }
// }
// return ResultBean.newOkResult("");
// }
@ApiOperation("点料后更新物料数量")
@PostMapping(value = "/service/store/robotBox/updateReelQty")
......
......@@ -150,4 +150,7 @@ public class TaskDto implements Serializable {
}
@ApiModelProperty("位置信息,如料架编号,托盘编号,移栽编号,皮带线编号,机器人编号等")
private String locInfo = "";
@ApiModelProperty("是否空出操作")
private Boolean emptyOperate;
}
......@@ -238,6 +238,11 @@ public class DataLog extends BasePo implements Serializable ,Comparable<DataLog>
*/
private MSDAppendInfo msdAppendInfo;
/**
* 是否空出操作
*/
private Boolean emptyOperate;
public String getBarcode() {
if(barcode == null){
return "";
......
......@@ -55,7 +55,7 @@ public class Micron1053Menu {
//MI1
MenuInit.addMenu(menuLabel,null,162, "MI1","ml", "miOne/miOne/index","miOne");
//MI2
MenuInit.addMenu(menuLabel,null,163, "MI2","ml2", "miTwo/miTwo/index","miOne");
MenuInit.addMenu(menuLabel,null,163, "MI2","ml2", "miOne/miOne/index","miOne");
//Status
MenuInit.addMenu(menuLabel,null,128, "Status","status", "state/state/index","state");
// //Report
......
......@@ -347,10 +347,12 @@ public class MicronStatusController {
String[] nameList = new String[]{};
String robotName = "R1";
if (boxName.equals("MI1")) {
nameList = new String[]{"M3", "M4", "M7", "M8"};
// nameList = new String[]{"M3", "M4", "M7", "M8"};
nameList = new String[]{ "KTS-R002A", "KTS-R002B","KTS-R002C", "KTS-R002D"};
robotName = "R1";
} else if (boxName.equals("MI2")) {
nameList = new String[]{"M1", "M2", "M5", "M6"};
// nameList = new String[]{"M1", "M2", "M5", "M6"};
nameList = new String[]{"KTS-R001A", "KTS-R001B", "KTS-R001C", "KTS-R001D"};
robotName = "R2";
}
......
......@@ -343,6 +343,7 @@ smfcore.selfAudit.noPos=\u76D8\u70B9{0}\u672A\u627E\u5230\u5E93\u4F4D\u53F7
smfcore.task.updatePutInFail=\u5165\u5E93\u4EFB\u52A1{0}[{1}]\u4E0D\u80FD\u66F4\u65B0\u72B6\u6001\u4E3A{2}
smfcore.saveOk=\u4FDD\u5B58\u6210\u529F
smfcore.lockMaterials=\u9501\u5B9A\u7269\u6599
smfcore.emptyOut.fail=\u4EFB\u52A1[{0}]\u7A7A\u51FA\u5904\u7406\u5931\u8D25:{1}
#smfclient.nlp.onlyOneTray=\u4E0D\u53EF\u540C\u65F6\u653E\u5165\u591A\u76D8\u7269\u6599:{0}
#smfclient.nlp.cannotFindPos={0}\u672A\u627E\u5230\u5E93\u4F4D:{1}
#smfclient.nlp.inputOk={0}\u5165\u5E93\u5230{1}\u6210\u529F
......
......@@ -342,4 +342,5 @@ smfcore.updatePass.hasNoAccess=No operating rights
smfcore.selfAudit.noPos=Self Audit{0}No depot number found
smfcore.task.updatePutInFail=Cannot update the status of the inbound task {0}[{1}] to {2}
smfcore.saveOk=save successfully
smfcore.lockMaterials=Locking Materials
\ No newline at end of file
smfcore.lockMaterials=Locking Materials
smfcore.emptyOut.fail=Task [{0}] empty processing failure:{1}
\ No newline at end of file
......@@ -339,4 +339,5 @@ smfcore.updatePass.hasNoAccess=\u64CD\u4F5C\u6A29\u306A\u3057
smfcore.selfAudit.noPos=\u76D8\u70B9{0}\u672A\u627E\u5230\u5E93\u4F4D\u53F7
smfcore.task.updatePutInFail=\u5165\u5E93\u4EFB\u52A1{0}[{1}]\u4E0D\u80FD\u66F4\u65B0\u72B6\u6001\u4E3A{2}
smfcore.saveOk=\u4FDD\u5B58\u6210\u529F
smfcore.lockMaterials=\u9501\u5B9A\u7269\u6599
\ No newline at end of file
smfcore.lockMaterials=\u9501\u5B9A\u7269\u6599
smfcore.emptyOut.fail=\u4EFB\u52A1[{0}]\u7A7A\u51FA\u5904\u7406\u5931\u8D25:{1}
\ No newline at end of file
......@@ -339,4 +339,5 @@ smfcore.updatePass.hasNoAccess=\u6CA1\u6709\u64CD\u4F5C\u6743\u9650
smfcore.selfAudit.noPos=\u76D8\u70B9{0}\u672A\u627E\u5230\u5E93\u4F4D\u53F7
smfcore.task.updatePutInFail=\u5165\u5E93\u4EFB\u52A1{0}[{1}]\u4E0D\u80FD\u66F4\u65B0\u72B6\u6001\u4E3A{2}
smfcore.saveOk=\u4FDD\u5B58\u6210\u529F
smfcore.lockMaterials=\u9501\u5B9A\u7269\u6599
\ No newline at end of file
smfcore.lockMaterials=\u9501\u5B9A\u7269\u6599
smfcore.emptyOut.fail=\u4EFB\u52A1[{0}]\u7A7A\u51FA\u5904\u7406\u5931\u8D25:{1}
\ No newline at end of file
......@@ -340,4 +340,5 @@ smfcore.updatePass.hasNoAccess=\u6C92\u6709\u64CD\u4F5C\u6B0A\u9650
smfcore.selfAudit.noPos=\u76E4\u9EDE{0}\u672A\u627E\u5230\u5EAB\u4F4D\u865F
smfcore.task.updatePutInFail=\u5165\u5EAB\u4EFB\u52D9{0}[{1}]\u4E0D\u80FD\u66F4\u65B0\u72C0\u614B\u70BA{2}
smfcore.saveOk=\u4FDD\u5B58\u6210\u529F
smfcore.lockMaterials=\u9396\u5B9A\u7269\u6599
\ No newline at end of file
smfcore.lockMaterials=\u9396\u5B9A\u7269\u6599
smfcore.emptyOut.fail=\u4EFB\u52D9[{0}]\u7A7A\u51FA\u8655\u7406\u5931\u6557:{1}
\ No newline at end of file
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!