This commit is contained in:
lgh 2022-12-27 18:01:05 +08:00
parent 21a4cfab23
commit 395817f10e
5 changed files with 49 additions and 17 deletions

View File

@ -614,6 +614,7 @@ public class EnergyController extends BaseController {
carbonActVo.setValue(parGasValue.getActualNitPotValue()); carbonActVo.setValue(parGasValue.getActualNitPotValue());
carbonActVo.setUnit("%"); carbonActVo.setUnit("%");
carbonActVo.setName("碳/氮势"); carbonActVo.setName("碳/氮势");
carbonActVo.setTime(parGasValue.getCreateTime());
carbonActVo.setCode(currTask.getStoveCode()); carbonActVo.setCode(currTask.getStoveCode());
carbon.add(carbonActVo); carbon.add(carbonActVo);
@ -680,6 +681,7 @@ public class EnergyController extends BaseController {
carbonActVo.setValue(parGasValue.getActualNitPotValue()); carbonActVo.setValue(parGasValue.getActualNitPotValue());
carbonActVo.setUnit("%"); carbonActVo.setUnit("%");
carbonActVo.setName("碳/氮势"); carbonActVo.setName("碳/氮势");
carbonActVo.setTime(parGasValue.getCreateTime());
carbonActVo.setCode(currTask.getStoveCode()); carbonActVo.setCode(currTask.getStoveCode());
carbon.add(carbonActVo); carbon.add(carbonActVo);

View File

@ -79,6 +79,10 @@ public class CurrTaskServiceImpl extends BaseService implements CurrTaskService
CurrTaskDetServiceBiz currTaskDetServiceBiz; CurrTaskDetServiceBiz currTaskDetServiceBiz;
@Autowired @Autowired
InStockInfoServiceBiz inStockInfoServiceBiz; InStockInfoServiceBiz inStockInfoServiceBiz;
@Autowired
TaskDetHisServiceBiz taskDetHisServiceBiz;
@Autowired
TaskHisServiceBiz taskHisServiceBiz;
private Logger logger = LoggerFactory.getLogger(getClass()); private Logger logger = LoggerFactory.getLogger(getClass());
@Override @Override
@ -456,12 +460,23 @@ public class CurrTaskServiceImpl extends BaseService implements CurrTaskService
locationServiceBiz.updateById(location); locationServiceBiz.updateById(location);
//删除库位缓存 //删除库位缓存
inStockInfoServiceBiz.removeById(inStockInfo); inStockInfoServiceBiz.removeById(inStockInfo);
} }
currTask.setStatus(1); currTask.setStatus(1);
currTask.setCreatorId(99); currTask.setCreatorId(99);
currTask.setBeginTime(LocalDateTime.now()); currTask.setBeginTime(LocalDateTime.now());
currTaskServiceBiz.updateById(currTask); currTaskServiceBiz.updateById(currTask);
logger.info("修改任务" + currTask.getId() + "状态为加工完成成功"); logger.info("修改任务" + currTask.getId() + "状态为加工完成成功");
//存入历史任务表以便查询能源消耗
TaskHis taskHis = new TaskHis();
org.springframework.beans.BeanUtils.copyProperties(currTask, taskHis);
taskHis.setStatus(2);
taskHis.setIsIn(2);
taskHis.setTaskId(currTask.getId());
taskHisServiceBiz.save(taskHis);
List<CurrTaskDet> currTaskDets = currTaskDetServiceBiz.list(new QueryWrapper<CurrTaskDet>().eq(CurrTaskDet.CURR_TASK_ID, currTask.getId()));
List<TaskDetHis> taskDetHisList = com.mt.wms.core.utils.BeanUtils.copyList(currTaskDets, TaskDetHis.class);
taskDetHisServiceBiz.saveBatch(taskDetHisList);
} }
currTask.setStatus(status); currTask.setStatus(status);
currTask.setCreatorId(99); currTask.setCreatorId(99);
@ -687,6 +702,9 @@ public class CurrTaskServiceImpl extends BaseService implements CurrTaskService
if (currTask.getStatus() != 0) { if (currTask.getStatus() != 0) {
return R.failed("该任务状态不为未执行,无法执行!"); return R.failed("该任务状态不为未执行,无法执行!");
} }
if (currTask.getCacheSatatus()==2||currTask.getIsCache()==1){
return R.failed("该任务已在缓存队列,状态不为未执行,无法执行!");
}
//是否为自动任务 //是否为自动任务
if (currTask.getIsAuto() == 1) { if (currTask.getIsAuto() == 1) {
List<AutoExeTask> exeTaskList = autoExeTaskServiceBiz.list(new QueryWrapper<AutoExeTask>().eq(AutoExeTask.F_TASK_ID, taskId)); List<AutoExeTask> exeTaskList = autoExeTaskServiceBiz.list(new QueryWrapper<AutoExeTask>().eq(AutoExeTask.F_TASK_ID, taskId));
@ -820,7 +838,11 @@ public class CurrTaskServiceImpl extends BaseService implements CurrTaskService
*/ */
private Boolean apmsEndProcess(CurrTask currTask) { private Boolean apmsEndProcess(CurrTask currTask) {
ApmsEndProcess apmsEndProcess = new ApmsEndProcess(); ApmsEndProcess apmsEndProcess = new ApmsEndProcess();
apmsEndProcess.setEndTime(currTask.getEndTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); LocalDateTime date=LocalDateTime.now();
if (currTask.getEndTime()!=null){
date=currTask.getEndTime();
}
apmsEndProcess.setEndTime(date.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
apmsEndProcess.setEndUser("QJJP03"); apmsEndProcess.setEndUser("QJJP03");
apmsEndProcess.setSheetNo(currTask.getSheetNo()); apmsEndProcess.setSheetNo(currTask.getSheetNo());
R<ApmsEndProcessVo> apmsEndProcessVoR = apmsControl.endProcess(apmsEndProcess); R<ApmsEndProcessVo> apmsEndProcessVoR = apmsControl.endProcess(apmsEndProcess);

View File

@ -507,15 +507,15 @@ public class AsynRunTaskService extends BaseService {
//两辆小车是否冲突 //两辆小车是否冲突
Boolean conflictBoolean = taskDistanceUtils.conflictForVehicle(vehicleId, kilnInfo.getCode(), yeyaTaiCode, rgv2CurrPosition); Boolean conflictBoolean = taskDistanceUtils.conflictForVehicle(vehicleId, kilnInfo.getCode(), yeyaTaiCode, rgv2CurrPosition);
if (conflictBoolean) { if (conflictBoolean) {
Integer status = moveRgv(2, 1L, 2, 0); Integer status = moveRgv(2, 1L, 1, 0);
logger.info(status.toString()); logger.info(status.toString());
if (status != 1) { if (status != 1) {
logger.info("===执行出库任务时车辆位置冲突,执行车辆位移任务,车辆" + anotherVehicleId + "移动到点位2,执行失败==="); logger.info("===执行出库任务时车辆位置冲突,执行车辆位移任务,车辆" + anotherVehicleId + "移动到点位1,执行失败===");
// 2022/3/6 websocket通知页面 // 2022/3/6 websocket通知页面
webSocketServer.sendtoAll(LocalDateTime.now() + "执行出库任务时车辆位置冲突,执行车辆位移任务,车辆" + anotherVehicleId + "移动到点位2执行失败"); webSocketServer.sendtoAll(LocalDateTime.now() + "执行出库任务时车辆位置冲突,执行车辆位移任务,车辆" + anotherVehicleId + "移动到点位2执行失败");
} else { } else {
logger.info("===执行任务出库任务时车辆位置冲突,执行车辆位移任务,车辆" + anotherVehicleId + "移动到点位2,执行成功==="); logger.info("===执行任务出库任务时车辆位置冲突,执行车辆位移任务,车辆" + anotherVehicleId + "移动到点位1,执行成功===");
} }
} }
} else { } else {
@ -606,14 +606,14 @@ public class AsynRunTaskService extends BaseService {
//两辆小车是否冲突 //两辆小车是否冲突
Boolean conflictBoolean = taskDistanceUtils.conflictForVehicle(vehicleId, location.getCode(), yeyaTaiCode, rgv2CurrPosition); Boolean conflictBoolean = taskDistanceUtils.conflictForVehicle(vehicleId, location.getCode(), yeyaTaiCode, rgv2CurrPosition);
if (conflictBoolean) { if (conflictBoolean) {
Integer status = moveRgv(2, 1L, 2, 0); Integer status = moveRgv(2, 1L, 1, 0);
if (status != 1) { if (status != 1) {
logger.info("===执行出库任务时车辆位置冲突,执行车辆位移任务,车辆" + vehicleId + "移动到点位39,执行失败==="); logger.info("===执行出库任务时车辆位置冲突,执行车辆位移任务,车辆" + vehicleId + "移动到点位1,执行失败===");
// 2022/3/6 websocket通知页面 // 2022/3/6 websocket通知页面
webSocketServer.sendtoAll(LocalDateTime.now() + "执行出库任务时车辆位置冲突,执行车辆位移任务,车辆" + vehicleId + "移动到点位39执行失败"); webSocketServer.sendtoAll(LocalDateTime.now() + "执行出库任务时车辆位置冲突,执行车辆位移任务,车辆" + vehicleId + "移动到点位39执行失败");
return; return;
} }
logger.info("===执行任务出库任务时车辆位置冲突,执行车辆位移任务,车辆" + vehicleId + "移动到点位39,执行成功==="); logger.info("===执行任务出库任务时车辆位置冲突,执行车辆位移任务,车辆" + vehicleId + "移动到点位1,执行成功===");
} }
} else { } else {
logger.info("RGV2不在线跳过检测是否避让。"); logger.info("RGV2不在线跳过检测是否避让。");
@ -629,12 +629,12 @@ public class AsynRunTaskService extends BaseService {
if (conflictBoolean) { if (conflictBoolean) {
Integer status = moveRgv(1, 1L, 12, 0); Integer status = moveRgv(1, 1L, 12, 0);
if (status != 1) { if (status != 1) {
logger.info("===执行任务出库任务时车辆位置冲突,执行车辆位移任务,车辆" + vehicleId + "移动到点位1,执行失败==="); logger.info("===执行任务出库任务时车辆位置冲突,执行车辆位移任务,车辆" + vehicleId + "移动到点位12,执行失败===");
// 2022/3/6 websocket通知页面 // 2022/3/6 websocket通知页面
webSocketServer.sendtoAll(LocalDateTime.now() + "执行出库任务时车辆位置冲突,执行车辆位移任务,车辆" + vehicleId + "移动到点位1执行失败"); webSocketServer.sendtoAll(LocalDateTime.now() + "执行出库任务时车辆位置冲突,执行车辆位移任务,车辆" + vehicleId + "移动到点位1执行失败");
return; return;
} }
logger.info("===执行任务出库任务时车辆位置冲突,执行车辆位移任务,车辆" + vehicleId + "移动到点位1,执行成功==="); logger.info("===执行任务出库任务时车辆位置冲突,执行车辆位移任务,车辆" + vehicleId + "移动到点位12,执行成功===");
} }
} else { } else {
logger.info("RGV1不在线跳过检测是否避让。"); logger.info("RGV1不在线跳过检测是否避让。");
@ -1331,8 +1331,12 @@ public class AsynRunTaskService extends BaseService {
* @return * @return
*/ */
private Boolean apmsEndProcess(CurrTask currTask) { private Boolean apmsEndProcess(CurrTask currTask) {
LocalDateTime date=LocalDateTime.now();
if (currTask.getEndTime()!=null){
date=currTask.getEndTime();
}
ApmsEndProcess apmsEndProcess = new ApmsEndProcess(); ApmsEndProcess apmsEndProcess = new ApmsEndProcess();
apmsEndProcess.setEndTime(currTask.getEndTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); apmsEndProcess.setEndTime(date.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
apmsEndProcess.setEndUser("QJJP03"); apmsEndProcess.setEndUser("QJJP03");
apmsEndProcess.setSheetNo(currTask.getSheetNo()); apmsEndProcess.setSheetNo(currTask.getSheetNo());
R<ApmsEndProcessVo> apmsEndProcessVoR = apmsController.endProcess(apmsEndProcess); R<ApmsEndProcessVo> apmsEndProcessVoR = apmsController.endProcess(apmsEndProcess);
@ -1424,13 +1428,13 @@ public class AsynRunTaskService extends BaseService {
//两辆小车是否冲突 //两辆小车是否冲突
Boolean conflictBoolean = taskDistanceUtils.conflictForVehicle(vehicleId, startPosition, targetPosition, rgv2CurrPosition); Boolean conflictBoolean = taskDistanceUtils.conflictForVehicle(vehicleId, startPosition, targetPosition, rgv2CurrPosition);
if (conflictBoolean) { if (conflictBoolean) {
Integer status = moveRgv(2, currTaskId, 2, 0); Integer status = moveRgv(2, currTaskId, 1, 0);
logger.info(status.toString()); logger.info(status.toString());
if (status != 1) { if (status != 1) {
logger.info("===执行任务:" + currTask.getTaskCode() + " 时车辆位置冲突,执行车辆位移任务,车辆" + anotherVehicleId + "移动到点位2,执行失败==="); logger.info("===执行任务:" + currTask.getTaskCode() + " 时车辆位置冲突,执行车辆位移任务,车辆" + anotherVehicleId + "移动到点位1,执行失败===");
webSocketServer.sendtoAll(LocalDateTime.now() + "执行任务:" + currTask.getTaskCode() + " 时车辆位置冲突,执行车辆位移任务,车辆" + anotherVehicleId + "移动到点位2执行失败"); webSocketServer.sendtoAll(LocalDateTime.now() + "执行任务:" + currTask.getTaskCode() + " 时车辆位置冲突,执行车辆位移任务,车辆" + anotherVehicleId + "移动到点位2执行失败");
} else { } else {
logger.info("===执行任务:" + currTaskId + " 时车辆位置冲突,执行车辆位移任务,车辆" + anotherVehicleId + "移动到点位2,执行成功==="); logger.info("===执行任务:" + currTaskId + " 时车辆位置冲突,执行车辆位移任务,车辆" + anotherVehicleId + "移动到点位1,执行成功===");
} }
} }
} else { } else {

View File

@ -897,8 +897,12 @@ public class ScheduledTask extends BaseService {
* @return * @return
*/ */
private Boolean apmsEndProcess(CurrTask currTask) { private Boolean apmsEndProcess(CurrTask currTask) {
LocalDateTime date=LocalDateTime.now();
if (currTask.getEndTime()!=null){
date=currTask.getEndTime();
}
ApmsEndProcess apmsEndProcess = new ApmsEndProcess(); ApmsEndProcess apmsEndProcess = new ApmsEndProcess();
apmsEndProcess.setEndTime(currTask.getEndTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); apmsEndProcess.setEndTime(date.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
apmsEndProcess.setEndUser("QJJP03"); apmsEndProcess.setEndUser("QJJP03");
apmsEndProcess.setSheetNo(currTask.getSheetNo()); apmsEndProcess.setSheetNo(currTask.getSheetNo());
R<ApmsEndProcessVo> apmsEndProcessVoR = apmsController.endProcess(apmsEndProcess); R<ApmsEndProcessVo> apmsEndProcessVoR = apmsController.endProcess(apmsEndProcess);

View File

@ -117,14 +117,14 @@ public class TaskDistanceUtils {
logger.info("min"+minDistance); logger.info("min"+minDistance);
logger.info("max"+maxDistance); logger.info("max"+maxDistance);
logger.info("other"+otherNowPosition); logger.info("other"+otherNowPosition);
//另一辆小车在在小车路径上比如冲突不在小车路径上时判定一下安全距离3.8 //另一辆小车在在小车路径上比如冲突不在小车路径上时判定一下安全距离4
if (otherNowPosition>=minDistance&&otherNowPosition<=maxDistance){ if (otherNowPosition>=minDistance&&otherNowPosition<=maxDistance){
return true; return true;
}else { }else {
if (Math.abs(otherNowPosition-maxDistance)<3.8){ if (Math.abs(otherNowPosition-maxDistance)<4){
return true; return true;
} }
if (Math.abs(otherNowPosition-minDistance)<3.8){ if (Math.abs(otherNowPosition-minDistance)<4){
return true; return true;
} }
return false; return false;