廖井涛
2025-06-06 32e8ae44d542d6f6d2dc82896f5ffe58ce695889
ºÓ±±ÍûÃÀÏîÄ¿/gmms.sql
@@ -11,7 +11,7 @@
 Target Server Version : 50528
 File Encoding         : 65001
 Date: 04/12/2023 09:47:49
 Date: 13/05/2024 13:12:34
*/
SET NAMES utf8mb4;
@@ -124,6 +124,26 @@
  `stoprank` bigint(20) NULL DEFAULT NULL,
  `shelfrankid` bigint(20) NULL DEFAULT NULL,
  `processcard` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;
-- ----------------------------
-- Table structure for Y_Edg_Statistics
-- ----------------------------
DROP TABLE IF EXISTS `Y_Edg_Statistics`;
CREATE TABLE `Y_Edg_Statistics`  (
  `Glassid` bigint(20) NOT NULL COMMENT '玻璃ID',
  `SendTime` datetime NULL DEFAULT NULL COMMENT '发送时间',
  `Width` double NULL DEFAULT NULL COMMENT '宽',
  `Height` double NULL DEFAULT NULL COMMENT '高',
  `Thickess` double NULL DEFAULT NULL COMMENT '厚',
  `SizeText` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '尺寸字符串',
  `SendText` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '发送内容',
  `Recordsid` bigint(20) NULL DEFAULT NULL COMMENT '记录ID',
  `Line` int(11) NULL DEFAULT NULL COMMENT '线路',
  `RecordsidW` double NULL DEFAULT NULL COMMENT '记录ID宽',
  `RecordsidH` double NULL DEFAULT NULL COMMENT '记录ID高',
  `banzu` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '班组',
  `report_time` date NULL DEFAULT NULL COMMENT '报工日期'
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;
-- ----------------------------
@@ -372,7 +392,7 @@
  `dengluname` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '切割班组',
  `BgTime` datetime NULL DEFAULT NULL COMMENT '报工时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 123992 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;
) ENGINE = InnoDB AUTO_INCREMENT = 167574 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;
-- ----------------------------
-- Table structure for gmms_device_state
@@ -558,7 +578,7 @@
  `start_time` datetime NULL DEFAULT NULL COMMENT '建立时间',
  `groups` bigint(20) NULL DEFAULT NULL COMMENT '线路',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1208629 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = COMPACT;
) ENGINE = InnoDB AUTO_INCREMENT = 1550998 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = COMPACT;
-- ----------------------------
-- Table structure for gmms_edg_speed
@@ -597,6 +617,8 @@
  `length` int(11) NOT NULL,
  `xinterval` int(11) NOT NULL,
  `yinterval` int(11) NOT NULL,
  `maxLoadingRate` int(3) NOT NULL COMMENT '单炉最大装载率',
  `maxTolerance` int(3) NOT NULL COMMENT '单炉最大尺寸比例',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;
