From 207197f91cce4c251b853a2a33585abff42e3c3c Mon Sep 17 00:00:00 2001 From: JIAL <2287346125@qq.com> Date: Wed, 6 Mar 2024 08:46:44 +0800 Subject: [PATCH] sql --- .../web/controller/quote/QuoteController.java | 47 ++ .../com/ruoyi/quote/domain/MaterialDto.java | 35 + .../com/ruoyi/quote/mapper/QuoteMapper.java | 49 ++ .../com/ruoyi/quote/service/QuoteService.java | 16 + .../quote/service/impl/QuoteServiceImpl.java | 36 + ruoyi-ui/src/api/quote/quote.js | 9 + ruoyi-ui/src/views/quotePage/quote/index.vue | 660 +++++++++++++----- 7 files changed, 691 insertions(+), 161 deletions(-) create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/web/controller/quote/QuoteController.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/quote/domain/MaterialDto.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/quote/mapper/QuoteMapper.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/quote/service/QuoteService.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/quote/service/impl/QuoteServiceImpl.java create mode 100644 ruoyi-ui/src/api/quote/quote.js diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/quote/QuoteController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/quote/QuoteController.java new file mode 100644 index 0000000..6287f22 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/quote/QuoteController.java @@ -0,0 +1,47 @@ +package com.ruoyi.web.controller.quote; + +import com.ruoyi.common.annotation.DataSource; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.page.TableDataInfo; +import com.ruoyi.common.enums.DataSourceType; +import com.ruoyi.quote.domain.MaterialDto; +import com.ruoyi.quote.service.QuoteService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +import static com.ruoyi.common.utils.PageUtils.startPage; + +/** + * @ClassName QuoteController + * @Description TODO + * @Author JIAL + * @Date 2024/3/5 12:57 + * @Version 1.0 + */ +@RestController +@RequestMapping("/quote") +@DataSource(DataSourceType.QUOT) +public class QuoteController extends BaseController { + + @Autowired + QuoteService quoteService; + + @PostMapping("/materialList") + public TableDataInfo queryMaterialListByParam(@RequestParam("precMaterialName") String precMaterialName, + @RequestParam("vagueMaterialName") String vagueMaterialName, + @RequestParam("vagueModel") String vagueModel) { + startPage(); + logger.info(precMaterialName + vagueMaterialName + vagueModel); + List materialDtos = quoteService.queryMaterialListByParam(precMaterialName, + vagueMaterialName, vagueModel); + + System.out.println("打通接口"); + return getDataTable(materialDtos); + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/quote/domain/MaterialDto.java b/ruoyi-system/src/main/java/com/ruoyi/quote/domain/MaterialDto.java new file mode 100644 index 0000000..338da2d --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/quote/domain/MaterialDto.java @@ -0,0 +1,35 @@ +package com.ruoyi.quote.domain; + + +import com.ruoyi.common.core.domain.BaseEntity; + +public class MaterialDto extends BaseEntity { + + private String uid; //物料uid + + private String prodCategory; //产品大类 + + private String prodWorkshop; //生产车间 + + private String model; //型号 + + private String specification; //规格 + + private String voltLevel; //电压等级 + + private String measureUnit; //单位 + + private String matCostPrice; //材料成本价格 + + private String redBookPrice; //红本价格 + + private String redBookCost; //红本成本 + + private String rbFacPrice; //红本厂价 + + private String manuCost; //制造成本 + + private String wdFSurcharge; //盘具点数 + + private Integer number = 1; //数量默认1 +} \ No newline at end of file diff --git a/ruoyi-system/src/main/java/com/ruoyi/quote/mapper/QuoteMapper.java b/ruoyi-system/src/main/java/com/ruoyi/quote/mapper/QuoteMapper.java new file mode 100644 index 0000000..bc736f3 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/quote/mapper/QuoteMapper.java @@ -0,0 +1,49 @@ +package com.ruoyi.quote.mapper; + +import com.ruoyi.quote.domain.MaterialDto; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; + +import java.util.List; + +/** + * @ClassName QuoteMapper + * @Description TODO + * @Author JIAL + * @Date 2024/3/5 16:07 + * @Version 1.0 + */ +@Mapper +public interface QuoteMapper { + + @Select("select a.material_id AS uid, a.material_xingh AS model,a.material_guig AS specification,a.material_diany AS voltLevel,a.material_dw AS measureUnit,c.type_name AS prodCategory,\n" + + "b.price matCostPrice, d.factory_total_ratio/100 manuCost,d.factory_pj_ratio/100 wdFSurcharge,\n" + + "cc.红本价格 AS redBookPrice,cc.红本价格*0.8 rbFacPrice,dd.成本价格 AS redBookCost\n" + + "from c_material a \n" + + "left join \n" + + "(select a.cost_material_id,sum((isnull(a.cost_cl_qty,0)+isnull(a.cost_cl_qty_2,0))*b.material_price) price from c_material_cost a\n" + + "left join c_yl_material b on a.cost_cl_id=b.material_no\n" + + "group by a.cost_material_id\n" + + ")b on a.material_id=b.cost_material_id\n" + + "left join c_material_type_factory c on a.material_type_id = c.type_no\n" + + "left join c_factory d on d.factory_no = c.factory_id\n" + + "left join(select 型号,规格,电压等级,红本价格 from [REDBOOK].[RedBook].[dbo].rb_product_price \n" + + " where version_uid_0 = (select max(version_uid_0) from [REDBOOK].[RedBook].[dbo].rb_product_price a\n" + + " left join [REDBOOK].[RedBook].[dbo].rb_productVersion b on b.uid_0 = a.version_uid_0\n" + + " where b.tong_price_0 ='70') and 型号 like '$%{vagueMaterialName}%' \n" + + ")as cc on cc.型号=a.material_xingh collate Chinese_PRC_CI_AS and cc.规格 = a.material_guig collate Chinese_PRC_CI_AS \n" + + "and cc.电压等级 = a.material_diany collate Chinese_PRC_CI_AS\n" + + "\n" + + "left join(select 型号,规格,电压等级,成本价格 from [REDBOOK].[RedBook].[dbo].rb_productbase_price \n" + + " where version_uid_0 = (select max(version_uid_0) from [REDBOOK].[RedBook].[dbo].rb_product_price a\n" + + " left join [REDBOOK].[RedBook].[dbo].rb_productVersion b on b.uid_0 = a.version_uid_0\n" + + " where b.tong_price_0 ='70') and 型号 like '$%{vagueMaterialName}%' \n" + + ")as dd on dd.型号=a.material_xingh collate Chinese_PRC_CI_AS and dd.规格 = a.material_guig collate Chinese_PRC_CI_AS \n" + + " and dd.电压等级= a.material_diany collate Chinese_PRC_CI_AS\n" + + "where a.material_xingh like '${precMaterialName}%' AND a.material_xingh like '%${vagueMaterialName}%' AND a.material_guig like '%${vagueModel}%'" + ) + List queryMaterialListByParam(@Param("precMaterialName") String precMaterialName, + @Param("vagueMaterialName")String vagueMaterialName, + @Param("vagueModel") String vagueModel); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/quote/service/QuoteService.java b/ruoyi-system/src/main/java/com/ruoyi/quote/service/QuoteService.java new file mode 100644 index 0000000..5a3d856 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/quote/service/QuoteService.java @@ -0,0 +1,16 @@ +package com.ruoyi.quote.service; + +import com.ruoyi.quote.domain.MaterialDto; + +import java.util.List; + +/** + * @ClassName QuoteService + * @Description TODO + * @Author JIAL + * @Date 2024/3/5 16:06 + * @Version 1.0 + */ +public interface QuoteService { + List queryMaterialListByParam(String precMaterialName, String vagueMaterialName, String vagueModel); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/quote/service/impl/QuoteServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/quote/service/impl/QuoteServiceImpl.java new file mode 100644 index 0000000..73b9094 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/quote/service/impl/QuoteServiceImpl.java @@ -0,0 +1,36 @@ +package com.ruoyi.quote.service.impl; + +import com.ruoyi.quote.domain.MaterialDto; +import com.ruoyi.quote.mapper.QuoteMapper; +import com.ruoyi.quote.service.QuoteService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * @ClassName QuoteServiceImpl + * @Description TODO + * @Author JIAL + * @Date 2024/3/5 16:07 + * @Version 1.0 + */ +@Service +public class QuoteServiceImpl implements QuoteService { + @Autowired + QuoteMapper quoteMapper; + + /** + * @title queryMaterialListByParam + * @description 根据条件查询物料信息 + * @author JIAL + * @param: precMaterialName + * @param: vagueMaterialName + * @param: vagueModel + * @updateTime 2024/3/5 16:16 + * @return: java.util.List + */ + public List queryMaterialListByParam(String precMaterialName, String vagueMaterialName, String vagueModel) { + return quoteMapper.queryMaterialListByParam(precMaterialName, vagueMaterialName, vagueModel); + } +} diff --git a/ruoyi-ui/src/api/quote/quote.js b/ruoyi-ui/src/api/quote/quote.js new file mode 100644 index 0000000..9013d17 --- /dev/null +++ b/ruoyi-ui/src/api/quote/quote.js @@ -0,0 +1,9 @@ +import request from '@/utils/request' + +export function queryMaterialListByParam(query) { + return request({ + url: '/quote/materialList', + method: 'post', + params: query + }) +} diff --git a/ruoyi-ui/src/views/quotePage/quote/index.vue b/ruoyi-ui/src/views/quotePage/quote/index.vue index 6131fe4..ff7b228 100644 --- a/ruoyi-ui/src/views/quotePage/quote/index.vue +++ b/ruoyi-ui/src/views/quotePage/quote/index.vue @@ -7,195 +7,220 @@
- - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + @@ -248,14 +273,247 @@
- 添加物料 + 添加物料 计算数据
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + + + + + + + 查询物料 + + +
+
+
+ + + + + + + + + + + + + + + + +
+
+
+ {{ selectedItem.model }} , {{ selectedItem.specification }} , {{ selectedItem.voltLevel }} + +
+
+
+ +
+ + 确认 + 取消 + +
+
@@ -419,4 +746,15 @@ export default { backdrop-filter: blur(10px); /* 调整模糊度 */ -webkit-backdrop-filter: blur(10px); /* 兼容性处理,适用于一些WebKit浏览器 */ } + +.changed-field { + background-color: #ffe6e6; /* 更改后的背景颜色 */ +} + +.materialDialogTable .el-dialog__header{ + padding: 20px 20px 0px !important; +} +.materialDialogTable .el-dialog__body{ + padding: 0px 20px !important; +}