chen 2 лет назад
Родитель
Сommit
5a38d265a5
22 измененных файлов с 1406 добавлено и 0 удалено
  1. 151 0
      src/main/java/org/springblade/modules/pl/product/controller/ProductController.java
  2. 34 0
      src/main/java/org/springblade/modules/pl/product/dto/ProductDTO.java
  3. 130 0
      src/main/java/org/springblade/modules/pl/product/entity/ProductEntity.java
  4. 165 0
      src/main/java/org/springblade/modules/pl/product/excel/ProductExcel.java
  5. 54 0
      src/main/java/org/springblade/modules/pl/product/mapper/ProductMapper.java
  6. 46 0
      src/main/java/org/springblade/modules/pl/product/mapper/ProductMapper.xml
  7. 52 0
      src/main/java/org/springblade/modules/pl/product/service/IProductService.java
  8. 54 0
      src/main/java/org/springblade/modules/pl/product/service/impl/ProductServiceImpl.java
  9. 35 0
      src/main/java/org/springblade/modules/pl/product/vo/ProductVO.java
  10. 50 0
      src/main/java/org/springblade/modules/pl/product/wrapper/ProductWrapper.java
  11. 151 0
      src/main/java/org/springblade/modules/pl/productBatch/controller/ProductBatchController.java
  12. 34 0
      src/main/java/org/springblade/modules/pl/productBatch/dto/ProductBatchDTO.java
  13. 65 0
      src/main/java/org/springblade/modules/pl/productBatch/entity/ProductBatchEntity.java
  14. 87 0
      src/main/java/org/springblade/modules/pl/productBatch/excel/ProductBatchExcel.java
  15. 54 0
      src/main/java/org/springblade/modules/pl/productBatch/mapper/ProductBatchMapper.java
  16. 33 0
      src/main/java/org/springblade/modules/pl/productBatch/mapper/ProductBatchMapper.xml
  17. 52 0
      src/main/java/org/springblade/modules/pl/productBatch/service/IProductBatchService.java
  18. 54 0
      src/main/java/org/springblade/modules/pl/productBatch/service/impl/ProductBatchServiceImpl.java
  19. 35 0
      src/main/java/org/springblade/modules/pl/productBatch/vo/ProductBatchVO.java
  20. 50 0
      src/main/java/org/springblade/modules/pl/productBatch/wrapper/ProductBatchWrapper.java
  21. 10 0
      src/main/java/sql/product.menu.sql
  22. 10 0
      src/main/java/sql/productbatch.menu.sql

+ 151 - 0
src/main/java/org/springblade/modules/pl/product/controller/ProductController.java

@@ -0,0 +1,151 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.modules.pl.product.controller;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import lombok.AllArgsConstructor;
+import javax.validation.Valid;
+
+import org.springblade.core.secure.BladeUser;
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.mp.support.Query;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.Func;
+import org.springframework.web.bind.annotation.*;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.modules.pl.product.entity.ProductEntity;
+import org.springblade.modules.pl.product.vo.ProductVO;
+import org.springblade.modules.pl.product.excel.ProductExcel;
+import org.springblade.modules.pl.product.wrapper.ProductWrapper;
+import org.springblade.modules.pl.product.service.IProductService;
+import org.springblade.core.boot.ctrl.BladeController;
+import org.springblade.core.tool.utils.DateUtil;
+import org.springblade.core.excel.util.ExcelUtil;
+import org.springblade.core.tool.constant.BladeConstant;
+import springfox.documentation.annotations.ApiIgnore;
+import java.util.Map;
+import java.util.List;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ * 商品表 控制器
+ *
+ * @author BladeX
+ * @since 2023-12-04
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("blade-product/product")
+@Api(value = "商品表", tags = "商品表接口")
+public class ProductController extends BladeController {
+
+	private final IProductService productService;
+
+	/**
+	 * 商品表 详情
+	 */
+	@GetMapping("/detail")
+	@ApiOperationSupport(order = 1)
+	@ApiOperation(value = "详情", notes = "传入product")
+	public R<ProductVO> detail(ProductEntity product) {
+		ProductEntity detail = productService.getOne(Condition.getQueryWrapper(product));
+		return R.data(ProductWrapper.build().entityVO(detail));
+	}
+	/**
+	 * 商品表 分页
+	 */
+	@GetMapping("/list")
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "分页", notes = "传入product")
+	public R<IPage<ProductVO>> list(@ApiIgnore @RequestParam Map<String, Object> product, Query query) {
+		IPage<ProductEntity> pages = productService.page(Condition.getPage(query), Condition.getQueryWrapper(product, ProductEntity.class));
+		return R.data(ProductWrapper.build().pageVO(pages));
+	}
+
+	/**
+	 * 商品表 自定义分页
+	 */
+	@GetMapping("/page")
+	@ApiOperationSupport(order = 3)
+	@ApiOperation(value = "分页", notes = "传入product")
+	public R<IPage<ProductVO>> page(ProductVO product, Query query) {
+		IPage<ProductVO> pages = productService.selectProductPage(Condition.getPage(query), product);
+		return R.data(pages);
+	}
+
+	/**
+	 * 商品表 新增
+	 */
+	@PostMapping("/save")
+	@ApiOperationSupport(order = 4)
+	@ApiOperation(value = "新增", notes = "传入product")
+	public R save(@Valid @RequestBody ProductEntity product) {
+		return R.status(productService.save(product));
+	}
+
+	/**
+	 * 商品表 修改
+	 */
+	@PostMapping("/update")
+	@ApiOperationSupport(order = 5)
+	@ApiOperation(value = "修改", notes = "传入product")
+	public R update(@Valid @RequestBody ProductEntity product) {
+		return R.status(productService.updateById(product));
+	}
+
+	/**
+	 * 商品表 新增或修改
+	 */
+	@PostMapping("/submit")
+	@ApiOperationSupport(order = 6)
+	@ApiOperation(value = "新增或修改", notes = "传入product")
+	public R submit(@Valid @RequestBody ProductEntity product) {
+		return R.status(productService.saveOrUpdate(product));
+	}
+
+	/**
+	 * 商品表 删除
+	 */
+	@PostMapping("/remove")
+	@ApiOperationSupport(order = 7)
+	@ApiOperation(value = "逻辑删除", notes = "传入ids")
+	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+		return R.status(productService.deleteLogic(Func.toLongList(ids)));
+	}
+
+
+	/**
+	 * 导出数据
+	 */
+	@GetMapping("/export-product")
+	@ApiOperationSupport(order = 9)
+	@ApiOperation(value = "导出数据", notes = "传入product")
+	public void exportProduct(@ApiIgnore @RequestParam Map<String, Object> product, BladeUser bladeUser, HttpServletResponse response) {
+		QueryWrapper<ProductEntity> queryWrapper = Condition.getQueryWrapper(product, ProductEntity.class);
+		//if (!AuthUtil.isAdministrator()) {
+		//	queryWrapper.lambda().eq(Product::getTenantId, bladeUser.getTenantId());
+		//}
+		queryWrapper.lambda().eq(ProductEntity::getIsDeleted, BladeConstant.DB_NOT_DELETED);
+		List<ProductExcel> list = productService.exportProduct(queryWrapper);
+		ExcelUtil.export(response, "商品表数据" + DateUtil.time(), "商品表数据表", list, ProductExcel.class);
+	}
+
+}

