Commit b08a229e authored by 332784038@qq.com's avatar 332784038@qq.com Committed by wux

参数类型bug修复

parent 793d34cd
...@@ -9,17 +9,14 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; ...@@ -9,17 +9,14 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import java.time.LocalDate; import java.time.LocalDate;
import java.util.Arrays; import java.util.*;
import java.util.Collections;
import java.util.Optional;
import java.util.Set;
import java.util.function.Consumer; import java.util.function.Consumer;
@Mapper @Mapper
public interface CurrencyRateMapper extends AbstractMapper<CurrencyRateDO> { public interface CurrencyRateMapper extends AbstractMapper<CurrencyRateDO> {
default PageResult<CurrencyRateDO> selectPage(CurrencyRateQueryParamVO param) { default PageResult<CurrencyRateDO> selectPage(CurrencyRateQueryParamVO param) {
LocalDate now = LocalDate.now(); LocalDate now = LocalDate.now();
Set<Long> countries = Optional.ofNullable(param.getCountries()).orElse(Collections.emptySet()); List<Long> countries = Optional.ofNullable(param.getCountries()).orElse(Collections.emptyList());
Consumer<LambdaQueryWrapper<CurrencyRateDO>> countriesQuery = it -> Consumer<LambdaQueryWrapper<CurrencyRateDO>> countriesQuery = it ->
countries.stream().limit(5).forEach(id -> countries.stream().limit(5).forEach(id ->
it.or().apply("json_contains(`countries`, {0})", String.valueOf(id))); it.or().apply("json_contains(`countries`, {0})", String.valueOf(id)));
......
...@@ -8,6 +8,8 @@ import org.hibernate.validator.constraints.Length; ...@@ -8,6 +8,8 @@ import org.hibernate.validator.constraints.Length;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDate; import java.time.LocalDate;
import java.util.Collection;
import java.util.List;
import java.util.Set; import java.util.Set;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY;
...@@ -23,7 +25,7 @@ public class CurrencyRateQueryParamVO extends PageParam { ...@@ -23,7 +25,7 @@ public class CurrencyRateQueryParamVO extends PageParam {
@ApiModelProperty(value = "国家(最多五个)") @ApiModelProperty(value = "国家(最多五个)")
// @Length(max = 5) // @Length(max = 5)
private Set<Long> countries; private List<Long> countries;
@ApiModelProperty(value = "状态") @ApiModelProperty(value = "状态")
private Boolean expired; private Boolean expired;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment