This commit is contained in:
USER-20220102CG\noblelift
2023-01-29 13:14:54 +08:00
parent 69cfb2fb87
commit c24f63f694
5 changed files with 48 additions and 108 deletions

View File

@@ -771,7 +771,7 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
list.add(map5);
this.writing(list);
this.writing(list);
message ="申请贴标成功";
message ="申请捆扎成功";
requireApplyLaStrangulationSuccess = true;
} else {
message = "未返回尺寸信息";

View File

@@ -142,16 +142,19 @@ public class SiemensConveyorLabelingDeviceDriver extends AbstractOpcDeviceDriver
task = this.itemProtocol.getTask();
weight = this.itemProtocol.getWeight();
if (mode != last_mode) {
requireSucess = false;
requireApplyLabelingSuccess = false;
requireApplyLaStrangulationSuccess =false;
requireEmptyInSuccess =false;
requireEmptyOutSuccess =false;
if( mode == 2){
requireSucess = false;
requireApplyLabelingSuccess = false;
requireApplyLaStrangulationSuccess =false;
requireEmptyInSuccess =false;
requireEmptyOutSuccess =false;
logServer.deviceExecuteLog(this.device_code, "", "", "信号mode" + last_mode + "->" + mode +"复位请求标记");
}
logServer.deviceItemValue(this.device_code, "mode", String.valueOf(mode));
logServer.deviceExecuteLog(this.device_code, "", "", "信号mode" + last_mode + "->" + mode);
}
if (move != last_move) {
if(move == 0 ){
if(move == 0 && mode == 2 ){
this.clearWrite();
}
logServer.deviceItemValue(this.device_code, "move", String.valueOf(move));

View File

@@ -236,11 +236,13 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe
case 2:
//申请任务
String newBarcode = null;
if(plcbarcode_length != 0){
newBarcode = plcbarcode;
if(!StrUtil.isEmpty(barcode())){
newBarcode = barcode();
} else {
if(!StrUtil.isEmpty(barcode())){
newBarcode = barcode();
//
if(plcbarcode_length>2){
newBarcode = plcbarcode;
} else {
break;
}
@@ -614,6 +616,17 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe
JSONObject jo = JSON.parseObject(str);
if (ObjectUtil.isEmpty(jo)) {
message = "接口不通";
List list = new ArrayList();
Map map = new HashMap();
map.put("code","to_target");
map.put("value","1011");
list.add(map);
Map map2 = new HashMap();
map2.put("code","to_command");
map2.put("value","1");
list.add(map2);
this.writing(list);
message = "申请任务失败接口不通下发退回";
} else {
if (jo.getInteger("status") == 200) {
message = "申请任务成功";
@@ -622,6 +635,18 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe
} else {
requireSucess = false;
message = jo.get("message").toString();
List list = new ArrayList();
Map map = new HashMap();
map.put("code","to_target");
map.put("value","1011");
list.add(map);
Map map2 = new HashMap();
map2.put("code","to_command");
map2.put("value","1");
list.add(map2);
this.writing(list);
message = "申请任务失败下发退回,"+message;
}
}
// requireSucess = true;

View File

@@ -63,7 +63,7 @@ public class LiKuToAcsServiceImpl implements LiKuToAcsService {
String status = requestParam.getState();
Instruction inst = instructionService.findByCodeFromCache(inst_code);
TaskDto task = taskService.findByCodeFromCache(inst.getTask_code());
// 1 已接收 2 开始执行 3执行完成 4 阻挡 5 空洞
// 1 已接收 2 开始执行 3执行完成 4 5 取消
if(StrUtil.equals(status,"1") || StrUtil.equals(status,"2") ){
task.setTask_status("1");
taskService.update(task);
@@ -73,47 +73,11 @@ public class LiKuToAcsServiceImpl implements LiKuToAcsService {
inst.setInstruction_status("2");
instructionService.finish(inst.getInstruction_id());
} else if(StrUtil.equals(status,"4")) {
UpdateLKTaskRequest updateLKTaskRequest = new UpdateLKTaskRequest();
updateLKTaskRequest.setVehicle_code(inst.getVehicle_code());
updateLKTaskRequest.setExt_task_id(task.getExt_task_id());
updateLKTaskRequest.setDtl_type(task.getStorage_task_type());
updateLKTaskRequest.setSrcLocation(inst.getNext_point_code());
updateLKTaskRequest.setType("1");
//调用LMS接口申请获取新库位
UpdateLKTaskResponse updateLKTaskResponse = acsToWmsService.updateLKTaskRequest(updateLKTaskRequest);
if(updateLKTaskResponse.getstatus() == 200){
String srcLocation = updateLKTaskResponse.getParameters().get("srcLocation");
String destLocation = updateLKTaskResponse.getParameters().get("destLocation ");
InStoreResetRequest inStoreResetRequest = new InStoreResetRequest();
inStoreResetRequest.setFloorNo(Integer.parseInt(inst.getTo_z()));
inStoreResetRequest.setSrcLocation(srcLocation);
inStoreResetRequest.setDestLocation(destLocation);
inStoreResetRequest.setPalletCode(inst.getVehicle_code());
inStoreResetRequest.setOrderId(inst.getInstruction_code());
acsToLiKuService.inStoreReset(inStoreResetRequest);
}
// 5 取消指令
} else if(StrUtil.equals(status,"5")) {
UpdateLKTaskRequest updateLKTaskRequest = new UpdateLKTaskRequest();
updateLKTaskRequest.setVehicle_code(inst.getVehicle_code());
updateLKTaskRequest.setExt_task_id(task.getExt_task_id());
updateLKTaskRequest.setDtl_type(task.getStorage_task_type());
updateLKTaskRequest.setSrcLocation(inst.getNext_point_code());
updateLKTaskRequest.setType("2");
//调用LMS接口申请获取新库位
UpdateLKTaskResponse updateLKTaskResponse = acsToWmsService.updateLKTaskRequest(updateLKTaskRequest);
if(updateLKTaskResponse.getstatus() == 200){
String srcLocation = updateLKTaskResponse.getParameters().get("srcLocation");
String destLocation = updateLKTaskResponse.getParameters().get("destLocation ");
InStoreResetRequest inStoreResetRequest = new InStoreResetRequest();
inStoreResetRequest.setFloorNo(Integer.parseInt(inst.getTo_z()));
inStoreResetRequest.setSrcLocation(srcLocation);
inStoreResetRequest.setDestLocation(destLocation);
inStoreResetRequest.setPalletCode(inst.getVehicle_code());
inStoreResetRequest.setOrderId(inst.getInstruction_code());
acsToLiKuService.inStoreReset(inStoreResetRequest);
}
instructionService.cancel(inst.getInstruction_id());
}
InStoreReportResponse inStoreReportResponse = new InStoreReportResponse();
inStoreReportResponse.setOrderId(inst_code);
@@ -150,25 +114,11 @@ public class LiKuToAcsServiceImpl implements LiKuToAcsService {
} else if(StrUtil.equals(status,"3")){
inst.setInstruction_status("2");
instructionService.finish(inst.getInstruction_id());
//出库任务起点无货
} else if(StrUtil.equals(status,"4")){
UpdateLKTaskRequest updateLKTaskRequest = new UpdateLKTaskRequest();
updateLKTaskRequest.setVehicle_code(inst.getVehicle_code());
updateLKTaskRequest.setExt_task_id(task.getExt_task_id());
updateLKTaskRequest.setDtl_type(task.getStorage_task_type());
updateLKTaskRequest.setSrcLocation(inst.getStart_point_code());
updateLKTaskRequest.setType("5");
//调用LMS接口
UpdateLKTaskResponse updateLKTaskResponse = acsToWmsService.updateLKTaskRequest(updateLKTaskRequest);
} else if(StrUtil.equals(status,"4")){
//5 取消指令
} else if(StrUtil.equals(status,"5")){
UpdateLKTaskRequest updateLKTaskRequest = new UpdateLKTaskRequest();
updateLKTaskRequest.setVehicle_code(inst.getVehicle_code());
updateLKTaskRequest.setExt_task_id(task.getExt_task_id());
updateLKTaskRequest.setDtl_type(task.getStorage_task_type());
updateLKTaskRequest.setSrcLocation(inst.getStart_point_code());
updateLKTaskRequest.setType("6");
UpdateLKTaskResponse updateLKTaskResponse = acsToWmsService.updateLKTaskRequest(updateLKTaskRequest);
instructionService.cancel(inst.getInstruction_id());
}
OutStoreReportResponse outStoreReportResponse = new OutStoreReportResponse();
@@ -211,49 +161,10 @@ public class LiKuToAcsServiceImpl implements LiKuToAcsService {
inst.setInstruction_status("2");
instructionService.finish(inst.getInstruction_id());
} else if(StrUtil.equals(status,"4")){
UpdateLKTaskRequest updateLKTaskRequest = new UpdateLKTaskRequest();
updateLKTaskRequest.setVehicle_code(inst.getVehicle_code());
updateLKTaskRequest.setExt_task_id(task.getExt_task_id());
updateLKTaskRequest.setDtl_type(task.getStorage_task_type());
updateLKTaskRequest.setSrcLocation(inst.getStart_point_code());
updateLKTaskRequest.setType("3");
//调用LMS接口
UpdateLKTaskResponse updateLKTaskResponse = acsToWmsService.updateLKTaskRequest(updateLKTaskRequest);
if(updateLKTaskResponse.getstatus() == 200){
String srcLocation = updateLKTaskResponse.getParameters().get("srcLocation");
String destLocation = updateLKTaskResponse.getParameters().get("destLocation ");
InStoreResetRequest inStoreResetRequest = new InStoreResetRequest();
inStoreResetRequest.setFloorNo(Integer.parseInt(inst.getTo_z()));
inStoreResetRequest.setSrcLocation(srcLocation);
inStoreResetRequest.setDestLocation(destLocation);
inStoreResetRequest.setPalletCode(inst.getVehicle_code());
inStoreResetRequest.setOrderId(inst.getInstruction_code());
acsToLiKuService.inStoreReset(inStoreResetRequest);
}
} else if(StrUtil.equals(status,"5")){
UpdateLKTaskRequest updateLKTaskRequest = new UpdateLKTaskRequest();
updateLKTaskRequest.setVehicle_code(inst.getVehicle_code());
updateLKTaskRequest.setExt_task_id(task.getExt_task_id());
updateLKTaskRequest.setDtl_type(task.getStorage_task_type());
updateLKTaskRequest.setSrcLocation(inst.getNext_point_code());
updateLKTaskRequest.setType("4");
UpdateLKTaskResponse updateLKTaskResponse = acsToWmsService.updateLKTaskRequest(updateLKTaskRequest);
if(updateLKTaskResponse.getstatus() == 200){
String srcLocation = updateLKTaskResponse.getParameters().get("srcLocation");
String destLocation = updateLKTaskResponse.getParameters().get("destLocation ");
InStoreResetRequest inStoreResetRequest = new InStoreResetRequest();
inStoreResetRequest.setFloorNo(Integer.parseInt(inst.getTo_z()));
inStoreResetRequest.setSrcLocation(srcLocation);
inStoreResetRequest.setDestLocation(destLocation);
inStoreResetRequest.setPalletCode(inst.getVehicle_code());
inStoreResetRequest.setOrderId(inst.getInstruction_code());
acsToLiKuService.inStoreReset(inStoreResetRequest);
}
instructionService.cancel(inst.getInstruction_id());
}
MoveStoreReportResponse moveStoreReportResponse = new MoveStoreReportResponse();
moveStoreReportResponse.setOrderId(inst_code);

View File

@@ -52,6 +52,7 @@ public class OpcUtl {
// throw new BusinessException(message.toString());
System.out.println("下发信号失败:"+message.toString());
log.info("下发信号失败:"+message.toString());
group.write(requests);
}
} catch (JIException arg7) {
// throw new BusinessException(arg7);