+ 34 - 0
src/main/java/org/springblade/modules/pl/product/dto/ProductDTO.java

@@ -0,0 +1,34 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.modules.pl.product.dto;
+
+import org.springblade.modules.pl.product.entity.ProductEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 商品表 数据传输对象实体类
+ *
+ * @author BladeX
+ * @since 2023-12-04
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class ProductDTO extends ProductEntity {
+	private static final long serialVersionUID = 1L;
+
+}

+ 130 - 0
src/main/java/org/springblade/modules/pl/product/entity/ProductEntity.java

@@ -0,0 +1,130 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.modules.pl.product.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.util.Date;
+import lombok.EqualsAndHashCode;
+import org.springblade.core.tenant.mp.TenantEntity;
+
+/**
+ * 商品表 实体类
+ *
+ * @author BladeX
+ * @since 2023-12-04
+ */
+@Data
+@TableName("pl_product")
+@ApiModel(value = "Product对象", description = "商品表")
+@EqualsAndHashCode(callSuper = true)
+public class ProductEntity extends TenantEntity {
+
+	/**
+	 * 所属工厂
+	 */
+	@ApiModelProperty(value = "所属工厂")
+	private Long factoryId;
+	/**
+	 * 所属客户
+	 */
+	@ApiModelProperty(value = "所属客户")
+	private Long clientId;
+	/**
+	 * 批次id
+	 */
+	@ApiModelProperty(value = "批次id")
+	private Long batchId;
+	/**
+	 * 批次号
+	 */
+	@ApiModelProperty(value = "批次号")
+	private String batchNo;
+	/**
+	 * 商品型号id
+	 */
+	@ApiModelProperty(value = "商品型号id")
+	private Long productModelId;
+	/**
+	 * 商品名称
+	 */
+	@ApiModelProperty(value = "商品名称")
+	private String productName;
+	/**
+	 * 商品型号
+	 */
+	@ApiModelProperty(value = "商品型号")
+	private String productModel;
+	/**
+	 * 正面图片
+	 */
+	@ApiModelProperty(value = "正面图片")
+	private String frontImg;
+	/**
+	 * 背面图片
+	 */
+	@ApiModelProperty(value = "背面图片")
+	private String backImg;
+	/**
+	 * 扫码日期
+	 */
+	@ApiModelProperty(value = "扫码日期")
+	private String scanDate;
+	/**
+	 * 二维码编号
+	 */
+	@ApiModelProperty(value = "二维码编号")
+	private String qrCode;
+	/**
+	 * 水冷
+	 */
+	@ApiModelProperty(value = "水冷")
+	private String waterCooling;
+	/**
+	 * 气密
+	 */
+	@ApiModelProperty(value = "气密")
+	private String airtight;
+	/**
+	 * 订单号
+	 */
+	@ApiModelProperty(value = "订单号")
+	private String orderNo;
+	/**
+	 * 出货批次
+	 */
+	@ApiModelProperty(value = "出货批次")
+	private String shipmentBatch;
+	/**
+	 * 冷板二维码
+	 */
+	@ApiModelProperty(value = "冷板二维码")
+	private String coldQrCode;
+	/**
+	 * 检测结果(1合格 2不合格)
+	 */
+	@ApiModelProperty(value = "检测结果(1合格 2不合格)")
+	private String checkResult;
+	/**
+	 * 入库时间
+	 */
+	@ApiModelProperty(value = "入库时间")
+	private Date inStockDate;
+
+}

