This commit is contained in:
xd 2024-03-06 09:25:57 +08:00
parent 6c95ddf924
commit 4552e9f081
4 changed files with 156 additions and 33 deletions

View File

@ -31,5 +31,107 @@ public class MaterialDto extends BaseEntity {
private String wdFSurcharge; //盘具点数 private String wdFSurcharge; //盘具点数
private Integer number = 1; //数量默认1 public String getUid() {
return uid;
}
public void setUid(String uid) {
this.uid = uid;
}
public String getProdCategory() {
return prodCategory;
}
public void setProdCategory(String prodCategory) {
this.prodCategory = prodCategory;
}
public String getProdWorkshop() {
return prodWorkshop;
}
public void setProdWorkshop(String prodWorkshop) {
this.prodWorkshop = prodWorkshop;
}
public String getModel() {
return model;
}
public void setModel(String model) {
this.model = model;
}
public String getSpecification() {
return specification;
}
public void setSpecification(String specification) {
this.specification = specification;
}
public String getVoltLevel() {
return voltLevel;
}
public void setVoltLevel(String voltLevel) {
this.voltLevel = voltLevel;
}
public String getMeasureUnit() {
return measureUnit;
}
public void setMeasureUnit(String measureUnit) {
this.measureUnit = measureUnit;
}
public String getMatCostPrice() {
return matCostPrice;
}
public void setMatCostPrice(String matCostPrice) {
this.matCostPrice = matCostPrice;
}
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 getManuCost() {
return manuCost;
}
public void setManuCost(String manuCost) {
this.manuCost = manuCost;
}
public String getWdFSurcharge() {
return wdFSurcharge;
}
public void setWdFSurcharge(String wdFSurcharge) {
this.wdFSurcharge = wdFSurcharge;
}
} }

View File

@ -14,36 +14,6 @@ import java.util.List;
* @Date 2024/3/5 16:07 * @Date 2024/3/5 16:07
* @Version 1.0 * @Version 1.0
*/ */
@Mapper
public interface QuoteMapper { public interface QuoteMapper {
List<MaterialDto> queryMaterialListByParam(String precMaterialName,String vagueMaterialName,String vagueModel);
@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<MaterialDto> queryMaterialListByParam(@Param("precMaterialName") String precMaterialName,
@Param("vagueMaterialName")String vagueMaterialName,
@Param("vagueModel") String vagueModel);
} }

View File

@ -17,6 +17,7 @@ import java.util.List;
*/ */
@Service @Service
public class QuoteServiceImpl implements QuoteService { public class QuoteServiceImpl implements QuoteService {
@Autowired @Autowired
QuoteMapper quoteMapper; QuoteMapper quoteMapper;

View File

@ -0,0 +1,50 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.quote.mapper.QuoteMapper">
<resultMap type="MaterialDto" id="MaterialResult">
<result property="uid" column="uid" />
<result property="model" column="model" />
<result property="specification" column="specification" />
<result property="voltLevel" column="voltLevel" />
<result property="measureUnit" column="measureUnit" />
<result property="prodCategory" column="prodCategory" />
<result property="matCostPrice" column="matCostPrice" />
<result property="manuCost" column="manuCost" />
<result property="wdFSurcharge" column="wdFSurcharge" />
<result property="redBookPrice" column="redBookPrice" />
<result property="rbFacPrice" column="rbFacPrice" />
<result property="redBookCost" column="redBookCost" />
</resultMap>
<select id="queryMaterialListByParam" resultType="com.ruoyi.quote.domain.MaterialDto">
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
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_factory d on d.factory_no = c.factory_id
left join(select 型号,规格,电压等级,红本价格 from [REDBOOK].[RedBook].[dbo].rb_product_price
where version_uid_0 = (select max(version_uid_0) from [REDBOOK].[RedBook].[dbo].rb_product_price a
left join [REDBOOK].[RedBook].[dbo].rb_productVersion b on b.uid_0 = a.version_uid_0
where b.tong_price_0 ='70') and 型号 like '%KYJV%'
)as cc on cc.型号=a.material_xingh collate Chinese_PRC_CI_AS and cc.规格 = a.material_guig collate Chinese_PRC_CI_AS
and cc.电压等级 = a.material_diany collate Chinese_PRC_CI_AS
left join(select 型号,规格,电压等级,成本价格 from [REDBOOK].[RedBook].[dbo].rb_productbase_price
where version_uid_0 = (select max(version_uid_0) from [REDBOOK].[RedBook].[dbo].rb_product_price a
left join [REDBOOK].[RedBook].[dbo].rb_productVersion b on b.uid_0 = a.version_uid_0
where b.tong_price_0 ='70') and 型号 like '%KYJV%'
)as dd on dd.型号=a.material_xingh collate Chinese_PRC_CI_AS and dd.规格 = a.material_guig collate Chinese_PRC_CI_AS
and dd.电压等级= a.material_diany collate Chinese_PRC_CI_AS
where a.material_xingh like '%KYJV%'
</select>
</mapper>