dev798
parent
ed4e2cb188
commit
09fd7d429a
|
@ -1,25 +0,0 @@
|
|||
package com.nuyu.product.dto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @Author: wangxinyuan
|
||||
* @Date: 2024/4/23 下午7:30
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class Book {
|
||||
|
||||
private Integer bookId;
|
||||
|
||||
private String bookName;
|
||||
|
||||
private String bookSex;
|
||||
|
||||
private String bookAge;
|
||||
|
||||
|
||||
}
|
|
@ -1,5 +1,6 @@
|
|||
package com.nuyu.product.req;
|
||||
|
||||
import com.muyu.common.core.annotation.Excel;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
@ -14,15 +15,47 @@ import lombok.NoArgsConstructor;
|
|||
@NoArgsConstructor
|
||||
public class BookReq {
|
||||
|
||||
private Integer bookId;
|
||||
/** 分类id */
|
||||
private Long catId;
|
||||
|
||||
/** 分类名称 */
|
||||
@Excel(name = "分类名称")
|
||||
private String name;
|
||||
|
||||
private String bookSex;
|
||||
/** 父分类id */
|
||||
@Excel(name = "父分类id")
|
||||
private Long parentCid;
|
||||
|
||||
private String bookAge;
|
||||
/** 层级 */
|
||||
@Excel(name = "层级")
|
||||
private Long catLevel;
|
||||
|
||||
private Integer pageSize=3;
|
||||
/** 是否显示[0-不显示,1显示] */
|
||||
@Excel(name = "是否显示[0-不显示,1显示]")
|
||||
private Integer showStatus;
|
||||
|
||||
/** 排序 */
|
||||
@Excel(name = "排序")
|
||||
private Long sort;
|
||||
|
||||
/** 图标地址 */
|
||||
@Excel(name = "图标地址")
|
||||
private String icon;
|
||||
|
||||
/** 计量单位 */
|
||||
@Excel(name = "计量单位")
|
||||
private String productUnit;
|
||||
|
||||
/** 商品数量 */
|
||||
@Excel(name = "商品数量")
|
||||
private Long productCount;
|
||||
|
||||
/** 乐观锁 */
|
||||
@Excel(name = "乐观锁")
|
||||
private Long revision;
|
||||
|
||||
|
||||
private Integer pageSize=10;
|
||||
|
||||
private Integer pageNum=1;
|
||||
}
|
||||
|
|
|
@ -8,7 +8,6 @@ import com.github.pagehelper.PageInfo;
|
|||
import com.muyu.common.core.web.domain.AjaxResult;
|
||||
import com.muyu.product.service.MallProductBrandInfoService;
|
||||
import com.nuyu.product.domain.MallProductBrandInfo;
|
||||
import com.nuyu.product.domain.MallProductTypeInfo;
|
||||
import com.nuyu.product.req.BookReq;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
@ -42,9 +41,7 @@ public class MallProductBrandInfoController extends BaseController
|
|||
@Autowired
|
||||
private MallProductBrandInfoService mallProductBrandInfoService;
|
||||
|
||||
/**
|
||||
* 查询商品品牌列表
|
||||
*/
|
||||
|
||||
@GetMapping("/test")
|
||||
@RequiresPermissions("product:brand:test")
|
||||
public Result<TableDataInfo<MallProductBrandInfo>> list(MallProductBrandInfo mallProductBrandInfo)
|
||||
|
@ -54,7 +51,10 @@ public class MallProductBrandInfoController extends BaseController
|
|||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@ApiOperation("三级分类列表")
|
||||
/**
|
||||
* 查询商品品牌列表
|
||||
*/
|
||||
@ApiOperation("查询商品品牌列表")
|
||||
@GetMapping("/list")
|
||||
@RequiresPermissions("product:brand:list")
|
||||
public AjaxResult list(BookReq bookReq){
|
||||
|
@ -65,12 +65,13 @@ public class MallProductBrandInfoController extends BaseController
|
|||
/**
|
||||
* 导出商品品牌列表
|
||||
*/
|
||||
@ApiOperation("导出商品品牌列表")
|
||||
@RequiresPermissions("product:brand:export")
|
||||
@Log(title = "商品品牌", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, MallProductBrandInfo mallProductBrandInfo)
|
||||
{
|
||||
List<MallProductBrandInfo> list = mallProductBrandInfoService.selectMallProductBrandInfoList(mallProductBrandInfo);
|
||||
List<MallProductBrandInfo> list = mallProductBrandInfoService.selectMallProductBrandList(mallProductBrandInfo);
|
||||
ExcelUtil<MallProductBrandInfo> util = new ExcelUtil<MallProductBrandInfo>(MallProductBrandInfo.class);
|
||||
util.exportExcel(response, list, "商品品牌数据");
|
||||
}
|
||||
|
@ -78,6 +79,7 @@ public class MallProductBrandInfoController extends BaseController
|
|||
/**
|
||||
* 获取商品品牌详细信息
|
||||
*/
|
||||
@ApiOperation("获取商品品牌详细信息")
|
||||
@RequiresPermissions("product:brand:query")
|
||||
@GetMapping(value = "/{id}")
|
||||
public Result getInfo(@PathVariable("id") Long id)
|
||||
|
@ -88,6 +90,7 @@ public class MallProductBrandInfoController extends BaseController
|
|||
/**
|
||||
* 新增商品品牌
|
||||
*/
|
||||
@ApiOperation("新增商品品牌")
|
||||
@RequiresPermissions("product:brand:add")
|
||||
@Log(title = "商品品牌", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
|
@ -99,6 +102,7 @@ public class MallProductBrandInfoController extends BaseController
|
|||
/**
|
||||
* 修改商品品牌
|
||||
*/
|
||||
@ApiOperation("修改商品品牌")
|
||||
@RequiresPermissions("product:brand:edit")
|
||||
@Log(title = "商品品牌", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
|
@ -110,6 +114,7 @@ public class MallProductBrandInfoController extends BaseController
|
|||
/**
|
||||
* 删除商品品牌
|
||||
*/
|
||||
@ApiOperation("删除商品品牌")
|
||||
@RequiresPermissions("product:brand:remove")
|
||||
@Log(title = "商品品牌", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
package com.muyu.product.controller;
|
||||
|
||||
import com.muyu.product.service.MallProductInfoService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* @Author: wangxinyuan
|
||||
* @Date: 2024/4/28 下午7:22
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/info")
|
||||
public class MallProductInfoController {
|
||||
|
||||
@Autowired
|
||||
private MallProductInfoService mallProductInfoService;
|
||||
}
|
|
@ -43,12 +43,7 @@ public class MallProductTypeInfoController extends BaseController
|
|||
@Autowired
|
||||
private MallProductTypeInfoService mallProductTypeInfoService;
|
||||
|
||||
/**
|
||||
* 查询商品三级分类列表
|
||||
*/
|
||||
/**
|
||||
* 查询商品三级分类列表
|
||||
*/
|
||||
|
||||
@GetMapping("/test")
|
||||
@RequiresPermissions("product:type:test")
|
||||
public Result<TableDataInfo<MallProductTypeInfo>> list(MallProductTypeInfo mallProductTypeInfo)
|
||||
|
@ -58,7 +53,13 @@ public class MallProductTypeInfoController extends BaseController
|
|||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@ApiOperation("三级分类列表")
|
||||
/**
|
||||
* 查询商品三级分类列表
|
||||
*/
|
||||
/**
|
||||
* 查询商品三级分类列表
|
||||
*/
|
||||
@ApiOperation("查询三级分类列表")
|
||||
@GetMapping("/list")
|
||||
@RequiresPermissions("product:type:list")
|
||||
public AjaxResult list(BookReq bookReq){
|
||||
|
@ -69,6 +70,7 @@ public class MallProductTypeInfoController extends BaseController
|
|||
/**
|
||||
* 导出商品三级分类列表
|
||||
*/
|
||||
@ApiOperation("导出商品三级分类列表")
|
||||
@RequiresPermissions("product:type:export")
|
||||
@Log(title = "商品三级分类", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
|
@ -82,6 +84,7 @@ public class MallProductTypeInfoController extends BaseController
|
|||
/**
|
||||
* 获取商品三级分类详细信息
|
||||
*/
|
||||
@ApiOperation("获取商品三级分类详细信息")
|
||||
@RequiresPermissions("product:type:query")
|
||||
@GetMapping(value = "/{catId}")
|
||||
public Result getInfo(@PathVariable("catId") Long catId)
|
||||
|
@ -92,6 +95,7 @@ public class MallProductTypeInfoController extends BaseController
|
|||
/**
|
||||
* 新增商品三级分类
|
||||
*/
|
||||
@ApiOperation("新增商品三级分类")
|
||||
@RequiresPermissions("product:type:add")
|
||||
@Log(title = "商品三级分类", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
|
@ -103,6 +107,7 @@ public class MallProductTypeInfoController extends BaseController
|
|||
/**
|
||||
* 修改商品三级分类
|
||||
*/
|
||||
@ApiOperation("修改商品三级分类")
|
||||
@RequiresPermissions("product:type:edit")
|
||||
@Log(title = "商品三级分类", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
|
@ -114,6 +119,7 @@ public class MallProductTypeInfoController extends BaseController
|
|||
/**
|
||||
* 删除商品三级分类
|
||||
*/
|
||||
@ApiOperation("删除商品三级分类")
|
||||
@RequiresPermissions("product:type:remove")
|
||||
@Log(title = "商品三级分类", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{catIds}")
|
||||
|
|
|
@ -65,4 +65,6 @@ public interface MallProductBrandInfoMapper
|
|||
public int deleteMallProductBrandInfoByIds(Long[] ids);
|
||||
|
||||
List<MallProductBrandInfo> list(BookReq bookReq);
|
||||
|
||||
List<MallProductBrandInfo> selectMallProductBrandList(MallProductBrandInfo mallProductBrandInfo);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
package com.muyu.product.mapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* @Author: wangxinyuan
|
||||
* @Date: 2024/4/28 下午7:22
|
||||
*/
|
||||
@Mapper
|
||||
public interface MallProductInfoMapper {
|
||||
|
||||
}
|
|
@ -39,7 +39,7 @@ public class MallProductBrandInfoServiceImpl implements MallProductBrandInfoServ
|
|||
|
||||
/**
|
||||
* 查询商品品牌列表
|
||||
*
|
||||
*selectMallProductBrandList
|
||||
* @param mallProductBrandInfo 商品品牌
|
||||
* @return 商品品牌
|
||||
*/
|
||||
|
@ -106,4 +106,10 @@ public class MallProductBrandInfoServiceImpl implements MallProductBrandInfoServ
|
|||
PageInfo<MallProductBrandInfo> pageInfo = new PageInfo<>(products);
|
||||
return pageInfo;
|
||||
}
|
||||
|
||||
//导出
|
||||
@Override
|
||||
public List<MallProductBrandInfo> selectMallProductBrandList(MallProductBrandInfo mallProductBrandInfo) {
|
||||
return mallProductBrandInfoMapper.selectMallProductBrandList(mallProductBrandInfo);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
package com.muyu.product.service.Impl;
|
||||
|
||||
import com.muyu.product.service.MallProductInfoService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @Author: wangxinyuan
|
||||
* @Date: 2024/4/28 下午7:22
|
||||
*/
|
||||
@Service
|
||||
public class MallProductInfoServiceImpl implements MallProductInfoService {
|
||||
}
|
|
@ -65,4 +65,7 @@ public interface MallProductBrandInfoService
|
|||
|
||||
//列表
|
||||
PageInfo<MallProductBrandInfo> list(BookReq bookReq);
|
||||
|
||||
//导出
|
||||
List<MallProductBrandInfo> selectMallProductBrandList(MallProductBrandInfo mallProductBrandInfo);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
package com.muyu.product.service;
|
||||
|
||||
/**
|
||||
* @Author: wangxinyuan
|
||||
* @Date: 2024/4/28 下午7:22
|
||||
*/
|
||||
public interface MallProductInfoService {
|
||||
}
|
|
@ -41,6 +41,13 @@
|
|||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectMallProductBrandList" resultType="com.nuyu.product.domain.MallProductBrandInfo">
|
||||
<include refid="selectMallProductBrandInfoVo"/>
|
||||
<where>
|
||||
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<insert id="insertMallProductBrandInfo" parameterType="com.nuyu.product.domain.MallProductBrandInfo" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into mall_product_brand_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
<?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.muyu.product.mapper.MallProductInfoMapper">
|
||||
|
||||
</mapper>
|
|
@ -35,6 +35,9 @@
|
|||
<select id="list" resultType="com.nuyu.product.domain.MallProductTypeInfo">
|
||||
<include refid="selectMallProductTypeInfoVo"/>
|
||||
<where>
|
||||
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
||||
<if test="sort != null "> and sort = #{sort}</if>
|
||||
<if test="productCount != null "> and product_count = #{productCount}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
|
Loading…
Reference in New Issue