알림문제 수정
This commit is contained in:
@@ -57,15 +57,20 @@ public class StrategyService {
|
||||
|
||||
try {
|
||||
String strategyName = entity.getName() != null ? entity.getName() : dto.getName();
|
||||
String buyJson = dto.getBuyCondition() != null
|
||||
? objectMapper.writeValueAsString(dto.getBuyCondition()) : null;
|
||||
String sellJson = dto.getSellCondition() != null
|
||||
? objectMapper.writeValueAsString(dto.getSellCondition()) : null;
|
||||
if (buyJson != null && sellJson != null) {
|
||||
sellJson = dslTimeframeNormalizer.alignSellStartTimeframeToBuy(buyJson, sellJson);
|
||||
}
|
||||
entity.setBuyConditionJson(
|
||||
dto.getBuyCondition() != null
|
||||
? dslTimeframeNormalizer.normalizeJson(
|
||||
objectMapper.writeValueAsString(dto.getBuyCondition()), strategyName)
|
||||
buyJson != null
|
||||
? dslTimeframeNormalizer.normalizeJson(buyJson, strategyName)
|
||||
: null);
|
||||
entity.setSellConditionJson(
|
||||
dto.getSellCondition() != null
|
||||
? dslTimeframeNormalizer.normalizeJson(
|
||||
objectMapper.writeValueAsString(dto.getSellCondition()), strategyName)
|
||||
sellJson != null
|
||||
? dslTimeframeNormalizer.normalizeJson(sellJson, strategyName)
|
||||
: null);
|
||||
} catch (Exception e) {
|
||||
log.warn("전략 DSL 직렬화 실패: {}", e.getMessage());
|
||||
@@ -93,9 +98,19 @@ public class StrategyService {
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
if (entity.getSellConditionJson() != null && !entity.getSellConditionJson().isBlank()) {
|
||||
String fixed = dslTimeframeNormalizer.normalizeJson(
|
||||
entity.getSellConditionJson(), entity.getName());
|
||||
String sellJson = entity.getSellConditionJson();
|
||||
if (entity.getBuyConditionJson() != null && !entity.getBuyConditionJson().isBlank()
|
||||
&& sellJson != null && !sellJson.isBlank()) {
|
||||
String aligned = dslTimeframeNormalizer.alignSellStartTimeframeToBuy(
|
||||
entity.getBuyConditionJson(), sellJson);
|
||||
if (!aligned.equals(sellJson)) {
|
||||
entity.setSellConditionJson(aligned);
|
||||
sellJson = aligned;
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
if (sellJson != null && !sellJson.isBlank()) {
|
||||
String fixed = dslTimeframeNormalizer.normalizeJson(sellJson, entity.getName());
|
||||
if (!fixed.equals(entity.getSellConditionJson())) {
|
||||
entity.setSellConditionJson(fixed);
|
||||
changed = true;
|
||||
|
||||
Reference in New Issue
Block a user