+ 165 - 0
src/main/java/org/springblade/modules/pl/product/excel/ProductExcel.java

@@ -0,0 +1,165 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.modules.pl.product.excel;
+
+
+import lombok.Data;
+
+import java.util.Date;
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.alibaba.excel.annotation.write.style.ColumnWidth;
+import com.alibaba.excel.annotation.write.style.ContentRowHeight;
+import com.alibaba.excel.annotation.write.style.HeadRowHeight;
+import java.io.Serializable;
+
+
+/**
+ * 商品表 Excel实体类
+ *
+ * @author BladeX
+ * @since 2023-12-04
+ */
+@Data
+@ColumnWidth(25)
+@HeadRowHeight(20)
+@ContentRowHeight(18)
+public class ProductExcel implements Serializable {
+
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * 租户ID
+	 */
+	@ColumnWidth(20)
+	@ExcelProperty("租户ID")
+	private String tenantId;
+	/**
+	 * 所属工厂
+	 */
+	@ColumnWidth(20)
+	@ExcelProperty("所属工厂")
+	private Long factoryId;
+	/**
+	 * 所属客户
+	 */
+	@ColumnWidth(20)
+	@ExcelProperty("所属客户")
+	private Long clientId;
+	/**
+	 * 批次id
+	 */
+	@ColumnWidth(20)
+	@ExcelProperty("批次id")
+	private Long batchId;
+	/**
+	 * 批次号
+	 */
+	@ColumnWidth(20)
+	@ExcelProperty("批次号")
+	private String batchNo;
+	/**
+	 * 商品型号id
+	 */
+	@ColumnWidth(20)
+	@ExcelProperty("商品型号id")
+	private Long productModelId;
+	/**
+	 * 商品名称
+	 */
+	@ColumnWidth(20)
+	@ExcelProperty("商品名称")
+	private String productName;
+	/**
+	 * 商品型号
+	 */
+	@ColumnWidth(20)
+	@ExcelProperty("商品型号")
+	private String productModel;
+	/**
+	 * 正面图片
+	 */
+	@ColumnWidth(20)
+	@ExcelProperty("正面图片")
+	private String frontImg;
+	/**
+	 * 背面图片
+	 */
+	@ColumnWidth(20)
+	@ExcelProperty("背面图片")
+	private String backImg;
+	/**
+	 * 扫码日期
+	 */
+	@ColumnWidth(20)
+	@ExcelProperty("扫码日期")
+	private String scanDate;
+	/**
+	 * 二维码编号
+	 */
+	@ColumnWidth(20)
+	@ExcelProperty("二维码编号")
+	private String qrCode;
+	/**
+	 * 水冷
+	 */
+	@ColumnWidth(20)
+	@ExcelProperty("水冷")
+	private String waterCooling;
+	/**
+	 * 气密
+	 */
+	@ColumnWidth(20)
+	@ExcelProperty("气密")
+	private String airtight;
+	/**
+	 * 订单号
+	 */
+	@ColumnWidth(20)
+	@ExcelProperty("订单号")
+	private String orderNo;
+	/**
+	 * 出货批次
+	 */
+	@ColumnWidth(20)
+	@ExcelProperty("出货批次")
+	private String shipmentBatch;
+	/**
+	 * 冷板二维码
+	 */
+	@ColumnWidth(20)
+	@ExcelProperty("冷板二维码")
+	private String coldQrCode;
+	/**
+	 * 检测结果(1合格 2不合格)
+	 */
+	@ColumnWidth(20)
+	@ExcelProperty("检测结果(1合格 2不合格)")
+	private String checkResult;
+	/**
+	 * 入库时间
+	 */
+	@ColumnWidth(20)
+	@ExcelProperty("入库时间")
+	private Date inStockDate;
+	/**
+	 * 是否已删除
+	 */
+	@ColumnWidth(20)
+	@ExcelProperty("是否已删除")
+	private Integer isDeleted;
+
+}

+ 54 - 0
src/main/java/org/springblade/modules/pl/product/mapper/ProductMapper.java

@@ -0,0 +1,54 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.modules.pl.product.mapper;
+
+import org.springblade.modules.pl.product.entity.ProductEntity;
+import org.springblade.modules.pl.product.vo.ProductVO;
+import org.springblade.modules.pl.product.excel.ProductExcel;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.conditions.Wrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.apache.ibatis.annotations.Param;
+import java.util.List;
+
+/**
+ * 商品表 Mapper 接口
+ *
+ * @author BladeX
+ * @since 2023-12-04
+ */
+public interface ProductMapper extends BaseMapper<ProductEntity> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param product
+	 * @return
+	 */
+	List<ProductVO> selectProductPage(IPage page, ProductVO product);
+
+
+	/**
+	 * 获取导出数据
+	 *
+	 * @param queryWrapper
+	 * @return
+	 */
+	List<ProductExcel> exportProduct(@Param("ew") Wrapper<ProductEntity> queryWrapper);
+
+}

