dev798
parent
09fd7d429a
commit
a76e987cb4
|
@ -1,5 +1,7 @@
|
|||
package com.nuyu.product.domain;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.muyu.common.core.annotation.Excel;
|
||||
|
|
|
@ -0,0 +1,39 @@
|
|||
package com.nuyu.product.domain;
|
||||
|
||||
import com.muyu.common.core.annotation.Excel;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
/**
|
||||
* @Author: wangxinyuan
|
||||
* @Date: 2024/4/28 下午7:54
|
||||
*/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class MallProductInfo extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 商品id */
|
||||
private Long productId;
|
||||
|
||||
/** 商品名称 */
|
||||
@Excel(name = "商品名称")
|
||||
private String productName;
|
||||
|
||||
/** 商品货号 */
|
||||
@Excel(name = "商品货号")
|
||||
private String productNumber;
|
||||
|
||||
/** 单位 */
|
||||
@Excel(name = "单位")
|
||||
private String productUnit;
|
||||
|
||||
}
|
|
@ -1,8 +1,6 @@
|
|||
package com.nuyu.product.domain;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.muyu.common.core.annotation.Excel;
|
||||
|
|
|
@ -1,10 +1,25 @@
|
|||
package com.muyu.product.controller;
|
||||
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.muyu.common.core.utils.poi.ExcelUtil;
|
||||
import com.muyu.common.core.web.domain.AjaxResult;
|
||||
import com.muyu.common.log.annotation.Log;
|
||||
import com.muyu.common.log.enums.BusinessType;
|
||||
import com.muyu.common.security.annotation.RequiresPermissions;
|
||||
import com.muyu.product.service.MallProductInfoService;
|
||||
import com.nuyu.product.domain.MallProductBrandInfo;
|
||||
import com.nuyu.product.domain.MallProductInfo;
|
||||
import com.nuyu.product.req.BookReq;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
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.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: wangxinyuan
|
||||
* @Date: 2024/4/28 下午7:22
|
||||
|
@ -15,4 +30,24 @@ public class MallProductInfoController {
|
|||
|
||||
@Autowired
|
||||
private MallProductInfoService mallProductInfoService;
|
||||
|
||||
|
||||
@ApiOperation("查询商品列表")
|
||||
@GetMapping("/list")
|
||||
@RequiresPermissions("product:info:list")
|
||||
public AjaxResult list(BookReq bookReq){
|
||||
PageInfo<MallProductInfo> info=mallProductInfoService.list(bookReq);
|
||||
return AjaxResult.success(info);
|
||||
}
|
||||
|
||||
@ApiOperation("导出商品列表")
|
||||
@RequiresPermissions("product:info:export")
|
||||
@Log(title = "商品",businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, MallProductInfo mallProductInfo){
|
||||
List<MallProductInfo> list=mallProductInfoService.selectMallProductInfoList(mallProductInfo);
|
||||
ExcelUtil<MallProductInfo> util = new ExcelUtil<MallProductInfo>(MallProductInfo.class);
|
||||
util.exportExcel(response, list, "商品品牌数据");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -21,7 +21,7 @@ import java.util.List;
|
|||
* @Date: 2024/4/26 上午11:23
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/info")
|
||||
@RequestMapping("/test")
|
||||
public class PurController {
|
||||
|
||||
|
||||
|
|
|
@ -1,7 +1,11 @@
|
|||
package com.muyu.product.mapper;
|
||||
|
||||
import com.nuyu.product.domain.MallProductInfo;
|
||||
import com.nuyu.product.req.BookReq;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: wangxinyuan
|
||||
* @Date: 2024/4/28 下午7:22
|
||||
|
@ -9,4 +13,7 @@ import org.apache.ibatis.annotations.Mapper;
|
|||
@Mapper
|
||||
public interface MallProductInfoMapper {
|
||||
|
||||
List<MallProductInfo> list(BookReq bookReq);
|
||||
|
||||
List<MallProductInfo> selectMallProductInfoList(MallProductInfo mallProductInfo);
|
||||
}
|
||||
|
|
|
@ -1,12 +1,36 @@
|
|||
package com.muyu.product.service.Impl;
|
||||
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.muyu.product.mapper.MallProductInfoMapper;
|
||||
import com.muyu.product.service.MallProductInfoService;
|
||||
import com.nuyu.product.domain.MallProductBrandInfo;
|
||||
import com.nuyu.product.domain.MallProductInfo;
|
||||
import com.nuyu.product.req.BookReq;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: wangxinyuan
|
||||
* @Date: 2024/4/28 下午7:22
|
||||
*/
|
||||
@Service
|
||||
public class MallProductInfoServiceImpl implements MallProductInfoService {
|
||||
|
||||
@Autowired
|
||||
private MallProductInfoMapper mallProductInfoMapper;
|
||||
@Override
|
||||
public PageInfo<MallProductInfo> list(BookReq bookReq) {
|
||||
PageHelper.startPage(bookReq.getPageNum(), bookReq.getPageSize());
|
||||
List<MallProductInfo>list=mallProductInfoMapper.list(bookReq);
|
||||
PageInfo<MallProductInfo>pageInfo=new PageInfo<>(list);
|
||||
return pageInfo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MallProductInfo> selectMallProductInfoList(MallProductInfo mallProductInfo) {
|
||||
return mallProductInfoMapper.selectMallProductInfoList(mallProductInfo);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,8 +1,19 @@
|
|||
package com.muyu.product.service;
|
||||
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.nuyu.product.domain.MallProductBrandInfo;
|
||||
import com.nuyu.product.domain.MallProductInfo;
|
||||
import com.nuyu.product.req.BookReq;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: wangxinyuan
|
||||
* @Date: 2024/4/28 下午7:22
|
||||
*/
|
||||
public interface MallProductInfoService {
|
||||
|
||||
PageInfo<MallProductInfo> list(BookReq bookReq);
|
||||
|
||||
List<MallProductInfo> selectMallProductInfoList(MallProductInfo mallProductInfo);
|
||||
}
|
||||
|
|
|
@ -4,4 +4,17 @@
|
|||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.muyu.product.mapper.MallProductInfoMapper">
|
||||
|
||||
<sql id="selectMallProductTypeInfoVo">
|
||||
select id, product_name , product_number , product_unit from t_product
|
||||
</sql>
|
||||
|
||||
<select id="list" resultType="com.nuyu.product.domain.MallProductInfo">
|
||||
<include refid="selectMallProductTypeInfoVo"/>
|
||||
</select>
|
||||
|
||||
<select id="selectMallProductInfoList" resultType="com.nuyu.product.domain.MallProductInfo">
|
||||
<include refid="selectMallProductTypeInfoVo"/>
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
|
|
Loading…
Reference in New Issue