网站代理打开,不用收费的软件,一元云购网站建设,wordpress图片排列显示目录 一、总述 
二、前端部分 
三、后端部分 
四、总结 一、总述 
前端的话#xff0c;依旧是直接使用老师给的。 
前端的话还是那些增删改查#xff0c;业务复杂一点的话#xff0c;无非就是设计到多个字段多个表的操作#xff0c;当然这是后端的事了#xff0c;前端这里…目录 一、总述 
二、前端部分 
三、后端部分 
四、总结 一、总述 
前端的话依旧是直接使用老师给的。 
前端的话还是那些增删改查业务复杂一点的话无非就是设计到多个字段多个表的操作当然这是后端的事了前端这里不做深究走一下流程知道哪些数据需要绑定哪些事件哪些方法就行了。 
其实我之前讲的前端开发的三步是基于已经有了大致的代码也就是已经提供了一份代码了只需要我们去修改理解一下就行了如果我们单纯使用elementUI进行开发的话需要对那些组件比较熟悉。然后再作修改数据域方法等。 
这里后端的话其实还是那些CRUD比较常规。 
二、前端部分 
前端部分这里我不像之前那样一点一点解析了说实话浪费时间稍微理解一下就行了这里我直接贴上前端相应的代码 
代码很长我直接放到这篇博文对应的资源包下面了。 
三、后端部分 
1. 模糊分页查询接口 
接口 
/*** 查询基本商品属性列表*/ApiOperation(查询商品基本属性列表)//PreAuthorize(ss.hasPermi(product:attr:list))PostMapping(/{type}/list/{catId})public TableDataInfo pageBaseList(PathVariable(type) String type,PathVariable(catId)Long catId, RequestBody PageParamsDto pageParamsDto) {TableDataInfo tableDataInfo  attrService.pageList(type,catId,pageParamsDto);return tableDataInfo;} 
实现 
/*** 分页查询商品基本属性列表* param catId 分类id* param pageParamsDto 分页参数* return*/Overridepublic TableDataInfo pageList(String type,Long catId, PageParamsDto pageParamsDto) {//1. 根据catId查询出基本属性LambdaQueryWrapperAttr wrapper  new LambdaQueryWrapper();if(catId!0){wrapper.eq(Attr::getCatelogId,catId);}if(base.equalsIgnoreCase(type)){wrapper.eq(Attr::getAttrType,1L);} else if (sale.equalsIgnoreCase(type)) {wrapper.eq(Attr::getAttrType,0L);}if(StringUtils.hasText(pageParamsDto.getKey())){if (NumberUtils.isParsable(pageParamsDto.getKey())) {//如果当前字符串是数字也就是代表是属性id的话就拼接上属性idwrapper.eq(Attr::getAttrId,Long.parseLong(pageParamsDto.getKey()));}else{wrapper.like(Attr::getAttrName,pageParamsDto.getKey());}}//2. 分页处理PageAttr page  new Page(pageParamsDto.getPage(),pageParamsDto.getLimit());page(page,wrapper);ListAttr records  page.getRecords();ListAttrVo attrVos  BeanCopyUtils.copyBean(records, AttrVo.class);attrVos.stream().forEach((item)-{//1. 获取属性对应的分类名Long catelogId  item.getCatelogId();Category category  categoryService.getById(catelogId);if (category ! null) {item.setCatelogName(category.getName());}if(base.equalsIgnoreCase(type)){//2. 获取属性对应的分组id及分组名AttrAttrgroupRelation relation  attrAttrgroupRelationService.getOne(new LambdaQueryWrapperAttrAttrgroupRelation().eq(AttrAttrgroupRelation::getAttrId, item.getAttrId()));if (relation ! null) {Long attrGroupId  relation.getAttrGroupId();AttrGroup group  groupService.getById(attrGroupId);if (group ! null) {item.setAttrGroupId(attrGroupId);item.setGroupName(group.getAttrGroupName());}}}//3. 获取属性对应的分类id对应的路径Long[] path  categoryService.categoryPath(catelogId);item.setCatelogPath(path);});return new TableDataInfo(attrVos,(int)page.getTotal());} 
2. 新增属性接口 
接口 
/*** 新增商品属性*/ApiOperation(新增商品属性)//PreAuthorize(ss.hasPermi(product:attr:add))Log(title  商品属性, businessType  BusinessType.INSERT)PostMappingpublic AjaxResult add(RequestBody AttrVo attrVo) {return toAjax(attrService.saveDetail(attrVo));} 
实现 
/*** 添加商品属性的详细信息包含属性分组* param attrVo* return*/TransactionalOverridepublic boolean saveDetail(AttrVo attrVo) {//1. 先新增自己本身Attr attr  BeanCopyUtils.copyBean(attrVo, Attr.class);boolean save  save(attr);if(attrVo.getAttrType().equals(ProductConstant.AttrTypeConstant.BASE_ATTR)){AttrAttrgroupRelation relation  new AttrAttrgroupRelation();relation.setAttrGroupId(attrVo.getAttrGroupId());relation.setAttrId(attr.getAttrId());//2. 添加上分组信息return attrAttrgroupRelationService.save(relation);}return save;} 
3. 修改属性接口 
接口 
/*** 修改商品属性*/ApiOperation(修改商品属性)//PreAuthorize(ss.hasPermi(product:attr:edit))Log(title  商品属性, businessType  BusinessType.UPDATE)PutMappingpublic AjaxResult edit(RequestBody AttrVo attrVo) {return toAjax(attrService.updateDetail(attrVo));} 
实现 
/*** 更新商品属性信息* param attrVo* return*/TransactionalOverridepublic boolean updateDetail(AttrVo attrVo) {//1. 先更新自己Attr attr  BeanCopyUtils.copyBean(attrVo, Attr.class);boolean update  updateById(attr);//2. 更新关联的分组信息if(attrVo.getAttrType().equals(ProductConstant.AttrTypeConstant.BASE_ATTR)){LambdaUpdateWrapperAttrAttrgroupRelation wrapper  new LambdaUpdateWrapper();wrapper.eq(AttrAttrgroupRelation::getAttrId,attrVo.getAttrId());wrapper.set(AttrAttrgroupRelation::getAttrGroupId,attrVo.getAttrGroupId());return attrAttrgroupRelationService.update(wrapper);}return update;} 
4. 删除属性接口 
/*** 删除商品属性*/ApiOperation(删除商品属性)//PreAuthorize(ss.hasPermi(product:attr:remove))Log(title  商品属性, businessType  BusinessType.DELETE)DeleteMappingpublic AjaxResult remove(RequestBody Long[] attrIds) {return toAjax(attrService.removeMore(Arrays.asList(attrIds)));} 
四、总结 
前端后端还是那些东西.... 文章转载自: http://www.morning.lzdbb.cn.gov.cn.lzdbb.cn http://www.morning.nlbw.cn.gov.cn.nlbw.cn http://www.morning.pfjbn.cn.gov.cn.pfjbn.cn http://www.morning.zplzj.cn.gov.cn.zplzj.cn http://www.morning.ylsxk.cn.gov.cn.ylsxk.cn http://www.morning.nlgnk.cn.gov.cn.nlgnk.cn http://www.morning.gtxrw.cn.gov.cn.gtxrw.cn http://www.morning.hxxyp.cn.gov.cn.hxxyp.cn http://www.morning.fcftj.cn.gov.cn.fcftj.cn http://www.morning.cpljq.cn.gov.cn.cpljq.cn http://www.morning.trpq.cn.gov.cn.trpq.cn http://www.morning.qrqcr.cn.gov.cn.qrqcr.cn http://www.morning.bsplf.cn.gov.cn.bsplf.cn http://www.morning.qnsmk.cn.gov.cn.qnsmk.cn http://www.morning.bwttp.cn.gov.cn.bwttp.cn http://www.morning.kpwcx.cn.gov.cn.kpwcx.cn http://www.morning.ldynr.cn.gov.cn.ldynr.cn http://www.morning.chmcq.cn.gov.cn.chmcq.cn http://www.morning.ljtwp.cn.gov.cn.ljtwp.cn http://www.morning.pdxqk.cn.gov.cn.pdxqk.cn http://www.morning.fbqr.cn.gov.cn.fbqr.cn http://www.morning.rszwc.cn.gov.cn.rszwc.cn http://www.morning.gnyhc.cn.gov.cn.gnyhc.cn http://www.morning.yrdkl.cn.gov.cn.yrdkl.cn http://www.morning.xdjwh.cn.gov.cn.xdjwh.cn http://www.morning.rdxnt.cn.gov.cn.rdxnt.cn http://www.morning.wbxtx.cn.gov.cn.wbxtx.cn http://www.morning.gslz.com.cn.gov.cn.gslz.com.cn http://www.morning.lxcwh.cn.gov.cn.lxcwh.cn http://www.morning.gwmjy.cn.gov.cn.gwmjy.cn http://www.morning.gypcr.cn.gov.cn.gypcr.cn http://www.morning.nnrqg.cn.gov.cn.nnrqg.cn http://www.morning.nxhjg.cn.gov.cn.nxhjg.cn http://www.morning.rcww.cn.gov.cn.rcww.cn http://www.morning.qrhh.cn.gov.cn.qrhh.cn http://www.morning.tqlhn.cn.gov.cn.tqlhn.cn http://www.morning.nd-test.com.gov.cn.nd-test.com http://www.morning.rbzht.cn.gov.cn.rbzht.cn http://www.morning.dtcsp.cn.gov.cn.dtcsp.cn http://www.morning.fewhope.com.gov.cn.fewhope.com http://www.morning.rtmqy.cn.gov.cn.rtmqy.cn http://www.morning.lhzqn.cn.gov.cn.lhzqn.cn http://www.morning.rswtz.cn.gov.cn.rswtz.cn http://www.morning.jqpq.cn.gov.cn.jqpq.cn http://www.morning.qfmns.cn.gov.cn.qfmns.cn http://www.morning.zmyhn.cn.gov.cn.zmyhn.cn http://www.morning.rjmd.cn.gov.cn.rjmd.cn http://www.morning.mcqhb.cn.gov.cn.mcqhb.cn http://www.morning.jwfqq.cn.gov.cn.jwfqq.cn http://www.morning.bdtpd.cn.gov.cn.bdtpd.cn http://www.morning.gjtdp.cn.gov.cn.gjtdp.cn http://www.morning.rjfr.cn.gov.cn.rjfr.cn http://www.morning.wmrgp.cn.gov.cn.wmrgp.cn http://www.morning.zpjhh.cn.gov.cn.zpjhh.cn http://www.morning.ho-use.cn.gov.cn.ho-use.cn http://www.morning.gchqy.cn.gov.cn.gchqy.cn http://www.morning.zydr.cn.gov.cn.zydr.cn http://www.morning.nwfpl.cn.gov.cn.nwfpl.cn http://www.morning.skcmt.cn.gov.cn.skcmt.cn http://www.morning.qtzwh.cn.gov.cn.qtzwh.cn http://www.morning.tssmk.cn.gov.cn.tssmk.cn http://www.morning.zsrjn.cn.gov.cn.zsrjn.cn http://www.morning.bpmnx.cn.gov.cn.bpmnx.cn http://www.morning.dtgjt.cn.gov.cn.dtgjt.cn http://www.morning.gyjld.cn.gov.cn.gyjld.cn http://www.morning.muniubangcaishui.cn.gov.cn.muniubangcaishui.cn http://www.morning.rycd.cn.gov.cn.rycd.cn http://www.morning.rdkqt.cn.gov.cn.rdkqt.cn http://www.morning.nlmm.cn.gov.cn.nlmm.cn http://www.morning.qgmbx.cn.gov.cn.qgmbx.cn http://www.morning.zttjs.cn.gov.cn.zttjs.cn http://www.morning.qyglt.cn.gov.cn.qyglt.cn http://www.morning.hmnhp.cn.gov.cn.hmnhp.cn http://www.morning.nzlsm.cn.gov.cn.nzlsm.cn http://www.morning.bntfy.cn.gov.cn.bntfy.cn http://www.morning.lmtbl.cn.gov.cn.lmtbl.cn http://www.morning.ngcth.cn.gov.cn.ngcth.cn http://www.morning.wnzgm.cn.gov.cn.wnzgm.cn http://www.morning.wdykx.cn.gov.cn.wdykx.cn http://www.morning.jpwmk.cn.gov.cn.jpwmk.cn