14 Commits

Author SHA1 Message Date
张怡蓉
eb26dc9a65 入库部分和接口 2026-03-23 09:52:06 +08:00
1009473166@qq.com
10fa4b3b15 2026.3.19 晚
缓存出库确认后台
2026-03-19 18:33:27 +08:00
1009473166@qq.com
f25bb2a549 Merge remote-tracking branch 'origin/main' 2026-03-19 15:44:02 +08:00
张怡蓉
d9da0de59e 入库部分和接口 2026-03-19 09:05:42 +08:00
1009473166@qq.com
e65b5933ad 2026.3.18 晚 2026-03-18 20:28:14 +08:00
liuhanqing
76517dc3a5 现场修改 2026-03-11 10:06:28 +08:00
liuhanqing
969949adf4 现场修改 2026-03-11 09:01:51 +08:00
liuhanqing
4384eb5b7a 现场调度修改 2026-03-11 08:55:44 +08:00
猫猫guowen
d652a29bba 库存平面图 2026-03-06 13:21:52 +08:00
liuhanqing
1ad5a15b6f 现场调度修改 2026-03-05 15:08:32 +08:00
张怡蓉
38f10b676d 入库部分和接口 2026-03-05 14:20:39 +08:00
张怡蓉
83db499c85 入库部分和接口 2026-03-02 11:41:34 +08:00
liuhanqing
a33998553e 现场调度修改 2026-02-26 09:55:15 +08:00
张怡蓉
88d4caa017 入库部分和接口 2026-02-24 10:17:20 +08:00
158 changed files with 3062 additions and 10073 deletions

479
AGENTS.md
View File

@@ -1,479 +0,0 @@
# 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

@@ -1,120 +0,0 @@
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

@@ -1,164 +0,0 @@
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

@@ -1,93 +0,0 @@
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

@@ -1,995 +0,0 @@
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

@@ -1,27 +0,0 @@
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

@@ -1,15 +0,0 @@
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

@@ -1,78 +0,0 @@
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

