Browse Source

[feat] 销售管理

新增销售估价详情物料采购价格domain
新增销售估价详情物料采购价格Mapper
新增销售估价详情物料采购价格Mapper.xml
新增销售估价详情物料采购价格Service
新增销售估价详情物料采购价格ServiceImpl
dev
liuxiaoxu 4 months ago
parent
commit
77e28f7d88
  1. 225
      ruoyi-admin/src/main/java/com/ruoyi/sales/domain/SalesEstimateDetailMaterial.java
  2. 77
      ruoyi-admin/src/main/java/com/ruoyi/sales/mapper/SalesEstimateDetailMaterialMapper.java
  3. 75
      ruoyi-admin/src/main/java/com/ruoyi/sales/service/ISalesEstimateDetailMaterialService.java
  4. 126
      ruoyi-admin/src/main/java/com/ruoyi/sales/service/impl/SalesEstimateDetailMaterialServiceImpl.java
  5. 132
      ruoyi-admin/src/main/resources/mapper/sales/SalesEstimateDetailMaterialMapper.xml

225
ruoyi-admin/src/main/java/com/ruoyi/sales/domain/SalesEstimateDetailMaterial.java

@ -0,0 +1,225 @@
package com.ruoyi.sales.domain;
import java.math.BigDecimal;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* 销售估价详情物料价格对象 sales_estimate_detail_material
*
* @author 刘晓旭
* @date 2024-08-05
*/
public class SalesEstimateDetailMaterial extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 销售估价详情物料价格ID */
private Long estimateDetailMaterialId;
/** 销售估价详情ID */
@Excel(name = "销售估价详情ID")
private Long estimateDetailId;
/** 估价单号 */
@Excel(name = "估价单号")
private String salesEstimateCode;
/** 料号 */
@Excel(name = "料号")
private String materialNo;
/** 物料名称 */
@Excel(name = "物料名称")
private String materialName;
/** 物料类型 */
@Excel(name = "物料类型")
private String materialType;
/** 图片地址 */
@Excel(name = "图片地址")
private String materialPhotoUrl;
/** 物料单位 */
@Excel(name = "物料单位")
private String materialUnit;
/** 物料品牌 */
@Excel(name = "物料品牌")
private String materialBrand;
/** 物料描述 */
@Excel(name = "物料描述")
private String materialDescribe;
/** 加工方式 */
@Excel(name = "加工方式")
private String materialProcessMethod;
/** 用量 */
@Excel(name = "用量")
private Long useNum;
/** 不含税采购单价(RMB) */
@Excel(name = "不含税采购单价", readConverterExp = "R=MB")
private BigDecimal noTaxPurchaseRmb;
/** 含税采购单价(RMB) */
@Excel(name = "含税采购单价", readConverterExp = "R=MB")
private BigDecimal taxPurchaseRmb;
public void setEstimateDetailMaterialId(Long estimateDetailMaterialId)
{
this.estimateDetailMaterialId = estimateDetailMaterialId;
}
public Long getEstimateDetailMaterialId()
{
return estimateDetailMaterialId;
}
public void setEstimateDetailId(Long estimateDetailId)
{
this.estimateDetailId = estimateDetailId;
}
public Long getEstimateDetailId()
{
return estimateDetailId;
}
public void setSalesEstimateCode(String salesEstimateCode)
{
this.salesEstimateCode = salesEstimateCode;
}
public String getSalesEstimateCode()
{
return salesEstimateCode;
}
public void setMaterialNo(String materialNo)
{
this.materialNo = materialNo;
}
public String getMaterialNo()
{
return materialNo;
}
public void setMaterialName(String materialName)
{
this.materialName = materialName;
}
public String getMaterialName()
{
return materialName;
}
public void setMaterialType(String materialType)
{
this.materialType = materialType;
}
public String getMaterialType()
{
return materialType;
}
public void setMaterialPhotoUrl(String materialPhotoUrl)
{
this.materialPhotoUrl = materialPhotoUrl;
}
public String getMaterialPhotoUrl()
{
return materialPhotoUrl;
}
public void setMaterialUnit(String materialUnit)
{
this.materialUnit = materialUnit;
}
public String getMaterialUnit()
{
return materialUnit;
}
public void setMaterialBrand(String materialBrand)
{
this.materialBrand = materialBrand;
}
public String getMaterialBrand()
{
return materialBrand;
}
public void setMaterialDescribe(String materialDescribe)
{
this.materialDescribe = materialDescribe;
}
public String getMaterialDescribe()
{
return materialDescribe;
}
public void setMaterialProcessMethod(String materialProcessMethod)
{
this.materialProcessMethod = materialProcessMethod;
}
public String getMaterialProcessMethod()
{
return materialProcessMethod;
}
public void setUseNum(Long useNum)
{
this.useNum = useNum;
}
public Long getUseNum()
{
return useNum;
}
public void setNoTaxPurchaseRmb(BigDecimal noTaxPurchaseRmb)
{
this.noTaxPurchaseRmb = noTaxPurchaseRmb;
}
public BigDecimal getNoTaxPurchaseRmb()
{
return noTaxPurchaseRmb;
}
public void setTaxPurchaseRmb(BigDecimal taxPurchaseRmb)
{
this.taxPurchaseRmb = taxPurchaseRmb;
}
public BigDecimal getTaxPurchaseRmb()
{
return taxPurchaseRmb;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("estimateDetailMaterialId", getEstimateDetailMaterialId())
.append("estimateDetailId", getEstimateDetailId())
.append("salesEstimateCode", getSalesEstimateCode())
.append("materialNo", getMaterialNo())
.append("materialName", getMaterialName())
.append("materialType", getMaterialType())
.append("materialPhotoUrl", getMaterialPhotoUrl())
.append("materialUnit", getMaterialUnit())
.append("materialBrand", getMaterialBrand())
.append("materialDescribe", getMaterialDescribe())
.append("materialProcessMethod", getMaterialProcessMethod())
.append("useNum", getUseNum())
.append("noTaxPurchaseRmb", getNoTaxPurchaseRmb())
.append("taxPurchaseRmb", getTaxPurchaseRmb())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.toString();
}
}

