This commit is contained in:
USER-20220102CG\noblelift
2022-08-17 14:07:01 +08:00
parent a177e3bc21
commit 785bc93613
4 changed files with 67 additions and 8 deletions

View File

@@ -64,15 +64,21 @@ public interface OpcDeviceDriver extends DeviceDriver {
}
default Float getFloatValue(String protocol) {
return (Float) this.getOpcValueAccessor().getValue(this.getItem(protocol));
RedisUtils redisUtils = SpringContextHolder.getBean(RedisUtils.class);
return (Float)redisUtils.get(this.getItem(protocol));
// return (Float) this.getOpcValueAccessor().getValue(this.getItem(protocol));
}
default int[] getIntegeregerArrayValue(String protocol) {
return (int[]) this.getOpcValueAccessor().getValue(this.getItem(protocol));
// return (int[]) this.getOpcValueAccessor().getValue(this.getItem(protocol));
RedisUtils redisUtils = SpringContextHolder.getBean(RedisUtils.class);
return (int[])redisUtils.get(this.getItem(protocol));
}
default String getStringValue(String protocol) {
return (String) this.getOpcValueAccessor().getValue(this.getItem(protocol));
// return (String) this.getOpcValueAccessor().getValue(this.getItem(protocol));
RedisUtils redisUtils = SpringContextHolder.getBean(RedisUtils.class);
return (String)redisUtils.get(this.getItem(protocol));
}
default Object getValue(String protocol) {

View File

@@ -152,7 +152,7 @@ public class ItemProtocol {
} else {
return value;
}
return "0";
return "";
}
public static List<ItemDto> getReadableItemDtos() {

View File

@@ -767,7 +767,7 @@ public class ItemProtocol {
} else {
return value;
}
return "0";
return "";
}
public static List<ItemDto> getReadableItemDtos() {

View File

@@ -689,12 +689,14 @@ public class RljnPackagePalletSplitManipulatorDeviceDriver extends AbstractOpcDe
case 6:
//码垛完成
if (!requireSucess) {
applyEmpty();
palletizing();
}
break;
case 7:
//码垛强制完成
//码垛强制完成 半托缓存
if (!requireSucess) {
applyEmpty();
mandatoryPalletizing();
}
break;
@@ -716,6 +718,19 @@ public class RljnPackagePalletSplitManipulatorDeviceDriver extends AbstractOpcDe
enterProduction(json);
}
break;
case 10:
//叫料
if (!requireSucess && getStation>0 && StrUtil.isNotEmpty(material)) {
callMaterial();
}
break;
case 11:
//强制去包装
if (!requireSucess) {
applyEmpty();
mandatoryPalletizing();
}
break;
}
switch (flag) {
@@ -819,6 +834,43 @@ public class RljnPackagePalletSplitManipulatorDeviceDriver extends AbstractOpcDe
}
}
/**
* 叫料
*
* @param
*/
public synchronized boolean callMaterial() {
Date date = new Date();
if (date.getTime() - this.instruction_require_time.getTime() < (long) this.instruction_require_time_out) {
log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out);
return false;
} else {
this.instruction_require_time = date;
JSONObject json = new JSONObject();
String linkobj = (String)this.getDevice().getExtraValue().get("link_device_code");
String demosub = linkobj.substring(1,linkobj.length()-1);
String demoArray[] = demosub.split(",");
List<String> demoList = Arrays.asList(demoArray);
json.put("device_code",demoList.get(getStation-1).replace("\"",""));
json.put("type","2");
json.put("material_code",material);
json.put("vehicle_code",barcode);
json.put("is_full","1");
HttpResponse result = acsToWmsService.lnshApplyTaskToWms(json);
if (ObjectUtil.isNotEmpty(result)) {
JSONObject jsonObject = JSONObject.parseObject(result.body());
if (result.getStatus() == 200 && StrUtil.equals(jsonObject.getString("status"),"200")) {
this.writing(1);
}
this.setRequireSucess(true);
}
return true;
}
}
/**
* 排产单确认
*
@@ -1109,9 +1161,10 @@ public class RljnPackagePalletSplitManipulatorDeviceDriver extends AbstractOpcDe
String demosub = linkobj.substring(1,linkobj.length()-1);
String demoArray[] = demosub.split(",");
List<String> demoList = Arrays.asList(demoArray);
json.put("device_code",demoList.get(put_station-1).replace("\"","")); json.put("qty",qty);
json.put("device_code",demoList.get(put_station-1).replace("\"",""));
json.put("qty",qty);
json.put("vehicle_code",barcode);
json.put("is_full","0");
json.put("is_full","1");
json.put("product_code",product_code);
json.put("AlongSide",AlongSide);
json.put("BshortSide",BshortSide);