Merge branch 'master' of http://10.153.19.25:10105/r/YiWuProject
New file |
| | |
| | | package com.mes.common.config; |
| | | |
| | | |
| | | /** |
| | | * @Author : zt |
| | | * @Date: 2025/4/08 10:33 |
| | | * @Description: |
| | | */ |
| | | public class ConstSysConfig { |
| | | |
| | | |
| | | // 钢化炉数阈值 |
| | | public static final Integer CACHE_THRESHOLD = 1; |
| | | // 磨边参数换算率 |
| | | public static final Integer CACHE_RATIO = 2; |
| | | // 卧理最大长边 |
| | | public static final Integer CACHE_CACHE_WIDTH = 3; |
| | | // 卧理最大短边 |
| | | public static final Integer CACHE_CACHE_HEIGHT = 4; |
| | | // 磨边二线最大长边 |
| | | public static final Integer CACHE_MAX_FIRST_LENGTH = 5; |
| | | // 磨边二线最大短边 |
| | | public static final Integer CACHE_MAX_SECOND_LENGTH = 6; |
| | | // 磨边一线最大长边 |
| | | public static final Integer CACHE_MIN_ONE_FIRST_LENGTH = 7; |
| | | // 磨边一线最大短边 |
| | | public static final Integer CACHE_MIN_ONE_SECOND_LENGTH = 8; |
| | | // 磨边二线最大长边 |
| | | public static final Integer CACHE_MIN_TWO_FIRST_LENGTH = 9; |
| | | // 磨边二线最大短边 |
| | | public static final Integer CACHE_MIN_TWO_SECOND_LENGTH = 10; |
| | | // 卧理玻璃间隙 |
| | | public static final Integer CACHE_GLASS_GAP = 1; |
| | | // 卧理格子宽度 |
| | | public static final Integer CACHE_CELL_LENGTH = 12; |
| | | // 排序方式 |
| | | public static final Integer CACHE_SEQUENCE_ORDER_FALSE = 13; |
| | | // 排序方式 |
| | | public static final Integer CACHE_SEQUENCE_ORDER_TRUE = 14; |
| | | |
| | | // 一炉玻璃占用格子数 |
| | | public static final Integer VERTICAL_MINCOUNT = 15; |
| | | // 大车宽度 |
| | | public static final Integer VERTICAL_CAR_WIDTH = 16; |
| | | // 格子宽度 |
| | | public static final Integer VERTICAL_SLOT_WIDTH = 17; |
| | | // 进片车最大玻璃数 |
| | | public static final Integer VERTICAL_IN_CAR_SIZE = 18; |
| | | // 出片车最大玻璃数 |
| | | public static final Integer VERTICAL_OUT_CAR_SIZE = 19; |
| | | // 玻璃间隙 |
| | | public static final Integer VERTICAL_GLASS_GAP = 20; |
| | | // 钢化炉长度 |
| | | public static final Integer VERTICAL_X_MAX_SIZE = 21; |
| | | // 格子最大高度 |
| | | public static final Integer VERTICAL_SLOT_MAX_HEIGHT = 22; |
| | | // 格子最大厚度 |
| | | public static final Integer VERTICAL_SLOT_MAXTHICKNESS = 23; |
| | | // 钢出目标位置 |
| | | public static final Integer VERTICAL_TEMPERING_OUT_TARGET_POSITION = 24; |
| | | // 人工下片目标位置 |
| | | public static final Integer VERTICAL_ARTIFICIAL_OUT_TARGET_POSITION = 25; |
| | | |
| | | // 排序方式 |
| | | public static final Integer HOLLOW_SEQUENCE_ORDER = 26; |
| | | // 一炉玻璃占用格子数 |
| | | public static final Integer HOLLOW_MINCOUNT = 27; |
| | | // 大车宽度 |
| | | public static final Integer HOLLOW_CAR_WIDTH = 28; |
| | | // 格子宽度 |
| | | public static final Integer HOLLOW_SLOT_WIDTH = 29; |
| | | // 进片车最大玻璃数 |
| | | public static final Integer HOLLOW_IN_CAR_SIZE = 30; |
| | | // 出片车最大玻璃数 |
| | | public static final Integer HOLLOW_OUT_CAR_SIZE = 31; |
| | | // 玻璃间隙 |
| | | public static final Integer HOLLOW_GLASS_GAP = 32; |
| | | // 钢化炉长度 |
| | | public static final Integer HOLLOW_X_MAX_SIZE = 33; |
| | | // 钢出目标位置 |
| | | public static final Integer HOLLOW_TEMPERING_OUT_TARGET_POSITION = 34; |
| | | // 人工下片目标位置 |
| | | public static final Integer HOLLOW_ARTIFICIAL_OUT_TARGET_POSITION = 35; |
| | | // 格子最大高度 |
| | | public static final Integer HOLLOW_SLOT_MAX_HEIGHT = 36; |
| | | // 格子最大厚度 |
| | | public static final Integer HOLLOW_SLOT_MAXTHICKNESS = 37; |
| | | |
| | | // 钢化炉长度 |
| | | public static final Integer TEMPERING_WIDTH = 38; |
| | | // 钢化炉宽度 |
| | | public static final Integer TEMPERING_HEIGHT = 39; |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | Boolean deleteConfig(Serializable id); |
| | | |
| | | String queryConfigValue(Serializable id); |
| | | |
| | | } |
| | | |
| | |
| | | import com.mes.sysconfig.entity.request.SysConfigRequest; |
| | | import com.mes.sysconfig.mapper.SysConfigMapper; |
| | | import com.mes.sysconfig.service.SysConfigService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.cache.annotation.CacheEvict; |
| | | import org.springframework.cache.annotation.CachePut; |
| | | import org.springframework.cache.annotation.Cacheable; |
| | |
| | | * @since 2025-04-01 15:01:27 |
| | | */ |
| | | @Service |
| | | @Slf4j |
| | | public class SysConfigServiceImpl extends ServiceImpl<SysConfigMapper, SysConfig> implements SysConfigService { |
| | | |
| | | @Override |
| | |
| | | public Boolean deleteConfig(Serializable id) { |
| | | return this.removeById(id); |
| | | } |
| | | |
| | | @Override |
| | | public String queryConfigValue(Serializable id) { |
| | | SysConfig sysConfig = this.queryConfigById(id); |
| | | if (sysConfig == null) { |
| | | log.info("系统配置查询为空,请检查该配置是否存在:{}", id); |
| | | return null; |
| | | } |
| | | return sysConfig.getConfigValue(); |
| | | } |
| | | } |
| | | |
| | |
| | | public Result<Boolean> cancelTemperingTask() { |
| | | boolean result = bigStorageCageDetailsService.cancelTemperingTask(); |
| | | if (result == true) { |
| | | return Result.build(200, "指定钢化成功", result); |
| | | return Result.build(200, "取消当前钢化成功", result); |
| | | } else { |
| | | return Result.build(200, "已存在钢化任务,请等待钢化完成再指定钢化", result); |
| | | return Result.build(200, "取消当前钢化失败", result); |
| | | } |
| | | } |
| | | |
| | |
| | | import com.mes.bigstorage.mapper.BigStorageCageDetailsMapper; |
| | | import com.mes.bigstorage.service.BigStorageCageDetailsService; |
| | | import com.mes.bigstorage.service.BigStorageCageService; |
| | | import com.mes.bigstoragecagetask.entity.BigStorageCageHistoryTask; |
| | | import com.mes.bigstoragecagetask.service.BigStorageCageHistoryTaskService; |
| | | import com.mes.bigstoragetask.entity.BigStorageCageFeedTask; |
| | | import com.mes.bigstoragetask.entity.BigStorageCageOutTask; |
| | | import com.mes.bigstoragetask.entity.UpdateBigStorageCageDTO; |
| | |
| | | private DamageService damageService; |
| | | @Resource |
| | | private RedisUtil redisUtil; |
| | | |
| | | @Resource |
| | | BigStorageCageHistoryTaskService bigStorageCageHistoryTaskService; |
| | | |
| | | @Value("${mes.minCount}") |
| | | private int minCount; |
| | |
| | | |
| | | @Override |
| | | public boolean cancelTemperingTask() { |
| | | return false; |
| | | //当前正在执行的出片任务 |
| | | List<BigStorageCageHistoryTask> historyTaskList = bigStorageCageHistoryTaskService.list(new LambdaQueryWrapper<BigStorageCageHistoryTask>() |
| | | .eq(BigStorageCageHistoryTask::getTaskState, Const.GLASS_STATE_NEW) |
| | | .eq(BigStorageCageHistoryTask::getTargetSlot, Const.TEMPERING_OUT_TARGET_POSITION)); |
| | | //不存在出片任务,直接删除钢化小片表未出片的任务 |
| | | if (CollectionUtils.isEmpty(historyTaskList)) { |
| | | temperingGlassInfoMapper.delete(new LambdaQueryWrapper<TemperingGlassInfo>().eq(TemperingGlassInfo::getState, Const.TEMPERING_NEW)); |
| | | return Boolean.TRUE; |
| | | } |
| | | //存在出片任务,删除钢化小片表 |
| | | List<String> glassIdList = historyTaskList.stream().map(BigStorageCageHistoryTask::getGlassId).collect(Collectors.toList()); |
| | | GlassInfo glassInfo = glassInfoService.getOne(new LambdaQueryWrapper<GlassInfo>().in(GlassInfo::getGlassId, glassIdList) |
| | | .orderByDesc(GlassInfo::getTemperingFeedSequence).last("limit 1")); |
| | | temperingGlassInfoMapper.delete(new LambdaQueryWrapper<TemperingGlassInfo>() |
| | | .eq(TemperingGlassInfo::getEngineerId, glassInfo.getEngineerId()) |
| | | .eq(TemperingGlassInfo::getState, Const.TEMPERING_NEW) |
| | | .ge(TemperingGlassInfo::getTemperingLayoutId, glassInfo.getTemperingLayoutId()) |
| | | .gt(TemperingGlassInfo::getTemperingFeedSequence, glassInfo.getTemperingFeedSequence()) |
| | | ); |
| | | return Boolean.TRUE; |
| | | } |
| | | |
| | | @Override |
New file |
| | |
| | | -- liquibase formatted sql |
| | | |
| | | -- changeset zt:20250407001 |
| | | -- preconditions onFail:CONTINUE onError:CONTINUE |
| | | -- precondition-sql-check expectedResult:0 SELECT COUNT(*) FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'sys_config' ; |
| | | CREATE TABLE `sys_config` ( |
| | | `id` int NOT NULL AUTO_INCREMENT, |
| | | `parent_id` int NULL DEFAULT NULL COMMENT '父配置id', |
| | | `config_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '配置名', |
| | | `config_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '配置代码', |
| | | `config_value` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '配置值', |
| | | `is_enable` int NULL DEFAULT NULL COMMENT '是否启用', |
| | | `create_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', |
| | | `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', |
| | | PRIMARY KEY (`id`) USING BTREE |
| | | ) ENGINE = InnoDB AUTO_INCREMENT = 61 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic; |
| | | -- rollback DROP TABLE big_storage_cage; |
| | | |
| | | |
| | | -- changeset zt:20250407001 |
| | | -- preconditions onFail:CONTINUE onError:CONTINUE |
| | | -- precondition-sql-check expectedResult:0 SELECT COUNT(*) FROM sys_config; |
| | | INSERT INTO `north_glass_mes`.`sys_config` (`id`, `parent_id`, `config_name`, `config_code`, `config_value`, `is_enable`, `create_time`, `update_time`) VALUES (1, 1, '钢化炉数阈值', 'cache_threshold', '11', 1, '2025-04-07 09:20:04', '2025-04-08 13:42:29'); |
| | | INSERT INTO `north_glass_mes`.`sys_config` (`id`, `parent_id`, `config_name`, `config_code`, `config_value`, `is_enable`, `create_time`, `update_time`) VALUES (2, 1, '磨边参数换算率', 'cache_ratio', '10', 1, '2025-04-07 09:20:04', '2025-04-08 13:42:26'); |
| | | INSERT INTO `north_glass_mes`.`sys_config` (`id`, `parent_id`, `config_name`, `config_code`, `config_value`, `is_enable`, `create_time`, `update_time`) VALUES (3, 1, '卧理最大长边', 'cache_cacheWidth', '3600', 0, '2025-04-07 09:20:04', '2025-04-08 13:42:00'); |
| | | INSERT INTO `north_glass_mes`.`sys_config` (`id`, `parent_id`, `config_name`, `config_code`, `config_value`, `is_enable`, `create_time`, `update_time`) VALUES (4, 1, '卧理最大短边', 'cache_cacheHeight', '3000', 1, '2025-04-07 09:20:04', '2025-04-08 13:42:00'); |
| | | INSERT INTO `north_glass_mes`.`sys_config` (`id`, `parent_id`, `config_name`, `config_code`, `config_value`, `is_enable`, `create_time`, `update_time`) VALUES (5, 1, '磨边二线最大长边', 'cache_max_firstLength', '3500', 1, '2025-04-07 09:20:04', '2025-04-08 13:42:00'); |
| | | INSERT INTO `north_glass_mes`.`sys_config` (`id`, `parent_id`, `config_name`, `config_code`, `config_value`, `is_enable`, `create_time`, `update_time`) VALUES (6, 1, '磨边二线最大短边', 'cache_max_secondLength', '2500', 1, '2025-04-07 09:20:04', '2025-04-08 13:42:00'); |
| | | INSERT INTO `north_glass_mes`.`sys_config` (`id`, `parent_id`, `config_name`, `config_code`, `config_value`, `is_enable`, `create_time`, `update_time`) VALUES (7, 1, '磨边一线最大长边', 'cache_min_one_firstLength', '460', 1, '2025-04-07 09:20:04', '2025-04-08 13:42:00'); |
| | | INSERT INTO `north_glass_mes`.`sys_config` (`id`, `parent_id`, `config_name`, `config_code`, `config_value`, `is_enable`, `create_time`, `update_time`) VALUES (8, 1, '磨边一线最大短边', 'cache_min_one,secondLength', '390', 1, '2025-04-07 09:20:04', '2025-04-08 13:42:00'); |
| | | INSERT INTO `north_glass_mes`.`sys_config` (`id`, `parent_id`, `config_name`, `config_code`, `config_value`, `is_enable`, `create_time`, `update_time`) VALUES (9, 1, '磨边二线最大长边', 'cache_min_two_firstLength', '300', 1, '2025-04-07 09:20:04', '2025-04-08 13:42:00'); |
| | | INSERT INTO `north_glass_mes`.`sys_config` (`id`, `parent_id`, `config_name`, `config_code`, `config_value`, `is_enable`, `create_time`, `update_time`) VALUES (10, 1, '磨边二线最大短边', 'cache_min_two_secondLength', '300', 1, '2025-04-07 09:20:04', '2025-04-08 13:42:00'); |
| | | INSERT INTO `north_glass_mes`.`sys_config` (`id`, `parent_id`, `config_name`, `config_code`, `config_value`, `is_enable`, `create_time`, `update_time`) VALUES (11, 1, '卧理玻璃间隙', 'cache_glassGap', '2500', 1, '2025-04-07 09:20:04', '2025-04-08 13:42:00'); |
| | | INSERT INTO `north_glass_mes`.`sys_config` (`id`, `parent_id`, `config_name`, `config_code`, `config_value`, `is_enable`, `create_time`, `update_time`) VALUES (12, 1, '卧理格子宽度', 'cache_cellLength', '2500', 1, '2025-04-07 09:20:04', '2025-04-08 13:42:00'); |
| | | INSERT INTO `north_glass_mes`.`sys_config` (`id`, `parent_id`, `config_name`, `config_code`, `config_value`, `is_enable`, `create_time`, `update_time`) VALUES (13, 1, '排序方式', 'cache_sequence_order', 'FALSE', 1, '2025-04-07 09:20:04', '2025-04-08 13:43:18'); |
| | | INSERT INTO `north_glass_mes`.`sys_config` (`id`, `parent_id`, `config_name`, `config_code`, `config_value`, `is_enable`, `create_time`, `update_time`) VALUES (14, 2, '排序方式', 'cache_sequence_order', 'TRUE', 1, '2025-04-07 09:20:04', '2025-04-08 13:42:00'); |
| | | INSERT INTO `north_glass_mes`.`sys_config` (`id`, `parent_id`, `config_name`, `config_code`, `config_value`, `is_enable`, `create_time`, `update_time`) VALUES (15, 2, '一炉玻璃占用格子数', 'vertical_mincount', '30', 1, '2025-04-07 09:20:04', '2025-04-08 13:42:00'); |
| | | INSERT INTO `north_glass_mes`.`sys_config` (`id`, `parent_id`, `config_name`, `config_code`, `config_value`, `is_enable`, `create_time`, `update_time`) VALUES (16, 2, '大车宽度', 'vertical_carWidth', '6200', 1, '2025-04-07 09:20:04', '2025-04-08 13:42:00'); |
| | | INSERT INTO `north_glass_mes`.`sys_config` (`id`, `parent_id`, `config_name`, `config_code`, `config_value`, `is_enable`, `create_time`, `update_time`) VALUES (17, 2, '格子宽度', 'vertical_slotWidth', '6200', 1, '2025-04-07 09:20:04', '2025-04-08 13:42:00'); |
| | | INSERT INTO `north_glass_mes`.`sys_config` (`id`, `parent_id`, `config_name`, `config_code`, `config_value`, `is_enable`, `create_time`, `update_time`) VALUES (18, 2, '进片车最大玻璃数', 'vertical_inCarSize', '5', 1, '2025-04-07 09:20:04', '2025-04-08 13:42:00'); |
| | | INSERT INTO `north_glass_mes`.`sys_config` (`id`, `parent_id`, `config_name`, `config_code`, `config_value`, `is_enable`, `create_time`, `update_time`) VALUES (19, 2, '出片车最大玻璃数', 'vertical_outCarSize', '6', 1, '2025-04-07 09:20:04', '2025-04-08 13:42:00'); |
| | | INSERT INTO `north_glass_mes`.`sys_config` (`id`, `parent_id`, `config_name`, `config_code`, `config_value`, `is_enable`, `create_time`, `update_time`) VALUES (20, 2, '玻璃间隙', 'vertical_glassGap', '250', 1, '2025-04-07 09:20:04', '2025-04-08 13:42:00'); |
| | | INSERT INTO `north_glass_mes`.`sys_config` (`id`, `parent_id`, `config_name`, `config_code`, `config_value`, `is_enable`, `create_time`, `update_time`) VALUES (21, 2, '钢化炉长度', 'vertical_xMaxSize', '2800', 0, '2025-04-07 09:20:04', '2025-04-08 13:42:00'); |
| | | INSERT INTO `north_glass_mes`.`sys_config` (`id`, `parent_id`, `config_name`, `config_code`, `config_value`, `is_enable`, `create_time`, `update_time`) VALUES (22, 2, '格子最大高度', 'vertical_slotMaxHeight', '2500', 1, '2025-04-07 09:20:04', '2025-04-08 13:42:00'); |
| | | INSERT INTO `north_glass_mes`.`sys_config` (`id`, `parent_id`, `config_name`, `config_code`, `config_value`, `is_enable`, `create_time`, `update_time`) VALUES (23, 2, '格子最大厚度', 'vertical_slotMaxthickness', '12', 1, '2025-04-07 09:20:04', '2025-04-08 13:42:00'); |
| | | INSERT INTO `north_glass_mes`.`sys_config` (`id`, `parent_id`, `config_name`, `config_code`, `config_value`, `is_enable`, `create_time`, `update_time`) VALUES (24, 2, '钢出目标位置', 'vertical_temperingOutTargetPosition', '930', 1, '2025-04-07 09:20:04', '2025-04-08 13:42:00'); |
| | | INSERT INTO `north_glass_mes`.`sys_config` (`id`, `parent_id`, `config_name`, `config_code`, `config_value`, `is_enable`, `create_time`, `update_time`) VALUES (25, 2, '人工下片目标位置', 'vertical_artificialOutTargetPosition', '931', 1, '2025-04-07 09:20:04', '2025-04-08 13:42:00'); |
| | | INSERT INTO `north_glass_mes`.`sys_config` (`id`, `parent_id`, `config_name`, `config_code`, `config_value`, `is_enable`, `create_time`, `update_time`) VALUES (26, 3, '排序方式', 'hollow_sequence,order', 'TRUE', 1, '2025-04-07 09:20:04', '2025-04-08 13:42:00'); |
| | | INSERT INTO `north_glass_mes`.`sys_config` (`id`, `parent_id`, `config_name`, `config_code`, `config_value`, `is_enable`, `create_time`, `update_time`) VALUES (27, 3, '一炉玻璃占用格子数', 'hollow_mincount', '30', 1, '2025-04-07 09:20:04', '2025-04-08 13:42:00'); |
| | | INSERT INTO `north_glass_mes`.`sys_config` (`id`, `parent_id`, `config_name`, `config_code`, `config_value`, `is_enable`, `create_time`, `update_time`) VALUES (28, 3, '大车宽度', 'hollow_carWidth', '6200', 1, '2025-04-07 09:20:04', '2025-04-08 13:42:00'); |
| | | INSERT INTO `north_glass_mes`.`sys_config` (`id`, `parent_id`, `config_name`, `config_code`, `config_value`, `is_enable`, `create_time`, `update_time`) VALUES (29, 3, '格子宽度', 'hollow_slotWidth', '6200', 1, '2025-04-07 09:20:04', '2025-04-08 13:42:00'); |
| | | INSERT INTO `north_glass_mes`.`sys_config` (`id`, `parent_id`, `config_name`, `config_code`, `config_value`, `is_enable`, `create_time`, `update_time`) VALUES (30, 3, '进片车最大玻璃数', 'hollow_inCarSize', '5', 1, '2025-04-07 09:20:04', '2025-04-08 13:42:00'); |
| | | INSERT INTO `north_glass_mes`.`sys_config` (`id`, `parent_id`, `config_name`, `config_code`, `config_value`, `is_enable`, `create_time`, `update_time`) VALUES (31, 3, '出片车最大玻璃数', 'hollow_outCarSize', '6', 1, '2025-04-07 09:20:04', '2025-04-08 13:42:00'); |
| | | INSERT INTO `north_glass_mes`.`sys_config` (`id`, `parent_id`, `config_name`, `config_code`, `config_value`, `is_enable`, `create_time`, `update_time`) VALUES (32, 3, '玻璃间隙', 'hollow_glassGap', '250', 1, '2025-04-07 09:20:04', '2025-04-08 13:42:00'); |
| | | INSERT INTO `north_glass_mes`.`sys_config` (`id`, `parent_id`, `config_name`, `config_code`, `config_value`, `is_enable`, `create_time`, `update_time`) VALUES (33, 3, '钢化炉长度', 'hollow_xMaxSize', '2800', 1, '2025-04-07 09:20:04', '2025-04-08 13:42:00'); |
| | | INSERT INTO `north_glass_mes`.`sys_config` (`id`, `parent_id`, `config_name`, `config_code`, `config_value`, `is_enable`, `create_time`, `update_time`) VALUES (34, 3, '钢出目标位置', 'hollow_temperingOutTargetPosition', '930', 1, '2025-04-07 09:20:04', '2025-04-08 13:42:00'); |
| | | INSERT INTO `north_glass_mes`.`sys_config` (`id`, `parent_id`, `config_name`, `config_code`, `config_value`, `is_enable`, `create_time`, `update_time`) VALUES (35, 3, '人工下片目标位置', 'hollow_artificialOutTargetPosition', '931', 1, '2025-04-07 09:20:04', '2025-04-08 13:42:00'); |
| | | INSERT INTO `north_glass_mes`.`sys_config` (`id`, `parent_id`, `config_name`, `config_code`, `config_value`, `is_enable`, `create_time`, `update_time`) VALUES (36, 3, '格子最大高度', 'hollow_slotMaxHeight', '2500', 1, '2025-04-07 09:20:04', '2025-04-08 13:42:00'); |
| | | INSERT INTO `north_glass_mes`.`sys_config` (`id`, `parent_id`, `config_name`, `config_code`, `config_value`, `is_enable`, `create_time`, `update_time`) VALUES (37, 3, '格子最大厚度', 'hollow_slotMaxthickness', '12', 1, '2025-04-07 09:20:04', '2025-04-08 13:42:00'); |
| | | INSERT INTO `north_glass_mes`.`sys_config` (`id`, `parent_id`, `config_name`, `config_code`, `config_value`, `is_enable`, `create_time`, `update_time`) VALUES (38, 4, '钢化炉长度', 'tempering_width', '2800', 1, '2025-04-07 09:20:04', '2025-04-08 13:42:00'); |
| | | INSERT INTO `north_glass_mes`.`sys_config` (`id`, `parent_id`, `config_name`, `config_code`, `config_value`, `is_enable`, `create_time`, `update_time`) VALUES (39, 4, '钢化炉宽度', 'tempering_height', '5000', 1, '2025-04-07 09:20:04', '2025-04-08 13:42:00'); |
| | | |
| | | |
| | |
| | | package com.mes.hollow.controller; |
| | | |
| | | |
| | | import com.mes.hollow.entity.dto.FlowCardGlassInfoDTO; |
| | | import com.mes.hollow.entity.dto.LackDetailsDTO; |
| | | import com.mes.hollow.entity.vo.HollowAllFlowCardVO; |
| | | import com.mes.hollow.entity.vo.HollowBigStorageDetailsQueryVO; |
| | | import com.mes.hollow.service.HollowGlassRelationInfoService; |
| | | import com.mes.utils.Result; |
| | |
| | | |
| | | @ApiOperation("界面点击创建任务:查询中空所有流程卡对应的玻璃信息") |
| | | @PostMapping("/queryHollowAllFlowCard") |
| | | public Result<Map<String, List<FlowCardGlassInfoDTO>>> queryHollowAllFlowCard(@RequestBody HollowBigStorageDetailsQueryVO query) { |
| | | Map<String, List<FlowCardGlassInfoDTO>> bigStorageCageDetails = hollowGlassRelationInfoService.queryHollowAllFlowCard(query); |
| | | return Result.success(bigStorageCageDetails); |
| | | public Result<List<HollowAllFlowCardVO>> queryHollowAllFlowCard(@RequestBody HollowBigStorageDetailsQueryVO query) { |
| | | List<HollowAllFlowCardVO> hollowAllFlowCardVOList = hollowGlassRelationInfoService.queryHollowAllFlowCard(query); |
| | | return Result.success(hollowAllFlowCardVOList); |
| | | } |
| | | |
| | | @ApiOperation("查询指定流程卡及层数的缺片详情") |
New file |
| | |
| | | package com.mes.hollow.entity.vo; |
| | | |
| | | import com.mes.hollow.entity.dto.FlowCardGlassInfoDTO; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Author : zhoush |
| | | * @Date: 2025/4/9 16:26 |
| | | * @Description: |
| | | */ |
| | | @Data |
| | | public class HollowAllFlowCardVO { |
| | | /** |
| | | * 流程卡号 |
| | | */ |
| | | private String FlowCardId; |
| | | /** |
| | | * 产品名称 |
| | | */ |
| | | private String ProductName; |
| | | /** |
| | | * 是否直通 |
| | | */ |
| | | private Boolean isThroughSlot; |
| | | |
| | | /** |
| | | * 流程卡数据 |
| | | */ |
| | | private List<FlowCardGlassInfoDTO> flowCardGlassInfoDTOList; |
| | | } |
| | |
| | | import com.mes.hollow.entity.dto.FlowCardGlassInfoDTO; |
| | | import com.mes.hollow.entity.dto.HollowBigStorageDTO; |
| | | import com.mes.hollow.entity.dto.LackDetailsDTO; |
| | | import com.mes.hollow.entity.vo.HollowAllFlowCardVO; |
| | | import com.mes.hollow.entity.vo.HollowBigStorageDetailsQueryVO; |
| | | |
| | | import java.util.List; |
| | |
| | | */ |
| | | void generateHollowGlassInfo(String flowCardId, int totalLayer, int layer); |
| | | |
| | | Map<String, List<FlowCardGlassInfoDTO>> queryHollowAllFlowCard(HollowBigStorageDetailsQueryVO query); |
| | | List<HollowAllFlowCardVO> queryHollowAllFlowCard(HollowBigStorageDetailsQueryVO query); |
| | | |
| | | List<FlowCardGlassInfoDTO> queryHollowAllFlowCardSummary(HollowBigStorageDetailsQueryVO query); |
| | | |
| | |
| | | |
| | | //设置文件第一层列表数据 |
| | | //暂时生成笼内所有的玻璃信息(已配对和未配对的) |
| | | // List<HollowGlassRelationInfo> hollowGlassRelationInfos = hollowGlassRelationInfoService.list(new LambdaQueryWrapper<HollowGlassRelationInfo>() |
| | | // .eq(HollowGlassRelationInfo::getFlowCardId, flowCardId).orderByAsc(HollowGlassRelationInfo::getHollowSequence)); |
| | | List<HollowBigStorageCageDetails> hollowGlassRelationInfos = hollowBigStorageCageDetailsService.queryPairGlassList(flowCardId, relationInfo.getTotalLayer(), relationInfo.getTotalPairQuantity(), isOut); |
| | | Map<Integer, List<HollowBigStorageCageDetails>> listMap = hollowGlassRelationInfos.stream().collect(Collectors.groupingBy(HollowBigStorageCageDetails::getHollowSequence)); |
| | | Map<Integer, List<HollowBigStorageCageDetails>> listMap = hollowGlassRelationInfos.stream() |
| | | .collect(Collectors.groupingBy(HollowBigStorageCageDetails::getHollowSequence, |
| | | Collectors.collectingAndThen(Collectors.toList(), |
| | | list -> list.stream().sorted(Comparator.comparing(HollowBigStorageCageDetails::getLayer)).collect(Collectors.toList())))); |
| | | Map<Integer, List<HollowBigStorageCageDetails>> sortListMap = new TreeMap<>(); |
| | | sortListMap.putAll(listMap); |
| | | //设置间隔板数据共所有配对玻璃使用 |
| | |
| | | import com.mes.hollow.entity.dto.HollowBigStorageDTO; |
| | | import com.mes.hollow.entity.dto.HollowGlassDetailsDTO; |
| | | import com.mes.hollow.entity.dto.LackDetailsDTO; |
| | | import com.mes.hollow.entity.vo.HollowAllFlowCardVO; |
| | | import com.mes.hollow.entity.vo.HollowBigStorageDetailsQueryVO; |
| | | import com.mes.hollow.mapper.HollowGlassRelationInfoMapper; |
| | | import com.mes.hollow.service.HollowBigStorageCageDetailsService; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.*; |
| | | import java.util.ArrayList; |
| | | import java.util.Comparator; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, List<FlowCardGlassInfoDTO>> queryHollowAllFlowCard(HollowBigStorageDetailsQueryVO query) { |
| | | public List<HollowAllFlowCardVO> queryHollowAllFlowCard(HollowBigStorageDetailsQueryVO query) { |
| | | List<HollowBigStorageCageDetails> detailsList = hollowBigStorageCageDetailsService.list(new LambdaQueryWrapper<HollowBigStorageCageDetails>() |
| | | .eq(HollowBigStorageCageDetails::getState, Const.GLASS_STATE_IN) |
| | | .like(StringUtils.isNotBlank(query.getFilmsId()), HollowBigStorageCageDetails::getFilmsId, query.getFilmsId()) |
| | |
| | | ); |
| | | if (CollectionUtil.isEmpty(detailsList)) { |
| | | log.info("笼内无玻璃"); |
| | | return new HashMap<>(); |
| | | return new ArrayList<>(); |
| | | } |
| | | Map<String, List<HollowBigStorageCageDetails>> listMap = detailsList.stream().collect(Collectors.groupingBy(HollowBigStorageCageDetails::getFlowCardId)); |
| | | List<FlowCardGlassInfoDTO> dtos = new ArrayList<>(); |
| | | List<HollowAllFlowCardVO> resultList = new ArrayList<>(); |
| | | listMap.forEach((e, v) -> { |
| | | HollowAllFlowCardVO hollowAllFlowCardVO = new HollowAllFlowCardVO(); |
| | | HollowBigStorageCageDetails cageDetails = v.get(0); |
| | | hollowAllFlowCardVO.setFlowCardId(e); |
| | | if (cageDetails.getHollowSequence() == 0) { |
| | | hollowAllFlowCardVO.setIsThroughSlot(Boolean.TRUE); |
| | | } else { |
| | | hollowAllFlowCardVO.setIsThroughSlot(Boolean.FALSE); |
| | | } |
| | | //按照流程卡获取对应的产品名称 |
| | | String productName = baseMapper.queryProductNameByFlowCardId(cageDetails.getFlowCardId()); |
| | | hollowAllFlowCardVO.setProductName(productName); |
| | | List<FlowCardGlassInfoDTO> flowCardInfoList = hollowBigStorageCageDetailsService.hollowIsAll(e, cageDetails.getTotalLayer(), Boolean.FALSE); |
| | | for (FlowCardGlassInfoDTO item : flowCardInfoList) { |
| | | item.setProductName(productName); |
| | | dtos.add(item); |
| | | } |
| | | hollowAllFlowCardVO.setFlowCardGlassInfoDTOList(flowCardInfoList); |
| | | resultList.add(hollowAllFlowCardVO); |
| | | }); |
| | | Map<String, FlowCardGlassInfoDTO> result = dtos.stream() |
| | | .collect(Collectors.toMap( |
| | | FlowCardGlassInfoDTO::getFlowCardId, |
| | | dto -> { |
| | | FlowCardGlassInfoDTO newDto = new FlowCardGlassInfoDTO(); |
| | | newDto.setFlowCardId(dto.getFlowCardId()); |
| | | newDto.setSumCount(dto.getSumCount()); |
| | | newDto.setPairCount(dto.getPairCount()); |
| | | newDto.setRealCount(dto.getRealCount()); |
| | | newDto.setLayer(dto.getLayer()); |
| | | return newDto; |
| | | }, |
| | | (dto1, dto2) -> { |
| | | dto1.setRealCount(dto1.getRealCount() + dto2.getRealCount()); // 累加 realCount |
| | | dto1.setLayer(Math.max(dto1.getLayer(), dto2.getLayer())); // 累加 最大层数 |
| | | return dto1; // 返回合并后的对象 |
| | | } |
| | | )); |
| | | return dtos.stream().collect(Collectors.groupingBy(e -> e.getFlowCardId() + ":" + e.getProductName())); |
| | | return resultList; |
| | | // return dtos.stream().collect(Collectors.groupingBy(e -> e.getFlowCardId() + ":" + e.getProductName())); |
| | | } |
| | | |
| | | @Override |
| | |
| | | } |
| | | } |
| | | //超大尺寸 |
| | | if (slotMaxHeight < Math.min(glassInfoList.get(0).getWidth(), glassInfoList.get(0).getHeight()) || glassInfoList.get(0).getThickness() > slotMaxthickness) { |
| | | if (slotMaxHeight < Math.min(glassInfoList.get(0).getWidth(), glassInfoList.get(0).getHeight()) || glassInfoList.get(0).getThickness() >= slotMaxthickness) { |
| | | int count = hollowBigStorageCageDetailsService.count(new LambdaQueryWrapper<HollowBigStorageCageDetails>() |
| | | .eq(HollowBigStorageCageDetails::getSlot, THROUGH_SLOT) |
| | | .in(HollowBigStorageCageDetails::getState, Const.GLASS_STATE_IN_ALL)); |
| | |
| | | //计算目标格子 |
| | | List<HollowBigStorageCageHistoryTask> historyTasks = new ArrayList<>(); |
| | | try { |
| | | for (BigStorageCageTask task : inTaskList) { |
| | | GlassInfo info = glassListMap.get(task.getGlassId()).get(0); |
| | | HollowBigStorageDTO bigStorageDTO = hollowGlassRelationInfoService.queryHollowTargetSlot(info.getFlowCardId(), |
| | | info.getWidth(), info.getHeight(), info.getTotalLayer(), info.getLayer()); |
| | | if (slotMaxHeight > Math.min(glassInfoList.get(0).getWidth(), glassInfoList.get(0).getHeight()) && glassInfoList.get(0).getThickness() < slotMaxthickness) { |
| | | for (BigStorageCageTask task : inTaskList) { |
| | | GlassInfo info = glassListMap.get(task.getGlassId()).get(0); |
| | | HollowBigStorageDTO bigStorageDTO = hollowGlassRelationInfoService.queryHollowTargetSlot(info.getFlowCardId(), |
| | | info.getWidth(), info.getHeight(), info.getTotalLayer(), info.getLayer()); |
| | | // 临时更新格子的剩余尺寸:防止相邻玻璃进同一格子造成剩余尺寸不足,玻璃越界的情况,任务完成后再次更新大理片笼表剩余宽度(按照笼内玻璃数量更新大理片笼剩余尺寸) |
| | | hollowBigStorageCageService.update(new LambdaUpdateWrapper<HollowBigStorageCage>() |
| | | .set(HollowBigStorageCage::getRemainWidth, bigStorageDTO.getRemainWidth() - Math.max(info.getWidth(), info.getHeight()) - glassGap) |
| | | .eq(HollowBigStorageCage::getSlot, bigStorageDTO.getSlot())); |
| | | task.setTargetSlot(bigStorageDTO.getSlot()); |
| | | task.setGlassId(info.getGlassId()); |
| | | bigStorageCageTaskService.updateTaskMessage(BIG_STORAGE_CAGE_IN_TWO_TASK, task); |
| | | hollowBigStorageCageService.update(new LambdaUpdateWrapper<HollowBigStorageCage>() |
| | | .set(HollowBigStorageCage::getRemainWidth, bigStorageDTO.getRemainWidth() - Math.max(info.getWidth(), info.getHeight()) - glassGap) |
| | | .eq(HollowBigStorageCage::getSlot, bigStorageDTO.getSlot())); |
| | | task.setTargetSlot(bigStorageDTO.getSlot()); |
| | | task.setGlassId(info.getGlassId()); |
| | | bigStorageCageTaskService.updateTaskMessage(BIG_STORAGE_CAGE_IN_TWO_TASK, task); |
| | | //存放历史任务 |
| | | HollowBigStorageCageHistoryTask historyTask = new HollowBigStorageCageHistoryTask(); |
| | | BeanUtils.copyProperties(task, historyTask); |
| | | historyTask.setTaskType(Const.BIG_STORAGE_AFTER_IN); |
| | | historyTask.setGlassCount(glassInfoList.size()); |
| | | historyTask.setTaskState(Const.ENGINEERING_NEW); |
| | | historyTasks.add(historyTask); |
| | | //存放详情数据 |
| | | HollowBigStorageCageDetails cageDetails = new HollowBigStorageCageDetails(); |
| | | BeanUtils.copyProperties(bigStorageDTO, cageDetails); |
| | | BeanUtils.copyProperties(info, cageDetails); |
| | | cageDetails.setState(Const.GLASS_STATE_NEW); |
| | | cageDetails.setSequence(bigStorageDTO.getSlotSequence()); |
| | | cageDetails.setGap(glassGap); |
| | | cageDetails.setId(null); |
| | | hollowBigStorageCageDetailsService.save(cageDetails); |
| | | hollowGlassRelationInfoService.update(new LambdaUpdateWrapper<HollowGlassRelationInfo>() |
| | | .set(HollowGlassRelationInfo::getGlassId, cageDetails.getGlassId()) |
| | | .set(HollowGlassRelationInfo::getTemperingLayoutId, cageDetails.getTemperingLayoutId()) |
| | | .set(HollowGlassRelationInfo::getTemperingFeedSequence, cageDetails.getTemperingFeedSequence()) |
| | | .set(HollowGlassRelationInfo::getEngineerId, cageDetails.getEngineerId()) |
| | | .set(HollowGlassRelationInfo::getState, Const.HOLLOW_RELATION_OCCUPY) |
| | | .eq(HollowGlassRelationInfo::getFlowCardId, bigStorageDTO.getFlowCardId()) |
| | | .eq(HollowGlassRelationInfo::getLayer, bigStorageDTO.getLayer()) |
| | | .eq(HollowGlassRelationInfo::getVirtualSlot, bigStorageDTO.getVirtualSlot()) |
| | | .eq(HollowGlassRelationInfo::getSlotSequence, bigStorageDTO.getSlotSequence()) |
| | | .eq(HollowGlassRelationInfo::getHollowSequence, bigStorageDTO.getHollowSequence()) |
| | | ); |
| | | } |
| | | } else { |
| | | BigStorageCageTask task = inTaskList.get(0); |
| | | task.setTargetSlot(THROUGH_SLOT); |
| | | bigStorageCageTaskService.updateTaskMessage("big_storage_cage_in_two_task", task); |
| | | //存放历史任务 |
| | | HollowBigStorageCageHistoryTask historyTask = new HollowBigStorageCageHistoryTask(); |
| | | BeanUtils.copyProperties(task, historyTask); |
| | |
| | | historyTask.setGlassCount(glassInfoList.size()); |
| | | historyTask.setTaskState(Const.ENGINEERING_NEW); |
| | | historyTasks.add(historyTask); |
| | | //存放详情数据 |
| | | GlassInfo info = glassInfoList.get(0); |
| | | HollowBigStorageCageDetails cageDetails = new HollowBigStorageCageDetails(); |
| | | BeanUtils.copyProperties(bigStorageDTO, cageDetails); |
| | | BeanUtils.copyProperties(info, cageDetails); |
| | | cageDetails.setSlot(THROUGH_SLOT); |
| | | cageDetails.setState(Const.GLASS_STATE_NEW); |
| | | cageDetails.setSequence(bigStorageDTO.getSlotSequence()); |
| | | cageDetails.setDeviceId(0); |
| | | cageDetails.setSequence(0); |
| | | cageDetails.setHollowSequence(0); |
| | | cageDetails.setGap(glassGap); |
| | | cageDetails.setFilmsId(info.getFilmsid()); |
| | | cageDetails.setId(null); |
| | | hollowBigStorageCageDetailsService.save(cageDetails); |
| | | hollowGlassRelationInfoService.update(new LambdaUpdateWrapper<HollowGlassRelationInfo>() |
| | | .set(HollowGlassRelationInfo::getGlassId, cageDetails.getGlassId()) |
| | | .set(HollowGlassRelationInfo::getTemperingLayoutId, cageDetails.getTemperingLayoutId()) |
| | | .set(HollowGlassRelationInfo::getTemperingFeedSequence, cageDetails.getTemperingFeedSequence()) |
| | | .set(HollowGlassRelationInfo::getEngineerId, cageDetails.getEngineerId()) |
| | | .set(HollowGlassRelationInfo::getState, Const.HOLLOW_RELATION_OCCUPY) |
| | | .eq(HollowGlassRelationInfo::getFlowCardId, bigStorageDTO.getFlowCardId()) |
| | | .eq(HollowGlassRelationInfo::getLayer, bigStorageDTO.getLayer()) |
| | | .eq(HollowGlassRelationInfo::getVirtualSlot, bigStorageDTO.getVirtualSlot()) |
| | | .eq(HollowGlassRelationInfo::getSlotSequence, bigStorageDTO.getSlotSequence()) |
| | | .eq(HollowGlassRelationInfo::getHollowSequence, bigStorageDTO.getHollowSequence()) |
| | | ); |
| | | } |
| | | } catch (Exception exception) { |
| | | log.info("进片任务执行中发生异常:{}", exception); |
| | |
| | | <if test="flag == true"> |
| | | and sum_count = pair_count |
| | | </if> |
| | | order by layer |
| | | </select> |
| | | |
| | | <select id="queryIsAllNeedDispatchVirtualSlot" resultMap="virtualSlotSequenceDTO"> |