rev:更新
This commit is contained in:
@@ -18,6 +18,7 @@ public enum DeviceType {
|
||||
group("设备组", 12),
|
||||
plcDb("plcDb块", 13),
|
||||
shadow("影子设备", 15),
|
||||
button("按钮",14),
|
||||
other("其他设备", 16);
|
||||
|
||||
|
||||
|
||||
@@ -535,6 +535,18 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
|
||||
}
|
||||
|
||||
public void writing(String param, String value) {
|
||||
|
||||
String to_param = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code()
|
||||
+ "." + param;
|
||||
|
||||
Map<String, Object> itemMap = new HashMap<String, Object>();
|
||||
|
||||
itemMap.put(to_param, Integer.parseInt(value));
|
||||
this.control(itemMap);
|
||||
logServer.deviceExecuteLog(device_code, "", "", "下发电气信号设备号:" + device_code + ",下发电气:" + to_param + ",下发电气值:" + value);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 请求指令
|
||||
|
||||
@@ -41,7 +41,7 @@ public class BlankManipulatorDefination implements OpcDeviceDriverDefination {
|
||||
@Override
|
||||
public List<DeviceType> getFitDeviceTypes() {
|
||||
List<DeviceType> types = new LinkedList();
|
||||
types.add(DeviceType.station);
|
||||
types.add(DeviceType.robot);
|
||||
return types;
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,9 @@ import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.http.HttpResponse;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.Data;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@@ -17,6 +20,9 @@ import org.nl.acs.device_driver.FeedLmsRealFailed;
|
||||
import org.nl.acs.device_driver.RouteableDeviceDriver;
|
||||
import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver;
|
||||
import org.nl.acs.device_driver.driver.ExecutableDeviceDriver;
|
||||
import org.nl.acs.ext.wms.data.ApplyManipulatorActionRequest;
|
||||
import org.nl.acs.ext.wms.data.ApplyManipulatorActionResponse;
|
||||
import org.nl.acs.ext.wms.service.AcsToWmsService;
|
||||
import org.nl.acs.history.ErrorUtil;
|
||||
import org.nl.acs.history.service.DeviceErrorLogService;
|
||||
import org.nl.acs.history.service.impl.DeviceErrorLogServiceImpl;
|
||||
@@ -61,7 +67,8 @@ public class BlankManipulatorDeviceDriver extends AbstractOpcDeviceDriver implem
|
||||
DeviceExtraService deviceExtraService = SpringContextHolder.getBean(DeviceExtraServiceImpl.class);
|
||||
@Autowired
|
||||
DeviceErrorLogService errorLogServer = SpringContextHolder.getBean(DeviceErrorLogServiceImpl.class);
|
||||
|
||||
@Autowired
|
||||
AcsToWmsService acsToWmsService = SpringContextHolder.getBean("acsToWmsServiceImpl");
|
||||
//工作模式
|
||||
int mode = 0;
|
||||
int last_mode = 0;
|
||||
@@ -233,12 +240,31 @@ public class BlankManipulatorDeviceDriver extends AbstractOpcDeviceDriver implem
|
||||
if (mode == 3 && action == 5 && move == 1 && task > 0) {
|
||||
Instruction inst2 = instructionService.findByCodeFromCache(String.valueOf(task));
|
||||
if (ObjectUtil.isNotEmpty(inst2)) {
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
//todo:反馈重量、条码
|
||||
map.put("to_command", "5");
|
||||
this.writing(map);
|
||||
String task_code = inst2.getTask_code();
|
||||
TaskDto dto = taskserver.findByCode(task_code);
|
||||
JSONObject jo = new JSONObject();
|
||||
jo.put("task_id", dto.getTask_id());
|
||||
jo.put("task_code", dto.getTask_code());
|
||||
jo.put("task_status", dto.getTask_status());
|
||||
jo.put("productin_qty", String.valueOf(this.weight));
|
||||
jo.put("scroll_code", String.valueOf(this.barcode));
|
||||
JSONArray ja = new JSONArray();
|
||||
ja.add(jo);
|
||||
HttpResponse body = acsToWmsService.feedbackTaskStatusToWms(ja);
|
||||
if (body.getStatus() == 200) {
|
||||
message = "反馈重量以及收卷轴LMS成功...";
|
||||
requireSucess = true;
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "反馈尺寸成请求成功,响应参数:" + JSON.toJSONString(body));
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
map.put("to_command", "5");
|
||||
this.writing(map);
|
||||
} else {
|
||||
message = "反馈重量以及收卷轴LMS失败...";
|
||||
requireSucess = false;
|
||||
message = "反馈LMS尺寸失败";
|
||||
}
|
||||
} else {
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "未反馈电气信号原因:当前步骤不为允许取货(now_steps_type!=3)");
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "当前指令号为空");
|
||||
}
|
||||
} else {
|
||||
feedMessage = "行架机械手:";
|
||||
@@ -262,6 +288,8 @@ public class BlankManipulatorDeviceDriver extends AbstractOpcDeviceDriver implem
|
||||
if (inst2 != null) {
|
||||
if (StrUtil.equals(inst2.getInstruction_status(), InstructionStatusEnum.BUSY.getIndex())) {
|
||||
try {
|
||||
requireSucess = true;
|
||||
message = "任务完成...";
|
||||
finish_instruction(inst2);
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
map.put("to_command", "6");
|
||||
|
||||
@@ -17,12 +17,12 @@ import java.util.List;
|
||||
public class BlankingButtonDefination implements OpcDeviceDriverDefination {
|
||||
@Override
|
||||
public String getDriverCode() {
|
||||
return "green_foil_machine_button";
|
||||
return "blanking_button";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDriverName() {
|
||||
return "下料按钮";
|
||||
return "表处下料按钮";
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -43,7 +43,7 @@ public class BlankingButtonDefination implements OpcDeviceDriverDefination {
|
||||
@Override
|
||||
public List<DeviceType> getFitDeviceTypes() {
|
||||
List<DeviceType> types = new LinkedList();
|
||||
types.add(DeviceType.conveyor);
|
||||
types.add(DeviceType.button);
|
||||
return types;
|
||||
}
|
||||
|
||||
|
||||
@@ -71,17 +71,17 @@ public class ItemProtocol {
|
||||
|
||||
public static List<ItemDto> getReadableItemDtos() {
|
||||
ArrayList list = new ArrayList();
|
||||
list.add(new ItemDto(item_heartbeat, "心跳", "251"));
|
||||
list.add(new ItemDto(item_mode, "工作模式", "7990"));
|
||||
list.add(new ItemDto(item_move, "光电信号", "550"));
|
||||
list.add(new ItemDto(item_action, "取放信号", "450"));
|
||||
list.add(new ItemDto(item_error, "故障", "8055"));
|
||||
list.add(new ItemDto(item_heartbeat, "心跳", "DB3.B0"));
|
||||
list.add(new ItemDto(item_mode, "工作模式", "DB3.B1"));
|
||||
list.add(new ItemDto(item_move, "光电信号", "DB3.B2"));
|
||||
list.add(new ItemDto(item_action, "取放信号", "DB3.B3"));
|
||||
list.add(new ItemDto(item_error, "故障", "DB3.B4"));
|
||||
return list;
|
||||
}
|
||||
|
||||
public static List<ItemDto> getWriteableItemDtos() {
|
||||
ArrayList list = new ArrayList();
|
||||
list.add(new ItemDto(item_to_command, "下发命令", "40226"));
|
||||
list.add(new ItemDto(item_to_command, "下发命令", "DB4.W0"));
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
@@ -22,12 +22,12 @@ public class GreenFoilMachineButtonDefination implements OpcDeviceDriverDefinati
|
||||
|
||||
@Override
|
||||
public String getDriverName() {
|
||||
return "生箔机按钮协议";
|
||||
return "生箔机按钮";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDriverDescription() {
|
||||
return "生箔机按钮协议";
|
||||
return "生箔机按钮";
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -43,7 +43,7 @@ public class GreenFoilMachineButtonDefination implements OpcDeviceDriverDefinati
|
||||
@Override
|
||||
public List<DeviceType> getFitDeviceTypes() {
|
||||
List<DeviceType> types = new LinkedList();
|
||||
types.add(DeviceType.conveyor);
|
||||
types.add(DeviceType.button);
|
||||
return types;
|
||||
}
|
||||
|
||||
|
||||
@@ -161,7 +161,7 @@ public class GreenFoilMachineButtonDriver extends AbstractOpcDeviceDriver implem
|
||||
break;
|
||||
case 4:
|
||||
// 申请AGV取空取满放空放满任务
|
||||
if (move > 0 && !requireSucess) {
|
||||
if (!requireSucess) {
|
||||
applyAgvTask(mode);
|
||||
}
|
||||
break;
|
||||
@@ -169,31 +169,19 @@ public class GreenFoilMachineButtonDriver extends AbstractOpcDeviceDriver implem
|
||||
/**
|
||||
* 申请AGV取空放空的任务
|
||||
*/
|
||||
if (move > 0 && !requireSucess) {
|
||||
if (!requireSucess) {
|
||||
applyAgvTask(mode);
|
||||
}
|
||||
break;
|
||||
case 6:
|
||||
// 申请取满放满任务
|
||||
if (move > 0 && !requireSucess) {
|
||||
applyAgvTask(mode);
|
||||
}
|
||||
break;
|
||||
case 7:
|
||||
// 允许AGV进入
|
||||
if (move == 0 && !requireSucess) {
|
||||
applyAgvTask(mode);
|
||||
}
|
||||
break;
|
||||
case 8:
|
||||
// 允许AGV离开
|
||||
if (move == 0 && !requireSucess) {
|
||||
if (!requireSucess) {
|
||||
applyAgvTask(mode);
|
||||
}
|
||||
break;
|
||||
case 9:
|
||||
// 取消任务
|
||||
if (move == 0 && !requireSucess) {
|
||||
if (!requireSucess) {
|
||||
applyAgvTask(mode);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -71,17 +71,17 @@ public class ItemProtocol {
|
||||
|
||||
public static List<ItemDto> getReadableItemDtos() {
|
||||
ArrayList list = new ArrayList();
|
||||
list.add(new ItemDto(item_heartbeat, "心跳", "251"));
|
||||
list.add(new ItemDto(item_mode, "工作模式", "7990"));
|
||||
list.add(new ItemDto(item_move, "光电信号", "550"));
|
||||
list.add(new ItemDto(item_action, "取放信号", "450"));
|
||||
list.add(new ItemDto(item_error, "故障", "8055"));
|
||||
list.add(new ItemDto(item_heartbeat, "心跳", "DB5.B0"));
|
||||
list.add(new ItemDto(item_mode, "工作模式", "DB5.B1"));
|
||||
list.add(new ItemDto(item_move, "光电信号", "DB5.B2"));
|
||||
list.add(new ItemDto(item_action, "取放信号", "DB5.B3"));
|
||||
list.add(new ItemDto(item_error, "故障", "DB5.B4"));
|
||||
return list;
|
||||
}
|
||||
|
||||
public static List<ItemDto> getWriteableItemDtos() {
|
||||
ArrayList list = new ArrayList();
|
||||
list.add(new ItemDto(item_to_command, "下发命令", "40226"));
|
||||
list.add(new ItemDto(item_to_command, "下发命令", "DB6.W0"));
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ public class HongXiangStationDefination implements OpcDeviceDriverDefination {
|
||||
@Override
|
||||
public List<DeviceType> getFitDeviceTypes() {
|
||||
List<DeviceType> types = new LinkedList();
|
||||
types.add(DeviceType.conveyor);
|
||||
types.add(DeviceType.station);
|
||||
return types;
|
||||
}
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ public class HongXiangConveyorDefination implements OpcDeviceDriverDefination {
|
||||
@Override
|
||||
public List<DeviceType> getFitDeviceTypes() {
|
||||
List<DeviceType> types = new LinkedList();
|
||||
types.add(DeviceType.conveyor);
|
||||
types.add(DeviceType.station);
|
||||
return types;
|
||||
}
|
||||
|
||||
|
||||
@@ -78,19 +78,19 @@ public class ItemProtocol {
|
||||
|
||||
public static List<ItemDto> getReadableItemDtos() {
|
||||
ArrayList list = new ArrayList();
|
||||
list.add(new ItemDto(item_heartbeat, "心跳", "DB1.B0"));
|
||||
list.add(new ItemDto(item_mode, "工作模式", "DB1.B1"));
|
||||
list.add(new ItemDto(item_move, "光电信号", "DB1.B2"));
|
||||
list.add(new ItemDto(item_action, "动作信号", "DB1.B3"));
|
||||
list.add(new ItemDto(item_qty, "数量", "DB1.B4"));
|
||||
list.add(new ItemDto(item_error, "报警信号", "DB1.B5"));
|
||||
list.add(new ItemDto(item_type, "类型", "DB1.B6"));
|
||||
list.add(new ItemDto(item_heartbeat, "心跳", "DB7.B0"));
|
||||
list.add(new ItemDto(item_mode, "工作模式", "DB7.B1"));
|
||||
list.add(new ItemDto(item_move, "光电信号", "DB7.B2"));
|
||||
list.add(new ItemDto(item_action, "动作信号", "DB7.B3"));
|
||||
list.add(new ItemDto(item_qty, "数量", "DB7.B4"));
|
||||
list.add(new ItemDto(item_error, "报警信号", "DB7.B5"));
|
||||
list.add(new ItemDto(item_type, "类型", "DB7.B6"));
|
||||
return list;
|
||||
}
|
||||
|
||||
public static List<ItemDto> getWriteableItemDtos() {
|
||||
ArrayList<ItemDto> list = new ArrayList<>();
|
||||
list.add(new ItemDto(item_to_command, "下发命令", "DB2.W0"));
|
||||
list.add(new ItemDto(item_to_command, "下发命令", "DB8.W0"));
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ public class OvenGantryManipulatorDefination implements OpcDeviceDriverDefinatio
|
||||
@Override
|
||||
public List<DeviceType> getFitDeviceTypes() {
|
||||
List<DeviceType> types = new LinkedList();
|
||||
types.add(DeviceType.station);
|
||||
types.add(DeviceType.robot);
|
||||
return types;
|
||||
}
|
||||
|
||||
|
||||
@@ -151,30 +151,30 @@ public class ItemProtocol {
|
||||
|
||||
public static List<ItemDto> getReadableItemDtos() {
|
||||
ArrayList list = new ArrayList();
|
||||
list.add(new ItemDto(item_heartbeat, "心跳", "DB1.B0"));
|
||||
list.add(new ItemDto(item_mode, "工作模式", "DB1.B1"));
|
||||
list.add(new ItemDto(item_move, "光电信号", "DB1.B2"));
|
||||
list.add(new ItemDto(item_action, "动作信号", "DB1.B3"));
|
||||
list.add(new ItemDto(item_barcode, "气胀轴条码", "DB1.B4"));
|
||||
list.add(new ItemDto(item_weight1, "纸管1重量", "DB1.B4"));
|
||||
list.add(new ItemDto(item_material1, "纸管1规格", "DB1.B4"));
|
||||
list.add(new ItemDto(item_weight2, "纸管2重量", "DB1.B4"));
|
||||
list.add(new ItemDto(item_material2, "纸管2规格", "DB1.B4"));
|
||||
list.add(new ItemDto(item_error, "报警信号", "DB1.B5"));
|
||||
list.add(new ItemDto(item_task, "任务号", "DB1.D6"));
|
||||
list.add(new ItemDto(item_heartbeat, "心跳", "DB9.B0"));
|
||||
list.add(new ItemDto(item_mode, "工作模式", "DB9.B1"));
|
||||
list.add(new ItemDto(item_move, "光电信号", "DB9.B2"));
|
||||
list.add(new ItemDto(item_action, "动作信号", "DB9.B3"));
|
||||
list.add(new ItemDto(item_barcode, "气胀轴条码", "DB9.B4"));
|
||||
list.add(new ItemDto(item_weight1, "纸管1重量", "DB9.B5"));
|
||||
list.add(new ItemDto(item_material1, "纸管1规格", "DB9.B6"));
|
||||
list.add(new ItemDto(item_weight2, "纸管2重量", "DB9.B7"));
|
||||
list.add(new ItemDto(item_material2, "纸管2规格", "DB9.B8"));
|
||||
list.add(new ItemDto(item_error, "报警信号", "DB9.B9"));
|
||||
list.add(new ItemDto(item_task, "任务号", "DB9.D10"));
|
||||
return list;
|
||||
}
|
||||
|
||||
public static List<ItemDto> getWriteableItemDtos() {
|
||||
ArrayList list = new ArrayList();
|
||||
list.add(new ItemDto(item_to_command, "下发命令", "DB2.W0"));
|
||||
list.add(new ItemDto(item_to_material1, "纸管1规格", "DB2.W2"));
|
||||
list.add(new ItemDto(item_to_material2, "纸管2规格", "DB2.W4"));
|
||||
list.add(new ItemDto(item_to_qty, "纸管数量", "DB2.W6"));
|
||||
list.add(new ItemDto(item_to_qzz_type, "气胀轴类型", "DB2.W8"));
|
||||
list.add(new ItemDto(item_to_is_changeShaft, "是否换轴", "DB2.W"));
|
||||
list.add(new ItemDto(item_to_location, "存储位置", "DB2.W10"));
|
||||
list.add(new ItemDto(item_to_size, "尺寸", "DB2.W12"));
|
||||
list.add(new ItemDto(item_to_command, "下发命令", "DB10.W0"));
|
||||
list.add(new ItemDto(item_to_material1, "纸管1规格", "DB10.W2"));
|
||||
list.add(new ItemDto(item_to_material2, "纸管2规格", "DB10.W4"));
|
||||
list.add(new ItemDto(item_to_qty, "纸管数量", "DB10.W6"));
|
||||
list.add(new ItemDto(item_to_qzz_type, "气胀轴类型", "DB10.W8"));
|
||||
list.add(new ItemDto(item_to_is_changeShaft, "是否换轴", "DB10.W10"));
|
||||
list.add(new ItemDto(item_to_location, "存储位置", "DB10.W12"));
|
||||
list.add(new ItemDto(item_to_size, "尺寸", "DB10.W14"));
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ public class PlugPullDeviceSiteDefination implements OpcDeviceDriverDefination {
|
||||
@Override
|
||||
public List<DeviceType> getFitDeviceTypes() {
|
||||
List<DeviceType> types = new LinkedList();
|
||||
types.add(DeviceType.conveyor);
|
||||
types.add(DeviceType.station);
|
||||
return types;
|
||||
}
|
||||
|
||||
|
||||
@@ -13,6 +13,10 @@ import org.nl.acs.device_driver.DeviceDriver;
|
||||
import org.nl.acs.device_driver.RouteableDeviceDriver;
|
||||
import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver;
|
||||
import org.nl.acs.device_driver.driver.ExecutableDeviceDriver;
|
||||
import org.nl.acs.ext.wms.data.ApplyManipulatorActionRequest;
|
||||
import org.nl.acs.ext.wms.data.ApplyManipulatorActionResponse;
|
||||
import org.nl.acs.ext.wms.data.ApplyPlugPullSitResponse;
|
||||
import org.nl.acs.ext.wms.data.ApplyPlugPullSiteRequest;
|
||||
import org.nl.acs.ext.wms.service.AcsToWmsService;
|
||||
import org.nl.acs.ext.wms.service.impl.AcsToWmsServiceImpl;
|
||||
import org.nl.acs.instruction.domain.Instruction;
|
||||
@@ -324,29 +328,88 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl
|
||||
* 申请套管
|
||||
*/
|
||||
private synchronized void apply_casing(int mode) {
|
||||
this.writeSignal(mode);
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "申请套管,返回参数:" + "applyResponse");
|
||||
message = "申请套管成功";
|
||||
ApplyPlugPullSiteRequest applyPlugPullSiteRequest = new ApplyPlugPullSiteRequest();
|
||||
ApplyPlugPullSitResponse applyPlugPullSitResponse;
|
||||
Instruction inst1 = instructionService.findByCode(String.valueOf(task));
|
||||
String task_code1 = inst1.getTask_code();
|
||||
applyPlugPullSiteRequest.setDevice_code(device_code);
|
||||
applyPlugPullSiteRequest.setTask_code(task_code1);
|
||||
applyPlugPullSiteRequest.setType("1");
|
||||
applyPlugPullSitResponse = acsToWmsService.applyPlugPullSiteRequest(applyPlugPullSiteRequest);
|
||||
if (applyPlugPullSitResponse.getCode() == 200) {
|
||||
this.writeSignal(mode);
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "申请套管,返回参数:" + applyPlugPullSitResponse);
|
||||
message = "申请套管成功";
|
||||
} else {
|
||||
message = applyPlugPullSitResponse.getMessage();
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
map.put("to_command", 99);
|
||||
this.writing(map);
|
||||
requireSucess = true;
|
||||
message = "申请套管失败";
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "申请套管反馈失败,返回参数:" + applyPlugPullSitResponse);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 套管完成
|
||||
*/
|
||||
private synchronized void bushingSucess(int mode) {
|
||||
this.writeSignal(mode);
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "反馈套管完成,返回参数:" + "applyResponse");
|
||||
message = "套管完成成功";
|
||||
ApplyPlugPullSiteRequest applyPlugPullSiteRequest = new ApplyPlugPullSiteRequest();
|
||||
ApplyPlugPullSitResponse applyPlugPullSitResponse;
|
||||
Instruction inst1 = instructionService.findByCode(String.valueOf(task));
|
||||
String task_code1 = inst1.getTask_code();
|
||||
applyPlugPullSiteRequest.setDevice_code(device_code);
|
||||
applyPlugPullSiteRequest.setTask_code(task_code1);
|
||||
applyPlugPullSiteRequest.setType("2");
|
||||
applyPlugPullSitResponse = acsToWmsService.applyPlugPullSiteRequest(applyPlugPullSiteRequest);
|
||||
if (applyPlugPullSitResponse.getCode() == 200) {
|
||||
this.writeSignal(mode);
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "反馈套管完成,返回参数:" + applyPlugPullSitResponse);
|
||||
message = "套管完成成功";
|
||||
} else {
|
||||
message = applyPlugPullSitResponse.getMessage();
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
map.put("to_command", 99);
|
||||
this.writing(map);
|
||||
requireSucess = true;
|
||||
message = "申请套管失败";
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "申请套管反馈失败,返回参数:" + applyPlugPullSitResponse);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 拔轴完成
|
||||
*/
|
||||
private synchronized void pullShaftSucess(int mode) {
|
||||
this.writeSignal(mode);
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "申请拔轴,返回参数:" + "applyResponse");
|
||||
message = "拔轴完成成功";
|
||||
ApplyPlugPullSiteRequest applyPlugPullSiteRequest = new ApplyPlugPullSiteRequest();
|
||||
ApplyPlugPullSitResponse applyPlugPullSitResponse;
|
||||
Instruction inst1 = instructionService.findByCode(String.valueOf(task));
|
||||
String task_code1 = inst1.getTask_code();
|
||||
applyPlugPullSiteRequest.setDevice_code(device_code);
|
||||
applyPlugPullSiteRequest.setTask_code(task_code1);
|
||||
applyPlugPullSiteRequest.setType("3");
|
||||
applyPlugPullSitResponse = acsToWmsService.applyPlugPullSiteRequest(applyPlugPullSiteRequest);
|
||||
if (applyPlugPullSitResponse.getCode() == 200) {
|
||||
this.writeSignal(mode);
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "申请拔轴,返回参数:" + applyPlugPullSitResponse);
|
||||
message = "拔轴完成成功";
|
||||
} else {
|
||||
message = applyPlugPullSitResponse.getMessage();
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
map.put("to_command", 99);
|
||||
this.writing(map);
|
||||
requireSucess = true;
|
||||
message = "申请拔轴失败";
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "申请拔轴反馈失败,返回参数:" + applyPlugPullSitResponse);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 下发电气信号
|
||||
* @param mode
|
||||
*/
|
||||
public void writeSignal(int mode){
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
map.put("to_command", mode);
|
||||
|
||||
@@ -180,31 +180,31 @@ public class ItemProtocol {
|
||||
|
||||
public static List<ItemDto> getReadableItemDtos() {
|
||||
ArrayList<ItemDto> list = new ArrayList<>();
|
||||
list.add(new ItemDto(item_heartbeat, "心跳", "DB1.B0"));
|
||||
list.add(new ItemDto(item_mode, "工作模式", "DB1.B1"));
|
||||
list.add(new ItemDto(item_move, "光电信号", "DB1.B2"));
|
||||
list.add(new ItemDto(item_action, "动作信号", "DB1.B3"));
|
||||
list.add(new ItemDto(item_walk_y, "行走列", "DB1.B4"));
|
||||
list.add(new ItemDto(item_error, "报警信号", "DB1.B5"));
|
||||
list.add(new ItemDto(item_task, "任务号", "DB1.D6"));
|
||||
list.add(new ItemDto(item_x_position, "x坐标", "DB1.REAL10"));
|
||||
list.add(new ItemDto(item_y_position, "y坐标", "DB1.REAL14"));
|
||||
list.add(new ItemDto(item_heartbeat, "心跳", "DB11.B0"));
|
||||
list.add(new ItemDto(item_mode, "工作模式", "DB11.B1"));
|
||||
list.add(new ItemDto(item_move, "光电信号", "DB11.B2"));
|
||||
list.add(new ItemDto(item_action, "动作信号", "DB11.B3"));
|
||||
list.add(new ItemDto(item_walk_y, "行走列", "DB11.B4"));
|
||||
list.add(new ItemDto(item_error, "报警信号", "DB11.B5"));
|
||||
list.add(new ItemDto(item_task, "任务号", "DB11.D6"));
|
||||
list.add(new ItemDto(item_x_position, "x坐标", "DB11.REAL10"));
|
||||
list.add(new ItemDto(item_y_position, "y坐标", "DB11.REAL14"));
|
||||
return list;
|
||||
}
|
||||
|
||||
public static List<ItemDto> getWriteableItemDtos() {
|
||||
ArrayList<ItemDto> list = new ArrayList<>();
|
||||
list.add(new ItemDto(item_to_command, "下发命令", "DB2.W0"));
|
||||
list.add(new ItemDto(item_to_onset, "下发起始站", "DB2.W2"));
|
||||
list.add(new ItemDto(item_to_target, "下发目标站", "DB2.W4"));
|
||||
list.add(new ItemDto(item_to_task, "下发任务号", "DB2.D6"));
|
||||
list.add(new ItemDto(item_to_pull, "是否拔轴", "DB2.W8"));
|
||||
list.add(new ItemDto(item_to_sleeve, "是否套轴", "DB2.W10"));
|
||||
list.add(new ItemDto(item_to_size, "尺寸", "DB2.W12"));
|
||||
list.add(new ItemDto(item_to_version, "代数", "DB2.W14"));
|
||||
list.add(new ItemDto(item_to_qty, "子卷数量", "DB2.W16"));
|
||||
list.add(new ItemDto(item_to_length1, "子卷1长度", "DB2.W18"));
|
||||
list.add(new ItemDto(item_to_length2, "子卷2长度", "DB2.W20"));
|
||||
list.add(new ItemDto(item_to_command, "下发命令", "DB12.W0"));
|
||||
list.add(new ItemDto(item_to_onset, "下发起始站", "DB12.W2"));
|
||||
list.add(new ItemDto(item_to_target, "下发目标站", "DB12.W4"));
|
||||
list.add(new ItemDto(item_to_task, "下发任务号", "DB12.D6"));
|
||||
list.add(new ItemDto(item_to_pull, "是否拔轴", "DB12.W8"));
|
||||
list.add(new ItemDto(item_to_sleeve, "是否套轴", "DB12.W10"));
|
||||
list.add(new ItemDto(item_to_size, "尺寸", "DB12.W12"));
|
||||
list.add(new ItemDto(item_to_version, "代数", "DB12.W14"));
|
||||
list.add(new ItemDto(item_to_qty, "子卷数量", "DB12.W16"));
|
||||
list.add(new ItemDto(item_to_length1, "子卷1长度", "DB12.W18"));
|
||||
list.add(new ItemDto(item_to_length2, "子卷2长度", "DB12.W20"));
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ public class PullHeadManipulatorDefination implements OpcDeviceDriverDefination
|
||||
@Override
|
||||
public List<DeviceType> getFitDeviceTypes() {
|
||||
List<DeviceType> types = new LinkedList();
|
||||
types.add(DeviceType.station);
|
||||
types.add(DeviceType.robot);
|
||||
return types;
|
||||
}
|
||||
|
||||
|
||||
@@ -143,25 +143,25 @@ public class ItemProtocol {
|
||||
|
||||
public static List<ItemDto> getReadableItemDtos() {
|
||||
ArrayList<ItemDto> list = new ArrayList<>();
|
||||
list.add(new ItemDto(item_heartbeat, "心跳", "DB1.B0"));
|
||||
list.add(new ItemDto(item_mode, "工作模式", "DB1.B1"));
|
||||
list.add(new ItemDto(item_move, "光电信号", "DB1.B2"));
|
||||
list.add(new ItemDto(item_action, "动作信号", "DB1.B3"));
|
||||
list.add(new ItemDto(item_walk_y, "行走列", "DB1.B4"));
|
||||
list.add(new ItemDto(item_error, "报警信号", "DB1.B5"));
|
||||
list.add(new ItemDto(item_task, "任务号", "DB1.D6"));
|
||||
list.add(new ItemDto(item_x_position, "x坐标", "DB1.REAL10"));
|
||||
list.add(new ItemDto(item_y_position, "y坐标", "DB1.REAL14"));
|
||||
list.add(new ItemDto(item_weight, "重量", "DB1.REAL16"));
|
||||
list.add(new ItemDto(item_heartbeat, "心跳", "DB13.B0"));
|
||||
list.add(new ItemDto(item_mode, "工作模式", "DB13.B1"));
|
||||
list.add(new ItemDto(item_move, "光电信号", "DB13.B2"));
|
||||
list.add(new ItemDto(item_action, "动作信号", "DB13.B3"));
|
||||
list.add(new ItemDto(item_walk_y, "行走列", "DB13.B4"));
|
||||
list.add(new ItemDto(item_error, "报警信号", "DB13.B5"));
|
||||
list.add(new ItemDto(item_task, "任务号", "DB13.D6"));
|
||||
list.add(new ItemDto(item_x_position, "x坐标", "DB13.REAL10"));
|
||||
list.add(new ItemDto(item_y_position, "y坐标", "DB13.REAL14"));
|
||||
list.add(new ItemDto(item_weight, "重量", "DB13.REAL16"));
|
||||
return list;
|
||||
}
|
||||
|
||||
public static List<ItemDto> getWriteableItemDtos() {
|
||||
ArrayList<ItemDto> list = new ArrayList<>();
|
||||
list.add(new ItemDto(item_to_command, "下发命令", "DB2.W0"));
|
||||
list.add(new ItemDto(item_to_onset, "下发起始站", "DB2.W2"));
|
||||
list.add(new ItemDto(item_to_target, "下发目标站", "DB2.W4"));
|
||||
list.add(new ItemDto(item_to_task, "下发任务号", "DB2.D6"));
|
||||
list.add(new ItemDto(item_to_command, "下发命令", "DB14.W0"));
|
||||
list.add(new ItemDto(item_to_onset, "下发起始站", "DB14.W2"));
|
||||
list.add(new ItemDto(item_to_target, "下发目标站", "DB14.W4"));
|
||||
list.add(new ItemDto(item_to_task, "下发任务号", "DB14.D6"));
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ public class PullTailManipulatorDefination implements OpcDeviceDriverDefination
|
||||
@Override
|
||||
public List<DeviceType> getFitDeviceTypes() {
|
||||
List<DeviceType> types = new LinkedList();
|
||||
types.add(DeviceType.station);
|
||||
types.add(DeviceType.robot);
|
||||
return types;
|
||||
}
|
||||
|
||||
|
||||
@@ -12,57 +12,52 @@ import java.util.List;
|
||||
@Data
|
||||
public class ItemProtocol {
|
||||
|
||||
/**
|
||||
/**
|
||||
* 心跳
|
||||
*/
|
||||
public static String item_heartbeat = "heartbeat";
|
||||
/**
|
||||
/**
|
||||
* 工作模式
|
||||
*/
|
||||
public static String item_mode = "mode";
|
||||
//设备状态
|
||||
public static String item_status = "status";
|
||||
//前工位光电信号
|
||||
public static String item_move1 = "move1";
|
||||
//后工位光电信号
|
||||
public static String item_move2 = "move2";
|
||||
//前工位动作信号
|
||||
public static String item_action1 = "action1";
|
||||
//后工位动作信号
|
||||
public static String item_action2 = "action2";
|
||||
//动作信号
|
||||
public static String item_action = "action";
|
||||
/**
|
||||
* 行走列
|
||||
*/
|
||||
public static String item_walk_y = "walk_y";
|
||||
/**
|
||||
//x坐标
|
||||
public static String item_x_position = "x_position";
|
||||
//动作信号
|
||||
public static String item_y_position = "y_position";
|
||||
/**
|
||||
* 报警
|
||||
*/
|
||||
public static String item_error = "error";
|
||||
//任务类型
|
||||
public static String item_type = "type";
|
||||
//前工位任务号
|
||||
public static String item_task1 = "task1";
|
||||
//后工位任务号
|
||||
public static String item_task2 = "task2";
|
||||
//任务号
|
||||
public static String item_task = "task";
|
||||
|
||||
|
||||
//前工位下发命令
|
||||
public static String item_to_command1 = "to_command1";
|
||||
//前工位下发起始站
|
||||
|
||||
//下发命令
|
||||
public static String item_to_command = "to_command";
|
||||
//下发起始站
|
||||
public static String item_to_onset1 = "to_onset1";
|
||||
//前工位下发目标站
|
||||
//下发目标站
|
||||
public static String item_to_target1 = "to_target1";
|
||||
//前工位下发任务号
|
||||
public static String item_to_task1 = "to_task1";
|
||||
//后工位下发命令
|
||||
public static String item_to_command2 = "to_command2";
|
||||
//后工位下发起始站
|
||||
//下发任务号
|
||||
public static String item_to_task = "to_task";
|
||||
//下发起始站2
|
||||
public static String item_to_onset2 = "to_onset2";
|
||||
//后工位下发目标站
|
||||
//下发目标站2
|
||||
public static String item_to_target2 = "to_target2";
|
||||
//后工位下发任务号
|
||||
public static String item_to_task2 = "to_task2";
|
||||
//任务类型 1前工位 2后工位 3双工位
|
||||
//下发空轴位
|
||||
public static String item_to_empty_shaft_site = "to_empty_shaft_site";
|
||||
//下发任务类型
|
||||
public static String item_to_type = "to_type";
|
||||
|
||||
|
||||
@@ -80,10 +75,6 @@ public class ItemProtocol {
|
||||
return this.getOpcIntegerValue(item_mode);
|
||||
}
|
||||
|
||||
public int getStatus() {
|
||||
return this.getOpcIntegerValue(item_status);
|
||||
}
|
||||
|
||||
public int getError() {
|
||||
return this.getOpcIntegerValue(item_error);
|
||||
}
|
||||
@@ -96,28 +87,24 @@ public class ItemProtocol {
|
||||
return this.getOpcIntegerValue(item_move2);
|
||||
}
|
||||
|
||||
public int getAction1() {
|
||||
return this.getOpcIntegerValue(item_action1);
|
||||
}
|
||||
|
||||
public int getAction2() {
|
||||
return this.getOpcIntegerValue(item_action2);
|
||||
public int getAction() {
|
||||
return this.getOpcIntegerValue(item_action);
|
||||
}
|
||||
|
||||
public int getWalk_y() {
|
||||
return this.getOpcIntegerValue(item_walk_y);
|
||||
}
|
||||
|
||||
public int getType() {
|
||||
return this.getOpcIntegerValue(item_type);
|
||||
public float getX_position() {
|
||||
return this.getOpcFloatValue(item_x_position);
|
||||
}
|
||||
|
||||
public int getTask1() {
|
||||
return this.getOpcIntegerValue(item_task1);
|
||||
public float getY_position() {
|
||||
return this.getOpcFloatValue(item_y_position);
|
||||
}
|
||||
|
||||
public int getTask2() {
|
||||
return this.getOpcIntegerValue(item_task2);
|
||||
public int getTask() {
|
||||
return this.getOpcIntegerValue(item_task);
|
||||
}
|
||||
|
||||
|
||||
@@ -143,6 +130,19 @@ public class ItemProtocol {
|
||||
|
||||
}
|
||||
|
||||
public float getOpcFloatValue(String protocol) {
|
||||
Float value = this.driver.getDoubleValue(protocol);
|
||||
if (value == null) {
|
||||
// log.error(this.getDriver().getDeviceCode() + ":protocol " + protocol + " 信号同步异常!");
|
||||
setIsonline(false);
|
||||
} else {
|
||||
setIsonline(true);
|
||||
return value;
|
||||
}
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
public String getOpcStringValue(String protocol) {
|
||||
String value = this.driver.getStringValue(protocol);
|
||||
if (StrUtil.isEmpty(value)) {
|
||||
@@ -155,32 +155,29 @@ public class ItemProtocol {
|
||||
|
||||
public static List<ItemDto> getReadableItemDtos() {
|
||||
ArrayList list = new ArrayList();
|
||||
list.add(new ItemDto(item_heartbeat, "心跳", "DB1.B0"));
|
||||
list.add(new ItemDto(item_mode, "工作模式", "DB1.B1"));
|
||||
list.add(new ItemDto(item_status, "设备状态", "DB1.B2"));
|
||||
list.add(new ItemDto(item_move1, "前工位光电信号", "DB1.B3"));
|
||||
list.add(new ItemDto(item_move2, "后工位光电信号", "DB1.B4"));
|
||||
list.add(new ItemDto(item_action1, "前工位动作信号", "DB1.B5"));
|
||||
list.add(new ItemDto(item_action2, "后工位动作信号", "DB2.B6"));
|
||||
list.add(new ItemDto(item_walk_y, "行走列", "DB1.B7"));
|
||||
list.add(new ItemDto(item_error, "报警信号", "DB1.B8"));
|
||||
list.add(new ItemDto(item_type, "任务类型", "DB1.B9"));
|
||||
list.add(new ItemDto(item_task1, "前工位任务号", "DB1.D10"));
|
||||
list.add(new ItemDto(item_task2, "后工位任务号", "DB1.D14"));
|
||||
list.add(new ItemDto(item_heartbeat, "心跳", "DB15.B0"));
|
||||
list.add(new ItemDto(item_mode, "工作模式", "DB15.B1"));
|
||||
list.add(new ItemDto(item_move1, "前工位光电信号", "DB15.B2"));
|
||||
list.add(new ItemDto(item_move2, "后工位光电信号", "DB15.B3"));
|
||||
list.add(new ItemDto(item_action, "动作信号", "DB15.B4"));
|
||||
list.add(new ItemDto(item_walk_y, "行走列", "DB15.B5"));
|
||||
list.add(new ItemDto(item_error, "报警信号", "DB15.B6"));
|
||||
list.add(new ItemDto(item_x_position, "x坐标", "DB15.REAL10"));
|
||||
list.add(new ItemDto(item_y_position, "y坐标", "DB15.REAL14"));
|
||||
list.add(new ItemDto(item_y_position, "y坐标", "DB15.B7"));
|
||||
return list;
|
||||
}
|
||||
|
||||
public static List<ItemDto> getWriteableItemDtos() {
|
||||
ArrayList list = new ArrayList();
|
||||
list.add(new ItemDto(item_to_command1, "前工位下发命令", "DB2.W0"));
|
||||
list.add(new ItemDto(item_to_onset1, "前工位下发起始站", "DB2.W2"));
|
||||
list.add(new ItemDto(item_to_target1, "前工位下发目标站", "DB2.W4"));
|
||||
list.add(new ItemDto(item_to_task1, "前工位下发任务号", "DB2.D6"));
|
||||
list.add(new ItemDto(item_to_command2, "后工位下发命令", "DB2.W10"));
|
||||
list.add(new ItemDto(item_to_onset2, "后工位下发起始站", "DB2.W12"));
|
||||
list.add(new ItemDto(item_to_target2, "后工位下发目标站", "DB2.W14"));
|
||||
list.add(new ItemDto(item_to_task2, "后工位下发任务号", "DB2.D16"));
|
||||
list.add(new ItemDto(item_to_type, "下发任务类型", "DB2.W20"));
|
||||
list.add(new ItemDto(item_to_command, "下发命令", "DB16.W0"));
|
||||
list.add(new ItemDto(item_to_onset1, "下发起始站1", "DB16.W2"));
|
||||
list.add(new ItemDto(item_to_target1, "下发目标站1", "DB16.W4"));
|
||||
list.add(new ItemDto(item_to_task, "下发任务号", "DB16.D6"));
|
||||
list.add(new ItemDto(item_to_onset2, "下发起始站2", "DB16.W12"));
|
||||
list.add(new ItemDto(item_to_target2, "下发目标站2", "DB16.W14"));
|
||||
list.add(new ItemDto(item_to_empty_shaft_site, "下发空轴位", "DB16.W16"));
|
||||
list.add(new ItemDto(item_to_type, "下发任务类型", "DB16.W20"));
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ public class SlitTwoManipulatorDefination implements OpcDeviceDriverDefination {
|
||||
@Override
|
||||
public List<DeviceType> getFitDeviceTypes() {
|
||||
List<DeviceType> types = new LinkedList();
|
||||
types.add(DeviceType.station);
|
||||
types.add(DeviceType.robot);
|
||||
return types;
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -75,18 +75,18 @@ public class ItemProtocol {
|
||||
|
||||
public static List<ItemDto> getReadableItemDtos() {
|
||||
ArrayList list = new ArrayList();
|
||||
list.add(new ItemDto(item_heartbeat, "心跳", "251"));
|
||||
list.add(new ItemDto(item_mode, "工作模式", "7990"));
|
||||
list.add(new ItemDto(item_move, "光电信号", "550"));
|
||||
list.add(new ItemDto(item_action, "取放信号", "450"));
|
||||
list.add(new ItemDto(item_error, "故障", "8055"));
|
||||
list.add(new ItemDto(item_weight, "重量", "8055"));
|
||||
list.add(new ItemDto(item_heartbeat, "心跳", "DB17.B0"));
|
||||
list.add(new ItemDto(item_mode, "工作模式", "DB17.B1"));
|
||||
list.add(new ItemDto(item_move, "光电信号", "DB17.B2"));
|
||||
list.add(new ItemDto(item_action, "取放信号", "DB17.B3"));
|
||||
list.add(new ItemDto(item_error, "故障", "DB17.B4"));
|
||||
list.add(new ItemDto(item_weight, "重量", "DB17.B5"));
|
||||
return list;
|
||||
}
|
||||
|
||||
public static List<ItemDto> getWriteableItemDtos() {
|
||||
ArrayList list = new ArrayList();
|
||||
list.add(new ItemDto(item_to_command, "下发命令", "40226"));
|
||||
list.add(new ItemDto(item_to_command, "下发命令", "DB18.W0"));
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ public class SubvolumeWeighingStationDefination implements OpcDeviceDriverDefina
|
||||
@Override
|
||||
public List<DeviceType> getFitDeviceTypes() {
|
||||
List<DeviceType> types = new LinkedList();
|
||||
types.add(DeviceType.station);
|
||||
types.add(DeviceType.conveyor);
|
||||
return types;
|
||||
}
|
||||
|
||||
|
||||
@@ -79,19 +79,19 @@ public class ItemProtocol {
|
||||
|
||||
public static List<ItemDto> getReadableItemDtos() {
|
||||
ArrayList list = new ArrayList();
|
||||
list.add(new ItemDto(item_heartbeat, "心跳", "251"));
|
||||
list.add(new ItemDto(item_mode, "工作模式", "7990"));
|
||||
list.add(new ItemDto(item_move, "光电信号", "550"));
|
||||
list.add(new ItemDto(item_action, "取放信号", "450"));
|
||||
list.add(new ItemDto(item_error, "故障", "8055"));
|
||||
list.add(new ItemDto(item_weight, "重量", "8055"));
|
||||
list.add(new ItemDto(item_old_weight, "上次重量", "8055"));
|
||||
list.add(new ItemDto(item_heartbeat, "心跳", "DB19.B0"));
|
||||
list.add(new ItemDto(item_mode, "工作模式", "DB19.B1"));
|
||||
list.add(new ItemDto(item_move, "光电信号", "DB19.B2"));
|
||||
list.add(new ItemDto(item_action, "取放信号", "DB19.B3"));
|
||||
list.add(new ItemDto(item_error, "故障", "DB19.B4"));
|
||||
list.add(new ItemDto(item_weight, "重量", "DB19.B5"));
|
||||
list.add(new ItemDto(item_old_weight, "上次重量", "DB19.B6"));
|
||||
return list;
|
||||
}
|
||||
|
||||
public static List<ItemDto> getWriteableItemDtos() {
|
||||
ArrayList list = new ArrayList();
|
||||
list.add(new ItemDto(item_to_command, "下发命令", "40226"));
|
||||
list.add(new ItemDto(item_to_command, "下发命令", "DB20.W0"));
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ public class WasteFoilWeighingStationDefination implements OpcDeviceDriverDefina
|
||||
@Override
|
||||
public List<DeviceType> getFitDeviceTypes() {
|
||||
List<DeviceType> types = new LinkedList();
|
||||
types.add(DeviceType.station);
|
||||
types.add(DeviceType.conveyor);
|
||||
return types;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,34 @@
|
||||
package org.nl.acs.ext.wms.data;
|
||||
|
||||
public class ApplyManipulatorActionRequest {
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ApplyManipulatorActionRequest extends BaseRequest {
|
||||
private String vehicle_code;
|
||||
private String device_code;
|
||||
/**
|
||||
* 1-
|
||||
* 2-反馈新放货点
|
||||
* 3-反馈新取货点
|
||||
* 4-反馈二次放货点
|
||||
* 6-套轴申请
|
||||
* 7-套轴完成
|
||||
* 8-拔轴完成
|
||||
*/
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 行架任务号
|
||||
*/
|
||||
private String task_code;
|
||||
|
||||
/**
|
||||
* 重量
|
||||
*/
|
||||
private String weight;
|
||||
|
||||
/**
|
||||
* 条码
|
||||
*/
|
||||
private String barcode;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
package org.nl.acs.ext.wms.data;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@Data
|
||||
public class ApplyManipulatorActionResponse extends BaseResponse{
|
||||
private Map<String, String> data = new HashMap();
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package org.nl.acs.ext.wms.data;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@Data
|
||||
public class ApplyPlugPullSitResponse extends BaseResponse {
|
||||
private Map<String, String> data = new HashMap();
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package org.nl.acs.ext.wms.data;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ApplyPlugPullSiteRequest extends BaseRequest {
|
||||
private String vehicle_code;
|
||||
private String device_code;
|
||||
/**
|
||||
* 1-申请套管
|
||||
* 2-套管完成
|
||||
* 3-拔轴完成
|
||||
*/
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 行架任务号
|
||||
*/
|
||||
private String task_code;
|
||||
|
||||
/**
|
||||
* 重量
|
||||
*/
|
||||
private String weight;
|
||||
|
||||
/**
|
||||
* 条码
|
||||
*/
|
||||
private String barcode;
|
||||
}
|
||||
@@ -3,11 +3,11 @@ package org.nl.acs.ext.wms.service;
|
||||
import cn.hutool.http.HttpResponse;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.nl.acs.ext.wms.data.ApplyGreenFoilButtonRequest;
|
||||
import org.nl.acs.ext.wms.data.ApplyGreenFoilButtonResponse;
|
||||
import org.nl.acs.ext.wms.data.BlankingButtonRequest;
|
||||
import org.nl.acs.ext.wms.data.BlankingButtonResponse;
|
||||
import org.nl.acs.ext.wms.data.*;
|
||||
import org.nl.acs.ext.wms.data.one.*;
|
||||
import org.nl.acs.ext.wms.data.one.ApplyLabelingAndBindingRequest;
|
||||
import org.nl.acs.ext.wms.data.one.ApplyLabelingAndBindingResponse;
|
||||
import org.nl.acs.ext.wms.data.one.BaseRequest;
|
||||
|
||||
public interface AcsToWmsService {
|
||||
|
||||
@@ -129,4 +129,17 @@ public interface AcsToWmsService {
|
||||
*/
|
||||
BlankingButtonResponse applyBlankButtonTask(BlankingButtonRequest param);
|
||||
|
||||
/**
|
||||
* 向lms申请反馈
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
ApplyManipulatorActionResponse applyManipulatorActionRequest(ApplyManipulatorActionRequest param);
|
||||
|
||||
/**
|
||||
* 向lms申请套管工位请求
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
ApplyPlugPullSitResponse applyPlugPullSiteRequest(ApplyPlugPullSiteRequest param);
|
||||
}
|
||||
|
||||
@@ -16,13 +16,13 @@ import org.nl.acs.address.service.AddressService;
|
||||
import org.nl.acs.address.service.dto.AddressDto;
|
||||
import org.nl.acs.device.service.DeviceService;
|
||||
import org.nl.acs.ext.wms.LmsUtil;
|
||||
import org.nl.acs.ext.wms.data.*;
|
||||
import org.nl.acs.ext.wms.data.AcsToWmsData.applyTask.ApplyTaskRequest;
|
||||
import org.nl.acs.ext.wms.data.AcsToWmsData.applyTask.ApplyTaskResponse;
|
||||
import org.nl.acs.ext.wms.data.ApplyGreenFoilButtonRequest;
|
||||
import org.nl.acs.ext.wms.data.ApplyGreenFoilButtonResponse;
|
||||
import org.nl.acs.ext.wms.data.BlankingButtonRequest;
|
||||
import org.nl.acs.ext.wms.data.BlankingButtonResponse;
|
||||
import org.nl.acs.ext.wms.data.one.*;
|
||||
import org.nl.acs.ext.wms.data.one.ApplyLabelingAndBindingRequest;
|
||||
import org.nl.acs.ext.wms.data.one.ApplyLabelingAndBindingResponse;
|
||||
import org.nl.acs.ext.wms.data.one.BaseRequest;
|
||||
import org.nl.acs.ext.wms.service.AcsToWmsService;
|
||||
import org.nl.acs.log.service.DeviceExecuteLogService;
|
||||
import org.nl.acs.task.service.TaskService;
|
||||
@@ -190,4 +190,70 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
MDC.remove(log_file_type);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ApplyPlugPullSitResponse applyPlugPullSiteRequest(ApplyPlugPullSiteRequest param) {
|
||||
log.info("向LMS申请反馈,请求参数{}",param);
|
||||
try {
|
||||
MDC.put(log_file_type, log_type);
|
||||
ApplyPlugPullSitResponse applyPlugPullSitResponse = new ApplyPlugPullSitResponse();
|
||||
if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) {
|
||||
String wmsUrl = paramService.findByCode(AcsConfig.WMSURL).getValue();
|
||||
AddressDto addressDto = addressService.findByCode("applyPlugPullSiteRequest");
|
||||
String methods_url = addressDto.getMethods_url();
|
||||
String url = wmsUrl + methods_url;
|
||||
log.info("ApplyPlugPullSiteRequest----请求参数:{}", JSONObject.toJSONString(param));
|
||||
try {
|
||||
// String result = "";
|
||||
String result = HttpRequest.post(url)
|
||||
.body(JSON.toJSONString(param))
|
||||
.execute().body();
|
||||
JSONObject jsonObject = JSONObject.parseObject(result);
|
||||
log.info("ApplyPlugPullSitResponse----返回参数{}", result);
|
||||
applyPlugPullSitResponse = JSONObject.toJavaObject(jsonObject, ApplyPlugPullSitResponse.class);
|
||||
} catch (Exception e) {
|
||||
JSONObject map = new JSONObject();
|
||||
map.put("status", 400);
|
||||
map.put("message", e.getMessage());
|
||||
return JSONObject.toJavaObject(map, ApplyPlugPullSitResponse.class);
|
||||
}
|
||||
}
|
||||
return applyPlugPullSitResponse;
|
||||
} finally {
|
||||
MDC.remove(log_file_type);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ApplyManipulatorActionResponse applyManipulatorActionRequest(ApplyManipulatorActionRequest param) {
|
||||
log.info("向LMS申请反馈,请求参数{}",param);
|
||||
try {
|
||||
MDC.put(log_file_type, log_type);
|
||||
ApplyManipulatorActionResponse applyManipulatorActionResponse = new ApplyManipulatorActionResponse();
|
||||
if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) {
|
||||
String wmsUrl = paramService.findByCode(AcsConfig.WMSURL).getValue();
|
||||
AddressDto addressDto = addressService.findByCode("applyManipulatorAction");
|
||||
String methods_url = addressDto.getMethods_url();
|
||||
String url = wmsUrl + methods_url;
|
||||
log.info("ApplyManipulatorActionRequest----请求参数:{}", JSONObject.toJSONString(param));
|
||||
try {
|
||||
// String result = "";
|
||||
String result = HttpRequest.post(url)
|
||||
.body(JSON.toJSONString(param))
|
||||
.execute().body();
|
||||
JSONObject jsonObject = JSONObject.parseObject(result);
|
||||
log.info("ApplyManipulatorActionResponse----返回参数{}", result);
|
||||
applyManipulatorActionResponse = JSONObject.toJavaObject(jsonObject, ApplyManipulatorActionResponse.class);
|
||||
} catch (Exception e) {
|
||||
JSONObject map = new JSONObject();
|
||||
map.put("status", 400);
|
||||
map.put("message", e.getMessage());
|
||||
return JSONObject.toJavaObject(map, ApplyManipulatorActionResponse.class);
|
||||
}
|
||||
}
|
||||
return applyManipulatorActionResponse;
|
||||
} finally {
|
||||
MDC.remove(log_file_type);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,10 +9,14 @@ import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.acs.device.domain.Device;
|
||||
import org.nl.acs.device_driver.conveyor.siemens_conveyor.SiemensConveyorDeviceDriver;
|
||||
import org.nl.acs.device_driver.one_manipulator.box_package_manipulator.BoxPackageManipulatorDeviceDriver;
|
||||
import org.nl.acs.device_driver.conveyor.box_palletizing_manipulator.BoxPalletizingManipulatorDeviceDriver;
|
||||
import org.nl.acs.device_driver.paper_tube_device2.PaperTubeConveyor2DeviceDriver;
|
||||
import org.nl.acs.device_driver.two_conveyor.blank_manipulator.BlankManipulatorDeviceDriver;
|
||||
import org.nl.acs.device_driver.two_conveyor.hongxiang_conveyor.HongXiangStationDeviceDriver;
|
||||
import org.nl.acs.device_driver.two_conveyor.inflatable_shaft_library.InflatableShaftLibraryDeviceDriver;
|
||||
import org.nl.acs.device_driver.two_conveyor.lamp_three_color.LampThreecolorDeviceDriver;
|
||||
import org.nl.acs.device_driver.two_conveyor.oven_manipulator.OvenGantryManipulatorDeviceDriver;
|
||||
import org.nl.acs.device_driver.two_conveyor.plug_pull_device_site.PlugPullDeviceSiteDeviceDriver;
|
||||
import org.nl.acs.device_driver.two_conveyor.subvolume_weighing_station.SubvolumeWeighingStationDriver;
|
||||
@@ -74,7 +78,51 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
||||
|
||||
@Override
|
||||
public PutActionResponse putAction(String jsonObject) throws Exception {
|
||||
return null;
|
||||
try {
|
||||
MDC.put(log_file_type, log_type);
|
||||
log.info("putAction--------------:输入参数" + jsonObject);
|
||||
JSONArray datas = JSONArray.parseArray(jsonObject);
|
||||
PutActionResponse response = new PutActionResponse();
|
||||
JSONArray errArr = new JSONArray();
|
||||
for (int i = 0; i < datas.size(); i++) {
|
||||
String data = datas.get(i).toString();
|
||||
PutActionRequest request = JsonUtl.format(data, PutActionRequest.class);
|
||||
String device_code = request.getDevice_code();
|
||||
String code = request.getCode();
|
||||
String value = request.getValue();
|
||||
Device device = deviceAppService.findDeviceByCode(device_code);
|
||||
if (ObjectUtil.isEmpty(device)) {
|
||||
throw new Exception("未找到对应设备:" + device_code);
|
||||
}
|
||||
InflatableShaftLibraryDeviceDriver inflatableShaftLibraryDeviceDriver;
|
||||
HongXiangStationDeviceDriver hongXiangStationDeviceDriver;
|
||||
LampThreecolorDeviceDriver lampThreecolorDeviceDriver;
|
||||
SiemensConveyorDeviceDriver siemensConveyorDeviceDriver;
|
||||
if (device.getDeviceDriver() instanceof HongXiangStationDeviceDriver) {
|
||||
hongXiangStationDeviceDriver = (HongXiangStationDeviceDriver) device.getDeviceDriver();
|
||||
hongXiangStationDeviceDriver.writing(code, value);
|
||||
}
|
||||
if (device.getDeviceDriver() instanceof LampThreecolorDeviceDriver) {
|
||||
lampThreecolorDeviceDriver = (LampThreecolorDeviceDriver) device.getDeviceDriver();
|
||||
lampThreecolorDeviceDriver.writing(code, value);
|
||||
}
|
||||
if (device.getDeviceDriver() instanceof SiemensConveyorDeviceDriver) {
|
||||
siemensConveyorDeviceDriver = (SiemensConveyorDeviceDriver) device.getDeviceDriver();
|
||||
siemensConveyorDeviceDriver.writing(code, value);
|
||||
}
|
||||
if (device.getDeviceDriver() instanceof InflatableShaftLibraryDeviceDriver) {
|
||||
inflatableShaftLibraryDeviceDriver = (InflatableShaftLibraryDeviceDriver) device.getDeviceDriver();
|
||||
inflatableShaftLibraryDeviceDriver.writing(code, value);
|
||||
}
|
||||
|
||||
}
|
||||
response.setCode(200);
|
||||
response.setMessage("success");
|
||||
log.info("putAction--------------:输出参数:" + response);
|
||||
return response;
|
||||
} finally {
|
||||
MDC.remove(log_file_type);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -313,4 +313,9 @@ public class TaskDto implements Serializable {
|
||||
* 行架任务类型
|
||||
*/
|
||||
private String truss_type;
|
||||
|
||||
/**
|
||||
* 空轴位
|
||||
*/
|
||||
private String empty_shaft_site;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user