parent
534bb9a877
commit
5bdd19bf6f
@ -0,0 +1,93 @@
|
|||||||
|
package com.cyl.pms.controller;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.data.domain.PageImpl;
|
||||||
|
import org.springframework.data.domain.Pageable;
|
||||||
|
import org.springframework.data.domain.Page;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PutMapping;
|
||||||
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
import com.ruoyi.common.annotation.Log;
|
||||||
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
|
import com.ruoyi.common.enums.BusinessType;
|
||||||
|
import com.cyl.pms.convert.BrandConvert;
|
||||||
|
import com.cyl.pms.domain.Brand;
|
||||||
|
import com.cyl.pms.pojo.query.BrandQuery;
|
||||||
|
import com.cyl.pms.service.BrandService;
|
||||||
|
import com.cyl.pms.pojo.vo.BrandVO;
|
||||||
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||||
|
/**
|
||||||
|
* 品牌管理Controller
|
||||||
|
*
|
||||||
|
* @author zcc
|
||||||
|
* @date 2022-11-18
|
||||||
|
*/
|
||||||
|
@Api(description ="品牌管理接口列表")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/pms/brand")
|
||||||
|
public class BrandController extends BaseController {
|
||||||
|
@Autowired
|
||||||
|
private BrandService service;
|
||||||
|
@Autowired
|
||||||
|
private BrandConvert convert;
|
||||||
|
|
||||||
|
@ApiOperation("查询品牌管理列表")
|
||||||
|
@PreAuthorize("@ss.hasPermi('pms:brand:list')")
|
||||||
|
@PostMapping("/list")
|
||||||
|
public ResponseEntity<Page<Brand>> list(@RequestBody BrandQuery query, Pageable page) {
|
||||||
|
List<Brand> list = service.selectList(query, page);
|
||||||
|
return ResponseEntity.ok(new PageImpl<>(list, page, ((com.github.pagehelper.Page)list).getTotal()));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("导出品牌管理列表")
|
||||||
|
@PreAuthorize("@ss.hasPermi('pms:brand:export')")
|
||||||
|
@Log(title = "品牌管理", businessType = BusinessType.EXPORT)
|
||||||
|
@GetMapping("/export")
|
||||||
|
public ResponseEntity<String> export(BrandQuery query) {
|
||||||
|
List<Brand> list = service.selectList(query, null);
|
||||||
|
ExcelUtil<BrandVO> util = new ExcelUtil<>(BrandVO.class);
|
||||||
|
return ResponseEntity.ok(util.writeExcel(convert.dos2vos(list), "品牌管理数据"));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("获取品牌管理详细信息")
|
||||||
|
@PreAuthorize("@ss.hasPermi('pms:brand:query')")
|
||||||
|
@GetMapping(value = "/{id}")
|
||||||
|
public ResponseEntity<Brand> getInfo(@PathVariable("id") Long id) {
|
||||||
|
return ResponseEntity.ok(service.selectById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("新增品牌管理")
|
||||||
|
@PreAuthorize("@ss.hasPermi('pms:brand:add')")
|
||||||
|
@Log(title = "品牌管理", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping
|
||||||
|
public ResponseEntity<Integer> add(@RequestBody Brand brand) {
|
||||||
|
return ResponseEntity.ok(service.insert(brand));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("修改品牌管理")
|
||||||
|
@PreAuthorize("@ss.hasPermi('pms:brand:edit')")
|
||||||
|
@Log(title = "品牌管理", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping
|
||||||
|
public ResponseEntity<Integer> edit(@RequestBody Brand brand) {
|
||||||
|
return ResponseEntity.ok(service.update(brand));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("删除品牌管理")
|
||||||
|
@PreAuthorize("@ss.hasPermi('pms:brand:remove')")
|
||||||
|
@Log(title = "品牌管理", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{ids}")
|
||||||
|
public ResponseEntity<Integer> remove(@PathVariable Long[] ids) {
|
||||||
|
return ResponseEntity.ok(service.deleteByIds(ids));
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,93 @@
|
|||||||
|
package com.cyl.pms.controller;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.data.domain.PageImpl;
|
||||||
|
import org.springframework.data.domain.Pageable;
|
||||||
|
import org.springframework.data.domain.Page;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PutMapping;
|
||||||
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
import com.ruoyi.common.annotation.Log;
|
||||||
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
|
import com.ruoyi.common.enums.BusinessType;
|
||||||
|
import com.cyl.pms.convert.ProductCategoryConvert;
|
||||||
|
import com.cyl.pms.domain.ProductCategory;
|
||||||
|
import com.cyl.pms.pojo.query.ProductCategoryQuery;
|
||||||
|
import com.cyl.pms.service.ProductCategoryService;
|
||||||
|
import com.cyl.pms.pojo.vo.ProductCategoryVO;
|
||||||
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||||
|
/**
|
||||||
|
* 商品分类Controller
|
||||||
|
*
|
||||||
|
* @author zcc
|
||||||
|
* @date 2022-11-18
|
||||||
|
*/
|
||||||
|
@Api(description ="商品分类接口列表")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/pms/productCategory")
|
||||||
|
public class ProductCategoryController extends BaseController {
|
||||||
|
@Autowired
|
||||||
|
private ProductCategoryService service;
|
||||||
|
@Autowired
|
||||||
|
private ProductCategoryConvert convert;
|
||||||
|
|
||||||
|
@ApiOperation("查询商品分类列表")
|
||||||
|
@PreAuthorize("@ss.hasPermi('pms:productCategory:list')")
|
||||||
|
@PostMapping("/list")
|
||||||
|
public ResponseEntity<Page<ProductCategory>> list(@RequestBody ProductCategoryQuery query, Pageable page) {
|
||||||
|
List<ProductCategory> list = service.selectList(query, page);
|
||||||
|
return ResponseEntity.ok(new PageImpl<>(list, page, ((com.github.pagehelper.Page)list).getTotal()));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("导出商品分类列表")
|
||||||
|
@PreAuthorize("@ss.hasPermi('pms:productCategory:export')")
|
||||||
|
@Log(title = "商品分类", businessType = BusinessType.EXPORT)
|
||||||
|
@GetMapping("/export")
|
||||||
|
public ResponseEntity<String> export(ProductCategoryQuery query) {
|
||||||
|
List<ProductCategory> list = service.selectList(query, null);
|
||||||
|
ExcelUtil<ProductCategoryVO> util = new ExcelUtil<>(ProductCategoryVO.class);
|
||||||
|
return ResponseEntity.ok(util.writeExcel(convert.dos2vos(list), "商品分类数据"));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("获取商品分类详细信息")
|
||||||
|
@PreAuthorize("@ss.hasPermi('pms:productCategory:query')")
|
||||||
|
@GetMapping(value = "/{id}")
|
||||||
|
public ResponseEntity<ProductCategory> getInfo(@PathVariable("id") Long id) {
|
||||||
|
return ResponseEntity.ok(service.selectById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("新增商品分类")
|
||||||
|
@PreAuthorize("@ss.hasPermi('pms:productCategory:add')")
|
||||||
|
@Log(title = "商品分类", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping
|
||||||
|
public ResponseEntity<Integer> add(@RequestBody ProductCategory productCategory) {
|
||||||
|
return ResponseEntity.ok(service.insert(productCategory));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("修改商品分类")
|
||||||
|
@PreAuthorize("@ss.hasPermi('pms:productCategory:edit')")
|
||||||
|
@Log(title = "商品分类", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping
|
||||||
|
public ResponseEntity<Integer> edit(@RequestBody ProductCategory productCategory) {
|
||||||
|
return ResponseEntity.ok(service.update(productCategory));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("删除商品分类")
|
||||||
|
@PreAuthorize("@ss.hasPermi('pms:productCategory:remove')")
|
||||||
|
@Log(title = "商品分类", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{ids}")
|
||||||
|
public ResponseEntity<Integer> remove(@PathVariable Long[] ids) {
|
||||||
|
return ResponseEntity.ok(service.deleteByIds(ids));
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,93 @@
|
|||||||
|
package com.cyl.pms.controller;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.data.domain.PageImpl;
|
||||||
|
import org.springframework.data.domain.Pageable;
|
||||||
|
import org.springframework.data.domain.Page;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PutMapping;
|
||||||
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
import com.ruoyi.common.annotation.Log;
|
||||||
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
|
import com.ruoyi.common.enums.BusinessType;
|
||||||
|
import com.cyl.pms.convert.ProductConvert;
|
||||||
|
import com.cyl.pms.domain.Product;
|
||||||
|
import com.cyl.pms.pojo.query.ProductQuery;
|
||||||
|
import com.cyl.pms.service.ProductService;
|
||||||
|
import com.cyl.pms.pojo.vo.ProductVO;
|
||||||
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||||
|
/**
|
||||||
|
* 商品信息Controller
|
||||||
|
*
|
||||||
|
* @author zcc
|
||||||
|
* @date 2022-11-18
|
||||||
|
*/
|
||||||
|
@Api(description ="商品信息接口列表")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/pms/product")
|
||||||
|
public class ProductController extends BaseController {
|
||||||
|
@Autowired
|
||||||
|
private ProductService service;
|
||||||
|
@Autowired
|
||||||
|
private ProductConvert convert;
|
||||||
|
|
||||||
|
@ApiOperation("查询商品信息列表")
|
||||||
|
@PreAuthorize("@ss.hasPermi('pms:product:list')")
|
||||||
|
@PostMapping("/list")
|
||||||
|
public ResponseEntity<Page<Product>> list(@RequestBody ProductQuery query, Pageable page) {
|
||||||
|
List<Product> list = service.selectList(query, page);
|
||||||
|
return ResponseEntity.ok(new PageImpl<>(list, page, ((com.github.pagehelper.Page)list).getTotal()));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("导出商品信息列表")
|
||||||
|
@PreAuthorize("@ss.hasPermi('pms:product:export')")
|
||||||
|
@Log(title = "商品信息", businessType = BusinessType.EXPORT)
|
||||||
|
@GetMapping("/export")
|
||||||
|
public ResponseEntity<String> export(ProductQuery query) {
|
||||||
|
List<Product> list = service.selectList(query, null);
|
||||||
|
ExcelUtil<ProductVO> util = new ExcelUtil<>(ProductVO.class);
|
||||||
|
return ResponseEntity.ok(util.writeExcel(convert.dos2vos(list), "商品信息数据"));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("获取商品信息详细信息")
|
||||||
|
@PreAuthorize("@ss.hasPermi('pms:product:query')")
|
||||||
|
@GetMapping(value = "/{id}")
|
||||||
|
public ResponseEntity<Product> getInfo(@PathVariable("id") Long id) {
|
||||||
|
return ResponseEntity.ok(service.selectById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("新增商品信息")
|
||||||
|
@PreAuthorize("@ss.hasPermi('pms:product:add')")
|
||||||
|
@Log(title = "商品信息", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping
|
||||||
|
public ResponseEntity<Integer> add(@RequestBody Product product) {
|
||||||
|
return ResponseEntity.ok(service.insert(product));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("修改商品信息")
|
||||||
|
@PreAuthorize("@ss.hasPermi('pms:product:edit')")
|
||||||
|
@Log(title = "商品信息", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping
|
||||||
|
public ResponseEntity<Integer> edit(@RequestBody Product product) {
|
||||||
|
return ResponseEntity.ok(service.update(product));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("删除商品信息")
|
||||||
|
@PreAuthorize("@ss.hasPermi('pms:product:remove')")
|
||||||
|
@Log(title = "商品信息", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{ids}")
|
||||||
|
public ResponseEntity<Integer> remove(@PathVariable Long[] ids) {
|
||||||
|
return ResponseEntity.ok(service.deleteByIds(ids));
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,93 @@
|
|||||||
|
package com.cyl.pms.controller;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.data.domain.PageImpl;
|
||||||
|
import org.springframework.data.domain.Pageable;
|
||||||
|
import org.springframework.data.domain.Page;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PutMapping;
|
||||||
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
import com.ruoyi.common.annotation.Log;
|
||||||
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
|
import com.ruoyi.common.enums.BusinessType;
|
||||||
|
import com.cyl.pms.convert.SkuConvert;
|
||||||
|
import com.cyl.pms.domain.Sku;
|
||||||
|
import com.cyl.pms.pojo.query.SkuQuery;
|
||||||
|
import com.cyl.pms.service.SkuService;
|
||||||
|
import com.cyl.pms.pojo.vo.SkuVO;
|
||||||
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||||
|
/**
|
||||||
|
* sku信息Controller
|
||||||
|
*
|
||||||
|
* @author zcc
|
||||||
|
* @date 2022-11-18
|
||||||
|
*/
|
||||||
|
@Api(description ="sku信息接口列表")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/pms/sku")
|
||||||
|
public class SkuController extends BaseController {
|
||||||
|
@Autowired
|
||||||
|
private SkuService service;
|
||||||
|
@Autowired
|
||||||
|
private SkuConvert convert;
|
||||||
|
|
||||||
|
@ApiOperation("查询sku信息列表")
|
||||||
|
@PreAuthorize("@ss.hasPermi('pms:sku:list')")
|
||||||
|
@PostMapping("/list")
|
||||||
|
public ResponseEntity<Page<Sku>> list(@RequestBody SkuQuery query, Pageable page) {
|
||||||
|
List<Sku> list = service.selectList(query, page);
|
||||||
|
return ResponseEntity.ok(new PageImpl<>(list, page, ((com.github.pagehelper.Page)list).getTotal()));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("导出sku信息列表")
|
||||||
|
@PreAuthorize("@ss.hasPermi('pms:sku:export')")
|
||||||
|
@Log(title = "sku信息", businessType = BusinessType.EXPORT)
|
||||||
|
@GetMapping("/export")
|
||||||
|
public ResponseEntity<String> export(SkuQuery query) {
|
||||||
|
List<Sku> list = service.selectList(query, null);
|
||||||
|
ExcelUtil<SkuVO> util = new ExcelUtil<>(SkuVO.class);
|
||||||
|
return ResponseEntity.ok(util.writeExcel(convert.dos2vos(list), "sku信息数据"));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("获取sku信息详细信息")
|
||||||
|
@PreAuthorize("@ss.hasPermi('pms:sku:query')")
|
||||||
|
@GetMapping(value = "/{id}")
|
||||||
|
public ResponseEntity<Sku> getInfo(@PathVariable("id") Long id) {
|
||||||
|
return ResponseEntity.ok(service.selectById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("新增sku信息")
|
||||||
|
@PreAuthorize("@ss.hasPermi('pms:sku:add')")
|
||||||
|
@Log(title = "sku信息", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping
|
||||||
|
public ResponseEntity<Integer> add(@RequestBody Sku sku) {
|
||||||
|
return ResponseEntity.ok(service.insert(sku));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("修改sku信息")
|
||||||
|
@PreAuthorize("@ss.hasPermi('pms:sku:edit')")
|
||||||
|
@Log(title = "sku信息", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping
|
||||||
|
public ResponseEntity<Integer> edit(@RequestBody Sku sku) {
|
||||||
|
return ResponseEntity.ok(service.update(sku));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("删除sku信息")
|
||||||
|
@PreAuthorize("@ss.hasPermi('pms:sku:remove')")
|
||||||
|
@Log(title = "sku信息", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{ids}")
|
||||||
|
public ResponseEntity<Integer> remove(@PathVariable Long[] ids) {
|
||||||
|
return ResponseEntity.ok(service.deleteByIds(ids));
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,16 @@
|
|||||||
|
package com.cyl.pms.convert;
|
||||||
|
|
||||||
|
import org.mapstruct.Mapper;
|
||||||
|
import com.cyl.pms.domain.Brand;
|
||||||
|
import com.cyl.pms.pojo.vo.BrandVO;
|
||||||
|
import java.util.List;
|
||||||
|
/**
|
||||||
|
* 品牌管理 DO <=> DTO <=> VO / BO / Query
|
||||||
|
*
|
||||||
|
* @author zcc
|
||||||
|
*/
|
||||||
|
@Mapper(componentModel = "spring")
|
||||||
|
public interface BrandConvert {
|
||||||
|
|
||||||
|
List<BrandVO> dos2vos(List<Brand> list);
|
||||||
|
}
|
||||||
@ -0,0 +1,16 @@
|
|||||||
|
package com.cyl.pms.convert;
|
||||||
|
|
||||||
|
import org.mapstruct.Mapper;
|
||||||
|
import com.cyl.pms.domain.ProductCategory;
|
||||||
|
import com.cyl.pms.pojo.vo.ProductCategoryVO;
|
||||||
|
import java.util.List;
|
||||||
|
/**
|
||||||
|
* 商品分类 DO <=> DTO <=> VO / BO / Query
|
||||||
|
*
|
||||||
|
* @author zcc
|
||||||
|
*/
|
||||||
|
@Mapper(componentModel = "spring")
|
||||||
|
public interface ProductCategoryConvert {
|
||||||
|
|
||||||
|
List<ProductCategoryVO> dos2vos(List<ProductCategory> list);
|
||||||
|
}
|
||||||
@ -0,0 +1,16 @@
|
|||||||
|
package com.cyl.pms.convert;
|
||||||
|
|
||||||
|
import org.mapstruct.Mapper;
|
||||||
|
import com.cyl.pms.domain.Product;
|
||||||
|
import com.cyl.pms.pojo.vo.ProductVO;
|
||||||
|
import java.util.List;
|
||||||
|
/**
|
||||||
|
* 商品信息 DO <=> DTO <=> VO / BO / Query
|
||||||
|
*
|
||||||
|
* @author zcc
|
||||||
|
*/
|
||||||
|
@Mapper(componentModel = "spring")
|
||||||
|
public interface ProductConvert {
|
||||||
|
|
||||||
|
List<ProductVO> dos2vos(List<Product> list);
|
||||||
|
}
|
||||||
@ -0,0 +1,16 @@
|
|||||||
|
package com.cyl.pms.convert;
|
||||||
|
|
||||||
|
import org.mapstruct.Mapper;
|
||||||
|
import com.cyl.pms.domain.Sku;
|
||||||
|
import com.cyl.pms.pojo.vo.SkuVO;
|
||||||
|
import java.util.List;
|
||||||
|
/**
|
||||||
|
* sku信息 DO <=> DTO <=> VO / BO / Query
|
||||||
|
*
|
||||||
|
* @author zcc
|
||||||
|
*/
|
||||||
|
@Mapper(componentModel = "spring")
|
||||||
|
public interface SkuConvert {
|
||||||
|
|
||||||
|
List<SkuVO> dos2vos(List<Sku> list);
|
||||||
|
}
|
||||||
@ -0,0 +1,42 @@
|
|||||||
|
package com.cyl.pms.domain;
|
||||||
|
|
||||||
|
import com.ruoyi.common.annotation.Excel;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import com.ruoyi.common.core.domain.BaseAudit;
|
||||||
|
import lombok.Data;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
/**
|
||||||
|
* 品牌管理对象 pms_brand
|
||||||
|
*
|
||||||
|
* @author zcc
|
||||||
|
*/
|
||||||
|
@ApiModel(description="品牌管理对象")
|
||||||
|
@Data
|
||||||
|
@TableName("pms_brand")
|
||||||
|
public class Brand extends BaseAudit {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty("ID")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@ApiModelProperty("NAME")
|
||||||
|
@Excel(name = "NAME")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@ApiModelProperty("SORT")
|
||||||
|
@Excel(name = "SORT")
|
||||||
|
private Integer sort;
|
||||||
|
|
||||||
|
@ApiModelProperty("SHOW_STATUS")
|
||||||
|
@Excel(name = "SHOW_STATUS")
|
||||||
|
private Integer showStatus;
|
||||||
|
|
||||||
|
@ApiModelProperty("品牌logo")
|
||||||
|
@Excel(name = "品牌logo")
|
||||||
|
private String logo;
|
||||||
|
|
||||||
|
@ApiModelProperty("删除标识")
|
||||||
|
private Integer delFlag;
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,28 @@
|
|||||||
|
package com.cyl.pms.mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import com.cyl.pms.domain.Brand;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 品牌管理Mapper接口
|
||||||
|
*
|
||||||
|
* @author zcc
|
||||||
|
*/
|
||||||
|
public interface BrandMapper extends BaseMapper<Brand> {
|
||||||
|
/**
|
||||||
|
* 查询品牌管理列表
|
||||||
|
*
|
||||||
|
* @param brand 品牌管理
|
||||||
|
* @return 品牌管理集合
|
||||||
|
*/
|
||||||
|
List<Brand> selectByEntity(Brand brand);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量软删除
|
||||||
|
* @param ids
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
int updateDelFlagByIds(@Param("ids") Long[] ids);
|
||||||
|
}
|
||||||
@ -0,0 +1,28 @@
|
|||||||
|
package com.cyl.pms.mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import com.cyl.pms.domain.ProductCategory;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品分类Mapper接口
|
||||||
|
*
|
||||||
|
* @author zcc
|
||||||
|
*/
|
||||||
|
public interface ProductCategoryMapper extends BaseMapper<ProductCategory> {
|
||||||
|
/**
|
||||||
|
* 查询商品分类列表
|
||||||
|
*
|
||||||
|
* @param productCategory 商品分类
|
||||||
|
* @return 商品分类集合
|
||||||
|
*/
|
||||||
|
List<ProductCategory> selectByEntity(ProductCategory productCategory);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量软删除
|
||||||
|
* @param ids
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
int updateDelFlagByIds(@Param("ids") Long[] ids);
|
||||||
|
}
|
||||||
@ -0,0 +1,28 @@
|
|||||||
|
package com.cyl.pms.mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import com.cyl.pms.domain.Product;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品信息Mapper接口
|
||||||
|
*
|
||||||
|
* @author zcc
|
||||||
|
*/
|
||||||
|
public interface ProductMapper extends BaseMapper<Product> {
|
||||||
|
/**
|
||||||
|
* 查询商品信息列表
|
||||||
|
*
|
||||||
|
* @param product 商品信息
|
||||||
|
* @return 商品信息集合
|
||||||
|
*/
|
||||||
|
List<Product> selectByEntity(Product product);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量软删除
|
||||||
|
* @param ids
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
int updateDelFlagByIds(@Param("ids") Long[] ids);
|
||||||
|
}
|
||||||
@ -0,0 +1,28 @@
|
|||||||
|
package com.cyl.pms.mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import com.cyl.pms.domain.Sku;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* sku信息Mapper接口
|
||||||
|
*
|
||||||
|
* @author zcc
|
||||||
|
*/
|
||||||
|
public interface SkuMapper extends BaseMapper<Sku> {
|
||||||
|
/**
|
||||||
|
* 查询sku信息列表
|
||||||
|
*
|
||||||
|
* @param sku sku信息
|
||||||
|
* @return sku信息集合
|
||||||
|
*/
|
||||||
|
List<Sku> selectByEntity(Sku sku);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量软删除
|
||||||
|
* @param ids
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
int updateDelFlagByIds(@Param("ids") Long[] ids);
|
||||||
|
}
|
||||||
@ -0,0 +1,27 @@
|
|||||||
|
package com.cyl.pms.pojo.query;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 品牌管理 查询 对象
|
||||||
|
*
|
||||||
|
* @author zcc
|
||||||
|
*/
|
||||||
|
@ApiModel(description="品牌管理 查询 对象")
|
||||||
|
@Data
|
||||||
|
public class BrandQuery {
|
||||||
|
@ApiModelProperty("NAME 精确匹配")
|
||||||
|
private String nameLike;
|
||||||
|
|
||||||
|
@ApiModelProperty("SORT 精确匹配")
|
||||||
|
private Integer sort;
|
||||||
|
|
||||||
|
@ApiModelProperty("SHOW_STATUS 精确匹配")
|
||||||
|
private Integer showStatus;
|
||||||
|
|
||||||
|
@ApiModelProperty("品牌logo 精确匹配")
|
||||||
|
private String logo;
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,28 @@
|
|||||||
|
package com.cyl.pms.pojo.vo;
|
||||||
|
|
||||||
|
import com.ruoyi.common.annotation.Excel;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.ruoyi.common.core.domain.BaseAudit;
|
||||||
|
import lombok.Data;
|
||||||
|
/**
|
||||||
|
* 品牌管理 数据视图对象
|
||||||
|
*
|
||||||
|
* @author zcc
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class BrandVO extends BaseAudit {
|
||||||
|
/** ID */
|
||||||
|
private Long id;
|
||||||
|
/** NAME */
|
||||||
|
@Excel(name = "NAME")
|
||||||
|
private String name;
|
||||||
|
/** SORT */
|
||||||
|
@Excel(name = "SORT")
|
||||||
|
private Integer sort;
|
||||||
|
/** SHOW_STATUS */
|
||||||
|
@Excel(name = "SHOW_STATUS")
|
||||||
|
private Integer showStatus;
|
||||||
|
/** 品牌logo */
|
||||||
|
@Excel(name = "品牌logo")
|
||||||
|
private String logo;
|
||||||
|
}
|
||||||
@ -0,0 +1,111 @@
|
|||||||
|
package com.cyl.pms.service;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.github.pagehelper.PageHelper;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.data.domain.Pageable;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import com.cyl.pms.mapper.BrandMapper;
|
||||||
|
import com.cyl.pms.domain.Brand;
|
||||||
|
import com.cyl.pms.pojo.query.BrandQuery;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 品牌管理Service业务层处理
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @author zcc
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class BrandService {
|
||||||
|
@Autowired
|
||||||
|
private BrandMapper brandMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询品牌管理
|
||||||
|
*
|
||||||
|
* @param id 品牌管理主键
|
||||||
|
* @return 品牌管理
|
||||||
|
*/
|
||||||
|
public Brand selectById(Long id) {
|
||||||
|
return brandMapper.selectById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询品牌管理列表
|
||||||
|
*
|
||||||
|
* @param query 查询条件
|
||||||
|
* @param page 分页条件
|
||||||
|
* @return 品牌管理
|
||||||
|
*/
|
||||||
|
public List<Brand> selectList(BrandQuery query, Pageable page) {
|
||||||
|
if (page != null) {
|
||||||
|
PageHelper.startPage(page.getPageNumber() + 1, page.getPageSize());
|
||||||
|
}
|
||||||
|
QueryWrapper<Brand> qw = new QueryWrapper<>();
|
||||||
|
qw.eq("del_flag",0);
|
||||||
|
String nameLike = query.getNameLike();
|
||||||
|
if (!StringUtils.isEmpty(nameLike)) {
|
||||||
|
qw.like("name", nameLike);
|
||||||
|
}
|
||||||
|
Integer sort = query.getSort();
|
||||||
|
if (sort != null) {
|
||||||
|
qw.eq("sort", sort);
|
||||||
|
}
|
||||||
|
Integer showStatus = query.getShowStatus();
|
||||||
|
if (showStatus != null) {
|
||||||
|
qw.eq("show_status", showStatus);
|
||||||
|
}
|
||||||
|
String logo = query.getLogo();
|
||||||
|
if (!StringUtils.isEmpty(logo)) {
|
||||||
|
qw.eq("logo", logo);
|
||||||
|
}
|
||||||
|
return brandMapper.selectList(qw);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增品牌管理
|
||||||
|
*
|
||||||
|
* @param brand 品牌管理
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insert(Brand brand) {
|
||||||
|
brand.setDelFlag(0);
|
||||||
|
brand.setCreateTime(LocalDateTime.now());
|
||||||
|
return brandMapper.insert(brand);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改品牌管理
|
||||||
|
*
|
||||||
|
* @param brand 品牌管理
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int update(Brand brand) {
|
||||||
|
return brandMapper.updateById(brand);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除品牌管理
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的品牌管理主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteByIds(Long[] ids) {
|
||||||
|
return brandMapper.updateDelFlagByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除品牌管理信息
|
||||||
|
*
|
||||||
|
* @param id 品牌管理主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteById(Long id) {
|
||||||
|
Long[] ids = {id};
|
||||||
|
return brandMapper.updateDelFlagByIds(ids);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,119 @@
|
|||||||
|
package com.cyl.pms.service;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.github.pagehelper.PageHelper;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.data.domain.Pageable;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import com.cyl.pms.mapper.ProductCategoryMapper;
|
||||||
|
import com.cyl.pms.domain.ProductCategory;
|
||||||
|
import com.cyl.pms.pojo.query.ProductCategoryQuery;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品分类Service业务层处理
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @author zcc
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class ProductCategoryService {
|
||||||
|
@Autowired
|
||||||
|
private ProductCategoryMapper productCategoryMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询商品分类
|
||||||
|
*
|
||||||
|
* @param id 商品分类主键
|
||||||
|
* @return 商品分类
|
||||||
|
*/
|
||||||
|
public ProductCategory selectById(Long id) {
|
||||||
|
return productCategoryMapper.selectById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询商品分类列表
|
||||||
|
*
|
||||||
|
* @param query 查询条件
|
||||||
|
* @param page 分页条件
|
||||||
|
* @return 商品分类
|
||||||
|
*/
|
||||||
|
public List<ProductCategory> selectList(ProductCategoryQuery query, Pageable page) {
|
||||||
|
if (page != null) {
|
||||||
|
PageHelper.startPage(page.getPageNumber() + 1, page.getPageSize());
|
||||||
|
}
|
||||||
|
QueryWrapper<ProductCategory> qw = new QueryWrapper<>();
|
||||||
|
qw.eq("del_flag",0);
|
||||||
|
Long parentId = query.getParentId();
|
||||||
|
if (parentId != null) {
|
||||||
|
qw.eq("parent_id", parentId);
|
||||||
|
}
|
||||||
|
String nameLike = query.getNameLike();
|
||||||
|
if (!StringUtils.isEmpty(nameLike)) {
|
||||||
|
qw.like("name", nameLike);
|
||||||
|
}
|
||||||
|
Integer level = query.getLevel();
|
||||||
|
if (level != null) {
|
||||||
|
qw.eq("level", level);
|
||||||
|
}
|
||||||
|
Integer showStatus = query.getShowStatus();
|
||||||
|
if (showStatus != null) {
|
||||||
|
qw.eq("show_status", showStatus);
|
||||||
|
}
|
||||||
|
Integer sort = query.getSort();
|
||||||
|
if (sort != null) {
|
||||||
|
qw.eq("sort", sort);
|
||||||
|
}
|
||||||
|
String icon = query.getIcon();
|
||||||
|
if (!StringUtils.isEmpty(icon)) {
|
||||||
|
qw.eq("icon", icon);
|
||||||
|
}
|
||||||
|
return productCategoryMapper.selectList(qw);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增商品分类
|
||||||
|
*
|
||||||
|
* @param productCategory 商品分类
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insert(ProductCategory productCategory) {
|
||||||
|
productCategory.setDelFlag(0);
|
||||||
|
productCategory.setCreateTime(LocalDateTime.now());
|
||||||
|
return productCategoryMapper.insert(productCategory);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改商品分类
|
||||||
|
*
|
||||||
|
* @param productCategory 商品分类
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int update(ProductCategory productCategory) {
|
||||||
|
return productCategoryMapper.updateById(productCategory);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除商品分类
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的商品分类主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteByIds(Long[] ids) {
|
||||||
|
return productCategoryMapper.updateDelFlagByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除商品分类信息
|
||||||
|
*
|
||||||
|
* @param id 商品分类主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteById(Long id) {
|
||||||
|
Long[] ids = {id};
|
||||||
|
return productCategoryMapper.updateDelFlagByIds(ids);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,156 @@
|
|||||||
|
package com.cyl.pms.service;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.github.pagehelper.PageHelper;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.data.domain.Pageable;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import com.cyl.pms.mapper.ProductMapper;
|
||||||
|
import com.cyl.pms.domain.Product;
|
||||||
|
import com.cyl.pms.pojo.query.ProductQuery;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品信息Service业务层处理
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @author zcc
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class ProductService {
|
||||||
|
@Autowired
|
||||||
|
private ProductMapper productMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询商品信息
|
||||||
|
*
|
||||||
|
* @param id 商品信息主键
|
||||||
|
* @return 商品信息
|
||||||
|
*/
|
||||||
|
public Product selectById(Long id) {
|
||||||
|
return productMapper.selectById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询商品信息列表
|
||||||
|
*
|
||||||
|
* @param query 查询条件
|
||||||
|
* @param page 分页条件
|
||||||
|
* @return 商品信息
|
||||||
|
*/
|
||||||
|
public List<Product> selectList(ProductQuery query, Pageable page) {
|
||||||
|
if (page != null) {
|
||||||
|
PageHelper.startPage(page.getPageNumber() + 1, page.getPageSize());
|
||||||
|
}
|
||||||
|
QueryWrapper<Product> qw = new QueryWrapper<>();
|
||||||
|
qw.eq("del_flag",0);
|
||||||
|
Long brandId = query.getBrandId();
|
||||||
|
if (brandId != null) {
|
||||||
|
qw.eq("brand_id", brandId);
|
||||||
|
}
|
||||||
|
Long categoryId = query.getCategoryId();
|
||||||
|
if (categoryId != null) {
|
||||||
|
qw.eq("category_id", categoryId);
|
||||||
|
}
|
||||||
|
String outProductId = query.getOutProductId();
|
||||||
|
if (!StringUtils.isEmpty(outProductId)) {
|
||||||
|
qw.eq("out_product_id", outProductId);
|
||||||
|
}
|
||||||
|
String nameLike = query.getNameLike();
|
||||||
|
if (!StringUtils.isEmpty(nameLike)) {
|
||||||
|
qw.like("name", nameLike);
|
||||||
|
}
|
||||||
|
String pic = query.getPic();
|
||||||
|
if (!StringUtils.isEmpty(pic)) {
|
||||||
|
qw.eq("pic", pic);
|
||||||
|
}
|
||||||
|
String albumPics = query.getAlbumPics();
|
||||||
|
if (!StringUtils.isEmpty(albumPics)) {
|
||||||
|
qw.eq("album_pics", albumPics);
|
||||||
|
}
|
||||||
|
Integer publishStatus = query.getPublishStatus();
|
||||||
|
if (publishStatus != null) {
|
||||||
|
qw.eq("publish_status", publishStatus);
|
||||||
|
}
|
||||||
|
Integer sort = query.getSort();
|
||||||
|
if (sort != null) {
|
||||||
|
qw.eq("sort", sort);
|
||||||
|
}
|
||||||
|
BigDecimal price = query.getPrice();
|
||||||
|
if (price != null) {
|
||||||
|
qw.eq("price", price);
|
||||||
|
}
|
||||||
|
String unit = query.getUnit();
|
||||||
|
if (!StringUtils.isEmpty(unit)) {
|
||||||
|
qw.eq("unit", unit);
|
||||||
|
}
|
||||||
|
BigDecimal weight = query.getWeight();
|
||||||
|
if (weight != null) {
|
||||||
|
qw.eq("weight", weight);
|
||||||
|
}
|
||||||
|
String detailHtml = query.getDetailHtml();
|
||||||
|
if (!StringUtils.isEmpty(detailHtml)) {
|
||||||
|
qw.eq("detail_html", detailHtml);
|
||||||
|
}
|
||||||
|
String detailMobileHtml = query.getDetailMobileHtml();
|
||||||
|
if (!StringUtils.isEmpty(detailMobileHtml)) {
|
||||||
|
qw.eq("detail_mobile_html", detailMobileHtml);
|
||||||
|
}
|
||||||
|
String brandNameLike = query.getBrandNameLike();
|
||||||
|
if (!StringUtils.isEmpty(brandNameLike)) {
|
||||||
|
qw.like("brand_name", brandNameLike);
|
||||||
|
}
|
||||||
|
String productCategoryNameLike = query.getProductCategoryNameLike();
|
||||||
|
if (!StringUtils.isEmpty(productCategoryNameLike)) {
|
||||||
|
qw.like("product_category_name", productCategoryNameLike);
|
||||||
|
}
|
||||||
|
return productMapper.selectList(qw);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增商品信息
|
||||||
|
*
|
||||||
|
* @param product 商品信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insert(Product product) {
|
||||||
|
product.setDelFlag(0);
|
||||||
|
product.setCreateTime(LocalDateTime.now());
|
||||||
|
return productMapper.insert(product);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改商品信息
|
||||||
|
*
|
||||||
|
* @param product 商品信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int update(Product product) {
|
||||||
|
return productMapper.updateById(product);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除商品信息
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的商品信息主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteByIds(Long[] ids) {
|
||||||
|
return productMapper.updateDelFlagByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除商品信息信息
|
||||||
|
*
|
||||||
|
* @param id 商品信息主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteById(Long id) {
|
||||||
|
Long[] ids = {id};
|
||||||
|
return productMapper.updateDelFlagByIds(ids);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,116 @@
|
|||||||
|
package com.cyl.pms.service;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.github.pagehelper.PageHelper;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.data.domain.Pageable;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import com.cyl.pms.mapper.SkuMapper;
|
||||||
|
import com.cyl.pms.domain.Sku;
|
||||||
|
import com.cyl.pms.pojo.query.SkuQuery;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* sku信息Service业务层处理
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @author zcc
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class SkuService {
|
||||||
|
@Autowired
|
||||||
|
private SkuMapper skuMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询sku信息
|
||||||
|
*
|
||||||
|
* @param id sku信息主键
|
||||||
|
* @return sku信息
|
||||||
|
*/
|
||||||
|
public Sku selectById(Long id) {
|
||||||
|
return skuMapper.selectById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询sku信息列表
|
||||||
|
*
|
||||||
|
* @param query 查询条件
|
||||||
|
* @param page 分页条件
|
||||||
|
* @return sku信息
|
||||||
|
*/
|
||||||
|
public List<Sku> selectList(SkuQuery query, Pageable page) {
|
||||||
|
if (page != null) {
|
||||||
|
PageHelper.startPage(page.getPageNumber() + 1, page.getPageSize());
|
||||||
|
}
|
||||||
|
QueryWrapper<Sku> qw = new QueryWrapper<>();
|
||||||
|
qw.eq("del_flag",0);
|
||||||
|
Long productId = query.getProductId();
|
||||||
|
if (productId != null) {
|
||||||
|
qw.eq("product_id", productId);
|
||||||
|
}
|
||||||
|
String outSkuId = query.getOutSkuId();
|
||||||
|
if (!StringUtils.isEmpty(outSkuId)) {
|
||||||
|
qw.eq("out_sku_id", outSkuId);
|
||||||
|
}
|
||||||
|
BigDecimal price = query.getPrice();
|
||||||
|
if (price != null) {
|
||||||
|
qw.eq("price", price);
|
||||||
|
}
|
||||||
|
String pic = query.getPic();
|
||||||
|
if (!StringUtils.isEmpty(pic)) {
|
||||||
|
qw.eq("pic", pic);
|
||||||
|
}
|
||||||
|
String spData = query.getSpData();
|
||||||
|
if (!StringUtils.isEmpty(spData)) {
|
||||||
|
qw.eq("sp_data", spData);
|
||||||
|
}
|
||||||
|
return skuMapper.selectList(qw);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增sku信息
|
||||||
|
*
|
||||||
|
* @param sku sku信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insert(Sku sku) {
|
||||||
|
sku.setDelFlag(0);
|
||||||
|
sku.setCreateTime(LocalDateTime.now());
|
||||||
|
return skuMapper.insert(sku);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改sku信息
|
||||||
|
*
|
||||||
|
* @param sku sku信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int update(Sku sku) {
|
||||||
|
return skuMapper.updateById(sku);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除sku信息
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的sku信息主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteByIds(Long[] ids) {
|
||||||
|
return skuMapper.updateDelFlagByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除sku信息信息
|
||||||
|
*
|
||||||
|
* @param id sku信息主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteById(Long id) {
|
||||||
|
Long[] ids = {id};
|
||||||
|
return skuMapper.updateDelFlagByIds(ids);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,44 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper
|
||||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.cyl.pms.mapper.BrandMapper">
|
||||||
|
|
||||||
|
<resultMap type="Brand" id="BrandResult">
|
||||||
|
<result property="id" column="id"/>
|
||||||
|
<result property="name" column="name"/>
|
||||||
|
<result property="sort" column="sort"/>
|
||||||
|
<result property="showStatus" column="show_status"/>
|
||||||
|
<result property="logo" column="logo"/>
|
||||||
|
<result property="delFlag" column="del_flag"/>
|
||||||
|
<result property="createBy" column="create_by"/>
|
||||||
|
<result property="createTime" column="create_time"/>
|
||||||
|
<result property="updateBy" column="update_by"/>
|
||||||
|
<result property="updateTime" column="update_time"/>
|
||||||
|
<result property="createBy" column="create_by"/>
|
||||||
|
<result property="createTime" column="create_time"/>
|
||||||
|
<result property="updateBy" column="update_by"/>
|
||||||
|
<result property="updateTime" column="update_time" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="selectBrandVo">
|
||||||
|
select id, name, sort, show_status, logo, del_flag, create_by, create_time, update_by, update_time from pms_brand
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectByEntity" parameterType="Brand" resultMap="BrandResult">
|
||||||
|
<include refid="selectBrandVo"/>
|
||||||
|
<where>
|
||||||
|
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
||||||
|
<if test="sort != null "> and sort = #{sort}</if>
|
||||||
|
<if test="showStatus != null "> and show_status = #{showStatus}</if>
|
||||||
|
<if test="logo != null and logo != ''"> and logo = #{logo}</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<update id="updateDelFlagByIds">
|
||||||
|
update pms_brand set del_flag=1
|
||||||
|
<where>
|
||||||
|
id in <foreach collection="ids" open="(" item="it" close=")" separator=",">#{it}</foreach>
|
||||||
|
</where>
|
||||||
|
</update>
|
||||||
|
</mapper>
|
||||||
@ -0,0 +1,48 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper
|
||||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.cyl.pms.mapper.ProductCategoryMapper">
|
||||||
|
|
||||||
|
<resultMap type="ProductCategory" id="ProductCategoryResult">
|
||||||
|
<result property="id" column="id"/>
|
||||||
|
<result property="parentId" column="parent_id"/>
|
||||||
|
<result property="name" column="name"/>
|
||||||
|
<result property="level" column="level"/>
|
||||||
|
<result property="showStatus" column="show_status"/>
|
||||||
|
<result property="sort" column="sort"/>
|
||||||
|
<result property="icon" column="icon"/>
|
||||||
|
<result property="delFlag" column="del_flag"/>
|
||||||
|
<result property="createBy" column="create_by"/>
|
||||||
|
<result property="createTime" column="create_time"/>
|
||||||
|
<result property="updateBy" column="update_by"/>
|
||||||
|
<result property="updateTime" column="update_time"/>
|
||||||
|
<result property="createBy" column="create_by"/>
|
||||||
|
<result property="createTime" column="create_time"/>
|
||||||
|
<result property="updateBy" column="update_by"/>
|
||||||
|
<result property="updateTime" column="update_time" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="selectProductCategoryVo">
|
||||||
|
select id, parent_id, name, level, show_status, sort, icon, del_flag, create_by, create_time, update_by, update_time from pms_product_category
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectByEntity" parameterType="ProductCategory" resultMap="ProductCategoryResult">
|
||||||
|
<include refid="selectProductCategoryVo"/>
|
||||||
|
<where>
|
||||||
|
<if test="parentId != null "> and parent_id = #{parentId}</if>
|
||||||
|
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
||||||
|
<if test="level != null "> and level = #{level}</if>
|
||||||
|
<if test="showStatus != null "> and show_status = #{showStatus}</if>
|
||||||
|
<if test="sort != null "> and sort = #{sort}</if>
|
||||||
|
<if test="icon != null and icon != ''"> and icon = #{icon}</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<update id="updateDelFlagByIds">
|
||||||
|
update pms_product_category set del_flag=1
|
||||||
|
<where>
|
||||||
|
id in <foreach collection="ids" open="(" item="it" close=")" separator=",">#{it}</foreach>
|
||||||
|
</where>
|
||||||
|
</update>
|
||||||
|
</mapper>
|
||||||
@ -0,0 +1,66 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper
|
||||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.cyl.pms.mapper.ProductMapper">
|
||||||
|
|
||||||
|
<resultMap type="Product" id="ProductResult">
|
||||||
|
<result property="id" column="id"/>
|
||||||
|
<result property="brandId" column="brand_id"/>
|
||||||
|
<result property="categoryId" column="category_id"/>
|
||||||
|
<result property="outProductId" column="out_product_id"/>
|
||||||
|
<result property="name" column="name"/>
|
||||||
|
<result property="pic" column="pic"/>
|
||||||
|
<result property="albumPics" column="album_pics"/>
|
||||||
|
<result property="publishStatus" column="publish_status"/>
|
||||||
|
<result property="sort" column="sort"/>
|
||||||
|
<result property="price" column="price"/>
|
||||||
|
<result property="unit" column="unit"/>
|
||||||
|
<result property="weight" column="weight"/>
|
||||||
|
<result property="detailHtml" column="detail_html"/>
|
||||||
|
<result property="detailMobileHtml" column="detail_mobile_html"/>
|
||||||
|
<result property="brandName" column="brand_name"/>
|
||||||
|
<result property="productCategoryName" column="product_category_name"/>
|
||||||
|
<result property="delFlag" column="del_flag"/>
|
||||||
|
<result property="createBy" column="create_by"/>
|
||||||
|
<result property="createTime" column="create_time"/>
|
||||||
|
<result property="updateBy" column="update_by"/>
|
||||||
|
<result property="updateTime" column="update_time"/>
|
||||||
|
<result property="createBy" column="create_by"/>
|
||||||
|
<result property="createTime" column="create_time"/>
|
||||||
|
<result property="updateBy" column="update_by"/>
|
||||||
|
<result property="updateTime" column="update_time" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="selectProductVo">
|
||||||
|
select id, brand_id, category_id, out_product_id, name, pic, album_pics, publish_status, sort, price, unit, weight, detail_html, detail_mobile_html, brand_name, product_category_name, del_flag, create_by, create_time, update_by, update_time from pms_product
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectByEntity" parameterType="Product" resultMap="ProductResult">
|
||||||
|
<include refid="selectProductVo"/>
|
||||||
|
<where>
|
||||||
|
<if test="brandId != null "> and brand_id = #{brandId}</if>
|
||||||
|
<if test="categoryId != null "> and category_id = #{categoryId}</if>
|
||||||
|
<if test="outProductId != null and outProductId != ''"> and out_product_id = #{outProductId}</if>
|
||||||
|
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
||||||
|
<if test="pic != null and pic != ''"> and pic = #{pic}</if>
|
||||||
|
<if test="albumPics != null and albumPics != ''"> and album_pics = #{albumPics}</if>
|
||||||
|
<if test="publishStatus != null "> and publish_status = #{publishStatus}</if>
|
||||||
|
<if test="sort != null "> and sort = #{sort}</if>
|
||||||
|
<if test="price != null "> and price = #{price}</if>
|
||||||
|
<if test="unit != null and unit != ''"> and unit = #{unit}</if>
|
||||||
|
<if test="weight != null "> and weight = #{weight}</if>
|
||||||
|
<if test="detailHtml != null and detailHtml != ''"> and detail_html = #{detailHtml}</if>
|
||||||
|
<if test="detailMobileHtml != null and detailMobileHtml != ''"> and detail_mobile_html = #{detailMobileHtml}</if>
|
||||||
|
<if test="brandName != null and brandName != ''"> and brand_name like concat('%', #{brandName}, '%')</if>
|
||||||
|
<if test="productCategoryName != null and productCategoryName != ''"> and product_category_name like concat('%', #{productCategoryName}, '%')</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<update id="updateDelFlagByIds">
|
||||||
|
update pms_product set del_flag=1
|
||||||
|
<where>
|
||||||
|
id in <foreach collection="ids" open="(" item="it" close=")" separator=",">#{it}</foreach>
|
||||||
|
</where>
|
||||||
|
</update>
|
||||||
|
</mapper>
|
||||||
@ -0,0 +1,46 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper
|
||||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.cyl.pms.mapper.SkuMapper">
|
||||||
|
|
||||||
|
<resultMap type="Sku" id="SkuResult">
|
||||||
|
<result property="id" column="id"/>
|
||||||
|
<result property="productId" column="product_id"/>
|
||||||
|
<result property="outSkuId" column="out_sku_id"/>
|
||||||
|
<result property="price" column="price"/>
|
||||||
|
<result property="pic" column="pic"/>
|
||||||
|
<result property="spData" column="sp_data"/>
|
||||||
|
<result property="delFlag" column="del_flag"/>
|
||||||
|
<result property="createBy" column="create_by"/>
|
||||||
|
<result property="createTime" column="create_time"/>
|
||||||
|
<result property="updateBy" column="update_by"/>
|
||||||
|
<result property="updateTime" column="update_time"/>
|
||||||
|
<result property="createBy" column="create_by"/>
|
||||||
|
<result property="createTime" column="create_time"/>
|
||||||
|
<result property="updateBy" column="update_by"/>
|
||||||
|
<result property="updateTime" column="update_time" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="selectSkuVo">
|
||||||
|
select id, product_id, out_sku_id, price, pic, sp_data, del_flag, create_by, create_time, update_by, update_time from pms_sku
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectByEntity" parameterType="Sku" resultMap="SkuResult">
|
||||||
|
<include refid="selectSkuVo"/>
|
||||||
|
<where>
|
||||||
|
<if test="productId != null "> and product_id = #{productId}</if>
|
||||||
|
<if test="outSkuId != null and outSkuId != ''"> and out_sku_id = #{outSkuId}</if>
|
||||||
|
<if test="price != null "> and price = #{price}</if>
|
||||||
|
<if test="pic != null and pic != ''"> and pic = #{pic}</if>
|
||||||
|
<if test="spData != null and spData != ''"> and sp_data = #{spData}</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<update id="updateDelFlagByIds">
|
||||||
|
update pms_sku set del_flag=1
|
||||||
|
<where>
|
||||||
|
id in <foreach collection="ids" open="(" item="it" close=")" separator=",">#{it}</foreach>
|
||||||
|
</where>
|
||||||
|
</update>
|
||||||
|
</mapper>
|
||||||
@ -0,0 +1,22 @@
|
|||||||
|
-- 菜单 SQL
|
||||||
|
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||||
|
values('品牌管理', '3', '1', 'brand', 'pms/brand/index', 1, 0, 'C', '0', '0', 'pms:brand:list', '#', 1, sysdate(), '', null, '品牌管理菜单');
|
||||||
|
|
||||||
|
-- 按钮父菜单ID
|
||||||
|
SELECT @parentId := LAST_INSERT_ID();
|
||||||
|
|
||||||
|
-- 按钮 SQL
|
||||||
|
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||||
|
values('品牌管理查询', @parentId, '1', '#', '', 1, 0, 'F', '0', '0', 'pms:brand:query', '#', 1, sysdate(), '', null, '');
|
||||||
|
|
||||||
|
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||||
|
values('品牌管理新增', @parentId, '2', '#', '', 1, 0, 'F', '0', '0', 'pms:brand:add', '#', 1, sysdate(), '', null, '');
|
||||||
|
|
||||||
|
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||||
|
values('品牌管理修改', @parentId, '3', '#', '', 1, 0, 'F', '0', '0', 'pms:brand:edit', '#', 1, sysdate(), '', null, '');
|
||||||
|
|
||||||
|
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||||
|
values('品牌管理删除', @parentId, '4', '#', '', 1, 0, 'F', '0', '0', 'pms:brand:remove', '#', 1, sysdate(), '', null, '');
|
||||||
|
|
||||||
|
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||||
|
values('品牌管理导出', @parentId, '5', '#', '', 1, 0, 'F', '0', '0', 'pms:brand:export', '#', 1, sysdate(), '', null, '');
|
||||||
@ -0,0 +1,22 @@
|
|||||||
|
-- 菜单 SQL
|
||||||
|
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||||
|
values('商品信息', '3', '1', 'product', 'pms/product/index', 1, 0, 'C', '0', '0', 'pms:product:list', '#', 1, sysdate(), '', null, '商品信息菜单');
|
||||||
|
|
||||||
|
-- 按钮父菜单ID
|
||||||
|
SELECT @parentId := LAST_INSERT_ID();
|
||||||
|
|
||||||
|
-- 按钮 SQL
|
||||||
|
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||||
|
values('商品信息查询', @parentId, '1', '#', '', 1, 0, 'F', '0', '0', 'pms:product:query', '#', 1, sysdate(), '', null, '');
|
||||||
|
|
||||||
|
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||||
|
values('商品信息新增', @parentId, '2', '#', '', 1, 0, 'F', '0', '0', 'pms:product:add', '#', 1, sysdate(), '', null, '');
|
||||||
|
|
||||||
|
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||||
|
values('商品信息修改', @parentId, '3', '#', '', 1, 0, 'F', '0', '0', 'pms:product:edit', '#', 1, sysdate(), '', null, '');
|
||||||
|
|
||||||
|
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||||
|
values('商品信息删除', @parentId, '4', '#', '', 1, 0, 'F', '0', '0', 'pms:product:remove', '#', 1, sysdate(), '', null, '');
|
||||||
|
|
||||||
|
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||||
|
values('商品信息导出', @parentId, '5', '#', '', 1, 0, 'F', '0', '0', 'pms:product:export', '#', 1, sysdate(), '', null, '');
|
||||||
@ -0,0 +1,22 @@
|
|||||||
|
-- 菜单 SQL
|
||||||
|
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||||
|
values('商品分类', '3', '1', 'productCategory', 'pms/productCategory/index', 1, 0, 'C', '0', '0', 'pms:productCategory:list', '#', 1, sysdate(), '', null, '商品分类菜单');
|
||||||
|
|
||||||
|
-- 按钮父菜单ID
|
||||||
|
SELECT @parentId := LAST_INSERT_ID();
|
||||||
|
|
||||||
|
-- 按钮 SQL
|
||||||
|
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||||
|
values('商品分类查询', @parentId, '1', '#', '', 1, 0, 'F', '0', '0', 'pms:productCategory:query', '#', 1, sysdate(), '', null, '');
|
||||||
|
|
||||||
|
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||||
|
values('商品分类新增', @parentId, '2', '#', '', 1, 0, 'F', '0', '0', 'pms:productCategory:add', '#', 1, sysdate(), '', null, '');
|
||||||
|
|
||||||
|
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||||
|
values('商品分类修改', @parentId, '3', '#', '', 1, 0, 'F', '0', '0', 'pms:productCategory:edit', '#', 1, sysdate(), '', null, '');
|
||||||
|
|
||||||
|
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||||
|
values('商品分类删除', @parentId, '4', '#', '', 1, 0, 'F', '0', '0', 'pms:productCategory:remove', '#', 1, sysdate(), '', null, '');
|
||||||
|
|
||||||
|
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||||
|
values('商品分类导出', @parentId, '5', '#', '', 1, 0, 'F', '0', '0', 'pms:productCategory:export', '#', 1, sysdate(), '', null, '');
|
||||||
@ -0,0 +1,22 @@
|
|||||||
|
-- 菜单 SQL
|
||||||
|
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||||
|
values('sku信息', '3', '1', 'sku', 'pms/sku/index', 1, 0, 'C', '0', '0', 'pms:sku:list', '#', 1, sysdate(), '', null, 'sku信息菜单');
|
||||||
|
|
||||||
|
-- 按钮父菜单ID
|
||||||
|
SELECT @parentId := LAST_INSERT_ID();
|
||||||
|
|
||||||
|
-- 按钮 SQL
|
||||||
|
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||||
|
values('sku信息查询', @parentId, '1', '#', '', 1, 0, 'F', '0', '0', 'pms:sku:query', '#', 1, sysdate(), '', null, '');
|
||||||
|
|
||||||
|
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||||
|
values('sku信息新增', @parentId, '2', '#', '', 1, 0, 'F', '0', '0', 'pms:sku:add', '#', 1, sysdate(), '', null, '');
|
||||||
|
|
||||||
|
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||||
|
values('sku信息修改', @parentId, '3', '#', '', 1, 0, 'F', '0', '0', 'pms:sku:edit', '#', 1, sysdate(), '', null, '');
|
||||||
|
|
||||||
|
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||||
|
values('sku信息删除', @parentId, '4', '#', '', 1, 0, 'F', '0', '0', 'pms:sku:remove', '#', 1, sysdate(), '', null, '');
|
||||||
|
|
||||||
|
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||||
|
values('sku信息导出', @parentId, '5', '#', '', 1, 0, 'F', '0', '0', 'pms:sku:export', '#', 1, sysdate(), '', null, '');
|
||||||
Loading…
Reference in new issue