fix:1.增加空辊信息管理。2.增加烘箱点位管理。3.增加生箔工序单下满卷、单上空辊、单下空辊、允许进入功能。4.优化生箔工序.5.增加烘箱工序工功能。6.手持接口等。
This commit is contained in:
@@ -23,4 +23,14 @@ public interface DictDataCommonApi {
|
||||
@Parameter(name = "dictType", description = "字典类型", example = "SEX", required = true)
|
||||
CommonResult<List<DictDataRespDTO>> getDictDataList(@RequestParam("dictType") String dictType);
|
||||
|
||||
@GetMapping(PREFIX + "/parseDictData")
|
||||
@Operation(summary = "获得指定字典类型和字典数据标签的字典数据")
|
||||
CommonResult<DictDataRespDTO> parseDictData(@RequestParam("dictType")
|
||||
@Parameter(name = "dictType", description = "字典类型", example = "SEX", required = true)
|
||||
String dictType,
|
||||
@RequestParam("label")
|
||||
@Parameter(name = "label", description = "字典数据标签", example = "男", required = true)
|
||||
String label
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package cn.code.nl.framework.execute.util.http;
|
||||
|
||||
import cn.code.nl.framework.common.exception.enums.GlobalErrorCodeConstants;
|
||||
import cn.code.nl.framework.common.pojo.AcsCommonResult;
|
||||
import cn.code.nl.framework.common.pojo.CommonResult;
|
||||
import cn.code.nl.framework.common.util.http.HttpUtils;
|
||||
import cn.code.nl.framework.common.util.json.JsonUtils;
|
||||
import cn.code.nl.framework.common.util.spring.SpringUtils;
|
||||
@@ -20,6 +21,8 @@ import java.net.UnknownHostException;
|
||||
import java.util.Collections;
|
||||
import java.util.Map;
|
||||
|
||||
import static cn.code.nl.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
|
||||
/**
|
||||
* ACS 调用工具
|
||||
*/
|
||||
@@ -36,6 +39,10 @@ public class AcsUtil {
|
||||
*/
|
||||
private static final String ACS_DISABLED = "0";
|
||||
|
||||
/**
|
||||
* ACS 服务地址配置后缀
|
||||
*/
|
||||
private static final String ACS_SERVER_ADDRESS_CONFIG_SUFFIX = "-acs-server-address";
|
||||
/**
|
||||
* 发送 POST 请求并解析 ACS 通用响应
|
||||
*
|
||||
@@ -160,4 +167,16 @@ public class AcsUtil {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取 ACS 服务地址
|
||||
*
|
||||
* @param productArea 生产区域
|
||||
* @return ACS 服务地址
|
||||
*/
|
||||
public static String getAcsServerAddress(String productArea) {
|
||||
String configKey = productArea + ACS_SERVER_ADDRESS_CONFIG_SUFFIX;
|
||||
ConfigApi configApi = SpringUtils.getBean("configApi");
|
||||
return configApi.getConfigValueByKey(configKey).getCheckedData();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package cn.code.nl.framework.redis.config;
|
||||
|
||||
import cn.code.nl.framework.redis.core.RedisUtils;
|
||||
import cn.hutool.core.util.ReflectUtil;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
|
||||
@@ -16,6 +17,14 @@ import org.springframework.data.redis.serializer.RedisSerializer;
|
||||
@AutoConfiguration(before = RedissonAutoConfigurationV2.class) // 目的:使用自己定义的 RedisTemplate Bean
|
||||
public class NlRedisAutoConfiguration {
|
||||
|
||||
/**
|
||||
* 通用 Redis 工具类(基于 framework 现有 RedisTemplate)
|
||||
*/
|
||||
@Bean
|
||||
public RedisUtils redisUtils(RedisTemplate<String, Object> redisTemplate) {
|
||||
return new RedisUtils(redisTemplate);
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建 RedisTemplate Bean,使用 JSON 序列化方式
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,104 @@
|
||||
package cn.code.nl.framework.redis.core;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* 通用 Redis 工具类(基于 framework 现有 {@link RedisTemplate}),供全项目调用
|
||||
* 由 {@link cn.code.nl.framework.redis.config.NlRedisAutoConfiguration} 暴露为 Bean
|
||||
*
|
||||
* @author dsh
|
||||
* 2026/8/23
|
||||
*/
|
||||
|
||||
@Slf4j
|
||||
public class RedisUtils {
|
||||
|
||||
private final RedisTemplate<String, Object> redisTemplate;
|
||||
|
||||
public RedisUtils(RedisTemplate<String, Object> redisTemplate) {
|
||||
this.redisTemplate = redisTemplate;
|
||||
}
|
||||
|
||||
/**
|
||||
* 普通缓存放入
|
||||
*
|
||||
* @param key 键
|
||||
* @param value 值(String)
|
||||
*/
|
||||
public void set(String key, String value) {
|
||||
redisTemplate.opsForValue().set(key, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* 普通缓存放入并设置过期时间
|
||||
*
|
||||
* @param key 键
|
||||
* @param value 值(String)
|
||||
* @param time 时间(秒)
|
||||
*/
|
||||
public void set(String key, String value, long time) {
|
||||
if (time > 0) {
|
||||
redisTemplate.opsForValue().set(key, value, time, TimeUnit.SECONDS);
|
||||
} else {
|
||||
set(key, value);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 普通缓存获取(String),不存在返回 null
|
||||
*
|
||||
* @param key 键
|
||||
* @return 值
|
||||
*/
|
||||
public String get(String key) {
|
||||
Object value = redisTemplate.opsForValue().get(key);
|
||||
return value != null ? value.toString() : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取 BigDecimal 值(烘箱温度用),不存在或非数字返回 null
|
||||
*
|
||||
* @param key 键
|
||||
* @return 值
|
||||
*/
|
||||
public BigDecimal getDecimal(String key) {
|
||||
String value = get(key);
|
||||
if (value == null) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
return new BigDecimal(value);
|
||||
} catch (NumberFormatException e) {
|
||||
log.warn("Redis 值非数字, key={}, value={}", key, value);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 写入 Hash 字段值(如:烘箱点位温度,key=点位编码,field=temperature)
|
||||
*
|
||||
* @param key Hash 键
|
||||
* @param field 字段
|
||||
* @param value 值(String)
|
||||
*/
|
||||
public void hset(String key, String field, Object value) {
|
||||
redisTemplate.opsForHash().put(key, field, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* 读取 Hash 字段值(String),不存在返回 null
|
||||
*
|
||||
* @param key Hash 键
|
||||
* @param field 字段
|
||||
* @return 值
|
||||
*/
|
||||
public String hget(String key, String field) {
|
||||
Object value = redisTemplate.opsForHash().get(key, field);
|
||||
return value != null ? value.toString() : null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user