Browse Source

金力永磁问题解决

master
loujf 2 years ago
parent
commit
121f40187f
  1. 5
      hd/nladmin-system/src/main/java/org/nl/acs/ext/wms/rest/AcsToWmsController.java
  2. 3
      hd/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/AcsToWmsServiceImpl.java
  3. 3
      hd/nladmin-system/src/main/java/org/nl/acs/task/service/impl/TaskFeedbackServiceImpl.java
  4. 41
      hd/nladmin-system/src/main/java/org/nl/modules/quartz/task/TaskFeekback.java
  5. 5
      hd/nladmin-system/src/main/java/org/nl/start/auto/run/NDCSocketConnectionAutoRun.java

5
hd/nladmin-system/src/main/java/org/nl/acs/ext/wms/rest/AcsToWmsController.java

@ -63,8 +63,9 @@ public class AcsToWmsController {
@PostMapping("/feedbackAgv")
@Log("反馈AGV设备信息")
@ApiOperation("反馈AGV设备信息")
public ResponseEntity<Object> feedbackAgv(@RequestBody JSONArray from) {
return new ResponseEntity<>(acstowmsService.feedbackAgv(from), HttpStatus.OK);
public ResponseEntity<Object> feedbackAgv(@RequestBody String from) {
JSONArray array = JSONArray.fromObject(from);
return new ResponseEntity<>(acstowmsService.feedbackAgv(array), HttpStatus.OK);
}
@PostMapping("/weighing")

3
hd/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/AcsToWmsServiceImpl.java

@ -115,10 +115,12 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
.header("Authorization", token).body(String.valueOf(data))
.execute();
System.out.println(result2);
log.info("feedbackTaskStatusToWms-----返回参数{}", result2.body());
} catch (Exception e) {
String msg = e.getMessage();
//网络不通
System.out.println(msg);
log.info("feedbackTaskStatusToWms-----异常{}", msg);
}
String type = "";
@ -438,6 +440,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
String msg = e.getMessage();
//网络不通
System.out.println(msg);
log.info("feedbackAgv----异常{}", msg);
}
return result;
}

3
hd/nladmin-system/src/main/java/org/nl/acs/task/service/impl/TaskFeedbackServiceImpl.java

@ -163,7 +163,8 @@ public class TaskFeedbackServiceImpl implements TaskFeedbackService {
feed_jo.put("task_uuid", entity.getTask_id());
feed_jo.put("task_code", entity.getTask_code());
feed_jo.put("task_status", entity.getTask_status());
JSONArray ja = new JSONArray();
JSONArray ja = JSONArray.fromObject(feed_jo);
HttpResponse body = null;
String error_message = null;

41
hd/nladmin-system/src/main/java/org/nl/modules/quartz/task/TaskFeekback.java

@ -0,0 +1,41 @@
package org.nl.modules.quartz.task;
import lombok.extern.slf4j.Slf4j;
import net.sf.json.JSONObject;
import org.nl.acs.task.service.TaskFeedbackService;
import org.nl.acs.task.service.dto.TaskFeedbackDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.ArrayList;
import java.util.List;
/**
* 向wms反馈任务状态
*/
@Slf4j
@Component
public class TaskFeekback {
@Autowired
TaskFeedbackService taskFeedbackService;
public void run() throws Exception {
JSONObject json = new JSONObject();
List<TaskFeedbackDto> taskFeedbackDtos = taskFeedbackService.queryAll(json);
List<TaskFeedbackDto> dtos = new ArrayList<>();
for (int i = 0; i < taskFeedbackDtos.size(); i++) {
TaskFeedbackDto dto = taskFeedbackDtos.get(i);
if (!dto.getError_code().equals("200") && dto.getIs_finished().equals("0")) {
dtos.add(dto);
}
}
for (int i = 0; i < dtos.size(); i++) {
TaskFeedbackDto taskFeedbackDto = dtos.get(i);
taskFeedbackService.retry(taskFeedbackDto.getTaskback_id());
}
}
}

5
hd/nladmin-system/src/main/java/org/nl/start/auto/run/NDCSocketConnectionAutoRun.java

@ -3565,19 +3565,20 @@ public class NDCSocketConnectionAutoRun extends AbstractAutoRunnable {
else if (phase == 0x67) {
AgvDto dto = null;
Map<String, AgvDto> map = AgvService.findAllAgvFromCache();
carno = arr[18] * 256 + arr[19];
if (map.containsKey(String.valueOf(carno))) {
dto = map.get(String.valueOf(carno));
} else {
dto = new AgvDto();
}
dto.setName(String.valueOf(carno));
if (arr[18] * 256 + arr[19] == 0) {
if (ikey == 0) {
dto.setState("IDLE");
acsToWmsService.feedbackAgvStatus(String.valueOf(carno), "0", "");
} else {
StringBuffer errbs = new StringBuffer();
for (int i = 0; i < ERROR.length; i++) {
if (((arr[18] * 256 + arr[19]) & (1 << i)) > 0)
if (((ikey) & (1 << i)) > 0)
errbs.append("," + ERROR[i]);
//反馈故障
}

Loading…
Cancel
Save