From 99b0eee9d4709a1fa3198f3d4a67cde4e20fdad4 Mon Sep 17 00:00:00 2001 From: xjs <1294405880@qq.com> Date: Tue, 22 Mar 2022 17:40:08 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E5=AE=9E=E7=8E=B0=E4=B8=80=E4=B8=AA?= =?UTF-8?q?=E5=89=8D=E7=AB=AF=E7=88=B6=E7=BB=84=E4=BB=B6=E8=B0=83=E7=94=A8?= =?UTF-8?q?=E5=AD=90=E7=BB=84=E4=BB=B6=E7=9A=84=E6=96=B9=E6=B3=95=E4=BE=8B?= =?UTF-8?q?=E5=AD=90=202=E3=80=81=E4=BB=93=E5=BA=93=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E4=BB=93=E5=BA=93=E4=BF=A1=E6=81=AFcrud=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-ui/src/api/mall/ware/ware-info.js | 48 +++++ .../src/views/mall/product/maintain/spu.vue | 5 +- .../views/mall/product/maintain/spuinfo.vue | 6 + .../ware/wareinfo/wareinfo-add-or-update.vue | 90 +++++++++ .../src/views/mall/ware/wareinfo/wareinfo.vue | 173 ++++++++++++++++++ .../ware/controller/WareInfoController.java | 39 ++-- .../service/impl/WareInfoServiceImpl.java | 19 +- 7 files changed, 357 insertions(+), 23 deletions(-) create mode 100644 ruoyi-ui/src/api/mall/ware/ware-info.js create mode 100644 ruoyi-ui/src/views/mall/ware/wareinfo/wareinfo-add-or-update.vue create mode 100644 ruoyi-ui/src/views/mall/ware/wareinfo/wareinfo.vue diff --git a/ruoyi-ui/src/api/mall/ware/ware-info.js b/ruoyi-ui/src/api/mall/ware/ware-info.js new file mode 100644 index 00000000..d8c8c515 --- /dev/null +++ b/ruoyi-ui/src/api/mall/ware/ware-info.js @@ -0,0 +1,48 @@ +import request from '@/utils/request' + +//获取仓库信息列表 +export function getWareInfoList(parms) { + return request({ + url: '/mall-ware/ware/wareinfo/list', + method: 'get', + params: parms + }) +} + +//删除仓库信息 +export function delWareInfo(ids) { + return request({ + url: '/mall-ware/ware/wareinfo/delete', + method: 'delete', + data: ids + }) +} + +//获取仓库信息详情 +export function getWareInfo(id) { + return request({ + url: `/mall-ware/ware/wareinfo/info/${id}`, + method: 'get', + }) +} + +//保存仓库信息 +export function saveWareInfo(data) { + return request({ + url: `/mall-ware/ware/wareinfo/save`, + method: 'post', + data: data, + }) +} + +//修改仓库信息 +export function editWareInfo(data) { + return request({ + url: `/mall-ware/ware/wareinfo/update`, + method: 'put', + data: data, + }) +} + + + diff --git a/ruoyi-ui/src/views/mall/product/maintain/spu.vue b/ruoyi-ui/src/views/mall/product/maintain/spu.vue index bdfe7420..0e327cec 100644 --- a/ruoyi-ui/src/views/mall/product/maintain/spu.vue +++ b/ruoyi-ui/src/views/mall/product/maintain/spu.vue @@ -29,7 +29,7 @@ - + @@ -75,6 +75,9 @@ export default { // this.catelogPath= [] this.$bus.$emit('clearCategoryCascader', []) this.$bus.$emit('clearBrandSelect', []) + + //调用子组件重置方法 + this.$refs.spuInfo.rest() }, diff --git a/ruoyi-ui/src/views/mall/product/maintain/spuinfo.vue b/ruoyi-ui/src/views/mall/product/maintain/spuinfo.vue index 4c9c1f9d..a5441e0f 100644 --- a/ruoyi-ui/src/views/mall/product/maintain/spuinfo.vue +++ b/ruoyi-ui/src/views/mall/product/maintain/spuinfo.vue @@ -138,6 +138,12 @@ export default { }, + //重置值 + rest() { + this.pageIndex = 1; + this.getDataList(); + }, + }, diff --git a/ruoyi-ui/src/views/mall/ware/wareinfo/wareinfo-add-or-update.vue b/ruoyi-ui/src/views/mall/ware/wareinfo/wareinfo-add-or-update.vue new file mode 100644 index 00000000..747e644e --- /dev/null +++ b/ruoyi-ui/src/views/mall/ware/wareinfo/wareinfo-add-or-update.vue @@ -0,0 +1,90 @@ + + + diff --git a/ruoyi-ui/src/views/mall/ware/wareinfo/wareinfo.vue b/ruoyi-ui/src/views/mall/ware/wareinfo/wareinfo.vue new file mode 100644 index 00000000..82e606b6 --- /dev/null +++ b/ruoyi-ui/src/views/mall/ware/wareinfo/wareinfo.vue @@ -0,0 +1,173 @@ + + + diff --git a/xjs-business/xjs-project-mall/mall-ware/src/main/java/com/xjs/mall/ware/controller/WareInfoController.java b/xjs-business/xjs-project-mall/mall-ware/src/main/java/com/xjs/mall/ware/controller/WareInfoController.java index da338821..b67ba35a 100644 --- a/xjs-business/xjs-project-mall/mall-ware/src/main/java/com/xjs/mall/ware/controller/WareInfoController.java +++ b/xjs-business/xjs-project-mall/mall-ware/src/main/java/com/xjs/mall/ware/controller/WareInfoController.java @@ -4,6 +4,8 @@ import com.xjs.mall.ware.entity.WareInfoEntity; import com.xjs.mall.ware.service.WareInfoService; import com.xjs.utils.PageUtils; import com.xjs.mall.other.R; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -11,16 +13,16 @@ import java.util.Arrays; import java.util.Map; - /** * 仓库信息 * * @author xiejs * @email 1294405880@qq.com - * @date 2022-03-15 09:56:19 + * @since 2022-03-15 09:56:19 */ @RestController @RequestMapping("ware/wareinfo") +@Api(tags = "商城-仓库-仓库信息") public class WareInfoController { @Autowired private WareInfoService wareInfoService; @@ -28,8 +30,9 @@ public class WareInfoController { /** * 列表 */ - @RequestMapping("/list") - public R list(@RequestParam Map params){ + @GetMapping("/list") + @ApiOperation("列表") + public R list(@RequestParam Map params) { PageUtils page = wareInfoService.queryPage(params); return R.ok().put("page", page); @@ -39,9 +42,10 @@ public class WareInfoController { /** * 信息 */ - @RequestMapping("/info/{id}") - public R info(@PathVariable("id") Long id){ - WareInfoEntity wareInfo = wareInfoService.getById(id); + @GetMapping("/info/{id}") + @ApiOperation("信息") + public R info(@PathVariable("id") Long id) { + WareInfoEntity wareInfo = wareInfoService.getById(id); return R.ok().put("wareInfo", wareInfo); } @@ -49,9 +53,10 @@ public class WareInfoController { /** * 保存 */ - @RequestMapping("/save") - public R save(@RequestBody WareInfoEntity wareInfo){ - wareInfoService.save(wareInfo); + @PostMapping("/save") + @ApiOperation("保存") + public R save(@RequestBody WareInfoEntity wareInfo) { + wareInfoService.save(wareInfo); return R.ok(); } @@ -59,9 +64,10 @@ public class WareInfoController { /** * 修改 */ - @RequestMapping("/update") - public R update(@RequestBody WareInfoEntity wareInfo){ - wareInfoService.updateById(wareInfo); + @PutMapping("/update") + @ApiOperation("修改") + public R update(@RequestBody WareInfoEntity wareInfo) { + wareInfoService.updateById(wareInfo); return R.ok(); } @@ -69,9 +75,10 @@ public class WareInfoController { /** * 删除 */ - @RequestMapping("/delete") - public R delete(@RequestBody Long[] ids){ - wareInfoService.removeByIds(Arrays.asList(ids)); + @DeleteMapping("/delete") + @ApiOperation("删除") + public R delete(@RequestBody Long[] ids) { + wareInfoService.removeByIds(Arrays.asList(ids)); return R.ok(); } diff --git a/xjs-business/xjs-project-mall/mall-ware/src/main/java/com/xjs/mall/ware/service/impl/WareInfoServiceImpl.java b/xjs-business/xjs-project-mall/mall-ware/src/main/java/com/xjs/mall/ware/service/impl/WareInfoServiceImpl.java index ad4aa978..88feed4d 100644 --- a/xjs-business/xjs-project-mall/mall-ware/src/main/java/com/xjs/mall/ware/service/impl/WareInfoServiceImpl.java +++ b/xjs-business/xjs-project-mall/mall-ware/src/main/java/com/xjs/mall/ware/service/impl/WareInfoServiceImpl.java @@ -1,8 +1,9 @@ package com.xjs.mall.ware.service.impl; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.ruoyi.common.core.utils.StringUtils; import com.xjs.mall.ware.dao.WareInfoDao; import com.xjs.mall.ware.entity.WareInfoEntity; import com.xjs.mall.ware.service.WareInfoService; @@ -18,12 +19,18 @@ public class WareInfoServiceImpl extends ServiceImpl params) { - IPage page = this.page( - new Query().getPage(params), - new QueryWrapper() - ); + String key = (String) params.get(Query.KEY_NAME); + + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + if (StringUtils.isNotEmpty(key)) { + wrapper.like(WareInfoEntity::getName, key).or() + .like(WareInfoEntity::getAddress, key).or() + .eq(WareInfoEntity::getAreacode, key); + } + + IPage page = this.page(new Query().getPage(params), wrapper); return new PageUtils(page); } -} \ No newline at end of file +}