rev:系统配置,设备监控

Signed-off-by: jiaoliming <dawnjiao@foxmail.com>
This commit is contained in:
jiaoliming
2023-09-01 10:14:18 +08:00
parent ba52db4d18
commit 408afd8e01
19 changed files with 1184 additions and 548 deletions

View File

@@ -33,7 +33,7 @@ public interface AcsConfig {
//指定AGV系统
String AGVTYPE = "agvType";
//WMS系统接口地址
String WMSURL = "wmsurl";
String WMSURL = "lmsurl";
//WCS系统接口地址
String WCSURL = "wcsurl";
@@ -41,8 +41,10 @@ public interface AcsConfig {
String ERPURL = "erpurl";
//是否存在wms系统
String HASWMS = "hasWms";
String ISTEST = "isTest";
String HASWMS = "hasLms";
String KZPLAN = "kzPlan";
//lucene日志索引目录
String LUCENEURL = "luceneUrl";
String ISFEEDDEVICESTATUS = "isFeedDeviceStatus";
//路由选择
String ROUTE = "route";

View File

@@ -21,7 +21,8 @@ public enum AgvTypeEnum {
PS_TYPE_1("6", "PS20称重任务刻字-包装)", "1"),
PS_TYPE_2("7", "PS20不称重任务刻字-包装)", "2"),
RT_TYPE_1("8", "RT20任务货架", "3"),
OTHERS_TYPE_1("9", "错误任务类型", "9");
OTHERS_TYPE_1("9", "错误任务类型", "9"),
HAIROU_TYPE_1("18", "立库任务", "1");
private String taskType;
private String taskName;

View File

@@ -57,6 +57,20 @@ public enum StatusEnum {
QXXL_COMPEL_REQ("11", "强制搬出请求(清洗下料)", ""),
KZSL_EMPTY_REQ("12","取空框请求(刻字上料)",""),
HAIROU_IN_REQ("13","半成品入库(海柔)",""),
HAIROU_OUT_REQ("14","半成品出库(海柔)",""),
HAIROU_INVENTORY_REQ("15","盘点(海柔)",""),
HAIROU_EMPTY_OUT_REQ("16","空载具出库(海柔)",""),
HAIROU_EMPTY_IN_REQ("17","空载具入库(海柔)",""),
HAIROU_LIKU_REQ("18","半成品库任务(海柔)",""),
TOTE_INBOUND("1","容器入库","tote_inbound"),
TOTE_OUTBOUND("2","容器出库","tote_outbound"),
TOTE_RELOCATION("3","容器移库","tote_relocation"),
TOTE_CARRY("4","容器搬运","tote_carry"),
TOTE_CHECK("5","容器盘库","tote_check"),
//指令状态
INST_READY("0", "就绪", ""),
INST_RUNNING("1", "执行中", ""),
@@ -67,7 +81,8 @@ public enum StatusEnum {
TASK_READY("0", "就绪", ""),
TASK_RUNNING("1", "执行中", "6"),
TASK_FINISH("2", "完成", "7"),
TASK_CANCEL("3", "取消", "8");
TASK_CANCEL("3", "取消", "8"),
TASK_FULL_IN("4","满入","");
private String code;
private String desc;

View File

@@ -110,7 +110,8 @@ public enum DriverTypeEnum {
HAILIANG_CLEANING_PUT_LINE(48, "hailiang_cleaning_put_line", "海亮-清洗下料", "conveyor"),
HAILIANG_ENGRAVING_IN(49, "hailiang_engraving_in", "海亮-刻字上料线体", "conveyor"),
HAILIANG_FRAME_WEIGHING(50, "hailiang_frame_weighing", "海亮-合框称重", "conveyor");
HAILIANG_FRAME_WEIGHING(50, "hailiang_frame_weighing", "海亮-合框称重", "conveyor"),
HAILIANG_WITH_STATION(51, "hailiang_with_station", "海亮-关联站点", "conveyor");
//驱动索引
private int index;
//驱动编码

View File

@@ -68,24 +68,25 @@ public class LiKuDeviceDriver extends AbstractDeviceDriver implements DeviceDriv
String containerCode = "";
List<String> taskCodes=null;
String positionCode = "";
public JSONObject getDeviceStatusName() {
JSONObject jo = new JSONObject();
jo.put("robotCode",robotCode);
jo.put("robotTypeCode", robotTypeCode);
jo.put("pointCode", pointCode);
jo.put("positionX",this.getPositionX());
jo.put("positionY",this. getPositionY());
jo.put("theta", this.getTheta());
jo.put("forkHeight", this.getForkHeight());
jo.put("forkLength", this.getForkLength());
jo.put("forkTheta", this.getForkTheta());
jo.put("stationCode", stationCode);
jo.put("locationCode", locationCode);
jo.put("state", state);
jo.put("hardwareState",hardwareState);
jo.put("trays", this.getTrayList());
return jo;
}
public JSONObject getDeviceStatusName() {
JSONObject jo = new JSONObject();
jo.put("robotCode",robotCode);
jo.put("robotTypeCode", robotTypeCode);
jo.put("pointCode", pointCode);
jo.put("positionX",this.getPositionX());
jo.put("positionY",this. getPositionY());
jo.put("theta", this.getTheta());
jo.put("forkHeight", this.getForkHeight());
jo.put("forkLength", this.getForkLength());
jo.put("forkTheta", this.getForkTheta());
jo.put("stationCode", stationCode);
jo.put("locationCode", locationCode);
jo.put("state", state);
jo.put("hardwareState",hardwareState);
jo.put("trays", this.getTrayList());
return jo;
}
@Override
public void setDeviceStatus(JSONObject data) {

View File

@@ -6,4 +6,5 @@ package org.nl.acs.device_driver.basedriver.hailiang_one;
*/
public class ApplyTaskTime {
public final static long APPLY_TIME = 60l;
public final static long APPLY_TIME_TEN = 30l;
}

View File

@@ -228,7 +228,7 @@ public class PhotoelectricInspectionSiteDeviceDriver extends AbstractOpcDeviceDr
dto.setCreate_time(now);
WQLObject wo = WQLObject.getWQLObject("acs_task");
JSONObject json = (JSONObject) JSONObject.toJSON(dto);
JSONObject json = (JSONObject) JSONObject.toJSON(dto);
wo.insert(json);
requireSucess = false;

View File

@@ -423,7 +423,7 @@ public class ProduceshiftorderServiceImpl implements ProduceshiftorderService, A
WQLObject wo = WQLObject.getWQLObject("acs_produceshiftorder");
dto.setOrder_status(status);
dto.setUpdate_time(DateUtil.now());
dto.setUpdate_by("mes");
dto.setUpdate_by("lms");
JSONObject json = (JSONObject) JSONObject.toJSON(dto);
wo.update(json);
this.order.removeIf(o -> o.getOrder_code().equals(dto.getOrder_code()));
@@ -472,7 +472,7 @@ public class ProduceshiftorderServiceImpl implements ProduceshiftorderService, A
HailiangStackingStationDriver hailiangStackingStationDriver;
HailiangOldSpecialDeviceDriver hailiangOldSpecialDeviceDriver;
Device device = deviceAppService.findDeviceByCode(dto.getDevice_code());
String upName = SecurityUtils.getCurrentUsername() == null ? "mes" : SecurityUtils.getCurrentUsername();
String upName = SecurityUtils.getCurrentUsername() == null ? "lms" : SecurityUtils.getCurrentUsername();
JSONObject map = new JSONObject();
map.put("online_id", IdUtil.simpleUUID());
map.put("device_code", device_code);

View File

@@ -30,6 +30,8 @@ import org.nl.acs.task.service.dto.TaskFeedbackDto;
import org.nl.modules.common.exception.BadRequestException;
import org.nl.modules.common.utils.FileUtil;
import org.nl.modules.common.utils.SecurityUtils;
import org.nl.modules.lucene.service.LuceneExecuteLogService;
import org.nl.modules.lucene.service.dto.LuceneLogDto;
import org.nl.modules.system.service.ParamService;
import org.nl.modules.system.util.CodeUtil;
import org.nl.modules.wql.WQL;
@@ -75,7 +77,7 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
private DeviceAssignedService deviceAssignedService;
@Autowired
private InstructionService instructionService;
// private LuceneExecuteLogService lucene = SpringContextHolder.getBean(LuceneExecuteLogService.class);
@Override
public void autoInitial() throws Exception {
this.reload();
@@ -561,9 +563,15 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
TaskDto entity = this.findById(id);
if (entity == null) throw new BadRequestException("被删除或无权限,操作失败!");
InstructionDto instdto = instructionService.findByTaskId(id, "instruction_status <2 ");
if (instdto != null) throw new BadRequestException("有指令未完成!");
entity.setTask_status(StatusEnum.INST_FINISH.getCode());
this.update(entity);
if (instdto != null) {
// lucene.deviceExecuteLog(new LuceneLogDto(id,"任务号关联的指令状态instruction_status <2"+instdto.getInstruction_status()));
log.info("任务号{}关联的指令状态instruction_status <2{}",id,instdto.getInstruction_status());
throw new BadRequestException("有指令未完成!");
}else {
entity.setTask_status(StatusEnum.INST_FINISH.getCode());
this.update(entity);
}
}
@Override