自测fix

This commit is contained in:
psh
2024-02-26 18:05:35 +08:00
parent ad55cf9f6a
commit 87e8219b96
4 changed files with 36 additions and 43 deletions

View File

@@ -77,8 +77,12 @@ public class SsxSiteDeviceDriver extends AbstractOpcDeviceDriver implements Devi
int io_action = 0;
int last_io_action = 0;
int tier = 0;
int last_tier = 0;
double weight = 0;
double last_weight = 0;
int material_type = 0;
int last_material_type =0;
int barcode = 0;
int last_barcode =0;
boolean hasVehicle = false;
@@ -142,33 +146,17 @@ public class SsxSiteDeviceDriver extends AbstractOpcDeviceDriver implements Devi
move = this.itemProtocol.getMove();
hasGoods = this.itemProtocol.getMove();
action = this.itemProtocol.getAction();
tier = this.itemProtocol.getTier();
weight = this.itemProtocol.getWeight();
material_type = this.itemProtocol.getMaterialType();
barcode = this.itemProtocol.getBarcode();
if (mode != last_mode) {
this.setRequireSucess(false);
if(mode==2){
this.writing(0);
}
}
if (move !=last_move||tier!=last_tier){
resultSucess=false;
}
if (tier != last_tier&&move!=0 && this.getDeviceCode().endsWith("0101")||this.getDeviceCode().endsWith("0201") &&!resultSucess) {
//高度数量变更后通知lms
FeedBackTaskStatusRequest request = new FeedBackTaskStatusRequest();
request.setState(String.valueOf(tier));
request.setDevice_code(this.getDeviceCode());
request.setType("2");
acsToWmsService.notify(request);
resultSucess=true;
}else if (move ==1 && this.getDeviceCode().startsWith("ZJBDJW") &&!resultSucess) {
//点位数量变更后通知lms
FeedBackTaskStatusRequest request = new FeedBackTaskStatusRequest();
request.setState("3");
request.setDevice_code(this.getDeviceCode());
request.setType("2");
acsToWmsService.notify(request);
resultSucess=true;
}
if (error != last_error) {
}
if (mode != last_mode) {
@@ -230,7 +218,9 @@ public class SsxSiteDeviceDriver extends AbstractOpcDeviceDriver implements Devi
last_error = error;
last_move = move;
last_task = task;
last_tier = tier;
last_weight = weight;
last_material_type = material_type;
last_barcode = barcode;
last_action = action;
}

View File

@@ -450,22 +450,22 @@ public class StandardInspectSiteDeviceDriver extends AbstractOpcDeviceDriver imp
request.setDevice_code(devicecode);
request.setMaterial_type(String.valueOf(material_type));
request.setVehicle_code(String.valueOf(barcode));
if (devicecode.startsWith("TBX")&&type==5&&barcode>0) {
//满架下料
request.setRequest_medthod_code(RequestMethodEnum.apply_mjxl.getCode());
request.setRequest_medthod_name(RequestMethodEnum.apply_mjxl.getName());
}else if (devicecode.startsWith("TBX")&&type==6) {
//补空架
request.setRequest_medthod_code(RequestMethodEnum.apply_tbxbkj.getCode());
request.setRequest_medthod_name(RequestMethodEnum.apply_tbxbkj.getName());
}else if (type==7) {
//空托盘出库,包片机和销售出库空位都可以
request.setRequest_medthod_code(RequestMethodEnum.apply_kghjrk.getCode());
request.setRequest_medthod_name(RequestMethodEnum.apply_kghjrk.getName());
}else if(devicecode.startsWith("BP")&&material_type>0){
request.setRequest_medthod_code(RequestMethodEnum.apply_bpsl.getCode());
request.setRequest_medthod_name(RequestMethodEnum.apply_bpsl.getName());
}
// if (devicecode.startsWith("TBX")&&type==5&&barcode>0) {
// //满架下料
// request.setRequest_medthod_code(RequestMethodEnum.apply_mjxl.getCode());
// request.setRequest_medthod_name(RequestMethodEnum.apply_mjxl.getName());
// }else if (devicecode.startsWith("TBX")&&type==6) {
// //补空架
// request.setRequest_medthod_code(RequestMethodEnum.apply_tbxbkj.getCode());
// request.setRequest_medthod_name(RequestMethodEnum.apply_tbxbkj.getName());
// }else if (type==7) {
// //空托盘出库,包片机和销售出库空位都可以
// request.setRequest_medthod_code(RequestMethodEnum.apply_kghjrk.getCode());
// request.setRequest_medthod_name(RequestMethodEnum.apply_kghjrk.getName());
// }else if(devicecode.startsWith("BP")&&material_type>0){
// request.setRequest_medthod_code(RequestMethodEnum.apply_bpsl.getCode());
// request.setRequest_medthod_name(RequestMethodEnum.apply_bpsl.getName());
// }
String resp = acsToWmsService.applyTask(request);
JSONObject res_jo = JSONObject.parseObject(resp);
if (StrUtil.equals(res_jo.getString("code"), "200")) {