fix: 托盘类型不对,直接去扫码位托盘入库代码开发
This commit is contained in:
@@ -209,6 +209,16 @@ public class FoldDiscSiteDeviceDriver extends AbstractOpcDeviceDriver implements
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//托盘去扫码位
|
||||||
|
if (mode == 4){
|
||||||
|
List list1 = new ArrayList();
|
||||||
|
Map map = new HashMap();
|
||||||
|
map.put("code", "to_command");
|
||||||
|
map.put("value", 0);
|
||||||
|
list1.add(map);
|
||||||
|
this.writing(list1);
|
||||||
|
}
|
||||||
|
|
||||||
if (mode == 0) {
|
if (mode == 0) {
|
||||||
this.setIsonline(false);
|
this.setIsonline(false);
|
||||||
message = "universal_off-line";
|
message = "universal_off-line";
|
||||||
|
|||||||
@@ -295,6 +295,13 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//申请空托盘入库
|
||||||
|
if (mode == 9 && move == 1 && !requireSucess){
|
||||||
|
applyEmptyTask(StorageTypeEnum.DISKS_IN.getType(), mode);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
//申请入库指令、异常位指令
|
//申请入库指令、异常位指令
|
||||||
if (mode == 2 && move == 1 && !requireSucess) {
|
if (mode == 2 && move == 1 && !requireSucess) {
|
||||||
boolean res = instruction_require();
|
boolean res = instruction_require();
|
||||||
@@ -375,6 +382,54 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void applyEmptyTask(String type, int mode) {
|
||||||
|
Date date = new Date();
|
||||||
|
if (date.getTime() - this.require_apply_strangulation_time.getTime()
|
||||||
|
< (long) this.instruction_require_time_out) {
|
||||||
|
log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out);
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
try {
|
||||||
|
JSONObject param = new JSONObject();
|
||||||
|
param.put("device_code", device_code);
|
||||||
|
param.put("container_type", container_type);
|
||||||
|
param.put("type", type);
|
||||||
|
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||||
|
.device_code(device_code)
|
||||||
|
.content("申请空托盘出入库,参数:" + param)
|
||||||
|
.build();
|
||||||
|
logDto.setLog_level(4);
|
||||||
|
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||||
|
String response = acsToWmsService.applyTwo(param);
|
||||||
|
JSONObject jo = JSON.parseObject(response);
|
||||||
|
if (response == null || jo.getInteger("status") == 200) {
|
||||||
|
LuceneLogDto logDto2 = LuceneLogDto.builder()
|
||||||
|
.device_code(device_code)
|
||||||
|
.content("申请空托盘出入库,参数,接口返回:" + jo)
|
||||||
|
.build();
|
||||||
|
logDto.setLog_level(4);
|
||||||
|
luceneExecuteLogService.deviceExecuteLog(logDto2);
|
||||||
|
List list1 = new ArrayList();
|
||||||
|
Map map = new HashMap();
|
||||||
|
map.put("code", "to_command");
|
||||||
|
map.put("value", mode);
|
||||||
|
list1.add(map);
|
||||||
|
this.writing(list1);
|
||||||
|
this.requireSucess = true;
|
||||||
|
}else {
|
||||||
|
LuceneLogDto logDto2 = LuceneLogDto.builder()
|
||||||
|
.device_code(device_code)
|
||||||
|
.content("申请空托盘出入库,返回参数:" + jo.getString("body"))
|
||||||
|
.build();
|
||||||
|
logDto.setLog_level(4);
|
||||||
|
luceneExecuteLogService.deviceExecuteLog(logDto2);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void applyIn(String type, int mode) {
|
private void applyIn(String type, int mode) {
|
||||||
Date date = new Date();
|
Date date = new Date();
|
||||||
if (date.getTime() - this.require_apply_strangulation_time.getTime()
|
if (date.getTime() - this.require_apply_strangulation_time.getTime()
|
||||||
@@ -390,7 +445,7 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv
|
|||||||
param.put("type", type);
|
param.put("type", type);
|
||||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||||
.device_code(device_code)
|
.device_code(device_code)
|
||||||
.content("申请空托盘出入库,参数:" + param)
|
.content("木箱、子卷入库申请入库任务,参数:" + param)
|
||||||
.build();
|
.build();
|
||||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||||
String response = acsToWmsService.applyTwo(param);
|
String response = acsToWmsService.applyTwo(param);
|
||||||
@@ -398,7 +453,7 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv
|
|||||||
if (response == null || jo.getInteger("status") == 200) {
|
if (response == null || jo.getInteger("status") == 200) {
|
||||||
LuceneLogDto logDto2 = LuceneLogDto.builder()
|
LuceneLogDto logDto2 = LuceneLogDto.builder()
|
||||||
.device_code(device_code)
|
.device_code(device_code)
|
||||||
.content("木箱入库申请入库任务,参数,接口返回:" + jo)
|
.content("木箱、子卷入库申请入库任务,参数,接口返回:" + jo)
|
||||||
.build();
|
.build();
|
||||||
luceneExecuteLogService.deviceExecuteLog(logDto2);
|
luceneExecuteLogService.deviceExecuteLog(logDto2);
|
||||||
List list1 = new ArrayList();
|
List list1 = new ArrayList();
|
||||||
@@ -411,7 +466,7 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv
|
|||||||
}else {
|
}else {
|
||||||
LuceneLogDto logDto2 = LuceneLogDto.builder()
|
LuceneLogDto logDto2 = LuceneLogDto.builder()
|
||||||
.device_code(device_code)
|
.device_code(device_code)
|
||||||
.content("木箱入库申请入库任务,返回参数:" + jo.getString("body"))
|
.content("木箱、子卷入库申请入库任务,返回参数:" + jo.getString("body"))
|
||||||
.build();
|
.build();
|
||||||
luceneExecuteLogService.deviceExecuteLog(logDto2);
|
luceneExecuteLogService.deviceExecuteLog(logDto2);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -242,7 +242,7 @@ public class BoxStorageManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
|
|||||||
}
|
}
|
||||||
|
|
||||||
//任务完成
|
//任务完成
|
||||||
if (action == 5 && move == 0) {
|
if (action == 4 && move == 0) {
|
||||||
if (inst != null) {
|
if (inst != null) {
|
||||||
try {
|
try {
|
||||||
logServer.deviceExecuteLog(this.device_code, "", "", "放货完成");
|
logServer.deviceExecuteLog(this.device_code, "", "", "放货完成");
|
||||||
|
|||||||
@@ -808,6 +808,7 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
if (ObjectUtil.isNotEmpty(instructionErro)&&InstructionStatusEnum.BUSY.getIndex().equals(instructionErro.getInstruction_status())&& StrUtil.isNotEmpty(instructionErro.getExecute_code())){
|
if (ObjectUtil.isNotEmpty(instructionErro)&&InstructionStatusEnum.BUSY.getIndex().equals(instructionErro.getInstruction_status())&& StrUtil.isNotEmpty(instructionErro.getExecute_code())){
|
||||||
List list = new ArrayList();
|
List list = new ArrayList();
|
||||||
pakagePLCData(list, String.valueOf(z),String.valueOf(x),String.valueOf(y),instructionErro.getExecute_code(),task);
|
pakagePLCData(list, String.valueOf(z),String.valueOf(x),String.valueOf(y),instructionErro.getExecute_code(),task);
|
||||||
|
requireSucess = true;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -56,6 +56,8 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@@ -507,6 +509,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
|||||||
LampThreecolorDeviceDriver lampThreecolorDeviceDriver;
|
LampThreecolorDeviceDriver lampThreecolorDeviceDriver;
|
||||||
SiemensConveyorDeviceDriver siemensConveyorDeviceDriver;
|
SiemensConveyorDeviceDriver siemensConveyorDeviceDriver;
|
||||||
WasteFoilWeighingStationDriver wasteFoilWeighingStationDriver;
|
WasteFoilWeighingStationDriver wasteFoilWeighingStationDriver;
|
||||||
|
FoldDiscSiteDeviceDriver foldDiscSiteDeviceDriver;
|
||||||
if (device.getDeviceDriver() instanceof HongXiangStationDeviceDriver) {
|
if (device.getDeviceDriver() instanceof HongXiangStationDeviceDriver) {
|
||||||
hongXiangStationDeviceDriver = (HongXiangStationDeviceDriver) device.getDeviceDriver();
|
hongXiangStationDeviceDriver = (HongXiangStationDeviceDriver) device.getDeviceDriver();
|
||||||
hongXiangStationDeviceDriver.writing(code, value);
|
hongXiangStationDeviceDriver.writing(code, value);
|
||||||
@@ -523,6 +526,15 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
|||||||
inflatableShaftLibraryDeviceDriver = (InflatableShaftLibraryDeviceDriver) device.getDeviceDriver();
|
inflatableShaftLibraryDeviceDriver = (InflatableShaftLibraryDeviceDriver) device.getDeviceDriver();
|
||||||
inflatableShaftLibraryDeviceDriver.writing(code, value);
|
inflatableShaftLibraryDeviceDriver.writing(code, value);
|
||||||
}
|
}
|
||||||
|
if (device.getDeviceDriver() instanceof FoldDiscSiteDeviceDriver) {
|
||||||
|
foldDiscSiteDeviceDriver = (FoldDiscSiteDeviceDriver) device.getDeviceDriver();
|
||||||
|
List list = new ArrayList();
|
||||||
|
Map map = new HashMap();
|
||||||
|
map.put("code",code);
|
||||||
|
map.put("value",value);
|
||||||
|
list.add(map);
|
||||||
|
foldDiscSiteDeviceDriver.writing(list);
|
||||||
|
}
|
||||||
if (device.getDeviceDriver() instanceof WasteFoilWeighingStationDriver) {
|
if (device.getDeviceDriver() instanceof WasteFoilWeighingStationDriver) {
|
||||||
wasteFoilWeighingStationDriver = (WasteFoilWeighingStationDriver) device.getDeviceDriver();
|
wasteFoilWeighingStationDriver = (WasteFoilWeighingStationDriver) device.getDeviceDriver();
|
||||||
wasteFoilWeighingStationDriver.writing(code, value);
|
wasteFoilWeighingStationDriver.writing(code, value);
|
||||||
|
|||||||
Reference in New Issue
Block a user