From e0a61480eba85a78da08ec8ad2dd1f6d61e3baa5 Mon Sep 17 00:00:00 2001 From: lgh0010 <1746689524@qq.com> Date: Sat, 1 Jan 2022 23:15:06 +0800 Subject: [PATCH] =?UTF-8?q?=E5=87=BA=E5=BA=93=E7=9B=B8=E5=85=B3=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 5.数据库/dump-mt_wms_qj-202112230921.sql | 1765 +++++++++++++++++ .../mt/wms/core/dal/entity/ParEleValue.java | 10 +- .../core/dal/mapper/ParEleValueMapper.java | 2 +- .../wms/core/dal/mapper/ParEleValueMapper.xml | 4 +- .../dal/service/ParEleValueServiceBiz.java | 2 +- .../impl/ParEleValueServiceBizImpl.java | 2 +- .../empty/controller/ElectricController.java | 124 +- .../wms/empty/params/AlarmInfoQueryParam.java | 4 +- .../service/impl/AlarmInfoServiceImpl.java | 2 +- .../service/impl/OutStockServiceImpl.java | 25 +- .../service/impl/StockInfoServiceImpl.java | 15 +- .../mt/wms/empty/task/AsynRunTaskService.java | 107 +- .../com/mt/wms/empty/task/RunTaskUtils.java | 37 +- .../com/mt/wms/empty/task/ScheduledTask.java | 30 +- .../com/mt/wms/empty/vo/CurrTaskDetVo.java | 2 +- .../java/com/mt/wms/empty/vo/StockInfoVo.java | 4 +- 16 files changed, 2099 insertions(+), 36 deletions(-) create mode 100644 5.数据库/dump-mt_wms_qj-202112230921.sql diff --git a/5.数据库/dump-mt_wms_qj-202112230921.sql b/5.数据库/dump-mt_wms_qj-202112230921.sql new file mode 100644 index 0000000..f982b4b --- /dev/null +++ b/5.数据库/dump-mt_wms_qj-202112230921.sql @@ -0,0 +1,1765 @@ +-- MySQL dump 10.13 Distrib 5.5.40, for Win64 (x86) +-- +-- Host: mysql.picaiba.com Database: mt_wms_qj +-- ------------------------------------------------------ +-- Server version 8.0.25 + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; + +-- +-- Table structure for table `t_alarm_base` +-- + +DROP TABLE IF EXISTS `t_alarm_base`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_alarm_base` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `valid` int NOT NULL DEFAULT '1' COMMENT '删除标志,是否有效:1 可用 0不可用', + `create_time` datetime DEFAULT NULL COMMENT '添加时间', + `creator_id` int DEFAULT '0' COMMENT '创建人id', + `updater_id` int DEFAULT '0' COMMENT '更新人id', + `update_time` datetime DEFAULT NULL COMMENT '修改时间', + `version` varchar(11) DEFAULT '1' COMMENT '版本号 默认为 1', + `status` int DEFAULT '0' COMMENT '状态 0初始化', + `inter_code` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '内部编码', + `code` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '编码', + `alarm_class` varchar(128) DEFAULT '' COMMENT '报警类型,数据字典获取', + `alarm_code` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '报警编码', + `alarm_info` varchar(1024) NOT NULL COMMENT '报警内容', + `description` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '描述信息', + `note` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=252 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='报警基础表'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `t_alarm_info` +-- + +DROP TABLE IF EXISTS `t_alarm_info`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_alarm_info` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `valid` int NOT NULL DEFAULT '1' COMMENT '删除标志,是否有效:1 可用 0不可用', + `create_time` datetime DEFAULT NULL COMMENT '添加时间', + `creator_id` int DEFAULT '0' COMMENT '创建人id', + `updater_id` int DEFAULT '0' COMMENT '更新人id', + `update_time` datetime DEFAULT NULL COMMENT '修改时间', + `version` varchar(11) DEFAULT '1' COMMENT '版本号 默认为 1', + `status` int DEFAULT '0' COMMENT '状态 0初始化', + `inter_code` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '内部编码', + `code` varchar(128) DEFAULT '' COMMENT '编码', + `equipment_id` int NOT NULL COMMENT '设备id', + `equipment_name` varchar(128) DEFAULT '' COMMENT '设备名称', + `type` int DEFAULT '0' COMMENT '报警类型 0窑炉,1表示车辆,依次类推', + `alarm_code` varchar(128) NOT NULL COMMENT '报警编码', + `alarm_info` varchar(1024) DEFAULT '' COMMENT '报警内容', + `description` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '描述信息', + `note` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=250 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='报警信息'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `t_apms_check_result` +-- + +DROP TABLE IF EXISTS `t_apms_check_result`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_apms_check_result` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `valid` int NOT NULL DEFAULT '1' COMMENT '删除标志,是否有效:1 可用 0不可用,2停止', + `create_time` datetime DEFAULT NULL COMMENT '添加时间,入库时间', + `creator_id` int DEFAULT '0' COMMENT '创建人id', + `updater_id` int DEFAULT '0' COMMENT '更新人id', + `update_time` datetime DEFAULT NULL COMMENT '修改时间,更具修改时间来判断下次执行顺序,第一次修改时间和新增时间相同', + `version` varchar(11) DEFAULT '1' COMMENT '版本号 默认为 1', + `sheet_no` varchar(11) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '生产单号', + `iden_card_num` varchar(128) NOT NULL COMMENT '标识卡号', + `hardness` varchar(128) DEFAULT '' COMMENT '硬度检验结果(合格、不合格、返工、作废)', + `metallography` varchar(128) DEFAULT '' COMMENT '金相检验结果(合格、不合格)', + `heart_hardness` float(8,2) DEFAULT '0.00' COMMENT '心部硬度检验值', + PRIMARY KEY (`id`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='apms推送检验结果表'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `t_auto_exe_task` +-- + +DROP TABLE IF EXISTS `t_auto_exe_task`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_auto_exe_task` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `valid` int NOT NULL DEFAULT '1' COMMENT '删除标志,是否有效:1 可用 0不可用,2停止', + `create_time` datetime DEFAULT NULL COMMENT '添加时间,入库时间', + `status` int DEFAULT '0' COMMENT '状态,0:新增,1:执行中,2完成', + `inter_code` varchar(128) NOT NULL COMMENT '内部编码,系统自动生成', + `process_flow_id` bigint DEFAULT '0' COMMENT '工艺流程ID', + `process_flow_name` varchar(128) DEFAULT '' COMMENT '工艺流程名称', + `process_flow_type` int NOT NULL COMMENT '工艺类型,1表示第一种工艺流程,2表示第二种工艺流程', + `craft_code_id` bigint DEFAULT '0' COMMENT '工艺号ID', + `craft_code` varchar(128) DEFAULT '' COMMENT '工艺编码', + `warehouse_id` bigint DEFAULT '0' COMMENT '区域ID,区分不同操作区域', + `f_task_id` bigint DEFAULT '0' COMMENT '执行任务ID,关联任务表:t_curr_task', + `f_det_task_code` varchar(128) NOT NULL COMMENT '任务编码,子任务编码对应任务表t_curr_task中task_code编码', + `f_equipment_type_id` bigint DEFAULT '0' COMMENT '设备类型ID,关联设备类型表:t_equipment_type', + `f_equipment_id` bigint DEFAULT '0' COMMENT '设备ID,关联设备表:t_kiln_info', + `f_craft_code_id` bigint DEFAULT '0' COMMENT '工艺号ID,关联工艺号表:t_craft_info', + `f_plc_value` int DEFAULT '0' COMMENT '工艺号对应PLC值', + `f_in_tran_status` int DEFAULT '0' COMMENT '进炉运输状态,0:开始,1:运输中,2:运输完成', + `f_pro_status` int DEFAULT '0' COMMENT '加工状态,0:加工开始,1:加工中,2:加工完成', + `f_out_tran_status` int DEFAULT '0' COMMENT '出炉运输状态,0:开始,1:运输中,2:运输完成', + `t_task_id` bigint DEFAULT '0' COMMENT '执行任务ID,关联任务表:t_curr_task', + `t_det_task_code` varchar(128) NOT NULL COMMENT '任务编码,子任务编码对应任务表t_curr_task中task_code编码', + `t_equipment_type_id` bigint DEFAULT '0' COMMENT '设备类型ID,关联设备类型表:t_equipment_type', + `t_equipment_id` bigint DEFAULT '0' COMMENT '设备ID,关联设备表:t_kiln_info', + `t_craft_code_id` bigint DEFAULT '0' COMMENT '工艺号ID,关联工艺号表:t_craft_info', + `t_plc_value` int DEFAULT '0' COMMENT '工艺号对应PLC值', + `t_in_tran_status` int DEFAULT '0' COMMENT '进炉运输状态,0:开始,1:运输中,2:运输完成', + `t_pro_status` int DEFAULT '0' COMMENT '加工状态,0:加工开始,1:加工中,2:加工完成', + `t_out_tran_status` int DEFAULT '0' COMMENT '出炉运输状态,0:开始,1:运输中,2:运输完成', + `th_task_id` bigint DEFAULT '0' COMMENT '执行任务ID,关联任务表:t_curr_task', + `th_det_task_code` varchar(128) NOT NULL COMMENT '任务编码,子任务编码对应任务表t_curr_task中task_code编码', + `th_equipment_type_id` bigint DEFAULT '0' COMMENT '设备类型ID,关联设备类型表:t_equipment_type', + `th_equipment_id` bigint DEFAULT '0' COMMENT '设备ID,关联设备表:t_kiln_info', + `th_craft_code_id` bigint DEFAULT '0' COMMENT '工艺号ID,关联工艺号表:t_craft_info', + `th_plc_value` int DEFAULT '0' COMMENT '工艺号对应PLC值', + `th_in_tran_status` int DEFAULT '0' COMMENT '进炉运输状态,0:开始,1:运输中,2:运输完成', + `th_pro_status` int DEFAULT '0' COMMENT '加工状态,0:加工开始,1:加工中,2:加工完成', + `th_out_tran_status` int DEFAULT '0' COMMENT '出炉运输状态,0:开始,1:运输中,2:运输完成', + `content` varchar(1024) DEFAULT '' COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=250 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='自动执行任务表'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `t_auto_exe_task_his` +-- + +DROP TABLE IF EXISTS `t_auto_exe_task_his`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_auto_exe_task_his` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `valid` int NOT NULL DEFAULT '1' COMMENT '删除标志,是否有效:1 可用 0不可用,2停止', + `create_time` datetime DEFAULT NULL COMMENT '添加时间,入库时间', + `status` int DEFAULT '0' COMMENT '状态,0:新增,1:执行中,2完成', + `inter_code` varchar(128) NOT NULL COMMENT '内部编码,系统自动生成', + `process_flow_id` bigint DEFAULT '0' COMMENT '工艺流程ID', + `process_flow_name` varchar(128) DEFAULT '' COMMENT '工艺流程名称', + `process_flow_type` int NOT NULL COMMENT '工艺类型,1表示第一种工艺流程,2表示第二种工艺流程', + `craft_code_id` bigint DEFAULT '0' COMMENT '工艺号ID', + `craft_code` varchar(128) DEFAULT '' COMMENT '工艺编码', + `warehouse_id` bigint DEFAULT '0' COMMENT '区域ID,区分不同操作区域', + `f_task_id` bigint DEFAULT '0' COMMENT '执行任务ID,关联任务表:t_curr_task', + `f_det_task_code` varchar(128) NOT NULL COMMENT '任务编码,子任务编码对应任务表t_curr_task中task_code编码', + `f_equipment_type_id` bigint DEFAULT '0' COMMENT '设备类型ID,关联设备类型表:t_equipment_type', + `f_equipment_id` bigint DEFAULT '0' COMMENT '设备ID,关联设备表:t_kiln_info', + `f_craft_code_id` bigint DEFAULT '0' COMMENT '工艺号ID,关联工艺号表:t_craft_info', + `f_plc_value` int DEFAULT '0' COMMENT '工艺号对应PLC值', + `f_in_tran_status` int DEFAULT '0' COMMENT '进炉运输状态,0:开始,1:运输中,2:运输完成', + `f_pro_status` int DEFAULT '0' COMMENT '加工状态,0:加工开始,1:加工中,2:加工完成', + `f_out_tran_status` int DEFAULT '0' COMMENT '出炉运输状态,0:开始,1:运输中,2:运输完成', + `t_task_id` bigint DEFAULT '0' COMMENT '执行任务ID,关联任务表:t_curr_task', + `t_det_task_code` varchar(128) NOT NULL COMMENT '任务编码,子任务编码对应任务表t_curr_task中task_code编码', + `t_equipment_type_id` bigint DEFAULT '0' COMMENT '设备类型ID,关联设备类型表:t_equipment_type', + `t_equipment_id` bigint DEFAULT '0' COMMENT '设备ID,关联设备表:t_kiln_info', + `t_craft_code_id` bigint DEFAULT '0' COMMENT '工艺号ID,关联工艺号表:t_craft_info', + `t_plc_value` int DEFAULT '0' COMMENT '工艺号对应PLC值', + `t_in_tran_status` int DEFAULT '0' COMMENT '进炉运输状态,0:开始,1:运输中,2:运输完成', + `t_pro_status` int DEFAULT '0' COMMENT '加工状态,0:加工开始,1:加工中,2:加工完成', + `t_out_tran_status` int DEFAULT '0' COMMENT '出炉运输状态,0:开始,1:运输中,2:运输完成', + `th_task_id` bigint DEFAULT '0' COMMENT '执行任务ID,关联任务表:t_curr_task', + `th_det_task_code` varchar(128) NOT NULL COMMENT '任务编码,子任务编码对应任务表t_curr_task中task_code编码', + `th_equipment_type_id` bigint DEFAULT '0' COMMENT '设备类型ID,关联设备类型表:t_equipment_type', + `th_equipment_id` bigint DEFAULT '0' COMMENT '设备ID,关联设备表:t_kiln_info', + `th_craft_code_id` bigint DEFAULT '0' COMMENT '工艺号ID,关联工艺号表:t_craft_info', + `th_plc_value` int DEFAULT '0' COMMENT '工艺号对应PLC值', + `th_in_tran_status` int DEFAULT '0' COMMENT '进炉运输状态,0:开始,1:运输中,2:运输完成', + `th_pro_status` int DEFAULT '0' COMMENT '加工状态,0:加工开始,1:加工中,2:加工完成', + `th_out_tran_status` int DEFAULT '0' COMMENT '出炉运输状态,0:开始,1:运输中,2:运输完成', + `content` varchar(1024) DEFAULT '' COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=250 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='自动执行任务表'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `t_communication_log` +-- + +DROP TABLE IF EXISTS `t_communication_log`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_communication_log` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `valid` int NOT NULL DEFAULT '1' COMMENT '删除标志,是否有效:1 可用 0不可用,2停止', + `create_time` datetime DEFAULT NULL COMMENT '添加时间,入库时间', + `creator_id` int DEFAULT '0' COMMENT '创建人id', + `updater_id` int DEFAULT '0' COMMENT '更新人id', + `update_time` datetime DEFAULT NULL COMMENT '修改时间,更具修改时间来判断下次执行顺序,第一次修改时间和新增时间相同', + `version` varchar(11) DEFAULT '1' COMMENT '版本号 默认为 1', + `type` int DEFAULT '0' COMMENT '类型,0:wms To wcs日志,1:wcs to wms日志\r\n2:wms to apms日志 3:apms to wms日志', + `code` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '内部编码,系统自动生成', + `log_name` varchar(128) DEFAULT '' COMMENT '日志名称', + `content` varchar(1024) DEFAULT '' COMMENT '内容', + PRIMARY KEY (`id`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=288 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='通讯日志信息 包括wcs与wms apms与wms相互通讯'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `t_craft_info` +-- + +DROP TABLE IF EXISTS `t_craft_info`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_craft_info` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `valid` int NOT NULL DEFAULT '1' COMMENT '删除标志,是否有效:1 可用 0不可用,2停止', + `create_time` datetime DEFAULT NULL COMMENT '添加时间,入库时间', + `creator_id` int DEFAULT '0' COMMENT '创建人id', + `updater_id` int DEFAULT '0' COMMENT '更新人id', + `update_time` datetime DEFAULT NULL COMMENT '修改时间,更具修改时间来判断下次执行顺序,第一次修改时间和新增时间相同', + `version` varchar(11) DEFAULT '1' COMMENT '版本号 默认为 1', + `status` int DEFAULT '0' COMMENT '状态,0:可用,1:不可用', + `inter_code` varchar(128) NOT NULL COMMENT '内部编码,系统自动生成', + `craft_code` varchar(128) NOT NULL COMMENT '工艺号', + `code` varchar(128) DEFAULT '' COMMENT '编码', + `plc_value` int NOT NULL COMMENT '对应PLC值', + `content` varchar(1024) DEFAULT '' COMMENT '说明', + PRIMARY KEY (`id`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='设备工艺信息'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `t_curr_task` +-- + +DROP TABLE IF EXISTS `t_curr_task`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_curr_task` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `valid` int NOT NULL DEFAULT '1' COMMENT '删除标志,是否有效:1 可用 0不可用,2停止', + `create_time` datetime DEFAULT NULL COMMENT '添加时间,每次修改记录要更新记录新增时间', + `creator_id` int DEFAULT '0' COMMENT '创建人id', + `updater_id` int DEFAULT '0' COMMENT '更新人id', + `update_time` datetime DEFAULT NULL COMMENT '修改时间,更具修改时间来判断下次执行顺序,第一次修改时间和新增时间相同', + `version` varchar(11) DEFAULT '1' COMMENT '版本号 默认为 1', + `status` int DEFAULT '0' COMMENT '状态: 0等待执行,1执行中,2执行完成', + `inter_code` varchar(128) NOT NULL COMMENT '内部编码,系统自动生成', + `is_auto` int DEFAULT '0' COMMENT '是否自动执行: 0手动,1自动,如果是自动任务这里要监控进出和到缓存区的调度任务', + `auto_exe_task_id` bigint DEFAULT '0' COMMENT '任务流程ID,关联流程表:t_auto_exe_task', + `kiln_id` bigint NOT NULL COMMENT '窑炉id,关联设备窑炉表:t_kiln_info', + `kiln_name` varchar(128) DEFAULT '' COMMENT '窑炉名称', + `craft_code_id` bigint DEFAULT '0' COMMENT '工艺号ID,关联工艺号表:t_craft_info', + `plc_value` int DEFAULT '0' COMMENT '工艺号对应PLC值', + `begin_time` datetime DEFAULT NULL COMMENT '开始加工时间', + `end_time` datetime DEFAULT NULL COMMENT '加工结束时间', + `is_in` int DEFAULT '0' COMMENT '进炉状态: 0准备进炉,1正在加工,2加工完成', + `run_task_id` bigint DEFAULT '0' COMMENT '调度任务ID,关联调度表:t_run_task', + `start_position` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '开始位置', + `target_position` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '目标位置指的是窑炉的位置', + `is_cache` int DEFAULT '0' COMMENT '是否缓存,如果当前指的窑炉正在加工,系统自动分配货物到缓存位置,\r\n 并且记录缓存库位,这是当指定窑炉加工完成后系统先判断是否当前缓存有当前等待执行的任务,然后按照先来先执行原则(等待多个任务)自动调用车辆来执行', + `cache_satatus` int DEFAULT '0' COMMENT '缓存状态状态: 0准备进入缓存区,1正在进入缓存区,2缓存完成', + `cache_run_task_id` bigint DEFAULT '0' COMMENT '调度任务ID,关联调度表:t_run_task', + `location_id` bigint DEFAULT '0' COMMENT '库位id,关联库位表:t_location', + `location_name` varchar(128) DEFAULT '' COMMENT '库位名称', + `is_out` int DEFAULT '0' COMMENT '出炉状态: 0准备出炉,1正在加工,2加工完成', + `out_run_task_id` bigint DEFAULT '0' COMMENT '调度任务ID,关联调度表:t_run_task', + `out_start_position` varchar(128) DEFAULT '' COMMENT '开始位置', + `out_target_position` varchar(128) DEFAULT '' COMMENT '目标位置,指缓存位置', + `task_code` varchar(100) NOT NULL DEFAULT '' COMMENT '任务编码', + `sheet_no` varchar(128) DEFAULT NULL COMMENT '生产单号 APMS生成生产单后返回', + `task_type` int NOT NULL COMMENT '任务类型:0:入库到窑炉,1:入库到缓存区,2出库到 窑炉到缓存区,3缓存区出库', + `process_type` int NOT NULL COMMENT '加工类型:0 初始加工,1 复加工 ', + PRIMARY KEY (`id`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=252 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='任务表'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `t_curr_task_det` +-- + +DROP TABLE IF EXISTS `t_curr_task_det`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_curr_task_det` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `valid` int NOT NULL DEFAULT '1' COMMENT '删除标志,是否有效:1 可用 0不可用,2停止', + `create_time` datetime DEFAULT NULL COMMENT '添加时间,每次修改记录要更新记录新增时间', + `creator_id` int DEFAULT '0' COMMENT '创建人id', + `updater_id` int DEFAULT '0' COMMENT '更新人id', + `update_time` datetime DEFAULT NULL COMMENT '修改时间,更具修改时间来判断下次执行顺序,第一次修改时间和新增时间相同', + `version` varchar(11) DEFAULT '1' COMMENT '版本号 默认为 1', + `status` int DEFAULT '0' COMMENT '状态: 0等待执行', + `inter_code` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '内部编码,系统自动生成', + `task_code` varchar(128) DEFAULT '' COMMENT '任务编码', + `curr_task_id` bigint NOT NULL COMMENT '当前任务id,关联当前任务表:t_curr_task', + `order_no` varchar(128) DEFAULT '' COMMENT '订单号,', + `iden_card_num` varchar(128) NOT NULL COMMENT '标识卡号,', + `product_name` varchar(128) DEFAULT '' COMMENT '产品名称', + `material_des` varchar(128) DEFAULT '' COMMENT '材料牌号 ', + `craft_ill` varchar(512) DEFAULT '' COMMENT '工艺要求 ', + `unit` varchar(32) DEFAULT '' COMMENT '单位', + `weight` float(8,2) DEFAULT '0.00' COMMENT '重量,手动输入', + `quantity` float(8,2) DEFAULT '0.00' COMMENT '数量,手动输入', + PRIMARY KEY (`id`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=254 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='当前任务明细'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `t_factory` +-- + +DROP TABLE IF EXISTS `t_factory`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_factory` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `valid` int NOT NULL DEFAULT '0' COMMENT '删除标志,是否有效:0 可用 1不可用', + `create_time` datetime DEFAULT NULL COMMENT '添加时间', + `creator_id` int DEFAULT '0' COMMENT '创建人id', + `updater_id` int DEFAULT '0' COMMENT '更新人id', + `update_time` datetime DEFAULT NULL COMMENT '修改时间', + `version` varchar(11) DEFAULT '1' COMMENT '版本号 默认为 1', + `status` int DEFAULT '0' COMMENT '状态 0初始化', + `inter_code` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '内部编码', + `code` varchar(128) NOT NULL COMMENT '工厂编码', + `factory_name` varchar(256) NOT NULL COMMENT '工厂名称', + `address` varchar(512) DEFAULT '' COMMENT '工厂地址', + `description` varchar(512) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '描述信息', + `note` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=250 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='工厂'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `t_in_stock_info` +-- + +DROP TABLE IF EXISTS `t_in_stock_info`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_in_stock_info` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `valid` int NOT NULL DEFAULT '1' COMMENT '删除标志,是否有效:1 可用 0不可用,2停止', + `create_time` datetime DEFAULT NULL COMMENT '添加时间,入库时间', + `creator_id` int DEFAULT '0' COMMENT '创建人id', + `updater_id` int DEFAULT '0' COMMENT '更新人id', + `update_time` datetime DEFAULT NULL COMMENT '修改时间,更具修改时间来判断下次执行顺序,第一次修改时间和新增时间相同', + `version` varchar(11) DEFAULT '1' COMMENT '版本号 默认为 1', + `status` int DEFAULT '0' COMMENT '状态: 0未开始执行,1正在执行,2执行完成', + `inter_code` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '内部编码,系统自动生成', + `task_code` varchar(128) DEFAULT '' COMMENT '任务编码', + `task_id` bigint DEFAULT '0' COMMENT '任务id,关联当前任务表:currTask', + `kiln_id` bigint DEFAULT NULL COMMENT '窑炉id ,if(status == 0){从窑炉出来等待库存} else if(status == 1){到目标窑炉前缓存到库位}关联设备窑炉表:t_kiln_info', + `kiln_name` varchar(128) DEFAULT '' COMMENT '窑炉名称', + `location_id` bigint DEFAULT '0' COMMENT '库位id,关联库位表:t_location', + `location_name` varchar(128) DEFAULT '' COMMENT '库位名称', + `pallet_code` varchar(128) DEFAULT '' COMMENT '托盘编码', + `type` int DEFAULT '0' COMMENT '类型: 0等待出库,1到窑炉前缓存,2插单任务缓存', + `in_time` datetime DEFAULT NULL COMMENT '进入缓存区的时间,插单任务按倒叙执行,正常任务按顺序执行', + PRIMARY KEY (`id`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=250 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='缓存区存储情况'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `t_in_stock_info_his` +-- + +DROP TABLE IF EXISTS `t_in_stock_info_his`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_in_stock_info_his` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `valid` int NOT NULL DEFAULT '1' COMMENT '删除标志,是否有效:1 可用 0不可用,2停止', + `create_time` datetime DEFAULT NULL COMMENT '添加时间,入库时间', + `creator_id` int DEFAULT '0' COMMENT '创建人id', + `updater_id` int DEFAULT '0' COMMENT '更新人id', + `update_time` datetime DEFAULT NULL COMMENT '修改时间,更具修改时间来判断下次执行顺序,第一次修改时间和新增时间相同', + `version` varchar(11) DEFAULT '1' COMMENT '版本号 默认为 1', + `status` int DEFAULT '0' COMMENT '状态: 0未开始执行,1正在执行,2执行完成', + `inter_code` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '内部编码,系统自动生成', + `task_code` varchar(128) DEFAULT '' COMMENT '任务编码', + `task_id` int DEFAULT '0' COMMENT '历史任务id,关联任务表:t_task_his', + `kiln_id` int NOT NULL COMMENT '窑炉id ,if(status == 0){从窑炉出来等待库存} else if(status == 1){到目标窑炉前缓存到库位}关联设备窑炉表:t_kiln_info', + `kiln_name` varchar(128) DEFAULT '' COMMENT '窑炉名称', + `location_id` int DEFAULT '0' COMMENT '库位id,关联库位表:t_location', + `location_name` varchar(128) DEFAULT '' COMMENT '库位名称', + `pallet_code` varchar(128) DEFAULT '' COMMENT '托盘编码', + `type` int DEFAULT NULL COMMENT '类型: 0等待出库,1到窑炉前缓存,2插单任务缓存', + `in_time` varchar(100) DEFAULT NULL COMMENT '进入缓存区的时间,插单任务按倒叙执行,正常任务按顺序执行', + PRIMARY KEY (`id`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=250 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='缓存区存储历史情况'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `t_kiln_info` +-- + +DROP TABLE IF EXISTS `t_kiln_info`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_kiln_info` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `valid` int NOT NULL DEFAULT '1' COMMENT '删除标志,是否有效:1 可用 0不可用', + `create_time` datetime DEFAULT NULL COMMENT '添加时间', + `creator_id` int DEFAULT '0' COMMENT '创建人id', + `updater_id` int DEFAULT '0' COMMENT '更新人id', + `update_time` datetime DEFAULT NULL COMMENT '修改时间', + `version` varchar(11) DEFAULT '1' COMMENT '版本号 默认为 1', + `status` int DEFAULT '0' COMMENT '状态 0初始化,1损坏', + `inter_code` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '内部编码,系统自动生成', + `code` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '' COMMENT '编码 必须与AMPS相同', + `factory_id` int DEFAULT NULL COMMENT '绑定工厂id', + `kiln_name` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '窑炉名称 建议与AMPS相同', + `kiln_alias` varchar(256) DEFAULT '' COMMENT '窑炉别名', + `en` varchar(256) DEFAULT '' COMMENT '英语名称', + `type` varchar(64) DEFAULT '' COMMENT '设备类型,存储数据字典编码', + `ip` varchar(32) DEFAULT '' COMMENT 'ip地址', + `port_number` varchar(16) DEFAULT '' COMMENT '端口号', + `description` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '描述信息', + `note` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=251 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='窑炉信息'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `t_location` +-- + +DROP TABLE IF EXISTS `t_location`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_location` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `valid` int NOT NULL DEFAULT '1' COMMENT '删除标志,是否有效:1 可用 0不可用', + `create_time` datetime DEFAULT NULL COMMENT '添加时间', + `creator_id` int DEFAULT '0' COMMENT '创建人id', + `updater_id` int DEFAULT '0' COMMENT '更新人id', + `update_time` datetime DEFAULT NULL COMMENT '修改时间', + `version` varchar(11) DEFAULT '1' COMMENT '版本号 默认为 1', + `status` int DEFAULT '0' COMMENT '状态 0空闲,1使用,2不可用', + `inter_code` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '内部编码,系统自动生成', + `code` varchar(128) DEFAULT '' COMMENT '编码', + `factory_id` int DEFAULT NULL COMMENT '绑定工厂id', + `warehouse_id` int DEFAULT NULL COMMENT '缓存区id,关联表:t_warehouse', + `location_name` varchar(256) NOT NULL COMMENT '货位名称', + `location_name_alias` varchar(256) DEFAULT NULL COMMENT '库位别名', + `description` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '描述信息', + `note` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=251 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='库位表'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `t_login_log` +-- + +DROP TABLE IF EXISTS `t_login_log`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_login_log` ( + `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键,自增', + `session_id` varchar(64) NOT NULL COMMENT '会话ID', + `account_id` bigint NOT NULL COMMENT '账号ID', + `user_id` bigint NOT NULL COMMENT '用户ID', + `corp_id` bigint DEFAULT NULL COMMENT '公司ID', + `hospital_id` bigint DEFAULT NULL COMMENT '医院ID', + `org_id` bigint DEFAULT NULL COMMENT '组织ID', + `account` varchar(32) NOT NULL COMMENT '账号', + `mobile` varchar(16) DEFAULT NULL COMMENT '手机号', + `user_name` varchar(64) DEFAULT NULL COMMENT '用户名称', + `corp_name` varchar(256) DEFAULT NULL COMMENT '公司名称', + `hospital_name` varchar(256) DEFAULT NULL COMMENT '医院名称', + `org_name` varchar(128) DEFAULT NULL COMMENT '组织名称,存放平台组织或者医院科室或者公司门店', + `user_type` int NOT NULL COMMENT '用户类型:1、平台用户,2、公司用户,3、医院用户,4、患者', + `app_type` int NOT NULL COMMENT '应用类型:1、pc,2、app,3、wechat,4、miniapp', + `app_code` int DEFAULT NULL COMMENT '应用编码:暂未使用', + `login_type` int NOT NULL DEFAULT '1' COMMENT '登录类型:1、自主登录,2、漫游登录', + `logout_type` int NOT NULL DEFAULT '1' COMMENT '退出类型:1、自主退出,2、管理退出,3,超时退出', + `login_time` datetime NOT NULL COMMENT '登录时间', + `logout_time` datetime NOT NULL COMMENT '退出时间', + `device_class` varchar(32) DEFAULT NULL COMMENT '设备类型', + `device_name` varchar(64) DEFAULT NULL COMMENT '设备名称', + `device_brand` varchar(64) DEFAULT NULL COMMENT '设备品牌', + `os` varchar(64) DEFAULT NULL COMMENT '操作系统', + `browser` varchar(64) DEFAULT NULL COMMENT '浏览器', + `country` varchar(32) DEFAULT NULL COMMENT '国家', + `province` varchar(32) DEFAULT NULL COMMENT '省份', + `city` varchar(32) DEFAULT NULL COMMENT '地市', + `county` varchar(32) DEFAULT NULL COMMENT '区县', + `address` varchar(256) DEFAULT NULL COMMENT '地址', + `lng` varchar(16) DEFAULT NULL COMMENT '精度', + `lat` varchar(16) DEFAULT NULL COMMENT '纬度', + `isp` varchar(32) DEFAULT NULL COMMENT '网络服务提供商', + `ip` varchar(16) DEFAULT NULL COMMENT 'IP地址', + `user_agent` varchar(1024) DEFAULT NULL COMMENT '用户代理,存放用户登录时客户端信息', + `logout_address` varchar(256) DEFAULT NULL COMMENT '退出地址', + `logout_ip` varchar(16) DEFAULT NULL COMMENT '退出IP地址', + `logout_user_agent` varchar(1024) DEFAULT NULL COMMENT '退出用户代理,存放用户退出时客户端信息', + `abnormal_status` int NOT NULL DEFAULT '0' COMMENT '异常状态:0、正常,1、省份异常,2、地市异常,3、区县异常', + `ip_to_address_status` int NOT NULL DEFAULT '0' COMMENT 'ip转地址状态:0、未获取,1、登录地址获取成功,2、退出地址获取成功,-1、登录地址获取失败,-2、退出地址获取失败', + `ip_to_address_count` int NOT NULL DEFAULT '0' COMMENT 'ip转地址次数,最多转换3次,三次失败修改状态为失败(-1、-2)', + `ip_to_address_time` datetime DEFAULT NULL COMMENT 'ip转地址时间', + `remark` varchar(512) DEFAULT NULL COMMENT '备注', + `valid` tinyint NOT NULL DEFAULT '1' COMMENT '删除标志,是否有效:1 可用 0不可用', + `creator` bigint DEFAULT NULL COMMENT '创建人', + `creator_name` varchar(64) DEFAULT NULL COMMENT '创建人姓名', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `updater` bigint DEFAULT NULL COMMENT '更新人', + `updater_name` varchar(64) DEFAULT NULL COMMENT '更新人姓名', + `update_time` datetime DEFAULT NULL COMMENT '更新时间', + `version` int DEFAULT '0' COMMENT '版本号', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='登录日志表,存放历史会话信息'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `t_login_session` +-- + +DROP TABLE IF EXISTS `t_login_session`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_login_session` ( + `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键,自增', + `session_id` varchar(64) NOT NULL COMMENT '会话ID', + `account_id` bigint NOT NULL COMMENT '账号ID', + `user_id` bigint NOT NULL COMMENT '用户ID', + `corp_id` bigint DEFAULT NULL COMMENT '公司ID', + `hospital_id` bigint DEFAULT NULL COMMENT '医院ID', + `org_id` bigint DEFAULT NULL COMMENT '组织ID', + `account` varchar(32) NOT NULL COMMENT '账号', + `mobile` varchar(16) DEFAULT NULL COMMENT '手机号', + `user_name` varchar(64) DEFAULT NULL COMMENT '用户名称', + `corp_name` varchar(256) DEFAULT NULL COMMENT '公司名称', + `hospital_name` varchar(256) DEFAULT NULL COMMENT '医院名称', + `org_name` varchar(128) DEFAULT NULL COMMENT '组织名称,存放平台组织或者医院科室或者公司门店', + `user_type` int NOT NULL COMMENT '用户类型:1、平台用户,2、公司用户,3、医院用户,4、患者', + `app_type` int NOT NULL COMMENT '应用类型:1、pc,2、app,3、wechat,4、miniapp', + `app_code` int DEFAULT NULL COMMENT '应用编码:暂未使用', + `login_type` int NOT NULL DEFAULT '1' COMMENT '登录类型:1、自主登录,2、漫游登录', + `login_time` datetime NOT NULL COMMENT '登录时间', + `device_class` varchar(32) DEFAULT NULL COMMENT '设备类型', + `device_name` varchar(64) DEFAULT NULL COMMENT '设备名称', + `device_brand` varchar(64) DEFAULT NULL COMMENT '设备品牌', + `os` varchar(64) DEFAULT NULL COMMENT '操作系统', + `browser` varchar(64) DEFAULT NULL COMMENT '浏览器', + `country` varchar(32) DEFAULT NULL COMMENT '国家', + `province` varchar(32) DEFAULT NULL COMMENT '省份', + `city` varchar(32) DEFAULT NULL COMMENT '地市', + `county` varchar(32) DEFAULT NULL COMMENT '区县', + `address` varchar(256) DEFAULT NULL COMMENT '地址', + `lng` varchar(16) DEFAULT NULL COMMENT '精度', + `lat` varchar(16) DEFAULT NULL COMMENT '纬度', + `isp` varchar(32) DEFAULT NULL COMMENT '网络服务提供商', + `ip` varchar(16) DEFAULT NULL COMMENT 'IP地址', + `user_agent` varchar(1024) DEFAULT NULL COMMENT '用户代理,存放用户登录时客户端信息', + `ip_to_address_status` int NOT NULL DEFAULT '0' COMMENT 'ip转地址状态:0、未获取,1、登录地址获取成功,2、退出地址获取成功,-1、登录地址获取失败,-2、退出地址获取失败', + `ip_to_address_count` int NOT NULL DEFAULT '0' COMMENT 'ip转地址次数,最多转换3次,三次失败修改状态为失败(-1、-2)', + `ip_to_address_time` datetime DEFAULT NULL COMMENT 'ip转地址时间', + `remark` varchar(512) DEFAULT NULL COMMENT '备注', + `creator` bigint DEFAULT NULL COMMENT '创建人', + `creator_name` varchar(64) DEFAULT NULL COMMENT '创建人姓名', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `updater` bigint DEFAULT NULL COMMENT '更新人', + `updater_name` varchar(64) DEFAULT NULL COMMENT '更新人姓名', + `update_time` datetime DEFAULT NULL COMMENT '更新时间', + `version` int DEFAULT '0' COMMENT '版本号', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='登录会话表,存放在线用户信息'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `t_order_info` +-- + +DROP TABLE IF EXISTS `t_order_info`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_order_info` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `valid` int NOT NULL DEFAULT '1' COMMENT '删除标志,是否有效:1 可用 0不可用,2停止', + `create_time` datetime DEFAULT NULL COMMENT '添加时间,每次修改记录要更新记录新增时间', + `creator_id` int DEFAULT '0' COMMENT '创建人id', + `updater_id` int DEFAULT '0' COMMENT '更新人id', + `update_time` datetime DEFAULT NULL COMMENT '修改时间,更具修改时间来判断下次执行顺序,第一次修改时间和新增时间相同', + `version` varchar(11) DEFAULT '1' COMMENT '版本号 默认为 1', + `order_source` int NOT NULL COMMENT '来源:1.APMS 2.人工输入', + `status` int DEFAULT '0' COMMENT '状态: 0等待执行,1执行中,2执行完成', + `inter_code` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '内部编码,系统自动生成', + `code` varchar(128) DEFAULT '' COMMENT '编码', + `order_no` varchar(128) NOT NULL COMMENT '订单号,APMS系统获取', + `old_order_no` varchar(128) DEFAULT NULL COMMENT '原订单号,APMS系统获取 返单时才存在', + `iden_card_num` varchar(128) NOT NULL COMMENT '标识卡号,APMS系统获取', + `customer_no` varchar(128) DEFAULT '' COMMENT '客户编码 APMS系统获取', + `customer_name` varchar(128) DEFAULT '' COMMENT '客户名称 APMS系统获取', + `product_name` varchar(128) DEFAULT '' COMMENT '产品名称 APMS系统获取', + `product_model` varchar(128) DEFAULT '' COMMENT '产品型号 APMS系统获取', + `material_des` varchar(128) DEFAULT '' COMMENT '材料牌号 APMS系统获取', + `craft_ill` varchar(512) DEFAULT '' COMMENT '工艺要求 APMS系统获取', + `unit` varchar(32) DEFAULT '' COMMENT '单位', + `weight` float(8,2) DEFAULT '0.00' COMMENT '重量', + `quantity` float(8,2) DEFAULT '0.00' COMMENT '数量', + `add_a` float(8,2) DEFAULT '0.00' COMMENT '扩展字段1', + `add_b` float(8,2) DEFAULT '0.00' COMMENT '扩展字段2', + `orther_a` varchar(128) DEFAULT '' COMMENT '扩展字段4', + `orther_b` varchar(128) DEFAULT '' COMMENT '扩展字段5', + `order_void` int NOT NULL DEFAULT '1' COMMENT '是否作废 1:正常 0:作废', + PRIMARY KEY (`id`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=254 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='订单任务表'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `t_order_info_his` +-- + +DROP TABLE IF EXISTS `t_order_info_his`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_order_info_his` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `valid` int NOT NULL DEFAULT '1' COMMENT '删除标志,是否有效:1 可用 0不可用,2停止', + `create_time` datetime DEFAULT NULL COMMENT '添加时间,每次修改记录要更新记录新增时间', + `creator_id` int DEFAULT '0' COMMENT '创建人id', + `updater_id` int DEFAULT '0' COMMENT '更新人id', + `update_time` datetime DEFAULT NULL COMMENT '修改时间,更具修改时间来判断下次执行顺序,第一次修改时间和新增时间相同', + `version` varchar(11) DEFAULT '1' COMMENT '版本号 默认为 1', + `order_source` int NOT NULL COMMENT '来源:1.APMS 2.人工输入', + `status` int DEFAULT '0' COMMENT '状态: 0等待执行,1执行中,2执行完成', + `inter_code` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '内部编码,系统自动生成', + `code` varchar(128) DEFAULT '' COMMENT '编码', + `order_no` varchar(128) NOT NULL COMMENT '订单号,APMS系统获取', + `old_order_no` varchar(128) DEFAULT NULL COMMENT '原订单号,APMS系统获取,返工单才存在', + `iden_card_num` varchar(128) NOT NULL COMMENT '标识卡号,APMS系统获取', + `customer_no` varchar(128) DEFAULT '' COMMENT '客户编码 APMS系统获取', + `customer_name` varchar(128) DEFAULT '' COMMENT '客户名称 APMS系统获取', + `product_name` varchar(128) DEFAULT '' COMMENT '产品名称 APMS系统获取', + `product_model` varchar(128) DEFAULT '' COMMENT '产品型号 APMS系统获取', + `material_des` varchar(128) DEFAULT '' COMMENT '材料牌号 APMS系统获取', + `craft_ill` varchar(512) DEFAULT '' COMMENT '工艺要求 APMS系统获取', + `unit` varchar(32) DEFAULT '' COMMENT '单位', + `weight` float(8,2) DEFAULT '0.00' COMMENT '重量', + `quantity` float(8,2) DEFAULT '0.00' COMMENT '数量', + `order_void` int NOT NULL DEFAULT '1' COMMENT '是否作废 1:正常 ,0:作废', + PRIMARY KEY (`id`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=258 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='订单任务历史表'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `t_par_base` +-- + +DROP TABLE IF EXISTS `t_par_base`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_par_base` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `valid` int NOT NULL DEFAULT '1' COMMENT '删除标志,是否有效:1 可用 0不可用', + `create_time` datetime DEFAULT NULL COMMENT '添加时间', + `creator_id` int DEFAULT '0' COMMENT '创建人id', + `updater_id` int DEFAULT '0' COMMENT '更新人id', + `update_time` datetime DEFAULT NULL COMMENT '修改时间', + `version` varchar(11) DEFAULT '1' COMMENT '版本号 默认为 1', + `status` int DEFAULT '0' COMMENT '状态 0初始化,1损坏', + `inter_code` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '内部编码,系统自动生成', + `code` varchar(128) DEFAULT '' COMMENT '编码', + `par_name` varchar(128) NOT NULL COMMENT '参数名称', + `unit` varchar(128) NOT NULL COMMENT '单位,数据字典获取', + PRIMARY KEY (`id`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=250 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='参数基础表'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `t_par_ele_value` +-- + +DROP TABLE IF EXISTS `t_par_ele_value`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_par_ele_value` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `create_time` datetime DEFAULT NULL COMMENT '添加时间', + `inter_code` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '内部编码,系统自动生成', + `status` int DEFAULT '0' COMMENT '状态 0初始化,1损坏', + `kiln_id` int NOT NULL COMMENT '窑炉id,关联设备窑炉表:t_kiln_info', + `par_id` int NOT NULL COMMENT '参数id,关联参数表:t_par_info', + `a_voltagev_value` float(8,2) DEFAULT '0.00' COMMENT 'A相电压', + `b_voltagev_value` float(8,2) DEFAULT '0.00' COMMENT 'B相电压', + `c_voltagev_value` float(8,2) DEFAULT '0.00' COMMENT 'C相电压', + `a_current_value` float(8,2) DEFAULT '0.00' COMMENT 'A相电流', + `b_current_value` float(8,2) DEFAULT '0.00' COMMENT 'B相电流', + `c_current_value` float(8,2) DEFAULT '0.00' COMMENT 'C相电流', + `total_bat` float(8,2) DEFAULT '0.00' COMMENT '总电量,单位KW', + `add_a` float(8,2) DEFAULT '0.00' COMMENT '扩展字段1', + `add_b` float(8,2) DEFAULT '0.00' COMMENT '扩展字段2', + `add_c` float(8,2) DEFAULT '0.00' COMMENT '扩展字段3', + `orther_a` varchar(128) DEFAULT '' COMMENT '扩展字段4', + `orther_b` varchar(128) DEFAULT '' COMMENT '扩展字段5', + `orther_c` varchar(128) DEFAULT '' COMMENT '扩展字段6', + PRIMARY KEY (`id`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=250 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='窑炉电能参数值'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `t_par_gas_value` +-- + +DROP TABLE IF EXISTS `t_par_gas_value`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_par_gas_value` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `create_time` datetime DEFAULT NULL COMMENT '添加时间', + `inter_code` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '内部编码,系统自动生成', + `status` int DEFAULT '0' COMMENT '状态 0初始化,1损坏', + `kiln_id` int NOT NULL COMMENT '窑炉id,关联设备窑炉表:t_kiln_info', + `par_id` int NOT NULL COMMENT '参数id,关联参数表:t_par_info', + `set_nit_pot_value` float(8,2) DEFAULT '0.00' COMMENT '设定氮势值', + `actual_nit_pot_value` float(8,2) DEFAULT '0.00' COMMENT '实际氮势值', + `accept_nit_pot_value` float(8,2) DEFAULT '0.00' COMMENT '接受氮势值', + `nit_flow_value` float(10,2) DEFAULT '0.00' COMMENT '氮气流量', + `ammonia_flow_value` float(10,2) DEFAULT '0.00' COMMENT '氨气流量', + `car_dioxide_flow_value` float(10,2) DEFAULT '0.00' COMMENT '二氧化碳流量', + `add_a` float(8,2) DEFAULT '0.00' COMMENT '扩展字段1', + `add_b` float(8,2) DEFAULT '0.00' COMMENT '扩展字段2', + `add_c` float(8,2) DEFAULT '0.00' COMMENT '扩展字段3', + `orther_a` varchar(128) DEFAULT '' COMMENT '扩展字段4', + `orther_b` varchar(128) DEFAULT '' COMMENT '扩展字段5', + `orther_c` varchar(128) DEFAULT '' COMMENT '扩展字段6', + PRIMARY KEY (`id`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=250 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='窑炉使用气检测值'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `t_par_info` +-- + +DROP TABLE IF EXISTS `t_par_info`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_par_info` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `valid` int NOT NULL DEFAULT '1' COMMENT '删除标志,是否有效:1 可用 0不可用', + `create_time` datetime DEFAULT NULL COMMENT '添加时间', + `creator_id` int DEFAULT '0' COMMENT '创建人id', + `updater_id` int DEFAULT '0' COMMENT '更新人id', + `update_time` datetime DEFAULT NULL COMMENT '修改时间', + `version` varchar(11) DEFAULT '1' COMMENT '版本号 默认为 1', + `status` int DEFAULT '0' COMMENT '状态 0初始化,1损坏', + `inter_code` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '内部编码,系统自动生成', + `code` varchar(128) DEFAULT '' COMMENT '编码', + `type` int NOT NULL COMMENT '参数类型,0 表示电能,1表示用气,3温度,4转速 依次类推', + `class_a` int DEFAULT '0' COMMENT '参数分类,eg:if (type ==0 && class_a== 0) {class_a== 0表示A向电压,class_a== 1,表示B向电压,class_a== 2,表示C向电压,依次类推} ', + `class_b` int DEFAULT '0' COMMENT '参数分类,eg:if (type ==0 && class_b== 0) {class_b== 0表示A向电流,class_b== 1,表示B向电流,class_b== 2,表示C向电流,依次类推} ', + `par_name` varchar(128) NOT NULL COMMENT '参数名称', + `unit` varchar(128) NOT NULL COMMENT '单位,数据字典获取', + PRIMARY KEY (`id`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=250 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='参数表'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `t_par_rot_speed_value` +-- + +DROP TABLE IF EXISTS `t_par_rot_speed_value`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_par_rot_speed_value` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `create_time` datetime DEFAULT NULL COMMENT '添加时间', + `inter_code` varchar(128) NOT NULL COMMENT '内部编码,系统自动生成', + `status` int DEFAULT '0' COMMENT '状态 0初始化,1损坏', + `kiln_id` int NOT NULL COMMENT '窑炉id,关联设备窑炉表:t_kiln_info', + `par_id` int NOT NULL COMMENT '参数id,关联参数表:t_par_info', + `fan_speed_a_value` float(8,2) DEFAULT '0.00' COMMENT '后室风扇1运行速度值', + `fan_speed_b_value` float(8,2) DEFAULT '0.00' COMMENT '后室风扇2运行速度值', + `oil_sti_speed_a_value` float(8,2) DEFAULT '0.00' COMMENT '油搅拌1运行速度', + `oil_sti_speed_b_value` float(8,2) DEFAULT '0.00' COMMENT '油搅拌2运行速度', + `oil_sti_speed_c_value` float(8,2) DEFAULT '0.00' COMMENT '油搅拌3运行速度', + `oil_sti_speed_d_value` float(8,2) DEFAULT '0.00' COMMENT '油搅拌4运行速度', + `oil_sti_speed_e_value` float(8,2) DEFAULT '0.00' COMMENT '油搅拌5运行速度', + `oil_sti_speed_f_value` float(8,2) DEFAULT '0.00' COMMENT '油搅拌6运行速度', + `add_a` float(8,2) DEFAULT '0.00' COMMENT '扩展字段1', + `add_b` float(8,2) DEFAULT '0.00' COMMENT '扩展字段2', + `add_c` float(8,2) DEFAULT '0.00' COMMENT '扩展字段3', + `orther_a` varchar(128) DEFAULT '' COMMENT '扩展字段4', + `orther_b` varchar(128) DEFAULT '' COMMENT '扩展字段5', + `orther_c` varchar(128) DEFAULT '' COMMENT '扩展字段6', + PRIMARY KEY (`id`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=250 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='窑炉运转速度'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `t_par_tem_value` +-- + +DROP TABLE IF EXISTS `t_par_tem_value`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_par_tem_value` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `create_time` datetime DEFAULT NULL COMMENT '添加时间', + `inter_code` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '内部编码,系统自动生成', + `status` int DEFAULT '0' COMMENT '状态 0初始化,1损坏', + `kiln_id` int NOT NULL COMMENT '窑炉id,关联设备窑炉表:t_kiln_info', + `par_id` int NOT NULL COMMENT '参数id,关联参数表:t_par_info', + `set_tem_value` float(8,2) DEFAULT '0.00' COMMENT '设定温度值', + `act_tem_value` float(8,2) DEFAULT '0.00' COMMENT '实际温度值', + `oil_tank_act_tem_value` float(8,2) DEFAULT '0.00' COMMENT '油槽实际温度', + `oil_tank_set_tem_value` float(8,2) DEFAULT '0.00' COMMENT '油槽设定温度', + `take_over_set_tem_value` float(8,2) DEFAULT '0.00' COMMENT '接受设定温度', + `take_over_oil_set_tem_value` float(8,2) DEFAULT '0.00' COMMENT '接受设定油温度', + `add_a` float(8,2) DEFAULT '0.00' COMMENT '扩展字段1', + `add_b` float(8,2) DEFAULT '0.00' COMMENT '扩展字段2', + `add_c` float(8,2) DEFAULT '0.00' COMMENT '扩展字段3', + `orther_a` varchar(128) DEFAULT '' COMMENT '扩展字段4', + `orther_b` varchar(128) DEFAULT '' COMMENT '扩展字段5', + `orther_c` varchar(128) DEFAULT '' COMMENT '扩展字段6', + PRIMARY KEY (`id`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=250 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='窑炉温度监控'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `t_product_attr` +-- + +DROP TABLE IF EXISTS `t_product_attr`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_product_attr` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `valid` int NOT NULL DEFAULT '1' COMMENT '删除标志,是否有效:1 可用 0不可用', + `create_time` datetime DEFAULT NULL COMMENT '添加时间', + `creator_id` int DEFAULT '0' COMMENT '创建人id', + `updater_id` int DEFAULT '0' COMMENT '更新人id', + `update_time` datetime DEFAULT NULL COMMENT '修改时间', + `version` varchar(11) DEFAULT '1' COMMENT '版本号 默认为 1', + `status` int DEFAULT '0' COMMENT '状态 0初始化', + `inter_code` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '内部编码', + `code` varchar(128) DEFAULT '' COMMENT '编码', + `product_id` int NOT NULL COMMENT '产品id,关联表:t_product_library', + `attr_name` varchar(128) NOT NULL COMMENT '属性名', + `attr_content` varchar(255) DEFAULT '' COMMENT '属性', + `note` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=250 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='产品属性表'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `t_product_library` +-- + +DROP TABLE IF EXISTS `t_product_library`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_product_library` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `valid` int NOT NULL DEFAULT '1' COMMENT '删除标志,是否有效:1 可用 0不可用', + `create_time` datetime DEFAULT NULL COMMENT '添加时间', + `creator_id` int DEFAULT '0' COMMENT '创建人id', + `updater_id` int DEFAULT '0' COMMENT '更新人id', + `update_time` datetime DEFAULT NULL COMMENT '修改时间', + `version` varchar(11) DEFAULT '1' COMMENT '版本号 默认为 1', + `status` int DEFAULT '0' COMMENT '状态 0初始化', + `inter_code` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '内部编码', + `code` varchar(128) DEFAULT '' COMMENT '编码', + `factory_id` int DEFAULT NULL COMMENT '绑定公司id', + `product_name` varchar(256) NOT NULL COMMENT '品名', + `spec` varchar(128) DEFAULT '' COMMENT '规格', + `type` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '' COMMENT '分类,关联数据字典,如:涤纶', + `description` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '描述信息', + `note` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=250 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='产品池'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `t_resource` +-- + +DROP TABLE IF EXISTS `t_resource`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_resource` ( + `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键,自增', + `service_id` bigint NOT NULL COMMENT '服务ID', + `name` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '名称', + `url` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '请求地址,可以用于前端ajax调用,后端用于做权限控制', + `method` varchar(16) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '请求类型:GET, HEAD, POST, PUT, PATCH, DELETE, OPTIONS, TRACE', + `subsystem` int NOT NULL DEFAULT '0' COMMENT '子系统:0、common,1、platform,2、partner,3、hospital,4、patient\r\n 用于限定维护菜单资源关系,公共资源允许所有菜单关联,其他资源只允许对应的菜单关联,如:平台菜单只允许关联到公共资源和平台资源', + `category` int NOT NULL DEFAULT '0' COMMENT '分类:0、common,1、pc,2、app,3、wechat,4、miniapp', + `enabled` int NOT NULL DEFAULT '1' COMMENT '启用状态:0 、停用,1、启用', + `remark` varchar(512) DEFAULT NULL COMMENT '备注', + `valid` tinyint NOT NULL DEFAULT '1' COMMENT '删除标志,是否有效:1 可用 0不可用', + `creator` bigint DEFAULT NULL COMMENT '创建人', + `creator_name` varchar(64) DEFAULT NULL COMMENT '创建人姓名', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `updater` bigint DEFAULT NULL COMMENT '更新人', + `updater_name` varchar(64) DEFAULT NULL COMMENT '更新人姓名', + `update_time` datetime DEFAULT NULL COMMENT '更新时间', + `version` int DEFAULT '0' COMMENT '版本号', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='资源表'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `t_run_task` +-- + +DROP TABLE IF EXISTS `t_run_task`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_run_task` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `valid` int NOT NULL DEFAULT '1' COMMENT '删除标志,是否有效:1 可用 0不可用', + `create_time` datetime DEFAULT NULL COMMENT '添加时间', + `creator_id` int DEFAULT '0' COMMENT '创建人id', + `updater_id` int DEFAULT '0' COMMENT '更新人id', + `update_time` datetime DEFAULT NULL COMMENT '修改时间', + `version` varchar(11) DEFAULT '1' COMMENT '版本号 默认为 1', + `task_id` bigint DEFAULT NULL COMMENT '任务id,关联curr_task表', + `task_code` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '任务编码, 查看任务编码规则', + `start_position` varchar(128) DEFAULT '' COMMENT '开始位置', + `end_position` varchar(128) DEFAULT '' COMMENT '结束位置', + `vehicle_id` bigint NOT NULL COMMENT '车辆id,关联车辆表:t_vehicle_info', + `begin_time` datetime DEFAULT NULL COMMENT '任务开始时间,车辆接收任务时间', + `end_time` datetime DEFAULT NULL COMMENT '结束时间,车辆完成送货时间', + `status` int DEFAULT '0' COMMENT '状态,0:未执行,1:正在执行,2:执行成功,3:执行失败', + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='执行任务信息表'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `t_service` +-- + +DROP TABLE IF EXISTS `t_service`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_service` ( + `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键,自增', + `code` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '编码', + `name` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '名称', + `enabled` int NOT NULL DEFAULT '1' COMMENT '启用状态:0 、停用,1、启用', + `remark` varchar(512) DEFAULT NULL COMMENT '备注', + `valid` tinyint NOT NULL DEFAULT '1' COMMENT '删除标志,是否有效:1 可用 0不可用', + `creator` bigint DEFAULT NULL COMMENT '创建人', + `creator_name` varchar(64) DEFAULT NULL COMMENT '创建人姓名', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `updater` bigint DEFAULT NULL COMMENT '更新人', + `updater_name` varchar(64) DEFAULT NULL COMMENT '更新人姓名', + `update_time` datetime DEFAULT NULL COMMENT '更新时间', + `version` int DEFAULT '0' COMMENT '版本号', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='服务表'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `t_sms_code` +-- + +DROP TABLE IF EXISTS `t_sms_code`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_sms_code` ( + `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键,自增', + `mobile` varchar(11) NOT NULL COMMENT '手机号码', + `code` varchar(8) NOT NULL COMMENT '验证码', + `type` int NOT NULL COMMENT '1、注册\r\n 2、找回密码\r\n 3、动态密码', + `expires_time` datetime DEFAULT NULL COMMENT '过期时间', + `used_status` int NOT NULL DEFAULT '0' COMMENT '使用状态:0、未使用,1、已使用', + `remark` varchar(512) DEFAULT NULL COMMENT '备注', + `valid` tinyint NOT NULL DEFAULT '1' COMMENT '删除标志,是否有效:1 可用 0不可用', + `creator` bigint DEFAULT NULL COMMENT '创建人', + `creator_name` varchar(64) DEFAULT NULL COMMENT '创建人姓名', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `updater` bigint DEFAULT NULL COMMENT '更新人', + `updater_name` varchar(64) DEFAULT NULL COMMENT '更新人姓名', + `update_time` datetime DEFAULT NULL COMMENT '更新时间', + `version` int DEFAULT '0' COMMENT '版本号', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='短信验证码表,过期时间和使用状态可以不用'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `t_sms_scene` +-- + +DROP TABLE IF EXISTS `t_sms_scene`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_sms_scene` ( + `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键,自增', + `corp_id` bigint NOT NULL DEFAULT '0' COMMENT '公司ID,0为公用,默认使用0对应的短信场景', + `type` int NOT NULL DEFAULT '0' COMMENT '场景类型\r\n 0、其他/未分类\r\n 1、注册\r\n 2、找回密码\r\n 3、动态密码\r\n 4、订单\r\n 5、支付\r\n 6、报告单\r\n 9、系统通知', + `code` varchar(32) NOT NULL COMMENT '场景编码,业务系统根据该编码区分不同的业务场景', + `name` varchar(64) NOT NULL COMMENT '场景名称', + `sign_id` bigint NOT NULL COMMENT '短信签名ID', + `template_id` bigint NOT NULL COMMENT '短信模板ID', + `enabled` int NOT NULL DEFAULT '1' COMMENT '启用状态:0 、停用,1、启用', + `remark` varchar(512) DEFAULT NULL COMMENT '备注', + `valid` tinyint NOT NULL DEFAULT '1' COMMENT '删除标志,是否有效:1 可用 0不可用', + `creator` bigint DEFAULT NULL COMMENT '创建人', + `creator_name` varchar(64) DEFAULT NULL COMMENT '创建人姓名', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `updater` bigint DEFAULT NULL COMMENT '更新人', + `updater_name` varchar(64) DEFAULT NULL COMMENT '更新人姓名', + `update_time` datetime DEFAULT NULL COMMENT '更新时间', + `version` int DEFAULT '0' COMMENT '版本号', + PRIMARY KEY (`id`), + UNIQUE KEY `ak_key_sms_code` (`corp_id`,`code`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='短信场景表'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `t_sms_send` +-- + +DROP TABLE IF EXISTS `t_sms_send`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_sms_send` ( + `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键,自增', + `corp_id` bigint NOT NULL DEFAULT '0' COMMENT '公司ID,0为公用,默认使用0对应的短信场景', + `scene_id` bigint NOT NULL COMMENT '短信场景ID', + `template_code` varchar(32) NOT NULL COMMENT '模板编号,第三方模板编码,如阿里云短信模板code', + `type` int NOT NULL COMMENT '短信类型\r\n 0、其他/未分类\r\n 1、注册\r\n 2、找回密码\r\n 3、动态密码\r\n 4、订单\r\n 5、支付\r\n 6、报告单\r\n 9、系统通知', + `mobile` varchar(1024) NOT NULL COMMENT '手机号码,多个号码用户英文逗号(,)分隔', + `content` varchar(1024) NOT NULL COMMENT '短信内容', + `relation_id` varchar(48) DEFAULT NULL COMMENT '关联ID,如:用户ID、订单ID等', + `sid` varchar(48) DEFAULT NULL COMMENT '短信接口测ID', + `send` int DEFAULT NULL COMMENT '发送条数', + `result_code` varchar(64) DEFAULT NULL COMMENT '短信接口结果码', + `result_info` varchar(256) DEFAULT NULL COMMENT '短信接口结果说明', + `response` varchar(512) DEFAULT NULL COMMENT '短信接口响应消息,完整的响应包', + `valid` tinyint NOT NULL DEFAULT '1' COMMENT '删除标志,是否有效:1 可用 0不可用', + `creator` bigint DEFAULT NULL COMMENT '创建人', + `creator_name` varchar(64) DEFAULT NULL COMMENT '创建人姓名', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `updater` bigint DEFAULT NULL COMMENT '更新人', + `updater_name` varchar(64) DEFAULT NULL COMMENT '更新人姓名', + `update_time` datetime DEFAULT NULL COMMENT '更新时间', + `version` int DEFAULT '0' COMMENT '版本号', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='短信发送表'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `t_sms_sign` +-- + +DROP TABLE IF EXISTS `t_sms_sign`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_sms_sign` ( + `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键,自增', + `name` varchar(32) NOT NULL COMMENT '签名名称', + `apply_time` datetime DEFAULT NULL COMMENT '申请时间', + `enabled` int NOT NULL DEFAULT '1' COMMENT '启用状态:0 、停用,1、启用', + `remark` varchar(512) DEFAULT NULL COMMENT '备注', + `valid` tinyint NOT NULL DEFAULT '1' COMMENT '删除标志,是否有效:1 可用 0不可用', + `creator` bigint DEFAULT NULL COMMENT '创建人', + `creator_name` varchar(64) DEFAULT NULL COMMENT '创建人姓名', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `updater` bigint DEFAULT NULL COMMENT '更新人', + `updater_name` varchar(64) DEFAULT NULL COMMENT '更新人姓名', + `update_time` datetime DEFAULT NULL COMMENT '更新时间', + `version` int DEFAULT '0' COMMENT '版本号', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='短信签名表'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `t_sms_template` +-- + +DROP TABLE IF EXISTS `t_sms_template`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_sms_template` ( + `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键,自增', + `type` int NOT NULL DEFAULT '2' COMMENT '模板类型:1、验证码,2、短信通知', + `code` varchar(32) NOT NULL COMMENT '模板编号,第三方模板编码,如阿里云短信模板code', + `name` varchar(128) NOT NULL COMMENT '模板名称', + `content` varchar(512) NOT NULL COMMENT '模板内容', + `description` varchar(512) DEFAULT NULL COMMENT '模板描述', + `apply_time` datetime DEFAULT NULL COMMENT '申请时间', + `enabled` int NOT NULL DEFAULT '1' COMMENT '启用状态:0 、停用,1、启用', + `remark` varchar(512) DEFAULT NULL COMMENT '备注', + `valid` tinyint NOT NULL DEFAULT '1' COMMENT '删除标志,是否有效:1 可用 0不可用', + `creator` bigint DEFAULT NULL COMMENT '创建人', + `creator_name` varchar(64) DEFAULT NULL COMMENT '创建人姓名', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `updater` bigint DEFAULT NULL COMMENT '更新人', + `updater_name` varchar(64) DEFAULT NULL COMMENT '更新人姓名', + `update_time` datetime DEFAULT NULL COMMENT '更新时间', + `version` int DEFAULT '0' COMMENT '版本号', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='短信模板表,用于定义阿里云短信模板'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `t_sys_dict_data` +-- + +DROP TABLE IF EXISTS `t_sys_dict_data`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_sys_dict_data` ( + `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键,自增', + `dict_type_id` bigint NOT NULL COMMENT '字典类型ID', + `type_code` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '数据字典类型编号', + `type_name` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '数据字典类型名称', + `data_code` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '数据字典编号', + `data_name` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '数据字典名称', + `remark` varchar(512) DEFAULT NULL COMMENT '备注', + `valid` tinyint NOT NULL DEFAULT '1' COMMENT '删除标志,是否有效:1 可用 0不可用', + `creator` bigint DEFAULT NULL COMMENT '创建人', + `creator_name` varchar(64) DEFAULT NULL COMMENT '创建人姓名', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `updater` bigint DEFAULT NULL COMMENT '更新人', + `updater_name` varchar(64) DEFAULT NULL COMMENT '更新人姓名', + `update_time` datetime DEFAULT NULL COMMENT '更新时间', + `version` int DEFAULT '0' COMMENT '版本号', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='数据字典表'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `t_sys_dict_type` +-- + +DROP TABLE IF EXISTS `t_sys_dict_type`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_sys_dict_type` ( + `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键,自增', + `type_code` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '数据字典类型', + `type_name` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '类型名称', + `remark` varchar(512) DEFAULT NULL COMMENT '备注', + `valid` tinyint NOT NULL DEFAULT '1' COMMENT '删除标志,是否有效:1 可用 0不可用', + `creator` bigint DEFAULT NULL COMMENT '创建人', + `creator_name` varchar(64) DEFAULT NULL COMMENT '创建人姓名', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `updater` bigint DEFAULT NULL COMMENT '更新人', + `updater_name` varchar(64) DEFAULT NULL COMMENT '更新人姓名', + `update_time` datetime DEFAULT NULL COMMENT '更新时间', + `version` int DEFAULT '0' COMMENT '版本号', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='数据字典类型表'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `t_sys_file` +-- + +DROP TABLE IF EXISTS `t_sys_file`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_sys_file` ( + `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键,自增', + `type_code` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '文件类型编号 如病例ID', + `file_code` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '文件编号', + `file_name` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '文件名称', + `file_url` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '文件路径URL', + `remark` varchar(512) DEFAULT NULL COMMENT '备注', + `valid` tinyint NOT NULL DEFAULT '1' COMMENT '删除标志,是否有效:1 可用 0不可用', + `creator` bigint DEFAULT NULL COMMENT '创建人', + `creator_name` varchar(64) DEFAULT NULL COMMENT '创建人姓名', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `updater` bigint DEFAULT NULL COMMENT '更新人', + `updater_name` varchar(64) DEFAULT NULL COMMENT '更新人姓名', + `update_time` datetime DEFAULT NULL COMMENT '更新时间', + `version` int DEFAULT '0' COMMENT '版本号', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='文件表'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `t_sys_file_type` +-- + +DROP TABLE IF EXISTS `t_sys_file_type`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_sys_file_type` ( + `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键,自增', + `type_code` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '文件类型编号', + `type_name` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '文件类型名称', + `remark` varchar(512) DEFAULT NULL COMMENT '备注', + `valid` tinyint NOT NULL DEFAULT '1' COMMENT '删除标志,是否有效:1 可用 0不可用', + `creator` bigint DEFAULT NULL COMMENT '创建人', + `creator_name` varchar(64) DEFAULT NULL COMMENT '创建人姓名', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `updater` bigint DEFAULT NULL COMMENT '更新人', + `updater_name` varchar(64) DEFAULT NULL COMMENT '更新人姓名', + `update_time` datetime DEFAULT NULL COMMENT '更新时间', + `version` int DEFAULT '0' COMMENT '版本号', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='文件类型表'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `t_sys_menu` +-- + +DROP TABLE IF EXISTS `t_sys_menu`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_sys_menu` ( + `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键,自增', + `parent_id` bigint DEFAULT NULL COMMENT '父菜单ID', + `code` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '菜单编码', + `name` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '菜单名称', + `icon` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '菜单图标', + `href` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '链接地址,可以是页面地址,也可以是函数事件', + `url` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '请求地址,可以用于前端ajax调用,后端用于做权限控制', + `method` varchar(16) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '请求类型:GET, HEAD, POST, PUT, PATCH, DELETE, OPTIONS, TRACE', + `permission` varchar(256) DEFAULT NULL COMMENT '权限,可以有多个,用逗号分隔,可用于第三方权限框架扩展', + `category` int NOT NULL DEFAULT '1' COMMENT '分类:1、pc,2、app,3、wechat,4、miniapp', + `type` int NOT NULL DEFAULT '1' COMMENT '类型:1、module,2、menu,3、button', + `level` int DEFAULT '1' COMMENT '层级,从1开始', + `order_num` int DEFAULT '0' COMMENT '显示顺序', + `enabled` int NOT NULL DEFAULT '1' COMMENT '启用状态:0 、停用,1、启用', + `remark` varchar(512) DEFAULT NULL COMMENT '备注', + `valid` tinyint NOT NULL DEFAULT '1' COMMENT '删除标志,是否有效:1 可用 0不可用', + `creator` bigint DEFAULT NULL COMMENT '创建人', + `creator_name` varchar(64) DEFAULT NULL COMMENT '创建人姓名', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `updater` bigint DEFAULT NULL COMMENT '更新人', + `updater_name` varchar(64) DEFAULT NULL COMMENT '更新人姓名', + `update_time` datetime DEFAULT NULL COMMENT '更新时间', + `version` int DEFAULT '0' COMMENT '版本号', + PRIMARY KEY (`id`), + UNIQUE KEY `ak_sys_menu_code` (`code`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='菜单表'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `t_sys_menu_resource` +-- + +DROP TABLE IF EXISTS `t_sys_menu_resource`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_sys_menu_resource` ( + `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键,自增', + `menu_id` bigint NOT NULL COMMENT '菜单ID', + `resource_id` bigint NOT NULL COMMENT '资源ID', + `remark` varchar(512) DEFAULT NULL COMMENT '备注', + `valid` tinyint NOT NULL DEFAULT '1' COMMENT '删除标志,是否有效:1 可用 0不可用', + `creator` bigint DEFAULT NULL COMMENT '创建人', + `creator_name` varchar(64) DEFAULT NULL COMMENT '创建人姓名', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `updater` bigint DEFAULT NULL COMMENT '更新人', + `updater_name` varchar(64) DEFAULT NULL COMMENT '更新人姓名', + `update_time` datetime DEFAULT NULL COMMENT '更新时间', + `version` int DEFAULT '0' COMMENT '版本号', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='菜单资源关系表'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `t_sys_org` +-- + +DROP TABLE IF EXISTS `t_sys_org`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_sys_org` ( + `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键,自增', + `parent_id` bigint DEFAULT NULL COMMENT '父组织ID', + `genealogy_id` varchar(1024) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '家谱ID,格式:/rootId/.../grandfatherId/parentId', + `name` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '名称', + `contact` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '联系人', + `phone` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '联系电话', + `address` varchar(128) DEFAULT NULL COMMENT '联系地址', + `email` varchar(128) DEFAULT NULL COMMENT '邮箱', + `enabled` int NOT NULL DEFAULT '1' COMMENT '启用状态:0 、停用,1、启用', + `remark` varchar(512) DEFAULT NULL COMMENT '备注', + `valid` tinyint NOT NULL DEFAULT '1' COMMENT '删除标志,是否有效:1 可用 0不可用', + `creator` bigint DEFAULT NULL COMMENT '创建人', + `creator_name` varchar(64) DEFAULT NULL COMMENT '创建人姓名', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `updater` bigint DEFAULT NULL COMMENT '更新人', + `updater_name` varchar(64) DEFAULT NULL COMMENT '更新人姓名', + `update_time` datetime DEFAULT NULL COMMENT '更新时间', + `version` int DEFAULT '0' COMMENT '版本号', + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='系统组织表'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `t_sys_post` +-- + +DROP TABLE IF EXISTS `t_sys_post`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_sys_post` ( + `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键,自增', + `parent_id` bigint NOT NULL DEFAULT '0' COMMENT '上级岗位ID,第一个岗位的上级岗位ID填0', + `type` int NOT NULL DEFAULT '0' COMMENT '类型:0、内部岗位,1、代理商岗位', + `code` varchar(64) NOT NULL COMMENT '编码:\r\n 内部岗位:省区经理、provincial_manager,地市主管、area_manager,业务员、sale\r\n 代理商岗位:代理商、agent', + `name` varchar(128) NOT NULL COMMENT '名称', + `preset` int NOT NULL DEFAULT '0' COMMENT '预设标志:1 预设 0 非预设', + `enabled` int NOT NULL DEFAULT '1' COMMENT '启用状态:0 、停用,1、启用', + `remark` varchar(512) DEFAULT NULL COMMENT '备注', + `valid` tinyint NOT NULL DEFAULT '1' COMMENT '删除标志,是否有效:1 可用 0不可用', + `creator` bigint DEFAULT NULL COMMENT '创建人', + `creator_name` varchar(64) DEFAULT NULL COMMENT '创建人姓名', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `updater` bigint DEFAULT NULL COMMENT '更新人', + `updater_name` varchar(64) DEFAULT NULL COMMENT '更新人姓名', + `update_time` datetime DEFAULT NULL COMMENT '更新时间', + `version` int DEFAULT '0' COMMENT '版本号', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='岗位表,需根据岗位编码判断用户是否有销售、物流权限'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `t_sys_role` +-- + +DROP TABLE IF EXISTS `t_sys_role`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_sys_role` ( + `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键,自增', + `code` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '角色编码', + `name` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '角色名称', + `type` int NOT NULL DEFAULT '1' COMMENT '类型:1、平台,2、药店,3、医院', + `category` int NOT NULL DEFAULT '1' COMMENT '分类:1、pc,2、app,3、wechat,4、miniapp', + `manager_flag` int NOT NULL DEFAULT '0' COMMENT '管理角色标志:1 管理角色0 非管理角色,管理角色不允许修改角色菜单关系', + `preset` int NOT NULL DEFAULT '0' COMMENT '预设角色标志:1 预设 0 非预设', + `enabled` int NOT NULL DEFAULT '1' COMMENT '启用状态:0 、停用,1、启用', + `remark` varchar(512) DEFAULT NULL COMMENT '备注', + `valid` tinyint NOT NULL DEFAULT '1' COMMENT '删除标志,是否有效:1 可用 0不可用', + `creator` bigint DEFAULT NULL COMMENT '创建人', + `creator_name` varchar(64) DEFAULT NULL COMMENT '创建人姓名', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `updater` bigint DEFAULT NULL COMMENT '更新人', + `updater_name` varchar(64) DEFAULT NULL COMMENT '更新人姓名', + `update_time` datetime DEFAULT NULL COMMENT '更新时间', + `version` int DEFAULT '0' COMMENT '版本号', + PRIMARY KEY (`id`), + UNIQUE KEY `role_code` (`code`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='角色表'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `t_sys_role_menu` +-- + +DROP TABLE IF EXISTS `t_sys_role_menu`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_sys_role_menu` ( + `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键,自增', + `role_id` bigint NOT NULL COMMENT '角色ID', + `menu_id` bigint NOT NULL COMMENT '菜单ID', + `remark` varchar(512) DEFAULT NULL COMMENT '备注', + `valid` tinyint NOT NULL DEFAULT '1' COMMENT '删除标志,是否有效:1 可用 0不可用', + `creator` bigint DEFAULT NULL COMMENT '创建人', + `creator_name` varchar(64) DEFAULT NULL COMMENT '创建人姓名', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `updater` bigint DEFAULT NULL COMMENT '更新人', + `updater_name` varchar(64) DEFAULT NULL COMMENT '更新人姓名', + `update_time` datetime DEFAULT NULL COMMENT '更新时间', + `version` int DEFAULT '0' COMMENT '版本号', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='角色菜单关系表'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `t_sys_user` +-- + +DROP TABLE IF EXISTS `t_sys_user`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_sys_user` ( + `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键,自增', + `org_id` bigint NOT NULL COMMENT '组织ID', + `account` varchar(64) NOT NULL COMMENT '帐号', + `password` varchar(64) NOT NULL COMMENT '密码,存放加密后的密码,加密方式:md5(password+nonce_str),转成小写存储', + `code` varchar(32) NOT NULL COMMENT '工号', + `name` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '姓名', + `sex` tinyint DEFAULT '1' COMMENT '性别:1、男性,2、女性,0、未知', + `mobile` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '系统用户手机号', + `phone` varchar(32) DEFAULT NULL COMMENT '电话号码', + `idcard` varchar(32) DEFAULT NULL COMMENT '身份证', + `birthday` date DEFAULT NULL COMMENT '生日', + `email` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '系统用户邮箱', + `portrait` varchar(256) DEFAULT NULL COMMENT '头像', + `wechat` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '微信', + `qq` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT 'QQ', + `address` varchar(256) DEFAULT NULL COMMENT '联系地址', + `nonce_str` varchar(64) NOT NULL COMMENT '密码随机串,用于加密明文密码', + `modify_password_time` datetime DEFAULT NULL COMMENT '修改密码时间', + `mobile_enabled` int NOT NULL DEFAULT '0' COMMENT '手机号码是否激活:0、未激活,1、激活,根据是否使用过短信验证码登录确认是否激活状态', + `enabled` int NOT NULL DEFAULT '1' COMMENT '启用状态:0 、停用,1、启用', + `remark` varchar(512) DEFAULT NULL COMMENT '备注', + `valid` tinyint NOT NULL DEFAULT '1' COMMENT '删除标志,是否有效:1 可用 0不可用', + `creator` bigint DEFAULT NULL COMMENT '创建人', + `creator_name` varchar(64) DEFAULT NULL COMMENT '创建人姓名', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `updater` bigint DEFAULT NULL COMMENT '更新人', + `updater_name` varchar(64) DEFAULT NULL COMMENT '更新人姓名', + `update_time` datetime DEFAULT NULL COMMENT '更新时间', + `version` int DEFAULT '0' COMMENT '版本号', + PRIMARY KEY (`id`), + UNIQUE KEY `user_mobile` (`mobile`), + KEY `ak_user_account` (`account`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='系统用户表'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `t_sys_user_post` +-- + +DROP TABLE IF EXISTS `t_sys_user_post`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_sys_user_post` ( + `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键,自增', + `user_id` bigint NOT NULL COMMENT '用户ID', + `post_id` bigint NOT NULL COMMENT '岗位ID', + `remark` varchar(512) DEFAULT NULL COMMENT '备注', + `valid` tinyint NOT NULL DEFAULT '1' COMMENT '删除标志,是否有效:1 可用 0不可用', + `creator` bigint DEFAULT NULL COMMENT '创建人', + `creator_name` varchar(64) DEFAULT NULL COMMENT '创建人姓名', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `updater` bigint DEFAULT NULL COMMENT '更新人', + `updater_name` varchar(64) DEFAULT NULL COMMENT '更新人姓名', + `update_time` datetime DEFAULT NULL COMMENT '更新时间', + `version` int DEFAULT '0' COMMENT '版本号', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='用户岗位关系表,先限定一个用只有一种岗位'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `t_sys_user_role` +-- + +DROP TABLE IF EXISTS `t_sys_user_role`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_sys_user_role` ( + `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键,自增', + `user_id` bigint NOT NULL COMMENT '用户ID', + `role_id` bigint NOT NULL COMMENT '角色ID', + `remark` varchar(512) DEFAULT NULL COMMENT '备注', + `valid` tinyint NOT NULL DEFAULT '1' COMMENT '删除标志,是否有效:1 可用 0不可用', + `creator` bigint DEFAULT NULL COMMENT '创建人', + `creator_name` varchar(64) DEFAULT NULL COMMENT '创建人姓名', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `updater` bigint DEFAULT NULL COMMENT '更新人', + `updater_name` varchar(64) DEFAULT NULL COMMENT '更新人姓名', + `update_time` datetime DEFAULT NULL COMMENT '更新时间', + `version` int DEFAULT '0' COMMENT '版本号', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='用户角色关系表'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `t_task_det_his` +-- + +DROP TABLE IF EXISTS `t_task_det_his`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_task_det_his` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `valid` int NOT NULL DEFAULT '1' COMMENT '删除标志,是否有效:1 可用 0不可用,2停止', + `create_time` datetime DEFAULT NULL COMMENT '添加时间,每次修改记录要更新记录新增时间', + `creator_id` int DEFAULT '0' COMMENT '创建人id', + `updater_id` int DEFAULT '0' COMMENT '更新人id', + `update_time` datetime DEFAULT NULL COMMENT '修改时间,更具修改时间来判断下次执行顺序,第一次修改时间和新增时间相同', + `version` varchar(11) DEFAULT '1' COMMENT '版本号 默认为 1', + `status` int DEFAULT '0' COMMENT '状态: 0等待执行,', + `inter_code` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '内部编码,系统自动生成', + `task_code` varchar(128) DEFAULT '' COMMENT '任务编码', + `task_id` bigint NOT NULL COMMENT '历史任务id,关联当前任务表:t_task_his', + `order_no` varchar(128) DEFAULT '' COMMENT '订单号', + `iden_card_num` varchar(128) NOT NULL COMMENT '标识卡号,', + `product_name` varchar(128) DEFAULT '' COMMENT '产品名称', + `material_des` varchar(128) DEFAULT '' COMMENT '材料牌号 ', + `craft_ill` varchar(512) DEFAULT '' COMMENT '工艺要求 ', + `unit` varchar(32) DEFAULT '' COMMENT '单位', + `weight` float(8,2) DEFAULT '0.00' COMMENT '重量,手动输入', + `quantity` float(8,2) DEFAULT '0.00' COMMENT '数量,手动输入', + PRIMARY KEY (`id`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=254 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='任务明细历史表'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `t_task_his` +-- + +DROP TABLE IF EXISTS `t_task_his`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_task_his` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `valid` int NOT NULL DEFAULT '1' COMMENT '删除标志,是否有效:1 可用 0不可用,2停止', + `create_time` datetime DEFAULT NULL COMMENT '添加时间,每次修改记录要更新记录新增时间', + `creator_id` int DEFAULT '0' COMMENT '创建人id', + `updater_id` int DEFAULT '0' COMMENT '更新人id', + `update_time` datetime DEFAULT NULL COMMENT '修改时间,更具修改时间来判断下次执行顺序,第一次修改时间和新增时间相同', + `version` varchar(11) DEFAULT '1' COMMENT '版本号 默认为 1', + `status` int DEFAULT '0' COMMENT '状态: 0等待执行,1执行中,2执行完成', + `inter_code` varchar(128) NOT NULL COMMENT '内部编码,系统自动生成', + `is_auto` int DEFAULT '0' COMMENT '是否自动执行: 0手动,1自动,如果是自动任务这里要监控进出和到缓存区的调度任务', + `auto_exe_task_id` bigint DEFAULT '0' COMMENT '任务流程ID,关联流程表:t_auto_exe_task', + `kiln_id` bigint NOT NULL COMMENT '窑炉id,关联设备窑炉表:t_kiln_info', + `kiln_name` varchar(128) DEFAULT '' COMMENT '窑炉名称', + `craft_code_id` bigint DEFAULT '0' COMMENT '工艺号ID,关联工艺号表:t_craft_info', + `plc_value` int DEFAULT '0' COMMENT '工艺号对应PLC值', + `begin_time` datetime DEFAULT NULL COMMENT '开始加工时间', + `end_time` datetime DEFAULT NULL COMMENT '加工结束时间', + `is_in` int DEFAULT '0' COMMENT '进炉状态: 0准备进炉,1正在加工,2加工完成', + `run_task_id` bigint DEFAULT '0' COMMENT '调度任务ID,关联调度表:t_run_task', + `start_position` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '开始位置', + `target_position` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '目标位置指的是窑炉的位置', + `is_cache` int DEFAULT '0' COMMENT '是否缓存,如果当前指的窑炉正在加工,系统自动分配货物到缓存位置,\r\n 并且记录缓存库位,这是当指定窑炉加工完成后系统先判断是否当前缓存有当前等待执行的任务,然后按照先来先执行原则(等待多个任务)自动调用车辆来执行', + `cache_satatus` int DEFAULT '0' COMMENT '缓存状态状态: 0准备进入缓存区,1正在进入缓存区,2缓存完成', + `cache_run_task_id` bigint DEFAULT '0' COMMENT '调度任务ID,关联调度表:t_run_task', + `location_id` bigint DEFAULT '0' COMMENT '库位id,关联库位表:t_location', + `location_name` varchar(128) DEFAULT '' COMMENT '库位名称', + `is_out` int DEFAULT '0' COMMENT '出炉状态: 0准备出炉,1正在加工,2加工完成', + `out_run_task_id` bigint DEFAULT '0' COMMENT '调度任务ID,关联调度表:t_run_task', + `out_start_position` varchar(128) DEFAULT '' COMMENT '开始位置', + `out_target_position` varchar(128) DEFAULT '' COMMENT '目标位置,指缓存位置', + `task_code` varchar(100) NOT NULL DEFAULT '' COMMENT '任务编码', + `process_type` int NOT NULL COMMENT '加工类型:0 初始加工,1 复加工', + `task_type` int NOT NULL COMMENT '任务类型:0:入库到窑炉,1:入库到缓存区,2出库到 窑炉到缓存区,3缓存区出库', + `sheet_no` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '生产单号 APMS生成生产单后返回', + PRIMARY KEY (`id`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=252 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='任务历史表'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `t_task_source_log` +-- + +DROP TABLE IF EXISTS `t_task_source_log`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_task_source_log` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `valid` int NOT NULL DEFAULT '1' COMMENT '删除标志,是否有效:1 可用 0不可用,2停止', + `create_time` datetime DEFAULT NULL COMMENT '添加时间,入库时间', + `creator_id` int DEFAULT '0' COMMENT '创建人id', + `updater_id` int DEFAULT '0' COMMENT '更新人id', + `update_time` datetime DEFAULT NULL COMMENT '修改时间,更具修改时间来判断下次执行顺序,第一次修改时间和新增时间相同', + `version` varchar(11) DEFAULT '1' COMMENT '版本号 默认为 1', + `status` int DEFAULT '0' COMMENT '状态,0:wms To wcs日期,1:wcs to wms日志', + `inter_code` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '内部编码,系统自动生成', + `source` int DEFAULT '0' COMMENT '日志来源,0:APMS,1:手动,2:其它系统,依次类推', + `log_name` varchar(128) DEFAULT '' COMMENT '日志名称', + `content` varchar(1024) DEFAULT '' COMMENT '内容', + PRIMARY KEY (`id`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=250 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='任务来源日志信息'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `t_tray_info` +-- + +DROP TABLE IF EXISTS `t_tray_info`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_tray_info` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `valid` int NOT NULL DEFAULT '1' COMMENT '删除标志,是否有效:1 可用 0不可用', + `create_time` datetime DEFAULT NULL COMMENT '添加时间', + `creator_id` int DEFAULT '0' COMMENT '创建人id', + `updater_id` int DEFAULT '0' COMMENT '更新人id', + `update_time` datetime DEFAULT NULL COMMENT '修改时间', + `version` varchar(11) DEFAULT '1' COMMENT '版本号 默认为 1', + `status` int DEFAULT '0' COMMENT '状态 0:正常,1:损坏', + `inter_code` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '内部编码,系统自动生成', + `code` varchar(128) DEFAULT '' COMMENT '编码', + `tray_name` varchar(256) NOT NULL COMMENT '托盘名称', + `spec` varchar(256) DEFAULT NULL COMMENT '规格', + `note` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=250 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='托盘信息表'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `t_vehicle_info` +-- + +DROP TABLE IF EXISTS `t_vehicle_info`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_vehicle_info` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `valid` int NOT NULL DEFAULT '1' COMMENT '删除标志,是否有效:1 可用 0不可用', + `create_time` datetime DEFAULT NULL COMMENT '添加时间', + `creator_id` int DEFAULT '0' COMMENT '创建人id', + `updater_id` int DEFAULT '0' COMMENT '更新人id', + `update_time` datetime DEFAULT NULL COMMENT '修改时间', + `version` varchar(11) DEFAULT '1' COMMENT '版本号 默认为 1', + `status` int DEFAULT '0' COMMENT '状态 0初始化,1使用中,2损坏', + `inter_code` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '内部编码,系统自动生成', + `code` varchar(128) DEFAULT '' COMMENT '编码', + `factory_id` int DEFAULT NULL COMMENT '绑定工厂id', + `vehicle_name` varchar(256) NOT NULL COMMENT '车辆名称', + `vehicle_alias` varchar(256) DEFAULT '' COMMENT '车辆别名', + `en` varchar(256) DEFAULT '' COMMENT '英语名称', + `type` varchar(64) DEFAULT '' COMMENT '设备类型,存储数据字典编码', + `ip` varchar(32) DEFAULT '' COMMENT 'ip地址', + `port_number` varchar(16) DEFAULT '' COMMENT '端口号', + `description` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '描述信息', + `note` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=251 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='RGV车辆信息'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `t_warehouse` +-- + +DROP TABLE IF EXISTS `t_warehouse`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_warehouse` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `valid` int NOT NULL DEFAULT '1' COMMENT '删除标志,是否有效:1 可用 0不可用', + `create_time` datetime DEFAULT NULL COMMENT '添加时间', + `creator_id` int DEFAULT '0' COMMENT '创建人id', + `updater_id` int DEFAULT '0' COMMENT '更新人id', + `update_time` datetime DEFAULT NULL COMMENT '修改时间', + `version` varchar(11) DEFAULT '1' COMMENT '版本号 默认为 1', + `status` int DEFAULT '0' COMMENT '状态 0初始化,1已占用', + `inter_code` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '内部编码', + `code` varchar(128) DEFAULT '' COMMENT '编码', + `factory_id` int DEFAULT NULL COMMENT '绑定工厂id', + `warehouse_name` varchar(256) NOT NULL COMMENT '仓库名称', + `spec` varchar(128) DEFAULT '' COMMENT '规格', + `description` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '描述信息', + `note` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '备注', + `english_name` varchar(256) DEFAULT NULL COMMENT '英文名称', + `alias_name` varchar(256) DEFAULT NULL COMMENT '别名', + `number` int NOT NULL COMMENT '库位数量', + PRIMARY KEY (`id`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=252 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='缓存区表'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `t_wcs_task` +-- + +DROP TABLE IF EXISTS `t_wcs_task`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_wcs_task` ( + `id` int NOT NULL AUTO_INCREMENT, + `valid` int NOT NULL DEFAULT '1' COMMENT '删除标志,是否有效:1 可用 0不可用,2停止', + `create_time` datetime DEFAULT NULL COMMENT '添加时间,入库时间', + `creator_id` int DEFAULT '0' COMMENT '创建人id', + `updater_id` int DEFAULT '0' COMMENT '更新人id', + `update_time` datetime DEFAULT NULL COMMENT '修改时间,更具修改时间来判断下次执行顺序,第一次修改时间和新增时间相同', + `version` varchar(11) DEFAULT '1' COMMENT '版本号 默认为 1', + `code` varchar(128) DEFAULT '' COMMENT '任务编码', + `iden_card_number` varchar(128) DEFAULT '' COMMENT '标识卡号', + `product_name` varchar(512) DEFAULT '' COMMENT '产品名称,有多个逗号隔开', + `material_grade` varchar(512) DEFAULT '' COMMENT '材料牌号,有多个逗号隔开', + `start_position` varchar(128) DEFAULT '' COMMENT '开始位置', + `end_position` varchar(128) DEFAULT '' COMMENT '结束位置', + `status` int DEFAULT '0' COMMENT '状态,0:未执行,1:正在执行,2:执行成功,3:执行失败', + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='wcs 任务信息表'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `t_wcs_task_log` +-- + +DROP TABLE IF EXISTS `t_wcs_task_log`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_wcs_task_log` ( + `id` int NOT NULL AUTO_INCREMENT, + `valid` int NOT NULL DEFAULT '1' COMMENT '删除标志,是否有效:1 可用 0不可用,2停止', + `create_time` datetime DEFAULT NULL COMMENT '添加时间,入库时间', + `creator_id` int DEFAULT '0' COMMENT '创建人id', + `updater_id` int DEFAULT '0' COMMENT '更新人id', + `update_time` datetime DEFAULT NULL COMMENT '修改时间,更具修改时间来判断下次执行顺序,第一次修改时间和新增时间相同', + `version` varchar(11) DEFAULT '1' COMMENT '版本号 默认为 1', + `source` varchar(128) DEFAULT '' COMMENT '任务来源', + `receive_status` varchar(128) DEFAULT '是' COMMENT '接收状态', + `send_status` varchar(128) DEFAULT '否' COMMENT '发送状态', + `content` varchar(512) DEFAULT '' COMMENT '内容', + `code` varchar(128) DEFAULT '' COMMENT '编码 和 t_wcs_task 中的code 一直。用来对应wms传过来任务的 唯一标识', + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='wcs 任务信息日志表'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `t_wechat_template_message` +-- + +DROP TABLE IF EXISTS `t_wechat_template_message`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_wechat_template_message` ( + `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键', + `account_id` bigint DEFAULT NULL COMMENT '账号ID', + `user_type` int NOT NULL DEFAULT '1' COMMENT '用户类型\r\n 1、平台\r\n 2、药店\r\n 3、医院\r\n 4、患者', + `user_id` bigint NOT NULL COMMENT '用户ID', + `open_id` varchar(128) NOT NULL COMMENT '微信用户ID', + `template_id` varchar(128) NOT NULL COMMENT '消息模板ID', + `title` varchar(128) NOT NULL COMMENT '标题', + `content` varchar(512) NOT NULL COMMENT '消息内容', + `url` varchar(128) NOT NULL COMMENT '链接地址', + `message_id` varchar(128) DEFAULT NULL COMMENT '消息ID', + `status` int NOT NULL DEFAULT '0' COMMENT '状态\r\n 0、未发送\r\n 1、发送中\r\n 2、已发送\r\n -1、失败', + `reserved` varchar(128) DEFAULT NULL COMMENT '预留字段', + `remark` varchar(512) DEFAULT NULL COMMENT '备注', + `valid` tinyint NOT NULL DEFAULT '1' COMMENT '删除标志,是否有效:1 可用 0不可用', + `creator` bigint DEFAULT NULL COMMENT '创建人', + `creator_name` varchar(64) DEFAULT NULL COMMENT '创建人姓名', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `updater` bigint DEFAULT NULL COMMENT '更新人', + `updater_name` varchar(64) DEFAULT NULL COMMENT '更新人姓名', + `update_time` datetime DEFAULT NULL COMMENT '更新时间', + `version` int DEFAULT '0' COMMENT '版本号', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='微信模板消息表'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping routines for database 'mt_wms_qj' +-- +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + +-- Dump completed on 2021-12-23 9:21:37 diff --git a/6.program/wms-core/src/main/java/com/mt/wms/core/dal/entity/ParEleValue.java b/6.program/wms-core/src/main/java/com/mt/wms/core/dal/entity/ParEleValue.java index 89d315f..173b6e1 100644 --- a/6.program/wms-core/src/main/java/com/mt/wms/core/dal/entity/ParEleValue.java +++ b/6.program/wms-core/src/main/java/com/mt/wms/core/dal/entity/ParEleValue.java @@ -18,7 +18,7 @@ import lombok.experimental.Accessors; *

* * @author mt - * @since 2021-11-18 + * @since 2021-12-27 */ @Data @EqualsAndHashCode(callSuper = false) @@ -104,10 +104,10 @@ public class ParEleValue extends Model { private Float totalBat; /** - * 扩展字段1 + * 时间段类型。0:半小时,1:天,2:月 */ - @TableField("add_a") - private Float addA; + @TableField("date_type") + private Integer dateType; /** * 扩展字段2 @@ -166,7 +166,7 @@ public class ParEleValue extends Model { public static final String TOTAL_BAT = "total_bat"; - public static final String ADD_A = "add_a"; + public static final String DATE_TYPE = "date_type"; public static final String ADD_B = "add_b"; diff --git a/6.program/wms-core/src/main/java/com/mt/wms/core/dal/mapper/ParEleValueMapper.java b/6.program/wms-core/src/main/java/com/mt/wms/core/dal/mapper/ParEleValueMapper.java index 91720d9..9f2ff8d 100644 --- a/6.program/wms-core/src/main/java/com/mt/wms/core/dal/mapper/ParEleValueMapper.java +++ b/6.program/wms-core/src/main/java/com/mt/wms/core/dal/mapper/ParEleValueMapper.java @@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; *

* * @author mt - * @since 2021-11-18 + * @since 2021-12-27 */ public interface ParEleValueMapper extends BaseMapper { diff --git a/6.program/wms-core/src/main/java/com/mt/wms/core/dal/mapper/ParEleValueMapper.xml b/6.program/wms-core/src/main/java/com/mt/wms/core/dal/mapper/ParEleValueMapper.xml index 9016bf5..b49df70 100644 --- a/6.program/wms-core/src/main/java/com/mt/wms/core/dal/mapper/ParEleValueMapper.xml +++ b/6.program/wms-core/src/main/java/com/mt/wms/core/dal/mapper/ParEleValueMapper.xml @@ -17,7 +17,7 @@ - + @@ -27,7 +27,7 @@ - id, create_time, inter_code, status, kiln_id, par_id, a_voltagev_value, b_voltagev_value, c_voltagev_value, a_current_value, b_current_value, c_current_value, total_bat, add_a, add_b, add_c, orther_a, orther_b, orther_c + id, create_time, inter_code, status, kiln_id, par_id, a_voltagev_value, b_voltagev_value, c_voltagev_value, a_current_value, b_current_value, c_current_value, total_bat, date_type, add_b, add_c, orther_a, orther_b, orther_c diff --git a/6.program/wms-core/src/main/java/com/mt/wms/core/dal/service/ParEleValueServiceBiz.java b/6.program/wms-core/src/main/java/com/mt/wms/core/dal/service/ParEleValueServiceBiz.java index 10e5569..ada7c94 100644 --- a/6.program/wms-core/src/main/java/com/mt/wms/core/dal/service/ParEleValueServiceBiz.java +++ b/6.program/wms-core/src/main/java/com/mt/wms/core/dal/service/ParEleValueServiceBiz.java @@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.extension.service.IService; *

* * @author mt - * @since 2021-11-18 + * @since 2021-12-27 */ public interface ParEleValueServiceBiz extends IService { diff --git a/6.program/wms-core/src/main/java/com/mt/wms/core/dal/service/impl/ParEleValueServiceBizImpl.java b/6.program/wms-core/src/main/java/com/mt/wms/core/dal/service/impl/ParEleValueServiceBizImpl.java index 7f867ff..e55672d 100644 --- a/6.program/wms-core/src/main/java/com/mt/wms/core/dal/service/impl/ParEleValueServiceBizImpl.java +++ b/6.program/wms-core/src/main/java/com/mt/wms/core/dal/service/impl/ParEleValueServiceBizImpl.java @@ -12,7 +12,7 @@ import org.springframework.stereotype.Service; *

* * @author mt - * @since 2021-11-18 + * @since 2021-12-27 */ @Service public class ParEleValueServiceBizImpl extends ServiceImpl implements ParEleValueServiceBiz { diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/controller/ElectricController.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/controller/ElectricController.java index a2c6090..d10813d 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/controller/ElectricController.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/controller/ElectricController.java @@ -12,6 +12,7 @@ import com.mt.wms.empty.params.ElectricQueryParam; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; +import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.PostMapping; @@ -19,12 +20,17 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +import javax.annotation.PostConstruct; import javax.validation.groups.Default; +import java.time.DayOfWeek; import java.time.LocalDate; import java.time.LocalDateTime; import java.time.LocalTime; import java.time.temporal.ChronoUnit; +import java.time.temporal.TemporalAdjusters; +import java.util.LinkedHashMap; import java.util.List; +import java.util.Map; /** * @Author: liguanghao @@ -37,6 +43,34 @@ import java.util.List; @Api(value = "电能消耗相关接口", tags = "电能消耗相关接口", hidden = false) public class ElectricController extends BaseController { + + //@PostConstruct + public void test(){ + LocalDateTime time=LocalDateTime.of(2021, 3, 31, 0, 0, 0); + Float f=29000F; + + LocalDate timeDate=time.toLocalDate(); + LocalDateTime timeEnd = LocalDateTime.of(timeDate, LocalTime.MAX).minus(5,ChronoUnit.SECONDS); + for (int i = 0; i < 10; i++) { + + ParEleValue parEleValue=new ParEleValue(); + parEleValue.setDateType(2); + parEleValue.setParId(1); + parEleValue.setKilnId(1); + parEleValue.setTotalBat(Float.valueOf(String.valueOf(f+(Math.random()*24000)))); + parEleValue.setCreateTime(timeEnd); + timeEnd=timeEnd.plus(1,ChronoUnit.MONTHS); + f=parEleValue.getTotalBat(); + parEleValueServiceBiz.save(parEleValue); + System.out.println(parEleValue); + } + + } + + public void test1(){ + + } + @Autowired private ParEleValueServiceBiz parEleValueServiceBiz; @@ -44,10 +78,7 @@ public class ElectricController extends BaseController { @ApiOperation(value = "根据窑炉id获取电能消耗情况") private R list(@Validated({Default.class}) @RequestBody ElectricQueryParam electricQueryParam) { Long kiln = electricQueryParam.getKilnId(); - //窑炉id为0代表全部 - if (kiln==0){ - - }else { + //窑炉id为0代表全部,存储的时候计算全部 JSONObject jsonObject=new JSONObject(); //指定时间节点 LocalDate timeDate = electricQueryParam.getTime().toLocalDate(); @@ -71,12 +102,13 @@ public class ElectricController extends BaseController { List yesterdayEleValueList = parEleValueServiceBiz.list(new QueryWrapper() .eq("kiln_id", kiln) .between("create_time", yesterdayStart, yesterdayEnd) + .eq("date_type",0) .orderByAsc("create_time")); Float yesterdayTotalBat= yesterdayEleValueList.get(yesterdayEleValueList.size()-1).getTotalBat()-yesterdayEleValueList.get(0).getTotalBat(); jsonObject.put("yesterdayCountEle",yesterdayTotalBat); //指定日期当天的电能消耗 - if (electricQueryParam.getDateType()==1){ + if (electricQueryParam.getDateType()==0){ List dateEleValueList = parEleValueServiceBiz.list(new QueryWrapper() .eq("kiln_id", kiln) .between("create_time", timeStart, timeEnd) @@ -88,12 +120,90 @@ public class ElectricController extends BaseController { } jsonObject.put("dateCountEle",dateCountEle); //分时消耗量 + Map timeJsonObject=new LinkedHashMap(); for (int i = 0; i < dateEleValueList.size() - 1; ++i) { // TODO: 2021/12/16 float eleValue = dateEleValueList.get(i).getTotalBat() - dateEleValueList.get(i - 1).getTotalBat(); + int j=i+1; + if (j%2==0){ + String time=(j-1)/2+":30"; + timeJsonObject.put(time,eleValue); + }else { + String time=(j-1)/2+":00"; + timeJsonObject.put(time,eleValue); + } } + jsonObject.put("timeEle",timeJsonObject); } - } - return null; + //指定日期当周的每天电能消耗 + if(electricQueryParam.getDateType()==1){ + LocalDate monday = timeDate.with(DayOfWeek.MONDAY); + LocalDate sunday = timeDate.with(DayOfWeek.SUNDAY); + List timeWeekEleValueList = parEleValueServiceBiz.list(new QueryWrapper() + .eq("kiln_id", kiln) + .between("create_time", monday, sunday.plusDays(1)) + .eq("date_type", 1) + .orderByAsc("create_time")); + //总耗电量 + Float dateCountEle=0F; + if (timeWeekEleValueList.size()!=0){ + dateCountEle= timeWeekEleValueList.get(timeWeekEleValueList.size()-1).getTotalBat()-timeWeekEleValueList.get(0).getTotalBat(); + } + jsonObject.put("dateCountEle",dateCountEle); + Map timeJsonObject=new LinkedHashMap(); + for (ParEleValue parEleValue:timeWeekEleValueList + ) { + LocalDate localDate = parEleValue.getCreateTime().toLocalDate(); + timeJsonObject.put(localDate.toString(),parEleValue.getTotalBat()); + } + jsonObject.put("timeEle",timeJsonObject); + } + //指定日期当月的每天电能消耗 + if(electricQueryParam.getDateType()==2){ + LocalDate firstday = LocalDate.of(timeDate.getYear(), timeDate.getMonthValue(), 1); + LocalDate lastDay = timeDate.with(TemporalAdjusters.lastDayOfMonth()); + List timeMonthEleValueList = parEleValueServiceBiz.list(new QueryWrapper() + .eq("kiln_id", kiln) + .between("create_time", firstday, lastDay.plusDays(1)) + .eq("date_type", 1) + .orderByAsc("create_time")); + //总耗电量 + Float dateCountEle=0F; + if (timeMonthEleValueList.size()!=0){ + dateCountEle= timeMonthEleValueList.get(timeMonthEleValueList.size()-1).getTotalBat()-timeMonthEleValueList.get(0).getTotalBat(); + } + jsonObject.put("dateCountEle",dateCountEle); + Map timeJsonObject=new LinkedHashMap(); + for (ParEleValue parEleValue:timeMonthEleValueList + ) { + LocalDate localDate = parEleValue.getCreateTime().toLocalDate(); + timeJsonObject.put(localDate.toString(),parEleValue.getTotalBat()); + } + jsonObject.put("timeEle",timeJsonObject); + } + //指定日期当年的每月电能消耗 + if(electricQueryParam.getDateType()==2){ + LocalDate firstDay = timeDate.with(TemporalAdjusters.firstDayOfYear()); + LocalDate lastDay = timeDate.with(TemporalAdjusters.lastDayOfYear()); + List timeYearEleValueList = parEleValueServiceBiz.list(new QueryWrapper() + .eq("kiln_id", kiln) + .between("create_time", firstDay, lastDay.plusDays(1)) + .eq("date_type", 2) + .orderByAsc("create_time")); + //总耗电量 + Float dateCountEle=0F; + if (timeYearEleValueList.size()!=0){ + dateCountEle= timeYearEleValueList.get(timeYearEleValueList.size()-1).getTotalBat()-timeYearEleValueList.get(0).getTotalBat(); + } + jsonObject.put("dateCountEle",dateCountEle); + Map timeJsonObject=new LinkedHashMap(); + for (ParEleValue parEleValue:timeYearEleValueList + ) { + LocalDate localDate = parEleValue.getCreateTime().toLocalDate(); + timeJsonObject.put(localDate.toString(),parEleValue.getTotalBat()); + } + jsonObject.put("timeEle",timeJsonObject); + } + return successful(jsonObject.toJSONString()); } } diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/params/AlarmInfoQueryParam.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/params/AlarmInfoQueryParam.java index 853688c..d92670b 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/params/AlarmInfoQueryParam.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/params/AlarmInfoQueryParam.java @@ -24,9 +24,9 @@ public class AlarmInfoQueryParam extends BasePageParam { private static final long serialVersionUID = 1L; @ApiModelProperty(value = "设备ID", required = false) - private Long equipmentID; + private Long equipmentId; - @ApiModelProperty(value = "报警类型", required = true) + @ApiModelProperty(value = "报警类型0窑炉,1表示车辆", required = true) private Integer type; @ApiModelProperty(value = "开始时间", required = false) diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/AlarmInfoServiceImpl.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/AlarmInfoServiceImpl.java index f8d4e69..bad72a4 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/AlarmInfoServiceImpl.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/AlarmInfoServiceImpl.java @@ -33,7 +33,7 @@ public class AlarmInfoServiceImpl extends BaseService implements AlarmInfoServic QueryWrapper wrapper = new QueryWrapper<>(); wrapper.between(alarmInfoQueryParam.getStartTime() != null, AlarmInfo.CREATE_TIME, alarmInfoQueryParam.getStartTime(), alarmInfoQueryParam.getEndTime()) .eq(AlarmInfo.TYPE, alarmInfoQueryParam.getType()) - .eq(alarmInfoQueryParam.getEquipmentID() != null, AlarmInfo.EQUIPMENT_ID, alarmInfoQueryParam.getEquipmentID()) + .eq(alarmInfoQueryParam.getEquipmentId() != null, AlarmInfo.EQUIPMENT_ID, alarmInfoQueryParam.getEquipmentId()) .orderByDesc(AlarmInfo.CREATE_TIME); Page page = alarmInfoServiceBiz.page(new Page<>(alarmInfoQueryParam.getCurrent(), alarmInfoQueryParam.getSize()), wrapper); return successful(new PageVo<>(page, AlarmInfoVo.class)); diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/OutStockServiceImpl.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/OutStockServiceImpl.java index 0978720..ce7a873 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/OutStockServiceImpl.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/OutStockServiceImpl.java @@ -3,13 +3,19 @@ package com.mt.wms.empty.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.mt.wms.core.base.BaseService; import com.mt.wms.core.dal.entity.InStockInfo; +import com.mt.wms.core.dal.entity.InStockInfoHis; +import com.mt.wms.core.dal.entity.RunTask; import com.mt.wms.core.dal.entity.VehicleInfo; +import com.mt.wms.core.dal.service.InStockInfoHisServiceBiz; import com.mt.wms.core.dal.service.InStockInfoServiceBiz; +import com.mt.wms.core.dal.service.RunTaskServiceBiz; import com.mt.wms.core.dal.service.VehicleInfoServiceBiz; +import com.mt.wms.core.dal.service.impl.InStockInfoHisServiceBizImpl; import com.mt.wms.core.vo.R; import com.mt.wms.empty.params.OutStockParam; import com.mt.wms.empty.service.OutStockService; import com.mt.wms.empty.task.AsynRunTaskService; +import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -33,11 +39,14 @@ public class OutStockServiceImpl extends BaseService implements OutStockService private AsynRunTaskService asynRunTaskService; @Resource private InStockInfoServiceBiz inStockInfoServiceBiz; + @Resource + private RunTaskServiceBiz runTaskServiceBiz; + @Override public R outTask(OutStockParam outStockParam) { // TODO: 2021/12/17 出库 - Long localtionId = outStockParam.getLocaltionId(); + Long locationId = outStockParam.getLocaltionId(); //提升台 Integer code = outStockParam.getCode(); //查询是否有空闲车辆,若有。占用车辆,若无,返回暂无可用车辆 @@ -52,14 +61,22 @@ public class OutStockServiceImpl extends BaseService implements OutStockService }else { return R.failed("暂无可用车辆!请稍后重试!"); } + //生成调度任务 + RunTask runTask=new RunTask(); + runTask.setBeginTime(LocalDateTime.now()); + runTask.setVehicleId(vehicleInfoList.get(0).getId()); + // TODO: 2021/12/22 库位id对应的位置 ,提升平台对应的位置 + runTask.setStartPosition("库位位置"); + runTask.setEndPosition("提升台位置"); + setCommonField(runTask); + runTaskServiceBiz.save(runTask); //异步调用车辆 - asynRunTaskService.asynRunOutStock(); + asynRunTaskService.asynRunOutStock(runTask.getId(),locationId); //修改库位状态 InStockInfo inStockInfo = inStockInfoServiceBiz - .getOne(new QueryWrapper().eq("Location_id", localtionId)); + .getOne(new QueryWrapper().eq("Location_id", locationId)); inStockInfo.setStatus(1); inStockInfoServiceBiz.updateById(inStockInfo); return R.ok("操作成功"); - } } diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/StockInfoServiceImpl.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/StockInfoServiceImpl.java index b1c3797..d06772e 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/StockInfoServiceImpl.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/StockInfoServiceImpl.java @@ -5,9 +5,11 @@ import com.mt.wms.core.base.BaseService; import com.mt.wms.core.dal.entity.CurrTaskDet; import com.mt.wms.core.dal.entity.InStockInfo; import com.mt.wms.core.dal.entity.Location; +import com.mt.wms.core.dal.entity.OrderInfo; import com.mt.wms.core.dal.service.CurrTaskDetServiceBiz; import com.mt.wms.core.dal.service.InStockInfoServiceBiz; import com.mt.wms.core.dal.service.LocationServiceBiz; +import com.mt.wms.core.dal.service.OrderInfoServiceBiz; import com.mt.wms.core.params.IdParam; import com.mt.wms.core.vo.R; import com.mt.wms.empty.params.StockInfoQueryParam; @@ -36,11 +38,18 @@ public class StockInfoServiceImpl extends BaseService implements StockInfoServic private LocationServiceBiz locationServiceBiz; @Resource private CurrTaskDetServiceBiz currTaskDetServiceBiz; + @Resource + private OrderInfoServiceBiz orderInfoServiceBiz; @Override public R> get(IdParam idParam) { Long taskId = inStockInfoServiceBiz.getById(idParam).getTaskId(); List currTaskDetList = currTaskDetServiceBiz.list(new QueryWrapper().eq("curr_task_id", taskId)); List currTaskDetVoList = com.mt.wms.core.utils.BeanUtils.copyList(currTaskDetList, CurrTaskDetVo.class); + for (CurrTaskDetVo currTaskDetVo:currTaskDetVoList + ) { + String costomerName = orderInfoServiceBiz.getOne(new QueryWrapper().eq("order_no", currTaskDetVo.getOrderNo())).getCustomerName(); + currTaskDetVo.setCustomer(costomerName); + } return successful(currTaskDetVoList); } @@ -55,11 +64,13 @@ public class StockInfoServiceImpl extends BaseService implements StockInfoServic //库位为空 if (location.getStatus()!=1){ stockInfoVo.setEmpty(1); - stockInfoVo.setLocaltionId(location.getId()); + stockInfoVo.setLocationId(location.getId()); + stockInfoVo.setLocationName(location.getLocationNameAlias()); }else { InStockInfo inStockInfo = inStockInfoServiceBiz.getOne(new QueryWrapper() - .eq("localtion_id", location.getId())); + .eq("location_id", location.getId())); BeanUtils.copyProperties(inStockInfo,stockInfoVo); + stockInfoVo.setEmpty(0); } stockInfoVoList.add(stockInfoVo); } diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/task/AsynRunTaskService.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/task/AsynRunTaskService.java index cf3f6a8..0d33167 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/task/AsynRunTaskService.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/task/AsynRunTaskService.java @@ -7,6 +7,7 @@ import com.mt.wms.core.dal.service.*; import com.mt.wms.core.utils.IDGenerator; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.springframework.beans.BeanUtils; import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -32,7 +33,8 @@ public class AsynRunTaskService extends BaseService { private LocationServiceBiz locationServiceBiz; @Resource private InStockInfoServiceBiz inStockInfoServiceBiz; - + @Resource + private InStockInfoHisServiceBiz inStockInfoHisServiceBiz; //窑炉可用未满的情况下,调用车辆起点为提升台终点为窑炉 @Async("asyncServiceExecutor") public void asynRunTask(Long currTaskId,Long vehicleId){ @@ -84,6 +86,7 @@ public class AsynRunTaskService extends BaseService { runTask.setVehicleId(vehicleId); runTask.setBeginTime(LocalDateTime.now()); runTask.setStartPosition(currTask.getStartPosition()); + // TODO: 2021/12/28 location对应的点位 runTask.setEndPosition(location.getCode()); runTaskServiceBiz.save(runTask); //更新 location 表对应库位状态为占用 @@ -135,12 +138,108 @@ public class AsynRunTaskService extends BaseService { } //窑炉加工完成,调用车辆入库到缓存区 @Async("asyncServiceExecutor") - public void asynRunTaskForKilnToWarehouse(Long kilnId,Long vehicleId){ - + public void asynRunTaskForKilnToWarehouse(Long currTaskId,Long vehicleId){ + CurrTask currTask = currTaskServiceBiz.getById(currTaskId); + // TODO: 2021/12/28 location排序 + Location location = locationServiceBiz.list(new QueryWrapper() + .eq(Location.STATUS, 1) + .eq(Location.VALID, 1)).get(0); + currTask.setOutStartPosition(currTask.getTargetPosition()); + // TODO: 2021/12/28 location对应的点位 + currTask.setOutTargetPosition(location.getCode()); + currTaskServiceBiz.updateById(currTask); + //新建一条执行任务的关系表存放任务执行信息,终点为缓存区空闲库位 + RunTask runTask=new RunTask(); + setCommonField(runTask); + runTask.setTaskId(currTask.getId()); + runTask.setTaskCode(currTask.getTaskCode()); + runTask.setVehicleId(vehicleId); + runTask.setBeginTime(LocalDateTime.now()); + runTask.setStartPosition(currTask.getOutStartPosition()); + runTask.setEndPosition(currTask.getOutTargetPosition()); + runTaskServiceBiz.save(runTask); + //更新 location 表对应库位状态为占用 + location.setStatus(1); + location.setUpdateTime(LocalDateTime.now()); + locationServiceBiz.updateById(location); + currTask.setOutRunTaskId(runTask.getId()); + currTaskServiceBiz.updateById(currTask); + //添加一条库位详情到in_stock_info表 + InStockInfo inStockInfo=new InStockInfo(); + inStockInfo.setStatus(1); + inStockInfo.setInterCode(IDGenerator.gen("HCT", "yyyyMMddHHmm", 2, "WAREHOUSE_CODE")); + inStockInfo.setTaskId(currTask.getId()); + inStockInfo.setTaskCode(currTask.getTaskCode()); + inStockInfo.setKilnId(currTask.getKilnId()); + inStockInfo.setKilnName(currTask.getKilnName()); + inStockInfo.setLocationId(location.getId()); + inStockInfo.setLocationName(location.getLocationNameAlias()); + inStockInfo.setType(0); + setCommonField(inStockInfo); + inStockInfoServiceBiz.save(inStockInfo); + // TODO: 2021/12/14 调用车辆填入起终点,得到车辆执行结果,填入任务号(待确认) + if (true){ + //更新关系表状态为完成 + runTask.setUpdateTime(LocalDateTime.now()); + runTask.setStatus(2); + runTask.setEndTime(LocalDateTime.now()); + runTaskServiceBiz.updateById(runTask); + //更新currTask表 + currTask.setIsOut(2); + currTask.setUpdateTime(LocalDateTime.now()); + currTask.setStatus(2); + currTaskServiceBiz.updateById(currTask); + //更新in_stock_info表 + inStockInfo.setStatus(2); + inStockInfo.setInTime(LocalDateTime.now()); + inStockInfoServiceBiz.updateById(inStockInfo); + }else { + runTask.setStatus(3); + runTask.setUpdateTime(LocalDateTime.now()); + runTaskServiceBiz.updateById(runTask); + logger.info("任务 "+currTask.getTaskCode()+" 车辆从窑炉到缓存区过程中失败。"); + // TODO: 2021/12/14 websocket推送到前端 + } } //出库。起点为缓存区库位,终点为提升台 @Async("asyncServiceExecutor") - public void asynRunOutStock(){ + public void asynRunOutStock(Long runTaskId,Long locationId){ + //修改调度任务状态 + RunTask runTask = runTaskServiceBiz.getById(runTaskId); + //修改缓存区状态 + InStockInfo inStockInfo = inStockInfoServiceBiz.getOne(new QueryWrapper() + .eq("location_id", locationId)); + inStockInfo.setStatus(1); + inStockInfoServiceBiz.updateById(inStockInfo); + // TODO: 2021/12/14 调用车辆填入起终点,得到车辆执行结果,填入任务号(待确认) + + if (true){ + //更新关系表状态为完成 + runTask.setUpdateTime(LocalDateTime.now()); + runTask.setStatus(2); + runTask.setEndTime(LocalDateTime.now()); + runTaskServiceBiz.updateById(runTask); + //更新in_stock_info表 + inStockInfo.setStatus(2); + inStockInfo.setInTime(LocalDateTime.now()); + inStockInfoServiceBiz.updateById(inStockInfo); + //缓存区存储历史 + InStockInfoHis inStockInfoHis=new InStockInfoHis(); + BeanUtils.copyProperties(inStockInfo,inStockInfoHis); + inStockInfoHisServiceBiz.save(inStockInfoHis); + inStockInfoServiceBiz.removeById(inStockInfo.getId()); + //更新库位状态 + Location location = locationServiceBiz.getById(locationId); + location.setStatus(0); + locationServiceBiz.updateById(location); + + }else { + runTask.setStatus(3); + runTask.setUpdateTime(LocalDateTime.now()); + runTaskServiceBiz.updateById(runTask); + logger.info("任务 "+runTask.getTaskCode()+" 车辆从缓存区到提升平台过程中失败。"); + // TODO: 2021/12/14 websocket推送到前端 + } } } diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/task/RunTaskUtils.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/task/RunTaskUtils.java index 0c74d34..a3da4b1 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/task/RunTaskUtils.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/task/RunTaskUtils.java @@ -106,7 +106,40 @@ public class RunTaskUtils { * 呼叫车辆暂存缓存区,车辆调度任务结束后,(结束后再查询缓存区队列避免车辆路线冲突)查询该窑炉的缓存区队列,开始下一托盘货物调度进窑炉 * @return */ - public R runTaskForOutKiln(){ - return null; + public R runTaskForOutKiln(Long kilnId){ + //查询正在该窑炉加工的currTask + CurrTask currTask = currTaskServiceBiz.getOne(new QueryWrapper() + .eq("is_in", 1) + .eq("status", 1) + .eq("kiln_id", kilnId)); + //查询缓存区库位是否已满 + int count = locationServiceBiz.count(new QueryWrapper() + .eq(Location.STATUS, 0) + .eq(Location.VALID, 1)); + //缓存区未满 + if (count >0) { + //查询是否有空闲车辆,若有。占用车辆,若无,返回暂无可用车辆 + List vehicleInfoList = vehicleInfoServiceBiz.list(new QueryWrapper() + .eq(VehicleInfo.STATUS, 0) + .eq(VehicleInfo.VALID, 1)); + if (vehicleInfoList.size()>0){ + VehicleInfo vehicleInfo = vehicleInfoList.get(0); + vehicleInfo.setStatus(1); + vehicleInfo.setUpdateTime(LocalDateTime.now()); + vehicleInfoServiceBiz.updateById(vehicleInfo); + }else { + return R.failed("暂无可用车辆!请稍后重试!"); + } + currTask.setIsOut(0); + currTask.setTaskType(2); + currTask.setUpdateTime(LocalDateTime.now()); + currTaskServiceBiz.updateById(currTask); + + //异步调用车辆 + asynRunTaskService.asynRunTaskForKilnToWarehouse(currTask.getId(),vehicleInfoList.get(0).getId()); + return R.ok("操作成功!当前目标窑炉已满,托盘加入缓存区待加工队列。"); + }else { + return R.ok("当前缓存区已满,无法从加工炉出炉到缓存区。"); + } } } diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/task/ScheduledTask.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/task/ScheduledTask.java index 0a1d395..8e3abd3 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/task/ScheduledTask.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/task/ScheduledTask.java @@ -14,6 +14,34 @@ public class ScheduledTask { */ @Scheduled public void taskForStockToKiln(){ - //遍历窑炉状态,若加工完毕,查询空车,占用,异步处理,继续遍历下一个窑炉状态 + //遍历currTask为进行中且is_in为正在加工的窑炉状态,若加工完毕,调用runTaskForOutKiln } + + //每个小时的0分和30分执行 + @Scheduled(cron = "0 0/30 * * * ?") + //获取全部窑炉每半小时电能消耗数据,计算,存储 + public void getAllEleValue(){ + // TODO: 2021/12/27 + // 获取每台窑炉的电度值,存入par_ele_value,dateType为0,kilnId为窑炉Id + // 获取11台窑炉的电度值,相加,存入par_ele_value,dateType为0,kilnId为0 + } + + //每日23:55执行 + @Scheduled(cron = "0 55 23 * * ?") + //获取全部窑炉每天电能消耗数据,计算,存储 + public void getAllEleValueForDay(){ + // TODO: 2021/12/27 + // 获取每台窑炉的电度值,存入par_ele_value,dateType为0,kilnId为窑炉Id + // 获取11台窑炉的电度值,相加,存入par_ele_value,dateType为0,kilnId为0 + } + + //每月最后一日23:55执行 + @Scheduled(cron = "0 55 23 L * ?") + //获取全部窑炉每天电能消耗数据,计算,存储 + public void getAllEleValueForMonth(){ + // TODO: 2021/12/27 + // 获取每台窑炉的电度值,存入par_ele_value,dateType为0,kilnId为窑炉Id + // 获取11台窑炉的电度值,相加,存入par_ele_value,dateType为0,kilnId为0 + } + } diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/CurrTaskDetVo.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/CurrTaskDetVo.java index c0c7f09..638db88 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/CurrTaskDetVo.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/CurrTaskDetVo.java @@ -87,7 +87,7 @@ public class CurrTaskDetVo extends BaseVo implements PageVo.ConvertVo { * 单位 */ @ApiModelProperty("单位") - private Float unit; + private String unit; /** * 数量,手动输入 diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/StockInfoVo.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/StockInfoVo.java index c51829e..c4eae5d 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/StockInfoVo.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/StockInfoVo.java @@ -36,12 +36,12 @@ public class StockInfoVo extends BaseVo implements PageVo.ConvertVo{ * 库位id */ @ApiModelProperty(value = "库位id",example = "0") - private Long localtionId; + private Long locationId; /** * 库位名称 */ @ApiModelProperty(value = "库位名称",example = "0") - private String localtionName; + private String locationName; /** * 任务id */