From dbac2c0cf72e37637e814a67453fd9a8fadf07bb Mon Sep 17 00:00:00 2001 From: xd <844539747@qq.com> Date: Fri, 10 May 2024 15:13:35 +0800 Subject: [PATCH] '123' --- .../controller/redBook/RedBookController.java | 22 +- .../ruoyi/redBook/mapper/OARedBookMapper.java | 9 + .../redBook/service/IRedBookService.java | 8 + .../service/impl/RedBookServiceImpl.java | 11 + .../mapper/redBook/OARedBookMapper.xml | 13 + ruoyi-ui/src/api/redBook/redBook.js | 9 + ruoyi-ui/src/views/redBook/productSelect.vue | 397 +++++++++++++----- 7 files changed, 358 insertions(+), 111 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/redBook/RedBookController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/redBook/RedBookController.java index 91c72c7..14863ce 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/redBook/RedBookController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/redBook/RedBookController.java @@ -3,11 +3,13 @@ package com.ruoyi.web.controller.redBook; import com.ruoyi.common.annotation.DataSource; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.enums.DataSourceType; +import com.ruoyi.common.utils.StringUtils; import com.ruoyi.redBook.domain.Product; import com.ruoyi.redBook.service.IRedBookService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; +import java.util.ArrayList; import java.util.List; /** @@ -154,5 +156,23 @@ public class RedBookController extends BaseController List list = redBookService.searchData(product); return list; } - + /** + * 点击查询按钮查询数据 + * @param product + * @return + */ + @GetMapping("/handleSearchData") + public List handleSearchData(Product product) + { + List list = new ArrayList<>(); + String name_0 = product.getName_0();//型号 + String model = product.getModel();//规格 + if(!StringUtils.isEmpty(name_0) || !StringUtils.isEmpty(model) ){ + if(!StringUtils.isEmpty(name_0)){ + name_0 = name_0.toUpperCase(); + } + list = redBookService.handleSearchData(name_0,model); + } + return list; + } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/redBook/mapper/OARedBookMapper.java b/ruoyi-system/src/main/java/com/ruoyi/redBook/mapper/OARedBookMapper.java index 09de5a3..f115f8b 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/redBook/mapper/OARedBookMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/redBook/mapper/OARedBookMapper.java @@ -4,6 +4,7 @@ import com.ruoyi.material.domain.CMaterial; import com.ruoyi.material.domain.CMaterialCost; import com.ruoyi.material.domain.temp; import com.ruoyi.redBook.domain.Product; +import org.apache.ibatis.annotations.Param; import java.util.List; @@ -63,4 +64,12 @@ public interface OARedBookMapper * @return */ List searchData(Product product); + + /** + * 点击查询按钮查询数据 + * @param name_0 + * @param model + * @return + */ + List handleSearchData(@Param("name_0")String name_0,@Param("model")String model); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/redBook/service/IRedBookService.java b/ruoyi-system/src/main/java/com/ruoyi/redBook/service/IRedBookService.java index 6e1fee7..bda3abf 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/redBook/service/IRedBookService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/redBook/service/IRedBookService.java @@ -60,4 +60,12 @@ public interface IRedBookService * @return */ List searchData(Product product); + + /** + * 点击查询按钮查询数据 + * @param name_0 + * @param model + * @return + */ + List handleSearchData(String name_0,String model); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/redBook/service/impl/RedBookServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/redBook/service/impl/RedBookServiceImpl.java index fd92c92..dd334fe 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/redBook/service/impl/RedBookServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/redBook/service/impl/RedBookServiceImpl.java @@ -89,4 +89,15 @@ public class RedBookServiceImpl implements IRedBookService public List searchData(Product product) { return oaRedBookMapper.searchData(product); } + + /** + * 点击查询按钮查询数据 + * @param name_0 + * @param model + * @return + */ + @Override + public List handleSearchData(String name_0,String model) { + return oaRedBookMapper.handleSearchData(name_0,model); + } } diff --git a/ruoyi-system/src/main/resources/mapper/redBook/OARedBookMapper.xml b/ruoyi-system/src/main/resources/mapper/redBook/OARedBookMapper.xml index 087d883..6c280eb 100644 --- a/ruoyi-system/src/main/resources/mapper/redBook/OARedBookMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/redBook/OARedBookMapper.xml @@ -65,4 +65,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and A.截面 = #{section} and A.型号 = #{name_0} order by A.order_0 + diff --git a/ruoyi-ui/src/api/redBook/redBook.js b/ruoyi-ui/src/api/redBook/redBook.js index 3174dea..de64bef 100644 --- a/ruoyi-ui/src/api/redBook/redBook.js +++ b/ruoyi-ui/src/api/redBook/redBook.js @@ -91,5 +91,14 @@ export function searchData(query) { params: query }) } +//点击查询按钮查询数据 +export function handleSearchData(query) { + return request({ + url: '/redBook/redBook/handleSearchData', + method: 'get', + params: query + }) +} + diff --git a/ruoyi-ui/src/views/redBook/productSelect.vue b/ruoyi-ui/src/views/redBook/productSelect.vue index 09edb43..29e73a6 100644 --- a/ruoyi-ui/src/views/redBook/productSelect.vue +++ b/ruoyi-ui/src/views/redBook/productSelect.vue @@ -1,35 +1,56 @@