|
|
@ -4,6 +4,7 @@ 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.JSONObject; |
|
|
|
import lombok.Getter; |
|
|
|
import lombok.Setter; |
|
|
@ -18,6 +19,8 @@ import org.nl.acs.device_driver.RouteableDeviceDriver; |
|
|
|
import org.nl.acs.device_driver.StandardRequestMethod; |
|
|
|
import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver; |
|
|
|
import org.nl.acs.device_driver.driver.ExecutableDeviceDriver; |
|
|
|
import org.nl.acs.device_driver.lnsh.lnsh_mixing_mill.LnshMixingMillDeviceDriver; |
|
|
|
import org.nl.acs.ext.wms.data.AcsToWmsData.applyTask.ApplyTaskResponse; |
|
|
|
import org.nl.acs.ext.wms.data.Resp; |
|
|
|
import org.nl.acs.ext.wms.data.AcsToWmsData.applyTask.ApplyTaskRequest; |
|
|
|
import org.nl.acs.ext.wms.service.AcsToWmsService; |
|
|
@ -26,10 +29,12 @@ import org.nl.acs.instruction.service.dto.Instruction; |
|
|
|
import org.nl.acs.log.service.DeviceExecuteLogService; |
|
|
|
import org.nl.acs.monitor.DeviceStageMonitor; |
|
|
|
import org.nl.acs.opc.Device; |
|
|
|
import org.nl.acs.opc.DeviceAppService; |
|
|
|
import org.nl.acs.order.service.ProduceshiftorderService; |
|
|
|
import org.nl.acs.route.service.RouteLineService; |
|
|
|
import org.nl.acs.task.service.TaskService; |
|
|
|
import org.nl.modules.lucene.service.LuceneExecuteLogService; |
|
|
|
import org.nl.modules.lucene.service.dto.LuceneLogDto; |
|
|
|
import org.nl.modules.wql.util.SpringContextHolder; |
|
|
|
import org.openscada.opc.lib.da.Server; |
|
|
|
import org.springframework.http.HttpStatus; |
|
|
@ -66,6 +71,9 @@ public class LnshPalletizingManipulatorSiteDeviceDriver extends AbstractOpcDevic |
|
|
|
|
|
|
|
ProduceshiftorderService produceshiftorderService = SpringContextHolder.getBean("produceshiftorderServiceImpl"); |
|
|
|
|
|
|
|
DeviceAppService deviceAppService = SpringContextHolder.getBean("deviceAppServiceImpl"); |
|
|
|
|
|
|
|
|
|
|
|
String device_code; |
|
|
|
int mode = 0; |
|
|
|
int error = 0; |
|
|
@ -587,117 +595,114 @@ public class LnshPalletizingManipulatorSiteDeviceDriver extends AbstractOpcDevic |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
//急停
|
|
|
|
if (this.isStop()) { |
|
|
|
|
|
|
|
//未在线无心跳
|
|
|
|
if (mode == 0) { |
|
|
|
this.setIsonline(false); |
|
|
|
this.setIserror(true); |
|
|
|
message = "未联机"; |
|
|
|
//有报警
|
|
|
|
} else if (error != 0) { |
|
|
|
this.setIsonline(false); |
|
|
|
this.setIserror(true); |
|
|
|
message = "有报警"; |
|
|
|
//无报警
|
|
|
|
} else { |
|
|
|
this.setIsonline(true); |
|
|
|
this.setIserror(false); |
|
|
|
message = ""; |
|
|
|
Instruction instruction = null; |
|
|
|
List toInstructions; |
|
|
|
|
|
|
|
|
|
|
|
if (mode > 2) { |
|
|
|
if (ObjectUtil.isNotEmpty(this.device.getExtraValue().get(String.valueOf(mode)))) { |
|
|
|
String modethod = this.device.getExtraValue().get(String.valueOf(mode)).toString(); |
|
|
|
try { |
|
|
|
applyRequest(modethod); |
|
|
|
} catch (Exception e) { |
|
|
|
message = "错误:" + e.getMessage(); |
|
|
|
this.setIserror(true); |
|
|
|
} |
|
|
|
} else { |
|
|
|
message = "无效模式请求,驱动未配置此请求方法"; |
|
|
|
//未在线无心跳
|
|
|
|
if (mode == 0) { |
|
|
|
this.setIsonline(false); |
|
|
|
this.setIserror(true); |
|
|
|
message = "未联机"; |
|
|
|
//有报警
|
|
|
|
} else if (error != 0) { |
|
|
|
this.setIsonline(false); |
|
|
|
this.setIserror(true); |
|
|
|
message = "有报警"; |
|
|
|
//无报警
|
|
|
|
} else { |
|
|
|
this.setIsonline(true); |
|
|
|
this.setIserror(false); |
|
|
|
message = ""; |
|
|
|
Instruction instruction = null; |
|
|
|
List toInstructions; |
|
|
|
|
|
|
|
|
|
|
|
if (mode > 2 && !requireSucess) { |
|
|
|
if (ObjectUtil.isNotEmpty(this.device.getExtraValue().get(String.valueOf(mode)))) { |
|
|
|
String modethod = this.device.getExtraValue().get(String.valueOf(mode)).toString(); |
|
|
|
try { |
|
|
|
applyRequest(modethod); |
|
|
|
} catch (Exception e) { |
|
|
|
message = "错误:" + e.getMessage(); |
|
|
|
this.setIserror(true); |
|
|
|
} |
|
|
|
} else { |
|
|
|
message = "无请求"; |
|
|
|
message = "无效模式请求,驱动未配置此请求方法"; |
|
|
|
} |
|
|
|
|
|
|
|
Object ignore_pickup_check = this.getExtraValue().get("ignore_pickup_check"); |
|
|
|
|
|
|
|
} else { |
|
|
|
message = "无请求"; |
|
|
|
} |
|
|
|
|
|
|
|
last_mode = mode; |
|
|
|
last_error = error; |
|
|
|
last_move = move; |
|
|
|
last_task = task; |
|
|
|
last_action = action; |
|
|
|
last_ioaction = io_action; |
|
|
|
last_weight = weight; |
|
|
|
last_material = material; |
|
|
|
last_barcode = barcode; |
|
|
|
last_encoder_qty = encoder_qty; |
|
|
|
last_unqualified_qty = unqualified_qty; |
|
|
|
|
|
|
|
last_product_code = product_code; |
|
|
|
last_AlongSide = AlongSide; |
|
|
|
last_BshortSide = BshortSide; |
|
|
|
last_Htrapezoidal = Htrapezoidal; |
|
|
|
last_Wthickness = Wthickness; |
|
|
|
last_tray_qty = tray_qty; |
|
|
|
last_tray_high = tray_high; |
|
|
|
last_crib_category = crib_category; |
|
|
|
last_palletX1_line = palletX1_line; |
|
|
|
last_palletY1_row = palletY1_row; |
|
|
|
last_palletA1_angle = palletA1_angle; |
|
|
|
last_palletX2_line = palletX2_line; |
|
|
|
last_palletY2_row = palletY2_row; |
|
|
|
last_palletA2_angle = palletA2_angle; |
|
|
|
last_palletX3_line = palletX3_line; |
|
|
|
last_palletY3_row = palletY3_row; |
|
|
|
last_palletA3_angle = palletA3_angle; |
|
|
|
last_pressCribX1_line = pressCribX1_line; |
|
|
|
last_pressCribY1_row = pressCribY1_row; |
|
|
|
last_pressCribA1_angle = pressCribA1_angle; |
|
|
|
last_pressCribX2_line = pressCribX2_line; |
|
|
|
last_pressCribY2_row = pressCribY2_row; |
|
|
|
last_pressCribA2_angle = pressCribA2_angle; |
|
|
|
last_pressCribX3_line = pressCribX3_line; |
|
|
|
last_pressCribY3_row = pressCribY3_row; |
|
|
|
last_pressCribA3_angle = pressCribA3_angle; |
|
|
|
last_Zoffset = Zoffset; |
|
|
|
last_pallet_layerQty = pallet_layerQty; |
|
|
|
last_pressCrib_layerQty = pressCrib_layerQty; |
|
|
|
last_codeLayerX1_interval = codeLayerX1_interval; |
|
|
|
last_codeLayerY1_interval = codeLayerY1_interval; |
|
|
|
last_codeLayerX2_interval = codeLayerX2_interval; |
|
|
|
last_codeLayerY2_interval = codeLayerY2_interval; |
|
|
|
last_codeLayerX3_interval = codeLayerX3_interval; |
|
|
|
last_codeLayerY3_interval = codeLayerY3_interval; |
|
|
|
last_codeLayerX1_offset = codeLayerX1_offset; |
|
|
|
last_codeLayerY1_offset = codeLayerY1_offset; |
|
|
|
last_codeLayerX2_offset = codeLayerX2_offset; |
|
|
|
last_codeLayerY2_offset = codeLayerY2_offset; |
|
|
|
last_codeLayerX3_offset = codeLayerX3_offset; |
|
|
|
last_codeLayerY3_offset = codeLayerY3_offset; |
|
|
|
last_pressLayerX1_interval = pressLayerX1_interval; |
|
|
|
last_pressLayerY1_interval = pressLayerY1_interval; |
|
|
|
last_pressLayerX2_interval = pressLayerX2_interval; |
|
|
|
last_pressLayerY2_interval = pressLayerY2_interval; |
|
|
|
last_pressLayerX3_interval = pressLayerX3_interval; |
|
|
|
last_pressLayerY3_interval = pressLayerY3_interval; |
|
|
|
last_pressLayerX1_offset = pressLayerX1_offset; |
|
|
|
last_pressLayerY1_offset = pressLayerY1_offset; |
|
|
|
last_pressLayerX2_offset = pressLayerX2_offset; |
|
|
|
last_pressLayerY2_offset = pressLayerY2_offset; |
|
|
|
last_pressLayerX3_offset = pressLayerX3_offset; |
|
|
|
last_pressLayerY3_offset = pressLayerY3_offset; |
|
|
|
last_tool_coordinate = tool_coordinate; |
|
|
|
Object ignore_pickup_check = this.getExtraValue().get("ignore_pickup_check"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
last_mode = mode; |
|
|
|
last_error = error; |
|
|
|
last_move = move; |
|
|
|
last_task = task; |
|
|
|
last_action = action; |
|
|
|
last_ioaction = io_action; |
|
|
|
last_weight = weight; |
|
|
|
last_material = material; |
|
|
|
last_barcode = barcode; |
|
|
|
last_encoder_qty = encoder_qty; |
|
|
|
last_unqualified_qty = unqualified_qty; |
|
|
|
|
|
|
|
last_product_code = product_code; |
|
|
|
last_AlongSide = AlongSide; |
|
|
|
last_BshortSide = BshortSide; |
|
|
|
last_Htrapezoidal = Htrapezoidal; |
|
|
|
last_Wthickness = Wthickness; |
|
|
|
last_tray_qty = tray_qty; |
|
|
|
last_tray_high = tray_high; |
|
|
|
last_crib_category = crib_category; |
|
|
|
last_palletX1_line = palletX1_line; |
|
|
|
last_palletY1_row = palletY1_row; |
|
|
|
last_palletA1_angle = palletA1_angle; |
|
|
|
last_palletX2_line = palletX2_line; |
|
|
|
last_palletY2_row = palletY2_row; |
|
|
|
last_palletA2_angle = palletA2_angle; |
|
|
|
last_palletX3_line = palletX3_line; |
|
|
|
last_palletY3_row = palletY3_row; |
|
|
|
last_palletA3_angle = palletA3_angle; |
|
|
|
last_pressCribX1_line = pressCribX1_line; |
|
|
|
last_pressCribY1_row = pressCribY1_row; |
|
|
|
last_pressCribA1_angle = pressCribA1_angle; |
|
|
|
last_pressCribX2_line = pressCribX2_line; |
|
|
|
last_pressCribY2_row = pressCribY2_row; |
|
|
|
last_pressCribA2_angle = pressCribA2_angle; |
|
|
|
last_pressCribX3_line = pressCribX3_line; |
|
|
|
last_pressCribY3_row = pressCribY3_row; |
|
|
|
last_pressCribA3_angle = pressCribA3_angle; |
|
|
|
last_Zoffset = Zoffset; |
|
|
|
last_pallet_layerQty = pallet_layerQty; |
|
|
|
last_pressCrib_layerQty = pressCrib_layerQty; |
|
|
|
last_codeLayerX1_interval = codeLayerX1_interval; |
|
|
|
last_codeLayerY1_interval = codeLayerY1_interval; |
|
|
|
last_codeLayerX2_interval = codeLayerX2_interval; |
|
|
|
last_codeLayerY2_interval = codeLayerY2_interval; |
|
|
|
last_codeLayerX3_interval = codeLayerX3_interval; |
|
|
|
last_codeLayerY3_interval = codeLayerY3_interval; |
|
|
|
last_codeLayerX1_offset = codeLayerX1_offset; |
|
|
|
last_codeLayerY1_offset = codeLayerY1_offset; |
|
|
|
last_codeLayerX2_offset = codeLayerX2_offset; |
|
|
|
last_codeLayerY2_offset = codeLayerY2_offset; |
|
|
|
last_codeLayerX3_offset = codeLayerX3_offset; |
|
|
|
last_codeLayerY3_offset = codeLayerY3_offset; |
|
|
|
last_pressLayerX1_interval = pressLayerX1_interval; |
|
|
|
last_pressLayerY1_interval = pressLayerY1_interval; |
|
|
|
last_pressLayerX2_interval = pressLayerX2_interval; |
|
|
|
last_pressLayerY2_interval = pressLayerY2_interval; |
|
|
|
last_pressLayerX3_interval = pressLayerX3_interval; |
|
|
|
last_pressLayerY3_interval = pressLayerY3_interval; |
|
|
|
last_pressLayerX1_offset = pressLayerX1_offset; |
|
|
|
last_pressLayerY1_offset = pressLayerY1_offset; |
|
|
|
last_pressLayerX2_offset = pressLayerX2_offset; |
|
|
|
last_pressLayerY2_offset = pressLayerY2_offset; |
|
|
|
last_pressLayerX3_offset = pressLayerX3_offset; |
|
|
|
last_pressLayerY3_offset = pressLayerY3_offset; |
|
|
|
last_tool_coordinate = tool_coordinate; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
* 请求 |
|
|
|
* |
|
|
@ -718,238 +723,177 @@ public class LnshPalletizingManipulatorSiteDeviceDriver extends AbstractOpcDevic |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
* 码垛完成 |
|
|
|
* 申请取走满料盅托盘 |
|
|
|
* 申请补满料盅托盘 |
|
|
|
* |
|
|
|
* @param |
|
|
|
*/ |
|
|
|
public synchronized boolean apply_take_full_vehicle() { |
|
|
|
JSONObject json = new JSONObject(); |
|
|
|
json.put("type", "1"); |
|
|
|
json.put("device_code", device_code); |
|
|
|
json.put("qty", encoder_qty); |
|
|
|
json.put("weight", weight); |
|
|
|
json.put("vehicle_code", barcode); |
|
|
|
json.put("is_full", "1"); |
|
|
|
json.put("is_package", "1"); |
|
|
|
json.put("product_code", product_code); |
|
|
|
json.put("AlongSide", AlongSide); |
|
|
|
json.put("BshortSide", BshortSide); |
|
|
|
json.put("Htrapezoidal", Htrapezoidal); |
|
|
|
json.put("Wthickness", Wthickness); |
|
|
|
json.put("tray_qty", tray_qty); |
|
|
|
json.put("tray_high", tray_high); |
|
|
|
json.put("crib_category", crib_category); |
|
|
|
json.put("palletX1_line", palletX1_line); |
|
|
|
json.put("palletY1_row", palletY1_row); |
|
|
|
json.put("palletA1_angle", palletA1_angle); |
|
|
|
json.put("palletX2_line", palletX2_line); |
|
|
|
json.put("palletY2_row", palletY2_row); |
|
|
|
json.put("palletA2_angle", palletA2_angle); |
|
|
|
json.put("palletX3_line", palletX3_line); |
|
|
|
json.put("palletY3_row", palletY3_row); |
|
|
|
json.put("palletA3_angle", palletA3_angle); |
|
|
|
json.put("pressCribX1_line", pressCribX1_line); |
|
|
|
json.put("pressCribY1_row", pressCribY1_row); |
|
|
|
json.put("pressCribA1_angle", pressCribA1_angle); |
|
|
|
json.put("pressCribX2_line", pressCribX2_line); |
|
|
|
json.put("pressCribY2_row", pressCribY2_row); |
|
|
|
json.put("pressCribA2_angle", pressCribA2_angle); |
|
|
|
json.put("pressCribX3_line", pressCribX3_line); |
|
|
|
json.put("pressCribY3_row", pressCribY3_row); |
|
|
|
json.put("pressCribA3_angle", pressCribA3_angle); |
|
|
|
json.put("Zoffset", Zoffset); |
|
|
|
json.put("pallet_layerQty", pallet_layerQty); |
|
|
|
json.put("pressCrib_layerQty", pressCrib_layerQty); |
|
|
|
json.put("codeLayerX1_interval", codeLayerX1_interval); |
|
|
|
json.put("codeLayerY1_interval", codeLayerY1_interval); |
|
|
|
json.put("codeLayerX2_interval", codeLayerX2_interval); |
|
|
|
json.put("codeLayerY2_interval", codeLayerY2_interval); |
|
|
|
json.put("codeLayerX3_interval", codeLayerX3_interval); |
|
|
|
json.put("codeLayerY3_interval", codeLayerY3_interval); |
|
|
|
json.put("codeLayerX1_offset", codeLayerX1_offset); |
|
|
|
json.put("codeLayerY1_offset", codeLayerY1_offset); |
|
|
|
json.put("codeLayerX2_offset", codeLayerX2_offset); |
|
|
|
json.put("codeLayerY2_offset", codeLayerY2_offset); |
|
|
|
json.put("codeLayerX3_offset", codeLayerX3_offset); |
|
|
|
json.put("codeLayerY3_offset", codeLayerY3_offset); |
|
|
|
json.put("pressLayerX1_interval", pressLayerX1_interval); |
|
|
|
json.put("pressLayerY1_interval", pressLayerY1_interval); |
|
|
|
json.put("pressLayerX2_interval", pressLayerX2_interval); |
|
|
|
json.put("pressLayerY2_interval", pressLayerY2_interval); |
|
|
|
json.put("pressLayerX3_interval", pressLayerX3_interval); |
|
|
|
json.put("pressLayerY3_interval", pressLayerY3_interval); |
|
|
|
json.put("pressLayerX1_offset", pressLayerX1_offset); |
|
|
|
json.put("pressLayerY1_offset", pressLayerY1_offset); |
|
|
|
json.put("pressLayerX2_offset", pressLayerX2_offset); |
|
|
|
json.put("pressLayerY2_offset", pressLayerY2_offset); |
|
|
|
json.put("pressLayerX3_offset", pressLayerX3_offset); |
|
|
|
json.put("pressLayerY3_offset", pressLayerY3_offset); |
|
|
|
json.put("tool_coordinate", tool_coordinate); |
|
|
|
HttpResponse result = acsToWmsService.applyTaskManipulatorToWms(json); |
|
|
|
if (ObjectUtil.isNotEmpty(result)) { |
|
|
|
if (result.getStatus() == HttpStatus.OK.value()) { |
|
|
|
JSONObject jsonObject = JSONObject.parseObject(result.body()); |
|
|
|
if (ObjectUtil.isNotEmpty(jsonObject) && "200".equals(jsonObject.getString("status"))) { |
|
|
|
this.writing(this.mode); |
|
|
|
this.setRequireSucess(true); |
|
|
|
} |
|
|
|
public synchronized boolean apply_put_full_vehicle() { |
|
|
|
if(move == 0) { |
|
|
|
ApplyTaskRequest request = new ApplyTaskRequest(); |
|
|
|
request.setDevice_code(this.getDevice_code()); |
|
|
|
request.setRequest_medthod_code(Thread.currentThread().getStackTrace()[1].getMethodName()); |
|
|
|
request.setRequest_medthod_name(RequestMethodEnum.getName(Thread.currentThread().getStackTrace()[1].getMethodName())); |
|
|
|
request.setWeight(String.valueOf(weight)); |
|
|
|
request.setVehicle_code(String.valueOf(barcode)); |
|
|
|
message = RequestMethodEnum.getName("apply_put_full_vehicle") + "apply_put_full_vehicle 接口请求LMS..."; |
|
|
|
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message + "参数:" + JSON.toJSONString(request))); |
|
|
|
ApplyTaskResponse resp = JSON.toJavaObject(JSONObject.parseObject(acsToWmsService.applyTask(request)),ApplyTaskResponse.class); |
|
|
|
if (resp.getCode() == 200) { |
|
|
|
this.writing(200); |
|
|
|
this.setRequireSucess(true); |
|
|
|
} else { |
|
|
|
this.writing(400); |
|
|
|
message = RequestMethodEnum.getName("apply_put_full_vehicle") + "apply_put_full_vehicle 接口请求失败" + resp.getMessage();; |
|
|
|
} |
|
|
|
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message)); |
|
|
|
return true; |
|
|
|
} else { |
|
|
|
message = RequestMethodEnum.getName("apply_put_full_vehicle") + "apply_put_full_vehicle 设备有货未请求LMS..."; |
|
|
|
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message)); |
|
|
|
return false; |
|
|
|
} |
|
|
|
return true; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 码垛强制完成 |
|
|
|
* 申请强制取走满料盅托盘 |
|
|
|
* 申请补空料盅托盘 |
|
|
|
* |
|
|
|
* @param |
|
|
|
*/ |
|
|
|
public synchronized boolean apply_force_take_full_vehicle() { |
|
|
|
JSONObject json = new JSONObject(); |
|
|
|
json.put("type", "1"); |
|
|
|
json.put("device_code", device_code); |
|
|
|
json.put("qty", encoder_qty); |
|
|
|
json.put("weight", weight); |
|
|
|
json.put("vehicle_code", barcode); |
|
|
|
json.put("is_full", "0"); |
|
|
|
json.put("is_package", "1"); |
|
|
|
json.put("product_code", product_code); |
|
|
|
json.put("AlongSide", AlongSide); |
|
|
|
json.put("BshortSide", BshortSide); |
|
|
|
json.put("Htrapezoidal", Htrapezoidal); |
|
|
|
json.put("Wthickness", Wthickness); |
|
|
|
json.put("tray_qty", tray_qty); |
|
|
|
json.put("tray_high", tray_high); |
|
|
|
json.put("crib_category", crib_category); |
|
|
|
json.put("palletX1_line", palletX1_line); |
|
|
|
json.put("palletY1_row", palletY1_row); |
|
|
|
json.put("palletA1_angle", palletA1_angle); |
|
|
|
json.put("palletX2_line", palletX2_line); |
|
|
|
json.put("palletY2_row", palletY2_row); |
|
|
|
json.put("palletA2_angle", palletA2_angle); |
|
|
|
json.put("palletX3_line", palletX3_line); |
|
|
|
json.put("palletY3_row", palletY3_row); |
|
|
|
json.put("palletA3_angle", palletA3_angle); |
|
|
|
json.put("pressCribX1_line", pressCribX1_line); |
|
|
|
json.put("pressCribY1_row", pressCribY1_row); |
|
|
|
json.put("pressCribA1_angle", pressCribA1_angle); |
|
|
|
json.put("pressCribX2_line", pressCribX2_line); |
|
|
|
json.put("pressCribY2_row", pressCribY2_row); |
|
|
|
json.put("pressCribA2_angle", pressCribA2_angle); |
|
|
|
json.put("pressCribX3_line", pressCribX3_line); |
|
|
|
json.put("pressCribY3_row", pressCribY3_row); |
|
|
|
json.put("pressCribA3_angle", pressCribA3_angle); |
|
|
|
json.put("Zoffset", Zoffset); |
|
|
|
json.put("pallet_layerQty", pallet_layerQty); |
|
|
|
json.put("pressCrib_layerQty", pressCrib_layerQty); |
|
|
|
json.put("codeLayerX1_interval", codeLayerX1_interval); |
|
|
|
json.put("codeLayerY1_interval", codeLayerY1_interval); |
|
|
|
json.put("codeLayerX2_interval", codeLayerX2_interval); |
|
|
|
json.put("codeLayerY2_interval", codeLayerY2_interval); |
|
|
|
json.put("codeLayerX3_interval", codeLayerX3_interval); |
|
|
|
json.put("codeLayerY3_interval", codeLayerY3_interval); |
|
|
|
json.put("codeLayerX1_offset", codeLayerX1_offset); |
|
|
|
json.put("codeLayerY1_offset", codeLayerY1_offset); |
|
|
|
json.put("codeLayerX2_offset", codeLayerX2_offset); |
|
|
|
json.put("codeLayerY2_offset", codeLayerY2_offset); |
|
|
|
json.put("codeLayerX3_offset", codeLayerX3_offset); |
|
|
|
json.put("codeLayerY3_offset", codeLayerY3_offset); |
|
|
|
json.put("pressLayerX1_interval", pressLayerX1_interval); |
|
|
|
json.put("pressLayerY1_interval", pressLayerY1_interval); |
|
|
|
json.put("pressLayerX2_interval", pressLayerX2_interval); |
|
|
|
json.put("pressLayerY2_interval", pressLayerY2_interval); |
|
|
|
json.put("pressLayerX3_interval", pressLayerX3_interval); |
|
|
|
json.put("pressLayerY3_interval", pressLayerY3_interval); |
|
|
|
json.put("pressLayerX1_offset", pressLayerX1_offset); |
|
|
|
json.put("pressLayerY1_offset", pressLayerY1_offset); |
|
|
|
json.put("pressLayerX2_offset", pressLayerX2_offset); |
|
|
|
json.put("pressLayerY2_offset", pressLayerY2_offset); |
|
|
|
json.put("pressLayerX3_offset", pressLayerX3_offset); |
|
|
|
json.put("pressLayerY3_offset", pressLayerY3_offset); |
|
|
|
json.put("tool_coordinate", tool_coordinate); |
|
|
|
HttpResponse result = acsToWmsService.applyTaskManipulatorToWms(json); |
|
|
|
if (ObjectUtil.isNotEmpty(result)) { |
|
|
|
if (result.getStatus() == HttpStatus.OK.value()) { |
|
|
|
JSONObject jsonObject = JSONObject.parseObject(result.body()); |
|
|
|
if (ObjectUtil.isNotEmpty(jsonObject) && "200".equals(jsonObject.getString("status"))) { |
|
|
|
this.writing(this.mode); |
|
|
|
this.setRequireSucess(true); |
|
|
|
} |
|
|
|
public synchronized boolean apply_put_empty_vehicle() { |
|
|
|
if(move == 0) { |
|
|
|
ApplyTaskRequest request = new ApplyTaskRequest(); |
|
|
|
request.setDevice_code(this.getDevice_code()); |
|
|
|
request.setRequest_medthod_code(Thread.currentThread().getStackTrace()[1].getMethodName()); |
|
|
|
request.setRequest_medthod_name(RequestMethodEnum.getName(Thread.currentThread().getStackTrace()[1].getMethodName())); |
|
|
|
request.setWeight(String.valueOf(weight)); |
|
|
|
request.setVehicle_code(String.valueOf(barcode)); |
|
|
|
ApplyTaskResponse resp = JSON.toJavaObject(JSONObject.parseObject(acsToWmsService.applyTask(request)),ApplyTaskResponse.class); |
|
|
|
message = RequestMethodEnum.getName("apply_put_empty_vehicle") + "apply_put_empty_vehicle 接口请求LMS..."; |
|
|
|
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message + "参数:" + JSON.toJSONString(request))); |
|
|
|
|
|
|
|
if (resp.getCode() == 200) { |
|
|
|
this.writing(200); |
|
|
|
this.setRequireSucess(true); |
|
|
|
} else { |
|
|
|
this.writing(400); |
|
|
|
message = RequestMethodEnum.getName("apply_put_empty_vehicle") + "apply_put_empty_vehicle 接口请求失败" + resp.getMessage();; |
|
|
|
} |
|
|
|
return true; |
|
|
|
} else { |
|
|
|
message = RequestMethodEnum.getName("apply_put_empty_vehicle") + "apply_put_empty_vehicle 设备有货未请求LMS..."; |
|
|
|
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message)); |
|
|
|
return false; |
|
|
|
} |
|
|
|
return true; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
* 申请补满料盅托盘 |
|
|
|
* 申请取走空料盅托盘 |
|
|
|
* |
|
|
|
* @param |
|
|
|
*/ |
|
|
|
public synchronized boolean apply_put_full_vehicle() { |
|
|
|
JSONObject json = new JSONObject(); |
|
|
|
json.put("device_code", this.device_code); |
|
|
|
json.put("type", "2"); |
|
|
|
json.put("qty", weight); |
|
|
|
json.put("vehicle_code", barcode); |
|
|
|
json.put("is_full", "1"); |
|
|
|
HttpResponse result = acsToWmsService.lnshApplyTaskToWms(json); |
|
|
|
if (ObjectUtil.isNotEmpty(result)) { |
|
|
|
if (result.getStatus() == HttpStatus.OK.value()) { |
|
|
|
JSONObject jsonObject = JSONObject.parseObject(result.body()); |
|
|
|
if (ObjectUtil.isNotEmpty(jsonObject) && "200".equals(jsonObject.getString("status"))) { |
|
|
|
this.writing(this.mode); |
|
|
|
this.setRequireSucess(true); |
|
|
|
} |
|
|
|
public synchronized boolean apply_take_empty_vehicle() { |
|
|
|
if(move == 0) { |
|
|
|
ApplyTaskRequest request = new ApplyTaskRequest(); |
|
|
|
request.setDevice_code(this.getDevice_code()); |
|
|
|
request.setRequest_medthod_code(Thread.currentThread().getStackTrace()[1].getMethodName()); |
|
|
|
request.setRequest_medthod_name(RequestMethodEnum.getName(Thread.currentThread().getStackTrace()[1].getMethodName())); |
|
|
|
request.setWeight(String.valueOf(weight)); |
|
|
|
request.setVehicle_code(String.valueOf(barcode)); |
|
|
|
ApplyTaskResponse resp = JSON.toJavaObject(JSONObject.parseObject(acsToWmsService.applyTask(request)),ApplyTaskResponse.class); |
|
|
|
message = RequestMethodEnum.getName("apply_take_empty_vehicle") + "apply_take_empty_vehicle 接口请求LMS..."; |
|
|
|
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message + "参数:" + JSON.toJSONString(request))); |
|
|
|
|
|
|
|
if (resp.getCode() == 200) { |
|
|
|
this.writing(200); |
|
|
|
this.setRequireSucess(true); |
|
|
|
} else { |
|
|
|
this.writing(400); |
|
|
|
message = RequestMethodEnum.getName("apply_take_empty_vehicle") + "apply_take_empty_vehicle 接口请求失败" + resp.getMessage();; |
|
|
|
} |
|
|
|
return true; |
|
|
|
} else { |
|
|
|
message = RequestMethodEnum.getName("apply_take_empty_vehicle") + "apply_take_empty_vehicle 设备有货未请求LMS..."; |
|
|
|
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message)); |
|
|
|
return false; |
|
|
|
} |
|
|
|
return true; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
* 申请补空料盅托盘 |
|
|
|
* 申请取走满料盅托盘 |
|
|
|
* |
|
|
|
* @param |
|
|
|
*/ |
|
|
|
public synchronized boolean apply_put_empty_vehicle() { |
|
|
|
ApplyTaskRequest request = new ApplyTaskRequest(); |
|
|
|
request.setDevice_code(this.getDevice_code()); |
|
|
|
request.setRequest_medthod_code(this.getClass().getName()); |
|
|
|
request.setRequest_medthod_name(RequestMethodEnum.getName(this.getClass().getName())); |
|
|
|
request.setRequestNo(IdUtil.simpleUUID()); |
|
|
|
request.setRequestDate(AgvUtil.getDate()); |
|
|
|
Resp resp = acsToWmsService.applyTask(request); |
|
|
|
if (resp.getCode() == 200) { |
|
|
|
this.writing(this.mode); |
|
|
|
this.setRequireSucess(true); |
|
|
|
public synchronized boolean apply_take_full_vehicle() { |
|
|
|
if(move > 0) { |
|
|
|
ApplyTaskRequest request = new ApplyTaskRequest(); |
|
|
|
request.setDevice_code(this.getDevice_code()); |
|
|
|
request.setRequest_medthod_code(Thread.currentThread().getStackTrace()[1].getMethodName()); |
|
|
|
request.setRequest_medthod_name(RequestMethodEnum.getName(Thread.currentThread().getStackTrace()[1].getMethodName())); |
|
|
|
request.setMaterial_code(material); |
|
|
|
request.setWeight(String.valueOf(weight)); |
|
|
|
request.setVehicle_code(String.valueOf(barcode)); |
|
|
|
if(ObjectUtil.isNotEmpty(this.getDevice().getExtraValue().get("link_device_code"))){ |
|
|
|
Device device = deviceAppService.findDeviceByCode(this.getDevice().getExtraValue().get("link_device_code").toString()); |
|
|
|
if(ObjectUtil.isNotEmpty(device)){ |
|
|
|
LnshMixingMillDeviceDriver lnshMixingMillDeviceDriver; |
|
|
|
if(device.getDeviceDriver() instanceof LnshMixingMillDeviceDriver){ |
|
|
|
lnshMixingMillDeviceDriver = (LnshMixingMillDeviceDriver) device.getDeviceDriver(); |
|
|
|
request.setMix_mum(String.valueOf(lnshMixingMillDeviceDriver.getMix_num())); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
ApplyTaskResponse resp = JSON.toJavaObject(JSONObject.parseObject(acsToWmsService.applyTask(request)),ApplyTaskResponse.class); |
|
|
|
message = RequestMethodEnum.getName("apply_take_full_vehicle") + "apply_take_full_vehicle 接口请求LMS..."; |
|
|
|
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message + "参数:" + JSON.toJSONString(request))); |
|
|
|
|
|
|
|
if (resp.getCode() == 200) { |
|
|
|
this.writing(200); |
|
|
|
this.setRequireSucess(true); |
|
|
|
} else { |
|
|
|
this.writing(400); |
|
|
|
message = RequestMethodEnum.getName("apply_take_full_vehicle") + "apply_take_full_vehicle 接口请求失败" + resp.getMessage();; |
|
|
|
} |
|
|
|
return true; |
|
|
|
} else { |
|
|
|
this.writing(400); |
|
|
|
message = RequestMethodEnum.getName("apply_take_full_vehicle") + "apply_take_full_vehicle 设备无货未请求LMS..."; |
|
|
|
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message)); |
|
|
|
return false; |
|
|
|
} |
|
|
|
return true; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 申请取走空料盅托盘 |
|
|
|
* 申请强制取走满料盅托盘 |
|
|
|
* |
|
|
|
* @param |
|
|
|
*/ |
|
|
|
public synchronized boolean apply_take_empty_vehicle() { |
|
|
|
JSONObject json = new JSONObject(); |
|
|
|
json.put("device_code", this.device_code); |
|
|
|
json.put("type", "2"); |
|
|
|
json.put("is_full", "1"); |
|
|
|
HttpResponse result = acsToWmsService.lnshApplyTaskToWms(json); |
|
|
|
if (ObjectUtil.isNotEmpty(result)) { |
|
|
|
if (result.getStatus() == HttpStatus.OK.value()) { |
|
|
|
JSONObject jsonObject = JSONObject.parseObject(result.body()); |
|
|
|
if (ObjectUtil.isNotEmpty(jsonObject) && "200".equals(jsonObject.getString("status"))) { |
|
|
|
this.writing(this.mode); |
|
|
|
this.setRequireSucess(true); |
|
|
|
} |
|
|
|
public synchronized boolean apply_force_take_full_vehicle() { |
|
|
|
if(move > 0) { |
|
|
|
ApplyTaskRequest request = new ApplyTaskRequest(); |
|
|
|
request.setDevice_code(this.getDevice_code()); |
|
|
|
request.setRequest_medthod_code(Thread.currentThread().getStackTrace()[1].getMethodName()); |
|
|
|
request.setRequest_medthod_name(RequestMethodEnum.getName(Thread.currentThread().getStackTrace()[1].getMethodName())); |
|
|
|
request.setWeight(String.valueOf(weight)); |
|
|
|
request.setVehicle_code(String.valueOf(barcode)); |
|
|
|
ApplyTaskResponse resp = JSON.toJavaObject(JSONObject.parseObject(acsToWmsService.applyTask(request)),ApplyTaskResponse.class); |
|
|
|
message = RequestMethodEnum.getName("apply_force_take_full_vehicle") + "apply_force_take_full_vehicle 接口请求LMS..."; |
|
|
|
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message + "参数:" + JSON.toJSONString(request))); |
|
|
|
|
|
|
|
if (resp.getCode() == 200) { |
|
|
|
this.writing(200); |
|
|
|
this.setRequireSucess(true); |
|
|
|
} else { |
|
|
|
this.writing(400); |
|
|
|
message = RequestMethodEnum.getName("apply_force_take_full_vehicle") + "apply_force_take_full_vehicle 接口请求失败" + resp.getMessage();; |
|
|
|
} |
|
|
|
return true; |
|
|
|
} else { |
|
|
|
message = RequestMethodEnum.getName("apply_force_take_full_vehicle") + "apply_force_take_full_vehicle 设备无货未请求LMS..."; |
|
|
|
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message)); |
|
|
|
return false; |
|
|
|
} |
|
|
|
return true; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
@ -958,23 +902,30 @@ public class LnshPalletizingManipulatorSiteDeviceDriver extends AbstractOpcDevic |
|
|
|
* @param |
|
|
|
*/ |
|
|
|
public synchronized boolean apply_force_take_full_vehicle_in_storage() { |
|
|
|
JSONObject json = new JSONObject(); |
|
|
|
json.put("device_code", this.device_code); |
|
|
|
json.put("type", "1"); |
|
|
|
json.put("weight", weight); |
|
|
|
json.put("vehicle_code", barcode); |
|
|
|
json.put("is_full", "1"); |
|
|
|
HttpResponse result = acsToWmsService.lnshApplyTaskToWms(json); |
|
|
|
if (ObjectUtil.isNotEmpty(result)) { |
|
|
|
if (result.getStatus() == HttpStatus.OK.value()) { |
|
|
|
JSONObject jsonObject = JSONObject.parseObject(result.body()); |
|
|
|
if (ObjectUtil.isNotEmpty(jsonObject) && "200".equals(jsonObject.getString("status"))) { |
|
|
|
this.writing(this.mode); |
|
|
|
this.setRequireSucess(true); |
|
|
|
} |
|
|
|
if(move > 0) { |
|
|
|
ApplyTaskRequest request = new ApplyTaskRequest(); |
|
|
|
request.setDevice_code(this.getDevice_code()); |
|
|
|
request.setRequest_medthod_code(Thread.currentThread().getStackTrace()[1].getMethodName()); |
|
|
|
request.setRequest_medthod_name(RequestMethodEnum.getName(Thread.currentThread().getStackTrace()[1].getMethodName())); |
|
|
|
request.setWeight(String.valueOf(weight)); |
|
|
|
request.setVehicle_code(String.valueOf(barcode)); |
|
|
|
ApplyTaskResponse resp = JSON.toJavaObject(JSONObject.parseObject(acsToWmsService.applyTask(request)),ApplyTaskResponse.class); |
|
|
|
message = RequestMethodEnum.getName("apply_force_take_full_vehicle_in_storage") + "apply_force_take_full_vehicle_in_storage 接口请求LMS..."; |
|
|
|
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message + "参数:" + JSON.toJSONString(request))); |
|
|
|
|
|
|
|
if (resp.getCode() == 200) { |
|
|
|
this.writing(200); |
|
|
|
this.setRequireSucess(true); |
|
|
|
} else { |
|
|
|
this.writing(400); |
|
|
|
message = RequestMethodEnum.getName("apply_force_take_full_vehicle_in_storage") + "apply_force_take_full_vehicle_in_storage 接口请求失败" + resp.getMessage();; |
|
|
|
} |
|
|
|
return true; |
|
|
|
} else { |
|
|
|
message = RequestMethodEnum.getName("apply_force_take_full_vehicle_in_storage") + "apply_force_take_full_vehicle_in_storage 设备无货未请求LMS..."; |
|
|
|
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message)); |
|
|
|
return false; |
|
|
|
} |
|
|
|
return true; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
@ -983,25 +934,31 @@ public class LnshPalletizingManipulatorSiteDeviceDriver extends AbstractOpcDevic |
|
|
|
* @param |
|
|
|
*/ |
|
|
|
public synchronized boolean barcode_sucess_apply() { |
|
|
|
JSONObject json = new JSONObject(); |
|
|
|
json.put("device_code", this.device_code); |
|
|
|
json.put("type", "1"); |
|
|
|
json.put("weight", weight); |
|
|
|
json.put("vehicle_code", barcode); |
|
|
|
json.put("is_full", "1"); |
|
|
|
HttpResponse result = acsToWmsService.lnshApplyTaskToWms(json); |
|
|
|
if (ObjectUtil.isNotEmpty(result)) { |
|
|
|
if (result.getStatus() == HttpStatus.OK.value()) { |
|
|
|
JSONObject jsonObject = JSONObject.parseObject(result.body()); |
|
|
|
if (ObjectUtil.isNotEmpty(jsonObject) && "200".equals(jsonObject.getString("status"))) { |
|
|
|
this.writing(this.mode); |
|
|
|
this.setRequireSucess(true); |
|
|
|
} |
|
|
|
if(move > 0) { |
|
|
|
ApplyTaskRequest request = new ApplyTaskRequest(); |
|
|
|
request.setDevice_code(this.getDevice_code()); |
|
|
|
request.setRequest_medthod_code(Thread.currentThread().getStackTrace()[1].getMethodName()); |
|
|
|
request.setRequest_medthod_name(RequestMethodEnum.getName(Thread.currentThread().getStackTrace()[1].getMethodName())); |
|
|
|
request.setWeight(String.valueOf(weight)); |
|
|
|
request.setVehicle_code(String.valueOf(barcode)); |
|
|
|
ApplyTaskResponse resp = JSON.toJavaObject(JSONObject.parseObject(acsToWmsService.applyTask(request)),ApplyTaskResponse.class); |
|
|
|
message = RequestMethodEnum.getName("barcode_sucess_apply") + "barcode_sucess_apply 接口请求LMS..."; |
|
|
|
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message + "参数:" + JSON.toJSONString(request))); |
|
|
|
|
|
|
|
if (resp.getCode() == 200) { |
|
|
|
this.writing(200); |
|
|
|
this.writing(resp.getIs_standing_finish(),"1"); |
|
|
|
this.setRequireSucess(true); |
|
|
|
} else { |
|
|
|
this.writing(400); |
|
|
|
message = RequestMethodEnum.getName("barcode_sucess_apply") + "barcode_sucess_apply 接口请求失败" + resp.getMessage();; |
|
|
|
} |
|
|
|
return true; |
|
|
|
} else { |
|
|
|
message = RequestMethodEnum.getName("barcode_sucess_apply") + "barcode_sucess_apply 设备无货未请求LMS..."; |
|
|
|
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message)); |
|
|
|
return false; |
|
|
|
} |
|
|
|
|
|
|
|
return true; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
@ -1010,71 +967,94 @@ public class LnshPalletizingManipulatorSiteDeviceDriver extends AbstractOpcDevic |
|
|
|
* @param |
|
|
|
*/ |
|
|
|
public synchronized boolean get_vehicle_info() { |
|
|
|
JSONObject json = new JSONObject(); |
|
|
|
json.put("device_code", this.device_code); |
|
|
|
json.put("type", "1"); |
|
|
|
json.put("weight", weight); |
|
|
|
json.put("vehicle_code", barcode); |
|
|
|
json.put("is_full", "1"); |
|
|
|
HttpResponse result = acsToWmsService.lnshApplyTaskToWms(json); |
|
|
|
if (ObjectUtil.isNotEmpty(result)) { |
|
|
|
if (result.getStatus() == HttpStatus.OK.value()) { |
|
|
|
JSONObject jsonObject = JSONObject.parseObject(result.body()); |
|
|
|
if (ObjectUtil.isNotEmpty(jsonObject) && "200".equals(jsonObject.getString("status"))) { |
|
|
|
this.writing(this.mode); |
|
|
|
this.setRequireSucess(true); |
|
|
|
} |
|
|
|
if(move > 0) { |
|
|
|
ApplyTaskRequest request = new ApplyTaskRequest(); |
|
|
|
request.setDevice_code(this.getDevice_code()); |
|
|
|
request.setRequest_medthod_code(Thread.currentThread().getStackTrace()[1].getMethodName()); |
|
|
|
request.setRequest_medthod_name(RequestMethodEnum.getName(Thread.currentThread().getStackTrace()[1].getMethodName())); |
|
|
|
request.setWeight(String.valueOf(weight)); |
|
|
|
request.setVehicle_code(String.valueOf(barcode)); |
|
|
|
ApplyTaskResponse resp = JSON.toJavaObject(JSONObject.parseObject(acsToWmsService.applyTask(request)),ApplyTaskResponse.class); |
|
|
|
message = RequestMethodEnum.getName("get_vehicle_info") + "get_vehicle_info 接口请求LMS..."; |
|
|
|
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message + "参数:" + JSON.toJSONString(request))); |
|
|
|
|
|
|
|
if (resp.getCode() == 200) { |
|
|
|
this.writing(200); |
|
|
|
this.setRequireSucess(true); |
|
|
|
} else { |
|
|
|
this.writing(400); |
|
|
|
message = RequestMethodEnum.getName("get_vehicle_info") + "get_vehicle_info 接口请求失败" + resp.getMessage();; |
|
|
|
} |
|
|
|
return true; |
|
|
|
} else { |
|
|
|
message = RequestMethodEnum.getName("get_vehicle_info") + "get_vehicle_info 设备无货未请求LMS..."; |
|
|
|
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message)); |
|
|
|
return false; |
|
|
|
} |
|
|
|
|
|
|
|
return true; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 强制去包装-不包装 |
|
|
|
*/ |
|
|
|
public synchronized boolean force_no_package() { |
|
|
|
JSONObject json = new JSONObject(); |
|
|
|
json.put("type", "5"); |
|
|
|
json.put("device_code", device_code); |
|
|
|
|
|
|
|
HttpResponse result = acsToWmsService.lnshApplyTaskToWms(json); |
|
|
|
if (ObjectUtil.isNotEmpty(result)) { |
|
|
|
if (result.getStatus() == HttpStatus.OK.value()) { |
|
|
|
JSONObject jsonObject = JSONObject.parseObject(result.body()); |
|
|
|
if (ObjectUtil.isNotEmpty(jsonObject) && "200".equals(jsonObject.getString("status"))) { |
|
|
|
this.writing(this.mode); |
|
|
|
this.setRequireSucess(true); |
|
|
|
} |
|
|
|
if(move > 0) { |
|
|
|
ApplyTaskRequest request = new ApplyTaskRequest(); |
|
|
|
request.setDevice_code(this.getDevice_code()); |
|
|
|
request.setRequest_medthod_code(Thread.currentThread().getStackTrace()[1].getMethodName()); |
|
|
|
request.setRequest_medthod_name(RequestMethodEnum.getName(Thread.currentThread().getStackTrace()[1].getMethodName())); |
|
|
|
request.setWeight(String.valueOf(weight)); |
|
|
|
request.setVehicle_code(String.valueOf(barcode)); |
|
|
|
ApplyTaskResponse resp = JSON.toJavaObject(JSONObject.parseObject(acsToWmsService.applyTask(request)),ApplyTaskResponse.class); |
|
|
|
message = RequestMethodEnum.getName("force_no_package") + "force_no_package 接口请求LMS..."; |
|
|
|
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message + "参数:" + JSON.toJSONString(request))); |
|
|
|
|
|
|
|
if (resp.getCode() == 200) { |
|
|
|
this.writing(200); |
|
|
|
this.setRequireSucess(true); |
|
|
|
} else { |
|
|
|
this.writing(400); |
|
|
|
message = RequestMethodEnum.getName("force_no_package") + "force_no_package 接口请求失败" + resp.getMessage();; |
|
|
|
} |
|
|
|
return true; |
|
|
|
} else { |
|
|
|
message = RequestMethodEnum.getName("force_no_package") + "force_no_package 设备无货未请求LMS..."; |
|
|
|
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message)); |
|
|
|
return false; |
|
|
|
} |
|
|
|
return true; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
* 申请贴标 |
|
|
|
*/ |
|
|
|
public synchronized boolean apply_labelling() { |
|
|
|
JSONObject json = new JSONObject(); |
|
|
|
json.put("type", "5"); |
|
|
|
json.put("device_code", device_code); |
|
|
|
|
|
|
|
HttpResponse result = acsToWmsService.lnshApplyTaskToWms(json); |
|
|
|
if (ObjectUtil.isNotEmpty(result)) { |
|
|
|
if (result.getStatus() == HttpStatus.OK.value()) { |
|
|
|
JSONObject jsonObject = JSONObject.parseObject(result.body()); |
|
|
|
if (ObjectUtil.isNotEmpty(jsonObject) && "200".equals(jsonObject.getString("status"))) { |
|
|
|
this.writing(this.mode); |
|
|
|
this.setRequireSucess(true); |
|
|
|
} |
|
|
|
public synchronized boolean apply_labelling() { |
|
|
|
if(move > 0) { |
|
|
|
ApplyTaskRequest request = new ApplyTaskRequest(); |
|
|
|
request.setDevice_code(this.getDevice_code()); |
|
|
|
request.setRequest_medthod_code(Thread.currentThread().getStackTrace()[1].getMethodName()); |
|
|
|
request.setRequest_medthod_name(RequestMethodEnum.getName(Thread.currentThread().getStackTrace()[1].getMethodName())); |
|
|
|
request.setWeight(String.valueOf(weight)); |
|
|
|
request.setVehicle_code(String.valueOf(barcode)); |
|
|
|
ApplyTaskResponse resp = JSON.toJavaObject(JSONObject.parseObject(acsToWmsService.applyTask(request)),ApplyTaskResponse.class); |
|
|
|
message = RequestMethodEnum.getName("apply_labelling") + "apply_labelling 接口请求LMS..."; |
|
|
|
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message + "参数:" + JSON.toJSONString(request))); |
|
|
|
|
|
|
|
if (resp.getCode() == 200) { |
|
|
|
this.writing(200); |
|
|
|
this.setRequireSucess(true); |
|
|
|
} else { |
|
|
|
this.writing(400); |
|
|
|
message = RequestMethodEnum.getName("apply_labelling") + "apply_labelling 接口请求失败" + resp.getMessage();; |
|
|
|
} |
|
|
|
return true; |
|
|
|
} else { |
|
|
|
message = RequestMethodEnum.getName("apply_labelling") + "apply_labelling 设备无货未请求LMS..."; |
|
|
|
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message)); |
|
|
|
return false; |
|
|
|
} |
|
|
|
return true; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public boolean exe_error() { |
|
|
|
if (this.error == 0) { |
|
|
|
return true; |
|
|
@ -1428,7 +1408,7 @@ public class LnshPalletizingManipulatorSiteDeviceDriver extends AbstractOpcDevic |
|
|
|
this.writing("to_pressLayerX3_offset", StrUtil.isBlank(pressLayerX3_offset) ? "0" : pressLayerX3_offset); |
|
|
|
this.writing("to_pressLayerY3_offset", StrUtil.isBlank(pressLayerY3_offset) ? "0" : pressLayerY3_offset); |
|
|
|
this.writing("to_tool_coordinate", StrUtil.isBlank(tool_coordinate) ? "0" : tool_coordinate); |
|
|
|
this.writing(this.mode); |
|
|
|
this.writing(200); |
|
|
|
} |
|
|
|
this.setRequireSucess(true); |
|
|
|
} |
|
|
@ -1527,7 +1507,7 @@ public class LnshPalletizingManipulatorSiteDeviceDriver extends AbstractOpcDevic |
|
|
|
if (result.getStatus() == HttpStatus.OK.value()) { |
|
|
|
JSONObject jsonObject = JSONObject.parseObject(result.body()); |
|
|
|
if (ObjectUtil.isNotEmpty(jsonObject) && "200".equals(jsonObject.getString("status"))) { |
|
|
|
this.writing(this.mode); |
|
|
|
this.writing(200); |
|
|
|
this.setRequireSucess(true); |
|
|
|
} |
|
|
|
} |
|
|
@ -1556,7 +1536,7 @@ public class LnshPalletizingManipulatorSiteDeviceDriver extends AbstractOpcDevic |
|
|
|
if (result.getStatus() == HttpStatus.OK.value()) { |
|
|
|
JSONObject jsonObject = JSONObject.parseObject(result.body()); |
|
|
|
if (ObjectUtil.isNotEmpty(jsonObject) && "200".equals(jsonObject.getString("status"))) { |
|
|
|
this.writing(this.mode); |
|
|
|
this.writing(200); |
|
|
|
this.setRequireSucess(true); |
|
|
|
} |
|
|
|
} |
|
|
@ -1585,7 +1565,7 @@ public class LnshPalletizingManipulatorSiteDeviceDriver extends AbstractOpcDevic |
|
|
|
if (result.getStatus() == HttpStatus.OK.value()) { |
|
|
|
JSONObject jsonObject = JSONObject.parseObject(result.body()); |
|
|
|
if (ObjectUtil.isNotEmpty(jsonObject) && "200".equals(jsonObject.getString("status"))) { |
|
|
|
this.writing(this.mode); |
|
|
|
this.writing(200); |
|
|
|
this.setRequireSucess(true); |
|
|
|
} |
|
|
|
} |
|
|
|