Browse Source

master备份

master2
涂强 1 month ago
parent
commit
629ae5d3b1
  1. 179
      acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/agv/ndctwo/AgvNdcTwoDeviceDriver.java
  2. 4
      acs2/nladmin-system/nlsso-server/src/main/java/org/nl/hand/rest/PdaController.java
  3. 7
      acs2/nladmin-system/nlsso-server/src/main/java/org/nl/hand/service/impl/PdaServiceImpl.java
  4. 2
      acs2/nladmin-system/nlsso-server/src/main/resources/config/application-dev.yml

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

@ -781,41 +781,9 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
} }
if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) { if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) {
standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver(); //通道1
Region region = regionService.findByCode("1"); Region region = regionService.findByCode("1");
if (ObjectUtil.isNotEmpty(device.getExtraValue().get("wait")) if (StrUtil.equals(region.getIs_charge(), CommonFinalParam.ZERO)) {
&& StrUtil.equals("true", device.getExtraValue().get("wait").toString()) ) {
if (StrUtil.equals(region.getIs_charge(), CommonFinalParam.ZERO)) {
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);
if (standardOrdinarySiteDeviceDriver.getOpenCount() == 0) {
region.setIs_charge("1");
region.setHas_agv("0");
regionService.updateById(region);
standardOrdinarySiteDeviceDriver.setOpenCount(standardOrdinarySiteDeviceDriver.getOpenCount() + 1);
}
if (standardOrdinarySiteDeviceDriver.getOpenCount() == 1) {
region.setIs_charge("0");
region.setHas_agv("1");
regionService.updateById(region);
standardOrdinarySiteDeviceDriver.setOpenCount(0);
}
}else {
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(this.getDeviceCode())
.content(region.getRegion_name()+"被管制!")
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
}
} 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()
.device_code(this.getDeviceCode()) .device_code(this.getDeviceCode())
@ -823,11 +791,12 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
.build(); .build();
logDto.setLog_level(4); logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto); luceneExecuteLogService.deviceExecuteLog(logDto);
region.setIs_charge("1");
region.setHas_agv("1");
regionService.updateById(region);
} }
} }
} } else if (phase == 0x4E) {
else if (phase == 0x4E) {
if (agvaddr == 0) { if (agvaddr == 0) {
agvaddr = agvaddr_copy; agvaddr = agvaddr_copy;
} }
@ -866,48 +835,17 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
} }
if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) { if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) {
standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver();
Region region = regionService.findByCode("1"); Region region = regionService.findByCode("1");
if (ObjectUtil.isNotEmpty(device.getExtraValue().get("reqWms")) data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
&& StrUtil.equals("true", device.getExtraValue().get("reqWms").toString())) { LuceneLogDto logDto = LuceneLogDto.builder()
if (StrUtil.equals(region.getIs_charge(), CommonFinalParam.ZERO)) { .device_code(this.getDeviceCode())
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); .content("agvphase:" + phase + "反馈:" + data)
LuceneLogDto logDto = LuceneLogDto.builder() .build();
.device_code(this.getDeviceCode()) logDto.setLog_level(4);
.content("agvphase:" + phase + "反馈:" + data) luceneExecuteLogService.deviceExecuteLog(logDto);
.build(); region.setIs_charge("0");
logDto.setLog_level(4); region.setHas_agv("0");
luceneExecuteLogService.deviceExecuteLog(logDto); regionService.updateById(region);
if (standardOrdinarySiteDeviceDriver.getCloseCount() == 0) {
region.setIs_charge("0");
region.setHas_agv("1");
regionService.updateById(region);
standardOrdinarySiteDeviceDriver.setOpenCount(standardOrdinarySiteDeviceDriver.getOpenCount() + 1);
}
if (standardOrdinarySiteDeviceDriver.getCloseCount() == 1) {
region.setIs_charge("1");
region.setHas_agv("0");
regionService.updateById(region);
standardOrdinarySiteDeviceDriver.setCloseCount(0);
}
}else {
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(this.getDeviceCode())
.content(region.getRegion_name()+"被管制!")
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
}
} else {
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);
}
} }
} }
@ -1054,21 +992,82 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
last_status = status; last_status = status;
} //进入区域(phase值) } //进入区域(phase值)
else if (phase == 0x50) { else if (phase == 0x50) {
LuceneLogDto logDto = LuceneLogDto.builder() if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) {
.device_code(device_code) standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver();
.content("agvphase:" + phase + "自动门开门") Region region = regionService.findByCode("1");
.build(); if (ObjectUtil.isNotEmpty(device.getExtraValue().get("open"))
logDto.setLog_level(4); && StrUtil.equals("true", device.getExtraValue().get("open").toString())) {
luceneExecuteLogService.deviceExecuteLog(logDto); if (StrUtil.equals(region.getIs_charge(), CommonFinalParam.ZERO)) {
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);
if (standardOrdinarySiteDeviceDriver.getOpenCount() == 0) {
region.setIs_charge("1");
region.setHas_agv("1");
regionService.updateById(region);
standardOrdinarySiteDeviceDriver.setOpenCount(standardOrdinarySiteDeviceDriver.getOpenCount() + 1);
}
if (standardOrdinarySiteDeviceDriver.getOpenCount() == 1) {
region.setIs_charge("0");
region.setHas_agv("0");
regionService.updateById(region);
standardOrdinarySiteDeviceDriver.setOpenCount(0);
}
} else {
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
LuceneLogDto logDto2 = LuceneLogDto.builder()
.device_code(this.getDeviceCode())
.content(region.getRegion_name() + "被管制!")
.build();
logDto2.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto2);
}
}
}
} }
//离开区域(phase值) //离开区域(phase值)
else if (phase == 0x51) { else if (phase == 0x51) {
LuceneLogDto logDto = LuceneLogDto.builder() if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) {
.device_code(device_code) standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver();
.content("agvphase:" + phase + "自动门关门") Region region = regionService.findByCode("1");
.build(); if (ObjectUtil.isNotEmpty(device.getExtraValue().get("close"))
logDto.setLog_level(4); && StrUtil.equals("true", device.getExtraValue().get("close").toString())) {
luceneExecuteLogService.deviceExecuteLog(logDto); if (StrUtil.equals(region.getIs_charge(), CommonFinalParam.ZERO)) {
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);
if (standardOrdinarySiteDeviceDriver.getCloseCount() == 0) {
region.setIs_charge("0");
region.setHas_agv("0");
regionService.updateById(region);
standardOrdinarySiteDeviceDriver.setOpenCount(standardOrdinarySiteDeviceDriver.getOpenCount() + 1);
}
if (standardOrdinarySiteDeviceDriver.getCloseCount() == 1) {
region.setIs_charge("1");
region.setHas_agv("1");
regionService.updateById(region);
standardOrdinarySiteDeviceDriver.setCloseCount(0);
}
} else {
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(this.getDeviceCode())
.content(region.getRegion_name() + "被管制!")
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
}
}
}
} }
//上报异常信息 //上报异常信息
//(不需要WCS反馈) //(不需要WCS反馈)

