23 changed files with 718 additions and 25 deletions
@ -0,0 +1,43 @@ |
|||
package cc.hiver.core.logisticsorder.vo; |
|||
|
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
import java.math.BigDecimal; |
|||
|
|||
/** |
|||
* 物流统计Vo |
|||
* @author 王富康 |
|||
* @date 2024/9/7 |
|||
*/ |
|||
@Data |
|||
public class StatisticsVo { |
|||
|
|||
// 客户总运费
|
|||
@ApiModelProperty(value = "客户总运费") |
|||
private BigDecimal totalFreight; |
|||
|
|||
// 运单数
|
|||
@ApiModelProperty(value = "运单数") |
|||
private Integer totalOrder; |
|||
|
|||
// 客户数
|
|||
@ApiModelProperty(value = "客户数") |
|||
private Integer totalCustomer; |
|||
|
|||
// 运输费
|
|||
@ApiModelProperty(value = "运输费") |
|||
private BigDecimal totalTransportationFee; |
|||
|
|||
// 装车费
|
|||
@ApiModelProperty(value = "装车费") |
|||
private BigDecimal totalLoadingFee; |
|||
|
|||
// 小费
|
|||
@ApiModelProperty(value = "小费") |
|||
private BigDecimal totalTip; |
|||
|
|||
// 保费
|
|||
@ApiModelProperty(value = "保费") |
|||
private BigDecimal totalInsuranceFee; |
|||
} |
|||
@ -0,0 +1,146 @@ |
|||
package cc.hiver.mall.customercategory.controller; |
|||
|
|||
import cc.hiver.core.common.utils.ResultUtil; |
|||
import cc.hiver.core.common.vo.Result; |
|||
import cc.hiver.mall.customercategory.entity.CustomerCategory; |
|||
import cc.hiver.mall.customercategory.service.CustomerCategoryService; |
|||
import cc.hiver.mall.customercategory.vo.CustomerCategoryQueryVo; |
|||
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/customerCategory/") |
|||
@Transactional |
|||
public class CustomerCategoryController { |
|||
|
|||
@Autowired |
|||
private CustomerCategoryService customerCategoryService; |
|||
|
|||
/** |
|||
* 新增物流客户分类 |
|||
* |
|||
* @param customerCategory |
|||
* @return Result |
|||
* @author 王富康 |
|||
* @date 2024/8/24 |
|||
*/ |
|||
@PostMapping(value = "/addCustomerCategory") |
|||
@ApiOperation("新增物流客户分类") |
|||
public Result addCustomerCategory(@RequestBody CustomerCategory customerCategory) { |
|||
|
|||
final boolean b = customerCategoryService.saveOrUpdate(customerCategory); |
|||
if (b) { |
|||
return ResultUtil.success("保存成功!"); |
|||
} else { |
|||
return ResultUtil.error("保存失败!"); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 更新物流客户分类 |
|||
* |
|||
* @param customerCategory |
|||
* @return Result |
|||
* @author 王富康 |
|||
* @date 2024/8/24 |
|||
*/ |
|||
@PostMapping(value = "/updateCustomerCategory") |
|||
@ApiOperation("更新物流客户分类") |
|||
public Result updateCustomerCategory(@RequestBody CustomerCategory customerCategory) { |
|||
|
|||
final boolean b = customerCategoryService.saveOrUpdate(customerCategory); |
|||
if (b) { |
|||
return ResultUtil.success("保存成功!"); |
|||
} else { |
|||
return ResultUtil.error("保存失败!"); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 删除物流客户分类 |
|||
* |
|||
* @param id |
|||
* @return Result |
|||
* @author 王富康 |
|||
* @date 2024/8/24 |
|||
*/ |
|||
@PostMapping(value = "/deleteCustomerCategory") |
|||
@ApiOperation("删除物流客户分类") |
|||
public Result deleteCustomerCategory(String id) { |
|||
|
|||
final boolean b = customerCategoryService.removeById(id); |
|||
if (b) { |
|||
return ResultUtil.success("删除成功!"); |
|||
} else { |
|||
return ResultUtil.error("删除失败!"); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 分页查询物流客户分类 |
|||
* |
|||
* @param logisticsRouteQueryVo |
|||
* @return Result<IPage < CustomerCategory>> |
|||
* @author 王富康 |
|||
* @date 2024/8/24 |
|||
*/ |
|||
@RequestMapping(value = "/getCustomerCategoryPageList", method = RequestMethod.POST) |
|||
@ApiOperation(value = "分页查询物流客户分类") |
|||
public Result<IPage<CustomerCategory>> getCustomerCategoryPageList(@RequestBody(required = false) CustomerCategoryQueryVo logisticsRouteQueryVo) { |
|||
final IPage<CustomerCategory> result = customerCategoryService.getCustomerCategoryPageList(logisticsRouteQueryVo); |
|||
return new ResultUtil<IPage<CustomerCategory>>().setData(result); |
|||
} |
|||
|
|||
/** |
|||
* 根据店铺id查询所有客户分类 |
|||
* |
|||
* @param shopId |
|||
* @return Result<List < CustomerCategory>> |
|||
* @author 王富康 |
|||
* @date 2024/8/28 |
|||
*/ |
|||
@RequestMapping(value = "/getCustomerCategoryListByShopId", method = RequestMethod.POST) |
|||
@ApiOperation(value = "根据店铺id查询所有客户分类") |
|||
public Result<List<CustomerCategory>> getCustomerCategoryListByShopId(String shopId) { |
|||
if (StringUtils.isEmpty(shopId)) { |
|||
return ResultUtil.error("店铺信息不能为空!"); |
|||
} |
|||
final List<CustomerCategory> result = customerCategoryService.getCustomerCategoryListByShopId(shopId); |
|||
return new ResultUtil<List<CustomerCategory>>().setData(result); |
|||
} |
|||
|
|||
/** |
|||
* 批量新增物流客户分类 |
|||
* @author 王富康 |
|||
* @date 2024/9/6 |
|||
* @param customerCategoryList |
|||
* @return Result |
|||
*/ |
|||
@PostMapping(value = "/addCustomerCategoryList") |
|||
@ApiOperation("批量新增物流客户分类") |
|||
public Result addCustomerCategoryList(@RequestBody List<CustomerCategory> customerCategoryList) { |
|||
|
|||
final boolean b = customerCategoryService.saveBatch(customerCategoryList); |
|||
if (b) { |
|||
return ResultUtil.success("保存成功!"); |
|||
} else { |
|||
return ResultUtil.error("保存失败!"); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,29 @@ |
|||
package cc.hiver.mall.customercategory.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; |
|||
|
|||
/** |
|||
* 物流客户分类实体 |
|||
* |
|||
* @author 王富康 |
|||
* @date 2024/8/24 |
|||
*/ |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@Data |
|||
@ApiModel(value = "物流客户分类表") |
|||
@TableName(value = "t_customer_category", autoResultMap = true) |
|||
public class CustomerCategory extends HiverBaseEntity { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
@ApiModelProperty(value = "店铺id") |
|||
private String shopId; |
|||
|
|||
@ApiModelProperty(value = "分类名称") |
|||
private String categoryName; |
|||
|
|||
} |
|||
@ -0,0 +1,34 @@ |
|||
package cc.hiver.mall.customercategory.mapper; |
|||
|
|||
import cc.hiver.mall.customercategory.entity.CustomerCategory; |
|||
import cc.hiver.mall.customercategory.vo.CustomerCategoryQueryVo; |
|||
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 CustomerCategoryMapper extends BaseMapper<CustomerCategory> { |
|||
|
|||
/** |
|||
* 分页查询物流客户分类 |
|||
* |
|||
* @param page |
|||
* @param logisticsRouteQueryVo |
|||
* @return IPage<CustomerCategory> |
|||
* @author 王富康 |
|||
* @date 2024/8/24 |
|||
*/ |
|||
IPage<CustomerCategory> getCustomerCategoryPageList(Page<CustomerCategory> page, @Param("queryParams") CustomerCategoryQueryVo logisticsRouteQueryVo); |
|||
|
|||
/** |
|||
* 根据店铺id查询所有客户分类 |
|||
* |
|||
* @param shopId |
|||
* @return List<CustomerCategory> |
|||
* @author 王富康 |
|||
* @date 2024/8/28 |
|||
*/ |
|||
List<CustomerCategory> getCustomerCategoryListByShopId(@Param("shopId")String shopId); |
|||
} |
|||
@ -0,0 +1,31 @@ |
|||
package cc.hiver.mall.customercategory.service; |
|||
|
|||
import cc.hiver.mall.customercategory.entity.CustomerCategory; |
|||
import cc.hiver.mall.customercategory.vo.CustomerCategoryQueryVo; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.baomidou.mybatisplus.extension.service.IService; |
|||
|
|||
import java.util.List; |
|||
|
|||
public interface CustomerCategoryService extends IService<CustomerCategory> { |
|||
|
|||
/** |
|||
* 分页查询物流客户分类 |
|||
* |
|||
* @param customerCategoryQueryVo |
|||
* @return IPage<CustomerCategory> |
|||
* @author 王富康 |
|||
* @date 2024/8/24 |
|||
*/ |
|||
IPage<CustomerCategory> getCustomerCategoryPageList(CustomerCategoryQueryVo customerCategoryQueryVo); |
|||
|
|||
/** |
|||
* 根据店铺id查询所有客户分类 |
|||
* |
|||
* @param shopId |
|||
* @return List<CustomerCategory> |
|||
* @author 王富康 |
|||
* @date 2024/8/28 |
|||
*/ |
|||
List<CustomerCategory> getCustomerCategoryListByShopId(String shopId); |
|||
} |
|||
@ -0,0 +1,47 @@ |
|||
package cc.hiver.mall.customercategory.service.impl; |
|||
|
|||
import cc.hiver.mall.customercategory.entity.CustomerCategory; |
|||
import cc.hiver.mall.customercategory.mapper.CustomerCategoryMapper; |
|||
import cc.hiver.mall.customercategory.service.CustomerCategoryService; |
|||
import cc.hiver.mall.customercategory.vo.CustomerCategoryQueryVo; |
|||
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 CustomerCategoryServiceImpl extends ServiceImpl<CustomerCategoryMapper, CustomerCategory> implements CustomerCategoryService { |
|||
|
|||
@Autowired |
|||
private CustomerCategoryMapper customerCategoryMapper; |
|||
|
|||
/** |
|||
* 分页查询物流客户分类 |
|||
* |
|||
* @param logisticsRouteQueryVo |
|||
* @return IPage<CustomerCategory> |
|||
* @author 王富康 |
|||
* @date 2024/8/24 |
|||
*/ |
|||
@Override |
|||
public IPage<CustomerCategory> getCustomerCategoryPageList(CustomerCategoryQueryVo logisticsRouteQueryVo) { |
|||
final Page<CustomerCategory> page = new Page<>(logisticsRouteQueryVo.getPageNum(), logisticsRouteQueryVo.getPageSize()); |
|||
return customerCategoryMapper.getCustomerCategoryPageList(page, logisticsRouteQueryVo); |
|||
} |
|||
|
|||
/** |
|||
* 根据店铺id查询所有客户分类 |
|||
* |
|||
* @param shopId |
|||
* @return List<CustomerCategory> |
|||
* @author 王富康 |
|||
* @date 2024/8/28 |
|||
*/ |
|||
@Override |
|||
public List<CustomerCategory> getCustomerCategoryListByShopId(String shopId) { |
|||
return customerCategoryMapper.getCustomerCategoryListByShopId(shopId); |
|||
} |
|||
} |
|||
@ -0,0 +1,22 @@ |
|||
package cc.hiver.mall.customercategory.vo; |
|||
|
|||
import cc.hiver.core.base.HiverBasePageQuery; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* 物流客户分类查询参数 |
|||
* @author 王富康 |
|||
* @date 2024/8/24 |
|||
*/ |
|||
@Data |
|||
public class CustomerCategoryQueryVo extends HiverBasePageQuery { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
@ApiModelProperty(value = "店铺id") |
|||
private String shopId; |
|||
|
|||
@ApiModelProperty(value = "分类名称") |
|||
private String categoryName; |
|||
|
|||
} |
|||
@ -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.mall.customercategory.mapper.CustomerCategoryMapper"> |
|||
<resultMap id="BaseResultMap" type="cc.hiver.mall.customercategory.entity.CustomerCategory"> |
|||
<id column="id" jdbcType="VARCHAR" property="id" /> |
|||
<result column="create_by" jdbcType="VARCHAR" property="createBy" /> |
|||
<result column="create_by_name" jdbcType="VARCHAR" property="createByName" /> |
|||
<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="shop_id" jdbcType="VARCHAR" property="shopId" /> |
|||
<result column="category_name" jdbcType="VARCHAR" property="categoryName" /> |
|||
</resultMap> |
|||
|
|||
<sql id="Base_Column_List"> |
|||
id, create_by,create_by_name, create_time, del_flag, update_by, update_time, shop_id, category_name |
|||
</sql> |
|||
|
|||
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap"> |
|||
select |
|||
<include refid="Base_Column_List" /> |
|||
from t_customer_category |
|||
where id = #{id,jdbcType=VARCHAR} |
|||
</select> |
|||
|
|||
<delete id="deleteByPrimaryKey" parameterType="java.lang.String"> |
|||
delete from t_customer_category |
|||
where id = #{id,jdbcType=VARCHAR} |
|||
</delete> |
|||
|
|||
<insert id="insert" parameterType="cc.hiver.mall.customercategory.entity.CustomerCategory"> |
|||
insert into t_customer_category |
|||
(id, create_by,create_by_name, create_time, del_flag, update_by, update_time, shop_id, category_name) |
|||
values (#{id,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR}, #{createByName,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, |
|||
#{delFlag,jdbcType=INTEGER}, #{updateBy,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, |
|||
#{shopId,jdbcType=VARCHAR}, #{categoryName,jdbcType=VARCHAR}) |
|||
</insert> |
|||
|
|||
<update id="updateByExampleSelective" parameterType="map"> |
|||
update t_customer_category |
|||
<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.createByName != null"> |
|||
create_by_name = #{record.createByName,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.shopId != null"> |
|||
shop_id = #{record.shopId,jdbcType=VARCHAR}, |
|||
</if> |
|||
<if test="record.categoryName != null"> |
|||
category_name = #{record.categoryName,jdbcType=VARCHAR}, |
|||
</if> |
|||
</set> |
|||
</update> |
|||
|
|||
<update id="updateByExample" parameterType="map"> |
|||
update t_customer_category |
|||
set id = #{record.id,jdbcType=VARCHAR}, |
|||
create_by = #{record.createBy,jdbcType=VARCHAR}, |
|||
create_by_name = #{record.createByName,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}, |
|||
shop_id = #{record.shopId,jdbcType=VARCHAR}, |
|||
category_name = #{record.categoryName,jdbcType=VARCHAR} |
|||
</update> |
|||
|
|||
<update id="updateByPrimaryKeySelective" parameterType="cc.hiver.mall.customercategory.entity.CustomerCategory"> |
|||
update t_customer_category |
|||
<set> |
|||
<if test="createBy != null"> |
|||
create_by = #{createBy,jdbcType=VARCHAR}, |
|||
</if> |
|||
<if test="createByName != null"> |
|||
create_by_name = #{createByName,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="shopId != null"> |
|||
shop_id = #{shopId,jdbcType=VARCHAR}, |
|||
</if> |
|||
<if test="categoryName != null"> |
|||
category_name = #{categoryName,jdbcType=VARCHAR}, |
|||
</if> |
|||
</set> |
|||
where id = #{id,jdbcType=VARCHAR} |
|||
</update> |
|||
|
|||
<update id="updateByPrimaryKey" parameterType="cc.hiver.mall.customercategory.entity.CustomerCategory"> |
|||
update t_customer_category |
|||
set create_by = #{createBy,jdbcType=VARCHAR}, |
|||
create_by_name = #{createByName,jdbcType=VARCHAR}, |
|||
create_time = #{createTime,jdbcType=TIMESTAMP}, |
|||
del_flag = #{delFlag,jdbcType=INTEGER}, |
|||
update_by = #{updateBy,jdbcType=VARCHAR}, |
|||
update_time = #{updateTime,jdbcType=TIMESTAMP}, |
|||
shop_id = #{shopId,jdbcType=VARCHAR}, |
|||
category_name = #{categoryName,jdbcType=VARCHAR} |
|||
where id = #{id,jdbcType=VARCHAR} |
|||
</update> |
|||
|
|||
<!--管理商品分页列表--> |
|||
<select id="getCustomerCategoryPageList" resultMap="BaseResultMap"> |
|||
select |
|||
t.id, t.create_by,t.create_time,t.del_flag,t.update_by,t.update_time,t.circuit_id,t.station_name,t.freight_rules,t.landing_fee_rules,t.delivery_fee_rules |
|||
from t_customer_category t |
|||
<where> |
|||
<!--反馈内容--> |
|||
<if test='queryParams.circuitId!=null and queryParams.circuitId.trim() neq ""'> |
|||
AND t.circuit_id = #{queryParams.circuitId} |
|||
</if> |
|||
<if test='queryParams.stationName!=null and queryParams.stationName.trim() neq ""'> |
|||
AND (t.station_name LIKE CONCAT( '%', #{queryParams.stationName}, '%' ) |
|||
OR to_pinyin ( t.station_name ) LIKE CONCAT( '%', to_pinyin ( #{queryParams.stationName} ), '%' ) |
|||
OR to_initial_pinyin ( t.station_name ) LIKE CONCAT( '%', #{queryParams.stationName}, '%' )) |
|||
</if> |
|||
</where> |
|||
ORDER BY |
|||
t.create_time desc |
|||
</select> |
|||
|
|||
<select id="getCustomerCategoryListByShopId" resultMap="BaseResultMap" > |
|||
select |
|||
t.id, t.create_by,t.create_by_name,t.create_time,t.del_flag,t.update_by,t.update_time,t.shop_id,t.category_name |
|||
from t_customer_category t |
|||
where shop_id = #{shopId} |
|||
ORDER BY |
|||
t.create_time desc |
|||
</select> |
|||
</mapper> |
|||
Loading…
Reference in new issue