feat:绕过开合盖任务、AGV扫码失败的手动放行
This commit is contained in:
@@ -68,6 +68,10 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
int phase = 0;
|
||||
String error_type = "agv_error_type";
|
||||
String error_code = "0";
|
||||
/**
|
||||
* 车辆放行标志
|
||||
*/
|
||||
boolean agvReleased = false;
|
||||
/**
|
||||
* x坐标
|
||||
*/
|
||||
@@ -1325,6 +1329,10 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
log.info(agvaddr + "对应设备号为空!");
|
||||
return;
|
||||
}
|
||||
if (agvReleased) {
|
||||
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
|
||||
agvReleased = false;
|
||||
}
|
||||
String task_code = inst.getTask_code();
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("task_code", task_code);
|
||||
|
||||
@@ -113,5 +113,12 @@ public class WmsToAcsController {
|
||||
return new ResponseEntity<>(wmstoacsService.getTubeMes(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/agvReleased")
|
||||
@Log("下发管芯信息")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> agvReleased(@RequestBody String whereJson) throws Exception {
|
||||
return new ResponseEntity<>(wmstoacsService.agvReleased(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -111,4 +111,5 @@ public interface WmsToAcsService {
|
||||
|
||||
Map<String, Object> getTubeMes(String whereJson) throws Exception;
|
||||
|
||||
JSONObject agvReleased(String whereJson);
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapp
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.acs.device.domain.Device;
|
||||
import org.nl.acs.device_driver.agv.ndcone.AgvNdcOneDeviceDriver;
|
||||
import org.nl.acs.device_driver.agv.ndctwo.AgvNdcTwoDeviceDriver;
|
||||
import org.nl.acs.device_driver.conveyor.belt_conveyor.BeltConveyorDeviceDriver;
|
||||
import org.nl.acs.device_driver.conveyor.standard_ordinary_site.StandardOrdinarySiteDeviceDriver;
|
||||
@@ -548,6 +549,66 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
||||
return resultJson;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject agvReleased(String jsonObject) {
|
||||
log.info("下发放行AGV信息--------------:输入参数" + jsonObject);
|
||||
JSONArray datas = JSONArray.parseArray(jsonObject);
|
||||
JSONObject param = datas.getJSONObject(0);
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code("ACS接收WMS任务")
|
||||
.content("ACS接收WMS任务-----输入参数:" + param)
|
||||
.build();
|
||||
logDto.setLog_level(4);
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
|
||||
String device_code = param.getString("device_code");
|
||||
String task_code = param.getString("task_code");
|
||||
Instruction inst = instructionService.findByTaskcode(task_code);
|
||||
JSONArray errArr = new JSONArray();
|
||||
if (ObjectUtil.isEmpty(inst)) {
|
||||
JSONObject jo = new JSONObject();
|
||||
jo.put("task_code", task_code);
|
||||
jo.put("message", "未找到对应任务");
|
||||
errArr.add(jo);
|
||||
} else {
|
||||
String carNo = inst.getCarno();
|
||||
if (ObjectUtil.isEmpty(carNo)) {
|
||||
JSONObject jo = new JSONObject();
|
||||
jo.put("task_code", task_code);
|
||||
jo.put("message", "未找到任务对应车号");
|
||||
errArr.add(jo);
|
||||
} else {
|
||||
Device device = deviceAppService.findDeviceByCode(carNo);
|
||||
AgvNdcOneDeviceDriver agvNdcOneDeviceDriver;
|
||||
if (device.getDeviceDriver() instanceof AgvNdcOneDeviceDriver) {
|
||||
agvNdcOneDeviceDriver = (AgvNdcOneDeviceDriver) device.getDeviceDriver();
|
||||
if (!agvNdcOneDeviceDriver.isAgvReleased()) {
|
||||
agvNdcOneDeviceDriver.setAgvReleased(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
JSONObject resultJson = new JSONObject();
|
||||
if (ObjectUtil.isEmpty(errArr)) {
|
||||
resultJson.put("status", HttpStatus.OK.value());
|
||||
resultJson.put("message", "操作成功");
|
||||
} else {
|
||||
resultJson.put("status", HttpStatus.BAD_REQUEST.value());
|
||||
resultJson.put("message", "操作失败");
|
||||
if (ObjectUtil.isNotEmpty(errArr)) {
|
||||
resultJson.put("errArr", errArr);
|
||||
}
|
||||
}
|
||||
LuceneLogDto logDto1 = LuceneLogDto.builder()
|
||||
.device_code("WMS更新任务点位状态")
|
||||
.content("WMS更新任务点位状态-----返回参数:" + resultJson)
|
||||
.build();
|
||||
logDto1.setLog_level(4);
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto1);
|
||||
return resultJson;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Map<String, Object> queryDevice(String jsonObject) throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user