本地最新代码:同步所有修改及新增模块

This commit is contained in:
local
2026-08-11 13:34:15 +08:00
parent 2b86d14f56
commit 916ac6bda3
172 changed files with 13896 additions and 1774 deletions

479
AGENTS.md Normal file
View File

@@ -0,0 +1,479 @@
# FT546MWS 项目说明
## 项目概述
FT546MWS 是一个基于 **若依(RuoYi)** 框架定制的制造执行系统(MES)和仓库管理系统(WMS),采用前后端分离架构。项目基于若依 v3.9.0 进行二次开发,集成了工业物联网(IIoT)功能和 AI 能力。
### 核心技术栈
#### 后端技术
- **框架**: Spring Boot 3.5.4
- **Java 版本**: Java 17
- **数据库**: SQL Server 2019 (主库), MariaDB (从库, 可选)
- **ORM**: MyBatis 3.0.4 + MyBatis-Plus 3.5.14
- **连接池**: Druid 1.2.23
- **缓存**: Redis
- **权限认证**: JWT + Spring Security
- **API 文档**: SpringDoc OpenAPI (Swagger)
- **定时任务**: Quartz
- **代码生成**: Velocity 模板引擎
- **工业通信**: HslCommunication 3.7.0 (支持 PLC、Modbus 等工业协议)
- **AI 集成**: Spring AI 1.0.1 (OpenAI 兼容接口, 向量数据库)
- **MCP 协议**: Spring AI MCP Client
- **工具库**: Hutool 5.8.27, FastJSON2 2.0.57, POI 4.1.2
#### 前端技术
- **框架**: Vue 2.6.12
- **UI 组件库**: Element UI 2.15.14
- **状态管理**: Vuex 3.6.0
- **路由**: Vue Router 3.4.9
- **图表**: ECharts 5.4.0
- **国际化**: Vue I18n 7.3.2
- **构建工具**: Vue CLI 4.4.6
- **其他**: Axios, Quill (富文本编辑器), VueCropper (图片裁剪)
### 项目架构
这是一个典型的前后端分离的 Maven 多模块项目,包含以下模块:
```
FT546MWS/
├── ruoyi-admin/ # Web 服务入口模块(启动类、控制器)
├── ruoyi-framework/ # 框架核心模块(安全配置、拦截器、工具类)
├── ruoyi-system/ # 系统管理模块(用户、角色、菜单、部门等)
├── ruoyi-common/ # 通用工具模块(工具类、常量、注解)
├── ruoyi-generator/ # 代码生成器模块
├── ruoyi-quartz/ # 定时任务模块
├── ruoyi-ui/ # 前端 Vue 项目
├── sql/ # 数据库脚本
├── bin/ # 批处理脚本(构建、运行、清理)
└── pom.xml # Maven 父 POM 配置
```
### 业务模块
前端业务模块(位于 `ruoyi-ui/src/views/`):
- **system**: 系统管理(用户、角色、菜单、部门、岗位、字典、参数、通知)
- **monitor**: 系统监控(在线用户、操作日志、登录日志、服务监控、缓存监控、定时任务)
- **tool**: 系统工具(表单构建、代码生成、系统接口)
- **bas**: 基础数据管理
- **in**: 入库管理
- **out**: 出库管理
- **stock**: 库存管理
- **check**: 盘点管理
- **job**: 作业管理
- **kpi**: 绩效管理
- **ai**: AI 功能集成
- **search**: 搜索功能
- **requestInterface**: 接口请求管理
- **dashboard**: 仪表盘/数据看板
## 环境配置
### 数据库配置
#### 主数据库(SQL Server)
- **地址**: 172.16.2.170:1433
- **数据库名**: FT546-wms
- **用户名**: sa
- **密码**: Flrd0914.
- **驱动**: com.microsoft.sqlserver.jdbc.SQLServerDriver
#### 从数据库(MariaDB)- 已禁用
- **地址**: 172.16.2.170:3307
- **数据库名**: mydb
- **用户名**: root
- **密码**: Flrd0914.
### Redis 配置
- **地址**: 172.16.2.170:6379
- **数据库索引**: 0
- **密码**: 123456
- **超时**: 10s
### AI 配置
- **提供商**: SiliconFlow (OpenAI 兼容)
- **Base URL**: https://api.siliconflow.cn
- **对话模型**: deepseek-ai/DeepSeek-V3.1
- **嵌入模型**: Qwen/Qwen3-Embedding-8B (1024 维度)
- **向量数据库**: MariaDB (已配置但未完全启用)
### Druid 监控
- **访问地址**: http://localhost:8080/druid/
- **用户名**: ruoyi
- **密码**: 123456
### API 文档
- **Swagger UI**: http://localhost:8080/swagger-ui.html
- **OpenAPI JSON**: http://localhost:8080/v3/api-docs
## 构建和运行
### 后端构建和运行
#### 方式一:使用 Maven 命令
```bash
# 进入项目根目录
cd D:\workSpace\PROJECT_SPACE\FT546\FT546MWS
# 清理并编译
mvn clean compile
# 打包(跳过测试)
mvn clean package -DskipTests
# 运行
java -jar ruoyi-admin/target/ruoyi-admin.jar
# 或使用 JVM 参数运行
java -Dname=ruoyi-admin.jar -Duser.timezone=Asia/Shanghai -Xms512m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m -jar ruoyi-admin/target/ruoyi-admin.jar
```
#### 方式二:使用批处理脚本
```bash
# 进入 bin 目录
cd bin
# 启动服务
ry.bat
# 选择 [1] 启动 ruoyi-admin.jar
# 停止服务
ry.bat
# 选择 [2] 关闭 ruoyi-admin.jar
# 重启服务
ry.bat
# 选择 [3] 重启 ruoyi-admin.jar
# 查看状态
ry.bat
# 选择 [4] 查看状态
```
#### 方式三:使用 IDE
1. 使用 IntelliJ IDEA 或 Eclipse 导入项目(Maven 项目)
2. 找到启动类:`com.ruoyi.RuoYiApplication`(位于 ruoyi-admin 模块)
3. 运行启动类
### 前端构建和运行
#### 开发环境
```bash
# 进入前端目录
cd ruoyi-ui
# 安装依赖(使用 npm 镜像加速)
npm install --registry=https://registry.npmmirror.com
# 或直接安装
npm install
# 启动开发服务器
npm run dev
```
前端服务启动后,浏览器访问:http://localhost:80
默认账号:
- 用户名: admin
- 密码: admin123
#### 生产环境构建
```bash
# 构建测试环境
npm run build:stage
# 构建生产环境
npm run build:prod
```
构建产物将输出到 `ruoyi-ui/dist` 目录。
#### 使用批处理脚本
```bash
# 进入前端 bin 目录
cd ruoyi-ui\bin
# 运行前端开发服务器
run-web.bat
# 打包前端
package.bat
# 清理构建产物
clean.bat
```
## 开发规范
### 后端开发规范
#### 包结构规范
```
com.ruoyi
├── common/ # 通用模块
│ ├── annotation/ # 自定义注解
│ ├── constant/ # 常量定义
│ ├── core/ # 核心配置
│ ├── enums/ # 枚举类
│ ├── exception/ # 异常处理
│ └── utils/ # 工具类
├── framework/ # 框架核心
│ ├── aspectj/ # 切面
│ ├── config/ # 配置类
│ ├── interceptor/ # 拦截器
│ ├── security/ # 安全相关
│ └── web/ # Web 配置
├── system/ # 系统管理
│ ├── controller/ # 控制器
│ ├── domain/ # 实体类
│ ├── mapper/ # 数据访问层
│ └── service/ # 业务逻辑层
│ └── impl/ # 业务实现
└── web/ # Web 控制器(其他业务模块)
```
#### 代码生成规范
项目使用代码生成器(`ruoyi-generator` 模块)快速生成 CRUD 代码:
1. 在数据库中创建表
2. 登录系统 → 系统工具 → 代码生成
3. 导入表并配置生成信息
4. 生成代码并下载
5. 将生成的代码复制到对应模块
生成的代码包括:
- Java 实体类(domain)
- Mapper 接口和 XML(mapper)
- Service 接口和实现(service/impl)
- Controller 控制器(controller)
- Vue 页面(前端 views)
- API 接口定义(前端 api)
#### 控制器规范
- 使用 `@RestController` 注解
- 统一返回格式:`AjaxResult`(包装 success、error、data)
- 权限控制:使用 `@PreAuthorize("@ss.hasPermi('system:user:list')")`
- 操作日志:使用 `@Log(title = "用户管理", businessType = BusinessType.INSERT)`
- 分页查询:使用 `startPage()` 方法(继承 BaseController)
#### Service 规范
- 接口定义在 `service` 包
- 实现类在 `service/impl` 包
- 使用 `@Service` 注解
- 业务逻辑方法命名:`selectXxxList`(查询)、`insertXxx`(新增)、`updateXxx`(修改)、`deleteXxxByIds`(删除)
- 缓存注解:`@Cacheable`(查询)、`@CacheEvict`(更新/删除)
#### Mapper 规范
- 使用 MyBatis-Plus 注解或 XML 配置
- XML 文件位于 `resources/mapper/` 目录
- 继承 `BaseMapper<T>` 接口
- 复杂查询使用 XML 文件编写 SQL
### 前端开发规范
#### 目录结构规范
```
src/
├── api/ # API 接口定义
│ ├── login.js # 登录相关
│ ├── system/ # 系统管理
│ ├── monitor/ # 监控模块
│ └── ... # 其他业务模块
├── assets/ # 静态资源
│ ├── images/ # 图片
│ ├── icons/ # 图标
│ ├── logo/ # Logo
│ └── styles/ # 样式文件
├── components/ # 公共组件
│ ├── Pagination/ # 分页组件
│ ├── RightToolbar/ # 工具栏
│ ├── Editor/ # 富文本编辑器
│ └── ... # 其他组件
├── directive/ # 自定义指令
├── layout/ # 布局组件
├── plugins/ # 插件
├── router/ # 路由配置
├── store/ # Vuex 状态管理
├── utils/ # 工具函数
├── views/ # 页面组件
│ ├── system/ # 系统管理页面
│ ├── monitor/ # 监控页面
│ └── ... # 其他业务页面
├── App.vue # 根组件
├── main.js # 入口文件
├── permission.js # 权限控制
└── settings.js # 全局配置
```
#### 组件命名规范
- 组件名使用 PascalCase(大驼峰)
- 文件名与组件名保持一致
- 例如:`UserList.vue`
#### API 调用规范
- API 接口定义在 `src/api/` 目录
- 使用 Axios 发送请求(已封装)
- 请求路径配置在 `.env.development` 等环境变量文件中
- 统一使用 `request.js` 封装的请求方法
#### 路由规范
- 路由配置在 `src/router/index.js`
- 使用 Vue Router 的路由懒加载
- 需要权限的路由在路由配置中添加 `meta` 字段
- 例如:`meta: { title: '用户管理', icon: 'user', noCache: true }`
#### 样式规范
- 使用 SCSS 预处理器
- 全局样式放在 `src/assets/styles/` 目录
- 组件样式使用 `<style scoped>` 限定作用域
- 遵循 BEM 命名规范
## 测试
### 后端测试
```bash
# 运行所有测试
mvn test
# 运行指定测试类
mvn test -Dtest=UserServiceTest
# 运行指定测试方法
mvn test -Dtest=UserServiceTest#testGetUser
```
### 前端测试
目前项目未配置前端单元测试,建议添加 Jest 或 Mocha。
## 部署
### 后端部署
```bash
# 打包
mvn clean package -DskipTests
# 生成的 JAR 文件位于:ruoyi-admin/target/ruoyi-admin.jar
# 上传到服务器后,使用脚本或命令启动
nohup java -jar ruoyi-admin.jar > app.log 2>&1 &
# 或使用提供的脚本
./ry.bat # Windows
./ry.sh # Linux
```
### 前端部署
```bash
# 构建生产版本
npm run build:prod
# 生成的静态文件位于:dist/ 目录
# 将 dist 目录内容部署到 Nginx 或其他 Web 服务器
# Nginx 配置示例:
server {
listen 80;
server_name your-domain.com;
root /path/to/dist;
index index.html;
location / {
try_files $uri $uri/ /index.html;
}
location /prod-api/ {
proxy_pass http://backend-server:8080/;
}
}
```
## 常见问题
### 1. 端口冲突
- 后端默认端口:8080
- 前端默认端口:80
- 如需修改,请编辑 `application.yml`(后端)和 `vue.config.js`(前端)
### 2. 数据库连接失败
- 检查数据库服务是否启动
- 检查 `application-druid.yml` 中的数据库配置
- 确保网络可访问数据库服务器
### 3. Redis 连接失败
- 检查 Redis 服务是否启动
- 检查 `application.yml` 中的 Redis 配置
- 确保网络可访问 Redis 服务器
### 4. 前端跨域问题
- 开发环境已配置代理(`vue.config.js` 中的 `proxy`)
- 生产环境需要在 Nginx 或后端配置 CORS
### 5. 代码生成器无法使用
- 确保数据库表已创建
- 检查表是否有主键
- 检查字段注释是否完整
### 6. 文件上传失败
- 检查 `application.yml` 中的文件路径配置
- 确保目录存在且有写入权限
- 检查文件大小限制(默认 20MB)
## 项目特色
### 1. 工业物联网集成
- 使用 HslCommunication 库支持多种工业协议
- 可与 PLC、Modbus 设备通信
- 适用于制造业数据采集和设备控制
### 2. AI 能力
- 集成 Spring AI 框架
- 支持 OpenAI 兼容的大模型接口
- 支持向量数据库和文档检索
- 可用于智能问答、数据分析等场景
### 3. MCP 协议支持
- 支持 MCP(Model Context Protocol)客户端
- 可连接 MCP 服务进行上下文管理
### 4. 多数据库支持
- 主数据库:SQL Server
- 从数据库:MariaDB(可选)
- 支持主从读写分离
### 5. 代码生成器
- 一键生成前后端 CRUD 代码
- 支持自定义模板
- 大幅提升开发效率
### 6. 完善的权限控制
- 基于 RBAC 的权限模型
- 支持数据权限控制
- 支持按钮级别的权限控制
### 7. 系统监控
- 在线用户监控
- 操作日志记录
- 系统性能监控
- 缓存监控
- 定时任务管理
## 联系方式
- 若依官方文档:http://doc.ruoyi.vip
- 若依官方演示:http://vue.ruoyi.vip
- 项目仓库:http://106.13.86.63:10082/zyr/FT546MWS.git
## 许可证
本项目基于 MIT 许可证开源,详见 [LICENSE](LICENSE) 文件。
---
**注意**: 本项目包含敏感信息(数据库密码、API 密钥等),在生产环境部署前请务必修改这些配置。

View File

