Merge remote-tracking branch 'gitea/master'
This commit is contained in:
@@ -22,6 +22,7 @@ public interface XBFundMapper {
|
||||
int batchSave(List<FundInfo> list);
|
||||
|
||||
List<XbFundList> queryFundList(@Param("type") Integer type);
|
||||
List<XbFundList> queryAllFundList();
|
||||
|
||||
int addCounts(List<XbFundCount> list);
|
||||
|
||||
|
||||
@@ -13,6 +13,8 @@ import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
@@ -33,6 +35,7 @@ import java.util.stream.Collectors;
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
@RestController
|
||||
public class FundCountJob {
|
||||
|
||||
private final FundService fundService;
|
||||
@@ -45,7 +48,7 @@ public class FundCountJob {
|
||||
return;
|
||||
}
|
||||
log.info("==========================[基金统计] 基金统计定时任务启动!==========================");
|
||||
List<XbFundList> lists = fundService.queryFundList(null);
|
||||
List<XbFundList> lists = fundService.queryFundList();
|
||||
if (CollectionUtils.isEmpty(lists)) {
|
||||
return;
|
||||
}
|
||||
@@ -71,6 +74,7 @@ public class FundCountJob {
|
||||
}
|
||||
|
||||
@Scheduled(cron = "0 40 14 * * ? ")
|
||||
@PostMapping("/ddddd")
|
||||
public void countFundInWeek() throws Exception {
|
||||
log.info("==========================[基金统计] 基金本周涨跌幅消息发送定时任务启动!==========================");
|
||||
List<XbFundCount> xbFundCounts = fundService.queryFundCountInWeek();
|
||||
@@ -81,7 +85,7 @@ public class FundCountJob {
|
||||
Map<String, List<XbFundCount>> map = xbFundCounts.stream().collect(Collectors.groupingBy(XbFundCount::getCode));
|
||||
map.forEach((k, v) -> {
|
||||
List<XbFundCount> fundCounts = map.get(k);
|
||||
if (CollectionUtils.isNotEmpty(fundCounts)) {
|
||||
if (CollectionUtils.isEmpty(fundCounts)) {
|
||||
return;
|
||||
}
|
||||
List<BigDecimal> decimals = fundCounts.stream().map(XbFundCount::getChange).collect(Collectors.toList());
|
||||
|
||||
@@ -31,6 +31,7 @@ public interface FundService {
|
||||
* @return
|
||||
*/
|
||||
List<XbFundList> queryFundList(Integer type);
|
||||
List<XbFundList> queryFundList();
|
||||
|
||||
int addCounts(List<XbFundCount> list);
|
||||
|
||||
|
||||
@@ -99,6 +99,11 @@ public class FundServiceImpl implements FundService{
|
||||
return xbFundMapper.queryFundList(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<XbFundList> queryFundList() {
|
||||
return xbFundMapper.queryAllFundList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int addCounts(List<XbFundCount> list) {
|
||||
return xbFundMapper.addCounts(list);
|
||||
|
||||
@@ -54,6 +54,9 @@
|
||||
select * from xb_fund_count
|
||||
where update_time between NOW() - INTERVAL 7 DAY and NOW()
|
||||
</select>
|
||||
<select id="queryAllFundList" resultMap="XbFundListMap" parameterType="Integer">
|
||||
select * from xb_fund_list where 1=1
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user