77
ruoyi-admin/src/main/java/com/ruoyi/sales/mapper/SalesEstimateDetailMaterialMapper.java

@ -0,0 +1,77 @@
package com.ruoyi.sales.mapper;
import java.util.List;
import com.ruoyi.sales.domain.SalesEstimateDetailMaterial;
/**
* 销售估价详情物料价格Mapper接口
*
* @author 刘晓旭
* @date 2024-08-05
*/
public interface SalesEstimateDetailMaterialMapper
{
/**
* 查询销售估价详情物料价格
*
* @param estimateDetailMaterialId 销售估价详情物料价格ID
* @return 销售估价详情物料价格
*/
public SalesEstimateDetailMaterial selectSalesEstimateDetailMaterialById(Long estimateDetailMaterialId);
/**
* 查询销售估价详情物料价格列表
*
* @param salesEstimateDetailMaterial 销售估价详情物料价格
* @return 销售估价详情物料价格集合
*/
public List<SalesEstimateDetailMaterial> selectSalesEstimateDetailMaterialList(SalesEstimateDetailMaterial salesEstimateDetailMaterial);
/**
* 新增销售估价详情物料价格
*
* @param salesEstimateDetailMaterial 销售估价详情物料价格
* @return 结果
*/
public int insertSalesEstimateDetailMaterial(SalesEstimateDetailMaterial salesEstimateDetailMaterial);
/**
* 修改销售估价详情物料价格
*
* @param salesEstimateDetailMaterial 销售估价详情物料价格
* @return 结果
*/
public int updateSalesEstimateDetailMaterial(SalesEstimateDetailMaterial salesEstimateDetailMaterial);
/**
* 删除销售估价详情物料价格
*
* @param estimateDetailMaterialId 销售估价详情物料价格ID
* @return 结果
*/
public int deleteSalesEstimateDetailMaterialById(Long estimateDetailMaterialId);
/**
* 批量删除销售估价详情物料价格
*
* @param estimateDetailMaterialIds 需要删除的数据ID
* @return 结果
*/
public int deleteSalesEstimateDetailMaterialByIds(String[] estimateDetailMaterialIds);
/**
* 作废销售估价详情物料价格
*
* @param estimateDetailMaterialId 销售估价详情物料价格ID
* @return 结果
*/
public int cancelSalesEstimateDetailMaterialById(Long estimateDetailMaterialId);
/**
* 恢复销售估价详情物料价格
*
* @param estimateDetailMaterialId 销售估价详情物料价格ID
* @return 结果
*/
public int restoreSalesEstimateDetailMaterialById(Long estimateDetailMaterialId);
}

