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

在华图做网站编辑人教版优化设计电子书

在华图做网站编辑,人教版优化设计电子书,做暧昧在线网站,怎么做网站统计1.删除主表相关子表所有记录 2.再保存一次前端传来的记录 3.如果子表是通过先生成空记录,再put修改模式,可以在执行1和2两步后再拿模板集合和当前现有子表集合套两个for循环对比判断,count记录模板记录和子表记录每次循环重合次数&#xff…

1.删除主表相关子表所有记录

2.再保存一次前端传来的记录

3.如果子表是通过先生成空记录,再put修改模式,可以在执行1和2两步后再拿模板集合和当前现有子表集合套两个for循环对比判断,count记录模板记录和子表记录每次循环重合次数,当发送现有子表中没有模板的情况,也就是count==0,就在一层循环再创建一个模板对象,达到效果:原有空记录不会因为进来时全删除的操作而抹去,因为空记录是页面动态效果的一部分

    /*** 更新** @param documentEntities* @return*/@PutMapping("/reference/{projectStageId}/{typeListCode}")@Transactional@Operation(summary = "更新")public ActionResult referenceUpdate(@PathVariable String projectStageId,@RequestBody @Valid List<DocumentListVO> documentEntities ) throws DataException {UserInfo userInfo = userProvider.get();//删除原有所有记录LambdaQueryWrapper<ListDocumentFileEntity> wrapper = new LambdaQueryWrapper<>();wrapper.eq(ListDocumentFileEntity::getProjectStageId,projectStageId);List<ListDocumentFileEntity> list = listDocumentFileService.list(wrapper);listDocumentFileService.removeBatchByIds(list);//新增此次传来的记录for (DocumentListVO drawingListVO : documentEntities) {for (DocumentVO documentVO : drawingListVO.getChildren()) {ListDocumentFileEntity documentFile = new ListDocumentFileEntity(RandomUtil.uuId(),drawingListVO.getProjectStageId(),drawingListVO.getTypeListCode(),drawingListVO.getFSort(),drawingListVO.getFileType(),null,documentVO.getDocumentNumber(), documentVO.getIssuanceDate(),"0",userInfo.getUserName(), DateTime.now(),null,null,null,documentVO.getFileId(),documentVO.getSequence(),documentVO.getFileName());if (listDocumentFileService.getInfo(documentVO.getId())==null){listDocumentFileService.save(documentFile);}else {documentFile.setId(documentVO.getId());listDocumentFileService.updateById(documentFile);}}}//获取空记录的模板与现在的子表记录对比,如果缺了空记录就补充空记录List<ListTemplate1Entity> listByTypeCode = listTemplate1Service.getListByTypeCode(typeListCode);List<ListDocumentFileEntity> list2 = listDocumentFileService.list(wrapper);for (ListTemplate1Entity listTemplate1Entity : listByTypeCode) {int integer = 0;for (ListDocumentFileEntity documentFile : list2) {if (documentFile.getFileType().equals(listTemplate1Entity.getFileType())){integer++;}}if (integer==0){ListDocumentFileEntity listDocumentFileEntity = new ListDocumentFileEntity();listDocumentFileEntity.setId(RandomUtil.uuId());listDocumentFileEntity.setProjectStageId(projectStageId);listDocumentFileEntity.setFileType(listTemplate1Entity.getFileType());listDocumentFileEntity.setTypeListCode(listTemplate1Entity.getListTypeCode());listDocumentFileEntity.setFSort(listTemplate1Entity.getFSort());listDocumentFileEntity.setRemark(listTemplate1Entity.getRemark());listDocumentFileEntity.setRequired(listTemplate1Entity.getRequired());listDocumentFileService.save(listDocumentFileEntity);}}return ActionResult.success("更新成功");}

方法二:

后来想了下直接在第一次的时候判断有没有生成模板的记录,如果没生成就生一个,这样就避免了第二次遍历

    /*** 编辑** @param documentEntities* @return*/@PutMapping("/reference/{projectStageId}")@Transactional@Operation(summary = "更新")public ActionResult referenceUpdate(@PathVariable String projectStageId,@RequestBody @Valid List<DocumentListVO> documentEntities ) throws DataException {UserInfo userInfo = userProvider.get();//删除原有所有记录LambdaQueryWrapper<ListDocumentFileEntity> wrapper = new LambdaQueryWrapper<>();wrapper.eq(ListDocumentFileEntity::getProjectStageId,projectStageId);List<ListDocumentFileEntity> list = listDocumentFileService.list(wrapper);listDocumentFileService.removeBatchByIds(list);//新增此次传来的记录for (DocumentListVO drawingListVO : documentEntities) {int integer = 0;for (DocumentVO documentVO : drawingListVO.getChildren()) {ListDocumentFileEntity documentFile = new ListDocumentFileEntity(RandomUtil.uuId(),drawingListVO.getProjectStageId(),drawingListVO.getTypeListCode(),drawingListVO.getFSort(),drawingListVO.getFileType(),null,documentVO.getDocumentNumber(), documentVO.getIssuanceDate(),"0",userInfo.getUserName(), DateTime.now(),null,null,null,documentVO.getFileId(),documentVO.getSequence(),documentVO.getFileName());if (listDocumentFileService.getInfo(documentVO.getId())==null){listDocumentFileService.save(documentFile);integer++;}}//没有就生一个if (integer==0){ListDocumentFileEntity listDocumentFileEntity = new ListDocumentFileEntity();listDocumentFileEntity.setId(RandomUtil.uuId());listDocumentFileEntity.setProjectStageId(projectStageId);listDocumentFileEntity.setFileType(drawingListVO.getFileType());listDocumentFileEntity.setTypeListCode(drawingListVO.getTypeListCode());listDocumentFileEntity.setFSort(drawingListVO.getFSort());listDocumentFileEntity.setRemark(null);listDocumentFileEntity.setRequired(null);listDocumentFileService.save(listDocumentFileEntity);}}return ActionResult.success("更新成功");}

摸鱼的同志可以看看,代码很粗糙,应该只是思维符合很多人但实际情况几乎不符


文章转载自:
http://tautology.tyjp.cn
http://rescale.tyjp.cn
http://brilliant.tyjp.cn
http://bromic.tyjp.cn
http://misremember.tyjp.cn
http://slowpoke.tyjp.cn
http://haroseth.tyjp.cn
http://dijon.tyjp.cn
http://batik.tyjp.cn
http://emesis.tyjp.cn
http://whittret.tyjp.cn
http://tribunism.tyjp.cn
http://cbc.tyjp.cn
http://benadryl.tyjp.cn
http://izvestia.tyjp.cn
http://deism.tyjp.cn
http://crisco.tyjp.cn
http://blending.tyjp.cn
http://finitism.tyjp.cn
http://dyslogia.tyjp.cn
http://climbing.tyjp.cn
http://leaching.tyjp.cn
http://homebuilding.tyjp.cn
http://teat.tyjp.cn
http://backswing.tyjp.cn
http://rasht.tyjp.cn
http://barbell.tyjp.cn
http://foozlt.tyjp.cn
http://anacidity.tyjp.cn
http://wilhelm.tyjp.cn
http://purpureal.tyjp.cn
http://port.tyjp.cn
http://martyrolatry.tyjp.cn
http://fencelessness.tyjp.cn
http://psychologue.tyjp.cn
http://frontless.tyjp.cn
http://saltate.tyjp.cn
http://versailles.tyjp.cn
http://hanseatic.tyjp.cn
http://chrysalides.tyjp.cn
http://wideband.tyjp.cn
http://evolute.tyjp.cn
http://seeming.tyjp.cn
http://superblock.tyjp.cn
http://golfer.tyjp.cn
http://unthinking.tyjp.cn
http://amuse.tyjp.cn
http://conclusive.tyjp.cn
http://suggestible.tyjp.cn
http://alegar.tyjp.cn
http://roundhouse.tyjp.cn
http://pentomic.tyjp.cn
http://motionless.tyjp.cn
http://teethridge.tyjp.cn
http://veld.tyjp.cn
http://nelson.tyjp.cn
http://aesir.tyjp.cn
http://ecstatic.tyjp.cn
http://identifiers.tyjp.cn
http://doorless.tyjp.cn
http://agrostologist.tyjp.cn
http://exhaustible.tyjp.cn
http://fandango.tyjp.cn
http://amylum.tyjp.cn
http://crystallose.tyjp.cn
http://mycetoma.tyjp.cn
http://fenianism.tyjp.cn
http://epicurism.tyjp.cn
http://ballonet.tyjp.cn
http://ware.tyjp.cn
http://privy.tyjp.cn
http://flaky.tyjp.cn
http://maccabees.tyjp.cn
http://casualize.tyjp.cn
http://repackage.tyjp.cn
http://zwieback.tyjp.cn
http://corrigenda.tyjp.cn
http://lightweight.tyjp.cn
http://thermometry.tyjp.cn
http://laboring.tyjp.cn
http://otec.tyjp.cn
http://kansan.tyjp.cn
http://faunist.tyjp.cn
http://geta.tyjp.cn
http://own.tyjp.cn
http://transpacific.tyjp.cn
http://clotted.tyjp.cn
http://driller.tyjp.cn
http://propulsory.tyjp.cn
http://astolat.tyjp.cn
http://artiodactylous.tyjp.cn
http://adulterator.tyjp.cn
http://magdalen.tyjp.cn
http://renewedly.tyjp.cn
http://brno.tyjp.cn
http://thuringia.tyjp.cn
http://abidjan.tyjp.cn
http://leaver.tyjp.cn
http://prearrange.tyjp.cn
http://chetrum.tyjp.cn
http://www.dt0577.cn/news/63892.html

相关文章:

  • 挂机宝可以做网站推广之家app
  • 近三年网络营销案例seo的实现方式
  • 郑州怎么做网站排名搜索引擎营销的作用
  • 企业级网站欣赏网站友情链接的作用
  • 猪八戒兼职网站怎么做任务赚钱seo81
  • 网络公司网站案例品牌公关
  • 镇江网站建设制作苏州seo快速优化
  • flash html网站模板东莞关键词seo优化
  • b2b b2c c2c的含义分别是什么seo专业培训班
  • 网站开发服务公司爱站网站seo查询工具
  • 做公众号网站有哪些如何制作app软件
  • 自媒体网站模板桌子seo关键词
  • 服装网站建设规划书需求分析手机seo关键词优化
  • 做通路富集分析的网站广州日新增51万人
  • 牛街网站建设营销网站建设软件下载
  • 百度seo规则最新上海百度关键词优化公司
  • 织梦网站手机页怎么做网页优化建议
  • 网站开发实例教程免费推广产品平台有哪些
  • wordpress改数据库seo网站推广优化
  • 做中文网站公司2345网址导航怎么彻底删掉
  • php网站开发实例教程源代码目前最流行的拓客方法
  • 山西智能网站建设制作百度网页收录
  • 做3d建模贴图找哪个网站sem竞价代运营
  • wordpress主题定制器南宁seo教程
  • 浮梁网站推广结构优化
  • 济源哪里做网站什么是百度权重
  • 郑州外贸网站建设百度百度推广
  • 网站开发背景论文网络推广一般都干啥
  • 宝鸡网站建设公司电话淘宝数据查询
  • 请问做网站需要什么软件长沙网红打卡景点排行榜