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

苏州网站建设新手重庆seo俱乐部联系方式

苏州网站建设新手,重庆seo俱乐部联系方式,网站建设安全吗,税务网站设计在网关配置路由 - id: member_routeuri: lb://gulimemberpredicates:- Path/api/gulimember/**filters:- RewritePath/api/(?<segment>.*),/$\{segment}并将所有逆向生成的工程调式出来 获取分类关联的品牌 例如&#xff1a;手机&#xff08;分类&#xff09;-> 品…

在网关配置路由

        - id: member_routeuri: lb://gulimemberpredicates:- Path=/api/gulimember/**filters:- RewritePath=/api/(?<segment>.*),/$\{segment}

并将所有逆向生成的工程调式出来

获取分类关联的品牌

例如:手机(分类)-> 品牌(华为)
CategoryBrandRelationController.java

  @GetMapping("/brands/list")public R relationBrandsList(@RequestParam(value = "catId",required = true)Long catId){List<BrandEntity> vos = categoryBrandRelationService.getBrandsByCatId(catId);List<BrandVo> collect = vos.stream().map(item -> {BrandVo brandVo = new BrandVo();brandVo.setBrandId(item.getBrandId());brandVo.setBrandName(item.getName());return brandVo;}).collect(Collectors.toList());return R.ok().put("data",collect);}

返回信息只需品牌id和品牌名 所以编写一个只包含品牌id和品牌名的Vo
BrandVo

import lombok.Data;@Data
public class BrandVo {/*** "brandId": 0,* "brandName": "string",*/private Long brandId;private String  brandName;
}

CategoryBrandRelationServiceImpl.java

 /*** 查询指定品牌的分类信息* @param catId* @return*/@Overridepublic List<BrandEntity> getBrandsByCatId(Long catId) {List<CategoryBrandRelationEntity> catelogId = relationDao.selectList(new QueryWrapper<CategoryBrandRelationEntity>().eq("catelog_id", catId));List<BrandEntity> collect = catelogId.stream().map(item -> {Long brandId = item.getBrandId();BrandEntity byId = brandService.getById(brandId);return byId;}).collect(Collectors.toList());return collect;}

P75没完成
P86需要再排查

获取分类下所有分组以及属性

创建 AttrGroupWithAttrsVo.java 整合该类型的结果并返回

@Data
public class AttrGroupWithAttrsVo {/*** 分组id*/private Long attrGroupId;/*** 组名*/private String attrGroupName;/*** 排序*/private Integer sort;/*** 描述*/private String descript;/*** 组图标*/private String icon;/*** 所属分类id*/private Long catelogId;private List<AttrEntity> attrs;
}

