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