75
ruoyi-admin/src/main/java/com/ruoyi/sales/service/ISalesEstimateDetailMaterialService.java

@ -0,0 +1,75 @@
package com.ruoyi.sales.service;
import java.util.List;
import com.ruoyi.sales.domain.SalesEstimateDetailMaterial;
/**
* 销售估价详情物料价格Service接口
*
* @author 刘晓旭
* @date 2024-08-05
*/
public interface ISalesEstimateDetailMaterialService
{
/**
* 查询销售估价详情物料价格
*
* @param estimateDetailMaterialId 销售估价详情物料价格ID
* @return 销售估价详情物料价格
*/
public SalesEstimateDetailMaterial selectSalesEstimateDetailMaterialById(Long estimateDetailMaterialId);
/**
* 查询销售估价详情物料价格列表
*
* @param salesEstimateDetailMaterial 销售估价详情物料价格
* @return 销售估价详情物料价格集合
*/
public List<SalesEstimateDetailMaterial> selectSalesEstimateDetailMaterialList(SalesEstimateDetailMaterial salesEstimateDetailMaterial);
/**
* 新增销售估价详情物料价格
*
* @param salesEstimateDetailMaterial 销售估价详情物料价格
* @return 结果
*/
public int insertSalesEstimateDetailMaterial(SalesEstimateDetailMaterial salesEstimateDetailMaterial);
/**
* 修改销售估价详情物料价格
*
* @param salesEstimateDetailMaterial 销售估价详情物料价格
* @return 结果
*/
public int updateSalesEstimateDetailMaterial(SalesEstimateDetailMaterial salesEstimateDetailMaterial);
/**
* 批量删除销售估价详情物料价格
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public int deleteSalesEstimateDetailMaterialByIds(String ids);
/**
* 删除销售估价详情物料价格信息
*
* @param estimateDetailMaterialId 销售估价详情物料价格ID
* @return 结果
*/
public int deleteSalesEstimateDetailMaterialById(Long estimateDetailMaterialId);
/**
* 作废销售估价详情物料价格
* @param estimateDetailMaterialId 销售估价详情物料价格ID
* @return
*/
int cancelSalesEstimateDetailMaterialById(Long estimateDetailMaterialId);
/**
* 恢复销售估价详情物料价格
* @param estimateDetailMaterialId 销售估价详情物料价格ID
* @return
*/
int restoreSalesEstimateDetailMaterialById(Long estimateDetailMaterialId);
}

126
ruoyi-admin/src/main/java/com/ruoyi/sales/service/impl/SalesEstimateDetailMaterialServiceImpl.java

