rev:修改
This commit is contained in:
@@ -51,11 +51,23 @@
|
||||
<groupId>org.openscada.jinterop</groupId>
|
||||
<artifactId>org.openscada.jinterop.core</artifactId>
|
||||
<version>2.1.8</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.bouncycastle</groupId>
|
||||
<artifactId>bcprov-jdk15on</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.openscada.jinterop</groupId>
|
||||
<artifactId>org.openscada.jinterop.deps</artifactId>
|
||||
<version>1.5.0</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.bouncycastle</groupId>
|
||||
<artifactId>bcprov-jdk15on</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.openscada.utgard</groupId>
|
||||
@@ -420,11 +432,6 @@
|
||||
<artifactId>lucene-analyzers-smartcn</artifactId>
|
||||
<version>${lucene.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.bouncycastle</groupId>
|
||||
<artifactId>bcprov-jdk15on</artifactId>
|
||||
<version>1.68</version> <!-- 更新到最新版本 -->
|
||||
</dependency>
|
||||
<!-- Lucene查询解析包 -->
|
||||
<dependency>
|
||||
<groupId>org.apache.lucene</groupId>
|
||||
|
||||
@@ -161,14 +161,14 @@ public class XianGongAgvServiceImpl implements XianGongAgvService {
|
||||
driver.setCar_no(reqParam.getString("robot_name"));
|
||||
|
||||
result.put("code", HttpStatus.HTTP_OK);
|
||||
result.put("message", "ok");
|
||||
result.put("message", "申请进入设备:"+device.getDevice_code()+"成功");
|
||||
} else {
|
||||
result.put("code", HttpStatus.HTTP_BAD_REQUEST);
|
||||
result.put("message", "ok");
|
||||
result.put("message", "当前action值为:"+driver.getAction()+"不允许进入");
|
||||
}
|
||||
} else {
|
||||
result.put("code", HttpStatus.HTTP_BAD_REQUEST);
|
||||
result.put("message", "ok");
|
||||
result.put("message", "当前设备不属于三色灯!");
|
||||
}
|
||||
log.info("getBlockGroup反馈AGV输出参数:{}", result.toString());
|
||||
return result;
|
||||
@@ -195,7 +195,7 @@ public class XianGongAgvServiceImpl implements XianGongAgvService {
|
||||
driver.writing(Arrays.asList(key),Arrays.asList(value));
|
||||
|
||||
// 判断是否允许离开 1-允许,0-不允许
|
||||
if (driver.getAction() == XgAgvEnum.GS_ACTION_YES.getCode()) {
|
||||
if (driver.getAction() == XgAgvEnum.GS_ACTION_NOT.getCode()) {
|
||||
// 判断是否清楚车号
|
||||
if (device.getExtraValue().get("is_clean").toString().equals("1")) {
|
||||
// 清除第当前设备车号(第二次)
|
||||
@@ -207,14 +207,14 @@ public class XianGongAgvServiceImpl implements XianGongAgvService {
|
||||
driver2.setCar_no("");
|
||||
}
|
||||
result.put("code", HttpStatus.HTTP_OK);
|
||||
result.put("message", "ok");
|
||||
result.put("message", "申请离开设备:"+device.getDevice_code()+"成功");
|
||||
} else {
|
||||
result.put("code", HttpStatus.HTTP_BAD_REQUEST);
|
||||
result.put("message", "ok");
|
||||
result.put("message", "当前action值为:"+driver.getAction()+"不允许离开");
|
||||
}
|
||||
} else {
|
||||
result.put("code", HttpStatus.HTTP_BAD_REQUEST);
|
||||
result.put("message", "ok");
|
||||
result.put("message", "当前设备不属于三色灯!");
|
||||
}
|
||||
log.info("releaseBlockGroup反馈AGV输出参数:{}", result.toString());
|
||||
return result;
|
||||
|
||||
@@ -15,6 +15,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
||||
@@ -50,6 +50,9 @@ public enum RegionEnum {
|
||||
// D生产区-->地面货架
|
||||
D_DMHJ("D", "DMHJ","PS20","Group-001"),
|
||||
|
||||
// 地面货架--> D生产区
|
||||
DMHJ_D("DMHJ", "D","PS20","Group-001"),
|
||||
|
||||
// 地面货架-->拆盘机
|
||||
DMHJ_CPJ("DMHJ", "CPJ","PS20","Group-001"),
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ public class AgvWaitUtil {
|
||||
@Autowired
|
||||
private ConveyorService conveyorService;
|
||||
|
||||
private final String code = "BZXXL,CPJSSX";
|
||||
private final String code = "AK001,ZB003,BK001";
|
||||
|
||||
//取货前等待
|
||||
public JSONObject waitInGet(String deviceCode) {
|
||||
|
||||
@@ -374,6 +374,6 @@ public class MqttService implements ApplicationAutoInitial {
|
||||
|
||||
@Override
|
||||
public void autoInitial() throws Exception {
|
||||
this.init();
|
||||
//this.init();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,33 +32,26 @@ import java.util.List;
|
||||
@AllArgsConstructor
|
||||
public enum RegionEnum {
|
||||
|
||||
// I区到E区
|
||||
I_E("I", "E","PS15","Group-005"),
|
||||
|
||||
// E区到I区
|
||||
E_I("E", "I","PS15","Group-005"),
|
||||
|
||||
// A区到E区
|
||||
A_E("A", "E","PS15","Group-005"),
|
||||
|
||||
// E区到G区
|
||||
E_G("E", "G","PS15","Group-005"),
|
||||
|
||||
// B区到D区
|
||||
B_D("B", "D","PS15","Group-005"),
|
||||
|
||||
// B区到C区
|
||||
B_C("B", "C","PS15","Group-005"),
|
||||
// I区到H区
|
||||
I_H("I", "H","PS15","Group-005"),
|
||||
|
||||
// I区到B区
|
||||
I_B("I", "B","PS15","Group-005"),
|
||||
|
||||
// C区到C区
|
||||
C_C("C", "C","PS15","Group-005"),
|
||||
|
||||
// F区到B区
|
||||
F_B("F", "B","PS15","Group-005"),
|
||||
|
||||
// F区到H区
|
||||
F_H("F", "H","PS15","Group-005"),
|
||||
|
||||
// F区到G区
|
||||
F_G("F", "G","PS15","Group-005"),
|
||||
|
||||
// G区到F区
|
||||
G_F("G", "F","PS15","Group-005"),
|
||||
|
||||
;
|
||||
|
||||
// 起点区域
|
||||
|
||||
@@ -320,6 +320,11 @@ public class MesToWmsServiceImpl implements MesToWmsService {
|
||||
private String ifTaskRegion(String start_region, String next_region) {
|
||||
String task_code = "";
|
||||
|
||||
// 如果起点或者是终点是二期
|
||||
if (start_region.equals("TWOPOINT") && next_region.equals("TWOPOINT")) {
|
||||
return "TWOPUBTask";
|
||||
}
|
||||
|
||||
// 如果起点和终点是相同区域则返回移库任务类
|
||||
if (start_region.equals(next_region)) {
|
||||
return "PUBMOVETask";
|
||||
|
||||
@@ -0,0 +1,149 @@
|
||||
package org.nl.wms.sch.task_manage.task.tasks.fj;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.config.IdUtil;
|
||||
import org.nl.wms.ext.mes.service.WmsToMesService;
|
||||
import org.nl.wms.sch.task.service.ISchBaseTaskService;
|
||||
import org.nl.wms.sch.task.service.ISchBaseTaskconfigService;
|
||||
import org.nl.wms.sch.task.service.dao.SchBaseTask;
|
||||
import org.nl.wms.sch.task_manage.AbstractTask;
|
||||
import org.nl.wms.sch.task_manage.AcsTaskDto;
|
||||
import org.nl.wms.sch.task_manage.GeneralDefinition;
|
||||
import org.nl.wms.sch.task_manage.enums.TaskFinishedTypeEnum;
|
||||
import org.nl.wms.sch.task_manage.task.TaskType;
|
||||
import org.nl.wms.sch.task_manage.task.core.TaskStatus;
|
||||
import org.nl.wms.util.TaskUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* @Author: lxy
|
||||
* @Description: D区送满托盘到地面货架
|
||||
* @Date: 2024/9/24
|
||||
*/
|
||||
@Component(value = "MDMDTask")
|
||||
@TaskType("MDMDTask")
|
||||
public class MDMDTask extends AbstractTask {
|
||||
@Autowired
|
||||
private ISchBaseTaskService taskService;
|
||||
|
||||
@Autowired
|
||||
private ISchBaseTaskconfigService taskConfigService;
|
||||
|
||||
@Autowired
|
||||
private WmsToMesService wmsToMesService;
|
||||
|
||||
@Override
|
||||
public String create(JSONObject json) {
|
||||
SchBaseTask task = new SchBaseTask();
|
||||
task.setTask_id(IdUtil.getStringId());
|
||||
task.setTask_code(json.getString("TaskCode"));
|
||||
task.setTask_status(TaskStatus.CREATE.getCode());
|
||||
task.setConfig_code(json.getString("task_type"));
|
||||
task.setPoint_code1(json.getString("PickingLocation"));
|
||||
task.setPoint_code2(json.getString("PlacedLocation"));
|
||||
task.setRequest_param(json.toString());
|
||||
task.setPriority(json.getString("Priority"));
|
||||
task.setIs_vehicle(json.getString("IsPanCode"));
|
||||
task.setExt_group_data(json.getString("CarryIsEmptyTuoPan"));
|
||||
task.setCreate_id(SecurityUtils.getCurrentUserId());
|
||||
task.setCreate_name(SecurityUtils.getCurrentNickName());
|
||||
task.setCreate_time(DateUtil.now());
|
||||
task.setWorkshop_code("A1");
|
||||
taskService.save(task);
|
||||
return task.getTask_id();
|
||||
}
|
||||
|
||||
@Override
|
||||
public AcsTaskDto sendAcsParam(String taskId) {
|
||||
SchBaseTask taskDao = taskService.getById(taskId);
|
||||
|
||||
// 组织下发给acs的数据
|
||||
AcsTaskDto acsTaskDto = new AcsTaskDto();
|
||||
acsTaskDto.setExt_task_uuid(taskDao.getTask_id());
|
||||
acsTaskDto.setTask_code(taskDao.getTask_code());
|
||||
acsTaskDto.setStart_device_code(taskDao.getPoint_code1());
|
||||
acsTaskDto.setNext_device_code(taskDao.getPoint_code2());
|
||||
acsTaskDto.setPriority(taskDao.getPriority());
|
||||
acsTaskDto.setIs_vehicle(taskDao.getIs_vehicle());
|
||||
acsTaskDto.setTask_type("1");
|
||||
acsTaskDto.setDtl_type("1");
|
||||
acsTaskDto.setIs_empvehicle(taskDao.getExt_group_data());
|
||||
return acsTaskDto;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void updateStatus(String task_code, TaskStatus status) {
|
||||
// 校验任务
|
||||
SchBaseTask taskObj = taskService.getByCode(task_code);
|
||||
if (taskObj.getTask_status().equals(TaskStatus.FINISHED.getCode())) {
|
||||
throw new BadRequestException("该任务已完成!");
|
||||
}
|
||||
if (taskObj.getTask_status().equals(TaskStatus.CANCELED.getCode())) {
|
||||
throw new BadRequestException("该任务已取消!");
|
||||
}
|
||||
// 根据传来的类型去对任务进行操作
|
||||
if (status.equals(TaskStatus.EXECUTING)) {
|
||||
taskObj.setTask_status(TaskStatus.EXECUTING.getCode());
|
||||
taskObj.setRemark("执行中");
|
||||
TaskUtils.setUpdateByAcs(taskObj);
|
||||
taskService.updateById(taskObj);
|
||||
}
|
||||
if (status.equals(TaskStatus.FINISHED)) {
|
||||
this.finishTask(taskObj, TaskFinishedTypeEnum.AUTO_ACS);
|
||||
}
|
||||
if (status.equals(TaskStatus.CANCELED)) {
|
||||
this.cancelTask(taskObj, TaskFinishedTypeEnum.AUTO_ACS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void forceFinish(String task_code) {
|
||||
SchBaseTask taskObj = taskService.getByCode(task_code);
|
||||
if (ObjectUtil.isEmpty(taskObj)) {
|
||||
throw new BadRequestException("该任务不存在");
|
||||
}
|
||||
this.finishTask(taskObj, TaskFinishedTypeEnum.MANUAL_PC);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cancel(String task_code) {
|
||||
SchBaseTask taskObj = taskService.getByCode(task_code);
|
||||
if (ObjectUtil.isEmpty(taskObj)) {
|
||||
throw new BadRequestException("该任务不存在");
|
||||
}
|
||||
this.cancelTask(taskObj, TaskFinishedTypeEnum.MANUAL_PC);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void backMes(String task_code) {
|
||||
wmsToMesService.receiveTaskStatusMesData(taskService.getByCode(task_code));
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void finishTask(SchBaseTask taskObj, TaskFinishedTypeEnum taskFinishedType) {
|
||||
// 任务完成
|
||||
taskObj.setTask_status(TaskStatus.FINISHED.getCode());
|
||||
taskObj.setRemark(GeneralDefinition.TASK_FINISH);
|
||||
taskObj.setFinished_type(taskFinishedType.getCode());
|
||||
TaskUtils.setUpdateByType(taskObj, taskFinishedType);
|
||||
taskService.updateById(taskObj);
|
||||
|
||||
// 通知mes任务完成
|
||||
wmsToMesService.receiveTaskStatusMesData(taskObj);
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void cancelTask(SchBaseTask taskObj, TaskFinishedTypeEnum taskFinishedType) {
|
||||
taskObj.setRemark(GeneralDefinition.TASK_CANCEL);
|
||||
taskObj.setTask_status(TaskStatus.CANCELED.getCode());
|
||||
taskObj.setFinished_type(taskFinishedType.getCode());
|
||||
TaskUtils.setUpdateByType(taskObj, taskFinishedType);
|
||||
taskService.updateById(taskObj);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user