Commit e641fc58 LN

增加NG按钮,释放料串按钮

1 个父辈 39a100ce
......@@ -86,13 +86,13 @@ private TaskService taskService;
InOutReelDto dto=new InOutReelDto(dt.getPartNumber(),dt.getBarcode(),dt.getStatus(),"",dt.getInput(),dt.getOutput(),dt.getGantry());
dtoList.add(dto);
}
if(dtoList.size()<=0&& MicronApi.Debug) {
dtoList.add(new InOutReelDto("PN1", "RI1", "Wait", "MBR", "LP1", "UP1", "G1"));
dtoList.add(new InOutReelDto("PN2", "RI2", "Wait", "MBR", "LP2", "UP3", "G1"));
dtoList.add(new InOutReelDto("PN3", "RI3", "Wait", "MBR", "LP1", "UP1", "G2"));
dtoList.add(new InOutReelDto("PN4", "RI4", "Wait", "MBR", "LP2", "UP3", "G1"));
dtoList.add(new InOutReelDto("PN5", "RI5", "Wait", "MBR", "LP1", "UP1", "G1"));
}
// if(dtoList.size()<=0&& MicronApi.Debug) {
// dtoList.add(new InOutReelDto("PN1", "RI1", "Wait", "MBR", "LP1", "UP1", "G1"));
// dtoList.add(new InOutReelDto("PN2", "RI2", "Wait", "MBR", "LP2", "UP3", "G1"));
// dtoList.add(new InOutReelDto("PN3", "RI3", "Wait", "MBR", "LP1", "UP1", "G2"));
// dtoList.add(new InOutReelDto("PN4", "RI4", "Wait", "MBR", "LP2", "UP3", "G1"));
// dtoList.add(new InOutReelDto("PN5", "RI5", "Wait", "MBR", "LP1", "UP1", "G1"));
// }
return dtoList;
}
......
......@@ -116,13 +116,13 @@ public class ML5SDeviceController {
dto.setGantry(item.getAppendData("gantry"));
}
}
if(dtoList.size()<=0&& MicronApi.Debug) {
dtoList.add(new InOutReelDto("PN1", "RI1", "Wait", "MBR", "LP1", "UP1", "G1"));
dtoList.add(new InOutReelDto("PN2", "RI2", "Wait", "MBR", "LP2", "UP3", "G1"));
dtoList.add(new InOutReelDto("PN3", "RI3", "Wait", "MBR", "LP1", "UP1", "G2"));
dtoList.add(new InOutReelDto("PN4", "RI4", "Wait", "MBR", "LP2", "UP3", "G1"));
dtoList.add(new InOutReelDto("PN5", "RI5", "Wait", "MBR", "LP1", "UP1", "G1"));
}
// if(dtoList.size()<=0&& MicronApi.Debug) {
// dtoList.add(new InOutReelDto("PN1", "RI1", "Wait", "MBR", "LP1", "UP1", "G1"));
// dtoList.add(new InOutReelDto("PN2", "RI2", "Wait", "MBR", "LP2", "UP3", "G1"));
// dtoList.add(new InOutReelDto("PN3", "RI3", "Wait", "MBR", "LP1", "UP1", "G2"));
// dtoList.add(new InOutReelDto("PN4", "RI4", "Wait", "MBR", "LP2", "UP3", "G1"));
// dtoList.add(new InOutReelDto("PN5", "RI5", "Wait", "MBR", "LP1", "UP1", "G1"));
// }
return dtoList;
}
......
package com.neotel.smfcore.custom.micron1551.controller;
import cn.hutool.core.util.NumberUtil;
import cn.hutool.core.util.ObjectUtil;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.neotel.smfcore.common.bean.ReelLockPosInfo;
import com.neotel.smfcore.common.bean.ResultBean;
import com.neotel.smfcore.common.enlog.EnLog;
import com.neotel.smfcore.common.exception.ApiException;
import com.neotel.smfcore.common.exception.ValidateException;
import com.neotel.smfcore.common.utils.Constants;
import com.neotel.smfcore.common.utils.ReelLockPosUtil;
import com.neotel.smfcore.common.utils.StringUtils;
import com.neotel.smfcore.core.barcode.bean.CodeBean;
import com.neotel.smfcore.core.barcode.enums.COMPONENT_TYPE;
import com.neotel.smfcore.core.barcode.service.manager.IBarcodeManager;
import com.neotel.smfcore.core.barcode.service.po.Barcode;
import com.neotel.smfcore.core.barcode.utils.CodeResolve;
......@@ -18,6 +23,8 @@ import com.neotel.smfcore.core.inList.service.po.InList;
import com.neotel.smfcore.core.inList.service.po.InListItem;
import com.neotel.smfcore.core.language.util.MessageUtils;
import com.neotel.smfcore.core.message.util.DeviceMessageUtil;
import com.neotel.smfcore.core.order.LiteOrderCache;
import com.neotel.smfcore.core.order.service.po.LiteOrder;
import com.neotel.smfcore.core.storage.enums.DeviceType;
import com.neotel.smfcore.core.storage.service.manager.IStoragePosManager;
import com.neotel.smfcore.core.storage.service.po.Storage;
......@@ -35,9 +42,7 @@ import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.session.StoreType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import java.util.*;
......@@ -45,7 +50,7 @@ import java.util.*;
@Api(tags = "1551 设备接口")
@RestController
@Slf4j
public class ML5DeviceController {
public class Micron1551DeviceController {
@Autowired
DataCache dataCache;
......@@ -67,8 +72,12 @@ public class ML5DeviceController {
protected CodeResolve codeResolve;
@Autowired
private IAlarmInfoDao alarmInfoDao;
@Autowired
private LiteOrderCache liteOrderCache;
@ApiOperation("ML5S扫码后获取库位号")
@PostMapping(value = "/service/ml5s/emptyPosForPutin")
@PostMapping(value = "/rest/micron1551/emptyPosForPutin")
@ResponseBody
@AnonymousAccess
public Map<String, Object> ml5sEmptyPosForPutin(HttpServletRequest request) {
......@@ -712,4 +721,147 @@ public class ML5DeviceController {
return barcode;
}
// ML5O获取料盘目的地post :
// /rest/micron1551/getTargetLine
//
// 参数:barcode
// 返回:
// code=0时获取目的地成功, data中包含:barcode,plateW,plateH,taskId,line
// taskId是任务ID,line是目的地,手动出料时line为空
// code=1时只有尺寸,没有出库任务料盘需要NG, data中包含:barcode,plateW,plateH
// code=其他值时错误,尺寸也没有
@ApiOperation("ML5O获取料盘目的地")
@PostMapping(value = "/rest/micron1551/getTargetLine")
@ResponseBody
@AnonymousAccess
public ResultBean getTargetLine(HttpServletRequest request) {
try {
String barcodeStr = request.getParameter("barcode");
log.info(" getTargetLine [" + barcodeStr + "] ");
EnLog.info("Get size info for [" + barcodeStr + "]");
Collection<CodeBean> codeBeans = codeResolve.resolveCodeStr(barcodeStr, COMPONENT_TYPE.COMPONENT);
Barcode barcode = null;
for (CodeBean codeBean : codeBeans) {
if (codeBean.isValid()) {
if (barcode != null) {
String msg = "获取尺寸时找到多个有效条码";
return ResultBean.newErrorResult(105, "smfcore.getSize.error", "获取" + barcodeStr + "尺寸失败:有多个条码");
} else {
barcode = codeBean.getBarcode();
}
}
}
if (barcode == null) {
return ResultBean.newErrorResult(105, "smfcore.getSize.error", "获取" + barcodeStr + "尺寸失败:未找到有效条码");
}
Map<String, String> returnData = new HashMap<>();
returnData.put("barcode", barcode.getBarcode());
returnData.put("plateW", barcode.getPlateSize() + "");
returnData.put("plateH", barcode.getHeight() + "");
//查找任务
List<DataLog> dataLogs = taskService.getAllTasks();
DataLog currTask = null;
for (DataLog dataLog : dataLogs
) {
if (dataLog.isCheckOutTask()) {
if (dataLog.isFinished() || dataLog.isCancel() || dataLog.isEnd()) {
} else {
currTask = dataLog;
break;
}
}
}
if (currTask != null) {
returnData.put("taskId", currTask.getId());
String line = "";
if (ObjectUtil.isNotEmpty(currTask.getSourceId()) && ObjectUtil.isNotEmpty(currTask.getSourceName())) {
LiteOrder order = liteOrderCache.getLiteOrder(currTask.getSourceName());
if (order != null) {
if (ObjectUtil.isEmpty(order.getLine())) {
line = order.getOrderNo();
} else {
line = order.getLine();
}
}
}
returnData.put("line", line);
return ResultBean.newOkResult(returnData);
} else {
log.info(" getTargetLine [" + barcodeStr + "],未找到任务信息");
ResultBean result= ResultBean.newErrorResult(1, "smfcore.getTargetLine.notask", "未找到出库任务:" );
result.setData(returnData);
return result;
}
} catch (ValidateException e) {
log.warn(" getTargetLine error :" + e.getMessage());
EnLog.warn("Get size info error: " + e.getMessage());
return ResultBean.newErrorResult(105, "smfcore.getTargetLine.error", "获取料盘目的地出错:" + e.getMessage());
} catch (Exception e) {
log.error("getTargetLine error", e);
EnLog.error("Get size info error", e);
return ResultBean.newErrorResult(105, "smfcore.getTargetLine.error", "获取料盘目的地出错:" + e.getMessage());
}
}
@ApiOperation("获取条码尺寸")
@PostMapping(value = "/service/micron1551/getSize")
@ResponseBody
@AnonymousAccess
public ResultBean getSize(HttpServletRequest request) {
try {
String barcodeStr = request.getParameter("barcode");
log.info(" 获取[" + barcodeStr + "]的尺寸信息");
EnLog.info("Get size info for [" + barcodeStr + "]");
Collection<CodeBean> codeBeans = codeResolve.resolveCodeStr(barcodeStr, COMPONENT_TYPE.COMPONENT);
Barcode barcode = null;
for (CodeBean codeBean : codeBeans) {
if (codeBean.isValid()) {
if (barcode != null) {
String msg = "获取尺寸时找到多个有效条码";
return ResultBean.newErrorResult(105, "smfcore.getSize.error", "获取" + barcodeStr + "尺寸失败:有多个条码");
} else {
barcode = codeBean.getBarcode();
}
}
}
if (barcode == null) {
return ResultBean.newErrorResult(105, "smfcore.getSize.error", "获取" + barcodeStr + "尺寸失败:未找到有效条码");
}
if (barcode.getPlateSize() > 0 && barcode.getHeight() > 0) {
Map<String, String> returnData = new HashMap<>();
returnData.put("barcode", barcode.getBarcode());
returnData.put("plateW", barcode.getPlateSize() + "");
returnData.put("plateH", barcode.getHeight() + "");
return ResultBean.newOkResult(returnData);
} else {
return ResultBean.newErrorResult(105, "smfcore.getSize.error", "获取" + barcodeStr + "尺寸失败:未找到对应尺寸");
}
} catch (ValidateException e) {
log.warn(" 获取尺寸信息出错:" + e.getMessage());
EnLog.warn("Get size info error: " + e.getMessage());
return ResultBean.newErrorResult(105, "smfcore.getSize.error", "获取尺寸信息出错:" + e.getMessage());
} catch (Exception e) {
log.error("获取尺寸信息出错", e);
EnLog.error("Get size info error", e);
return ResultBean.newErrorResult(1, "smfcore.getSize.error", "获取尺寸信息出错:" + e.getMessage());
}
}
}
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!