金力永磁问题解决
This commit is contained in:
@@ -63,8 +63,9 @@ public class AcsToWmsController {
|
|||||||
@PostMapping("/feedbackAgv")
|
@PostMapping("/feedbackAgv")
|
||||||
@Log("反馈AGV设备信息")
|
@Log("反馈AGV设备信息")
|
||||||
@ApiOperation("反馈AGV设备信息")
|
@ApiOperation("反馈AGV设备信息")
|
||||||
public ResponseEntity<Object> feedbackAgv(@RequestBody JSONArray from) {
|
public ResponseEntity<Object> feedbackAgv(@RequestBody String from) {
|
||||||
return new ResponseEntity<>(acstowmsService.feedbackAgv(from), HttpStatus.OK);
|
JSONArray array = JSONArray.fromObject(from);
|
||||||
|
return new ResponseEntity<>(acstowmsService.feedbackAgv(array), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/weighing")
|
@PostMapping("/weighing")
|
||||||
|
|||||||
@@ -115,10 +115,12 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
|||||||
.header("Authorization", token).body(String.valueOf(data))
|
.header("Authorization", token).body(String.valueOf(data))
|
||||||
.execute();
|
.execute();
|
||||||
System.out.println(result2);
|
System.out.println(result2);
|
||||||
|
log.info("feedbackTaskStatusToWms-----返回参数{}", result2.body());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
String msg = e.getMessage();
|
String msg = e.getMessage();
|
||||||
//网络不通
|
//网络不通
|
||||||
System.out.println(msg);
|
System.out.println(msg);
|
||||||
|
log.info("feedbackTaskStatusToWms-----异常{}", msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
String type = "";
|
String type = "";
|
||||||
@@ -438,6 +440,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
|||||||
String msg = e.getMessage();
|
String msg = e.getMessage();
|
||||||
//网络不通
|
//网络不通
|
||||||
System.out.println(msg);
|
System.out.println(msg);
|
||||||
|
log.info("feedbackAgv----异常{}", msg);
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -163,7 +163,8 @@ public class TaskFeedbackServiceImpl implements TaskFeedbackService {
|
|||||||
feed_jo.put("task_uuid", entity.getTask_id());
|
feed_jo.put("task_uuid", entity.getTask_id());
|
||||||
feed_jo.put("task_code", entity.getTask_code());
|
feed_jo.put("task_code", entity.getTask_code());
|
||||||
feed_jo.put("task_status", entity.getTask_status());
|
feed_jo.put("task_status", entity.getTask_status());
|
||||||
JSONArray ja = new JSONArray();
|
|
||||||
|
JSONArray ja = JSONArray.fromObject(feed_jo);
|
||||||
|
|
||||||
HttpResponse body = null;
|
HttpResponse body = null;
|
||||||
String error_message = null;
|
String error_message = null;
|
||||||
|
|||||||
@@ -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());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3565,19 +3565,20 @@ public class NDCSocketConnectionAutoRun extends AbstractAutoRunnable {
|
|||||||
else if (phase == 0x67) {
|
else if (phase == 0x67) {
|
||||||
AgvDto dto = null;
|
AgvDto dto = null;
|
||||||
Map<String, AgvDto> map = AgvService.findAllAgvFromCache();
|
Map<String, AgvDto> map = AgvService.findAllAgvFromCache();
|
||||||
|
carno = arr[18] * 256 + arr[19];
|
||||||
if (map.containsKey(String.valueOf(carno))) {
|
if (map.containsKey(String.valueOf(carno))) {
|
||||||
dto = map.get(String.valueOf(carno));
|
dto = map.get(String.valueOf(carno));
|
||||||
} else {
|
} else {
|
||||||
dto = new AgvDto();
|
dto = new AgvDto();
|
||||||
}
|
}
|
||||||
dto.setName(String.valueOf(carno));
|
dto.setName(String.valueOf(carno));
|
||||||
if (arr[18] * 256 + arr[19] == 0) {
|
if (ikey == 0) {
|
||||||
dto.setState("IDLE");
|
dto.setState("IDLE");
|
||||||
acsToWmsService.feedbackAgvStatus(String.valueOf(carno), "0", "");
|
acsToWmsService.feedbackAgvStatus(String.valueOf(carno), "0", "");
|
||||||
} else {
|
} else {
|
||||||
StringBuffer errbs = new StringBuffer();
|
StringBuffer errbs = new StringBuffer();
|
||||||
for (int i = 0; i < ERROR.length; i++) {
|
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]);
|
errbs.append("," + ERROR[i]);
|
||||||
//反馈故障
|
//反馈故障
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user