Merge remote-tracking branch 'origin/master'

# Conflicts:
#	acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/plug_pull_device_site/PlugPullDeviceSiteDeviceDriver.java
#	acs2/nladmin-ui/src/views/system/monitor/device/index.vue
This commit is contained in:
2024-02-29 10:37:12 +08:00
37 changed files with 527 additions and 327 deletions

View File

@@ -1,5 +1,6 @@
package org.nl.acs.common.base; package org.nl.acs.common.base;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
import com.baomidou.mybatisplus.extension.conditions.query.QueryChainWrapper; import com.baomidou.mybatisplus.extension.conditions.query.QueryChainWrapper;
@@ -7,6 +8,7 @@ import com.baomidou.mybatisplus.extension.conditions.update.LambdaUpdateChainWra
import com.baomidou.mybatisplus.extension.conditions.update.UpdateChainWrapper; import com.baomidou.mybatisplus.extension.conditions.update.UpdateChainWrapper;
import com.baomidou.mybatisplus.extension.toolkit.ChainWrappers; import com.baomidou.mybatisplus.extension.toolkit.ChainWrappers;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.nl.acs.instruction.domain.Instruction;
/** /**
* 公共抽象Mapper接口类 * 公共抽象Mapper接口类

View File

@@ -291,14 +291,12 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements
break; break;
case 5: case 5:
//申请AGV任务 //申请AGV任务
//TODO 申请AGV任务待确认
if (move == 1 && !requireSucess) { if (move == 1 && !requireSucess) {
applyAgvTask(); applyAgvTask();
} }
break; break;
case 6: case 6:
//二楼到一楼输送线申请行架任务 //二楼到一楼输送线申请行架任务
//TODO 申请行架任务
if (move == 1 && !requireSucess) { if (move == 1 && !requireSucess) {
applyManipulatorTask(); applyManipulatorTask();
} }
@@ -327,7 +325,11 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements
private void applyManipulatorTask() { private void applyManipulatorTask() {
Date date = new Date();
if (date.getTime() - this.instruction_require_time.getTime() < (long) this.instruction_require_time_out) {
log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out);
return;
} else {
JSONObject param = new JSONObject(); JSONObject param = new JSONObject();
param.put("device_code", device_code); param.put("device_code", device_code);
param.put("material_barcode", material_barcode); param.put("material_barcode", material_barcode);
@@ -341,7 +343,7 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements
.build(); .build();
luceneExecuteLogService.deviceExecuteLog(logDto2); luceneExecuteLogService.deviceExecuteLog(logDto2);
this.requireSucess = true; this.requireSucess = true;
}else { } else {
LuceneLogDto logDto2 = LuceneLogDto.builder() LuceneLogDto logDto2 = LuceneLogDto.builder()
.device_code(device_code) .device_code(device_code)
.content("二楼到一楼输送线申请行架任务,返回参数:" + jo.getString("body")) .content("二楼到一楼输送线申请行架任务,返回参数:" + jo.getString("body"))
@@ -349,6 +351,7 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements
luceneExecuteLogService.deviceExecuteLog(logDto2); luceneExecuteLogService.deviceExecuteLog(logDto2);
} }
} }
}
public void writing(int command) { public void writing(int command) {
@@ -371,10 +374,8 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements
if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) { if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) {
//判断是否有手动补码 如果有就申请补码agv任务 //判断是否有手动补码 如果有就申请补码agv任务
if (StrUtil.isNotEmpty(hand_barcode)) { if (StrUtil.isNotEmpty(hand_barcode)) {
message = "申请补码AGV搬运任务中...";
JSONObject apply = new JSONObject(); JSONObject apply = new JSONObject();
apply.put("device_code", device_code); apply.put("device_code", device_code);
apply.put("type", AcsToLmsApplyTaskTypeEnum.AGV.getType());
apply.put("vehicle_code", hand_barcode); apply.put("vehicle_code", hand_barcode);
String str = acsToWmsService.applyTaskToWms(apply); String str = acsToWmsService.applyTaskToWms(apply);
@@ -385,10 +386,10 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements
.build(); .build();
luceneExecuteLogService.deviceExecuteLog(logDto2); luceneExecuteLogService.deviceExecuteLog(logDto2);
if (ObjectUtil.isEmpty(jo)) { if (ObjectUtil.isEmpty(jo)) {
message = "申请补码AGV搬运任务接口不通"; message = LangProcess.msg("one_message15");
} else { } else {
if (jo.getInteger("status") == 200) { if (jo.getInteger("status") == 200) {
message = "申请补码AGV搬运任务成功"; message = LangProcess.msg("one_message16");
List list = new ArrayList(); List list = new ArrayList();
while (!StrUtil.equals(this.getOpcValueAccessor().getValue(this.getOpcServer() + "." + this.getOpcPlc() + "." + this.getDevice_code() + ".to_command").toString() while (!StrUtil.equals(this.getOpcValueAccessor().getValue(this.getOpcServer() + "." + this.getOpcPlc() + "." + this.getDevice_code() + ".to_command").toString()
, "8")) { , "8")) {
@@ -407,38 +408,26 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements
luceneExecuteLogService.deviceExecuteLog(logDto); luceneExecuteLogService.deviceExecuteLog(logDto);
requireSucess = true; requireSucess = true;
} else { } else {
message = "申请补码AGV搬运任务失败," + jo.get("message").toString(); message = LangProcess.msg("one_message17") + jo.get("message").toString();
} }
} }
return; return;
} }
//没有就正常申请agv任务
Instruction instruction = instructionService.findByCode(String.valueOf(task));
if (ObjectUtil.isEmpty(instruction)) {
message = "指令号" + task + "未找到对应指令";
return;
}
if (StrUtil.isEmpty(instruction.getVehicle_code())) {
message = "指令号" + task + "未找到对应木箱号";
return;
}
message = "申请AGV搬运任务中...";
JSONObject apply = new JSONObject(); JSONObject apply = new JSONObject();
apply.put("device_code", device_code); apply.put("device_code", device_code);
apply.put("type", AcsToLmsApplyTaskTypeEnum.AGV.getType());
apply.put("vehicle_code", instruction.getVehicle_code()); apply.put("vehicle_code", barcode);
String str = acsToWmsService.applySendOutTwo(apply); String str = acsToWmsService.applySendOutTwo(apply);
logServer.deviceExecuteLog(this.device_code, "", "", "申请AGV任务,请求参数:" + apply + ",响应参数"); logServer.deviceExecuteLog(this.device_code, "", "", "申请AGV任务,请求参数:" + apply + ",响应参数");
JSONObject jo = JSON.parseObject(str); JSONObject jo = JSON.parseObject(str);
if (ObjectUtil.isEmpty(jo)) { if (ObjectUtil.isEmpty(jo)) {
message = "申请AGV搬运任务接口不通"; message = LangProcess.msg("one_message15");
// requireSucess = true; // requireSucess = true;
} else { } else {
if (jo.getInteger("status") == 200) { if (jo.getInteger("status") == 200) {
message = "申请AGV搬运任务成功"; message = LangProcess.msg("one_message16");
List list = new ArrayList(); List list = new ArrayList();
Map map = new HashMap(); Map map = new HashMap();
map.put("code", "to_command"); map.put("code", "to_command");
@@ -458,7 +447,7 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements
logServer.deviceExecuteLog(this.device_code, "", "", "申请AGV任务,返回参数:" + jo); logServer.deviceExecuteLog(this.device_code, "", "", "申请AGV任务,返回参数:" + jo);
requireSucess = true; requireSucess = true;
} else { } else {
message = "申请AGV搬运任务失败," + jo.get("message").toString(); message = LangProcess.msg("one_message17") + jo.get("message").toString();
} }
} }
@@ -469,60 +458,6 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements
/*public synchronized void request_for_shipment(String mode, String item_out_seq_arr, int[] item_out_qty_arr) {
Date date = new Date();
if (date.getTime() - this.require_apply_strangulation_time.getTime() < (long) this.instruction_require_time_out) {
log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out);
} else {
this.require_apply_strangulation_time = date;
ApplyPaperActionRequest applyPaperActionRequest = new ApplyPaperActionRequest();
applyPaperActionRequest.setDevice_code(this.device_code);
applyPaperActionRequest.setType(CommonFinalParam.ONE);
applyPaperActionRequest.setTask_code(String.valueOf(task));
//获取出库顺序
boolean contains = item_out_seq_arr.contains(",");
boolean contains1 = item_out_seq_arr.contains("");
if (contains) {
String[] split = item_out_seq_arr.split(",");
applyPaperActionRequest.setMaterial1(split[0]);
applyPaperActionRequest.setMaterial1(split[1]);
} else if (contains1) {
String[] split = item_out_seq_arr.split("");
applyPaperActionRequest.setMaterial1(split[0]);
applyPaperActionRequest.setMaterial1(split[1]);
} else {
applyPaperActionRequest.setMaterial1(item_out_seq_arr);
}
if (item_out_qty_arr.length >= 1 && item_out_qty_arr.length < 4) {
applyPaperActionRequest.setQty1(String.valueOf(item_out_qty_arr[0]));
applyPaperActionRequest.setQty2(String.valueOf(item_out_qty_arr[1]));
}
ApplyPaperActionResponse applyPaperActionResponse = acsToWmsService.applyPaperActionRequest(applyPaperActionRequest);
if (ObjectUtil.isNull(applyPaperActionResponse)) {
message = "请求失败";
requireSucess = false;
return;
}
Map map3 = new HashMap();
if (applyPaperActionResponse.getstatus() == 200) {
map3.put("to_command", "4");
this.writing(map3);
requireSucess = true;
logServer.deviceExecuteLog(this.device_code, "", "", "申请出纸管,返回参数:" + applyPaperActionResponse);
message = "申请出货成功";
} else {
message = applyPaperActionResponse.getMessage();
map3.put("to_command", "5");
this.writing(map3);
requireSucess = false;
message = "出库顺序错误";
logServer.deviceExecuteLog(this.device_code, "", "", "申请出纸管,返回参数:" + applyPaperActionResponse);
}
}
}
*/
/** /**
* 申请任务 * 申请任务
*/ */

View File

