This commit is contained in:
van
2026-04-08 16:36:20 +08:00
parent 2d4f933791
commit c9876df3de
5 changed files with 44 additions and 19 deletions

View File

@@ -1057,22 +1057,30 @@ public class JDOrderController extends BaseController {
}
try {
// 构建配置键名
String configKey = CONFIG_KEY_PREFIX + distributionMark.trim();
// 从系统配置中获取接收人列表
String trimmed = distributionMark.trim();
String configKey = CONFIG_KEY_PREFIX + trimmed;
String configValue = sysConfigService.selectConfigByKey(configKey);
if (StringUtils.hasText(configValue)) {
// 清理配置值(去除空格)
String touser = configValue.trim().replaceAll(",\\s+", ",");
logger.info("从配置获取接收人列表 - 分销标识: {}, 配置键: {}, 接收人: {}",
distributionMark, configKey, touser);
return touser;
} else {
logger.debug("未找到接收人配置 - 分销标识: {}, 配置键: {}", distributionMark, configKey);
return null;
}
if (trimmed.startsWith("F-") || "F".equals(trimmed)) {
if (!trimmed.equals("F")) {
String fallbackKey = CONFIG_KEY_PREFIX + "F";
String fallbackVal = sysConfigService.selectConfigByKey(fallbackKey);
if (StringUtils.hasText(fallbackVal)) {
String touser = fallbackVal.trim().replaceAll(",\\s+", ",");
logger.info("从配置获取接收人列表F 系回退) - 分销标识: {}, 配置键: {}, 接收人: {}",
distributionMark, fallbackKey, touser);
return touser;
}
}
}
logger.debug("未找到接收人配置 - 分销标识: {}, 配置键: {}", distributionMark, configKey);
return null;
} catch (Exception e) {
logger.error("获取接收人配置失败 - 分销标识: {}, 错误: {}", distributionMark, e.getMessage(), e);
return null;