This commit is contained in:
李广豪 2022-07-09 22:03:31 +08:00
commit 591716ebc8
3 changed files with 15 additions and 10 deletions

View File

@ -60,4 +60,10 @@ public class VehicleVo extends BaseVo implements PageVo.ConvertVo{
*/ */
@ApiModelProperty(value = "描述信息", example = "1") @ApiModelProperty(value = "描述信息", example = "1")
private String description; private String description;
/**
* 描述信息
*/
@ApiModelProperty(value = "车辆状态0-空闲1-占用", example = "1")
private Integer status;
} }

View File

@ -121,6 +121,7 @@ public class CurrTaskServiceImpl extends BaseService implements CurrTaskService
public R<PageVo<CurrTaskQueryVo>> currentTaskPage(CurrTaskQueryParam param) { public R<PageVo<CurrTaskQueryVo>> currentTaskPage(CurrTaskQueryParam param) {
QueryWrapper<CurrTask> currTaskQueryWrapper = new QueryWrapper<>(); QueryWrapper<CurrTask> currTaskQueryWrapper = new QueryWrapper<>();
currTaskQueryWrapper.eq(CurrTask.VALID, 1); currTaskQueryWrapper.eq(CurrTask.VALID, 1);
currTaskQueryWrapper.in(CurrTask.STATUS,0,1);
Page<CurrTask> page = currTaskServiceBiz.page(new Page<>(param.getCurrent(), param.getSize()), currTaskQueryWrapper); Page<CurrTask> page = currTaskServiceBiz.page(new Page<>(param.getCurrent(), param.getSize()), currTaskQueryWrapper);
return successful(new PageVo<>(page, CurrTaskQueryVo.class)); return successful(new PageVo<>(page, CurrTaskQueryVo.class));
} }

View File

