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