@@ -5,15 +5,12 @@ 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
*/
@@ -25,8 +22,6 @@ public class ToErpApiController {
private IToErpService toErpService;
@Autowired
private IRequestLogService requestLogService;
@Autowired
private PdaMapper pdaMapper;
/**
* 接收入出库通知单
@@ -36,7 +31,7 @@ public class ToErpApiController {
public AjaxResult receiveDeliveryNotice(@RequestBody DeliveryNoticeVo deliveryNoticeVo) {
AjaxResult ajaxResult = toErpService.receiveDeliveryNotice(deliveryNoticeVo);
requestLogService.insertRequestLog(requestLogService.getRequestLogERP(JSONUtil.toJsonStr(deliveryNoticeVo), "接收入出库通知单", ajaxResult));
requestLogService.insertRequestLog(requestLogService.getRequestLog(JSONUtil.toJsonStr(deliveryNoticeVo), "接收入出库通知单", ajaxResult));
return ajaxResult;
@@ -44,107 +39,32 @@ public class ToErpApiController {
/**
* 回传入库单
* 回传其他入库单
*/
@Scheduled(fixedDelay = 1500)
//@Scheduled(fixedDelay = 1500)
@RequestMapping("/callbackInDeliveryNotice")
@ResponseBody
public void callbackInDeliveryNoticeNew() {
toErpService.callbackInDeliveryNoticeNew();
public void callbackInDeliveryNotice() {
toErpService.callbackInDeliveryNotice();
}
/**
* 回传出库单(新)
* 回传其他出库单
*/
@Scheduled(fixedDelay = 1500)
// @Scheduled(fixedDelay = 1500)
@RequestMapping("/callbackOutDeliveryNotice")
@ResponseBody
public void callbackDeliveryOutNoticeNew() {
toErpService.callbackDeliveryOutNoticeNew();
public void callbackDeliveryOutNotice() {
toErpService.callbackoutDeliveryNotice();
}
// @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)
// @Scheduled(fixedDelay = 1500)
@RequestMapping("/moveCargoSpace")
@ResponseBody
public void moveCargoSpace() {
public void moveCargoSpace(){
toErpService.moveCargoSpace();
}
/**
* 自动确认入库单据
*/
@Scheduled(fixedDelay = 10000)
// @RequestMapping("/FillFinishAllot")
@ResponseBody
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,6 +1,5 @@
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;
@@ -12,10 +11,6 @@ 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;
@@ -24,7 +19,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import java.util.*;
import java.util.Map;
/**
* 作业统计 Controller
@@ -41,10 +36,6 @@ public class ToWmsApiController {
private IOutStockoutService outStockoutService;
@Autowired
private IBasProductService basProductService;
@Autowired
private MydoJobMapper mapper;
@Autowired
private IAgvContainerTaskService agvContainerTaskService;
/**
* 入库请求生成作业
@@ -52,50 +43,26 @@ public class ToWmsApiController {
@PostMapping("/requestEnterByTrayCode")
public AjaxResult requestEnterByTrayCode(@RequestBody RequestEnter requestEnter) {
AjaxResult ajaxResult = toWmsService.requestEnterByTrayCode(requestEnter);
RequestLog requestLog = requestLogService.getRequestLog(JSONUtil.toJsonStr(requestEnter), "入库任务创建请求", ajaxResult);
RequestLog requestLog = requestLogService.getRequestLog(JSONUtil.toJsonStr(requestEnter), "入库任务创建请求",ajaxResult);
requestLogService.insertRequestLog(requestLog);
return ajaxResult;
}
// 入库分货位
@PostMapping("/sendCargoSpace")
public AjaxResult sendCargoSpace(@RequestBody RequestEnter requestEnter) {
AjaxResult ajaxResult = toWmsService.requestEnterByTaskNo(requestEnter);
RequestLog requestLog = requestLogService.getRequestLog(JSONUtil.toJsonStr(requestEnter), "入库请求分配货位", ajaxResult);
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();
}
/**
* 请求补码作业
*/
@RequestMapping("/requestByNoTrayCode")
public AjaxResult requestByNoTrayCode(@RequestBody RequestEnter requestEnter) {
AjaxResult ajaxResult = toWmsService.selectMydoJobByEntranceId(requestEnter);
RequestLog requestLog = requestLogService.getRequestLog(JSONUtil.toJsonStr(requestEnter), "请求补码作业", ajaxResult);
RequestLog requestLog = requestLogService.getRequestLog(JSONUtil.toJsonStr(requestEnter), "请求补码作业",ajaxResult);
requestLogService.insertRequestLog(requestLog);
return ajaxResult;
}
@@ -106,7 +73,7 @@ public class ToWmsApiController {
@RequestMapping("/requestEnterByTrayCodeAndEntranceId")
public AjaxResult requestEnterByTrayCodeAndEntranceId(@RequestBody RequestEnter requestEnter) {
AjaxResult ajaxResult = toWmsService.requestEnterByTrayCodeAndEntranceId(requestEnter);
RequestLog requestLog = requestLogService.getRequestLog(JSONUtil.toJsonStr(requestEnter), "获取入库作业", ajaxResult);
RequestLog requestLog = requestLogService.getRequestLog(JSONUtil.toJsonStr(requestEnter), "获取入库作业",ajaxResult);
requestLogService.insertRequestLog(requestLog);
return ajaxResult;
}
@@ -115,17 +82,18 @@ public class ToWmsApiController {
/**
* 入库、出库 任务完成回传
* Map<String, String>
* "wmsType": "任务类型" 1-入库 2-出库 3-agv搬运,
* taskNo:出库 入库任务号
* trayCode:托盘码
* positionCode1:起点
* positionCode2:终点
* containerCode:容器编码
* "wmsType": "任务类型" 1-入库 2-出库 3-agv搬运,
* taskNo:出库 入库任务号
* trayCode:托盘码
* positionCode1:起点
* positionCode2:终点
* containerCode:容器编码
*
*/
@PostMapping("/jobFinish")
public AjaxResult jobFinish(@RequestBody WmsJobRequest wmsJobRequest) {
AjaxResult ajaxResult = toWmsService.jobFinish(wmsJobRequest);
RequestLog requestLog = requestLogService.getRequestLog(JSONUtil.toJsonStr(wmsJobRequest), "jobFinish", ajaxResult);
RequestLog requestLog = requestLogService.getRequestLog(JSONUtil.toJsonStr(wmsJobRequest), "jobFinish",ajaxResult);
requestLogService.insertRequestLog(requestLog);
return ajaxResult;
}
@@ -136,7 +104,7 @@ public class ToWmsApiController {
@PostMapping("/reAssign")
public AjaxResult reAssign(@RequestBody ReMaterialParam reMaterialParam) {
AjaxResult ajaxResult = toWmsService.reAssign(reMaterialParam);
RequestLog requestLog = requestLogService.getRequestLog(JSONUtil.toJsonStr(reMaterialParam), "reAssign", ajaxResult);
RequestLog requestLog = requestLogService.getRequestLog(JSONUtil.toJsonStr(reMaterialParam), "reAssign",ajaxResult);
requestLogService.insertRequestLog(requestLog);
return ajaxResult;
}
@@ -147,12 +115,13 @@ public class ToWmsApiController {
@PostMapping("/reMaterial")
public AjaxResult reMaterial(@RequestBody ReMaterialParam reMaterialParam) {
AjaxResult ajaxResult = toWmsService.reMaterial(reMaterialParam);
RequestLog requestLog = requestLogService.getRequestLog(JSONUtil.toJsonStr(reMaterialParam), "reMaterial", ajaxResult);
RequestLog requestLog = requestLogService.getRequestLog(JSONUtil.toJsonStr(reMaterialParam), "reMaterial",ajaxResult);
requestLogService.insertRequestLog(requestLog);
return ajaxResult;
}
/**
* 出库单据保存
*
@@ -176,7 +145,8 @@ 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);
@@ -188,7 +158,8 @@ 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);
@@ -200,76 +171,12 @@ 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

@@ -12,4 +12,5 @@ public class AgvMoveParam {
private String endPoint;
private String containerCode;
private String taskNo;
private String type;
}

View File

@@ -1,70 +0,0 @@
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

@@ -1,68 +0,0 @@
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

@@ -54,29 +54,5 @@ public class DeliveryNoticeItemVo {
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

@@ -53,13 +53,6 @@ public class DeliveryNoticeVo {
private String destination;
/** 领料车间 */
private String workshop;
private String companyShortName;
/** 账套号**/
private String accountSetNo;
/** 子表明细列表 */
private List<DeliveryNoticeItemVo> detailList;
}

View File

@@ -21,7 +21,4 @@ public class RequestEnter {
private String flag;
private String taskNo;
private String deviceCode;
private String code;
private String errorCode;
}

View File

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

View File

@@ -20,10 +20,4 @@ public interface IToErpService {
void moveCargoSpace();
AjaxResult createWorkshopInboundOrder(BasProduct basProduct);
void callbackInDeliveryNoticeNew();
void callbackDeliveryOutNoticeNew();
void callbackDeliveryOutNoticeNews();
}

View File

@@ -45,4 +45,6 @@ public interface IToWcsService {
AjaxResult updateWcsPort(WcsPort wcsPort);
AjaxResult insertAgvMoveJob(AgvMoveParam agvMoveParam);
}

View File

@@ -1,10 +1,7 @@
package com.ruoyi.api.service.impl;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONUtil;
import com.ruoyi.api.controller.BatchNoGenerator;
import com.ruoyi.api.domain.*;
import com.ruoyi.api.moveMsg.domain.MoveMsg;
import com.ruoyi.api.moveMsg.service.IMoveMsgService;
@@ -58,8 +55,6 @@ import java.math.BigDecimal;
import java.util.Map;
import java.util.stream.Collectors;
import static com.ruoyi.framework.datasource.DynamicDataSourceContextHolder.log;
/**
* 作业统计 Service 实现
*/
@@ -72,8 +67,7 @@ public class ToErpServiceImpl implements IToErpService {
private IMydoJobService mydoJobService;
@Autowired
private IMydoJobDetailService mydoJobDetailService;
@Autowired
private IBasJobIdService iBasJobIdService;
@Autowired
private IBasJobIdService basJobIdService;
@@ -122,270 +116,27 @@ public class ToErpServiceImpl implements IToErpService {
* @param deliveryNoticeVo 送货通知单数据对象,包含单据基本信息和明细列表
* @return AjaxResult 操作结果,包含成功或错误信息
*/
// @Override
// @Transactional(rollbackFor = Exception.class)
// public AjaxResult receiveDeliveryNotice(DeliveryNoticeVo deliveryNoticeVo) {
//
// if (deliveryNoticeVo == null || deliveryNoticeVo.getDetailList() == null || deliveryNoticeVo.getDetailList().isEmpty()) {
// return AjaxResult.error("单据或明细不能为空");
// }
// String billType = deliveryNoticeVo.getBillType();
// String opType = deliveryNoticeVo.getOpType();
//// String status = deliveryNoticeVo.getStatus();
// int type = 0;
// try {
// type = Integer.parseInt(billType);
// } catch (Exception ignored) {
// }
//
// // 处理入库单相关操作(单据类型1-4)
// if (type >= 1 && type <= 4) {
// InStockin param = new InStockin();
// param.setErpBill(deliveryNoticeVo.getBillNo());
// List<InStockin> existList = inStockinService.selectInStockinListApi(param);
// InStockin exist = (existList != null && !existList.isEmpty()) ? existList.get(0) : null;
//
// // 删除操作(操作类型3)
// if ("3".equals(opType)) {
// if (exist == null) {
// return AjaxResult.error("单据不存在");
// }
// if ("3".equals(exist.getStatus())) {
// return AjaxResult.error("单据已执行,禁止删除");
// }
// if (exist.getStockinGuid() != null) {
// inStockinDetailService.deleteInStockinDetailByStockinGuid(exist.getStockinGuid());
// inStockinService.deleteInStockinByStockinGuid(exist.getStockinGuid());
// }
//
// return AjaxResult.success();
// }
//
// // 新增或修改操作(操作类型1或2)
// if ("2".equals(opType) || "1".equals(opType)) {
// if ("2".equals(opType) && exist == null) {
// return AjaxResult.error("单据不存在,无法修改");
// }
// if ("1".equals(opType) && exist != null) {
// return AjaxResult.error("单据已存在,请勿重复添加");
// }
// if (exist != null && "3".equals(exist.getStatus()) && "2".equals(opType)) {
// return AjaxResult.error("单据已执行,禁止修改");
// }
// InStockin inStockin = exist != null ? exist : new InStockin();
// if (exist == null) {
// inStockin.setStockinGuid(UUID.randomUUID().toString());
// }
// String rkdId = iBasJobIdService.getJobId("RKD");
//
// inStockin.setStockinId(rkdId);
// inStockin.setInType(deliveryNoticeVo.getBillType());
// inStockin.setCreateDate(deliveryNoticeVo.getBillDate());
// inStockin.setCreateManId(deliveryNoticeVo.getCreateMan());
// inStockin.setStatus("2");
// inStockin.setWarehouseId(deliveryNoticeVo.getWarehouseId());
// inStockin.setErpBill(deliveryNoticeVo.getBillNo());
// inStockin.setStockSource("1");
// inStockin.setDepartmentNo(deliveryNoticeVo.getProjectNo());//项目号
// inStockin.setSupplierNo(deliveryNoticeVo.getCustomerId());//供应商编码
// inStockin.setClassNo(deliveryNoticeVo.getCustomerName());//供应商名称
// inStockin.setSpare1(deliveryNoticeVo.getContractNo());//合同号
// inStockin.setSpare2(deliveryNoticeVo.getSalesOrderNo());//销售订单号
// inStockin.setSpare3(deliveryNoticeVo.getApproveDate());//审核时间
// inStockin.setSpare4(deliveryNoticeVo.getApproveMan());//审核人
// inStockin.setSpare5(deliveryNoticeVo.getRemark());
// inStockin.setCompanyShortName(deliveryNoticeVo.getCompanyShortName());
// inStockin.setAccountSetNo(deliveryNoticeVo.getAccountSetNo());
// if (exist == null) {
// inStockinService.insertInStockin(inStockin);
// } else {
// inStockinService.updateInStockin(inStockin);
// inStockinDetailService.deleteInStockinDetailByStockinGuid(inStockin.getStockinGuid());
// }
// List<DeliveryNoticeItemVo> items = deliveryNoticeVo.getDetailList();
//
// int a = 0;
// for (DeliveryNoticeItemVo item : items) {
// a += 1;
// InStockinDetail detail = new InStockinDetail();
// detail.setStockinGuid(inStockin.getStockinGuid());
// detail.setStockinDetailId(item.getBarCode());
// detail.setStockinId(inStockin.getStockinId());
// detail.setProductId(item.getInventoryCode());
// detail.setProductName(item.getInventoryName());
// detail.setSpec(item.getSpecModel());
// detail.setUnit(item.getUnit());
// detail.setQuantity(item.getQuantity());
// if (item.getIsBatchManage().equals("1") && (item.getLotNo().equals("") || item.getLotNo() == null)) {
// // 获取流水号
// detail.setLotNo(BatchNoGenerator.generateBatchNo());
// } else {
// detail.setLotNo(item.getLotNo());
// }
// detail.setSpare1(item.getLevelRelation());
// detail.setSpare2(item.getUpperMaterial());
// detail.setSpare3(item.getTopMaterial());
// detail.setSpare4(item.getProjectNo());
// detail.setSpare6(item.getLineNo());
// detail.setRemark(item.getRemark());
// detail.setAssignNum("0");
// detail.setScanNum("0");
// detail.setSourceLineId(item.getSourceLineId());
// detail.setBarCode(item.getBarCode());
// detail.setIsBatchManage(item.getIsBatchManage());
// detail.setOldProjectNo(item.getOldProjectNo());
// detail.setCargoNo(item.getGroupNum());
// inStockinDetailService.insertInStockinDetail(detail);
//
// }
//
// return AjaxResult.success();
// }
// }
// // 处理出库单相关操作(单据类型5-7)
// else if (type >= 5 && type <= 7) {
// OutStockout param = new OutStockout();
// param.setErpStockoutId(deliveryNoticeVo.getBillNo());
// List<OutStockout> outList = outStockoutService.selectOutStockoutList(param);
// OutStockout exist = (outList != null && !outList.isEmpty()) ? outList.get(0) : null;
//
// // 删除操作(操作类型3)
// if ("3".equals(opType)) {
// if (exist == null) {
// return AjaxResult.error("单据不存在");
// }
// if ("3".equals(exist.getStatus())) {
// return AjaxResult.error("单据已执行,禁止删除");
// }
// OutStockoutDetail outStockoutDetail = new OutStockoutDetail();
// outStockoutDetail.setStockoutId(deliveryNoticeVo.getBillNo());
// List<OutStockoutDetail> details = outStockoutDetailService.selectOutStockoutDetailList(outStockoutDetail);
// if (details != null && !details.isEmpty()) {
// String[] ids = details.stream().map(OutStockoutDetail::getStockoutDetailId).toArray(String[]::new);
// outStockoutDetailService.deleteOutStockoutDetailByStockoutDetailIds(ids);
// }
// outStockoutService.deleteOutStockoutByStockoutGuid(exist.getStockoutGuid());
// return AjaxResult.success();
// }
//
// // 新增或修改操作(操作类型1或2)
// if ("2".equals(opType) || "1".equals(opType)) {
// if ("2".equals(opType) && exist == null) {
// return AjaxResult.error("单据不存在,无法修改");
// }
// if ("1".equals(opType) && exist != null) {
// return AjaxResult.error("单据已存在,请勿重复添加");
// }
// if (exist != null && "3".equals(exist.getStatus()) && "2".equals(opType)) {
// return AjaxResult.error("单据已执行,禁止修改");
// }
// OutStockout out = exist != null ? exist : new OutStockout();
//
// if (exist == null) {
// out.setStockoutGuid(UUID.randomUUID().toString());
// }
// String ckdId = iBasJobIdService.getJobId("CKD");
// out.setStockoutId(ckdId);
// out.setOutType(deliveryNoticeVo.getBillType());
// out.setCreateDate(deliveryNoticeVo.getBillDate());
// out.setErpStockoutId(deliveryNoticeVo.getBillNo());
// out.setCreateManId(deliveryNoticeVo.getCreateMan());
// out.setStatus("2");
// out.setWarehouseId(deliveryNoticeVo.getWarehouseId());
// out.setStockoutSource("1");
//// out.setSpare6(deliveryNoticeVo.getOutType());
// out.setSpare6("1");
// out.setCarNumber(deliveryNoticeVo.getIsProjectOut());
// out.setDepartmentNo(deliveryNoticeVo.getProjectNo());
// out.setCustomerNo(deliveryNoticeVo.getCustomerId());
// out.setClassNowId(deliveryNoticeVo.getCustomerName());
// out.setSpare1(deliveryNoticeVo.getContractNo());//合同号
// out.setSpare2(deliveryNoticeVo.getSalesOrderNo());//销售订单号
// out.setSpare3(deliveryNoticeVo.getApproveDate());//审核时间
// out.setSpare4(deliveryNoticeVo.getApproveMan());//审核人
// out.setSpare5(deliveryNoticeVo.getRemark());
// out.setSpare7(deliveryNoticeVo.getDestination());
// //手动设置出库类型为2 这样会赋值 in_or_out 21
// out.setSpare8("2");
// out.setCompanyShortName(deliveryNoticeVo.getCompanyShortName());
// out.setAccountSetNo(deliveryNoticeVo.getAccountSetNo());
//
// if (exist == null) {
// outStockoutService.insertOutStockout(out);
// } else {
// outStockoutService.updateOutStockout(out);
// OutStockoutDetail q2 = new OutStockoutDetail();
// q2.setStockoutId(deliveryNoticeVo.getBillNo());
// List<OutStockoutDetail> oldDetails = outStockoutDetailService.selectOutStockoutDetailList(q2);
// if (oldDetails != null && !oldDetails.isEmpty()) {
// String[] ids = oldDetails.stream().map(OutStockoutDetail::getStockoutDetailId).toArray(String[]::new);
// outStockoutDetailService.deleteOutStockoutDetailByStockoutDetailIds(ids);
// }
// }
// int i = 0;
// for (DeliveryNoticeItemVo item : deliveryNoticeVo.getDetailList()) {
// OutStockoutDetail d = new OutStockoutDetail();
// i += 1;
// d.setStockoutDetailId(out.getStockoutId() + "-" + i);
// d.setStockoutGuid(out.getStockoutGuid());
// d.setStockoutId(out.getStockoutId());
// d.setProductId(item.getInventoryCode());
// d.setProductName(item.getInventoryName());
// d.setLotNo(item.getLotNo());
// d.setSpec(item.getSpecModel());
// d.setUnit(item.getUnit());
// d.setSpare1(item.getLevelRelation());
// d.setSpare2(item.getUpperMaterial());
// d.setSpare3(item.getTopMaterial());
// d.setSpare4(item.getProjectNo());
// d.setSpare6(item.getLineNo());
// d.setRemark(item.getRemark());
// d.setSourceLineId(item.getSourceLineId());
// d.setCargoNo(item.getGroupNum());
// d.setBarCode(item.getBarCode());
// d.setIsBatchManage(item.getIsBatchManage());
// d.setOldProjectNo(item.getOldProjectNo());
// //d.setSpare8(deliveryNoticeVo.getDestination());
//
//
// try {
// d.setQuantity(new BigDecimal(item.getQuantity()));
// d.setAllotQuantity(BigDecimal.ZERO);
// d.setAssignNum(BigDecimal.ZERO);
// } catch (Exception e) {
// d.setQuantity(BigDecimal.ZERO);
// }
// outStockoutDetailService.insertOutStockoutDetail(d);
//
// }
// return AjaxResult.success();
// }
// }
// return AjaxResult.error("不支持的单据类型或操作类型");
//
// }
@Override
@Transactional(rollbackFor = Exception.class)
public AjaxResult receiveDeliveryNotice(DeliveryNoticeVo deliveryNoticeVo) {
if (deliveryNoticeVo == null || deliveryNoticeVo.getDetailList() == null || deliveryNoticeVo.getDetailList().isEmpty()) {
return AjaxResult.error("单据或明细不能为空");
}
String billType = deliveryNoticeVo.getBillType();
String opType = deliveryNoticeVo.getOpType();
// String status = deliveryNoticeVo.getStatus();
int type = 0;
try {
type = Integer.parseInt(billType);
} catch (Exception ignored) {
}
// ===================== 入库单 1-4 逻辑完全不变 =====================
if ((type >= 1 && type <= 4) || (type >= 10 && type <= 14)) {
// 处理入库单相关操作(单据类型1-4)
if (type >= 1 && type <= 4) {
InStockin param = new InStockin();
param.setErpBill(deliveryNoticeVo.getBillNo());
param.setAccountSetNo(deliveryNoticeVo.getAccountSetNo());
param.setInType(String.valueOf(type));
List<InStockin> existList = inStockinService.selectInStockinListBill(param);
// List<InStockin> existList = inStockinService.selectInStockinListApi(param);
param.setStockinId(deliveryNoticeVo.getBillNo());
List<InStockin> existList = inStockinService.selectInStockinListApi(param);
InStockin exist = (existList != null && !existList.isEmpty()) ? existList.get(0) : null;
// 删除操作(操作类型3)
@@ -400,6 +151,7 @@ public class ToErpServiceImpl implements IToErpService {
inStockinDetailService.deleteInStockinDetailByStockinGuid(exist.getStockinGuid());
inStockinService.deleteInStockinByStockinGuid(exist.getStockinGuid());
}
return AjaxResult.success();
}
@@ -418,27 +170,22 @@ public class ToErpServiceImpl implements IToErpService {
if (exist == null) {
inStockin.setStockinGuid(UUID.randomUUID().toString());
}
String rkdId = iBasJobIdService.getJobId("RKD");
inStockin.setStockinId(rkdId);
inStockin.setStockinId(deliveryNoticeVo.getBillNo());
inStockin.setInType(deliveryNoticeVo.getBillType());
inStockin.setCreateDate(deliveryNoticeVo.getBillDate());
inStockin.setCreateManId(deliveryNoticeVo.getCreateMan());
inStockin.setStatus("2");
inStockin.setStatus("1");
inStockin.setWarehouseId(deliveryNoticeVo.getWarehouseId());
inStockin.setErpBill(deliveryNoticeVo.getBillNo());
// inStockin.setErpBill(deliveryNoticeVo.getBillNo());
inStockin.setStockSource("1");
inStockin.setDepartmentNo(deliveryNoticeVo.getProjectNo());
inStockin.setSupplierNo(deliveryNoticeVo.getCustomerId());
inStockin.setClassNo(deliveryNoticeVo.getCustomerName());
inStockin.setSpare1(deliveryNoticeVo.getContractNo());
inStockin.setSpare2(deliveryNoticeVo.getSalesOrderNo());
inStockin.setSpare3(deliveryNoticeVo.getApproveDate());
inStockin.setSpare4(deliveryNoticeVo.getApproveMan());
inStockin.setDepartmentNo(deliveryNoticeVo.getProjectNo());//项目号
inStockin.setSupplierNo(deliveryNoticeVo.getCustomerId());//供应商编码
inStockin.setClassNo(deliveryNoticeVo.getCustomerName());//供应商名称
inStockin.setSpare1(deliveryNoticeVo.getContractNo());//合同号
inStockin.setSpare2(deliveryNoticeVo.getSalesOrderNo());//销售订单号
inStockin.setSpare3(deliveryNoticeVo.getApproveDate());//审核时间
inStockin.setSpare4(deliveryNoticeVo.getApproveMan());//审核人
inStockin.setSpare5(deliveryNoticeVo.getRemark());
inStockin.setCompanyShortName(deliveryNoticeVo.getCompanyShortName());
inStockin.setAccountSetNo(deliveryNoticeVo.getAccountSetNo());
if (exist == null) {
inStockinService.insertInStockin(inStockin);
} else {
@@ -446,53 +193,41 @@ public class ToErpServiceImpl implements IToErpService {
inStockinDetailService.deleteInStockinDetailByStockinGuid(inStockin.getStockinGuid());
}
List<DeliveryNoticeItemVo> items = deliveryNoticeVo.getDetailList();
int a = 0;
for (DeliveryNoticeItemVo item : items) {
a += 1;
InStockinDetail detail = new InStockinDetail();
detail.setStockinGuid(inStockin.getStockinGuid());
detail.setStockinDetailId(inStockin.getStockinId() + '-' + a);
detail.setStockinDetailId(item.getLineNo());
detail.setStockinId(inStockin.getStockinId());
detail.setProductId(item.getInventoryCode());
detail.setProductName(item.getInventoryName());
detail.setSpec(item.getSpecModel());
detail.setUnit(item.getUnit());
detail.setQuantity(item.getQuantity());
if (item.getIsBatchManage().equals("1") && (item.getLotNo().equals("") || item.getLotNo() == null)) {
detail.setLotNo(BatchNoGenerator.generateBatchNo());
} else {
detail.setLotNo(item.getLotNo());
}
detail.setLotNo(item.getLotNo());
detail.setSpare1(item.getLevelRelation());
detail.setSpare2(item.getUpperMaterial());
detail.setSpare3(item.getTopMaterial());
detail.setSpare4(item.getProjectNo());
detail.setSpare6(item.getLineNo());
detail.setRemark(item.getRemark());
detail.setAssignNum("0");
detail.setScanNum("0");
detail.setSourceLineId(item.getSourceLineId());
detail.setBarCode(item.getBarCode());
detail.setIsBatchManage(item.getIsBatchManage());
detail.setOldProjectNo(item.getOldProjectNo());
detail.setCargoNo(item.getGroupNum());
inStockinDetailService.insertInStockinDetail(detail);
}
return AjaxResult.success();
}
}
// ===================== 出库单 5-7 改造:按立库/平库分两组各1主单多明细 =====================
else if ((type >= 5 && type <= 7) || (type >= 15 && type <= 20)) {
// 处理出库单相关操作(单据类型5-7)
else if (type >= 5 && type <= 7) {
OutStockout param = new OutStockout();
param.setErpStockoutId(deliveryNoticeVo.getBillNo());
param.setAccountSetNo(deliveryNoticeVo.getAccountSetNo());
param.setOutType(String.valueOf(type));
param.setStockoutId(deliveryNoticeVo.getBillNo());
List<OutStockout> outList = outStockoutService.selectOutStockoutList(param);
OutStockout exist = (outList != null && !outList.isEmpty()) ? outList.get(0) : null;
String billNo = deliveryNoticeVo.getBillNo();
// 删除操作 不变
// 删除操作(操作类型3)
if ("3".equals(opType)) {
if (exist == null) {
return AjaxResult.error("单据不存在");
@@ -501,7 +236,7 @@ public class ToErpServiceImpl implements IToErpService {
return AjaxResult.error("单据已执行,禁止删除");
}
OutStockoutDetail outStockoutDetail = new OutStockoutDetail();
outStockoutDetail.setStockoutId(billNo);
outStockoutDetail.setStockoutId(deliveryNoticeVo.getBillNo());
List<OutStockoutDetail> details = outStockoutDetailService.selectOutStockoutDetailList(outStockoutDetail);
if (details != null && !details.isEmpty()) {
String[] ids = details.stream().map(OutStockoutDetail::getStockoutDetailId).toArray(String[]::new);
@@ -511,7 +246,7 @@ public class ToErpServiceImpl implements IToErpService {
return AjaxResult.success();
}
// 新增/修改
// 新增或修改操作(操作类型1或2)
if ("2".equals(opType) || "1".equals(opType)) {
if ("2".equals(opType) && exist == null) {
return AjaxResult.error("单据不存在,无法修改");
@@ -522,151 +257,81 @@ public class ToErpServiceImpl implements IToErpService {
if (exist != null && "3".equals(exist.getStatus()) && "2".equals(opType)) {
return AjaxResult.error("单据已执行,禁止修改");
}
List<DeliveryNoticeItemVo> allDetail = deliveryNoticeVo.getDetailList();
// 1. 按 stg_location 分组
List<DeliveryNoticeItemVo> liKuList = new ArrayList<>();
List<DeliveryNoticeItemVo> pingKuList = new ArrayList<>();
for (DeliveryNoticeItemVo item : allDetail) {
String loc = item.getStg_location();
if ("2".equals(loc)) {
pingKuList.add(item);
} else {
// 1 或空 都归立库
liKuList.add(item);
}
}
// ========== 处理立库:原有主单 + 所有立库明细 ==========
OutStockout mainOut = exist != null ? exist : new OutStockout();
if (exist == null) {
mainOut.setStockoutGuid(UUID.randomUUID().toString());
}
if (liKuList.size() > 0) {
String ckdId = iBasJobIdService.getJobId("CKD");
fillOutStockout(mainOut, deliveryNoticeVo, ckdId);
}
OutStockout out = exist != null ? exist : new OutStockout();
if (exist == null) {
String ckdId = iBasJobIdService.getJobId("CKD");
fillOutStockout(mainOut, deliveryNoticeVo, ckdId);
outStockoutService.insertOutStockout(mainOut);
out.setStockoutGuid(UUID.randomUUID().toString());
}
out.setStockoutId(deliveryNoticeVo.getBillNo());
out.setOutType(deliveryNoticeVo.getBillType());
out.setCreateDate(deliveryNoticeVo.getBillDate());
out.setCreateManId(deliveryNoticeVo.getCreateMan());
out.setStatus("1");
out.setWarehouseId(deliveryNoticeVo.getWarehouseId());
out.setStockoutSource("1");
out.setSpare6(deliveryNoticeVo.getOutType());
out.setCarNumber(deliveryNoticeVo.getIsProjectOut());
out.setDepartmentNo(deliveryNoticeVo.getProjectNo());
out.setCustomerNo(deliveryNoticeVo.getCustomerId());
out.setClassNowId(deliveryNoticeVo.getCustomerName());
out.setSpare1(deliveryNoticeVo.getContractNo());//合同号
out.setSpare2(deliveryNoticeVo.getSalesOrderNo());//销售订单号
out.setSpare3(deliveryNoticeVo.getApproveDate());//审核时间
out.setSpare4(deliveryNoticeVo.getApproveMan());//审核人
out.setSpare5(deliveryNoticeVo.getRemark());
out.setSpare7(deliveryNoticeVo.getDestination());
if (exist == null) {
outStockoutService.insertOutStockout(out);
} else {
outStockoutService.updateOutStockouts(mainOut);
// 修改先删旧明细
outStockoutService.updateOutStockout(out);
OutStockoutDetail q2 = new OutStockoutDetail();
q2.setStockoutId(billNo);
q2.setStockoutId(deliveryNoticeVo.getBillNo());
List<OutStockoutDetail> oldDetails = outStockoutDetailService.selectOutStockoutDetailList(q2);
if (oldDetails != null && !oldDetails.isEmpty()) {
String[] ids = oldDetails.stream()
.map(OutStockoutDetail::getStockoutDetailId)
.toArray(String[]::new);
String[] ids = oldDetails.stream().map(OutStockoutDetail::getStockoutDetailId).toArray(String[]::new);
outStockoutDetailService.deleteOutStockoutDetailByStockoutDetailIds(ids);
}
}
if (liKuList.size() > 0) {
// 保存所有立库明细到主单
saveOutDetailList(mainOut, liKuList, "1");
}
for (DeliveryNoticeItemVo item : deliveryNoticeVo.getDetailList()) {
OutStockoutDetail d = new OutStockoutDetail();
d.setStockoutDetailId(item.getLineNo());
d.setStockoutGuid(out.getStockoutGuid());
d.setStockoutId(out.getStockoutId());
d.setProductId(item.getInventoryCode());
d.setProductName(item.getInventoryName());
d.setLotNo(item.getLotNo());
d.setSpec(item.getSpecModel());
d.setUnit(item.getUnit());
d.setSpare1(item.getLevelRelation());
d.setSpare2(item.getUpperMaterial());
d.setSpare3(item.getTopMaterial());
d.setSpare4(deliveryNoticeVo.getProjectNo());
// d.setSpare6(item.getLineNo());
d.setRemark(item.getRemark());
//d.setSpare8(deliveryNoticeVo.getDestination());
// ========== 处理平库:新建一张独立主单 + 所有平库明细 ==========
if (CollUtil.isNotEmpty(pingKuList)) {
OutStockout pingKuOut = new OutStockout();
pingKuOut.setStockoutGuid(UUID.randomUUID().toString());
if (pingKuList.size() > 0) {
String pingCkdId = iBasJobIdService.getJobId("CKD");
fillOutStockout(pingKuOut, deliveryNoticeVo, pingCkdId);
// 插入平库主单
outStockoutService.insertOutStockout(pingKuOut);
log.info("平库分组生成独立出库单:{},明细条数:{}", pingCkdId, pingKuList.size());
// 平库所有明细挂到这个新主单
saveOutDetailList(pingKuOut, pingKuList, "2");
try {
d.setQuantity(new BigDecimal(item.getQuantity()));
d.setAllotQuantity(BigDecimal.ZERO);
d.setAssignNum(BigDecimal.ZERO);
} catch (Exception e) {
d.setQuantity(BigDecimal.ZERO);
}
outStockoutDetailService.insertOutStockoutDetail(d);
}
return AjaxResult.success();
}
}
return AjaxResult.error("不支持的单据类型或操作类型");
}
/**
* 填充出库单主表公共字段
*/
private void fillOutStockout(OutStockout out, DeliveryNoticeVo vo, String ckdId) {
out.setStockoutId(ckdId);
out.setOutType(vo.getBillType());
out.setCreateDate(vo.getBillDate());
out.setErpStockoutId(vo.getBillNo());
out.setCreateManId(vo.getCreateMan());
out.setStatus("2");
out.setWarehouseId(vo.getWarehouseId());
out.setStockoutSource("1");
out.setSpare6(vo.getOutType()); // 搬运方式 1人工 2agv
out.setCarNumber(vo.getIsProjectOut());
out.setDepartmentNo(vo.getProjectNo());
out.setCustomerNo(vo.getCustomerId());
out.setClassNowId(vo.getCustomerName());
out.setSpare1(vo.getContractNo());
out.setSpare2(vo.getSalesOrderNo());
out.setSpare3(vo.getApproveDate());
out.setSpare4(vo.getApproveMan());
out.setSpare5(vo.getRemark());
out.setSpare7(vo.getDestination()); // 配送终点
out.setSpare8("2"); // 配送去向 1 缓存 2 线边 默认线边
out.setCompanyShortName(vo.getCompanyShortName());
out.setAccountSetNo(vo.getAccountSetNo());
out.setFID(vo.getIsProjectOut()); // 是否按项目出 1是 0否
}
/**
* 批量保存出库明细列表
*/
private void saveOutDetailList(OutStockout out, List<DeliveryNoticeItemVo> detailList, String warehouseId) {
if (CollUtil.isEmpty(detailList)) {
return;
}
int i = 0;
for (DeliveryNoticeItemVo item : detailList) {
i++;
OutStockoutDetail d = new OutStockoutDetail();
d.setStockoutDetailId(out.getStockoutId() + "-" + i);
d.setStockoutGuid(out.getStockoutGuid());
d.setStockoutId(out.getStockoutId());
d.setProductId(item.getInventoryCode());
d.setProductName(item.getInventoryName());
d.setLotNo(item.getLotNo());
d.setSpec(item.getSpecModel());
d.setUnit(item.getUnit());
d.setSpare1(item.getLevelRelation());
d.setSpare2(item.getUpperMaterial());
d.setSpare3(item.getTopMaterial());
d.setSpare4(item.getProjectNo());
d.setSpare6(item.getLineNo());
d.setRemark(item.getRemark());
d.setSourceLineId(item.getSourceLineId());
d.setBarCode(item.getBarCode());
d.setIsBatchManage(item.getIsBatchManage());
d.setOldProjectNo(item.getOldProjectNo());
d.setProductGuid(item.getStg_location());
d.setEntryid(item.getGroupNum());
try {
d.setQuantity(new BigDecimal(item.getQuantity()));
d.setAllotQuantity(BigDecimal.ZERO);
d.setAssignNum(BigDecimal.ZERO);
} catch (Exception e) {
d.setQuantity(BigDecimal.ZERO);
}
outStockoutDetailService.insertOutStockoutDetail(d);
}
out.setWarehouseId(warehouseId);
outStockoutService.updateOutStockout(out);
}
@Override
public void callbackInDeliveryNotice() {
@@ -717,7 +382,7 @@ public class ToErpServiceImpl implements IToErpService {
String[] splitLocation = detail.getSpare8().split(",");
String[] splitQuantity = detail.getQuantityX().split(",");
ArrayList<LocationDetail> locationDetails = new ArrayList<>();
for (int i = 0; i < splitArea.length; i++) {
for(int i=0;i<splitArea.length;i++) {
LocationDetail locationDetail = new LocationDetail();
locationDetail.setLocationNo(splitLocation[i]);
locationDetail.setQuantity(splitQuantity[i]);
@@ -732,7 +397,7 @@ public class ToErpServiceImpl implements IToErpService {
}
deliveryNoticeVo.setDetailList(detailList);
String sendMsg = JSONUtil.toJsonStr(deliveryNoticeVo);
String sendMsg=JSONUtil.toJsonStr(deliveryNoticeVo);
try {
//todo 发送给erp 成功失败改状态
RequestLog requestLog = requestLogService.getRequestLog("http://192.168.188.235/app1/api?type=1&key=1", JSONUtil.toJsonStr(deliveryNoticeVo), "入库回传", "wms", "erp");
@@ -792,7 +457,7 @@ public class ToErpServiceImpl implements IToErpService {
// outStockoutDetailBack.setSendStatus("0");
List<OutStockoutDetailBack> outStockoutDetailBacks = outStockoutDetailBackService.selectOutStockoutDetailBackList(outStockoutDetailBack);
List<DeliveryNoticeItemVo> detailList = new ArrayList<>();
if (outStockoutDetailBacks != null && !outStockoutDetailBacks.isEmpty()) {
if(outStockoutDetailBacks != null && !outStockoutDetailBacks.isEmpty()) {
for (OutStockoutDetailBack detail : outStockoutDetailBacks) {
DeliveryNoticeItemVo item = new DeliveryNoticeItemVo();
item.setLineNo(detail.getStockoutDetailId());
@@ -812,12 +477,9 @@ public class ToErpServiceImpl implements IToErpService {
String[] splitArea = detail.getSpare9().split(",");
String[] splitLocation = detail.getSpare8().split(",");
String[] splitQuantity = detail.getQuantityX().split(",");
String[] lotNo = new String[]{};
if (StrUtil.isNotEmpty(detail.getLotNo())) {
lotNo = detail.getLotNo().split(",");
}
String[] lotNo = detail.getLotNo().split(",");
ArrayList<LocationDetail> locationDetails = new ArrayList<>();
for (int i = 0; i < splitArea.length; i++) {
for(int i=0;i<splitArea.length;i++) {
LocationDetail locationDetail = new LocationDetail();
locationDetail.setLocationNo(splitLocation[i]);
locationDetail.setQuantity(splitQuantity[i]);
@@ -978,236 +640,6 @@ public class ToErpServiceImpl implements IToErpService {
}
}
@Override
public void callbackInDeliveryNoticeNew() {
InStockinBack inStockin = inStockinBackService.selectTopInStockin();
if (inStockin == null) {
return;
}
CallBackErp callBackErp = new CallBackErp();
callBackErp.setCcompany(inStockin.getCompanyShortName()); // 公司简称
callBackErp.setCcode(inStockin.getStockinId()); // wms 单据号 需要改成作业号
callBackErp.setDdate(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date())); // 操作日期
callBackErp.setCintype(inStockin.getInType()); // 业务类型
callBackErp.setCvencode(inStockin.getSupplierNo()); // 供应商编码
callBackErp.setCvenname(inStockin.getClassNo()); // 供应商名称
callBackErp.setCoptname(inStockin.getCreateManId()); // 操作人
callBackErp.setCmemo(inStockin.getRemark()); // 备注
callBackErp.setCacc_id(inStockin.getAccountSetNo()); // 账套号
callBackErp.setCwhcode("01"); // 仓库编码
callBackErp.setCwhname("立体库"); // 仓库名称
// TODO 以下需要重新编写根据给的字段
InStockinDetailBack inStockinDetailParam = new InStockinDetailBack();
inStockinDetailParam.setStockinId(inStockin.getStockinId());
inStockinDetailParam.setSendStatus("0");
List<InStockinDetailBack> inStockinDetails = inStockinDetailBackService.selectInStockinDetailBackList(inStockinDetailParam);
List<CallBackErpItems> detailList = new ArrayList<>();
if (inStockinDetails != null && !inStockinDetails.isEmpty()) {
for (InStockinDetailBack detail : inStockinDetails) {
CallBackErpItems item = new CallBackErpItems();
// 存货编码11
item.setCinvcode(detail.getProductId());
// 存货名称
item.setCinvname(detail.getProductName());
// 规格型号
item.setCinvstd(detail.getSpec());
// 单位
item.setCinvm_unit(detail.getUnit());
// 货位编码
item.setCposcode(detail.getSpare9());
item.setJobid(detail.getStockinGuid());
// 货位名称
item.setCposname("");
// 托盘号
item.setCtrayname(detail.getSpare8());
//jobid
// item.setJobid(detail.getSpare7());
// 批号
item.setCbatch(detail.getLotNo());
// 数量
item.setIquantity(Integer.valueOf(detail.getAssignNum()));
// 老项目号
item.setCxmh(detail.getOldProjectNo());
// 新项目号
item.setCnewxmh(detail.getSpare4());
// erpbillno
item.setSrccode(inStockin.getErpBill());
// erp来源单子表id
item.setSrcids(Integer.valueOf(detail.getSourceLineId()));
// erp子表行号
item.setSrcrowno(detail.getSpare6());
// 是否批次管理
item.setBinvbatch(Integer.valueOf(detail.getIsBatchManage()));
// 仓库选择 1立库 2 平库
item.setStg_location(detail.getProductGuid());
// 组件号
System.err.println("组件号赋值 " + detail.getCargoNo());
item.setGroupNum(detail.getCargoNo());
System.err.println("组件号赋值 结束");
detailList.add(item);
}
}
callBackErp.setDetails(detailList);
String sendMsg = JSONUtil.toJsonStr(callBackErp);
System.err.println(sendMsg);
try {
//todo 发送给erp 成功失败改状态
// http://192.168.188.235/app1/api?type=1&key=1
RequestLog requestLog = requestLogService.getRequestLog("https://192.168.188.239:1093/hzgmid/ServerCommand/SaveDataFromWms", JSONUtil.toJsonStr(callBackErp), "入库回传", "wms", "erp", inStockin.getInType(), inStockin.getAccountSetNo());
if ("1".equals(requestLog.getIsSuccessful())) {
inStockin.setSendStatus("1");
inStockin.setSendTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
inStockin.setMsg("成功");
inStockinDetailParam.setSendStatus("1");
inStockinDetailParam.setSendTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
inStockinDetailParam.setMsg("成功");
inStockinDetailBackService.insertInStockInDetailBackFinish(inStockinDetails);
inStockinDetailBackService.deleteInStockInDetailList(inStockinDetails);
} else {
inStockin.setSendStatus("2");
inStockin.setSendTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
inStockin.setMsg(requestLog.getErrorDetails());
inStockinDetailParam.setSendStatus("2");
inStockinDetailParam.setSendTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
inStockinDetailParam.setMsg(requestLog.getErrorDetails());
}
inStockinBackService.updateInStockinBack(inStockin);
inStockinDetailBackService.updateInStockinDetailBack(inStockinDetailParam);
} catch (Exception e) {
inStockin.setSendStatus("2");
inStockin.setSendTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
inStockin.setMsg(e.getMessage());
inStockinDetailParam.setSendStatus("2");
inStockinDetailParam.setSendTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
inStockinDetailParam.setMsg(e.getMessage());
inStockinBackService.updateInStockinBack(inStockin);
inStockinDetailBackService.updateInStockinDetailBack(inStockinDetailParam);
}
}
@Override
public void callbackDeliveryOutNoticeNew() {
OutStockoutBack outStockoutBack = outStockoutBackService.selelctTopOutStockout();
if (outStockoutBack == null) {
return;
}
CallBackErp callBackErp = new CallBackErp();
callBackErp.setCcompany(outStockoutBack.getCompanyShortName()); // 公司简称
callBackErp.setCcode(outStockoutBack.getStockoutId()); // wms 单据号
callBackErp.setDdate(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date())); // 操作日期
callBackErp.setCintype(outStockoutBack.getOutType()); // 业务类型
callBackErp.setCvencode(outStockoutBack.getCustomerNo()); // 供应商编码
callBackErp.setCvenname(outStockoutBack.getCustomerNo()); // 供应商名称
callBackErp.setCoptname(outStockoutBack.getCreateManId()); // 操作人
callBackErp.setCmemo(outStockoutBack.getRemark()); // 备注
callBackErp.setCacc_id(outStockoutBack.getAccountSetNo()); // 账套号
callBackErp.setCwhcode("01"); // 仓库编码
callBackErp.setCwhname("立体库"); // 仓库名称
OutStockoutDetailBack outStockoutDetailBack = new OutStockoutDetailBack();
outStockoutDetailBack.setStockoutId(outStockoutBack.getStockoutId());
outStockoutDetailBack.setSendStatus("0");
// outStockoutDetailBack.setSendStatus("0");
List<OutStockoutDetailBack> outStockoutDetailBacks = outStockoutDetailBackService.selectOutStockoutDetailBackList(outStockoutDetailBack);
List<CallBackErpItems> detailList = new ArrayList<>();
if (outStockoutDetailBacks != null && !outStockoutDetailBacks.isEmpty()) {
for (OutStockoutDetailBack detail : outStockoutDetailBacks) {
CallBackErpItems item = new CallBackErpItems();
// 存货编码
item.setCinvcode(detail.getProductId());
// 存货名称
item.setCinvname(detail.getProductName());
// 规格型号
item.setCinvstd(detail.getSpec());
// 单位
item.setCinvm_unit(detail.getUnit());
// 货位编码
item.setCposcode(detail.getSpare9());
// 货位名称
item.setCposname("");
// 托盘号
item.setCtrayname(detail.getSpare8());
// 批号
item.setCbatch(detail.getLotNo());
item.setJobid(detail.getStockoutGuid());
// item.setLotNo(detail.getLotNo());
// 数量
item.setIquantity(Integer.parseInt(String.valueOf(detail.getAssignNum())));
// 老项目号
item.setCxmh(detail.getOldProjectNo());
// 新项目号
item.setCnewxmh(detail.getSpare4());
// erpbillno
item.setSrccode(outStockoutBack.getErpStockoutId());
// erp来源单子表id
item.setSrcids(Integer.valueOf(detail.getSourceLineId()));
// erp子表行号
item.setSrcrowno(detail.getSpare6());
// 是否批次管理
item.setBinvbatch(Integer.valueOf(detail.getIsBatchManage()));
// 仓库选择 1立库 2 平库
item.setStg_location(detail.getProductGuid());
// TODO 暂时未启用 等甲方后续通知
item.setGroupNum(detail.getEntryid());
detailList.add(item);
}
callBackErp.setDetails(detailList);
}
try {
//todo 发送给erp 成功失败改状态
RequestLog requestLog = requestLogService.getRequestLog("https://192.168.188.239:1093/hzgmid/ServerCommand/SaveDataFromWms", JSONUtil.toJsonStr(callBackErp), "出库回传", "wms", "erp", outStockoutBack.getOutType(), outStockoutBack.getAccountSetNo());
if ("1".equals(requestLog.getIsSuccessful())) {
outStockoutBack.setSendStatus("1");
outStockoutBack.setSendTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
outStockoutBack.setMsg("成功");
outStockoutDetailBack.setSendStatus("1");
outStockoutDetailBack.setSendTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
outStockoutDetailBack.setMsg("成功");
outStockoutDetailBackService.insertOutStockDetailBackFinish(outStockoutDetailBacks);
outStockoutDetailBackService.deleteOutStockDetailList(outStockoutDetailBacks);
} else {
outStockoutBack.setSendStatus("2");
outStockoutBack.setSendTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
outStockoutBack.setMsg(requestLog.getErrorDetails());
outStockoutDetailBack.setSendStatus("2");
outStockoutDetailBack.setSendTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
outStockoutDetailBack.setMsg(requestLog.getErrorDetails());
}
outStockoutBackService.updateOutStockoutBack(outStockoutBack);
outStockoutDetailBackService.updateOutStockoutDetailBack(outStockoutDetailBack);
} catch (Exception e) {
outStockoutBack.setSendStatus("2");
outStockoutBack.setSendTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
outStockoutBack.setMsg(e.getMessage());
outStockoutDetailBack.setSendStatus("2");
outStockoutDetailBack.setSendTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
outStockoutDetailBack.setMsg(e.getMessage());
outStockoutBackService.updateOutStockoutBack(outStockoutBack);
outStockoutDetailBackService.updateOutStockoutDetailBack(outStockoutDetailBack);
}
}
@Override
public void callbackDeliveryOutNoticeNews() {
}
public AjaxResult createOtherInOutboundOrder(TransferBillCallback transferBillCallback) {
ErpInterfaceParam<ErpInOutBoundOrder> param = new ErpInterfaceParam<>();

View File

@@ -42,6 +42,7 @@ public class ToWcsServiceImpl implements IToWcsService {
public static final String UPDATE_WCS_PORT = "http://localhost:8081/wcs2Wms/api/updateWcsPort";
@Override
@Scheduled(fixedDelay=1500)
public void pushOutMydoJob() {
@@ -152,4 +153,18 @@ public class ToWcsServiceImpl implements IToWcsService {
return AjaxResult.error();
}
@Override
public AjaxResult insertAgvMoveJob(AgvMoveParam agvMoveParam) {
Map<String,String> map = new HashMap<>();
map.put("startPoint", agvMoveParam.getStartPoint());
map.put("endPoint", agvMoveParam.getEndPoint());
map.put("type", agvMoveParam.getType());
map.put("jobId", UUID.randomUUID().toString());
RequestLog requestLog = requestLogService.getRequestLog(PUSH_AGV_MOVE_JOB, JSONUtil.toJsonStr(map), "修改缓存点状态","wms","wcs");
if ("1".equals(requestLog.getIsSuccessful())){
return AjaxResult.success();
}
return AjaxResult.error();
}
}

View File

@@ -401,7 +401,6 @@ public class ToWmsServiceImpl implements IToWmsService {
@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())){
@@ -411,7 +410,6 @@ public class ToWmsServiceImpl implements IToWmsService {
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());

View File

@@ -262,7 +262,7 @@ public class TwinServiceImpl implements ITwinService {
@Override
public Map<String, Object> getCargo(String cargoSpaceName) {
BasStock basStock = new BasStock();
basStock.setCargoSpaceId(cargoSpaceName);
basStock.setCargoSpaceName(cargoSpaceName);
List<BasStock> list = basStockService.selectBasStockList(basStock);
List<Map<String, String>> dataList = new ArrayList<>();
for (BasStock stock : list) {

View File

@@ -1,22 +0,0 @@
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

@@ -27,25 +27,23 @@ import java.util.List;
*/
@RestController
@RequestMapping("/check/stockCheck")
public class CheckStockinController extends BaseController
{
public class CheckStockinController extends BaseController {
@Autowired
private ICheckStockinService checkStockinService;
@Autowired
private ICheckStockinFinishService checkStockinFinishService;
private ICheckStockinFinishService checkStockinFinishService;
/**
* 查询盘库单据主信息列表
*/
@PreAuthorize("@ss.hasPermi('check:stockCheck:list')")
@GetMapping("/list")
public TableDataInfo list(CheckStockin checkStockin)
{
public TableDataInfo list(CheckStockin checkStockin) {
startPage();
List<CheckStockin> list = new ArrayList<>();
if (checkStockin.getStatus() == null || Convert.toInt(checkStockin.getStatus())<4){
list = checkStockinService.selectCheckStockinList(checkStockin);
}else {
if (checkStockin.getStatus() == null || Convert.toInt(checkStockin.getStatus()) < 4) {
list = checkStockinService.selectCheckStockinList(checkStockin);
} else {
list = checkStockinFinishService.selectCheckStockinList(checkStockin);
}
@@ -58,8 +56,7 @@ public class CheckStockinController extends BaseController
@PreAuthorize("@ss.hasPermi('check:stockCheck:export')")
@Log(title = "盘库单据主信息", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, CheckStockin checkStockin)
{
public void export(HttpServletResponse response, CheckStockin checkStockin) {
List<CheckStockin> list = checkStockinService.selectCheckStockinList(checkStockin);
ExcelUtil<CheckStockin> util = new ExcelUtil<CheckStockin>(CheckStockin.class);
util.exportExcel(response, list, "盘库单据主信息数据");
@@ -70,8 +67,7 @@ public class CheckStockinController extends BaseController
*/
@PreAuthorize("@ss.hasPermi('check:stockCheck:query')")
@GetMapping(value = "/{stockGuid}")
public AjaxResult getInfo(@PathVariable("stockGuid") String stockGuid)
{
public AjaxResult getInfo(@PathVariable("stockGuid") String stockGuid) {
return success(checkStockinService.selectCheckStockinByStockGuid(stockGuid));
}
@@ -81,8 +77,7 @@ public class CheckStockinController extends BaseController
@PreAuthorize("@ss.hasPermi('check:stockCheck:add')")
@Log(title = "盘库单据主信息", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody CheckStockin checkStockin)
{
public AjaxResult add(@RequestBody CheckStockin checkStockin) {
return toAjax(checkStockinService.insertCheckStockin(checkStockin));
}
@@ -92,8 +87,7 @@ public class CheckStockinController extends BaseController
@PreAuthorize("@ss.hasPermi('check:stockCheck:edit')")
@Log(title = "盘库单据主信息", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody CheckStockin checkStockin)
{
public AjaxResult edit(@RequestBody CheckStockin checkStockin) {
return checkStockinService.updateCheckStockin(checkStockin);
}
@@ -102,9 +96,8 @@ public class CheckStockinController extends BaseController
*/
@PreAuthorize("@ss.hasPermi('check:stockCheck:remove')")
@Log(title = "盘库单据主信息", businessType = BusinessType.DELETE)
@DeleteMapping("/{stockGuids}")
public AjaxResult remove(@PathVariable String[] stockGuids)
{
@DeleteMapping("/{stockGuids}")
public AjaxResult remove(@PathVariable String[] stockGuids) {
return toAjax(checkStockinService.deleteCheckStockinByStockGuids(stockGuids));
}
@@ -119,12 +112,15 @@ public class CheckStockinController extends BaseController
@PreAuthorize("@ss.hasPermi('check:stockCheck:saveBill')")
@ResponseBody
public AjaxResult saveBill(@RequestBody CheckStockVo checkStockVo) {
String stockOutId = checkStockinService.saveBill(checkStockVo);
return AjaxResult.success(stockOutId);
return checkStockinService.saveBill(checkStockVo);
}
/**
* 盘点自动分配
*
* @param checkStockin
* @return
*/

View File

@@ -62,7 +62,7 @@ public interface ICheckStockinService
*/
public int deleteCheckStockinByStockGuid(String stockGuid);
String saveBill(CheckStockVo outStockoutVo);
AjaxResult saveBill(CheckStockVo outStockoutVo);
/**
* 盘点自动分配

View File

@@ -162,9 +162,8 @@ public class CheckStockinServiceImpl implements ICheckStockinService {
@Override
@Transactional(rollbackFor = Exception.class)
public String saveBill(CheckStockVo checkStockVo) {
public AjaxResult saveBill(CheckStockVo checkStockVo) {
CheckStockin checkStockin = checkStockVo.getCheckStockin();
List<CheckStockinDetail> detailList = checkStockVo.getDetailList();
String stockCheckId = basJobIdService.getJobId("PDD");
checkStockin.setStockCheckId(stockCheckId);
@@ -182,8 +181,11 @@ 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());
if (basProduct==null){
throw new RuntimeException(checkStockinDetail.getProductId()+",系统内无该物料,请检查!");
}
checkStockinDetail.setProductGuid(basProduct.getProductGuid());
checkStockinDetail.setStockCheckGuid(checkStockin.getStockGuid());
checkStockinDetail.setScanNum("0");
checkStockinDetail.setAssignNum("0");
@@ -193,13 +195,6 @@ public class CheckStockinServiceImpl implements ICheckStockinService {
} else if ("2".equals(checkStockin.getCheckType())) {
//货位盘点
for (int i = 0; i < detailList.size(); i++) {
// BasStock param = new BasStock();
// param.setCargoSpaceId(detailList.get(i).getSpare1());
// List<BasStock> basStocks = basStockService.selectBasStockList(param);
// Integer quantity = 0;
// for (BasStock basStock : basStocks) {
// quantity += Convert.toInt(basStock.getQuantity());
// }
CheckStockinDetail checkStockinDetail = detailList.get(i);
checkStockinDetail.setStockCheckDetailId(stockCheckId + "-" + (i + 1));
checkStockinDetail.setStockCheckId(stockCheckId);
@@ -211,7 +206,7 @@ public class CheckStockinServiceImpl implements ICheckStockinService {
}
checkStockinMapper.insertCheckStockin(checkStockin);
return stockCheckId;
return AjaxResult.success("单据创建成功",stockCheckId);
}
@Override

View File

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

View File

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

View File

@@ -97,9 +97,4 @@ 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,54 +102,8 @@ 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,6 +66,4 @@ public interface InStockinMapper
void insertInStockinHistory(InStockin inStockin);
List<InStockin> selectStockinByDetail(String stockinDetailId);
List<InStockin> selectInStockinListBill(InStockin param);
}

View File

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

View File

@@ -255,9 +255,4 @@ 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,24 +95,6 @@ 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,44 +152,6 @@ 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,7 +4,6 @@ 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接口
@@ -62,8 +61,4 @@ 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,8 +58,4 @@ public interface IInStockinDetailBackService
* @return 结果
*/
public int deleteInStockinDetailBackByStockinDetailId(String stockinDetailId);
void insertInStockInDetailBackFinish(List<InStockinDetailBack> inStockinDetails);
void deleteInStockInDetailList(List<InStockinDetailBack> inStockinDetails);
}

View File

@@ -90,14 +90,4 @@ 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,13 +143,9 @@ 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,6 +69,4 @@ public interface InStockinDetailMapper
void deleteInStockinDetailByStockinGuid(String stockinGuid);
InStockinDetail selectStockinByDetailById(InStockinDetail inStockinDetail);
List<InStockinDetail> selectStockInByDetailByBarCode(String barCode);
}

View File

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

View File

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

View File

@@ -89,15 +89,6 @@ 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

@@ -124,9 +124,6 @@ public class MydoJob extends BaseEntity
/** 重分标记 */
@Excel(name = "重分标记")
private String faultFlag;
private String endPoint;
private String inOut;
@@ -136,23 +133,6 @@ 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

@@ -1,27 +0,0 @@
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,6 +1,5 @@
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;
@@ -89,10 +88,4 @@ public interface MydoJobMapper
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

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

View File

@@ -69,7 +69,6 @@ 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);
/**
* 接收接口记录
*
@@ -78,12 +77,4 @@ 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,8 +3,6 @@ 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;
@@ -124,8 +122,6 @@ public class RequestLogServiceImpl implements IRequestLogService
requestLog.setRequestBody(param);
requestLog.setRequestUrl(url);
try {
// 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捕获
@@ -151,53 +147,6 @@ 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;
}
/**
* 插入请求日志
*
@@ -224,43 +173,6 @@ public class RequestLogServiceImpl implements IRequestLogService
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,9 +42,6 @@ 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,7 +4,6 @@ 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
@@ -188,38 +187,7 @@ 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)
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,24 +132,17 @@ 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

@@ -102,24 +102,6 @@ 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;

View File

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

View File

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

View File

@@ -183,6 +183,7 @@ public class OutStockoutServiceImpl implements IOutStockoutService
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_resultmsg"));
}
@@ -220,9 +221,4 @@ public class OutStockoutServiceImpl implements IOutStockoutService
}
return AjaxResult.success();
}
@Override
public void updateOutStockouts(OutStockout mainOut) {
outStockoutMapper.updateOutStockouts(mainOut);
}
}

View File

@@ -127,28 +127,7 @@ public class OutStockoutBack extends BaseEntity
@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)
public void setStockoutGuid(String stockoutGuid)
{
this.stockoutGuid = stockoutGuid;
}

View File

@@ -48,7 +48,7 @@ public class OutStockoutDetail extends BaseEntity
/** 计划数量(箱) */
@Excel(name = "计划数量", readConverterExp = "箱=")
private String quantityX;
private BigDecimal quantityX;
/** 计划数量(件) */
@Excel(name = "计划数量", readConverterExp = "件=")
@@ -200,42 +200,6 @@ 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;
@@ -443,12 +407,14 @@ public class OutStockoutDetail extends BaseEntity
return quantity;
}
public String getQuantityX() {
return quantityX;
public void setQuantityX(BigDecimal quantityX)
{
this.quantityX = quantityX;
}
public void setQuantityX(String quantityX) {
this.quantityX = quantityX;
public BigDecimal getQuantityX()
{
return quantityX;
}
public void setQuantityJ(BigDecimal quantityJ)

View File

@@ -172,44 +172,7 @@ public class OutStockoutDetailBack extends BaseEntity
@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)
public void setStockoutDetailId(String stockoutDetailId)
{
this.stockoutDetailId = stockoutDetailId;
}

View File

@@ -2,7 +2,6 @@ package com.ruoyi.out.outStockoutDetailBack.mapper;
import java.util.List;
import com.ruoyi.out.outStockoutDetailBack.domain.OutStockoutDetailBack;
import org.apache.ibatis.annotations.Param;
/**
* 历史出库单据子信息Mapper接口
@@ -59,8 +58,4 @@ public interface OutStockoutDetailBackMapper
* @return 结果
*/
public int deleteOutStockoutDetailBackByStockoutDetailIds(String[] stockoutDetailIds);
void insertOutStockDetailBackFinish(@Param("list") List<OutStockoutDetailBack> outStockoutDetailBacks);
void deleteOutStockDetailList(@Param("list") List<OutStockoutDetailBack> outStockoutDetailBacks);
}

View File

@@ -58,8 +58,4 @@ public interface IOutStockoutDetailBackService
* @return 结果
*/
public int deleteOutStockoutDetailBackByStockoutDetailId(String stockoutDetailId);
void insertOutStockDetailBackFinish(List<OutStockoutDetailBack> outStockoutDetailBacks);
void deleteOutStockDetailList(List<OutStockoutDetailBack> outStockoutDetailBacks);
}

View File

@@ -90,14 +90,4 @@ public class OutStockoutDetailBackServiceImpl implements IOutStockoutDetailBackS
{
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

@@ -1,43 +1,30 @@
package com.ruoyi.pda.controller;
import com.ruoyi.api.domain.AgvMoveParam;
import com.ruoyi.api.domain.RequestEnter;
import com.ruoyi.api.domain.WcsPort;
import com.ruoyi.api.service.IToWcsService;
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.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
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 java.util.HashMap;
import java.util.List;
import java.util.UUID;
@Controller
@RequestMapping("/pda")
@@ -49,19 +36,7 @@ public class PdaController extends BaseController {
@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;
private IToWcsService iToWcsService;
/**
* 查询是否有半满托盘
@@ -76,11 +51,11 @@ public class PdaController extends BaseController {
/**
* 通过单据码查询物料详情
*/
@RequestMapping("/selectDetailByIds")
@RequestMapping("/selectDetailById")
@ResponseBody
public AjaxResult selectDetailByIds(String inStockinDetailId) {
public AjaxResult selectDetailById(String inStockinDetailId) {
InStockinDetail inStockinDetail = iInStockinDetailService.selectInStockinDetailByStockinDetailId(inStockinDetailId);
if (inStockinDetail != null) {
if(inStockinDetail != null) {
inStockinDetail.setQuantity(String.valueOf(Integer.valueOf(inStockinDetail.getQuantity()) - Integer.valueOf(inStockinDetail.getScanNum())));
}
return AjaxResult.success(inStockinDetail);
@@ -97,22 +72,6 @@ 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
*/
@@ -131,13 +90,6 @@ public class PdaController extends BaseController {
return pdaService.bindTray(trayCodeMakeSure);
}
@RequestMapping("/bindTray2")
@ResponseBody
public AjaxResult bindTray2(@RequestBody TrayCodeMakeSure trayCodeMakeSure) {
return pdaService.bindTray2(trayCodeMakeSure);
}
/**
* 空托盘入库
*/
@@ -158,13 +110,12 @@ public class PdaController extends BaseController {
/**
* 出库确认查询子作业信息
*
* @param trayCodeMsg
* @return
*/
@RequestMapping("/selectJobDetailByTray")
@ResponseBody
public AjaxResult selectJobDetailByTray(@RequestBody TrayCodeMsg trayCodeMsg) {
public AjaxResult selectJobDetailByTray(@RequestBody TrayCodeMsg trayCodeMsg){
return pdaService.selectJobDetailByTray(trayCodeMsg);
}
@@ -193,12 +144,19 @@ public class PdaController extends BaseController {
}
@RequestMapping("/selectDetailByPDTray")
@ResponseBody
public AjaxResult selectDetailByPDTray(@RequestBody TrayCodeMakeSure trayCodeMakeSure) {
return pdaService.selectDetailByPDTray(trayCodeMakeSure);
}
@RequestMapping("/selectHcTray")
@ResponseBody
public AjaxResult selectHcTray(@RequestBody TrayCodeMakeSure trayCodeMakeSure) {
return pdaService.selectHcTray(trayCodeMakeSure);
}
/**
* 盘点出库确认
@@ -208,7 +166,7 @@ public class PdaController extends BaseController {
*/
@PreAuthorize("@ss.hasPermi('pda:check:checkMakeSure')")
@PostMapping("/checkMakeSure")
@Log(title = "手持机盘点出库确认", businessType = BusinessType.OTHER)
@Log(title = "手持机盘点出库确认", businessType = BusinessType.INSERT)
@ResponseBody
public AjaxResult checkMakeSure(@RequestBody TrayCodeMakeSure trayCodeMakeSure) {
return pdaService.checkMakeSure(trayCodeMakeSure);
@@ -226,244 +184,31 @@ public class PdaController extends BaseController {
return pdaService.updateWcsPort(wcsPort);
}
/**
* 根据类型查询AGV站点
*/
@RequestMapping("/selectAgvPointByType")
@ResponseBody
public AjaxResult selectAgvPointByType(String type) {
List<AgvPoint> list = pdaService.selectAgvPointByType(type);
return AjaxResult.success(list);
}
@RequestMapping("/insertAgvJob")
@ResponseBody
public AjaxResult insertAgvJob(@RequestBody AgvMoveParam agvMoveParam) {
return iToWcsService.insertAgvMoveJob(agvMoveParam);
}
@RequestMapping("/hcoutMakesure")
@ResponseBody
@Log(title = "手持机缓存出库确认", businessType = BusinessType.OTHER)
public AjaxResult hcoutMakesure(String trayCode) {
@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,6 +1,5 @@
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;
@@ -23,18 +22,10 @@ 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,7 +1,5 @@
package com.ruoyi.pda.domain;
import java.util.List;
public class TrayCodeMsg {
private String trayCode;
@@ -20,18 +18,8 @@ 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;
private String trayType;
public String getTrayType() {
return trayType;

View File

@@ -40,16 +40,4 @@ public interface PdaMapper {
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

@@ -2,13 +2,13 @@ package com.ruoyi.pda.service;
import com.ruoyi.api.domain.RequestEnter;
import com.ruoyi.api.domain.WcsPort;
import com.ruoyi.bas.agvPoint.domain.AgvPoint;
import com.ruoyi.bas.container.domain.BasContainer;
import com.ruoyi.common.core.domain.AjaxResult;
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;
@@ -48,6 +48,8 @@ public interface PdaService {
public AjaxResult selectDetailByPDTray(TrayCodeMakeSure trayCodeMakeSure);
public AjaxResult selectHcTray(TrayCodeMakeSure trayCodeMakeSure);
AjaxResult outMakeSure(TrayCodeMakeSure trayCodeMakeSure);
AjaxResult checkMakeSure(TrayCodeMakeSure trayCodeMakeSure);
@@ -56,20 +58,7 @@ public interface PdaService {
AjaxResult updateWcsPort(WcsPort wcsport);
List<AgvPoint> selectAgvPointByType(String type);
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

@@ -6,28 +6,29 @@ import com.ruoyi.api.domain.RequestEnter;
import com.ruoyi.api.domain.WcsPort;
import com.ruoyi.api.service.IToWcsService;
import com.ruoyi.api.service.IToWmsService;
import com.ruoyi.bas.agvPoint.domain.AgvPoint;
import com.ruoyi.bas.agvPoint.service.IAgvPointService;
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.out.outStockoutDetail.domain.OutStockoutDetail;
import com.ruoyi.out.outStockoutDetail.service.impl.OutStockoutDetailServiceImpl;
import com.ruoyi.job.mydojobdetail.service.impl.MydoJobDetailServiceImpl;
import com.ruoyi.pda.domain.TrayCodeMakeSure;
import com.ruoyi.pda.domain.TrayCodeMsg;
import com.ruoyi.pda.mapper.PdaMapper;
import com.ruoyi.pda.trayMsg.domain.TrayMsg;
import com.ruoyi.pda.trayMsg.service.ITrayMsgService;
import com.ruoyi.stock.hcstock.domain.BasStockHc;
import com.ruoyi.stock.hcstock.service.IBasStockHcService;
import com.ruoyi.stock.stock.domain.BasStock;
import com.ruoyi.stock.stock.mapper.BasStockMapper;
import com.ruoyi.system.service.ISysRoleService;
@@ -37,7 +38,6 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.*;
import java.util.stream.Collectors;
@Service
@Slf4j
@@ -65,20 +65,17 @@ public class PdaServiceImp implements PdaService {
@Autowired
private IInStockinService inStockinService;
@Autowired
private OutStockoutDetailServiceImpl outStockoutDetailService;
private IAgvPointService agvPointService;
@Autowired
private MydoJobMapper mapper;
private IBasStockHcService basStockHcService;
@Override
public List<BasStock> selectHasHalfTray(String inStockinDetailId) {
InStockinDetail inStockinDetail = inStockinDetailService.selectInStockinDetailByStockinDetailId(inStockinDetailId);
// InStockin inStockin = inStockinService.selectInStockinByStockinId(inStockinDetail.getStockinId());
// inStockinDetail.setSpare4(inStockinDetail.getSpare4());
InStockin inStockin = inStockinService.selectInStockinByStockinId(inStockinDetail.getStockinId());
inStockinDetail.setSpare4(inStockin.getDepartmentNo());
List<BasStock> hasHalfTray = basStockMapper.selectHasHalfTray(inStockinDetail);
Integer count = mapper.selectBySpare4OrCargo(inStockinDetail);
if (count > 0) {
return null;
}
return hasHalfTray;
}
@@ -86,16 +83,16 @@ 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());
map.put("v_exit_id", trayCodeMsg.getExitId());
map.put("v_exit_id",trayCodeMsg.getExitId());
pdaMapper.halfTrayOut(map);
if (!"10".equals(map.get("v_result").toString())) {
if(!"10".equals(map.get("v_result").toString())){
return AjaxResult.error(map.get("v_resultmsg").toString());
} else {
}else{
return AjaxResult.success();
}
@@ -123,25 +120,29 @@ 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());
throw new RuntimeException(map.get("v_result").toString());
return AjaxResult.error(errorbulider.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())) {
throw new RuntimeException(map.get("v_result").toString());
return AjaxResult.error(errorbulider.toString());
}
return AjaxResult.success();
}
@@ -152,9 +153,9 @@ public class PdaServiceImp implements PdaService {
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())) {
if(!"10".equals(map.get("v_result").toString())){
return AjaxResult.error(map.get("v_resultmsg").toString());
} else {
}else{
return AjaxResult.success();
}
@@ -166,9 +167,9 @@ public class PdaServiceImp implements PdaService {
HashMap<String, Object> map = new HashMap<>();
map.put("v_tray_type", trayCodeMsg.getTrayType());
pdaMapper.tpOut(map);
if (!"10".equals(map.get("v_result").toString())) {
if(!"10".equals(map.get("v_result").toString())){
return AjaxResult.error(map.get("v_resultmsg").toString());
} else {
}else{
return AjaxResult.success();
}
}
@@ -206,15 +207,23 @@ public class PdaServiceImp implements PdaService {
@Override
public AjaxResult selectDetailByPDTray(TrayCodeMakeSure trayCodeMakeSure) {
MydoJob mydoJob = new MydoJob();
// mydoJob.setExitId(trayCodeMakeSure.getExitId());
mydoJob.setTrayCode(trayCodeMakeSure.getTrayCode());
mydoJob.setStatus("3");
mydoJob.setInOrOut("28");
mydoJob.setTrayCode(trayCodeMakeSure.getTrayCode());
List<MydoJobDetail> mydoJobDetails = mydoJobDetailService.selectPdMydoJobDetailListByExit(mydoJob);
return AjaxResult.success(mydoJobDetails);
}
@Override
public AjaxResult selectHcTray(TrayCodeMakeSure trayCodeMakeSure) {
BasStockHc basStockHc = new BasStockHc();
basStockHc.setTrayCode(trayCodeMakeSure.getTrayCode());
List<BasStockHc> basStockHcs = basStockHcService.selectBasStockHcList(basStockHc);
return AjaxResult.success(basStockHcs);
}
@Override
public AjaxResult outMakeSure(TrayCodeMakeSure trayCodeMakeSure) {
String trayCode = trayCodeMakeSure.getTrayCode();
@@ -260,7 +269,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("盘点数量不可为0"));
return AjaxResult.warn(MessageUtils.message("数量不可为0"));
}
for (MydoJobDetail mydoJobDetail : mydoJobDetailList) {
//插入盘点提交表
@@ -270,7 +279,7 @@ public class PdaServiceImp implements PdaService {
checkCommitRecord.setStockId(mydoJobDetail.getStockId());
checkCommitRecord.setSpare1(mydoJobDetail.getInOrOutDId());
checkCommitRecord.setSpare2(mydoJobDetail.getProductId());
checkCommitRecord.setSpare3(mydoJobDetail.getOutQuantity());
// checkCommitRecord.setSpare3(mydoJobDetail.getOutQuantity());
checkCommitRecordService.insertCheckCommitRecord(checkCommitRecord);
}
@@ -299,6 +308,13 @@ public class PdaServiceImp implements PdaService {
return ajaxResult;
}
@Override
public List<AgvPoint> selectAgvPointByType(String type) {
AgvPoint agvPoint = new AgvPoint();
agvPoint.setType(type);
return agvPointService.selectAgvPointList(agvPoint);
}
@Override
public AjaxResult hcoutMakesure(String trayCode) {
HashMap<String, Object> map = new HashMap<>();
@@ -310,92 +326,6 @@ public class PdaServiceImp implements PdaService {
} 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

@@ -0,0 +1,104 @@
package com.ruoyi.stock.hcstock.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.stock.hcstock.domain.BasStockHc;
import com.ruoyi.stock.hcstock.service.IBasStockHcService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 缓存库存信息Controller
*
* @author ruoyi
* @date 2026-03-23
*/
@RestController
@RequestMapping("/hcstock/hcstock")
public class BasStockHcController extends BaseController
{
@Autowired
private IBasStockHcService basStockHcService;
/**
* 查询缓存库存信息列表
*/
@PreAuthorize("@ss.hasPermi('hcstock:hcstock:list')")
@GetMapping("/list")
public TableDataInfo list(BasStockHc basStockHc)
{
startPage();
List<BasStockHc> list = basStockHcService.selectBasStockHcList(basStockHc);
return getDataTable(list);
}
/**
* 导出缓存库存信息列表
*/
@PreAuthorize("@ss.hasPermi('hcstock:hcstock:export')")
@Log(title = "缓存库存信息", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, BasStockHc basStockHc)
{
List<BasStockHc> list = basStockHcService.selectBasStockHcList(basStockHc);
ExcelUtil<BasStockHc> util = new ExcelUtil<BasStockHc>(BasStockHc.class);
util.exportExcel(response, list, "缓存库存信息数据");
}
/**
* 获取缓存库存信息详细信息
*/
@PreAuthorize("@ss.hasPermi('hcstock:hcstock:query')")
@GetMapping(value = "/{stockId}")
public AjaxResult getInfo(@PathVariable("stockId") String stockId)
{
return success(basStockHcService.selectBasStockHcByStockId(stockId));
}
/**
* 新增缓存库存信息
*/
@PreAuthorize("@ss.hasPermi('hcstock:hcstock:add')")
@Log(title = "缓存库存信息", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody BasStockHc basStockHc)
{
return toAjax(basStockHcService.insertBasStockHc(basStockHc));
}
/**
* 修改缓存库存信息
*/
@PreAuthorize("@ss.hasPermi('hcstock:hcstock:edit')")
@Log(title = "缓存库存信息", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody BasStockHc basStockHc)
{
return toAjax(basStockHcService.updateBasStockHc(basStockHc));
}
/**
* 删除缓存库存信息
*/
@PreAuthorize("@ss.hasPermi('hcstock:hcstock:remove')")
@Log(title = "缓存库存信息", businessType = BusinessType.DELETE)
@DeleteMapping("/{stockIds}")
public AjaxResult remove(@PathVariable String[] stockIds)
{
return toAjax(basStockHcService.deleteBasStockHcByStockIds(stockIds));
}
}

View File

@@ -0,0 +1,562 @@
package com.ruoyi.stock.hcstock.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;
/**
* 缓存库存信息对象 bas_stock_hc
*
* @author ruoyi
* @date 2026-03-23
*/
public class BasStockHc extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 库存id */
private String stockId;
/** 货位id */
@Excel(name = "货位id")
private String cargoSpaceId;
/** 库存状态 1正常 2冻结 */
@Excel(name = "库存状态 1正常 2冻结")
private String stockStatus;
/** 物料状态 1正常 2盘点待审批 3异常 */
@Excel(name = "物料状态 1正常 2盘点待审批 3异常")
private String productStatus;
/** 546批号 */
@Excel(name = "546批号")
private String lotNo;
/** 入库时间 */
@Excel(name = "入库时间")
private String inDate;
/** 回流时间 */
@Excel(name = "回流时间")
private String backDate;
/** 物料GUID */
@Excel(name = "物料GUID")
private String productGuid;
/** 库存数量 */
@Excel(name = "库存数量")
private String quantity;
/** 作业ID */
@Excel(name = "作业ID")
private String jobId;
/** 托盘条码 */
@Excel(name = "托盘条码")
private String trayCode;
/** 出库数量 */
@Excel(name = "出库数量")
private String outQuantity;
/** 入库子单id */
@Excel(name = "入库子单id")
private String stockinDetailId;
/** 入库主单 */
@Excel(name = "入库主单")
private String stockinId;
/** 入库类型 */
@Excel(name = "入库类型")
private String inType;
/** 入库班组ID */
@Excel(name = "入库班组ID")
private String inClassId;
/** 仓库 */
@Excel(name = "仓库")
private String warehouseId;
/** 供应商名称546 */
@Excel(name = "供应商名称546")
private String stackingId;
/** 层级关系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 */
@Excel(name = "销售订单号546")
private String spare6;
/** 物料编码 */
@Excel(name = "物料编码")
private String productId;
/** 物料名称 */
@Excel(name = "物料名称")
private String productName;
/** 供应商编码546 */
@Excel(name = "供应商编码546")
private String voltage;
/** 规格型号546 */
@Excel(name = "规格型号546")
private String power;
/** 计量单位546 */
@Excel(name = "计量单位546")
private String phase;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private String netWeight;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private String grossWeight;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private String distribution;
/** 是否满盘546,0否1是 */
@Excel(name = "是否满盘546,0否1是")
private String model;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private String orderId;
/** 盘点记录 0-未盘点 1-已盘点 */
@Excel(name = "盘点记录 0-未盘点 1-已盘点")
private String spare7;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private String spare8;
public void setStockId(String stockId)
{
this.stockId = stockId;
}
public String getStockId()
{
return stockId;
}
public void setCargoSpaceId(String cargoSpaceId)
{
this.cargoSpaceId = cargoSpaceId;
}
public String getCargoSpaceId()
{
return cargoSpaceId;
}
public void setStockStatus(String stockStatus)
{
this.stockStatus = stockStatus;
}
public String getStockStatus()
{
return stockStatus;
}
public void setProductStatus(String productStatus)
{
this.productStatus = productStatus;
}
public String getProductStatus()
{
return productStatus;
}
public void setLotNo(String lotNo)
{
this.lotNo = lotNo;
}
public String getLotNo()
{
return lotNo;
}
public void setInDate(String inDate)
{
this.inDate = inDate;
}
public String getInDate()
{
return inDate;
}
public void setBackDate(String backDate)
{
this.backDate = backDate;
}
public String getBackDate()
{
return backDate;
}
public void setProductGuid(String productGuid)
{
this.productGuid = productGuid;
}
public String getProductGuid()
{
return productGuid;
}
public void setQuantity(String quantity)
{
this.quantity = quantity;
}
public String getQuantity()
{
return quantity;
}
public void setJobId(String jobId)
{
this.jobId = jobId;
}
public String getJobId()
{
return jobId;
}
public void setTrayCode(String trayCode)
{
this.trayCode = trayCode;
}
public String getTrayCode()
{
return trayCode;
}
public void setOutQuantity(String outQuantity)
{
this.outQuantity = outQuantity;
}
public String getOutQuantity()
{
return outQuantity;
}
public void setStockinDetailId(String stockinDetailId)
{
this.stockinDetailId = stockinDetailId;
}
public String getStockinDetailId()
{
return stockinDetailId;
}
public void setStockinId(String stockinId)
{
this.stockinId = stockinId;
}
public String getStockinId()
{
return stockinId;
}
public void setInType(String inType)
{
this.inType = inType;
}
public String getInType()
{
return inType;
}
public void setInClassId(String inClassId)
{
this.inClassId = inClassId;
}
public String getInClassId()
{
return inClassId;
}
public void setWarehouseId(String warehouseId)
{
this.warehouseId = warehouseId;
}
public String getWarehouseId()
{
return warehouseId;
}
public void setStackingId(String stackingId)
{
this.stackingId = stackingId;
}
public String getStackingId()
{
return stackingId;
}
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 setProductId(String productId)
{
this.productId = productId;
}
public String getProductId()
{
return productId;
}
public void setProductName(String productName)
{
this.productName = productName;
}
public String getProductName()
{
return productName;
}
public void setVoltage(String voltage)
{
this.voltage = voltage;
}
public String getVoltage()
{
return voltage;
}
public void setPower(String power)
{
this.power = power;
}
public String getPower()
{
return power;
}
public void setPhase(String phase)
{
this.phase = phase;
}
public String getPhase()
{
return phase;
}
public void setNetWeight(String netWeight)
{
this.netWeight = netWeight;
}
public String getNetWeight()
{
return netWeight;
}
public void setGrossWeight(String grossWeight)
{
this.grossWeight = grossWeight;
}
public String getGrossWeight()
{
return grossWeight;
}
public void setDistribution(String distribution)
{
this.distribution = distribution;
}
public String getDistribution()
{
return distribution;
}
public void setModel(String model)
{
this.model = model;
}
public String getModel()
{
return model;
}
public void setOrderId(String orderId)
{
this.orderId = orderId;
}
public String getOrderId()
{
return orderId;
}
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;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("stockId", getStockId())
.append("cargoSpaceId", getCargoSpaceId())
.append("stockStatus", getStockStatus())
.append("productStatus", getProductStatus())
.append("lotNo", getLotNo())
.append("inDate", getInDate())
.append("backDate", getBackDate())
.append("productGuid", getProductGuid())
.append("quantity", getQuantity())
.append("jobId", getJobId())
.append("trayCode", getTrayCode())
.append("outQuantity", getOutQuantity())
.append("stockinDetailId", getStockinDetailId())
.append("stockinId", getStockinId())
.append("inType", getInType())
.append("inClassId", getInClassId())
.append("warehouseId", getWarehouseId())
.append("stackingId", getStackingId())
.append("spare1", getSpare1())
.append("spare2", getSpare2())
.append("spare3", getSpare3())
.append("spare4", getSpare4())
.append("spare5", getSpare5())
.append("spare6", getSpare6())
.append("productId", getProductId())
.append("productName", getProductName())
.append("voltage", getVoltage())
.append("power", getPower())
.append("phase", getPhase())
.append("netWeight", getNetWeight())
.append("grossWeight", getGrossWeight())
.append("distribution", getDistribution())
.append("model", getModel())
.append("orderId", getOrderId())
.append("spare7", getSpare7())
.append("spare8", getSpare8())
.toString();
}
}

View File

@@ -0,0 +1,61 @@
package com.ruoyi.stock.hcstock.mapper;
import java.util.List;
import com.ruoyi.stock.hcstock.domain.BasStockHc;
/**
* 缓存库存信息Mapper接口
*
* @author ruoyi
* @date 2026-03-23
*/
public interface BasStockHcMapper
{
/**
* 查询缓存库存信息
*
* @param stockId 缓存库存信息主键
* @return 缓存库存信息
*/
public BasStockHc selectBasStockHcByStockId(String stockId);
/**
* 查询缓存库存信息列表
*
* @param basStockHc 缓存库存信息
* @return 缓存库存信息集合
*/
public List<BasStockHc> selectBasStockHcList(BasStockHc basStockHc);
/**
* 新增缓存库存信息
*
* @param basStockHc 缓存库存信息
* @return 结果
*/
public int insertBasStockHc(BasStockHc basStockHc);
/**
* 修改缓存库存信息
*
* @param basStockHc 缓存库存信息
* @return 结果
*/
public int updateBasStockHc(BasStockHc basStockHc);
/**
* 删除缓存库存信息
*
* @param stockId 缓存库存信息主键
* @return 结果
*/
public int deleteBasStockHcByStockId(String stockId);
/**
* 批量删除缓存库存信息
*
* @param stockIds 需要删除的数据主键集合
* @return 结果
*/
public int deleteBasStockHcByStockIds(String[] stockIds);
}

View File

@@ -0,0 +1,61 @@
package com.ruoyi.stock.hcstock.service;
import java.util.List;
import com.ruoyi.stock.hcstock.domain.BasStockHc;
/**
* 缓存库存信息Service接口
*
* @author ruoyi
* @date 2026-03-23
*/
public interface IBasStockHcService
{
/**
* 查询缓存库存信息
*
* @param stockId 缓存库存信息主键
* @return 缓存库存信息
*/
public BasStockHc selectBasStockHcByStockId(String stockId);
/**
* 查询缓存库存信息列表
*
* @param basStockHc 缓存库存信息
* @return 缓存库存信息集合
*/
public List<BasStockHc> selectBasStockHcList(BasStockHc basStockHc);
/**
* 新增缓存库存信息
*
* @param basStockHc 缓存库存信息
* @return 结果
*/
public int insertBasStockHc(BasStockHc basStockHc);
/**
* 修改缓存库存信息
*
* @param basStockHc 缓存库存信息
* @return 结果
*/
public int updateBasStockHc(BasStockHc basStockHc);
/**
* 批量删除缓存库存信息
*
* @param stockIds 需要删除的缓存库存信息主键集合
* @return 结果
*/
public int deleteBasStockHcByStockIds(String[] stockIds);
/**
* 删除缓存库存信息信息
*
* @param stockId 缓存库存信息主键
* @return 结果
*/
public int deleteBasStockHcByStockId(String stockId);
}

View File

@@ -0,0 +1,93 @@
package com.ruoyi.stock.hcstock.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.stock.hcstock.mapper.BasStockHcMapper;
import com.ruoyi.stock.hcstock.domain.BasStockHc;
import com.ruoyi.stock.hcstock.service.IBasStockHcService;
/**
* 缓存库存信息Service业务层处理
*
* @author ruoyi
* @date 2026-03-23
*/
@Service
public class BasStockHcServiceImpl implements IBasStockHcService
{
@Autowired
private BasStockHcMapper basStockHcMapper;
/**
* 查询缓存库存信息
*
* @param stockId 缓存库存信息主键
* @return 缓存库存信息
*/
@Override
public BasStockHc selectBasStockHcByStockId(String stockId)
{
return basStockHcMapper.selectBasStockHcByStockId(stockId);
}
/**
* 查询缓存库存信息列表
*
* @param basStockHc 缓存库存信息
* @return 缓存库存信息
*/
@Override
public List<BasStockHc> selectBasStockHcList(BasStockHc basStockHc)
{
return basStockHcMapper.selectBasStockHcList(basStockHc);
}
/**
* 新增缓存库存信息
*
* @param basStockHc 缓存库存信息
* @return 结果
*/
@Override
public int insertBasStockHc(BasStockHc basStockHc)
{
return basStockHcMapper.insertBasStockHc(basStockHc);
}
/**
* 修改缓存库存信息
*
* @param basStockHc 缓存库存信息
* @return 结果
*/
@Override
public int updateBasStockHc(BasStockHc basStockHc)
{
return basStockHcMapper.updateBasStockHc(basStockHc);
}
/**
* 批量删除缓存库存信息
*
* @param stockIds 需要删除的缓存库存信息主键
* @return 结果
*/
@Override
public int deleteBasStockHcByStockIds(String[] stockIds)
{
return basStockHcMapper.deleteBasStockHcByStockIds(stockIds);
}
/**
* 删除缓存库存信息信息
*
* @param stockId 缓存库存信息主键
* @return 结果
*/
@Override
public int deleteBasStockHcByStockId(String stockId)
{
return basStockHcMapper.deleteBasStockHcByStockId(stockId);
}
}

View File

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

View File

@@ -11,7 +11,6 @@ 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;
@@ -185,8 +184,6 @@ public class BasStock extends BaseEntity
/** 仓库 */
// @Excel(name = "${stock.BasStock.warehouseId}")
private String warehouseId;
@Transient
private String warehouseCode;
/** 垛型ID */

View File

@@ -1,7 +1,6 @@
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;
@@ -74,20 +73,4 @@ 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,10 +83,4 @@ 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);
}

View File

@@ -58,7 +58,7 @@ public class BasStockServiceImpl implements IBasStockService
@Override
public List<BasStock> selectBasStockList(BasStock basStock)
{
return basStockMapper.selectBasStockList2(basStock);
return basStockMapper.selectBasStockList(basStock);
}
/**
* 无权限查询库存信息列表
@@ -115,10 +115,10 @@ public class BasStockServiceImpl implements IBasStockService
@Override
public int updateBasStock(BasStock basStock)
{
BasStock oldBasStock = basStockMapper.selectBasStockByStockId2(basStock.getStockId(),basStock.getWarehouseCode());
BasStock oldBasStock = basStockMapper.selectBasStockByStockId(basStock.getStockId());
insertMaintainRecord(oldBasStock,basStock,"2");
insertFreezeRecord(oldBasStock,basStock);
return basStockMapper.updateBasStock2(basStock);
return basStockMapper.updateBasStock(basStock);
}
private void insertFreezeRecord(BasStock oldBasStock, BasStock basStock) {
@@ -194,28 +194,6 @@ public class BasStockServiceImpl implements IBasStockService
return basStockMapper.getStockBySerial(trayCode);
}
@Override
public BasStock selectBasStockByStockId2(String stockId, String warehouseCode) {
return basStockMapper.selectBasStockByStockId2(stockId,warehouseCode);
}
@Override
@Transactional(rollbackFor = Exception.class)
public int deleteBasStockByStockIds2(String[] stockIds,String warehouseCode)
{
for (String stockId : stockIds) {
BasStock oldBasStock = basStockMapper.selectBasStockByStockId2(stockId,warehouseCode);
insertMaintainRecord(oldBasStock,oldBasStock,"3");
}
return basStockMapper.deleteBasStockByStockIds2(stockIds,warehouseCode);
}
@Override
public BasStock selectBasStockListTopOne(String trayCode) {
return basStockMapper.selectBasStockListTopOne(trayCode);
}
/**
* 新增库存信息(不记录维护记录)
*

View File

@@ -71,7 +71,7 @@ spring:
# redis 配置
redis:
# 地址
host: 127.0.0.1
host: 192.168.188.236
# 端口,默认为6379
port: 6379
# 数据库索引
@@ -133,7 +133,7 @@ token:
# 令牌密钥
secret: abcdefghijklmnopqrstuvwxyz
# 令牌有效期(默认30分钟)
expireTime: 43800
expireTime: 720
@@ -175,6 +175,4 @@ xss:
# 匹配链接
urlPatterns: /system/*,/monitor/*,/tool/*
mybatis-plus:
configuration:
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8" ?>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
@@ -19,21 +19,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectAgvContainerTaskVo">
select top 1 id, container, start_point, end_point, create_time, start_time, finish_time, task_no, status, spare1, spare2 from agv_container_task
select id, container, start_point, end_point, create_time, start_time, finish_time, task_no, status, spare1, spare2 from agv_container_task
</sql>
<select id="selectAgvContainerTaskList" parameterType="AgvContainerTask" resultMap="AgvContainerTaskResult">
<include refid="selectAgvContainerTaskVo"/>
<where>
<if test="container != null and container != ''"> and container like concat('%', #{container}, '%')</if>
<if test="startPoint != null and startPoint != ''"> and start_point like concat('%', #{startPoint}, '%')</if>
<if test="endPoint != null and endPoint != ''"> and end_point like concat('%', #{endPoint}, '%')</if>
<if test="startTime != null and startTime != ''"> and start_time like concat('%', #{startTime}, '%')</if>
<if test="finishTime != null and finishTime != ''"> and finish_time like concat('%', #{finishTime}, '%')</if>
<if test="taskNo != null and taskNo != ''"> and task_no like concat('%', #{taskNo}, '%')</if>
<if test="container != null and container != ''"> and container = #{container}</if>
<if test="startPoint != null and startPoint != ''"> and start_point = #{startPoint}</if>
<if test="endPoint != null and endPoint != ''"> and end_point = #{endPoint}</if>
<if test="startTime != null and startTime != ''"> and start_time = #{startTime}</if>
<if test="finishTime != null and finishTime != ''"> and finish_time = #{finishTime}</if>
<if test="taskNo != null and taskNo != ''"> and task_no = #{taskNo}</if>
<if test="status != null and status != ''"> and status = #{status}</if>
<if test="spare1 != null and spare1 != ''"> and spare1 like concat('%', #{spare1}, '%')</if>
<if test="spare2 != null and spare2 != ''"> and spare2 like concat('%', #{spare2}, '%')</if>
<if test="spare1 != null and spare1 != ''"> and spare1 = #{spare1}</if>
<if test="spare2 != null and spare2 != ''"> and spare2 = #{spare2}</if>
</where>
</select>
@@ -101,10 +101,4 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{id}
</foreach>
</delete>
<delete id="deleteAgvJobByOrder" parameterType="string">
delete from agv_container_task where container = #{order}
</delete>
</mapper>

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8" ?>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
@@ -28,14 +28,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectChatMessageList" parameterType="ChatMessage" resultMap="ChatMessageResult">
<include refid="selectChatMessageVo"/>
<where>
<if test="sessionId != null "> and session_id like concat('%', #{sessionId}, '%')</if>
<if test="conversationId != null "> and conversation_id like concat('%', #{conversationId}, '%')</if>
<if test="content != null and content != ''"> and content like concat('%', #{content}, '%')</if>
<if test="role != null and role != ''"> and role like concat('%', #{role}, '%')</if>
<if test="deductCost != null "> and deduct_cost like concat('%', #{deductCost}, '%')</if>
<if test="totalTokens != null "> and total_tokens like concat('%', #{totalTokens}, '%')</if>
<if test="sessionId != null "> and session_id = #{sessionId}</if>
<if test="conversationId != null "> and conversation_id = #{conversationId}</if>
<if test="content != null and content != ''"> and content = #{content}</if>
<if test="role != null and role != ''"> and role = #{role}</if>
<if test="deductCost != null "> and deduct_cost = #{deductCost}</if>
<if test="totalTokens != null "> and total_tokens = #{totalTokens}</if>
<if test="modelName != null and modelName != ''"> and model_name like concat('%', #{modelName}, '%')</if>
<if test="createDept != null "> and create_dept like concat('%', #{createDept}, '%')</if>
<if test="createDept != null "> and create_dept = #{createDept}</if>
</where>
order by create_time asc
</select>
@@ -115,4 +115,3 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
delete from chat_message where conversation_id = #{conversationId}
</delete>
</mapper>

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8" ?>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
@@ -26,17 +26,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectConversationsList" parameterType="Conversations" resultMap="ConversationsResult">
<include refid="selectConversationsVo"/>
<where>
<if test="sessionId != null and sessionId != ''"> and session_id like concat('%', #{sessionId}, '%')</if>
<if test="userId != null and userId != ''"> and user_id like concat('%', #{userId}, '%')</if>
<if test="title != null and title != ''"> and title like concat('%', #{title}, '%')</if>
<if test="status != null and status != ''"> and status like concat('%', #{status}, '%')</if>
<if test="metadata != null and metadata != ''"> and metadata like concat('%', #{metadata}, '%')</if>
<if test="firstQuery != null and firstQuery != ''"> and first_query like concat('%', #{firstQuery}, '%')</if>
<if test="messageCount != null "> and message_count like concat('%', #{messageCount}, '%')</if>
<if test="tokenUsage != null "> and token_usage like concat('%', #{tokenUsage}, '%')</if>
<if test="createdAt != null "> and created_at like concat('%', #{createdAt}, '%')</if>
<if test="updatedAt != null "> and updated_at like concat('%', #{updatedAt}, '%')</if>
<if test="lastInteractionAt != null "> and last_interaction_at like concat('%', #{lastInteractionAt}, '%')</if>
<if test="sessionId != null and sessionId != ''"> and session_id = #{sessionId}</if>
<if test="userId != null and userId != ''"> and user_id = #{userId}</if>
<if test="title != null and title != ''"> and title = #{title}</if>
<if test="status != null and status != ''"> and status = #{status}</if>
<if test="metadata != null and metadata != ''"> and metadata = #{metadata}</if>
<if test="firstQuery != null and firstQuery != ''"> and first_query = #{firstQuery}</if>
<if test="messageCount != null "> and message_count = #{messageCount}</if>
<if test="tokenUsage != null "> and token_usage = #{tokenUsage}</if>
<if test="createdAt != null "> and created_at = #{createdAt}</if>
<if test="updatedAt != null "> and updated_at = #{updatedAt}</if>
<if test="lastInteractionAt != null "> and last_interaction_at = #{lastInteractionAt}</if>
order by id desc
</where>
</select>
@@ -105,4 +105,3 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</foreach>
</delete>
</mapper>

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8" ?>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
@@ -26,17 +26,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectKnowledgeFileList" parameterType="KnowledgeFile" resultMap="KnowledgeFileResult">
<include refid="selectKnowledgeFileVo"/>
<where>
<if test="knowledgeBaseId != null "> and knowledge_base_id like concat('%', #{knowledgeBaseId}, '%')</if>
<if test="knowledgeBaseId != null "> and knowledge_base_id = #{knowledgeBaseId}</if>
<if test="fileName != null and fileName != ''"> and file_name like concat('%', #{fileName}, '%')</if>
<if test="filePath != null and filePath != ''"> and file_path like concat('%', #{filePath}, '%')</if>
<if test="fileSize != null "> and file_size like concat('%', #{fileSize}, '%')</if>
<if test="fileType != null and fileType != ''"> and file_type like concat('%', #{fileType}, '%')</if>
<if test="description != null and description != ''"> and description like concat('%', #{description}, '%')</if>
<if test="isVectorized != null "> and is_vectorized like concat('%', #{isVectorized}, '%')</if>
<if test="vectorizedTime != null "> and vectorized_time like concat('%', #{vectorizedTime}, '%')</if>
<if test="uploadTime != null "> and upload_time like concat('%', #{uploadTime}, '%')</if>
<if test="updatedAt != null "> and updated_at like concat('%', #{updatedAt}, '%')</if>
<if test="isDeleted != null "> and is_deleted like concat('%', #{isDeleted}, '%')</if>
<if test="filePath != null and filePath != ''"> and file_path = #{filePath}</if>
<if test="fileSize != null "> and file_size = #{fileSize}</if>
<if test="fileType != null and fileType != ''"> and file_type = #{fileType}</if>
<if test="description != null and description != ''"> and description = #{description}</if>
<if test="isVectorized != null "> and is_vectorized = #{isVectorized}</if>
<if test="vectorizedTime != null "> and vectorized_time = #{vectorizedTime}</if>
<if test="uploadTime != null "> and upload_time = #{uploadTime}</if>
<if test="updatedAt != null "> and updated_at = #{updatedAt}</if>
<if test="isDeleted != null "> and is_deleted = #{isDeleted}</if>
</where>
</select>
@@ -103,4 +103,4 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{id}
</foreach>
</delete>
</mapper>
</mapper>

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8" ?>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
@@ -26,17 +26,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectMoveMsgList" parameterType="MoveMsg" resultMap="MoveMsgResult">
<include refid="selectMoveMsgVo"/>
<where>
<if test="trayCode != null and trayCode != ''"> and tray_code like concat('%', #{trayCode}, '%')</if>
<if test="oldSpace != null and oldSpace != ''"> and old_space like concat('%', #{oldSpace}, '%')</if>
<if test="newSpace != null and newSpace != ''"> and new_space like concat('%', #{newSpace}, '%')</if>
<if test="status != null and status != ''"> and status like concat('%', #{status}, '%')</if>
<if test="sendTime != null and sendTime != ''"> and send_time like concat('%', #{sendTime}, '%')</if>
<if test="msg != null and msg != ''"> and msg like concat('%', #{msg}, '%')</if>
<if test="spare1 != null and spare1 != ''"> and spare1 like concat('%', #{spare1}, '%')</if>
<if test="spare2 != null and spare2 != ''"> and spare2 like concat('%', #{spare2}, '%')</if>
<if test="spare3 != null and spare3 != ''"> and spare3 like concat('%', #{spare3}, '%')</if>
<if test="spare4 != null and spare4 != ''"> and spare4 like concat('%', #{spare4}, '%')</if>
<if test="spare5 != null and spare5 != ''"> and spare5 like concat('%', #{spare5}, '%')</if>
<if test="trayCode != null and trayCode != ''"> and tray_code = #{trayCode}</if>
<if test="oldSpace != null and oldSpace != ''"> and old_space = #{oldSpace}</if>
<if test="newSpace != null and newSpace != ''"> and new_space = #{newSpace}</if>
<if test="status != null and status != ''"> and status = #{status}</if>
<if test="sendTime != null and sendTime != ''"> and send_time = #{sendTime}</if>
<if test="msg != null and msg != ''"> and msg = #{msg}</if>
<if test="spare1 != null and spare1 != ''"> and spare1 = #{spare1}</if>
<if test="spare2 != null and spare2 != ''"> and spare2 = #{spare2}</if>
<if test="spare3 != null and spare3 != ''"> and spare3 = #{spare3}</if>
<if test="spare4 != null and spare4 != ''"> and spare4 = #{spare4}</if>
<if test="spare5 != null and spare5 != ''"> and spare5 = #{spare5}</if>
</where>
</select>
@@ -105,4 +105,4 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{id}
</foreach>
</delete>
</mapper>
</mapper>

View File

@@ -21,7 +21,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectAgvPointList" parameterType="AgvPoint" resultMap="AgvPointResult">
<include refid="selectAgvPointVo"/>
<where>
<if test="station != null and station != ''"> and station like concat('%',#{station},'%') </if>
<if test="station != null and station != ''"> and station = #{station}</if>
<if test="type != null and type != ''"> and type = #{type}</if>
<if test="spare1 != null and spare1 != ''"> and spare1 = #{spare1}</if>
<if test="spare2 != null and spare2 != ''"> and spare2 = #{spare2}</if>

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8" ?>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
@@ -23,14 +23,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectBasContainerDetailsList" parameterType="BasContainerDetails" resultMap="BasContainerDetailsResult">
<include refid="selectBasContainerDetailsVo"/>
<where>
<if test="containerId != null and containerId != ''"> and container_id like concat('%', #{containerId}, '%')</if>
<if test="productId != null and productId != ''"> and product_id like concat('%', #{productId}, '%')</if>
<if test="containerId != null and containerId != ''"> and container_id = #{containerId}</if>
<if test="productId != null and productId != ''"> and product_id = #{productId}</if>
<if test="productName != null and productName != ''"> and product_name like concat('%', #{productName}, '%')</if>
<if test="quantity != null "> and quantity like concat('%', #{quantity}, '%')</if>
<if test="unit != null and unit != ''"> and unit like concat('%', #{unit}, '%')</if>
<if test="spare1 != null and spare1 != ''"> and spare1 like concat('%', #{spare1}, '%')</if>
<if test="spare2 != null and spare2 != ''"> and spare2 like concat('%', #{spare2}, '%')</if>
<if test="spare3 != null and spare3 != ''"> and spare3 like concat('%', #{spare3}, '%')</if>
<if test="quantity != null "> and quantity = #{quantity}</if>
<if test="unit != null and unit != ''"> and unit = #{unit}</if>
<if test="spare1 != null and spare1 != ''"> and spare1 = #{spare1}</if>
<if test="spare2 != null and spare2 != ''"> and spare2 = #{spare2}</if>
<if test="spare3 != null and spare3 != ''"> and spare3 = #{spare3}</if>
</where>
</select>
@@ -90,4 +90,4 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{id}
</foreach>
</delete>
</mapper>
</mapper>

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8" ?>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
@@ -26,11 +26,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectBasContainerVo"/>
<where>
<if test="containerId != null and containerId != ''"> and container_id like concat('%', #{containerId}, '%')</if>
<if test="portName != null and portName != ''"> and port_name like concat('%', #{portName}, '%')</if>
<if test="status != null "> and status like concat('%', #{status}, '%')</if>
<if test="productTypeQuantity != null "> and product_type_quantity like concat('%', #{productTypeQuantity}, '%')</if>
<if test="updateTime != null and updateTime != ''"> and update_time like concat('%', #{updateTime}, '%')</if>
<if test="operationMan != null and operationMan != ''"> and operation_man like concat('%', #{operationMan}, '%')</if>
<if test="portName != null and portName != ''"> and port_name = #{portName}</if>
<if test="status != null "> and status = #{status}</if>
<if test="productTypeQuantity != null "> and product_type_quantity = #{productTypeQuantity}</if>
<if test="updateTime != null and updateTime != ''"> and update_time = #{updateTime}</if>
<if test="operationMan != null and operationMan != ''"> and operation_man = #{operationMan}</if>
</where>
</select>
@@ -102,4 +102,4 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectPortNames" resultType="string">
SELECT DISTINCT port_name FROM bas_product_port WHERE port_name != null or port_name != ''
</select>
</mapper>
</mapper>

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8" ?>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
@@ -39,7 +39,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="customerGroupNo != null and customerGroupNo != ''"> and customer_group_no like concat('%', #{customerGroupNo}, '%')</if>
<if test="customerName != null and customerName != ''"> and customer_name like concat('%', #{customerName}, '%')</if>
<if test="simpleName != null and simpleName != ''"> and simple_name like concat('%', #{simpleName}, '%')</if>
<if test="useable != null and useable != ''"> and useable like concat('%', #{useable}, '%')</if>
<if test="useable != null and useable != ''"> and useable = #{useable}</if>
<if test="businessDepartment != null and businessDepartment != ''"> and business_department like concat('%', #{businessDepartment}, '%')</if>
<if test="salesman != null and salesman != ''"> and salesman like concat('%', #{salesman}, '%')</if>
<if test="mnemonicCode != null and mnemonicCode != ''"> and mnemonic_code like concat('%', #{mnemonicCode}, '%')</if>
@@ -149,4 +149,4 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{id}
</foreach>
</delete>
</mapper>
</mapper>

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8" ?>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
@@ -34,25 +34,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectBasJobIdList" parameterType="BasJobId" resultMap="BasJobIdResult">
<include refid="selectBasJobIdVo"/>
<where>
<if test="type != null and type != ''"> and type like concat('%', #{type}, '%')</if>
<if test="jobId != null and jobId != ''"> and job_id like concat('%', #{jobId}, '%')</if>
<if test="jobDetail != null and jobDetail != ''"> and job_detail like concat('%', #{jobDetail}, '%')</if>
<if test="stockId != null and stockId != ''"> and stock_id like concat('%', #{stockId}, '%')</if>
<if test="orderId != null and orderId != ''"> and order_id like concat('%', #{orderId}, '%')</if>
<if test="exorderId != null and exorderId != ''"> and Exorder_id like concat('%', #{exorderId}, '%')</if>
<if test="jobIdR != null and jobIdR != ''"> and job_id_R like concat('%', #{jobIdR}, '%')</if>
<if test="jobDetailR != null and jobDetailR != ''"> and job_detail_R like concat('%', #{jobDetailR}, '%')</if>
<if test="jobIdC != null and jobIdC != ''"> and job_id_C like concat('%', #{jobIdC}, '%')</if>
<if test="jobDetailC != null and jobDetailC != ''"> and job_detail_C like concat('%', #{jobDetailC}, '%')</if>
<if test="tempOrderId != null and tempOrderId != ''"> and temp_order_id like concat('%', #{tempOrderId}, '%')</if>
<if test="lotNo != null and lotNo != ''"> and lot_no like concat('%', #{lotNo}, '%')</if>
<if test="stockinId != null and stockinId != ''"> and stockin_id like concat('%', #{stockinId}, '%')</if>
<if test="stockinDetailId != null and stockinDetailId != ''"> and stockin_detail_id like concat('%', #{stockinDetailId}, '%')</if>
<if test="stockoutId != null and stockoutId != ''"> and stockout_id like concat('%', #{stockoutId}, '%')</if>
<if test="stockoutDetailId != null and stockoutDetailId != ''"> and stockout_detail_id like concat('%', #{stockoutDetailId}, '%')</if>
<if test="planId != null and planId != ''"> and plan_id like concat('%', #{planId}, '%')</if>
<if test="jobIdY != null and jobIdY != ''"> and job_id_y like concat('%', #{jobIdY}, '%')</if>
<if test="jobIdS != null and jobIdS != ''"> and job_id_s like concat('%', #{jobIdS}, '%')</if>
<if test="type != null and type != ''"> and type = #{type}</if>
<if test="jobId != null and jobId != ''"> and job_id = #{jobId}</if>
<if test="jobDetail != null and jobDetail != ''"> and job_detail = #{jobDetail}</if>
<if test="stockId != null and stockId != ''"> and stock_id = #{stockId}</if>
<if test="orderId != null and orderId != ''"> and order_id = #{orderId}</if>
<if test="exorderId != null and exorderId != ''"> and Exorder_id = #{exorderId}</if>
<if test="jobIdR != null and jobIdR != ''"> and job_id_R = #{jobIdR}</if>
<if test="jobDetailR != null and jobDetailR != ''"> and job_detail_R = #{jobDetailR}</if>
<if test="jobIdC != null and jobIdC != ''"> and job_id_C = #{jobIdC}</if>
<if test="jobDetailC != null and jobDetailC != ''"> and job_detail_C = #{jobDetailC}</if>
<if test="tempOrderId != null and tempOrderId != ''"> and temp_order_id = #{tempOrderId}</if>
<if test="lotNo != null and lotNo != ''"> and lot_no = #{lotNo}</if>
<if test="stockinId != null and stockinId != ''"> and stockin_id = #{stockinId}</if>
<if test="stockinDetailId != null and stockinDetailId != ''"> and stockin_detail_id = #{stockinDetailId}</if>
<if test="stockoutId != null and stockoutId != ''"> and stockout_id = #{stockoutId}</if>
<if test="stockoutDetailId != null and stockoutDetailId != ''"> and stockout_detail_id = #{stockoutDetailId}</if>
<if test="planId != null and planId != ''"> and plan_id = #{planId}</if>
<if test="jobIdY != null and jobIdY != ''"> and job_id_y = #{jobIdY}</if>
<if test="jobIdS != null and jobIdS != ''"> and job_id_s = #{jobIdS}</if>
</where>
</select>
@@ -162,4 +162,3 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
</mapper>

View File

@@ -1,65 +0,0 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.Dzp.mapper.BasLedMapper">
<resultMap type="basLed" id="basLedResult">
<result property="id" column="id"/>
<result property="product_id" column="product_id"/>
<result property="spec" column="spec"/>
<result property="sendFlag" column="send_flag"/>
<result property="ipAddress" column="ip_address"/>
<result property="quantity" column="quantity"/>
<result property="trayCode" column="tray_code"/>
<result property="model" column="model"/>
<result property="productName" column="product_name"/>
<result property="errorMsg" column="error_msg"/>
</resultMap>
<sql id="selectBasContainerVo">
select id,
product_id,
spec,
quantity,
send_flag,
ip_address,
tray_code,
model,
product_name,
error_msg
from bas_led
</sql>
<select id="selectBasLedList" parameterType="basLed" resultMap="basLedResult">
<include refid="selectBasContainerVo"/>
<where>
<if test="sendFlag != null and sendFlag != ''">and send_flag = #{sendFlag}
</if>
<if test="id != null and id != ''">and id = #{id}
</if>
</where>
</select>
<update id="updateBasLed" parameterType="basLed">
update bas_led
<trim prefix="SET" suffixOverrides=",">
<if test="product_id != null">product_id = #{product_id},</if>
<if test="sendFlag != null">send_flag = #{sendFlag},</if>
<if test="spec != null">spec = #{spec},</if>
<if test="quantity != null">quantity = #{quantity},</if>
</trim>
where id = #{id}
</update>
</mapper>

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8" ?>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
@@ -31,7 +31,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectBasProductCodeList" parameterType="BasProductCode" resultMap="BasProductCodeResult">
<include refid="selectBasProductCodeVo"/>
<where>
<if test="model != null and model != ''"> and model like concat('%', #{model}, '%')</if>
<if test="model != null and model != ''"> and model = #{model}</if>
<if test="color != null and color != ''"> and color like concat('%', #{color}, '%')</if>
<if test="serial != null and serial != ''"> and serial like concat('%', #{serial}, '%')</if>
<if test="v != null and v != ''"> and v like concat('%', #{v}, '%')</if>
@@ -39,13 +39,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="ph != null and ph != ''"> and ph like concat('%', #{ph}, '%')</if>
<if test="nW != null and nW != ''"> and n_w like concat('%', #{nW}, '%')</if>
<if test="gW != null and gW != ''"> and g_w like concat('%', #{gW}, '%')</if>
<if test="type != null and type != ''"> and type like concat('%', #{type}, '%')</if>
<if test="spare1 != null and spare1 != ''"> and spare1 like concat('%', #{spare1}, '%')</if>
<if test="spare2 != null and spare2 != ''"> and spare2 like concat('%', #{spare2}, '%')</if>
<if test="spare3 != null and spare3 != ''"> and spare3 like concat('%', #{spare3}, '%')</if>
<if test="spare4 != null and spare4 != ''"> and spare4 like concat('%', #{spare4}, '%')</if>
<if test="spare5 != null and spare5 != ''"> and spare5 like concat('%', #{spare5}, '%')</if>
<if test="spare6 != null and spare6 != ''"> and spare6 like concat('%', #{spare6}, '%')</if>
<if test="type != null and type != ''"> and type = #{type}</if>
<if test="spare1 != null and spare1 != ''"> and spare1 = #{spare1}</if>
<if test="spare2 != null and spare2 != ''"> and spare2 = #{spare2}</if>
<if test="spare3 != null and spare3 != ''"> and spare3 = #{spare3}</if>
<if test="spare4 != null and spare4 != ''"> and spare4 = #{spare4}</if>
<if test="spare5 != null and spare5 != ''"> and spare5 = #{spare5}</if>
<if test="spare6 != null and spare6 != ''"> and spare6 = #{spare6}</if>
</where>
</select>
@@ -129,4 +129,4 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{id}
</foreach>
</delete>
</mapper>
</mapper>

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8" ?>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
@@ -21,9 +21,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectBasProductPortVo"/>
<where>
<if test="portName != null and portName != ''"> and port_name like concat('%', #{portName}, '%')</if>
<if test="portType != null and portType != ''"> and port_type like concat('%', #{portType}, '%')</if>
<if test="portDesc != null and portDesc != ''"> and port_desc like concat('%', #{portDesc}, '%')</if>
<if test="createMan != null and createMan != ''"> and create_man like concat('%', #{createMan}, '%')</if>
<if test="portType != null and portType != ''"> and port_type = #{portType}</if>
<if test="portDesc != null and portDesc != ''"> and port_desc = #{portDesc}</if>
<if test="createMan != null and createMan != ''"> and create_man = #{createMan}</if>
</where>
</select>
@@ -74,4 +74,4 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{id}
</foreach>
</delete>
</mapper>
</mapper>

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8" ?>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
@@ -43,9 +43,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectBasProductPortRelList" parameterType="BasProductPortRel" resultMap="BasProductPortRelResult">
<include refid="selectBasProductPortRelVo"/>
<where>
<if test="productGuid != null and productGuid != ''"> and product_guid like concat('%', #{productGuid}, '%')</if>
<if test="productId != null and productId != ''"> and product_id like concat('%', #{productId}, '%')</if>
<if test="portId != null and portId != ''"> and port_id like concat('%', #{portId}, '%')</if>
<if test="productGuid != null and productGuid != ''"> and product_guid = #{productGuid}</if>
<if test="productId != null and productId != ''"> and product_id = #{productId}</if>
<if test="portId != null and portId != ''"> and port_id = #{portId}</if>
</where>
</select>
@@ -63,7 +63,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="bindStatus =='0'.toString()">
and product_id not in (select product_id from bas_product_port_rel where port_id=#{portId})
</if>
<if test="productId != null and productId != ''"> and product_id like concat('%', #{productId}, '%')</if>
<if test="productId != null and productId != ''"> and product_id = #{productId}</if>
<if test="productName != null and productName != ''"> and product_name like concat('%', #{productName}, '%')</if>
</where>
@@ -112,4 +112,3 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</foreach>
</delete>
</mapper>

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8" ?>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
@@ -23,14 +23,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectBasRoadwayList" parameterType="BasRoadway" resultMap="BasRoadwayResult">
<include refid="selectBasRoadwayVo"/>
<where>
<if test="roadwayId != null and roadwayId != ''"> and roadway_id like concat('%', #{roadwayId}, '%')</if>
<if test="warehouseId != null and warehouseId != ''"> and warehouse_id like concat('%', #{warehouseId}, '%')</if>
<if test="roadwayId != null and roadwayId != ''"> and roadway_id = #{roadwayId}</if>
<if test="warehouseId != null and warehouseId != ''"> and warehouse_id = #{warehouseId}</if>
<if test="roadwayName != null and roadwayName != ''"> and roadway_name like concat('%', #{roadwayName}, '%')</if>
<if test="deviceId != null and deviceId != ''"> and device_id like concat('%', #{deviceId}, '%')</if>
<if test="inLocked != null and inLocked != ''"> and in_locked like concat('%', #{inLocked}, '%')</if>
<if test="outLocked != null and outLocked != ''"> and out_locked like concat('%', #{outLocked}, '%')</if>
<if test="inLocked2 != null and inLocked2 != ''"> and in_locked2 like concat('%', #{inLocked2}, '%')</if>
<if test="outLocked2 != null and outLocked2 != ''"> and out_locked2 like concat('%', #{outLocked2}, '%')</if>
<if test="deviceId != null and deviceId != ''"> and device_id = #{deviceId}</if>
<if test="inLocked != null and inLocked != ''"> and in_locked = #{inLocked}</if>
<if test="outLocked != null and outLocked != ''"> and out_locked = #{outLocked}</if>
<if test="inLocked2 != null and inLocked2 != ''"> and in_locked2 = #{inLocked2}</if>
<if test="outLocked2 != null and outLocked2 != ''"> and out_locked2 = #{outLocked2}</if>
</where>
</select>
@@ -90,4 +90,4 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{id}
</foreach>
</delete>
</mapper>
</mapper>

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8" ?>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
@@ -37,7 +37,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="supplierGroupNo != null and supplierGroupNo != ''"> and supplier_group_no like concat('%', #{supplierGroupNo}, '%')</if>
<if test="supplierName != null and supplierName != ''"> and supplier_name like concat('%', #{supplierName}, '%')</if>
<if test="simpleName != null and simpleName != ''"> and simple_name like concat('%', #{simpleName}, '%')</if>
<if test="useable != null and useable != ''"> and useable like concat('%', #{useable}, '%')</if>
<if test="useable != null and useable != ''"> and useable = #{useable}</if>
<if test="supplierArae != null and supplierArae != ''"> and supplier_arae like concat('%', #{supplierArae}, '%')</if>
<if test="taxpayerRegistrationNumber != null and taxpayerRegistrationNumber != ''"> and taxpayer_registration_number like concat('%', #{taxpayerRegistrationNumber}, '%')</if>
<if test="country != null and country != ''"> and country like concat('%', #{country}, '%')</if>
@@ -139,4 +139,4 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{id}
</foreach>
</delete>
</mapper>
</mapper>

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8" ?>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
@@ -23,14 +23,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectBasTagList" parameterType="BasTag" resultMap="BasTagResult">
<include refid="selectBasTagVo"/>
<where>
<if test="ip != null and ip != ''"> and ip like concat('%', #{ip}, '%')</if>
<if test="pickAdd != null and pickAdd != ''"> and pick_add like concat('%', #{pickAdd}, '%')</if>
<if test="trayCode != null and trayCode != ''"> and tray_code like concat('%', #{trayCode}, '%')</if>
<if test="curNum != null and curNum != ''"> and cur_num like concat('%', #{curNum}, '%')</if>
<if test="sendCompleted != null and sendCompleted != ''"> and send_completed like concat('%', #{sendCompleted}, '%')</if>
<if test="spare1 != null and spare1 != ''"> and spare1 like concat('%', #{spare1}, '%')</if>
<if test="spare2 != null and spare2 != ''"> and spare2 like concat('%', #{spare2}, '%')</if>
<if test="spare3 != null and spare3 != ''"> and spare3 like concat('%', #{spare3}, '%')</if>
<if test="ip != null and ip != ''"> and ip = #{ip}</if>
<if test="pickAdd != null and pickAdd != ''"> and pick_add = #{pickAdd}</if>
<if test="trayCode != null and trayCode != ''"> and tray_code = #{trayCode}</if>
<if test="curNum != null and curNum != ''"> and cur_num = #{curNum}</if>
<if test="sendCompleted != null and sendCompleted != ''"> and send_completed = #{sendCompleted}</if>
<if test="spare1 != null and spare1 != ''"> and spare1 = #{spare1}</if>
<if test="spare2 != null and spare2 != ''"> and spare2 = #{spare2}</if>
<if test="spare3 != null and spare3 != ''"> and spare3 = #{spare3}</if>
</where>
</select>
@@ -93,4 +93,3 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</foreach>
</delete>
</mapper>

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