+ 46 - 0
src/main/java/org/springblade/modules/pl/product/mapper/ProductMapper.xml

@@ -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="org.springblade.modules.pl.product.mapper.ProductMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="productResultMap" type="org.springblade.modules.pl.product.entity.ProductEntity">
+        <result column="id" property="id"/>
+        <result column="tenant_id" property="tenantId"/>
+        <result column="factory_id" property="factoryId"/>
+        <result column="client_id" property="clientId"/>
+        <result column="batch_id" property="batchId"/>
+        <result column="batch_no" property="batchNo"/>
+        <result column="product_model_id" property="productModelId"/>
+        <result column="product_name" property="productName"/>
+        <result column="product_model" property="productModel"/>
+        <result column="front_img" property="frontImg"/>
+        <result column="back_img" property="backImg"/>
+        <result column="scan_date" property="scanDate"/>
+        <result column="qr_code" property="qrCode"/>
+        <result column="water_cooling" property="waterCooling"/>
+        <result column="airtight" property="airtight"/>
+        <result column="order_no" property="orderNo"/>
+        <result column="shipment_batch" property="shipmentBatch"/>
+        <result column="cold_qr_code" property="coldQrCode"/>
+        <result column="check_result" property="checkResult"/>
+        <result column="in_stock_date" property="inStockDate"/>
+        <result column="create_user" property="createUser"/>
+        <result column="create_dept" property="createDept"/>
+        <result column="create_time" property="createTime"/>
+        <result column="update_user" property="updateUser"/>
+        <result column="update_time" property="updateTime"/>
+        <result column="status" property="status"/>
+        <result column="is_deleted" property="isDeleted"/>
+    </resultMap>
+
+
+    <select id="selectProductPage" resultMap="productResultMap">
+        select * from pl_product where is_deleted = 0
+    </select>
+
+
+    <select id="exportProduct" resultType="org.springblade.modules.pl.product.excel.ProductExcel">
+        SELECT * FROM pl_product ${ew.customSqlSegment}
+    </select>
+
+</mapper>

+ 52 - 0
src/main/java/org/springblade/modules/pl/product/service/IProductService.java

@@ -0,0 +1,52 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.modules.pl.product.service;
+
+import com.baomidou.mybatisplus.core.conditions.Wrapper;
+import org.springblade.modules.pl.product.entity.ProductEntity;
+import org.springblade.modules.pl.product.vo.ProductVO;
+import org.springblade.modules.pl.product.excel.ProductExcel;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.core.mp.base.BaseService;
+import java.util.List;
+
+/**
+ * 商品表 服务类
+ *
+ * @author BladeX
+ * @since 2023-12-04
+ */
+public interface IProductService extends BaseService<ProductEntity> {
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param product
+	 * @return
+	 */
+	IPage<ProductVO> selectProductPage(IPage<ProductVO> page, ProductVO product);
+
+
+	/**
+	 * 导出数据
+	 *
+	 * @param queryWrapper
+	 * @return
+	 */
+	List<ProductExcel> exportProduct(Wrapper<ProductEntity> queryWrapper);
+
+}

+ 54 - 0
src/main/java/org/springblade/modules/pl/product/service/impl/ProductServiceImpl.java

@@ -0,0 +1,54 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.modules.pl.product.service.impl;
+
+import org.springblade.modules.pl.product.entity.ProductEntity;
+import org.springblade.modules.pl.product.vo.ProductVO;
+import org.springblade.modules.pl.product.excel.ProductExcel;
+import org.springblade.modules.pl.product.mapper.ProductMapper;
+import org.springblade.modules.pl.product.service.IProductService;
+import org.springframework.stereotype.Service;
+import com.baomidou.mybatisplus.core.conditions.Wrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.core.mp.base.BaseServiceImpl;
+import java.util.List;
+
+/**
+ * 商品表 服务实现类
+ *
+ * @author BladeX
+ * @since 2023-12-04
+ */
+@Service
+public class ProductServiceImpl extends BaseServiceImpl<ProductMapper, ProductEntity> implements IProductService {
+
+	@Override
+	public IPage<ProductVO> selectProductPage(IPage<ProductVO> page, ProductVO product) {
+		return page.setRecords(baseMapper.selectProductPage(page, product));
+	}
+
+
+	@Override
+	public List<ProductExcel> exportProduct(Wrapper<ProductEntity> queryWrapper) {
+		List<ProductExcel> productList = baseMapper.exportProduct(queryWrapper);
+		//productList.forEach(product -> {
+		//	product.setTypeName(DictCache.getValue(DictEnum.YES_NO, Product.getType()));
+		//});
+		return productList;
+	}
+
+}

+ 35 - 0
src/main/java/org/springblade/modules/pl/product/vo/ProductVO.java

@@ -0,0 +1,35 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.modules.pl.product.vo;
+
+import org.springblade.modules.pl.product.entity.ProductEntity;
+import org.springblade.core.tool.node.INode;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 商品表 视图实体类
+ *
+ * @author BladeX
+ * @since 2023-12-04
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class ProductVO extends ProductEntity {
+	private static final long serialVersionUID = 1L;
+
+}

+ 50 - 0
src/main/java/org/springblade/modules/pl/product/wrapper/ProductWrapper.java

