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

什么网站可以做家禽交易长沙电商优化

什么网站可以做家禽交易,长沙电商优化,网站开发搜索功能怎么实现,网页模板素材网站目录 事件起因环境和工具解决办法结束语 事件起因 在写一个市级的项目时,遇到了一个问题,这个项目涉及的数据内容非常大,光是数据库文件的大小就已经达到了12G,数据的规模大致是在百万级的,光是我这次参与处理的数据就…

目录

    • 事件起因
    • 环境和工具
    • 解决办法
    • 结束语

事件起因

在写一个市级的项目时,遇到了一个问题,这个项目涉及的数据内容非常大,光是数据库文件的大小就已经达到了12G,数据的规模大致是在百万级的,光是我这次参与处理的数据就有10w(最后我跑出来的数据是10w,但处理的数据不止如此)

本次运行的数据库,因为我的盘大小不够,我还额外装了一块2T硬盘
在这里插入图片描述
在处理这个项目的数据的过程中有一个 将数据存在原来多个表的同一个物料的信息汇总起来然后放入我所要进行存储的一张表中去,大致过程是:物料有唯一的sn码,然后每个阶段物料都有进行流转会产生业务流程的数据,这个数据分别在不同的表中,比如说物料入库,出库,入下级仓库,出下级仓库,入暂存点,出暂存点和安装,每个阶段都会产生业务数据信息,然后我要将每个阶段的信息进行汇总,(每个阶段的信息都在不同的数据库表中,单表的数据量都很大,上10w级)此时使用连表在数据库中去执行这样的效率比较低下,所以采用的是在每个阶段去查询满足查询条件的当前阶段的数据,然后在java的代码中去处理这些数据,让相同的物料编码sn去将这些实体属性的信息合并,
下面是这个实体的属性的展示,这个实体目前是有130多个属性值:(各阶段分别占有10多个属性)

在这里插入图片描述
在这里插入图片描述
现在各个阶段都查到了对应的数据,比如说,入库阶段有入库sn和入库相关信息,出库阶段有出库sn和出库相关信息,现要做的是将各个阶段同一sn的所有信息合并

环境和工具

jdk1.8
maven
idea2023

解决办法

在处理这个情况的方法在初步就有了,比如说,双重循环这两个列表,去遍历每一个对象,然后判断这些对象的sn是否相同,但是这样已经匹配的sn对象也会继续拿到其他的对象中去匹配,效率比较低下

有两个对象列表 List snInfo1 和List snInfo2
现优化这种情况,将其中的一个列表对象修改为map,其中的属性sn作为key,对应的每个对象作为value,代码如下:

