Commit 0fcac298 sunke

扫码后展示MES返回结果

在库物料不亮灯
1 个父辈 82f882ba
...@@ -97,18 +97,7 @@ public class NLPShelfHandler extends BaseDeviceHandler { ...@@ -97,18 +97,7 @@ public class NLPShelfHandler extends BaseDeviceHandler {
try{ try{
CodeValidateParam params = new CodeValidateParam(loginUser, groupId, storageId, code, token); CodeValidateParam params = new CodeValidateParam(loginUser, groupId, storageId, code, token);
Barcode barcodeSave = smfApi.canPutInBeforeResolve(params); Barcode barcodeSave = smfApi.canPutInBeforeResolve(params);
return ResultBean.newOkResult("");
if (barcodeSave == null) {
barcodeSave = codeResolve.resolveOneValideBarcode("=1x1=" + code);
}
//从API验证
Barcode verResult = smfApi.canPutInAfterResolve(barcodeSave);
if (verResult != null) {
barcodeSave = verResult;
}
return putIn(loginUser, groupId, storageId, barcodeSave, token);
}catch (ValidateException ve){ }catch (ValidateException ve){
return ResultBean.newErrorResult(-1,ve.getMsgKey(),ve.getDefaultMsg(),ve.getMsgParam()); return ResultBean.newErrorResult(-1,ve.getMsgKey(),ve.getDefaultMsg(),ve.getMsgParam());
} }
...@@ -214,15 +203,12 @@ public class NLPShelfHandler extends BaseDeviceHandler { ...@@ -214,15 +203,12 @@ public class NLPShelfHandler extends BaseDeviceHandler {
//亮灯 //亮灯
Collection<DataLog> queueTasks = taskService.getQueueTasks(statusBean.getCid()); Collection<DataLog> queueTasks = taskService.getQueueTasks(statusBean.getCid());
for (DataLog queueTask : queueTasks) { for (DataLog queueTask : queueTasks) {
if (queueTask.isWait()) { if (queueTask.isWait() && queueTask.isCheckOutTask()) {
queueTask.setStatus(OP_STATUS.EXECUTING.name()); queueTask.setStatus(OP_STATUS.EXECUTING.name());
taskService.updateQueueTask(queueTask); taskService.updateQueueTask(queueTask);
String rgb = queueTask.getLightColor(); String rgb = queueTask.getLightColor();
ORDER_COLOR color = ORDER_COLOR.fromRgb(rgb); ORDER_COLOR color = ORDER_COLOR.fromRgb(rgb);
if (color == null) { if (color == null) {
if (queueTask.isPutInTask()) {
color = ORDER_COLOR.DARKGREEN;
} else {
if (openZhiYin && ObjectUtil.isNotEmpty(queueTask.getSourceId())) { if (openZhiYin && ObjectUtil.isNotEmpty(queueTask.getSourceId())) {
List<DataLog> dataLogList = outMap.get(queueTask.getSourceId()); List<DataLog> dataLogList = outMap.get(queueTask.getSourceId());
if (dataLogList == null) { if (dataLogList == null) {
...@@ -234,19 +220,9 @@ public class NLPShelfHandler extends BaseDeviceHandler { ...@@ -234,19 +220,9 @@ public class NLPShelfHandler extends BaseDeviceHandler {
color = ORDER_COLOR.BLUE; color = ORDER_COLOR.BLUE;
} }
} }
}
statusBean.addData("open", queueTask.getPosName() + "=" + color.name()); statusBean.addData("open", queueTask.getPosName() + "=" + color.name());
log.info("库位[" + queueTask.getPosName() + "]+亮灯:" + color.name()); log.info("库位[" + queueTask.getPosName() + "]+亮灯:" + color.name());
} }
// else if(queueTask.isCancel()){
// if(queueTask.isCheckOutTask()){
//
// statusBean.addData("open",queueTask.getPosName()+"="+"orange" );
// log.info("库位["+queueTask.getPosName()+"]+取消:open=orange" );
// //从任务列表中删除
// taskService.removeFinishedTask(queueTask);
// }
// }
} }
List<DataLog> dataLogs = getLightGuideTask(outMap); List<DataLog> dataLogs = getLightGuideTask(outMap);
...@@ -516,7 +492,7 @@ public class NLPShelfHandler extends BaseDeviceHandler { ...@@ -516,7 +492,7 @@ public class NLPShelfHandler extends BaseDeviceHandler {
} }
String hasReelPosColor = "off"; String hasReelPosColor = "off";
hasReelPosColor = ORDER_COLOR.FORESTGREEN.name().toLowerCase(); //hasReelPosColor = ORDER_COLOR.FORESTGREEN.name().toLowerCase();
// if(lightPosCidList.contains(cid)){ // if(lightPosCidList.contains(cid)){
// hasReelPosColor = ORDER_COLOR.LIGHTBLUE.name(); // hasReelPosColor = ORDER_COLOR.LIGHTBLUE.name();
// } // }
......
package com.neotel.smfcore.custom.hella.handler; package com.neotel.smfcore.custom.hella.handler;
import com.neotel.smfcore.common.bean.ResultBean;
import com.neotel.smfcore.common.exception.ValidateException; import com.neotel.smfcore.common.exception.ValidateException;
import com.neotel.smfcore.core.api.listener.BaseSmfApiListener; import com.neotel.smfcore.core.api.listener.BaseSmfApiListener;
import com.neotel.smfcore.core.barcode.service.po.Barcode; import com.neotel.smfcore.core.barcode.service.po.Barcode;
...@@ -19,10 +20,11 @@ public class HellaApiHandler extends BaseSmfApiListener { ...@@ -19,10 +20,11 @@ public class HellaApiHandler extends BaseSmfApiListener {
if (!HellaTcpClient.isEnable()) { if (!HellaTcpClient.isEnable()) {
return null; return null;
} }
hellaServiceHandler.checkMaterial(param); ResultBean resultBean = hellaServiceHandler.checkMaterial(param);
Barcode barcode = new Barcode(); if(!resultBean.isOkResult()){
barcode.setFullCode(param.getCode()); throw new ValidateException(resultBean.getMsgKey(),resultBean.getMsg(), resultBean.getParams());
return barcode; }
return null;
} }
@Override @Override
......
...@@ -139,16 +139,17 @@ public class HellaServiceHandler extends BaseSmfApiListener implements IoHandler ...@@ -139,16 +139,17 @@ public class HellaServiceHandler extends BaseSmfApiListener implements IoHandler
log.info("发送检查物料条码请求:" + command.toReqMsg()); log.info("发送检查物料条码请求:" + command.toReqMsg());
ResultBean resultBean = HellaTcpClient.sendMsg(command.toReqMsg()); ResultBean resultBean = HellaTcpClient.sendMsg(command.toReqMsg());
// ResultBean resultBean = testCheckOK(command);
resultBean.setMsg("Check Material result:"+resultBean.getMsg()); resultBean.setMsg("Check Material result:"+resultBean.getMsg());
waitCheckMaterialResult(command); if(resultBean.isOkResult()){
resultBean = waitCheckMaterialResult(command);
}
return resultBean; return resultBean;
} }
/** /**
* 等待指令请求返回超时 * 等待指令请求返回超时
*/ */
public void waitCheckMaterialResult(HellaReqCommand reqCommand){ public ResultBean waitCheckMaterialResult(HellaReqCommand reqCommand){
try{ try{
long sleepTime = 10; long sleepTime = 10;
long waitTime = 0; long waitTime = 0;
...@@ -164,11 +165,14 @@ public class HellaServiceHandler extends BaseSmfApiListener implements IoHandler ...@@ -164,11 +165,14 @@ public class HellaServiceHandler extends BaseSmfApiListener implements IoHandler
} }
if(timeOut){ if(timeOut){
ResultBean ngResult = ResultBean.newErrorResult(408,"smfcore.checkMaterial.timeOut","checkMaterial timeout,event Id:{0}",new String[]{reqCommand.getEventId()} ); ResultBean ngResult = ResultBean.newErrorResult(408,"smfcore.checkMaterial.timeOut","checkMaterial timeout,event Id:{0}",new String[]{reqCommand.getEventId()} );
WebSocketServer.sendMsg(new SocketMsg(Lists.newArrayList(reqCommand.getLoginUser()),ngResult.getMsg(), MsgType.ERROR,ngResult.getMsgKey(),ngResult.getParams())); //WebSocketServer.sendMsg(new SocketMsg(Lists.newArrayList(reqCommand.getLoginUser()),ngResult.getMsg(), MsgType.ERROR,ngResult.getMsgKey(),ngResult.getParams()));
return ngResult;
} }
}catch (Exception e){ }catch (Exception e){
log.error("waitCheckMaterialResult Error",e); log.error("waitCheckMaterialResult Error",e);
return ResultBean.newErrorResult(500, "smfcore.checkMaterial.error","Check Material Error:" + e.getMessage());
} }
return ResultBean.newOkResult("");
} }
......
...@@ -6,10 +6,10 @@ ...@@ -6,10 +6,10 @@
</Properties> </Properties>
<appenders> <appenders>
<Console name="Console" target="SYSTEM_OUT"> <Console name="Console" target="SYSTEM_OUT">
<PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss} %-5level [%file:%line] - %msg%n"/> <PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level [%file:%line] - %msg%n"/>
</Console> </Console>
<RollingFile name="log" fileName="${LOG_HOME}/${LOG_NAME}" filePattern="${LOG_HOME}/%d{yyyy-MM-dd}.${LOG_NAME}" append="true"> <RollingFile name="log" fileName="${LOG_HOME}/${LOG_NAME}" filePattern="${LOG_HOME}/%d{yyyy-MM-dd}.${LOG_NAME}" append="true">
<PatternLayout charset="GB18030" pattern="%d{yyyy-MM-dd HH:mm:ss} %-5level [%file:%line] - %msg%n" /> <PatternLayout charset="GB18030" pattern="%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level [%file:%line] - %msg%n" />
<Policies> <Policies>
<TimeBasedTriggeringPolicy modulate="true" interval="1" /> <TimeBasedTriggeringPolicy modulate="true" interval="1" />
</Policies> </Policies>
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!