This commit is contained in:
lgh 2022-12-27 18:01:05 +08:00
джерело 21a4cfab23
коміт 395817f10e
5 змінених файлів з 49 додано та 17 видалено

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

@ -79,6 +79,10 @@ public class CurrTaskServiceImpl extends BaseService implements CurrTaskService
CurrTaskDetServiceBiz currTaskDetServiceBiz;
@Autowired
InStockInfoServiceBiz inStockInfoServiceBiz;
@Autowired
TaskDetHisServiceBiz taskDetHisServiceBiz;
@Autowired
TaskHisServiceBiz taskHisServiceBiz;
private Logger logger = LoggerFactory.getLogger(getClass());
@Override
@ -456,12 +460,23 @@ public class CurrTaskServiceImpl extends BaseService implements CurrTaskService
locationServiceBiz.updateById(location);
//删除库位缓存
inStockInfoServiceBiz.removeById(inStockInfo);
}
currTask.setStatus(1);
currTask.setCreatorId(99);
currTask.setBeginTime(LocalDateTime.now());
currTaskServiceBiz.updateById(currTask);
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.setCreatorId(99);
@ -687,6 +702,9 @@ public class CurrTaskServiceImpl extends BaseService implements CurrTaskService
if (currTask.getStatus() != 0) {
return R.failed("该任务状态不为未执行,无法执行!");
}
if (currTask.getCacheSatatus()==2||currTask.getIsCache()==1){
return R.failed("该任务已在缓存队列,状态不为未执行,无法执行!");
}
//是否为自动任务
if (currTask.getIsAuto() == 1) {
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) {
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.setSheetNo(currTask.getSheetNo());
R<ApmsEndProcessVo> apmsEndProcessVoR = apmsControl.endProcess(apmsEndProcess);

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

@ -897,8 +897,12 @@ public class ScheduledTask extends BaseService {
* @return
*/
private Boolean apmsEndProcess(CurrTask currTask) {
LocalDateTime date=LocalDateTime.now();
if (currTask.getEndTime()!=null){
date=currTask.getEndTime();
}
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.setSheetNo(currTask.getSheetNo());
R<ApmsEndProcessVo> apmsEndProcessVoR = apmsController.endProcess(apmsEndProcess);

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