@@ -76,6 +76,11 @@ public class ItemProtocol {
*/ */
public static String item_to_target = "to_target"; public static String item_to_target = "to_target";
/**
* 托盘条码
*/
public static String item_barcode = "barcode";
@@ -128,6 +133,11 @@ public class ItemProtocol {
return this.getOpcIntegerValue(item_to_task); return this.getOpcIntegerValue(item_to_task);
} }
public String getBarcode() {
return this.getOpcStringValue(item_barcode);
}
public int getTotarget() { public int getTotarget() {
return this.getOpcIntegerValue(item_to_target); return this.getOpcIntegerValue(item_to_target);
@@ -192,7 +202,8 @@ public class ItemProtocol {
list.add(new ItemDto(item_action, "动作类型", "DB101.B6")); list.add(new ItemDto(item_action, "动作类型", "DB101.B6"));
list.add(new ItemDto(item_error, "报警", "DB101.B58")); list.add(new ItemDto(item_error, "报警", "DB101.B58"));
list.add(new ItemDto(item_task, "任务号", "DB101.D68")); list.add(new ItemDto(item_task, "任务号", "DB101.D68"));
list.add(new ItemDto(item_material_barcode, "子卷条码", "DB1.B12")); list.add(new ItemDto(item_material_barcode, "子卷条码", "DB601.STRING1.50"));
list.add(new ItemDto(item_barcode, "托盘条码", "DB602.STRING1.50"));
return list; return list;
} }

View File

@@ -4,8 +4,8 @@ import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
import lombok.Data; import lombok.Data;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@@ -20,8 +20,6 @@ import org.nl.acs.device_driver.RouteableDeviceDriver;
import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver; import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver;
import org.nl.acs.device_driver.driver.ExecutableDeviceDriver; import org.nl.acs.device_driver.driver.ExecutableDeviceDriver;
import org.nl.acs.enums.AcsToLmsApplyTaskTypeEnum; import org.nl.acs.enums.AcsToLmsApplyTaskTypeEnum;
import org.nl.acs.ext.wms.data.one.ApplyLabelingAndBindingRequest;
import org.nl.acs.ext.wms.data.one.ApplyLabelingAndBindingResponse;
import org.nl.acs.ext.wms.service.AcsToWmsService; import org.nl.acs.ext.wms.service.AcsToWmsService;
import org.nl.acs.history.ErrorUtil; import org.nl.acs.history.ErrorUtil;
import org.nl.acs.history.service.DeviceErrorLogService; import org.nl.acs.history.service.DeviceErrorLogService;
@@ -33,7 +31,6 @@ import org.nl.acs.monitor.DeviceStageMonitor;
import org.nl.acs.opc.DeviceAppService; import org.nl.acs.opc.DeviceAppService;
import org.nl.acs.route.service.RouteLineService; import org.nl.acs.route.service.RouteLineService;
import org.nl.acs.route.service.dto.RouteLineDto; import org.nl.acs.route.service.dto.RouteLineDto;
import org.nl.acs.storage_cell.domain.StorageCell;
import org.nl.acs.storage_cell.service.mapper.StorageCellMapper; import org.nl.acs.storage_cell.service.mapper.StorageCellMapper;
import org.nl.acs.task.enums.TaskStatusEnum; import org.nl.acs.task.enums.TaskStatusEnum;
import org.nl.acs.task.service.TaskService; import org.nl.acs.task.service.TaskService;
@@ -44,7 +41,6 @@ import org.nl.config.lucene.service.LuceneExecuteLogService;
import org.nl.config.lucene.service.dto.LuceneLogDto; import org.nl.config.lucene.service.dto.LuceneLogDto;
import org.nl.config.thread.ThreadPoolExecutorUtil; import org.nl.config.thread.ThreadPoolExecutorUtil;
import org.openscada.opc.lib.da.Server; import org.openscada.opc.lib.da.Server;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.*; import java.util.*;
import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.ThreadPoolExecutor;
@@ -80,8 +76,8 @@ public class FinishedProductOutBindLableDeviceDriver extends AbstractOpcDeviceDr
DeviceErrorLogService deviceErrorLogService = SpringContextHolder.getBean(DeviceErrorLogServiceImpl.class); DeviceErrorLogService deviceErrorLogService = SpringContextHolder.getBean(DeviceErrorLogServiceImpl.class);
@Autowired LuceneExecuteLogService luceneExecuteLogService = SpringContextHolder.getBean(LuceneExecuteLogService.class);
LuceneExecuteLogService luceneExecuteLogService;
//当前指令 //当前指令
Instruction inst = null; Instruction inst = null;
@@ -123,6 +119,10 @@ public class FinishedProductOutBindLableDeviceDriver extends AbstractOpcDeviceDr
int to_height = 0; int to_height = 0;
int last_to_height = 0; int last_to_height = 0;
//托盘条码
String barcode = null;
String last_barcode = null;
String material_barcode = null; String material_barcode = null;
String last_material_barcode = null; String last_material_barcode = null;
@@ -164,8 +164,7 @@ public class FinishedProductOutBindLableDeviceDriver extends AbstractOpcDeviceDr
String device_code; String device_code;
String vehicle_code;
String last_vehicle_code;
@Override @Override
public Device getDevice() { public Device getDevice() {
@@ -187,6 +186,7 @@ public class FinishedProductOutBindLableDeviceDriver extends AbstractOpcDeviceDr
to_task = this.itemProtocol.getTo_task(); to_task = this.itemProtocol.getTo_task();
heartbeat = this.itemProtocol.getHeartbeat(); heartbeat = this.itemProtocol.getHeartbeat();
material_barcode = this.itemProtocol.getMaterialBarCode(); material_barcode = this.itemProtocol.getMaterialBarCode();
barcode = this.itemProtocol.getBarcode();
if (mode != last_mode) { if (mode != last_mode) {
JSONObject param = new JSONObject(); JSONObject param = new JSONObject();
@@ -268,76 +268,53 @@ public class FinishedProductOutBindLableDeviceDriver extends AbstractOpcDeviceDr
return; return;
} else { } else {
this.require_apply_strangulation_time = date; this.require_apply_strangulation_time = date;
String vehicle_code = ""; // String vehicle_code = "";
if (task > 0) { //
Instruction instruction = instructionService.findByCodeFromCache(String.valueOf(task)); // if (StrUtil.isEmpty(vehicle_code)) {
if (ObjectUtil.isEmpty(instruction)) { // message = LangProcess.msg("one_message8") + ": " + task + LangProcess.msg("one_message11");
message = LangProcess.msg("one_message8") + ": " + task + LangProcess.msg("one_message9"); // return;
return; // }
}
vehicle_code = instruction.getVehicle_code(); JSONObject param = new JSONObject();
} else { param.put("device_code", device_code);
message = LangProcess.msg("one_message8") + ": " + task + LangProcess.msg("one_message10"); param.put("vehicle_code", material_barcode);
return; param.put("type", AcsToLmsApplyTaskTypeEnum.LABEL_BIND.getType());
} String response = acsToWmsService.deviceApplyTwo(param);
if (StrUtil.isEmpty(vehicle_code)) { JSONObject jo = JSON.parseObject(response);
message = LangProcess.msg("one_message8") + ": " + task + LangProcess.msg("one_message11"); if (StrUtil.isNotEmpty(jo.getString("body")) || jo.getInteger("status") == 200) {
return;
}
ApplyLabelingAndBindingRequest applyLabelingAndBindingRequest =
new ApplyLabelingAndBindingRequest();
StorageCell storageCell = new LambdaQueryChainWrapper<>(storageCellMapper)
.eq(StorageCell::getStorage_code, this.device_code)
.one();
String start_point_code = null;
if (!ObjectUtil.isEmpty(storageCell)) {
start_point_code = (String) storageCell.getParent_storage_code() == null ? this.device_code : (String) storageCell.getParent_storage_code();
}
applyLabelingAndBindingRequest.setDevice_code(start_point_code);
applyLabelingAndBindingRequest.setType(AcsToLmsApplyTaskTypeEnum.LABEL_BIND.getType());
applyLabelingAndBindingRequest.setVehicle_code(vehicle_code);
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code)
.content("申请贴标捆扎信息,参数:" + applyLabelingAndBindingRequest)
.build();
luceneExecuteLogService.deviceExecuteLog(logDto);
ApplyLabelingAndBindingResponse applyLabelingAndBindingResponse = acsToWmsService.applyLabelingAndBindingRequest(applyLabelingAndBindingRequest);
if (applyLabelingAndBindingResponse.getstatus() == 200) {
if (ObjectUtil.isNotEmpty(applyLabelingAndBindingResponse.getData())) {
LuceneLogDto logDto2 = LuceneLogDto.builder() LuceneLogDto logDto2 = LuceneLogDto.builder()
.device_code(device_code) .device_code(device_code)
.content("申请贴标捆扎信息,接口返回:" + applyLabelingAndBindingResponse.getData()) .content("申请捆扎,参数,接口返回:" + jo)
.build(); .build();
luceneExecuteLogService.deviceExecuteLog(logDto2); luceneExecuteLogService.deviceExecuteLog(logDto2);
Map datas = applyLabelingAndBindingResponse.getData(); // Map datas = applyLabelingAndBindingResponse.getData();
packagePLCData(datas); packagePLCData(jo.getString("body"));
requireSucess = true; requireSucess = true;
} else { } else {
LuceneLogDto logDto2 = LuceneLogDto.builder() LuceneLogDto logDto2 = LuceneLogDto.builder()
.device_code(device_code) .device_code(device_code)
.content("申请捆扎失败,接口返回:" + applyLabelingAndBindingResponse.getData()) .content("申请捆扎失败,接口返回:" + jo.getString("body"))
.build(); .build();
luceneExecuteLogService.deviceExecuteLog(logDto2); luceneExecuteLogService.deviceExecuteLog(logDto2);
} }
} else {
message = applyLabelingAndBindingResponse.getMessage();
} }
} }
}
private void packagePLCData(Map datas) { private void packagePLCData(String datas) {
String length = datas.get("length").toString();
String weight = datas.get("weight").toString(); JSONObject jo = JSON.parseObject(datas);
String height = datas.get("height").toString(); String length = jo.get("length").toString();
String isBinding = datas.get("isBinding").toString(); String weight = jo.get("weight").toString();
String isLabeling = datas.get("isLabeling").toString(); String height = jo.get("height").toString();
String printQty = datas.get("printQty").toString(); String isBinding = jo.get("isBinding").toString();
String labelingTemplate = datas.get("labelingTemplate").toString(); String isLabeling = jo.get("isLabeling").toString();
String bindingTemplate = datas.get("bindingTemplate").toString(); String printQty = jo.get("printQty").toString();
String printDevice = datas.get("printDevice").toString(); String labelingTemplate = jo.get("labelingTemplate").toString();
String bundleTimes = datas.get("bundleTimes").toString(); String bindingTemplate = jo.get("bindingTemplate").toString();
String printDevice = jo.get("printDevice").toString();
String bundleTimes = jo.get("bundleTimes").toString();
List list = new ArrayList(); List list = new ArrayList();
Map map = new HashMap(); Map map = new HashMap();
@@ -358,7 +335,7 @@ public class FinishedProductOutBindLableDeviceDriver extends AbstractOpcDeviceDr
list.add(map4); list.add(map4);
Map map5 = new HashMap(); Map map5 = new HashMap();
map5.put("code", "to_command"); map5.put("code", "to_command");
map5.put("value", "10"); map5.put("value", 10);
list.add(map5); list.add(map5);
Map map6 = new HashMap(); Map map6 = new HashMap();
map6.put("code", "to_is_labeling"); map6.put("code", "to_is_labeling");
@@ -483,7 +460,7 @@ public class FinishedProductOutBindLableDeviceDriver extends AbstractOpcDeviceDr
jo.put("isError", this.getIserror()); jo.put("isError", this.getIserror());
jo.put("message", this.getMessage()); jo.put("message", this.getMessage());
jo.put("hand_barcode", hand_barcode); jo.put("hand_barcode", hand_barcode);
jo.put("barcode", this.getMove() == 0 ? null : checkInst() == null ? vehicle_code : checkInst().getVehicle_code()); jo.put("barcode", this.getMove() == 0 ? null : checkInst() == null ? barcode : checkInst().getVehicle_code());
jo.put("is_click", true); jo.put("is_click", true);
jo.put("requireSucess", requireSucess); jo.put("requireSucess", requireSucess);
jo.put("driver_type", "siemens_conveyor"); jo.put("driver_type", "siemens_conveyor");
@@ -751,7 +728,6 @@ public class FinishedProductOutBindLableDeviceDriver extends AbstractOpcDeviceDr
inst = checkInst(); inst = checkInst();
if (inst != null) { if (inst != null) {
inst_message = "当前指令号:" + inst.getInstruction_code() + " " + inst.getStart_point_code() + "->" + inst.getNext_point_code() + " 载具号:" + inst.getVehicle_code(); inst_message = "当前指令号:" + inst.getInstruction_code() + " " + inst.getStart_point_code() + "->" + inst.getNext_point_code() + " 载具号:" + inst.getVehicle_code();
vehicle_code = inst.getVehicle_code();
task_code = inst.getTask_code(); task_code = inst.getTask_code();
if (StrUtil.equals(inst.getInstruction_status(), "0") && StrUtil.equals(this.getDeviceCode(), inst.getStart_device_code())) { if (StrUtil.equals(inst.getInstruction_status(), "0") && StrUtil.equals(this.getDeviceCode(), inst.getStart_device_code())) {
inst.setInstruction_status("1"); inst.setInstruction_status("1");
@@ -761,7 +737,6 @@ public class FinishedProductOutBindLableDeviceDriver extends AbstractOpcDeviceDr
} }
if (StrUtil.equals(inst.getInstruction_status(), "1") || StrUtil.equals(inst.getInstruction_status(), "0")) { if (StrUtil.equals(inst.getInstruction_status(), "1") || StrUtil.equals(inst.getInstruction_status(), "0")) {
if (StrUtil.equals(this.getDeviceCode(), inst.getNext_device_code())) { if (StrUtil.equals(this.getDeviceCode(), inst.getNext_device_code())) {
vehicle_code = inst.getVehicle_code();
inst.setExecute_device_code(this.device_code); inst.setExecute_device_code(this.device_code);
if (mode == 2) { if (mode == 2) {
finish_instruction(); finish_instruction();

View File

@@ -48,6 +48,11 @@ public class ItemProtocol {
*/ */
public static String item_task = "task"; public static String item_task = "task";
/**
* 托盘条码
*/
public static String item_barcode = "barcode";
/** /**
* 动作信号 * 动作信号
*/ */
@@ -175,7 +180,9 @@ public class ItemProtocol {
return this.getOpcIntegerValue(item_action); return this.getOpcIntegerValue(item_action);
} }
public String getBarcode() {
return this.getOpcStringValue(item_barcode);
}
Boolean isonline; Boolean isonline;
@@ -218,7 +225,8 @@ public class ItemProtocol {
list.add(new ItemDto(item_error, "报警信号", "DB600.B6")); list.add(new ItemDto(item_error, "报警信号", "DB600.B6"));
list.add(new ItemDto(item_container_type, "托盘类型", "DB101.B7")); list.add(new ItemDto(item_container_type, "托盘类型", "DB101.B7"));
list.add(new ItemDto(item_task, "任务号", "DB600.D8")); list.add(new ItemDto(item_task, "任务号", "DB600.D8"));
list.add(new ItemDto(item_material_barcode, "物料条码", "DB600.D9")); list.add(new ItemDto(item_material_barcode, "物料条码", "DB81.STRING14.50"));
list.add(new ItemDto(item_barcode, "托盘条码", "DB602.STRING1.50"));
return list; return list;
} }

View File

@@ -6,6 +6,7 @@ import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HttpResponse; import cn.hutool.http.HttpResponse;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import lombok.Data; import lombok.Data;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
@@ -73,8 +74,7 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv
DeviceAppService deviceAppservice = SpringContextHolder.getBean(DeviceAppService.class); DeviceAppService deviceAppservice = SpringContextHolder.getBean(DeviceAppService.class);
@Autowired LuceneExecuteLogService luceneExecuteLogService = SpringContextHolder.getBean(LuceneExecuteLogService.class);
LuceneExecuteLogService luceneExecuteLogService;
//工作模式 //工作模式
int mode = 0; int mode = 0;
int last_mode = 0; int last_mode = 0;
@@ -244,7 +244,12 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv
List toInstructions; List toInstructions;
//木箱入库申请入库任务 //木箱入库申请入库任务
if (mode == 6 && !requireSucess){ if (mode == 6 && !requireSucess){
applyIn(); applyIn(StorageTypeEnum.BOX_IN.getType());
}
//子卷入库申请入库任务
if (mode == 7 && !requireSucess){
applyIn(StorageTypeEnum.STORAGE.getType());
} }
//申请入库指令、异常位指令 //申请入库指令、异常位指令
@@ -331,7 +336,7 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv
} }
} }
private void applyIn() { private void applyIn(String type) {
Date date = new Date(); Date date = new Date();
if (date.getTime() - this.require_apply_strangulation_time.getTime() if (date.getTime() - this.require_apply_strangulation_time.getTime()
< (long) this.instruction_require_time_out) { < (long) this.instruction_require_time_out) {
@@ -343,13 +348,30 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv
param.put("device_code", device_code); param.put("device_code", device_code);
param.put("vehicle_code", barcode); param.put("vehicle_code", barcode);
param.put("material_barcode", material_barcode); param.put("material_barcode", material_barcode);
param.put("type", StorageTypeEnum.STORAGE.getType()); param.put("type", type);
logServer.deviceExecuteLog(this.device_code, "", "", "木箱入库申请入库任务,参数:" + param); LuceneLogDto logDto = LuceneLogDto.builder()
HttpResponse response = acsToWmsService.shipDeviceUpdate(param); .device_code(device_code)
if (response == null || response.getStatus() == 200) { .content("申请空托盘出入库,参数:" + param)
logServer.deviceExecuteLog(this.device_code, "", "", "木箱入库申请入库任务,接口返回:" + response.body()); .build();
luceneExecuteLogService.deviceExecuteLog(logDto);
String response = acsToWmsService.applyTwo(param);
JSONObject jo = JSON.parseObject(response);
if (response == null || jo.getInteger("status") == 200) {
LuceneLogDto logDto2 = LuceneLogDto.builder()
.device_code(device_code)
.content("木箱入库申请入库任务,参数,接口返回:" + jo)
.build();
luceneExecuteLogService.deviceExecuteLog(logDto2);
this.requireSucess = true;
}else {
LuceneLogDto logDto2 = LuceneLogDto.builder()
.device_code(device_code)
.content("木箱入库申请入库任务,返回参数:" + jo.getString("body"))
.build();
luceneExecuteLogService.deviceExecuteLog(logDto2);
} }
} catch (Exception e) { }
catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
} }

View File

@@ -191,8 +191,8 @@ public class ItemProtocol {
list.add(new ItemDto(item_carrier_direction, "托盘方向", "DB1.B8")); list.add(new ItemDto(item_carrier_direction, "托盘方向", "DB1.B8"));
list.add(new ItemDto(item_qty, "数量", "DB1.B9")); list.add(new ItemDto(item_qty, "数量", "DB1.B9"));
list.add(new ItemDto(item_weight, "重量", "DB1.B10")); list.add(new ItemDto(item_weight, "重量", "DB1.B10"));
list.add(new ItemDto(item_barcode, "托盘条码", "DB1.B11")); list.add(new ItemDto(item_barcode, "托盘条码", "DB602.STRING1.50"));
list.add(new ItemDto(item_material_barcode, "子卷条码", "DB1.B12")); list.add(new ItemDto(item_material_barcode, "子卷条码", "DB601.STRING1.50"));
return list; return list;
} }

View File

@@ -23,9 +23,15 @@ public class InteractionJsonDTO {
*/ */
private String template; private String template;
/** /**
*是否是最后一个 *是否离开
*/ */
private String isLastOne; private String isLeave;
/**
*捆扎次数
*/
private String bindingTimes;
/** /**
*是否捆轧 *是否捆轧

View File

@@ -449,8 +449,8 @@ public class TrappedManipulatorManipulatorDeviceDriver extends AbstractOpcDevice
list.add(map8); list.add(map8);
} }
if (ObjectUtil.isNotEmpty(interactionJsonDTO.getTemplate())) { if (ObjectUtil.isNotEmpty(interactionJsonDTO.getTemplate())) {
map9.put("code", "to_last_one"); map9.put("code", "to_is_leave");
map9.put("value", interactionJsonDTO.getIsLastOne()); map9.put("value", interactionJsonDTO.getIsLeave());
list.add(map9); list.add(map9);
} }
if (ObjectUtil.isNotEmpty(interactionJsonDTO.getIsBinding())) { if (ObjectUtil.isNotEmpty(interactionJsonDTO.getIsBinding())) {

View File

@@ -0,0 +1,25 @@
package org.nl.acs.device_driver.stacker.standard_stacker;
import lombok.AllArgsConstructor;
import lombok.Getter;
@Getter
@AllArgsConstructor
public enum StandarStirageErroEnum {
FILL("1", "入库货位满"),
VOIDANCE("2", "出库货位空"),
BLOCK_OUT("3", "取货潜货位阻挡"),
BLOCK_IN("4", "放货潜货位阻挡");
/**
* 索引
*/
private String type;
/**
* 编码
*/
private String value;
}

View File

@@ -5,6 +5,8 @@ import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HttpResponse;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import lombok.Data; import lombok.Data;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
@@ -21,6 +23,8 @@ import org.nl.acs.device_driver.conveyor.belt_conveyor.BeltConveyorDeviceDriver;
import org.nl.acs.device_driver.conveyor.siemens_conveyor.SiemensConveyorDeviceDriver; import org.nl.acs.device_driver.conveyor.siemens_conveyor.SiemensConveyorDeviceDriver;
import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver; import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver;
import org.nl.acs.device_driver.driver.ExecutableDeviceDriver; import org.nl.acs.device_driver.driver.ExecutableDeviceDriver;
import org.nl.acs.ext.wms.service.AcsToWmsService;
import org.nl.acs.ext.wms.service.impl.AcsToWmsServiceImpl;
import org.nl.acs.history.ErrorUtil; import org.nl.acs.history.ErrorUtil;
import org.nl.acs.history.domain.AcsDeviceErrorLog; import org.nl.acs.history.domain.AcsDeviceErrorLog;
import org.nl.acs.history.service.DeviceErrorLogService; import org.nl.acs.history.service.DeviceErrorLogService;
@@ -35,10 +39,13 @@ import org.nl.acs.opc.DeviceAppServiceImpl;
import org.nl.acs.route.service.RouteLineService; import org.nl.acs.route.service.RouteLineService;
import org.nl.acs.route.service.dto.RouteLineDto; import org.nl.acs.route.service.dto.RouteLineDto;
import org.nl.acs.route.service.impl.RouteLineServiceImpl; import org.nl.acs.route.service.impl.RouteLineServiceImpl;
import org.nl.acs.task.domain.Task;
import org.nl.acs.task.service.TaskService; import org.nl.acs.task.service.TaskService;
import org.nl.acs.task.service.dto.TaskDto; import org.nl.acs.task.service.dto.TaskDto;
import org.nl.config.SpringContextHolder; import org.nl.config.SpringContextHolder;
import org.nl.config.language.LangProcess; import org.nl.config.language.LangProcess;
import org.nl.config.lucene.service.LuceneExecuteLogService;
import org.nl.config.lucene.service.dto.LuceneLogDto;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import java.util.*; import java.util.*;
@@ -67,6 +74,9 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
@Autowired @Autowired
DeviceErrorLogService errorLogServer = SpringContextHolder.getBean(DeviceErrorLogServiceImpl.class); DeviceErrorLogService errorLogServer = SpringContextHolder.getBean(DeviceErrorLogServiceImpl.class);
AcsToWmsService acsToWmsService = SpringContextHolder.getBean(AcsToWmsServiceImpl.class);
LuceneExecuteLogService luceneExecuteLogService = SpringContextHolder.getBean("luceneExecuteLogServiceImpl");
/** /**
* 禁止入库 * 禁止入库
@@ -344,19 +354,21 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
message = LangProcess.msg("universal_message3"); message = LangProcess.msg("universal_message3");
//指定库位满入 //指定库位满入
if (error == 5) { if (error == 5) {
applyUpdatePointCode(StandarStirageErroEnum.FILL.getType());
} }
//空出 //空出
if (error == 6) { if (error == 6) {
applyUpdatePointCode(StandarStirageErroEnum.VOIDANCE.getType());
} }
//浅货位有货 //浅货位有货
if (error == 16) { if (error == 16) {
//放货 //放货
if (cargoMove == 1) { if (cargoMove == 1) {
applyUpdatePointCode(StandarStirageErroEnum.BLOCK_OUT.getType());
} else if (cargoMove == 0) { } else if (cargoMove == 0) {
//取货 //取货
applyUpdatePointCode(StandarStirageErroEnum.BLOCK_IN.getType());
} }
@@ -543,6 +555,91 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
last_fork_runingTimes = fork_runingTimes;*/ last_fork_runingTimes = fork_runingTimes;*/
} }
/**
* 申请更新点位
* @param type
*/
private void applyUpdatePointCode(String type) {
Date date = new Date();
if (date.getTime() - this.instruction_require_time.getTime() < (long) this.instruction_require_time_out) {
log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out);
return;
} else {
Instruction instruction = instructionService.findByCode(String.valueOf(task));
if (ObjectUtil.isNotEmpty(instruction)){
message = LangProcess.msg("one_message9");
return;
}
JSONObject param = new JSONObject();
param.put("task_code", instruction.getTask_code());
param.put("type", type);
String response = acsToWmsService.applyUpdatePointCode(param);
JSONObject jo = JSON.parseObject(response);
if (StrUtil.isNotEmpty(jo.getString("body")) || jo.getInteger("status") == 200) {
LuceneLogDto logDto2 = LuceneLogDto.builder()
.device_code(device_code)
.content("申请更新点位,参数,接口返回:" + jo)
.build();
luceneExecuteLogService.deviceExecuteLog(logDto2);
JSONObject pointCodeJson = JSON.parseObject(jo.getString("body"));
String poinCode = pointCodeJson.getString("poin_code").toString();
if (type.equals(StandarStirageErroEnum.BLOCK_OUT.getType()) || type.equals(StandarStirageErroEnum.VOIDANCE.getType())){
updateData1(poinCode, instruction);
}
if (type.equals(StandarStirageErroEnum.BLOCK_IN.getType()) || type.equals(StandarStirageErroEnum.FILL.getType())){
updateData2(poinCode, instruction);
}
this.requireSucess = true;
} else {
LuceneLogDto logDto2 = LuceneLogDto.builder()
.device_code(device_code)
.content("申请更新点位,返回参数:" + jo.getString("body"))
.build();
luceneExecuteLogService.deviceExecuteLog(logDto2);
}
}
}
private void updateData2(String poinCode, Instruction instruction) {
Instruction instructionUpdate = new Instruction();
instructionUpdate.setNext_point_code(poinCode);
String[] split = poinCode.split("-");
Device endPoint = deviceAppService.findDeviceByCode(split[0]);
instructionUpdate.setTo_x(endPoint.getExtraValue().get("x").toString());
instructionUpdate.setNext_device_code(split[0]);
instructionUpdate.setTo_y(split[1]);
instructionUpdate.setTo_z(split[2]);
instructionUpdate.setInstruction_code(String.valueOf(task));
instructionService.updateByInstructionCode(instructionUpdate);
Task taskUpdate = new Task();
taskUpdate.setTo_x(endPoint.getExtraValue().get("x").toString());
taskUpdate.setNext_device_code(split[0]);
taskUpdate.setTo_y(split[1]);
taskUpdate.setTo_z(split[2]);
taskUpdate.setTask_code(instruction.getTask_code());
taskserver.updateByTaskCode(taskUpdate);
}
private void updateData1(String poinCode, Instruction instruction) {
Instruction instructionUpdate = new Instruction();
instructionUpdate.setStart_point_code(poinCode);
String[] split = poinCode.split("-");
Device starPoint = deviceAppService.findDeviceByCode(split[0]);
instructionUpdate.setFrom_x(starPoint.getExtraValue().get("x").toString());
instructionUpdate.setStart_device_code(split[0]);
instructionUpdate.setFrom_y(split[1]);
instructionUpdate.setFrom_z(split[2]);
instructionUpdate.setInstruction_code(String.valueOf(task));
instructionService.updateByInstructionCode(instructionUpdate);
Task taskUpdate = new Task();
taskUpdate.setFrom_x(starPoint.getExtraValue().get("x").toString());
taskUpdate.setStart_device_code(split[0]);
taskUpdate.setFrom_y(split[1]);
taskUpdate.setFrom_z(split[2]);
taskUpdate.setTask_code(instruction.getTask_code());
taskserver.updateByTaskCode(taskUpdate);
}
/** /**
* 申请任务 * 申请任务

View File

@@ -71,7 +71,7 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
@Autowired @Autowired
DeviceErrorLogService deviceErrorLogService = SpringContextHolder.getBean(DeviceErrorLogServiceImpl.class); DeviceErrorLogService deviceErrorLogService = SpringContextHolder.getBean(DeviceErrorLogServiceImpl.class);
@Autowired @Autowired
private LimitRegionalService limitRegionalService=SpringContextHolder.getBean(LimitRegionalService.class); private LimitRegionalService limitRegionalService = SpringContextHolder.getBean(LimitRegionalService.class);
@Autowired @Autowired
LuceneExecuteLogService luceneExecuteLogService = SpringContextHolder.getBean(LuceneExecuteLogService.class); LuceneExecuteLogService luceneExecuteLogService = SpringContextHolder.getBean(LuceneExecuteLogService.class);
@@ -177,51 +177,11 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
y_position = this.itemProtocol.getY_position(); y_position = this.itemProtocol.getY_position();
iserror = this.itemProtocol.device_status; iserror = this.itemProtocol.device_status;
if (to_onset != last_to_onset) { if(mode != last_mode){
logServer.deviceExecuteLog(this.device_code, "", "", "信号to_onset" + last_to_onset + "->" + to_onset);
}
if (to_command != last_to_command) {
logServer.deviceExecuteLog(this.device_code, "", "", "信号to_command" + last_to_command + "->" + to_command);
}
if (to_target != last_to_target) {
logServer.deviceExecuteLog(this.device_code, "", "", "信号to_target" + last_to_target + "->" + to_target);
}
if (to_task != last_to_task) {
logServer.deviceExecuteLog(this.device_code, "", "", "信号to_task" + last_to_task + "->" + to_task);
}
if (mode != last_mode) {
requireSucess = false; requireSucess = false;
logServer.deviceItemValue(this.device_code, "mode", String.valueOf(mode));
logServer.deviceExecuteLog(this.device_code, "", "", "信号mode" + last_mode + "->" + mode);
}
if (move != last_move) {
logServer.deviceItemValue(this.device_code, "move", String.valueOf(move));
logServer.deviceExecuteLog(this.device_code, "", "", "信号move" + last_move + "->" + move);
}
if (action != last_action) {
logServer.deviceItemValue(this.device_code, "action", String.valueOf(action));
logServer.deviceExecuteLog(this.device_code, "", "", "信号action" + last_action + "->" + action);
}
if (error != last_error) {
logServer.deviceItemValue(this.device_code, "error", String.valueOf(error));
logServer.deviceExecuteLog(this.device_code, "", "", "信号error" + last_error + "->" + error);
}
if (walk_y != last_walk_y) {
logServer.deviceItemValue(this.device_code, "walk_y", String.valueOf(walk_y));
logServer.deviceExecuteLog(this.device_code, "", "", "信号walk_y" + last_walk_y + "->" + walk_y);
}
if (task != last_task) {
logServer.deviceItemValue(this.device_code, "task", String.valueOf(task));
logServer.deviceExecuteLog(this.device_code, "", "", "信号task" + last_task + "->" + task);
}
if (x_position != last_x_position) {
logServer.deviceItemValue(this.device_code, "x_position", String.valueOf(x_position));
logServer.deviceExecuteLog(this.device_code, "", "", "信号x_position" + last_x_position + "->" + x_position);
}
if (y_position != last_y_position) {
logServer.deviceItemValue(this.device_code, "y_position", String.valueOf(y_position));
logServer.deviceExecuteLog(this.device_code, "", "", "信号y_position" + last_y_position + "->" + y_position);
} }
update_instruction_status(); update_instruction_status();
} catch (Exception var17) { } catch (Exception var17) {
@@ -356,32 +316,32 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
HongXiangConveyorDeviceDriver hongXiangConveyorDeviceDriver; HongXiangConveyorDeviceDriver hongXiangConveyorDeviceDriver;
StandardInspectSiteDeviceDriver standardInspectSiteDeviceDriver; StandardInspectSiteDeviceDriver standardInspectSiteDeviceDriver;
OvenInspectSiteDeviceDriver ovenInspectSiteDeviceDriver; OvenInspectSiteDeviceDriver ovenInspectSiteDeviceDriver;
if(startdevice.getDeviceDriver() instanceof OvenInspectSiteDeviceDriver && nextdevice.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver){ if (startdevice.getDeviceDriver() instanceof OvenInspectSiteDeviceDriver && nextdevice.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) {
ovenInspectSiteDeviceDriver = (OvenInspectSiteDeviceDriver) startdevice.getDeviceDriver(); ovenInspectSiteDeviceDriver = (OvenInspectSiteDeviceDriver) startdevice.getDeviceDriver();
standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) nextdevice.getDeviceDriver(); standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) nextdevice.getDeviceDriver();
if(ovenInspectSiteDeviceDriver.getMove() != 1 || standardInspectSiteDeviceDriver.getMove() == 1){ if (ovenInspectSiteDeviceDriver.getMove() != 1 || standardInspectSiteDeviceDriver.getMove() == 1) {
notCreateInstMessage = "手动创建指令未下发电气信号原因->烘箱检测站点-普通检测站点:" + ovenInspectSiteDeviceDriver.getDevicecode() + notCreateInstMessage = "手动创建指令未下发电气信号原因->烘箱检测站点-普通检测站点:" + ovenInspectSiteDeviceDriver.getDevicecode() +
"无货,无法下发指令或"+standardInspectSiteDeviceDriver.getDevicecode()+ "有货,无法下发指令!" +"!指令号:" + instruction.getInstruction_code(); "无货,无法下发指令或" + standardInspectSiteDeviceDriver.getDevicecode() + "有货,无法下发指令!" + "!指令号:" + instruction.getInstruction_code();
return false; return false;
} }
//判断经过的烘箱是否关门 //判断经过的烘箱是否关门
boolean hongxiangCloseDoor = this.hongxiangCloseDoor(start_device_code, next_device_code); boolean hongxiangCloseDoor = this.hongxiangCloseDoor(start_device_code, next_device_code);
if(!hongxiangCloseDoor){ if (!hongxiangCloseDoor) {
notCreateInstMessage = "手动创建指令未下发电气信号原因->取货位:" + start_device_code + ",放货位:" + next_device_code + ",存在关联的同一列烘箱设备未关门!指令号:" + instruction.getInstruction_code(); notCreateInstMessage = "手动创建指令未下发电气信号原因->取货位:" + start_device_code + ",放货位:" + next_device_code + ",存在关联的同一列烘箱设备未关门!指令号:" + instruction.getInstruction_code();
return false; return false;
} }
} }
if(nextdevice.getDeviceDriver() instanceof OvenInspectSiteDeviceDriver && startdevice.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver){ if (nextdevice.getDeviceDriver() instanceof OvenInspectSiteDeviceDriver && startdevice.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) {
ovenInspectSiteDeviceDriver = (OvenInspectSiteDeviceDriver) nextdevice.getDeviceDriver(); ovenInspectSiteDeviceDriver = (OvenInspectSiteDeviceDriver) nextdevice.getDeviceDriver();
standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) startdevice.getDeviceDriver(); standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) startdevice.getDeviceDriver();
if(ovenInspectSiteDeviceDriver.getMove() != 1 || standardInspectSiteDeviceDriver.getMove() == 1){ if (ovenInspectSiteDeviceDriver.getMove() != 1 || standardInspectSiteDeviceDriver.getMove() == 1) {
notCreateInstMessage = "手动创建指令未下发电气信号原因->烘箱检测站点-普通检测站点:" + ovenInspectSiteDeviceDriver.getDevicecode() + notCreateInstMessage = "手动创建指令未下发电气信号原因->烘箱检测站点-普通检测站点:" + ovenInspectSiteDeviceDriver.getDevicecode() +
"无货,无法下发指令或"+standardInspectSiteDeviceDriver.getDevicecode()+ "有货,无法下发指令!" +"!指令号:" + instruction.getInstruction_code(); "无货,无法下发指令或" + standardInspectSiteDeviceDriver.getDevicecode() + "有货,无法下发指令!" + "!指令号:" + instruction.getInstruction_code();
return false; return false;
} }
//判断经过的烘箱是否关门 //判断经过的烘箱是否关门
boolean hongxiangCloseDoor = this.hongxiangCloseDoor( next_device_code, start_device_code); boolean hongxiangCloseDoor = this.hongxiangCloseDoor(next_device_code, start_device_code);
if(!hongxiangCloseDoor){ if (!hongxiangCloseDoor) {
notCreateInstMessage = "手动创建指令未下发电气信号原因->取货位:" + start_device_code + ",放货位:" + next_device_code + ",存在关联的同一列烘箱设备未关门!指令号:" + instruction.getInstruction_code(); notCreateInstMessage = "手动创建指令未下发电气信号原因->取货位:" + start_device_code + ",放货位:" + next_device_code + ",存在关联的同一列烘箱设备未关门!指令号:" + instruction.getInstruction_code();
return false; return false;
} }
@@ -435,9 +395,14 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
} }
String start_addr = startDevice.getExtraValue().get("address").toString(); String start_addr = startDevice.getExtraValue().get("address").toString();
String next_addr = nextDevice.getExtraValue().get("address").toString(); String next_addr = nextDevice.getExtraValue().get("address").toString();
logServer.deviceExecuteLog(device_code, "", "", "当前设备:" + device_code + ",下发指令:" String msg = "当前设备:" + device_code + ",下发指令:"
+ instruction.getInstruction_code() + ",指令起点:" + instruction.getStart_device_code() + instruction.getInstruction_code() + ",指令起点:" + instruction.getStart_device_code()
+ ",指令终点:" + instruction.getNext_device_code()); + ",指令终点:" + instruction.getNext_device_code();
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code)
.content(msg)
.build();
luceneExecuteLogService.deviceExecuteLog(logDto);
List list = new ArrayList<>(); List list = new ArrayList<>();
Map map = new HashMap(); Map map = new HashMap();
map.put("to_onset", start_addr); map.put("to_onset", start_addr);
@@ -482,32 +447,32 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
HongXiangConveyorDeviceDriver hongXiangConveyorDeviceDriver; HongXiangConveyorDeviceDriver hongXiangConveyorDeviceDriver;
StandardInspectSiteDeviceDriver standardInspectSiteDeviceDriver; StandardInspectSiteDeviceDriver standardInspectSiteDeviceDriver;
OvenInspectSiteDeviceDriver ovenInspectSiteDeviceDriver; OvenInspectSiteDeviceDriver ovenInspectSiteDeviceDriver;
if(startdevice.getDeviceDriver() instanceof OvenInspectSiteDeviceDriver && nextdevice.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver){ if (startdevice.getDeviceDriver() instanceof OvenInspectSiteDeviceDriver && nextdevice.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) {
ovenInspectSiteDeviceDriver = (OvenInspectSiteDeviceDriver) startdevice.getDeviceDriver(); ovenInspectSiteDeviceDriver = (OvenInspectSiteDeviceDriver) startdevice.getDeviceDriver();
standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) nextdevice.getDeviceDriver(); standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) nextdevice.getDeviceDriver();
if(ovenInspectSiteDeviceDriver.getMove() != 1 || standardInspectSiteDeviceDriver.getMove() == 1){ if (ovenInspectSiteDeviceDriver.getMove() != 1 || standardInspectSiteDeviceDriver.getMove() == 1) {
notCreateInstMessage = "手动创建指令未下发电气信号原因->烘箱检测站点-普通检测站点:" + ovenInspectSiteDeviceDriver.getDevicecode() + notCreateInstMessage = "手动创建指令未下发电气信号原因->烘箱检测站点-普通检测站点:" + ovenInspectSiteDeviceDriver.getDevicecode() +
"无货,无法下发指令或"+standardInspectSiteDeviceDriver.getDevicecode()+ "有货,无法下发指令!" +"!任务号:" + task.getTask_code(); "无货,无法下发指令或" + standardInspectSiteDeviceDriver.getDevicecode() + "有货,无法下发指令!" + "!任务号:" + task.getTask_code();
return false; return false;
} }
//判断经过的烘箱是否关门 //判断经过的烘箱是否关门
boolean hongxiangCloseDoor = this.hongxiangCloseDoor(task.getStart_device_code(), task.getNext_device_code()); boolean hongxiangCloseDoor = this.hongxiangCloseDoor(task.getStart_device_code(), task.getNext_device_code());
if(!hongxiangCloseDoor){ if (!hongxiangCloseDoor) {
notCreateInstMessage = "手动创建指令未下发电气信号原因->取货位:" + task.getStart_device_code() + ",放货位:" + task.getNext_device_code() + ",存在关联的同一列烘箱设备未关门!任务号:" + task.getTask_code(); notCreateInstMessage = "手动创建指令未下发电气信号原因->取货位:" + task.getStart_device_code() + ",放货位:" + task.getNext_device_code() + ",存在关联的同一列烘箱设备未关门!任务号:" + task.getTask_code();
return false; return false;
} }
} }
if(nextdevice.getDeviceDriver() instanceof OvenInspectSiteDeviceDriver && startdevice.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver){ if (nextdevice.getDeviceDriver() instanceof OvenInspectSiteDeviceDriver && startdevice.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) {
ovenInspectSiteDeviceDriver = (OvenInspectSiteDeviceDriver) nextdevice.getDeviceDriver(); ovenInspectSiteDeviceDriver = (OvenInspectSiteDeviceDriver) nextdevice.getDeviceDriver();
standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) startdevice.getDeviceDriver(); standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) startdevice.getDeviceDriver();
if(ovenInspectSiteDeviceDriver.getMove() != 1 || standardInspectSiteDeviceDriver.getMove() == 1){ if (ovenInspectSiteDeviceDriver.getMove() != 1 || standardInspectSiteDeviceDriver.getMove() == 1) {
notCreateInstMessage = "手动创建指令未下发电气信号原因->烘箱检测站点-普通检测站点:" + ovenInspectSiteDeviceDriver.getDevicecode() + notCreateInstMessage = "手动创建指令未下发电气信号原因->烘箱检测站点-普通检测站点:" + ovenInspectSiteDeviceDriver.getDevicecode() +
"无货,无法下发指令或"+standardInspectSiteDeviceDriver.getDevicecode()+ "有货,无法下发指令!" +"!任务号:" + task.getTask_code(); "无货,无法下发指令或" + standardInspectSiteDeviceDriver.getDevicecode() + "有货,无法下发指令!" + "!任务号:" + task.getTask_code();
return false; return false;
} }
//判断经过的烘箱是否关门 //判断经过的烘箱是否关门
boolean hongxiangCloseDoor = this.hongxiangCloseDoor(task.getStart_device_code(), task.getNext_device_code()); boolean hongxiangCloseDoor = this.hongxiangCloseDoor(task.getStart_device_code(), task.getNext_device_code());
if(!hongxiangCloseDoor){ if (!hongxiangCloseDoor) {
notCreateInstMessage = "手动创建指令未下发电气信号原因->取货位:" + task.getStart_device_code() + ",放货位:" + task.getNext_device_code() + ",存在关联的同一列烘箱设备未关门!任务号:" + task.getTask_code(); notCreateInstMessage = "手动创建指令未下发电气信号原因->取货位:" + task.getStart_device_code() + ",放货位:" + task.getNext_device_code() + ",存在关联的同一列烘箱设备未关门!任务号:" + task.getTask_code();
return false; return false;
} }
@@ -616,6 +581,9 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
} }
String start_addr = startDevice.getExtraValue().get("address").toString(); String start_addr = startDevice.getExtraValue().get("address").toString();
String next_addr = nextDevice.getExtraValue().get("address").toString(); String next_addr = nextDevice.getExtraValue().get("address").toString();
if(ObjectUtil.isEmpty(start_addr) || ObjectUtil.isEmpty(next_addr)){
throw new BadRequestException("设备:" + startDevice.getDevice_code() + "或设备:" + nextDevice.getDevice_code() + "地址值!");
}
String msg = "当前设备:" + device_code + ",下发指令:" String msg = "当前设备:" + device_code + ",下发指令:"
+ instdto.getInstruction_code() + ",指令起点:" + instdto.getStart_device_code() + instdto.getInstruction_code() + ",指令起点:" + instdto.getStart_device_code()
+ ",指令终点:" + instdto.getNext_device_code(); + ",指令终点:" + instdto.getNext_device_code();
@@ -627,16 +595,16 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
List list = new ArrayList<>(); List list = new ArrayList<>();
Map map = new HashMap(); Map map = new HashMap();
map.put("code", "to_onset"); map.put("code", "to_onset");
map.put("value",StrUtil.isNotBlank(start_addr)? start_addr : "0"); map.put("value", StrUtil.isNotBlank(start_addr) ? start_addr : "0");
Map map1 = new HashMap(); Map map1 = new HashMap();
map1.put("code", "to_target"); map1.put("code", "to_target");
map1.put("value",StrUtil.isNotBlank(next_addr)? next_addr : "0"); map1.put("value", StrUtil.isNotBlank(next_addr) ? next_addr : "0");
Map map2 = new HashMap(); Map map2 = new HashMap();
map2.put("code", "to_task"); map2.put("code", "to_task");
map2.put("value",instdto.getInstruction_code()); map2.put("value", instdto.getInstruction_code());
Map map3 = new HashMap(); Map map3 = new HashMap();
map3.put("code", "to_command"); map3.put("code", "to_command");
map3.put("value","1"); map3.put("value", "1");
list.add(map); list.add(map);
list.add(map1); list.add(map1);
list.add(map2); list.add(map2);
@@ -667,7 +635,7 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
/** /**
* 判断经过的烘箱是否关门 * 判断经过的烘箱是否关门
*/ */
private boolean hongxiangCloseDoor(String start_device_code,String next_device_code) { private boolean hongxiangCloseDoor(String start_device_code, String next_device_code) {
boolean flag = true; boolean flag = true;
List<String> ovenDeviceCodeList = null; List<String> ovenDeviceCodeList = null;
Device startDevice = deviceAppService.findDeviceByCode(start_device_code); Device startDevice = deviceAppService.findDeviceByCode(start_device_code);
@@ -682,7 +650,7 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
ovenDeviceCodeList = ovenInspectSiteDeviceDriver.getExtraDeviceCodes("link_device_code"); ovenDeviceCodeList = ovenInspectSiteDeviceDriver.getExtraDeviceCodes("link_device_code");
} }
HongXiangConveyorDeviceDriver hongXiangConveyorDeviceDriver; HongXiangConveyorDeviceDriver hongXiangConveyorDeviceDriver;
if(CollUtil.isNotEmpty(ovenDeviceCodeList)){ if (CollUtil.isNotEmpty(ovenDeviceCodeList)) {
for (String s : ovenDeviceCodeList) { for (String s : ovenDeviceCodeList) {
Device device = deviceAppService.findDeviceByCode(s); Device device = deviceAppService.findDeviceByCode(s);
if (device.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) { if (device.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) {
@@ -701,6 +669,7 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
/** /**
* 判断取货位或放货位为烘箱设备时关联的同一列烘箱设备是否有开门 * 判断取货位或放货位为烘箱设备时关联的同一列烘箱设备是否有开门
*
* @param start_device_code * @param start_device_code
* @param next_device_code * @param next_device_code
* @return * @return
@@ -1087,7 +1056,7 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
} else if (this.getAction() == 4) { } else if (this.getAction() == 4) {
action = "放货完成"; action = "放货完成";
} }
if(error == 0 && iserror){ if (error == 0 && iserror) {
this.setMessage(LangProcess.msg("universal_message4")); this.setMessage(LangProcess.msg("universal_message4"));
} }
jo.put("device_name", this.getDevice().getDevice_name()); jo.put("device_name", this.getDevice().getDevice_name());
@@ -1195,4 +1164,51 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
return null; return null;
} }
/*if (to_onset != last_to_onset) {
logServer.deviceExecuteLog(this.device_code, "", "", "信号to_onset" + last_to_onset + "->" + to_onset);
}
if (to_command != last_to_command) {
logServer.deviceExecuteLog(this.device_code, "", "", "信号to_command" + last_to_command + "->" + to_command);
}
if (to_target != last_to_target) {
logServer.deviceExecuteLog(this.device_code, "", "", "信号to_target" + last_to_target + "->" + to_target);
}
if (to_task != last_to_task) {
logServer.deviceExecuteLog(this.device_code, "", "", "信号to_task" + last_to_task + "->" + to_task);
}
if (mode != last_mode) {
requireSucess = false;
logServer.deviceItemValue(this.device_code, "mode", String.valueOf(mode));
logServer.deviceExecuteLog(this.device_code, "", "", "信号mode" + last_mode + "->" + mode);
}
if (move != last_move) {
logServer.deviceItemValue(this.device_code, "move", String.valueOf(move));
logServer.deviceExecuteLog(this.device_code, "", "", "信号move" + last_move + "->" + move);
}
if (action != last_action) {
logServer.deviceItemValue(this.device_code, "action", String.valueOf(action));
logServer.deviceExecuteLog(this.device_code, "", "", "信号action" + last_action + "->" + action);
}
if (error != last_error) {
logServer.deviceItemValue(this.device_code, "error", String.valueOf(error));
logServer.deviceExecuteLog(this.device_code, "", "", "信号error" + last_error + "->" + error);
}
if (walk_y != last_walk_y) {
logServer.deviceItemValue(this.device_code, "walk_y", String.valueOf(walk_y));
logServer.deviceExecuteLog(this.device_code, "", "", "信号walk_y" + last_walk_y + "->" + walk_y);
}
if (task != last_task) {
logServer.deviceItemValue(this.device_code, "task", String.valueOf(task));
logServer.deviceExecuteLog(this.device_code, "", "", "信号task" + last_task + "->" + task);
}
if (x_position != last_x_position) {
logServer.deviceItemValue(this.device_code, "x_position", String.valueOf(x_position));
logServer.deviceExecuteLog(this.device_code, "", "", "信号x_position" + last_x_position + "->" + x_position);
}
if (y_position != last_y_position) {
logServer.deviceItemValue(this.device_code, "y_position", String.valueOf(y_position));
logServer.deviceExecuteLog(this.device_code, "", "", "信号y_position" + last_y_position + "->" + y_position);
}*/
} }

View File

@@ -159,6 +159,7 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
task = this.itemProtocol.getTask(); task = this.itemProtocol.getTask();
x_position = this.itemProtocol.getX_position(); x_position = this.itemProtocol.getX_position();
y_position = this.itemProtocol.getY_position(); y_position = this.itemProtocol.getY_position();
heartbeat = this.itemProtocol.getHeartbeat();
if (mode != last_mode) { if (mode != last_mode) {
requireSucess = false; requireSucess = false;
logServer.deviceItemValue(this.device_code, "mode", String.valueOf(mode)); logServer.deviceItemValue(this.device_code, "mode", String.valueOf(mode));

View File

@@ -14,7 +14,9 @@ public enum StorageTypeEnum {
DISKS_OUT("3", "空盘出库"), DISKS_OUT("3", "空盘出库"),
ERROR("4", "异常处理位"); ERROR("4", "异常处理位"),
BOX_IN("5", "木箱入库");
/** /**
* 索引 * 索引
*/ */

View File

@@ -1,5 +1,6 @@
package org.nl.acs.ext.wms.data; package org.nl.acs.ext.wms.data;
import com.alibaba.fastjson.JSONObject;
import lombok.Data; import lombok.Data;
import org.nl.acs.common.base.CommonFinalParam; import org.nl.acs.common.base.CommonFinalParam;
@@ -194,4 +195,5 @@ public class CreateTaskRequest extends BaseRequest {
private String bushing_num; private String bushing_num;
private String paper_array; private String paper_array;
private JSONObject interaction_json;
} }

View File

@@ -6,6 +6,7 @@ import lombok.Data;
public class ApplyLabelingAndBindingRequest extends BaseRequest { public class ApplyLabelingAndBindingRequest extends BaseRequest {
private String vehicle_code; private String vehicle_code;
private String device_code; private String device_code;
private Integer task_code;
/** /**
* 1:贴标、捆扎申请 * 1:贴标、捆扎申请
* 2:烘箱 * 2:烘箱

View File

@@ -174,4 +174,5 @@ public interface AcsToWmsService {
void sendDeviceStatus(JSONObject param); void sendDeviceStatus(JSONObject param);
String applyUpdatePointCode(JSONObject param);
} }

View File

@@ -239,7 +239,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
MDC.put(log_file_type, log_type); MDC.put(log_file_type, log_type);
log.info("applyTaskToWms-----输入参数{}", param); log.info("applyTaskToWms-----输入参数{}", param);
String wmsurl = paramService.findByCode(AcsConfig.WMSURL).getValue(); String wmsurl = paramService.findByCode(AcsConfig.WMSURL).getValue();
AddressDto addressDto = addressService.findByCode("applyTwo"); AddressDto addressDto = addressService.findByCode("deviceApplyTwo");
String url = wmsurl + addressDto.getMethods_url(); String url = wmsurl + addressDto.getMethods_url();
HttpResponse result2 = null; HttpResponse result2 = null;
try { try {
@@ -279,7 +279,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
MDC.put(log_file_type, log_type); MDC.put(log_file_type, log_type);
log.info("applyTaskToWms-----输入参数{}", param); log.info("applyTaskToWms-----输入参数{}", param);
String wmsurl = paramService.findByCode(AcsConfig.WMSURL).getValue(); String wmsurl = paramService.findByCode(AcsConfig.WMSURL).getValue();
AddressDto addressDto = addressService.findByCode("applyTwo"); AddressDto addressDto = addressService.findByCode("sendProductToFirstFloor");
String url = wmsurl + addressDto.getMethods_url(); String url = wmsurl + addressDto.getMethods_url();
HttpResponse result2 = null; HttpResponse result2 = null;
try { try {
@@ -573,5 +573,45 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
} }
} }
@Override
public String applyUpdatePointCode(JSONObject param) {
try {
MDC.put(log_file_type, log_type);
log.info("applyTaskToWms-----输入参数{}", param);
String wmsurl = paramService.findByCode(AcsConfig.WMSURL).getValue();
AddressDto addressDto = addressService.findByCode("applyUpdatePointCode");
String url = wmsurl + addressDto.getMethods_url();
HttpResponse result2 = null;
try {
result2 = HttpRequest.post(url)
.header("Authorization", token)
.body(String.valueOf(param))
.execute();
} catch (Exception e) {
String msg = e.getMessage();
log.info("applyTaskToWms-----输出参数{}", msg);
//网络不通
}
if (ObjectUtil.isEmpty(result2)) {
log.info("applyTaskToWms-----输出参数{}", "返回结果为空");
return null;
}
String type = "";
if (result2.getStatus() == 200) {
type = "info";
} else {
type = "error";
}
log.info("applyTaskToWms-----输出参数{}", result2.body());
LuceneLogDto luceneLogDto = new LuceneLogDto("applyTaskToWms", String.valueOf(result2.getStatus()),
JSON.toJSONString(param), String.valueOf(result2.body()), "申请更新点位");
luceneLogService.interfaceExecuteLog(luceneLogDto);
return result2.body();
} finally {
MDC.remove(log_file_type);
}
}
} }

View File

@@ -347,7 +347,9 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
TaskDto task_dto = jo.toJavaObject(TaskDto.class); TaskDto task_dto = jo.toJavaObject(TaskDto.class);
try { try {
if (ObjectUtil.isNotEmpty(request.getInteraction_json())) {
task_dto.setInteractionJson(request.getInteraction_json());
}
taskserver.create(task_dto); taskserver.create(task_dto);
} catch (Exception e) { } catch (Exception e) {

View File

@@ -40,7 +40,6 @@ public class DeviceErrorLogController {
*/ */
@GetMapping @GetMapping
@Log("查询设备报警记录") @Log("查询设备报警记录")
public ResponseEntity<Object> query(@RequestParam Map whereJson, Pageable page){ public ResponseEntity<Object> query(@RequestParam Map whereJson, Pageable page){
return new ResponseEntity<>(acsDeviceErrorLogService.queryAll(whereJson,page),HttpStatus.OK); return new ResponseEntity<>(acsDeviceErrorLogService.queryAll(whereJson,page),HttpStatus.OK);
} }
@@ -52,7 +51,6 @@ public class DeviceErrorLogController {
*/ */
@PostMapping @PostMapping
@Log("新增设备报警记录") @Log("新增设备报警记录")
public ResponseEntity<Object> create(@Validated @RequestBody DeviceErrorLogDto dto){ public ResponseEntity<Object> create(@Validated @RequestBody DeviceErrorLogDto dto){
acsDeviceErrorLogService.create(dto); acsDeviceErrorLogService.create(dto);
return new ResponseEntity<>(HttpStatus.CREATED); return new ResponseEntity<>(HttpStatus.CREATED);
@@ -65,7 +63,6 @@ public class DeviceErrorLogController {
*/ */
@PutMapping @PutMapping
@Log("修改设备报警记录") @Log("修改设备报警记录")
public ResponseEntity<Object> update(@Validated @RequestBody DeviceErrorLogDto dto){ public ResponseEntity<Object> update(@Validated @RequestBody DeviceErrorLogDto dto){
acsDeviceErrorLogService.update(dto); acsDeviceErrorLogService.update(dto);
return new ResponseEntity<>(HttpStatus.NO_CONTENT); return new ResponseEntity<>(HttpStatus.NO_CONTENT);
@@ -77,7 +74,6 @@ public class DeviceErrorLogController {
* @return * @return
*/ */
@Log("删除设备报警记录") @Log("删除设备报警记录")
@DeleteMapping @DeleteMapping
public ResponseEntity<Object> delete(@RequestBody String[] ids) { public ResponseEntity<Object> delete(@RequestBody String[] ids) {
acsDeviceErrorLogService.deleteAll(ids); acsDeviceErrorLogService.deleteAll(ids);
@@ -91,7 +87,6 @@ public class DeviceErrorLogController {
* @throws IOException * @throws IOException
*/ */
@Log("导出设备报警记录") @Log("导出设备报警记录")
@GetMapping(value = "/download") @GetMapping(value = "/download")
public void download(HttpServletResponse response, @RequestParam Map whereJson) throws IOException { public void download(HttpServletResponse response, @RequestParam Map whereJson) throws IOException {
acsDeviceErrorLogService.download(acsDeviceErrorLogService.queryAll(whereJson), response); acsDeviceErrorLogService.download(acsDeviceErrorLogService.queryAll(whereJson), response);

View File

@@ -444,4 +444,6 @@ public interface InstructionService extends CommonService<InstructionMybatis> {
* @return * @return
*/ */
Boolean querySameNextDeviceCodeInstByOut(String nextDeviceCode); Boolean querySameNextDeviceCodeInstByOut(String nextDeviceCode);
void updateByInstructionCode(Instruction instructionUpdate);
} }

View File

@@ -14,6 +14,7 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.StringUtils; import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
@@ -27,6 +28,7 @@ import org.nl.acs.agv.server.XianGongAgvService;
import org.nl.acs.auto.initial.ApplicationAutoInitial; import org.nl.acs.auto.initial.ApplicationAutoInitial;
import org.nl.acs.common.base.CommonFinalParam; import org.nl.acs.common.base.CommonFinalParam;
import org.nl.acs.device.domain.Device; import org.nl.acs.device.domain.Device;
import org.nl.acs.device.domain.DeviceErpmapping;
import org.nl.acs.device.enums.DeviceType; import org.nl.acs.device.enums.DeviceType;
import org.nl.acs.device.service.DeviceService; import org.nl.acs.device.service.DeviceService;
import org.nl.acs.device.service.impl.DeviceServiceImpl; import org.nl.acs.device.service.impl.DeviceServiceImpl;
@@ -524,7 +526,9 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
dto = foramte(dto); dto = foramte(dto);
String task_code = dto.getTask_code(); String task_code = dto.getTask_code();
TaskDto task = taskService.findByCodeFromCache(task_code); TaskDto task = taskService.findByCodeFromCache(task_code);
if(regional(dto.getStart_device_code(), dto.getNext_device_code())){
throw new BadRequestException(LangProcess.msg("error_regional_max"));
}
String currentUsername = SecurityUtils.getCurrentUsername(); String currentUsername = SecurityUtils.getCurrentUsername();
String now = DateUtil.now(); String now = DateUtil.now();
if (StrUtil.isEmpty(dto.getRoute_plan_code())) { if (StrUtil.isEmpty(dto.getRoute_plan_code())) {
@@ -907,28 +911,7 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
log.debug("地址对应设备未找到"); log.debug("地址对应设备未找到");
return; return;
} }
// 如果是无光电的设备 放货任务完成需要变更有货状态
// XgAgvCarDeviceDriver standardOrdinarySiteDeviceDriver;
// if(device.getDeviceDriver() instanceof XgAgvCarDeviceDriver) {
// standardOrdinarySiteDeviceDriver = (XgAgvCarDeviceDriver)
// device.getDeviceDriver();
// standardOrdinarySiteDeviceDriver.setMove(2);
// }
// 如果是无光电的设备 指令完成变更起点、终点状态
JSONObject jo = new JSONObject();
jo.put("device_code", dto.getStart_point_code());
jo.put("hasGoodStatus", "0");
jo.put("material_type", "");
jo.put("batch", "");
deviceService.changeDeviceStatus(jo);
JSONObject jo1 = new JSONObject();
jo1.put("device_code", dto.getNext_point_code());
jo1.put("hasGoodStatus", CommonFinalParam.ONE);
jo1.put("material_type", dto.getMaterial());
jo1.put("batch", dto.getBatch());
deviceService.changeDeviceStatus(jo1);
removeByCodeFromCache(dto.getInstruction_code()); removeByCodeFromCache(dto.getInstruction_code());
// this.reload(); // this.reload();
@@ -1331,7 +1314,8 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
} }
if (StrUtil.contains(start_point_code, commonFinalParam.getBARRE()) && StrUtil.count(start_point_code, commonFinalParam.getBARRE()) == 2) { if (StrUtil.contains(start_point_code, commonFinalParam.getBARRE()) && StrUtil.count(start_point_code, commonFinalParam.getBARRE()) == 2) {
String[] start_point = start_point_code.split(commonFinalParam.getBARRE()); String[] start_point = start_point_code.split(commonFinalParam.getBARRE());
inst.setFrom_x(start_point[0]); Device starPoint = deviceAppService.findDeviceByCode(start_point[0]);
inst.setFrom_x(starPoint.getExtraValue().get("x").toString());
inst.setStart_device_code(start_point[0]); inst.setStart_device_code(start_point[0]);
inst.setFrom_y(start_point[1]); inst.setFrom_y(start_point[1]);
inst.setFrom_z(start_point[2]); inst.setFrom_z(start_point[2]);
@@ -1344,8 +1328,9 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
.get(0) .get(0)
.name(); .name();
if (StrUtil.equals("storage", start_device)) { if (StrUtil.equals("storage", start_device)) {
String[] start_point = start_point_code.split("-"); String[] start_point = start_point_code.split(commonFinalParam.getBARRE());
inst.setFrom_x(start_point[0]); Device starPoint = deviceAppService.findDeviceByCode(start_point[0]);
inst.setFrom_x(starPoint.getExtraValue().get("x").toString());
inst.setStart_device_code(start_point[0]); inst.setStart_device_code(start_point[0]);
inst.setFrom_y(start_point[1]); inst.setFrom_y(start_point[1]);
inst.setFrom_z(start_point[2]); inst.setFrom_z(start_point[2]);
@@ -1732,6 +1717,14 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
.isEmpty(); .isEmpty();
} }
@Override
public void updateByInstructionCode(Instruction instructionUpdate) {
InstructionMybatis entity = ConvertUtil.convert(instructionUpdate, InstructionMybatis.class);
UpdateWrapper<InstructionMybatis> updateWrapper = new UpdateWrapper<>();
updateWrapper.eq("instruction_code", instructionUpdate.getInstruction_code());
instructionMapper.update(entity,updateWrapper);
}
private boolean regional( String start_device_code, String next_device_code) { private boolean regional( String start_device_code, String next_device_code) {
Device startdevice = deviceAppService.findDeviceByCode(start_device_code); Device startdevice = deviceAppService.findDeviceByCode(start_device_code);
Device nextdevice = deviceAppService.findDeviceByCode(next_device_code); Device nextdevice = deviceAppService.findDeviceByCode(next_device_code);
@@ -1740,6 +1733,9 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
int count = 0; int count = 0;
boolean startRegionalExit = true; boolean startRegionalExit = true;
boolean nextRegionalExit = true; boolean nextRegionalExit = true;
if(StrUtil.isEmpty(startRegion) || StrUtil.isEmpty(nextRegion)){
return true;
}
//控制指令生成 //控制指令生成
LimitRegionalDto limitRegionalDtos = limitRegionalService.selectByReging(startRegion, nextRegion); LimitRegionalDto limitRegionalDtos = limitRegionalService.selectByReging(startRegion, nextRegion);
if (ObjectUtil.isNotEmpty(limitRegionalDtos)) { if (ObjectUtil.isNotEmpty(limitRegionalDtos)) {

View File

@@ -11,7 +11,6 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.TreeSet; import java.util.TreeSet;
@Service
public interface LimitRegionalService extends CommonService<LimitRegional> { public interface LimitRegionalService extends CommonService<LimitRegional> {
/** /**

View File

@@ -2,6 +2,7 @@ package org.nl.acs.limit_regional.server.impl;
import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.RandomUtil; import cn.hutool.core.util.RandomUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
@@ -21,7 +22,9 @@ import org.nl.acs.limit_regional.server.mapper.LimitRegionalMapper;
import org.nl.acs.opc.DeviceAppService; import org.nl.acs.opc.DeviceAppService;
import org.nl.acs.utils.ConvertUtil; import org.nl.acs.utils.ConvertUtil;
import org.nl.acs.utils.PageUtil; import org.nl.acs.utils.PageUtil;
import org.nl.common.exception.BadRequestException;
import org.nl.common.utils.SecurityUtils; import org.nl.common.utils.SecurityUtils;
import org.nl.config.language.LangProcess;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@@ -45,7 +48,7 @@ public class LimitRegionalServiceImpl extends CommonServiceImpl<LimitRegionalMap
@Autowired @Autowired
private DeviceAppService deviceAppService; private DeviceAppService deviceAppService;
private List<LimitRegional> dataList; public List<LimitRegional> dataList;
@Override @Override
@@ -82,7 +85,7 @@ public class LimitRegionalServiceImpl extends CommonServiceImpl<LimitRegionalMap
@Override @Override
public void add(JSONObject json) { public void add(JSONObject json) {
LimitRegional limitRegional = new LimitRegional(); LimitRegional limitRegional = new LimitRegional();
limitRegional.setId(String.valueOf(RandomUtil.randomInt(8))); limitRegional.setId(RandomUtil.randomNumbers(8));
limitRegional.setStart_regional(json.getString("start_regional")); limitRegional.setStart_regional(json.getString("start_regional"));
limitRegional.setNext_regional(json.getString("next_regional")); limitRegional.setNext_regional(json.getString("next_regional"));
limitRegional.setStart_exclude_device(json.getString("startExcludeDevice")); limitRegional.setStart_exclude_device(json.getString("startExcludeDevice"));
@@ -91,12 +94,14 @@ public class LimitRegionalServiceImpl extends CommonServiceImpl<LimitRegionalMap
String regex = "\\d+"; String regex = "\\d+";
boolean isNumeric = max_num.matches(regex); boolean isNumeric = max_num.matches(regex);
if(!isNumeric){ if(!isNumeric){
throw new RuntimeException("最大数请输入纯数字"); throw new BadRequestException("请输入纯数字");
} }
limitRegional.setIs_active("1");
limitRegional.setMax_num(max_num); limitRegional.setMax_num(max_num);
limitRegional.setCreate_by("auto"); limitRegional.setCreate_by("auto");
limitRegional.setCreate_time(DateUtil.now()); limitRegional.setCreate_time(DateUtil.now());
limitRegionalMapper.insert(limitRegional); limitRegionalMapper.insert(limitRegional);
dataList.add(limitRegional);
} }
@@ -106,13 +111,25 @@ public class LimitRegionalServiceImpl extends CommonServiceImpl<LimitRegionalMap
return; return;
} }
for (String id : ids) { for (String id : ids) {
LimitRegional limitRegional = limitRegionalMapper.selectById(id);
if(ObjectUtil.isNull(limitRegional)){
throw new BadRequestException("这个对象不存在");
}
limitRegionalMapper.deleteById(id); limitRegionalMapper.deleteById(id);
} }
dataList.removeIf(limitRegional -> CollUtil.contains(Arrays.asList(ids), limitRegional.getId()));
} }
@Override @Override
public void update(JSONObject json) { public void update(JSONObject json) {
if(StrUtil.isEmpty(json.getString("id"))){
throw new BadRequestException(LangProcess.msg("error_checkNull", "流量限制id"));
}
LimitRegional id = limitRegionalMapper.selectById(json.getString("id"));
if(ObjectUtil.isNull(id)){
throw new BadRequestException(LangProcess.msg("error_isNull", "流量限制id="+json.getString("id")));
}
LimitRegional limitRegional = new LimitRegional(); LimitRegional limitRegional = new LimitRegional();
String currentUsername = SecurityUtils.getCurrentUsername(); String currentUsername = SecurityUtils.getCurrentUsername();
limitRegional.setId(json.getString("id")); limitRegional.setId(json.getString("id"));
@@ -124,19 +141,30 @@ public class LimitRegionalServiceImpl extends CommonServiceImpl<LimitRegionalMap
String regex = "\\d+"; String regex = "\\d+";
boolean isNumeric = max_num.matches(regex); boolean isNumeric = max_num.matches(regex);
if(!isNumeric){ if(!isNumeric){
throw new RuntimeException("最大数请输入纯数字"); throw new RuntimeException("请输入纯数字");
} }
limitRegional.setMax_num(max_num); limitRegional.setMax_num(max_num);
limitRegional.setUpdate_by(currentUsername); limitRegional.setUpdate_by(currentUsername);
limitRegional.setUpdate_time(DateUtil.now()); limitRegional.setUpdate_time(DateUtil.now());
limitRegionalMapper.updateById(limitRegional); limitRegionalMapper.updateById(limitRegional);
dataList.forEach(limitRegional1 -> {
if (limitRegional.getId().equals(limitRegional1.getId())) {
limitRegional1.setStart_regional(limitRegional.getStart_regional());
limitRegional1.setNext_regional(limitRegional.getNext_regional());
limitRegional1.setStart_exclude_device(limitRegional.getStart_exclude_device());
limitRegional1.setNext_exclude_device(limitRegional.getNext_exclude_device());
limitRegional1.setMax_num(limitRegional.getMax_num());
limitRegional1.setUpdate_by(limitRegional.getUpdate_by());
limitRegional1.setUpdate_time(limitRegional.getUpdate_time());
}
});
} }
@Override @Override
public void updateStatusById(Map whereJson) { public void updateStatusById(Map whereJson) {
String id = whereJson.get("id").toString(); String id = whereJson.get("id").toString();
if(StrUtil.isEmpty(id)){ if(StrUtil.isEmpty(id)){
return; throw new BadRequestException("id为空");
} }
LimitRegional limitRegional = new LimitRegional(); LimitRegional limitRegional = new LimitRegional();
limitRegional.setId(id); limitRegional.setId(id);
@@ -144,15 +172,23 @@ public class LimitRegionalServiceImpl extends CommonServiceImpl<LimitRegionalMap
limitRegional.setUpdate_by(SecurityUtils.getCurrentUsername()); limitRegional.setUpdate_by(SecurityUtils.getCurrentUsername());
limitRegional.setUpdate_time(DateUtil.now()); limitRegional.setUpdate_time(DateUtil.now());
limitRegionalMapper.updateById(limitRegional); limitRegionalMapper.updateById(limitRegional);
dataList.forEach(limitRegional1 -> {if (limitRegional.getId().equals(limitRegional1.getId())) {
limitRegional1.setIs_active(limitRegional.getIs_active());
limitRegional1.setUpdate_by(limitRegional.getUpdate_by());
limitRegional1.setUpdate_time(limitRegional.getUpdate_time());
}
});
} }
@Override @Override
public LimitRegionalDto selectByReging(String startRegion, String nextRegion) { public LimitRegionalDto selectByReging(String startRegion, String nextRegion) {
if (StrUtil.isNotEmpty(startRegion)&&StrUtil.isNotEmpty(nextRegion)) {
for (LimitRegional limitRegional : dataList) { for (LimitRegional limitRegional : dataList) {
if (startRegion.equals(limitRegional.getStart_regional()) && nextRegion.equals(limitRegional.getNext_regional())){ if (startRegion.equals(limitRegional.getStart_regional()) && nextRegion.equals(limitRegional.getNext_regional())) {
return ConvertUtil.convert(limitRegional, LimitRegionalDto.class); return ConvertUtil.convert(limitRegional, LimitRegionalDto.class);
} }
} }
}
return null; return null;
} }

View File

@@ -290,6 +290,7 @@ public class DeviceOpcProtocolRunable implements Runnable, DataCallback, ServerC
} }
private void runNew() { private void runNew() {
Async20Access accessor = null; Async20Access accessor = null;

View File

@@ -510,4 +510,6 @@ public interface TaskService extends CommonService<Task> {
* @return AcsTask * @return AcsTask
*/ */
TaskDto findByTaskCode(String task_code); TaskDto findByTaskCode(String task_code);
void updateByTaskCode(Task taskUpdate);
} }

View File

@@ -8,10 +8,12 @@ import cn.hutool.core.text.CharSequenceUtil;
import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
@@ -256,7 +258,7 @@ public class TaskServiceImpl extends CommonServiceImpl<TaskMapper, Task> impleme
if (!StrUtil.isEmpty(point_code)) { if (!StrUtil.isEmpty(point_code)) {
wrapper.and(task -> task.like(Task::getStart_point_code, point_code).or().like(Task::getNext_point_code, point_code)); wrapper.and(task -> task.like(Task::getStart_point_code, point_code).or().like(Task::getNext_point_code, point_code));
} }
if(StrUtil.isNotEmpty(task_type)){ if (StrUtil.isNotEmpty(task_type)) {
wrapper.eq(Task::getTask_type, task_type); wrapper.eq(Task::getTask_type, task_type);
} }
if (!StrUtil.isEmpty(is_over)) { if (!StrUtil.isEmpty(is_over)) {
@@ -498,7 +500,7 @@ public class TaskServiceImpl extends CommonServiceImpl<TaskMapper, Task> impleme
Iterator<TaskDto> iterator = tasks.iterator(); Iterator<TaskDto> iterator = tasks.iterator();
if (iterator.hasNext()) { if (iterator.hasNext()) {
TaskDto task = iterator.next(); TaskDto task = iterator.next();
if(StrUtil.equals(task.getTask_status(), status)){ if (StrUtil.equals(task.getTask_status(), status)) {
taskDtoList.add(task); taskDtoList.add(task);
} }
} }
@@ -559,12 +561,12 @@ public class TaskServiceImpl extends CommonServiceImpl<TaskMapper, Task> impleme
DeviceService deviceService = SpringContextHolder.getBean(DeviceServiceImpl.class); DeviceService deviceService = SpringContextHolder.getBean(DeviceServiceImpl.class);
DeviceAppService appService = SpringContextHolder.getBean(DeviceAppServiceImpl.class); DeviceAppService appService = SpringContextHolder.getBean(DeviceAppServiceImpl.class);
Device nextdevice = appService.findDeviceByCode(next_device_code); Device nextdevice = appService.findDeviceByCode(next_device_code);
if (nextdevice == null){ if (nextdevice == null) {
//TODO 国际化处理 //TODO 国际化处理
throw new BadRequestException("终点设备未配置"); throw new BadRequestException("终点设备未配置");
} }
Device startdevice = appService.findDeviceByCode(start_device_code); Device startdevice = appService.findDeviceByCode(start_device_code);
if (startdevice == null){ if (startdevice == null) {
//TODO 国际化处理 //TODO 国际化处理
throw new BadRequestException("起点设备未配置"); throw new BadRequestException("起点设备未配置");
} }
@@ -1517,6 +1519,13 @@ public class TaskServiceImpl extends CommonServiceImpl<TaskMapper, Task> impleme
return null; return null;
} }
@Override
public void updateByTaskCode(Task taskUpdate) {
UpdateWrapper<Task> updateWrapper = new UpdateWrapper<>();
updateWrapper.eq("task_code", taskUpdate.getTask_code());
taskMapper.update(taskUpdate,updateWrapper);
}
/** /**
* 把多个字符串拼接的inst_nextDevice_code解析成集合 * 把多个字符串拼接的inst_nextDevice_code解析成集合
* *

View File

@@ -138,14 +138,14 @@ public class LogAspect {
@AfterThrowing(pointcut = "logPointcut()", throwing = "e") /*@AfterThrowing(pointcut = "logPointcut()", throwing = "e")
public void logAfterThrowing(JoinPoint joinPoint, Throwable e) { public void logAfterThrowing(JoinPoint joinPoint, Throwable e) {
SysLog log = new SysLog("ERROR",System.currentTimeMillis() - currentTime.get()); SysLog log = new SysLog("ERROR",System.currentTimeMillis() - currentTime.get());
currentTime.remove(); currentTime.remove();
log.setException_detail(ThrowableUtil.getStackTrace(e).getBytes()); log.setException_detail(ThrowableUtil.getStackTrace(e).getBytes());
HttpServletRequest request = RequestHolder.getHttpServletRequest(); HttpServletRequest request = RequestHolder.getHttpServletRequest();
logService.save(getUsername(), StringUtils.getBrowser(request), StringUtils.getIp(request), (ProceedingJoinPoint)joinPoint, log); logService.save(getUsername(), StringUtils.getBrowser(request), StringUtils.getIp(request), (ProceedingJoinPoint)joinPoint, log);
} }*/
public String getUsername() { public String getUsername() {
try { try {

View File

@@ -30,15 +30,12 @@ public class SysLogController {
@Autowired @Autowired
private ISysLogService logService; private ISysLogService logService;
@GetMapping @GetMapping
//@SaCheckPermission("@el.check()")
public ResponseEntity<Object> query(@RequestParam Map criteria, PageQuery pageable){ public ResponseEntity<Object> query(@RequestParam Map criteria, PageQuery pageable){
criteria.put("log_type","INFO"); criteria.put("log_type","INFO");
return new ResponseEntity<>(TableDataInfo.build(logService.queryAll(criteria,pageable)), HttpStatus.OK); return new ResponseEntity<>(TableDataInfo.build(logService.queryAll(criteria,pageable)), HttpStatus.OK);
} }
@GetMapping(value = "/user") @GetMapping(value = "/user")
//
public ResponseEntity<Object> queryUserLog(@RequestParam Map criteria, PageQuery pageable){ public ResponseEntity<Object> queryUserLog(@RequestParam Map criteria, PageQuery pageable){
criteria.put("log_type","INFO"); criteria.put("log_type","INFO");
criteria.put("username", SecurityUtils.getCurrentUsername()); criteria.put("username", SecurityUtils.getCurrentUsername());
@@ -46,7 +43,6 @@ public class SysLogController {
} }
@GetMapping(value = "/error") @GetMapping(value = "/error")
// @SaCheckPermission("@el.check()") // @SaCheckPermission("@el.check()")
public ResponseEntity<Object> queryErrorLog(@RequestParam Map criteria, PageQuery pageable){ public ResponseEntity<Object> queryErrorLog(@RequestParam Map criteria, PageQuery pageable){
criteria.put("log_type","ERROR"); criteria.put("log_type","ERROR");
@@ -54,7 +50,6 @@ public class SysLogController {
} }
@GetMapping(value = "/error/{id}") @GetMapping(value = "/error/{id}")
// @SaCheckPermission("@el.check()") // @SaCheckPermission("@el.check()")
public ResponseEntity<Object> queryErrorLogs(@PathVariable String id){ public ResponseEntity<Object> queryErrorLogs(@PathVariable String id){
return new ResponseEntity<>(logService.findByErrDetail(id), HttpStatus.OK); return new ResponseEntity<>(logService.findByErrDetail(id), HttpStatus.OK);
@@ -62,7 +57,6 @@ public class SysLogController {
@DeleteMapping(value = "/del/error") @DeleteMapping(value = "/del/error")
@Log("删除所有ERROR日志") @Log("删除所有ERROR日志")
// @SaCheckPermission("@el.check()") // @SaCheckPermission("@el.check()")
public ResponseEntity<Object> delAllErrorLog(){ public ResponseEntity<Object> delAllErrorLog(){
logService.delAllByError(); logService.delAllByError();
@@ -71,7 +65,6 @@ public class SysLogController {
@DeleteMapping(value = "/del/info") @DeleteMapping(value = "/del/info")
@Log("删除所有INFO日志") @Log("删除所有INFO日志")
// @SaCheckPermission("@el.check()") // @SaCheckPermission("@el.check()")
public ResponseEntity<Object> delAllInfoLog(){ public ResponseEntity<Object> delAllInfoLog(){
logService.delAllByInfo(); logService.delAllByInfo();

View File

@@ -11,6 +11,9 @@ one_message10=\u4EFB\u52A1\u53F7\u4E3A\u7A7A
one_message11=\u672A\u627E\u5230\u8F7D\u5177\u53F7 one_message11=\u672A\u627E\u5230\u8F7D\u5177\u53F7
one_message13=\u7533\u8BF7\u4EFB\u52A1\u6210\u529F one_message13=\u7533\u8BF7\u4EFB\u52A1\u6210\u529F
one_message14=\u7533\u8BF7\u4EFB\u52A1\u5931\u8D25 one_message14=\u7533\u8BF7\u4EFB\u52A1\u5931\u8D25
one_message15=\u7533\u8BF7AGV\u642C\u8FD0\u4EFB\u52A1\u63A5\u53E3\u4E0D\u901A
one_message16=\u7533\u8BF7AGV\u642C\u8FD0\u4EFB\u52A1\u6210\u529F
one_message17=\u7533\u8BF7AGV\u642C\u8FD0\u4EFB\u52A1\u5931\u8D25
one_mode1=\u7533\u8BF7\u5165\u5E93\u4EFB\u52A1 one_mode1=\u7533\u8BF7\u5165\u5E93\u4EFB\u52A1
one_mode2=\u7533\u8BF7\u7A7A\u6258\u76D8\u5165\u5E93 one_mode2=\u7533\u8BF7\u7A7A\u6258\u76D8\u5165\u5E93
one_mode3=\u7533\u8BF7AGV\u4EFB\u52A1 one_mode3=\u7533\u8BF7AGV\u4EFB\u52A1

View File

@@ -11,6 +11,9 @@ one_message10=The task number is empty
one_message11=Vehicle number not found one_message11=Vehicle number not found
one_message13=Request task successfully one_message13=Request task successfully
one_message14=Task request failed one_message14=Task request failed
one_message15=The interface for applying for a complement to the AGV carrying task fails. Procedure
one_message16=Succeeded in applying for the AGV transfer task. Procedure
one_message17=Failed to apply for the AGV transfer task. Procedure
one_mode1=Request a warehouse entry task one_mode1=Request a warehouse entry task
one_mode2=Request empty pallets for storage one_mode2=Request empty pallets for storage
one_mode3=Request AGV one_mode3=Request AGV

View File

@@ -11,6 +11,9 @@ one_message10=Nomor misi kosong
one_message11=Tidak ada nomor muatan yang ditemukan one_message11=Tidak ada nomor muatan yang ditemukan
one_message13=Sukses menerapkan misi one_message13=Sukses menerapkan misi
one_message14=Misi aplikasi gagal one_message14=Misi aplikasi gagal
one_message15=Permintaan kode tambahan AGV memindahkan antarmuka misi tidak tersedia
one_message16=Minta ijin ke operasi AGV
one_message17=Aplikasi bantuan AGV pemindahan gagal
one_mode1=Berlaku untuk tugas pustaka one_mode1=Berlaku untuk tugas pustaka
one_mode2=Pendaftaran nampan kosong one_mode2=Pendaftaran nampan kosong
one_mode3=Permintaan AGV one_mode3=Permintaan AGV

View File

@@ -11,6 +11,9 @@ one_message10=\u4EFB\u52A1\u53F7\u4E3A\u7A7A
one_message11=\u672A\u627E\u5230\u8F7D\u5177\u53F7 one_message11=\u672A\u627E\u5230\u8F7D\u5177\u53F7
one_message13=\u7533\u8BF7\u4EFB\u52A1\u6210\u529F one_message13=\u7533\u8BF7\u4EFB\u52A1\u6210\u529F
one_message14=\u7533\u8BF7\u4EFB\u52A1\u5931\u8D25 one_message14=\u7533\u8BF7\u4EFB\u52A1\u5931\u8D25
one_message15=\u7533\u8BF7\u8865\u7801AGV\u642C\u8FD0\u4EFB\u52A1\u63A5\u53E3\u4E0D\u901A
one_message16=\u7533\u8BF7\u8865\u7801AGV\u642C\u8FD0\u4EFB\u52A1\u6210\u529F
one_message17=\u7533\u8BF7\u8865\u7801AGV\u642C\u8FD0\u4EFB\u52A1\u5931\u8D25
one_mode1=\u7533\u8BF7\u5165\u5E93\u4EFB\u52A1 one_mode1=\u7533\u8BF7\u5165\u5E93\u4EFB\u52A1
one_mode2=\u7533\u8BF7\u7A7A\u6258\u76D8\u5165\u5E93 one_mode2=\u7533\u8BF7\u7A7A\u6258\u76D8\u5165\u5E93
one_mode3=\u7533\u8BF7AGV\u4EFB\u52A1 one_mode3=\u7533\u8BF7AGV\u4EFB\u52A1

View File

@@ -135,7 +135,7 @@ export default {
props: { props: {
parentForm: { parentForm: {
type: Object, type: Object,
required: true require: true
} }
}, },
cruds() { cruds() {

View File

@@ -286,7 +286,7 @@ export default {
this.$refs.child1.setForm(clickObj) this.$refs.child1.setForm(clickObj)
} else if (clickObj.data.driver_type === 'standard_stacker') { } else if (clickObj.data.driver_type === 'standard_stacker') {
this.dialogFormVisible4 = true this.dialogFormVisible4 = true
}else { } else {
this.dialogFormVisible = true this.dialogFormVisible = true
} }
} }

View File

@@ -759,7 +759,11 @@ export default {
this.dialogVisible = false this.dialogVisible = false
}, },
saveBtn() { saveBtn() {
// 禁用按钮
this.isDisabled = true
crudTask.add(this.form).then(res => { crudTask.add(this.form).then(res => {
// 请求完成后启用按钮
this.isDisabled = false
this.crud.toQuery() this.crud.toQuery()
this.formDia = false this.formDia = false
this.isDisabled = true this.isDisabled = true
@@ -767,6 +771,10 @@ export default {
this.extension = [{ this.extension = [{
name: '', name: '',
value: '' }] value: '' }]
// 设置定时器,等待一定时间后再次允许请求
setTimeout(() => {
this.isDisabled = false // 可根据具体需求进行调整
}, 1000) // 5000 毫秒,即 5 秒钟
}, },
openDialog() { openDialog() {
this.dialogVisible = true this.dialogVisible = true

View File

@@ -5,8 +5,8 @@
v-for="item in stageParam" v-for="item in stageParam"
:key="item.value" :key="item.value"
:label="item.label" :label="item.label"
:value="item.value"> :value="item.value"
</el-option> />
</el-select> </el-select>
<el-row> <el-row>
<div id="container" className="container" style="min-height: 100%" /> <div id="container" className="container" style="min-height: 100%" />
@@ -194,7 +194,7 @@
</el-form-item> </el-form-item>
<el-form-item :label="$t('monitor.click.job_command')" prop="toCommand" label-width="120px"> <el-form-item :label="$t('monitor.click.job_command')" prop="toCommand" label-width="120px">
<el-radio-group v-model="form.toCommand"> <el-radio-group v-model="form.toCommand">
<el-radio-button :label="7" >{{ $t('monitor.click.recall') }}</el-radio-button> <el-radio-button :label="7">{{ $t('monitor.click.recall') }}</el-radio-button>
<el-radio-button :label="8">{{ $t('monitor.click.scram') }}</el-radio-button> <el-radio-button :label="8">{{ $t('monitor.click.scram') }}</el-radio-button>
<el-radio-button :label="5">{{ $t('monitor.click.police_clearance') }}</el-radio-button> <el-radio-button :label="5">{{ $t('monitor.click.police_clearance') }}</el-radio-button>
</el-radio-group> </el-radio-group>
@@ -778,6 +778,7 @@ body {
::v-deep.el-radio-button{ ::v-deep.el-radio-button{
margin-right: 15px; margin-right: 15px;
border-radius:4px; border-radius:4px;
}
.el-radio-button__inner { .el-radio-button__inner {
width: 90px; width: 90px;
height: 30px; height: 30px;
@@ -791,5 +792,5 @@ body {
border-color: blue; border-color: blue;
box-shadow: -1px 0 0 0 blue; box-shadow: -1px 0 0 0 blue;
} }
}
</style> </style>