Merge branch 'master' of http://121.40.234.130:8899/root/rl_mg
This commit is contained in:
@@ -26,7 +26,7 @@ public enum RequestMethodEnum {
|
||||
|
||||
apply_force_take_full_vehicle_in_storage(8, "apply_force_take_full_vehicle_in_storage", "申请强制满托入缓存","0"),
|
||||
|
||||
barcode_sucess_apply(9, "barcode_sucess_apply", "扫码成功申请","0"),
|
||||
barcode_sucess_apply(9, "barcode_success_apply", "扫码成功申请","0"),
|
||||
|
||||
get_vehicle_info(10, "get_vehicle_info", "获取组盘信息","0"),
|
||||
|
||||
|
||||
@@ -33,13 +33,13 @@ public class ConveyorBarcodeDefination implements OpcDeviceDriverDefination {
|
||||
|
||||
@Override
|
||||
public DeviceDriver getDriverInstance(Device device) {
|
||||
return (new LnshStationDeviceDriver()).setDevice(device).setDriverDefination(this);
|
||||
return (new ConveyorBarcodeDeviceDriver()).setDevice(device).setDriverDefination(this);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends DeviceDriver> getDeviceDriverType() {
|
||||
return LnshStationDeviceDriver.class;
|
||||
return ConveyorBarcodeDeviceDriver.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -16,7 +16,10 @@ 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_Laminating_machine.LnshLaminatingMachineDeviceDriver;
|
||||
import org.nl.acs.device_driver.lnsh.lnsh_mixing_mill.LnshMixingMillDeviceDriver;
|
||||
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.Resp;
|
||||
import org.nl.acs.ext.wms.service.AcsToWmsService;
|
||||
import org.nl.acs.instruction.service.InstructionService;
|
||||
@@ -24,6 +27,7 @@ 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.route.service.RouteLineService;
|
||||
import org.nl.acs.task.service.TaskService;
|
||||
import org.nl.modules.lucene.service.LuceneExecuteLogService;
|
||||
@@ -44,7 +48,7 @@ import java.util.Map;
|
||||
@Getter
|
||||
@Setter
|
||||
@RequiredArgsConstructor
|
||||
public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver, DeviceStageMonitor, StandardRequestMethod {
|
||||
public class ConveyorBarcodeDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver, DeviceStageMonitor, StandardRequestMethod {
|
||||
protected ItemProtocol itemProtocol = new ItemProtocol(this);
|
||||
|
||||
LuceneExecuteLogService lucene = SpringContextHolder.getBean("luceneExecuteLogServiceImpl");
|
||||
@@ -61,6 +65,8 @@ public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements
|
||||
|
||||
AcsToWmsService acsToWmsService = SpringContextHolder.getBean("acsToWmsServiceImpl");
|
||||
|
||||
DeviceAppService deviceAppService = SpringContextHolder.getBean("deviceAppServiceImpl");
|
||||
|
||||
String device_code;
|
||||
int mode = 0;
|
||||
int error = 0;
|
||||
@@ -202,7 +208,7 @@ public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements
|
||||
List toInstructions;
|
||||
|
||||
|
||||
if (mode > 2) {
|
||||
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 {
|
||||
@@ -485,9 +491,10 @@ public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements
|
||||
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)));
|
||||
Resp resp = acsToWmsService.applyTask(request);
|
||||
ApplyTaskResponse resp = JSON.toJavaObject(JSONObject.parseObject(acsToWmsService.applyTask(request)),ApplyTaskResponse.class);
|
||||
|
||||
if (resp.getCode() == 200) {
|
||||
this.writing(this.mode);
|
||||
this.writing(200);
|
||||
this.setRequireSucess(true);
|
||||
} else {
|
||||
this.writing(400);
|
||||
@@ -511,16 +518,17 @@ public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements
|
||||
if(move == 0) {
|
||||
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.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));
|
||||
Resp resp = acsToWmsService.applyTask(request);
|
||||
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(this.mode);
|
||||
this.writing(200);
|
||||
this.setRequireSucess(true);
|
||||
} else {
|
||||
this.writing(400);
|
||||
@@ -543,16 +551,17 @@ public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements
|
||||
if(move == 0) {
|
||||
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.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));
|
||||
Resp resp = acsToWmsService.applyTask(request);
|
||||
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(this.mode);
|
||||
this.writing(200);
|
||||
this.setRequireSucess(true);
|
||||
} else {
|
||||
this.writing(400);
|
||||
@@ -576,16 +585,30 @@ public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements
|
||||
if(move > 0) {
|
||||
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.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));
|
||||
Resp resp = acsToWmsService.applyTask(request);
|
||||
|
||||
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(this.mode);
|
||||
this.writing(200);
|
||||
this.setRequireSucess(true);
|
||||
} else {
|
||||
this.writing(400);
|
||||
@@ -599,6 +622,23 @@ public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
String opcservcerid = this.getDevice().getOpc_server_id();
|
||||
Server server = ReadUtil.getServer(opcservcerid);
|
||||
Map<String, Object> itemMap = new HashMap<String, Object>();
|
||||
if (value instanceof String) {
|
||||
itemMap.put(to_param, value);
|
||||
} else {
|
||||
itemMap.put(to_param, value);
|
||||
}
|
||||
ReadUtil.write(itemMap, server);
|
||||
server.disconnect();
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", param + " 写入 " + value);
|
||||
}
|
||||
|
||||
/**
|
||||
* 申请强制取走满料盅托盘
|
||||
*
|
||||
@@ -608,16 +648,17 @@ public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements
|
||||
if(move > 0) {
|
||||
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.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));
|
||||
Resp resp = acsToWmsService.applyTask(request);
|
||||
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(this.mode);
|
||||
this.writing(200);
|
||||
this.setRequireSucess(true);
|
||||
} else {
|
||||
this.writing(400);
|
||||
@@ -640,16 +681,17 @@ public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements
|
||||
if(move > 0) {
|
||||
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.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));
|
||||
Resp resp = acsToWmsService.applyTask(request);
|
||||
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(this.mode);
|
||||
this.writing(200);
|
||||
this.setRequireSucess(true);
|
||||
} else {
|
||||
this.writing(400);
|
||||
@@ -672,16 +714,17 @@ public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements
|
||||
if(move > 0) {
|
||||
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.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));
|
||||
Resp resp = acsToWmsService.applyTask(request);
|
||||
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(this.mode);
|
||||
this.writing(200);
|
||||
this.setRequireSucess(true);
|
||||
} else {
|
||||
this.writing(400);
|
||||
@@ -704,16 +747,17 @@ public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements
|
||||
if(move > 0) {
|
||||
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.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));
|
||||
Resp resp = acsToWmsService.applyTask(request);
|
||||
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(this.mode);
|
||||
this.writing(200);
|
||||
this.setRequireSucess(true);
|
||||
} else {
|
||||
this.writing(400);
|
||||
@@ -735,16 +779,17 @@ public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements
|
||||
if(move > 0) {
|
||||
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.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));
|
||||
Resp resp = acsToWmsService.applyTask(request);
|
||||
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(this.mode);
|
||||
this.writing(200);
|
||||
this.setRequireSucess(true);
|
||||
} else {
|
||||
this.writing(400);
|
||||
@@ -766,16 +811,17 @@ public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements
|
||||
if(move > 0) {
|
||||
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.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));
|
||||
Resp resp = acsToWmsService.applyTask(request);
|
||||
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(this.mode);
|
||||
this.writing(200);
|
||||
this.setRequireSucess(true);
|
||||
} else {
|
||||
this.writing(400);
|
||||
@@ -32,9 +32,9 @@ public class ItemProtocol {
|
||||
|
||||
Boolean isonline;
|
||||
|
||||
private LnshStationDeviceDriver driver;
|
||||
private ConveyorBarcodeDeviceDriver driver;
|
||||
|
||||
public ItemProtocol(LnshStationDeviceDriver driver) {
|
||||
public ItemProtocol(ConveyorBarcodeDeviceDriver driver) {
|
||||
this.driver = driver;
|
||||
}
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@ 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.ext.wms.data.AcsToWmsData.applyTask.ApplyTaskRequest;
|
||||
import org.nl.acs.ext.wms.data.AcsToWmsData.applyTask.ApplyTaskResponse;
|
||||
import org.nl.acs.ext.wms.data.Resp;
|
||||
import org.nl.acs.ext.wms.service.AcsToWmsService;
|
||||
import org.nl.acs.instruction.service.InstructionService;
|
||||
@@ -202,7 +203,7 @@ public class ConveyorPressStationDeviceDriver extends AbstractOpcDeviceDriver im
|
||||
List toInstructions;
|
||||
|
||||
|
||||
if (mode > 2) {
|
||||
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 {
|
||||
@@ -248,6 +249,25 @@ public class ConveyorPressStationDeviceDriver extends AbstractOpcDeviceDriver im
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
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;
|
||||
String opcservcerid = this.getDevice().getOpc_server_id();
|
||||
Server server = ReadUtil.getServer(opcservcerid);
|
||||
Map<String, Object> itemMap = new HashMap<String, Object>();
|
||||
if (value instanceof String) {
|
||||
itemMap.put(to_param, value);
|
||||
} else {
|
||||
itemMap.put(to_param, value);
|
||||
}
|
||||
ReadUtil.write(itemMap, server);
|
||||
server.disconnect();
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", param + " 写入 " + value);
|
||||
}
|
||||
|
||||
|
||||
protected void executing(Instruction instruction) {
|
||||
this.executing(1, instruction, "");
|
||||
}
|
||||
@@ -485,9 +505,10 @@ public class ConveyorPressStationDeviceDriver extends AbstractOpcDeviceDriver im
|
||||
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)));
|
||||
Resp resp = acsToWmsService.applyTask(request);
|
||||
ApplyTaskResponse resp = JSON.toJavaObject(JSONObject.parseObject(acsToWmsService.applyTask(request)),ApplyTaskResponse.class);
|
||||
|
||||
if (resp.getCode() == 200) {
|
||||
this.writing(this.mode);
|
||||
this.writing(200);
|
||||
this.setRequireSucess(true);
|
||||
} else {
|
||||
this.writing(400);
|
||||
@@ -511,16 +532,17 @@ public class ConveyorPressStationDeviceDriver extends AbstractOpcDeviceDriver im
|
||||
if(move == 0) {
|
||||
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.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));
|
||||
Resp resp = acsToWmsService.applyTask(request);
|
||||
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(this.mode);
|
||||
this.writing(200);
|
||||
this.setRequireSucess(true);
|
||||
} else {
|
||||
this.writing(400);
|
||||
@@ -540,19 +562,20 @@ public class ConveyorPressStationDeviceDriver extends AbstractOpcDeviceDriver im
|
||||
* @param
|
||||
*/
|
||||
public synchronized boolean apply_take_empty_vehicle() {
|
||||
if(move == 0) {
|
||||
if(move == 1) {
|
||||
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.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));
|
||||
Resp resp = acsToWmsService.applyTask(request);
|
||||
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(this.mode);
|
||||
this.writing(200);
|
||||
this.setRequireSucess(true);
|
||||
} else {
|
||||
this.writing(400);
|
||||
@@ -576,16 +599,17 @@ public class ConveyorPressStationDeviceDriver extends AbstractOpcDeviceDriver im
|
||||
if(move > 0) {
|
||||
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.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));
|
||||
Resp resp = acsToWmsService.applyTask(request);
|
||||
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(this.mode);
|
||||
this.writing(200);
|
||||
this.setRequireSucess(true);
|
||||
} else {
|
||||
this.writing(400);
|
||||
@@ -608,16 +632,17 @@ public class ConveyorPressStationDeviceDriver extends AbstractOpcDeviceDriver im
|
||||
if(move > 0) {
|
||||
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.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));
|
||||
Resp resp = acsToWmsService.applyTask(request);
|
||||
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(this.mode);
|
||||
this.writing(200);
|
||||
this.setRequireSucess(true);
|
||||
} else {
|
||||
this.writing(400);
|
||||
@@ -640,16 +665,17 @@ public class ConveyorPressStationDeviceDriver extends AbstractOpcDeviceDriver im
|
||||
if(move > 0) {
|
||||
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.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));
|
||||
Resp resp = acsToWmsService.applyTask(request);
|
||||
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(this.mode);
|
||||
this.writing(200);
|
||||
this.setRequireSucess(true);
|
||||
} else {
|
||||
this.writing(400);
|
||||
@@ -668,20 +694,23 @@ public class ConveyorPressStationDeviceDriver extends AbstractOpcDeviceDriver im
|
||||
*
|
||||
* @param
|
||||
*/
|
||||
public synchronized boolean barcode_sucess_apply() {
|
||||
public synchronized boolean barcode_success_apply() {
|
||||
if(move > 0) {
|
||||
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.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));
|
||||
Resp resp = acsToWmsService.applyTask(request);
|
||||
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(this.mode);
|
||||
this.writing(200);
|
||||
this.writing("to_command",resp.getIs_standing_finish());
|
||||
this.writing("to_mix_num",resp.getMix_num());
|
||||
this.setRequireSucess(true);
|
||||
} else {
|
||||
this.writing(400);
|
||||
@@ -704,16 +733,17 @@ public class ConveyorPressStationDeviceDriver extends AbstractOpcDeviceDriver im
|
||||
if(move > 0) {
|
||||
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.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));
|
||||
Resp resp = acsToWmsService.applyTask(request);
|
||||
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(this.mode);
|
||||
this.writing(200);
|
||||
this.setRequireSucess(true);
|
||||
} else {
|
||||
this.writing(400);
|
||||
@@ -735,16 +765,17 @@ public class ConveyorPressStationDeviceDriver extends AbstractOpcDeviceDriver im
|
||||
if(move > 0) {
|
||||
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.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));
|
||||
Resp resp = acsToWmsService.applyTask(request);
|
||||
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(this.mode);
|
||||
this.writing(200);
|
||||
this.setRequireSucess(true);
|
||||
} else {
|
||||
this.writing(400);
|
||||
@@ -766,16 +797,17 @@ public class ConveyorPressStationDeviceDriver extends AbstractOpcDeviceDriver im
|
||||
if(move > 0) {
|
||||
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.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));
|
||||
Resp resp = acsToWmsService.applyTask(request);
|
||||
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(this.mode);
|
||||
this.writing(200);
|
||||
this.setRequireSucess(true);
|
||||
} else {
|
||||
this.writing(400);
|
||||
|
||||
@@ -251,7 +251,7 @@ public class LnshLaminatingMachineDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
if (jo.getInteger("status") == 200) {
|
||||
String vehicle_code = jo.getString("vehicle_code");
|
||||
this.writing("to_barcode", vehicle_code);
|
||||
this.writing(this.mode);
|
||||
this.writing(200);
|
||||
requireSucess = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -235,7 +235,7 @@ public class LnshFoldDiscSiteDeviceDriver extends AbstractOpcDeviceDriver implem
|
||||
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);
|
||||
requireSucess = true;
|
||||
}
|
||||
}
|
||||
@@ -301,7 +301,7 @@ public class LnshFoldDiscSiteDeviceDriver extends AbstractOpcDeviceDriver implem
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ 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.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;
|
||||
@@ -396,9 +397,10 @@ public class LnshMixingMillDeviceDriver extends AbstractOpcDeviceDriver implemen
|
||||
request.setOrder_code(this.getOrder_No());
|
||||
message = RequestMethodEnum.getName("order_verify") + "order_verify 接口请求LMS...";
|
||||
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message + "参数:" + JSON.toJSONString(request)));
|
||||
Resp resp = acsToWmsService.applyTask(request);
|
||||
ApplyTaskResponse resp = JSON.toJavaObject(JSONObject.parseObject(acsToWmsService.applyTask(request)),ApplyTaskResponse.class);
|
||||
|
||||
if (resp.getCode() == 200) {
|
||||
this.writing(this.mode);
|
||||
this.writing(200);
|
||||
this.setRequireSucess(true);
|
||||
} else {
|
||||
this.writing(400);
|
||||
@@ -418,9 +420,10 @@ public class LnshMixingMillDeviceDriver extends AbstractOpcDeviceDriver implemen
|
||||
request.setOrder_code(this.getOrder_No());
|
||||
message = RequestMethodEnum.getName("order_finish") + "order_finish 接口请求LMS...";
|
||||
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message + "参数:" + JSON.toJSONString(request)));
|
||||
Resp resp = acsToWmsService.applyTask(request);
|
||||
ApplyTaskResponse resp = JSON.toJavaObject(JSONObject.parseObject(acsToWmsService.applyTask(request)),ApplyTaskResponse.class);
|
||||
|
||||
if (resp.getCode() == 200) {
|
||||
this.writing(this.mode);
|
||||
this.writing(200);
|
||||
this.setRequireSucess(true);
|
||||
} else {
|
||||
this.writing(400);
|
||||
|
||||
@@ -345,8 +345,8 @@ public class LnshPackageLineDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
this.writing("to_brick_type", data.getString("brick_type"));
|
||||
this.writing("to_brick_type", data.getString("brick_type"));
|
||||
|
||||
this.writing(this.mode);
|
||||
this.writing(this.mode);
|
||||
this.writing(200);
|
||||
this.writing(200);
|
||||
|
||||
this.setRequireSucess(true);
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ 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.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.data.AcsToWmsData.grab.GrabRequest;
|
||||
@@ -375,9 +376,10 @@ public class LnshPalletizingManipulatorDeviceDriver extends AbstractOpcDeviceDri
|
||||
request.setUnqualified_qty(unqualified_qty);
|
||||
message = RequestMethodEnum.getName("apply_one_grab") + "apply_one_grab 接口请求LMS...";
|
||||
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message + "参数:" + JSON.toJSONString(request)));
|
||||
Resp resp = acsToWmsService.applyTask(request);
|
||||
ApplyTaskResponse resp = JSON.toJavaObject(JSONObject.parseObject(acsToWmsService.applyTask(request)),ApplyTaskResponse.class);
|
||||
|
||||
if (resp.getCode() == 200) {
|
||||
this.writing(this.mode);
|
||||
this.writing(200);
|
||||
this.setRequireSucess(true);
|
||||
} else {
|
||||
this.writing(400);
|
||||
@@ -467,7 +469,7 @@ public class LnshPalletizingManipulatorDeviceDriver extends AbstractOpcDeviceDri
|
||||
String two_qty = content.getString("two_qty");
|
||||
String tool_coordinate = content.getString("tool_coordinate");
|
||||
|
||||
this.writing(this.mode);
|
||||
this.writing(200);
|
||||
this.writing("to_materialQty", qty);
|
||||
this.writing("to_material_code", material_code);
|
||||
this.writing("to_AlongSide", AlongSide);
|
||||
|
||||
@@ -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 == 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 > 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;
|
||||
Object ignore_pickup_check = this.getExtraValue().get("ignore_pickup_check");
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
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,168 +723,6 @@ 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 申请补满料盅托盘
|
||||
@@ -887,23 +730,30 @@ public class LnshPalletizingManipulatorSiteDeviceDriver extends AbstractOpcDevic
|
||||
* @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);
|
||||
}
|
||||
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;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -912,21 +762,30 @@ public class LnshPalletizingManipulatorSiteDeviceDriver extends AbstractOpcDevic
|
||||
* @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);
|
||||
} else {
|
||||
this.writing(400);
|
||||
}
|
||||
return 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_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;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -935,21 +794,106 @@ public class LnshPalletizingManipulatorSiteDeviceDriver extends AbstractOpcDevic
|
||||
* @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);
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 申请取走满料盅托盘
|
||||
*
|
||||
* @param
|
||||
*/
|
||||
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 {
|
||||
message = RequestMethodEnum.getName("apply_take_full_vehicle") + "apply_take_full_vehicle 设备无货未请求LMS...";
|
||||
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 申请强制取走满料盅托盘
|
||||
*
|
||||
* @param
|
||||
*/
|
||||
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,24 +967,30 @@ 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)));
|
||||
|
||||
return true;
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1035,46 +998,63 @@ public class LnshPalletizingManipulatorSiteDeviceDriver extends AbstractOpcDevic
|
||||
* 强制去包装-不包装
|
||||
*/
|
||||
public synchronized boolean force_no_package() {
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("type", "5");
|
||||
json.put("device_code", device_code);
|
||||
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)));
|
||||
|
||||
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 (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);
|
||||
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)));
|
||||
|
||||
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 (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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ 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.AcsToWmsData.applyTask.ApplyTaskRequest;
|
||||
import org.nl.acs.ext.wms.data.AcsToWmsData.applyTask.ApplyTaskResponse;
|
||||
import org.nl.acs.ext.wms.data.Resp;
|
||||
import org.nl.acs.ext.wms.service.AcsToWmsService;
|
||||
import org.nl.acs.instruction.service.InstructionService;
|
||||
@@ -297,9 +298,10 @@ public class LnshPressDeviceDriver extends AbstractOpcDeviceDriver implements De
|
||||
request.setOrder_code(this.getOrder_No());
|
||||
message = RequestMethodEnum.getName("order_verify") + "order_verify 接口请求LMS...";
|
||||
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message + "参数:" + JSON.toJSONString(request)));
|
||||
Resp resp = acsToWmsService.applyTask(request);
|
||||
ApplyTaskResponse resp = JSON.toJavaObject(JSONObject.parseObject(acsToWmsService.applyTask(request)),ApplyTaskResponse.class);
|
||||
|
||||
if (resp.getCode() == 200) {
|
||||
this.writing(this.mode);
|
||||
this.writing(200);
|
||||
this.setRequireSucess(true);
|
||||
} else {
|
||||
this.writing(400);
|
||||
@@ -319,9 +321,10 @@ public class LnshPressDeviceDriver extends AbstractOpcDeviceDriver implements De
|
||||
request.setOrder_code(this.getOrder_No());
|
||||
message = RequestMethodEnum.getName("order_finish") + "order_finish 接口请求LMS...";
|
||||
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message + "参数:" + JSON.toJSONString(request)));
|
||||
Resp resp = acsToWmsService.applyTask(request);
|
||||
ApplyTaskResponse resp = JSON.toJavaObject(JSONObject.parseObject(acsToWmsService.applyTask(request)),ApplyTaskResponse.class);
|
||||
|
||||
if (resp.getCode() == 200) {
|
||||
this.writing(this.mode);
|
||||
this.writing(200);
|
||||
this.setRequireSucess(true);
|
||||
} else {
|
||||
this.writing(400);
|
||||
@@ -356,7 +359,7 @@ public class LnshPressDeviceDriver extends AbstractOpcDeviceDriver implements De
|
||||
// dto.setOrder_status("2");
|
||||
// }
|
||||
// produceshiftorderService.update(dto);
|
||||
this.writing(this.mode);
|
||||
this.writing(200);
|
||||
this.setRequireSucess(true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -729,7 +729,7 @@ public class LnshSplitManipulatorDeviceDriver extends AbstractOpcDeviceDriver im
|
||||
} else {
|
||||
this.instruction_require_time = date;
|
||||
JSONObject json = new JSONObject();
|
||||
String linkobj = (String) this.getDevice().getExtraValue().get("link_device_code");
|
||||
String linkobj = (String) this.getDevice().getExtraValue().get("resp.getMessage()vice_code");
|
||||
String demosub = linkobj.substring(1, linkobj.length() - 1);
|
||||
String demoArray[] = demosub.split(",");
|
||||
List<String> demoList = Arrays.asList(demoArray);
|
||||
@@ -859,7 +859,7 @@ public class LnshSplitManipulatorDeviceDriver extends AbstractOpcDeviceDriver im
|
||||
this.writing("to_one_qty", one_qty);
|
||||
this.writing("to_two_qty", two_qty);
|
||||
this.writing("to_tool_coordinate", tool_coordinate);
|
||||
this.writing(this.mode);
|
||||
this.writing(200);
|
||||
requireSucess = true;
|
||||
}
|
||||
return true;
|
||||
@@ -890,7 +890,7 @@ public class LnshSplitManipulatorDeviceDriver extends AbstractOpcDeviceDriver im
|
||||
HttpResponse result = acsToWmsService.lnshApplyTaskToWms(json);
|
||||
if (ObjectUtil.isNotEmpty(result)) {
|
||||
if (result.getStatus() == 200) {
|
||||
this.writing(this.mode);
|
||||
this.writing(200);
|
||||
requireSucess = true;
|
||||
}
|
||||
}
|
||||
@@ -921,7 +921,7 @@ public class LnshSplitManipulatorDeviceDriver extends AbstractOpcDeviceDriver im
|
||||
HttpResponse result = acsToWmsService.lnshApplyTaskToWms(json);
|
||||
if (ObjectUtil.isNotEmpty(result)) {
|
||||
if (result.getStatus() == 200) {
|
||||
this.writing(this.mode);
|
||||
this.writing(200);
|
||||
requireSucess = true;
|
||||
}
|
||||
}
|
||||
@@ -953,7 +953,7 @@ public class LnshSplitManipulatorDeviceDriver extends AbstractOpcDeviceDriver im
|
||||
HttpResponse result = acsToWmsService.lnshApplyTaskToWms(json);
|
||||
if (ObjectUtil.isNotEmpty(result)) {
|
||||
if (result.getStatus() == 200) {
|
||||
this.writing(this.mode);
|
||||
this.writing(200);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -16,6 +16,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;
|
||||
@@ -24,6 +26,7 @@ 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.route.service.RouteLineService;
|
||||
import org.nl.acs.task.service.TaskService;
|
||||
import org.nl.modules.lucene.service.LuceneExecuteLogService;
|
||||
@@ -59,6 +62,8 @@ public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements
|
||||
|
||||
DeviceExecuteLogService logServer = SpringContextHolder.getBean("deviceExecuteLogServiceImpl");
|
||||
|
||||
DeviceAppService deviceAppService = SpringContextHolder.getBean("deviceAppServiceImpl");
|
||||
|
||||
AcsToWmsService acsToWmsService = SpringContextHolder.getBean("acsToWmsServiceImpl");
|
||||
|
||||
String device_code;
|
||||
@@ -305,6 +310,23 @@ public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements
|
||||
|
||||
}
|
||||
|
||||
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;
|
||||
String opcservcerid = this.getDevice().getOpc_server_id();
|
||||
Server server = ReadUtil.getServer(opcservcerid);
|
||||
Map<String, Object> itemMap = new HashMap<String, Object>();
|
||||
if (value instanceof String) {
|
||||
itemMap.put(to_param, value);
|
||||
} else {
|
||||
itemMap.put(to_param, value);
|
||||
}
|
||||
ReadUtil.write(itemMap, server);
|
||||
server.disconnect();
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", param + " 写入 " + value);
|
||||
}
|
||||
|
||||
public void writing(int command) {
|
||||
String to_command = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code()
|
||||
+ "." + ItemProtocol.item_to_command;
|
||||
@@ -485,9 +507,9 @@ public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements
|
||||
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)));
|
||||
Resp resp = acsToWmsService.applyTask(request);
|
||||
ApplyTaskResponse resp = JSON.toJavaObject(JSONObject.parseObject(acsToWmsService.applyTask(request)),ApplyTaskResponse.class);
|
||||
if (resp.getCode() == 200) {
|
||||
this.writing(this.mode);
|
||||
this.writing(200);
|
||||
this.setRequireSucess(true);
|
||||
} else {
|
||||
this.writing(400);
|
||||
@@ -511,16 +533,16 @@ public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements
|
||||
if(move == 0) {
|
||||
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.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));
|
||||
Resp resp = acsToWmsService.applyTask(request);
|
||||
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(this.mode);
|
||||
this.writing(200);
|
||||
this.setRequireSucess(true);
|
||||
} else {
|
||||
this.writing(400);
|
||||
@@ -543,16 +565,16 @@ public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements
|
||||
if(move == 0) {
|
||||
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.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));
|
||||
Resp resp = acsToWmsService.applyTask(request);
|
||||
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(this.mode);
|
||||
this.writing(200);
|
||||
this.setRequireSucess(true);
|
||||
} else {
|
||||
this.writing(400);
|
||||
@@ -576,16 +598,27 @@ public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements
|
||||
if(move > 0) {
|
||||
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.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));
|
||||
Resp resp = acsToWmsService.applyTask(request);
|
||||
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(this.mode);
|
||||
this.writing(200);
|
||||
this.setRequireSucess(true);
|
||||
} else {
|
||||
this.writing(400);
|
||||
@@ -608,16 +641,16 @@ public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements
|
||||
if(move > 0) {
|
||||
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.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));
|
||||
Resp resp = acsToWmsService.applyTask(request);
|
||||
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(this.mode);
|
||||
this.writing(200);
|
||||
this.setRequireSucess(true);
|
||||
} else {
|
||||
this.writing(400);
|
||||
@@ -640,16 +673,16 @@ public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements
|
||||
if(move > 0) {
|
||||
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.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));
|
||||
Resp resp = acsToWmsService.applyTask(request);
|
||||
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(this.mode);
|
||||
this.writing(200);
|
||||
this.setRequireSucess(true);
|
||||
} else {
|
||||
this.writing(400);
|
||||
@@ -672,16 +705,17 @@ public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements
|
||||
if(move > 0) {
|
||||
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.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));
|
||||
Resp resp = acsToWmsService.applyTask(request);
|
||||
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(this.mode);
|
||||
this.writing(200);
|
||||
this.writing(resp.getIs_standing_finish(),"1");
|
||||
this.setRequireSucess(true);
|
||||
} else {
|
||||
this.writing(400);
|
||||
@@ -704,16 +738,16 @@ public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements
|
||||
if(move > 0) {
|
||||
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.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));
|
||||
Resp resp = acsToWmsService.applyTask(request);
|
||||
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(this.mode);
|
||||
this.writing(200);
|
||||
this.setRequireSucess(true);
|
||||
} else {
|
||||
this.writing(400);
|
||||
@@ -735,16 +769,16 @@ public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements
|
||||
if(move > 0) {
|
||||
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.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));
|
||||
Resp resp = acsToWmsService.applyTask(request);
|
||||
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(this.mode);
|
||||
this.writing(200);
|
||||
this.setRequireSucess(true);
|
||||
} else {
|
||||
this.writing(400);
|
||||
@@ -766,16 +800,16 @@ public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements
|
||||
if(move > 0) {
|
||||
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.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));
|
||||
Resp resp = acsToWmsService.applyTask(request);
|
||||
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(this.mode);
|
||||
this.writing(200);
|
||||
this.setRequireSucess(true);
|
||||
} else {
|
||||
this.writing(400);
|
||||
|
||||
@@ -22,6 +22,11 @@ public class ApplyTaskRequest extends BaseRequest {
|
||||
*/
|
||||
private String weight;
|
||||
|
||||
/**
|
||||
* 碾次
|
||||
*/
|
||||
private String mix_mum;
|
||||
|
||||
/**
|
||||
* 工单号
|
||||
*/
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
package org.nl.acs.ext.wms.data.AcsToWmsData.applyTask;
|
||||
|
||||
import lombok.Data;
|
||||
import org.nl.acs.ext.wms.data.BaseResponse;
|
||||
|
||||
@Data
|
||||
public class ApplyTaskResponse extends BaseResponse {
|
||||
|
||||
/**
|
||||
@@ -14,4 +16,10 @@ public class ApplyTaskResponse extends BaseResponse {
|
||||
*/
|
||||
private String is_package;
|
||||
|
||||
/**
|
||||
* 碾次
|
||||
*/
|
||||
private String mix_num;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ public interface AcsToWmsService {
|
||||
/**
|
||||
* ACS向WMS申请晟华任务
|
||||
*/
|
||||
public Resp<BaseResponse> applyTask(BaseRequest request);
|
||||
public String applyTask(BaseRequest request);
|
||||
|
||||
/**
|
||||
* ACS向WMS申请贴标
|
||||
|
||||
@@ -277,14 +277,14 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
|
||||
|
||||
@Override
|
||||
public Resp<BaseResponse> applyTask(BaseRequest requestParam) {
|
||||
public String applyTask(BaseRequest requestParam) {
|
||||
try {
|
||||
MDC.put(log_file_type, log_type);
|
||||
String api = addressService.findByCode("lnshApplyTaskToWms").getMethods_url();
|
||||
log.info("lnshApplyTaskToWms-----输入参数{}", JSON.toJSONString(requestParam));
|
||||
String result = LmsUtil.notifyAcs(api, requestParam);
|
||||
log.info("lnshApplyTaskToWms-----输出参数{}", result);
|
||||
return RespUtil.getResp(result, new BaseResponse());
|
||||
return result;
|
||||
} finally {
|
||||
MDC.remove(log_file_type);
|
||||
}
|
||||
|
||||
@@ -21,12 +21,16 @@ import org.nl.acs.device.service.DeviceService;
|
||||
import org.nl.acs.device.service.StorageCellService;
|
||||
import org.nl.acs.device.service.dto.DeviceAssignedDto;
|
||||
import org.nl.acs.device.service.impl.DeviceServiceImpl;
|
||||
import org.nl.acs.device_driver.RequestMethodEnum;
|
||||
import org.nl.acs.device_driver.basedriver.standard_inspect_site.StandardInspectSiteDeviceDriver;
|
||||
import org.nl.acs.device_driver.basedriver.standard_ordinary_site.StandardOrdinarySiteDeviceDriver;
|
||||
import org.nl.acs.device_driver.lamp_three_color.LampThreecolorDeviceDriver;
|
||||
import org.nl.acs.device_driver.lnsh.lnsh_fold_disc_site.LnshFoldDiscSiteDeviceDriver;
|
||||
import org.nl.acs.device_driver.lnsh.lnsh_station.LnshStationDeviceDriver;
|
||||
import org.nl.acs.device_driver.standard_emptypallet_site.StandardEmptyPalletSiteDeviceDriver;
|
||||
import org.nl.acs.ext.wms.data.AcsToWmsData.applyTask.ApplyTaskResponse;
|
||||
import org.nl.acs.ext.wms.data.AcsToWmsData.feedBackTaskStatus.FeedBackTaskStatusRequest;
|
||||
import org.nl.acs.ext.wms.data.Resp;
|
||||
import org.nl.acs.ext.wms.service.AcsToWmsService;
|
||||
import org.nl.acs.instruction.service.InstructionService;
|
||||
import org.nl.acs.instruction.service.dto.Instruction;
|
||||
@@ -491,90 +495,22 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
|
||||
//判断是否为WMS下发的任务,如果是反馈任务状态给WMS
|
||||
String hasWms = acsConfigService.findByCode(AcsConfig.HASWMS).getValue();
|
||||
if (!StrUtil.startWith(dto.getTask_code(), "-") && StrUtil.equals(hasWms, "1")) {
|
||||
TaskFeedbackDto feefbackdto = taskFeedbackService.findByCode(entity.getTask_code());
|
||||
JSONObject feed_jo = new JSONObject();
|
||||
feed_jo.put("ext_task_uuid", entity.getExt_task_uuid());
|
||||
feed_jo.put("task_code", dto.getTask_code());
|
||||
feed_jo.put("task_status", dto.getTask_status());
|
||||
JSONArray ja = new JSONArray();
|
||||
ja.add(feed_jo);
|
||||
String message = null;
|
||||
HttpResponse body = null;
|
||||
FeedBackTaskStatusRequest request = new FeedBackTaskStatusRequest();
|
||||
request.setTask_id(entity.getExt_task_uuid());
|
||||
request.setTask_code(dto.getTask_code());
|
||||
request.setTask_status(dto.getTask_status());
|
||||
request.setRequest_medthod_code(RequestMethodEnum.feedback_task_status.getCode());
|
||||
request.setRequest_medthod_name(RequestMethodEnum.feedback_task_status.getName());
|
||||
boolean flag = false;
|
||||
String resp = null;
|
||||
try {
|
||||
body = acstowmsService.feedbackTaskStatusToWms(ja);
|
||||
resp = acstowmsService.applyTask(request);
|
||||
} catch (Exception e) {
|
||||
flag = true;
|
||||
message = e.getMessage();
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
|
||||
}
|
||||
if (flag) {
|
||||
if (ObjectUtil.isEmpty(feefbackdto)) {
|
||||
feefbackdto = new TaskFeedbackDto();
|
||||
feefbackdto.setTask_id(entity.getTask_id());
|
||||
feefbackdto.setTask_code(entity.getTask_code());
|
||||
feefbackdto.setTask_status(entity.getTask_status());
|
||||
feefbackdto.setVehicle_type(entity.getVehicle_type());
|
||||
feefbackdto.setVehicle_code(entity.getVehicle_code());
|
||||
feefbackdto.setStart_device_code(entity.getStart_device_code());
|
||||
feefbackdto.setStart_point_code(entity.getStart_point_code());
|
||||
feefbackdto.setNext_device_code(entity.getNext_device_code());
|
||||
feefbackdto.setNext_point_code(entity.getNext_point_code());
|
||||
feefbackdto.setError_code("400");
|
||||
feefbackdto.setIs_finished("0");
|
||||
feefbackdto.setRemark(message);
|
||||
taskFeedbackService.create(feefbackdto);
|
||||
} else {
|
||||
feefbackdto.setTask_status(entity.getTask_status());
|
||||
feefbackdto.setStart_device_code(entity.getStart_device_code());
|
||||
feefbackdto.setStart_point_code(entity.getStart_point_code());
|
||||
feefbackdto.setNext_device_code(entity.getNext_device_code());
|
||||
feefbackdto.setNext_point_code(entity.getNext_point_code());
|
||||
feefbackdto.setError_code("400");
|
||||
feefbackdto.setRemark(message);
|
||||
taskFeedbackService.update(feefbackdto);
|
||||
}
|
||||
} else {
|
||||
int status = body.getStatus();
|
||||
JSONObject jo = JSONObject.parseObject(body.body());
|
||||
if (ObjectUtil.isEmpty(feefbackdto)) {
|
||||
feefbackdto = new TaskFeedbackDto();
|
||||
feefbackdto.setTask_id(entity.getTask_id());
|
||||
feefbackdto.setTask_code(entity.getTask_code());
|
||||
feefbackdto.setTask_status(entity.getTask_status());
|
||||
feefbackdto.setVehicle_type(entity.getVehicle_type());
|
||||
feefbackdto.setVehicle_code(entity.getVehicle_code());
|
||||
feefbackdto.setError_code(String.valueOf(body.getStatus()));
|
||||
feefbackdto.setStart_device_code(entity.getStart_device_code());
|
||||
feefbackdto.setStart_point_code(entity.getNext_point_code());
|
||||
feefbackdto.setNext_device_code(entity.getNext_device_code());
|
||||
feefbackdto.setNext_point_code(entity.getNext_point_code());
|
||||
if (status == 200) {
|
||||
if (StrUtil.equals(entity.getTask_status(), "2")) {
|
||||
feefbackdto.setIs_finished("1");
|
||||
} else {
|
||||
feefbackdto.setIs_finished("0");
|
||||
}
|
||||
} else {
|
||||
feefbackdto.setIs_finished("0");
|
||||
feefbackdto.setRemark(jo.getString("message"));
|
||||
}
|
||||
taskFeedbackService.create(feefbackdto);
|
||||
} else {
|
||||
feefbackdto.setTask_status(entity.getTask_status());
|
||||
if (status == 200) {
|
||||
} else {
|
||||
if (StrUtil.equals(entity.getTask_status(), "2")) {
|
||||
feefbackdto.setIs_finished("1");
|
||||
} else {
|
||||
feefbackdto.setIs_finished("0");
|
||||
}
|
||||
}
|
||||
taskFeedbackService.update(feefbackdto);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -607,97 +543,22 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
|
||||
//判断是否为WMS下发的任务,如果是反馈任务状态给WMS
|
||||
String hasWms = acsConfigService.findByCode(AcsConfig.HASWMS).getValue();
|
||||
if (!StrUtil.startWith(entity.getTask_code(), "-") && StrUtil.equals(hasWms, "1")) {
|
||||
TaskFeedbackDto feefbackdto = taskFeedbackService.findByCode(entity.getTask_code());
|
||||
JSONObject feed_jo = new JSONObject();
|
||||
Instruction inst = instructionservice.findByTaskcodeToWms(entity.getTask_code());
|
||||
feed_jo.put("ext_task_uuid", entity.getExt_task_uuid());
|
||||
feed_jo.put("task_code", entity.getTask_code());
|
||||
feed_jo.put("task_status", entity.getTask_status());
|
||||
if (ObjectUtil.isNotEmpty(inst)) {
|
||||
feed_jo.put("car_no", inst.getCarno());
|
||||
}
|
||||
JSONArray ja = new JSONArray();
|
||||
ja.add(feed_jo);
|
||||
String message = null;
|
||||
HttpResponse body = null;
|
||||
FeedBackTaskStatusRequest request = new FeedBackTaskStatusRequest();
|
||||
request.setTask_id(entity.getExt_task_uuid());
|
||||
request.setTask_code(entity.getTask_code());
|
||||
request.setTask_status(entity.getTask_status());
|
||||
request.setRequest_medthod_code(RequestMethodEnum.feedback_task_status.getCode());
|
||||
request.setRequest_medthod_name(RequestMethodEnum.feedback_task_status.getName());
|
||||
boolean flag = false;
|
||||
String resp = null;
|
||||
try {
|
||||
body = acstowmsService.feedbackTaskStatusToWms(ja);
|
||||
resp = acstowmsService.applyTask(request);
|
||||
} catch (Exception e) {
|
||||
flag = true;
|
||||
message = e.getMessage();
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
|
||||
}
|
||||
if (flag) {
|
||||
if (ObjectUtil.isEmpty(feefbackdto)) {
|
||||
feefbackdto = new TaskFeedbackDto();
|
||||
feefbackdto.setTask_id(entity.getTask_id());
|
||||
feefbackdto.setTask_code(entity.getTask_code());
|
||||
feefbackdto.setTask_status(entity.getTask_status());
|
||||
feefbackdto.setVehicle_type(entity.getVehicle_type());
|
||||
feefbackdto.setVehicle_code(entity.getVehicle_code());
|
||||
feefbackdto.setStart_device_code(entity.getStart_device_code());
|
||||
feefbackdto.setStart_point_code(entity.getStart_point_code());
|
||||
feefbackdto.setNext_device_code(entity.getNext_device_code());
|
||||
feefbackdto.setNext_point_code(entity.getNext_point_code());
|
||||
feefbackdto.setError_code("400");
|
||||
feefbackdto.setIs_finished("0");
|
||||
feefbackdto.setRemark(message);
|
||||
taskFeedbackService.create(feefbackdto);
|
||||
} else {
|
||||
feefbackdto.setTask_status(entity.getTask_status());
|
||||
feefbackdto.setStart_device_code(entity.getStart_device_code());
|
||||
feefbackdto.setStart_point_code(entity.getStart_point_code());
|
||||
feefbackdto.setNext_device_code(entity.getNext_device_code());
|
||||
feefbackdto.setNext_point_code(entity.getNext_point_code());
|
||||
feefbackdto.setError_code("400");
|
||||
feefbackdto.setRemark(message);
|
||||
taskFeedbackService.update(feefbackdto);
|
||||
}
|
||||
} else {
|
||||
int status = body.getStatus();
|
||||
JSONObject jo = JSONObject.parseObject(body.body());
|
||||
if (ObjectUtil.isEmpty(feefbackdto)) {
|
||||
feefbackdto = new TaskFeedbackDto();
|
||||
feefbackdto.setTask_id(entity.getTask_id());
|
||||
feefbackdto.setTask_code(entity.getTask_code());
|
||||
feefbackdto.setTask_status(entity.getTask_status());
|
||||
feefbackdto.setVehicle_type(entity.getVehicle_type());
|
||||
feefbackdto.setVehicle_code(entity.getVehicle_code());
|
||||
feefbackdto.setError_code(String.valueOf(body.getStatus()));
|
||||
feefbackdto.setStart_device_code(entity.getStart_device_code());
|
||||
feefbackdto.setStart_point_code(entity.getNext_point_code());
|
||||
feefbackdto.setNext_device_code(entity.getNext_device_code());
|
||||
feefbackdto.setNext_point_code(entity.getNext_point_code());
|
||||
if (status == 200) {
|
||||
if (StrUtil.equals(entity.getTask_status(), "2")) {
|
||||
feefbackdto.setIs_finished("1");
|
||||
} else {
|
||||
feefbackdto.setIs_finished("0");
|
||||
}
|
||||
} else {
|
||||
feefbackdto.setIs_finished("0");
|
||||
feefbackdto.setRemark(jo.getString("message"));
|
||||
}
|
||||
taskFeedbackService.create(feefbackdto);
|
||||
} else {
|
||||
feefbackdto.setTask_status(entity.getTask_status());
|
||||
if (status == 200) {
|
||||
if (StrUtil.equals(entity.getTask_status(), "2")) {
|
||||
feefbackdto.setIs_finished("1");
|
||||
} else {
|
||||
feefbackdto.setIs_finished("0");
|
||||
}
|
||||
} else {
|
||||
feefbackdto.setIs_finished("0");
|
||||
feefbackdto.setRemark(jo.getString("message"));
|
||||
}
|
||||
taskFeedbackService.update(feefbackdto);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
//如果属于先知AGV,关闭运单序列
|
||||
if (StrUtil.equals(acsConfigService.findByCode(AcsConfig.AGVTYPE).getValue(), "3")) {
|
||||
@@ -736,13 +597,22 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
|
||||
//判断是否为WMS下发的任务,如果是反馈任务状态给WMS
|
||||
String hasWms = acsConfigService.findByCode(AcsConfig.HASWMS).getValue();
|
||||
if (!StrUtil.startWith(entity.getTask_code(), "-") && StrUtil.equals(hasWms, "1")) {
|
||||
JSONObject feed_jo = new JSONObject();
|
||||
feed_jo.put("ext_task_uuid", entity.getExt_task_uuid());
|
||||
feed_jo.put("task_code", entity.getTask_code());
|
||||
feed_jo.put("task_status", entity.getTask_status());
|
||||
JSONArray ja = new JSONArray();
|
||||
ja.add(feed_jo);
|
||||
acstowmsService.feedbackTaskStatusToWms(ja);
|
||||
FeedBackTaskStatusRequest request = new FeedBackTaskStatusRequest();
|
||||
request.setTask_id(entity.getExt_task_uuid());
|
||||
request.setTask_code(entity.getTask_code());
|
||||
request.setTask_status(entity.getTask_status());
|
||||
request.setRequest_medthod_code(RequestMethodEnum.feedback_task_status.getCode());
|
||||
request.setRequest_medthod_name(RequestMethodEnum.feedback_task_status.getName());
|
||||
boolean flag = false;
|
||||
String resp = null;
|
||||
try {
|
||||
resp = acstowmsService.applyTask(request);
|
||||
} catch (Exception e) {
|
||||
flag = true;
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
|
||||
}
|
||||
}
|
||||
List<RouteLineDto> shortPathsList = routeLineService.getShortPathLines(entity.getStart_device_code(), entity.getNext_device_code(), entity.getRoute_plan_code());
|
||||
String type = shortPathsList.get(0).getType();
|
||||
|
||||
@@ -83,7 +83,7 @@ export default {
|
||||
// 根据驱动类型判断是否为路由设备
|
||||
const parentForm = this.parentForm
|
||||
parentForm.is_route = true
|
||||
updateConfig(parentForm, this.form, null, this.data1, this.data2).then(res => {
|
||||
updateConfig(parentForm, this.form, this.modeform, this.data1, this.data2).then(res => {
|
||||
this.notify('保存成功', 'success')
|
||||
this.configLoading = false
|
||||
}).catch(err => {
|
||||
|
||||
@@ -95,7 +95,7 @@ export default {
|
||||
this.configLoading = true
|
||||
// 根据驱动类型判断是否为路由设备
|
||||
const parentForm = this.parentForm
|
||||
updateConfig(parentForm, this.form, null, this.data1, this.data2).then(res => {
|
||||
updateConfig(parentForm, this.form, this.modeform, this.data1, this.data2).then(res => {
|
||||
this.notify('保存成功', 'success')
|
||||
this.configLoading = false
|
||||
}).catch(err => {
|
||||
|
||||
@@ -464,7 +464,7 @@ export default {
|
||||
parentForm.is_route = true
|
||||
parentForm.plc_id = this.plc_id
|
||||
parentForm.opc_id = this.opc_id
|
||||
updateConfig(parentForm, this.form, null, this.data1, this.data2).then(res => {
|
||||
updateConfig(parentForm, this.form, this.modeform, this.data1, this.data2).then(res => {
|
||||
this.notify('保存成功', 'success')
|
||||
this.configLoading = false
|
||||
}).catch(err => {
|
||||
|
||||
@@ -464,7 +464,7 @@ export default {
|
||||
parentForm.is_route = true
|
||||
parentForm.plc_id = this.plc_id
|
||||
parentForm.opc_id = this.opc_id
|
||||
updateConfig(parentForm, this.form, null, this.data1, this.data2).then(res => {
|
||||
updateConfig(parentForm, this.form, this.modeform, this.data1, this.data2).then(res => {
|
||||
this.notify('保存成功', 'success')
|
||||
this.configLoading = false
|
||||
}).catch(err => {
|
||||
|
||||
@@ -455,7 +455,7 @@ export default {
|
||||
parentForm.is_route = true
|
||||
parentForm.plc_id = this.plc_id
|
||||
parentForm.opc_id = this.opc_id
|
||||
updateConfig(parentForm, this.form, null, this.data1, this.data2).then(res => {
|
||||
updateConfig(parentForm, this.form, this.modeform, this.data1, this.data2).then(res => {
|
||||
this.notify('保存成功', 'success')
|
||||
this.configLoading = false
|
||||
}).catch(err => {
|
||||
|
||||
@@ -435,7 +435,7 @@ export default {
|
||||
parentForm.is_route = true
|
||||
parentForm.plc_id = this.plc_id
|
||||
parentForm.opc_id = this.opc_id
|
||||
updateConfig(parentForm, this.form, null, this.data1, this.data2).then(res => {
|
||||
updateConfig(parentForm, this.form, this.modeform, this.data1, this.data2).then(res => {
|
||||
this.notify('保存成功', 'success')
|
||||
this.configLoading = false
|
||||
}).catch(err => {
|
||||
|
||||
@@ -318,7 +318,7 @@ export default {
|
||||
parentForm.is_route = true
|
||||
parentForm.plc_id = this.plc_id
|
||||
parentForm.opc_id = this.opc_id
|
||||
updateConfig(parentForm, this.form, null, this.data1, this.data2).then(res => {
|
||||
updateConfig(parentForm, this.form, this.modeform, this.data1, this.data2).then(res => {
|
||||
this.notify('保存成功', 'success')
|
||||
this.configLoading = false
|
||||
}).catch(err => {
|
||||
|
||||
@@ -473,7 +473,7 @@ export default {
|
||||
parentForm.is_route = true
|
||||
parentForm.plc_id = this.plc_id
|
||||
parentForm.opc_id = this.opc_id
|
||||
updateConfig(parentForm, this.form, null, this.data1, this.data2).then(res => {
|
||||
updateConfig(parentForm, this.form, this.modeform, this.data1, this.data2).then(res => {
|
||||
this.notify('保存成功', 'success')
|
||||
this.configLoading = false
|
||||
}).catch(err => {
|
||||
|
||||
@@ -464,7 +464,7 @@ export default {
|
||||
parentForm.is_route = true
|
||||
parentForm.plc_id = this.plc_id
|
||||
parentForm.opc_id = this.opc_id
|
||||
updateConfig(parentForm, this.form, null, this.data1, this.data2).then(res => {
|
||||
updateConfig(parentForm, this.form, this.modeform, this.data1, this.data2).then(res => {
|
||||
this.notify('保存成功', 'success')
|
||||
this.configLoading = false
|
||||
}).catch(err => {
|
||||
|
||||
@@ -493,7 +493,7 @@ export default {
|
||||
parentForm.is_route = true
|
||||
parentForm.plc_id = this.plc_id
|
||||
parentForm.opc_id = this.opc_id
|
||||
updateConfig(parentForm, this.form, null, this.data1, this.data2).then(res => {
|
||||
updateConfig(parentForm, this.form, this.modeform, this.data1, this.data2).then(res => {
|
||||
this.notify('保存成功', 'success')
|
||||
this.configLoading = false
|
||||
}).catch(err => {
|
||||
|
||||
@@ -464,7 +464,7 @@ export default {
|
||||
parentForm.is_route = true
|
||||
parentForm.plc_id = this.plc_id
|
||||
parentForm.opc_id = this.opc_id
|
||||
updateConfig(parentForm, this.form, null, this.data1, this.data2).then(res => {
|
||||
updateConfig(parentForm, this.form, this.modeform, this.data1, this.data2).then(res => {
|
||||
|
||||
this.notify('保存成功', 'success')
|
||||
this.configLoading = false
|
||||
|
||||
@@ -464,7 +464,7 @@ export default {
|
||||
parentForm.is_route = true
|
||||
parentForm.plc_id = this.plc_id
|
||||
parentForm.opc_id = this.opc_id
|
||||
updateConfig(parentForm, this.form, null, this.data1, this.data2).then(res => {
|
||||
updateConfig(parentForm, this.form, this.modeform, this.data1, this.data2).then(res => {
|
||||
this.notify('保存成功', 'success')
|
||||
this.configLoading = false
|
||||
}).catch(err => {
|
||||
|
||||
@@ -540,7 +540,7 @@ export default {
|
||||
parentForm.is_route = true
|
||||
parentForm.plc_id = this.plc_id
|
||||
parentForm.opc_id = this.opc_id
|
||||
updateConfig(parentForm, this.form, null, this.data1, this.data2).then(res => {
|
||||
updateConfig(parentForm, this.form, this.modeform, this.data1, this.data2).then(res => {
|
||||
this.notify('保存成功', 'success')
|
||||
this.configLoading = false
|
||||
}).catch(err => {
|
||||
|
||||
@@ -464,7 +464,7 @@ export default {
|
||||
parentForm.is_route = true
|
||||
parentForm.plc_id = this.plc_id
|
||||
parentForm.opc_id = this.opc_id
|
||||
updateConfig(parentForm, this.form, null, this.data1, this.data2).then(res => {
|
||||
updateConfig(parentForm, this.form, this.modeform, this.data1, this.data2).then(res => {
|
||||
this.notify('保存成功', 'success')
|
||||
this.configLoading = false
|
||||
}).catch(err => {
|
||||
|
||||
@@ -464,7 +464,7 @@ export default {
|
||||
parentForm.is_route = true
|
||||
parentForm.plc_id = this.plc_id
|
||||
parentForm.opc_id = this.opc_id
|
||||
updateConfig(parentForm, this.form, null, this.data1, this.data2).then(res => {
|
||||
updateConfig(parentForm, this.form, this.modeform, this.data1, this.data2).then(res => {
|
||||
this.notify('保存成功', 'success')
|
||||
this.configLoading = false
|
||||
}).catch(err => {
|
||||
|
||||
@@ -464,7 +464,7 @@ export default {
|
||||
parentForm.is_route = true
|
||||
parentForm.plc_id = this.plc_id
|
||||
parentForm.opc_id = this.opc_id
|
||||
updateConfig(parentForm, this.form, null, this.data1, this.data2).then(res => {
|
||||
updateConfig(parentForm, this.form, this.modeform, this.data1, this.data2).then(res => {
|
||||
this.notify('保存成功', 'success')
|
||||
this.configLoading = false
|
||||
}).catch(err => {
|
||||
|
||||
@@ -450,7 +450,7 @@ export default {
|
||||
parentForm.is_route = true
|
||||
parentForm.plc_id = this.plc_id
|
||||
parentForm.opc_id = this.opc_id
|
||||
updateConfig(parentForm, this.form, null, this.data1, this.data2).then(res => {
|
||||
updateConfig(parentForm, this.form, this.modeform, this.data1, this.data2).then(res => {
|
||||
this.notify('保存成功', 'success')
|
||||
this.configLoading = false
|
||||
}).catch(err => {
|
||||
|
||||
@@ -464,7 +464,7 @@ export default {
|
||||
parentForm.is_route = true
|
||||
parentForm.plc_id = this.plc_id
|
||||
parentForm.opc_id = this.opc_id
|
||||
updateConfig(parentForm, this.form, null, this.data1, this.data2).then(res => {
|
||||
updateConfig(parentForm, this.form, this.modeform, this.data1, this.data2).then(res => {
|
||||
this.notify('保存成功', 'success')
|
||||
this.configLoading = false
|
||||
}).catch(err => {
|
||||
|
||||
@@ -500,7 +500,7 @@ export default {
|
||||
parentForm.is_route = true
|
||||
parentForm.plc_id = this.plc_id
|
||||
parentForm.opc_id = this.opc_id
|
||||
updateConfig(parentForm, this.form, null, this.data1, this.data2).then(res => {
|
||||
updateConfig(parentForm, this.form, this.modeform, this.data1, this.data2).then(res => {
|
||||
this.notify('保存成功', 'success')
|
||||
this.configLoading = false
|
||||
}).catch(err => {
|
||||
|
||||
@@ -612,85 +612,85 @@ export default {
|
||||
}
|
||||
if (this.data1[val].code.indexOf('pallet_layerQty') !== -1) {
|
||||
this.data1[val].db = beforeStr + '.' + 'W' + (parseInt(endNumber) + 125)
|
||||
}
|
||||
}
|
||||
if (this.data1[val].code.indexOf('pressCrib_layerQty') !== -1) {
|
||||
this.data1[val].db = beforeStr + '.' + 'W' + (parseInt(endNumber) + 127)
|
||||
}
|
||||
}
|
||||
if (this.data1[val].code.indexOf('codeLayerX1_interval') !== -1) {
|
||||
this.data1[val].db = beforeStr + '.' + 'W' + (parseInt(endNumber) + 129)
|
||||
}
|
||||
}
|
||||
if (this.data1[val].code.indexOf('codeLayerY1_interval') !== -1) {
|
||||
this.data1[val].db = beforeStr + '.' + 'W' + (parseInt(endNumber) + 131)
|
||||
}
|
||||
}
|
||||
if (this.data1[val].code.indexOf('codeLayerX2_interval') !== -1) {
|
||||
this.data1[val].db = beforeStr + '.' + 'W' + (parseInt(endNumber) + 133)
|
||||
}
|
||||
}
|
||||
if (this.data1[val].code.indexOf('codeLayerY2_interval') !== -1) {
|
||||
this.data1[val].db = beforeStr + '.' + 'W' + (parseInt(endNumber) + 135)
|
||||
}
|
||||
}
|
||||
if (this.data1[val].code.indexOf('codeLayerX3_interval') !== -1) {
|
||||
this.data1[val].db = beforeStr + '.' + 'W' + (parseInt(endNumber) + 137)
|
||||
}
|
||||
}
|
||||
if (this.data1[val].code.indexOf('codeLayerY3_interval') !== -1) {
|
||||
this.data1[val].db = beforeStr + '.' + 'W' + (parseInt(endNumber) + 139)
|
||||
}
|
||||
}
|
||||
if (this.data1[val].code.indexOf('codeLayerX1_offset') !== -1) {
|
||||
this.data1[val].db = beforeStr + '.' + 'W' + (parseInt(endNumber) + 141)
|
||||
}
|
||||
}
|
||||
if (this.data1[val].code.indexOf('codeLayerY1_offset') !== -1) {
|
||||
this.data1[val].db = beforeStr + '.' + 'W' + (parseInt(endNumber) + 143)
|
||||
}
|
||||
}
|
||||
if (this.data1[val].code.indexOf('codeLayerX2_offset') !== -1) {
|
||||
this.data1[val].db = beforeStr + '.' + 'W' + (parseInt(endNumber) + 145)
|
||||
}
|
||||
}
|
||||
if (this.data1[val].code.indexOf('codeLayerY2_offset') !== -1) {
|
||||
this.data1[val].db = beforeStr + '.' + 'W' + (parseInt(endNumber) + 147)
|
||||
}
|
||||
}
|
||||
if (this.data1[val].code.indexOf('codeLayerX3_offset') !== -1) {
|
||||
this.data1[val].db = beforeStr + '.' + 'W' + (parseInt(endNumber) + 149)
|
||||
}
|
||||
}
|
||||
if (this.data1[val].code.indexOf('codeLayerY3_offset') !== -1) {
|
||||
this.data1[val].db = beforeStr + '.' + 'W' + (parseInt(endNumber) + 151)
|
||||
}
|
||||
}
|
||||
if (this.data1[val].code.indexOf('pressLayerX1_interval') !== -1) {
|
||||
this.data1[val].db = beforeStr + '.' + 'W' + (parseInt(endNumber) + 153)
|
||||
}
|
||||
}
|
||||
if (this.data1[val].code.indexOf('pressLayerY1_interval') !== -1) {
|
||||
this.data1[val].db = beforeStr + '.' + 'W' + (parseInt(endNumber) + 155)
|
||||
}
|
||||
}
|
||||
if (this.data1[val].code.indexOf('pressLayerX2_interval') !== -1) {
|
||||
this.data1[val].db = beforeStr + '.' + 'W' + (parseInt(endNumber) + 157)
|
||||
}
|
||||
}
|
||||
if (this.data1[val].code.indexOf('pressLayerY2_interval') !== -1) {
|
||||
this.data1[val].db = beforeStr + '.' + 'W' + (parseInt(endNumber) + 159)
|
||||
}
|
||||
}
|
||||
if (this.data1[val].code.indexOf('pressLayerX3_interval') !== -1) {
|
||||
this.data1[val].db = beforeStr + '.' + 'W' + (parseInt(endNumber) + 161)
|
||||
}
|
||||
}
|
||||
if (this.data1[val].code.indexOf('pressLayerY3_interval') !== -1) {
|
||||
this.data1[val].db = beforeStr + '.' + 'W' + (parseInt(endNumber) + 163)
|
||||
}
|
||||
}
|
||||
if (this.data1[val].code.indexOf('pressLayerX1_offset') !== -1) {
|
||||
this.data1[val].db = beforeStr + '.' + 'W' + (parseInt(endNumber) + 165)
|
||||
}
|
||||
}
|
||||
if (this.data1[val].code.indexOf('pressLayerY1_offset') !== -1) {
|
||||
this.data1[val].db = beforeStr + '.' + 'W' + (parseInt(endNumber) + 167)
|
||||
}
|
||||
}
|
||||
if (this.data1[val].code.indexOf('pressLayerX2_offset') !== -1) {
|
||||
this.data1[val].db = beforeStr + '.' + 'W' + (parseInt(endNumber) + 169)
|
||||
}
|
||||
}
|
||||
if (this.data1[val].code.indexOf('pressLayerX3_offset') !== -1) {
|
||||
this.data1[val].db = beforeStr + '.' + 'W' + (parseInt(endNumber) + 171)
|
||||
}
|
||||
}
|
||||
if (this.data1[val].code.indexOf('pressLayerX3_offset') !== -1) {
|
||||
this.data1[val].db = beforeStr + '.' + 'W' + (parseInt(endNumber) + 173)
|
||||
}
|
||||
}
|
||||
if (this.data1[val].code.indexOf('pressLayerY3_offset') !== -1) {
|
||||
this.data1[val].db = beforeStr + '.' + 'W' + (parseInt(endNumber) + 175)
|
||||
}
|
||||
}
|
||||
if (this.data1[val].code.indexOf('tool_coordinate') !== -1) {
|
||||
this.data1[val].db = beforeStr + '.' + 'W' + (parseInt(endNumber) + 177)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -940,7 +940,7 @@ export default {
|
||||
parentForm.is_route = true
|
||||
parentForm.plc_id = this.plc_id
|
||||
parentForm.opc_id = this.opc_id
|
||||
updateConfig(parentForm, this.form, null, this.data1, this.data2).then(res => {
|
||||
updateConfig(parentForm, this.form, this.modeform, this.data1, this.data2).then(res => {
|
||||
this.notify('保存成功', 'success')
|
||||
this.configLoading = false
|
||||
}).catch(err => {
|
||||
|
||||
@@ -567,7 +567,7 @@ export default {
|
||||
parentForm.is_route = true
|
||||
parentForm.plc_id = this.plc_id
|
||||
parentForm.opc_id = this.opc_id
|
||||
updateConfig(parentForm, this.form, null, this.data1, this.data2).then(res => {
|
||||
updateConfig(parentForm, this.form, this.modeform, this.data1, this.data2).then(res => {
|
||||
this.notify('保存成功', 'success')
|
||||
this.configLoading = false
|
||||
}).catch(err => {
|
||||
|
||||
@@ -464,7 +464,7 @@ export default {
|
||||
parentForm.is_route = true
|
||||
parentForm.plc_id = this.plc_id
|
||||
parentForm.opc_id = this.opc_id
|
||||
updateConfig(parentForm, this.form, null, this.data1, this.data2).then(res => {
|
||||
updateConfig(parentForm, this.form, this.modeform, this.data1, this.data2).then(res => {
|
||||
this.notify('保存成功', 'success')
|
||||
this.configLoading = false
|
||||
}).catch(err => {
|
||||
|
||||
@@ -66,6 +66,23 @@
|
||||
</div>
|
||||
<el-form ref="form" :inline="true" :model="form" :rules="rules" size="small" label-width="78px">
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="关联设备" prop="device_code">
|
||||
<el-select
|
||||
v-model="form.link_device_code"
|
||||
clearable
|
||||
filterable
|
||||
placeholder="请选择"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in deviceList"
|
||||
:key="item.device_code"
|
||||
:label="item.device_name"
|
||||
:value="item.device_code"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="检验有货">
|
||||
<el-switch v-model="form.inspect_in_stocck" />
|
||||
@@ -365,7 +382,7 @@ export default {
|
||||
},
|
||||
{
|
||||
mode: '11',
|
||||
request: 'barcode_sucess_apply'
|
||||
request: 'barcode_success_apply'
|
||||
},
|
||||
{
|
||||
mode: '12',
|
||||
|
||||
@@ -471,7 +471,7 @@ export default {
|
||||
parentForm.is_route = true
|
||||
parentForm.plc_id = this.plc_id
|
||||
parentForm.opc_id = this.opc_id
|
||||
updateConfig(parentForm, this.form, null, this.data1, this.data2).then(res => {
|
||||
updateConfig(parentForm, this.form, this.modeform, this.data1, this.data2).then(res => {
|
||||
this.notify('保存成功', 'success')
|
||||
this.configLoading = false
|
||||
}).catch(err => {
|
||||
|
||||
@@ -478,7 +478,7 @@ export default {
|
||||
parentForm.is_route = true
|
||||
parentForm.plc_id = this.plc_id
|
||||
parentForm.opc_id = this.opc_id
|
||||
updateConfig(parentForm, this.form, null, this.data1, this.data2).then(res => {
|
||||
updateConfig(parentForm, this.form, this.modeform, this.data1, this.data2).then(res => {
|
||||
this.notify('保存成功', 'success')
|
||||
this.configLoading = false
|
||||
}).catch(err => {
|
||||
|
||||
@@ -522,7 +522,7 @@ export default {
|
||||
parentForm.is_route = true
|
||||
parentForm.plc_id = this.plc_id
|
||||
parentForm.opc_id = this.opc_id
|
||||
updateConfig(parentForm, this.form, null, this.data1, this.data2).then(res => {
|
||||
updateConfig(parentForm, this.form, this.modeform, this.data1, this.data2).then(res => {
|
||||
this.notify('保存成功', 'success')
|
||||
this.configLoading = false
|
||||
}).catch(err => {
|
||||
|
||||
@@ -453,7 +453,7 @@ export default {
|
||||
parentForm.is_route = true
|
||||
parentForm.plc_id = this.plc_id
|
||||
parentForm.opc_id = this.opc_id
|
||||
updateConfig(parentForm, this.form, null, this.data1, this.data2).then(res => {
|
||||
updateConfig(parentForm, this.form, this.modeform, this.data1, this.data2).then(res => {
|
||||
this.notify('保存成功', 'success')
|
||||
this.configLoading = false
|
||||
}).catch(err => {
|
||||
|
||||
@@ -466,7 +466,7 @@ export default {
|
||||
parentForm.is_route = true
|
||||
parentForm.plc_id = this.plc_id
|
||||
parentForm.opc_id = this.opc_id
|
||||
updateConfig(parentForm, this.form, null, this.data1, this.data2).then(res => {
|
||||
updateConfig(parentForm, this.form, this.modeform, this.data1, this.data2).then(res => {
|
||||
this.notify('保存成功', 'success')
|
||||
this.configLoading = false
|
||||
}).catch(err => {
|
||||
|
||||
@@ -98,7 +98,7 @@ export default {
|
||||
parentForm.is_route = true
|
||||
parentForm.plc_id = this.plc_id
|
||||
parentForm.opc_id = this.opc_id
|
||||
updateConfig(parentForm, this.form, null, this.data1, this.data2).then(res => {
|
||||
updateConfig(parentForm, this.form, this.modeform, this.data1, this.data2).then(res => {
|
||||
this.notify('保存成功', 'success')
|
||||
this.configLoading = false
|
||||
}).catch(err => {
|
||||
|
||||
@@ -268,7 +268,7 @@ export default {
|
||||
parentForm.is_route = true
|
||||
parentForm.plc_id = this.plc_id
|
||||
parentForm.opc_id = this.opc_id
|
||||
updateConfig(parentForm, this.form, null, this.data1, this.data2).then(res => {
|
||||
updateConfig(parentForm, this.form, this.modeform, this.data1, this.data2).then(res => {
|
||||
this.notify('保存成功', 'success')
|
||||
this.configLoading = false
|
||||
}).catch(err => {
|
||||
|
||||
Reference in New Issue
Block a user