Commit 9489fc884224621d8482bd542ef6c471f0756faa
1 parent
9fa70a6e
feature(*): 设置bug修复
- 设置bug修复
Showing
8 changed files
with
14 additions
and
4 deletions
fw-valhalla-domain/src/main/java/cn/fw/valhalla/domain/vo/setting/SettingVO.java
... | ... | @@ -45,7 +45,7 @@ public class SettingVO { |
45 | 45 | SettingVO vo = new SettingVO(); |
46 | 46 | vo.setId(detail.getId()); |
47 | 47 | vo.setDetailValue(detail.getDetailValue()); |
48 | - if (SettingTypeEnum.REVISE_RATIO.equals(detail.getType()) || SettingTypeEnum.RETENTION_RATIO.equals(detail.getType())) { | |
48 | + if (SettingTypeEnum.MINIMUM_CONVERSION_RATE.equals(detail.getType()) || SettingTypeEnum.REVISE_RATIO.equals(detail.getType()) || SettingTypeEnum.RETENTION_RATIO.equals(detail.getType())) { | |
49 | 49 | vo.setDetailValue(detail.getDetailValue() / 100); |
50 | 50 | } |
51 | 51 | vo.setSettingId(detail.getSettingId()); | ... | ... |
fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/setting/strategy/AbstractSettingStrategy.java
... | ... | @@ -23,7 +23,6 @@ import org.springframework.beans.factory.annotation.Value; |
23 | 23 | import org.springframework.context.ApplicationEventPublisher; |
24 | 24 | import org.springframework.data.redis.core.BoundHashOperations; |
25 | 25 | import org.springframework.data.redis.core.StringRedisTemplate; |
26 | -import org.springframework.transaction.annotation.Transactional; | |
27 | 26 | import org.springframework.util.Assert; |
28 | 27 | import org.springframework.util.CollectionUtils; |
29 | 28 | |
... | ... | @@ -132,7 +131,6 @@ public abstract class AbstractSettingStrategy implements SettingStrategy { |
132 | 131 | * @param list |
133 | 132 | * @return |
134 | 133 | */ |
135 | - @Transactional(rollbackFor = Exception.class) | |
136 | 134 | protected boolean saveOrUpdate(final FollowTypeEnum type, final Long groupId, final List<SettingDTO> list) { |
137 | 135 | String lockKey = getLockKey(groupId, type); |
138 | 136 | Pair<Boolean, RLock> pair = distributedLocker.tryLock(lockKey, TimeUnit.SECONDS, 0, 15); |
... | ... | @@ -161,7 +159,7 @@ public abstract class AbstractSettingStrategy implements SettingStrategy { |
161 | 159 | detail.setBrandId(brandId); |
162 | 160 | detail.setId(settingDTO.getId()); |
163 | 161 | detail.setDetailValue(settingDTO.getDetailValue()); |
164 | - if (SettingTypeEnum.REVISE_RATIO.getValue().equals(settingDTO.getType()) || SettingTypeEnum.RETENTION_RATIO.getValue().equals(settingDTO.getType())) { | |
162 | + if (SettingTypeEnum.MINIMUM_CONVERSION_RATE.equals(detail.getType()) || SettingTypeEnum.REVISE_RATIO.getValue().equals(settingDTO.getType()) || SettingTypeEnum.RETENTION_RATIO.getValue().equals(settingDTO.getType())) { | |
165 | 163 | detail.setDetailValue(settingDTO.getDetailValue() * 100); |
166 | 164 | } |
167 | 165 | detail.setType(SettingTypeEnum.ofValue(settingDTO.getType())); | ... | ... |
fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/setting/strategy/SettingStrategy.java
... | ... | @@ -4,6 +4,7 @@ import cn.fw.valhalla.domain.dto.SettingDTO; |
4 | 4 | import cn.fw.valhalla.domain.enums.FollowTypeEnum; |
5 | 5 | import cn.fw.valhalla.domain.enums.SettingTypeEnum; |
6 | 6 | import cn.fw.valhalla.domain.vo.setting.SettingVO; |
7 | +import org.springframework.transaction.annotation.Transactional; | |
7 | 8 | |
8 | 9 | import java.util.List; |
9 | 10 | |
... | ... | @@ -42,6 +43,7 @@ public interface SettingStrategy { |
42 | 43 | * @param groupId |
43 | 44 | * @return |
44 | 45 | */ |
46 | + @Transactional(rollbackFor = Exception.class) | |
45 | 47 | boolean save(List<SettingDTO> list, Long groupId); |
46 | 48 | |
47 | 49 | /** | ... | ... |
fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/setting/strategy/impl/ACSetting.java
... | ... | @@ -7,6 +7,7 @@ import cn.fw.valhalla.domain.vo.setting.SettingVO; |
7 | 7 | import cn.fw.valhalla.service.bus.setting.strategy.AbstractSettingStrategy; |
8 | 8 | import lombok.extern.slf4j.Slf4j; |
9 | 9 | import org.springframework.stereotype.Component; |
10 | +import org.springframework.transaction.annotation.Transactional; | |
10 | 11 | |
11 | 12 | import java.util.Arrays; |
12 | 13 | import java.util.List; |
... | ... | @@ -33,6 +34,7 @@ public class ACSetting extends AbstractSettingStrategy { |
33 | 34 | } |
34 | 35 | |
35 | 36 | @Override |
37 | + @Transactional(rollbackFor = Exception.class) | |
36 | 38 | public boolean save(List<SettingDTO> list, Long groupId) { |
37 | 39 | return this.saveOrUpdate(getFollowType(), groupId, list); |
38 | 40 | } | ... | ... |
fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/setting/strategy/impl/FMSetting.java
... | ... | @@ -7,6 +7,7 @@ import cn.fw.valhalla.domain.vo.setting.SettingVO; |
7 | 7 | import cn.fw.valhalla.service.bus.setting.strategy.AbstractSettingStrategy; |
8 | 8 | import lombok.extern.slf4j.Slf4j; |
9 | 9 | import org.springframework.stereotype.Component; |
10 | +import org.springframework.transaction.annotation.Transactional; | |
10 | 11 | |
11 | 12 | import java.util.List; |
12 | 13 | |
... | ... | @@ -30,6 +31,7 @@ public class FMSetting extends AbstractSettingStrategy { |
30 | 31 | } |
31 | 32 | |
32 | 33 | @Override |
34 | + @Transactional(rollbackFor = Exception.class) | |
33 | 35 | public boolean save(List<SettingDTO> list, Long groupId) { |
34 | 36 | return saveOrUpdate(getFollowType(), groupId, list); |
35 | 37 | } | ... | ... |
fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/setting/strategy/impl/GeneralSetting.java
... | ... | @@ -7,6 +7,7 @@ import cn.fw.valhalla.domain.vo.setting.SettingVO; |
7 | 7 | import cn.fw.valhalla.service.bus.setting.strategy.AbstractSettingStrategy; |
8 | 8 | import lombok.extern.slf4j.Slf4j; |
9 | 9 | import org.springframework.stereotype.Component; |
10 | +import org.springframework.transaction.annotation.Transactional; | |
10 | 11 | |
11 | 12 | import java.util.List; |
12 | 13 | |
... | ... | @@ -30,6 +31,7 @@ public class GeneralSetting extends AbstractSettingStrategy { |
30 | 31 | } |
31 | 32 | |
32 | 33 | @Override |
34 | + @Transactional(rollbackFor = Exception.class) | |
33 | 35 | public boolean save(List<SettingDTO> list, Long groupId) { |
34 | 36 | return saveOrUpdate(getFollowType(), groupId, list); |
35 | 37 | } | ... | ... |
fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/setting/strategy/impl/IRSetting.java
... | ... | @@ -7,6 +7,7 @@ import cn.fw.valhalla.domain.vo.setting.SettingVO; |
7 | 7 | import cn.fw.valhalla.service.bus.setting.strategy.AbstractSettingStrategy; |
8 | 8 | import lombok.extern.slf4j.Slf4j; |
9 | 9 | import org.springframework.stereotype.Component; |
10 | +import org.springframework.transaction.annotation.Transactional; | |
10 | 11 | |
11 | 12 | import java.util.List; |
12 | 13 | |
... | ... | @@ -30,6 +31,7 @@ public class IRSetting extends AbstractSettingStrategy { |
30 | 31 | } |
31 | 32 | |
32 | 33 | @Override |
34 | + @Transactional(rollbackFor = Exception.class) | |
33 | 35 | public boolean save(List<SettingDTO> list, Long groupId) { |
34 | 36 | return saveOrUpdate(getFollowType(), groupId, list); |
35 | 37 | } | ... | ... |
fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/setting/strategy/impl/RMSetting.java
... | ... | @@ -7,6 +7,7 @@ import cn.fw.valhalla.domain.vo.setting.SettingVO; |
7 | 7 | import cn.fw.valhalla.service.bus.setting.strategy.AbstractSettingStrategy; |
8 | 8 | import lombok.extern.slf4j.Slf4j; |
9 | 9 | import org.springframework.stereotype.Component; |
10 | +import org.springframework.transaction.annotation.Transactional; | |
10 | 11 | |
11 | 12 | import java.util.List; |
12 | 13 | |
... | ... | @@ -30,6 +31,7 @@ public class RMSetting extends AbstractSettingStrategy { |
30 | 31 | } |
31 | 32 | |
32 | 33 | @Override |
34 | + @Transactional(rollbackFor = Exception.class) | |
33 | 35 | public boolean save(List<SettingDTO> list, Long groupId) { |
34 | 36 | return saveOrUpdate(getFollowType(), groupId, list); |
35 | 37 | } | ... | ... |