| | |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.Optional; |
| | | import java.util.concurrent.atomic.AtomicReference; |
| | | import java.util.stream.Collectors; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Propagation; |
| | |
| | | saveOrUpdateBatch( |
| | | Lists.newArrayList(wishDescription, wishShareTitle, wishShareImgUrl)); |
| | | } |
| | | |
| | | /** |
| | | * 保存保证金退还 |
| | | */ |
| | | @Override |
| | | @Transactional |
| | | public void saveRefundOfDeposit(String refundOfDeposit) { |
| | | CustomConfig wishDescription = getCustomConfigByKey( |
| | | ConfigEnum.REFUND_OF_DEPOSIT.getKey()).orElseGet(() -> { |
| | | CustomConfig customConfig = new CustomConfig(); |
| | | customConfig.setConfigKey(ConfigEnum.REFUND_OF_DEPOSIT.getKey()); |
| | | customConfig.setConfigName(ConfigEnum.REFUND_OF_DEPOSIT.getKeyName()); |
| | | customConfig.setConfigType(ConfigEnum.REFUND_OF_DEPOSIT.getKeyType()); |
| | | return customConfig; |
| | | }); |
| | | wishDescription.setConfigValue(refundOfDeposit); |
| | | saveOrUpdate(wishDescription); |
| | | } |
| | | |
| | | @Override |
| | | public String getRefundOfDeposit() { |
| | | AtomicReference<String> refundOfDeposit = new AtomicReference<>(""); |
| | | getCustomConfigByKey( |
| | | ConfigEnum.REFUND_OF_DEPOSIT.getKey()).ifPresent( |
| | | customConfig -> |
| | | refundOfDeposit.set(customConfig.getConfigValue()) |
| | | ); |
| | | return refundOfDeposit.get(); |
| | | } |
| | | } |