Commit 373409d1 sunke

设备端接口

1 个父辈 1f05edb3
......@@ -33,6 +33,20 @@ public enum OP_STATUS {
/**
* 已结束
*/
END
END,
/**
* 任务状态
* EXECUTING=已发送到AGV
* IN_ON_LINE=入库时人员将料箱推上线体,
* IN_ON_AGV=入库时AGV从线体上抓起料箱
* OUT_ON_LINE=出库时AGV将料箱放上线体,
* OUT_ON_AGV=出库时AGV将料箱从库位中取出
* FINISHED=任务完成(入库时AGV将料箱放入库位;出库时料箱到达工位)
*/
IN_ON_LINE,
IN_ON_AGV,
OUT_ON_LINE,
OUT_ON_AGV
;
}
......@@ -117,7 +117,12 @@ public enum DeviceType {
/**
* 18 (默认料仓)
*/
DEFAULT("storage.type.default")
DEFAULT("storage.type.default"),
/**
* 19 (AGV BOX)
*/
AGV_BOX("storage.type.agvBox")
;
private String key;
......
......@@ -30,6 +30,7 @@ import org.springframework.stereotype.Service;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import java.util.regex.Pattern;
@Service
@Slf4j
......@@ -222,7 +223,11 @@ public class StoragePosManagerImpl implements IStoragePosManager {
@Override
public StoragePos getByBarcode(String barcode){
return storagePosDao.findOneByCondition(new String[]{"barcode.barcode"}, new String[]{barcode});
List<Criteria> orCriterialList = Lists.newArrayList();
orCriterialList.add(Criteria.where("barcode.barcode").is(barcode));
orCriterialList.add(Criteria.where("barcode.subCodeList.barcode").is(barcode));
Criteria c = new Criteria().orOperator(orCriterialList);
return storagePosDao.findOne(new Query(c));
}
@Override
......
......@@ -89,6 +89,13 @@ public class Storage extends BasePo implements Serializable {
}
/**
* 是否是某种类型的料仓
*/
public boolean isStorage(DeviceType deviceType){
return deviceType.name().equals(type);
}
/**
* 是否是单台自动仓
*/
public boolean isAuto(){
......
......@@ -252,6 +252,10 @@ public class DataLog extends BasePo implements Serializable {
return OP_STATUS.END.name().equals(status);
}
public boolean isTaskInStatus(OP_STATUS taskStatus){
return taskStatus.name().equals(status);
}
/**
* 是否是入库任务
......@@ -274,6 +278,7 @@ public class DataLog extends BasePo implements Serializable {
return OP.MIX == type;
}
/**
* 是否是回温放料任务
*/
......
......@@ -831,7 +831,7 @@ public class TaskService {
/**
* 出库完成
*/
private void checkoutFinished(DataLog task) throws ValidateException {
public void checkoutFinished(DataLog task) throws ValidateException {
boolean isCancelTask = task.isCancel();
StoragePos storagePos = storagePosManager.get(task.getPosId());
......
package com.neotel.smfcore.custom.lizhen.util;
import cn.hutool.core.util.ObjectUtil;
import com.neotel.smfcore.common.bean.ResultBean;
import com.neotel.smfcore.core.barcode.service.po.Barcode;
import com.neotel.smfcore.core.device.util.DataCache;
import com.neotel.smfcore.core.inList.bean.ItemReelInfo;
import com.neotel.smfcore.core.inList.enums.INLIST_STATUS;
import com.neotel.smfcore.core.inList.service.manager.IInListItemManager;
import com.neotel.smfcore.core.inList.service.manager.IInListManager;
import com.neotel.smfcore.core.inList.service.po.InList;
import com.neotel.smfcore.core.inList.service.po.InListItem;
import com.neotel.smfcore.core.storage.service.po.StoragePos;
import com.neotel.smfcore.custom.lizhen.bean.Station;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.query.Criteria;
import org.springframework.data.mongodb.core.query.Query;
import org.springframework.stereotype.Service;
import javax.annotation.PostConstruct;
import java.util.Date;
import java.util.List;
import java.util.Collection;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
......@@ -66,12 +53,21 @@ public class StationCacheUtil {
}
Station station = getStation(stationName);
if(station != null){
station.setCurrentRfid(rfid);
updateStation(station);
String oldRfid = station.getCurrentRfid();
if (!oldRfid.equals(rfid)) {
log.info("工位" + stationName + " 切换料箱,当前料箱:" + rfid + ",上一料箱:" + oldRfid);
station.setCurrentRfid(rfid);
updateStation(station);
}
}
}
/**
* 获取所有工位的缓存信息
*/
public static Collection<Station> getAllStations(){
return stationMap.values();
}
/**
* 获取工位信息
......
......@@ -3,7 +3,7 @@ server:
api:
#name: Neotel
#inCheckUrl: DaLu
#inCheckUrl:
#outNotifyUrl: https://matlabel-tool.com:4434/SMD_BOXAPI/OutBox
#inNotifyUrl: https://matlabel-tool.com:4434/SMD_BOXAPI/InBox
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!