Browse Source

rev:优化手持下发任务接口

master
涂强 4 months ago
parent
commit
b641cf7157
  1. 10
      acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/agv/ndctwo/AgvNdcTwoDeviceDriver.java
  2. 15
      acs2/nladmin-system/nlsso-server/src/main/java/org/nl/hand/dto/B2HeadDto.java
  3. 2
      acs2/nladmin-system/nlsso-server/src/main/java/org/nl/hand/dto/HeadDto.java
  4. 2
      acs2/nladmin-system/nlsso-server/src/main/java/org/nl/hand/rest/B2HandController.java
  5. 19
      acs2/nladmin-system/nlsso-server/src/main/java/org/nl/hand/service/impl/B2HandServiceImpl.java
  6. 2
      acs2/nladmin-system/nlsso-server/src/main/java/org/nl/hand/service/impl/HandServiceImpl.java

10
acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/agv/ndctwo/AgvNdcTwoDeviceDriver.java

@ -243,6 +243,15 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
.build(); .build();
logDto.setLog_level(4); logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto); luceneExecuteLogService.deviceExecuteLog(logDto);
} else if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver){
standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver();
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(this.getDeviceCode())
.content("agvphase:" + phase + "反馈:" + data)
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
} else { } else {
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
LuceneLogDto logDto = LuceneLogDto.builder() LuceneLogDto logDto = LuceneLogDto.builder()
@ -252,6 +261,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
logDto.setLog_level(4); logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto); luceneExecuteLogService.deviceExecuteLog(logDto);
} }
} }
// 取货完毕 // 取货完毕

15
acs2/nladmin-system/nlsso-server/src/main/java/org/nl/hand/dto/B2HeadDto.java

@ -13,25 +13,16 @@ public class B2HeadDto implements Serializable {
/** /**
* 起始设备编码1 * 起始设备编码1
*/ */
private String start_device_code1; private String start_device_code;
/** /**
* 目标设备编码1 * 目标设备编码1
*/ */
private String next_device_code1; private String next_device_code;
/**
* 起始设备编码2
*/
private String start_device_code2;
/**
* 目标设备编码2
*/
private String next_device_code2;
/** /**
* 任务类型 * 任务类型
*/ */
private String task_type; private String type;
} }

2
acs2/nladmin-system/nlsso-server/src/main/java/org/nl/hand/dto/HeadDto.java

@ -24,6 +24,6 @@ public class HeadDto implements Serializable {
/** /**
* 任务类型 * 任务类型
*/ */
private String task_type; private String type;
} }

2
acs2/nladmin-system/nlsso-server/src/main/java/org/nl/hand/rest/B2HandController.java

@ -26,7 +26,7 @@ import org.springframework.web.bind.annotation.RestController;
@RestController @RestController
@RequiredArgsConstructor @RequiredArgsConstructor
@Api(tags = "手持接口") @Api(tags = "手持接口")
@RequestMapping("api/hands") @RequestMapping("api/task")
@Slf4j @Slf4j
public class B2HandController { public class B2HandController {
@Autowired @Autowired

19
acs2/nladmin-system/nlsso-server/src/main/java/org/nl/hand/service/impl/B2HandServiceImpl.java

@ -47,11 +47,9 @@ public class B2HandServiceImpl implements B2HandService {
@Override @Override
public Map<String, Object> callTask(B2HeadDto dto) { public Map<String, Object> callTask(B2HeadDto dto) {
JSONArray errArr = new JSONArray(); JSONArray errArr = new JSONArray();
String start_device_code = dto.getStart_device_code1(); String start_device_code = dto.getStart_device_code();
String next_device_code = dto.getNext_device_code1(); String next_device_code = dto.getNext_device_code();
String start_device_code2 = dto.getStart_device_code2(); String task_type = dto.getType();
String next_device_code2 = dto.getNext_device_code2();
String task_type = dto.getTask_type();
if (StrUtil.isEmpty(start_device_code)) { if (StrUtil.isEmpty(start_device_code)) {
throw new BadRequestException("起点1不能为空"); throw new BadRequestException("起点1不能为空");
@ -64,17 +62,6 @@ public class B2HandServiceImpl implements B2HandService {
} }
JSONObject jo = new JSONObject(); JSONObject jo = new JSONObject();
if (StrUtil.equals(task_type, CommonFinalParam.TYPE_ONE)) {
jo.put("start_device_code2", start_device_code2);
jo.put("next_device_code2", next_device_code2);
jo.put("start_point_code2", start_device_code2);
jo.put("next_point_code2", next_device_code2);
} else if (StrUtil.equals(task_type, CommonFinalParam.TYPE_TWO)) {
jo.put("start_device_code2", start_device_code2);
jo.put("next_device_code2", next_device_code2);
jo.put("start_point_code2", start_device_code2);
jo.put("next_point_code2", next_device_code2);
}
jo.put("start_device_code", start_device_code); jo.put("start_device_code", start_device_code);
jo.put("next_device_code", next_device_code); jo.put("next_device_code", next_device_code);
jo.put("start_point_code", start_device_code); jo.put("start_point_code", start_device_code);

2
acs2/nladmin-system/nlsso-server/src/main/java/org/nl/hand/service/impl/HandServiceImpl.java

@ -118,7 +118,7 @@ public class HandServiceImpl implements HandService {
JSONArray errArr = new JSONArray(); JSONArray errArr = new JSONArray();
String start_device_code = dto.getStart_device_code(); String start_device_code = dto.getStart_device_code();
String next_device_code = dto.getNext_device_code(); String next_device_code = dto.getNext_device_code();
String task_type = dto.getTask_type(); String task_type = dto.getType();
if (StrUtil.isEmpty(start_device_code)) { if (StrUtil.isEmpty(start_device_code)) {
throw new BadRequestException("起点不能为空"); throw new BadRequestException("起点不能为空");

Loading…
Cancel
Save