称重优化
This commit is contained in:
@@ -4,7 +4,6 @@ import com.alibaba.excel.annotation.ExcelIgnore;
|
|||||||
import com.alibaba.excel.annotation.ExcelProperty;
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import top.wms.admin.common.enums.LightLevelEnumConverter;
|
|
||||||
import top.wms.admin.common.model.resp.BaseDetailResp;
|
import top.wms.admin.common.model.resp.BaseDetailResp;
|
||||||
|
|
||||||
import java.io.Serial;
|
import java.io.Serial;
|
||||||
|
|||||||
@@ -39,7 +39,6 @@ import top.continew.starter.file.excel.util.ExcelUtils;
|
|||||||
import top.continew.starter.web.util.FileUploadUtils;
|
import top.continew.starter.web.util.FileUploadUtils;
|
||||||
import top.wms.admin.common.constant.CacheConstants;
|
import top.wms.admin.common.constant.CacheConstants;
|
||||||
import top.wms.admin.common.context.UserContextHolder;
|
import top.wms.admin.common.context.UserContextHolder;
|
||||||
import top.wms.admin.common.enums.LightLevelEnum;
|
|
||||||
import top.wms.admin.common.util.SecureUtils;
|
import top.wms.admin.common.util.SecureUtils;
|
||||||
import top.wms.admin.material.mapper.MaterialInfoMapper;
|
import top.wms.admin.material.mapper.MaterialInfoMapper;
|
||||||
import top.wms.admin.material.model.entity.MaterialInfoDO;
|
import top.wms.admin.material.model.entity.MaterialInfoDO;
|
||||||
@@ -232,7 +231,9 @@ public class MaterialInfoServiceImpl extends BaseServiceImpl<MaterialInfoMapper,
|
|||||||
? row.getMaterialProcess()
|
? row.getMaterialProcess()
|
||||||
: null);
|
: null);
|
||||||
materialDO.setMaterialTypeId(materialTypeMap.get(row.getTypeName()));
|
materialDO.setMaterialTypeId(materialTypeMap.get(row.getTypeName()));
|
||||||
materialDO.setLightLevel(StrUtil.isNotBlank(row.getLightLevelName()) ? Integer.parseInt(row.getLightLevelName()) : null);
|
materialDO.setLightLevel(StrUtil.isNotBlank(row.getLightLevelName())
|
||||||
|
? Integer.parseInt(row.getLightLevelName())
|
||||||
|
: null);
|
||||||
// 修改 or 新增
|
// 修改 or 新增
|
||||||
if (UPDATE.validate(req.getDuplicateName(), row.getMaterialName(), existName)) {
|
if (UPDATE.validate(req.getDuplicateName(), row.getMaterialName(), existName)) {
|
||||||
materialDO.setMaterialName(row.getMaterialName());
|
materialDO.setMaterialName(row.getMaterialName());
|
||||||
|
|||||||
@@ -118,6 +118,11 @@
|
|||||||
<scope>system</scope>
|
<scope>system</scope>
|
||||||
<systemPath>${project.basedir}/src/main/resources/lib/jna.jar</systemPath>
|
<systemPath>${project.basedir}/src/main/resources/lib/jna.jar</systemPath>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>net.java.dev.jna</groupId>
|
||||||
|
<artifactId>jna</artifactId>
|
||||||
|
<version>5.13.0</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!-- 串口通信依赖 -->
|
<!-- 串口通信依赖 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
@@ -202,6 +207,9 @@
|
|||||||
<include>logback-spring.xml</include>
|
<include>logback-spring.xml</include>
|
||||||
</includes>
|
</includes>
|
||||||
</resource>
|
</resource>
|
||||||
|
<resource>
|
||||||
|
<directory>src/main/resources/lib</directory>
|
||||||
|
</resource>
|
||||||
</resources>
|
</resources>
|
||||||
<outputDirectory>${project.build.directory}/app/${config-path}</outputDirectory>
|
<outputDirectory>${project.build.directory}/app/${config-path}</outputDirectory>
|
||||||
</configuration>
|
</configuration>
|
||||||
|
|||||||
@@ -15,8 +15,6 @@ import top.wms.admin.controller.tcp.manager.ChannelManager;
|
|||||||
import top.wms.admin.controller.tcp.service.SaveBmpTaskService;
|
import top.wms.admin.controller.tcp.service.SaveBmpTaskService;
|
||||||
import top.wms.admin.material.mapper.MaterialInfoMapper;
|
import top.wms.admin.material.mapper.MaterialInfoMapper;
|
||||||
import top.wms.admin.material.model.entity.MaterialInfoDO;
|
import top.wms.admin.material.model.entity.MaterialInfoDO;
|
||||||
import top.wms.admin.material.model.resp.MaterialInfoResp;
|
|
||||||
import top.wms.admin.material.service.MaterialInfoService;
|
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@RestController
|
@RestController
|
||||||
@@ -39,7 +37,8 @@ public class VmCommandController {
|
|||||||
public String sendAndWait(@RequestBody JSONObject js) {
|
public String sendAndWait(@RequestBody JSONObject js) {
|
||||||
String materialCode = js.getString("materialCode");
|
String materialCode = js.getString("materialCode");
|
||||||
log.info("开始比对: {}", 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(ObjectUtil.isEmpty(materialInfoDO), "物料数据异常");
|
||||||
CheckUtils.throwIf(StrUtil.isBlank(materialInfoDO.getMaterialProcess()), "物料流程编码不能为空");
|
CheckUtils.throwIf(StrUtil.isBlank(materialInfoDO.getMaterialProcess()), "物料流程编码不能为空");
|
||||||
|
|
||||||
@@ -67,7 +66,7 @@ public class VmCommandController {
|
|||||||
if (!StrUtil.equals(split[1], materialInfoDO.getColor())) {
|
if (!StrUtil.equals(split[1], materialInfoDO.getColor())) {
|
||||||
throw new BusinessException("颜色不匹配");
|
throw new BusinessException("颜色不匹配");
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
double measuredDiameter = Double.parseDouble(split[2]);
|
double measuredDiameter = Double.parseDouble(split[2]);
|
||||||
double difference = Math.abs(measuredDiameter - materialInfoDO.getMaterialSpec());
|
double difference = Math.abs(measuredDiameter - materialInfoDO.getMaterialSpec());
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ public class NetCommon {
|
|||||||
// 设备信息
|
// 设备信息
|
||||||
String strUserName = "admin";
|
String strUserName = "admin";
|
||||||
String strPassword = "admin@123";
|
String strPassword = "admin@123";
|
||||||
String strIPAddr = "192.168.1.13";
|
String strIPAddr = "192.168.2.11";
|
||||||
int dwPort = 80;
|
int dwPort = 80;
|
||||||
int dwLoginProto = 1; // 私有协议
|
int dwLoginProto = 1; // 私有协议
|
||||||
|
|
||||||
|
|||||||
@@ -46,12 +46,12 @@ class BaseFun {
|
|||||||
String OsArch = getOsArch();
|
String OsArch = getOsArch();
|
||||||
|
|
||||||
if (OsArch.toLowerCase().startsWith("win32-x86")) {
|
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")) {
|
} 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";
|
String loadSDKLibrary = loadLibrary + "NetDEVSDK";
|
||||||
System.out.printf("[Load SDKLibrary Path : %s]\n", loadSDKLibrary);
|
System.out.printf("[Load SDKLibrary Path : %s]\n", loadSDKLibrary);
|
||||||
return loadSDKLibrary;
|
return loadSDKLibrary;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user