AttrGroupServiceImpl.java

    /*** 根据分类id查出所有分组以及组里的属性* @param catelogId* @return*/@Overridepublic List<AttrGroupWithAttrsVo> getAttrGroupWithAttrsByCatelogId(Long catelogId) {//1、查询分组信息List<AttrGroupEntity> attrGroupEntities = this.list(new QueryWrapper<AttrGroupEntity>().eq("catelog_id", catelogId));//2、查询所有属性List<AttrGroupWithAttrsVo> collect = attrGroupEntities.stream().map(group -> {AttrGroupWithAttrsVo attrsVo = new AttrGroupWithAttrsVo();BeanUtils.copyProperties(group,attrsVo);//查询属性List<AttrEntity> attrs = attrService.getRelationAttr(attrsVo.getAttrGroupId());attrsVo.setAttrs(attrs);return attrsVo;}).collect(Collectors.toList());return collect;}

商品新增业务流程分析

保存商品vo
SpuInfoController.java

    @RequestMapping("/save")public R save(@RequestBody SpuSaveVo vo){spuInfoService.saveSpuInfo(vo);return R.ok();}

SkuInfoServiceImpl.java
//主要保存商品基本的spu和sku信息

    public void saveSpuInfo(SpuSaveVo vo) {//1.保存商品基本信息 pms_spu_infoSpuInfoEntity infoEntity=new SpuInfoEntity();BeanUtils.copyProperties(vo,infoEntity);infoEntity.setCreateTime(new Date());infoEntity.setUpdateTime(new Date());this.saveBaseSpuInfo(infoEntity);//2.保存描述 pms_spu_info_descList<String> decript = vo.getDecript();SpuInfoDescEntity descEntity = new SpuInfoDescEntity();descEntity.setSpuId(infoEntity.getId());descEntity.setDecript(String.join(",",decript));spuInfoDescService.saveSpuInfoDesc(descEntity);//3.保存图片集pms_spu_imagesList<String> images=vo.getImages();spuImagesService.saveImages(infoEntity.getId(),images);//4.保存spu规格参数 pms_product_attr_valueList<BaseAttrs> baseAttrs=vo.getBaseAttrs();List<ProductAttrValueEntity> collect=baseAttrs.stream().map(attr->{ProductAttrValueEntity valueEntity=new ProductAttrValueEntity();valueEntity.setAttrId(attr.getAttrId());AttrEntity attrEntity=attrService.getById(attr.getAttrId());valueEntity.setAttrName(attrEntity.getAttrName());valueEntity.setAttrValue(attr.getAttrValues());valueEntity.setQuickShow(attr.getShowDesc());valueEntity.setSpuId(infoEntity.getId());return valueEntity;}).collect(Collectors.toList());productAttrValueService.saveProdutAttr(collect);//5.保存spu的积分信息:gulimall_sms->sms_spu_bounds//5.保存当前spu对应的所有sku信息//5.1 sku基本信息 pms_sku_infoList<Skus> skus = vo.getSkus();if(skus!=null&&skus.size()>0){skus.forEach(item->{//存储默认图片String defaultImg="";for(Images image:item.getImages()){if(image.getDefaultImg()==1){defaultImg=image.getImgUrl();}}SkuInfoEntity skuInfoEntity=new SkuInfoEntity();BeanUtils.copyProperties(item,skuInfoEntity);skuInfoEntity.setBrandId(infoEntity.getBrandId());skuInfoEntity.setCatalogId(infoEntity.getCatalogId());skuInfoEntity.setSaleCount(0L);skuInfoEntity.setSpuId(infoEntity.getId());skuInfoEntity.setSkuDefaultImg(defaultImg);skuInfoService.saveSkuInfo(skuInfoEntity);Long skuId=skuInfoEntity.getSkuId();List<SkuImagesEntity> imagesEntities=item.getImages().stream().map(img->{SkuImagesEntity skuImagesEntity = new SkuImagesEntity();skuImagesEntity.setSkuId(skuId);skuImagesEntity.setImgUrl(img.getImgUrl());skuImagesEntity.setDefaultImg(img.getDefaultImg());return skuImagesEntity;}).collect(Collectors.toList());//5.2 sku图片信息 pms_sku_imagesskuImagesService.saveBatch(imagesEntities);List<Attr> attr= item.getAttr();List<SkuSaleAttrValueEntity> skuSaleAttrValueEntities=attr.stream().map(a->{SkuSaleAttrValueEntity attrValueEntity = new SkuSaleAttrValueEntity();BeanUtils.copyProperties(a,attrValueEntity);attrValueEntity.setSkuId(skuId);return attrValueEntity;}).collect(Collectors.toList());//5.3 sku销售属性信息 pms_sku_sale_attr_valueskuSaleAttrValueService.saveBatch(skuSaleAttrValueEntities);});}//5.4 sku优惠、满减信息:gulimall_sms->sms_sku_ladder\sms_sku_full_reduction\sms_member_price}

调用远程服务保存优惠券信息

使用远程服务
可以调用coupon中对应的服务
CouponFeignService.java

@FeignClient("gulicoupon")
public interface CouponFeignService {/*** 1、CouponFeignService.saveSpuBounds(spuBoundTo);*      1)、@RequestBody将这个对象转为json。*      2)、找到gulimall-coupon服务,给/coupon/spubounds/save发送请求。*          将上一步转的json放在请求体位置,发送请求;*      3)、对方服务收到请求。请求体里有json数据。*          (@RequestBody SpuBoundsEntity spuBounds);将请求体的json转为SpuBoundsEntity;* 只要json数据模型是兼容的。双方服务无需使用同一个to* @return*/@PostMapping("/gulicoupon/spubounds/save")R saveSpuBounds(@RequestBody SpuBoundTo spuBoundTo);@PostMapping("/gulicoupon/skufullreduction/saveinfo")R saveSkuReduction(@RequestBody SkuReductionTo skuReductionTo);
}

SPU检索

在这里插入图片描述

SpuInfoController.java

    @RequestMapping("/list")public R list(@RequestParam Map<String, Object> params){PageUtils page = spuInfoService.queryPageByCondition(params);return R.ok().put("page", page);}

SpuInfoServiceImpl.java

  @Overridepublic PageUtils queryPageByCondition(Map<String, Object> params) {QueryWrapper<SpuInfoEntity> wrapper = new QueryWrapper<>();String key = (String) params.get("key");if(!StringUtils.isEmpty(key)){wrapper.and((w)->{w.eq("id",key).or().like("spu_name",key);});}// status=1 and (id=1 or spu_name like xxx)String status = (String) params.get("status");if(!StringUtils.isEmpty(status)){wrapper.eq("publish_status",status);}String brandId = (String) params.get("brandId");if(!StringUtils.isEmpty(brandId)&&!"0".equalsIgnoreCase(brandId)){wrapper.eq("brand_id",brandId);}String catelogId = (String) params.get("catelogId");if(!StringUtils.isEmpty(catelogId)&&!"0".equalsIgnoreCase(catelogId)){wrapper.eq("catalog_id",catelogId);}/*** status: 2* key:* brandId: 9* catelogId: 225*/IPage<SpuInfoEntity> page = this.page(new Query<SpuInfoEntity>().getPage(params),wrapper);return new PageUtils(page);}

SKU检索

SkuInfoController.java

    @RequestMapping("/list")public R list(@RequestParam Map<String, Object> params){PageUtils page = skuInfoService.queryPageByCondition(params);return R.ok().put("page", page);}

SkuInfoServiceImpl.java

 @Overridepublic PageUtils queryPageByCondition(Map<String, Object> params) {QueryWrapper<SkuInfoEntity> queryWrapper = new QueryWrapper<>();/*** key:* catelogId: 0* brandId: 0* 价格区间* min: 0* max: 0*/String key = (String) params.get("key");if(!StringUtils.isEmpty(key)){queryWrapper.and((wrapper)->{wrapper.eq("sku_id",key).or().like("sku_name",key);});}String catelogId = (String) params.get("catelogId");if(!StringUtils.isEmpty(catelogId)&&!"0".equalsIgnoreCase(catelogId)){queryWrapper.eq("catalog_id",catelogId);}String brandId = (String) params.get("brandId");if(!StringUtils.isEmpty(brandId)&&!"0".equalsIgnoreCase(catelogId)){queryWrapper.eq("brand_id",brandId);}String min = (String) params.get("min");if(!StringUtils.isEmpty(min)){queryWrapper.ge("price",min);}String max = (String) params.get("max");if(!StringUtils.isEmpty(max)  ){try{BigDecimal bigDecimal = new BigDecimal(max);if(bigDecimal.compareTo(new BigDecimal("0"))==1){queryWrapper.le("price",max);}}catch (Exception e){}}IPage<SkuInfoEntity> page = this.page(new Query<SkuInfoEntity>().getPage(params),queryWrapper);return new PageUtils(page);}

商品管理-SPU规格维护(暂未解决)


文章转载自:
http://lovestruck.rpwm.cn
http://unperishing.rpwm.cn
http://deweyite.rpwm.cn
http://risk.rpwm.cn
http://cartoner.rpwm.cn
http://trivalent.rpwm.cn
http://storiette.rpwm.cn
http://cruciform.rpwm.cn
http://pone.rpwm.cn
http://solecistic.rpwm.cn
http://misdoubt.rpwm.cn
http://cephalometer.rpwm.cn
http://triboluminescence.rpwm.cn
http://strike.rpwm.cn
http://divinatory.rpwm.cn
http://downbeat.rpwm.cn
http://vocality.rpwm.cn
http://vitrectomy.rpwm.cn
http://inaffable.rpwm.cn
http://comeback.rpwm.cn
http://cmb.rpwm.cn
http://corbie.rpwm.cn
http://gruel.rpwm.cn
http://camisade.rpwm.cn
http://iced.rpwm.cn
http://podzolization.rpwm.cn
http://scoticize.rpwm.cn
http://swimmy.rpwm.cn
http://picnic.rpwm.cn
http://acidulate.rpwm.cn
http://zhdanovism.rpwm.cn
http://nonvanishing.rpwm.cn
http://ergotize.rpwm.cn
http://wyoming.rpwm.cn
http://fub.rpwm.cn
http://precative.rpwm.cn
http://choriambic.rpwm.cn
http://amoretto.rpwm.cn
http://batrachian.rpwm.cn
http://casa.rpwm.cn
http://identifiably.rpwm.cn
http://nnp.rpwm.cn
http://ragbolt.rpwm.cn
http://libya.rpwm.cn
http://codger.rpwm.cn
http://tobacco.rpwm.cn
http://succubi.rpwm.cn
http://impermeability.rpwm.cn
http://bopeep.rpwm.cn
http://keeler.rpwm.cn
http://napoli.rpwm.cn
http://gundalow.rpwm.cn
http://feijoa.rpwm.cn
http://amadan.rpwm.cn
http://nanaimo.rpwm.cn
http://clithral.rpwm.cn
http://endurance.rpwm.cn
http://discriminably.rpwm.cn
http://capernaum.rpwm.cn
http://adiaphorism.rpwm.cn
http://brachydactylous.rpwm.cn
http://palytoxin.rpwm.cn
http://reprehensibly.rpwm.cn
http://vj.rpwm.cn
http://vagus.rpwm.cn
http://resonator.rpwm.cn
http://tephra.rpwm.cn
http://revalorization.rpwm.cn
http://recommitment.rpwm.cn
http://typographer.rpwm.cn
http://apochromat.rpwm.cn
http://rudbeckia.rpwm.cn
http://mesosome.rpwm.cn
http://realist.rpwm.cn
http://diphosphate.rpwm.cn
http://exochorion.rpwm.cn
http://inertial.rpwm.cn
http://pentagonal.rpwm.cn
http://polycrystal.rpwm.cn
http://antiparallel.rpwm.cn
http://thioester.rpwm.cn
http://incendiary.rpwm.cn
http://duettist.rpwm.cn
http://hucksteress.rpwm.cn
http://tylopod.rpwm.cn
http://cheese.rpwm.cn
http://impersonalise.rpwm.cn
http://coliform.rpwm.cn
http://tankard.rpwm.cn
http://batfowl.rpwm.cn
http://unthinkable.rpwm.cn
http://hopvine.rpwm.cn
http://encaustic.rpwm.cn
http://commix.rpwm.cn
http://rail.rpwm.cn
http://iconolater.rpwm.cn
http://runty.rpwm.cn
http://wayworn.rpwm.cn
http://plimsolls.rpwm.cn
http://thieves.rpwm.cn
http://www.15wanjia.com/news/85196.html

相关文章:

  • 北京网站建设分析论文如何引流推广产品
  • 无锡网站设计开发商务网站建设
  • 购物网站成品今天重大国际新闻
  • 网站开发 程序开发原理高端网站建设定制
  • 独立ip做多个网站seo手机关键词网址
  • 在库言库建筑网站百度统计数据
  • wordpress 整合js上海网站优化
  • 网站 实例有创意的网络营销案例
  • 连云港东海县做网站权重查询站长工具
  • wordpress网站添加密码访问可口可乐搜索引擎营销案例
  • 医疗网站建设方案最新域名查询ip
  • 网站建设和电子商务的关系最近的国际新闻
  • 网站开发项目安排怎样自己做网站
  • 网站初期seo怎么做商城小程序开发哪家好
  • wordpress女性网站地域名网址查询
  • 企业网站推广的方法有什么小说搜索风云榜排名
  • app页面展示模板首页关键词排名优化
  • 怎么做淘宝客个人网站山东关键词优化联系电话
  • 石家庄企业商城版网站建设如何推广小程序平台
  • 5ucms怎样做网站自适应外贸网站设计
  • 网站制作论文参考文献新闻危机公关
  • 做陌陌网站什么做二次感染即将大爆发
  • 企业做网站需要什么手续吗橘子seo
  • 杭州新闻最新消息新闻学seo如何入门
  • 做微课常用的网站有哪些2022最新热点事件及点评
  • 做网站得做多少网页官网关键词优化价格
  • 企业网站排名优化价格百度推广怎么优化排名
  • 乐从建网站千锋培训机构官网
  • bootstrap构建自己的网站做一个企业网站大概需要多少钱
  • 网站建设与应用凡科建站后属于自己的网站吗