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 new file mode 100644 index 0000000..91c72c7 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/redBook/RedBookController.java @@ -0,0 +1,158 @@ +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.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.List; + +/** + * 红本管理Controller + * + * @author ruoyi + * @date 2024-03-25 + */ +@RestController +@RequestMapping("/redBook/redBook") +@DataSource(DataSourceType.OAREDBOOK) +public class RedBookController extends BaseController +{ + @Autowired + private IRedBookService redBookService; + + /** + * 获取目录 + * @param product + * @return + */ + @GetMapping("/productList") + public List productList(Product product) + { + List list = redBookService.productModelList(product); + return list; + } + + /** + * 获取备注信息 + * @param product + * @return + */ + @GetMapping("/productRemarkList") + public List productRemarkList(Product product) + { + List list = redBookService.productRemarkList(product); + return list; + } + + /** + * 获取型号 + * @param product + * @return + */ + @GetMapping("/productXinghList") + public List productXinghList(Product product) + { + List list = redBookService.productModelList(product); + return list; + } + + /** + * 判断是否为父节点,如果有说明下面还有子类显示,如果没有则直接显示衍生型号 + * @param product + * @return + */ + @GetMapping("/judgeparent") + public Boolean judgeparent(Product product) + { + Boolean flag = false; + List list = redBookService.productModelList(product); + if(list!=null&&list.size()>0){ + flag = true; + } + return flag; + } + + /** + * 获取子类 + * @param product + * @return + */ + @GetMapping("/productZlList") + public List productZlList(Product product) + { + List list = redBookService.productModelList(product); + return list; + } + + /** + * 判断是否存在衍生型号 + * @param product + * @return + */ + @GetMapping("/productYsxhListCheck") + public Boolean productYsxhListCheck(Product product) + { + Boolean flag = false; + List list = redBookService.productExtList(product); + if(list!=null&&list.size()>0){ + flag = true; + } + return flag; + } + + /** + * 获取衍生型号 + * @param product + * @return + */ + @GetMapping("/productYsxhList") + public List productYsxhList(Product product) + { + List list = redBookService.productYsxhList(product); + return list; + } + + /** + * 判断是否存在截面 + * @param product + * @return + */ + @GetMapping("/productJmListCheck") + public Boolean productJmListCheck(Product product) + { + Boolean flag = false; + List list = redBookService.judgesection(product); + if(list!=null&&list.size()>0){ + flag = true; + } + return flag; + } + /** + * 获取截面 + * @param product + * @return + */ + @GetMapping("/productJmList") + public List productJmList(Product product) + { + List list = redBookService.productJmList(product); + return list; + } + + /** + * 查询数据 + * @param product + * @return + */ + @GetMapping("/searchData") + public List searchData(Product product) + { + List list = redBookService.searchData(product); + return list; + } + +} diff --git a/ruoyi-admin/src/main/resources/application-druid.yml b/ruoyi-admin/src/main/resources/application-druid.yml index f031044..7603bb3 100644 --- a/ruoyi-admin/src/main/resources/application-druid.yml +++ b/ruoyi-admin/src/main/resources/application-druid.yml @@ -17,6 +17,14 @@ spring: url: jdbc:sqlserver://172.19.6.3:1433;DatabaseName=RedBook username: sa password: Itcenter110- + # 红本数据库-OA单点登录数据源 + oaredbook: + # 从数据源开关/默认关闭 + enabled: true + driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver + url: jdbc:sqlserver://192.168.9.90:1433;DatabaseName=RedBook + username: sa + password: Itcenter110- # 江南全要素报价数据库数据源 quot: # 从数据源开关/默认关闭 diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/enums/DataSourceType.java b/ruoyi-common/src/main/java/com/ruoyi/common/enums/DataSourceType.java index 2d9e661..8354d08 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/enums/DataSourceType.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/enums/DataSourceType.java @@ -17,6 +17,11 @@ public enum DataSourceType */ REDBOOK, + /** + * 红本数据库-OA单点登录数据源 + */ + OAREDBOOK, + /** * 江南全要素报价数据库 */ diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/DruidConfig.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/DruidConfig.java index 38833e7..0f54371 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/DruidConfig.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/DruidConfig.java @@ -49,6 +49,15 @@ public class DruidConfig return druidProperties.dataSource(dataSource); } + @Bean + @ConfigurationProperties("spring.datasource.druid.oaredbook") + @ConditionalOnProperty(prefix = "spring.datasource.druid.oaredbook", name = "enabled", havingValue = "true") + public DataSource oaredbookDataSource(DruidProperties druidProperties) + { + DruidDataSource dataSource = DruidDataSourceBuilder.create().build(); + return druidProperties.dataSource(dataSource); + } + @Bean @ConfigurationProperties("spring.datasource.druid.quot") @ConditionalOnProperty(prefix = "spring.datasource.druid.quot", name = "enabled", havingValue = "true") @@ -83,6 +92,7 @@ public class DruidConfig Map targetDataSources = new HashMap<>(); targetDataSources.put(DataSourceType.MASTER.name(), masterDataSource); setDataSource(targetDataSources, DataSourceType.REDBOOK.name(), "redbookDataSource"); + setDataSource(targetDataSources, DataSourceType.OAREDBOOK.name(), "oaredbookDataSource"); setDataSource(targetDataSources, DataSourceType.QUOT.name(), "quotDataSource"); setDataSource(targetDataSources, DataSourceType.JNERP.name(), "jnerpDataSource"); setDataSource(targetDataSources, DataSourceType.STORAGE.name(), "storageDataSource"); diff --git a/ruoyi-system/src/main/java/com/ruoyi/redBook/domain/Product.java b/ruoyi-system/src/main/java/com/ruoyi/redBook/domain/Product.java new file mode 100644 index 0000000..d248180 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/redBook/domain/Product.java @@ -0,0 +1,157 @@ +package com.ruoyi.redBook.domain; + +public class Product { + private int uid_0; + private String name_0; + private String model; + private String spec; + private String section; + private String stu; + private float price; + private float newprice; + private float quantity; + private float amount; + private String voltage; + private String remark_0; + private String showname_0; + private String pricedate; + private float prime_0; + private float profitrate; + private String example_0; + + public int getUid_0() { + return uid_0; + } + + public void setUid_0(int uid_0) { + this.uid_0 = uid_0; + } + + public String getName_0() { + return name_0; + } + + public void setName_0(String name_0) { + this.name_0 = name_0; + } + + public String getModel() { + return model; + } + + public void setModel(String model) { + this.model = model; + } + + public String getSpec() { + return spec; + } + + public void setSpec(String spec) { + this.spec = spec; + } + + public String getSection() { + return section; + } + + public void setSection(String section) { + this.section = section; + } + + public String getStu() { + return stu; + } + + public void setStu(String stu) { + this.stu = stu; + } + + public float getPrice() { + return price; + } + + public void setPrice(float price) { + this.price = price; + } + + public float getNewprice() { + return newprice; + } + + public void setNewprice(float newprice) { + this.newprice = newprice; + } + + public float getQuantity() { + return quantity; + } + + public void setQuantity(float quantity) { + this.quantity = quantity; + } + + public float getAmount() { + return amount; + } + + public void setAmount(float amount) { + this.amount = amount; + } + + public String getVoltage() { + return voltage; + } + + public void setVoltage(String voltage) { + this.voltage = voltage; + } + + public String getRemark_0() { + return remark_0; + } + + public void setRemark_0(String remark_0) { + this.remark_0 = remark_0; + } + + public String getShowname_0() { + return showname_0; + } + + public void setShowname_0(String showname_0) { + this.showname_0 = showname_0; + } + + public String getPricedate() { + return pricedate; + } + + public void setPricedate(String pricedate) { + this.pricedate = pricedate; + } + + public float getPrime_0() { + return prime_0; + } + + public void setPrime_0(float prime_0) { + this.prime_0 = prime_0; + } + + public float getProfitrate() { + return profitrate; + } + + public void setProfitrate(float profitrate) { + this.profitrate = profitrate; + } + + public String getExample_0() { + return example_0; + } + + public void setExample_0(String example_0) { + this.example_0 = example_0; + } +} 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 new file mode 100644 index 0000000..09de5a3 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/redBook/mapper/OARedBookMapper.java @@ -0,0 +1,66 @@ +package com.ruoyi.redBook.mapper; + +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 java.util.List; + +/** + * 红本管理Mapper接口 + * + * @author ruoyi + * @date 2024-02-28 + */ +public interface OARedBookMapper +{ + /** + * 获取目录 + * @param product + * @return + */ + List productModelList(Product product); + + /** + * 获取备注信息 + * @param product + * @return + */ + List productRemarkList(Product product); + + /** + * 判断是否存在衍生型号 + * @param product + * @return + */ + List productExtList(Product product); + + /** + * 获取衍生型号 + * @param product + * @return + */ + List productYsxhList(Product product); + + /** + * 判断是否存在截面 + * @param product + * @return + */ + List judgesection(Product product); + + /** + * 获取截面 + * @param product + * @return + */ + List productJmList(Product product); + + /** + * 查询数据 + * @param product + * @return + */ + List searchData(Product product); +} 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 new file mode 100644 index 0000000..6e1fee7 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/redBook/service/IRedBookService.java @@ -0,0 +1,63 @@ +package com.ruoyi.redBook.service; + +import com.ruoyi.redBook.domain.Product; + +import java.util.List; + +/** + * 红本管理Service接口 + * + * @author ruoyi + * @date 2024-02-28 + */ +public interface IRedBookService +{ + /** + * 获取目录 + * @param product + * @return + */ + List productModelList(Product product); + + /** + * 获取备注信息 + * @param product + * @return + */ + List productRemarkList(Product product); + + /** + * 判断是否存在衍生型号 + * @param product + * @return + */ + List productExtList(Product product); + + /** + * 获取衍生型号 + * @param product + * @return + */ + List productYsxhList(Product product); + + /** + * 判断是否存在截面 + * @param product + * @return + */ + List judgesection(Product product); + + /** + * 获取截面 + * @param product + * @return + */ + List productJmList(Product product); + + /** + * 查询数据 + * @param product + * @return + */ + List searchData(Product product); +} 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 new file mode 100644 index 0000000..fd92c92 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/redBook/service/impl/RedBookServiceImpl.java @@ -0,0 +1,92 @@ +package com.ruoyi.redBook.service.impl; + +import com.ruoyi.redBook.domain.Product; +import com.ruoyi.redBook.mapper.OARedBookMapper; +import com.ruoyi.redBook.service.IRedBookService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 红本管理Service业务层处理 + * + * @author ruoyi + * @date 2024-02-28 + */ +@Service +public class RedBookServiceImpl implements IRedBookService +{ + @Autowired + private OARedBookMapper oaRedBookMapper; + + /** + * 获取目录 + * @param product + * @return + */ + @Override + public List productModelList(Product product) { + return oaRedBookMapper.productModelList(product); + } + + /** + * 获取备注信息 + * @param product + * @return + */ + @Override + public List productRemarkList(Product product) { + return oaRedBookMapper.productRemarkList(product); + } + + /** + * 判断是否存在衍生型号 + * @param product + * @return + */ + @Override + public List productExtList(Product product) { + return oaRedBookMapper.productExtList(product); + } + + /** + * 获取衍生型号 + * @param product + * @return + */ + @Override + public List productYsxhList(Product product) { + return oaRedBookMapper.productYsxhList(product); + } + + /** + * 判断是否存在截面 + * @param product + * @return + */ + @Override + public List judgesection(Product product) { + return oaRedBookMapper.judgesection(product); + } + + /** + * 获取截面 + * @param product + * @return + */ + @Override + public List productJmList(Product product) { + return oaRedBookMapper.productJmList(product); + } + + /** + * 查询数据 + * @param product + * @return + */ + @Override + public List searchData(Product product) { + return oaRedBookMapper.searchData(product); + } +} diff --git a/ruoyi-system/src/main/resources/mapper/redBook/OARedBookMapper.xml b/ruoyi-system/src/main/resources/mapper/redBook/OARedBookMapper.xml new file mode 100644 index 0000000..087d883 --- /dev/null +++ b/ruoyi-system/src/main/resources/mapper/redBook/OARedBookMapper.xml @@ -0,0 +1,68 @@ + + + + + + + + + + + + + + + + + + diff --git a/ruoyi-ui/src/api/redBook/redBook.js b/ruoyi-ui/src/api/redBook/redBook.js new file mode 100644 index 0000000..b14bdc5 --- /dev/null +++ b/ruoyi-ui/src/api/redBook/redBook.js @@ -0,0 +1,86 @@ +import request from '@/utils/request' + +// 获取目录 +export function productList(query) { + return request({ + url: '/redBook/redBook/productList', + method: 'get', + params: query + }) +} +// 获取备注信息 +export function productRemarkList(query) { + return request({ + url: '/redBook/redBook/productRemarkList', + method: 'get', + params: query + }) +} +// 获取型号 +export function productXinghList(query) { + return request({ + url: '/redBook/redBook/productXinghList', + method: 'get', + params: query + }) +} +// 判断是否为父节点,如果有说明下面还有子类显示,如果没有则直接显示衍生型号 +export function judgeparent(query) { + return request({ + url: '/redBook/redBook/judgeparent', + method: 'get', + params: query + }) +} +// 获取子类 +export function productZlList(query) { + return request({ + url: '/redBook/redBook/productZlList', + method: 'get', + params: query + }) +} + +// 判断是否存在衍生型号 +export function productYsxhListCheck(query) { + return request({ + url: '/redBook/redBook/productYsxhListCheck', + method: 'get', + params: query + }) +} + +// 获取衍生型号 +export function productYsxhList(query) { + return request({ + url: '/redBook/redBook/productYsxhList', + method: 'get', + params: query + }) +} +// 判断是否存在截面 +export function productJmListCheck(query) { + return request({ + url: '/redBook/redBook/productJmListCheck', + method: 'get', + params: query + }) +} +// 获取截面 +export function productJmList(query) { + return request({ + url: '/redBook/redBook/productJmList', + method: 'get', + params: query + }) +} +//查询数据 +export function searchData(query) { + return request({ + url: '/redBook/redBook/searchData', + method: 'get', + params: query + }) +} + + diff --git a/ruoyi-ui/src/views/redBook/productSelect.vue b/ruoyi-ui/src/views/redBook/productSelect.vue new file mode 100644 index 0000000..966f968 --- /dev/null +++ b/ruoyi-ui/src/views/redBook/productSelect.vue @@ -0,0 +1,415 @@ + + + + +