@@ -0,0 +1,50 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.modules.pl.product.wrapper;
+
+import org.springblade.core.mp.support.BaseEntityWrapper;
+import org.springblade.core.tool.utils.BeanUtil;
+import org.springblade.modules.pl.product.entity.ProductEntity;
+import org.springblade.modules.pl.product.vo.ProductVO;
+import java.util.Objects;
+
+/**
+ * 商品表 包装类,返回视图层所需的字段
+ *
+ * @author BladeX
+ * @since 2023-12-04
+ */
+public class ProductWrapper extends BaseEntityWrapper<ProductEntity, ProductVO>  {
+
+	public static ProductWrapper build() {
+		return new ProductWrapper();
+ 	}
+
+	@Override
+	public ProductVO entityVO(ProductEntity product) {
+		ProductVO productVO = Objects.requireNonNull(BeanUtil.copy(product, ProductVO.class));
+
+		//User createUser = UserCache.getUser(product.getCreateUser());
+		//User updateUser = UserCache.getUser(product.getUpdateUser());
+		//productVO.setCreateUserName(createUser.getName());
+		//productVO.setUpdateUserName(updateUser.getName());
+
+		return productVO;
+	}
+
+
+}

+ 151 - 0
src/main/java/org/springblade/modules/pl/productBatch/controller/ProductBatchController.java

@@ -0,0 +1,151 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.modules.pl.productBatch.controller;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import lombok.AllArgsConstructor;
+import javax.validation.Valid;
+
+import org.springblade.core.secure.BladeUser;
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.mp.support.Query;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.Func;
+import org.springframework.web.bind.annotation.*;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.modules.pl.productBatch.entity.ProductBatchEntity;
+import org.springblade.modules.pl.productBatch.vo.ProductBatchVO;
+import org.springblade.modules.pl.productBatch.excel.ProductBatchExcel;
+import org.springblade.modules.pl.productBatch.wrapper.ProductBatchWrapper;
+import org.springblade.modules.pl.productBatch.service.IProductBatchService;
+import org.springblade.core.boot.ctrl.BladeController;
+import org.springblade.core.tool.utils.DateUtil;
+import org.springblade.core.excel.util.ExcelUtil;
+import org.springblade.core.tool.constant.BladeConstant;
+import springfox.documentation.annotations.ApiIgnore;
+import java.util.Map;
+import java.util.List;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ * 商品入库批次表 控制器
+ *
+ * @author BladeX
+ * @since 2023-12-04
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("blade-productBatch/productBatch")
+@Api(value = "商品入库批次表", tags = "商品入库批次表接口")
+public class ProductBatchController extends BladeController {
+
+	private final IProductBatchService productBatchService;
+
+	/**
+	 * 商品入库批次表 详情
+	 */
+	@GetMapping("/detail")
+	@ApiOperationSupport(order = 1)
+	@ApiOperation(value = "详情", notes = "传入productBatch")
+	public R<ProductBatchVO> detail(ProductBatchEntity productBatch) {
+		ProductBatchEntity detail = productBatchService.getOne(Condition.getQueryWrapper(productBatch));
+		return R.data(ProductBatchWrapper.build().entityVO(detail));
+	}
+	/**
+	 * 商品入库批次表 分页
+	 */
+	@GetMapping("/list")
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "分页", notes = "传入productBatch")
+	public R<IPage<ProductBatchVO>> list(@ApiIgnore @RequestParam Map<String, Object> productBatch, Query query) {
+		IPage<ProductBatchEntity> pages = productBatchService.page(Condition.getPage(query), Condition.getQueryWrapper(productBatch, ProductBatchEntity.class));
+		return R.data(ProductBatchWrapper.build().pageVO(pages));
+	}
+
+	/**
+	 * 商品入库批次表 自定义分页
+	 */
+	@GetMapping("/page")
+	@ApiOperationSupport(order = 3)
+	@ApiOperation(value = "分页", notes = "传入productBatch")
+	public R<IPage<ProductBatchVO>> page(ProductBatchVO productBatch, Query query) {
+		IPage<ProductBatchVO> pages = productBatchService.selectProductBatchPage(Condition.getPage(query), productBatch);
+		return R.data(pages);
+	}
+
+	/**
+	 * 商品入库批次表 新增
+	 */
+	@PostMapping("/save")
+	@ApiOperationSupport(order = 4)
+	@ApiOperation(value = "新增", notes = "传入productBatch")
+	public R save(@Valid @RequestBody ProductBatchEntity productBatch) {
+		return R.status(productBatchService.save(productBatch));
+	}
+
+	/**
+	 * 商品入库批次表 修改
+	 */
+	@PostMapping("/update")
+	@ApiOperationSupport(order = 5)
+	@ApiOperation(value = "修改", notes = "传入productBatch")
+	public R update(@Valid @RequestBody ProductBatchEntity productBatch) {
+		return R.status(productBatchService.updateById(productBatch));
+	}
+
+	/**
+	 * 商品入库批次表 新增或修改
+	 */
+	@PostMapping("/submit")
+	@ApiOperationSupport(order = 6)
+	@ApiOperation(value = "新增或修改", notes = "传入productBatch")
+	public R submit(@Valid @RequestBody ProductBatchEntity productBatch) {
+		return R.status(productBatchService.saveOrUpdate(productBatch));
+	}
+
+	/**
+	 * 商品入库批次表 删除
+	 */
+	@PostMapping("/remove")
+	@ApiOperationSupport(order = 7)
+	@ApiOperation(value = "逻辑删除", notes = "传入ids")
+	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+		return R.status(productBatchService.deleteLogic(Func.toLongList(ids)));
+	}
+
+
+	/**
+	 * 导出数据
+	 */
+	@GetMapping("/export-productBatch")
+	@ApiOperationSupport(order = 9)
+	@ApiOperation(value = "导出数据", notes = "传入productBatch")
+	public void exportProductBatch(@ApiIgnore @RequestParam Map<String, Object> productBatch, BladeUser bladeUser, HttpServletResponse response) {
+		QueryWrapper<ProductBatchEntity> queryWrapper = Condition.getQueryWrapper(productBatch, ProductBatchEntity.class);
+		//if (!AuthUtil.isAdministrator()) {
+		//	queryWrapper.lambda().eq(ProductBatch::getTenantId, bladeUser.getTenantId());
+		//}
+		queryWrapper.lambda().eq(ProductBatchEntity::getIsDeleted, BladeConstant.DB_NOT_DELETED);
+		List<ProductBatchExcel> list = productBatchService.exportProductBatch(queryWrapper);
+		ExcelUtil.export(response, "商品入库批次表数据" + DateUtil.time(), "商品入库批次表数据表", list, ProductBatchExcel.class);
+	}
+
+}