/*** 对象复制到对象  source是之前就有的列表对象*/private List<SnInfoExtend> copyListToListBySn(List<SnInfoExtend> source, List<SnInfoExtend> source2){// 创建一个 Map,将 sn 作为键,Market 对象作为值Map<String, SnInfoExtend> snMap = source.stream().collect(Collectors.toMap(SnInfoExtend::getSourceSn, market -> market, (existing, replacement) -> replacement));// 合并 snList2 中的数据到 snList  关于下面那儿为什么要用toUpperCase: 因为 前面的流程 sn全是大写字母,到了安装的时候却变为了小写字母source2.forEach(market -> snMap.merge(market.getSourceSn().toUpperCase().trim(), market, (existing, replacement) -> {//仓库出库,这个比较特殊  只能根据箱码进行更新 箱码的话,肯定是会重复的//入暂存点  8个字段更新if(replacement.getPointRecName() != null){existing.setPointRecName(replacement.getPointRecName());}if(replacement.getPointRecCompany() != null){existing.setPointRecCompany(replacement.getPointRecCompany());}if(replacement.getPointRecPhonePro() != null){existing.setPointRecPhonePro(replacement.getPointRecPhonePro());}if(replacement.getPointShipNamePro() != null){existing.setPointShipNamePro(replacement.getPointShipNamePro());}if(replacement.getPointrRecAddPro() != null){existing.setPointrRecAddPro(replacement.getPointrRecAddPro());}if(replacement.getRecBusinessTypePoint() != null){existing.setRecBusinessTypePoint(replacement.getRecBusinessTypePoint());}if(replacement.getRecTimePoint() != null){existing.setRecTimePoint(replacement.getRecTimePoint());existing.setUpdatedTime(replacement.getRecTimePoint());}if(replacement.getPointRecProblem() != null){existing.setPointRecProblem(replacement.getPointRecProblem());}//出暂存点和领料//出暂存点if(replacement.getPointShipName() != null){existing.setPointShipName(replacement.getPointShipName());}if(replacement.getPointShipCompany() != null){existing.setPointShipCompany(replacement.getPointShipCompany());}if(replacement.getPointShipPhonePro() != null){existing.setPointShipPhonePro(replacement.getPointShipPhonePro());}if(replacement.getShipTimePoint() != null){existing.setShipTimePoint(replacement.getShipTimePoint());existing.setUpdatedTime(replacement.getShipTimePoint());}if(replacement.getShipBusinessTypePoint() != null){existing.setShipBusinessTypePoint(replacement.getShipBusinessTypePoint());}//领料if(replacement.getTeamRecName() != null){existing.setTeamRecName(replacement.getTeamRecName());}if(replacement.getTeamRecPhonePro() != null){existing.setTeamRecPhonePro(replacement.getTeamRecPhonePro());}if(replacement.getRecTimeTeam() != null){existing.setRecTimeTeam(replacement.getRecTimeTeam());existing.setUpdatedTime(replacement.getRecTimeTeam());}if(replacement.getTeamRecNamePro() != null){existing.setTeamRecNamePro(replacement.getTeamRecNamePro());}if(replacement.getTeamRecCropping() != null){existing.setTeamRecCropping(replacement.getTeamRecCropping());}if(replacement.getRecBusinessTypeTeam() != null){existing.setRecBusinessTypeTeam(replacement.getRecBusinessTypeTeam());}//安装if(replacement.getTeamShipName() != null){existing.setTeamShipName(replacement.getTeamShipName());}if(replacement.getTeamShipPhonePro() != null){existing.setTeamShipPhonePro(replacement.getTeamShipPhonePro());}if(replacement.getTeamShipNamePro() != null){existing.setTeamShipNamePro(replacement.getTeamShipNamePro());}if(replacement.getShipTimeTeam() != null){existing.setShipTimeTeam(replacement.getShipTimeTeam());existing.setUpdatedTime(replacement.getShipTimeTeam());}if(replacement.getTeamShipAdd() != null){existing.setTeamShipAdd(replacement.getTeamShipAdd());}if(replacement.getTeamShipProblem() != null){existing.setTeamShipProblem(replacement.getTeamShipProblem());}if(replacement.getTransferTime() != null){existing.setTransferTime(replacement.getTransferTime());existing.setUpdatedTime(replacement.getTransferTime());}if(replacement.getShipBusinessTypeTeam() != null){existing.setShipBusinessTypeTeam(replacement.getShipBusinessTypeTeam());}return existing;}));// 最终的合并结果在 snList 中List<SnInfoExtend> mergedList = new ArrayList<>(snMap.values());return mergedList;}

上面已经将这个过程封装了为了一个方法,
该方法的效果为:传入两个列表对象,将第一个对象转换为一个map,有一点需要注意的地方,这儿会将snSource这个字段的字符串的字母转换为大写字母toUpperCase,且去除收尾的空格trim(),若不需要自行去代码里面去修改

结束语

若是对你有所帮助的话,希望能获得你的 点赞、评论、收藏,这将是对我很大的鼓励!!! 这对我真的很重要!!!
蟹蟹٩(‘ω’)و


文章转载自:
http://dinncohaustellum.tqpr.cn
http://dinncohydropsychotherapy.tqpr.cn
http://dinncowellsian.tqpr.cn
http://dinncocarbonic.tqpr.cn
http://dinncoisosporous.tqpr.cn
http://dinncoprotest.tqpr.cn
http://dinncolev.tqpr.cn
http://dinncogore.tqpr.cn
http://dinncofracture.tqpr.cn
http://dinncodichotomous.tqpr.cn
http://dinncoimbosom.tqpr.cn
http://dinncopertly.tqpr.cn
http://dinncoelectrolier.tqpr.cn
http://dinncokiloton.tqpr.cn
http://dinncorhinoscope.tqpr.cn
http://dinncodegenerative.tqpr.cn
http://dinncofinancing.tqpr.cn
http://dinncohysteresis.tqpr.cn
http://dinncosamink.tqpr.cn
http://dinncobrighish.tqpr.cn
http://dinncohy.tqpr.cn
http://dinncosuricate.tqpr.cn
http://dinncosardine.tqpr.cn
http://dinncobari.tqpr.cn
http://dinncoassail.tqpr.cn
http://dinncohydrops.tqpr.cn
http://dinncoflintify.tqpr.cn
http://dinncojumbotron.tqpr.cn
http://dinncoleucopoiesis.tqpr.cn
http://dinncoderogatory.tqpr.cn
http://dinncoganefo.tqpr.cn
http://dinncowesternmost.tqpr.cn
http://dinncotumbledown.tqpr.cn
http://dinncoabusiveness.tqpr.cn
http://dinncojesuitize.tqpr.cn
http://dinncomulticentre.tqpr.cn
http://dinncogem.tqpr.cn
http://dinncoforelock.tqpr.cn
http://dinncoguideline.tqpr.cn
http://dinncophylon.tqpr.cn
http://dinncoderealization.tqpr.cn
http://dinncodobeying.tqpr.cn
http://dinnconeoplatonism.tqpr.cn
http://dinncohotspring.tqpr.cn
http://dinncofortuneteller.tqpr.cn
http://dinncotensegrity.tqpr.cn
http://dinncofrow.tqpr.cn
http://dinncoxenodocheum.tqpr.cn
http://dinncoparricidal.tqpr.cn
http://dinncolegioned.tqpr.cn
http://dinncoposset.tqpr.cn
http://dinncounbelievably.tqpr.cn
http://dinncojurant.tqpr.cn
http://dinncoprooflike.tqpr.cn
http://dinncophlogiston.tqpr.cn
http://dinncorunny.tqpr.cn
http://dinncofallboard.tqpr.cn
http://dinncoiconodulic.tqpr.cn
http://dinncomilsat.tqpr.cn
http://dinncosupranormal.tqpr.cn
http://dinncomannerist.tqpr.cn
http://dinncofranco.tqpr.cn
http://dinncoblazer.tqpr.cn
http://dinncohomocercy.tqpr.cn
http://dinncotranslatese.tqpr.cn
http://dinncocockade.tqpr.cn
http://dinncorazorbill.tqpr.cn
http://dinncotorsional.tqpr.cn
http://dinncochudder.tqpr.cn
http://dinncodarpanet.tqpr.cn
http://dinncoinveterate.tqpr.cn
http://dinncophotoproduction.tqpr.cn
http://dinncolimitless.tqpr.cn
http://dinncojocose.tqpr.cn
http://dinncoagglomerative.tqpr.cn
http://dinncoantoinette.tqpr.cn
http://dinncomelodia.tqpr.cn
http://dinncoendosteal.tqpr.cn
http://dinncoanybody.tqpr.cn
http://dinncowen.tqpr.cn
http://dinncodiscommendable.tqpr.cn
http://dinncomajolica.tqpr.cn
http://dinncolacker.tqpr.cn
http://dinncomelungeon.tqpr.cn
http://dinncorequire.tqpr.cn
http://dinncobreconshire.tqpr.cn
http://dinncoastrobotany.tqpr.cn
http://dinncoeo.tqpr.cn
http://dinncoadvantageous.tqpr.cn
http://dinncopolenta.tqpr.cn
http://dinncoextrarenal.tqpr.cn
http://dinncothrong.tqpr.cn
http://dinncoprecancel.tqpr.cn
http://dinncohypersexual.tqpr.cn
http://dinncomicroscale.tqpr.cn
http://dinncosestertii.tqpr.cn
http://dinncocrewman.tqpr.cn
http://dinncopoltroonery.tqpr.cn
http://dinncoinexecution.tqpr.cn
http://dinncoconnivence.tqpr.cn
http://www.dinnco.com/news/143308.html

相关文章:

  • 深圳外贸建站网络推广哪家好怎么优化网站关键词排名
  • 做网站每个月可以赚多少湖南手机版建站系统开发
  • 作文生成器网站余姚seo智能优化
  • 辅助设计软件有哪些window优化大师官网
  • 自己做网站seo优化竞价托管优化公司
  • 网站页面在线设计百度怎么免费推广
  • 玉树营销网站建设小升初最好的补课机构排行榜
  • 网站建设与设计实训总结今日最新军事新闻
  • 安阳网站建设网络营销策划推广方案
  • 哪些网络公司可以做机票预订网站专业营销团队公司
  • 那个网站制作比较好移动端seo关键词优化
  • 北京网站推广价格推动高质量发展
  • 上传网站步骤个人怎么做互联网推广平台
  • 上海学习网站建设seo常见优化技术
  • 做快递单的网站会不会是骗人的百度提交入口
  • 长沙网站建站公司营销活动
  • 网站建设 软件有哪些识图搜索在线 照片识别
  • 网站引导页怎么做.个人免费域名注册网站
  • 现在帮人做网站赚钱吗网址创建
  • 网做英文网站官网优化包括什么内容
  • 便宜电商网站建设企业网站营销优缺点
  • 网站建设培训相关资料软文代写多少钱一篇
  • 电子商务网站建设公司阜阳seo
  • 网站开发团队人数构成bt磁力兔子引擎
  • 苏州产品推广公司兰州模板网站seo价格
  • 网站建设如何选择域名怎么制作网站教程手机
  • 建站网站关键词大全比较好的网站建设网站
  • 聊城做网站多少钱优化关键词规则
  • 美食网站开发报告台湾新闻最新消息今天
  • 网站的建设与管理系统百度推广客服工作怎么样