Merge branch 'master' of http://121.40.234.130:8899/root/lanzhouhailiang_one
This commit is contained in:
@@ -397,7 +397,12 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple
|
||||
try {
|
||||
this.checkcontrol(itemMap);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
try {
|
||||
Thread.sleep(1000);
|
||||
this.checkcontrol(itemMap);
|
||||
} catch (Exception ex) {
|
||||
throw new RuntimeException(ex);
|
||||
}
|
||||
}
|
||||
logServer.deviceExecuteLog(this.getDevice().getDevice_code(), "", "", "下发多个电气信号:" + itemMap);
|
||||
}
|
||||
|
||||
@@ -161,6 +161,11 @@ public class PluggingUnpluggingMachineDeviceDriver extends AbstractOpcDeviceDriv
|
||||
pullingSucess();
|
||||
}
|
||||
break;
|
||||
case 7:
|
||||
if (task1 > 0 && !requireSucess) {
|
||||
deliveryCompleted();
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
@@ -174,6 +179,28 @@ public class PluggingUnpluggingMachineDeviceDriver extends AbstractOpcDeviceDriv
|
||||
last_to_command = to_command;
|
||||
}
|
||||
|
||||
/**
|
||||
* 取货完成
|
||||
*/
|
||||
private void deliveryCompleted() {
|
||||
ApplyManipulatorActionRequest applyManipulatorActionRequest = new ApplyManipulatorActionRequest();
|
||||
applyManipulatorActionRequest.setAction("1");
|
||||
applyManipulatorActionRequest.setTask_code1(String.valueOf(task1));
|
||||
ApplyManipulatorActionResponse applyManipulatorActionResponse = acsToWmsService.actionFinishRequest(applyManipulatorActionRequest);
|
||||
if (applyManipulatorActionResponse.getstatus() == 200) {
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "插拔机取货完成,请求成功响应参数:" + JSON.toJSONString(applyManipulatorActionResponse));
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
map.put("to_command", 7);
|
||||
this.writing(map);
|
||||
requireSucess = true;
|
||||
message = "缓存库放货成功";
|
||||
} else {
|
||||
requireSucess = false;
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "插拔机取货完成,请求失败响应参数:" + JSON.toJSONString(applyManipulatorActionResponse));
|
||||
message = "缓存库放货失败";
|
||||
}
|
||||
}
|
||||
|
||||
private synchronized void pullingSucess() {
|
||||
List list = new ArrayList();
|
||||
ApplyManipulatorActionRequest applyManipulatorActionRequest = new ApplyManipulatorActionRequest();
|
||||
|
||||
@@ -65,10 +65,10 @@ public class RgvDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDr
|
||||
int last_move1 = 0;
|
||||
Integer move2 = 0;
|
||||
Integer last_move2 = 0;
|
||||
float qty1 = 0f;
|
||||
float last_qty1 = 0f;
|
||||
float qty2 = 0f;
|
||||
float last_qty2 = 0f;
|
||||
Float qty1 = 0f;
|
||||
Float last_qty1 = 0f;
|
||||
Float qty2 = 0f;
|
||||
Float last_qty2 = 0f;
|
||||
|
||||
int task = 0;
|
||||
int last_task = 0;
|
||||
@@ -117,14 +117,14 @@ public class RgvDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDr
|
||||
if(!move2.equals(last_move2)){
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号move2:" + last_move2 + "->" + move2);
|
||||
}
|
||||
if(qty1 != last_qty1){
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号move2:" + last_qty1 + "->" + qty1);
|
||||
if(!qty1.equals(last_qty1)){
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号qty1:" + last_qty1 + "->" + qty1);
|
||||
}
|
||||
if(qty2 != last_qty2){
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号move2:" + last_qty2 + "->" + qty2);
|
||||
if(!qty2.equals(last_qty2)){
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号qty2:" + last_qty2 + "->" + qty2);
|
||||
}
|
||||
if(task != last_task){
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号move2:" + last_task + "->" + task);
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号task:" + last_task + "->" + task);
|
||||
}
|
||||
|
||||
|
||||
@@ -162,7 +162,7 @@ public class RgvDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDr
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
if (task > 0 && !requireSucess && (qty1 > 0 || qty2 > 0)) {
|
||||
if (task > 0 && !requireSucess) {
|
||||
manualFeedbackQty();
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -17,7 +17,7 @@ spring:
|
||||
username: ${DB_USER:root}
|
||||
# password: ${DB_PWD:P@ssw0rd}
|
||||
# password: ${DB_PWD:Root.123456}
|
||||
password: ${DB_PWD:123456}
|
||||
password: ${DB_PWD:root}
|
||||
|
||||
# 初始连接数
|
||||
initial-size: 5
|
||||
|
||||
@@ -599,13 +599,7 @@ export default {
|
||||
device_code: '',
|
||||
material_code: '',
|
||||
qty: ''
|
||||
}/* ,
|
||||
{
|
||||
device_code: '',
|
||||
material_code: '',
|
||||
qty: ''
|
||||
} */
|
||||
]
|
||||
}]
|
||||
},
|
||||
rules: {
|
||||
start_height: [
|
||||
|
||||
@@ -171,52 +171,7 @@ public class BoxStorageOutConveyorDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
heartbeat = this.itemProtocol.getHeartbeat();
|
||||
|
||||
|
||||
if (to_strap_times != last_to_strap_times) {
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号to_strap_times:" + last_to_strap_times + "->" + to_strap_times);
|
||||
}
|
||||
if (to_length != last_to_length) {
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号to_length:" + last_to_length + "->" + to_length);
|
||||
}
|
||||
if (to_weight != last_to_weight) {
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号to_weight:" + last_to_weight + "->" + to_weight);
|
||||
}
|
||||
if (to_height != last_to_height) {
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号to_height:" + last_to_height + "->" + to_height);
|
||||
}
|
||||
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) {
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_mode + "->" + mode + "复位请求标记:" + requireSucess);
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_mode + "->" + mode);
|
||||
}
|
||||
|
||||
if (carrier_direction != last_carrier_direction) {
|
||||
logServer.deviceItemValue(this.device_code, "carrier_direction", String.valueOf(carrier_direction));
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号carrier_direction:" + last_carrier_direction + "->" + carrier_direction);
|
||||
}
|
||||
if (error != last_error) {
|
||||
if (error != 0) {
|
||||
DeviceErrorLogDto dto = new DeviceErrorLogDto();
|
||||
dto.setDevice_code(device_code);
|
||||
dto.setError_code(String.valueOf(error));
|
||||
String errorInfo = ErrorUtil.getDictDetail("ssx_error_type", String.valueOf(error));
|
||||
dto.setError_info(errorInfo);
|
||||
deviceErrorLogService.create(dto);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
logServer.deviceItemValue(this.device_code, "error", String.valueOf(error));
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号error:" + last_error + "->" + error);
|
||||
}
|
||||
if (move != 0 && task > 0) {
|
||||
|
||||
update_instruction_status();
|
||||
|
||||
@@ -64,6 +64,9 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv
|
||||
|
||||
AcsToWmsService acsToWmsService = SpringContextHolder.getBean(AcsToWmsService.class);
|
||||
|
||||
DeviceAppService deviceAppservice = SpringContextHolder.getBean(DeviceAppService.class);
|
||||
|
||||
|
||||
//工作模式
|
||||
int mode = 0;
|
||||
int last_mode = 0;
|
||||
@@ -267,8 +270,8 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv
|
||||
applyIn();
|
||||
}
|
||||
|
||||
//申请任务
|
||||
if (mode == 2 && move == 0 && task == 0 && !requireSucess) {
|
||||
//申请入库指令、异常位指令
|
||||
if (mode == 2 && move == 1 && task > 0 && !requireSucess) {
|
||||
boolean res = instruction_require();
|
||||
if (res) {
|
||||
notCreateInstMessage = "";
|
||||
@@ -400,85 +403,22 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv
|
||||
//判断是否存在起点相同 任务状态就绪的任务
|
||||
TaskDto taskdto = taskserver.findByStartCodeAndReady(device_code);
|
||||
if (!ObjectUtil.isEmpty(taskdto)) {
|
||||
//需要判断当前设备是否已经存在就绪的指令 如果存在就直接下发 不存在则创建
|
||||
Instruction inst = instructionService.findByTaskcodeAndStatus(taskdto.getTask_code());
|
||||
if (ObjectUtil.isNotEmpty(inst)) {
|
||||
List list = new ArrayList();
|
||||
Map map2 = new HashMap();
|
||||
map2.put("code", "to_task");
|
||||
map2.put("value", inst.getInstruction_code());
|
||||
list.add(map2);
|
||||
Map map3 = new HashMap();
|
||||
map3.put("code", "to_command");
|
||||
map3.put("value", "1");
|
||||
list.add(map3);
|
||||
this.writing(list);
|
||||
requireSucess = true;
|
||||
while (!StrUtil.equals(this.getOpcValueAccessor().getValue(this.getOpcServer() + "." + this.getOpcPlc() + "." + this.getDevice_code() + ".task").toString()
|
||||
, inst.getInstruction_code())) {
|
||||
this.writing(list);
|
||||
logServer.deviceExecuteLog(device_code, "", "", inst.getInstruction_code() + "再次下发信号");
|
||||
try {
|
||||
Thread.sleep(500);
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
if (ObjectUtil.isEmpty(instructionService.findByTaskcodeAndStatus(taskdto.getTask_code()))) {
|
||||
requireSucess = false;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
message = "下发电气任务号成功";
|
||||
requireSucess = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
String taskid = taskdto.getTask_id();
|
||||
String taskcode = taskdto.getTask_code();
|
||||
String vehiclecode = taskdto.getVehicle_code();
|
||||
String priority = taskdto.getPriority();
|
||||
String start_point_code = taskdto.getStart_point_code();
|
||||
String start_device_code = taskdto.getStart_device_code();
|
||||
String route_plan_code = taskdto.getRoute_plan_code();
|
||||
String next_device_code = "";
|
||||
|
||||
/**
|
||||
* 开始平均分配
|
||||
*/
|
||||
String this_coevice_code = taskserver.queryAssignedByDevice(device_code, taskdto.getNext_device_code());
|
||||
if (StrUtil.isEmpty(this_coevice_code)) {
|
||||
List<RouteLineDto> shortPathsList = routeLineService.getShortPathLines(start_device_code, taskdto.getNext_device_code(), route_plan_code);
|
||||
RouteLineDto routeLineDto = shortPathsList.get(0);
|
||||
|
||||
String path = routeLineDto.getPath();
|
||||
String type = routeLineDto.getType();
|
||||
String[] str = path.split("->");
|
||||
|
||||
List<String> pathlist = Arrays.asList(str);
|
||||
int index = 0;
|
||||
for (int m = 0; m < pathlist.size(); m++) {
|
||||
if (pathlist.get(m).equals(start_device_code)) {
|
||||
index = m + 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
next_device_code = pathlist.get(index);
|
||||
} else {
|
||||
next_device_code = this_coevice_code;
|
||||
}
|
||||
//校验路由关系
|
||||
List<RouteLineDto> shortPathsList = routeLineService.getShortPathLines(start_device_code, next_device_code, route_plan_code);
|
||||
if (ObjectUtils.isEmpty(shortPathsList)) {
|
||||
throw new RuntimeException("路由不通!");
|
||||
}
|
||||
|
||||
Device startdevice = deviceAppService.findDeviceByCode(start_device_code);
|
||||
Device nextdevice = deviceAppService.findDeviceByCode(next_device_code);
|
||||
String next_point_code;
|
||||
if (StrUtil.equals(deviceAppService.findDeviceTypeByCode(next_device_code), "storage")) {
|
||||
next_point_code = taskdto.getTo_x() + "-" + taskdto.getTo_y() + "-" + taskdto.getTo_z();
|
||||
} else {
|
||||
next_point_code = next_device_code;
|
||||
}
|
||||
List<RouteLineDto> shortPathsList = routeLineService.getShortPathLines(taskdto.getStart_device_code(), taskdto.getNext_device_code(), route_plan_code);
|
||||
RouteLineDto routeLineDto = shortPathsList.get(0);
|
||||
String path = routeLineDto.getPath();
|
||||
String[] str = path.split("->");
|
||||
List<String> pathlist = Arrays.asList(str);
|
||||
Integer start = 2;
|
||||
String start_point_code = pathlist.get(start);
|
||||
String start_device_code = pathlist.get(start);
|
||||
String next_device_code = pathlist.get(start+1);
|
||||
Instruction instdto = new Instruction();
|
||||
instdto.setInstruction_id(IdUtil.simpleUUID());
|
||||
instdto.setRoute_plan_code(route_plan_code);
|
||||
@@ -494,7 +434,7 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv
|
||||
instdto.setStart_device_code(start_device_code);
|
||||
instdto.setNext_device_code(next_device_code);
|
||||
instdto.setStart_point_code(start_point_code);
|
||||
instdto.setNext_point_code(next_point_code);
|
||||
instdto.setNext_point_code(next_device_code);
|
||||
instdto.setPriority(priority);
|
||||
instdto.setInstruction_status("0");
|
||||
instdto.setExecute_device_code(start_point_code);
|
||||
@@ -505,6 +445,8 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv
|
||||
log.error("指令创建失败!", e.getMessage());
|
||||
return false;
|
||||
}
|
||||
Device nextdevice = deviceAppservice.findDeviceByCode(next_device_code);
|
||||
|
||||
//创建指令后修改任务状态
|
||||
taskdto.setTask_status("1");
|
||||
taskserver.update(taskdto);
|
||||
@@ -540,45 +482,6 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv
|
||||
return false;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
//如果不存在则直接找对应指令
|
||||
Instruction inst = instructionService.findByDeviceCodeFromCache(this.device_code);
|
||||
if (ObjectUtil.isEmpty(inst)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Device nextdevice = deviceAppService.findDeviceByCode(inst.getNext_device_code());
|
||||
String next_addr = nextdevice.getExtraValue().get("address").toString();
|
||||
|
||||
List list = new ArrayList();
|
||||
Map map = new HashMap();
|
||||
map.put("code", "to_target");
|
||||
map.put("value", next_addr);
|
||||
list.add(map);
|
||||
Map map2 = new HashMap();
|
||||
map2.put("code", "to_task");
|
||||
map2.put("value", inst.getInstruction_code());
|
||||
list.add(map2);
|
||||
Map map3 = new HashMap();
|
||||
map3.put("code", "to_command");
|
||||
map3.put("value", "1");
|
||||
list.add(map3);
|
||||
this.writing(list);
|
||||
requireSucess = true;
|
||||
while (!StrUtil.equals(this.getOpcValueAccessor().getValue(this.getOpcServer() + "." + this.getOpcPlc() + "." + this.getDevice_code() + ".task").toString()
|
||||
, inst.getInstruction_code())) {
|
||||
this.writing(list);
|
||||
logServer.deviceExecuteLog(device_code, "", "", inst.getInstruction_code() + "再次下发电气信号");
|
||||
try {
|
||||
Thread.sleep(500);
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
if (ObjectUtil.isEmpty(instructionService.findByDeviceCodeFromCache(this.device_code))) {
|
||||
requireSucess = false;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -48,6 +48,11 @@ public class ItemProtocol {
|
||||
*/
|
||||
public static String item_task = "task";
|
||||
|
||||
/**
|
||||
* 干燥机模板
|
||||
*/
|
||||
public static String item_desiccant = "desiccant";
|
||||
|
||||
/**
|
||||
* 动作信号
|
||||
*/
|
||||
@@ -76,7 +81,7 @@ public class ItemProtocol {
|
||||
|
||||
public String getMaterialBarCode() {
|
||||
return this.getOpcStringValue(item_material_barcode);
|
||||
}
|
||||
}
|
||||
|
||||
public int getContainer_type() {
|
||||
return this.getOpcIntegerValue(item_container_type);
|
||||
@@ -163,6 +168,7 @@ public class ItemProtocol {
|
||||
list.add(new ItemDto(item_error, "报警信号", "DB600.B6"));
|
||||
list.add(new ItemDto(item_container_type, "托盘类型", "DB101.B7"));
|
||||
list.add(new ItemDto(item_task, "任务号", "DB600.D10"));
|
||||
list.add(new ItemDto(item_desiccant, "干燥机模板", "DB600.D10"));
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
@@ -171,47 +171,6 @@ public class UnBoxLableConveyorDeviceDriver extends AbstractOpcDeviceDriver impl
|
||||
to_task = this.itemProtocol.getTo_task();
|
||||
heartbeat = this.itemProtocol.getHeartbeat();
|
||||
|
||||
|
||||
if (to_strap_times != last_to_strap_times) {
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号to_strap_times:" + last_to_strap_times + "->" + to_strap_times);
|
||||
}
|
||||
if (to_length != last_to_length) {
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号to_length:" + last_to_length + "->" + to_length);
|
||||
}
|
||||
if (to_weight != last_to_weight) {
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号to_weight:" + last_to_weight + "->" + to_weight);
|
||||
}
|
||||
if (to_height != last_to_height) {
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号to_height:" + last_to_height + "->" + to_height);
|
||||
}
|
||||
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) {
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_mode + "->" + mode + "复位请求标记:" + requireSucess);
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_mode + "->" + mode);
|
||||
}
|
||||
|
||||
if (carrier_direction != last_carrier_direction) {
|
||||
logServer.deviceItemValue(this.device_code, "carrier_direction", String.valueOf(carrier_direction));
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号carrier_direction:" + last_carrier_direction + "->" + carrier_direction);
|
||||
}
|
||||
if (error != last_error) {
|
||||
logServer.deviceItemValue(this.device_code, "error", String.valueOf(error));
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号error:" + last_error + "->" + error);
|
||||
}
|
||||
|
||||
// if (move != 0 && task > 0) {
|
||||
//
|
||||
// update_instruction_status();
|
||||
// }
|
||||
|
||||
} catch (Exception e) {
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "读取信号值时出现异常:" + Arrays.toString(e.getStackTrace()));
|
||||
|
||||
@@ -231,11 +190,20 @@ public class UnBoxLableConveyorDeviceDriver extends AbstractOpcDeviceDriver impl
|
||||
message = "有报警";
|
||||
}
|
||||
|
||||
Instruction instruction = null;
|
||||
List toInstructions;
|
||||
//空箱出库开盖位,申请开盖
|
||||
if (mode == 7 && move == 1 && task > 0) {
|
||||
applyUnbox();
|
||||
//不允许开盖,完成出库任务,自动去扫码位
|
||||
if (!applyUnbox()){
|
||||
Instruction instruction = instructionService.findByCode(String.valueOf(task));
|
||||
if (ObjectUtil.isNotEmpty(instruction)) {
|
||||
try {
|
||||
instructionService.finish(instruction);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -256,12 +224,12 @@ public class UnBoxLableConveyorDeviceDriver extends AbstractOpcDeviceDriver impl
|
||||
last_to_height =to_height;
|
||||
}
|
||||
|
||||
private void applyUnbox() {
|
||||
private Boolean applyUnbox() {
|
||||
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);
|
||||
return;
|
||||
return false;
|
||||
} else {
|
||||
try {
|
||||
JSONObject param = new JSONObject();
|
||||
@@ -271,11 +239,13 @@ public class UnBoxLableConveyorDeviceDriver extends AbstractOpcDeviceDriver impl
|
||||
HttpResponse response = acsToWmsService.shipDeviceUpdate(param);
|
||||
if (response == null || response.getStatus() == 200) {
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "木箱申请开盖任务,接口返回:" + response.body());
|
||||
return true;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean exe_error() {
|
||||
|
||||
@@ -171,63 +171,6 @@ public class BoxPackageManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
to_direction = this.itemProtocol.getTo_direction();
|
||||
to_last = this.itemProtocol.getTo_last();
|
||||
|
||||
if (to_last != last_to_last) {
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号to_last:" + last_to_last + "->" + to_last);
|
||||
}
|
||||
if (to_max_no != last_to_max_no) {
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号to_max_no:" + last_to_max_no + "->" + to_max_no);
|
||||
}
|
||||
if (to_direction != last_to_direction) {
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号to_direction:" + last_to_direction + "->" + to_direction);
|
||||
}
|
||||
if (to_seq != last_to_seq) {
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号to_seq:" + last_to_seq + "->" + to_seq);
|
||||
}
|
||||
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 (mode == 3 && task > 0) {
|
||||
|
||||
@@ -48,6 +48,18 @@ public class ItemProtocol {
|
||||
*/
|
||||
public static String item_y_position = "y_position";
|
||||
|
||||
|
||||
/**
|
||||
* 木箱数量
|
||||
*/
|
||||
public static String item_number = "number";
|
||||
|
||||
/**
|
||||
* 木箱位置
|
||||
*/
|
||||
public static String item_position = "position";
|
||||
|
||||
|
||||
/**
|
||||
* 下发命令
|
||||
*/
|
||||
@@ -207,6 +219,8 @@ public class ItemProtocol {
|
||||
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_position, "木箱位置", "DB1.REAL16"));
|
||||
list.add(new ItemDto(item_number, "木箱数量", "DB1.REAL18"));
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
@@ -152,39 +152,7 @@ public class BoxStorageManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
to_task = this.itemProtocol.getTo_task();
|
||||
to_layer = this.itemProtocol.getTo_layer();
|
||||
to_barcode = this.itemProtocol.getTo_barcode();
|
||||
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 (task != last_task) {
|
||||
logServer.deviceItemValue(this.device_code, "task", String.valueOf(task));
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号task:" + last_task + "->" + task);
|
||||
}
|
||||
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_onset != last_to_onset) {
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号to_onset:" + last_to_target + "->" + to_target);
|
||||
}
|
||||
if (to_task != last_to_task) {
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号to_task:" + last_to_task + "->" + to_task);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 更新指令状态
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.nl.wms.ext.acs.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
@@ -1290,7 +1291,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
JSONObject fhd_jo = WQLObject.getWQLObject("st_ivt_shaftivt").query("point_type = '7' AND product_area = '" + product_area + "'").uniqueResult(0);
|
||||
jo.put("point_code2", fhd_jo.getString("point_code"));
|
||||
jo.put("product_area", product_area);
|
||||
jo.put("vehicle_code", "qzz");
|
||||
jo.put("vehicle_code", DateUtil.format(DateUtil.date(),"yyyyMMdd")+"qzz");
|
||||
jo.put("truss_type", "8");
|
||||
JSONObject request_param = new JSONObject();
|
||||
request_param.put("have_size", cbz_size);
|
||||
@@ -1318,7 +1319,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
JSONObject point1_jo = ivt_shaftivt.query("point_code = '" + task_jo.getString("point_code1") + "'").uniqueResult(0);
|
||||
point1_jo.put("have_qzz", "0");
|
||||
ivt_shaftivt.update(point1_jo);
|
||||
} else if ("010607".equals(point_type)) {
|
||||
} else if ("010607".equals(point_type) || "010603".equals(point_type)) {
|
||||
JSONObject point1_jo = ivt_shaftivt.query("point_code = '" + task_jo.getString("point_code1") + "'").uniqueResult(0);
|
||||
point1_jo.put("qzz_size", "");
|
||||
point1_jo.put("qzz_generation", "");
|
||||
|
||||
@@ -108,15 +108,6 @@ public class PaperTrussTask extends AbstractAcsTask {
|
||||
goal_point.put("have_qzz", "1");
|
||||
ivt_shaftivt.update(goal_point);
|
||||
}
|
||||
//空轴放货任务
|
||||
if ("010603".equals(task_type)) {
|
||||
String point_code = task_jo.getString("point_code1");
|
||||
JSONObject goal_point = ivt_shaftivt.query("point_code = '" + point_code + "'").uniqueResult(0);
|
||||
goal_point.put("qzz_size", "");
|
||||
goal_point.put("qzz_generation", "");
|
||||
goal_point.put("have_qzz", "0");
|
||||
ivt_shaftivt.update(goal_point);
|
||||
}
|
||||
//空轴换货任务
|
||||
if ("010604".equals(task_type)) {
|
||||
String point_code = task_jo.getString("point_code1");
|
||||
|
||||
Reference in New Issue
Block a user