package com.mes.service.CacheGlassService;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.stereotype.Service;
|
|
import com.mes.common.PlcTools.S7control;
|
import com.mes.entity.GlassInfo;
|
import com.mes.mapper.SelectInfo;
|
|
|
@Service
|
public class Logic {
|
@Autowired
|
private SelectInfo selectInfo;
|
//识别逻辑
|
public void identify(String Number){
|
//查询任务
|
// PlcParameterObject plcmes=PLCAutoMes.PlcMesObject;
|
// S7control.getinstance().WriteWord(plcmes.getPlcParameter("MESToGaStatus").getAddress(),(short) 1);
|
boolean isexist=isExist(Number);
|
if (isexist) {
|
//存在逻辑 1.添加信息 2.回复PLC存在
|
//S7control.getinstance().WriteWord(plcmes.getPlcParameter("MESToGaStatus").getAddress(),(short) 1);
|
}else {
|
//不存在逻辑 1.回复PLC不存在
|
//S7control.getinstance().WriteWord(plcmes.getPlcParameter("MESToGaStatus").getAddress(),(short) 2);
|
}
|
}
|
//理片 进
|
public void process(String Number){
|
//查询消息队列里的玻璃
|
|
//返回结果
|
}
|
//理片 出
|
public void processOut(String Number){
|
//查询任务
|
|
//返回结果
|
}
|
//磨边
|
public void processMb(String Number){
|
//查询任务
|
|
//返回结果
|
}
|
|
//查询消息队列里此玻璃ID的数据
|
public boolean SelectMessageId(String Number){
|
//查询是否存在
|
GlassInfo GlassInfo=selectInfo.SelectGlassId(Number);
|
if(GlassInfo==null){
|
return false;//返回 不存在
|
}
|
return true;//返回 存在
|
}
|
//删除消息队列里此玻璃ID的数据
|
public boolean DeleteMessageId(String Number){
|
//查询是否存在
|
GlassInfo GlassInfo=selectInfo.SelectGlassId(Number);
|
if(GlassInfo==null){
|
return false;//返回 不存在
|
}
|
return true;//返回 存在
|
}
|
//是否存在此编号玻璃
|
public boolean isExist(String Number){
|
//查询是否存在
|
GlassInfo GlassInfo=selectInfo.SelectGlassId(Number);
|
if(GlassInfo==null){
|
return false;//返回 不存在
|
}
|
return true;//返回 存在
|
}
|
|
}
|