修改jdk版本
This commit is contained in:
@@ -112,14 +112,6 @@
|
||||
<warName>${project.artifactId}</warName>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<configuration>
|
||||
<source>17</source>
|
||||
<target>17</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
<finalName>${project.artifactId}</finalName>
|
||||
</build>
|
||||
|
||||
@@ -151,7 +151,7 @@ public class ToWmsServiceImpl implements IToWmsService {
|
||||
}
|
||||
MydoJob outJob = outMydoJobs.get(0);
|
||||
//料箱出库 需同步电子标签
|
||||
if("23".equals(outJob.getInOut())){
|
||||
if("23".equals(outJob.getInOrOut())){
|
||||
//查询拣选工位绑定的电子标签
|
||||
BasTag tagParam = new BasTag();
|
||||
tagParam.setPickAdd(wmsJobRequest.getPickSsj());
|
||||
|
||||
@@ -6,6 +6,7 @@ import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.ruoyi.bas.basJobId.service.IBasJobIdService;
|
||||
import com.ruoyi.common.annotation.DataScope;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
@@ -182,7 +183,7 @@ public class OutStockoutServiceImpl implements IOutStockoutService
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!stringBuilder.isEmpty()){
|
||||
if (!StrUtil.isEmpty(stringBuilder.toString())){
|
||||
return AjaxResult.warn(stringBuilder.toString());
|
||||
}
|
||||
return AjaxResult.success();
|
||||
|
||||
@@ -41,55 +41,59 @@ public class TagReadThread implements Runnable{
|
||||
for (Long tagId : tagGroup.keySet()) {
|
||||
BasTag basTag = basTagService.selectBasTagById(tagId);
|
||||
try (Socket socket = getSocket(basTag)){
|
||||
/** 接收电子标签指令 */
|
||||
String content = ElectronicTagClient.receiveHexData(socket,0);//读取值
|
||||
if (!content.isEmpty()) {
|
||||
System.out.println("读取电子标签值:" + content);
|
||||
}
|
||||
for (TagTask tagTask : tagGroup.get(tagId)) {
|
||||
//将拍灯指令整理成数组
|
||||
String[] split = content.split("5A");
|
||||
for (String s : split) {
|
||||
if (s.length() == 10) {
|
||||
String type = s.substring(4, 6);//指令类型 01是下发成功反馈 12是拍灭绿灯指令
|
||||
if ("12".equals(type)) {
|
||||
//12为 绿色拍灯指令
|
||||
int address = new BigInteger(s.substring(2, 4), 16).intValue();
|
||||
if (address == basTag.getId()) {
|
||||
//更新当前子任务状态
|
||||
tagTask.setStatus("2");
|
||||
tagTaskMapper.updateTagTask(tagTask);
|
||||
System.out.println("更新任务状态:" + tagTask.getProductId() + ",id:" + tagTask.getId());
|
||||
TagTask param = new TagTask();
|
||||
param.setTagId(tagId);
|
||||
List<TagTask> tagTasks = tagTaskMapper.selectTagTaskList(param);
|
||||
if (CollUtil.isNotEmpty(tagTasks)){
|
||||
if (tagTasks.stream().allMatch(x-> "2".equals(x.getStatus()))){
|
||||
//全部拣选完成 灭灯逻辑
|
||||
//灭灯
|
||||
boolean b = sendDzbqOff(basTag);
|
||||
if (b) {
|
||||
//出库确认
|
||||
TrayCodeMakeSure trayCodeMakeSure = new TrayCodeMakeSure();
|
||||
trayCodeMakeSure.setTrayCode(basTag.getTrayCode());
|
||||
AjaxResult ajaxResult = pdaService.outMakeSure(trayCodeMakeSure);
|
||||
if (ajaxResult.isSuccess()){
|
||||
//删除标签绑定信息
|
||||
basTag.setSendCompleted("0");
|
||||
basTag.setTrayCode("");
|
||||
basTagService.updateBasTag(basTag);
|
||||
//删除tagList
|
||||
tagTaskMapper.deleteTagTaskByIds(tagTasks.stream().map(TagTask::getId).toArray(Long[]::new));
|
||||
while (true){
|
||||
/** 接收电子标签指令 */
|
||||
String content = ElectronicTagClient.receiveHexData(socket,0);//读取值
|
||||
if (!content.isEmpty()) {
|
||||
System.out.println("读取电子标签值:" + content);
|
||||
}
|
||||
for (TagTask tagTask : tagGroup.get(tagId)) {
|
||||
//将拍灯指令整理成数组
|
||||
String[] split = content.split("5A");
|
||||
for (String s : split) {
|
||||
if (s.length() == 10) {
|
||||
String type = s.substring(4, 6);//指令类型 01是下发成功反馈 12是拍灭绿灯指令
|
||||
if ("12".equals(type)) {
|
||||
//12为 绿色拍灯指令
|
||||
int address = new BigInteger(s.substring(2, 4), 16).intValue();
|
||||
if (address == basTag.getId()) {
|
||||
//更新当前子任务状态
|
||||
tagTask.setStatus("2");
|
||||
tagTaskMapper.updateTagTask(tagTask);
|
||||
System.out.println("更新任务状态:" + tagTask.getProductId() + ",id:" + tagTask.getId());
|
||||
TagTask param = new TagTask();
|
||||
param.setTagId(tagId);
|
||||
List<TagTask> tagTasks = tagTaskMapper.selectTagTaskList(param);
|
||||
if (CollUtil.isNotEmpty(tagTasks)){
|
||||
if (tagTasks.stream().allMatch(x-> "2".equals(x.getStatus()))){
|
||||
//全部拣选完成 灭灯逻辑
|
||||
//灭灯
|
||||
boolean b = sendDzbqOff(basTag);
|
||||
if (b) {
|
||||
//出库确认
|
||||
TrayCodeMakeSure trayCodeMakeSure = new TrayCodeMakeSure();
|
||||
trayCodeMakeSure.setTrayCode(basTag.getTrayCode());
|
||||
AjaxResult ajaxResult = pdaService.outMakeSure(trayCodeMakeSure);
|
||||
if (ajaxResult.isSuccess()){
|
||||
//删除标签绑定信息
|
||||
basTag.setSendCompleted("0");
|
||||
basTag.setTrayCode("");
|
||||
basTagService.updateBasTag(basTag);
|
||||
//删除tagList
|
||||
tagTaskMapper.deleteTagTaskByIds(tagTasks.stream().map(TagTask::getId).toArray(Long[]::new));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package com.ruoyi.out.tagTask.util;
|
||||
|
||||
import javax.xml.bind.DatatypeConverter;
|
||||
import java.io.*;
|
||||
import java.net.*;
|
||||
import java.util.Arrays;
|
||||
import java.util.HexFormat;
|
||||
|
||||
public class ElectronicTagClient {
|
||||
|
||||
@@ -85,11 +85,11 @@ public class ElectronicTagClient {
|
||||
|
||||
// 16进制字符串转字节数组
|
||||
public static byte[] hexStringToByteArray(String hexString) {
|
||||
return HexFormat.of().parseHex(hexString);
|
||||
return DatatypeConverter.parseHexBinary(hexString);
|
||||
}
|
||||
|
||||
// 字节数组转16进制字符串
|
||||
private static String byteArrayToHexString(byte[] bytes) {
|
||||
return HexFormat.of().formatHex(bytes).toUpperCase();
|
||||
return DatatypeConverter.printHexBinary(bytes).toUpperCase();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user