+ 34 - 0
src/main/java/org/springblade/modules/pl/productBatch/dto/ProductBatchDTO.java

@@ -0,0 +1,34 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.modules.pl.productBatch.dto;
+
+import org.springblade.modules.pl.productBatch.entity.ProductBatchEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 商品入库批次表 数据传输对象实体类
+ *
+ * @author BladeX
+ * @since 2023-12-04
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class ProductBatchDTO extends ProductBatchEntity {
+	private static final long serialVersionUID = 1L;
+
+}

+ 65 - 0
src/main/java/org/springblade/modules/pl/productBatch/entity/ProductBatchEntity.java

@@ -0,0 +1,65 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.modules.pl.productBatch.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.util.Date;
+import lombok.EqualsAndHashCode;
+import org.springblade.core.tenant.mp.TenantEntity;
+
+/**
+ * 商品入库批次表 实体类
+ *
+ * @author BladeX
+ * @since 2023-12-04
+ */
+@Data
+@TableName("pl_product_batch")
+@ApiModel(value = "ProductBatch对象", description = "商品入库批次表")
+@EqualsAndHashCode(callSuper = true)
+public class ProductBatchEntity extends TenantEntity {
+
+	/**
+	 * 所属工厂
+	 */
+	@ApiModelProperty(value = "所属工厂")
+	private Long factoryId;
+	/**
+	 * 批次号
+	 */
+	@ApiModelProperty(value = "批次号")
+	private String batchNo;
+	/**
+	 * 产品型号id
+	 */
+	@ApiModelProperty(value = "产品型号id")
+	private Long productModelId;
+	/**
+	 * 产品名称
+	 */
+	@ApiModelProperty(value = "产品名称")
+	private String productName;
+	/**
+	 * 产品型号
+	 */
+	@ApiModelProperty(value = "产品型号")
+	private String productModel;
+
+}

+ 87 - 0
src/main/java/org/springblade/modules/pl/productBatch/excel/ProductBatchExcel.java

@@ -0,0 +1,87 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.modules.pl.productBatch.excel;
+
+
+import lombok.Data;
+
+import java.util.Date;
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.alibaba.excel.annotation.write.style.ColumnWidth;
+import com.alibaba.excel.annotation.write.style.ContentRowHeight;
+import com.alibaba.excel.annotation.write.style.HeadRowHeight;
+import java.io.Serializable;
+
+
+/**
+ * 商品入库批次表 Excel实体类
+ *
+ * @author BladeX
+ * @since 2023-12-04
+ */
+@Data
+@ColumnWidth(25)
+@HeadRowHeight(20)
+@ContentRowHeight(18)
+public class ProductBatchExcel implements Serializable {
+
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * 租户ID
+	 */
+	@ColumnWidth(20)
+	@ExcelProperty("租户ID")
+	private String tenantId;
+	/**
+	 * 所属工厂
+	 */
+	@ColumnWidth(20)
+	@ExcelProperty("所属工厂")
+	private Long factoryId;
+	/**
+	 * 批次号
+	 */
+	@ColumnWidth(20)
+	@ExcelProperty("批次号")
+	private String batchNo;
+	/**
+	 * 产品型号id
+	 */
+	@ColumnWidth(20)
+	@ExcelProperty("产品型号id")
+	private Long productModelId;
+	/**
+	 * 产品名称
+	 */
+	@ColumnWidth(20)
+	@ExcelProperty("产品名称")
+	private String productName;
+	/**
+	 * 产品型号
+	 */
+	@ColumnWidth(20)
+	@ExcelProperty("产品型号")
+	private String productModel;
+	/**
+	 * 是否已删除
+	 */
+	@ColumnWidth(20)
+	@ExcelProperty("是否已删除")
+	private Integer isDeleted;
+
+}

