This commit is contained in:
zc
2026-04-13 11:03:05 +08:00
parent 5e2972e8c5
commit bfcb05893a
18 changed files with 60 additions and 777 deletions

View File

@@ -1,183 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>top.wms</groupId>
<artifactId>wms-admin</artifactId>
<version>3.6.0-SNAPSHOT</version>
</parent>
<artifactId>wms-webapi</artifactId>
<version>3.6.0-SNAPSHOT</version>
<description>API 及打包部署模块</description>
<licenses>
<license>
<name>GNU LESSER GENERAL PUBLIC LICENSE</name>
<url>http://www.gnu.org/licenses/lgpl.html</url>
</license>
</licenses>
<properties>
<config-path>config/</config-path>
<lib-path>lib/</lib-path>
<bin-path>bin/</bin-path>
<main-class>top.wms.admin.WmsAdminApplication</main-class>
</properties>
<dependencies>
<dependency>
<groupId>top.continew</groupId>
<artifactId>continew-starter-log-interceptor</artifactId>
<exclusions>
<exclusion>
<artifactId>tlog-core</artifactId>
<groupId>com.yomahub</groupId>
</exclusion>
<exclusion>
<artifactId>tlog-webflux</artifactId>
<groupId>com.yomahub</groupId>
</exclusion>
<exclusion>
<artifactId>tlog-feign</artifactId>
<groupId>com.yomahub</groupId>
</exclusion>
<exclusion>
<artifactId>tlog-okhttp</artifactId>
<groupId>com.yomahub</groupId>
</exclusion>
<exclusion>
<artifactId>tlog-resttemplate</artifactId>
<groupId>com.yomahub</groupId>
</exclusion>
<exclusion>
<artifactId>tlog-xxljob</artifactId>
<groupId>com.yomahub</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>top.wms</groupId>
<artifactId>wms-module-system</artifactId>
</dependency>
<dependency>
<groupId>top.wms</groupId>
<artifactId>wms-plugin-schedule</artifactId>
</dependency>
<dependency>
<groupId>top.wms</groupId>
<artifactId>wms-plugin-generator</artifactId>
</dependency>
<dependency>
<groupId>org.liquibase</groupId>
<artifactId>liquibase-core</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-s3</artifactId>
<version>1.12.780</version>
</dependency>
<dependency>
<groupId>com.fazecast</groupId>
<artifactId>jSerialComm</artifactId>
<version>2.9.2</version>
</dependency>
<dependency>
<groupId>jakarta.websocket</groupId>
<artifactId>jakarta.websocket-api</artifactId>
<version>2.1.0</version>
</dependency>
<dependency>
<groupId>com.hikvision</groupId>
<artifactId>MvCameraControlWrapper</artifactId>
<version>1.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/Library/MvCameraControlWrapper.jar</systemPath>
</dependency>
<dependency>
<groupId>com.sun.jna</groupId>
<artifactId>jna</artifactId>
<version>1.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/src/main/resources/lib/jna.jar</systemPath>
</dependency>
<dependency>
<groupId>com.fazecast</groupId>
<artifactId>jSerialComm</artifactId>
<version>2.10.5</version>
</dependency>
</dependencies>
<build>
<finalName>${project.parent.name}</finalName>
<plugins>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<excludes>
<exclude>${config-path}</exclude>
<exclude>db/</exclude>
<exclude>templates/</exclude>
<exclude>logback-spring.xml</exclude>
</excludes>
<archive>
<manifest>
<mainClass>${main-class}</mainClass>
<classpathPrefix>../${lib-path}</classpathPrefix>
<addClasspath>true</addClasspath>
<useUniqueVersions>false</useUniqueVersions>
</manifest>
<manifestEntries>
<Class-Path>../${config-path}</Class-Path>
</manifestEntries>
</archive>
<outputDirectory>${project.build.directory}/app/${bin-path}</outputDirectory>
</configuration>
</plugin>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/app/${lib-path}</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<executions>
<execution>
<id>copy-resources</id>
<phase>package</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<resources>
<resource>
<directory>src/main/resources/${config-path}</directory>
</resource>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>db/</include>
<include>templates/</include>
<include>logback-spring.xml</include>
</includes>
</resource>
</resources>
<outputDirectory>${project.build.directory}/app/${config-path}</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@@ -31,7 +31,6 @@ import java.util.List;
@CrudRequestMapping(value = "/fullWorkOrder/fullWorkOrder", api = {Api.PAGE, Api.ADD, Api.DELETE, Api.EXPORT})
public class FullWorkOrderController extends BaseController<FullWorkOrderService, FullWorkOrderResp, FullWorkOrderResp, FullWorkOrderQuery, FullWorkOrderReq> {
@PostMapping("/saveInfo")
public R saveFullWorkOrderDetail(@RequestBody List<FullWorkOrderInfoReq> infos) {
baseService.saveFullWorkOrderDetail(infos);

View File

@@ -10,10 +10,8 @@ import org.springframework.web.bind.annotation.RestController;
import top.continew.starter.web.model.R;
import java.nio.charset.Charset;
import java.util.Random;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
@@ -54,9 +52,9 @@ public class AHDZCConnect {
private ScheduledExecutorService executorService;
// todo 模拟数据生成
// private ScheduledFuture<?> mockDataTask;
// private final AtomicBoolean isMockDataRunning = new AtomicBoolean(false);
// private final Random random = new Random();
// private ScheduledFuture<?> mockDataTask;
// private final AtomicBoolean isMockDataRunning = new AtomicBoolean(false);
// private final Random random = new Random();
/**
* 初始化并启动电子秤服务
@@ -74,9 +72,9 @@ public class AHDZCConnect {
ScaleService();
start();
// todo 模拟数据生成
// isMockDataRunning.set(true);
// startMockData();
// todo 模拟数据生成
// isMockDataRunning.set(true);
// startMockData();
return R.ok();
}
@@ -337,8 +335,8 @@ public class AHDZCConnect {
log.info("停止电子秤线程...");
log.info("========================================");
// todo 模拟数据生成
// stopMockData();
// todo 模拟数据生成
// stopMockData();
try {
if (executorService != null && !executorService.isShutdown()) {
@@ -360,32 +358,32 @@ public class AHDZCConnect {
}
// todo 模拟数据生成
// private void startMockData() {
// if (executorService == null || executorService.isShutdown()) {
// log.warn("[模拟数据] 线程池未初始化或已关闭");
// return;
// }
//
// mockDataTask = executorService.scheduleAtFixedRate(() -> {
// if (!isMockDataRunning.get()) {
// return;
// }
//
// try {
// ScaleWebSocketHandler.sendMessage(String.valueOf(random.nextInt(100) + 1));
// log.debug("[模拟数据] 发送重量数据: 37.8");
// } catch (Exception e) {
// log.error("[模拟数据] 发送异常: {}", e.getMessage());
// }
// }, 0, 1, TimeUnit.SECONDS);
// }
//
// private void stopMockData() {
// if (mockDataTask != null && !mockDataTask.isCancelled()) {
// mockDataTask.cancel(false);
// mockDataTask = null;
// }
// isMockDataRunning.set(false);
// }
// private void startMockData() {
// if (executorService == null || executorService.isShutdown()) {
// log.warn("[模拟数据] 线程池未初始化或已关闭");
// return;
// }
//
// mockDataTask = executorService.scheduleAtFixedRate(() -> {
// if (!isMockDataRunning.get()) {
// return;
// }
//
// try {
// ScaleWebSocketHandler.sendMessage(String.valueOf(random.nextInt(100) + 1));
// log.debug("[模拟数据] 发送重量数据: 37.8");
// } catch (Exception e) {
// log.error("[模拟数据] 发送异常: {}", e.getMessage());
// }
// }, 0, 1, TimeUnit.SECONDS);
// }
//
// private void stopMockData() {
// if (mockDataTask != null && !mockDataTask.isCancelled()) {
// mockDataTask.cancel(false);
// mockDataTask = null;
// }
// isMockDataRunning.set(false);
// }
}

View File

@@ -1,7 +1,6 @@
package top.wms.admin.controller.ys;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.sun.jna.Pointer;
import com.sun.jna.ptr.IntByReference;
import lombok.extern.slf4j.Slf4j;
@@ -131,7 +130,7 @@ public class NetCommon {
// 设置通道为1
ChannelID = 1;
//定时任务
String strPicPath = req.getPicPath();
String strPicPath = "";
if (ObjectUtil.isNull(req)) {
strPicPath = "E:\\img\\ys\\carousel";
// 创建保存目录
@@ -144,16 +143,17 @@ public class NetCommon {
if (!picDir.exists()) {
picDir.mkdir();
}
strPicPath = req.getPicPath();
} else {
File picDir = new File("E:\\img\\ys\\fullWorkOrder");
if (!picDir.exists()) {
picDir.mkdir();
}
strPicPath = req.getPicPath();
}
// 使用NETDEV_CaptureNoPreview直接保存图片文件
boolean bRet = netdevsdk.NETDEV_CaptureNoPreview(lpUserID, ChannelID, 0, strPicPath, 1);
if (bRet) {
return true;
} else {

View File

@@ -54,6 +54,7 @@ class BaseFun {
}
String loadSDKLibrary = loadLibrary + "NetDEVSDK";
// String loadSDKLibrary = "D:\\wms\\wms-admin\\wms-webapi\\src\\main\\resources\\lib\\win64\\NetDEVSDK";
log.info("Load SDK Library: " + loadSDKLibrary);
return loadSDKLibrary;
}

View File

@@ -106,7 +106,8 @@ public class ysNetController {
boolean success = NetCommon.captureImage(req);
if (success) {
if (req.getType() == 1) {
return R.ok("http://localhost:6609/file/ys/" + req.getBatch() + "/" + req.getEncoding() + "_" + l + ".jpg");
return R.ok("http://localhost:6609/file/ys/" + req.getBatch() + "/" + req
.getEncoding() + "_" + l + ".jpg");
} else {
return R.ok("http://localhost:6609/file/ys/fullWorkOrder/" + l + ".jpg");
}