提交 a3c85b09 authored 作者: zhoushaopan's avatar zhoushaopan

feat(盘存模块): 释放读写机资源

释放读写机资源
上级 fe92153b
......@@ -76,6 +76,7 @@ public class ReadMachineBillController {
static{
//增加一个全局变量,只要加载过这个so就不再执行,除非进程重启才会清掉该变量。
if(System.getProperty("myapplibrary")==null){
log.info("myapplibrary:{}",System.getProperty("myapplibrary"));
System.setProperty("myapplibrary", "libModuleAPIJni.so");
System.loadLibrary("libModuleAPIJni");
}
......
......@@ -64,5 +64,4 @@ public interface ReadMachineBillService {
*/
void deleteReadMachineBillForDraft(SaveDefatVos saveDefatVos);
void readDevice();
}
......@@ -22,16 +22,11 @@ import com.tykj.dev.readmachine.devreadmachine.repository.ReadMachineBillDao;
import com.tykj.dev.readmachine.devreadmachine.service.ReadMachineBillService;
import com.tykj.dev.readmachine.devreadmachine.service.ReadMachineLibraryService;
import com.tykj.dev.readmachine.devreadmachine.util.BeanDtoVoUtils;
import com.tykj.dev.rfid.timeTask.ReadUtils;
import com.tykj.dev.socket.MyWebSocket;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import javax.persistence.Transient;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
......@@ -222,35 +217,6 @@ public class ReadMachineBillServiceImpl implements ReadMachineBillService {
CompletableFuture.runAsync(()->readMachineLibraryService.batchDeleteEntity(saveDefatVos.getReadMachineLibraries()));
}
@Override
public void readDevice() {
List<String> rfids = startDeviceDetail();
List<DeviceLibrary> deviceLibraries = deviceLibraryService.findAllByRfids(rfids);
//可以查询出来装备的集合
List<DeviceLibrary> result = new ArrayList<>();
if (!deviceLibraries.isEmpty()){
deviceLibraries.forEach(deviceLibrary -> {
if (ObjectUtil.isNotNull(deviceLibrary)){
result.add(deviceLibrary);
myWebSocket.sendMessageForReadMachine(deviceLibrary);
}
});
}
}
/**
* 读取装备信息
*/
private List<String> startDeviceDetail(){
ReadUtils readUtils = new ReadUtils();
//先开启
readUtils.testinitreader();
//开始盘存
List<String> rfids = readUtils.testinventory1();
log.info("rfids:{}",rfids);
return rfids;
}
/**
* 构建条件插叙构造器
* @param selectBillVo 条件查询构造器
......
......@@ -12,7 +12,7 @@ import java.util.List;
@Data
@Slf4j
//@Component
@Component
public class ReadUtils {
/**
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论