fix: 修复一期内包间问题,更新二期日志
This commit is contained in:
@@ -180,13 +180,16 @@ public class DeviceController {
|
||||
}
|
||||
|
||||
|
||||
|
||||
@PostMapping({"/testRead"})
|
||||
@Log("读信号")
|
||||
public ResponseEntity<Object> testRead(@RequestBody Map map) {
|
||||
return new ResponseEntity(deviceService.testRead(map), HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping({"/testWrite"})
|
||||
@Log("写信号")
|
||||
public ResponseEntity<Object> testWrite(@RequestBody Map map) {
|
||||
deviceService.testWrite(map);
|
||||
return new ResponseEntity(HttpStatus.NO_CONTENT);
|
||||
|
||||
@@ -522,7 +522,7 @@ public class BoxStorageManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
.device_code(device_code)
|
||||
.content("下发多个电气信号" + itemMap)
|
||||
.build();
|
||||
logDto.setLog_level(2);
|
||||
logDto.setLog_level(4);
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
logServer.deviceExecuteLog(device_code, "", "", "下发电气信号:" + itemMap);
|
||||
try {
|
||||
|
||||
@@ -292,6 +292,10 @@ public class VolumeTwoManipulatorManipulatorDeviceDriver extends AbstractOpcDevi
|
||||
|
||||
private void creatAGV(Integer actionType, int toCommand) {
|
||||
Instruction instruction = checkInst();
|
||||
if(ObjectUtil.isEmpty(instruction)){
|
||||
log.info("指令不存在");
|
||||
return;
|
||||
}
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("taskCode", instruction.getTask_code());
|
||||
param.put("actionType",actionType );
|
||||
@@ -636,6 +640,7 @@ public class VolumeTwoManipulatorManipulatorDeviceDriver extends AbstractOpcDevi
|
||||
.device_code(device_code)
|
||||
.content("下发多个电气信号" + itemMap)
|
||||
.build();
|
||||
logDto.setLog_level(4);
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
logServer.deviceExecuteLog(device_code, "", "", "下发电气信号:" + itemMap);
|
||||
try {
|
||||
|
||||
@@ -21,6 +21,7 @@ import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -37,7 +38,8 @@ public class WmsToAcsController {
|
||||
@PostMapping("/task")
|
||||
@Log(value = "ACS接收WMS任务")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> createFromWms(@RequestBody String whereJson) {
|
||||
public ResponseEntity<Object> createFromWms(@RequestBody String whereJson, HttpServletRequest request) {
|
||||
log.info("wms下发任务的ip:{},端口号:{},地址:{}", request.getRemoteAddr(),request.getRemotePort(),request.getRemoteHost());
|
||||
return new ResponseEntity<>(wmstoacsService.crateTask(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,11 +1,16 @@
|
||||
/*
|
||||
package org.nl.config;
|
||||
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import com.yomahub.tlog.id.TLogIdGenerator;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@Slf4j
|
||||
public class TlogIdGenerator extends TLogIdGenerator {
|
||||
@Override
|
||||
public String generateTraceId() {
|
||||
log.info("TlogIdGenerator generateTraceId");
|
||||
return IdUtil.getSnowflake(1, 1).nextIdStr();
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
@@ -118,12 +118,23 @@ public class AutoCreateInst {
|
||||
String[] str = path.split("->");
|
||||
List<String> pathlist = Arrays.asList(str);
|
||||
int index = 0;
|
||||
boolean flag = false;
|
||||
for (int m = 0; m < pathlist.size(); m++) {
|
||||
if (pathlist.get(m).equals(start_device_code)) {
|
||||
if("1".equals(acsTask.getTask_type()) && !pathlist.get(m+1).equals(next_device_code)){
|
||||
flag = true;
|
||||
break;
|
||||
}
|
||||
index = m + 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (flag) {
|
||||
acsTask.setRemark("路由不通无法生成指令");
|
||||
taskserver.update(acsTask);
|
||||
taskserver.updateByCodeFromCache(acsTask);
|
||||
continue;
|
||||
}
|
||||
next_device_code = pathlist.get(index);
|
||||
|
||||
if (StrUtil.equals(appService.findDeviceTypeByCode(next_device_code), "storage")) {
|
||||
@@ -215,6 +226,7 @@ public class AutoCreateInst {
|
||||
//创建指令后修改任务状态
|
||||
acsTask.setTask_status(TaskStatusEnum.BUSY.getIndex());
|
||||
acsTask.setUpdate_time(DateUtil.now());
|
||||
acsTask.setRemark(" ");
|
||||
taskserver.update(acsTask);
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user