@ -77,7 +77,7 @@ public class ScheduledTask extends BaseService {
@Test @Test
public void test() throws IOException { public void test() throws IOException {
} }
@Scheduled(fixedDelay = 1000*60) //@Scheduled(fixedDelay = 1000*60)
public void testWebsocket() throws IOException { public void testWebsocket() throws IOException {
//查询出正在进炉加工的curr_task,查询对应炉号是否Working,查询计划时间剩余时间查询标识卡详情 //查询出正在进炉加工的curr_task,查询对应炉号是否Working,查询计划时间剩余时间查询标识卡详情
List<CurrTask> currTaskList = currTaskServiceBiz.list(new QueryWrapper<CurrTask>().eq(CurrTask.IS_IN, 1)); List<CurrTask> currTaskList = currTaskServiceBiz.list(new QueryWrapper<CurrTask>().eq(CurrTask.IS_IN, 1));
@ -123,7 +123,7 @@ public class ScheduledTask extends BaseService {
/** /**
* 正在加工的加工任务详情 * 正在加工的加工任务详情
*/ */
//@Scheduled(fixedDelay = 1000*60) @Scheduled(fixedDelay = 1000*60)
public void screen() throws IOException { public void screen() throws IOException {
//查询出正在进炉加工的curr_task,查询对应炉号是否Working,查询计划时间剩余时间查询标识卡详情 //查询出正在进炉加工的curr_task,查询对应炉号是否Working,查询计划时间剩余时间查询标识卡详情
List<CurrTask> currTaskList = currTaskServiceBiz.list(new QueryWrapper<CurrTask>().eq(CurrTask.IS_IN, 1)); List<CurrTask> currTaskList = currTaskServiceBiz.list(new QueryWrapper<CurrTask>().eq(CurrTask.IS_IN, 1));
@ -179,7 +179,7 @@ public class ScheduledTask extends BaseService {
/** /**
* 查询加工完成的窑炉 * 查询加工完成的窑炉
*/ */
//@Scheduled(fixedDelay = 1000*60*2) @Scheduled(fixedDelay = 1000*60*2)
public void taskForStockToKiln() throws IOException { public void taskForStockToKiln() throws IOException {
//两辆车是否都空闲只有两辆车都空闲才被允许做任务 //两辆车是否都空闲只有两辆车都空闲才被允许做任务
List<VehicleInfo> vehicleInfoList = vehicleInfoServiceBiz.list(new QueryWrapper<VehicleInfo>().eq(VehicleInfo.STATUS, 0)); List<VehicleInfo> vehicleInfoList = vehicleInfoServiceBiz.list(new QueryWrapper<VehicleInfo>().eq(VehicleInfo.STATUS, 0));
@ -212,7 +212,7 @@ public class ScheduledTask extends BaseService {
} }
//查询出正在加工的窑炉遍历根据采集频率的不同采集高频数据能源消耗暂定30秒 //查询出正在加工的窑炉遍历根据采集频率的不同采集高频数据能源消耗暂定30秒
//@Scheduled(fixedDelay = 1000*30) @Scheduled(fixedDelay = 1000*30)
public void getFastValue(){ public void getFastValue(){
logger.info("==采集高频能耗数据开始=="); logger.info("==采集高频能耗数据开始==");
//加工炉列表 //加工炉列表
@ -307,7 +307,7 @@ public class ScheduledTask extends BaseService {
} }
//查询出正在加工的窑炉遍历根据采集频率的不同采集低频数据能源消耗暂定3分钟一次 //查询出正在加工的窑炉遍历根据采集频率的不同采集低频数据能源消耗暂定3分钟一次
//@Scheduled(fixedDelay = 1000*60*3) @Scheduled(fixedDelay = 1000*60*3)
public void getSlowValue(){ public void getSlowValue(){
logger.info("==开始采集低频数据=="); logger.info("==开始采集低频数据==");
List<KilnInfo> kilnInfoList = kilnInfoServiceBiz.list(); List<KilnInfo> kilnInfoList = kilnInfoServiceBiz.list();
@ -455,7 +455,7 @@ public class ScheduledTask extends BaseService {
//遍历窑炉空窑炉查询缓存区是否有等待加工的任务 //遍历窑炉空窑炉查询缓存区是否有等待加工的任务
//待加工任务存在且没有状态为正在进炉的情况下按照先进先出的规则选择待加工任务呼叫车辆进炉 //待加工任务存在且没有状态为正在进炉的情况下按照先进先出的规则选择待加工任务呼叫车辆进炉
//@Scheduled(fixedDelay = 1000*60) @Scheduled(fixedDelay = 1000*60)
public void runTaskForEmptyKiln() throws IOException { public void runTaskForEmptyKiln() throws IOException {
List<KilnInfo> kilnInfoList = kilnInfoServiceBiz.list(new QueryWrapper<KilnInfo>() List<KilnInfo> kilnInfoList = kilnInfoServiceBiz.list(new QueryWrapper<KilnInfo>()
.eq(KilnInfo.VALID, 1).eq(KilnInfo.STATUS, 0).orderByAsc(KilnInfo.TYPE)); .eq(KilnInfo.VALID, 1).eq(KilnInfo.STATUS, 0).orderByAsc(KilnInfo.TYPE));
@ -506,7 +506,7 @@ public class ScheduledTask extends BaseService {
} }
//遍历正在工作炉子的报警变量记录报警 //遍历正在工作炉子的报警变量记录报警
//@Scheduled(fixedDelay = 1000*60) @Scheduled(fixedDelay = 1000*60)
public void listenKilnAlarm(){ public void listenKilnAlarm(){
List<KilnInfo> kilnInfoList = kilnInfoServiceBiz.list(); List<KilnInfo> kilnInfoList = kilnInfoServiceBiz.list();
logger.info("==开始查询炉子是否有报警=="); logger.info("==开始查询炉子是否有报警==");
@ -626,7 +626,6 @@ public class ScheduledTask extends BaseService {
String result = readPlcToString(nameSpaceNote, "AllowIn"); String result = readPlcToString(nameSpaceNote, "AllowIn");
return Boolean.valueOf(JSONObject.parseObject(result).get("result").toString()); return Boolean.valueOf(JSONObject.parseObject(result).get("result").toString());
} }
private Boolean kilnReadyIn(Long kilnId){ private Boolean kilnReadyIn(Long kilnId){
PlcNameSpace nameSpace = plcNameSpaceServiceBiz.getOne(new QueryWrapper<PlcNameSpace>() PlcNameSpace nameSpace = plcNameSpaceServiceBiz.getOne(new QueryWrapper<PlcNameSpace>()
.eq(PlcNameSpace.EQ_TYPE, 0) .eq(PlcNameSpace.EQ_TYPE, 0)
@ -636,7 +635,6 @@ public class ScheduledTask extends BaseService {
String result = readPlcToString(nameSpaceNote, "ReadyIn"); String result = readPlcToString(nameSpaceNote, "ReadyIn");
return Boolean.valueOf(JSONObject.parseObject(result).get("result").toString()); return Boolean.valueOf(JSONObject.parseObject(result).get("result").toString());
} }
private Boolean kilnWorking(Long kilnId){ private Boolean kilnWorking(Long kilnId){
PlcNameSpace nameSpace = plcNameSpaceServiceBiz.getOne(new QueryWrapper<PlcNameSpace>() PlcNameSpace nameSpace = plcNameSpaceServiceBiz.getOne(new QueryWrapper<PlcNameSpace>()
.eq(PlcNameSpace.EQ_TYPE, 0) .eq(PlcNameSpace.EQ_TYPE, 0)