Browse Source

master备份

master2
涂强 1 month ago
parent
commit
629ae5d3b1
  1. 135
      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. 1
      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

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

@ -781,10 +781,8 @@ 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"))
&& StrUtil.equals("true", device.getExtraValue().get("wait").toString()) ) {
if (StrUtil.equals(region.getIs_charge(), CommonFinalParam.ZERO)) { if (StrUtil.equals(region.getIs_charge(), CommonFinalParam.ZERO)) {
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
LuceneLogDto logDto = LuceneLogDto.builder() LuceneLogDto logDto = LuceneLogDto.builder()
@ -793,41 +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);
if (standardOrdinarySiteDeviceDriver.getOpenCount() == 0) {
region.setIs_charge("1"); 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"); region.setHas_agv("1");
regionService.updateById(region); 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);
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(this.getDeviceCode())
.content("agvphase:" + phase + "反馈:" + data)
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
}
} }
} }
} else if (phase == 0x4E) {
else if (phase == 0x4E) {
if (agvaddr == 0) { if (agvaddr == 0) {
agvaddr = agvaddr_copy; agvaddr = agvaddr_copy;
} }
@ -866,11 +835,7 @@ 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"))
&& StrUtil.equals("true", device.getExtraValue().get("reqWms").toString())) {
if (StrUtil.equals(region.getIs_charge(), CommonFinalParam.ZERO)) {
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())
@ -878,36 +843,9 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
.build(); .build();
logDto.setLog_level(4); logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto); luceneExecuteLogService.deviceExecuteLog(logDto);
if (standardOrdinarySiteDeviceDriver.getCloseCount() == 0) {
region.setIs_charge("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"); region.setHas_agv("0");
regionService.updateById(region); 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,22 +992,83 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
last_status = status; last_status = status;
} //进入区域(phase值) } //进入区域(phase值)
else if (phase == 0x50) { else if (phase == 0x50) {
if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) {
standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver();
Region region = regionService.findByCode("1");
if (ObjectUtil.isNotEmpty(device.getExtraValue().get("open"))
&& StrUtil.equals("true", device.getExtraValue().get("open").toString())) {
if (StrUtil.equals(region.getIs_charge(), CommonFinalParam.ZERO)) {
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
LuceneLogDto logDto = LuceneLogDto.builder() LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code) .device_code(this.getDeviceCode())
.content("agvphase:" + phase + "自动门开门") .content("agvphase:" + phase + "反馈:" + data)
.build(); .build();
logDto.setLog_level(4); logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto); 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) {
if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) {
standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver();
Region region = regionService.findByCode("1");
if (ObjectUtil.isNotEmpty(device.getExtraValue().get("close"))
&& StrUtil.equals("true", device.getExtraValue().get("close").toString())) {
if (StrUtil.equals(region.getIs_charge(), CommonFinalParam.ZERO)) {
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
LuceneLogDto logDto = LuceneLogDto.builder() LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code) .device_code(this.getDeviceCode())
.content("agvphase:" + phase + "自动门关门") .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(); .build();
logDto.setLog_level(4); logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto); luceneExecuteLogService.deviceExecuteLog(logDto);
} }
}
}
}
//上报异常信息 //上报异常信息
//(不需要WCS反馈) //(不需要WCS反馈)
else if (phase == 0x67) { else if (phase == 0x67) {

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 {

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

@ -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;

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