This commit is contained in:
李广豪 2022-07-07 16:11:55 +08:00
commit 4133285cdd
2 changed files with 10 additions and 7 deletions

View File

@ -128,10 +128,11 @@ public class AsynRunTaskService extends BaseService {
Long startPoint = pointInfoServiceBiz.getOne(new QueryWrapper<PointInfo>().eq(PointInfo.NOTE, runTask.getStartPosition())).getCode(); Long startPoint = pointInfoServiceBiz.getOne(new QueryWrapper<PointInfo>().eq(PointInfo.NOTE, runTask.getStartPosition())).getCode();
Long endPoint = pointInfoServiceBiz.getOne(new QueryWrapper<PointInfo>().eq(PointInfo.NOTE, runTask.getEndPosition())).getCode(); Long endPoint = pointInfoServiceBiz.getOne(new QueryWrapper<PointInfo>().eq(PointInfo.NOTE, runTask.getEndPosition())).getCode();
Integer status = sendTaskToRgv(vehicleId, currTaskId, startPoint, endPoint, currTask.getPlcValue()); Integer status = sendTaskToRgv(vehicleId, currTaskId, startPoint, endPoint, currTask.getPlcValue());
logger.info(String.valueOf(status));
//执行成功,托盘进炉 //执行成功,托盘进炉
if (status==1){ if (status==1){
//开始记录能源消耗 // TODO: 2022/7/7 开始记录能源消耗
asynStartRecordConsume(currTaskId,currTask.getKilnId()); //asynStartRecordConsume(currTaskId,currTask.getKilnId());
logger.info("===执行任务:"+currTaskId+" ,车辆搬运任务,车辆:"+vehicleId+" ,起点:"+startPoint+" ,终点:"+endPoint+"任务执行成功==="); logger.info("===执行任务:"+currTaskId+" ,车辆搬运任务,车辆:"+vehicleId+" ,起点:"+startPoint+" ,终点:"+endPoint+"任务执行成功===");
//更新调度表状态为完成 //更新调度表状态为完成
runTask.setUpdateTime(LocalDateTime.now()); runTask.setUpdateTime(LocalDateTime.now());
@ -215,7 +216,8 @@ public class AsynRunTaskService extends BaseService {
Integer status = sendTaskToRgv(vehicleId, currTaskId, startPoint, endPoint, currTask.getPlcValue()); Integer status = sendTaskToRgv(vehicleId, currTaskId, startPoint, endPoint, currTask.getPlcValue());
//执行成功,托盘进炉 //执行成功,托盘进炉
if (status==1){ if (status==1){
asynStartRecordConsume(currTaskId,currTask.getKilnId()); // TODO: 2022/7/7
//asynStartRecordConsume(currTaskId,currTask.getKilnId());
logger.info("===执行任务:"+currTaskId+" ,车辆搬运任务,车辆:"+vehicleId+" ,起点:"+startPoint+" ,终点:"+endPoint+"任务执行成功==="); logger.info("===执行任务:"+currTaskId+" ,车辆搬运任务,车辆:"+vehicleId+" ,起点:"+startPoint+" ,终点:"+endPoint+"任务执行成功===");
//更新调度表状态为完成 //更新调度表状态为完成
runTask.setUpdateTime(LocalDateTime.now()); runTask.setUpdateTime(LocalDateTime.now());
@ -413,8 +415,9 @@ public class AsynRunTaskService extends BaseService {
Long endPoint = pointInfoServiceBiz.getOne(new QueryWrapper<PointInfo>().eq(PointInfo.NOTE, runTask.getEndPosition())).getCode(); Long endPoint = pointInfoServiceBiz.getOne(new QueryWrapper<PointInfo>().eq(PointInfo.NOTE, runTask.getEndPosition())).getCode();
Integer status = sendTaskToRgv(vehicleId, currTaskId, startPoint, endPoint, currTask.getPlcValue()); Integer status = sendTaskToRgv(vehicleId, currTaskId, startPoint, endPoint, currTask.getPlcValue());
if (status==1){ if (status==1){
//加工完成记录结束时能源消耗
asynEndRecordConsume(currTaskId,currTask.getKilnId()); // TODO: 2022/7/7 加工完成记录结束时能源消耗
//asynEndRecordConsume(currTaskId,currTask.getKilnId());
logger.info("===执行任务:"+currTaskId+" ,车辆搬运任务,车辆:"+vehicleId+" ,起点:"+startPoint+" ,终点:"+endPoint+"任务执行成功==="); logger.info("===执行任务:"+currTaskId+" ,车辆搬运任务,车辆:"+vehicleId+" ,起点:"+startPoint+" ,终点:"+endPoint+"任务执行成功===");
//更新关系表状态为完成 //更新关系表状态为完成
runTask.setUpdateTime(LocalDateTime.now()); runTask.setUpdateTime(LocalDateTime.now());

View File

@ -179,7 +179,7 @@ public class ScheduledTask extends BaseService {
/** /**
* 查询加工完成的窑炉 * 查询加工完成的窑炉
*/ */
//@Scheduled(fixedDelay = 1000*60*3) @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));
@ -195,7 +195,7 @@ public class ScheduledTask extends BaseService {
Long kilnId = currTask.getKilnId(); Long kilnId = currTask.getKilnId();
KilnInfo kilnInfo = kilnInfoServiceBiz.getById(kilnId); KilnInfo kilnInfo = kilnInfoServiceBiz.getById(kilnId);
PlcNameSpace plcNameSpace = plcNameSpaceServiceBiz.getOne(new QueryWrapper<PlcNameSpace>() PlcNameSpace plcNameSpace = plcNameSpaceServiceBiz.getOne(new QueryWrapper<PlcNameSpace>()
.eq(PlcNameSpace.EQ_TYPE, 1) .eq(PlcNameSpace.EQ_TYPE, 0)
.eq(PlcNameSpace.TYPE, 0) .eq(PlcNameSpace.TYPE, 0)
.eq(PlcNameSpace.EQ_ID,kilnId)); .eq(PlcNameSpace.EQ_ID,kilnId));
//通过允许出炉信号来判定是否加工完成 //通过允许出炉信号来判定是否加工完成