4
acs2/nladmin-system/nlsso-server/src/main/java/org/nl/hand/rest/PdaController.java

@ -88,8 +88,8 @@ public class PdaController {
} }
@PostMapping("/queryTaskIds") @PostMapping("/queryTaskIds")
@Log("查询任务") @Log("查询任务")
@ApiOperation("查询任务") @ApiOperation("查询任务")
@SaIgnore @SaIgnore
//@PreAuthorize("@el.check('sect:list')") //@PreAuthorize("@el.check('sect:list')")
public ResponseEntity<Object> queryTaskIds() throws Exception { public ResponseEntity<Object> queryTaskIds() throws Exception {

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

@ -210,7 +210,7 @@ public class PdaServiceImpl implements PdaService {
} }
JSONObject resultJson = new JSONObject(); JSONObject resultJson = new JSONObject();
Instruction instruction = instructionService.findByTaskid(dto.getTask_id(), "instruction_status <2 "); Instruction instruction = instructionService.findByTaskid(dto.getTask_id(), "instruction_status <2 ");
if (instruction!=null){ if (instruction != null) {
resultJson.put("message", "有指令未完成!"); resultJson.put("message", "有指令未完成!");
return resultJson; return resultJson;
} }
@ -240,6 +240,7 @@ public class PdaServiceImpl implements PdaService {
JSONObject obj = arr.getJSONObject(i); JSONObject obj = arr.getJSONObject(i);
JSONObject json = new JSONObject(); JSONObject json = new JSONObject();
json.put("task_id", obj.getString("task_code")); json.put("task_id", obj.getString("task_code"));
json.put("task_name", obj.getString("task_code") + " - " + obj.getString("start_device_code") + "-->" + obj.getString("next_device_code"));
result.add(json); result.add(json);
} }
return result; return result;
@ -251,7 +252,7 @@ public class PdaServiceImpl implements PdaService {
String task_code = jsonObject.getString("task_id"); String task_code = jsonObject.getString("task_id");
JSONObject resultJson = new JSONObject(); JSONObject resultJson = new JSONObject();
TaskDto dto = taskserver.findByCode(task_code); TaskDto dto = taskserver.findByCode(task_code);
if (Integer.parseInt(dto.getTask_status())==0) { if (Integer.parseInt(dto.getTask_status()) == 0) {
try { try {
taskserver.cancel(dto.getTask_id()); taskserver.cancel(dto.getTask_id());
} catch (Exception e) { } catch (Exception e) {
@ -350,7 +351,7 @@ public class PdaServiceImpl implements PdaService {
jo.put("x", agvNdcTwoDeviceDriver.getX()); jo.put("x", agvNdcTwoDeviceDriver.getX());
jo.put("y", agvNdcTwoDeviceDriver.getY()); jo.put("y", agvNdcTwoDeviceDriver.getY());
jo.put("angle", agvNdcTwoDeviceDriver.getAngle()); jo.put("angle", agvNdcTwoDeviceDriver.getAngle());
ja.put(agvNdcTwoDeviceDriver.getDevice().getDevice_code(),jo); ja.put(agvNdcTwoDeviceDriver.getDevice().getDevice_code(), jo);
} }
backja.add(ja); backja.add(ja);
} }

2
acs2/nladmin-system/nlsso-server/src/main/resources/config/application-dev.yml

@ -10,7 +10,7 @@ spring:
driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
# url: jdbc:log4jdbc:mysql://${DB_HOST:192.168.81.252}:${DB_PORT:3306}/${DB_NAME:stand_acs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true # url: jdbc:log4jdbc:mysql://${DB_HOST:192.168.81.252}:${DB_PORT:3306}/${DB_NAME:stand_acs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
# url: jdbc:log4jdbc:mysql://${DB_HOST:47.111.78.178}:${DB_PORT:3306}/${DB_NAME:lzhl_two_acs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true # url: jdbc:log4jdbc:mysql://${DB_HOST:47.111.78.178}:${DB_PORT:3306}/${DB_NAME:lzhl_two_acs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
url: jdbc:log4jdbc:mysql://${DB_HOST:localhost}:${DB_PORT:3306}/${DB_NAME:hanguodoushan}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true url: jdbc:log4jdbc:mysql://${DB_HOST:localhost}:${DB_PORT:3306}/${DB_NAME:jinbao}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true
username: ${DB_USER:root} username: ${DB_USER:root}
# password: ${DB_PWD:Root.123456} # password: ${DB_PWD:Root.123456}

Loading…
Cancel
Save