diff --git a/ruoyi-ui/src/layout/components/Navbar.vue b/ruoyi-ui/src/layout/components/Navbar.vue index 9d259517..3f8a6123 100644 --- a/ruoyi-ui/src/layout/components/Navbar.vue +++ b/ruoyi-ui/src/layout/components/Navbar.vue @@ -19,39 +19,40 @@ - 今天({{cast.week}}) + 今天({{ cast.week }}) - 明天({{cast.week}}) + 明天({{ cast.week }}) - 后天({{cast.week}}) + 后天({{ cast.week }}) - 大后天({{cast.week}}) + 大后天({{ cast.week }}) - {{cast.dayweather}} + {{ cast.dayweather }} - {{cast.nighttemp+"℃~"+cast.daytemp+"℃"}} + {{ cast.nighttemp + "℃~" + cast.daytemp + "℃" }}
-
- - +
+ + {{ nowWeatherData.temperature + "℃" }} - + {{ nowWeatherData.weather }} -
+
- + 已读 - + +
+ +
+
@@ -145,7 +146,7 @@ export default { forecastWeatherData: {}, visible: false, - weatherVisible:false, + weatherVisible: false, weather, } @@ -238,7 +239,7 @@ export default { if (json.warningMessage !== undefined) { // this.visible = true return json.warningMessage - }else { + } else { return '暂无提示!!!' } } diff --git a/ruoyi-ui/src/views/mall/product/attribute/attr-group.vue b/ruoyi-ui/src/views/mall/product/attribute/attr-group.vue index a629da4f..61203d78 100644 --- a/ruoyi-ui/src/views/mall/product/attribute/attr-group.vue +++ b/ruoyi-ui/src/views/mall/product/attribute/attr-group.vue @@ -8,7 +8,7 @@
- + @@ -25,6 +25,7 @@ :disabled="dataListSelections.length <= 0" >批量删除 + 重置 @@ -183,7 +184,19 @@ export default { this.getDataList(); }) }); - } + }, + + /** 重置按钮操作 */ + resetQuery() { + this.dataForm={} + this.handleQuery(); + }, + + /** 搜索按钮操作 */ + handleQuery() { + this.pageIndex = 1; + this.getDataList(); + }, } }; diff --git a/ruoyi-ui/src/views/mall/product/attribute/attrgroup-add-or-update.vue b/ruoyi-ui/src/views/mall/product/attribute/attrgroup-add-or-update.vue index 8a37aa42..de906e8f 100644 --- a/ruoyi-ui/src/views/mall/product/attribute/attrgroup-add-or-update.vue +++ b/ruoyi-ui/src/views/mall/product/attribute/attrgroup-add-or-update.vue @@ -58,7 +58,7 @@ diff --git a/xjs-business/xjs-business-common/src/main/java/com/xjs/utils/Query.java b/xjs-business/xjs-business-common/src/main/java/com/xjs/utils/Query.java index 4a0cb0b2..66641e7d 100644 --- a/xjs-business/xjs-business-common/src/main/java/com/xjs/utils/Query.java +++ b/xjs-business/xjs-business-common/src/main/java/com/xjs/utils/Query.java @@ -24,6 +24,8 @@ import java.util.Map; */ public class Query { + public static final String KEY_NAME= "key"; + public IPage getPage(Map params) { return this.getPage(params, null, false); } diff --git a/xjs-business/xjs-project-mall/mall-product/src/main/java/com/xjs/mall/product/controller/AttrGroupController.java b/xjs-business/xjs-project-mall/mall-product/src/main/java/com/xjs/mall/product/controller/AttrGroupController.java index f74312d8..d128e9fe 100644 --- a/xjs-business/xjs-project-mall/mall-product/src/main/java/com/xjs/mall/product/controller/AttrGroupController.java +++ b/xjs-business/xjs-project-mall/mall-product/src/main/java/com/xjs/mall/product/controller/AttrGroupController.java @@ -1,10 +1,14 @@ package com.xjs.mall.product.controller; +import com.ruoyi.common.log.annotation.Log; +import com.ruoyi.common.log.enums.BusinessType; import com.xjs.mall.product.entity.AttrGroupEntity; import com.xjs.mall.product.service.AttrGroupService; import com.xjs.mall.product.service.CategoryService; import com.xjs.utils.PageUtils; import com.xjs.utils.R; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -23,6 +27,7 @@ import java.util.stream.Collectors; */ @RestController @RequestMapping("product/attrgroup") +@Api(tags = "商城-商品-属性分组") public class AttrGroupController { @Autowired private AttrGroupService attrGroupService; @@ -32,7 +37,8 @@ public class AttrGroupController { /** * 列表 */ - @RequestMapping("/list/{catelogId}") + @GetMapping("/list/{catelogId}") + @ApiOperation("列表") public R list(@RequestParam Map params,Long catelogId){ PageUtils page =attrGroupService.queryPage(params,catelogId); @@ -44,7 +50,8 @@ public class AttrGroupController { /** * 信息 */ - @RequestMapping("/info/{attrGroupId}") + @GetMapping("/info/{attrGroupId}") + @ApiOperation("信息") public R info(@PathVariable("attrGroupId") Long attrGroupId){ AttrGroupEntity attrGroup = attrGroupService.getById(attrGroupId); @@ -59,7 +66,9 @@ public class AttrGroupController { /** * 保存 */ - @RequestMapping("/save") + @PostMapping("/save") + @ApiOperation("保存") + @Log(title = "属性分组", businessType = BusinessType.INSERT) public R save(@RequestBody AttrGroupEntity attrGroup){ attrGroupService.save(attrGroup); @@ -69,7 +78,9 @@ public class AttrGroupController { /** * 修改 */ - @RequestMapping("/update") + @PutMapping("/update") + @ApiOperation("修改") + @Log(title = "属性分组", businessType = BusinessType.UPDATE) public R update(@RequestBody AttrGroupEntity attrGroup){ attrGroupService.updateById(attrGroup); @@ -79,7 +90,9 @@ public class AttrGroupController { /** * 删除 */ - @RequestMapping("/delete") + @DeleteMapping("/delete") + @ApiOperation("删除") + @Log(title = "属性分组", businessType = BusinessType.DELETE) public R delete(@RequestBody Long[] attrGroupIds){ attrGroupService.removeByIds(Arrays.asList(attrGroupIds)); diff --git a/xjs-business/xjs-project-mall/mall-product/src/main/java/com/xjs/mall/product/controller/BrandController.java b/xjs-business/xjs-project-mall/mall-product/src/main/java/com/xjs/mall/product/controller/BrandController.java index 221e908c..51a111e9 100644 --- a/xjs-business/xjs-project-mall/mall-product/src/main/java/com/xjs/mall/product/controller/BrandController.java +++ b/xjs-business/xjs-project-mall/mall-product/src/main/java/com/xjs/mall/product/controller/BrandController.java @@ -10,6 +10,7 @@ import com.xjs.validation.group.AddGroup; import com.xjs.validation.group.SelectGroup; import com.xjs.validation.group.UpdateGroup; import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -37,6 +38,7 @@ public class BrandController { * 列表 */ @GetMapping("/list") + @ApiOperation("列表") public R list(@Validated(SelectGroup.class) @RequestParam Map params){ PageUtils page = brandService.queryPage(params); @@ -48,6 +50,7 @@ public class BrandController { * 信息 */ @GetMapping("/info/{brandId}") + @ApiOperation("信息") public R info(@PathVariable("brandId") Long brandId){ BrandEntity brand = brandService.getById(brandId); @@ -58,6 +61,7 @@ public class BrandController { * 保存 */ @PostMapping("/save") + @ApiOperation("保存") @Log(title = "品牌管理", businessType = BusinessType.INSERT) public R save(@Validated(AddGroup.class) @RequestBody BrandEntity brand){ brandService.save(brand); @@ -69,6 +73,7 @@ public class BrandController { * 修改 */ @PutMapping("/update") + @ApiOperation("修改") @Log(title = "品牌管理", businessType = BusinessType.UPDATE) public R update(@Validated(UpdateGroup.class) @RequestBody BrandEntity brand){ brandService.updateById(brand); @@ -80,6 +85,7 @@ public class BrandController { * 删除 */ @DeleteMapping("/delete") + @ApiOperation("删除") @Log(title = "品牌管理", businessType = BusinessType.DELETE) public R delete(@RequestBody Long[] brandIds){ brandService.removeByIds(Arrays.asList(brandIds)); diff --git a/xjs-business/xjs-project-mall/mall-product/src/main/java/com/xjs/mall/product/service/impl/AttrGroupServiceImpl.java b/xjs-business/xjs-project-mall/mall-product/src/main/java/com/xjs/mall/product/service/impl/AttrGroupServiceImpl.java index 5534a1c9..cc76c208 100644 --- a/xjs-business/xjs-project-mall/mall-product/src/main/java/com/xjs/mall/product/service/impl/AttrGroupServiceImpl.java +++ b/xjs-business/xjs-project-mall/mall-product/src/main/java/com/xjs/mall/product/service/impl/AttrGroupServiceImpl.java @@ -30,12 +30,14 @@ public class AttrGroupServiceImpl extends ServiceImpl params, Long categoryId) { - String key = (String) params.get("key"); - //select * from pms_attr_group where catelog_id=? and (attr_group_id=key or attr_group_name like %key%) + String key = (String) params.get(Query.KEY_NAME); + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); if(!StringUtils.isEmpty(key)){ wrapper.and((obj)->{ - obj.eq(AttrGroupEntity::getAttrGroupId,key).or().like(AttrGroupEntity::getAttrGroupName,key); + obj.eq(AttrGroupEntity::getAttrGroupId,key) + .or().like(AttrGroupEntity::getDescript,key) + .or().like(AttrGroupEntity::getAttrGroupName,key); }); } @@ -53,4 +55,4 @@ public class AttrGroupServiceImpl extends ServiceImpl impleme @Override public PageUtils queryPage(Map params) { + String key = (String) params.get(Query.KEY_NAME); + + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.and(StringUtils.isNotEmpty(key), obj ->{ + obj.like(BrandEntity::getName, key) + .or().like(BrandEntity::getDescript, key) + .or().eq(BrandEntity::getFirstLetter, key); + }); + IPage page = this.page( new Query().getPage(params), - new QueryWrapper() + wrapper ); return new PageUtils(page); } -} \ No newline at end of file +}