+ 54 - 0
src/main/java/org/springblade/modules/pl/productBatch/mapper/ProductBatchMapper.java

@@ -0,0 +1,54 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.modules.pl.productBatch.mapper;
+
+import org.springblade.modules.pl.productBatch.entity.ProductBatchEntity;
+import org.springblade.modules.pl.productBatch.vo.ProductBatchVO;
+import org.springblade.modules.pl.productBatch.excel.ProductBatchExcel;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.conditions.Wrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.apache.ibatis.annotations.Param;
+import java.util.List;
+
+/**
+ * 商品入库批次表 Mapper 接口
+ *
+ * @author BladeX
+ * @since 2023-12-04
+ */
+public interface ProductBatchMapper extends BaseMapper<ProductBatchEntity> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param productBatch
+	 * @return
+	 */
+	List<ProductBatchVO> selectProductBatchPage(IPage page, ProductBatchVO productBatch);
+
+
+	/**
+	 * 获取导出数据
+	 *
+	 * @param queryWrapper
+	 * @return
+	 */
+	List<ProductBatchExcel> exportProductBatch(@Param("ew") Wrapper<ProductBatchEntity> queryWrapper);
+
+}

+ 33 - 0
src/main/java/org/springblade/modules/pl/productBatch/mapper/ProductBatchMapper.xml

@@ -0,0 +1,33 @@
+<?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="org.springblade.modules.pl.productBatch.mapper.ProductBatchMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="productBatchResultMap" type="org.springblade.modules.pl.productBatch.entity.ProductBatchEntity">
+        <result column="id" property="id"/>
+        <result column="tenant_id" property="tenantId"/>
+        <result column="factory_id" property="factoryId"/>
+        <result column="batch_no" property="batchNo"/>
+        <result column="product_model_id" property="productModelId"/>
+        <result column="product_name" property="productName"/>
+        <result column="product_model" property="productModel"/>
+        <result column="create_user" property="createUser"/>
+        <result column="create_dept" property="createDept"/>
+        <result column="create_time" property="createTime"/>
+        <result column="update_user" property="updateUser"/>
+        <result column="update_time" property="updateTime"/>
+        <result column="status" property="status"/>
+        <result column="is_deleted" property="isDeleted"/>
+    </resultMap>
+
+
+    <select id="selectProductBatchPage" resultMap="productBatchResultMap">
+        select * from pl_product_batch where is_deleted = 0
+    </select>
+
+
+    <select id="exportProductBatch" resultType="org.springblade.modules.pl.productBatch.excel.ProductBatchExcel">
+        SELECT * FROM pl_product_batch ${ew.customSqlSegment}
+    </select>
+
+</mapper>

+ 52 - 0
src/main/java/org/springblade/modules/pl/productBatch/service/IProductBatchService.java

@@ -0,0 +1,52 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.modules.pl.productBatch.service;
+
+import com.baomidou.mybatisplus.core.conditions.Wrapper;
+import org.springblade.modules.pl.productBatch.entity.ProductBatchEntity;
+import org.springblade.modules.pl.productBatch.vo.ProductBatchVO;
+import org.springblade.modules.pl.productBatch.excel.ProductBatchExcel;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.core.mp.base.BaseService;
+import java.util.List;
+
+/**
+ * 商品入库批次表 服务类
+ *
+ * @author BladeX
+ * @since 2023-12-04
+ */
+public interface IProductBatchService extends BaseService<ProductBatchEntity> {
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param productBatch
+	 * @return
+	 */
+	IPage<ProductBatchVO> selectProductBatchPage(IPage<ProductBatchVO> page, ProductBatchVO productBatch);
+
+
+	/**
+	 * 导出数据
+	 *
+	 * @param queryWrapper
+	 * @return
+	 */
+	List<ProductBatchExcel> exportProductBatch(Wrapper<ProductBatchEntity> queryWrapper);
+
+}

+ 54 - 0
src/main/java/org/springblade/modules/pl/productBatch/service/impl/ProductBatchServiceImpl.java

@@ -0,0 +1,54 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.modules.pl.productBatch.service.impl;
+
+import org.springblade.modules.pl.productBatch.entity.ProductBatchEntity;
+import org.springblade.modules.pl.productBatch.vo.ProductBatchVO;
+import org.springblade.modules.pl.productBatch.excel.ProductBatchExcel;
+import org.springblade.modules.pl.productBatch.mapper.ProductBatchMapper;
+import org.springblade.modules.pl.productBatch.service.IProductBatchService;
+import org.springframework.stereotype.Service;
+import com.baomidou.mybatisplus.core.conditions.Wrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.core.mp.base.BaseServiceImpl;
+import java.util.List;
+
+/**
+ * 商品入库批次表 服务实现类
+ *
+ * @author BladeX
+ * @since 2023-12-04
+ */
+@Service
+public class ProductBatchServiceImpl extends BaseServiceImpl<ProductBatchMapper, ProductBatchEntity> implements IProductBatchService {
+
+	@Override
+	public IPage<ProductBatchVO> selectProductBatchPage(IPage<ProductBatchVO> page, ProductBatchVO productBatch) {
+		return page.setRecords(baseMapper.selectProductBatchPage(page, productBatch));
+	}
+
+
+	@Override
+	public List<ProductBatchExcel> exportProductBatch(Wrapper<ProductBatchEntity> queryWrapper) {
+		List<ProductBatchExcel> productBatchList = baseMapper.exportProductBatch(queryWrapper);
+		//productBatchList.forEach(productBatch -> {
+		//	productBatch.setTypeName(DictCache.getValue(DictEnum.YES_NO, ProductBatch.getType()));
+		//});
+		return productBatchList;
+	}
+
+}

