|
@@ -2,9 +2,11 @@ package com.dayou.service.impl;
|
|
|
|
|
|
import com.dayou.common.BaseEntity;
|
|
|
import com.dayou.entity.BrokerageMarketerRatio;
|
|
|
+import com.dayou.exception.ErrorCode;
|
|
|
import com.dayou.mapper.BrokerageMarketerRatioMapper;
|
|
|
import com.dayou.service.IBrokerageMarketerRatioService;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
+import com.dayou.vo.MarketerRatioVO;
|
|
|
import com.google.common.cache.LoadingCache;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
@@ -14,6 +16,9 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
import java.util.List;
|
|
|
+import java.util.regex.Pattern;
|
|
|
+
|
|
|
+import static com.dayou.common.Constants.MATH_REGULAR;
|
|
|
|
|
|
/**
|
|
|
* <p>
|
|
@@ -29,10 +34,14 @@ public class BrokerageMarketerRatioServiceImpl extends ServiceImpl<BrokerageMark
|
|
|
@Autowired
|
|
|
private LoadingCache<String,BigDecimal> marketerRatioCache;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private BrokerageMarketerRatioMapper brokerageMarketerRatioMapper;
|
|
|
+
|
|
|
@Override
|
|
|
@SuppressWarnings("unchecked")
|
|
|
- public Page<BrokerageMarketerRatio> selectPage(Page page,BrokerageMarketerRatio brokerageMarketerRatio){
|
|
|
- return this.page(page, new QueryWrapper<BrokerageMarketerRatio>(brokerageMarketerRatio));
|
|
|
+ public Page<MarketerRatioVO> selectPage(Page page, BrokerageMarketerRatio brokerageMarketerRatio){
|
|
|
+ Page<MarketerRatioVO> xPage = brokerageMarketerRatioMapper.xPage(page,brokerageMarketerRatio);
|
|
|
+ return xPage;
|
|
|
}
|
|
|
|
|
|
|
|
@@ -48,7 +57,7 @@ public class BrokerageMarketerRatioServiceImpl extends ServiceImpl<BrokerageMark
|
|
|
|
|
|
@Override
|
|
|
public Boolean update(BrokerageMarketerRatio brokerageMarketerRatio){
|
|
|
- boolean b = this.updateById(brokerageMarketerRatio);
|
|
|
+ boolean b = this.saveOrUpdate(brokerageMarketerRatio);
|
|
|
this.cacheMarketerRatio();
|
|
|
return b;
|
|
|
}
|
|
@@ -62,7 +71,7 @@ public class BrokerageMarketerRatioServiceImpl extends ServiceImpl<BrokerageMark
|
|
|
@Override
|
|
|
public void cacheMarketerRatio(){
|
|
|
List<BrokerageMarketerRatio> list = this.list(new LambdaQueryWrapper<BrokerageMarketerRatio>()
|
|
|
- .eq(BaseEntity::getDeleted, Boolean.FALSE));
|
|
|
+ .eq(BaseEntity::getDeleted, Boolean.FALSE).isNotNull(BrokerageMarketerRatio::getRatio));
|
|
|
list.stream().forEach(x->{
|
|
|
marketerRatioCache.put(x.mergeKey(),x.getRatio());
|
|
|
});
|