@@ -0,0 +1,120 @@
package com.ruoyi.Dzp;
import com.ruoyi.Dzp.domain.basLed;
import com.ruoyi.Dzp.mapper.BasLedMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.io.IOException;
import java.util.List;
@RestController
@RequestMapping("/api2dzp")
public class DzpSend {
@Autowired
private BasLedMapper mapper;
@Scheduled(fixedDelay = 1000)
public void InLed() throws IOException {
basLed basLed = new basLed();
basLed.setSendFlag("0");
basLed.setId(1);
List<com.ruoyi.Dzp.domain.basLed> basLeds = mapper.selectBasLedList(basLed);
if (basLeds != null && basLeds.size() > 0 && (basLeds.get(0).getModel().equals("1") || basLeds.get(0).getModel().equals("2"))) {
MyUdpSocket myUdpSocket = new MyUdpSocket(6666);
ProtocolDemo.my_udp = myUdpSocket;
String ip = basLeds.get(0).getIpAddress();
String msgProductTitle = "物资编码:";
String msgProduct = basLeds.get(0).getProduct_id();
String msgSpecTitle = "物资规格:";
String msgSpec = basLeds.get(0).getSpec();
String msg3 = "托盘条码:" + basLeds.get(0).getTrayCode();
String msg4 = null;
if (basLeds.get(0).getModel().equals("1")) {
msg4 = "入库数量:";
} else {
msg4 = "出库数量:";
}
String ms7 = "物资名称:";
String msg8 = basLeds.get(0).getProductName();
String msgQuantity = basLeds.get(0).getQuantity();
if (ProtocolDemo.demo_play_chapterschedule4(ip, msgProductTitle, msgSpecTitle, msg4, msg3, msgSpec, msgProduct, ms7, msg8, msgQuantity)) {
basLeds.get(0).setSendFlag("1");
mapper.updateBasLed(basLeds.get(0));
}
myUdpSocket.close();
}
basLed basLed2 = new basLed();
basLed2.setSendFlag("0");
basLed2.setId(2);
List<com.ruoyi.Dzp.domain.basLed> basLeds2 = mapper.selectBasLedList(basLed2);
if (basLeds2 != null && basLeds2.size() > 0 && (basLeds2.get(0).getModel().equals("1") || basLeds2.get(0).getModel().equals("2"))) {
MyUdpSocket myUdpSocket = new MyUdpSocket(6666);
ProtocolDemo.my_udp = myUdpSocket;
String ip = basLeds2.get(0).getIpAddress();
String msgProductTitle = "物资编码:";
String msgProduct = basLeds2.get(0).getProduct_id();
String msgSpecTitle = "物资规格:";
String msgSpec = basLeds2.get(0).getSpec();
String msg3 = "托盘条码:" + basLeds2.get(0).getTrayCode();
String msg4 = null;
if (basLeds2.get(0).getModel().equals("1")) {
msg4 = "入库数量:";
} else {
msg4 = "出库数量:";
}
String ms7 = "物资名称:";
String msg8 = basLeds2.get(0).getProductName();
String msgQuantity = basLeds2.get(0).getQuantity();
if (ProtocolDemo.demo_play_chapterschedule4(ip, msgProductTitle, msgSpecTitle, msg4, msg3, msgSpec, msgProduct, ms7, msg8, msgQuantity)) {
basLeds2.get(0).setSendFlag("1");
mapper.updateBasLed(basLeds2.get(0));
}
myUdpSocket.close();
}
}
@Scheduled(fixedDelay = 1000)
public void ErrorLed() throws IOException {
basLed basLed = new basLed();
basLed.setSendFlag("0");
basLed.setId(1);
List<com.ruoyi.Dzp.domain.basLed> basLeds = mapper.selectBasLedList(basLed);
if (basLeds != null && basLeds.size() > 0 && basLeds.get(0).getModel().equals("3")) {
MyUdpSocket myUdpSocket = new MyUdpSocket(6666);
ProtocolDemo.my_udp = myUdpSocket;
String ip = basLeds.get(0).getIpAddress();
if (ProtocolDemo.demo_play_chapterschedule2(ip, "报警信息", basLeds.get(0).getErrorMsg())) {
basLeds.get(0).setSendFlag("1");
mapper.updateBasLed(basLeds.get(0));
}
myUdpSocket.close();
}
basLed basLed2 = new basLed();
basLed2.setSendFlag("0");
basLed2.setId(2);
List<com.ruoyi.Dzp.domain.basLed> basLeds2 = mapper.selectBasLedList(basLed2);
if (basLeds2 != null && basLeds2.size() > 0 && basLeds2.get(0).getModel().equals("3")) {
MyUdpSocket myUdpSocket = new MyUdpSocket(6666);
ProtocolDemo.my_udp = myUdpSocket;
String ip = basLeds2.get(0).getIpAddress();
if (ProtocolDemo.demo_play_chapterschedule2(ip, "报警信息", basLeds2.get(0).getErrorMsg())) {
basLeds2.get(0).setSendFlag("1");
mapper.updateBasLed(basLeds2.get(0));
}
myUdpSocket.close();
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,164 @@
package com.ruoyi.Dzp;
public class Lzss {
static int N = 4096;
static int F = 18;
static int THRESHOLD = 2;
static int NIL = N;
static int textsize = 0;
static int codesize = 0;
static int printcount = 0;
static int text_buf[];
static int match_position, match_length;
static int lson[], rson[], dad[];
public Lzss() {
lson = new int[N + 1];
rson = new int[N + 257];
dad = new int[N + 1];
text_buf = new int[N + F - 1];
}
private static void InitTree() /* initialize trees */
{
int i;
textsize = 0; codesize = 0; printcount = 0;
for (i = N + 1; i <= N + 256; i++) rson[i] = NIL;
for (i = 0; i < N; i++) dad[i] = NIL;
}
private static void InsertNode(int r)
{
int i, p, cmp;
//unsigned char *key;
//key = &text_buf[r];
cmp = 1; p = N + 1 + text_buf[r];
rson[r] = NIL; lson[r] = NIL; match_length = 0;
for ( ; ; ) {
if (cmp >= 0) {
if (rson[p] != NIL) p = rson[p];
else { rson[p] = r; dad[r] = p; return; }
} else {
if (lson[p] != NIL) p = lson[p];
else { lson[p] = r; dad[r] = p; return; }
}
for (i = 1; i < F; i++)
if ((cmp = text_buf[r + i] - text_buf[p + i]) != 0) break;
if (i > match_length) {
match_position = p;
if ((match_length = i) >= F) break;
}
}
dad[r] = dad[p]; lson[r] = lson[p]; rson[r] = rson[p];
dad[lson[p]] = r; dad[rson[p]] = r;
if (rson[dad[p]] == p) rson[dad[p]] = r;
else lson[dad[p]] = r;
dad[p] = NIL;
}
private static void DeleteNode(int p)
{
int q;
if (dad[p] == NIL) return;
if (rson[p] == NIL) q = lson[p];
else if (lson[p] == NIL) q = rson[p];
else {
q = lson[p];
if (rson[q] != NIL) {
do { q = rson[q]; } while (rson[q] != NIL);
rson[dad[q]] = lson[q]; dad[lson[q]] = dad[q];
lson[q] = lson[p]; dad[lson[p]] = q;
}
rson[q] = rson[p]; dad[rson[p]] = q;
}
dad[q] = dad[p];
if (rson[dad[p]] == p) rson[dad[p]] = q; else lson[dad[p]] = q;
dad[p] = NIL;
}
public int Encode(byte[] ibuf, int istart, int isize, byte[] obuf, int ostart)
{
int i, c, len, r, s, last_match_length, code_buf_ptr;
int[] code_buf = new int[17];
int mask;
int x, x1;
x=x1=0;
InitTree();
code_buf[0] = 0;
code_buf_ptr = mask = 1;
s = 0; r = N - F;
for (i = s; i < r; i++) text_buf[i] = ' ';
for (len = 0, c = 0; len < F && c < isize; len++, c++)
{
if (ibuf[istart + x] >= 0)
text_buf[r + len] = ibuf[istart + x];
else
text_buf[r + len] = 0x100 + ibuf[istart + x];
x++;
}
if ((textsize = len) == 0) return 0;
for (i = 1; i <= F; i++) InsertNode(r - i);
InsertNode(r);
do {
if (match_length > len) match_length = len;
if (match_length <= THRESHOLD) {
match_length = 1;
code_buf[0] |= mask;
code_buf[code_buf_ptr++] = text_buf[r];
} else {
code_buf[code_buf_ptr++] = match_position & 0xff;
code_buf[code_buf_ptr++] = ((((match_position >> 4) & 0xf0) | (match_length - (THRESHOLD + 1))) & 0xff);
}
mask <<= 1;
mask &= 0xff;
if (mask == 0) {
if (codesize + code_buf_ptr > isize) return 0;
for (i = 0; i < code_buf_ptr; i++)
{
obuf[ostart + x1] = (byte)code_buf[i];
x1++;
}
codesize += code_buf_ptr;
code_buf[0] = 0; code_buf_ptr = mask = 1;
}
last_match_length = match_length;
for (i = 0; i < last_match_length && c < isize; i++, c++) {
DeleteNode(s); /* Delete old strings and */
if (ibuf[istart + x] >= 0)
text_buf[s] = ibuf[istart + x];
else
text_buf[s] = 0x100 + ibuf[istart + x];
if (s < F - 1)
{
if (ibuf[istart + x] >= 0)
text_buf[s + N] = ibuf[istart + x];
else
text_buf[s + N] = 0x100 + ibuf[istart + x];
}
s = (s + 1) & (N - 1); r = (r + 1) & (N - 1);
InsertNode(r); /* Register the string in text_buf[r..r+F-1] */
x++;
}
while (i++ < last_match_length) {
DeleteNode(s);
s = (s + 1) & (N - 1); r = (r + 1) & (N - 1);
len--;
if (len > 0) InsertNode(r);
}
} while (len > 0);
if (code_buf_ptr > 1) {
for (i = 0; i < code_buf_ptr; i++)
{
obuf[ostart + x1] = (byte)(code_buf[i]&0xff);
x1++;
}
codesize += code_buf_ptr;
}
return x1;
}
}

View File

@@ -0,0 +1,93 @@
package com.ruoyi.Dzp;
import java.io.IOException;
import java.net.InetSocketAddress;
import java.nio.ByteBuffer;
import java.nio.channels.DatagramChannel;
import java.nio.channels.SelectionKey;
import java.nio.channels.Selector;
import java.util.Set;
public class MyUdpSocket {
private DatagramChannel channel;
private Selector selector;
private final int MAX_SIZE = 1280;
private static int client_port;
private static String client_ip;
ByteBuffer receive_buffer = ByteBuffer.allocate(MAX_SIZE);
public MyUdpSocket(int port) throws IOException {
channel = DatagramChannel.open();
selector = Selector.open();
try {
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ģʽ
channel.configureBlocking(false);
//<2F><>ȡ<EFBFBD><C8A1><EFBFBD>׽<EFBFBD><D7BD><EFBFBD>ͨ<EFBFBD><CDA8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>׽<EFBFBD><D7BD>֣<EFBFBD><D6A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>׽<EFBFBD><D7BD>ְ󶨵<D6B0><F3B6A8B5><EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD><D6B8><EFBFBD>˿<EFBFBD>
channel.socket().bind(new InetSocketAddress(port));
//Ϊͨ<CEAA><CDA8>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD>ע<EFBFBD><D7A2>ͨ<EFBFBD><CDA8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD><D6B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD>
channel.register(selector, SelectionKey.OP_READ);
} catch (IOException e) {
e.printStackTrace();
}
}
public final void send(String ip, int port, byte[] buffer, int size) throws IOException {
InetSocketAddress client = new InetSocketAddress(ip, port);
channel.send(ByteBuffer.wrap(buffer, 0, size), client); //<2F><>EchoClient<6E>ظ<EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD>ݱ<EFBFBD>
}
public final void close() throws IOException {
selector.close();
channel.close();
}
public final int get_client_port() {
return client_port;
}
public final String get_client_ip() {
return client_ip;
}
public final void get_receive_buffer(byte[] buffer) {
receive_buffer.get(buffer);
}
public final int receive() {
try {
receive_buffer.clear();
if (selector.select(10) != 0) {
Set<SelectionKey> readyKeys = selector.selectedKeys();
for (SelectionKey key : readyKeys) {
readyKeys.remove(key);
if (key.isReadable()) {
DatagramChannel dc = (DatagramChannel) key.channel();
InetSocketAddress client = (InetSocketAddress) dc.receive(receive_buffer); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>Client<6E><74><EFBFBD><EFBFBD><EFBFBD>ݱ<EFBFBD>
if (client != null) {
client_ip = client.getAddress().getHostAddress();
client_port = client.getPort();
//System.out.println(client_ip+":"+client_port+" size="+receive_buffer.position());
key.interestOps(SelectionKey.OP_READ);
return receive_buffer.position();
} else {
return 0;
}
} else {
return 0;
}
}
}
} catch (IOException e) {
e.printStackTrace();
}
return 0;
}
public final void get_receive_packet(byte[] packet, int size) {
int i;
for (i = 0; i < size; i++) {
packet[i] = receive_buffer.array()[i];
}
}
}

View File

@@ -0,0 +1,995 @@
package com.ruoyi.Dzp;
import java.awt.*;
//import java.util.Calendar;
public class ProtocolDemo {
// ====<3D><><EFBFBD>붯<EFBFBD><EBB6AF><EFBFBD><EFBFBD>ʽ<EFBFBD>б<EFBFBD>(<28><>ֵ<EFBFBD><D6B5>0<EFBFBD><30>ʼ)====
// 0 = '<27><><EFBFBD>',
// 1 = '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ',
// 2 = '<27><><EFBFBD><EFBFBD><EFBFBD>ʾ',
// 3 = '<27>Ϲ<EFBFBD><CFB9><EFBFBD>ʾ',
// 4 = '<27>ҹ<EFBFBD><D2B9><EFBFBD>ʾ',
// 5 = '<27>¹<EFBFBD><C2B9><EFBFBD>ʾ',
// 6 = '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ',
// 7 = '<27><><EFBFBD><EFBFBD><EFBFBD>Ϲ<EFBFBD><CFB9><EFBFBD>ʾ',
// 8 = '<27><><EFBFBD><EFBFBD><EFBFBD>ҹ<EFBFBD>',
// 9 = '<27><><EFBFBD><EFBFBD><EFBFBD>¹<EFBFBD>',
// 10 = '<27>м<EFBFBD><D0BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>չ<EFBFBD><D5B9>',
// 11 = '<27>м<EFBFBD><D0BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>չ<EFBFBD><D5B9>',
// 12 = '<27>м<EFBFBD><D0BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>չ<EFBFBD><D5B9>',
// 13 = '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',
// 14 = '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',
// 15 = '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>չ<EFBFBD><D5B9>',
// 16 = '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>չ<EFBFBD><D5B9>',
// 17 = '<27><><EFBFBD><EFBFBD><EFBFBD>Ͻ<EFBFBD><CFBD><EFBFBD><EFBFBD><EFBFBD>',
// 18 = '<27><><EFBFBD><EFBFBD><EFBFBD>½<EFBFBD><C2BD><EFBFBD><EFBFBD><EFBFBD>',
// 19 = '<27><><EFBFBD><EFBFBD><EFBFBD>Ͻ<EFBFBD><CFBD><EFBFBD><EFBFBD><EFBFBD>',
// 20 = '<27><><EFBFBD><EFBFBD><EFBFBD>½<EFBFBD><C2BD><EFBFBD><EFBFBD><EFBFBD>',
// 21 = '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',
// 22 = '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',
// 23 = '<27><><EFBFBD><EFBFBD><EFBFBD>Ҷ<EFBFBD><D2B6>',
// 24 = '<27><><EFBFBD><EFBFBD><EFBFBD>Ҷ<EFBFBD><D2B6>',
// =====================================
// ====<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ<EFBFBD>б<EFBFBD>(<28><>ֵ<EFBFBD><D6B5>0<EFBFBD><30>ʼ)====
// 0 = '<27><><EFBFBD>',
// 1 = '<27><><EFBFBD><EFBFBD>ʧ',
// 2 = '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ',
// 3 = '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>м<EFBFBD><D0BC>£',
// 4 = '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>м<EFBFBD><D0BC>£',
// 5 = '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>м<EFBFBD><D0BC>£',
// 6 = '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƴ<EFBFBD>',
// 7 = '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƴ<EFBFBD>',
// 8 = '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>£',
// 9 = '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Һ<EFBFBD>£',
// 10 = '<27><><EFBFBD><EFBFBD><EFBFBD>Ͻ<EFBFBD><CFBD>Ƴ<EFBFBD>',
// 11 = '<27><><EFBFBD><EFBFBD><EFBFBD>½<EFBFBD><C2BD>Ƴ<EFBFBD>',
// 12 = '<27><><EFBFBD><EFBFBD><EFBFBD>Ͻ<EFBFBD><CFBD>Ƴ<EFBFBD>',
// 13 = '<27><><EFBFBD><EFBFBD><EFBFBD>½<EFBFBD><C2BD>Ƴ<EFBFBD>',
// 14 = '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƴ<EFBFBD>',
// 15 = '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƴ<EFBFBD>',
// 16 = '<27><><EFBFBD><EFBFBD><EFBFBD>Ҷ<EFBFBD><D2B6>',
// 17 = '<27><><EFBFBD><EFBFBD><EFBFBD>Ҷ<EFBFBD><D2B6>'
// =====================================
// ====ͣ<><CDA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ<EFBFBD>б<EFBFBD>(<28><>ֵ<EFBFBD><D6B5>0<EFBFBD><30>ʼ)====
// 0 = '<27><>̬<EFBFBD><CCAC>ʾ',
// 1 = '<27><>˸<EFBFBD><CBB8>ʾ'
// =====================================
public static MyUdpSocket my_udp;
public static LEDSender2010 ledsender = new LEDSender2010();
//public static String ledhost = "127.0.0.1";
public static String ledhost = "10.170.23.237";
public static int ledport = 6666;
public static int addr = 0;
public static void mysleep(int msec) {
try {
Thread.sleep(msec);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
//<2F><><EFBFBD><EFBFBD>UDP<44><50><EFBFBD><EFBFBD>bufferΪ<72><CEAA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݣ<EFBFBD>sizeΪ<65><CEAA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݳ<EFBFBD><DDB3><EFBFBD>
public static void udp_send(byte[] buffer, int size) {
byte[] packet = new byte[size];
ledsender.blockCopy(packet, 0, buffer, 0, size);
ledsender.print_stream(packet, size);
try {
my_udp.send(ledhost, ledport, packet, size);
} catch (Exception ex) {
ex.printStackTrace();
}
}
public static void udp_send1(String ip, byte[] buffer, int size) {
byte[] packet = new byte[size];
ledsender.blockCopy(packet, 0, buffer, 0, size);
ledsender.print_stream(packet, size);
try {
my_udp.send(ip, ledport, packet, size);
} catch (Exception ex) {
ex.printStackTrace();
}
}
//<2F><><EFBFBD><EFBFBD>UDP<44><50><EFBFBD><EFBFBD>bufferΪ<72><CEAA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݣ<EFBFBD>sizeΪ<65><CEAA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݳ<EFBFBD><DDB3><EFBFBD>
public static int udp_receive(byte[] buffer) {
int size = 0;
size = my_udp.receive();
if (size > 0) {
my_udp.get_receive_packet(buffer, size);
}
return size;
}
public static int do_command(byte[] buffer, int size) {
byte[] packet = new byte[1280];
int tx, tx_repeat = 5;
int isize = 0;
int i;
for (tx = 0; tx < tx_repeat; tx++) {
udp_send(buffer, size);
for (i = 0; i < 50; i++) {
isize = udp_receive(packet);
if (isize > 0 && ledsender.parse_cmd_respond(packet, isize) == 1) {
return 1;
}
}
}
System.out.println("<EFBFBD><EFBFBD>ʱ");
return 0;
}
public static void demo_reset_display() {
int size;
byte[] packet = new byte[1280];
size = ledsender.pkg_reset_display(packet, (byte) addr, 1);
System.out.println("<EFBFBD><EFBFBD>λ<EFBFBD><EFBFBD>Ŀ<EFBFBD><EFBFBD>ʾ...");
do_command(packet, size);
}
public static void demo_power_on() {
int size;
byte[] packet = new byte[1280];
size = ledsender.pkg_set_power(packet, (byte) addr, 1);
System.out.println("<EFBFBD>򿪵<EFBFBD>Դ...");
do_command(packet, size);
}
public static void demo_power_off() {
int size;
byte[] packet = new byte[1280];
size = ledsender.pkg_set_power(packet, (byte) addr, 0);
System.out.println("<EFBFBD>رյ<EFBFBD>Դ...");
do_command(packet, size);
}
public static void demo_get_power() {
int size;
byte[] packet = new byte[1280];
size = ledsender.pkg_get_power(packet, (byte) addr);
System.out.println("<EFBFBD><EFBFBD>ȡ<EFBFBD><EFBFBD>Դ״̬...");
do_command(packet, size);
}
public static void demo_set_bright() {
int size;
byte[] packet = new byte[1280];
size = ledsender.pkg_set_bright(packet, (byte) addr, 7);
System.out.println("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>...");
do_command(packet, size);
}
public static void demo_get_bright() {
int size;
byte[] packet = new byte[1280];
size = ledsender.pkg_get_bright(packet, (byte) addr);
System.out.println("<EFBFBD><EFBFBD>ȡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>...");
do_command(packet, size);
}
public static void demo_adjust_time() {
int size;
byte[] packet = new byte[1280];
//Calendar calendar = Calendar.getInstance();
//ָ<><D6B8>ʱ<EFBFBD><CAB1>Уʱ<D0A3><CAB1>12Сʱ<D0A1><CAB1>
//size=ledsender.pkg_adjust_time_ex(packet, (byte)addr, calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH)+1, calendar.get(Calendar.DAY_OF_WEEK)-1, calendar.get(Calendar.DAY_OF_MONTH), calendar.get(Calendar.HOUR), calendar.get(Calendar.MINUTE), calendar.get(Calendar.SECOND));
//ָ<><D6B8>ʱ<EFBFBD><CAB1>Уʱ<D0A3><CAB1>24Сʱ<D0A1><CAB1>
//size=ledsender.pkg_adjust_time_ex(packet, (byte)addr, calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH)+1, calendar.get(Calendar.DAY_OF_WEEK)-1, calendar.get(Calendar.DAY_OF_MONTH), calendar.get(Calendar.HOUR_OF_DAY), calendar.get(Calendar.MINUTE), calendar.get(Calendar.SECOND));
//<2F>Ե<EFBFBD>ǰϵͳʱ<CDB3><CAB1>Уʱ
size = ledsender.pkg_adjust_time(packet, (byte) addr);
System.out.println("У<EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD>...");
do_command(packet, size);
}
public static void demo_switch_on() {
int size;
byte[] packet = new byte[1280];
size = ledsender.pkg_set_switch(packet, (byte) addr, 1);
System.out.println("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>5V<EFBFBD><EFBFBD><EFBFBD>...");
do_command(packet, size);
}
public static void demo_switch_off() {
int size;
byte[] packet = new byte[1280];
size = ledsender.pkg_set_switch(packet, (byte) addr, 0);
System.out.println("<EFBFBD>ر<EFBFBD>5V<EFBFBD><EFBFBD><EFBFBD>...");
do_command(packet, size);
}
public static void demo_get_boardparam() {
int size;
byte[] packet = new byte[1280];
size = ledsender.pkg_get_boardparam(packet, (byte) addr);
System.out.println("<EFBFBD><EFBFBD>ȡ<EFBFBD><EFBFBD><EFBFBD>ƿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>...");
do_command(packet, size);
}
public static void demo_set_boardparam_ip(String ip) {
int size;
byte[] packet = new byte[1280];
byte[] ips = new byte[4];
int i, k, k1, x;
size = ledsender.pkg_get_boardparam(packet, (byte) addr);
System.out.println("<EFBFBD><EFBFBD>ȡ<EFBFBD><EFBFBD><EFBFBD>ƿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>...");
if (do_command(packet, size) == 1) {
k = 0;
x = 0;
ip = ip + '.';
for (i = 0; i < 4; i++) {
k1 = ip.indexOf('.', k);
if (k1 > k) {
ips[i] = (byte) Integer.parseInt(ip.substring(k, k1));
k = k1 + 1;
x++;
}
}
if (x == 4) {
size = ledsender.pkg_set_boardparam_ip(packet, (byte) addr, ips);
if (size > 0) {
do_command(packet, size);
}
}
}
}
public static void demo_power_schedule() {
int size;
byte[] packet = new byte[1280];
//<2F><>һ<EFBFBD><D2BB>7<EFBFBD><37>ÿ<EFBFBD>ն<EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ÿ<EFBFBD>տ<EFBFBD><D5BF>Զ<EFBFBD><D4B6><EFBFBD>3<EFBFBD><33>ʱ<EFBFBD><CAB1>
size = ledsender.pkg_power_schedule_weekday(packet, (byte) addr, true);
//<2F><>ָ<EFBFBD><D6B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֹ<EFBFBD><D6B9><EFBFBD><EFBFBD>ʱ<EFBFBD>䲥<EFBFBD>ţ<EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD>Զ<EFBFBD><D4B6><EFBFBD>21<32><31>ʱ<EFBFBD><CAB1>
//size=ledsender.pkg_power_schedule_period(packet, (byte)addr, true);
System.out.println("<EFBFBD><EFBFBD><EFBFBD>ö<EFBFBD>ʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƻ<EFBFBD>...");
do_command(packet, size);
}
//dib_bufferΪ<72><CEAA><EFBFBD><EFBFBD>ͼƬ<CDBC><C6AC>RGB<47><42><EFBFBD>飬<EFBFBD><E9A3AC><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>飬<EFBFBD><E9A3AC><EFBFBD><EFBFBD><EFBFBD>ÿ<EFBFBD><C3BF><EFBFBD><EFBFBD>Ԫ<EFBFBD><D4AA><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD><D8B5>RGBֵ
// <20><><EFBFBD>ص<EFBFBD>(X,Y)<29><>RGBֵ<42><D6B5><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>һ<EFBFBD><D2BB>˳<EFBFBD><CBB3><EFBFBD><EFBFBD><EFBFBD>У<EFBFBD><D0A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>64<36><34><EFBFBD><EFBFBD>32<33><32><EFBFBD><EFBFBD>
// (0,0),(0,1),(0,2),...(0,31) (1,0),(1,1),(1,2),...(1,31) (2,0),(2,1),(2,2),...(2,31) ... (63,0),(63,1),(63,2),...(63,31)
// <20><><EFBFBD>ص<EFBFBD><D8B5>RGBֵ<42><D6B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><CABE>0-7λ<37><CEBB>ʾ<EFBFBD><CABE>ɫ<EFBFBD><C9AB>8-15λ<35><CEBB>ʾ<EFBFBD><CABE>ɫ<EFBFBD><C9AB>16-23<32><33>ʾ<EFBFBD><CABE>ɫ<EFBFBD><C9AB>24-31λ<31><CEBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0
// <20><><EFBFBD><EFBFBD>dib_buffer[n]&0xFF <20><>ʾ<EFBFBD><CABE>ɫ
// (dib_buffer[n]>>8)&0xFF <20><>ʾ<EFBFBD><CABE>ɫ
// (dib_buffer[n]>>16)&0xFF <20><>ʾ<EFBFBD><CABE>ɫ
public static int dib_width = 64;
public static int dib_height = 64;
public static int dib_buffer_size = dib_width * dib_height;
public static int[] dib_buffer = new int[dib_buffer_size];
public static void draw_dib() {
int x, y, z = 0;
int seek = 0;
int color = 0xFF;
for (x = 0; x < dib_width; x++) {
for (y = 0; y < dib_height; y++) {
dib_buffer[seek++] = color;
}
z++;
if (z >= 4) {
switch (color) {
case 0xFF:
color = 0xFF00;
break;
case 0xFF00:
color = 0xFFFF;
break;
case 0xFFFF:
color = 0xFF;
break;
default:
color = 0xFF;
break;
}
z = 0;
}
}
}
public static void send_data() {
int size = 0;
byte[] packet = new byte[1280];
int i, j, k, x, r;
int tx, tx_repeat = 5;
boolean ok;
//<2F><><EFBFBD><EFBFBD>ΪͨѶ<CDA8><D1B6><EFBFBD>룬<EFBFBD><EBA3AC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݵIJ<DDB5>ִ<EFBFBD><D6B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>UDPͨѶ<CDA8><D1B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
if (ledsender.GetDataSize() > (1 << 21)) {
System.out.println("LED<EFBFBD><EFBFBD>Ŀ<EFBFBD><EFBFBD><EFBFBD>ݳ<EFBFBD><EFBFBD>ȳ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD>洢<EFBFBD>ռ<EFBFBD>");
return;
}
System.out.println("LED<EFBFBD><EFBFBD>Ŀѹ<EFBFBD><EFBFBD>ǰ<EFBFBD><EFBFBD><EFBFBD>ݳ<EFBFBD><EFBFBD><EFBFBD>" + ledsender.GetDataSize() + "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݰ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" + ledsender.get_pkg_count(512));
ledsender.Compress();
System.out.println("LED<EFBFBD><EFBFBD>Ŀѹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݳ<EFBFBD><EFBFBD><EFBFBD>" + ledsender.GetDataSize() + "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݰ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" + ledsender.get_pkg_count(512));
//<2F><>ʼ<EFBFBD><CABC>
ok = false;
//System.out.println("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><CABC>...<2E><><EFBFBD><EFBFBD><EFBFBD>к<EFBFBD>=0");
for (tx = 0; tx < tx_repeat; tx++) {
size = ledsender.pkg_begin(packet, addr);
udp_send(packet, size);
for (x = 0; x < 50; x++) {
size = udp_receive(packet);
if (size > 0 && ledsender.parse_trans_respond(packet, size, LEDSender2010.PKC_BEGIN, 0) > 0) {
//System.out.println("<22><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɣ<EFBFBD><C9A3><EFBFBD><EFBFBD>к<EFBFBD>=0");
ok = true;
break;
}
}
if (ok) break;
}
if (!ok) {
System.out.println("<EFBFBD><EFBFBD>ʱ");
return;
}
//<2F><><EFBFBD>ݰ<EFBFBD>
k = ledsender.get_pkg_count(512);
i = 1;
while (i <= k) {
ok = false;
//System.out.println("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݰ<EFBFBD>...<2E><><EFBFBD><EFBFBD><EFBFBD>к<EFBFBD>="+i);
for (tx = 0; tx < tx_repeat; tx++) {
j = i;
size = ledsender.pkg_data(packet, addr, i, 512);
udp_send(packet, size);
for (x = 0; x < 50; x++) {
size = udp_receive(packet);
if (size > 0) {
r = ledsender.parse_trans_respond(packet, size, LEDSender2010.PKC_DATA, i);
switch (r) {
case 0x1:
//System.out.println("<22><><EFBFBD>ݰ<EFBFBD><DDB0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɣ<EFBFBD><C9A3><EFBFBD><EFBFBD>к<EFBFBD>="+i);
ok = true;
j = i + 1;
break;
case 0x2:
//System.out.println("<22><><EFBFBD>ݰ<EFBFBD><DDB0><EFBFBD><EFBFBD>к<EFBFBD>У<EFBFBD>Դ<EFBFBD><D4B4><EFBFBD>Ӧ<EFBFBD><D3A6>="+i+"<22><>ʵ<EFBFBD><CAB5>="+ledsender.fix_serialno);
j = ledsender.fix_serialno;
break;
}
//ok=true;
//break;
}
if (ok) break;
}
i = j;
if (ok) break;
}
if (!ok) {
System.out.println("<EFBFBD><EFBFBD>ʱ");
return;
}
}
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
ok = false;
//System.out.println("<22><><EFBFBD>ͽ<EFBFBD><CDBD><EFBFBD><EFBFBD><EFBFBD>...<2E><><EFBFBD><EFBFBD><EFBFBD>к<EFBFBD>="+i);
for (tx = 0; tx < tx_repeat; tx++) {
size = ledsender.pkg_end(packet, addr, i);
udp_send(packet, size);
for (x = 0; x < 50; x++) {
size = udp_receive(packet);
if (size > 0 && ledsender.parse_trans_respond(packet, size, LEDSender2010.PKC_END, i) > 0) {
//System.out.println("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɣ<EFBFBD><C9A3><EFBFBD><EFBFBD>к<EFBFBD>="+i);
ok = true;
break;
}
}
if (ok) break;
}
if (!ok) {
System.out.println("<EFBFBD><EFBFBD>ʱ");
return;
}
/*
ok=false;
for (x=0; x<100; x++){
size=udp_receive(packet);
switch (ledsender.parse_notify(packet, size)){
case LEDSender2010.NOTIFY_ROOT_PLAY:
System.out.println("<22><><EFBFBD>ͽ<EFBFBD>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD>У<EFBFBD><D0A3>ɹ<EFBFBD>");
ok=true;
break;
case LEDSender2010.NOTIFY_ROOT_DOWNLOAD:
System.out.println("<22><><EFBFBD>ؽ<EFBFBD>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD>У<EFBFBD><D0A3>ɹ<EFBFBD>");
ok=true;
break;
}
if (ok) break;
}
if (!ok) System.out.println("<22><>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD>У<EFBFBD><D0A3><EFBFBD><EFBFBD>󣬷<EFBFBD><F3A3ACB7><EFBFBD>/<2F><><EFBFBD><EFBFBD>ʧ<EFBFBD><CAA7>");
*/
}
public static boolean send_data1(String ip) {
int size = 0;
byte[] packet = new byte[1280];
int i, j, k, x, r;
int tx, tx_repeat = 5;
boolean ok;
// 下面为通讯代码,包括数据的拆分打包、发送
// 由于是UDP通讯,增加
// 如果数据量大于上限,直接返回失败
if (ledsender.GetDataSize() > (1 << 21)) {
System.out.println("LED节目数据长度超出显示屏存储空间");
return false;
}
ledsender.Compress();
// 起始包发送
ok = false;
for (tx = 0; tx < tx_repeat; tx++) {
size = ledsender.pkg_begin(packet, addr);
udp_send1(ip, packet, size);
for (x = 0; x < 50; x++) {
size = udp_receive(packet);
if (size > 0 && ledsender.parse_trans_respond(packet, size, LEDSender2010.PKC_BEGIN, 0) > 0) {
ok = true;
break;
}
}
if (ok) break;
}
// 起始包超时,返回失败
if (!ok) {
System.out.println("起始包发送超时");
return false;
}
// 数据包发送
k = ledsender.get_pkg_count(512);
i = 1;
while (i <= k) {
ok = false;
for (tx = 0; tx < tx_repeat; tx++) {
j = i;
size = ledsender.pkg_data(packet, addr, i, 512);
udp_send1(ip, packet, size);
for (x = 0; x < 50; x++) {
size = udp_receive(packet);
if (size > 0) {
r = ledsender.parse_trans_respond(packet, size,LEDSender2010.PKC_DATA, i);
switch (r) {
case 0x1:
ok = true;
j = i + 1;
break;
case 0x2:
j = ledsender.fix_serialno;
break;
}
}
if (ok) break;
}
i = j;
if (ok) break;
}
// 数据包超时,返回失败
if (!ok) {
System.out.println("数据包发送超时");
return false;
}
}
// 结束包发送
ok = false;
for (tx = 0; tx < tx_repeat; tx++) {
size = ledsender.pkg_end(packet, addr, i);
udp_send1(ip, packet, size);
for (x = 0; x < 50; x++) {
size = udp_receive(packet);
if (size > 0 && ledsender.parse_trans_respond(packet, size, LEDSender2010.PKC_END, i) > 0) {
ok = true;
break;
}
}
if (ok) break;
}
// 结束包超时,返回失败
if (!ok) {
System.out.println("结束包发送超时");
return false;
}
// 所有步骤执行成功,返回true
System.out.println("数据发送全部完成");
return true;
}
public static void demo_upgrade() {
ledsender.Upgrade("d:\\vsd.bin");
send_data();
}
public static void demo_play() {
//String[] formats={"#y", "<22><>", "#m", "<22><>", "#d", "<22><>", " ", "#h", ":", "#n", ":", "#s"};
//String[] formats={"#h", ":", "#n", ":", "#s"};
//<2F><><EFBFBD>ɽ<EFBFBD>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD>
ledsender.MakeRoot(LEDSender2010.ROOT_PLAY,LEDSender2010.COLOR_TYPE_DOUBLE);
//ledsender.MakeRoot(LEDSender2010.ROOT_PLAY, LEDSender2010.COLOR_TYPE_THREE);
//ledsender.MakeRoot(LEDSender2010.ROOT_PLAY, LEDSender2010.COLOR_TYPE_FULL);
ledsender.AddChapter(1, 1000);
ledsender.AddRegion(0, 0, 256, 64);
/*
//<2F><><EFBFBD><EFBFBD>ͼƬ
ledsender.AddLeaf(1, 2000);
//draw_dib();
//ledsender.AddDib(0, 0, 64, 64, dib_buffer, dib_buffer_size, dib_width, dib_height, 1, 5, 2, 5, 0, 0, 1000);
BufferedImage bi;
try {
bi = LEDSender2010.createImageEx("<22>л<EFBFBD><D0BB><EFBFBD><EFBFBD>񹲺͹<F1B9B2BA>", new Font("<22><><EFBFBD><EFBFBD>", Font.BOLD, 24), Color.BLACK, Color.CYAN, 0, false, 64);
System.out.println("width:"+bi.getWidth()+"height:"+bi.getHeight());
ledsender.AddWindow(0, 0, 64, 64, LEDSender2010.getBufferedImageRGB(bi), bi.getWidth() * bi.getHeight(), bi.getWidth(), bi.getHeight(), 2, 0, 2, 0, 0, 0, 0);
} catch (Exception e) {
e.printStackTrace();
}
*/
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֣<EFBFBD><D6A3><EFBFBD><EFBFBD>У<EFBFBD>֧<EFBFBD>ֶ<EFBFBD><D6B6>뷽ʽ<EBB7BD><CABD>
ledsender.AddLeaf(1, 2000);
//ledsender.AddTextJuhao(0, 0, 64, 32, "<22><>ӭ<EFBFBD><D3AD><EFBFBD>١<EFBFBD>лл<D0BB>ݹˡ<DDB9>", "<22><><EFBFBD><EFBFBD>", 24, Color.BLACK, Color.RED, 0, 2, true, 2, 0, 2, 0, 0, 0, 0);
ledsender.AddTextEx(0, 0, 128, 32, "<EFBFBD><EFBFBD>ӭ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>",LEDSender2010.ALIGN_LEFT,LEDSender2010.ALIGN_TOP, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>", 16, Color.BLACK, new Color(255, 0, 0), 0, 1, 0, 2, 0, 0, 0, 0);
//ledsender.AddTextEx(128, 0, 160, 32, "лл<D0BB>ݹ<EFBFBD>", LEDSender2010.ALIGN_LEFT, LEDSender2010.ALIGN_TOP, "<22><><EFBFBD><EFBFBD>", 16, Color.BLACK, Color.RED, 0, 1, 0, 2, 0, 0, 0, 0);
//ledsender.AddLeaf(1, 2000);
//ledsender.AddTextEx(0, 0, 128, 32, "ͬһ<CDAC><D2BB><EFBFBD>й<EFBFBD>", LEDSender2010.ALIGN_LEFT, LEDSender2010.ALIGN_TOP, "<22><><EFBFBD><EFBFBD>", 16, Color.BLACK, Color.RED, 0, 1, 0, 2, 0, 0, 0, 0);
//ledsender.AddTextEx(128, 0, 160, 32, "ͬһ<CDAC><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", LEDSender2010.ALIGN_LEFT, LEDSender2010.ALIGN_TOP, "<22><><EFBFBD><EFBFBD>", 16, Color.BLACK, Color.RED, 0, 1, 0, 2, 0, 0, 0, 0);
/*
//24<32><34><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
ledsender.AddLeaf(1, 2000);
ledsender.AddString(0, 0, 64, 32, "<22><>ӭ<EFBFBD><D3AD><EFBFBD><EFBFBD>abc", 2, 0, 2, 0, 0, 0, 0, 0xFF, 1);
//24<32><34><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD>䣬<EFBFBD><E4A3AC>ʽyyyy<79><79>mm<6D><6D>dd<64><64>
ledsender.AddLeaf(1, 2000);
ledsender.AddStringDateTime(0, 0, 256, 32, 0xFFFF, 1, formats, 6);
*/
send_data();
}
public static void demo_play2() {
//<2F><><EFBFBD>ɽ<EFBFBD>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD>
ledsender.MakeRoot(LEDSender2010.ROOT_DOWNLOAD,LEDSender2010.COLOR_TYPE_DOUBLE);
//ledsender.MakeRoot(LEDSender2010.ROOT_PLAY, LEDSender2010.COLOR_TYPE_THREE);
ledsender.AddChapter(1, 1000000);
ledsender.AddRegion(0, 0, 256, 64);
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֣<EFBFBD><D6A3><EFBFBD><EFBFBD>У<EFBFBD>֧<EFBFBD>ֶ<EFBFBD><D6B6>뷽ʽ<EBB7BD><CABD>
ledsender.AddLeaf(1, 200000);
ledsender.AddWindows(0, 0, 64, 32);
ledsender.AddChildText("<EFBFBD><EFBFBD>ӭ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>", "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>", 16, Color.BLACK, Color.RED, 0, 0, false, 6, 0, 2, 0, 0, 0, 0);
ledsender.AddChildText("лл<EFBFBD>ݹ<EFBFBD>", "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>", 16, Color.BLACK, Color.RED, 0, 0, false, 6, 0, 2, 0, 0, 0, 0);
send_data();
}
public static void demo_play_chapterschedule() {
//String[] formats={"#y", "<22><>", "#m", "<22><>", "#d", "<22><>", " ", "#h", ":", "#n", ":", "#s"};
//String[] formats={"#h", ":", "#n", ":", "#s"};
//<2F><><EFBFBD>ɽ<EFBFBD>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD>
ledsender.MakeRoot(LEDSender2010.ROOT_PLAY,LEDSender2010.COLOR_TYPE_DOUBLE);
ledsender.AddChapterEx(1, 1000, 1, 1, 0x7F, 2016, 8, 17, 0, 0, 0, 2016, 12, 27, 23, 59, 59);
ledsender.AddRegion(0, 0, 64, 64);
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֣<EFBFBD><D6A3>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD>У<EFBFBD>
ledsender.AddLeaf(1, 2000);
ledsender.AddText(0, 0, 64, 32, "<EFBFBD><EFBFBD>ӭ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>abc", "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>", 14, Color.BLACK, Color.RED, 0, 2, true, 3, 0, 2, 0, 0, 0, 0);
ledsender.AddChapterEx(1, 1000, 1, 1, 0x7F, 2016, 4, 28, 10, 10, 0, 2016, 12, 27, 23, 15, 0);
ledsender.AddRegion(0, 0, 64, 64);
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֣<EFBFBD><D6A3><EFBFBD><EFBFBD>У<EFBFBD>֧<EFBFBD>ֶ<EFBFBD><D6B6>뷽ʽ<EBB7BD><CABD>
ledsender.AddLeaf(1, 2000);
ledsender.AddTextEx(0, 0, 64, 32, "лл<EFBFBD>ݹ<EFBFBD>abc",LEDSender2010.ALIGN_CENTER,LEDSender2010.ALIGN_TOP, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>", 14, Color.BLACK, Color.RED, 0, 1, 0, 2, 0, 0, 0, 0);
send_data();
}
public static void demo_play_picture() {
//<2F><><EFBFBD>ɽ<EFBFBD>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD>
ledsender.MakeRoot(LEDSender2010.ROOT_PLAY,LEDSender2010.COLOR_TYPE_DOUBLE);
ledsender.AddChapter(1, 1000);
ledsender.AddRegion(0, 0, 64, 64);
ledsender.AddLeaf(1, 2000);
ledsender.AddPicture(0, 0, 64, 64, "c:\\demo.bmp", 1, 0, 2, 0, 0, 0, 0);
send_data();
}
public static void demo_play_voice() {
//<2F><><EFBFBD>ɽ<EFBFBD>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD>
ledsender.MakeRoot(LEDSender2010.ROOT_PLAY,LEDSender2010.COLOR_TYPE_DOUBLE);
ledsender.AddChapter(1, 1000);
ledsender.AddRegion(0, 0, 64, 64);
ledsender.AddLeaf(1, 2000);
ledsender.AddTextEx(0, 0, 64, 32, "<EFBFBD><EFBFBD>ӭ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>",LEDSender2010.ALIGN_CENTER,LEDSender2010.ALIGN_TOP, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>", 16, Color.BLACK, Color.RED, 0, 1, 0, 2, 0, 0, 0, 0);
ledsender.AddVoice("<EFBFBD><EFBFBD>ӭ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>", 5000, 10, 0, 5, 5, 1);
send_data();
}
public static void demo_datetime_play() {
String[] formats_datetime = {"#y", "<EFBFBD><EFBFBD>", "#m", "<EFBFBD><EFBFBD>", "#d", "<EFBFBD><EFBFBD>", " ", "#h", ":", "#n", ":", "#s"};
String[] formats_date = {"#y", "<EFBFBD><EFBFBD>", "#m", "<EFBFBD><EFBFBD>", "#d", "<EFBFBD><EFBFBD>"};
String[] formats_time = {"#h", ":", "#n", ":", "#s"};
String[] formats_week = {"<EFBFBD><EFBFBD><EFBFBD><EFBFBD>", "#w"};
//<2F><><EFBFBD>ɽ<EFBFBD>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD>
ledsender.MakeRoot(LEDSender2010.ROOT_PLAY,LEDSender2010.COLOR_TYPE_DOUBLE);
//ledsender.MakeRoot(LEDSender2010.ROOT_PLAY, LEDSender2010.COLOR_TYPE_THREE);
ledsender.AddChapter(1, 10000);
ledsender.AddRegion(0, 0, 64, 64);
ledsender.AddLeaf(1, 2000);
ledsender.AddDateTime(0, 0, 64, 32, formats_datetime, 12, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>", 14, Color.BLACK, Color.YELLOW, 0);
ledsender.AddLeaf(1, 2000);
ledsender.AddDateTime(0, 0, 64, 32, formats_date, 6, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>", 14, Color.BLACK, Color.RED, 0);
ledsender.AddLeaf(1, 2000);
ledsender.AddDateTime(0, 0, 64, 32, formats_time, 5, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>", 14, Color.BLACK, Color.GREEN, 0);
ledsender.AddLeaf(1, 2000);
ledsender.AddDateTime(0, 0, 64, 32, formats_week, 2, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>", 14, Color.BLACK, Color.RED, 0);
send_data();
}
public static void demo_schedule_child_play() {
//<2F><><EFBFBD>ɽ<EFBFBD>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD>
//String[] formats_datetime={"#y", "<22><>", "#m", "<22><>", "#d", "<22><>", " ", "#h", ":", "#n", ":", "#s"};
ledsender.MakeRoot(LEDSender2010.ROOT_PLAY,LEDSender2010.COLOR_TYPE_DOUBLE);
ledsender.AddChapter(1, 10000);
ledsender.AddRegion(0, 0, 64, 64);
ledsender.AddLeaf(1, 2000);
ledsender.AddWindows(0, 0, 64, 32);
//ledsender.AddChildText("abc", "<22><><EFBFBD><EFBFBD>", 14, Color.BLACK, Color.RED, 0, false, 1, 0, 2, 0, 0, 0, 0);
ledsender.AddChildScheduleText("<EFBFBD><EFBFBD>ӭ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>", "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>", 14, Color.BLACK, Color.RED, 0, 0, false, 1, 0, 2, 0, 0, 0, 2000, 2, 0x0, 2018, 2, 5, 7, 10, 0, 2018, 2, 6, 23, 15, 0);
ledsender.AddChildScheduleText("лл<EFBFBD>ݹ<EFBFBD>", "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>", 14, Color.BLACK, Color.RED, 0, 0, false, 1, 0, 2, 0, 0, 0, 2000, 2, 0x0, 2018, 2, 5, 7, 10, 0, 2018, 2, 6, 23, 15, 0);
ledsender.AddChildScheduleText("ͬһ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>", 14, Color.BLACK, Color.RED, 0, 0, false, 1, 0, 2, 0, 0, 0, 2000, 2, 0x0, 2018, 2, 8, 7, 10, 0, 2018, 2, 9, 23, 15, 0);
ledsender.AddChildScheduleText("ͬһ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>", 14, Color.BLACK, Color.RED, 0, 0, false, 1, 0, 2, 0, 0, 0, 2000, 2, 0x0, 2018, 2, 8, 7, 10, 0, 2018, 2, 9, 23, 15, 0);
send_data();
}
public static void demo_fontset_import(MyUdpSocket udp, String ip, int num, String text) {
byte[] packet = new byte[1024];
byte[] s;
int i, size;
int c;
size = 0;
try {
s = text.getBytes("GB2312");
size = 0;
packet[size++] = 0x55;
packet[size++] = 0x25;
packet[size++] = 0x3E;
packet[size++] = (byte) (((num / 100) % 10) + 0x30);
packet[size++] = (byte) (((num / 10) % 10) + 0x30);
packet[size++] = (byte) ((num % 10) + 0x30);
for (i = 0; i < s.length; i++) {
if (s[i] >= 0) c = s[i];
else c = (256 + s[i]);
switch (c >> 4) {
case 0:
packet[size++] = 0x30;
break;
case 1:
packet[size++] = 0x31;
break;
case 2:
packet[size++] = 0x32;
break;
case 3:
packet[size++] = 0x33;
break;
case 4:
packet[size++] = 0x34;
break;
case 5:
packet[size++] = 0x35;
break;
case 6:
packet[size++] = 0x36;
break;
case 7:
packet[size++] = 0x37;
break;
case 8:
packet[size++] = 0x38;
break;
case 9:
packet[size++] = 0x39;
break;
case 10:
packet[size++] = 0x61;
break;
case 11:
packet[size++] = 0x62;
break;
case 12:
packet[size++] = 0x63;
break;
case 13:
packet[size++] = 0x64;
break;
case 14:
packet[size++] = 0x65;
break;
case 15:
packet[size++] = 0x66;
break;
default:
packet[size++] = 0x30;
break;
}
switch (c & 0xF) {
case 0:
packet[size++] = 0x30;
break;
case 1:
packet[size++] = 0x31;
break;
case 2:
packet[size++] = 0x32;
break;
case 3:
packet[size++] = 0x33;
break;
case 4:
packet[size++] = 0x34;
break;
case 5:
packet[size++] = 0x35;
break;
case 6:
packet[size++] = 0x36;
break;
case 7:
packet[size++] = 0x37;
break;
case 8:
packet[size++] = 0x38;
break;
case 9:
packet[size++] = 0x39;
break;
case 10:
packet[size++] = 0x61;
break;
case 11:
packet[size++] = 0x62;
break;
case 12:
packet[size++] = 0x63;
break;
case 13:
packet[size++] = 0x64;
break;
case 14:
packet[size++] = 0x65;
break;
case 15:
packet[size++] = 0x66;
break;
default:
packet[size++] = 0x30;
break;
}
}
packet[size++] = 0x23;
packet[size++] = (byte) 0xAA;
} catch (Exception e) {
}
if (size > 0) {
try {
udp = new MyUdpSocket(8868);
udp.send(ip, 6666, packet, size);
} catch (Exception ex) {
ex.printStackTrace();
}
}
}
//ֻ<><D6BB><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD>Ŀ
public static void demo_play_sub_chapter() {
ledsender.MakeChapter(LEDSender2010.ROOT_PLAY_CHAPTER,LEDSender2010.COLOR_TYPE_DOUBLE, 1, 0, 1, 1000);
ledsender.AddRegion(0, 0, 64, 64);
ledsender.AddLeaf(1, 2000);
ledsender.AddTextEx(0, 0, 64, 32, "abc",LEDSender2010.ALIGN_CENTER,LEDSender2010.ALIGN_TOP, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>", 14, Color.BLACK, Color.RED, 0, 1, 0, 2, 0, 0, 0, 0);
send_data();
}
public static void demo_play_sub_chapter_ex() {
ledsender.MakeChapterEx(LEDSender2010.ROOT_PLAY_CHAPTER,LEDSender2010.COLOR_TYPE_DOUBLE, 1, 0, 1, 1000, 1, 1, 0x7F, 2016, 8, 17, 0, 0, 0, 2016, 12, 27, 23, 59, 59);
ledsender.AddRegion(0, 0, 64, 64);
ledsender.AddLeaf(1, 2000);
ledsender.AddTextEx(0, 0, 64, 32, "abc",LEDSender2010.ALIGN_CENTER,LEDSender2010.ALIGN_TOP, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>", 14, Color.BLACK, Color.RED, 0, 1, 0, 2, 0, 0, 0, 0);
send_data();
}
//ֻ<><D6BB><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
public static void demo_play_sub_region() {
ledsender.MakeRegion(LEDSender2010.ROOT_PLAY_REGION,LEDSender2010.COLOR_TYPE_DOUBLE, 1, 0, 1, 0, 16, 128, 16);
ledsender.AddLeaf(1, 2000);
ledsender.AddTextEx(0, 0, 64, 32, "abc",LEDSender2010.ALIGN_CENTER,LEDSender2010.ALIGN_TOP, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>", 14, Color.BLACK, Color.RED, 0, 1, 0, 2, 0, 0, 0, 0);
send_data();
}
//ֻ<><D6BB><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>ҳ<EFBFBD><D2B3>
public static void demo_play_sub_leaf() {
String[] formats_datetime = {"#h", ":", "#n", ":", "#s"};
ledsender.MakeLeaf(LEDSender2010.ROOT_PLAY_LEAF,LEDSender2010.COLOR_TYPE_DOUBLE, 1, 0, 0, 1, 1, 1000);
ledsender.AddTextEx(0, 0, 64, 16, "abc",LEDSender2010.ALIGN_CENTER,LEDSender2010.ALIGN_TOP, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>", 14, Color.BLACK, Color.RED, 0, 1, 0, 2, 0, 0, 0, 0);
ledsender.AddDateTime(0, 16, 64, 16, formats_datetime, 12, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>", 14, Color.BLACK, Color.YELLOW, 0);
send_data();
}
//ֻ<><D6BB><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
public static void demo_play_sub_object() {
ledsender.MakeObject(LEDSender2010.ROOT_PLAY_OBJECT,LEDSender2010.COLOR_TYPE_DOUBLE, 1, 0, 0, 0, 1);
//<2F>˴<EFBFBD>ֻ<EFBFBD><D6BB><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
ledsender.AddTextEx(0, 0, 64, 32, "abc",LEDSender2010.ALIGN_CENTER,LEDSender2010.ALIGN_TOP, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>", 12, Color.BLACK, Color.RED, 0, 1, 0, 2, 0, 0, 0, 0);
send_data();
}
//<2F>Զ<EFBFBD><D4B6>巽<EFBFBD><E5B7BD> <20><>̬<EFBFBD><CCAC>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
public static void demo_play_chapterschedule1(String ip, String msg) {
//<2F><><EFBFBD>ɽ<EFBFBD>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD>
ledsender.MakeRoot(LEDSender2010.ROOT_PLAY,LEDSender2010.COLOR_TYPE_DOUBLE);
ledsender.AddChapterEx(1, 1000, 1, 1, 0x7F, 2016, 8, 17, 0, 0, 0, 2016, 12, 27, 23, 59, 59);
ledsender.AddRegion(0, 0, 192, 64);
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֣<EFBFBD><D6A3>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD>У<EFBFBD>
ledsender.AddLeaf(1, 2000);
ledsender.AddText(8, 24, 192, 64, msg, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>", 16, Color.BLACK, Color.YELLOW, 0, 2, false, 1, 0, 2, 0, 0, 5, 10000);
send_data1(ip);
}
//<2F>Զ<EFBFBD><D4B6>巽<EFBFBD><E5B7BD> <20><>̬<EFBFBD><CCAC>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
public static boolean demo_play_chapterschedule2(String ip, String msg1, String msg2) {
//<2F><><EFBFBD>ɽ<EFBFBD>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD>
ledsender.MakeRoot(LEDSender2010.ROOT_PLAY,LEDSender2010.COLOR_TYPE_DOUBLE);
ledsender.AddChapterEx(1, 1000, 1, 1, 0x7F, 2016, 8, 17, 0, 0, 0, 2016, 12, 27, 23, 59, 59);
ledsender.AddRegion(0, 0, 192, 64);
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֣<EFBFBD><D6A3>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD>У<EFBFBD>
ledsender.AddLeaf(1, 2000);
ledsender.AddText(0, 11, 192, 32, msg1, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>", 16, Color.BLACK, Color.YELLOW, 0, 2, false, 1, 0, 2, 0, 0, 5, 10000);
ledsender.AddText(0, 37, 192, 32, msg2, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>", 16, Color.BLACK, Color.YELLOW, 0, 2, false, 1, 0, 2, 0, 0, 5, 10000);
return send_data1(ip);
}
//<2F>Զ<EFBFBD><D4B6>巽<EFBFBD><E5B7BD><EFBFBD><EFBFBD>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
public static void demo_play_chapterschedule3(String ip, String msg1, String msg2, String msg3, String msg4, String msg5, String msg) {
//<2F><><EFBFBD>ɽ<EFBFBD>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD>
ledsender.MakeRoot(LEDSender2010.ROOT_PLAY,LEDSender2010.COLOR_TYPE_DOUBLE);
ledsender.AddChapterEx(1, 1000, 1, 1, 0x7F, 2016, 8, 17, 0, 0, 0, 2016, 12, 27, 23, 59, 59);
ledsender.AddRegion(0, 0, 400, 300);
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֣<EFBFBD><D6A3>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD>У<EFBFBD>
ledsender.AddLeaf(1, 2000);
ledsender.AddText(0, 0, 192, 21, msg, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>", 13, Color.BLACK, Color.YELLOW, 0, 2, false, 1, 0, 2, 0, 0, 5, 10000);
ledsender.AddText(0, 12, 192, 21, msg1, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>", 13, Color.BLACK, Color.YELLOW, 0, 2, false, 1, 0, 2, 0, 0, 5, 10000);
ledsender.AddText(0, 24, 192, 21, msg2, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>", 13, Color.BLACK, Color.YELLOW, 0, 2, false, 1, 0, 2, 0, 0, 5, 10000);
ledsender.AddText(0, 36, 192, 22, msg3, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>", 13, Color.BLACK, Color.YELLOW, 0, 2, false, 1, 0, 2, 0, 0, 5, 10000);
// ledsender.AddText(0, 48, 192, 22, msg4, "<22><><EFBFBD><EFBFBD>", 13, Color.BLACK, Color.YELLOW, 0, 2, false, 1, 0, 2, 0, 0, 5, 10000);
// ledsender.AddText(0, 50, 192, 22, msg5, "<22><><EFBFBD><EFBFBD>", 13, Color.BLACK, Color.YELLOW, 0, 2, false, 1, 0, 2, 0, 0, 5, 10000);
send_data1(ip);
}
//<2F>Զ<EFBFBD><D4B6>巽<EFBFBD><E5B7BD><EFBFBD><EFBFBD>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
public static void demo_play_chapterschedule4(String ip, String msg1, String msg2, String msg3, String msg, String msgSpec, String msgProduct, String ms7, String msg8) {
//<2F><><EFBFBD>ɽ<EFBFBD>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD>
ledsender.MakeRoot(LEDSender2010.ROOT_PLAY,LEDSender2010.COLOR_TYPE_DOUBLE);
ledsender.AddChapterEx(1, 1000, 1, 1, 0x7F, 2016, 8, 17, 0, 0, 0, 2016, 12, 27, 23, 59, 59);
ledsender.AddRegion(0, 0, 400, 300);
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֣<EFBFBD><D6A3>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD>У<EFBFBD>
ledsender.AddLeaf(1, 2000);
ledsender.AddText(0, 0, 192, 21, msg, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>", 13, Color.BLACK, Color.YELLOW, 0, 2, false, 1, 0, 2, 0, 0, 5, 10000);
ledsender.AddText(0, 15, 192, 21, msg1, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>", 13, Color.BLACK, Color.YELLOW, 0, 2, false, 1, 0, 2, 0, 0, 5, 10000);
ledsender.AddText(0, 30, 192, 21, msg2, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>", 13, Color.BLACK, Color.YELLOW, 0, 2, false, 1, 0, 2, 0, 0, 5, 10000);
ledsender.AddText(0, 45, 192, 22, msg3, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>", 13, Color.BLACK, Color.YELLOW, 0, 2, false, 1, 0, 2, 0, 0, 5, 10000);
// ledsender.AddText(0, 48, 192, 22, msg4, "<22><><EFBFBD><EFBFBD>", 13, Color.BLACK, Color.YELLOW, 0, 2, false, 1, 0, 2, 0, 0, 5, 10000);
// ledsender.AddText(0, 50, 192, 22, msg5, "<22><><EFBFBD><EFBFBD>", 13, Color.BLACK, Color.YELLOW, 0, 2, false, 1, 0, 2, 0, 0, 5, 10000);
send_data1(ip);
}
public static boolean demo_play_chapterschedule4(String ip, String msg1, String msg2, String msg3, String msg,String msg5,String msg6,String msg7,String msg8, String msgQuantity) {
//<2F><><EFBFBD>ɽ<EFBFBD>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD>
ledsender.MakeRoot(LEDSender2010.ROOT_PLAY,LEDSender2010.COLOR_TYPE_DOUBLE);
ledsender.AddChapterEx(1, 1000, 1, 1, 0x7F, 2016, 8, 17, 0, 0, 0, 2016, 12, 27, 23, 59, 59);
ledsender.AddRegion(0, 0, 400, 300);
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֣<EFBFBD><D6A3>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD>У<EFBFBD>
ledsender.AddLeaf(1, 2000);
ledsender.AddText(0, 0, 192, 21, msg, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>", 13, Color.BLACK, Color.YELLOW, 0, 2, false, 1, 0, 2, 0, 0, 5, 10000);
ledsender.AddText(0, 15, 192, 21, msg1, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>", 13, Color.BLACK, Color.YELLOW, 0, 2, false, 1, 0, 2, 0, 0, 5, 10000);
ledsender.AddText(65, 15, 192, 21, msg6, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>", 13, Color.BLACK, Color.YELLOW, 0, 2, false, 1, 0, 7, 0, 0, 5, 3000);
ledsender.AddText(0, 30, 192, 21, msg2, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>", 13, Color.BLACK, Color.YELLOW, 0, 2, false, 1, 0, 2, 0, 0, 5, 10000);
ledsender.AddText(65, 30, 192, 21, msg5, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>", 13, Color.BLACK, Color.YELLOW, 0, 2, false, 1, 0, 7, 0, 0, 5, 3000);
ledsender.AddText(0, 45, 192, 22, msg3, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>", 13, Color.BLACK, Color.YELLOW, 0, 2, false, 1, 0, 2, 0, 0, 5, 10000);
ledsender.AddText(65, 45, 192, 22, msgQuantity, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>", 13, Color.BLACK, Color.YELLOW, 0, 2, false, 1, 0, 7, 0, 0, 5, 3000);
ledsender.AddText(0, 60, 192, 21, msg7, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>", 13, Color.BLACK, Color.YELLOW, 0, 2, false, 1, 0, 2, 0, 0, 5, 10000);
ledsender.AddText(65, 60, 192, 21, msg8, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>", 13, Color.BLACK, Color.YELLOW, 0, 2, false, 1, 0, 7, 0, 0, 5, 3000);
return send_data1(ip);
}
public static void main(String[] args) {
// TODO Auto-generated method stub
try {
my_udp = new MyUdpSocket(8818);
} catch (Exception ex) {
ex.printStackTrace();
}
//demo_play();
//demo_play_voice();
//demo_fontset_import(my_udp, "192.168.1.99", 0, "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>123");
//demo_reset_display();
//demo_play_chapterschedule();
//demo_upgrade();
//demo_datetime_play();
//demo_play_picture();
//demo_schedule_child_play();
demo_get_boardparam();
//demo_set_boardparam_ip("192.168.1.99");
//demo_power_off();
//demo_power_on();
//demo_get_power();
//demo_set_bright();
//demo_get_bright();
//demo_adjust_time();
//demo_switch_on();
//demo_switch_off();
//demo_power_schedule();
System.out.println("<EFBFBD><EFBFBD><EFBFBD>н<EFBFBD><EFBFBD><EFBFBD>.");
}
}

View File

@@ -0,0 +1,27 @@
package com.ruoyi.Dzp.domain;
import com.ruoyi.common.core.domain.BaseEntity;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@NoArgsConstructor
public class basLed extends BaseEntity {
private int id;
private String product_id;
private String spec;
private String quantity;
private String sendFlag;
private String ipAddress;
private String trayCode;
private String model;
private String productName;
private String errorMsg;
}

View File

@@ -0,0 +1,15 @@
package com.ruoyi.Dzp.mapper;
import com.ruoyi.Dzp.domain.basLed;
import java.util.List;
public interface BasLedMapper {
List<basLed> selectBasLedList(basLed BasLed);
void updateBasLed(basLed BasLed);
}

View File

@@ -0,0 +1,78 @@
package com.ruoyi.api.controller;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicReference;
public class BatchNoGenerator{
// 日期格式化模板:固定生成 yyyyMMdd 格式
private static final DateTimeFormatter DATE_FORMATTER = DateTimeFormatter.ofPattern("yyyyMMdd");
// 原子引用:存储当前日期,CAS保证【日期判断+重置】的原子性
private static final AtomicReference<String> CURRENT_DATE =
new AtomicReference<>(LocalDate.now().format(DATE_FORMATTER));
// 原子整数:流水号计数器,CPU级指令保证自增原子性
private static final AtomicInteger SERIAL_NUMBER = new AtomicInteger(1);
// 流水号最大长度(4位,最大值9999)
private static final int MAX_SERIAL = 9999;
private static final String SERIAL_FORMAT = "%04d";
/**
* 生成唯一批号(多线程安全,原子操作)
* @return yyyyMMdd+4位流水号
*/
public static String generateBatchNo() {
// 获取当前系统日期
String today = LocalDate.now().format(DATE_FORMATTER);
// CAS自旋:保证日期判断、重置、计数的原子性
while (true) {
// 读取缓存的日期
String cacheDate = CURRENT_DATE.get();
// 场景1:当天未跨天,直接生成流水号
if (today.equals(cacheDate)) {
// 原子自增获取当前序号
int currentNum = SERIAL_NUMBER.getAndIncrement();
// 防止4位流水号溢出(超过9999)
if (currentNum > MAX_SERIAL) {
// 重置序号,抛出异常提示
SERIAL_NUMBER.set(1);
throw new RuntimeException("当日批号已达上限:" + MAX_SERIAL);
}
// 拼接日期+4位流水号,返回结果
return today + String.format(SERIAL_FORMAT, currentNum);
}
// 场景2:跨天了,CAS原子更新日期并重置流水号
if (CURRENT_DATE.compareAndSet(cacheDate, today)) {
// 只有一个线程能执行到这里,重置为1
SERIAL_NUMBER.set(1);
return today + String.format(SERIAL_FORMAT, 1);
}
// CAS更新失败:说明其他线程已完成跨天重置,重新循环
}
}
public static void main(String[] args) throws InterruptedException {
// 模拟20个线程同时生成批号
for (int i = 0; i < 20; i++) {
new Thread(() -> {
String batchNo = generateBatchNo();
System.out.println("线程:" + Thread.currentThread().getName() + ",生成批号:" + batchNo);
}).start();
}
Thread.sleep(1000);
System.out.println("=== 所有批号生成完成,无重复、无乱序 ===");
}
}

View File

@@ -1,13 +1,19 @@
package com.ruoyi.api.controller;
import cn.hutool.json.JSONUtil;
import com.ruoyi.api.moveMsg.domain.MoveMsg;
import com.ruoyi.api.service.IToErpService;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.log.service.IRequestLogService;
import com.ruoyi.pda.mapper.PdaMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.web.bind.annotation.*;
import com.ruoyi.api.domain.DeliveryNoticeVo;
import java.util.HashMap;
/**
* 作业统计 Controller
*/
@@ -19,6 +25,8 @@ public class ToErpApiController {
private IToErpService toErpService;
@Autowired
private IRequestLogService requestLogService;
@Autowired
private PdaMapper pdaMapper;
/**
* 接收入出库通知单
@@ -28,7 +36,7 @@ public class ToErpApiController {
public AjaxResult receiveDeliveryNotice(@RequestBody DeliveryNoticeVo deliveryNoticeVo) {
AjaxResult ajaxResult = toErpService.receiveDeliveryNotice(deliveryNoticeVo);
requestLogService.insertRequestLog(requestLogService.getRequestLog(deliveryNoticeVo.toString(), "接收入出库通知单", ajaxResult));
requestLogService.insertRequestLog(requestLogService.getRequestLogERP(JSONUtil.toJsonStr(deliveryNoticeVo), "接收入出库通知单", ajaxResult));
return ajaxResult;
@@ -36,22 +44,107 @@ public class ToErpApiController {
/**
* 回传其他入库单
* 回传入库单
*/
// @Scheduled(fixedDelay = 1500)
@Scheduled(fixedDelay = 1500)
@RequestMapping("/callbackInDeliveryNotice")
@ResponseBody
public void callbackInDeliveryNotice() {
toErpService.callbackInDeliveryNotice();
public void callbackInDeliveryNoticeNew() {
toErpService.callbackInDeliveryNoticeNew();
}
/**
* 回传出库单(新)
*/
@Scheduled(fixedDelay = 1500)
@RequestMapping("/callbackOutDeliveryNotice")
@ResponseBody
public void callbackDeliveryOutNoticeNew() {
toErpService.callbackDeliveryOutNoticeNew();
}
// @Scheduled(fixedDelay = 1500)
// @RequestMapping("/callbackOutDeliveryNotice")
// @ResponseBody
// public void callbackDeliveryOutNoticeNewS() {
// toErpService.callbackDeliveryOutNoticeNews();
// }
// /**
// * 回传其他入库单
// */
// @Scheduled(fixedDelay = 1500)
// @RequestMapping("/callbackInDeliveryNotice")
// @ResponseBody
// public void callbackInDeliveryNotice() {
// toErpService.callbackInDeliveryNotice();
// }
//
// /**
// * 回传其他出库单
// */
// @Scheduled(fixedDelay = 1500)
// @RequestMapping("/callbackOutDeliveryNotice")
// @ResponseBody
// public void callbackDeliveryOutNotice() {
// toErpService.callbackoutDeliveryNotice();
// }
/**
* 移库回调接口
*/
@Scheduled(fixedDelay = 1500)
@RequestMapping("/moveCargoSpace")
@ResponseBody
public void moveCargoSpace() {
toErpService.moveCargoSpace();
}
/**
* 回传其他出库单
* 自动确认入库单据
*/
@RequestMapping("/callbackOutDeliveryNotice")
@Scheduled(fixedDelay = 10000)
// @RequestMapping("/FillFinishAllot")
@ResponseBody
public void callbackDeliveryOutNotice() {
toErpService.callbackoutDeliveryNotice();
public void FillFinishAllot() {
HashMap<String, Object> map = new HashMap<>();
map.put("v_result", null);
map.put("v_result_msg", null);
pdaMapper.FillFinishAllot(map);
String result = map.get("v_result").toString();
String msg = map.get("v_result_msg").toString();
if ("10".equals(result)) {
System.err.println(msg);
} else {
// System.err.println(msg);
}
}
/**
* 自动确认出库单据
*/
@Scheduled(fixedDelay = 10000)
// @RequestMapping("/FillFinishAllot")
@ResponseBody
public void FillFinishAllotOut() {
HashMap<String, Object> map = new HashMap<>();
map.put("v_result", null);
map.put("v_result_msg", null);
pdaMapper.FillFinishAllotOut(map);
String result = map.get("v_result").toString();
String msg = map.get("v_result_msg").toString();
if ("10".equals(result)) {
System.err.println(msg);
} else {
// System.err.println(msg);
}
}
}

View File

@@ -1,5 +1,6 @@
package com.ruoyi.api.controller;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import com.ruoyi.api.domain.ErpProduct;
import com.ruoyi.api.domain.ReMaterialParam;
@@ -11,6 +12,10 @@ import com.ruoyi.bas.BasProduct.service.IBasProductService;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.device.agv.domain.AgvContainerTask;
import com.ruoyi.device.agv.service.IAgvContainerTaskService;
import com.ruoyi.job.mydojob.domain.MydoJob;
import com.ruoyi.job.mydojob.mapper.MydoJobMapper;
import com.ruoyi.log.domain.RequestLog;
import com.ruoyi.log.service.IRequestLogService;
import com.ruoyi.out.outStockout.domain.OutStockoutVo;
@@ -19,7 +24,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import java.util.Map;
import java.util.*;
/**
* 作业统计 Controller
@@ -36,6 +41,10 @@ public class ToWmsApiController {
private IOutStockoutService outStockoutService;
@Autowired
private IBasProductService basProductService;
@Autowired
private MydoJobMapper mapper;
@Autowired
private IAgvContainerTaskService agvContainerTaskService;
/**
* 入库请求生成作业
@@ -48,6 +57,38 @@ public class ToWmsApiController {
return ajaxResult;
}
// 入库分货位
@PostMapping("/sendCargoSpace")
public AjaxResult sendCargoSpace(@RequestBody RequestEnter requestEnter) {
AjaxResult ajaxResult = toWmsService.requestEnterByTaskNo(requestEnter);
RequestLog requestLog = requestLogService.getRequestLog(JSONUtil.toJsonStr(requestEnter), "入库请求分配货位", ajaxResult);
requestLogService.insertRequestLog(requestLog);
return ajaxResult;
}
// 出库到位更新LED显示屏
@PostMapping("/updateLed")
public AjaxResult updateLed(@RequestBody RequestEnter requestEnter) {
HashMap<String, Object> map = new HashMap<>();
map.put("v_task_no", requestEnter.getTaskNo());
map.put("v_code", requestEnter.getDeviceCode());
mapper.updateLed(map);
return AjaxResult.success();
}
// 线体报警更新报警信息
@PostMapping("/updateLedError")
public AjaxResult updateLedError(@RequestBody RequestEnter requestEnter) {
HashMap<String, Object> map = new HashMap<>();
map.put("v_code", requestEnter.getDeviceCode());
map.put("v_error_code", requestEnter.getErrorCode());
mapper.updateLedError(map);
return AjaxResult.success();
}
/**
* 请求补码作业
*/
@@ -80,7 +121,6 @@ public class ToWmsApiController {
* positionCode1:起点
* positionCode2:终点
* containerCode:容器编码
*
*/
@PostMapping("/jobFinish")
public AjaxResult jobFinish(@RequestBody WmsJobRequest wmsJobRequest) {
@@ -113,7 +153,6 @@ public class ToWmsApiController {
}
/**
* 出库单据保存
*
@@ -137,8 +176,7 @@ public class ToWmsApiController {
*/
@Log(title = "接收物料", businessType = BusinessType.INSERT)
@PutMapping("/receiveProduct")
public AjaxResult receiveProduct(@RequestBody ErpProduct erpProduct)
{
public AjaxResult receiveProduct(@RequestBody ErpProduct erpProduct) {
AjaxResult ajaxResult = toWmsService.receiveProduct(erpProduct);
RequestLog requestLog = requestLogService.getRequestLog(JSONUtil.toJsonStr(erpProduct), "接收物料", ajaxResult);
requestLogService.insertRequestLog(requestLog);
@@ -150,8 +188,7 @@ public class ToWmsApiController {
*/
@Log(title = "修改物料管理", businessType = BusinessType.UPDATE)
@PutMapping("/updateProduct")
public AjaxResult updateProduct(@RequestBody ErpProduct erpProduct)
{
public AjaxResult updateProduct(@RequestBody ErpProduct erpProduct) {
AjaxResult ajaxResult = toWmsService.updateProduct(erpProduct);
RequestLog requestLog = requestLogService.getRequestLog(JSONUtil.toJsonStr(erpProduct), "修改物料管理", ajaxResult);
requestLogService.insertRequestLog(requestLog);
@@ -163,12 +200,76 @@ public class ToWmsApiController {
*/
@Log(title = "作废物料", businessType = BusinessType.UPDATE)
@PutMapping("/InvalidProduct")
public AjaxResult InvalidProduct(@RequestBody ErpProduct erpProduct)
{
public AjaxResult InvalidProduct(@RequestBody ErpProduct erpProduct) {
AjaxResult ajaxResult = toWmsService.InvalidProduct(erpProduct);
RequestLog requestLog = requestLogService.getRequestLog(JSONUtil.toJsonStr(erpProduct), "作废物料", ajaxResult);
requestLogService.insertRequestLog(requestLog);
return ajaxResult;
}
/**
* 请求AGV执行队列
*/
// @Log(title = "请求未下发的AGV执行队列", businessType = BusinessType.OTHER)
@RequestMapping("/queryAgvQuene")
public AjaxResult queryAgvQuene() {
AgvContainerTask agvContainerTask = new AgvContainerTask();
agvContainerTask.setStatus("0");
List<AgvContainerTask> agvContainerTasks = agvContainerTaskService.selectAgvContainerTaskList(agvContainerTask);
RequestLog requestLog = requestLogService.getRequestLog(JSONUtil.toJsonStr(""), "请求未下发的AGV执行队列", AjaxResult.success(agvContainerTasks));
// requestLogService.insertRequestLog(requestLog);
if (agvContainerTasks != null && agvContainerTasks.size() > 0) {
for (AgvContainerTask containerTask : agvContainerTasks) {
containerTask.setStatus("1");
agvContainerTaskService.updateAgvContainerTask(containerTask);
}
return AjaxResult.success(agvContainerTasks.get(0));
} else {
return AjaxResult.error("无队列");
}
}
/**
* 请求AGV执行队列
*/
@Log(title = "完成AGV执行队列", businessType = BusinessType.UPDATE)
@RequestMapping("/finishAgvQuene")
public AjaxResult finishAgvQuene(@RequestBody JSONObject jsonObject) {
String order = (String) jsonObject.get("order");
agvContainerTaskService.deleteAgvJobByOrder(order);
return AjaxResult.success();
}
@Log(title = "自动生成Agv搬运队列到线边", businessType = BusinessType.INSERT)
@PutMapping("/insertAgvQuene")
public AjaxResult insertAgvQuene(@RequestBody WmsJobRequest wmsJobRequest) {
String taskNo = wmsJobRequest.getTaskNo();// 到位任务号
String code = wmsJobRequest.getCode();// 线体号
AgvContainerTask agvContainerTask = new AgvContainerTask();
agvContainerTask.setTaskNo(taskNo);
List<AgvContainerTask> agvContainerTasks = agvContainerTaskService.selectAgvContainerTaskList(agvContainerTask);
if (Objects.isNull(agvContainerTasks)) {
MydoJob mydoJob = new MydoJob();
mydoJob.setTaskNo(taskNo);
List<MydoJob> mydoJobs = mapper.selectMydoJobList(mydoJob);
AgvContainerTask agvContainerTask1 = new AgvContainerTask();
agvContainerTask1.setContainer(UUID.randomUUID().toString());
agvContainerTask1.setTaskNo(taskNo);
agvContainerTask1.setStartPoint(code);
agvContainerTask1.setEndPoint(mydoJobs.get(0).getEndPoint());//TODO 需要修改
agvContainerTask1.setSpare2(mydoJobs.get(0).getTrayCode());
// 10缓存区到线边 11立库到线边 12 立库到缓存区 13 缓存到立库
agvContainerTask1.setSpare1("11");
agvContainerTask1.setStatus("0");
agvContainerTaskService.insertAgvContainerTask(agvContainerTask1);
}
RequestLog requestLog = requestLogService.getRequestLog(JSONUtil.toJsonStr(wmsJobRequest), "自动生成Agv搬运队列到线边", AjaxResult.success());
requestLogService.insertRequestLog(requestLog);
return AjaxResult.success();
}
}

View File

@@ -7,6 +7,7 @@ import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.annotation.Anonymous;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@@ -23,6 +24,7 @@ public class TwinController {
@Autowired
private ITwinService twinService;
//获取所有货位
@Anonymous
@GetMapping("/getEmptyCargoSpace")
public AjaxResult getEmptyCargoSpace() {
@@ -30,10 +32,25 @@ public class TwinController {
return AjaxResult.success(list);
}
//获取统计信息
@Anonymous
@GetMapping("/getStockList")
public Map<String, Object> getStockList() {
return twinService.getStockListOverview();
}
//根据货位号获取库存中的物料信息
@Anonymous
@GetMapping("/getCargo/{cargoSpaceName}")
public Map<String, Object> getCargo(@PathVariable("cargoSpaceName") String cargoSpaceName) {
return twinService.getCargo(cargoSpaceName);
}
//根据任务号获取作业表中的物料信息
@Anonymous
@GetMapping("/getTaskCargo/{taskNo}")
public Map<String, Object> getTaskCargo(@PathVariable("taskNo") String taskNo) {
return twinService.getTaskCargo(taskNo);
}
}

View File

@@ -0,0 +1,70 @@
package com.ruoyi.api.domain;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import java.io.Serializable;
import java.util.List;
@NoArgsConstructor
@Data
@Getter
@Setter
public class CallBackErp implements Serializable {
/**
* | 方向 | 字段名 | 对应方向 | 字段名 |
* | ------- | ---------------- | -------- | -------- |
* | ERP→WMS | companyShortName | WMS→ERP | ccompany | 公司简称
* | ERP→WMS | accountSetNo | WMS→ERP | cacc_id | 账套号
* | ERP→WMS | warehouseId | WMS→ERP | cwhcode | 仓库
* | ERP→WMS | customerId | WMS→ERP | cvencode | 客户
* | ERP→WMS | customerName | WMS→ERP | cvenname | 客户名称
* | ERP→WMS | remark | WMS→ERP | cmemo |
*
*/
// 公司名称
@JsonProperty("ccompany")
private String ccompany;
// WMS单据号
@JsonProperty("ccode")
private String ccode;
// 操作日期
@JsonProperty("ddate")
private String ddate;
// 业务类型
@JsonProperty("cintype")
private String cintype;
// 供应商编码
@JsonProperty("cvencode")
private String cvencode;
// 供应商名称
@JsonProperty("cvenname")
private String cvenname;
// 出/入库人 操作人
@JsonProperty("coptname")
private String coptname;
// 仓库编码
@JsonProperty("cwhcode")
private String cwhcode;
// 仓库名称
@JsonProperty("cwhname")
private String cwhname;
// 备注
@JsonProperty("cmemo")
private String cmemo;
// 账套号
@JsonProperty("cacc_id")
private String cacc_id;
// 子明细
@JsonProperty("details")
private List<CallBackErpItems> details;
}

View File

@@ -0,0 +1,68 @@
package com.ruoyi.api.domain;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import java.io.Serializable;
import java.util.List;
@NoArgsConstructor
@Data
@Getter
@Setter
public class CallBackErpItems implements Serializable {
/**
*
* | 方向 | 字段名 | 对应方向 | 字段名 |
* | ------- | ------------- | -------- | --------- |
* | ERP→WMS | lineNo | WMS→ERP | srcrowno |
* | ERP→WMS | sourceLineId | WMS→ERP | srcids |
* | ERP→WMS | oldProjectNo | WMS→ERP | cxmh |
* | ERP→WMS | projectNo | WMS→ERP | cnewxmh |
* | ERP→WMS | isBatchManage | WMS→ERP | binvbatch |
* | ERP→WMS | lotNo | WMS→ERP | cbatch |
*/
@JsonProperty("cinvcode")
private String cinvcode;
@JsonProperty("cinvname")
private String cinvname;
@JsonProperty("cinvstd")
private String cinvstd;
@JsonProperty("cinvm_unit")
private String cinvm_unit;
@JsonProperty("cposcode")
private String cposcode;
@JsonProperty("cposname")
private String cposname;
@JsonProperty("ctrayname")
private String ctrayname;
@JsonProperty("cbatch")
private String cbatch;
@JsonProperty("iquantity")
private Integer iquantity;
@JsonProperty("cxmh")
private String cxmh;
@JsonProperty("cnewxmh")
private String cnewxmh;
@JsonProperty("srccode")
private String srccode;
@JsonProperty("srcids")
private Integer srcids;
@JsonProperty("srcrowno")
private String srcrowno;
@JsonProperty("binvbatch")
private Integer binvbatch;
@JsonProperty("jobid")
private String jobid;
@JsonProperty("stg_location")
private String stg_location;
@JsonProperty("groupNum")
private String groupNum;
}

View File

@@ -4,6 +4,9 @@ import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import org.w3c.dom.stylesheets.LinkStyle;
import java.util.List;
/**
* 出入库通知单-子表接收对象
@@ -42,7 +45,38 @@ public class DeliveryNoticeItemVo {
/** 备注 */
private String remark;
private List<LocationDetail> locations;
/**货位*/
private String area;
/**托盘*/
private String location;
private String areaBefore;
private String locationBefore;
/** 项目号 */
private String projectNo;
/**
* erp子表主键
***/
private String sourceLineId;
/**
* 条码号
***/
private String barCode;
/**
* 是否批次管理
**/
private String isBatchManage;
/**旧项目号**/
private String oldProjectNo;
/**组件号**/
private String groupNum;
/**存放地点 1 立库 2平库*/
private String stg_location;
}

View File

@@ -49,6 +49,17 @@ public class DeliveryNoticeVo {
private String warehouseId;
/** 备注 */
private String remark;
/** 配送终点 */
private String destination;
/** 领料车间 */
private String workshop;
private String companyShortName;
/** 账套号**/
private String accountSetNo;
/** 子表明细列表 */
private List<DeliveryNoticeItemVo> detailList;
}

View File

@@ -0,0 +1,44 @@
package com.ruoyi.api.domain;
public class LocationDetail {
private String locationNo;
private String areaNo;
private String quantity;
private String lotNo;
public String getLocationNo() {
return locationNo;
}
public void setLocationNo(String locationNo) {
this.locationNo = locationNo;
}
public String getAreaNo() {
return areaNo;
}
public void setAreaNo(String areaNo) {
this.areaNo = areaNo;
}
public String getQuantity() {
return quantity;
}
public void setQuantity(String quantity) {
this.quantity = quantity;
}
public String getLotNo() {
return lotNo;
}
public void setLotNo(String lotNo) {
this.lotNo = lotNo;
}
}

View File

@@ -20,4 +20,8 @@ public class RequestEnter {
private String type;
private String flag;
private String taskNo;
private String deviceCode;
private String code;
private String errorCode;
}

View File

@@ -24,4 +24,6 @@ public class WmsJobRequest {
private String positionCode2;
//任务id
private String jobId;
//线体号
private String code;
}

View File

@@ -0,0 +1,104 @@
package com.ruoyi.api.moveMsg.controller;
import java.util.List;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.api.moveMsg.domain.MoveMsg;
import com.ruoyi.api.moveMsg.service.IMoveMsgService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 移库信息回传Controller
*
* @author ruoyi
* @date 2026-01-29
*/
@RestController
@RequestMapping("/api/moveMsg")
public class MoveMsgController extends BaseController
{
@Autowired
private IMoveMsgService moveMsgService;
/**
* 查询移库信息回传列表
*/
@PreAuthorize("@ss.hasPermi('api:moveMsg:list')")
@GetMapping("/list")
public TableDataInfo list(MoveMsg moveMsg)
{
startPage();
List<MoveMsg> list = moveMsgService.selectMoveMsgList(moveMsg);
return getDataTable(list);
}
/**
* 导出移库信息回传列表
*/
@PreAuthorize("@ss.hasPermi('api:moveMsg:export')")
@Log(title = "移库信息回传", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, MoveMsg moveMsg)
{
List<MoveMsg> list = moveMsgService.selectMoveMsgList(moveMsg);
ExcelUtil<MoveMsg> util = new ExcelUtil<MoveMsg>(MoveMsg.class);
util.exportExcel(response, list, "移库信息回传数据");
}
/**
* 获取移库信息回传详细信息
*/
@PreAuthorize("@ss.hasPermi('api:moveMsg:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") String id)
{
return success(moveMsgService.selectMoveMsgById(id));
}
/**
* 新增移库信息回传
*/
@PreAuthorize("@ss.hasPermi('api:moveMsg:add')")
@Log(title = "移库信息回传", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody MoveMsg moveMsg)
{
return toAjax(moveMsgService.insertMoveMsg(moveMsg));
}
/**
* 修改移库信息回传
*/
@PreAuthorize("@ss.hasPermi('api:moveMsg:edit')")
@Log(title = "移库信息回传", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody MoveMsg moveMsg)
{
return toAjax(moveMsgService.updateMoveMsg(moveMsg));
}
/**
* 删除移库信息回传
*/
@PreAuthorize("@ss.hasPermi('api:moveMsg:remove')")
@Log(title = "移库信息回传", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable String[] ids)
{
return toAjax(moveMsgService.deleteMoveMsgByIds(ids));
}
}

View File

@@ -0,0 +1,202 @@
package com.ruoyi.api.moveMsg.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* 移库信息回传对象 move_msg
*
* @author ruoyi
* @date 2026-01-29
*/
public class MoveMsg extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 序号 */
private String id;
/** 托盘条码 */
@Excel(name = "托盘条码")
private String trayCode;
/** 原货位 */
@Excel(name = "原货位")
private String oldSpace;
/** 新货位 */
@Excel(name = "新货位")
private String newSpace;
/** 状态 */
@Excel(name = "状态")
private String status;
/** 发送时间 */
@Excel(name = "发送时间")
private String sendTime;
/** 信息 */
@Excel(name = "信息")
private String msg;
/** 备用 */
@Excel(name = "备用")
private String spare1;
/** 备用 */
@Excel(name = "备用")
private String spare2;
/** 备用 */
@Excel(name = "备用")
private String spare3;
/** 备用 */
@Excel(name = "备用")
private String spare4;
/** 备用 */
@Excel(name = "备用")
private String spare5;
public void setId(String id)
{
this.id = id;
}
public String getId()
{
return id;
}
public void setTrayCode(String trayCode)
{
this.trayCode = trayCode;
}
public String getTrayCode()
{
return trayCode;
}
public void setOldSpace(String oldSpace)
{
this.oldSpace = oldSpace;
}
public String getOldSpace()
{
return oldSpace;
}
public void setNewSpace(String newSpace)
{
this.newSpace = newSpace;
}
public String getNewSpace()
{
return newSpace;
}
public void setStatus(String status)
{
this.status = status;
}
public String getStatus()
{
return status;
}
public void setSendTime(String sendTime)
{
this.sendTime = sendTime;
}
public String getSendTime()
{
return sendTime;
}
public void setMsg(String msg)
{
this.msg = msg;
}
public String getMsg()
{
return msg;
}
public void setSpare1(String spare1)
{
this.spare1 = spare1;
}
public String getSpare1()
{
return spare1;
}
public void setSpare2(String spare2)
{
this.spare2 = spare2;
}
public String getSpare2()
{
return spare2;
}
public void setSpare3(String spare3)
{
this.spare3 = spare3;
}
public String getSpare3()
{
return spare3;
}
public void setSpare4(String spare4)
{
this.spare4 = spare4;
}
public String getSpare4()
{
return spare4;
}
public void setSpare5(String spare5)
{
this.spare5 = spare5;
}
public String getSpare5()
{
return spare5;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("trayCode", getTrayCode())
.append("oldSpace", getOldSpace())
.append("newSpace", getNewSpace())
.append("status", getStatus())
.append("sendTime", getSendTime())
.append("msg", getMsg())
.append("spare1", getSpare1())
.append("spare2", getSpare2())
.append("spare3", getSpare3())
.append("spare4", getSpare4())
.append("spare5", getSpare5())
.toString();
}
}

View File

@@ -0,0 +1,61 @@
package com.ruoyi.api.moveMsg.mapper;
import java.util.List;
import com.ruoyi.api.moveMsg.domain.MoveMsg;
/**
* 移库信息回传Mapper接口
*
* @author ruoyi
* @date 2026-01-29
*/
public interface MoveMsgMapper
{
/**
* 查询移库信息回传
*
* @param id 移库信息回传主键
* @return 移库信息回传
*/
public MoveMsg selectMoveMsgById(String id);
/**
* 查询移库信息回传列表
*
* @param moveMsg 移库信息回传
* @return 移库信息回传集合
*/
public List<MoveMsg> selectMoveMsgList(MoveMsg moveMsg);
/**
* 新增移库信息回传
*
* @param moveMsg 移库信息回传
* @return 结果
*/
public int insertMoveMsg(MoveMsg moveMsg);
/**
* 修改移库信息回传
*
* @param moveMsg 移库信息回传
* @return 结果
*/
public int updateMoveMsg(MoveMsg moveMsg);
/**
* 删除移库信息回传
*
* @param id 移库信息回传主键
* @return 结果
*/
public int deleteMoveMsgById(String id);
/**
* 批量删除移库信息回传
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteMoveMsgByIds(String[] ids);
}

View File

@@ -0,0 +1,61 @@
package com.ruoyi.api.moveMsg.service;
import java.util.List;
import com.ruoyi.api.moveMsg.domain.MoveMsg;
/**
* 移库信息回传Service接口
*
* @author ruoyi
* @date 2026-01-29
*/
public interface IMoveMsgService
{
/**
* 查询移库信息回传
*
* @param id 移库信息回传主键
* @return 移库信息回传
*/
public MoveMsg selectMoveMsgById(String id);
/**
* 查询移库信息回传列表
*
* @param moveMsg 移库信息回传
* @return 移库信息回传集合
*/
public List<MoveMsg> selectMoveMsgList(MoveMsg moveMsg);
/**
* 新增移库信息回传
*
* @param moveMsg 移库信息回传
* @return 结果
*/
public int insertMoveMsg(MoveMsg moveMsg);
/**
* 修改移库信息回传
*
* @param moveMsg 移库信息回传
* @return 结果
*/
public int updateMoveMsg(MoveMsg moveMsg);
/**
* 批量删除移库信息回传
*
* @param ids 需要删除的移库信息回传主键集合
* @return 结果
*/
public int deleteMoveMsgByIds(String[] ids);
/**
* 删除移库信息回传信息
*
* @param id 移库信息回传主键
* @return 结果
*/
public int deleteMoveMsgById(String id);
}

View File

@@ -0,0 +1,93 @@
package com.ruoyi.api.moveMsg.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.api.moveMsg.mapper.MoveMsgMapper;
import com.ruoyi.api.moveMsg.domain.MoveMsg;
import com.ruoyi.api.moveMsg.service.IMoveMsgService;
/**
* 移库信息回传Service业务层处理
*
* @author ruoyi
* @date 2026-01-29
*/
@Service
public class MoveMsgServiceImpl implements IMoveMsgService
{
@Autowired
private MoveMsgMapper moveMsgMapper;
/**
* 查询移库信息回传
*
* @param id 移库信息回传主键
* @return 移库信息回传
*/
@Override
public MoveMsg selectMoveMsgById(String id)
{
return moveMsgMapper.selectMoveMsgById(id);
}
/**
* 查询移库信息回传列表
*
* @param moveMsg 移库信息回传
* @return 移库信息回传
*/
@Override
public List<MoveMsg> selectMoveMsgList(MoveMsg moveMsg)
{
return moveMsgMapper.selectMoveMsgList(moveMsg);
}
/**
* 新增移库信息回传
*
* @param moveMsg 移库信息回传
* @return 结果
*/
@Override
public int insertMoveMsg(MoveMsg moveMsg)
{
return moveMsgMapper.insertMoveMsg(moveMsg);
}
/**
* 修改移库信息回传
*
* @param moveMsg 移库信息回传
* @return 结果
*/
@Override
public int updateMoveMsg(MoveMsg moveMsg)
{
return moveMsgMapper.updateMoveMsg(moveMsg);
}
/**
* 批量删除移库信息回传
*
* @param ids 需要删除的移库信息回传主键
* @return 结果
*/
@Override
public int deleteMoveMsgByIds(String[] ids)
{
return moveMsgMapper.deleteMoveMsgByIds(ids);
}
/**
* 删除移库信息回传信息
*
* @param id 移库信息回传主键
* @return 结果
*/
@Override
public int deleteMoveMsgById(String id)
{
return moveMsgMapper.deleteMoveMsgById(id);
}
}

View File

@@ -1,6 +1,7 @@
package com.ruoyi.api.service;
import com.ruoyi.api.domain.DeliveryNoticeVo;
import com.ruoyi.api.moveMsg.domain.MoveMsg;
import com.ruoyi.bas.BasProduct.domain.BasProduct;
import com.ruoyi.common.core.domain.AjaxResult;
@@ -16,5 +17,13 @@ public interface IToErpService {
void callbackoutDeliveryNotice();
void moveCargoSpace();
AjaxResult createWorkshopInboundOrder(BasProduct basProduct);
void callbackInDeliveryNoticeNew();
void callbackDeliveryOutNoticeNew();
void callbackDeliveryOutNoticeNews();
}

View File

@@ -59,4 +59,6 @@ public interface IToWmsService {
* 作废物料
*/
AjaxResult InvalidProduct(ErpProduct erpProduct);
AjaxResult requestEnterByTaskNo(RequestEnter requestEnter);
}

View File

@@ -4,5 +4,7 @@ import java.util.Map;
public interface ITwinService {
Map<String, Object> getStockListOverview();
Map<String, Object> getCargo(String cargoSpaceName);
Map<String, Object> getTaskCargo(String taskNo);
}

View File

@@ -33,7 +33,7 @@ public class ToWcsServiceImpl implements IToWcsService {
@Autowired
private IAgvContainerTaskService agvContainerTaskService;
public static final String PUSH_OUT_MYDO_JOB = "http://localhost:8081/wcs2Wms/api/receiveOutMydoJob";
public static final String PUSH_OUT_MYDO_JOB = "http://192.168.188.236:8081/wcs2Wms/api/receiveOutMydoJob";
public static final String PUSH_IN_MYDO_JOB = "http://localhost:8081/wcs2Wms/api/receiveInMydoJob";
public static final String PUSH_AGV_MOVE_JOB = "http://localhost:8081/agv/api/receiveAgvMoveJob";
public static final String OUT_MYDOJOB_MS = "http://localhost:8081/wcs2Wms/api/outMydojobMakesure";
@@ -43,15 +43,12 @@ public class ToWcsServiceImpl implements IToWcsService {
@Override
// @Scheduled(fixedDelay=1500)
@Scheduled(fixedDelay=1500)
public void pushOutMydoJob() {
//查询所有未推送的料箱出库作业
MydoJob mydoJobParam = new MydoJob();
mydoJobParam.setStatus("1");
List<String> list = new ArrayList<>();
list.add("21");
list.add("26");
mydoJobParam.setInOutIds(list);
mydoJobParam.setInOut("2");
List<MydoJob> outMydoJobs = mydoJobService.selectMydoJobListApi(mydoJobParam);
for (MydoJob outMydoJob : outMydoJobs) {
RequestLog requestLog = requestLogService.getRequestLog(PUSH_OUT_MYDO_JOB, JSONUtil.toJsonStr(outMydoJob), "推送出库任务","wms","wcs");

View File

@@ -93,27 +93,29 @@ public class ToWmsServiceImpl implements IToWmsService {
@Override
@Transactional(rollbackFor = Exception.class)
public AjaxResult requestEnterByTrayCode(RequestEnter requestEnter) {
String trayCode = requestEnter.getTrayCode();
MydoJob inJob = mydoJobMapper.selectInJobByTrayCode(trayCode);
if(inJob != null && Integer.parseInt(inJob.getInOrOut()) < 20){
if(inJob.getCargoSpaceId() != null && !"".equals(inJob.getCargoSpaceId())){
return AjaxResult.success(JSONUtil.toJsonStr(inJob));
}else{
//分配货位
HashMap<String, Object> map = new HashMap<>();
// if(inJob.getCargoSpaceId() != null && !"".equals(inJob.getCargoSpaceId())){
// return AjaxResult.success(inJob);
// }else{
// //分配货位
// HashMap<String, Object> map = new HashMap<>();
//
// map.put("v_tray_code", trayCode);
// mydoJobMapper.allotInJobSpace(map);
// if (!"10".equals(map.get("v_result").toString())) {
// return AjaxResult.error(map.get("v_resultmsg").toString());
// }else{
//
// }
// }
// MydoJob inJob2 = mydoJobMapper.selectInJobByTrayCode(trayCode);
return AjaxResult.success(inJob);
map.put("v_tray_code", trayCode);
mydoJobMapper.allotInJobSpace(map);
if (!"10".equals(map.get("v_result").toString())) {
return AjaxResult.error(map.get("v_resultmsg").toString());
}else{
MydoJob inJob2 = mydoJobMapper.selectInJobByTrayCode(trayCode);
return AjaxResult.success(JSONUtil.toJsonStr(inJob2));
}
}
}else{
return AjaxResult.error("该条码无入库任务,请扫码绑定!");
}
@@ -197,9 +199,20 @@ public class ToWmsServiceImpl implements IToWmsService {
return AjaxResult.error("任务不存在");
}
MydoJob outJob = outMydoJobs.get(0);
//出库作业
outJob.setExecutionPhase("2");
mydoJobService.updateMydoJob(outJob);
break;
case "7":
//移库作业
mydoJobParam.setTaskNo(wmsJobRequest.getTaskNo());
List<MydoJob> ykMydoJobs = mydoJobService.selectMydoJobListApi(mydoJobParam);
if (ykMydoJobs.isEmpty()) {
return AjaxResult.error("任务不存在");
}
MydoJob ykJob = ykMydoJobs.get(0);
mydoJobService.ykCompleted(ykJob);
break;
default:
log.error("作业类型错误");
@@ -385,5 +398,32 @@ public class ToWmsServiceImpl implements IToWmsService {
return AjaxResult.error(erpProduct.getSys_MainId()+"物料不存在");
}
@Override
public AjaxResult requestEnterByTaskNo(RequestEnter requestEnter) {
String taskNo = requestEnter.getTaskNo();
String deviceCode = requestEnter.getDeviceCode();
MydoJob inJob = mydoJobMapper.selectInJobByTaskNo(taskNo);
if(inJob != null && Integer.parseInt(inJob.getInOrOut()) < 20){
if(inJob.getCargoSpaceId() != null && !"".equals(inJob.getCargoSpaceId())){
return AjaxResult.success(inJob);
}else{
//分配货位
HashMap<String, Object> map = new HashMap<>();
map.put("v_tray_code", inJob.getTrayCode());
map.put("v_code", deviceCode);
mydoJobMapper.allotInJobSpace(map);
if (!"10".equals(map.get("v_result").toString())) {
return AjaxResult.error(map.get("v_resultmsg").toString());
}else{
MydoJob inJob2 = mydoJobMapper.selectInJobByTaskNo(taskNo);
return AjaxResult.success(inJob2);
}
}
}else{
return AjaxResult.error("该条码无入库任务,请扫码绑定!");
}
}
}

View File

@@ -5,6 +5,10 @@ import com.ruoyi.bas.cargoSpace.domain.BasCargoSpace;
import com.ruoyi.bas.cargoSpace.service.IBasCargoSpaceService;
import com.ruoyi.in.stockinfinish.domain.InStockinFinish;
import com.ruoyi.in.stockinfinish.service.IInStockinFinishService;
import com.ruoyi.job.mydojob.domain.MydoJob;
import com.ruoyi.job.mydojob.service.IMydoJobService;
import com.ruoyi.job.mydojobdetail.domain.MydoJobDetail;
import com.ruoyi.job.mydojobdetail.service.IMydoJobDetailService;
import com.ruoyi.out.outStockoutFinish.domain.OutStockoutFinish;
import com.ruoyi.out.outStockoutFinish.service.IOutStockoutFinishService;
import com.ruoyi.stock.stock.domain.BasStock;
@@ -33,6 +37,10 @@ public class TwinServiceImpl implements ITwinService {
private IInStockinFinishService inStockinFinishService;
@Autowired
private IOutStockoutFinishService outStockoutFinishService;
@Autowired
private IMydoJobService mydoJobService;
@Autowired
private IMydoJobDetailService mydoJobDetailService;
@Override
public Map<String, Object> getStockListOverview() {
@@ -250,4 +258,62 @@ public class TwinServiceImpl implements ITwinService {
result.put("monthOutStock", monthOutStock);
return result;
}
@Override
public Map<String, Object> getCargo(String cargoSpaceName) {
BasStock basStock = new BasStock();
basStock.setCargoSpaceId(cargoSpaceName);
List<BasStock> list = basStockService.selectBasStockList(basStock);
List<Map<String, String>> dataList = new ArrayList<>();
for (BasStock stock : list) {
Map<String, String> dataMap = new HashMap<>();
dataMap.put("productId", stock.getProductId());
dataMap.put("productName", stock.getProductName());
dataMap.put("quantity", stock.getQuantity());
dataMap.put("trayCode", stock.getTrayCode());
dataList.add(dataMap);
}
Map<String, Object> result = new HashMap<>();
result.put("data", dataList);
return result;
}
@Override
public Map<String, Object> getTaskCargo(String taskNo) {
MydoJob mydoJob = new MydoJob();
mydoJob.setTaskNo(taskNo);
List<MydoJob> jobList = mydoJobService.selectMydoJobList(mydoJob);
List<Map<String, String>> dataList = new ArrayList<>();
if (jobList != null && !jobList.isEmpty()) {
MydoJob job = jobList.get(0);
String jobId = job.getJobId();
String inOrOutStr = job.getInOrOut();
int inOrOut = 0;
try {
inOrOut = Integer.parseInt(inOrOutStr);
} catch (Exception e) {
// Ignore parse error
}
List<MydoJobDetail> details = mydoJobDetailService.selectMydoJobDetailListByJobId(jobId);
for (MydoJobDetail detail : details) {
Map<String, String> dataMap = new HashMap<>();
dataMap.put("productId", detail.getProductId());
dataMap.put("productName", detail.getProductName());
String quantity = "0";
if (inOrOut < 20) {
quantity = detail.getInQuantity();
} else {
quantity = detail.getOutQuantity();
}
dataMap.put("quantity", quantity);
dataMap.put("trayCode", detail.getTrayCode());
dataList.add(dataMap);
}
}
Map<String, Object> result = new HashMap<>();
result.put("data", dataList);
return result;
}
}

View File

@@ -0,0 +1,104 @@
package com.ruoyi.bas.agvPoint.controller;
import java.util.List;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.bas.agvPoint.domain.AgvPoint;
import com.ruoyi.bas.agvPoint.service.IAgvPointService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* agv站点Controller
*
* @author ruoyi
* @date 2026-03-17
*/
@RestController
@RequestMapping("/bas/agvPoint")
public class AgvPointController extends BaseController
{
@Autowired
private IAgvPointService agvPointService;
/**
* 查询agv站点列表
*/
@PreAuthorize("@ss.hasPermi('bas:agvPoint:list')")
@GetMapping("/list")
public TableDataInfo list(AgvPoint agvPoint)
{
startPage();
List<AgvPoint> list = agvPointService.selectAgvPointList(agvPoint);
return getDataTable(list);
}
/**
* 导出agv站点列表
*/
@PreAuthorize("@ss.hasPermi('bas:agvPoint:export')")
@Log(title = "agv站点", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, AgvPoint agvPoint)
{
List<AgvPoint> list = agvPointService.selectAgvPointList(agvPoint);
ExcelUtil<AgvPoint> util = new ExcelUtil<AgvPoint>(AgvPoint.class);
util.exportExcel(response, list, "agv站点数据");
}
/**
* 获取agv站点详细信息
*/
@PreAuthorize("@ss.hasPermi('bas:agvPoint:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") String id)
{
return success(agvPointService.selectAgvPointById(id));
}
/**
* 新增agv站点
*/
@PreAuthorize("@ss.hasPermi('bas:agvPoint:add')")
@Log(title = "agv站点", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody AgvPoint agvPoint)
{
return toAjax(agvPointService.insertAgvPoint(agvPoint));
}
/**
* 修改agv站点
*/
@PreAuthorize("@ss.hasPermi('bas:agvPoint:edit')")
@Log(title = "agv站点", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody AgvPoint agvPoint)
{
return toAjax(agvPointService.updateAgvPoint(agvPoint));
}
/**
* 删除agv站点
*/
@PreAuthorize("@ss.hasPermi('bas:agvPoint:remove')")
@Log(title = "agv站点", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable String[] ids)
{
return toAjax(agvPointService.deleteAgvPointByIds(ids));
}
}

View File

@@ -0,0 +1,113 @@
package com.ruoyi.bas.agvPoint.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* agv站点对象 agv_point
*
* @author ruoyi
* @date 2026-03-17
*/
public class AgvPoint extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 序号 */
private String id;
/** 站点编号 */
@Excel(name = "站点编号")
private String station;
/** 类型 */
@Excel(name = "类型")
private String type;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private String spare1;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private String spare2;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private String spare3;
public void setId(String id)
{
this.id = id;
}
public String getId()
{
return id;
}
public void setStation(String station)
{
this.station = station;
}
public String getStation()
{
return station;
}
public void setType(String type)
{
this.type = type;
}
public String getType()
{
return type;
}
public void setSpare1(String spare1)
{
this.spare1 = spare1;
}
public String getSpare1()
{
return spare1;
}
public void setSpare2(String spare2)
{
this.spare2 = spare2;
}
public String getSpare2()
{
return spare2;
}
public void setSpare3(String spare3)
{
this.spare3 = spare3;
}
public String getSpare3()
{
return spare3;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("station", getStation())
.append("type", getType())
.append("remark", getRemark())
.append("spare1", getSpare1())
.append("spare2", getSpare2())
.append("spare3", getSpare3())
.toString();
}
}

View File

@@ -0,0 +1,22 @@
package com.ruoyi.bas.agvPoint.domain;
import lombok.Getter;
import lombok.Setter;
import java.io.Serializable;
@lombok.Data
@Getter
@Setter
public class AgvTask implements Serializable {
private String startPoint;
private String endPoint;
private String type;
private String trayCode;
}

View File

@@ -0,0 +1,61 @@
package com.ruoyi.bas.agvPoint.mapper;
import java.util.List;
import com.ruoyi.bas.agvPoint.domain.AgvPoint;
/**
* agv站点Mapper接口
*
* @author ruoyi
* @date 2026-03-17
*/
public interface AgvPointMapper
{
/**
* 查询agv站点
*
* @param id agv站点主键
* @return agv站点
*/
public AgvPoint selectAgvPointById(String id);
/**
* 查询agv站点列表
*
* @param agvPoint agv站点
* @return agv站点集合
*/
public List<AgvPoint> selectAgvPointList(AgvPoint agvPoint);
/**
* 新增agv站点
*
* @param agvPoint agv站点
* @return 结果
*/
public int insertAgvPoint(AgvPoint agvPoint);
/**
* 修改agv站点
*
* @param agvPoint agv站点
* @return 结果
*/
public int updateAgvPoint(AgvPoint agvPoint);
/**
* 删除agv站点
*
* @param id agv站点主键
* @return 结果
*/
public int deleteAgvPointById(String id);
/**
* 批量删除agv站点
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteAgvPointByIds(String[] ids);
}

View File

@@ -0,0 +1,61 @@
package com.ruoyi.bas.agvPoint.service;
import java.util.List;
import com.ruoyi.bas.agvPoint.domain.AgvPoint;
/**
* agv站点Service接口
*
* @author ruoyi
* @date 2026-03-17
*/
public interface IAgvPointService
{
/**
* 查询agv站点
*
* @param id agv站点主键
* @return agv站点
*/
public AgvPoint selectAgvPointById(String id);
/**
* 查询agv站点列表
*
* @param agvPoint agv站点
* @return agv站点集合
*/
public List<AgvPoint> selectAgvPointList(AgvPoint agvPoint);
/**
* 新增agv站点
*
* @param agvPoint agv站点
* @return 结果
*/
public int insertAgvPoint(AgvPoint agvPoint);
/**
* 修改agv站点
*
* @param agvPoint agv站点
* @return 结果
*/
public int updateAgvPoint(AgvPoint agvPoint);
/**
* 批量删除agv站点
*
* @param ids 需要删除的agv站点主键集合
* @return 结果
*/
public int deleteAgvPointByIds(String[] ids);
/**
* 删除agv站点信息
*
* @param id agv站点主键
* @return 结果
*/
public int deleteAgvPointById(String id);
}

View File

@@ -0,0 +1,93 @@
package com.ruoyi.bas.agvPoint.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.bas.agvPoint.mapper.AgvPointMapper;
import com.ruoyi.bas.agvPoint.domain.AgvPoint;
import com.ruoyi.bas.agvPoint.service.IAgvPointService;
/**
* agv站点Service业务层处理
*
* @author ruoyi
* @date 2026-03-17
*/
@Service
public class AgvPointServiceImpl implements IAgvPointService
{
@Autowired
private AgvPointMapper agvPointMapper;
/**
* 查询agv站点
*
* @param id agv站点主键
* @return agv站点
*/
@Override
public AgvPoint selectAgvPointById(String id)
{
return agvPointMapper.selectAgvPointById(id);
}
/**
* 查询agv站点列表
*
* @param agvPoint agv站点
* @return agv站点
*/
@Override
public List<AgvPoint> selectAgvPointList(AgvPoint agvPoint)
{
return agvPointMapper.selectAgvPointList(agvPoint);
}
/**
* 新增agv站点
*
* @param agvPoint agv站点
* @return 结果
*/
@Override
public int insertAgvPoint(AgvPoint agvPoint)
{
return agvPointMapper.insertAgvPoint(agvPoint);
}
/**
* 修改agv站点
*
* @param agvPoint agv站点
* @return 结果
*/
@Override
public int updateAgvPoint(AgvPoint agvPoint)
{
return agvPointMapper.updateAgvPoint(agvPoint);
}
/**
* 批量删除agv站点
*
* @param ids 需要删除的agv站点主键
* @return 结果
*/
@Override
public int deleteAgvPointByIds(String[] ids)
{
return agvPointMapper.deleteAgvPointByIds(ids);
}
/**
* 删除agv站点信息
*
* @param id agv站点主键
* @return 结果
*/
@Override
public int deleteAgvPointById(String id)
{
return agvPointMapper.deleteAgvPointById(id);
}
}

View File

@@ -71,6 +71,7 @@ public class BasTraycodeController extends BaseController
@PostMapping
public AjaxResult add(@RequestBody BasTraycode basTraycode)
{
return toAjax(basTraycodeService.insertBasTraycode(basTraycode));
}

View File

@@ -16,16 +16,16 @@ public class BasTraycode extends BaseEntity
private static final long serialVersionUID = 1L;
/** id */
@Excel(name = "${bas.Traycode.id}")
// @Excel(name = "${bas.Traycode.id}")
private Long id;
/** 条码类型id */
@Excel(name = "${bas.Traycode.formatId}")
// @Excel(name = "${bas.Traycode.formatId}")
private Long formatId;
private String formatName;
/** 条码 */
@Excel(name = "${bas.Traycode.trayCode}")
@Excel(name = "条码")
private String trayCode;
/** 备用字段1 */
@@ -33,7 +33,7 @@ public class BasTraycode extends BaseEntity
private String spare1;
/** 备用字段2 */
// @Excel(name = "${bas.Traycode.spare2}")
@Excel(name = "是否可用",dictType = "sys_yes_no")
private String spare2;
/** 备用字段3 */

View File

@@ -61,4 +61,6 @@ public interface BasTraycodeMapper
public int deleteBasTraycodeByIds(Long[] ids);
void insertBasTraycodeList(List<BasTraycode> list);
Integer selectBasTrayCodeMax();
}

View File

@@ -61,4 +61,6 @@ public interface IBasTraycodeService
public int deleteBasTraycodeById(Long id);
void insertBasTraycodeList(List<BasTraycode> traycodeList);
Integer selectBasTrayCodeMax();
}

View File

@@ -1,9 +1,12 @@
package com.ruoyi.bas.traycode.service.impl;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.convert.Convert;
import com.ruoyi.bas.traycode.domain.BasTraycode;
import com.ruoyi.bas.traycode.mapper.BasTraycodeMapper;
import com.ruoyi.bas.traycode.service.IBasTraycodeService;
import com.ruoyi.bas.traycodeformat.domain.BasTraycodeFormat;
import com.ruoyi.bas.traycodeformat.service.IBasTraycodeFormatService;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -21,6 +24,8 @@ public class BasTraycodeServiceImpl implements IBasTraycodeService
{
@Autowired
private BasTraycodeMapper basTraycodeMapper;
@Autowired
private IBasTraycodeFormatService basTraycodeFormatService;
/**
* 查询条码信息
@@ -55,8 +60,33 @@ public class BasTraycodeServiceImpl implements IBasTraycodeService
@Override
public int insertBasTraycode(BasTraycode basTraycode)
{
try {
BasTraycodeFormat basTraycodeFormat = basTraycodeFormatService.selectBasTraycodeFormatById(basTraycode.getFormatId());
int i1 = Integer.parseInt(basTraycode.getSpare1());
//如果i<4位数,前面补0
String code = "";
for (int j = 0; j < i1; j++) {
code = String.format("%07d",Convert.toInt( basTraycodeFormat.getSerialRule()) + 1 + j);
if(basTraycodeFormat.getMaxNum() < Convert.toLong( code)){
throw new RuntimeException("已生成最大值");
}
String finalCode = basTraycodeFormat.getBarcodeFormat()+code;
basTraycode.setTrayCode(finalCode);
basTraycode.setSpare1(null);
basTraycode.setCreateTime(DateUtils.getNowDate());
return basTraycodeMapper.insertBasTraycode(basTraycode);
basTraycode.setSpare2("Y");
basTraycodeMapper.insertBasTraycode(basTraycode);
}
basTraycodeFormat.setSerialRule(Convert.toLong( code).toString());
basTraycodeFormatService.updateBasTraycodeFormat(basTraycodeFormat);
} catch (Exception e) {
throw new RuntimeException(e);
}
return 1;
}
/**
@@ -103,4 +133,9 @@ public class BasTraycodeServiceImpl implements IBasTraycodeService
basTraycodeMapper.insertBasTraycodeList(list);
}
}
@Override
public Integer selectBasTrayCodeMax() {
return basTraycodeMapper.selectBasTrayCodeMax();
}
}

View File

@@ -1,17 +1,13 @@
package com.ruoyi.bas.traycodeformat.service.impl;
import cn.hutool.core.util.StrUtil;
import com.ruoyi.bas.traycode.domain.BasTraycode;
import com.ruoyi.bas.traycode.service.IBasTraycodeService;
import com.ruoyi.bas.traycodeformat.domain.BasTraycodeFormat;
import com.ruoyi.bas.traycodeformat.mapper.BasTraycodeFormatMapper;
import com.ruoyi.bas.traycodeformat.service.IBasTraycodeFormatService;
import com.ruoyi.common.core.text.Convert;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
/**
@@ -79,20 +75,7 @@ public class BasTraycodeFormatServiceImpl implements IBasTraycodeFormatService
public int updateBasTraycodeFormat(BasTraycodeFormat basTraycodeFormat)
{
BasTraycodeFormat old = selectBasTraycodeFormatById(basTraycodeFormat.getId());
int oldSerialRule = Convert.toInt(old.getSerialRule());
int newSerialRule = Convert.toInt(basTraycodeFormat.getSerialRule());
List<BasTraycode> traycodeList = new ArrayList<>();
for (int i = oldSerialRule; i < newSerialRule; i++) {
BasTraycode basTraycode = new BasTraycode();
basTraycode.setFormatId(basTraycodeFormat.getId());
String traycode = old.getBarcodeFormat()+ StrUtil.padPre(Convert.toStr(i),5,'0');
basTraycode.setTrayCode(traycode);
traycodeList.add(basTraycode);
}
basTraycodeFormat.setUpdateTime(DateUtils.getNowDate());
//插入条码信息
basTraycodeService.insertBasTraycodeList(traycodeList);
return basTraycodeFormatMapper.updateBasTraycodeFormat(basTraycodeFormat);
}

View File

@@ -182,8 +182,8 @@ public class CheckStockinServiceImpl implements ICheckStockinService {
CheckStockinDetail checkStockinDetail = detailList.get(i);
checkStockinDetail.setStockCheckDetailId(stockCheckId + "-" + (i + 1));
checkStockinDetail.setStockCheckId(stockCheckId);
BasProduct basProduct = productService.selectBasProductByProductId(checkStockinDetail.getProductId());
checkStockinDetail.setProductGuid(basProduct.getProductGuid());
// BasProduct basProduct = productService.selectBasProductByProductId(checkStockinDetail.getProductId());
// checkStockinDetail.setProductGuid(basProduct.getProductGuid());
checkStockinDetail.setStockCheckGuid(checkStockin.getStockGuid());
checkStockinDetail.setScanNum("0");
checkStockinDetail.setAssignNum("0");
@@ -229,7 +229,7 @@ public class CheckStockinServiceImpl implements ICheckStockinService {
checkStockinMapper.autoAllot(map);
builder.append("行明细:" + checkStockinDetail.getStockCheckDetailId() + ",分配结果:" + map.get("v_resultmsg") + "<br />");
}
iToWcsService.pushOutMydoJob();
//iToWcsService.pushOutMydoJob();
return AjaxResult.success(builder.toString());

View File

@@ -60,4 +60,6 @@ public interface AgvContainerTaskMapper
public int deleteAgvContainerTaskByIds(Long[] ids);
void insertHistory(Long id);
void deleteAgvJobByOrder(String order);
}

View File

@@ -60,4 +60,6 @@ public interface IAgvContainerTaskService
public int deleteAgvContainerTaskById(Long id);
void insertHistory(Long id);
void deleteAgvJobByOrder(String order);
}

View File

@@ -97,4 +97,9 @@ public class AgvContainerTaskServiceImpl implements IAgvContainerTaskService
public void insertHistory(Long id) {
agvContainerTaskMapper.insertHistory(id);
}
@Override
public void deleteAgvJobByOrder(String order) {
agvContainerTaskMapper.deleteAgvJobByOrder(order);
}
}

View File

@@ -102,8 +102,54 @@ public class InStockin extends BaseEntity
private String lotNo;
private String materialDesc;
private String productId;
private String startDate;
private String companyShortName;
private String accountSetNo;
private String cargoNo;
private String stockinDetailId;
public String getProductId() {
return productId;
}
public void setProductId(String productId) {
this.productId = productId;
}
public String getStockinDetailId() {
return stockinDetailId;
}
public void setStockinDetailId(String stockinDetailId) {
this.stockinDetailId = stockinDetailId;
}
public String getCargoNo() {
return cargoNo;
}
public void setCargoNo(String cargoNo) {
this.cargoNo = cargoNo;
}
public String getCompanyShortName() {
return companyShortName;
}
public void setCompanyShortName(String companyShortName) {
this.companyShortName = companyShortName;
}
public String getAccountSetNo() {
return accountSetNo;
}
public void setAccountSetNo(String accountSetNo) {
this.accountSetNo = accountSetNo;
}
private List<String> typeData;
public String getStartDate() {

View File

@@ -66,4 +66,6 @@ public interface InStockinMapper
void insertInStockinHistory(InStockin inStockin);
List<InStockin> selectStockinByDetail(String stockinDetailId);
List<InStockin> selectInStockinListBill(InStockin param);
}

View File

@@ -73,4 +73,6 @@ public interface IInStockinService
public int deleteInStockinByStockinGuid(String stockinGuid);
public List<InStockin> selectStockinByDetail(String stockinDetailId);
List<InStockin> selectInStockinListBill(InStockin param);
}

View File

@@ -255,4 +255,9 @@ public class InStockinServiceImpl implements IInStockinService
public List<InStockin> selectStockinByDetail(String stockinDetailId) {
return inStockinMapper.selectStockinByDetail(stockinDetailId);
}
@Override
public List<InStockin> selectInStockinListBill(InStockin param) {
return inStockinMapper.selectInStockinListBill(param);
}
}

View File

@@ -95,6 +95,24 @@ public class InStockinBack extends BaseEntity
private String sendTime;
private String msg;
private String companyShortName;
private String accountSetNo;
public String getCompanyShortName() {
return companyShortName;
}
public void setCompanyShortName(String companyShortName) {
this.companyShortName = companyShortName;
}
public String getAccountSetNo() {
return accountSetNo;
}
public void setAccountSetNo(String accountSetNo) {
this.accountSetNo = accountSetNo;
}
public String getSendStatus() {
return sendStatus;

View File

@@ -152,6 +152,44 @@ public class InStockinDetailBack extends BaseEntity
private String msg;
private String sourceLineId;
private String barCode;
private String isBatchManage;
private String oldProjectNo;
public String getSourceLineId() {
return sourceLineId;
}
public void setSourceLineId(String sourceLineId) {
this.sourceLineId = sourceLineId;
}
public String getBarCode() {
return barCode;
}
public void setBarCode(String barCode) {
this.barCode = barCode;
}
public String getIsBatchManage() {
return isBatchManage;
}
public void setIsBatchManage(String isBatchManage) {
this.isBatchManage = isBatchManage;
}
public String getOldProjectNo() {
return oldProjectNo;
}
public void setOldProjectNo(String oldProjectNo) {
this.oldProjectNo = oldProjectNo;
}
public String getSendStatus() {
return sendStatus;
}

View File

@@ -4,6 +4,7 @@ import java.util.List;
import com.ruoyi.in.stockin.domain.InStockin;
import com.ruoyi.in.stockindeatilback.domain.InStockinDetailBack;
import org.apache.ibatis.annotations.Param;
/**
* 入库单据子信息Mapper接口
@@ -61,4 +62,8 @@ public interface InStockinDetailBackMapper
* @return 结果
*/
public int deleteInStockinDetailBackByStockinDetailIds(String[] stockinDetailIds);
void insertInStockInDetailBackFinish(@Param("list") List<InStockinDetailBack> inStockinDetailParam);
void deleteInStockInDetailList(@Param("idList") List<InStockinDetailBack> inStockinDetails);
}

View File

@@ -58,4 +58,8 @@ public interface IInStockinDetailBackService
* @return 结果
*/
public int deleteInStockinDetailBackByStockinDetailId(String stockinDetailId);
void insertInStockInDetailBackFinish(List<InStockinDetailBack> inStockinDetails);
void deleteInStockInDetailList(List<InStockinDetailBack> inStockinDetails);
}

View File

@@ -90,4 +90,14 @@ public class InStockinDetailBackServiceImpl implements IInStockinDetailBackServi
{
return inStockinDetailBackMapper.deleteInStockinDetailBackByStockinDetailId(stockinDetailId);
}
@Override
public void insertInStockInDetailBackFinish(List<InStockinDetailBack> inStockinDetails) {
inStockinDetailBackMapper.insertInStockInDetailBackFinish(inStockinDetails);
}
@Override
public void deleteInStockInDetailList(List<InStockinDetailBack> inStockinDetails) {
inStockinDetailBackMapper.deleteInStockInDetailList(inStockinDetails);
}
}

View File

@@ -143,9 +143,13 @@ public class InStockinDetail extends BaseEntity
private String status;
private ExtraField extraField;
private String erpBill;
private String warehouseName;
private String warehouseId;
private String sourceLineId;
private String barCode;
private String isBatchManage;
private String oldProjectNo;
}

View File

@@ -69,4 +69,6 @@ public interface InStockinDetailMapper
void deleteInStockinDetailByStockinGuid(String stockinGuid);
InStockinDetail selectStockinByDetailById(InStockinDetail inStockinDetail);
List<InStockinDetail> selectStockInByDetailByBarCode(String barCode);
}

View File

@@ -81,4 +81,6 @@ public interface IInStockinDetailService
public InStockinDetail selectStockinByDetailById(InStockinDetail inStockinDetail);
List<InStockinDetail> selectStockInByDetailByBarCode(String barCode);
}

View File

@@ -127,4 +127,9 @@ public class InStockinDetailServiceImpl implements IInStockinDetailService
return inStockinDetailMapper.selectStockinByDetailById(inStockinDetail);
}
@Override
public List<InStockinDetail> selectStockInByDetailByBarCode(String barCode) {
return inStockinDetailMapper.selectStockInByDetailByBarCode(barCode);
}
}

View File

@@ -89,6 +89,15 @@ public class InStockinFinish extends BaseEntity
/** 备用字段5 */
@Excel(name = "备用字段5")
private String spare5;
private String stockinDetailId;
public String getStockinDetailId() {
return stockinDetailId;
}
public void setStockinDetailId(String stockinDetailId) {
this.stockinDetailId = stockinDetailId;
}
public void setStockinGuid(String stockinGuid)
{

View File

@@ -102,7 +102,7 @@ public class InStockinFinishServiceImpl implements IInStockinFinishService
}
@Override
@DataScope(warehouseAlias = "is2")
// @DataScope(warehouseAlias = "is2")
public List<InStockin> selectInStockinFinishListByInStockin(InStockin inStockin) {
return inStockinFinishMapper.selectInStockinFinishListByInStockin(inStockin);
}

View File

@@ -124,6 +124,9 @@ public class MydoJob extends BaseEntity
/** 重分标记 */
@Excel(name = "重分标记")
private String faultFlag;
private String endPoint;
private String inOut;
@@ -133,6 +136,23 @@ public class MydoJob extends BaseEntity
private String createRightTime;
private String productId;
private String stockinDetailId;
public String getEndPoint() {
return endPoint;
}
public void setEndPoint(String endPoint) {
this.endPoint = endPoint;
}
public String getStockinDetailId() {
return stockinDetailId;
}
public void setStockinDetailId(String stockinDetailId) {
this.stockinDetailId = stockinDetailId;
}
public String getProductId() {
return productId;

View File

@@ -0,0 +1,27 @@
package com.ruoyi.job.mydojob.domain;
import java.io.Serializable;
public class PkDetail implements Serializable {
private String stockinDetailId;
private String quantity;
public String getStockinDetailId() {
return stockinDetailId;
}
public void setStockinDetailId(String stockinDetailId) {
this.stockinDetailId = stockinDetailId;
}
public String getQuantity() {
return quantity;
}
public void setQuantity(String quantity) {
this.quantity = quantity;
}
}

View File

@@ -1,5 +1,6 @@
package com.ruoyi.job.mydojob.mapper;
import com.ruoyi.in.stockindetail.domain.InStockinDetail;
import com.ruoyi.job.mydojob.domain.MydoJob;
import org.apache.ibatis.annotations.Param;
@@ -82,5 +83,16 @@ public interface MydoJobMapper
MydoJob selectInJobByTrayCode(@Param("trayCode") String trayCode);
MydoJob selectInJobByTaskNo(@Param("taskNo") String taskNo);
void allotInJobSpace(HashMap<String, Object> map);
void ykCompleted(HashMap<String, Object> map);
void updateLed(HashMap<String, Object> map);
void updateLedError(HashMap<String, Object> map);
Integer selectBySpare4OrCargo(InStockinDetail inStockinDetail);
}

View File

@@ -109,4 +109,6 @@ public interface IMydoJobService
MydoJob selectMydoJobByEntranceId(MydoJob mydoJob);
List<MydoJob> getInJobBySerial(String serial);
void ykCompleted(MydoJob outJob);
}

View File

@@ -192,7 +192,7 @@ public class MydoJobServiceImpl implements IMydoJobService {
List<MydoJobDetail> mydoJobDetails = mydoJobDetailService.selectMydoJobDetailList(param);
for (MydoJobDetail mydoJobDetail : mydoJobDetails) {
String inOrOutDId = mydoJobDetail.getInOrOutDId();
String inOrOutDId = mydoJobDetail.getStockinDetailId();
InStockinDetail inStockinDetail = inStockinDetailService.selectInStockinDetailByStockinDetailId(inOrOutDId);
BigDecimal stockInNum = Convert.toBigDecimal(inStockinDetail.getScanNum());
BigDecimal jobInNum = Convert.toBigDecimal(mydoJobDetail.getInQuantity());
@@ -506,7 +506,7 @@ public class MydoJobServiceImpl implements IMydoJobService {
msg = map.get("v_resultmsg").toString();
builder.append("托盘:" + basStock.getTrayCode() + ",分配结果:" + msg + "<br/>");
}
iToWcsService.pushOutMydoJob();
//iToWcsService.pushOutMydoJob();
if (!StrUtil.isEmpty(builder)) {
return AjaxResult.warn(builder.toString());
}
@@ -527,4 +527,17 @@ public class MydoJobServiceImpl implements IMydoJobService {
public List<MydoJob> getInJobBySerial(String trayCode) {
return mydoJobMapper.getInJobBySerial(trayCode);
}
@Override
public void ykCompleted(MydoJob outJob) {
HashMap<String, Object> map = new HashMap<>();
map.put("v_job_id", outJob.getJobId());
map.put("v_result", null);
mydoJobMapper.ykCompleted(map);
if (!"10".equals(map.get("v_result").toString())) {
log.error("移库任务处理异常 异常代码{}", map.get("v_result"));
}else{
log.info("移库任务处理成功 jobId:[{}] trayCode:[{}]", outJob.getJobId(), outJob.getTrayCode());
}
}
}

View File

@@ -85,6 +85,34 @@ public class RequestLogController extends BaseController
return toAjax(requestLogService.updateRequestLog(requestLog));
}
@GetMapping("/getMethod")
public AjaxResult getMethod()
{
List<String> strings=requestLogService.getMethod();
return AjaxResult.success(requestLogService.getMethod());
}
// 获取原系统
@GetMapping("/getSource")
public AjaxResult getSource()
{
List<String> strings=requestLogService.getSource();
return AjaxResult.success(requestLogService.getSource());
}
// 获取目标系统
@GetMapping("/getTarget")
public AjaxResult getTarget()
{
List<String> strings=requestLogService.getTarget();
return AjaxResult.success(requestLogService.getTarget());
}
/**
* 删除接口记录
*/

View File

@@ -59,4 +59,10 @@ public interface RequestLogMapper
* @return 结果
*/
public int deleteRequestLogByRequestIds(Long[] requestIds);
List<String> getMethod();
List<String> getSource();
List<String> getTarget();
}

View File

@@ -69,6 +69,7 @@ public interface IRequestLogService
* @return
*/
public RequestLog getRequestLog(String url, String param, String remark,String source,String target);
public RequestLog getRequestLog(String url, String param, String remark,String source,String target,String billType,String ciccid);
/**
* 接收接口记录
*
@@ -77,4 +78,12 @@ public interface IRequestLogService
* @return
*/
public RequestLog getRequestLog(String param, String remark, AjaxResult ajaxResult);
public RequestLog getRequestLogERP(String param, String remark, AjaxResult ajaxResult);
List<String> getMethod();
List<String> getSource();
List<String> getTarget();
}

View File

@@ -3,6 +3,8 @@ package com.ruoyi.log.service.impl;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.date.DateUnit;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.net.URLEncodeUtil;
import cn.hutool.http.HttpRequest;
import cn.hutool.http.HttpUtil;
import cn.hutool.json.JSONUtil;
import com.ruoyi.common.core.domain.AjaxResult;
@@ -122,8 +124,10 @@ public class RequestLogServiceImpl implements IRequestLogService
requestLog.setRequestBody(param);
requestLog.setRequestUrl(url);
try {
String resStr = HttpUtil.post(url, param);
// String resStr = HttpRequest.post(url).contentType("application/x-www-from-urlencoded").timeout(2000).body(param).execute().body();
String resStr = HttpUtil.post(url, param);
requestLog.setResponseBody(resStr);
// 判断resStr的状态码,如果不是200抛出异常让catch捕获
if (!JSONUtil.isJsonObj(resStr)) {
throw new RuntimeException("返回结果不是有效的JSON对象");
@@ -133,7 +137,6 @@ public class RequestLogServiceImpl implements IRequestLogService
if (codeObj == null || !codeObj.toString().equals("200")) {
throw new RuntimeException("请求失败,状态码: " + (codeObj != null ? codeObj.toString() : "null"));
}
requestLog.setResponseBody(resStr);
requestLog.setResponseTime(DateUtil.formatDateTime(new Date()));
requestLog.setResponseStatus("1");
requestLog.setDuration(Convert.toStr(DateUtil.between(Convert.toDate(requestLog.getRequestTime()), Convert.toDate(requestLog.getResponseTime()), DateUnit.MS)));
@@ -148,6 +151,53 @@ public class RequestLogServiceImpl implements IRequestLogService
return requestLog;
}
@Override
public RequestLog getRequestLog(String url, String param, String remark, String source, String target, String billType, String ciccid) {
String body = "datajson=" + param
+ "&ibilltype=" + URLEncodeUtil.encodeAll(billType)
+ "&cacc_id=" + URLEncodeUtil.encodeAll(ciccid);
RequestLog requestLog = new RequestLog();
requestLog.setRequestTime(DateUtil.formatDateTime(new Date()));
requestLog.setSourceSystem(source);
requestLog.setTargetSystem(target);
requestLog.setEndpoint(remark);
requestLog.setRequestMethod("post");
requestLog.setRequestHeaders(null);
requestLog.setRequestBody(body);
requestLog.setRequestUrl(url);
try {
String resStr = HttpRequest.post(url)
.contentType("application/x-www-form-urlencoded;charset=UTF-8")
.body(body)
.execute().body();
requestLog.setResponseBody(resStr);
// 判断resStr的状态码,如果不是200抛出异常让catch捕获
if (!JSONUtil.isJsonObj(resStr)) {
throw new RuntimeException("返回结果不是有效的JSON对象");
}
cn.hutool.json.JSONObject jsonObject = JSONUtil.parseObj(resStr);
Object codeObj = jsonObject.get("ErrCode");
if (codeObj == null || !codeObj.toString().equals("0")) {
throw new RuntimeException("请求失败,状态码: " + (codeObj != null ? codeObj.toString() : "null"));
}
requestLog.setResponseTime(DateUtil.formatDateTime(new Date()));
requestLog.setResponseStatus("1");
requestLog.setDuration(Convert.toStr(DateUtil.between(Convert.toDate(requestLog.getRequestTime()), Convert.toDate(requestLog.getResponseTime()), DateUnit.MS)));
requestLog.setIsSuccessful("1");
} catch (Exception e) {
requestLog.setErrorDetails(e.getMessage());
requestLog.setIsSuccessful("0");
requestLog.setResponseStatus("0");
} finally {
insertRequestLog(requestLog);
}
return requestLog;
}
/**
* 插入请求日志
*
@@ -173,4 +223,46 @@ public class RequestLogServiceImpl implements IRequestLogService
requestLog.setResponseBody(Convert.toStr(ajaxResult.get("msg")));
return requestLog;
}
@Override
public RequestLog getRequestLogERP(String param, String remark, AjaxResult ajaxResult) {
RequestLog requestLog = new RequestLog();
requestLog.setRequestTime(DateUtil.formatDateTime(new Date()));
requestLog.setRequestBody(param);
requestLog.setSourceSystem("erp");
requestLog.setTargetSystem("wms");
requestLog.setEndpoint(remark);
requestLog.setRequestMethod("post");
requestLog.setResponseTime(DateUtil.formatDateTime(new Date()));
requestLog.setDuration(Convert.toStr(DateUtil.between(Convert.toDate(requestLog.getRequestTime()), Convert.toDate(requestLog.getResponseTime()), DateUnit.MS)));
requestLog.setResponseStatus("1");
if (ajaxResult.isSuccess()){
requestLog.setIsSuccessful("1");
}else {
requestLog.setIsSuccessful("0");
}
requestLog.setResponseBody(Convert.toStr(ajaxResult.get("msg")));
return requestLog;
}
@Override
public List<String> getMethod() {
return requestLogMapper.getMethod();
}
@Override
public List<String> getSource() {
return requestLogMapper.getSource();
}
@Override
public List<String> getTarget() {
return requestLogMapper.getTarget();
}
public static void main(String[] args) {
String aa = "{\"code\":\"200,\"success\":true,\"msg\":\"请求成功\"}";
System.out.println(JSONUtil.isJsonObj(aa));
}
}

View File

@@ -42,6 +42,9 @@ public class ViewHandAllotStockController extends BaseController
public TableDataInfo list(ViewHandAllotStock viewHandAllotStock)
{
startPage();
if (viewHandAllotStock.getWarehouseCode()==null||viewHandAllotStock.getWarehouseCode().equals("")){
viewHandAllotStock.setWarehouseCode("1");
}
List<ViewHandAllotStock> list = viewHandAllotStockService.selectViewHandAllotStockList(viewHandAllotStock);
return getDataTable(list);
}

View File

@@ -4,6 +4,7 @@ import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import org.springframework.data.annotation.Transient;
/**
* 手动分配库存对象 view_hand_allot_stock
@@ -187,6 +188,37 @@ public class ViewHandAllotStock extends BaseEntity
@Excel(name = "货位锁")
private String locked;
@Transient
private String ktpType;
@Transient
private String productType;
@Transient
private String warehouseCode;
public String getWarehouseCode() {
return warehouseCode;
}
public void setWarehouseCode(String warehouseCode) {
this.warehouseCode = warehouseCode;
}
public String getKtpType() {
return ktpType;
}
public void setKtpType(String ktpType) {
this.ktpType = ktpType;
}
public String getProductType() {
return productType;
}
public void setProductType(String productType) {
this.productType = productType;
}
public void setStockId(String stockId)
{
this.stockId = stockId;

View File

@@ -35,7 +35,7 @@ public class OutStockoutController extends BaseController {
/**
* 查询出库主单列表
*/
@PreAuthorize("@ss.hasPermi('out:outStockout:list')")
// @PreAuthorize("@ss.hasPermi('out:outStockout:list')")
@GetMapping("/list")
public TableDataInfo list(OutStockout outStockout) {
startPage();
@@ -51,7 +51,7 @@ public class OutStockoutController extends BaseController {
/**
* 导出出库主单列表
*/
@PreAuthorize("@ss.hasPermi('out:outStockout:export')")
// @PreAuthorize("@ss.hasPermi('out:outStockout:export')")
@Log(title = "出库主单", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, OutStockout outStockout) {
@@ -63,7 +63,7 @@ public class OutStockoutController extends BaseController {
/**
* 获取出库主单详细信息
*/
@PreAuthorize("@ss.hasPermi('out:outStockout:query')")
// @PreAuthorize("@ss.hasPermi('out:outStockout:query')")
@GetMapping(value = "/{stockoutGuid}")
public AjaxResult getInfo(@PathVariable("stockoutGuid") String stockoutGuid) {
return success(outStockoutService.selectOutStockoutByStockoutGuid(stockoutGuid));
@@ -72,7 +72,7 @@ public class OutStockoutController extends BaseController {
/**
* 新增出库主单
*/
@PreAuthorize("@ss.hasPermi('out:outStockout:add')")
// @PreAuthorize("@ss.hasPermi('out:outStockout:add')")
@Log(title = "出库主单", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody OutStockout outStockout) {
@@ -82,7 +82,7 @@ public class OutStockoutController extends BaseController {
/**
* 修改出库主单
*/
@PreAuthorize("@ss.hasPermi('out:outStockout:edit')")
// @PreAuthorize("@ss.hasPermi('out:outStockout:edit')")
@Log(title = "出库主单", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody OutStockout outStockout) {
@@ -92,7 +92,7 @@ public class OutStockoutController extends BaseController {
/**
* 删除出库主单
*/
@PreAuthorize("@ss.hasPermi('out:outStockout:remove')")
// @PreAuthorize("@ss.hasPermi('out:outStockout:remove')")
@Log(title = "出库主单", businessType = BusinessType.DELETE)
@DeleteMapping("/{stockoutGuids}")
public AjaxResult remove(@PathVariable String[] stockoutGuids) {
@@ -107,7 +107,7 @@ public class OutStockoutController extends BaseController {
*/
@Log(title = "出库主单保存", businessType = BusinessType.OTHER)
@PostMapping("/saveBill")
@PreAuthorize("@ss.hasPermi('out:outStockout:saveBill')")
// @PreAuthorize("@ss.hasPermi('out:outStockout:saveBill')")
@ResponseBody
public AjaxResult saveBill(@RequestBody OutStockoutVo outStockoutVo) {
String stockOutId = outStockoutService.saveBill(outStockoutVo);
@@ -117,7 +117,7 @@ public class OutStockoutController extends BaseController {
/**
* 出库单据状态改变
*/
@PreAuthorize("@ss.hasPermi('out:outStockout:changeStatus')")
// @PreAuthorize("@ss.hasPermi('out:outStockout:changeStatus')")
@Log(title = "出库主单状态改变", businessType = BusinessType.OTHER)
@RequestMapping("/changeStatus")
@ResponseBody
@@ -132,17 +132,24 @@ public class OutStockoutController extends BaseController {
* @param stockoutId
* @return
*/
@PreAuthorize("@ss.hasPermi('out:outStockout:autoAllot')")
// @PreAuthorize("@ss.hasPermi('out:outStockout:autoAllot')")
@Log(title = "出库单自动分配", businessType = BusinessType.OTHER)
@GetMapping("/autoAllot")
public AjaxResult autoAllot(@RequestParam("stockoutId") String stockoutId) {
// 修改出库方向
// OutStockout outStockout = new OutStockout();
// outStockout.setStockoutId(stockoutId);
// outStockout.setSpare8(spare8);
// outStockoutService.updateOutStockout(outStockout);
System.out.println(stockoutId);
// System.out.println(spare8);
return outStockoutService.autoAllot(stockoutId);
}
/**
* 手动分配
*/
@PreAuthorize("@ss.hasPermi('out:outStockout:manualAllot')")
// @PreAuthorize("@ss.hasPermi('out:outStockout:manualAllot')")
@Log(title = "出库单手动分配", businessType = BusinessType.OTHER)
@GetMapping("/manualAllot")
public AjaxResult manualAllot(@RequestParam("stockList") String[] stockList, @RequestParam("stockoutDetailId") String stockoutDetailId) {

View File

@@ -91,6 +91,9 @@ public class OutStockout extends BaseEntity
private String spare4;
private String spare5;
private String spare6;
private String spare7;
private String spare8;
private String customerName;
@@ -99,9 +102,51 @@ public class OutStockout extends BaseEntity
private String productId;
private String productName;
private String companyShortName;
private String accountSetNo;
public String getCompanyShortName() {
return companyShortName;
}
public void setCompanyShortName(String companyShortName) {
this.companyShortName = companyShortName;
}
public String getAccountSetNo() {
return accountSetNo;
}
public void setAccountSetNo(String accountSetNo) {
this.accountSetNo = accountSetNo;
}
private List<String> typeData;
public String getSpare6() {
return spare6;
}
public void setSpare6(String spare6) {
this.spare6 = spare6;
}
public String getSpare7() {
return spare7;
}
public void setSpare7(String spare7) {
this.spare7 = spare7;
}
public String getSpare8() {
return spare8;
}
public void setSpare8(String spare8) {
this.spare8 = spare8;
}
public List<String> getTypeData() {
return typeData;
}

View File

@@ -68,4 +68,6 @@ public interface OutStockoutMapper
OutStockout selectOutStockoutByStockoutId(String stockoutId);
void manualAllot(HashMap<String, String> map);
void updateOutStockouts(OutStockout mainOut);
}

View File

@@ -73,4 +73,6 @@ public interface IOutStockoutService
List<OutStockout> selectOutStockoutListApi(OutStockout outStockoutParam);
AjaxResult manualAllot(String[] stockList,String stockoutDetailId);
void updateOutStockouts(OutStockout mainOut);
}

View File

@@ -180,10 +180,11 @@ public class OutStockoutServiceImpl implements IOutStockoutService
for (OutStockoutDetail detail : outStockoutDetails) {
if (detail.getAllotQuantity().compareTo(detail.getQuantity()) < 0){
map.put("v_stockout_detail_id", detail.getStockoutDetailId());
map.put("v_result", null);
map.put("v_resultmsg", null);
outStockoutMapper.autoAllot(map);
toWcsService.pushOutMydoJob();
if (!"10".equals(map.get("v_result"))){
stringBuilder.append(",").append(detail.getStockoutDetailId()+map.get("v_resultString"));
stringBuilder.append(",").append(detail.getStockoutDetailId()+map.get("v_resultmsg"));
}
}else{
stringBuilder.append(",").append(detail.getStockoutDetailId()+"单据已分配完成");
@@ -209,7 +210,7 @@ public class OutStockoutServiceImpl implements IOutStockoutService
map.put("v_stockout_detail_id", stockoutDetailId);
map.put("v_stock_id", stock);
outStockoutMapper.manualAllot(map);
toWcsService.pushOutMydoJob();
//toWcsService.pushOutMydoJob();
if (!"10".equals(map.get("v_result"))){
stringBuilder.append(",").append(stockoutDetailId+map.get("v_resultString"));
}
@@ -219,4 +220,9 @@ public class OutStockoutServiceImpl implements IOutStockoutService
}
return AjaxResult.success();
}
@Override
public void updateOutStockouts(OutStockout mainOut) {
outStockoutMapper.updateOutStockouts(mainOut);
}
}

View File

@@ -0,0 +1,104 @@
package com.ruoyi.out.outStockoutBack.controller;
import java.util.List;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.out.outStockoutBack.domain.OutStockoutBack;
import com.ruoyi.out.outStockoutBack.service.IOutStockoutBackService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 出库单据主信息Controller
*
* @author ruoyi
* @date 2026-02-02
*/
@RestController
@RequestMapping("/out/outStockoutBack")
public class OutStockoutBackController extends BaseController
{
@Autowired
private IOutStockoutBackService outStockoutBackService;
/**
* 查询出库单据主信息列表
*/
@PreAuthorize("@ss.hasPermi('out:outStockoutBack:list')")
@GetMapping("/list")
public TableDataInfo list(OutStockoutBack outStockoutBack)
{
startPage();
List<OutStockoutBack> list = outStockoutBackService.selectOutStockoutBackList(outStockoutBack);
return getDataTable(list);
}
/**
* 导出出库单据主信息列表
*/
@PreAuthorize("@ss.hasPermi('out:outStockoutBack:export')")
@Log(title = "出库单据主信息", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, OutStockoutBack outStockoutBack)
{
List<OutStockoutBack> list = outStockoutBackService.selectOutStockoutBackList(outStockoutBack);
ExcelUtil<OutStockoutBack> util = new ExcelUtil<OutStockoutBack>(OutStockoutBack.class);
util.exportExcel(response, list, "出库单据主信息数据");
}
/**
* 获取出库单据主信息详细信息
*/
@PreAuthorize("@ss.hasPermi('out:outStockoutBack:query')")
@GetMapping(value = "/{stockoutGuid}")
public AjaxResult getInfo(@PathVariable("stockoutGuid") String stockoutGuid)
{
return success(outStockoutBackService.selectOutStockoutBackByStockoutGuid(stockoutGuid));
}
/**
* 新增出库单据主信息
*/
@PreAuthorize("@ss.hasPermi('out:outStockoutBack:add')")
@Log(title = "出库单据主信息", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody OutStockoutBack outStockoutBack)
{
return toAjax(outStockoutBackService.insertOutStockoutBack(outStockoutBack));
}
/**
* 修改出库单据主信息
*/
@PreAuthorize("@ss.hasPermi('out:outStockoutBack:edit')")
@Log(title = "出库单据主信息", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody OutStockoutBack outStockoutBack)
{
return toAjax(outStockoutBackService.updateOutStockoutBack(outStockoutBack));
}
/**
* 删除出库单据主信息
*/
@PreAuthorize("@ss.hasPermi('out:outStockoutBack:remove')")
@Log(title = "出库单据主信息", businessType = BusinessType.DELETE)
@DeleteMapping("/{stockoutGuids}")
public AjaxResult remove(@PathVariable String[] stockoutGuids)
{
return toAjax(outStockoutBackService.deleteOutStockoutBackByStockoutGuids(stockoutGuids));
}
}

View File

@@ -0,0 +1,464 @@
package com.ruoyi.out.outStockoutBack.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* 出库单据主信息对象 out_stockout_back
*
* @author ruoyi
* @date 2026-02-02
*/
public class OutStockoutBack extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 546 guid */
@Excel(name = "546 guid")
private String stockoutGuid;
/** 546 单据编码 */
@Excel(name = "546 单据编码")
private String stockoutId;
/** 546 出库类型 */
@Excel(name = "546 出库类型")
private String outType;
/** 546 单据时间 */
@Excel(name = "546 单据时间")
private String createDate;
/** 项目号546 */
@Excel(name = "项目号546")
private String departmentNo;
/** 客户编码546 */
@Excel(name = "客户编码546")
private String customerNo;
/** 制单人546 */
@Excel(name = "制单人546")
private String createManId;
/** 546 单据状态 */
@Excel(name = "546 单据状态")
private String status;
/** 单据来源0自建单1接口 */
@Excel(name = "单据来源0自建单1接口")
private String stockoutSource;
/** 仓库ID546 */
@Excel(name = "仓库ID546")
private String warehouseId;
/** 客户名称546 */
@Excel(name = "客户名称546")
private String classNowId;
/** 出口 */
@Excel(name = "出口")
private String exitId;
/** 出库方式546 */
@Excel(name = "出库方式546")
private String carNumber;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private String FID;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private String erpStockoutId;
/** 546 */
@Excel(name = "546")
private String startDate;
/** 546 */
@Excel(name = "546")
private String finishDate;
/** 合同号546 */
@Excel(name = "合同号546")
private String spare1;
/** 销售订单号546 */
@Excel(name = "销售订单号546")
private String spare2;
/** 审核时间546 */
@Excel(name = "审核时间546")
private String spare3;
/** 审核人546 */
@Excel(name = "审核人546")
private String spare4;
/** 备注546 */
@Excel(name = "备注546")
private String spare5;
/** 配送方式546 1人工2agv */
@Excel(name = "配送方式546 1人工2agv")
private String spare6;
/** 出库配送终点546 */
@Excel(name = "出库配送终点546")
private String spare7;
/** 1缓存2线边546 */
@Excel(name = "1缓存2线边546")
private String spare8;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private String sendStatus;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private String sendTime;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private String msg;
private String companyShortName;
private String accountSetNo;
public String getCompanyShortName() {
return companyShortName;
}
public void setCompanyShortName(String companyShortName) {
this.companyShortName = companyShortName;
}
public String getAccountSetNo() {
return accountSetNo;
}
public void setAccountSetNo(String accountSetNo) {
this.accountSetNo = accountSetNo;
}
public void setStockoutGuid(String stockoutGuid)
{
this.stockoutGuid = stockoutGuid;
}
public String getStockoutGuid()
{
return stockoutGuid;
}
public void setStockoutId(String stockoutId)
{
this.stockoutId = stockoutId;
}
public String getStockoutId()
{
return stockoutId;
}
public void setOutType(String outType)
{
this.outType = outType;
}
public String getOutType()
{
return outType;
}
public void setCreateDate(String createDate)
{
this.createDate = createDate;
}
public String getCreateDate()
{
return createDate;
}
public void setDepartmentNo(String departmentNo)
{
this.departmentNo = departmentNo;
}
public String getDepartmentNo()
{
return departmentNo;
}
public void setCustomerNo(String customerNo)
{
this.customerNo = customerNo;
}
public String getCustomerNo()
{
return customerNo;
}
public void setCreateManId(String createManId)
{
this.createManId = createManId;
}
public String getCreateManId()
{
return createManId;
}
public void setStatus(String status)
{
this.status = status;
}
public String getStatus()
{
return status;
}
public void setStockoutSource(String stockoutSource)
{
this.stockoutSource = stockoutSource;
}
public String getStockoutSource()
{
return stockoutSource;
}
public void setWarehouseId(String warehouseId)
{
this.warehouseId = warehouseId;
}
public String getWarehouseId()
{
return warehouseId;
}
public void setClassNowId(String classNowId)
{
this.classNowId = classNowId;
}
public String getClassNowId()
{
return classNowId;
}
public void setExitId(String exitId)
{
this.exitId = exitId;
}
public String getExitId()
{
return exitId;
}
public void setCarNumber(String carNumber)
{
this.carNumber = carNumber;
}
public String getCarNumber()
{
return carNumber;
}
public void setFID(String FID)
{
this.FID = FID;
}
public String getFID()
{
return FID;
}
public void setErpStockoutId(String erpStockoutId)
{
this.erpStockoutId = erpStockoutId;
}
public String getErpStockoutId()
{
return erpStockoutId;
}
public void setStartDate(String startDate)
{
this.startDate = startDate;
}
public String getStartDate()
{
return startDate;
}
public void setFinishDate(String finishDate)
{
this.finishDate = finishDate;
}
public String getFinishDate()
{
return finishDate;
}
public void setSpare1(String spare1)
{
this.spare1 = spare1;
}
public String getSpare1()
{
return spare1;
}
public void setSpare2(String spare2)
{
this.spare2 = spare2;
}
public String getSpare2()
{
return spare2;
}
public void setSpare3(String spare3)
{
this.spare3 = spare3;
}
public String getSpare3()
{
return spare3;
}
public void setSpare4(String spare4)
{
this.spare4 = spare4;
}
public String getSpare4()
{
return spare4;
}
public void setSpare5(String spare5)
{
this.spare5 = spare5;
}
public String getSpare5()
{
return spare5;
}
public void setSpare6(String spare6)
{
this.spare6 = spare6;
}
public String getSpare6()
{
return spare6;
}
public void setSpare7(String spare7)
{
this.spare7 = spare7;
}
public String getSpare7()
{
return spare7;
}
public void setSpare8(String spare8)
{
this.spare8 = spare8;
}
public String getSpare8()
{
return spare8;
}
public void setSendStatus(String sendStatus)
{
this.sendStatus = sendStatus;
}
public String getSendStatus()
{
return sendStatus;
}
public void setSendTime(String sendTime)
{
this.sendTime = sendTime;
}
public String getSendTime()
{
return sendTime;
}
public void setMsg(String msg)
{
this.msg = msg;
}
public String getMsg()
{
return msg;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("stockoutGuid", getStockoutGuid())
.append("stockoutId", getStockoutId())
.append("outType", getOutType())
.append("createDate", getCreateDate())
.append("departmentNo", getDepartmentNo())
.append("customerNo", getCustomerNo())
.append("createManId", getCreateManId())
.append("status", getStatus())
.append("stockoutSource", getStockoutSource())
.append("warehouseId", getWarehouseId())
.append("classNowId", getClassNowId())
.append("exitId", getExitId())
.append("carNumber", getCarNumber())
.append("FID", getFID())
.append("erpStockoutId", getErpStockoutId())
.append("startDate", getStartDate())
.append("finishDate", getFinishDate())
.append("spare1", getSpare1())
.append("spare2", getSpare2())
.append("spare3", getSpare3())
.append("spare4", getSpare4())
.append("spare5", getSpare5())
.append("spare6", getSpare6())
.append("spare7", getSpare7())
.append("spare8", getSpare8())
.append("sendStatus", getSendStatus())
.append("sendTime", getSendTime())
.append("msg", getMsg())
.toString();
}
}

View File

@@ -0,0 +1,64 @@
package com.ruoyi.out.outStockoutBack.mapper;
import java.util.List;
import com.ruoyi.out.outStockoutBack.domain.OutStockoutBack;
/**
* 出库单据主信息Mapper接口
*
* @author ruoyi
* @date 2026-02-02
*/
public interface OutStockoutBackMapper
{
/**
* 查询出库单据主信息
*
* @param stockoutGuid 出库单据主信息主键
* @return 出库单据主信息
*/
public OutStockoutBack selectOutStockoutBackByStockoutGuid(String stockoutGuid);
public OutStockoutBack selelctTopOutStockout();
/**
* 查询出库单据主信息列表
*
* @param outStockoutBack 出库单据主信息
* @return 出库单据主信息集合
*/
public List<OutStockoutBack> selectOutStockoutBackList(OutStockoutBack outStockoutBack);
/**
* 新增出库单据主信息
*
* @param outStockoutBack 出库单据主信息
* @return 结果
*/
public int insertOutStockoutBack(OutStockoutBack outStockoutBack);
/**
* 修改出库单据主信息
*
* @param outStockoutBack 出库单据主信息
* @return 结果
*/
public int updateOutStockoutBack(OutStockoutBack outStockoutBack);
/**
* 删除出库单据主信息
*
* @param stockoutGuid 出库单据主信息主键
* @return 结果
*/
public int deleteOutStockoutBackByStockoutGuid(String stockoutGuid);
/**
* 批量删除出库单据主信息
*
* @param stockoutGuids 需要删除的数据主键集合
* @return 结果
*/
public int deleteOutStockoutBackByStockoutGuids(String[] stockoutGuids);
}

View File

@@ -0,0 +1,70 @@
package com.ruoyi.out.outStockoutBack.service;
import java.util.List;
import com.ruoyi.out.outStockoutBack.domain.OutStockoutBack;
/**
* 出库单据主信息Service接口
*
* @author ruoyi
* @date 2026-02-02
*/
public interface IOutStockoutBackService
{
/**
* 查询出库单据主信息
*
* @param stockoutGuid 出库单据主信息主键
* @return 出库单据主信息
*/
public OutStockoutBack selectOutStockoutBackByStockoutGuid(String stockoutGuid);
public OutStockoutBack selelctTopOutStockout();
/**
* 查询出库单据主信息列表
*
* @param outStockoutBack 出库单据主信息
* @return 出库单据主信息集合
*/
public List<OutStockoutBack> selectOutStockoutBackList(OutStockoutBack outStockoutBack);
/**
* 新增出库单据主信息
*
* @param outStockoutBack 出库单据主信息
* @return 结果
*/
public int insertOutStockoutBack(OutStockoutBack outStockoutBack);
/**
* 修改出库单据主信息
*
* @param outStockoutBack 出库单据主信息
* @return 结果
*/
public int updateOutStockoutBack(OutStockoutBack outStockoutBack);
/**
* 批量删除出库单据主信息
*
* @param stockoutGuids 需要删除的出库单据主信息主键集合
* @return 结果
*/
public int deleteOutStockoutBackByStockoutGuids(String[] stockoutGuids);
/**
* 删除出库单据主信息信息
*
* @param stockoutGuid 出库单据主信息主键
* @return 结果
*/
public int deleteOutStockoutBackByStockoutGuid(String stockoutGuid);
}

View File

@@ -0,0 +1,98 @@
package com.ruoyi.out.outStockoutBack.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.out.outStockoutBack.mapper.OutStockoutBackMapper;
import com.ruoyi.out.outStockoutBack.domain.OutStockoutBack;
import com.ruoyi.out.outStockoutBack.service.IOutStockoutBackService;
/**
* 出库单据主信息Service业务层处理
*
* @author ruoyi
* @date 2026-02-02
*/
@Service
public class OutStockoutBackServiceImpl implements IOutStockoutBackService
{
@Autowired
private OutStockoutBackMapper outStockoutBackMapper;
/**
* 查询出库单据主信息
*
* @param stockoutGuid 出库单据主信息主键
* @return 出库单据主信息
*/
@Override
public OutStockoutBack selectOutStockoutBackByStockoutGuid(String stockoutGuid)
{
return outStockoutBackMapper.selectOutStockoutBackByStockoutGuid(stockoutGuid);
}
@Override
public OutStockoutBack selelctTopOutStockout() {
return outStockoutBackMapper.selelctTopOutStockout();
}
/**
* 查询出库单据主信息列表
*
* @param outStockoutBack 出库单据主信息
* @return 出库单据主信息
*/
@Override
public List<OutStockoutBack> selectOutStockoutBackList(OutStockoutBack outStockoutBack)
{
return outStockoutBackMapper.selectOutStockoutBackList(outStockoutBack);
}
/**
* 新增出库单据主信息
*
* @param outStockoutBack 出库单据主信息
* @return 结果
*/
@Override
public int insertOutStockoutBack(OutStockoutBack outStockoutBack)
{
return outStockoutBackMapper.insertOutStockoutBack(outStockoutBack);
}
/**
* 修改出库单据主信息
*
* @param outStockoutBack 出库单据主信息
* @return 结果
*/
@Override
public int updateOutStockoutBack(OutStockoutBack outStockoutBack)
{
return outStockoutBackMapper.updateOutStockoutBack(outStockoutBack);
}
/**
* 批量删除出库单据主信息
*
* @param stockoutGuids 需要删除的出库单据主信息主键
* @return 结果
*/
@Override
public int deleteOutStockoutBackByStockoutGuids(String[] stockoutGuids)
{
return outStockoutBackMapper.deleteOutStockoutBackByStockoutGuids(stockoutGuids);
}
/**
* 删除出库单据主信息信息
*
* @param stockoutGuid 出库单据主信息主键
* @return 结果
*/
@Override
public int deleteOutStockoutBackByStockoutGuid(String stockoutGuid)
{
return outStockoutBackMapper.deleteOutStockoutBackByStockoutGuid(stockoutGuid);
}
}

View File

@@ -48,7 +48,7 @@ public class OutStockoutDetail extends BaseEntity
/** 计划数量(箱) */
@Excel(name = "计划数量", readConverterExp = "箱=")
private BigDecimal quantityX;
private String quantityX;
/** 计划数量(件) */
@Excel(name = "计划数量", readConverterExp = "件=")
@@ -200,6 +200,42 @@ public class OutStockoutDetail extends BaseEntity
private String spare9;
private String sourceLineId;
private String barCode;
private String isBatchManage;
private String oldProjectNo;
public String getSourceLineId() {
return sourceLineId;
}
public void setSourceLineId(String sourceLineId) {
this.sourceLineId = sourceLineId;
}
public String getBarCode() {
return barCode;
}
public void setBarCode(String barCode) {
this.barCode = barCode;
}
public String getIsBatchManage() {
return isBatchManage;
}
public void setIsBatchManage(String isBatchManage) {
this.isBatchManage = isBatchManage;
}
public String getOldProjectNo() {
return oldProjectNo;
}
public void setOldProjectNo(String oldProjectNo) {
this.oldProjectNo = oldProjectNo;
}
public String getSpare1() {
return spare1;
@@ -407,14 +443,12 @@ public class OutStockoutDetail extends BaseEntity
return quantity;
}
public void setQuantityX(BigDecimal quantityX)
{
this.quantityX = quantityX;
public String getQuantityX() {
return quantityX;
}
public BigDecimal getQuantityX()
{
return quantityX;
public void setQuantityX(String quantityX) {
this.quantityX = quantityX;
}
public void setQuantityJ(BigDecimal quantityJ)

View File

@@ -0,0 +1,104 @@
package com.ruoyi.out.outStockoutDetailBack.controller;
import java.util.List;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.out.outStockoutDetailBack.domain.OutStockoutDetailBack;
import com.ruoyi.out.outStockoutDetailBack.service.IOutStockoutDetailBackService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 历史出库单据子信息Controller
*
* @author ruoyi
* @date 2026-02-02
*/
@RestController
@RequestMapping("/out/outStockoutDetailBack")
public class OutStockoutDetailBackController extends BaseController
{
@Autowired
private IOutStockoutDetailBackService outStockoutDetailBackService;
/**
* 查询历史出库单据子信息列表
*/
@PreAuthorize("@ss.hasPermi('out:outStockoutDetailBack:list')")
@GetMapping("/list")
public TableDataInfo list(OutStockoutDetailBack outStockoutDetailBack)
{
startPage();
List<OutStockoutDetailBack> list = outStockoutDetailBackService.selectOutStockoutDetailBackList(outStockoutDetailBack);
return getDataTable(list);
}
/**
* 导出历史出库单据子信息列表
*/
@PreAuthorize("@ss.hasPermi('out:outStockoutDetailBack:export')")
@Log(title = "历史出库单据子信息", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, OutStockoutDetailBack outStockoutDetailBack)
{
List<OutStockoutDetailBack> list = outStockoutDetailBackService.selectOutStockoutDetailBackList(outStockoutDetailBack);
ExcelUtil<OutStockoutDetailBack> util = new ExcelUtil<OutStockoutDetailBack>(OutStockoutDetailBack.class);
util.exportExcel(response, list, "历史出库单据子信息数据");
}
/**
* 获取历史出库单据子信息详细信息
*/
@PreAuthorize("@ss.hasPermi('out:outStockoutDetailBack:query')")
@GetMapping(value = "/{stockoutDetailId}")
public AjaxResult getInfo(@PathVariable("stockoutDetailId") String stockoutDetailId)
{
return success(outStockoutDetailBackService.selectOutStockoutDetailBackByStockoutDetailId(stockoutDetailId));
}
/**
* 新增历史出库单据子信息
*/
@PreAuthorize("@ss.hasPermi('out:outStockoutDetailBack:add')")
@Log(title = "历史出库单据子信息", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody OutStockoutDetailBack outStockoutDetailBack)
{
return toAjax(outStockoutDetailBackService.insertOutStockoutDetailBack(outStockoutDetailBack));
}
/**
* 修改历史出库单据子信息
*/
@PreAuthorize("@ss.hasPermi('out:outStockoutDetailBack:edit')")
@Log(title = "历史出库单据子信息", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody OutStockoutDetailBack outStockoutDetailBack)
{
return toAjax(outStockoutDetailBackService.updateOutStockoutDetailBack(outStockoutDetailBack));
}
/**
* 删除历史出库单据子信息
*/
@PreAuthorize("@ss.hasPermi('out:outStockoutDetailBack:remove')")
@Log(title = "历史出库单据子信息", businessType = BusinessType.DELETE)
@DeleteMapping("/{stockoutDetailIds}")
public AjaxResult remove(@PathVariable String[] stockoutDetailIds)
{
return toAjax(outStockoutDetailBackService.deleteOutStockoutDetailBackByStockoutDetailIds(stockoutDetailIds));
}
}

View File

@@ -0,0 +1,645 @@
package com.ruoyi.out.outStockoutDetailBack.domain;
import java.math.BigDecimal;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* 历史出库单据子信息对象 out_stockout_detail_back
*
* @author ruoyi
* @date 2026-02-02
*/
public class OutStockoutDetailBack extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private String stockoutDetailId;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private String stockoutGuid;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private String stockoutId;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private String lotNo;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private String productGuid;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private String productId;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private BigDecimal quantity;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private String quantityX;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private BigDecimal quantityJ;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private BigDecimal assignNum;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private BigDecimal assignNumX;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private BigDecimal assignNumJ;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private BigDecimal allotQuantity;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private BigDecimal allotQuantityX;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private BigDecimal allotQuantityJ;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private String price;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private String warehouseId;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private String outId;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private String bukechaiQuantity;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private String kechaiQuantity;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private String entryid;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private String flatQuantity;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private String fid;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private String erpStockoutId;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private String unit;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private String spec;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private String productName;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private String spare1;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private String spare2;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private String spare3;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private String spare4;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private String spare5;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private String spare6;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private String spare7;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private String spare8;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private String spare9;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private String sendStatus;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private String sendTime;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private String msg;
private String sourceLineId;
private String barCode;
private String isBatchManage;
private String oldProjectNo;
public String getSourceLineId() {
return sourceLineId;
}
public void setSourceLineId(String sourceLineId) {
this.sourceLineId = sourceLineId;
}
public String getBarCode() {
return barCode;
}
public void setBarCode(String barCode) {
this.barCode = barCode;
}
public String getIsBatchManage() {
return isBatchManage;
}
public void setIsBatchManage(String isBatchManage) {
this.isBatchManage = isBatchManage;
}
public String getOldProjectNo() {
return oldProjectNo;
}
public void setOldProjectNo(String oldProjectNo) {
this.oldProjectNo = oldProjectNo;
}
public void setStockoutDetailId(String stockoutDetailId)
{
this.stockoutDetailId = stockoutDetailId;
}
public String getStockoutDetailId()
{
return stockoutDetailId;
}
public void setStockoutGuid(String stockoutGuid)
{
this.stockoutGuid = stockoutGuid;
}
public String getStockoutGuid()
{
return stockoutGuid;
}
public void setStockoutId(String stockoutId)
{
this.stockoutId = stockoutId;
}
public String getStockoutId()
{
return stockoutId;
}
public void setLotNo(String lotNo)
{
this.lotNo = lotNo;
}
public String getLotNo()
{
return lotNo;
}
public void setProductGuid(String productGuid)
{
this.productGuid = productGuid;
}
public String getProductGuid()
{
return productGuid;
}
public void setProductId(String productId)
{
this.productId = productId;
}
public String getProductId()
{
return productId;
}
public void setQuantity(BigDecimal quantity)
{
this.quantity = quantity;
}
public BigDecimal getQuantity()
{
return quantity;
}
public String getQuantityX() {
return quantityX;
}
public void setQuantityX(String quantityX) {
this.quantityX = quantityX;
}
public void setQuantityJ(BigDecimal quantityJ)
{
this.quantityJ = quantityJ;
}
public BigDecimal getQuantityJ()
{
return quantityJ;
}
public void setAssignNum(BigDecimal assignNum)
{
this.assignNum = assignNum;
}
public BigDecimal getAssignNum()
{
return assignNum;
}
public void setAssignNumX(BigDecimal assignNumX)
{
this.assignNumX = assignNumX;
}
public BigDecimal getAssignNumX()
{
return assignNumX;
}
public void setAssignNumJ(BigDecimal assignNumJ)
{
this.assignNumJ = assignNumJ;
}
public BigDecimal getAssignNumJ()
{
return assignNumJ;
}
public void setAllotQuantity(BigDecimal allotQuantity)
{
this.allotQuantity = allotQuantity;
}
public BigDecimal getAllotQuantity()
{
return allotQuantity;
}
public void setAllotQuantityX(BigDecimal allotQuantityX)
{
this.allotQuantityX = allotQuantityX;
}
public BigDecimal getAllotQuantityX()
{
return allotQuantityX;
}
public void setAllotQuantityJ(BigDecimal allotQuantityJ)
{
this.allotQuantityJ = allotQuantityJ;
}
public BigDecimal getAllotQuantityJ()
{
return allotQuantityJ;
}
public void setPrice(String price)
{
this.price = price;
}
public String getPrice()
{
return price;
}
public void setWarehouseId(String warehouseId)
{
this.warehouseId = warehouseId;
}
public String getWarehouseId()
{
return warehouseId;
}
public void setOutId(String outId)
{
this.outId = outId;
}
public String getOutId()
{
return outId;
}
public void setBukechaiQuantity(String bukechaiQuantity)
{
this.bukechaiQuantity = bukechaiQuantity;
}
public String getBukechaiQuantity()
{
return bukechaiQuantity;
}
public void setKechaiQuantity(String kechaiQuantity)
{
this.kechaiQuantity = kechaiQuantity;
}
public String getKechaiQuantity()
{
return kechaiQuantity;
}
public void setEntryid(String entryid)
{
this.entryid = entryid;
}
public String getEntryid()
{
return entryid;
}
public void setFlatQuantity(String flatQuantity)
{
this.flatQuantity = flatQuantity;
}
public String getFlatQuantity()
{
return flatQuantity;
}
public void setFid(String fid)
{
this.fid = fid;
}
public String getFid()
{
return fid;
}
public void setErpStockoutId(String erpStockoutId)
{
this.erpStockoutId = erpStockoutId;
}
public String getErpStockoutId()
{
return erpStockoutId;
}
public void setUnit(String unit)
{
this.unit = unit;
}
public String getUnit()
{
return unit;
}
public void setSpec(String spec)
{
this.spec = spec;
}
public String getSpec()
{
return spec;
}
public void setProductName(String productName)
{
this.productName = productName;
}
public String getProductName()
{
return productName;
}
public void setSpare1(String spare1)
{
this.spare1 = spare1;
}
public String getSpare1()
{
return spare1;
}
public void setSpare2(String spare2)
{
this.spare2 = spare2;
}
public String getSpare2()
{
return spare2;
}
public void setSpare3(String spare3)
{
this.spare3 = spare3;
}
public String getSpare3()
{
return spare3;
}
public void setSpare4(String spare4)
{
this.spare4 = spare4;
}
public String getSpare4()
{
return spare4;
}
public void setSpare5(String spare5)
{
this.spare5 = spare5;
}
public String getSpare5()
{
return spare5;
}
public void setSpare6(String spare6)
{
this.spare6 = spare6;
}
public String getSpare6()
{
return spare6;
}
public void setSpare7(String spare7)
{
this.spare7 = spare7;
}
public String getSpare7()
{
return spare7;
}
public void setSpare8(String spare8)
{
this.spare8 = spare8;
}
public String getSpare8()
{
return spare8;
}
public void setSpare9(String spare9)
{
this.spare9 = spare9;
}
public String getSpare9()
{
return spare9;
}
public void setSendStatus(String sendStatus)
{
this.sendStatus = sendStatus;
}
public String getSendStatus()
{
return sendStatus;
}
public void setSendTime(String sendTime)
{
this.sendTime = sendTime;
}
public String getSendTime()
{
return sendTime;
}
public void setMsg(String msg)
{
this.msg = msg;
}
public String getMsg()
{
return msg;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("stockoutDetailId", getStockoutDetailId())
.append("stockoutGuid", getStockoutGuid())
.append("stockoutId", getStockoutId())
.append("lotNo", getLotNo())
.append("productGuid", getProductGuid())
.append("productId", getProductId())
.append("quantity", getQuantity())
.append("quantityX", getQuantityX())
.append("quantityJ", getQuantityJ())
.append("assignNum", getAssignNum())
.append("assignNumX", getAssignNumX())
.append("assignNumJ", getAssignNumJ())
.append("allotQuantity", getAllotQuantity())
.append("allotQuantityX", getAllotQuantityX())
.append("allotQuantityJ", getAllotQuantityJ())
.append("price", getPrice())
.append("remark", getRemark())
.append("warehouseId", getWarehouseId())
.append("outId", getOutId())
.append("bukechaiQuantity", getBukechaiQuantity())
.append("kechaiQuantity", getKechaiQuantity())
.append("entryid", getEntryid())
.append("flatQuantity", getFlatQuantity())
.append("fid", getFid())
.append("erpStockoutId", getErpStockoutId())
.append("unit", getUnit())
.append("spec", getSpec())
.append("productName", getProductName())
.append("spare1", getSpare1())
.append("spare2", getSpare2())
.append("spare3", getSpare3())
.append("spare4", getSpare4())
.append("spare5", getSpare5())
.append("spare6", getSpare6())
.append("spare7", getSpare7())
.append("spare8", getSpare8())
.append("spare9", getSpare9())
.append("sendStatus", getSendStatus())
.append("sendTime", getSendTime())
.append("msg", getMsg())
.toString();
}
}

View File

@@ -0,0 +1,66 @@
package com.ruoyi.out.outStockoutDetailBack.mapper;
import java.util.List;
import com.ruoyi.out.outStockoutDetailBack.domain.OutStockoutDetailBack;
import org.apache.ibatis.annotations.Param;
/**
* 历史出库单据子信息Mapper接口
*
* @author ruoyi
* @date 2026-02-02
*/
public interface OutStockoutDetailBackMapper
{
/**
* 查询历史出库单据子信息
*
* @param stockoutDetailId 历史出库单据子信息主键
* @return 历史出库单据子信息
*/
public OutStockoutDetailBack selectOutStockoutDetailBackByStockoutDetailId(String stockoutDetailId);
/**
* 查询历史出库单据子信息列表
*
* @param outStockoutDetailBack 历史出库单据子信息
* @return 历史出库单据子信息集合
*/
public List<OutStockoutDetailBack> selectOutStockoutDetailBackList(OutStockoutDetailBack outStockoutDetailBack);
/**
* 新增历史出库单据子信息
*
* @param outStockoutDetailBack 历史出库单据子信息
* @return 结果
*/
public int insertOutStockoutDetailBack(OutStockoutDetailBack outStockoutDetailBack);
/**
* 修改历史出库单据子信息
*
* @param outStockoutDetailBack 历史出库单据子信息
* @return 结果
*/
public int updateOutStockoutDetailBack(OutStockoutDetailBack outStockoutDetailBack);
/**
* 删除历史出库单据子信息
*
* @param stockoutDetailId 历史出库单据子信息主键
* @return 结果
*/
public int deleteOutStockoutDetailBackByStockoutDetailId(String stockoutDetailId);
/**
* 批量删除历史出库单据子信息
*
* @param stockoutDetailIds 需要删除的数据主键集合
* @return 结果
*/
public int deleteOutStockoutDetailBackByStockoutDetailIds(String[] stockoutDetailIds);
void insertOutStockDetailBackFinish(@Param("list") List<OutStockoutDetailBack> outStockoutDetailBacks);
void deleteOutStockDetailList(@Param("list") List<OutStockoutDetailBack> outStockoutDetailBacks);
}

View File

@@ -0,0 +1,65 @@
package com.ruoyi.out.outStockoutDetailBack.service;
import java.util.List;
import com.ruoyi.out.outStockoutDetailBack.domain.OutStockoutDetailBack;
/**
* 历史出库单据子信息Service接口
*
* @author ruoyi
* @date 2026-02-02
*/
public interface IOutStockoutDetailBackService
{
/**
* 查询历史出库单据子信息
*
* @param stockoutDetailId 历史出库单据子信息主键
* @return 历史出库单据子信息
*/
public OutStockoutDetailBack selectOutStockoutDetailBackByStockoutDetailId(String stockoutDetailId);
/**
* 查询历史出库单据子信息列表
*
* @param outStockoutDetailBack 历史出库单据子信息
* @return 历史出库单据子信息集合
*/
public List<OutStockoutDetailBack> selectOutStockoutDetailBackList(OutStockoutDetailBack outStockoutDetailBack);
/**
* 新增历史出库单据子信息
*
* @param outStockoutDetailBack 历史出库单据子信息
* @return 结果
*/
public int insertOutStockoutDetailBack(OutStockoutDetailBack outStockoutDetailBack);
/**
* 修改历史出库单据子信息
*
* @param outStockoutDetailBack 历史出库单据子信息
* @return 结果
*/
public int updateOutStockoutDetailBack(OutStockoutDetailBack outStockoutDetailBack);
/**
* 批量删除历史出库单据子信息
*
* @param stockoutDetailIds 需要删除的历史出库单据子信息主键集合
* @return 结果
*/
public int deleteOutStockoutDetailBackByStockoutDetailIds(String[] stockoutDetailIds);
/**
* 删除历史出库单据子信息信息
*
* @param stockoutDetailId 历史出库单据子信息主键
* @return 结果
*/
public int deleteOutStockoutDetailBackByStockoutDetailId(String stockoutDetailId);
void insertOutStockDetailBackFinish(List<OutStockoutDetailBack> outStockoutDetailBacks);
void deleteOutStockDetailList(List<OutStockoutDetailBack> outStockoutDetailBacks);
}

View File

@@ -0,0 +1,103 @@
package com.ruoyi.out.outStockoutDetailBack.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.out.outStockoutDetailBack.mapper.OutStockoutDetailBackMapper;
import com.ruoyi.out.outStockoutDetailBack.domain.OutStockoutDetailBack;
import com.ruoyi.out.outStockoutDetailBack.service.IOutStockoutDetailBackService;
/**
* 历史出库单据子信息Service业务层处理
*
* @author ruoyi
* @date 2026-02-02
*/
@Service
public class OutStockoutDetailBackServiceImpl implements IOutStockoutDetailBackService
{
@Autowired
private OutStockoutDetailBackMapper outStockoutDetailBackMapper;
/**
* 查询历史出库单据子信息
*
* @param stockoutDetailId 历史出库单据子信息主键
* @return 历史出库单据子信息
*/
@Override
public OutStockoutDetailBack selectOutStockoutDetailBackByStockoutDetailId(String stockoutDetailId)
{
return outStockoutDetailBackMapper.selectOutStockoutDetailBackByStockoutDetailId(stockoutDetailId);
}
/**
* 查询历史出库单据子信息列表
*
* @param outStockoutDetailBack 历史出库单据子信息
* @return 历史出库单据子信息
*/
@Override
public List<OutStockoutDetailBack> selectOutStockoutDetailBackList(OutStockoutDetailBack outStockoutDetailBack)
{
return outStockoutDetailBackMapper.selectOutStockoutDetailBackList(outStockoutDetailBack);
}
/**
* 新增历史出库单据子信息
*
* @param outStockoutDetailBack 历史出库单据子信息
* @return 结果
*/
@Override
public int insertOutStockoutDetailBack(OutStockoutDetailBack outStockoutDetailBack)
{
return outStockoutDetailBackMapper.insertOutStockoutDetailBack(outStockoutDetailBack);
}
/**
* 修改历史出库单据子信息
*
* @param outStockoutDetailBack 历史出库单据子信息
* @return 结果
*/
@Override
public int updateOutStockoutDetailBack(OutStockoutDetailBack outStockoutDetailBack)
{
return outStockoutDetailBackMapper.updateOutStockoutDetailBack(outStockoutDetailBack);
}
/**
* 批量删除历史出库单据子信息
*
* @param stockoutDetailIds 需要删除的历史出库单据子信息主键
* @return 结果
*/
@Override
public int deleteOutStockoutDetailBackByStockoutDetailIds(String[] stockoutDetailIds)
{
return outStockoutDetailBackMapper.deleteOutStockoutDetailBackByStockoutDetailIds(stockoutDetailIds);
}
/**
* 删除历史出库单据子信息信息
*
* @param stockoutDetailId 历史出库单据子信息主键
* @return 结果
*/
@Override
public int deleteOutStockoutDetailBackByStockoutDetailId(String stockoutDetailId)
{
return outStockoutDetailBackMapper.deleteOutStockoutDetailBackByStockoutDetailId(stockoutDetailId);
}
@Override
public void insertOutStockDetailBackFinish(List<OutStockoutDetailBack> outStockoutDetailBacks) {
outStockoutDetailBackMapper.insertOutStockDetailBackFinish(outStockoutDetailBacks);
}
@Override
public void deleteOutStockDetailList(List<OutStockoutDetailBack> outStockoutDetailBacks) {
outStockoutDetailBackMapper.deleteOutStockDetailList(outStockoutDetailBacks);
}
}

View File

@@ -35,7 +35,7 @@ public class ViewProductAndStockController extends BaseController
private IViewProductAndStockService viewProductAndStockService;
/**
* 查询库存物资列表
// * 查询库存物资列表
*/
@PreAuthorize("@ss.hasPermi('productAndStock:productAndStock:list')")
@GetMapping("/list")

View File

@@ -2,26 +2,42 @@ package com.ruoyi.pda.controller;
import com.ruoyi.api.domain.RequestEnter;
import com.ruoyi.api.domain.WcsPort;
import com.ruoyi.bas.agvPoint.domain.AgvPoint;
import com.ruoyi.bas.agvPoint.domain.AgvTask;
import com.ruoyi.bas.agvPoint.service.impl.AgvPointServiceImpl;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.device.agv.domain.AgvContainerTask;
import com.ruoyi.device.agv.service.IAgvContainerTaskService;
import com.ruoyi.in.stockindetail.domain.InStockinDetail;
import com.ruoyi.in.stockindetail.service.IInStockinDetailService;
import com.ruoyi.job.mydojob.domain.MydoJob;
import com.ruoyi.job.mydojob.service.IMydoJobService;
import com.ruoyi.job.mydojobdetail.domain.MydoJobDetail;
import com.ruoyi.out.outStockout.domain.OutStockout;
import com.ruoyi.out.outStockout.service.impl.OutStockoutServiceImpl;
import com.ruoyi.out.outStockoutDetail.domain.OutStockoutDetail;
import com.ruoyi.out.outStockoutDetail.service.impl.OutStockoutDetailServiceImpl;
import com.ruoyi.pda.domain.TrayCodeMakeSure;
import com.ruoyi.pda.domain.TrayCodeMsg;
import com.ruoyi.pda.mapper.PdaMapper;
import com.ruoyi.pda.service.PdaService;
import com.ruoyi.stock.stock.domain.BasStock;
import com.ruoyi.stock.stock.service.IBasStockService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import java.util.HashMap;
import java.util.List;
import java.util.UUID;
@Controller
@RequestMapping("/pda")
@@ -32,6 +48,20 @@ public class PdaController extends BaseController {
private PdaService pdaService;
@Autowired
private IInStockinDetailService iInStockinDetailService;
@Autowired
private OutStockoutServiceImpl outStockoutService;
@Autowired
private OutStockoutDetailServiceImpl outStockoutDetailService;
@Autowired
private AgvPointServiceImpl agvPointService;
@Autowired
private IAgvContainerTaskService agvContainerTaskService;
@Autowired
private PdaMapper pdaMapper;
@Autowired
private IMydoJobService mydoJobService;
@Autowired
private IBasStockService basStockService;
/**
* 查询是否有半满托盘
@@ -46,9 +76,9 @@ public class PdaController extends BaseController {
/**
* 通过单据码查询物料详情
*/
@RequestMapping("/selectDetailById")
@RequestMapping("/selectDetailByIds")
@ResponseBody
public AjaxResult selectDetailById(String inStockinDetailId) {
public AjaxResult selectDetailByIds(String inStockinDetailId) {
InStockinDetail inStockinDetail = iInStockinDetailService.selectInStockinDetailByStockinDetailId(inStockinDetailId);
if (inStockinDetail != null) {
inStockinDetail.setQuantity(String.valueOf(Integer.valueOf(inStockinDetail.getQuantity()) - Integer.valueOf(inStockinDetail.getScanNum())));
@@ -67,6 +97,22 @@ public class PdaController extends BaseController {
}
/**
* 通过单据码查询物料详情 TODO 修改单据码为barCode 前端需同步修改
*/
@RequestMapping("/selectDetailById")
@ResponseBody
public AjaxResult selectDetailById(String barCode) {
List<InStockinDetail> stockinDetails = iInStockinDetailService.selectStockInByDetailByBarCode(barCode);
stockinDetails.stream().forEach(inStockinDetail -> {
Integer quantity = StringUtils.hasText(inStockinDetail.getQuantity()) ? Integer.valueOf(inStockinDetail.getQuantity()) : 0;
Integer scanNum = StringUtils.hasText(inStockinDetail.getScanNum()) ? Integer.valueOf(inStockinDetail.getScanNum()) : 0;
inStockinDetail.setQuantity(String.valueOf(quantity - scanNum));
});
return AjaxResult.success(stockinDetails);
}
/**
* 通过托盘码查询作业或trayMsg
*/
@@ -85,13 +131,20 @@ public class PdaController extends BaseController {
return pdaService.bindTray(trayCodeMakeSure);
}
@RequestMapping("/bindTray2")
@ResponseBody
public AjaxResult bindTray2(@RequestBody TrayCodeMakeSure trayCodeMakeSure) {
return pdaService.bindTray2(trayCodeMakeSure);
}
/**
* 空托盘入库
*/
@RequestMapping("/tpIn")
@ResponseBody
public AjaxResult tpIn(@RequestBody TrayCodeMsg trayCodeMsg) {
return pdaService.tpIn(trayCodeMsg.getTrayCode());
return pdaService.tpIn(trayCodeMsg);
}
/**
@@ -105,6 +158,7 @@ public class PdaController extends BaseController {
/**
* 出库确认查询子作业信息
*
* @param trayCodeMsg
* @return
*/
@@ -129,9 +183,6 @@ public class PdaController extends BaseController {
}
/**
* 入库扫码生成作业
*/
@@ -142,7 +193,6 @@ public class PdaController extends BaseController {
}
@RequestMapping("/selectDetailByPDTray")
@ResponseBody
public AjaxResult selectDetailByPDTray(@RequestBody TrayCodeMakeSure trayCodeMakeSure) {
@@ -150,9 +200,6 @@ public class PdaController extends BaseController {
}
/**
* 盘点出库确认
*
@@ -161,7 +208,7 @@ public class PdaController extends BaseController {
*/
@PreAuthorize("@ss.hasPermi('pda:check:checkMakeSure')")
@PostMapping("/checkMakeSure")
@Log(title = "手持机盘点出库确认", businessType = BusinessType.INSERT)
@Log(title = "手持机盘点出库确认", businessType = BusinessType.OTHER)
@ResponseBody
public AjaxResult checkMakeSure(@RequestBody TrayCodeMakeSure trayCodeMakeSure) {
return pdaService.checkMakeSure(trayCodeMakeSure);
@@ -179,6 +226,245 @@ public class PdaController extends BaseController {
return pdaService.updateWcsPort(wcsPort);
}
@RequestMapping("/hcoutMakesure")
@ResponseBody
@Log(title = "手持机缓存出库确认", businessType = BusinessType.OTHER)
public AjaxResult hcoutMakesure(String trayCode) {
return pdaService.hcoutMakesure(trayCode);
}
/**
* 平库入库
*/
@RequestMapping("/inStockPk")
@ResponseBody
public AjaxResult inStockPk(@RequestBody TrayCodeMakeSure trayCodeMakeSure) {
return pdaService.completeInPk(trayCodeMakeSure);
}
/**
* 库存查询(平库扫码查询托盘入库信息)
*/
@RequestMapping("/searchStock")
@ResponseBody
public AjaxResult searchStock(@RequestBody TrayCodeMakeSure trayCodeMakeSure) {
return pdaService.selectBasStockHc(trayCodeMakeSure.getTrayCode());
}
/**
* 立库出库信息校验
*
* @param trayCodeMakeSure
* @return
*/
@RequestMapping("/verifyMaterial")
@ResponseBody
public AjaxResult verifyMaterial(@RequestBody TrayCodeMakeSure trayCodeMakeSure) {
String trayCode = trayCodeMakeSure.getTrayCode();
List<MydoJobDetail> mydoJobDetailList = trayCodeMakeSure.getMydoJobDetailList();
for (MydoJobDetail m : mydoJobDetailList) {
Integer count = pdaService.selectByTrayCodeAndProduct(trayCode, m.getProductId());
if (count == 0) {
return AjaxResult.error(m.getProductId() + ",物料不是出库物料");
}
}
return AjaxResult.success();
}
/**
* 平库出库确认
*
* @param trayCodeMakeSure
* @return
*/
@RequestMapping("/completeOutPk")
@ResponseBody
@Async
@Transactional(rollbackFor = Exception.class)
public AjaxResult completeOutPk(@RequestBody TrayCodeMakeSure trayCodeMakeSure) {
try {
String trayCode = trayCodeMakeSure.getTrayCode();
List<MydoJobDetail> mydoJobDetailList = trayCodeMakeSure.getMydoJobDetailList();
for (MydoJobDetail m : mydoJobDetailList) {
HashMap<String, Object> map = new HashMap<>();
map.put("v_tray_code", trayCode);
map.put("v_out_stockout_detail_id", trayCodeMakeSure.getStockoutDetailId());
map.put("v_quantity", m.getOutQuantity());
map.put("v_stock_id", m.getStockId());
pdaService.completeOutPk(map);
Integer vResult = (Integer) map.get("v_result");
if (vResult != 10) {
System.err.println(map.get("v_result_msg").toString());
return AjaxResult.error(map.get("v_result_msg").toString());
}
}
return AjaxResult.success();
} catch (Exception e) {
throw new RuntimeException(e.getMessage());
}
}
/**
* 查询平库出库主单 建议参数(erpStockOutId U8单据号作为查询条件传到后台)
*
* @param outStockout
* @return
*/
@RequestMapping("/OutFillPk")
@ResponseBody
public AjaxResult OutFillPk() {
OutStockout outStockout = new OutStockout();
outStockout.setWarehouseId("2");
outStockoutService.selectOutStockoutList(outStockout);
return AjaxResult.success(outStockoutService.selectOutStockoutList(outStockout));
}
/**
* 查出平库出库子单 参数: stockoutId 作为参数传递到后台
*
* @param outStockout
* @return
*/
@RequestMapping("/OutFillPkDetail")
@ResponseBody
public AjaxResult OutFillPkDetail(@RequestBody OutStockout outStockout) {
List<OutStockout> outStockouts = outStockoutService.selectOutStockoutList(outStockout);
return AjaxResult.success(outStockoutDetailService.selectOutStockoutDetailByStockoutGuid(outStockouts.get(0).getStockoutGuid()));
}
/**
* 查询平库出库子单对应信息 在平库中是否存在
* 参数:trayCode 托盘码
* 参数:stockinDetailId 子单据号
*
* @param trayCodeMsg
* @return
*/
@RequestMapping("/queryBasStockHc")
@ResponseBody
public AjaxResult queryBasStockHc(@RequestBody TrayCodeMsg trayCodeMsg) {
return pdaService.selectBasStockHcs(trayCodeMsg.getTrayCode(), trayCodeMsg.getStockoutDetailId());
}
// 立库扫码规则校验
@RequestMapping("/validateMaterial")
@ResponseBody
public AjaxResult validateMaterial(@RequestBody TrayCodeMakeSure trayCodeMakeSure) {
HashMap<String, Object> map = new HashMap<>();
map.put("v_tray_code", trayCodeMakeSure.getTrayCode());
map.put("v_stockin_detail_id", trayCodeMakeSure.getInStockinDetailId());
map.put("v_is_bound_accord", trayCodeMakeSure.getIsBoundByAccord());
map.put("v_quantity", trayCodeMakeSure.getQuantity());
pdaMapper.bindTray(map);
if (!"10".equals(map.get("v_result").toString())) {
return AjaxResult.error(map.get("v_result").toString());
} else {
return AjaxResult.success(map.get("v_result").toString());
}
}
/**
* 平库出库信息校验
*
* @param trayCodeMakeSure TODO 要校验项目号,批号,以及其他条件,要复合查询,待修改
* @return
*/
@RequestMapping("/verifypkTrayMaterials")
@ResponseBody
public AjaxResult verifypkTrayMaterials(@RequestBody TrayCodeMakeSure trayCodeMakeSure) {
String trayCode = trayCodeMakeSure.getTrayCode();
List<MydoJobDetail> mydoJobDetailList = trayCodeMakeSure.getMydoJobDetailList();
for (MydoJobDetail m : mydoJobDetailList) {
String productId = m.getProductId();
Integer integer = pdaService.selectBasStockHcCount(trayCode, productId);
if (integer == 0) {
return AjaxResult.error(m.getProductId() + ",物料不是出库物料");
}
}
return AjaxResult.success();
}
// 查询AGV的起点和终点
@RequestMapping("/selectAgvPointByType")
@ResponseBody
public AjaxResult selectAgvPointByType(String type) {
AgvPoint agvPoint = new AgvPoint();
agvPoint.setType(type);
List<AgvPoint> agvPoints = agvPointService.selectAgvPointList(agvPoint);
return AjaxResult.success(agvPoints);
}
// 保存agv执行队列
@RequestMapping("/insertAgvJob")
@ResponseBody
public AjaxResult insertAgvJob(@RequestBody AgvTask agvTask) {
AgvPoint agvPoint = new AgvPoint();
agvPoint.setStation(agvTask.getEndPoint());
List<AgvPoint> agvPoints = agvPointService.selectAgvPointList(agvPoint);
if (!agvPoints.get(0).getStation().equals("K1-1") && !agvPoints.get(0).getStation().equals("K2-1") && agvPoints.get(0).getSpare1().equals("2")) {
return AjaxResult.error("该点位被占用,请检查!");
}
AgvContainerTask agvContainerTask = new AgvContainerTask();
agvContainerTask.setContainer(UUID.randomUUID().toString());
agvContainerTask.setEndPoint(agvTask.getEndPoint());
agvContainerTask.setStartPoint(agvTask.getStartPoint());
agvContainerTask.setSpare1(agvTask.getType());
agvContainerTask.setSpare2(agvTask.getTrayCode());
agvContainerTask.setStatus("0");
agvContainerTaskService.insertAgvContainerTask(agvContainerTask);
return AjaxResult.success();
}
// 保存agv执行队列
@GetMapping("/selectAgvPointByType")
@ResponseBody
public AjaxResult selectAgvPointByType(String type, String position) {
System.out.println(type + " " + position);
AgvPoint agvPoint = new AgvPoint();
// agvPoint.setType(type);
agvPoint.setStation(position);
List<AgvPoint> agvPoints = agvPointService.selectAgvPointList(agvPoint);
return AjaxResult.success(agvPoints);
}
// // 查询子单据的明细信息
// @RequestMapping("/selectDetailById")
// public AjaxResult selectDetailById(@RequestBody TrayCodeMakeSure trayCodeMakeSure) {
// String inStockinDetailId = trayCodeMakeSure.getInStockinDetailId();
// InStockinDetail inStockinDetail = iInStockinDetailService.selectInStockinDetailByStockinDetailId(inStockinDetailId);
// return AjaxResult.success(inStockinDetail);
//
// }
@RequestMapping("/selectByTrayCode")
public AjaxResult selectByTrayCode(@RequestBody TrayCodeMakeSure trayCodeMakeSure) {
MydoJob mydoJob = mydoJobService.selectMydoJobByTrayCode(trayCodeMakeSure.getTrayCode());
if (mydoJob != null && mydoJob.getInOrOut().equals("26")) {
BasStock basStock = basStockService.selectBasStockListTopOne(trayCodeMakeSure.getTrayCode());
return AjaxResult.success(basStock);
} else {
return AjaxResult.error("该托盘无盘任务");
}
}
}

View File

@@ -1,5 +1,6 @@
package com.ruoyi.pda.domain;
import com.ruoyi.job.mydojob.domain.PkDetail;
import com.ruoyi.job.mydojobdetail.domain.MydoJobDetail;
import lombok.AllArgsConstructor;
import lombok.Data;
@@ -22,10 +23,18 @@ public class TrayCodeMakeSure {
private String exitId;
private String isFull;
// 选中传1 没选中传0
private String isBoundByAccord;
//拣选详情列表
private List<MydoJobDetail> mydoJobDetailList;
//盘点详情列表
private List<MydoJobDetail> materials;
//异常详情列表
private List<MydoJobDetail> materialDetails;
private List<PkDetail> pkDetailList;
private String quantity;
private String stockinDetailId;
private String inStockinDetailId;
private String stockoutDetailId;
private String cargoSpaceId;
}

View File

@@ -1,5 +1,7 @@
package com.ruoyi.pda.domain;
import java.util.List;
public class TrayCodeMsg {
private String trayCode;
@@ -18,6 +20,26 @@ private String stockinDetailId;
private String inOut;
private String status;
private String stockoutDetailId;
public String getStockoutDetailId() {
return stockoutDetailId;
}
public void setStockoutDetailId(String stockoutDetailId) {
this.stockoutDetailId = stockoutDetailId;
}
private String trayType;
public String getTrayType() {
return trayType;
}
public void setTrayType(String trayType) {
this.trayType = trayType;
}
public String getStatus() {
return status;

View File

@@ -38,4 +38,18 @@ public interface PdaMapper {
void pkOut(HashMap<String, Object> map);
void outMakeSureException(HashMap<String, Object> map);
void hcoutMakesure(HashMap<String, Object> map);
Integer selectByTrayCodeAndProduct(String trayCode, String productId);
void completeOutPk(HashMap<String, Object> map);
void completeInPk(HashMap<String, Object> map);
void FillFinishAllot(HashMap<String, Object> map);
void FillFinishAllotOut(HashMap<String, Object> map);
void bindTrayCheck(HashMap<String, Object> map);
}

View File

@@ -8,6 +8,7 @@ import com.ruoyi.pda.domain.TrayCodeMakeSure;
import com.ruoyi.pda.domain.TrayCodeMsg;
import com.ruoyi.stock.stock.domain.BasStock;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
@@ -28,7 +29,7 @@ public interface PdaService {
AjaxResult bindTray(TrayCodeMakeSure trayCodeMakeSure);
AjaxResult tpIn(String trayCode);
AjaxResult tpIn(TrayCodeMsg trayCodeMsg);
AjaxResult tpOut(TrayCodeMsg trayCodeMsg);
@@ -56,4 +57,19 @@ public interface PdaService {
AjaxResult updateWcsPort(WcsPort wcsport);
AjaxResult hcoutMakesure(String trayCode);
AjaxResult completeInPk(TrayCodeMakeSure trayCodeMakeSure);
AjaxResult selectBasStockHc(String trayCode);
Integer selectByTrayCodeAndProduct(String trayCode, String productId);
void completeOutPk(HashMap<String, Object> map);
Integer selectBasStockHcCount(String trayCode, String productId);
AjaxResult selectBasStockHcs(String trayCode, String stockoutDetailId);
AjaxResult bindTray2(TrayCodeMakeSure trayCodeMakeSure);
}

View File

@@ -9,17 +9,20 @@ import com.ruoyi.api.service.IToWmsService;
import com.ruoyi.check.commit.domain.CheckCommitRecord;
import com.ruoyi.check.commit.service.ICheckCommitRecordService;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.MessageUtils;
import com.ruoyi.in.stockin.domain.InStockin;
import com.ruoyi.in.stockin.service.IInStockinService;
import com.ruoyi.in.stockindetail.domain.InStockinDetail;
import com.ruoyi.in.stockindetail.service.IInStockinDetailService;
import com.ruoyi.job.mydojob.domain.MydoJob;
import com.ruoyi.job.mydojob.domain.PkDetail;
import com.ruoyi.job.mydojob.mapper.MydoJobMapper;
import com.ruoyi.job.mydojob.service.IMydoJobService;
import com.ruoyi.job.mydojobdetail.domain.MydoJobDetail;
import com.ruoyi.job.mydojobdetail.service.IMydoJobDetailService;
import com.ruoyi.job.mydojobdetail.service.impl.MydoJobDetailServiceImpl;
import com.ruoyi.out.outStockoutDetail.domain.OutStockoutDetail;
import com.ruoyi.out.outStockoutDetail.service.impl.OutStockoutDetailServiceImpl;
import com.ruoyi.pda.domain.TrayCodeMakeSure;
import com.ruoyi.pda.domain.TrayCodeMsg;
import com.ruoyi.pda.mapper.PdaMapper;
@@ -34,6 +37,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.*;
import java.util.stream.Collectors;
@Service
@Slf4j
@@ -60,14 +64,21 @@ public class PdaServiceImp implements PdaService {
private BasStockMapper basStockMapper;
@Autowired
private IInStockinService inStockinService;
@Autowired
private OutStockoutDetailServiceImpl outStockoutDetailService;
@Autowired
private MydoJobMapper mapper;
@Override
public List<BasStock> selectHasHalfTray(String inStockinDetailId) {
InStockinDetail inStockinDetail = inStockinDetailService.selectInStockinDetailByStockinDetailId(inStockinDetailId);
InStockin inStockin = inStockinService.selectInStockinByStockinId(inStockinDetail.getStockinId());
inStockinDetail.setSpare4(inStockin.getDepartmentNo());
// InStockin inStockin = inStockinService.selectInStockinByStockinId(inStockinDetail.getStockinId());
// inStockinDetail.setSpare4(inStockinDetail.getSpare4());
List<BasStock> hasHalfTray = basStockMapper.selectHasHalfTray(inStockinDetail);
Integer count = mapper.selectBySpare4OrCargo(inStockinDetail);
if (count > 0) {
return null;
}
return hasHalfTray;
}
@@ -75,8 +86,8 @@ public class PdaServiceImp implements PdaService {
@Override
public AjaxResult halfTrayOut(TrayCodeMsg trayCodeMsg) {
InStockinDetail inStockinDetail = inStockinDetailService.selectInStockinDetailByStockinDetailId(trayCodeMsg.getStockinDetailId());
InStockin inStockin = inStockinService.selectInStockinByStockinId(inStockinDetail.getStockinId());
inStockinDetail.setSpare4(inStockin.getDepartmentNo());
// InStockin inStockin = inStockinService.selectInStockinByStockinId(inStockinDetail.getStockinId());
// inStockinDetail.setSpare4(inStockin.getDepartmentNo());
List<BasStock> hasHalfTray = basStockMapper.selectHasHalfTray(inStockinDetail);
HashMap<String, Object> map = new HashMap<>();
map.put("v_tray_code", hasHalfTray.get(0).getTrayCode());
@@ -112,36 +123,34 @@ public class PdaServiceImp implements PdaService {
@Transactional(rollbackFor = Exception.class)
public AjaxResult bindTray(TrayCodeMakeSure trayCodeMakeSure) {
StringBuilder errorbulider = new StringBuilder();
for (MydoJobDetail mydoJobDetail : trayCodeMakeSure.getMydoJobDetailList()) {
HashMap<String, Object> map = new HashMap<>();
map.put("v_tray_code", trayCodeMakeSure.getTrayCode());
map.put("v_stockin_detail_id", mydoJobDetail.getStockinDetailId());
map.put("v_is_bound_accord", trayCodeMakeSure.getIsBoundByAccord());
map.put("v_quantity", Integer.valueOf(mydoJobDetail.getInQuantity()));
pdaMapper.bindTray(map);
if (!"10".equals(map.get("v_result").toString())) {
errorbulider.append(mydoJobDetail.getStockinDetailId() + map.get("v_resultmsg").toString());
return AjaxResult.error(errorbulider.toString());
throw new RuntimeException(map.get("v_result").toString());
}
}
HashMap<String, Object> map = new HashMap<>();
map.put("v_tray_code", trayCodeMakeSure.getTrayCode());
map.put("v_is_full", trayCodeMakeSure.getIsFull());
pdaMapper.addInJob(map);
if (!"10".equals(map.get("v_result").toString())) {
return AjaxResult.error(errorbulider.toString());
throw new RuntimeException(map.get("v_result").toString());
}
return AjaxResult.success();
}
@Override
public AjaxResult tpIn(String trayCode) {
public AjaxResult tpIn(TrayCodeMsg trayCodeMsg) {
HashMap<String, Object> map = new HashMap<>();
map.put("v_tray_code", trayCode);
map.put("v_tray_code", trayCodeMsg.getTrayCode());
map.put("v_tray_type", trayCodeMsg.getTrayType());
map.put("v_quantity", Integer.valueOf(trayCodeMsg.getInQuantity()));
pdaMapper.tpIn(map);
if (!"10".equals(map.get("v_result").toString())) {
return AjaxResult.error(map.get("v_resultmsg").toString());
@@ -155,7 +164,7 @@ public class PdaServiceImp implements PdaService {
public AjaxResult tpOut(TrayCodeMsg trayCodeMsg) {
HashMap<String, Object> map = new HashMap<>();
map.put("v_exit_id", trayCodeMsg.getExitId());
map.put("v_tray_type", trayCodeMsg.getTrayType());
pdaMapper.tpOut(map);
if (!"10".equals(map.get("v_result").toString())) {
return AjaxResult.error(map.get("v_resultmsg").toString());
@@ -197,10 +206,12 @@ public class PdaServiceImp implements PdaService {
@Override
public AjaxResult selectDetailByPDTray(TrayCodeMakeSure trayCodeMakeSure) {
MydoJob mydoJob = new MydoJob();
mydoJob.setExitId(trayCodeMakeSure.getExitId());
// mydoJob.setExitId(trayCodeMakeSure.getExitId());
mydoJob.setStatus("3");
mydoJob.setInOrOut("26");
mydoJob.setInOrOut("28");
mydoJob.setTrayCode(trayCodeMakeSure.getTrayCode());
List<MydoJobDetail> mydoJobDetails = mydoJobDetailService.selectPdMydoJobDetailListByExit(mydoJob);
return AjaxResult.success(mydoJobDetails);
}
@@ -237,9 +248,9 @@ public class PdaServiceImp implements PdaService {
public AjaxResult checkMakeSure(TrayCodeMakeSure trayCodeMakeSure) {
MydoJob mydoJob = new MydoJob();
mydoJob.setExitId(trayCodeMakeSure.getExitId());
mydoJob.setTrayCode(trayCodeMakeSure.getTrayCode());
mydoJob.setStatus("3");
mydoJob.setInOrOut("26");
mydoJob.setInOrOut("28");
List<MydoJobDetail> mydoJobDetails = mydoJobDetailService.selectPdMydoJobDetailListByExit(mydoJob);
if (mydoJobDetails.isEmpty()) {
return AjaxResult.error("该物料没有盘点出库作业,请检查");
@@ -249,7 +260,7 @@ public class PdaServiceImp implements PdaService {
if (CollUtil.isNotEmpty(mydoJobDetailList)) {
boolean flag = mydoJobDetailList.stream().anyMatch(x -> StrUtil.isEmpty(x.getStockId()) && "0".equals(x.getInQuantity()));
if (flag) {
return AjaxResult.warn(MessageUtils.message("warn.message8"));
return AjaxResult.warn(MessageUtils.message("盘点数量不可为0"));
}
for (MydoJobDetail mydoJobDetail : mydoJobDetailList) {
//插入盘点提交表
@@ -287,4 +298,104 @@ public class PdaServiceImp implements PdaService {
AjaxResult ajaxResult = toWcsService.updateWcsPort(wcsport);
return ajaxResult;
}
@Override
public AjaxResult hcoutMakesure(String trayCode) {
HashMap<String, Object> map = new HashMap<>();
map.put("v_tray_code", trayCode);
pdaMapper.hcoutMakesure(map);
String result = map.get("v_result").toString();
if ("10".equals(result)) {
return AjaxResult.success();
} else {
return AjaxResult.error(map.get("v_resultmsg").toString());
}
}
@Override
@Transactional(rollbackFor = Exception.class)
public AjaxResult completeInPk(TrayCodeMakeSure trayCodeMakeSure) {
for (PkDetail pkDetail : trayCodeMakeSure.getPkDetailList()) {
HashMap<String, Object> map = new HashMap<>();
map.put("v_tray_code", trayCodeMakeSure.getTrayCode());
map.put("v_in_stockin_detail_id", pkDetail.getStockinDetailId());
map.put("v_quantity", pkDetail.getQuantity());
map.put("v_cargo_space_id", trayCodeMakeSure.getCargoSpaceId());
pdaMapper.completeInPk(map);
if (!"10".equals(String.valueOf(map.get("v_result")))) {
String errorMessage = Objects.toString(map.get("v_result_msg"), "平库入库失败");
throw new ServiceException(errorMessage);
}
}
return AjaxResult.success();
}
@Override
public AjaxResult selectBasStockHc(String trayCode) {
BasStock basStock = new BasStock();
basStock.setTrayCode(trayCode);
List<BasStock> stocks = basStockMapper.selectBasStockListHc(basStock);
if (stocks.size() > 0) {
return AjaxResult.success(stocks);
} else {
return AjaxResult.error("无库存信息");
}
}
@Override
public Integer selectByTrayCodeAndProduct(String trayCode, String productId) {
return pdaMapper.selectByTrayCodeAndProduct(trayCode, productId);
}
@Override
public void completeOutPk(HashMap<String, Object> map) {
pdaMapper.completeOutPk(map);
}
@Override
public Integer selectBasStockHcCount(String trayCode, String productId) {
BasStock basStock = new BasStock();
basStock.setTrayCode(trayCode);
basStock.setProductId(productId);
List<BasStock> basStocks = basStockMapper.selectBasStockHcCount(basStock);
return basStocks.size();
}
@Override
public AjaxResult selectBasStockHcs(String trayCode, String stockoutDetailId) {
OutStockoutDetail outStockoutDetail = outStockoutDetailService.selectOutStockoutDetailByStockoutDetailId(stockoutDetailId);
List<BasStock> stocks = basStockMapper.selectBasStockHcs(trayCode, outStockoutDetail);
if (stocks.size() > 0) {
return AjaxResult.success(stocks);
}
{
return AjaxResult.error("该托盘无对应库存,请检查!");
}
}
@Override
public AjaxResult bindTray2(TrayCodeMakeSure trayCodeMakeSure) {
String collect = trayCodeMakeSure.getMydoJobDetailList().stream().map(detail -> detail.getStockinDetailId() + ":" + detail.getInQuantity()).collect(Collectors.joining(","));
HashMap<String, Object> map = new HashMap<>();
map.put("v_tray_code", trayCodeMakeSure.getTrayCode());
map.put("v_string", collect);
map.put("v_is_bound_accord", trayCodeMakeSure.getIsBoundByAccord());
pdaMapper.bindTray(map);
if (!"10".equals(map.get("v_result").toString())) {
return AjaxResult.error(map.get("v_result").toString());
}
map.clear();
map.put("v_tray_code", trayCodeMakeSure.getTrayCode());
map.put("v_is_full", trayCodeMakeSure.getIsFull());
pdaMapper.addInJob(map);
if (!"10".equals(map.get("v_result").toString())) {
return AjaxResult.error(map.get("v_result").toString());
}
return AjaxResult.success();
}
}

View File

@@ -58,9 +58,10 @@ public class BasStockController extends BaseController
*/
@PreAuthorize("@ss.hasPermi('stock:management:query')")
@GetMapping(value = "/{stockId}")
public AjaxResult getInfo(@PathVariable("stockId") String stockId)
public AjaxResult getInfo(@PathVariable("stockId") String stockId, @RequestParam(value = "warehouseCode", required = false) String warehouseCode)
{
return success(basStockService.selectBasStockByStockId(stockId));
BasStock basStock = basStockService.selectBasStockByStockId2(stockId, warehouseCode);
return success(basStock);
}
/**
@@ -91,9 +92,10 @@ public class BasStockController extends BaseController
@PreAuthorize("@ss.hasPermi('stock:management:remove')")
@Log(title = "库存信息", businessType = BusinessType.DELETE)
@DeleteMapping("/{stockIds}")
public AjaxResult remove(@PathVariable String[] stockIds)
public AjaxResult remove(@PathVariable String[] stockIds,@RequestParam(value = "warehouseCode",required = false) String warehouseCode)
{
return toAjax(basStockService.deleteBasStockByStockIds(stockIds));
System.out.println(warehouseCode);
return toAjax(basStockService.deleteBasStockByStockIds2(stockIds,warehouseCode));
}
/**

View File

@@ -11,6 +11,7 @@ import lombok.ToString;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.springframework.ai.tool.annotation.ToolParam;
import org.springframework.data.annotation.Transient;
import java.util.List;
@@ -184,6 +185,8 @@ public class BasStock extends BaseEntity
/** 仓库 */
// @Excel(name = "${stock.BasStock.warehouseId}")
private String warehouseId;
@Transient
private String warehouseCode;
/** 垛型ID */

View File

@@ -1,6 +1,7 @@
package com.ruoyi.stock.stock.mapper;
import com.ruoyi.in.stockindetail.domain.InStockinDetail;
import com.ruoyi.out.outStockoutDetail.domain.OutStockoutDetail;
import com.ruoyi.stock.stock.domain.BasStock;
import org.apache.ibatis.annotations.Param;
@@ -73,4 +74,20 @@ public interface BasStockMapper
List<BasStock> getStockBySerial(String trayCode);
List<BasStock> selectHasHalfTray(InStockinDetail inStockinDetail);
List<BasStock> selectBasStockHcCount(BasStock basStock);
List<BasStock> selectBasStockListHc(BasStock basStock);
BasStock selectBasStockByStockId2(String stockId, String warehouseCode);
int updateBasStock2(BasStock basStock);
int deleteBasStockByStockIds2(@Param("stockIds") String[] stockIds, @Param("warehouseCode")String warehouseCode);
List<BasStock> selectBasStockList2(BasStock basStock);
List<BasStock> selectBasStockHcs(@Param("trayCode") String trayCode, @Param("out") OutStockoutDetail outStockoutDetail);
BasStock selectBasStockListTopOne(String trayCode);
}

View File

@@ -83,4 +83,10 @@ public interface IBasStockService
AjaxResult resetPdRecord();
List<BasStock> getStockBySerial(String serial);
BasStock selectBasStockByStockId2(String stockId, String warehouseCode);
int deleteBasStockByStockIds2(String[] stockIds,String warehouseCode);
BasStock selectBasStockListTopOne(String trayCode);
}

Some files were not shown because too many files have changed in this diff Show More