23 changed files with 714 additions and 102 deletions
@ -0,0 +1,146 @@ |
|||
package cc.hiver.core.logisticslandingfeerules.controller; |
|||
|
|||
import cc.hiver.core.common.utils.ResultUtil; |
|||
import cc.hiver.core.common.vo.Result; |
|||
import cc.hiver.core.logisticslandingfeerules.entity.LogisticsLandingFeeRules; |
|||
import cc.hiver.core.logisticslandingfeerules.service.LogisticsLandingFeeRulesService; |
|||
import cc.hiver.core.logisticslandingfeerules.vo.LogisticsLandingFeeRulesQueryVo; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import io.swagger.annotations.Api; |
|||
import io.swagger.annotations.ApiOperation; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.apache.commons.lang3.StringUtils; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.transaction.annotation.Transactional; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 站点落地费规则控制器 |
|||
* |
|||
* @author 王富康 |
|||
* @date 2024/8/24 |
|||
*/ |
|||
@Slf4j |
|||
@RestController |
|||
@Api(tags = "站点落地费规则接口") |
|||
@RequestMapping("/hiver/app/logisticsLandingFeeRules/") |
|||
@Transactional |
|||
public class LogisticsLandingFeeRulesController { |
|||
|
|||
@Autowired |
|||
private LogisticsLandingFeeRulesService logisticsLandingFeeRulesService; |
|||
|
|||
/** |
|||
* 新增物流站点落地费规则 |
|||
* |
|||
* @param logisticsLandingFeeRules |
|||
* @return Result |
|||
* @author 王富康 |
|||
* @date 2024/8/24 |
|||
*/ |
|||
@PostMapping(value = "/addLogisticsLandingFeeRules") |
|||
@ApiOperation("新增物流站点落地费规则") |
|||
public Result addLogisticsLandingFeeRules(@RequestBody LogisticsLandingFeeRules logisticsLandingFeeRules) { |
|||
|
|||
final boolean b = logisticsLandingFeeRulesService.saveOrUpdate(logisticsLandingFeeRules); |
|||
if (b) { |
|||
return ResultUtil.success("保存成功!"); |
|||
} else { |
|||
return ResultUtil.error("保存失败!"); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 更新物流站点落地费规则 |
|||
* |
|||
* @param logisticsLandingFeeRules |
|||
* @return Result |
|||
* @author 王富康 |
|||
* @date 2024/8/24 |
|||
*/ |
|||
@PostMapping(value = "/updateLogisticsLandingFeeRules") |
|||
@ApiOperation("更新物流站点落地费规则") |
|||
public Result updateLogisticsLandingFeeRules(@RequestBody LogisticsLandingFeeRules logisticsLandingFeeRules) { |
|||
|
|||
final boolean b = logisticsLandingFeeRulesService.saveOrUpdate(logisticsLandingFeeRules); |
|||
if (b) { |
|||
return ResultUtil.success("保存成功!"); |
|||
} else { |
|||
return ResultUtil.error("保存失败!"); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 删除物流站点落地费规则 |
|||
* |
|||
* @param id |
|||
* @return Result |
|||
* @author 王富康 |
|||
* @date 2024/8/24 |
|||
*/ |
|||
@PostMapping(value = "/deleteLogisticsLandingFeeRules") |
|||
@ApiOperation("删除物流站点落地费规则") |
|||
public Result deleteLogisticsLandingFeeRules(String id) { |
|||
|
|||
final boolean b = logisticsLandingFeeRulesService.removeById(id); |
|||
if (b) { |
|||
return ResultUtil.success("删除成功!"); |
|||
} else { |
|||
return ResultUtil.error("删除失败!"); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 分页查询物流站点落地费规则 |
|||
* |
|||
* @param logisticsRouteQueryVo |
|||
* @return Result<IPage < LogisticsLandingFeeRules>> |
|||
* @author 王富康 |
|||
* @date 2024/8/24 |
|||
*/ |
|||
@RequestMapping(value = "/getLogisticsLandingFeeRulesPageList", method = RequestMethod.POST) |
|||
@ApiOperation(value = "分页查询物流站点落地费规则") |
|||
public Result<IPage<LogisticsLandingFeeRules>> getLogisticsLandingFeeRulesPageList(@RequestBody(required = false) LogisticsLandingFeeRulesQueryVo logisticsRouteQueryVo) { |
|||
final IPage<LogisticsLandingFeeRules> result = logisticsLandingFeeRulesService.getLogisticsLandingFeeRulesPageList(logisticsRouteQueryVo); |
|||
return new ResultUtil<IPage<LogisticsLandingFeeRules>>().setData(result); |
|||
} |
|||
|
|||
/** |
|||
* 根据站点id查询所有站点信息 |
|||
* |
|||
* @param stationId |
|||
* @return Result<List < LogisticsLandingFeeRules>> |
|||
* @author 王富康 |
|||
* @date 2024/8/28 |
|||
*/ |
|||
@RequestMapping(value = "/getLogisticsLandingFeeRulesListByStationId", method = RequestMethod.POST) |
|||
@ApiOperation(value = "根据站点id查询所有落地费规则") |
|||
public Result<List<LogisticsLandingFeeRules>> getLogisticsLandingFeeRulesListByStationId(String stationId) { |
|||
if (StringUtils.isEmpty(stationId)) { |
|||
return ResultUtil.error("站点信息不能为空!"); |
|||
} |
|||
final List<LogisticsLandingFeeRules> result = logisticsLandingFeeRulesService.getLogisticsLandingFeeRulesListByStationId(stationId); |
|||
return new ResultUtil<List<LogisticsLandingFeeRules>>().setData(result); |
|||
} |
|||
|
|||
/** |
|||
* 批量新增物流站点落地费规则 |
|||
* @author 王富康 |
|||
* @date 2024/9/6 |
|||
* @param logisticsLandingFeeRulesList |
|||
* @return Result |
|||
*/ |
|||
@PostMapping(value = "/addLogisticsLandingFeeRulesList") |
|||
@ApiOperation("批量新增物流站点落地费规则") |
|||
public Result addLogisticsLandingFeeRulesList(@RequestBody List<LogisticsLandingFeeRules> logisticsLandingFeeRulesList) { |
|||
|
|||
final boolean b = logisticsLandingFeeRulesService.saveBatch(logisticsLandingFeeRulesList); |
|||
if (b) { |
|||
return ResultUtil.success("保存成功!"); |
|||
} else { |
|||
return ResultUtil.error("保存失败!"); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,41 @@ |
|||
package cc.hiver.core.logisticslandingfeerules.entity; |
|||
|
|||
import cc.hiver.core.base.HiverBaseEntity; |
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
import java.math.BigDecimal; |
|||
|
|||
/** |
|||
* 物流站点落地费规则实体 |
|||
* |
|||
* @author 王富康 |
|||
* @date 2024/8/24 |
|||
*/ |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@Data |
|||
@ApiModel(value = "物流站点落地费规则表") |
|||
@TableName(value = "t_logistics_landing_fee_rules", autoResultMap = true) |
|||
public class LogisticsLandingFeeRules extends HiverBaseEntity { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
@ApiModelProperty(value = "站点id") |
|||
private String stationId; |
|||
|
|||
@ApiModelProperty(value = "站点名称") |
|||
private String stationName; |
|||
|
|||
@ApiModelProperty(value = "起收点") |
|||
private BigDecimal minWeight; |
|||
|
|||
@ApiModelProperty(value = "终收点") |
|||
private BigDecimal maxWeight; |
|||
|
|||
@ApiModelProperty(value = "收费金额") |
|||
private BigDecimal price; |
|||
|
|||
} |
|||
@ -0,0 +1,34 @@ |
|||
package cc.hiver.core.logisticslandingfeerules.mapper; |
|||
|
|||
import cc.hiver.core.logisticslandingfeerules.entity.LogisticsLandingFeeRules; |
|||
import cc.hiver.core.logisticslandingfeerules.vo.LogisticsLandingFeeRulesQueryVo; |
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|||
import org.apache.ibatis.annotations.Param; |
|||
|
|||
import java.util.List; |
|||
|
|||
public interface LogisticsLandingFeeRulesMapper extends BaseMapper<LogisticsLandingFeeRules> { |
|||
|
|||
/** |
|||
* 分页查询物流站点落地费规则 |
|||
* |
|||
* @param page |
|||
* @param logisticsRouteQueryVo |
|||
* @return IPage<LogisticsLandingFeeRules> |
|||
* @author 王富康 |
|||
* @date 2024/8/24 |
|||
*/ |
|||
IPage<LogisticsLandingFeeRules> getLogisticsLandingFeeRulesPageList(Page<LogisticsLandingFeeRules> page, @Param("queryParams") LogisticsLandingFeeRulesQueryVo logisticsRouteQueryVo); |
|||
|
|||
/** |
|||
* 根据站点id查询所有落地费规则 |
|||
* |
|||
* @param stationId |
|||
* @return List<LogisticsLandingFeeRules> |
|||
* @author 王富康 |
|||
* @date 2024/8/28 |
|||
*/ |
|||
List<LogisticsLandingFeeRules> getLogisticsLandingFeeRulesListByStationId(@Param("stationId")String stationId); |
|||
} |
|||
@ -0,0 +1,31 @@ |
|||
package cc.hiver.core.logisticslandingfeerules.service; |
|||
|
|||
import cc.hiver.core.logisticslandingfeerules.entity.LogisticsLandingFeeRules; |
|||
import cc.hiver.core.logisticslandingfeerules.vo.LogisticsLandingFeeRulesQueryVo; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.baomidou.mybatisplus.extension.service.IService; |
|||
|
|||
import java.util.List; |
|||
|
|||
public interface LogisticsLandingFeeRulesService extends IService<LogisticsLandingFeeRules> { |
|||
|
|||
/** |
|||
* 分页查询物流站点落地费规则 |
|||
* |
|||
* @param logisticsRouteQueryVo |
|||
* @return IPage<LogisticsLandingFeeRules> |
|||
* @author 王富康 |
|||
* @date 2024/8/24 |
|||
*/ |
|||
IPage<LogisticsLandingFeeRules> getLogisticsLandingFeeRulesPageList(LogisticsLandingFeeRulesQueryVo logisticsRouteQueryVo); |
|||
|
|||
/** |
|||
* 根据站点id查询所有落地费规则 |
|||
* |
|||
* @param stationId |
|||
* @return List<LogisticsLandingFeeRules> |
|||
* @author 王富康 |
|||
* @date 2024/8/28 |
|||
*/ |
|||
List<LogisticsLandingFeeRules> getLogisticsLandingFeeRulesListByStationId(String stationId); |
|||
} |
|||
@ -0,0 +1,47 @@ |
|||
package cc.hiver.core.logisticslandingfeerules.service.impl; |
|||
|
|||
import cc.hiver.core.logisticslandingfeerules.entity.LogisticsLandingFeeRules; |
|||
import cc.hiver.core.logisticslandingfeerules.mapper.LogisticsLandingFeeRulesMapper; |
|||
import cc.hiver.core.logisticslandingfeerules.service.LogisticsLandingFeeRulesService; |
|||
import cc.hiver.core.logisticslandingfeerules.vo.LogisticsLandingFeeRulesQueryVo; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.util.List; |
|||
|
|||
@Service |
|||
public class LogisticsLandingFeeRulesServiceImpl extends ServiceImpl<LogisticsLandingFeeRulesMapper, LogisticsLandingFeeRules> implements LogisticsLandingFeeRulesService { |
|||
|
|||
@Autowired |
|||
private LogisticsLandingFeeRulesMapper logisticsLandingFeeRulesMapper; |
|||
|
|||
/** |
|||
* 分页查询物流站点落地费规则 |
|||
* |
|||
* @param logisticsRouteQueryVo |
|||
* @return IPage<LogisticsLandingFeeRules> |
|||
* @author 王富康 |
|||
* @date 2024/8/24 |
|||
*/ |
|||
@Override |
|||
public IPage<LogisticsLandingFeeRules> getLogisticsLandingFeeRulesPageList(LogisticsLandingFeeRulesQueryVo logisticsRouteQueryVo) { |
|||
final Page<LogisticsLandingFeeRules> page = new Page<>(logisticsRouteQueryVo.getPageNum(), logisticsRouteQueryVo.getPageSize()); |
|||
return logisticsLandingFeeRulesMapper.getLogisticsLandingFeeRulesPageList(page, logisticsRouteQueryVo); |
|||
} |
|||
|
|||
/** |
|||
* 根据站点id查询所有落地费规则 |
|||
* |
|||
* @param String stationId |
|||
* @return List<LogisticsLandingFeeRules> |
|||
* @author 王富康 |
|||
* @date 2024/8/28 |
|||
*/ |
|||
@Override |
|||
public List<LogisticsLandingFeeRules> getLogisticsLandingFeeRulesListByStationId(String stationId) { |
|||
return logisticsLandingFeeRulesMapper.getLogisticsLandingFeeRulesListByStationId(stationId); |
|||
} |
|||
} |
|||
@ -0,0 +1,24 @@ |
|||
package cc.hiver.core.logisticslandingfeerules.vo; |
|||
|
|||
import cc.hiver.core.base.HiverBasePageQuery; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* 物流站点落地费规则查询参数 |
|||
* @author 王富康 |
|||
* @date 2024/8/24 |
|||
*/ |
|||
@Data |
|||
public class LogisticsLandingFeeRulesQueryVo extends HiverBasePageQuery { |
|||
|
|||
@ApiModelProperty(value = "站点id") |
|||
private String stationId; |
|||
|
|||
@ApiModelProperty(value = "线路id") |
|||
private String circuitId; |
|||
|
|||
@ApiModelProperty(value = "站点名称") |
|||
private String stationName; |
|||
|
|||
} |
|||
@ -0,0 +1,158 @@ |
|||
<?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="cc.hiver.core.logisticslandingfeerules.mapper.LogisticsLandingFeeRulesMapper"> |
|||
<resultMap id="BaseResultMap" type="cc.hiver.core.logisticslandingfeerules.entity.LogisticsLandingFeeRules"> |
|||
<id column="id" jdbcType="VARCHAR" property="id" /> |
|||
<result column="create_by" jdbcType="VARCHAR" property="createBy" /> |
|||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" /> |
|||
<result column="del_flag" jdbcType="INTEGER" property="delFlag" /> |
|||
<result column="update_by" jdbcType="VARCHAR" property="updateBy" /> |
|||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" /> |
|||
<result column="station_id" jdbcType="VARCHAR" property="stationId" /> |
|||
<result column="station_name" jdbcType="VARCHAR" property="stationName" /> |
|||
<result column="min_weight" jdbcType="DECIMAL" property="minWeight" /> |
|||
<result column="max_weight" jdbcType="DECIMAL" property="maxWeight" /> |
|||
<result column="price" jdbcType="DECIMAL" property="price" /> |
|||
</resultMap> |
|||
|
|||
<sql id="Base_Column_List"> |
|||
id, create_by, create_time, del_flag, update_by, update_time, station_id, station_name, min_weight, max_weight, price |
|||
</sql> |
|||
|
|||
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap"> |
|||
select |
|||
<include refid="Base_Column_List" /> |
|||
from t_logistics_landing_fee_rules |
|||
where id = #{id,jdbcType=VARCHAR} |
|||
</select> |
|||
|
|||
<delete id="deleteByPrimaryKey" parameterType="java.lang.String"> |
|||
delete from t_logistics_landing_fee_rules |
|||
where id = #{id,jdbcType=VARCHAR} |
|||
</delete> |
|||
|
|||
<insert id="insert" parameterType="cc.hiver.core.logisticslandingfeerules.entity.LogisticsLandingFeeRules"> |
|||
insert into t_logistics_landing_fee_rules |
|||
(id, create_by, create_time, del_flag, update_by, update_time, station_id, station_name, min_weight, max_weight, price) |
|||
values (#{id,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, |
|||
#{delFlag,jdbcType=INTEGER}, #{updateBy,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, |
|||
#{record.stationId,jdbcType=VARCHAR}, #{record.stationName,jdbcType=VARCHAR}, #{record.minWeight,jdbcType=DECIMAL}, |
|||
#{record.maxWeight,jdbcType=DECIMAL}, #{record.price,jdbcType=DECIMAL}) |
|||
</insert> |
|||
|
|||
<update id="updateByExampleSelective" parameterType="map"> |
|||
update t_logistics_landing_fee_rules |
|||
<set> |
|||
<if test="record.id != null"> |
|||
id = #{record.id,jdbcType=VARCHAR}, |
|||
</if> |
|||
<if test="record.createBy != null"> |
|||
create_by = #{record.createBy,jdbcType=VARCHAR}, |
|||
</if> |
|||
<if test="record.createTime != null"> |
|||
create_time = #{record.createTime,jdbcType=TIMESTAMP}, |
|||
</if> |
|||
<if test="record.delFlag != null"> |
|||
del_flag = #{record.delFlag,jdbcType=INTEGER}, |
|||
</if> |
|||
<if test="record.updateBy != null"> |
|||
update_by = #{record.updateBy,jdbcType=VARCHAR}, |
|||
</if> |
|||
<if test="record.updateTime != null"> |
|||
update_time = #{record.updateTime,jdbcType=TIMESTAMP}, |
|||
</if> |
|||
<if test="record.stationId != null"> |
|||
station_id = #{record.stationId,jdbcType=VARCHAR}, |
|||
</if> |
|||
<if test="record.stationName != null"> |
|||
station_name = #{record.stationName,jdbcType=VARCHAR}, |
|||
</if> |
|||
<if test="record.minWeight != null"> |
|||
min_weight = #{record.minWeight,jdbcType=DECIMAL}, |
|||
</if> |
|||
<if test="record.maxWeight != null"> |
|||
max_weight = #{record.maxWeight,jdbcType=DECIMAL}, |
|||
</if> |
|||
<if test="record.price != null"> |
|||
price = #{record.price,jdbcType=DECIMAL}, |
|||
</if> |
|||
</set> |
|||
</update> |
|||
|
|||
<update id="updateByExample" parameterType="map"> |
|||
update t_logistics_landing_fee_rules |
|||
set id = #{record.id,jdbcType=VARCHAR}, |
|||
create_by = #{record.createBy,jdbcType=VARCHAR}, |
|||
create_time = #{record.createTime,jdbcType=TIMESTAMP}, |
|||
del_flag = #{record.delFlag,jdbcType=INTEGER}, |
|||
update_by = #{record.updateBy,jdbcType=VARCHAR}, |
|||
update_time = #{record.updateTime,jdbcType=TIMESTAMP}, |
|||
station_id = #{record.stationId,jdbcType=VARCHAR}, |
|||
station_name = #{record.stationName,jdbcType=VARCHAR}, |
|||
min_weight = #{record.minWeight,jdbcType=DECIMAL}, |
|||
max_weight = #{record.maxWeight,jdbcType=DECIMAL}, |
|||
price = #{record.price,jdbcType=DECIMAL} |
|||
where id = #{record.id,jdbcType=VARCHAR} |
|||
</update> |
|||
|
|||
<update id="updateByPrimaryKeySelective" parameterType="cc.hiver.core.logisticslandingfeerules.entity.LogisticsLandingFeeRules"> |
|||
update t_logistics_landing_fee_rules |
|||
<set> |
|||
<if test="createBy != null"> |
|||
create_by = #{createBy,jdbcType=VARCHAR}, |
|||
</if> |
|||
<if test="createTime != null"> |
|||
create_time = #{createTime,jdbcType=TIMESTAMP}, |
|||
</if> |
|||
<if test="delFlag != null"> |
|||
del_flag = #{delFlag,jdbcType=INTEGER}, |
|||
</if> |
|||
<if test="updateBy != null"> |
|||
update_by = #{updateBy,jdbcType=VARCHAR}, |
|||
</if> |
|||
<if test="updateTime != null"> |
|||
update_time = #{updateTime,jdbcType=TIMESTAMP}, |
|||
</if> |
|||
<if test="stationId != null"> |
|||
station_id = #{stationId,jdbcType=VARCHAR}, |
|||
</if> |
|||
<if test="stationName != null"> |
|||
station_name = #{stationName,jdbcType=VARCHAR}, |
|||
</if> |
|||
<if test="minWeight != null"> |
|||
min_weight = #{minWeight,jdbcType=DECIMAL}, |
|||
</if> |
|||
<if test="maxWeight != null"> |
|||
max_weight = #{maxWeight,jdbcType=DECIMAL}, |
|||
</if> |
|||
<if test="price != null"> |
|||
price = #{price,jdbcType=DECIMAL}, |
|||
</if> |
|||
</set> |
|||
where id = #{id,jdbcType=VARCHAR} |
|||
</update> |
|||
|
|||
<update id="updateByPrimaryKey" parameterType="cc.hiver.core.logisticslandingfeerules.entity.LogisticsLandingFeeRules"> |
|||
update t_logistics_landing_fee_rules |
|||
set create_by = #{createBy,jdbcType=VARCHAR}, |
|||
create_time = #{createTime,jdbcType=TIMESTAMP}, |
|||
del_flag = #{delFlag,jdbcType=INTEGER}, |
|||
update_by = #{updateBy,jdbcType=VARCHAR}, |
|||
update_time = #{updateTime,jdbcType=TIMESTAMP}, |
|||
station_id = #{stationId,jdbcType=VARCHAR}, |
|||
station_name = #{stationName,jdbcType=VARCHAR}, |
|||
min_weight = #{minWeight,jdbcType=DECIMAL}, |
|||
max_weight = #{maxWeight,jdbcType=DECIMAL}, |
|||
price = #{price,jdbcType=DECIMAL} |
|||
where id = #{id,jdbcType=VARCHAR} |
|||
</update> |
|||
|
|||
<select id="getLogisticsLandingFeeRulesListByStationId" resultMap="BaseResultMap"> |
|||
select |
|||
<include refid="Base_Column_List" /> |
|||
from t_logistics_landing_fee_rules t |
|||
where station_id = #{stationId} |
|||
ORDER BY |
|||
t.create_time desc |
|||
</select> |
|||
</mapper> |
|||
Loading…
Reference in new issue