rev 缓存线反馈
This commit is contained in:
@@ -477,7 +477,7 @@ public class HailiangAutoCacheLineDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
} else if (agvphase == 0x0C || agvphase == 0x23) {
|
||||
//agv送满框1完毕或送满框2完毕
|
||||
//需要判断缓存线工作模式联机,对接位有货,任务号不为0,对接位条码正常才反馈agv以及电气放货完成
|
||||
if (mode == 1 && in_finish == 1 && task != 0 && docking_barcode != 0 && error != 35 && ObjectUtil.isNotEmpty(inst) && Integer.parseInt(inst.getInstruction_code()) == task) {
|
||||
if (mode == 1 && task != 0 && docking_barcode != 0 && error != 34 && ObjectUtil.isNotEmpty(inst) && Integer.parseInt(inst.getInstruction_code()) == task) {
|
||||
if (inst != null) {
|
||||
TaskDto taskDto = taskserver.findByCodeFromCache(inst.getTask_code());
|
||||
if (taskDto != null) {
|
||||
@@ -504,9 +504,9 @@ public class HailiangAutoCacheLineDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
if (prepare_ready != 1) {
|
||||
noFeedMessage += "准备位未就绪,";
|
||||
}
|
||||
if (in_ready != 1) {
|
||||
noFeedMessage += "对接位入箱未就绪,";
|
||||
}
|
||||
// if (in_ready != 1) {
|
||||
// noFeedMessage += "对接位入箱未就绪,";
|
||||
// }
|
||||
if (error == 35) {
|
||||
noFeedMessage += "准备位条码异常,";
|
||||
}
|
||||
@@ -672,7 +672,7 @@ public class HailiangAutoCacheLineDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
}
|
||||
} else if (agvphase == 0x15 || agvphase == 0x19) {
|
||||
//缓存线出满框送回空框完毕
|
||||
if (mode == 1 && in_finish == 1 && ObjectUtil.isNotEmpty(inst)) {
|
||||
if (mode == 1 && docking_barcode > 0 && error != 34 && ObjectUtil.isNotEmpty(inst)) {
|
||||
this.writing("to_agv_put_finish", "1");
|
||||
inst.setExecute_status(InstActionEnum.EXECUTE_PUT_EMPTY_FINISH.getCode());
|
||||
instructionService.update(inst);
|
||||
@@ -687,9 +687,9 @@ public class HailiangAutoCacheLineDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
this.set(0, 0, null);
|
||||
} else {
|
||||
String noFeedMessage = this.noFeedMessage();
|
||||
if (in_finish != 1) {
|
||||
noFeedMessage += "电气未上报对接位入箱完成,";
|
||||
}
|
||||
// if (in_finish != 1) {
|
||||
// noFeedMessage += "电气未上报对接位入箱完成,";
|
||||
// }
|
||||
this.noFeedAgvMessage = this.replace(noFeedMessage);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,10 +36,10 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
|
||||
@Override
|
||||
public HttpResponse applyTaskToWms(JSONObject param) {
|
||||
log.info("acs开始向mes请求任务,请求参数:{}", JSON.toJSONString(param));
|
||||
try {
|
||||
MDC.put(log_file_type, log_type);
|
||||
if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) {
|
||||
log.info("acs开始向mes请求任务,请求参数:{}", JSON.toJSONString(param));
|
||||
String wmsurl = paramService.findByCode(AcsConfig.WMSURL).getValue();
|
||||
AddressDto addressDto = addressService.findByCode("applyTaskToWms");
|
||||
String url = wmsurl + addressDto.getMethods_url();
|
||||
@@ -203,10 +203,10 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
|
||||
@Override
|
||||
public HttpResponse applyScannerTask(JSONObject map) {
|
||||
log.info("acs开始向mes申请扫码器任务,请求参数:{}", JSON.toJSONString(map));
|
||||
try {
|
||||
MDC.put(log_file_type, log_type);
|
||||
if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) {
|
||||
log.info("acs开始向mes申请扫码器任务,请求参数:{}", JSON.toJSONString(map));
|
||||
String wmsUrl = paramService.findByCode(AcsConfig.WMSURL).getValue();
|
||||
AddressDto addressDto = addressService.findByCode("applyScannerTask");
|
||||
String methods_url = addressDto.getMethods_url();
|
||||
@@ -230,10 +230,10 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
|
||||
@Override
|
||||
public HttpResponse feedCacheLineBarcodes(JSONObject map) {
|
||||
log.info("acs开始向mes反馈缓存线条码,请求参数:{}", JSON.toJSONString(map));
|
||||
try {
|
||||
MDC.put(log_file_type, log_type);
|
||||
if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) {
|
||||
log.info("acs开始向mes反馈缓存线条码,请求参数:{}", JSON.toJSONString(map));
|
||||
String wmsUrl = paramService.findByCode(AcsConfig.WMSURL).getValue();
|
||||
AddressDto addressDto = addressService.findByCode("feedCacheLineBarcodes");
|
||||
String methods_url = addressDto.getMethods_url();
|
||||
@@ -257,10 +257,10 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
|
||||
@Override
|
||||
public HttpResponse feedCacheLineTask(JSONObject param) {
|
||||
log.info("acs开始向mes反馈缓存线任务号,请求参数:{}", JSON.toJSONString(param));
|
||||
try {
|
||||
MDC.put(log_file_type, log_type);
|
||||
if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) {
|
||||
log.info("acs开始向mes反馈缓存线任务号,请求参数:{}", JSON.toJSONString(param));
|
||||
String wmsUrl = paramService.findByCode(AcsConfig.WMSURL).getValue();
|
||||
AddressDto addressDto = addressService.findByCode("feedCacheLineTask");
|
||||
String methods_url = addressDto.getMethods_url();
|
||||
|
||||
@@ -710,7 +710,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
||||
hailiangAutoCacheLineDeviceDriver.writing(code, value);
|
||||
if (code.equals("to_start_checking")) {
|
||||
hailiangAutoCacheLineDeviceDriver.writing("to_task", "1001");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
JSONObject resultJson = new JSONObject();
|
||||
|
||||
@@ -349,5 +349,5 @@ public interface InstructionService {
|
||||
*/
|
||||
void removeCacheLinePhase(Instruction dto);
|
||||
|
||||
Instruction findInstByPutDeviceCode(String put_device_code);
|
||||
Instruction findInstByDeviceCode(String device_code);
|
||||
}
|
||||
|
||||
@@ -1333,8 +1333,8 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
|
||||
if (putDevice != null) {
|
||||
if (startDevice.getDeviceDriver() instanceof HailiangAutoCacheLineDeviceDriver) {
|
||||
hailiangAutoCacheLineDeviceDriver = (HailiangAutoCacheLineDeviceDriver) startDevice.getDeviceDriver();
|
||||
if (hailiangAutoCacheLineDeviceDriver.getItemProtocol().getOpcIntegerValue("task") != 0) {
|
||||
throw new BadRequestException("缓存线已存在任务,稍后下发!");
|
||||
if (hailiangAutoCacheLineDeviceDriver.getItemProtocol().getOpcIntegerValue("task") != 0 || !hailiangAutoCacheLineDeviceDriver.getIsonline()) {
|
||||
throw new BadRequestException("缓存线已存在任务或设备不在线,稍后下发!");
|
||||
} else if (hailiangAutoCacheLineDeviceDriver.getItemProtocol().getOpcIntegerValue("task") == 0) {
|
||||
//下发电气单出
|
||||
to_task_type = "4";
|
||||
@@ -1348,8 +1348,8 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
|
||||
}
|
||||
if (putDevice.getDeviceDriver() instanceof HailiangAutoCacheLineDeviceDriver) {
|
||||
hailiangAutoCacheLineDeviceDriver = (HailiangAutoCacheLineDeviceDriver) putDevice.getDeviceDriver();
|
||||
if (hailiangAutoCacheLineDeviceDriver.getItemProtocol().getOpcIntegerValue("task") != 0) {
|
||||
throw new BadRequestException("缓存线已存在任务,稍后下发!");
|
||||
if (hailiangAutoCacheLineDeviceDriver.getItemProtocol().getOpcIntegerValue("task") != 0 || !hailiangAutoCacheLineDeviceDriver.getIsonline()) {
|
||||
throw new BadRequestException("缓存线已存在任务或设备不在线,稍后下发!");
|
||||
} else if (tasksByLinNum.size() == 1 && hailiangAutoCacheLineDeviceDriver.getItemProtocol().getOpcIntegerValue("task") == 0) {
|
||||
//下发电气单入
|
||||
to_task_type = "2";
|
||||
@@ -1450,12 +1450,12 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
|
||||
}
|
||||
|
||||
@Override
|
||||
public Instruction findInstByPutDeviceCode(String put_device_code) {
|
||||
public Instruction findInstByDeviceCode(String device_code) {
|
||||
return Optional
|
||||
.ofNullable(this.instructions)
|
||||
.orElse(new CopyOnWriteArrayList<>())
|
||||
.stream()
|
||||
.filter(i -> i.getPut_device_code().equals(put_device_code))
|
||||
.filter(i -> i.getPut_device_code().equals(device_code) || i.getStart_device_code().equals(device_code) || i.getNext_device_code().equals(device_code))
|
||||
.findFirst()
|
||||
.orElse(null);
|
||||
}
|
||||
|
||||
@@ -94,7 +94,7 @@ public class AutoCreateInst {
|
||||
Device device = deviceAppService.findDeviceByCode(put_device_code);
|
||||
if (device != null && device.getDeviceDriver() instanceof HailiangAutoCacheLineDeviceDriver) {
|
||||
hailiangAutoCacheLineDeviceDriver = (HailiangAutoCacheLineDeviceDriver) device.getDeviceDriver();
|
||||
if (hailiangAutoCacheLineDeviceDriver.getTask() != 0) {
|
||||
if (hailiangAutoCacheLineDeviceDriver.getTask() != 0 || instructionService.findInstByDeviceCode(put_device_code) != null) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@@ -105,7 +105,7 @@ public class AutoCreateInst {
|
||||
Device device = deviceAppService.findDeviceByCode(start_device_code);
|
||||
if (device != null && device.getDeviceDriver() instanceof HailiangAutoCacheLineDeviceDriver) {
|
||||
hailiangAutoCacheLineDeviceDriver = (HailiangAutoCacheLineDeviceDriver) device.getDeviceDriver();
|
||||
if (hailiangAutoCacheLineDeviceDriver.getTask() != 0) {
|
||||
if (hailiangAutoCacheLineDeviceDriver.getTask() != 0 || instructionService.findInstByDeviceCode(start_device_code) != null) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@@ -143,7 +143,7 @@ public class AutoCreateInst {
|
||||
Device device = deviceAppService.findDeviceByCode(taskDto1.getPut_device_code());
|
||||
if (device != null && device.getDeviceDriver() instanceof HailiangAutoCacheLineDeviceDriver) {
|
||||
hailiangAutoCacheLineDeviceDriver = (HailiangAutoCacheLineDeviceDriver) device.getDeviceDriver();
|
||||
if (hailiangAutoCacheLineDeviceDriver.getTask() != 0) {
|
||||
if (hailiangAutoCacheLineDeviceDriver.getTask() != 0 || instructionService.findInstByDeviceCode(taskDto1.getPut_device_code()) != null) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user