@ -0,0 +1,126 @@
package com.ruoyi.sales.service.impl;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.ShiroUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.sales.mapper.SalesEstimateDetailMaterialMapper;
import com.ruoyi.sales.domain.SalesEstimateDetailMaterial;
import com.ruoyi.sales.service.ISalesEstimateDetailMaterialService;
import com.ruoyi.common.core.text.Convert;
/**
* 销售估价详情物料价格Service业务层处理
*
* @author 刘晓旭
* @date 2024-08-05
*/
@Service
public class SalesEstimateDetailMaterialServiceImpl implements ISalesEstimateDetailMaterialService
{
@Autowired
private SalesEstimateDetailMaterialMapper salesEstimateDetailMaterialMapper;
/**
* 查询销售估价详情物料价格
*
* @param estimateDetailMaterialId 销售估价详情物料价格ID
* @return 销售估价详情物料价格
*/
@Override
public SalesEstimateDetailMaterial selectSalesEstimateDetailMaterialById(Long estimateDetailMaterialId)
{
return salesEstimateDetailMaterialMapper.selectSalesEstimateDetailMaterialById(estimateDetailMaterialId);
}
/**
* 查询销售估价详情物料价格列表
*
* @param salesEstimateDetailMaterial 销售估价详情物料价格
* @return 销售估价详情物料价格
*/
@Override
public List<SalesEstimateDetailMaterial> selectSalesEstimateDetailMaterialList(SalesEstimateDetailMaterial salesEstimateDetailMaterial)
{
return salesEstimateDetailMaterialMapper.selectSalesEstimateDetailMaterialList(salesEstimateDetailMaterial);
}
/**
* 新增销售估价详情物料价格
*
* @param salesEstimateDetailMaterial 销售估价详情物料价格
* @return 结果
*/
@Override
public int insertSalesEstimateDetailMaterial(SalesEstimateDetailMaterial salesEstimateDetailMaterial)
{
String loginName = ShiroUtils.getLoginName();
salesEstimateDetailMaterial.setCreateBy(loginName);
salesEstimateDetailMaterial.setCreateTime(DateUtils.getNowDate());
return salesEstimateDetailMaterialMapper.insertSalesEstimateDetailMaterial(salesEstimateDetailMaterial);
}
/**
* 修改销售估价详情物料价格
*
* @param salesEstimateDetailMaterial 销售估价详情物料价格
* @return 结果
*/
@Override
public int updateSalesEstimateDetailMaterial(SalesEstimateDetailMaterial salesEstimateDetailMaterial)
{
String loginName = ShiroUtils.getLoginName();
salesEstimateDetailMaterial.setUpdateBy(loginName);
salesEstimateDetailMaterial.setUpdateTime(DateUtils.getNowDate());
return salesEstimateDetailMaterialMapper.updateSalesEstimateDetailMaterial(salesEstimateDetailMaterial);
}
/**
* 删除销售估价详情物料价格对象
*
* @param ids 需要删除的数据ID
* @return 结果
*/
@Override
public int deleteSalesEstimateDetailMaterialByIds(String ids)
{
return salesEstimateDetailMaterialMapper.deleteSalesEstimateDetailMaterialByIds(Convert.toStrArray(ids));
}
/**
* 删除销售估价详情物料价格信息
*
* @param estimateDetailMaterialId 销售估价详情物料价格ID
* @return 结果
*/
@Override
public int deleteSalesEstimateDetailMaterialById(Long estimateDetailMaterialId)
{
return salesEstimateDetailMaterialMapper.deleteSalesEstimateDetailMaterialById(estimateDetailMaterialId);
}
/**
* 作废销售估价详情物料价格
*
* @param estimateDetailMaterialId 销售估价详情物料价格ID
* @return 结果
*/
@Override
public int cancelSalesEstimateDetailMaterialById(Long estimateDetailMaterialId)
{
return salesEstimateDetailMaterialMapper.cancelSalesEstimateDetailMaterialById(estimateDetailMaterialId);
}
/**
* 恢复销售估价详情物料价格信息
*
* @param estimateDetailMaterialId 销售估价详情物料价格ID
* @return 结果
*/
@Override
public int restoreSalesEstimateDetailMaterialById(Long estimateDetailMaterialId)
{
return salesEstimateDetailMaterialMapper.restoreSalesEstimateDetailMaterialById(estimateDetailMaterialId);
}
}

132
ruoyi-admin/src/main/resources/mapper/sales/SalesEstimateDetailMaterialMapper.xml

