称重优化

This commit is contained in:
zc
2026-04-09 20:09:17 +08:00
parent 677349559c
commit c03bcfb043
6 changed files with 18 additions and 11 deletions

View File

@@ -118,6 +118,11 @@
<scope>system</scope>
<systemPath>${project.basedir}/src/main/resources/lib/jna.jar</systemPath>
</dependency>
<dependency>
<groupId>net.java.dev.jna</groupId>
<artifactId>jna</artifactId>
<version>5.13.0</version>
</dependency>
<!-- 串口通信依赖 -->
<dependency>
@@ -202,6 +207,9 @@
<include>logback-spring.xml</include>
</includes>
</resource>
<resource>
<directory>src/main/resources/lib</directory>
</resource>
</resources>
<outputDirectory>${project.build.directory}/app/${config-path}</outputDirectory>
</configuration>

View File

@@ -15,8 +15,6 @@ import top.wms.admin.controller.tcp.manager.ChannelManager;
import top.wms.admin.controller.tcp.service.SaveBmpTaskService;
import top.wms.admin.material.mapper.MaterialInfoMapper;
import top.wms.admin.material.model.entity.MaterialInfoDO;
import top.wms.admin.material.model.resp.MaterialInfoResp;
import top.wms.admin.material.service.MaterialInfoService;
@Slf4j
@RestController
@@ -39,7 +37,8 @@ public class VmCommandController {
public String sendAndWait(@RequestBody JSONObject js) {
String materialCode = js.getString("materialCode");
log.info("开始比对: {}", materialCode);
MaterialInfoDO materialInfoDO = materialInfoMapper.selectOne(new QueryWrapper<MaterialInfoDO>().eq("encoding", materialCode));
MaterialInfoDO materialInfoDO = materialInfoMapper.selectOne(new QueryWrapper<MaterialInfoDO>()
.eq("encoding", materialCode));
CheckUtils.throwIf(ObjectUtil.isEmpty(materialInfoDO), "物料数据异常");
CheckUtils.throwIf(StrUtil.isBlank(materialInfoDO.getMaterialProcess()), "物料流程编码不能为空");
@@ -67,7 +66,7 @@ public class VmCommandController {
if (!StrUtil.equals(split[1], materialInfoDO.getColor())) {
throw new BusinessException("颜色不匹配");
}
try {
double measuredDiameter = Double.parseDouble(split[2]);
double difference = Math.abs(measuredDiameter - materialInfoDO.getMaterialSpec());

View File

@@ -87,7 +87,7 @@ public class NetCommon {
// 设备信息
String strUserName = "admin";
String strPassword = "admin@123";
String strIPAddr = "192.168.1.13";
String strIPAddr = "192.168.2.11";
int dwPort = 80;
int dwLoginProto = 1; // 私有协议

View File

@@ -46,12 +46,12 @@ class BaseFun {
String OsArch = getOsArch();
if (OsArch.toLowerCase().startsWith("win32-x86")) {
loadLibrary = filePath + "\\wms-webapi\\src\\main\\resources\\lib\\win32\\";
loadLibrary = filePath + "\\config\\lib\\win32\\";
} else if (OsArch.toLowerCase().startsWith("win32-amd64")) {
loadLibrary = filePath + "\\wms-webapi\\src\\main\\resources\\lib\\win64\\";
loadLibrary = filePath + "\\config\\lib\\win64\\";
}
String loadSDKLibrary = loadLibrary + "NetDEVSDK";
System.out.printf("[Load SDKLibrary Path : %s]\n", loadSDKLibrary);
return loadSDKLibrary;
}
}
}