+ 35 - 0
src/main/java/org/springblade/modules/pl/productBatch/vo/ProductBatchVO.java

@@ -0,0 +1,35 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.modules.pl.productBatch.vo;
+
+import org.springblade.modules.pl.productBatch.entity.ProductBatchEntity;
+import org.springblade.core.tool.node.INode;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 商品入库批次表 视图实体类
+ *
+ * @author BladeX
+ * @since 2023-12-04
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class ProductBatchVO extends ProductBatchEntity {
+	private static final long serialVersionUID = 1L;
+
+}

+ 50 - 0
src/main/java/org/springblade/modules/pl/productBatch/wrapper/ProductBatchWrapper.java

@@ -0,0 +1,50 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.modules.pl.productBatch.wrapper;
+
+import org.springblade.core.mp.support.BaseEntityWrapper;
+import org.springblade.core.tool.utils.BeanUtil;
+import org.springblade.modules.pl.productBatch.entity.ProductBatchEntity;
+import org.springblade.modules.pl.productBatch.vo.ProductBatchVO;
+import java.util.Objects;
+
+/**
+ * 商品入库批次表 包装类,返回视图层所需的字段
+ *
+ * @author BladeX
+ * @since 2023-12-04
+ */
+public class ProductBatchWrapper extends BaseEntityWrapper<ProductBatchEntity, ProductBatchVO>  {
+
+	public static ProductBatchWrapper build() {
+		return new ProductBatchWrapper();
+ 	}
+
+	@Override
+	public ProductBatchVO entityVO(ProductBatchEntity productBatch) {
+		ProductBatchVO productBatchVO = Objects.requireNonNull(BeanUtil.copy(productBatch, ProductBatchVO.class));
+
+		//User createUser = UserCache.getUser(productBatch.getCreateUser());
+		//User updateUser = UserCache.getUser(productBatch.getUpdateUser());
+		//productBatchVO.setCreateUserName(createUser.getName());
+		//productBatchVO.setUpdateUserName(updateUser.getName());
+
+		return productBatchVO;
+	}
+
+
+}

+ 10 - 0
src/main/java/sql/product.menu.sql

@@ -0,0 +1,10 @@
+INSERT INTO `blade_menu`(`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`)
+VALUES ('1731678427001438210', 1123598815738675201, 'product', '商品表', 'menu', '/product/product', NULL, 1, 1, 0, 1, NULL, 0);
+INSERT INTO `blade_menu`(`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`)
+VALUES ('1731678427001438211', '1731678427001438210', 'product_add', '新增', 'add', '/product/product/add', 'plus', 1, 2, 1, 1, NULL, 0);
+INSERT INTO `blade_menu`(`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`)
+VALUES ('1731678427001438212', '1731678427001438210', 'product_edit', '修改', 'edit', '/product/product/edit', 'form', 2, 2, 2, 1, NULL, 0);
+INSERT INTO `blade_menu`(`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`)
+VALUES ('1731678427001438213', '1731678427001438210', 'product_delete', '删除', 'delete', '/api/blade-product/product/remove', 'delete', 3, 2, 3, 1, NULL, 0);
+INSERT INTO `blade_menu`(`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`)
+VALUES ('1731678427001438214', '1731678427001438210', 'product_view', '查看', 'view', '/product/product/view', 'file-text', 4, 2, 2, 1, NULL, 0);

+ 10 - 0
src/main/java/sql/productbatch.menu.sql

@@ -0,0 +1,10 @@
+INSERT INTO `blade_menu`(`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`)
+VALUES ('1731678429740318721', 1123598815738675201, 'productBatch', '商品入库批次表', 'menu', '/productBatch/productBatch', NULL, 1, 1, 0, 1, NULL, 0);
+INSERT INTO `blade_menu`(`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`)
+VALUES ('1731678429740318722', '1731678429740318721', 'productBatch_add', '新增', 'add', '/productBatch/productBatch/add', 'plus', 1, 2, 1, 1, NULL, 0);
+INSERT INTO `blade_menu`(`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`)
+VALUES ('1731678429740318723', '1731678429740318721', 'productBatch_edit', '修改', 'edit', '/productBatch/productBatch/edit', 'form', 2, 2, 2, 1, NULL, 0);
+INSERT INTO `blade_menu`(`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`)
+VALUES ('1731678429740318724', '1731678429740318721', 'productBatch_delete', '删除', 'delete', '/api/blade-productBatch/productBatch/remove', 'delete', 3, 2, 3, 1, NULL, 0);
+INSERT INTO `blade_menu`(`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`)
+VALUES ('1731678429740318725', '1731678429740318721', 'productBatch_view', '查看', 'view', '/productBatch/productBatch/view', 'file-text', 4, 2, 2, 1, NULL, 0);