加工炉识别到ReadyIn就开始发任务
This commit is contained in:
parent
835b98e486
commit
4867a5cc26
@ -123,7 +123,7 @@ public class ScheduledTask extends BaseService {
|
||||
/**
|
||||
* 正在加工的加工任务详情
|
||||
*/
|
||||
@Scheduled(fixedDelay = 1000*60)
|
||||
//@Scheduled(fixedDelay = 1000*60)
|
||||
public void screen() throws IOException {
|
||||
//查询出正在进炉加工的curr_task,查询对应炉号是否Working,查询计划时间,剩余时间,查询标识卡详情
|
||||
List<CurrTask> currTaskList = currTaskServiceBiz.list(new QueryWrapper<CurrTask>().eq(CurrTask.IS_IN, 1));
|
||||
@ -212,7 +212,7 @@ public class ScheduledTask extends BaseService {
|
||||
}
|
||||
|
||||
//查询出正在加工的窑炉,遍历,根据采集频率的不同,采集高频数据能源消耗。暂定30秒
|
||||
@Scheduled(fixedDelay = 1000*30)
|
||||
//@Scheduled(fixedDelay = 1000*30)
|
||||
public void getFastValue(){
|
||||
logger.info("==采集高频能耗数据开始==");
|
||||
//加工炉列表
|
||||
@ -307,7 +307,7 @@ public class ScheduledTask extends BaseService {
|
||||
}
|
||||
|
||||
//查询出正在加工的窑炉,遍历,根据采集频率的不同,采集低频数据能源消耗。暂定3分钟一次
|
||||
@Scheduled(fixedDelay = 1000*60*3)
|
||||
//@Scheduled(fixedDelay = 1000*60*3)
|
||||
public void getSlowValue(){
|
||||
logger.info("==开始采集低频数据==");
|
||||
List<KilnInfo> kilnInfoList = kilnInfoServiceBiz.list();
|
||||
@ -458,7 +458,7 @@ public class ScheduledTask extends BaseService {
|
||||
//@Scheduled(fixedDelay = 1000*60)
|
||||
public void runTaskForEmptyKiln() throws IOException {
|
||||
List<KilnInfo> kilnInfoList = kilnInfoServiceBiz.list(new QueryWrapper<KilnInfo>()
|
||||
.eq(KilnInfo.VALID, 1).eq(KilnInfo.STATUS, 0));
|
||||
.eq(KilnInfo.VALID, 1).eq(KilnInfo.STATUS, 0).orderByAsc(KilnInfo.TYPE));
|
||||
// 呼叫车辆运送货物给炉子
|
||||
//存在空闲窑炉
|
||||
if (kilnInfoList.size()!=0) {
|
||||
@ -469,9 +469,13 @@ public class ScheduledTask extends BaseService {
|
||||
if (vehicleInfos.size()>0){
|
||||
return;
|
||||
}
|
||||
Boolean kilnReadyIn=false;
|
||||
if (kilnInfo.getType()==1){
|
||||
kilnReadyIn = kilnReadyIn(kilnInfo.getId());
|
||||
}
|
||||
//查询炉子是否allowIn
|
||||
Boolean kilnAllowIn = kilnAllowIn(kilnInfo.getId());
|
||||
if (kilnAllowIn){
|
||||
if (kilnReadyIn||kilnAllowIn){
|
||||
//缓存区是否有目标位置为窑炉的待加工任务
|
||||
List<InStockInfo> inStockInfoList = inStockInfoServiceBiz.list(new QueryWrapper<InStockInfo>()
|
||||
.eq(InStockInfo.TYPE, 1)
|
||||
@ -502,7 +506,7 @@ public class ScheduledTask extends BaseService {
|
||||
}
|
||||
|
||||
//遍历正在工作炉子的报警变量,记录报警
|
||||
@Scheduled(fixedDelay = 1000*60)
|
||||
//@Scheduled(fixedDelay = 1000*60)
|
||||
public void listenKilnAlarm(){
|
||||
List<KilnInfo> kilnInfoList = kilnInfoServiceBiz.list();
|
||||
logger.info("==开始查询炉子是否有报警==");
|
||||
@ -623,6 +627,16 @@ public class ScheduledTask extends BaseService {
|
||||
return Boolean.valueOf(JSONObject.parseObject(result).get("result").toString());
|
||||
}
|
||||
|
||||
private Boolean kilnReadyIn(Long kilnId){
|
||||
PlcNameSpace nameSpace = plcNameSpaceServiceBiz.getOne(new QueryWrapper<PlcNameSpace>()
|
||||
.eq(PlcNameSpace.EQ_TYPE, 0)
|
||||
.eq(PlcNameSpace.EQ_ID, kilnId)
|
||||
.eq(PlcNameSpace.TYPE,0));
|
||||
String nameSpaceNote = nameSpace.getName();
|
||||
String result = readPlcToString(nameSpaceNote, "ReadyIn");
|
||||
return Boolean.valueOf(JSONObject.parseObject(result).get("result").toString());
|
||||
}
|
||||
|
||||
private Boolean kilnWorking(Long kilnId){
|
||||
PlcNameSpace nameSpace = plcNameSpaceServiceBiz.getOne(new QueryWrapper<PlcNameSpace>()
|
||||
.eq(PlcNameSpace.EQ_TYPE, 0)
|
||||
|
Loading…
Reference in New Issue
Block a user