Bladeren bron

Merge remote-tracking branch 'origin/master' into master

zxfqwert 1 maand geleden
bovenliggende
commit
a642323f74

+ 104 - 0
jd-logistics-modules/jd-logistics-system/src/main/java/com/ruoyi/logistics/controller/SysDeptRateController.java

@@ -0,0 +1,104 @@
+package com.ruoyi.logistics.controller;
+
+import java.util.List;
+import javax.servlet.http.HttpServletResponse;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.ruoyi.common.log.annotation.Log;
+import com.ruoyi.common.log.enums.BusinessType;
+import com.ruoyi.common.security.annotation.RequiresPermissions;
+import com.ruoyi.logistics.domain.SysDeptRate;
+import com.ruoyi.logistics.service.ISysDeptRateService;
+import com.ruoyi.common.core.web.controller.BaseController;
+import com.ruoyi.common.core.web.domain.AjaxResult;
+import com.ruoyi.common.core.utils.poi.ExcelUtil;
+import com.ruoyi.common.core.web.page.TableDataInfo;
+
+/**
+ * 供应商费率配置Controller
+ * 
+ * @author RuiJing
+ * @date 2026-03-17
+ */
+@RestController
+@RequestMapping("/rate")
+public class SysDeptRateController extends BaseController
+{
+    @Autowired
+    private ISysDeptRateService sysDeptRateService;
+
+    /**
+     * 查询供应商费率配置列表
+     */
+    @RequiresPermissions("logistics:rate:list")
+    @GetMapping("/list")
+    public TableDataInfo list(SysDeptRate sysDeptRate)
+    {
+        startPage();
+        List<SysDeptRate> list = sysDeptRateService.selectSysDeptRateList(sysDeptRate);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出供应商费率配置列表
+     */
+    @RequiresPermissions("logistics:rate:export")
+    @Log(title = "供应商费率配置", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, SysDeptRate sysDeptRate)
+    {
+        List<SysDeptRate> list = sysDeptRateService.selectSysDeptRateList(sysDeptRate);
+        ExcelUtil<SysDeptRate> util = new ExcelUtil<SysDeptRate>(SysDeptRate.class);
+        util.exportExcel(response, list, "供应商费率配置数据");
+    }
+
+    /**
+     * 获取供应商费率配置详细信息
+     */
+    @RequiresPermissions("logistics:rate:query")
+    @GetMapping(value = "/{rateId}")
+    public AjaxResult getInfo(@PathVariable("rateId") Long rateId)
+    {
+        return success(sysDeptRateService.selectSysDeptRateByRateId(rateId));
+    }
+
+    /**
+     * 新增供应商费率配置
+     */
+    @RequiresPermissions("logistics:rate:add")
+    @Log(title = "供应商费率配置", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody SysDeptRate sysDeptRate)
+    {
+        return toAjax(sysDeptRateService.insertSysDeptRate(sysDeptRate));
+    }
+
+    /**
+     * 修改供应商费率配置
+     */
+    @RequiresPermissions("logistics:rate:edit")
+    @Log(title = "供应商费率配置", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody SysDeptRate sysDeptRate)
+    {
+        return toAjax(sysDeptRateService.updateSysDeptRate(sysDeptRate));
+    }
+
+    /**
+     * 删除供应商费率配置
+     */
+    @RequiresPermissions("logistics:rate:remove")
+    @Log(title = "供应商费率配置", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{rateIds}")
+    public AjaxResult remove(@PathVariable Long[] rateIds)
+    {
+        return toAjax(sysDeptRateService.deleteSysDeptRateByRateIds(rateIds));
+    }
+}

+ 147 - 0
jd-logistics-modules/jd-logistics-system/src/main/java/com/ruoyi/logistics/domain/SysDeptRate.java

@@ -0,0 +1,147 @@
+package com.ruoyi.logistics.domain;
+
+import java.math.BigDecimal;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.ruoyi.common.core.annotation.Excel;
+import com.ruoyi.common.core.web.domain.BaseEntity;
+
+/**
+ * 供应商费率配置对象 sys_dept_rate
+ * 
+ * @author RuiJing
+ * @date 2026-03-17
+ */
+public class SysDeptRate extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /**  */
+    private Long rateId;
+
+    /**  */
+    @Excel(name = "")
+    private Long deptId;
+
+    /** 物流公司类型  取字典 */
+    @Excel(name = "物流公司类型  取字典")
+    private String companyType;
+
+    /** 快递产品类型   取字典 */
+    @Excel(name = "快递产品类型   取字典")
+    private String productType;
+
+    /** 区间开始 */
+    @Excel(name = "区间开始")
+    private Long intervalBegins;
+
+    /** 区间结束 */
+    @Excel(name = "区间结束")
+    private Long intervalEnds;
+
+    /** 折扣 */
+    @Excel(name = "折扣")
+    private BigDecimal rate;
+
+    /**  */
+    @Excel(name = "")
+    private Long userId;
+
+    public void setRateId(Long rateId) 
+    {
+        this.rateId = rateId;
+    }
+
+    public Long getRateId() 
+    {
+        return rateId;
+    }
+
+    public void setDeptId(Long deptId) 
+    {
+        this.deptId = deptId;
+    }
+
+    public Long getDeptId() 
+    {
+        return deptId;
+    }
+
+    public void setCompanyType(String companyType) 
+    {
+        this.companyType = companyType;
+    }
+
+    public String getCompanyType() 
+    {
+        return companyType;
+    }
+
+    public void setProductType(String productType) 
+    {
+        this.productType = productType;
+    }
+
+    public String getProductType() 
+    {
+        return productType;
+    }
+
+    public void setIntervalBegins(Long intervalBegins) 
+    {
+        this.intervalBegins = intervalBegins;
+    }
+
+    public Long getIntervalBegins() 
+    {
+        return intervalBegins;
+    }
+
+    public void setIntervalEnds(Long intervalEnds) 
+    {
+        this.intervalEnds = intervalEnds;
+    }
+
+    public Long getIntervalEnds() 
+    {
+        return intervalEnds;
+    }
+
+    public void setRate(BigDecimal rate) 
+    {
+        this.rate = rate;
+    }
+
+    public BigDecimal getRate() 
+    {
+        return rate;
+    }
+
+    public void setUserId(Long userId) 
+    {
+        this.userId = userId;
+    }
+
+    public Long getUserId() 
+    {
+        return userId;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("rateId", getRateId())
+            .append("deptId", getDeptId())
+            .append("companyType", getCompanyType())
+            .append("productType", getProductType())
+            .append("intervalBegins", getIntervalBegins())
+            .append("intervalEnds", getIntervalEnds())
+            .append("rate", getRate())
+            .append("userId", getUserId())
+            .append("createTime", getCreateTime())
+            .append("createBy", getCreateBy())
+            .append("updateTime", getUpdateTime())
+            .append("updateBy", getUpdateBy())
+            .toString();
+    }
+}

+ 61 - 0
jd-logistics-modules/jd-logistics-system/src/main/java/com/ruoyi/logistics/mapper/SysDeptRateMapper.java

@@ -0,0 +1,61 @@
+package com.ruoyi.logistics.mapper;
+
+import java.util.List;
+import com.ruoyi.logistics.domain.SysDeptRate;
+
+/**
+ * 供应商费率配置Mapper接口
+ * 
+ * @author RuiJing
+ * @date 2026-03-17
+ */
+public interface SysDeptRateMapper 
+{
+    /**
+     * 查询供应商费率配置
+     * 
+     * @param rateId 供应商费率配置主键
+     * @return 供应商费率配置
+     */
+    public SysDeptRate selectSysDeptRateByRateId(Long rateId);
+
+    /**
+     * 查询供应商费率配置列表
+     * 
+     * @param sysDeptRate 供应商费率配置
+     * @return 供应商费率配置集合
+     */
+    public List<SysDeptRate> selectSysDeptRateList(SysDeptRate sysDeptRate);
+
+    /**
+     * 新增供应商费率配置
+     * 
+     * @param sysDeptRate 供应商费率配置
+     * @return 结果
+     */
+    public int insertSysDeptRate(SysDeptRate sysDeptRate);
+
+    /**
+     * 修改供应商费率配置
+     * 
+     * @param sysDeptRate 供应商费率配置
+     * @return 结果
+     */
+    public int updateSysDeptRate(SysDeptRate sysDeptRate);
+
+    /**
+     * 删除供应商费率配置
+     * 
+     * @param rateId 供应商费率配置主键
+     * @return 结果
+     */
+    public int deleteSysDeptRateByRateId(Long rateId);
+
+    /**
+     * 批量删除供应商费率配置
+     * 
+     * @param rateIds 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteSysDeptRateByRateIds(Long[] rateIds);
+}

+ 61 - 0
jd-logistics-modules/jd-logistics-system/src/main/java/com/ruoyi/logistics/service/ISysDeptRateService.java

@@ -0,0 +1,61 @@
+package com.ruoyi.logistics.service;
+
+import java.util.List;
+import com.ruoyi.logistics.domain.SysDeptRate;
+
+/**
+ * 供应商费率配置Service接口
+ * 
+ * @author RuiJing
+ * @date 2026-03-17
+ */
+public interface ISysDeptRateService 
+{
+    /**
+     * 查询供应商费率配置
+     * 
+     * @param rateId 供应商费率配置主键
+     * @return 供应商费率配置
+     */
+    public SysDeptRate selectSysDeptRateByRateId(Long rateId);
+
+    /**
+     * 查询供应商费率配置列表
+     * 
+     * @param sysDeptRate 供应商费率配置
+     * @return 供应商费率配置集合
+     */
+    public List<SysDeptRate> selectSysDeptRateList(SysDeptRate sysDeptRate);
+
+    /**
+     * 新增供应商费率配置
+     * 
+     * @param sysDeptRate 供应商费率配置
+     * @return 结果
+     */
+    public int insertSysDeptRate(SysDeptRate sysDeptRate);
+
+    /**
+     * 修改供应商费率配置
+     * 
+     * @param sysDeptRate 供应商费率配置
+     * @return 结果
+     */
+    public int updateSysDeptRate(SysDeptRate sysDeptRate);
+
+    /**
+     * 批量删除供应商费率配置
+     * 
+     * @param rateIds 需要删除的供应商费率配置主键集合
+     * @return 结果
+     */
+    public int deleteSysDeptRateByRateIds(Long[] rateIds);
+
+    /**
+     * 删除供应商费率配置信息
+     * 
+     * @param rateId 供应商费率配置主键
+     * @return 结果
+     */
+    public int deleteSysDeptRateByRateId(Long rateId);
+}

+ 96 - 0
jd-logistics-modules/jd-logistics-system/src/main/java/com/ruoyi/logistics/service/impl/SysDeptRateServiceImpl.java

@@ -0,0 +1,96 @@
+package com.ruoyi.logistics.service.impl;
+
+import java.util.List;
+import com.ruoyi.common.core.utils.DateUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.ruoyi.logistics.mapper.SysDeptRateMapper;
+import com.ruoyi.logistics.domain.SysDeptRate;
+import com.ruoyi.logistics.service.ISysDeptRateService;
+
+/**
+ * 供应商费率配置Service业务层处理
+ * 
+ * @author RuiJing
+ * @date 2026-03-17
+ */
+@Service
+public class SysDeptRateServiceImpl implements ISysDeptRateService 
+{
+    @Autowired
+    private SysDeptRateMapper sysDeptRateMapper;
+
+    /**
+     * 查询供应商费率配置
+     * 
+     * @param rateId 供应商费率配置主键
+     * @return 供应商费率配置
+     */
+    @Override
+    public SysDeptRate selectSysDeptRateByRateId(Long rateId)
+    {
+        return sysDeptRateMapper.selectSysDeptRateByRateId(rateId);
+    }
+
+    /**
+     * 查询供应商费率配置列表
+     * 
+     * @param sysDeptRate 供应商费率配置
+     * @return 供应商费率配置
+     */
+    @Override
+    public List<SysDeptRate> selectSysDeptRateList(SysDeptRate sysDeptRate)
+    {
+        return sysDeptRateMapper.selectSysDeptRateList(sysDeptRate);
+    }
+
+    /**
+     * 新增供应商费率配置
+     * 
+     * @param sysDeptRate 供应商费率配置
+     * @return 结果
+     */
+    @Override
+    public int insertSysDeptRate(SysDeptRate sysDeptRate)
+    {
+        sysDeptRate.setCreateTime(DateUtils.getNowDate());
+        return sysDeptRateMapper.insertSysDeptRate(sysDeptRate);
+    }
+
+    /**
+     * 修改供应商费率配置
+     * 
+     * @param sysDeptRate 供应商费率配置
+     * @return 结果
+     */
+    @Override
+    public int updateSysDeptRate(SysDeptRate sysDeptRate)
+    {
+        sysDeptRate.setUpdateTime(DateUtils.getNowDate());
+        return sysDeptRateMapper.updateSysDeptRate(sysDeptRate);
+    }
+
+    /**
+     * 批量删除供应商费率配置
+     * 
+     * @param rateIds 需要删除的供应商费率配置主键
+     * @return 结果
+     */
+    @Override
+    public int deleteSysDeptRateByRateIds(Long[] rateIds)
+    {
+        return sysDeptRateMapper.deleteSysDeptRateByRateIds(rateIds);
+    }
+
+    /**
+     * 删除供应商费率配置信息
+     * 
+     * @param rateId 供应商费率配置主键
+     * @return 结果
+     */
+    @Override
+    public int deleteSysDeptRateByRateId(Long rateId)
+    {
+        return sysDeptRateMapper.deleteSysDeptRateByRateId(rateId);
+    }
+}

+ 102 - 0
jd-logistics-modules/jd-logistics-system/src/main/resources/mapper/logistics/SysDeptRateMapper.xml

@@ -0,0 +1,102 @@
+<?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.logistics.mapper.SysDeptRateMapper">
+    
+    <resultMap type="SysDeptRate" id="SysDeptRateResult">
+        <result property="rateId"    column="rate_id"    />
+        <result property="deptId"    column="dept_id"    />
+        <result property="companyType"    column="company_type"    />
+        <result property="productType"    column="product_type"    />
+        <result property="intervalBegins"    column="interval_begins"    />
+        <result property="intervalEnds"    column="interval_ends"    />
+        <result property="rate"    column="rate"    />
+        <result property="userId"    column="user_id"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="updateTime"    column="update_time"    />
+        <result property="updateBy"    column="update_by"    />
+    </resultMap>
+
+    <sql id="selectSysDeptRateVo">
+        select rate_id, dept_id, company_type, product_type, interval_begins, interval_ends, rate, user_id, create_time, create_by, update_time, update_by from sys_dept_rate
+    </sql>
+
+    <select id="selectSysDeptRateList" parameterType="SysDeptRate" resultMap="SysDeptRateResult">
+        <include refid="selectSysDeptRateVo"/>
+        <where>  
+            <if test="deptId != null "> and dept_id = #{deptId}</if>
+            <if test="companyType != null  and companyType != ''"> and company_type = #{companyType}</if>
+            <if test="productType != null  and productType != ''"> and product_type = #{productType}</if>
+            <if test="intervalBegins != null "> and interval_begins = #{intervalBegins}</if>
+            <if test="intervalEnds != null "> and interval_ends = #{intervalEnds}</if>
+            <if test="rate != null "> and rate = #{rate}</if>
+            <if test="userId != null "> and user_id = #{userId}</if>
+        </where>
+    </select>
+    
+    <select id="selectSysDeptRateByRateId" parameterType="Long" resultMap="SysDeptRateResult">
+        <include refid="selectSysDeptRateVo"/>
+        where rate_id = #{rateId}
+    </select>
+
+    <insert id="insertSysDeptRate" parameterType="SysDeptRate" useGeneratedKeys="true" keyProperty="rateId">
+        insert into sys_dept_rate
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="deptId != null">dept_id,</if>
+            <if test="companyType != null">company_type,</if>
+            <if test="productType != null">product_type,</if>
+            <if test="intervalBegins != null">interval_begins,</if>
+            <if test="intervalEnds != null">interval_ends,</if>
+            <if test="rate != null">rate,</if>
+            <if test="userId != null">user_id,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="createBy != null">create_by,</if>
+            <if test="updateTime != null">update_time,</if>
+            <if test="updateBy != null">update_by,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="deptId != null">#{deptId},</if>
+            <if test="companyType != null">#{companyType},</if>
+            <if test="productType != null">#{productType},</if>
+            <if test="intervalBegins != null">#{intervalBegins},</if>
+            <if test="intervalEnds != null">#{intervalEnds},</if>
+            <if test="rate != null">#{rate},</if>
+            <if test="userId != null">#{userId},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="createBy != null">#{createBy},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+            <if test="updateBy != null">#{updateBy},</if>
+         </trim>
+    </insert>
+
+    <update id="updateSysDeptRate" parameterType="SysDeptRate">
+        update sys_dept_rate
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="deptId != null">dept_id = #{deptId},</if>
+            <if test="companyType != null">company_type = #{companyType},</if>
+            <if test="productType != null">product_type = #{productType},</if>
+            <if test="intervalBegins != null">interval_begins = #{intervalBegins},</if>
+            <if test="intervalEnds != null">interval_ends = #{intervalEnds},</if>
+            <if test="rate != null">rate = #{rate},</if>
+            <if test="userId != null">user_id = #{userId},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+        </trim>
+        where rate_id = #{rateId}
+    </update>
+
+    <delete id="deleteSysDeptRateByRateId" parameterType="Long">
+        delete from sys_dept_rate where rate_id = #{rateId}
+    </delete>
+
+    <delete id="deleteSysDeptRateByRateIds" parameterType="String">
+        delete from sys_dept_rate where rate_id in 
+        <foreach item="rateId" collection="array" open="(" separator="," close=")">
+            #{rateId}
+        </foreach>
+    </delete>
+</mapper>