@ -0,0 +1,132 @@
<?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.sales.mapper.SalesEstimateDetailMaterialMapper">
<resultMap type="SalesEstimateDetailMaterial" id="SalesEstimateDetailMaterialResult">
<result property="estimateDetailMaterialId" column="estimate_detail_material_id" />
<result property="estimateDetailId" column="estimate_detail_id" />
<result property="salesEstimateCode" column="sales_estimate_code" />
<result property="materialNo" column="material_no" />
<result property="materialName" column="material_name" />
<result property="materialType" column="material_type" />
<result property="materialPhotoUrl" column="material_photo_url" />
<result property="materialUnit" column="material_unit" />
<result property="materialBrand" column="material_brand" />
<result property="materialDescribe" column="material_describe" />
<result property="materialProcessMethod" column="material_process_method" />
<result property="useNum" column="use_num" />
<result property="noTaxPurchaseRmb" column="no_tax_purchase_rmb" />
<result property="taxPurchaseRmb" column="tax_purchase_rmb" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
</resultMap>
<sql id="selectSalesEstimateDetailMaterialVo">
select estimate_detail_material_id, estimate_detail_id, sales_estimate_code, material_no, material_name, material_type, material_photo_url, material_unit, material_brand, material_describe, material_process_method, use_num, no_tax_purchase_rmb, tax_purchase_rmb, create_by, create_time, update_by, update_time, remark from sales_estimate_detail_material
</sql>
<select id="selectSalesEstimateDetailMaterialList" parameterType="SalesEstimateDetailMaterial" resultMap="SalesEstimateDetailMaterialResult">
<include refid="selectSalesEstimateDetailMaterialVo"/>
<where>
</where>
</select>
<select id="selectSalesEstimateDetailMaterialById" parameterType="Long" resultMap="SalesEstimateDetailMaterialResult">
<include refid="selectSalesEstimateDetailMaterialVo"/>
where estimate_detail_material_id = #{estimateDetailMaterialId}
</select>
<insert id="insertSalesEstimateDetailMaterial" parameterType="SalesEstimateDetailMaterial" useGeneratedKeys="true" keyProperty="estimateDetailMaterialId">
insert into sales_estimate_detail_material
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="estimateDetailId != null">estimate_detail_id,</if>
<if test="salesEstimateCode != null">sales_estimate_code,</if>
<if test="materialNo != null">material_no,</if>
<if test="materialName != null">material_name,</if>
<if test="materialType != null">material_type,</if>
<if test="materialPhotoUrl != null">material_photo_url,</if>
<if test="materialUnit != null">material_unit,</if>
<if test="materialBrand != null">material_brand,</if>
<if test="materialDescribe != null">material_describe,</if>
<if test="materialProcessMethod != null">material_process_method,</if>
<if test="useNum != null">use_num,</if>
<if test="noTaxPurchaseRmb != null">no_tax_purchase_rmb,</if>
<if test="taxPurchaseRmb != null">tax_purchase_rmb,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="remark != null">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="estimateDetailId != null">#{estimateDetailId},</if>
<if test="salesEstimateCode != null">#{salesEstimateCode},</if>
<if test="materialNo != null">#{materialNo},</if>
<if test="materialName != null">#{materialName},</if>
<if test="materialType != null">#{materialType},</if>
<if test="materialPhotoUrl != null">#{materialPhotoUrl},</if>
<if test="materialUnit != null">#{materialUnit},</if>
<if test="materialBrand != null">#{materialBrand},</if>
<if test="materialDescribe != null">#{materialDescribe},</if>
<if test="materialProcessMethod != null">#{materialProcessMethod},</if>
<if test="useNum != null">#{useNum},</if>
<if test="noTaxPurchaseRmb != null">#{noTaxPurchaseRmb},</if>
<if test="taxPurchaseRmb != null">#{taxPurchaseRmb},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if>
</trim>
</insert>
<update id="updateSalesEstimateDetailMaterial" parameterType="SalesEstimateDetailMaterial">
update sales_estimate_detail_material
<trim prefix="SET" suffixOverrides=",">
<if test="estimateDetailId != null">estimate_detail_id = #{estimateDetailId},</if>
<if test="salesEstimateCode != null">sales_estimate_code = #{salesEstimateCode},</if>
<if test="materialNo != null">material_no = #{materialNo},</if>
<if test="materialName != null">material_name = #{materialName},</if>
<if test="materialType != null">material_type = #{materialType},</if>
<if test="materialPhotoUrl != null">material_photo_url = #{materialPhotoUrl},</if>
<if test="materialUnit != null">material_unit = #{materialUnit},</if>
<if test="materialBrand != null">material_brand = #{materialBrand},</if>
<if test="materialDescribe != null">material_describe = #{materialDescribe},</if>
<if test="materialProcessMethod != null">material_process_method = #{materialProcessMethod},</if>
<if test="useNum != null">use_num = #{useNum},</if>
<if test="noTaxPurchaseRmb != null">no_tax_purchase_rmb = #{noTaxPurchaseRmb},</if>
<if test="taxPurchaseRmb != null">tax_purchase_rmb = #{taxPurchaseRmb},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where estimate_detail_material_id = #{estimateDetailMaterialId}
</update>
<delete id="deleteSalesEstimateDetailMaterialById" parameterType="Long">
delete from sales_estimate_detail_material where estimate_detail_material_id = #{estimateDetailMaterialId}
</delete>
<delete id="deleteSalesEstimateDetailMaterialByIds" parameterType="String">
delete from sales_estimate_detail_material where estimate_detail_material_id in
<foreach item="estimateDetailMaterialId" collection="array" open="(" separator="," close=")">
#{estimateDetailMaterialId}
</foreach>
</delete>
<update id="cancelSalesEstimateDetailMaterialById" parameterType="Long">
update sales_estimate_detail_material set del_flag = '1' where estimate_detail_material_id = #{estimateDetailMaterialId}
</update>
<update id="restoreSalesEstimateDetailMaterialById" parameterType="Long">
update sales_estimate_detail_material set del_flag = '0' where estimate_detail_material_id = #{estimateDetailMaterialId}
</update>
</mapper>
Loading…
Cancel
Save