Browse Source

add:新增区域查询接口

master
涂强 5 months ago
parent
commit
d3215c3ee3
  1. 376
      acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/agv/ndctwo/AgvNdcTwoDeviceDriver.java
  2. 8
      acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/region/service/impl/RegionServiceImpl.java
  3. 3
      acs2/nladmin-system/nlsso-server/src/main/java/org/nl/hand/service/impl/PdaServiceImpl.java
  4. 0
      acs2/nladmin-ui/src/assets/images/background333.png
  5. BIN
      acs2/nladmin-ui/src/assets/images/newlogo.png
  6. 4
      acs2/nladmin-ui/src/layout/components/Sidebar/Logo.vue

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

@ -353,194 +353,194 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
// 取货完毕
//(Itype=1、3,需要WCS反馈)
else if (phase == 0x0A) {
if (agvaddr == 0) {
agvaddr = agvaddr_copy;
}
if (agvaddr < 1) {
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code)
.content("agv地址参数有误,phase:" + phase)
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
return;
}
if (agvaddr != 0) {
CommonFinalParam commonFinalParam = new CommonFinalParam();
old_device_code = deviceService.queryDeviceCodeByAddress(agvaddr);
if (StrUtil.contains(old_device_code, commonFinalParam.getBARRE())) {
String[] point = old_device_code.split(commonFinalParam.getBARRE());
device_code = point[0];
} else if (StrUtil.contains(old_device_code, commonFinalParam.getPOINT())) {
String[] point = old_device_code.split("\\.");
device_code = point[0];
emptyNum = point[1];
} else {
device_code = old_device_code;
}
}
device = deviceAppService.findDeviceByCode(device_code);
if (ObjectUtil.isEmpty(device_code)) {
log.info(agvaddr + "对应设备号为空!");
return;
}
if (ObjectUtil.isEmpty(inst)) {
log.info("未找到指令号{}对应的指令", ikey);
return;
}
String agv_inst_type = inst.getAgv_inst_type();
if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) {
standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver();
if (ObjectUtil.isNotEmpty(standardOrdinarySiteDeviceDriver.getDevice().getExtraValue().get("wait"))
&& StrUtil.equals("true", standardOrdinarySiteDeviceDriver.getDevice().getExtraValue().get("wait").toString())) {
standardOrdinarySiteDeviceDriver.setOption(0);
} 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);
}
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
standardOrdinarySiteDeviceDriver.setAgvphase(phase);
standardOrdinarySiteDeviceDriver.setIndex(index);
standardOrdinarySiteDeviceDriver.setInst(inst);
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(this.getDeviceCode())
.content("agvphase:" + phase + "反馈:" + data)
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
String task_code = inst.getTask_code();
if (ObjectUtil.isNotEmpty(standardOrdinarySiteDeviceDriver.getDevice().getExtraValue().get("feedbackToLms"))
&& StrUtil.equals("true", standardOrdinarySiteDeviceDriver.getDevice().getExtraValue().get("feedbackToLms").toString())) {
JSONObject jsonObject = new JSONObject();
jsonObject.put("task_code", task_code);
LuceneLogDto logDto1 = LuceneLogDto.builder()
.device_code(standardOrdinarySiteDeviceDriver.getDevice_code())
.content("取货完成反馈:" + jsonObject.toJSONString() + ";设备:" + standardOrdinarySiteDeviceDriver.getDeviceCode())
.build();
logDto1.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto1);
acsToWmsService.actionFinishRequest2(jsonObject);
}
} else if (device.getDeviceDriver() instanceof HongXiangStationDeviceDriver) {
hongXiangStationDeviceDriver = (HongXiangStationDeviceDriver) device.getDeviceDriver();
try {
hongXiangStationDeviceDriver.writing(0);
} catch (Exception e) {
e.printStackTrace();
}
if (hongXiangStationDeviceDriver.getMove() == 0) {
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 {
message = "设备号:" + device_code + "光电信号:" + hongXiangStationDeviceDriver.getMove() + ",指令号:" + ikey + "不满足取货条件";
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(this.getDeviceCode())
.content(message)
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
}
} else if (device.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver) {
manipulatorAgvStationDeviceDriver = (ManipulatorAgvStationDeviceDriver) device.getDeviceDriver();
try {
manipulatorAgvStationDeviceDriver.writing(3);
} catch (Exception e) {
e.printStackTrace();
}
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);
String task_code = inst.getTask_code();
if (ObjectUtil.isNotEmpty(manipulatorAgvStationDeviceDriver.getDevice().getExtraValue().get("feedbackToLms"))
&& StrUtil.equals("true", manipulatorAgvStationDeviceDriver.getDevice().getExtraValue().get("feedbackToLms").toString())) {
JSONObject jsonObject = new JSONObject();
jsonObject.put("task_code", task_code);
LuceneLogDto logDto1 = LuceneLogDto.builder()
.device_code(manipulatorAgvStationDeviceDriver.getDevice_code())
.content("取货完成反馈:" + jsonObject.toJSONString() + ";设备:" + manipulatorAgvStationDeviceDriver.getDeviceCode())
.build();
logDto1.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto1);
acsToWmsService.actionFinishRequest2(jsonObject);
}
} else if (device.getDeviceDriver() instanceof PaperTubePickSiteDeviceDriver) {
paperTubePickSiteDeviceDriver = (PaperTubePickSiteDeviceDriver) device.getDeviceDriver();
try {
paperTubePickSiteDeviceDriver.writing(3);
} catch (Exception e) {
e.printStackTrace();
}
if (paperTubePickSiteDeviceDriver.getAction() == 1
&& paperTubePickSiteDeviceDriver.getError() == 0 && paperTubePickSiteDeviceDriver.getMode() == 2) {
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 {
message = "设备号:" + device_code + ",动作信号:" + paperTubePickSiteDeviceDriver.getAction() + "报警信号:" + paperTubePickSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件";
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(this.getDeviceCode())
.content(message)
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
}
} else if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) {
standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver();
try {
standardInspectSiteDeviceDriver.writing(1);
} catch (Exception e) {
e.printStackTrace();
}
if ((standardInspectSiteDeviceDriver.getMove() == 1 && standardInspectSiteDeviceDriver.getAction() == 1 && standardInspectSiteDeviceDriver.getError() == 0)) {
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 {
message = "设备号:" + device_code + "光电信号:" + standardInspectSiteDeviceDriver.getMove() + ",动作信号:" + standardInspectSiteDeviceDriver.getAction() + "报警信号:" + standardInspectSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件";
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(this.getDeviceCode())
.content(message)
.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 == 0x0A) {
// if (agvaddr == 0) {
// agvaddr = agvaddr_copy;
// }
// if (agvaddr < 1) {
// LuceneLogDto logDto = LuceneLogDto.builder()
// .device_code(device_code)
// .content("agv地址参数有误,phase:" + phase)
// .build();
// logDto.setLog_level(4);
// luceneExecuteLogService.deviceExecuteLog(logDto);
// return;
// }
// if (agvaddr != 0) {
// CommonFinalParam commonFinalParam = new CommonFinalParam();
// old_device_code = deviceService.queryDeviceCodeByAddress(agvaddr);
// if (StrUtil.contains(old_device_code, commonFinalParam.getBARRE())) {
// String[] point = old_device_code.split(commonFinalParam.getBARRE());
// device_code = point[0];
// } else if (StrUtil.contains(old_device_code, commonFinalParam.getPOINT())) {
// String[] point = old_device_code.split("\\.");
// device_code = point[0];
// emptyNum = point[1];
// } else {
// device_code = old_device_code;
// }
// }
//
// device = deviceAppService.findDeviceByCode(device_code);
// if (ObjectUtil.isEmpty(device_code)) {
// log.info(agvaddr + "对应设备号为空!");
// return;
// }
// if (ObjectUtil.isEmpty(inst)) {
// log.info("未找到指令号{}对应的指令", ikey);
// return;
// }
// String agv_inst_type = inst.getAgv_inst_type();
// if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) {
// standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver();
// if (ObjectUtil.isNotEmpty(standardOrdinarySiteDeviceDriver.getDevice().getExtraValue().get("wait"))
// && StrUtil.equals("true", standardOrdinarySiteDeviceDriver.getDevice().getExtraValue().get("wait").toString())) {
// standardOrdinarySiteDeviceDriver.setOption(0);
// } 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);
// }
// data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
// standardOrdinarySiteDeviceDriver.setAgvphase(phase);
// standardOrdinarySiteDeviceDriver.setIndex(index);
// standardOrdinarySiteDeviceDriver.setInst(inst);
// LuceneLogDto logDto = LuceneLogDto.builder()
// .device_code(this.getDeviceCode())
// .content("agvphase:" + phase + "反馈:" + data)
// .build();
// logDto.setLog_level(4);
// luceneExecuteLogService.deviceExecuteLog(logDto);
// String task_code = inst.getTask_code();
// if (ObjectUtil.isNotEmpty(standardOrdinarySiteDeviceDriver.getDevice().getExtraValue().get("feedbackToLms"))
// && StrUtil.equals("true", standardOrdinarySiteDeviceDriver.getDevice().getExtraValue().get("feedbackToLms").toString())) {
// JSONObject jsonObject = new JSONObject();
// jsonObject.put("task_code", task_code);
// LuceneLogDto logDto1 = LuceneLogDto.builder()
// .device_code(standardOrdinarySiteDeviceDriver.getDevice_code())
// .content("取货完成反馈:" + jsonObject.toJSONString() + ";设备:" + standardOrdinarySiteDeviceDriver.getDeviceCode())
// .build();
// logDto1.setLog_level(4);
// luceneExecuteLogService.deviceExecuteLog(logDto1);
// acsToWmsService.actionFinishRequest2(jsonObject);
// }
//
// } else if (device.getDeviceDriver() instanceof HongXiangStationDeviceDriver) {
// hongXiangStationDeviceDriver = (HongXiangStationDeviceDriver) device.getDeviceDriver();
// try {
// hongXiangStationDeviceDriver.writing(0);
// } catch (Exception e) {
// e.printStackTrace();
// }
// if (hongXiangStationDeviceDriver.getMove() == 0) {
// 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 {
// message = "设备号:" + device_code + "光电信号:" + hongXiangStationDeviceDriver.getMove() + ",指令号:" + ikey + "不满足取货条件";
// LuceneLogDto logDto = LuceneLogDto.builder()
// .device_code(this.getDeviceCode())
// .content(message)
// .build();
// logDto.setLog_level(4);
// luceneExecuteLogService.deviceExecuteLog(logDto);
// }
// } else if (device.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver) {
// manipulatorAgvStationDeviceDriver = (ManipulatorAgvStationDeviceDriver) device.getDeviceDriver();
// try {
// manipulatorAgvStationDeviceDriver.writing(3);
// } catch (Exception e) {
// e.printStackTrace();
// }
// 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);
// String task_code = inst.getTask_code();
// if (ObjectUtil.isNotEmpty(manipulatorAgvStationDeviceDriver.getDevice().getExtraValue().get("feedbackToLms"))
// && StrUtil.equals("true", manipulatorAgvStationDeviceDriver.getDevice().getExtraValue().get("feedbackToLms").toString())) {
// JSONObject jsonObject = new JSONObject();
// jsonObject.put("task_code", task_code);
// LuceneLogDto logDto1 = LuceneLogDto.builder()
// .device_code(manipulatorAgvStationDeviceDriver.getDevice_code())
// .content("取货完成反馈:" + jsonObject.toJSONString() + ";设备:" + manipulatorAgvStationDeviceDriver.getDeviceCode())
// .build();
// logDto1.setLog_level(4);
// luceneExecuteLogService.deviceExecuteLog(logDto1);
// acsToWmsService.actionFinishRequest2(jsonObject);
// }
// } else if (device.getDeviceDriver() instanceof PaperTubePickSiteDeviceDriver) {
// paperTubePickSiteDeviceDriver = (PaperTubePickSiteDeviceDriver) device.getDeviceDriver();
// try {
// paperTubePickSiteDeviceDriver.writing(3);
// } catch (Exception e) {
// e.printStackTrace();
// }
// if (paperTubePickSiteDeviceDriver.getAction() == 1
// && paperTubePickSiteDeviceDriver.getError() == 0 && paperTubePickSiteDeviceDriver.getMode() == 2) {
// 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 {
// message = "设备号:" + device_code + ",动作信号:" + paperTubePickSiteDeviceDriver.getAction() + "报警信号:" + paperTubePickSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件";
// LuceneLogDto logDto = LuceneLogDto.builder()
// .device_code(this.getDeviceCode())
// .content(message)
// .build();
// logDto.setLog_level(4);
// luceneExecuteLogService.deviceExecuteLog(logDto);
// }
// } else if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) {
// standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver();
//
// try {
// standardInspectSiteDeviceDriver.writing(1);
// } catch (Exception e) {
// e.printStackTrace();
// }
// if ((standardInspectSiteDeviceDriver.getMove() == 1 && standardInspectSiteDeviceDriver.getAction() == 1 && standardInspectSiteDeviceDriver.getError() == 0)) {
// 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 {
// message = "设备号:" + device_code + "光电信号:" + standardInspectSiteDeviceDriver.getMove() + ",动作信号:" + standardInspectSiteDeviceDriver.getAction() + "报警信号:" + standardInspectSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件";
// LuceneLogDto logDto = LuceneLogDto.builder()
// .device_code(this.getDeviceCode())
// .content(message)
// .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);
// }
//
// }
// 到达放货点
//(Itype=1/2/3,需要WCS反馈)

8
acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/region/service/impl/RegionServiceImpl.java

@ -15,6 +15,7 @@ import org.nl.acs.region.service.mapper.RegionMapper;
import org.nl.common.exception.BadRequestException;
import org.nl.config.language.LangProcess;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
@ -27,15 +28,14 @@ import java.util.List;
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class)
public class RegionServiceImpl extends CommonServiceImpl<RegionMapper,Region> implements RegionService{
@Autowired
RegionService regionService;
@Autowired
RegionMapper regionMapper;
private RegionMapper regionMapper;
@Override
public JSONArray queryAllRegions() {
//查询所有区域
List<Region> list = regionService.lambdaQuery().list();
List<Region> list = this.lambdaQuery().list();
if (CollectionUtil.isEmpty(list)) {
throw new BadRequestException(LangProcess.msg("error_no_regional"));
}

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

@ -28,6 +28,7 @@ import org.nl.hand.service.PdaService;
import org.nl.system.service.dict.dao.Dict;
import org.nl.system.service.dict.dao.mapper.SysDictMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Service;
@ -49,7 +50,7 @@ public class PdaServiceImpl implements PdaService {
DeviceAppService deviceAppService;
@Autowired
RegionService regionService;
private RegionService regionService;
@Autowired
private TaskService taskserver;

0
acs2/nladmin-ui/src/assets/images/newloge.png → acs2/nladmin-ui/src/assets/images/background333.png

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

BIN
acs2/nladmin-ui/src/assets/images/newlogo.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

4
acs2/nladmin-ui/src/layout/components/Sidebar/Logo.vue

@ -14,7 +14,7 @@
</template>
<script>
import Logo from '@/assets/images/newloge.png'
import Logo from '@/assets/images/newlogo.png'
import variables from '@/assets/styles/variables.scss'
export default {
name: 'SidebarLogo',
@ -26,7 +26,7 @@ export default {
},
data() {
return {
title: '喜临门ACS系统',
title: '山东金宝铜箔ACS系统',
logo: Logo,
title_param: 'platform'
}

Loading…
Cancel
Save