Commit c4a96115 LN

新加PCB_DUO类型

1 个父辈 b6a32579
......@@ -63,18 +63,39 @@ public class SmdBoxController {
}
return null;
}
private List<String> getCidsByBoxName(String pageName) {
List<String> cids = new ArrayList<>();
Map<String, Storage> allStorages = dataCache.getAllStorage();
for (Storage storage :
allStorages.values()) {
if (storage.getCid().toUpperCase().contains(pageName.trim().toUpperCase())) {
cids.add(storage.getCid());
}else if(storage.getCid().toUpperCase().contains(pageName.trim().toUpperCase())) {
cids.add(storage.getCid());
}
}
return cids;
}
@ApiOperation("设备状态")
@RequestMapping("/boxStatus")
@AnonymousAccess
public List<ElecKanbanBoxStatusDto> getElecKanbanBoxStatusDto(String cid, HttpServletRequest servletRequest) throws ParseException {
public List<ElecKanbanBoxStatusDto> getElecKanbanBoxStatusDto(String cid,String pageName, HttpServletRequest servletRequest) throws ParseException {
List<ElecKanbanBoxStatusDto> resultList = new ArrayList<>();
if (StringUtils.isBlank(cid)) {
if(ObjectUtil.isEmpty(pageName)){
Storage storage = getDefaultBox();
if (storage != null) {
cid = storage.getCid();
}
}else{
List<String> cids=getCidsByBoxName(pageName);
if(cids.size()>0){
cid=cids.get(0);
}
}
}
MSDSettiings msdSettiings = dataCache.getCache(Constants.CACHE_msdSetting);
if (msdSettiings == null) {
......
package com.neotel.smfcore.core.device.handler.impl;
import com.google.common.base.Strings;
import com.neotel.smfcore.common.enlog.EnLog;
import com.neotel.smfcore.common.exception.ValidateException;
import com.neotel.smfcore.core.device.bean.BoxStatusBean;
import com.neotel.smfcore.core.device.bean.StatusBean;
import com.neotel.smfcore.core.device.enums.BOX_STATUS;
import com.neotel.smfcore.core.device.enums.OP;
import com.neotel.smfcore.core.device.enums.OP_STATUS;
import com.neotel.smfcore.core.message.util.DeviceMessageUtil;
import com.neotel.smfcore.core.storage.enums.DeviceType;
import com.neotel.smfcore.core.storage.service.po.Storage;
import com.neotel.smfcore.core.storage.service.po.StoragePos;
import com.neotel.smfcore.core.system.service.po.DataLog;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;
@Service
@Slf4j
public class PCBDuoBoxHandler extends BaseDeviceHandler {
@Override
public StatusBean handleClientRequest(StatusBean statusBean, HttpServletRequest request) {
statusBean.setClientIp(request.getRemoteHost());
String cid = statusBean.getCid();
Storage storage = dataCache.getStorage(cid);
if (storage == null) {
log.error("料仓cid: [" + cid + "]不存在");
EnLog.error("Storage cid: [" + cid + "] not exist");
return null;
}
handleMsg(statusBean);
statusBean = saveAlarmAndHumidity(statusBean);
statusBean=handleSelfAudit(statusBean);
statusBean = handleDeviceStatus(statusBean);
StatusBean humidityResult = handleHumidity(statusBean);
if (humidityResult != null) {
return humidityResult;
}
if (statusBean.getOp() == OP.PUT_IN) {
log.debug("入库:" + statusBean.toString());
EnLog.debug("Put in: " + statusBean.toString());
statusBean = putInLine(storage, statusBean);
} else {
//查看是否有要出库的操作
statusBean =taskService.checkOut(storage, statusBean);
}
return statusBean;
}
protected StatusBean handleDeviceStatus(StatusBean statusBean) {
Map<String, BoxStatusBean> statusOfBoxes = statusBean.getBoxStatus();
if (statusOfBoxes != null) {
for (BoxStatusBean boxStatus : statusOfBoxes.values()) {
try {
//出库入库完成处理
int status = boxStatus.getStatus();
String posName = boxStatus.getPosId();
String barcode=boxStatus.getBarcode();
int executeTime=boxStatus.getExecuteTime();
if (!Strings.isNullOrEmpty(posName)) {//客户端发一次完成之后,会发空的 posName,不需要处理
if (BOX_STATUS.IN_FINISHED == status) {//入仓完成
finishedPutIn(statusBean.getCid(),posName,barcode,executeTime);
} else if (BOX_STATUS.OUT_FINISHED == status) {//出仓完成
finishedOutPos(statusBean.getCid(),posName,barcode,executeTime, OP_STATUS.OUT_BOX);
} else if (BOX_STATUS.OUT_END == status) {//出库完成(放到仓门口
log.info(statusBean.getCid() +"将物料从库位["+posName+"]出库到门口/料串完成");
EnLog.info(statusBean.getCid() + " move material from pos [" + posName + "] to door/reel completed");
reelOnShelf(statusBean.getCid(),posName);
} } else if (BOX_STATUS.OUT_FAILED == status) {
//更改出库状态为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() + "取出放到门口,但未感应到料盘,屏蔽库位");
EnLog.info("Material " + finishedTask.getBarcode() + " taken from pos " + finishedTask.getPosName() + " to door, but reel not detected, disable position");
StoragePos pos = storagePosManager.getByPosName(finishedTask.getPosName());
if (pos != null) {
pos.setEnabled(false);
storagePosManager.save(pos);
DeviceMessageUtil.addEnabledPosMessage(pos, "SYSTEM");
Storage storage = dataCache.getStorageById(pos.getStorageId());
if (storage != null) {
dataCache.reloadStorage(storage, storage.getCid());
}
}
taskService.updateFinishedTask(finishedTask);
return statusBean;
}
}
}
}
} catch (ValidateException e) {
log.error("更新状态时出错" + e.getMessage());
EnLog.error("Update status error: " + e.getMessage());
}
}
}
return statusBean;
}
protected void reelInLine(String cid,String posName){
//更改出库状态为OUT_DOOR
List<DataLog> finishedTasks = taskService.getFinishedTasks();
for (DataLog finishedTask : finishedTasks) {
if (finishedTask.getCid().equals(cid) && finishedTask.isCheckOutTask() && finishedTask.isOutBox()) {
if (posName.equals(finishedTask.getPosName())) {
//已出仓但未放到门口,更改状态
finishedTask.setStatus(OP_STATUS.INLINE.name());
taskService.updateFinishedTask(finishedTask);
log.info("物料" + finishedTask.getBarcode() + "已从库位" + finishedTask.getPosName() + "取出放到门口,更改状态=INLINE");
EnLog.info("Material " + finishedTask.getBarcode() + " taken from pos " + finishedTask.getPosName() + " to door");
return ;
}
}
}
log.error(posName + "出库放到门口时,未找到对应的出库任务");
EnLog.error("No matching checkout task found when placing pos " + posName + " to door");
}
protected void reelOnShelf(String cid, String posName){
DataLog task = taskService.findFinishedOutTask(cid,posName);
if(task != null){
task.setStatus(OP_STATUS.FINISHED.name());
taskService.updateFinishedTask(task);
}else{
log.info(cid +"未找到任务["+posName+"] ");
}
}
@Override
public DeviceType getDeviceType() {
return DeviceType.SMD_PCB_DUO;
}
}
\ No newline at end of file
......@@ -13,7 +13,7 @@ public enum DeviceType {
* 料仓类型:0单台自动料仓,1手动料仓2流水线料仓
*/
/**
*0单台自动料仓
* 0单台自动料仓
*/
AUTO("storage.type.auto"),
......@@ -127,8 +127,14 @@ public enum DeviceType {
/**
* 20 第三方料仓 麦康尼虚拟料仓
*/
SMDBOX_THIRD("storage.type.SMDBOX_THIRD");
;
SMDBOX_THIRD("storage.type.SMDBOX_THIRD"),
/**
* 21 PCB多料仓
*/
SMD_PCB_DUO("storage.type.pcbDuo"),
;;
private String key;
......@@ -144,11 +150,12 @@ public enum DeviceType {
this.key = key;
}
public String getName(){
public String getName() {
return name();
}
public static List<DeviceType> availableTypeList(){
return Lists.newArrayList(AUTO,LINE,BATCH,SOLDERPASTE,VERTICALBOX,SMD_XL,SMD_DUO,SMD_XLC,SMD_XLR,VIRTUAL,NL,NLP,NLM,SMDBOX_THIRD);
public static List<DeviceType> availableTypeList() {
// return Lists.newArrayList(AUTO,LINE,BATCH,SOLDERPASTE,VERTICALBOX,SMD_XL,SMD_DUO,SMD_XLC,SMD_XLR,VIRTUAL,NL,NLP,NLM,SMDBOX_THIRD);
return Lists.newArrayList(AUTO, SMD_DUO, SMD_PCB_DUO);
}
}
......@@ -198,7 +198,12 @@ public class Storage extends BasePo implements Serializable {
public boolean isSmdDuo() {
return DeviceType.SMD_DUO.name().equals(type);
}
/**
* 是否是Duo料仓
*/
public boolean isSmdPcbDuo() {
return DeviceType.SMD_PCB_DUO.name().equals(type);
}
public boolean isXLC() {
return DeviceType.SMD_XLC.name().equals(type);
}
......
......@@ -31,4 +31,13 @@ public class Humiture extends BasePo implements Serializable {
*/
private String humidity;
/**
* 温度2
*/
public String temperature2="" ;
/**
* 湿度2
*/
public String humidity2="" ;
}
......@@ -30,8 +30,11 @@ public class Micron1551Menu {
MenuInit.addMenu(menuLabel,mL5,120, "ML5S Input","ml5sInput", "ml5s/input/index","dispatch");
MenuInit.addMenu(menuLabel,mL5,121, "ML5S Ouput","ml5sOutput", "ml5s/output/index","dispatch");
MenuInit.addMenu(menuLabel,mL5,122, "X800","X800", "x800kanban/index","X800");
MenuInit.addMenu(menuLabel,mL5, 131, "ML5O STATUS", "ml5odispatch", "ml5s/ml5odispatch/index","dispatchSelection");
MenuInit.addMenu(menuLabel,null, 131, "ML5O STATUS", "ml5odispatch", "ml5s/ml5odispatch/index","dispatchSelection");
MenuInit.addMenu(menuLabel,null,141, "SBD1","SBD1", "multipleSilos/index","SBD1");
MenuInit.addMenu(menuLabel,null,142, "SBD2","SBD2", "multipleSilos/index","SBD2");
MenuInit.addMenu(menuLabel,null,143, "SBDH","SBDH", "multipleSilos/index","SBDH");
MenuInit.addMenu(menuLabel,null,151, "X800","X800", "x800kanban/index","X800");
// MenuInit.addMenu(menuLabel,mL5,132, "ML5S STORAGE","ML5Loading", "mlFive/LoadingSelect/index","loadingSelection");
// MenuInit.addMenu(menuLabel,mL5,133, "DISPATCH STATUS", "dispatchStatus", "mlFive/dispatchStatus/index","dispatchStatus");
// MenuInit.addMenu(menuLabel,mL5,134,"LOADING STATUS","loadingStatus", "mlFive/loadingStatus/index","loadingStatus");
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!