@@ -615,7 +637,7 @@
  `IntRemark` int(255) NULL DEFAULT NULL,
  `StrRemark` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 20 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;
) ENGINE = InnoDB AUTO_INCREMENT = 28 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;
-- ----------------------------
-- Table structure for gmms_galss_task
@@ -819,7 +841,7 @@
  INDEX `galss_id`(`galss_id`) USING BTREE,
  INDEX `type_id`(`type_id`) USING BTREE,
  INDEX `gc`(`engineering_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1393464 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = COMPACT;
) ENGINE = InnoDB AUTO_INCREMENT = 1779094 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = COMPACT;
-- ----------------------------
-- Table structure for gmms_galss_task_details
@@ -1104,6 +1126,102 @@
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;
-- ----------------------------
-- Table structure for gmms_galss_task_shelf_copy3
-- ----------------------------
DROP TABLE IF EXISTS `gmms_galss_task_shelf_copy3`;
CREATE TABLE `gmms_galss_task_shelf_copy3`  (
  `id` bigint(20) NOT NULL,
  `rank` bigint(20) NULL DEFAULT 0,
  `type_id` bigint(20) NULL DEFAULT NULL,
  `galss_id` bigint(20) NOT NULL,
  `pattern_id` bigint(20) NULL DEFAULT NULL,
  `width` double(6, 1) NULL DEFAULT NULL,
  `height` double(6, 1) NULL DEFAULT NULL,
  `thickness` double(6, 1) NULL DEFAULT NULL,
  `color` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `edg_width` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `edg_height` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `chamfer_size` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '倒角大小',
  `galss_type` int(11) NULL DEFAULT NULL COMMENT '玻璃类型 æ•£å•/整单',
  `edg_speed1` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '磨边速度',
  `edg_speed2` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `fine_throwing` int(11) NULL DEFAULT NULL COMMENT '精抛/粗磨',
  `work_state` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `work_procedure` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `slicecage_rank` bigint(20) NULL DEFAULT 0 COMMENT '理片笼架子',
  `drop_frame` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '落架',
  `slicecage_flag` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '0' COMMENT '理片笼标志(备用)',
  `out_rank` bigint(20) NOT NULL COMMENT '出理片笼序号',
  `start_time` datetime NOT NULL,
  `finsh_time` datetime NULL DEFAULT NULL,
  `stop_position` int(11) NOT NULL COMMENT '下片位置',
  `processcard_id` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '流程卡号',
  `engineering_id` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '工程号',
  `broken_state` int(11) NOT NULL COMMENT '破片标记,非0破片',
  `stop_rank` int(11) NOT NULL,
  `work_procedure_number` int(11) NULL DEFAULT NULL,
  `gc_number` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `gc_width` double NULL DEFAULT NULL,
  `gc_height` double NULL DEFAULT NULL,
  `gc_stockid` int(11) NULL DEFAULT NULL,
  `marking_flag` int(11) NOT NULL COMMENT '打标',
  `groupsss` int(11) NULL DEFAULT NULL COMMENT '线路',
  `banzu` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '班组',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `pattern_id`(`pattern_id`) USING BTREE,
  INDEX `galss_id`(`galss_id`) USING BTREE,
  INDEX `type_id`(`type_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;
-- ----------------------------
-- Table structure for gmms_galss_task_shelf_log
-- ----------------------------
DROP TABLE IF EXISTS `gmms_galss_task_shelf_log`;
CREATE TABLE `gmms_galss_task_shelf_log`  (
  `id` bigint(20) NOT NULL,
  `rank` bigint(20) NULL DEFAULT 0,
  `type_id` bigint(20) NULL DEFAULT NULL,
  `galss_id` bigint(20) NOT NULL,
  `pattern_id` bigint(20) NULL DEFAULT NULL,
  `width` double(6, 1) NULL DEFAULT NULL,
  `height` double(6, 1) NULL DEFAULT NULL,
  `thickness` double(6, 1) NULL DEFAULT NULL,
  `color` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `edg_width` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `edg_height` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `chamfer_size` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '倒角大小',
  `galss_type` int(11) NULL DEFAULT NULL COMMENT '玻璃类型 æ•£å•/整单',
  `edg_speed1` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '磨边速度',
  `edg_speed2` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `fine_throwing` int(11) NULL DEFAULT NULL COMMENT '精抛/粗磨',
  `work_state` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `work_procedure` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `slicecage_rank` bigint(20) NULL DEFAULT 0 COMMENT '理片笼架子',
  `drop_frame` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '落架',
  `slicecage_flag` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '0' COMMENT '理片笼标志(备用)',
  `out_rank` bigint(20) NOT NULL COMMENT '出理片笼序号',
  `start_time` datetime NOT NULL,
  `finsh_time` datetime NULL DEFAULT NULL,
  `stop_position` int(11) NOT NULL COMMENT '下片位置',
  `processcard_id` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '流程卡号',
  `engineering_id` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '工程号',
  `broken_state` int(11) NOT NULL COMMENT '破片标记,非0破片',
  `stop_rank` int(11) NOT NULL,
  `work_procedure_number` int(11) NULL DEFAULT NULL,
  `gc_number` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `gc_width` double NULL DEFAULT NULL,
  `gc_height` double NULL DEFAULT NULL,
  `gc_stockid` int(11) NULL DEFAULT NULL,
  `marking_flag` int(11) NOT NULL COMMENT '打标',
  `groupsss` int(11) NULL DEFAULT NULL COMMENT '线路',
  `banzu` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '班组',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `pattern_id`(`pattern_id`) USING BTREE,
  INDEX `galss_id`(`galss_id`) USING BTREE,
  INDEX `type_id`(`type_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;
-- ----------------------------
-- Table structure for gmms_galss_task_slicecage
-- ----------------------------
DROP TABLE IF EXISTS `gmms_galss_task_slicecage`;
@@ -1255,7 +1373,7 @@
  `IntRemark` int(255) NULL DEFAULT NULL,
  `CreateTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  PRIMARY KEY (`Id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 30 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;
) ENGINE = InnoDB AUTO_INCREMENT = 35 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;
-- ----------------------------
-- Table structure for gmms_glass_log
@@ -1322,7 +1440,7 @@
  `glass_id` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '玻璃类型',
  `flag` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '标记',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 83 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = COMPACT;
) ENGINE = InnoDB AUTO_INCREMENT = 94 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = COMPACT;
-- ----------------------------
-- Table structure for gmms_glass_yuliao
@@ -1407,7 +1525,7 @@
  `flag` int(11) NOT NULL,
  `content` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '匹配内容',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1995652 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;
) ENGINE = InnoDB AUTO_INCREMENT = 2588657 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;
-- ----------------------------
-- Table structure for gmms_identify_mark
@@ -1513,7 +1631,7 @@
  `minArea` double NULL DEFAULT NULL COMMENT '最小面积',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `main_liuchengka_idx`(`main_liuchengka`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 58777 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = COMPACT;
) ENGINE = InnoDB AUTO_INCREMENT = 78834 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = COMPACT;
-- ----------------------------
-- Table structure for gmms_liuchengka_buffer
@@ -1538,7 +1656,7 @@
  `StrRemark` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '预留列,占用时请标明',
  `Create_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  PRIMARY KEY (`ID`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 44932 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = COMPACT;
) ENGINE = InnoDB AUTO_INCREMENT = 61757 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = COMPACT;
-- ----------------------------
-- Table structure for gmms_liuchengka_copy1
@@ -1640,7 +1758,7 @@
  `IntRemark` int(255) NULL DEFAULT NULL COMMENT '预留列,使用需注明',
  `StrRemark` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '预留列,使用需注明',
  PRIMARY KEY (`ID`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 39208 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = COMPACT;
) ENGINE = InnoDB AUTO_INCREMENT = 53854 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = COMPACT;
-- ----------------------------
-- Table structure for gmms_load_rack
@@ -1855,7 +1973,7 @@
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `task_id`(`task_id`) USING BTREE,
  INDEX `engineering_id`(`engineering_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 142276 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = COMPACT;
) ENGINE = InnoDB AUTO_INCREMENT = 190667 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = COMPACT;
-- ----------------------------
-- Table structure for gmms_pattern_task_interrupt
@@ -1969,7 +2087,7 @@
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `shelf_rank_id`(`shelf_rack_id`) USING BTREE,
  CONSTRAINT `gmms_rank_ibfk_1` FOREIGN KEY (`shelf_rack_id`) REFERENCES `gmms_shelf_rack` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 4138 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = COMPACT;
) ENGINE = InnoDB AUTO_INCREMENT = 5834 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = COMPACT;
-- ----------------------------
-- Table structure for gmms_rank_2
@@ -2018,7 +2136,7 @@
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `file_name`(`file_name`) USING BTREE,
  INDEX `create_time`(`create_time`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 8137 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = COMPACT;
) ENGINE = InnoDB AUTO_INCREMENT = 10540 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = COMPACT;
-- ----------------------------
-- Table structure for gmms_raw_file_2
@@ -2054,7 +2172,7 @@
  `production_time` datetime NULL DEFAULT NULL COMMENT '生产日期',
  `batch_id` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '批次号',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 5549 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = COMPACT;
) ENGINE = InnoDB AUTO_INCREMENT = 7264 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = COMPACT;
-- ----------------------------
-- Table structure for gmms_shelf_rack
@@ -2110,7 +2228,7 @@
  `finsh_time` datetime NULL DEFAULT NULL COMMENT '完成时间',
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `file_id`(`file_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 72768 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = COMPACT;
) ENGINE = InnoDB AUTO_INCREMENT = 95108 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = COMPACT;
-- ----------------------------
-- Table structure for gmms_shelf_task_2
@@ -2152,7 +2270,7 @@
  `finshtype1` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '上车完成手动或自动',
  `finshtype2` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '下车完成手动或自动',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 52731 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;
) ENGINE = InnoDB AUTO_INCREMENT = 71643 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;
-- ----------------------------
-- Table structure for gmms_slicecage
@@ -2257,7 +2375,7 @@
  `erp_glass_id` bigint(20) NULL DEFAULT NULL,
  `head_info` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '附加信息头 ä¸€èˆ¬åªæœ‰ç¬¬ä¸€ç‰‡çŽ»ç’ƒæœ‰è¯¥å­—æ®µ',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 171765 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;
) ENGINE = InnoDB AUTO_INCREMENT = 236561 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;
-- ----------------------------
-- Table structure for gmms_timer
@@ -2298,6 +2416,7 @@
  `banzu` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '班组',
  `intRemark` int(11) NULL DEFAULT NULL COMMENT '预留列,使用请标明用途',
  `strRemark` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '预留列,使用请标明用途',
  `isPaused` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '是否暂停设备(用于切换班组)',
  PRIMARY KEY (`Id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 12 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = COMPACT;
@@ -2350,7 +2469,7 @@
  `processcard_count` int(11) NULL DEFAULT NULL COMMENT '总数',
  `starttime` datetime NULL DEFAULT NULL COMMENT '创建时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 85423 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = COMPACT;
) ENGINE = InnoDB AUTO_INCREMENT = 120850 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = COMPACT;
-- ----------------------------
-- Table structure for gmms_yuliao_slicecage
@@ -2407,7 +2526,7 @@
  `update_time` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `add_time` bigint(13) NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 38155 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = COMPACT;
) ENGINE = InnoDB AUTO_INCREMENT = 49702 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = COMPACT;
-- ----------------------------
-- Table structure for io_log
@@ -2421,7 +2540,7 @@
  `read_message` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `send_message` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 310306 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;
) ENGINE = InnoDB AUTO_INCREMENT = 479352 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;
-- ----------------------------
-- Table structure for liuchengka_output
@@ -2471,7 +2590,7 @@
  `name1` datetime NULL DEFAULT NULL,
  `name2` datetime NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 549993 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;
) ENGINE = InnoDB AUTO_INCREMENT = 638603 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;
-- ----------------------------
-- Table structure for namess
@@ -5593,6 +5712,17 @@
   DECLARE booldate1 varchar(255);
   DECLARE booldate2 varchar(255);
   DECLARE messagedates varchar(255) DEFAULT '';
   DECLARE jiID BIGINT DEFAULT 0;
   DECLARE thistype varchar(255);
   DECLARE lasttype varchar(255) DEFAULT '';
   DECLARE lastRecordsid BIGINT DEFAULT 0;
   DECLARE lastRecordsidW BIGINT DEFAULT 0;
   DECLARE lastRecordsidH BIGINT DEFAULT 0;
   DECLARE lastW int DEFAULT 0;
   DECLARE lastH int DEFAULT 0;
   set messagedate=messagedates;
   
   select machine_type_id,work_id into @mtid,@work_groups from gmms_machine where id=machineids;
@@ -5601,7 +5731,7 @@
   
   select return_value into @returnvalue from gmms_machine_dispose where id=machinedisposeids;
   
   select galss_id,edg_width,edg_height,thickness,chamfer_size,galss_type,fine_throwing,edg_speed1,edg_speed2 into @rank,@width,@heigth,@thickness,@chamfer_size,@galss_type,@fine_throwing,@edg_speed1,@edg_speed2 from gmms_galss_task where work_state='等待中' and work_procedure='磨边' and engineering_id=@engineering_id order by out_rank limit 1;
   select id,galss_id,edg_width,edg_height,thickness,chamfer_size,galss_type,fine_throwing,edg_speed1,edg_speed2 into jiID,@rank,@width,@heigth,@thickness,@chamfer_size,@galss_type,@fine_throwing,@edg_speed1,@edg_speed2 from gmms_galss_task where work_state='等待中' and work_procedure='磨边' and engineering_id=@engineering_id order by out_rank limit 1;
   
   
   select @rank;
@@ -5609,6 +5739,27 @@
   
    update gmms_galss_task set work_state='正在工作' where galss_id=@rank and engineering_id=@engineering_id;
   #update gmms_galss_task set work_state='待复合',work_procedure='复合' where galss_id=@rank;
   set thistype=CONCAT(IFNULL(@width,''),'*',IFNULL(@heigth,''));
   select SizeText,Recordsid,Width,Height,RecordsidW,RecordsidH into lasttype,lastRecordsid,lastW,lastH,lastRecordsidW,lastRecordsidH from Y_Edg_Statistics
   where Line=@work_groups order by Recordsid desc limit 1;
   if lasttype is null then
      set lastRecordsid=1;
      set lastRecordsidW=1;
      set lastRecordsidH=1;
   else
      if lasttype!=thistype then
         set lastRecordsid=lastRecordsid+1;
      end if;
      if lastW!=@width then
         set lastRecordsidW=lastRecordsidW+1;
      end if;
      if lastH!=@heigth then
         set lastRecordsidH=lastRecordsidH+1;
      end if;
   end if;
   
   set rank1=cast(@rank as UNSIGNED INTEGER);
   select rank1;
@@ -5640,6 +5791,14 @@
--    call intTo2ByteHex10_16_4(edg_speed21,@edg_speed2s);
--    
--    set booldate=CONCAT(@booldate2,@booldate1);
   INSERT INTO `gmms`.`Y_Edg_Statistics`(`Glassid`, `SendTime`, `Width`, `Height`, `Thickess`, `SizeText`, `SendText`, `Recordsid`, `Line`,RecordsidW,RecordsidH)
   select id,NOW(),edg_width,edg_height,thickness,CONCAT(IFNULL(edg_width,''),'*',IFNULL(edg_height,'')),CONCAT(@returnvalue,@ranks,@heigths,@widths,@thicknesss),lastRecordsid,@work_groups,lastRecordsidW,lastRecordsidH from gmms_galss_task
   where id=jiID;
   if machineids=28 then
      set dates=CONCAT(@returnvalue,@ranks,@heigths,@widths,@thicknesss);
      select dates;
@@ -5719,18 +5878,16 @@
   set t_step=2;
    #insert into gmms_galss_task select * from gmms_galss_task_buffer where engineering_id=@file_name;
   select @file_name;
   insert into gmms_galss_task (id,rank,type_id,galss_id,pattern_id,width,height,thickness,color,edg_width,edg_height,chamfer_size,galss_type,edg_speed1,edg_speed2,fine_throwing,work_state,work_procedure,slicecage_rank,drop_frame,slicecage_flag,out_rank,start_time,finsh_time,stop_position,processcard_id,engineering_id,broken_state,stop_rank,work_procedure_number,gc_number,gc_width,gc_height,gc_stockid,marking_flag) select id,rank,type_id,MOD(galss_id,10000),pattern_id,width,height,thickness,color,edg_width,edg_height,chamfer_size,galss_type,edg_speed1,edg_speed2,fine_throwing,work_state,work_procedure,slicecage_rank,drop_frame,slicecage_flag,out_rank,start_time,finsh_time,stop_position,processcard_id,engineering_id,broken_state,stop_rank,work_procedure_number,gc_number,gc_width,gc_height,gc_stockid,marking_flag from gmms_galss_task_buffer where engineering_id=@file_name;
   
   select t_err,t_step,0;
   call output_create(@file_name);
   select t_err,t_step,1;
   end if;
   if t_err=0 then 
            set t_step=3;
         call dongzuo_update_marking_flag(@file_name,line);
   end if;
   select t_err;
   select t_step;
   if t_err=0 then    
         set t_step=4;
         update gmms_raw_file set `state`='已领取',operator=line,create_time=now() where id= rawFileid;          
@@ -5740,11 +5897,9 @@
         COMMIT; 
   end if;
   
   if t_err=1 then
   if t_err=1 then
      ROLLBACK;
   end if;
       select t_err,t_step;
END
;;
delimiter ;
@@ -6296,7 +6451,12 @@
         if lck_c = 0
         then 
            select count(*) into lck_xc from gmms_galss_task_stock 
            where id>(select min(id) from (select * from gmms_galss_task_buffer order by id desc limit 50000) as tbmin) and processcard_id = lckNo;
            where id>(select min(id) from (select * from gmms_galss_task_stock order by id desc limit 50000) as tbmin) and processcard_id = lckNo;
            if lck_xc = 0 then
               select count(*) into lck_xc from gmms_galss_task_buffer
               where id>(select min(id) from (select * from gmms_galss_task_stock order by id desc limit 50000) as tbmin) and processcard_id = lckNo;
            end if;
            if lck_xc = 0
            then 
               set back_Num=4;
@@ -6579,6 +6739,7 @@
         and stop_position>0 and work_state!='破损' and work_procedure!='钢化后下片';
         
         SELECT count(*) into waitingcount from gmms_slicecage_tempering where state="等待中";
         select notsliceagecount,ischuku_,nottaizi;
         if notsliceagecount=0 or (ischuku_='出库' and nottaizi=0) then
            #出片
            if (ischuku_='出库' and nottaizi=0) then
@@ -6608,6 +6769,7 @@
                  set gs.work_state='出库中',st.state='出库中'
                  where gs.slicecage_rank is not null and gs.id=@taskids;
                  UPDATE gmms_var SET Value=rk where varname='last_pos' and groups=@work_groups;
                  insert into aaaa(MachineName,groups,data1,Content,id,Sendtext) values (machineids,"",NOW(),'发送出库任务',"",messagedate);
               end if;
            end if;
         elseif waitingcount=0 then
@@ -14179,16 +14341,21 @@
      declare countsss int;
      
      
         declare o_err int default(0);
      
      DECLARE cur CURSOR FOR
      SELECT edg_width,edg_height,cast(edg_speed2 as signed) as xuhao,count(*),processcard_id FROM gmms_galss_task where engineering_id=gc group by processcard_id , edg_speed2,processcard_id
    ,edg_width,edg_height order by processcard_id,cast(edg_speed2 as signed);
    DECLARE  CONTINUE HANDLER FOR NOT FOUND SET _break=1;
    set _break=0;
set o_err =1;
    SELECT edg_width,edg_height,cast(edg_speed2 as signed) as xuhao,count(*),processcard_id FROM gmms_galss_task where engineering_id=gc group by processcard_id , edg_speed2,processcard_id
    ,edg_width,edg_height order by processcard_id,cast(edg_speed2 as signed);
    set o_err =2;
    open cur;
     set nxh=0;
    set tmp=0;
@@ -14198,33 +14365,57 @@
    end if;
    set countsss=0;
    while _break=0 do
    set o_err =3;
       FETCH cur into w,h,xh,c,lck;   
         select o_err;
         if _break=0 then
            -- cselect 1;
            if nxh=0 then 
            set o_err =4;
               set nxh=1;
               set lastlck=lck;
               set lw=w;
               set lh=h;
               update gmms_galss_task set gc_width=nxh where processcard_id=lck  and edg_speed2=xh;
               select o_err;
            else         
                         set o_err =5;
                     
               if lastlck=lck then 
                   set o_err =6;
                  if lw=w and lh=lh then 
                  set o_err =31;
                     update gmms_galss_task set gc_width=nxh where processcard_id=lck  and edg_speed2=xh;
                  else
                  set o_err =32;
                     set nxh=nxh+1;
                     set   lw=w;
                     set   lh=h;
                     update gmms_galss_task set gc_width=nxh where processcard_id=lck  and edg_speed2=xh;                                  
                  end if;
                  select o_err;
               else   
                  #   INSERT INTO liuchengka_output 
                  set tmp=1;
                  if nxh>3 then 
                     set   tmp=2;
                  end if;
set o_err=33;
-- select CONCAT(lastlck,',0;',tmp,',1;',gc,',2:',nxh,',0,3;',w,',4:',h,',0');
                  INSERT INTO `gmms`.`liuchengka_output`(`liuchengka`, `guige`, `state`, `gongcheng`, `maxxuhao`, `currentxuhao`, `width`, `height`, `suo`) VALUES (lastlck,NULL,tmp,gc,nxh,0,w,h,0);
                  select o_err;
                     set o_err =7;
                  if tmp=1 then 
                     set   tmp=0;
                  end if;
@@ -14234,12 +14425,14 @@
                  set lastlck=lck;
                  set lw=w;
                  set lh=h;
                  update gmms_galss_task set gc_width=nxh where processcard_id=lck  and edg_speed2=xh;
               end if;
                  update gmms_galss_task set gc_width=nxh where processcard_id=lck  and edg_speed2=xh;
               end if;         select o_err;
            end if;
         else
            #结束
                set o_err =8;
            if nxh<>0 then 
               set tmp=1;
               if nxh>3 then 
@@ -14255,8 +14448,11 @@
            end if;
            
         end if;
            select o_err;
             set o_err =9;
    end while;
    close cur;
    select o_err;
END
;;
delimiter ;
@@ -15062,14 +15258,25 @@
   #输入参数:pline-生产产线
   #输出参数:back_Num æ•°å€¼ç±»åž‹å‚æ•°,back_Msg å­—符串类型参数
   #Declare current_banzu varchar(50);#当前班组
   DECLARE Dbanzu varchar(255) DEFAULT '';#当前班组
   #select banzu into current_banzu from gmms_user_current where gongyi = '磨边' and chanxian = pline;
--    update (select processcard_id from e_record_stock where is_report = 0 and line = pline group by processcard_id) as lck 
--    left join gmms_liuchengka as lk on lck.processcard_id=lk.liuchengka set lk.isgang="冷加工下片完成" where lk.gy_gang=1 and lk.Occupied=0;
   
   update e_record_stock set is_report = 1,report_time = now() where is_report = 0 and line = pline;
   
   update e_pierceds set is_report=1,report_time = now() where is_report = 0 and line = pline and process = '磨边';
   select banzu into Dbanzu from gmms_user_current where chanxian=pline and gongyi='磨边';
   update Y_Edg_Statistics set banzu=Dbanzu,report_time=NOW() where banzu is null and Line = pline;
--    update Y_Edg_Statistics AS ES LEFT JOIN (select * from e_record_stock where line=pline order by create_time desc limit 4500) AS ERS on ERS.glass_id=ES.Glassid
--    set ES.banzu=ERS.team_name,ES.report_time=ERS.report_time
--    where ERS.glass_id is not null and ES.banzu is null and ES.Line = pline;
--    update Y_Edg_Statistics AS ES LEFT JOIN e_pierceds AS ep on ep.glass_id=ES.Glassid
--    set ES.banzu=ep.team_name
--    where ep.is_report = 0 and ES.Line = 1 and ep.process = '磨边';
   #update gmms_cutmanage set BgTime=now() where BgTime is null and groups=pline;
   set back_Num = 1;
   set back_Msg = "成功";
@@ -16282,7 +16489,7 @@
               select rp.left_pieces into @left_pieces from gmms_shelf_rack sr join gmms_raw_package rp on sr.raw_package_id1=rp.id where sr.id=@shelf_rack_id;
               #判断架子上面是否还有玻璃
               if @left_pieces=0 then
                  update gmms_shelf_rack set state='空闲',raw_package_id1=Null,mod_time=now(),color_falg=0 where id=@shelf_rack_id;
                  update gmms_shelf_rack set state='空闲',raw_package_id1=null,mod_time=now(),color_falg=0 where id=@shelf_rack_id;
               else 
               # @color='白玻' or @color='超白' or @color='C' 
                  if 1=1 then
@@ -17229,9 +17436,7 @@
      select count(*) into @counts from gmms_galss_task where work_state='等待中' and work_procedure='下片' and out_rank=rankid and engineering_id=@engineering_id;
      select drop_frame,width,height,thickness,processcard_id,galss_type,color into @drop_frame,@width,@height,@thickness,@processcard_id,@galss_type,@color from gmms_galss_task where work_state='等待中' and work_procedure='下片' and out_rank=rankid and engineering_id=@engineering_id; 
      select stops,finsh_count into @id,@finsh_count from gmms_drop_frame where drop_frame=@drop_frame and processcard_id=@processcard_id and groups=@work_groups;
      select @id;
      select @processcard_id;
      select @counts;
      select @id,@processcard_id,@counts;
      #判断是否有等待的任务
      
      if @counts=1 then      
@@ -17260,7 +17465,8 @@
         set messagedate=@date;
         if messagedate is not null then      
            update gmms_galss_task set work_state='正在工作' where work_state='等待中' and work_procedure='下片' and out_rank=rankid and    engineering_id=@engineering_id;
         end if;
         end if;
      end if;
   elseif machineids=75 then
      #新加机械手
@@ -17275,8 +17481,12 @@
      select out_rank,stop_position into @out_rank1,@stop_position from gmms_galss_task 
      where work_state='正在工作' and work_procedure='下片'  and engineering_id=@engineering_id limit 0,1;
      
      select id,drop_frame,width,height,thickness,processcard_id,out_rank into @gid_,@drop_frame,@width,@height,@thickness,@processcard_id,@out_rank from gmms_galss_task
--       select id,drop_frame,width,height,thickness,processcard_id,out_rank into @gid_,@drop_frame,@width,@height,@thickness,@processcard_id,@out_rank from gmms_galss_task
--       where work_state='等待中' and work_procedure='下片'  and engineering_id=@engineering_id order by out_rank limit 0,1;
      #修改   å‘送磨边后的宽高   ä¸‹ç‰‡æœºç²¾åº¦ä»Ž0.1mm>1mm  2024/1/19
      select id,drop_frame,edg_width,edg_height,thickness,processcard_id,out_rank into @gid_,@drop_frame,@width,@height,@thickness,@processcard_id,@out_rank from gmms_galss_task
      where work_state='等待中' and work_procedure='下片'  and engineering_id=@engineering_id order by out_rank limit 0,1;
      
      select stops,finsh_count into @id,@finsh_count from gmms_drop_frame 
      where drop_frame=@drop_frame and processcard_id=@processcard_id and groups=@work_groups;
@@ -17309,7 +17519,7 @@
                  update gmms_galss_task set work_state='正在工作' where work_state='等待中' and work_procedure='下片' and out_rank=@out_rank and engineering_id=@engineering_id;
               end if;      
               call intTo2ByteHex10_16_4(@out_rank,@out_ranks);
               call intTo2ByteHex10_16_4(@width*10,@widths);
               call intTo2ByteHex10_16_4(@width,@widths);
               call intTo2ByteHex10_16_4(@height*10,@heights);
               call intTo2ByteHex10_16_4(@thickness*10,@thicknesss);
               call intTo2ByteHex10_16_4(@id,@ids);
@@ -17325,7 +17535,16 @@
               insert into aaaa(MachineName,groups,data1,Content,id,Sendtext) values (machineids,IFNULL(@id,0),NOW(),'发送下片机任务',IFNULL(@gid_,0),messagedate);
         end if;
      
      end if;
      end if;
--       if (select software_connect from gmms_machine where id=5)=0 then
--          #set dates=CONCAT(returnvalue,'0001','0001','7fbc','3a98','003c');
--          set dates=CONCAT(returnvalue,'0001','0001','0ccf','5dc0','003c');
--          call message(dates,'000a',@date);
--          set messagedate=@date;
--          update gmms_machine set software_connect=10 where id=5;
--          insert into aaaa(MachineName,groups,data1,Content,id,Sendtext) values (machineids,0,NOW(),'发送下片机测试任务',0,messagedate);
--       end if;
      if @counts=1 and false then
         if @out_rank1 is not null then
            if @stop_position=2 then
@@ -20104,6 +20323,8 @@
   
   select count(*) into @workcount from gmms_galss_task_shelf 
   where processcard_id=@processcardid and work_state='正在工作' and (work_procedure='理片笼上片' or work_procedure='理片笼下片');
   select @dropid,@workcount,@processcardid,signs_,@remarks,@sliceagecount,ischuku_;
   #and ranksumcount>=maxpostoprank
   if @dropid is not null and @workcount=0 and @processcardid is not null and signs_=3 and @remarks=1 then
      if @sliceagecount>0 and ischuku_ is null then
@@ -20128,9 +20349,10 @@
            if dates is not null then
               update gmms_galss_task_shelf set work_state='正在工作',work_procedure='理片笼上片' where id=@id;
            end if;
            insert into aaaa(MachineName,groups,data1,Content,id,Sendtext) values (machineids,IFNULL(@id,0),NOW(),'发送理片机器人上片任务',"",messagedate);
            call message(dates,'000a',@date);
            set messagedate=@date;
            insert into aaaa(MachineName,groups,data1,Content,id,Sendtext) values (machineids,IFNULL(@id,0),NOW(),'发送理片机器人上片任务',"",messagedate);
         end if;         
      else
         update gmms_liuchengka set ischu='出库' where liuchengka=@processcardid and ischu='待出库';
@@ -20816,6 +21038,7 @@
   DECLARE Endaddress_ varchar(255) DEFAULT null;    #目的地
   DECLARE orientation_ varchar(255) DEFAULT null;    #朝向
   DECLARE rackid_ bigint DEFAULT 0;    #车上架子任务id
   DECLARE zknotFinsh bigint DEFAULT 0;    #中空未完成数量
   DECLARE groups_ BIGINT DEFAULT  
   (select work_id from gmms_machine where id=machineids);  #线路
   DECLARE isWorking bigint DEFAULT 
@@ -20891,7 +21114,24 @@
                  where liuchengka=(select processcard_id from gmms_shelf_rack_2 where id=rackid_ limit 0,1);
                  update gmms_liuchengka set ischu=null where liuchengka=liuchengka_;
                  update gmms_drop_frame_5 set rank=rackid_,sign=0,rankposition=Beginaddress_ where stop_rank=Endaddress_ order by stops asc limit 1;
               else
               elseif Tasktype_='中空' then
                  #保存数据  ç„¶åŽåˆ é™¤åº“存表  zknotFinsh
                  select liuchengka into liuchengka_ from gmms_liuchengka
                  where liuchengka=(select processcard_id from gmms_shelf_rack_2 where id=rackid_ limit 0,1);
                  set zknotFinsh=(select count(*) from gmms_galss_task_shelf where processcard_id=liuchengka_ and !(work_state='已完成' and work_procedure='中空上片'));
                  if zknotFinsh=0 then
                     insert into gmms_galss_task_shelf_log
                     select gt.* from gmms_galss_task_shelf as gt left join gmms_galss_task_shelf_log as gs on gt.id=gs.id
                     where gt.processcard_id=liuchengka_  and gs.id is null and
                     (select count(*) from gmms_galss_task_shelf where processcard_id=gt.processcard_id and !(work_state='已完成' and work_procedure='中空上片'))=0;
                     delete from gmms_galss_task_shelf where processcard_id=liuchengka_;
                  end if;
                  update gmms_galss_task_shelf set stop_position=0 where processcard_id=liuchengka_;
                  update gmms_drop_frame_5 set rank=rackid_,sign=0,rankposition=Beginaddress_ where stop_rank=Endaddress_ order by stops asc limit 1;
               else
                  update gmms_drop_frame_5 set rank=rackid_,sign=0,rankposition=Beginaddress_ where stop_rank=Endaddress_ order by stops asc limit 1;
               end if;               
            elseif Taskphase_='出库' then
@@ -20967,10 +21207,7 @@
   where groups_=4 and drop_groups=groupss_ and rank is null and sign=0 and flag=1 and orientation='A';
   select count(stop_rank) into CountB_D from gmms_drop_frame_5 
   where groups_=4 and drop_groups=groupss_ and rank is null and sign=0 and flag=1 and orientation='B';
   select CountA_D;
   select CountB_D;
   select CountA_S;
   select CountB_S;
   select CountA_D,CountB_D,CountA_S,CountB_S;
   #找到此合片流程卡 æ˜¯å¦å±žäºŽåŒä¸€é¢
   if childcount_=2 and (CountA_S+CountB_S)=childcount_ then
      #两架合片
@@ -21027,7 +21264,8 @@
   DECLARE Count_S DOUBLE DEFAULT 0;    #查找此父级流程卡在库内的数量 
   DECLARE parentliuchengkaCount int DEFAULT 0;     #此父级流程卡下 çš„子流程卡数量
   DECLARE zkliuchengka_ varchar(255) DEFAULT null;  #父级流程卡
   DECLARE isMatchCount_ varchar(255) DEFAULT null;  #父级流程卡
   DECLARE isMatchCount_ varchar(255) DEFAULT null;  #是否有未优化的
   DECLARE isWorkingCount_ varchar(255) DEFAULT 0;  #是否有正在工作的
   #定义游标
   DECLARE emp_cursor CURSOR FOR SELECT zkliuchengka FROM y_parent_liuchengka;
   DECLARE CONTINUE HANDLER FOR NOT FOUND SET isEnd = 1;
@@ -21059,7 +21297,10 @@
         select count(*) into isMatchCount_ from gmms_galss_task_shelf 
         where gc_number=zkliuchengka_ and ((work_state='已完成' and work_procedure='钢化后下片' and stop_position<1) or (stop_position>0 and work_state='破损'));
         
         if Count_S=parentliuchengkaCount and parentliuchengkaCount>0 and isMatchCount_>0 and Count_DZ=0 then
         select count(*) into isWorkingCount_ from gmms_galss_task_shelf
         where gc_number=zkliuchengka_ and work_state='正在工作';
         if Count_S=parentliuchengkaCount and parentliuchengkaCount>0 and isMatchCount_>0 and Count_DZ=0 and isWorkingCount_=0 then
            insert into A_youhua(processcard_id,count,youhuashijian) values (zkliuchengka_,isMatchCount_,NOW());
            call y_optimize_GAI(zkliuchengka_,1,@h,@l);
         end if;      
@@ -21398,12 +21639,13 @@
            set orientation_='A';
         end if;
         if orientation_ is null then
            #表示 1.此任务未领取 / 2.领取线路无空工位
            #表示 1.此任务未领取 / 2.领取线路无空工位    ï¼ˆè§„则:按不缺片的方向为准,即缺片的去旋转)
            select sr.orientation into orientation_ from gmms_drop_frame_5 as dr 
            left join gmms_shelf_rack_2 as sr on dr.rank=sr.id
            left join gmms_liuchengka as lk on sr.processcard_id=lk.liuchengka
            where sr.id is not null and lk.liuchengka is not null and dr.groups_=100 and dr.sign=0
            and lk.parent_liuchengka=parentliuchengka_ limit 0,1;
            and lk.parent_liuchengka=parentliuchengka_
            ORDER BY (select count(*) from gmms_galss_task_shelf where processcard_id=sr.processcard_id and (work_state='已完成' and work_procedure='钢化后下片')) asc limit 0,1;
         end if;
      end if;