fix: 手持、国际化开发

This commit is contained in:
2024-08-07 20:26:55 +08:00
parent cd39fa836a
commit 542f96b539
13 changed files with 344 additions and 173 deletions

View File

@@ -1578,7 +1578,7 @@ public class DeviceServiceImpl extends CommonServiceImpl<DeviceMapper, Device> i
Iterator iterator = storageCells.iterator();
while (iterator.hasNext()) {
StorageCellDto storageCellDto = (StorageCellDto) iterator.next();
if (storageCellDto.getAddress() == code) {
if ( storageCellDto!=null && storageCellDto.getAddress() == code) {
return storageCellDto.getStorage_code();
}
}

View File

@@ -432,54 +432,18 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
for (int i = 0; i < datas.size(); i++) {
JSONObject jsonObject = datas.getJSONObject(i);
String device_code = jsonObject.getString("device_code");
String task_code = jsonObject.getString("task_code");
//1-允许取放; 2-允许离开
//1-允许取放;
String option = jsonObject.getString("option");
Instruction inst = instructionService.findByTaskcode(task_code);
if (ObjectUtil.isEmpty(inst)) {
JSONObject jo = new JSONObject();
jo.put("task_code", task_code);
jo.put("message", "未找到对应任务");
errArr.add(jo);
continue;
} else {
String carNo = inst.getCarno();
if (ObjectUtil.isEmpty(carNo)) {
JSONObject jo = new JSONObject();
jo.put("task_code", task_code);
jo.put("message", "未找到任务对应车号");
errArr.add(jo);
continue;
} else {
Device device = deviceAppService.findDeviceByCode(carNo);
AgvNdcTwoDeviceDriver agvNdcTwoDeviceDriver;
if (device.getDeviceDriver() instanceof AgvNdcTwoDeviceDriver) {
agvNdcTwoDeviceDriver = (AgvNdcTwoDeviceDriver) device.getDeviceDriver();
int phase = agvNdcTwoDeviceDriver.getPhase();
if (phase == 0x03 || phase == 0x05 || phase == 0x08) {
StandardOrdinarySiteDeviceDriver standardOrdinarySiteDeviceDriver;
Device device_k = deviceAppService.findDeviceByCode(device_code + "_K");
Device device_m = deviceAppService.findDeviceByCode(device_code + "_M");
if (device_k.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) {
standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device_k.getDeviceDriver();
standardOrdinarySiteDeviceDriver.setOption(Integer.parseInt(option));
standardOrdinarySiteDeviceDriver.setTask_code(task_code);
}
if (device_m.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) {
standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device_m.getDeviceDriver();
standardOrdinarySiteDeviceDriver.setOption(Integer.parseInt(option));
standardOrdinarySiteDeviceDriver.setTask_code(task_code);
}
} else {
JSONObject jo = new JSONObject();
jo.put("task_code", task_code);
jo.put("message", "AGV未就绪无法设置");
errArr.add(jo);
continue;
}
}
}
StandardOrdinarySiteDeviceDriver standardOrdinarySiteDeviceDriver;
Device device_k = deviceAppService.findDeviceByCode(device_code);
Device device_m = deviceAppService.findDeviceByCode(device_code);
if (device_k.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) {
standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device_k.getDeviceDriver();
standardOrdinarySiteDeviceDriver.setOption(Integer.parseInt(option));
}
if (device_m.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) {
standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device_m.getDeviceDriver();
standardOrdinarySiteDeviceDriver.setOption(Integer.parseInt(option));
}
}
}

View File

@@ -641,7 +641,6 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
if (ObjectUtil.isEmpty(route) && !(start_device_code.equals(next_device_code))) {
throw new BadRequestException(LangProcess.msg("error_isNull", "route"));
}
//判断是否是仙工AGV
if (shortPathsList.size() > 0 && StrUtil.equals(shortPathsList.get(0).getType(), CommonFinalParam.ONE)) {
Device deviceByCode = deviceAppService.findDeviceByCode(dto.getStart_device_code());

View File

@@ -1,6 +1,7 @@
package org.nl.hand.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.IdUtil;
@@ -372,24 +373,26 @@ public class HandServiceImpl implements HandService {
throw new BadRequestException(LangProcess.msg("error_no_ins"));
}
JSONArray data = new JSONArray();
for (int i = 0; i < list.size(); i++) {
Device deviceCodeStart = deviceAppService.findDeviceByCode(list.get(i).getStart_device_code());
Device deviceCodeEnd = deviceAppService.findDeviceByCode(list.get(i).getNext_device_code());
if (CollUtil.isNotEmpty(list)) {
for (int i = 0; i < list.size(); i++) {
Device deviceCodeStart = deviceAppService.findDeviceByCode(list.get(i).getStart_device_code());
Device deviceCodeEnd = deviceAppService.findDeviceByCode(list.get(i).getNext_device_code());
JSONObject task = new JSONObject();
task.put("task_uuid",list.get(i).getTask_id());
task.put("task_no",list.get(i).getTask_code());
task.put("start_devicecode",list.get(i).getStart_device_code());
task.put("start_en_devicecode",deviceCodeStart.getEn_device_name());
task.put("start_ko_devicecode",deviceCodeStart.getKo_device_name());
task.put("next_devicecode",list.get(i).getNext_device_code());
task.put("next_en_devicecode",deviceCodeEnd.getEn_device_name());
task.put("next_ko_devicecode",deviceCodeEnd.getKo_device_name());
task.put("task_status",list.get(i).getTask_status());
task.put("priority",list.get(i).getPriority());
task.put("create_time",list.get(i).getCreate_time());
task.put("carrier",list.get(i).getVehicle_code());
data.add(task);
JSONObject task = new JSONObject();
task.put("task_uuid", list.get(i).getTask_id());
task.put("task_no", list.get(i).getTask_code());
task.put("start_devicecode", list.get(i).getStart_device_code());
task.put("start_en_devicecode", deviceCodeStart.getEn_device_name());
task.put("start_ko_devicecode", deviceCodeStart.getKo_device_name());
task.put("next_devicecode", list.get(i).getNext_device_code());
task.put("next_en_devicecode", deviceCodeEnd.getEn_device_name());
task.put("next_ko_devicecode", deviceCodeEnd.getKo_device_name());
task.put("task_status", list.get(i).getTask_status());
task.put("priority", list.get(i).getPriority());
task.put("create_time", list.get(i).getCreate_time());
task.put("carrier", list.get(i).getVehicle_code());
data.add(task);
}
}
JSONObject resultJson = new JSONObject();
resultJson.put("message", LangProcess.msg("universal_directives_message1"));

View File

@@ -10,7 +10,7 @@ spring:
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: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:lzhl_two_acs2}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=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
username: ${DB_USER:root}
# password: ${DB_PWD:Root.123456}