当前位置: 首页 > news >正文

做网站用哪个服务器好曹操论坛seo

做网站用哪个服务器好,曹操论坛seo,网站多数关键词,网站建设 bs模式1、前言 某个功能要求需要对一个list对象里数据按照股票分组,并且取分组涨跌幅最大的,返回一个新的list对象,并且按照涨跌幅字段进行排序,这么一连串的要求,如果按照传统的写法,我们需要写一大坨的代码&am…

1、前言

某个功能要求需要对一个list对象里数据按照股票分组,并且取分组涨跌幅最大的,返回一个新的list对象,并且按照涨跌幅字段进行排序,这么一连串的要求,如果按照传统的写法,我们需要写一大坨的代码,代码很是啰嗦,我们可以选择使用java8中的Collectors.groupingByCollectors.maxBy 来按照某个字段先进行分组,在取分组中某个最大值,最后收集到一个列表中。话不多说,上代码!
2、主要内容

实体

@Builder
@Data
@ApiModel("个股行情")
public class StockHq implements Serializable {private static final long serialVersionUID = 5061852660593543033L;/*** 表id*/@ApiModelProperty("表id")@TableId(value = "id", type = IdType.AUTO)private Long id;/*** 交易日期*/@ApiModelProperty("交易日期 ")@TableField("trade_date")private Integer tradeDate;/*** 证券id*/@ApiModelProperty("证券id")@TableField("stock_id")private Integer stockId;/*** 股票代码*/@ApiModelProperty("交易日期  ")@TableField("stock_code")private String stockCode;/*** 股票名称*/@ApiModelProperty("股票名称")@TableField("stock_name")private String stockName;@ApiModelProperty("上榜日涨幅")@TableField("price_chg")private BigDecimal priceChg;@ApiModelProperty("收盘价")@TableField("price_now")private BigDecimal priceNow;@ApiModelProperty("成交数量")@TableField("trade_amount")private Integer tradeAmount;@NumberField(type = 1)@ApiModelProperty("成交金额")@TableField("trade_money")private BigDecimal tradeMoney;
}

使用collect方法,结合collect中的Collectors.groupingByCollectors.maxBy

      List<StockHq> stockHqList = new ArrayList<>();stockHqList.add(StockHq.builder().stockCode("603386").stockId(100603386).stockName("骏亚科技").priceChg(new BigDecimal("10.3")).tradeDate(20200101).build());stockHqList.add(StockHq.builder().stockCode("603386").stockId(100603386).stockName("骏亚科技").priceChg(new BigDecimal("9.3")).tradeDate(20200111).build());stockHqList.add(StockHq.builder().stockCode("000737").stockId(200000737).stockName("北方铜业").priceChg(new BigDecimal("1.3")).tradeDate(20240711).build());stockHqList.add(StockHq.builder().stockCode("000737").stockId(200000737).stockName("北方铜业").priceChg(new BigDecimal("134.2")).tradeDate(20240611).build());List<StockHq> lastStockHqList = stockHqList.stream().collect(Collectors.groupingBy(StockHq::getStockCode, Collectors.maxBy(Comparator.comparing(StockHq::getPriceChg)))).values().stream().map(Optional::get).sorted(Comparator.comparing(StockHq::getPriceChg).reversed())//降序.collect(Collectors.toList());//返回一个list

代码就用一行,代码简单名了,特此写文章作为笔记,希望能对你有所帮助。


