Commit 0e7517cd sunke

增加出库放到门口失败的状态(同时屏蔽库位)

分配库位时,排除急停和报警的料仓
1 个父辈 11a719d7
......@@ -46,5 +46,10 @@ public enum OP_STATUS {
* 已放到料仓门口
*/
BOXDOOR,
/**
* 已放到料仓门口无料盘
*/
BOXDOOR_NOREEL
;
}
......@@ -9,6 +9,7 @@ import com.neotel.smfcore.common.bean.ResultBean;
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.SecurityUtils;
import com.neotel.smfcore.core.barcode.service.po.Barcode;
import com.neotel.smfcore.core.device.api.IOpAuthApi;
import com.neotel.smfcore.core.device.bean.BoxStatusBean;
......@@ -195,8 +196,25 @@ public class RobotBoxHandler extends BaseDeviceHandler {
}
log.error(posName + "出库放到门口时,未找到对应的出库任务");
} else if(BOX_STATUS.OUT_FAILED == status){
log.error(posName + "出库放到门口时,未感应到料盘");
//通知
//更改出库状态为OUT_DOOR
List<DataLog> finishedTasks = taskService.getFinishedTasks();
for (DataLog finishedTask : finishedTasks) {
if(finishedTask.getCid().equals(statusBean.getCid()) && finishedTask.isCheckOutTask() && finishedTask.isOutBox()){
if(posName.equals(finishedTask.getPosName())){
//已出仓但未放到门口,更改状态
finishedTask.setStatus(OP_STATUS.BOXDOOR_NOREEL.name());
log.info("物料" + finishedTask.getBarcode() + "已从库位"+ finishedTask.getPosName() + "取出放到门口,但未感应到料盘,屏蔽库位");
StoragePos pos = storagePosManager.getByPosName(finishedTask.getPosName());
if (pos != null) {
pos.setEnabled(false);
storagePosManager.save(pos);
DeviceMessageUtil.addEnabledPosMessage(pos, "SYSTEM");
}
taskService.updateFinishedTask(finishedTask);
return statusBean;
}
}
}
}
}
......@@ -242,12 +260,12 @@ public class RobotBoxHandler extends BaseDeviceHandler {
String errorMsg = "";
List<Storage> storageList = Lists.newArrayList();
List<String> cidList=new ArrayList<>();
if (Strings.isNullOrEmpty(cids)) {
//if (Strings.isNullOrEmpty(cids)) {
//自动获取在线的料仓列表
cidList=dataCache.getAvailableStorageIds(this.getDeviceType());
} else {
cidList = Lists.newArrayList(cids.split(","));
}
//} else {
//cidList = Lists.newArrayList(cids.split(","));
//}
for (String cid : cidList) {
String notIntoCids = dataCache.getSettings().getNotIntoCids();
if (notIntoCids != null) {
......
......@@ -266,7 +266,11 @@ public class DataLog extends BasePo implements Serializable {
}
public boolean isBoxdoor(){
return OP_STATUS.BOXDOOR.name().equals(status);
return OP_STATUS.BOXDOOR.name().equals(status) || OP_STATUS.BOXDOOR_NOREEL.equals(status);
}
public boolean isBoxDoorNoReel(){
return OP_STATUS.BOXDOOR_NOREEL.equals(status);
}
......
......@@ -34,12 +34,12 @@ public class TaiZhiApi implements ITaskListener, IOpAuthApi {
@Override
public void onTaskStatusChange(DataLog task) {
if(task.isFinished() || task.isOutBox()){
if(task.isPutInTask()){
if(task.isPutInTask()){
if(task.isFinished() || task.isOutBox()){
inFinished(task);
}else{
outFinished(task);
}
}else{
outFinished(task);
}
}
......@@ -48,24 +48,36 @@ public class TaiZhiApi implements ITaskListener, IOpAuthApi {
* @param task
*/
private void outFinished(DataLog task) {
String outDoneUrl = config.outDoneUrl;
if(Strings.isNotBlank(outDoneUrl)){
try {
String reelId = task.getBarcode();
String deviceId = task.getCid();
String location = task.getPosName();
String status = "";
//"status": "状态:R:开始出库,Y:出库成功,N:出库失败",
String status = "Y";
log.info("调用物料出库完成接口deviceId="+deviceId+",reelId="+reelId+",location="+location+","+status);
Map<String,Object> paramMap = new HashMap<>();
paramMap.put("deviceId",deviceId);
paramMap.put("location",location);
paramMap.put("reelId",reelId);
paramMap.put("status",status);
paramMap.put("outTime",task.getUpdateDate());
paramMap.put("remark","");
String result = HttpHelper.postJson(outDoneUrl,paramMap);
log.info(reelId + "物料出库完成接口返回:" +result);
if(task.isOutBox()){
status = "R";
}else if(task.isBoxdoor()){
if(task.isBoxDoorNoReel()){
status = "N";
}else{
status = "Y";
}
}
if(Strings.isNotBlank(status)){
String reelId = task.getBarcode();
String deviceId = task.getCid();
String location = task.getPosName();
log.info("调用物料出库完成接口deviceId="+deviceId+",reelId="+reelId+",location="+location+","+status);
Map<String,Object> paramMap = new HashMap<>();
paramMap.put("deviceId",deviceId);
paramMap.put("location",location);
paramMap.put("reelId",reelId);
paramMap.put("status",status);
paramMap.put("outTime",task.getUpdateDate());
paramMap.put("remark","");
String result = HttpHelper.postJson(outDoneUrl,paramMap);
log.info(reelId + "物料出库完成接口返回:" +result);
}
} catch (ApiException e) {
log.error("调用物料出库完成接口",e);
}
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!