rev:任务看板优化
This commit is contained in:
@@ -53,6 +53,10 @@ public interface AcsConfig {
|
||||
* 二楼2区AGV系统端口
|
||||
*/
|
||||
String AGVPORT22 = "agvport22";
|
||||
/**
|
||||
* acsIP地址
|
||||
*/
|
||||
String ACSIP = "acsIP";
|
||||
/**
|
||||
* 指定AGV系统
|
||||
*/
|
||||
|
||||
@@ -272,7 +272,7 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements
|
||||
break;
|
||||
case 2:
|
||||
//申请任务
|
||||
if (move == 1 && !requireSucess) {
|
||||
if (move == 1 && !requireSucess && task==0) {
|
||||
instruction_require();
|
||||
}
|
||||
break;
|
||||
@@ -490,7 +490,7 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements
|
||||
}
|
||||
List list = new ArrayList();
|
||||
writeData(next_addr, list, inst);
|
||||
led_message = getLedMessage(inst);
|
||||
// led_message = getLedMessage(inst);
|
||||
requireSucess = true;
|
||||
return true;
|
||||
} else {
|
||||
@@ -499,7 +499,7 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements
|
||||
if (ObjectUtil.isNull(taskdto)) {
|
||||
return false;
|
||||
}
|
||||
if (ObjectUtil.isNotNull(taskdto) && TaskTypeEnum.Conveyor_Task.getIndex().equals(taskdto.getTask_type())) {
|
||||
if (ObjectUtil.isNotNull(taskdto)) {
|
||||
//判断指令的起点和当前的设备号相同
|
||||
if (!taskdto.getStart_device_code().equals(device_code)) {
|
||||
return false;
|
||||
@@ -565,7 +565,7 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements
|
||||
String next_addr = nextdevice.getExtraValue().get("address").toString();
|
||||
List list = new ArrayList();
|
||||
writeData(next_addr, list, instdto);
|
||||
led_message = getLedMessage(instdto);
|
||||
// led_message = getLedMessage(instdto);
|
||||
requireSucess = true;
|
||||
return true;
|
||||
}
|
||||
@@ -703,23 +703,24 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements
|
||||
return jo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取任务信息
|
||||
*/
|
||||
public JSONObject getLedMessage(Instruction instdto) {
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("task_code", instdto.getTask_code());
|
||||
json.put("inst_code", instdto.getInstruction_code());
|
||||
json.put("start_device_code", instdto.getStart_device_code());
|
||||
json.put("next_device_code", instdto.getNext_device_code());
|
||||
json.put("material_type", instdto.getMaterial());
|
||||
json.put("quantity", instdto.getQuantity());
|
||||
json.put("vehicle_code", instdto.getVehicle_code());
|
||||
json.put("instruction_status", instdto.getInstruction_status());
|
||||
json.put("entry_time", instdto.getCreate_time());
|
||||
json.put("ip", localhost);
|
||||
return json;
|
||||
}
|
||||
// /**
|
||||
// * 获取任务信息
|
||||
// */
|
||||
// public JSONObject getLedMessage(Instruction instdto) {
|
||||
// JSONObject json = new JSONObject();
|
||||
// json.put("task_code", instdto.getTask_code());
|
||||
// json.put("inst_code", instdto.getInstruction_code());
|
||||
// json.put("start_device_code", instdto.getStart_device_code());
|
||||
// json.put("next_device_code", instdto.getNext_device_code());
|
||||
// json.put("material_type", instdto.getMaterial());
|
||||
// json.put("quantity", instdto.getQuantity());
|
||||
// json.put("vehicle_code", instdto.getVehicle_code());
|
||||
// json.put("instruction_status", instdto.getInstruction_status());
|
||||
// json.put("entry_time", instdto.getCreate_time());
|
||||
// String acsIp = paramService.findByCode(AcsConfig.ACSIP).getValue();
|
||||
// json.put("ip", acsIp);
|
||||
// return json;
|
||||
// }
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -20,6 +20,7 @@ import org.nl.acs.monitor.DeviceStageMonitor;
|
||||
public class LedScreenDeviceDriver extends AbstractDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver, DeviceStageMonitor {
|
||||
@Override
|
||||
public void execute() {
|
||||
//todo:判断当前对接位有货变没货后十五秒清屏
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ import lombok.Data;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.nl.acs.AcsConfig;
|
||||
import org.nl.acs.common.base.CommonFinalParam;
|
||||
import org.nl.acs.device.domain.Device;
|
||||
import org.nl.acs.device.service.DeviceExtraService;
|
||||
@@ -45,6 +46,7 @@ import org.nl.config.SpringContextHolder;
|
||||
import org.nl.config.language.LangProcess;
|
||||
import org.nl.config.lucene.service.LuceneExecuteLogService;
|
||||
import org.nl.config.lucene.service.dto.LuceneLogDto;
|
||||
import org.nl.system.service.param.ISysParamService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import java.util.*;
|
||||
@@ -76,6 +78,8 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv
|
||||
DeviceAppService deviceAppservice = SpringContextHolder.getBean(DeviceAppService.class);
|
||||
|
||||
LuceneExecuteLogService luceneExecuteLogService = SpringContextHolder.getBean(LuceneExecuteLogService.class);
|
||||
|
||||
ISysParamService paramService = SpringContextHolder.getBean(ISysParamService.class);
|
||||
//工作模式
|
||||
int mode = 0;
|
||||
int last_mode = 0;
|
||||
@@ -165,6 +169,10 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv
|
||||
|
||||
//当前指令
|
||||
Instruction inst = null;
|
||||
/**
|
||||
* led点阵屏信息
|
||||
*/
|
||||
JSONObject led_message = null;
|
||||
|
||||
//0 无任务执行 1更新指令状态 2下发电气信号 3允许取货 允许放货 5放货完成
|
||||
int now_steps_type = 0;
|
||||
@@ -217,6 +225,13 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_mode + "->" + mode + "复位请求标记:" + requireSucess);
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_mode + "->" + mode);
|
||||
}
|
||||
if(move !=last_move){
|
||||
if (ObjectUtil.isNotEmpty(inst)){
|
||||
Thread.sleep(10000);
|
||||
led_message = clearMessage();
|
||||
}
|
||||
requireSucess = false;
|
||||
}
|
||||
if (move != 0 && task > 0) {
|
||||
|
||||
update_instruction_status();
|
||||
@@ -483,6 +498,7 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv
|
||||
map3.put("value", "1");
|
||||
list.add(map3);
|
||||
this.writing(list);
|
||||
led_message = getLedMessage(instdto);
|
||||
requireSucess = true;
|
||||
while (!StrUtil.equals(this.getOpcValueAccessor().getValue(this.getOpcServer() + "." + this.getOpcPlc() + "." + this.getDevice_code() + ".task").toString()
|
||||
, instdto.getInstruction_code())) {
|
||||
@@ -503,6 +519,43 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取任务信息
|
||||
*/
|
||||
public JSONObject getLedMessage(Instruction instdto) {
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("task_code", instdto.getTask_code());
|
||||
json.put("inst_code", instdto.getInstruction_code());
|
||||
json.put("start_device_code", instdto.getStart_device_code());
|
||||
json.put("next_device_code", instdto.getNext_device_code());
|
||||
json.put("material_type", instdto.getMaterial());
|
||||
json.put("quantity", instdto.getQuantity());
|
||||
json.put("vehicle_code", instdto.getVehicle_code());
|
||||
json.put("instruction_status", instdto.getInstruction_status());
|
||||
json.put("entry_time", instdto.getCreate_time());
|
||||
String acsIp = paramService.findByCode(AcsConfig.ACSIP).getValue();
|
||||
json.put("ip", acsIp);
|
||||
return json;
|
||||
}
|
||||
|
||||
/**
|
||||
* 清空任务信息任务信息
|
||||
*/
|
||||
public JSONObject clearMessage() {
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("task_code", "");
|
||||
json.put("inst_code", "");
|
||||
json.put("start_device_code", "");
|
||||
json.put("next_device_code", "");
|
||||
json.put("material_type", "");
|
||||
json.put("quantity", "");
|
||||
json.put("vehicle_code", "");
|
||||
json.put("instruction_status", "");
|
||||
json.put("entry_time", "");
|
||||
json.put("ip", "");
|
||||
return json;
|
||||
}
|
||||
|
||||
private void packageInstrcutData(Instruction instdto, TaskDto taskdto, String taskid, String taskcode, String vehiclecode, String priority,String startCode, String endCode) {
|
||||
instdto.setInstruction_id(IdUtil.simpleUUID());
|
||||
instdto.setRoute_plan_code(taskdto.getRoute_plan_code());
|
||||
|
||||
@@ -172,43 +172,8 @@ public class RgvDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDr
|
||||
to_task = this.itemProtocol.getTo_task();
|
||||
to_sub_volume_no = this.itemProtocol.getTo_sub_volume_no();
|
||||
|
||||
if (to_sub_volume_no != last_to_sub_volume_no) {
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号to_sub_volume_no:" + last_to_sub_volume_no + "->" + to_sub_volume_no);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -204,32 +204,6 @@ public class BlankManipulatorDeviceDriver extends AbstractOpcDeviceDriver implem
|
||||
|
||||
if (mode != last_mode) {
|
||||
requireSucess = false;
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(device_code)
|
||||
.content("信号mode:" + last_mode + "->" + mode)
|
||||
.build();
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
}
|
||||
if (move != last_move) {
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(device_code)
|
||||
.content("信号move:" + last_move + "->" + move)
|
||||
.build();
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
}
|
||||
if (action != last_action) {
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(device_code)
|
||||
.content("信号action:" + last_action + "->" + action)
|
||||
.build();
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
}
|
||||
if (error != last_error) {
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(device_code)
|
||||
.content("信号error:" + last_error + "->" + error)
|
||||
.build();
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -126,34 +126,7 @@ public class BlankingButtonDriver extends AbstractOpcDeviceDriver implements Dev
|
||||
|
||||
if (mode != lastMode) {
|
||||
requireSucess = false;
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(deviceCode)
|
||||
.content("信号mode:" + lastMode + "->" + mode)
|
||||
.build();
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
}
|
||||
if (move != lastMove) {
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(deviceCode)
|
||||
.content("信号move:" + lastMove + "->" + move)
|
||||
.build();
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
}
|
||||
if (action != lastAction) {
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(deviceCode)
|
||||
.content("信号action:" + lastAction + "->" + action)
|
||||
.build();
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
}
|
||||
if (error != lastError) {
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(deviceCode)
|
||||
.content("信号error:" + lastError + "->" + error)
|
||||
.build();
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
}
|
||||
|
||||
|
||||
if (mode == 0) {
|
||||
this.setIsonline(false);
|
||||
|
||||
@@ -120,32 +120,6 @@ public class GreenFoilMachineButtonDriver extends AbstractOpcDeviceDriver implem
|
||||
|
||||
if (mode != lastMode) {
|
||||
requireSucess = false;
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(deviceCode)
|
||||
.content("信号mode:" + lastMode + "->" + mode)
|
||||
.build();
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
}
|
||||
if (move != lastMove) {
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(deviceCode)
|
||||
.content("信号move:" + lastMove + "->" + move)
|
||||
.build();
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
}
|
||||
if (action != lastAction) {
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(deviceCode)
|
||||
.content("信号action:" + lastAction + "->" + action)
|
||||
.build();
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
}
|
||||
if (error != lastError) {
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(deviceCode)
|
||||
.content("信号error:" + lastError + "->" + error)
|
||||
.build();
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
}
|
||||
|
||||
if (mode == 0) {
|
||||
|
||||
@@ -107,28 +107,6 @@ public class InflatableShaftLibraryDeviceDriver extends AbstractOpcDeviceDriver
|
||||
|
||||
if (mode != lastMode) {
|
||||
requireSucess = false;
|
||||
logServer.deviceItemValue(this.deviceCode, "mode", String.valueOf(mode));
|
||||
logServer.deviceExecuteLog(this.deviceCode, "", "", "信号mode:" + lastMode + "->" + mode);
|
||||
}
|
||||
if (move != lastMove) {
|
||||
logServer.deviceItemValue(this.deviceCode, "move", String.valueOf(move));
|
||||
logServer.deviceExecuteLog(this.deviceCode, "", "", "信号move:" + lastMove + "->" + move);
|
||||
}
|
||||
if (action != lastAction) {
|
||||
logServer.deviceItemValue(this.deviceCode, "action", String.valueOf(action));
|
||||
logServer.deviceExecuteLog(this.deviceCode, "", "", "信号action:" + lastAction + "->" + action);
|
||||
}
|
||||
if (error != lastError) {
|
||||
logServer.deviceItemValue(this.deviceCode, "error", String.valueOf(error));
|
||||
logServer.deviceExecuteLog(this.deviceCode, "", "", "信号error:" + lastError + "->" + error);
|
||||
}
|
||||
if (qty != lastQty) {
|
||||
logServer.deviceItemValue(this.deviceCode, "weight", String.valueOf(qty));
|
||||
logServer.deviceExecuteLog(this.deviceCode, "", "", "信号qty:" + lastQty + "->" + qty);
|
||||
}
|
||||
if (type != lastType) {
|
||||
logServer.deviceItemValue(this.deviceCode, "weight", String.valueOf(type));
|
||||
logServer.deviceExecuteLog(this.deviceCode, "", "", "信号type:" + lastType + "->" + type);
|
||||
}
|
||||
|
||||
lastMode = mode;
|
||||
|
||||
@@ -192,144 +192,6 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl
|
||||
|
||||
if (mode != lastMode) {
|
||||
requireSucess = false;
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(deviceCode)
|
||||
.content("信号mode:" + lastMode + "->" + mode)
|
||||
.build();
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
}
|
||||
if (move != lastMove) {
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(deviceCode)
|
||||
.content("信号move:" + lastMove + "->" + move)
|
||||
.build();
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
}
|
||||
if (action != lastAction) {
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(deviceCode)
|
||||
.content("信号action:" + lastAction + "->" + action)
|
||||
.build();
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
}
|
||||
if (error != lastError) {
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(deviceCode)
|
||||
.content("信号error:" + lastError + "->" + error)
|
||||
.build();
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
}
|
||||
if (barcode != lastBarcode) {
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(deviceCode)
|
||||
.content("信号barcode:" + lastBarcode + "->" + barcode)
|
||||
.build();
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
}
|
||||
if (weight1 != lastWeight1) {
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(deviceCode)
|
||||
.content("信号weight1:" + lastWeight1 + "->" + weight1)
|
||||
.build();
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
}
|
||||
if (material1 != lastMaterial1) {
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(deviceCode)
|
||||
.content("信号material1:" + lastMaterial1 + "->" + material1)
|
||||
.build();
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
}
|
||||
if (weight2 != lastWeight2) {
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(deviceCode)
|
||||
.content("信号weight2:" + lastWeight2 + "->" + weight2)
|
||||
.build();
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
}
|
||||
if (material2 != lastMaterial2) {
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(deviceCode)
|
||||
.content("信号material2:" + lastMaterial2 + "->" + material2)
|
||||
.build();
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
}
|
||||
if (task != lastTask) {
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(deviceCode)
|
||||
.content("信号task:" + lastTask + "->" + task)
|
||||
.build();
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
}
|
||||
if (size != lastSize) {
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(deviceCode)
|
||||
.content("信号size:" + lastSize + "->" + size)
|
||||
.build();
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
}
|
||||
if (toCommand != lastToCommand) {
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(deviceCode)
|
||||
.content("信号to_command:" + lastToCommand + "->" + toCommand)
|
||||
.build();
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
}
|
||||
if (toMaterial1 != lastToMaterial1) {
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(deviceCode)
|
||||
.content("信号to_material1:" + lastToMaterial1 + "->" + toMaterial1)
|
||||
.build();
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
}
|
||||
if (toMaterial2 != lastToMaterial2) {
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(deviceCode)
|
||||
.content("信号to_material2:" + lastToMaterial2 + "->" + toMaterial2)
|
||||
.build();
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
}
|
||||
if (toQty != lastToQty) {
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(deviceCode)
|
||||
.content("信号to_qty:" + lastToQty + "->" + toQty)
|
||||
.build();
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
}
|
||||
if (toQzzType != lastToQzzType) {
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(deviceCode)
|
||||
.content("信号to_qzz_type:" + lastToQzzType + "->" + toQzzType)
|
||||
.build();
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
}
|
||||
if (toVolumn1 != lastToVolumn1) {
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(deviceCode)
|
||||
.content("信号to_volumn1:" + lastToVolumn1 + "->" + toVolumn1)
|
||||
.build();
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
}
|
||||
if (toVolumn2 != lastToVolumn2) {
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(deviceCode)
|
||||
.content("信号to_volumn1:" + lastToVolumn2 + "->" + toVolumn2)
|
||||
.build();
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
}
|
||||
if (toSize1 != lastToSize1) {
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(deviceCode)
|
||||
.content("信号to_size1:" + lastToSize1 + "->" + toSize1)
|
||||
.build();
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
}
|
||||
if (toSize2 != lastToSize2) {
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(deviceCode)
|
||||
.content("信号to_size2:" + lastToSize2 + "->" + toSize2)
|
||||
.build();
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -183,61 +183,11 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
|
||||
xPosition = this.itemProtocol.getX_position();
|
||||
yPosition = this.itemProtocol.getY_position();
|
||||
|
||||
if (toOnset != lastToOnset) {
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号to_onset:" + lastToOnset + "->" + toOnset);
|
||||
}
|
||||
if (toCommand != lastToCommand) {
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号to_command:" + lastToCommand + "->" + toCommand);
|
||||
}
|
||||
if (toTarget != lastToTarget) {
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号to_target:" + lastToTarget + "->" + toTarget);
|
||||
}
|
||||
if (toTask != lastToTask) {
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号to_task:" + lastToTask + "->" + toTask);
|
||||
}
|
||||
if (toPull != lastToPull) {
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号to_pull:" + lastToPull + "->" + toPull);
|
||||
}
|
||||
if (toSleeve != lastToSleeve) {
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号to_sleeve:" + lastToSleeve + "->" + toSleeve);
|
||||
}
|
||||
if (toSize != lastToSize) {
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号to_size:" + lastToSize + "->" + toSize);
|
||||
}
|
||||
if (mode != lastMode) {
|
||||
requireSucess = false;
|
||||
logServer.deviceItemValue(this.device_code, "mode", String.valueOf(mode));
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + lastMode + "->" + mode);
|
||||
}
|
||||
if (move != lastMove) {
|
||||
logServer.deviceItemValue(this.device_code, "move", String.valueOf(move));
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号move:" + lastMove + "->" + move);
|
||||
}
|
||||
if (action != lastAction) {
|
||||
logServer.deviceItemValue(this.device_code, "action", String.valueOf(action));
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号action:" + lastAction + "->" + action);
|
||||
}
|
||||
if (error != lastError) {
|
||||
logServer.deviceItemValue(this.device_code, "error", String.valueOf(error));
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号error:" + lastError + "->" + error);
|
||||
}
|
||||
if (walkY != lastWalkY) {
|
||||
logServer.deviceItemValue(this.device_code, "walkY", String.valueOf(walkY));
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号walk_y:" + lastWalkY + "->" + walkY);
|
||||
}
|
||||
if (task != lastTask) {
|
||||
logServer.deviceItemValue(this.device_code, "task", String.valueOf(task));
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号task:" + lastTask + "->" + task);
|
||||
}
|
||||
if (xPosition != lastXPosition) {
|
||||
logServer.deviceItemValue(this.device_code, "x_position", String.valueOf(xPosition));
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号x_position:" + lastXPosition + "->" + xPosition);
|
||||
}
|
||||
if (yPosition != lastYPosition) {
|
||||
logServer.deviceItemValue(this.device_code, "y_position", String.valueOf(yPosition));
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号y_position:" + lastYPosition + "->" + yPosition);
|
||||
}
|
||||
|
||||
|
||||
// 更新指令状态
|
||||
if (mode == 3 && task > 0) {
|
||||
Date date = new Date();
|
||||
@@ -271,12 +221,13 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
if (ObjectUtil.isNotEmpty(dto)){
|
||||
String interaction_json = dto.getInteraction_json();
|
||||
JSONObject jsonObject = (JSONObject) JSONObject.toJSON(interaction_json);
|
||||
map.put("to_pull", jsonObject.getString("is_pulling"));
|
||||
map.put("is_bushing", jsonObject.getString("is_bushing"));
|
||||
map.put("to_size", jsonObject.getString("size"));
|
||||
map.put("to_barcode", jsonObject.getString(""));
|
||||
map.put("to_command", "5");
|
||||
if (ObjectUtil.isNotEmpty(interaction_json)){
|
||||
JSONObject jsonObject = (JSONObject) JSONObject.toJSON(interaction_json);
|
||||
map.put("to_pull", jsonObject.getString("is_pulling"));
|
||||
map.put("is_bushing", jsonObject.getString("is_bushing"));
|
||||
map.put("to_size", jsonObject.getString("qzz_size"));
|
||||
map.put("to_barcode", jsonObject.getString("qzz_no"));
|
||||
}
|
||||
}
|
||||
map.put("to_command", "5");
|
||||
this.writing(map);
|
||||
@@ -404,11 +355,21 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
|
||||
}
|
||||
String startAddr = startDevice.getExtraValue().get("address").toString();
|
||||
String nextAddr = nextDevice.getExtraValue().get("address").toString();
|
||||
String interaction_json = taskDto.getInteraction_json();
|
||||
JSONObject jsonObject = JSONObject.parseObject(interaction_json);
|
||||
// Object isBushing = jsonObject.get("is_bushing");
|
||||
// Object isPulling = jsonObject.get("is_pulling");
|
||||
// Object qzzNo = jsonObject.get("qzz_no");
|
||||
// Object qzzSize = jsonObject.get("qzz_size");
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
map.put("to_command", CommonFinalParam.ONE);
|
||||
map.put("to_onset", startAddr);
|
||||
map.put("to_task", instruction.getInstruction_code());
|
||||
map.put("to_target", nextAddr);
|
||||
map.put("to_task", instruction.getInstruction_code());
|
||||
// map.put("to_pull", isPulling);
|
||||
// map.put("to_bushing", isBushing);
|
||||
// map.put("to_size", qzzSize);
|
||||
// map.put("to_barcode", qzzNo);
|
||||
this.writing(map);
|
||||
this.setRequireSucess(true);
|
||||
return true;
|
||||
@@ -482,11 +443,21 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
|
||||
}
|
||||
String startAddr = startDevice.getExtraValue().get("address").toString();
|
||||
String nextAddr = nextDevice.getExtraValue().get("address").toString();
|
||||
// String interactionJson = task.getInteraction_json();
|
||||
// JSONObject jsonObject = JSONObject.parseObject(interactionJson);
|
||||
// Object isBushing = jsonObject.get("is_bushing");
|
||||
// Object isPulling = jsonObject.get("is_pulling");
|
||||
// Object qzzNo = jsonObject.get("qzz_no");
|
||||
// Object qzzSize = jsonObject.get("qzz_size");
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
map.put("to_command", CommonFinalParam.ONE);
|
||||
map.put("to_onset", startAddr);
|
||||
map.put("to_task", instdto.getInstruction_code());
|
||||
map.put("to_target", nextAddr);
|
||||
// map.put("to_pull", isPulling);
|
||||
// map.put("to_bushing", isBushing);
|
||||
// map.put("to_size", qzzSize);
|
||||
// map.put("to_barcode", qzzNo);
|
||||
this.writing(map);
|
||||
this.setRequireSucess(true);
|
||||
notCreateInstMessage = "";
|
||||
|
||||
@@ -170,54 +170,8 @@ public class PullTailManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
|
||||
x_position = this.itemProtocol.getX_position();
|
||||
y_position = this.itemProtocol.getY_position();
|
||||
|
||||
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);
|
||||
}
|
||||
if (weight != last_weight) {
|
||||
logServer.deviceItemValue(this.device_code, "weight", String.valueOf(weight));
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号weight:" + last_weight + "->" + weight);
|
||||
}
|
||||
|
||||
// 更新指令状态
|
||||
|
||||
@@ -163,8 +163,6 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
|
||||
heartbeat = this.itemProtocol.getHeartbeat();
|
||||
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 (mode == 3 && task > 0 && !requireSucess) {
|
||||
|
||||
@@ -86,24 +86,6 @@ public class SubvolumeWeighingStationDriver extends AbstractOpcDeviceDriver impl
|
||||
weight = this.itemProtocol.getItem_weight();
|
||||
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 (weight != last_weight) {
|
||||
logServer.deviceItemValue(this.device_code, "weight", String.valueOf(weight));
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号weight:" + last_weight + "->" + weight);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -101,28 +101,6 @@ public class WasteFoilWeighingStationDriver extends AbstractOpcDeviceDriver impl
|
||||
if (mode != last_mode) {
|
||||
requireSucess = false;
|
||||
this.setFeedbackSucess(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 (weight != last_weight) {
|
||||
logServer.deviceItemValue(this.device_code, "weight", String.valueOf(weight));
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号weight:" + last_weight + "->" + weight);
|
||||
}
|
||||
if (old_weight != last_old_weight) {
|
||||
logServer.deviceItemValue(this.device_code, "old_weight", String.valueOf(old_weight));
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号old_weight:" + last_old_weight + "->" + old_weight);
|
||||
}
|
||||
|
||||
if (mode == 0) {
|
||||
|
||||
@@ -341,8 +341,6 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
||||
jo.put("size", JSONUtil.toJsonStr(size));
|
||||
jo.put("version", JSONUtil.toJsonStr(version));
|
||||
jo.put("bushing_num", JSONUtil.toJsonStr(bushing_num));
|
||||
|
||||
|
||||
if (!StrUtil.isEmpty(ext_task_id)) {
|
||||
jo.put("ext_task_id", ext_task_id);
|
||||
}
|
||||
|
||||
@@ -150,7 +150,7 @@ public class TaskServiceImpl extends CommonServiceImpl<TaskMapper, Task> impleme
|
||||
list.add(task);
|
||||
}
|
||||
} else {
|
||||
if (StrUtil.equals(task.getTask_type(), TaskTypeEnum.Inner_Truss_Task.getIndex()) && StrUtil.isNotEmpty(task.getPut_device_code())) {
|
||||
if (StrUtil.equals(task.getTask_type(), TaskTypeEnum.Truss_Task.getIndex()) && StrUtil.isNotEmpty(task.getPut_device_code())) {
|
||||
Instruction instruction = instructionService.findByDeviceCodeFromCache(task.getNext_device_code());
|
||||
if (ObjectUtil.isNotEmpty(instruction)) {
|
||||
if (StrUtil.equals(instruction.getStart_device_code(), device_code)) {
|
||||
|
||||
@@ -23,14 +23,12 @@ public class TaskScreenController {
|
||||
|
||||
@GetMapping
|
||||
@Log("下拉选设备")
|
||||
|
||||
public ResponseEntity<Object> selectLedList() {
|
||||
return new ResponseEntity<>(taskScreenService.selectLedList(), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping("/getLedMessage/{device}")
|
||||
@Log("根据关联设备获取任务信息")
|
||||
|
||||
public ResponseEntity<Object> getLedMessage(@PathVariable String device) {
|
||||
return new ResponseEntity<>(taskScreenService.getLedMessage(device), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ import org.nl.acs.device.service.dto.DeviceDto;
|
||||
import org.nl.acs.device.service.mapper.DeviceExtraMapper;
|
||||
import org.nl.acs.device.service.mapper.DeviceMapper;
|
||||
import org.nl.acs.device_driver.conveyor.belt_conveyor.BeltConveyorDeviceDriver;
|
||||
import org.nl.acs.device_driver.one_conveyor.scanner_weight_conveyor.ConveyorWithScannerWeightDeviceDriver;
|
||||
import org.nl.acs.opc.DeviceAppService;
|
||||
import org.nl.acs.taskscreen.mapper.TaskScreenMapper;
|
||||
import org.nl.acs.taskscreen.service.TaskScreenService;
|
||||
@@ -30,7 +31,7 @@ import java.util.List;
|
||||
|
||||
/**
|
||||
* @author tuqiang
|
||||
* @date 2023-05-09
|
||||
* @date 2023-12-09
|
||||
*/
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
@@ -85,11 +86,11 @@ public class TaskScreenServiceImpl extends CommonServiceImpl<TaskScreenMapper, D
|
||||
DeviceDto linkDevice = deviceService.findByCode(deviceCode1);
|
||||
String linkDeviceCode = linkDevice.getDevice_code();
|
||||
Device device = deviceAppservice.findDeviceByCode(linkDeviceCode);
|
||||
if (device.getDeviceDriver() instanceof BeltConveyorDeviceDriver) {
|
||||
BeltConveyorDeviceDriver beltConveyorDeviceDriver;
|
||||
beltConveyorDeviceDriver = (BeltConveyorDeviceDriver) device.getDeviceDriver();
|
||||
if (ObjectUtil.isNotEmpty(beltConveyorDeviceDriver.getLed_message())) {
|
||||
json = beltConveyorDeviceDriver.getLed_message();
|
||||
ConveyorWithScannerWeightDeviceDriver conveyorWithScannerWeightDeviceDriver;
|
||||
if (device.getDeviceDriver() instanceof ConveyorWithScannerWeightDeviceDriver) {
|
||||
conveyorWithScannerWeightDeviceDriver = (ConveyorWithScannerWeightDeviceDriver) device.getDeviceDriver();
|
||||
if (ObjectUtil.isNotEmpty(conveyorWithScannerWeightDeviceDriver.getLed_message())) {
|
||||
json = conveyorWithScannerWeightDeviceDriver.getLed_message();
|
||||
}
|
||||
}
|
||||
return json;
|
||||
|
||||
@@ -98,6 +98,4 @@ public class Param implements Serializable {
|
||||
* 修改时间
|
||||
*/
|
||||
private String update_time;
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user