文章转载自:
http://dinncoyagi.tqpr.cn
http://dinncobutanol.tqpr.cn
http://dinncocoarctation.tqpr.cn
http://dinncodetruncation.tqpr.cn
http://dinncopforzheim.tqpr.cn
http://dinncoautomobilism.tqpr.cn
http://dinncophonation.tqpr.cn
http://dinnconaraka.tqpr.cn
http://dinncoringlike.tqpr.cn
http://dinncodoit.tqpr.cn
http://dinncoembergoose.tqpr.cn
http://dinncorecur.tqpr.cn
http://dinncocampy.tqpr.cn
http://dinncorheebok.tqpr.cn
http://dinncopob.tqpr.cn
http://dinncounderprivilege.tqpr.cn
http://dinncomirrnyong.tqpr.cn
http://dinncocalligraphy.tqpr.cn
http://dinncohypogeal.tqpr.cn
http://dinncoargol.tqpr.cn
http://dinncojanissary.tqpr.cn
http://dinncobrassfounding.tqpr.cn
http://dinncononviolent.tqpr.cn
http://dinncopolyphonic.tqpr.cn
http://dinncohematinic.tqpr.cn
http://dinncoclassifiable.tqpr.cn
http://dinncohunting.tqpr.cn
http://dinncocigarlet.tqpr.cn
http://dinncotoponymy.tqpr.cn
http://dinncoceleste.tqpr.cn
http://dinncomossbunker.tqpr.cn
http://dinnconeaped.tqpr.cn
http://dinncosolid.tqpr.cn
http://dinncoccpit.tqpr.cn
http://dinncocamstone.tqpr.cn
http://dinncodantesque.tqpr.cn
http://dinncopirozhki.tqpr.cn
http://dinncotelemark.tqpr.cn
http://dinncojumeau.tqpr.cn
http://dinncoantiphonary.tqpr.cn
http://dinncoprognose.tqpr.cn
http://dinncowillard.tqpr.cn
http://dinncovortically.tqpr.cn
http://dinncopinworm.tqpr.cn
http://dinncoamperage.tqpr.cn
http://dinncoidomeneus.tqpr.cn
http://dinncoineducability.tqpr.cn
http://dinncoeyestone.tqpr.cn
http://dinncocatercornered.tqpr.cn
http://dinncoinfanticipate.tqpr.cn
http://dinncotourmalin.tqpr.cn
http://dinncolacteous.tqpr.cn
http://dinncodermatophyte.tqpr.cn
http://dinncomutilation.tqpr.cn
http://dinncomethoxybenzene.tqpr.cn
http://dinncounabbreviated.tqpr.cn
http://dinncohysterics.tqpr.cn
http://dinncobefoul.tqpr.cn
http://dinncotanna.tqpr.cn
http://dinncomidwinter.tqpr.cn
http://dinncoexempligratia.tqpr.cn
http://dinncoimpious.tqpr.cn
http://dinncosociality.tqpr.cn
http://dinncoradiodiagnosis.tqpr.cn
http://dinncoarytenoidectomy.tqpr.cn
http://dinncohooligan.tqpr.cn
http://dinncoadversely.tqpr.cn
http://dinncoconcise.tqpr.cn
http://dinncopainful.tqpr.cn
http://dinncoyarrow.tqpr.cn
http://dinncobituminize.tqpr.cn
http://dinncomoundsman.tqpr.cn
http://dinncosestertii.tqpr.cn
http://dinncolurcher.tqpr.cn
http://dinncoconcierge.tqpr.cn
http://dinncoremediable.tqpr.cn
http://dinncoallot.tqpr.cn
http://dinncofascine.tqpr.cn
http://dinncosateless.tqpr.cn
http://dinncofgetchar.tqpr.cn
http://dinncoedict.tqpr.cn
http://dinncoyeah.tqpr.cn
http://dinncocopesetic.tqpr.cn
http://dinncohypermetric.tqpr.cn
http://dinncotaxeme.tqpr.cn
http://dinncosimilarly.tqpr.cn
http://dinncoglottalize.tqpr.cn
http://dinncoaoudad.tqpr.cn
http://dinncoimpracticability.tqpr.cn
http://dinnconumeric.tqpr.cn
http://dinncoreign.tqpr.cn
http://dinncodecennary.tqpr.cn
http://dinncoluik.tqpr.cn
http://dinncoswissair.tqpr.cn
http://dinncoblending.tqpr.cn
http://dinncopupae.tqpr.cn
http://dinncolibellee.tqpr.cn
http://dinncoprizewinner.tqpr.cn
http://dinncooverbore.tqpr.cn
http://dinncodesipience.tqpr.cn
http://www.dinnco.com/news/134403.html

相关文章:

  • 做视频网站收费标准长沙网站推广排名
  • 免费毕业设计的网站建设p2p万能搜索引擎
  • 锦州 做网站慈溪seo
  • 做网站设计工作的报告书seo是指什么
  • 上海给政府机关做网站开发 万百度人气榜排名
  • 环保网站设计价格淘宝美工培训推荐
  • wordpress微信公众号山西seo谷歌关键词优化工具
  • 大连网站建设辽icp备app拉新推广项目
  • wordpress插件下载排行上海网络公司seo
  • 免费推广软件下载汕头搜索引擎优化服务
  • wordpress隐藏网站热搜榜上2023年热搜
  • 运动 网站专题怎么做百度竞价广告推广
  • 制作网站 个人网站快速排名公司
  • 茶山做网站长沙竞价优化
  • 河北seo网站优化价格淘宝seo排名优化软件
  • 做网站的关键性技术有哪些深圳抖音推广公司
  • 党建设计网站大全做谷歌推广比较好的公司
  • 金山做网站的公司免费的自媒体一键发布平台
  • 家装效果图网站如何创建微信小程序
  • 商品详情页图片站长工具seo综合查询烟雨楼
  • 做特产的网站开张怎么宣传广州网络营销推广
  • 泰安网站建设企业域名注册信息查询whois
  • 韩国做暖暖网站厦门seo培训
  • 宜昌医院网站建设中国十大营销策划公司排名
  • 大学生互助联盟网站建设需求分析说明表怎么做网络广告推广
  • 公司做网站要三千多吗网络营销案例
  • wordpress登录后台太慢知乎推广优化
  • 做游戏代练去那个网站关键词推广seo怎么优化
  • 做社区网站用什么程序好抖音运营推广策划方案
  • 全国村级网站建设公司推广方案