rev 缓存线反馈

This commit is contained in:
2023-06-06 17:31:00 +08:00
parent 4d90435ce8
commit ce9e6e80a8
6 changed files with 23 additions and 23 deletions

View File

@@ -477,7 +477,7 @@ public class HailiangAutoCacheLineDeviceDriver extends AbstractOpcDeviceDriver i
} else if (agvphase == 0x0C || agvphase == 0x23) { } else if (agvphase == 0x0C || agvphase == 0x23) {
//agv送满框1完毕或送满框2完毕 //agv送满框1完毕或送满框2完毕
//需要判断缓存线工作模式联机对接位有货任务号不为0对接位条码正常才反馈agv以及电气放货完成 //需要判断缓存线工作模式联机对接位有货任务号不为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) { if (inst != null) {
TaskDto taskDto = taskserver.findByCodeFromCache(inst.getTask_code()); TaskDto taskDto = taskserver.findByCodeFromCache(inst.getTask_code());
if (taskDto != null) { if (taskDto != null) {
@@ -504,9 +504,9 @@ public class HailiangAutoCacheLineDeviceDriver extends AbstractOpcDeviceDriver i
if (prepare_ready != 1) { if (prepare_ready != 1) {
noFeedMessage += "准备位未就绪,"; noFeedMessage += "准备位未就绪,";
} }
if (in_ready != 1) { // if (in_ready != 1) {
noFeedMessage += "对接位入箱未就绪,"; // noFeedMessage += "对接位入箱未就绪,";
} // }
if (error == 35) { if (error == 35) {
noFeedMessage += "准备位条码异常,"; noFeedMessage += "准备位条码异常,";
} }
@@ -672,7 +672,7 @@ public class HailiangAutoCacheLineDeviceDriver extends AbstractOpcDeviceDriver i
} }
} else if (agvphase == 0x15 || agvphase == 0x19) { } 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"); this.writing("to_agv_put_finish", "1");
inst.setExecute_status(InstActionEnum.EXECUTE_PUT_EMPTY_FINISH.getCode()); inst.setExecute_status(InstActionEnum.EXECUTE_PUT_EMPTY_FINISH.getCode());
instructionService.update(inst); instructionService.update(inst);
@@ -687,9 +687,9 @@ public class HailiangAutoCacheLineDeviceDriver extends AbstractOpcDeviceDriver i
this.set(0, 0, null); this.set(0, 0, null);
} else { } else {
String noFeedMessage = this.noFeedMessage(); String noFeedMessage = this.noFeedMessage();
if (in_finish != 1) { // if (in_finish != 1) {
noFeedMessage += "电气未上报对接位入箱完成,"; // noFeedMessage += "电气未上报对接位入箱完成,";
} // }
this.noFeedAgvMessage = this.replace(noFeedMessage); this.noFeedAgvMessage = this.replace(noFeedMessage);
} }
} }

View File

@@ -36,10 +36,10 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
@Override @Override
public HttpResponse applyTaskToWms(JSONObject param) { public HttpResponse applyTaskToWms(JSONObject param) {
log.info("acs开始向mes请求任务,请求参数:{}", JSON.toJSONString(param));
try { try {
MDC.put(log_file_type, log_type); MDC.put(log_file_type, log_type);
if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) { if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) {
log.info("acs开始向mes请求任务,请求参数:{}", JSON.toJSONString(param));
String wmsurl = paramService.findByCode(AcsConfig.WMSURL).getValue(); String wmsurl = paramService.findByCode(AcsConfig.WMSURL).getValue();
AddressDto addressDto = addressService.findByCode("applyTaskToWms"); AddressDto addressDto = addressService.findByCode("applyTaskToWms");
String url = wmsurl + addressDto.getMethods_url(); String url = wmsurl + addressDto.getMethods_url();
@@ -203,10 +203,10 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
@Override @Override
public HttpResponse applyScannerTask(JSONObject map) { public HttpResponse applyScannerTask(JSONObject map) {
log.info("acs开始向mes申请扫码器任务,请求参数:{}", JSON.toJSONString(map));
try { try {
MDC.put(log_file_type, log_type); MDC.put(log_file_type, log_type);
if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) { if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) {
log.info("acs开始向mes申请扫码器任务,请求参数:{}", JSON.toJSONString(map));
String wmsUrl = paramService.findByCode(AcsConfig.WMSURL).getValue(); String wmsUrl = paramService.findByCode(AcsConfig.WMSURL).getValue();
AddressDto addressDto = addressService.findByCode("applyScannerTask"); AddressDto addressDto = addressService.findByCode("applyScannerTask");
String methods_url = addressDto.getMethods_url(); String methods_url = addressDto.getMethods_url();
@@ -230,10 +230,10 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
@Override @Override
public HttpResponse feedCacheLineBarcodes(JSONObject map) { public HttpResponse feedCacheLineBarcodes(JSONObject map) {
log.info("acs开始向mes反馈缓存线条码,请求参数:{}", JSON.toJSONString(map));
try { try {
MDC.put(log_file_type, log_type); MDC.put(log_file_type, log_type);
if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) { if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) {
log.info("acs开始向mes反馈缓存线条码,请求参数:{}", JSON.toJSONString(map));
String wmsUrl = paramService.findByCode(AcsConfig.WMSURL).getValue(); String wmsUrl = paramService.findByCode(AcsConfig.WMSURL).getValue();
AddressDto addressDto = addressService.findByCode("feedCacheLineBarcodes"); AddressDto addressDto = addressService.findByCode("feedCacheLineBarcodes");
String methods_url = addressDto.getMethods_url(); String methods_url = addressDto.getMethods_url();
@@ -257,10 +257,10 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
@Override @Override
public HttpResponse feedCacheLineTask(JSONObject param) { public HttpResponse feedCacheLineTask(JSONObject param) {
log.info("acs开始向mes反馈缓存线任务号,请求参数:{}", JSON.toJSONString(param));
try { try {
MDC.put(log_file_type, log_type); MDC.put(log_file_type, log_type);
if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) { if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) {
log.info("acs开始向mes反馈缓存线任务号,请求参数:{}", JSON.toJSONString(param));
String wmsUrl = paramService.findByCode(AcsConfig.WMSURL).getValue(); String wmsUrl = paramService.findByCode(AcsConfig.WMSURL).getValue();
AddressDto addressDto = addressService.findByCode("feedCacheLineTask"); AddressDto addressDto = addressService.findByCode("feedCacheLineTask");
String methods_url = addressDto.getMethods_url(); String methods_url = addressDto.getMethods_url();

View File

@@ -349,5 +349,5 @@ public interface InstructionService {
*/ */
void removeCacheLinePhase(Instruction dto); void removeCacheLinePhase(Instruction dto);
Instruction findInstByPutDeviceCode(String put_device_code); Instruction findInstByDeviceCode(String device_code);
} }

View File

@@ -1333,8 +1333,8 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
if (putDevice != null) { if (putDevice != null) {
if (startDevice.getDeviceDriver() instanceof HailiangAutoCacheLineDeviceDriver) { if (startDevice.getDeviceDriver() instanceof HailiangAutoCacheLineDeviceDriver) {
hailiangAutoCacheLineDeviceDriver = (HailiangAutoCacheLineDeviceDriver) startDevice.getDeviceDriver(); hailiangAutoCacheLineDeviceDriver = (HailiangAutoCacheLineDeviceDriver) startDevice.getDeviceDriver();
if (hailiangAutoCacheLineDeviceDriver.getItemProtocol().getOpcIntegerValue("task") != 0) { if (hailiangAutoCacheLineDeviceDriver.getItemProtocol().getOpcIntegerValue("task") != 0 || !hailiangAutoCacheLineDeviceDriver.getIsonline()) {
throw new BadRequestException("缓存线已存在任务,稍后下发!"); throw new BadRequestException("缓存线已存在任务或设备不在线,稍后下发!");
} else if (hailiangAutoCacheLineDeviceDriver.getItemProtocol().getOpcIntegerValue("task") == 0) { } else if (hailiangAutoCacheLineDeviceDriver.getItemProtocol().getOpcIntegerValue("task") == 0) {
//下发电气单出 //下发电气单出
to_task_type = "4"; to_task_type = "4";
@@ -1348,8 +1348,8 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
} }
if (putDevice.getDeviceDriver() instanceof HailiangAutoCacheLineDeviceDriver) { if (putDevice.getDeviceDriver() instanceof HailiangAutoCacheLineDeviceDriver) {
hailiangAutoCacheLineDeviceDriver = (HailiangAutoCacheLineDeviceDriver) putDevice.getDeviceDriver(); hailiangAutoCacheLineDeviceDriver = (HailiangAutoCacheLineDeviceDriver) putDevice.getDeviceDriver();
if (hailiangAutoCacheLineDeviceDriver.getItemProtocol().getOpcIntegerValue("task") != 0) { if (hailiangAutoCacheLineDeviceDriver.getItemProtocol().getOpcIntegerValue("task") != 0 || !hailiangAutoCacheLineDeviceDriver.getIsonline()) {
throw new BadRequestException("缓存线已存在任务,稍后下发!"); throw new BadRequestException("缓存线已存在任务或设备不在线,稍后下发!");
} else if (tasksByLinNum.size() == 1 && hailiangAutoCacheLineDeviceDriver.getItemProtocol().getOpcIntegerValue("task") == 0) { } else if (tasksByLinNum.size() == 1 && hailiangAutoCacheLineDeviceDriver.getItemProtocol().getOpcIntegerValue("task") == 0) {
//下发电气单入 //下发电气单入
to_task_type = "2"; to_task_type = "2";
@@ -1450,12 +1450,12 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
} }
@Override @Override
public Instruction findInstByPutDeviceCode(String put_device_code) { public Instruction findInstByDeviceCode(String device_code) {
return Optional return Optional
.ofNullable(this.instructions) .ofNullable(this.instructions)
.orElse(new CopyOnWriteArrayList<>()) .orElse(new CopyOnWriteArrayList<>())
.stream() .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() .findFirst()
.orElse(null); .orElse(null);
} }

View File

@@ -94,7 +94,7 @@ public class AutoCreateInst {
Device device = deviceAppService.findDeviceByCode(put_device_code); Device device = deviceAppService.findDeviceByCode(put_device_code);
if (device != null && device.getDeviceDriver() instanceof HailiangAutoCacheLineDeviceDriver) { if (device != null && device.getDeviceDriver() instanceof HailiangAutoCacheLineDeviceDriver) {
hailiangAutoCacheLineDeviceDriver = (HailiangAutoCacheLineDeviceDriver) device.getDeviceDriver(); hailiangAutoCacheLineDeviceDriver = (HailiangAutoCacheLineDeviceDriver) device.getDeviceDriver();
if (hailiangAutoCacheLineDeviceDriver.getTask() != 0) { if (hailiangAutoCacheLineDeviceDriver.getTask() != 0 || instructionService.findInstByDeviceCode(put_device_code) != null) {
continue; continue;
} }
} }
@@ -105,7 +105,7 @@ public class AutoCreateInst {
Device device = deviceAppService.findDeviceByCode(start_device_code); Device device = deviceAppService.findDeviceByCode(start_device_code);
if (device != null && device.getDeviceDriver() instanceof HailiangAutoCacheLineDeviceDriver) { if (device != null && device.getDeviceDriver() instanceof HailiangAutoCacheLineDeviceDriver) {
hailiangAutoCacheLineDeviceDriver = (HailiangAutoCacheLineDeviceDriver) device.getDeviceDriver(); hailiangAutoCacheLineDeviceDriver = (HailiangAutoCacheLineDeviceDriver) device.getDeviceDriver();
if (hailiangAutoCacheLineDeviceDriver.getTask() != 0) { if (hailiangAutoCacheLineDeviceDriver.getTask() != 0 || instructionService.findInstByDeviceCode(start_device_code) != null) {
continue; continue;
} }
} }
@@ -143,7 +143,7 @@ public class AutoCreateInst {
Device device = deviceAppService.findDeviceByCode(taskDto1.getPut_device_code()); Device device = deviceAppService.findDeviceByCode(taskDto1.getPut_device_code());
if (device != null && device.getDeviceDriver() instanceof HailiangAutoCacheLineDeviceDriver) { if (device != null && device.getDeviceDriver() instanceof HailiangAutoCacheLineDeviceDriver) {
hailiangAutoCacheLineDeviceDriver = (HailiangAutoCacheLineDeviceDriver) device.getDeviceDriver(); hailiangAutoCacheLineDeviceDriver = (HailiangAutoCacheLineDeviceDriver) device.getDeviceDriver();
if (hailiangAutoCacheLineDeviceDriver.getTask() != 0) { if (hailiangAutoCacheLineDeviceDriver.getTask() != 0 || instructionService.findInstByDeviceCode(taskDto1.getPut_device_code()) != null) {
continue; continue;
} }
} }