fix: 斗山开发改动
This commit is contained in:
@@ -74,196 +74,65 @@ public class NDCAgvServiceImpl implements NDCAgvService {
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void sendAgvInstToNDC(String agv_system_type, Instruction inst) {
|
||||
log.info("sendAgvInstToNDC 指令下发NDC:" + "inst_code:" + inst.getInstruction_code() + ",agv_system_type:" + agv_system_type + ",agv_inst_type:" + inst.getAgv_inst_type() +
|
||||
",priority:" + inst.getPriority() + ",startAddress:" + inst.getStart_point_code() +
|
||||
log.info("sendAgvInstToNDC 指令下发NDC:" + "inst_code:" + inst.getInstruction_code() + ",agv_system_type:" + agv_system_type + ",agv_inst_type:" + inst.getAgv_inst_type() +
|
||||
",priority:" + inst.getPriority() + ",startAddress:" + inst.getStart_point_code() +
|
||||
",nextAddress:" + inst.getNext_point_code());
|
||||
if (StrUtil.equals(paramService.findByCode(AcsConfig.FORKAGV).getValue(), "1")) {
|
||||
if (!StrUtil.equals(agv_system_type, "1")) {
|
||||
String instcode = inst.getInstruction_code();
|
||||
int type = Integer.parseInt(inst.getAgv_inst_type());
|
||||
int priority = Integer.parseInt(inst.getPriority()) + 128;
|
||||
DeviceAppService appService = SpringContextHolder.getBean(DeviceAppServiceImpl.class);
|
||||
DeviceService deviceService = SpringContextHolder.getBean(DeviceServiceImpl.class);
|
||||
int startAddress = deviceService.queryAddressBydeviceCode(inst.getStart_point_code());
|
||||
int nextAddress = deviceService.queryAddressBydeviceCode(inst.getNext_point_code());
|
||||
int startAddress2 = deviceService.queryAddressBydeviceCode(inst.getStart_point_code2());
|
||||
int nextAddress2 = deviceService.queryAddressBydeviceCode(inst.getNext_point_code2());
|
||||
byte ikeyhigh = (byte) IntToHexHigh(Integer.parseInt(instcode));
|
||||
byte ikeylow = (byte) IntToHexLow(Integer.parseInt(instcode));
|
||||
byte typehigh = (byte) IntToHexHigh(type);
|
||||
byte typelow = (byte) IntToHexLow(type);
|
||||
byte qhdhigh = (byte) IntToHexHigh(startAddress);
|
||||
byte qhdlow = (byte) IntToHexLow(startAddress);
|
||||
byte qhdhigh2 = (byte) IntToHexHigh(startAddress2);
|
||||
byte qhdlow2 = (byte) IntToHexLow(startAddress2);
|
||||
byte fhdhigh = (byte) IntToHexHigh(nextAddress);
|
||||
byte fhdlow = (byte) IntToHexLow(nextAddress);
|
||||
byte fhdhigh2 = (byte) IntToHexHigh(nextAddress2);
|
||||
byte fhdlow2 = (byte) IntToHexLow(nextAddress2);
|
||||
byte prioritylow = (byte) IntToHexLow(priority);
|
||||
|
||||
String str = "十进制下发:";
|
||||
String str1 = "十六进制下发:";
|
||||
str += "任务号 ikey:" + (Integer.parseInt(instcode));
|
||||
str1 += "任务号 ikey:" + hexToString(ikeyhigh & 0xFF) + hexToString(ikeylow & 0xFF);
|
||||
String instcode = inst.getInstruction_code();
|
||||
int type = Integer.parseInt(inst.getAgv_inst_type());
|
||||
int priority = Integer.parseInt(inst.getPriority()) + 128;
|
||||
DeviceService deviceService = SpringContextHolder.getBean(DeviceServiceImpl.class);
|
||||
int startAddress = deviceService.queryAddressBydeviceCode(inst.getStart_point_code());
|
||||
int nextAddress = deviceService.queryAddressBydeviceCode(inst.getNext_point_code());
|
||||
byte ikeyhigh = (byte) IntToHexHigh(Integer.parseInt(instcode));
|
||||
byte ikeylow = (byte) IntToHexLow(Integer.parseInt(instcode));
|
||||
byte typehigh = (byte) IntToHexHigh(type);
|
||||
byte typelow = (byte) IntToHexLow(type);
|
||||
byte qhdhigh = (byte) IntToHexHigh(startAddress);
|
||||
byte qhdlow = (byte) IntToHexLow(startAddress);
|
||||
byte fhdhigh = (byte) IntToHexHigh(nextAddress);
|
||||
byte fhdlow = (byte) IntToHexLow(nextAddress);
|
||||
|
||||
str += "指令类型 /type:" + (type);
|
||||
str1 += "指令类型 /type:" + hexToString(typehigh & 0xFF) + hexToString(typelow & 0xFF);
|
||||
String str = "十进制下发:";
|
||||
String str1 = "十六进制下发:";
|
||||
str += "任务号 ikey:" + (Integer.parseInt(instcode));
|
||||
str1 += "任务号 ikey:" + hexToString(ikeyhigh & 0xFF) + hexToString(ikeylow & 0xFF);
|
||||
|
||||
str += "取货点 /qhd:" + (startAddress);
|
||||
str1 += "取货点 /qhd:" + hexToString(qhdhigh & 0xFF) + hexToString(qhdlow & 0xFF);
|
||||
str += "放货点 /fhd:" + (nextAddress);
|
||||
str1 += "放货点 /fhd:" + hexToString(fhdhigh & 0xFF) + hexToString(fhdlow & 0xFF);
|
||||
str += "指令类型 /type:" + (type);
|
||||
str1 += "指令类型 /type:" + hexToString(typehigh & 0xFF) + hexToString(typelow & 0xFF);
|
||||
|
||||
str += "取货点2 /qhd2:" + (startAddress2);
|
||||
str1 += "取货点2 /qhd2:" + hexToString(qhdhigh2 & 0xFF) + hexToString(qhdlow2 & 0xFF);
|
||||
str += "放货点2 /fhd2:" + (nextAddress2);
|
||||
str1 += "放货点2 /fhd2:" + hexToString(fhdhigh2 & 0xFF) + hexToString(fhdlow2 & 0xFF);
|
||||
str += "取货点 /qhd:" + (startAddress);
|
||||
str1 += "取货点 /qhd:" + hexToString(qhdhigh & 0xFF) + hexToString(qhdlow & 0xFF);
|
||||
str += "放货点 /fhd:" + (nextAddress);
|
||||
str1 += "放货点 /fhd:" + hexToString(fhdhigh & 0xFF) + hexToString(fhdlow & 0xFF);
|
||||
|
||||
str += "优先级 /priority:" + (priority);
|
||||
str1 += "优先级 /priority:" + hexToString(prioritylow & 0xFF);
|
||||
|
||||
byte[] b = new byte[]{};
|
||||
if (type == 1) {
|
||||
b = new byte[]{(byte) 0X87, (byte) 0XCD,
|
||||
(byte) 0X00, (byte) 0X08,
|
||||
(byte) 0X00, (byte) 0X16,
|
||||
(byte) 0X00, (byte) 0X01,
|
||||
(byte) 0X00, (byte) 0X71,
|
||||
(byte) 0X00, (byte) 0X12,
|
||||
(byte) 0X01, prioritylow,
|
||||
(byte) 0X00, (byte) 0X01,
|
||||
(byte) ikeyhigh, (byte) ikeylow,
|
||||
(byte) ikeyhigh, (byte) ikeylow,
|
||||
(byte) typehigh, (byte) typelow,
|
||||
(byte) qhdhigh, (byte) qhdlow,
|
||||
(byte) qhdhigh2, (byte) qhdlow2,
|
||||
(byte) fhdhigh, (byte) fhdlow,
|
||||
(byte) fhdhigh2, (byte) fhdlow2
|
||||
};
|
||||
} else if (type == 2) {
|
||||
b = new byte[]{(byte) 0X87, (byte) 0XCD,
|
||||
(byte) 0X00, (byte) 0X08,
|
||||
(byte) 0X00, (byte) 0X16,
|
||||
(byte) 0X00, (byte) 0X01,
|
||||
(byte) 0X00, (byte) 0X71,
|
||||
(byte) 0X00, (byte) 0X12,
|
||||
(byte) 0X01, prioritylow,
|
||||
(byte) 0X00, (byte) 0X01,
|
||||
(byte) ikeyhigh, (byte) ikeylow,
|
||||
(byte) ikeyhigh, (byte) ikeylow,
|
||||
(byte) typehigh, (byte) typelow,
|
||||
(byte) qhdhigh, (byte) qhdlow,
|
||||
(byte) 0X00, (byte) 0X00,
|
||||
(byte) fhdhigh, (byte) fhdlow,
|
||||
(byte) 0X00, (byte) 0X00
|
||||
};
|
||||
} else if (type == 3) {
|
||||
b = new byte[]{(byte) 0X87, (byte) 0XCD,
|
||||
(byte) 0X00, (byte) 0X08,
|
||||
(byte) 0X00, (byte) 0X16,
|
||||
(byte) 0X00, (byte) 0X01,
|
||||
(byte) 0X00, (byte) 0X71,
|
||||
(byte) 0X00, (byte) 0X12,
|
||||
(byte) 0X01, prioritylow,
|
||||
(byte) 0X00, (byte) 0X01,
|
||||
(byte) ikeyhigh, (byte) ikeylow,
|
||||
(byte) ikeyhigh, (byte) ikeylow,
|
||||
(byte) typehigh, (byte) typelow,
|
||||
(byte) qhdhigh, (byte) qhdlow,
|
||||
(byte) qhdhigh2, (byte) qhdlow2,
|
||||
(byte) fhdhigh, (byte) fhdlow,
|
||||
(byte) fhdhigh2, (byte) fhdlow2
|
||||
};
|
||||
}
|
||||
log.info("下发AGV作业指令 --{}", str1);
|
||||
log.info("下发AGV作业指令--{}", str);
|
||||
log.info("下发agv指令数据--{}", Bytes2HexString(b));
|
||||
|
||||
if (StrUtil.equals(agv_system_type, "2")) {
|
||||
TwoNDCSocketConnectionAutoRun.write(b);
|
||||
}
|
||||
} else {
|
||||
|
||||
String instcode = inst.getInstruction_code();
|
||||
int startHeight = Integer.parseInt(StrUtil.isEmpty(inst.getStart_height()) ? "0" : inst.getStart_height());
|
||||
int nextHeight = Integer.parseInt(StrUtil.isEmpty(inst.getNext_height()) ? "0" : inst.getNext_height());
|
||||
//默认取货放货高度都为0
|
||||
//int type = Integer.parseInt(inst.getInstruction_type());
|
||||
int type = 4;
|
||||
if (startHeight != 0 && nextHeight != 0) {
|
||||
//取货放货高度都不为0
|
||||
type = 1;
|
||||
} else if (startHeight != 0 && nextHeight == 0) {
|
||||
//取货高度不为0 放货高度为0
|
||||
type = 2;
|
||||
} else if (startHeight == 0 && nextHeight != 0) {
|
||||
//取货高度为0 放货高度不为0
|
||||
type = 3;
|
||||
}
|
||||
int priority = Integer.parseInt(inst.getPriority()) + 128;
|
||||
DeviceAppService appService = SpringContextHolder.getBean(DeviceAppServiceImpl.class);
|
||||
DeviceService deviceService = SpringContextHolder.getBean(DeviceServiceImpl.class);
|
||||
int startAddress = deviceService.queryAddressBydeviceCode(inst.getStart_point_code());
|
||||
int nextAddress = deviceService.queryAddressBydeviceCode(inst.getNext_point_code());
|
||||
|
||||
byte ikeyhigh = (byte) IntToHexHigh(Integer.parseInt(instcode));
|
||||
byte ikeylow = (byte) IntToHexLow(Integer.parseInt(instcode));
|
||||
byte typehigh = (byte) IntToHexHigh(type);
|
||||
byte typelow = (byte) IntToHexLow(type);
|
||||
byte qhdhigh = (byte) IntToHexHigh(startAddress);
|
||||
byte qhdlow = (byte) IntToHexLow(startAddress);
|
||||
byte fhdhigh = (byte) IntToHexHigh(nextAddress);
|
||||
byte fhdlow = (byte) IntToHexLow(nextAddress);
|
||||
byte prioritylow = (byte) IntToHexLow(priority);
|
||||
|
||||
byte shhigh = (byte) IntToHexHigh(startHeight);
|
||||
byte shlow = (byte) IntToHexLow(startHeight);
|
||||
|
||||
byte nhhigh = (byte) IntToHexHigh(nextHeight);
|
||||
byte nhlow = (byte) IntToHexLow(nextHeight);
|
||||
|
||||
String str = "十进制下发:";
|
||||
String str1 = "十六进制下发:";
|
||||
str += "ikey:" + (Integer.parseInt(instcode));
|
||||
str1 += "ikey:" + hexToString(ikeyhigh & 0xFF) + hexToString(ikeylow & 0xFF);
|
||||
|
||||
str += "/type:" + (type);
|
||||
str1 += "/type:" + hexToString(typehigh & 0xFF) + hexToString(typelow & 0xFF);
|
||||
|
||||
str += "/qhd:" + (startAddress);
|
||||
str1 += "/qhd:" + hexToString(qhdhigh & 0xFF) + hexToString(qhdlow & 0xFF);
|
||||
str += "/fhd:" + (nextAddress);
|
||||
str1 += "/fhd:" + hexToString(fhdhigh & 0xFF) + hexToString(fhdlow & 0xFF);
|
||||
|
||||
str += "/priority:" + (priority);
|
||||
str1 += "/priority:" + hexToString(prioritylow & 0xFF);
|
||||
|
||||
System.out.println(str);
|
||||
System.out.println(str1);
|
||||
byte[] b = new byte[]{(byte) 0X87, (byte) 0XCD,
|
||||
byte[] b = new byte[]{};
|
||||
if (type == 1) {
|
||||
b = new byte[]{(byte) 0X87, (byte) 0XCD,
|
||||
(byte) 0X00, (byte) 0X08,
|
||||
(byte) 0X00, (byte) 0X16,
|
||||
(byte) 0X00, (byte) 0X12,
|
||||
(byte) 0X00, (byte) 0X01,
|
||||
(byte) 0X00, (byte) 0X71,
|
||||
(byte) 0X00, (byte) 0X12,
|
||||
(byte) 0X01, prioritylow,
|
||||
(byte) 0X01, (byte) 0X80,
|
||||
(byte) 0X00, (byte) 0X01,
|
||||
(byte) ikeyhigh, (byte) ikeylow,
|
||||
(byte) ikeyhigh, (byte) ikeylow,
|
||||
(byte) typehigh, (byte) typelow,
|
||||
(byte) qhdhigh, (byte) qhdlow,
|
||||
(byte) fhdhigh, (byte) fhdlow,
|
||||
(byte) shhigh, (byte) shlow,
|
||||
(byte) nhhigh, (byte) nhlow
|
||||
};
|
||||
log.info("下发AGV作业指令 --{}", str1);
|
||||
log.info("下发AGV作业指令--{}", str);
|
||||
log.info("下发agv指令数据--{}", Bytes2HexString(b));
|
||||
OneNDCSocketConnectionAutoRun.write(b);
|
||||
}
|
||||
log.info("下发AGV作业指令 --{}", str1);
|
||||
log.info("下发AGV作业指令--{}", str);
|
||||
log.info("下发agv指令数据--{}", Bytes2HexString(b));
|
||||
|
||||
if (StrUtil.equals(agv_system_type, "2")) {
|
||||
TwoNDCSocketConnectionAutoRun.write(b);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -337,7 +206,7 @@ public class NDCAgvServiceImpl implements NDCAgvService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] sendAgvTwoModeInst(int phase, int index, int result,int offset,int quantity) {
|
||||
public byte[] sendAgvTwoModeInst(int phase, int index, int result, int offset, int quantity) {
|
||||
if (phase < 0 || index < 0)
|
||||
return null;
|
||||
byte indexhigh = (byte) IntToHexHigh(index);
|
||||
@@ -364,7 +233,7 @@ public class NDCAgvServiceImpl implements NDCAgvService {
|
||||
|
||||
|
||||
log.info("反馈agv动作数据--index:" + hexToString(indexhigh & 0xFF) + hexToString(indexlow & 0xFF) + ",phase:"
|
||||
+ hexToString(phasehigh & 0xFF) + hexToString(phaselow & 0xFF)+",是否侧移: "+(offset == 1?"侧移":"不测移") + ",偏离量: " + quantity);
|
||||
+ hexToString(phasehigh & 0xFF) + hexToString(phaselow & 0xFF) + ",是否侧移: " + (offset == 1 ? "侧移" : "不测移") + ",偏离量: " + quantity);
|
||||
|
||||
System.out.println("反馈agv动作数据:" + Bytes2HexString(b));
|
||||
return b;
|
||||
@@ -506,7 +375,6 @@ public class NDCAgvServiceImpl implements NDCAgvService {
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public Map<String, AgvDto> findAllAgvFromCache() {
|
||||
return AGVDeviceStatus;
|
||||
|
||||
@@ -197,7 +197,7 @@ public class TwoNDCSocketConnectionAutoRun extends AbstractAutoRunnable {
|
||||
}
|
||||
//任务完毕
|
||||
//(无车id及状态)
|
||||
else if (phase == 0x14) {
|
||||
else if (phase == 0x0A) {
|
||||
if (ObjectUtil.isEmpty(inst)) {
|
||||
log.info("未找到指令号{}对应的指令", ikey);
|
||||
} else {
|
||||
|
||||
@@ -135,7 +135,7 @@ public class DeviceDto implements Serializable {
|
||||
private String en_device_name;
|
||||
|
||||
/**
|
||||
* 设备印尼名称
|
||||
* 设备韩国名称
|
||||
*/
|
||||
private String in_device_name;
|
||||
private String ko_device_name;
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -266,7 +266,6 @@ public class StandardOrdinarySiteDeviceDriver extends AbstractDeviceDriver imple
|
||||
DeviceDto dto = deviceservice.findByCode(this.getDevice().getDevice_code());
|
||||
jo.put("zh_device_name",dto.getZh_device_name());
|
||||
jo.put("en_device_name",dto.getEn_device_name());
|
||||
jo.put("in_device_name",dto.getIn_device_name());
|
||||
jo.put("mode", mode);
|
||||
jo.put("move", move);
|
||||
jo.put("action", action);
|
||||
|
||||
@@ -51,8 +51,6 @@ public class InstructionController {
|
||||
|
||||
@GetMapping("/reload")
|
||||
@Log("数据同步")
|
||||
|
||||
|
||||
public ResponseEntity<Object> reload() {
|
||||
instructionService.reload();
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
|
||||
@@ -11,7 +11,7 @@ import java.util.Map;
|
||||
|
||||
|
||||
public class InitLocaleResolver implements LocaleResolver {
|
||||
public static Map<String,String> Language_Country = MapOf.of("id","in-ID","in","in-ID","en-US,en;q=0.9","en-US","en","en-US","zh","zh-CN");
|
||||
public static Map<String,String> Language_Country = MapOf.of("id","in-ID","in","in-ID","en-US,en;q=0.9","en-US","en","en-US","zh","zh-CN","ko","ko-KR");
|
||||
public static String language = "";
|
||||
@Override
|
||||
public Locale resolveLocale(HttpServletRequest request) {
|
||||
|
||||
@@ -15,8 +15,10 @@ import org.nl.system.service.dict.dao.Dict;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.HttpRequestHandler;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
@@ -84,7 +86,8 @@ public class HandController {
|
||||
@ApiOperation("查询未完成指令")
|
||||
@SaIgnore
|
||||
//@PreAuthorize("@el.check('sect:list')")
|
||||
public ResponseEntity<Object> querytasks(@RequestBody HeadTaskDto dto) {
|
||||
public ResponseEntity<Object> querytasks(@RequestBody HeadTaskDto dto, HttpServletRequest request ) {
|
||||
request.getHeader("Accept-Language");
|
||||
return new ResponseEntity<>(handService.querytasks(dto), HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
@@ -156,6 +156,7 @@ public class SysDictServiceImpl extends ServiceImpl<SysDictMapper, Dict> impleme
|
||||
dic.setZh_label(dict.getZh_label());
|
||||
dic.setEn_label(dict.getEn_label());
|
||||
dic.setIn_label(dict.getIn_label());
|
||||
dic.setKo_label(dict.getKo_label());
|
||||
sysDictMapper.updateById(dic);
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user