From 947853a1e819724ab0cf0eefdee1c03be5811a61 Mon Sep 17 00:00:00 2001 From: JIAL <2287346125@qq.com> Date: Wed, 13 Mar 2024 09:59:58 +0800 Subject: [PATCH] 11 --- .../web/controller/quote/QuoteController.java | 58 ++++++- .../quote/domain/CalculateRBParamDto.java | 41 ++++- .../com/ruoyi/quote/domain/MaterialDto.java | 16 +- .../com/ruoyi/quote/mapper/QuoteMapper.java | 7 + .../com/ruoyi/quote/service/QuoteService.java | 7 + .../quote/service/impl/QuoteServiceImpl.java | 41 +++++ .../resources/mapper/quote/QuoteMapper.xml | 69 +++++++- ruoyi-ui/src/api/quote/quote.js | 17 +- ruoyi-ui/src/views/quotePage/quote/index.vue | 153 ++++++++++++++++-- 9 files changed, 382 insertions(+), 27 deletions(-) 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 index 331c51d..4e76716 100644 --- 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 @@ -25,12 +25,23 @@ import static com.ruoyi.common.utils.PageUtils.startPage; */ @RestController @RequestMapping("/quote") -@DataSource(DataSourceType.QUOT) + public class QuoteController extends BaseController { @Autowired QuoteService quoteService; + /** + * @title queryMaterialListByParam + * @description 获取物料列表 + * @author JIAL + * @param: precMaterialName + * @param: vagueMaterialName + * @param: vagueModel + * @updateTime 2024/3/11 10:56 + * @return: com.ruoyi.common.core.page.TableDataInfo + */ + @DataSource(DataSourceType.QUOT) @PostMapping("/materialList") public TableDataInfo queryMaterialListByParam(@RequestParam("precMaterialName") String precMaterialName, @RequestParam("vagueMaterialName") String vagueMaterialName, @@ -44,13 +55,48 @@ public class QuoteController extends BaseController { return getDataTable(materialDtos); } + /** + * @title queryRedBookPriceByParam + * @description 计算物料红本价格 + * @author JIAL + * @param: params + * @updateTime 2024/3/11 10:56 + */ + @DataSource(DataSourceType.QUOT) + @PostMapping("/redBCost") + public AjaxResult queryRedBCostByParams(@RequestBody List params) { + List calculateRBParamDtoList = quoteService.queryRedBCostByParams(params); + logger.info("查询结果: {}", calculateRBParamDtoList); + return success(calculateRBParamDtoList); + } + + /** + * @title queryRedBPriceByParams + * @description 获取红本价格 + * @author JIAL + * @param: params + * @updateTime 2024/3/12 10:33 + * @return: com.ruoyi.common.core.domain.AjaxResult + */ + @DataSource(DataSourceType.QUOT) @PostMapping("/redBPrice") - public void queryRedBookPriceByParam(@RequestBody List params) { - - System.out.println(params.get(0).getModel()); - System.out.println(params.get(0).getSpecification()); - System.out.println(params.get(0).getVoltLevel()); + public AjaxResult queryRedBPriceByParams(@RequestBody List params) { + List calculateRBParamDtoList = quoteService.queryRedBPriceByParams(params); + logger.info("查询结果: {}", calculateRBParamDtoList); + return success(calculateRBParamDtoList); + } + /** + * @title queryRedBookVersion + * @description 获取红本版本号 + * @author JIAL + * @updateTime 2024/3/11 11:24 + * @return: com.ruoyi.common.core.domain.AjaxResult + */ + @DataSource(DataSourceType.REDBOOK) + @PostMapping("/redBookVer") + public AjaxResult queryRedBookVersion() { + return success(quoteService.queryRedBookVer()); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/quote/domain/CalculateRBParamDto.java b/ruoyi-system/src/main/java/com/ruoyi/quote/domain/CalculateRBParamDto.java index 6b0f860..ef3ebc9 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/quote/domain/CalculateRBParamDto.java +++ b/ruoyi-system/src/main/java/com/ruoyi/quote/domain/CalculateRBParamDto.java @@ -9,9 +9,48 @@ package com.ruoyi.quote.domain; public class CalculateRBParamDto { private String model; private String specification; - private String voltLevel; + private String redBookVer; //红本版本号 + + private String redBookPrice; //红本价格 + + private String redBookCost; //红本成本 + + private String rbFacPrice; //红本厂价 + + public String getRedBookVer() { + return redBookVer; + } + + public void setRedBookVer(String redBookVer) { + this.redBookVer = redBookVer; + } + + public String getRedBookPrice() { + return redBookPrice; + } + + public void setRedBookPrice(String redBookPrice) { + this.redBookPrice = redBookPrice; + } + + public String getRedBookCost() { + return redBookCost; + } + + public void setRedBookCost(String redBookCost) { + this.redBookCost = redBookCost; + } + + public String getRbFacPrice() { + return rbFacPrice; + } + + public void setRbFacPrice(String rbFacPrice) { + this.rbFacPrice = rbFacPrice; + } + public String getVoltLevel() { return voltLevel; } 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 index afa49b4..09c96eb 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/quote/domain/MaterialDto.java +++ b/ruoyi-system/src/main/java/com/ruoyi/quote/domain/MaterialDto.java @@ -25,6 +25,14 @@ public class MaterialDto extends BaseEntity { private double redBookCost = 0; //红本成本 + private double rbFacPrice = 0; //红本厂价 + + private String manuCost; //制造成本 + + private String wdFSurcharge; //盘具点数 + + private Integer number = 1; + public double getMatCostPrice() { return matCostPrice; } @@ -57,14 +65,6 @@ public class MaterialDto extends BaseEntity { this.rbFacPrice = rbFacPrice; } - private double rbFacPrice = 0; //红本厂价 - - private String manuCost; //制造成本 - - private String wdFSurcharge; //盘具点数 - - private Integer number = 1; - public Integer getNumber() { return number; } 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 index 5261c01..9cda06d 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/quote/mapper/QuoteMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/quote/mapper/QuoteMapper.java @@ -1,5 +1,6 @@ package com.ruoyi.quote.mapper; +import com.ruoyi.quote.domain.CalculateRBParamDto; import com.ruoyi.quote.domain.MaterialDto; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -18,4 +19,10 @@ public interface QuoteMapper { List selectMaterialListByParam(@Param("precMaterialName") String precMaterialName, @Param("vagueMaterialName")String vagueMaterialName, @Param("vagueModel") String vagueModel); + + List queryRedBCostByParams(@Param("params") List params); + + List queryRedBPriceByParams(@Param("params") List params); + + String queryRedBookVer(); } 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 index 5a3d856..51b20ba 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/quote/service/QuoteService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/quote/service/QuoteService.java @@ -1,5 +1,6 @@ package com.ruoyi.quote.service; +import com.ruoyi.quote.domain.CalculateRBParamDto; import com.ruoyi.quote.domain.MaterialDto; import java.util.List; @@ -13,4 +14,10 @@ import java.util.List; */ public interface QuoteService { List queryMaterialListByParam(String precMaterialName, String vagueMaterialName, String vagueModel); + + List queryRedBCostByParams(List params); + + List queryRedBPriceByParams(List params); + + String queryRedBookVer(); } 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 index 25560e3..e68de19 100644 --- 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 @@ -1,5 +1,6 @@ package com.ruoyi.quote.service.impl; +import com.ruoyi.quote.domain.CalculateRBParamDto; import com.ruoyi.quote.domain.MaterialDto; import com.ruoyi.quote.mapper.QuoteMapper; import com.ruoyi.quote.service.QuoteService; @@ -31,7 +32,47 @@ public class QuoteServiceImpl implements QuoteService { * @updateTime 2024/3/5 16:16 * @return: java.util.List */ + @Override public List queryMaterialListByParam(String precMaterialName, String vagueMaterialName, String vagueModel) { return quoteMapper.selectMaterialListByParam(precMaterialName, vagueMaterialName, vagueModel); } + + /** + * @title queryCostPriceByParams + * @description 查红本成本 + * @author JIAL + * @param: params + * @updateTime 2024/3/11 9:44 + * @return: java.util.List + */ + @Override + public List queryRedBCostByParams(List params) { + return quoteMapper.queryRedBCostByParams(params); + } + + /** + * @title queryRedBPriceByParams + * @description 获取红本价 + * @author JIAL + * @param: params + * @updateTime 2024/3/12 10:32 + * @return: java.util.List + */ + @Override + public List queryRedBPriceByParams(List params) { + return quoteMapper.queryRedBPriceByParams(params); + } + + + /** + * @title queryRedBookVer + * @description 获取红本价最新版本 + * @author JIAL + * @updateTime 2024/3/11 11:13 + * @return: java.lang.String + */ + @Override + public String queryRedBookVer() { + return quoteMapper.queryRedBookVer(); + } } diff --git a/ruoyi-system/src/main/resources/mapper/quote/QuoteMapper.xml b/ruoyi-system/src/main/resources/mapper/quote/QuoteMapper.xml index e1f3c78..64c419f 100644 --- a/ruoyi-system/src/main/resources/mapper/quote/QuoteMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/quote/QuoteMapper.xml @@ -19,7 +19,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - + 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, + b.price matCostPrice, d.factory_total_ratio/100 manuCost,d.factory_pj_ratio/100 wdFSurcharge, + cc.红本价格 AS redBookPrice,cc.红本价格*0.8 rbFacPrice, dd.成本价格 AS redBookCost + from c_material a + left join + (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 + left join c_yl_material b on a.cost_cl_id=b.material_no + where b.material_state='0' + group by a.cost_material_id + )b on a.material_id=b.cost_material_id + left join c_material_type_factory c on a.material_type_id = c.type_no + left join c_material_type e on e.type_no = c.type_no + left join c_factory d on d.factory_no = c.factory_id + left join(select 型号,规格,电压等级,红本价格 from temp_price + where version_uid_0 = 804 + )as cc on cc.型号=a.material_xingh and cc.规格 = a.material_guig + and cc.电压等级 = a.material_diany + left join(select 型号,规格,电压等级,成本价格 from temp_base_price + where version_uid_0 = 804 + )as dd on dd.型号=a.material_xingh and dd.规格 = a.material_guig + and dd.电压等级= a.material_diany + + a.material_state='0' and e.type_state ='0' + and a.material_xingh like concat('', #{precMaterialName}, '%') + and a.material_xingh like concat('%', #{vagueMaterialName}, '%') + and a.material_guig like concat('%', #{vagueModel}, '%') + + ORDER BY a.material_id + + + + + + + + diff --git a/ruoyi-ui/src/api/quote/quote.js b/ruoyi-ui/src/api/quote/quote.js index f40e9b2..c3adb04 100644 --- a/ruoyi-ui/src/api/quote/quote.js +++ b/ruoyi-ui/src/api/quote/quote.js @@ -8,10 +8,25 @@ export function queryMaterialListByParam(query) { }) } -export function queryRedBookPriceByParam (query) { +export function queryRedBCostByParams (query) { + return request({ + url: '/quote/redBCost', + method: 'post', + data: query + }) +} + +export function queryRedBPriceByParams (query) { return request({ url: '/quote/redBPrice', method: 'post', data: query }) } + +export function queryRedBookVer () { + return request({ + url: '/quote/redBookVer', + method: 'post', + }) +} diff --git a/ruoyi-ui/src/views/quotePage/quote/index.vue b/ruoyi-ui/src/views/quotePage/quote/index.vue index 79e450e..91e4214 100644 --- a/ruoyi-ui/src/views/quotePage/quote/index.vue +++ b/ruoyi-ui/src/views/quotePage/quote/index.vue @@ -274,8 +274,8 @@
添加物料 - 计算红本价格 - 计算数据 + + 计算数据
@@ -381,7 +381,7 @@ prop="wdFSurcharge" label="盘具运费">