From 5c6e383e2e9e50d9d836d4387990e07f7fe1967c Mon Sep 17 00:00:00 2001 From: wws <18630710203@163.com> Date: Sun, 3 Sep 2023 19:07:11 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A1=E5=88=92=E6=A8=A1=E5=9D=97(=E8=AE=A1?= =?UTF-8?q?=E5=88=92=E6=96=B0=E5=A2=9E=E9=80=BB=E8=BE=91=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=88=9D=E7=89=88)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/BaseProductController.java | 36 +++++++++++++++++ .../java/com/op/plan/domain/BaseProduct.java | 39 +++++++++++++++++++ .../com/op/plan/mapper/BaseProductMapper.java | 23 +++++++++++ .../op/plan/service/IBaseProductService.java | 21 ++++++++++ .../service/impl/BaseProductServiceImpl.java | 29 ++++++++++++++ .../mapper/plan/BaseProductMapper.xml | 25 ++++++++++++ 6 files changed, 173 insertions(+) create mode 100644 op-modules/op-plan/src/main/java/com/op/plan/controller/BaseProductController.java create mode 100644 op-modules/op-plan/src/main/java/com/op/plan/domain/BaseProduct.java create mode 100644 op-modules/op-plan/src/main/java/com/op/plan/mapper/BaseProductMapper.java create mode 100644 op-modules/op-plan/src/main/java/com/op/plan/service/IBaseProductService.java create mode 100644 op-modules/op-plan/src/main/java/com/op/plan/service/impl/BaseProductServiceImpl.java create mode 100644 op-modules/op-plan/src/main/resources/mapper/plan/BaseProductMapper.xml diff --git a/op-modules/op-plan/src/main/java/com/op/plan/controller/BaseProductController.java b/op-modules/op-plan/src/main/java/com/op/plan/controller/BaseProductController.java new file mode 100644 index 00000000..828d6ffc --- /dev/null +++ b/op-modules/op-plan/src/main/java/com/op/plan/controller/BaseProductController.java @@ -0,0 +1,36 @@ +package com.op.plan.controller; + +import com.op.common.core.web.controller.BaseController; +import com.op.common.core.web.page.TableDataInfo; +import com.op.common.security.annotation.RequiresPermissions; +import com.op.plan.domain.BaseProduct; +import com.op.plan.service.IBaseProductService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +/** + * 物料信息Controller + * + * @author Open Platform + * @date 2023-09-03 + */ +@RestController +@RequestMapping("/product") +public class BaseProductController extends BaseController { + @Autowired + private IBaseProductService baseProductService; + + /** + * 查询物料信息列表 + */ + @GetMapping("/list") + public TableDataInfo list(BaseProduct baseProduct) { + startPage(); + List list = baseProductService.selectBaseProductList(baseProduct); + return getDataTable(list); + } +} diff --git a/op-modules/op-plan/src/main/java/com/op/plan/domain/BaseProduct.java b/op-modules/op-plan/src/main/java/com/op/plan/domain/BaseProduct.java new file mode 100644 index 00000000..a5400f5d --- /dev/null +++ b/op-modules/op-plan/src/main/java/com/op/plan/domain/BaseProduct.java @@ -0,0 +1,39 @@ +package com.op.plan.domain; + +// 订单-物料实体类 +public class BaseProduct { + private String productCode; + private String productDescZh; + + @Override + public String toString() { + return "BaseProduct{" + + "productCode='" + productCode + '\'' + + ", productDescZh='" + productDescZh + '\'' + + '}'; + } + + public String getProductCode() { + return productCode; + } + + public void setProductCode(String productCode) { + this.productCode = productCode; + } + + public String getProductDescZh() { + return productDescZh; + } + + public void setProductDescZh(String productDescZh) { + this.productDescZh = productDescZh; + } + + public BaseProduct(String productCode, String productDescZh) { + this.productCode = productCode; + this.productDescZh = productDescZh; + } + + public BaseProduct() { + } +} diff --git a/op-modules/op-plan/src/main/java/com/op/plan/mapper/BaseProductMapper.java b/op-modules/op-plan/src/main/java/com/op/plan/mapper/BaseProductMapper.java new file mode 100644 index 00000000..fc780b19 --- /dev/null +++ b/op-modules/op-plan/src/main/java/com/op/plan/mapper/BaseProductMapper.java @@ -0,0 +1,23 @@ +package com.op.plan.mapper; + +import com.op.plan.domain.BaseProduct; + +import java.util.List; + +/** + * 物料信息Mapper接口 + * + * @author Open Platform + * @date 2023-09-03 + */ +public interface BaseProductMapper { + + /** + * 查询物料信息列表 + * + * @param baseProduct 物料信息 + * @return 物料信息集合 + */ + public List selectBaseProductList(BaseProduct baseProduct); + +} diff --git a/op-modules/op-plan/src/main/java/com/op/plan/service/IBaseProductService.java b/op-modules/op-plan/src/main/java/com/op/plan/service/IBaseProductService.java new file mode 100644 index 00000000..dd1241ac --- /dev/null +++ b/op-modules/op-plan/src/main/java/com/op/plan/service/IBaseProductService.java @@ -0,0 +1,21 @@ +package com.op.plan.service; + +import com.op.plan.domain.BaseProduct; + +import java.util.List; + +/** + * 物料信息Service接口 + * + * @author Open Platform + * @date 2023-09-03 + */ +public interface IBaseProductService { + /** + * 查询物料信息列表 + * + * @param baseProduct 物料信息 + * @return 物料信息集合 + */ + public List selectBaseProductList(BaseProduct baseProduct); +} diff --git a/op-modules/op-plan/src/main/java/com/op/plan/service/impl/BaseProductServiceImpl.java b/op-modules/op-plan/src/main/java/com/op/plan/service/impl/BaseProductServiceImpl.java new file mode 100644 index 00000000..4bbd165d --- /dev/null +++ b/op-modules/op-plan/src/main/java/com/op/plan/service/impl/BaseProductServiceImpl.java @@ -0,0 +1,29 @@ +package com.op.plan.service.impl; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.op.plan.domain.BaseProduct; +import com.op.plan.mapper.BaseProductMapper; +import com.op.plan.service.IBaseProductService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +public class BaseProductServiceImpl implements IBaseProductService { + + @Autowired + private BaseProductMapper baseProductMapper; + + /** + * 查询物料信息列表 + * + * @param baseProduct 物料信息 + * @return 物料信息 + */ + @Override + @DS("#header.poolName") + public List selectBaseProductList(BaseProduct baseProduct) { + return baseProductMapper.selectBaseProductList(baseProduct); + } +} diff --git a/op-modules/op-plan/src/main/resources/mapper/plan/BaseProductMapper.xml b/op-modules/op-plan/src/main/resources/mapper/plan/BaseProductMapper.xml new file mode 100644 index 00000000..1590447a --- /dev/null +++ b/op-modules/op-plan/src/main/resources/mapper/plan/BaseProductMapper.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + select product_code, product_desc_zh from base_product + + + + + \ No newline at end of file