Browse Source

物流统计

客户分类
dev
wangfukang 2 years ago
parent
commit
0c04c95d1f
  1. 16
      hiver-admin/test-output/test-report.html
  2. 4
      hiver-core/src/main/java/cc/hiver/core/logisticsentruckinglog/mapper/LogisticsEntruckingLogMapper.java
  3. 4
      hiver-core/src/main/java/cc/hiver/core/logisticsentruckinglog/service/LogisticsEntruckingLogService.java
  4. 7
      hiver-core/src/main/java/cc/hiver/core/logisticsentruckinglog/service/impl/LogisticsEntruckingLogServiceImpl.java
  5. 12
      hiver-core/src/main/java/cc/hiver/core/logisticsorder/controller/LogisticsOrderController.java
  6. 5
      hiver-core/src/main/java/cc/hiver/core/logisticsorder/mapper/LogisticsOrderMapper.java
  7. 10
      hiver-core/src/main/java/cc/hiver/core/logisticsorder/service/LogisticsOrderService.java
  8. 30
      hiver-core/src/main/java/cc/hiver/core/logisticsorder/service/impl/LogisticsOrderServiceImpl.java
  9. 43
      hiver-core/src/main/java/cc/hiver/core/logisticsorder/vo/StatisticsVo.java
  10. 16
      hiver-core/src/main/resources/mapper/LogisticsEntruckingLogMapper.xml
  11. 38
      hiver-core/src/main/resources/mapper/LogisticsOrderMapper.xml
  12. 146
      hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/customercategory/controller/CustomerCategoryController.java
  13. 29
      hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/customercategory/entity/CustomerCategory.java
  14. 34
      hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/customercategory/mapper/CustomerCategoryMapper.java
  15. 31
      hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/customercategory/service/CustomerCategoryService.java
  16. 47
      hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/customercategory/service/impl/CustomerCategoryServiceImpl.java
  17. 22
      hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/customercategory/vo/CustomerCategoryQueryVo.java
  18. 8
      hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/entity/Customer.java
  19. 3
      hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/entity/Product.java
  20. 5
      hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/serviceimpl/mybatis/ProductServiceImpl.java
  21. 158
      hiver-modules/hiver-mall/src/main/resources/mapper/CustomerCategoryMapper.xml
  22. 42
      hiver-modules/hiver-mall/src/main/resources/mapper/CustomerMapper.xml
  23. 33
      hiver-modules/hiver-mall/src/main/resources/mapper/ProductMapper.xml

16
hiver-admin/test-output/test-report.html

@ -35,7 +35,7 @@
<a href="#"><span class="badge badge-primary">Hiver</span></a> <a href="#"><span class="badge badge-primary">Hiver</span></a>
</li> </li>
<li class="m-r-10"> <li class="m-r-10">
<a href="#"><span class="badge badge-primary">九月 06, 2024 15:28:59</span></a> <a href="#"><span class="badge badge-primary">九月 07, 2024 16:05:02</span></a>
</li> </li>
</ul> </ul>
</div> </div>
@ -84,7 +84,7 @@
<div class="test-detail"> <div class="test-detail">
<span class="meta text-white badge badge-sm"></span> <span class="meta text-white badge badge-sm"></span>
<p class="name">passTest</p> <p class="name">passTest</p>
<p class="text-sm"><span>15:29:00 下午</span> / <span>0.026 secs</span></p> <p class="text-sm"><span>16:05:02 下午</span> / <span>0.017 secs</span></p>
</div> </div>
<div class="test-contents d-none"> <div class="test-contents d-none">
<div class="detail-head"> <div class="detail-head">
@ -92,9 +92,9 @@
<div class="info"> <div class="info">
<div class='float-right'><span class='badge badge-default'>#test-id=1</span></div> <div class='float-right'><span class='badge badge-default'>#test-id=1</span></div>
<h5 class="test-status text-pass">passTest</h5> <h5 class="test-status text-pass">passTest</h5>
<span class='badge badge-success'>09.06.2024 15:29:00</span> <span class='badge badge-success'>09.07.2024 16:05:02</span>
<span class='badge badge-danger'>09.06.2024 15:29:00</span> <span class='badge badge-danger'>09.07.2024 16:05:02</span>
<span class='badge badge-default'>0.026 secs</span> <span class='badge badge-default'>0.017 secs</span>
</div> </div>
<div class="m-t-10 m-l-5"></div> <div class="m-t-10 m-l-5"></div>
</div> </div>
@ -104,7 +104,7 @@
<tbody> <tbody>
<tr class="event-row"> <tr class="event-row">
<td><span class="badge log pass-bg">Pass</span></td> <td><span class="badge log pass-bg">Pass</span></td>
<td>15:29:00</td> <td>16:05:02</td>
<td> <td>
Test passed Test passed
</td> </td>
@ -128,13 +128,13 @@
<div class="col-md-3"> <div class="col-md-3">
<div class="card"><div class="card-body"> <div class="card"><div class="card-body">
<p class="m-b-0">Started</p> <p class="m-b-0">Started</p>
<h3>九月 06, 2024 15:28:59</h3> <h3>九月 07, 2024 16:05:02</h3>
</div></div> </div></div>
</div> </div>
<div class="col-md-3"> <div class="col-md-3">
<div class="card"><div class="card-body"> <div class="card"><div class="card-body">
<p class="m-b-0">Ended</p> <p class="m-b-0">Ended</p>
<h3>九月 06, 2024 15:29:00</h3> <h3>九月 07, 2024 16:05:02</h3>
</div></div> </div></div>
</div> </div>
<div class="col-md-3"> <div class="col-md-3">

4
hiver-core/src/main/java/cc/hiver/core/logisticsentruckinglog/mapper/LogisticsEntruckingLogMapper.java

@ -3,6 +3,8 @@ package cc.hiver.core.logisticsentruckinglog.mapper;
import cc.hiver.core.logisticsentruckinglog.entity.LogisticsEntruckingLog; import cc.hiver.core.logisticsentruckinglog.entity.LogisticsEntruckingLog;
import cc.hiver.core.logisticsentruckinglog.vo.LogisticsEntruckingLogDatePageVo; import cc.hiver.core.logisticsentruckinglog.vo.LogisticsEntruckingLogDatePageVo;
import cc.hiver.core.logisticsentruckinglog.vo.LogisticsEntruckingLogQueryVo; import cc.hiver.core.logisticsentruckinglog.vo.LogisticsEntruckingLogQueryVo;
import cc.hiver.core.logisticsorder.vo.LogisticsOrderQueryVo;
import cc.hiver.core.logisticsorder.vo.StatisticsVo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@ -27,4 +29,6 @@ public interface LogisticsEntruckingLogMapper extends BaseMapper<LogisticsEntruc
void deleteByCarNumberAndCompanyId(@Param("logisticsEntruckingLogs")List<LogisticsEntruckingLog> logisticsEntruckingLogs,@Param("nowDate") String nowDate,@Param("afterDay") String afterDay); void deleteByCarNumberAndCompanyId(@Param("logisticsEntruckingLogs")List<LogisticsEntruckingLog> logisticsEntruckingLogs,@Param("nowDate") String nowDate,@Param("afterDay") String afterDay);
IPage<LogisticsEntruckingLogDatePageVo> getDateLogisticsEntruckingLogPageList(Page<LogisticsEntruckingLogDatePageVo> page,@Param("queryParams") LogisticsEntruckingLogQueryVo logisticsEntruckingLogQueryVo); IPage<LogisticsEntruckingLogDatePageVo> getDateLogisticsEntruckingLogPageList(Page<LogisticsEntruckingLogDatePageVo> page,@Param("queryParams") LogisticsEntruckingLogQueryVo logisticsEntruckingLogQueryVo);
StatisticsVo getCarStatistics(@Param("logisticsOrderQueryVo") LogisticsOrderQueryVo logisticsOrderQueryVo);
} }

4
hiver-core/src/main/java/cc/hiver/core/logisticsentruckinglog/service/LogisticsEntruckingLogService.java

@ -3,6 +3,8 @@ package cc.hiver.core.logisticsentruckinglog.service;
import cc.hiver.core.logisticsentruckinglog.entity.LogisticsEntruckingLog; import cc.hiver.core.logisticsentruckinglog.entity.LogisticsEntruckingLog;
import cc.hiver.core.logisticsentruckinglog.vo.LogisticsEntruckingLogDatePageVo; import cc.hiver.core.logisticsentruckinglog.vo.LogisticsEntruckingLogDatePageVo;
import cc.hiver.core.logisticsentruckinglog.vo.LogisticsEntruckingLogQueryVo; import cc.hiver.core.logisticsentruckinglog.vo.LogisticsEntruckingLogQueryVo;
import cc.hiver.core.logisticsorder.vo.LogisticsOrderQueryVo;
import cc.hiver.core.logisticsorder.vo.StatisticsVo;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
@ -23,4 +25,6 @@ public interface LogisticsEntruckingLogService extends IService<LogisticsEntruck
void deleteByCarNumberAndCompanyId(List<LogisticsEntruckingLog> logisticsEntruckingLogs); void deleteByCarNumberAndCompanyId(List<LogisticsEntruckingLog> logisticsEntruckingLogs);
IPage<LogisticsEntruckingLogDatePageVo> getDateLogisticsEntruckingLogPageList(LogisticsEntruckingLogQueryVo logisticsEntruckingLogQueryVo); IPage<LogisticsEntruckingLogDatePageVo> getDateLogisticsEntruckingLogPageList(LogisticsEntruckingLogQueryVo logisticsEntruckingLogQueryVo);
StatisticsVo getCarStatistics(LogisticsOrderQueryVo logisticsOrderQueryVo);
} }

7
hiver-core/src/main/java/cc/hiver/core/logisticsentruckinglog/service/impl/LogisticsEntruckingLogServiceImpl.java

@ -5,6 +5,8 @@ import cc.hiver.core.logisticsentruckinglog.mapper.LogisticsEntruckingLogMapper;
import cc.hiver.core.logisticsentruckinglog.service.LogisticsEntruckingLogService; import cc.hiver.core.logisticsentruckinglog.service.LogisticsEntruckingLogService;
import cc.hiver.core.logisticsentruckinglog.vo.LogisticsEntruckingLogDatePageVo; import cc.hiver.core.logisticsentruckinglog.vo.LogisticsEntruckingLogDatePageVo;
import cc.hiver.core.logisticsentruckinglog.vo.LogisticsEntruckingLogQueryVo; import cc.hiver.core.logisticsentruckinglog.vo.LogisticsEntruckingLogQueryVo;
import cc.hiver.core.logisticsorder.vo.LogisticsOrderQueryVo;
import cc.hiver.core.logisticsorder.vo.StatisticsVo;
import cc.hiver.core.utils.DateUtil; import cc.hiver.core.utils.DateUtil;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@ -79,4 +81,9 @@ public class LogisticsEntruckingLogServiceImpl extends ServiceImpl<LogisticsEntr
} }
return dateLogisticsEntruckingLogPageList; return dateLogisticsEntruckingLogPageList;
} }
@Override
public StatisticsVo getCarStatistics(LogisticsOrderQueryVo logisticsOrderQueryVo) {
return logisticsEntruckingLogMapper.getCarStatistics(logisticsOrderQueryVo);
}
} }

12
hiver-core/src/main/java/cc/hiver/core/logisticsorder/controller/LogisticsOrderController.java

@ -11,6 +11,7 @@ import cc.hiver.core.logisticsorder.entity.LogisticsOrderChangeLog;
import cc.hiver.core.logisticsorder.service.LogisticsOrderService; import cc.hiver.core.logisticsorder.service.LogisticsOrderService;
import cc.hiver.core.logisticsorder.vo.LogisticsOrderChangeLogVo; import cc.hiver.core.logisticsorder.vo.LogisticsOrderChangeLogVo;
import cc.hiver.core.logisticsorder.vo.LogisticsOrderQueryVo; import cc.hiver.core.logisticsorder.vo.LogisticsOrderQueryVo;
import cc.hiver.core.logisticsorder.vo.StatisticsVo;
import cc.hiver.core.utils.DateUtil; import cc.hiver.core.utils.DateUtil;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.google.gson.Gson; import com.google.gson.Gson;
@ -177,4 +178,15 @@ public class LogisticsOrderController {
public Result<LogisticsOrder> getLogisticsOrderDetail(String orderId) { public Result<LogisticsOrder> getLogisticsOrderDetail(String orderId) {
return new ResultUtil<LogisticsOrder>().setData(logisticsOrderService.getById(orderId)); return new ResultUtil<LogisticsOrder>().setData(logisticsOrderService.getById(orderId));
} }
// 数据统计(可按照线路、物流公司、到达站搜索):客户总运费、运单数、客户数、运输费、装车费、小费、保费
@RequestMapping(value = "/getLogisticsOrderStatistics", method = RequestMethod.POST)
@ApiOperation(value = "物流订单数据统计")
public Result getLogisticsOrderStatistics(@RequestBody(required = false) LogisticsOrderQueryVo logisticsOrderQueryVo) {
try{
return new ResultUtil<StatisticsVo>().setData(logisticsOrderService.getLogisticsOrderStatistics(logisticsOrderQueryVo));
}catch (Exception e){
return ResultUtil.error("查询物流统计失败!");
}
}
} }

5
hiver-core/src/main/java/cc/hiver/core/logisticsorder/mapper/LogisticsOrderMapper.java

@ -3,6 +3,7 @@ package cc.hiver.core.logisticsorder.mapper;
import cc.hiver.core.logisticsorder.entity.LogisticsOrder; import cc.hiver.core.logisticsorder.entity.LogisticsOrder;
import cc.hiver.core.logisticsorder.entity.LogisticsOrderChangeLog; import cc.hiver.core.logisticsorder.entity.LogisticsOrderChangeLog;
import cc.hiver.core.logisticsorder.vo.LogisticsOrderQueryVo; import cc.hiver.core.logisticsorder.vo.LogisticsOrderQueryVo;
import cc.hiver.core.logisticsorder.vo.StatisticsVo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@ -38,4 +39,8 @@ public interface LogisticsOrderMapper extends BaseMapper<LogisticsOrder> {
* @return int * @return int
*/ */
List<LogisticsOrderChangeLog> getLogisticsOrderChangeLog(@Param("orderId") String orderId); List<LogisticsOrderChangeLog> getLogisticsOrderChangeLog(@Param("orderId") String orderId);
StatisticsVo getLogisticsOrderStatistics(@Param("logisticsOrderQueryVo") LogisticsOrderQueryVo logisticsOrderQueryVo);
int getCustomerCount(@Param("logisticsOrderQueryVo") LogisticsOrderQueryVo logisticsOrderQueryVo);
} }

10
hiver-core/src/main/java/cc/hiver/core/logisticsorder/service/LogisticsOrderService.java

@ -4,6 +4,7 @@ import cc.hiver.core.logisticsorder.entity.LogisticsOrder;
import cc.hiver.core.logisticsorder.entity.LogisticsOrderChangeLog; import cc.hiver.core.logisticsorder.entity.LogisticsOrderChangeLog;
import cc.hiver.core.logisticsorder.vo.LogisticsOrderChangeLogVo; import cc.hiver.core.logisticsorder.vo.LogisticsOrderChangeLogVo;
import cc.hiver.core.logisticsorder.vo.LogisticsOrderQueryVo; import cc.hiver.core.logisticsorder.vo.LogisticsOrderQueryVo;
import cc.hiver.core.logisticsorder.vo.StatisticsVo;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
@ -42,4 +43,13 @@ public interface LogisticsOrderService extends IService<LogisticsOrder> {
* @return int * @return int
*/ */
List<LogisticsOrderChangeLogVo> getLogisticsOrderChangeLog(String orderId); List<LogisticsOrderChangeLogVo> getLogisticsOrderChangeLog(String orderId);
/**
* 物流订单数据统计
* @author 王富康
* @date 2024/9/7
* @param logisticsOrderQueryVo
* @return StatisticsVo
*/
StatisticsVo getLogisticsOrderStatistics(LogisticsOrderQueryVo logisticsOrderQueryVo);
} }

30
hiver-core/src/main/java/cc/hiver/core/logisticsorder/service/impl/LogisticsOrderServiceImpl.java

@ -1,13 +1,11 @@
package cc.hiver.core.logisticsorder.service.impl; package cc.hiver.core.logisticsorder.service.impl;
import cc.hiver.core.logisticsentruckinglog.service.LogisticsEntruckingLogService;
import cc.hiver.core.logisticsorder.entity.LogisticsOrder; import cc.hiver.core.logisticsorder.entity.LogisticsOrder;
import cc.hiver.core.logisticsorder.entity.LogisticsOrderChangeLog; import cc.hiver.core.logisticsorder.entity.LogisticsOrderChangeLog;
import cc.hiver.core.logisticsorder.mapper.LogisticsOrderMapper; import cc.hiver.core.logisticsorder.mapper.LogisticsOrderMapper;
import cc.hiver.core.logisticsorder.service.LogisticsOrderService; import cc.hiver.core.logisticsorder.service.LogisticsOrderService;
import cc.hiver.core.logisticsorder.vo.CompareObjectUtils; import cc.hiver.core.logisticsorder.vo.*;
import cc.hiver.core.logisticsorder.vo.DiffAttr;
import cc.hiver.core.logisticsorder.vo.LogisticsOrderChangeLogVo;
import cc.hiver.core.logisticsorder.vo.LogisticsOrderQueryVo;
import cc.hiver.core.utils.DateUtil; import cc.hiver.core.utils.DateUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
@ -29,6 +27,9 @@ public class LogisticsOrderServiceImpl extends ServiceImpl<LogisticsOrderMapper,
@Autowired @Autowired
private LogisticsOrderMapper logisticsOrderMapper; private LogisticsOrderMapper logisticsOrderMapper;
@Autowired
private LogisticsEntruckingLogService logisticsEntruckingLogService;
/** /**
* 分页查询物流订单 * 分页查询物流订单
* *
@ -97,4 +98,25 @@ public class LogisticsOrderServiceImpl extends ServiceImpl<LogisticsOrderMapper,
} }
return logisticsOrderChangeLogVoList; return logisticsOrderChangeLogVoList;
} }
/**
* 物流订单数据统计
* @author 王富康
* @date 2024/9/7
* @param logisticsOrderQueryVo
* @return StatisticsVo
*/
@Override
public StatisticsVo getLogisticsOrderStatistics(LogisticsOrderQueryVo logisticsOrderQueryVo) {
// 从订单表获取客户总运费、运单数、小费、保费
StatisticsVo statisticsVo = logisticsOrderMapper.getLogisticsOrderStatistics(logisticsOrderQueryVo);
// 从订单表获取客户数
int customerCount = logisticsOrderMapper.getCustomerCount(logisticsOrderQueryVo);
statisticsVo.setTotalCustomer(customerCount);
// 从装车记录获取运输费、装车费
StatisticsVo carStatisticsVo = logisticsEntruckingLogService.getCarStatistics(logisticsOrderQueryVo);
statisticsVo.setTotalTransportationFee(carStatisticsVo.getTotalTransportationFee());
statisticsVo.setTotalLoadingFee(carStatisticsVo.getTotalLoadingFee());
return statisticsVo;
}
} }

43
hiver-core/src/main/java/cc/hiver/core/logisticsorder/vo/StatisticsVo.java

@ -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;
}

16
hiver-core/src/main/resources/mapper/LogisticsEntruckingLogMapper.xml

@ -178,4 +178,20 @@
and create_time BETWEEN #{nowDate} AND #{afterDay} and create_time BETWEEN #{nowDate} AND #{afterDay}
</foreach> </foreach>
</update> </update>
<select id="getCarStatistics" resultType="cc.hiver.core.logisticsentruckinglog.vo.StatisticsVo" parameterType="cc.hiver.core.logisticsentruckinglog.vo.LogisticsOrderQueryVo">
SELECT
SUM(t.car_fee) AS total_loading_fee,
SUM(t.car_freight) AS total_transportation_fee
FROM
t_logistics_entrucking_log t
WHERE
t.del_flag = 0
<!--可按照线路、物流公司、到达站搜索-->
<if test='logisticsOrderQueryVo.companyId!=null and logisticsOrderQueryVo.companyId.trim() neq ""'>
AND t.company_id = #{logisticsOrderQueryVo.companyId}
</if>
<if test='logisticsOrderQueryVo.circuitId!=null and logisticsOrderQueryVo.circuitId.trim() neq ""'>
AND t.circuit_id = #{logisticsOrderQueryVo.circuitId}
</if>
</select>
</mapper> </mapper>

38
hiver-core/src/main/resources/mapper/LogisticsOrderMapper.xml

@ -170,4 +170,42 @@
<select id="getLogisticsOrderChangeLog" resultType="cc.hiver.core.logisticsorder.entity.LogisticsOrderChangeLog"> <select id="getLogisticsOrderChangeLog" resultType="cc.hiver.core.logisticsorder.entity.LogisticsOrderChangeLog">
select * from t_logistics_order_change_log where order_id = #{orderId} order by create_time desc; select * from t_logistics_order_change_log where order_id = #{orderId} order by create_time desc;
</select> </select>
<select id="getLogisticsOrderStatistics" resultType="cc.hiver.core.logisticsorder.vo.StatisticsVo">
SELECT
SUM(t.all_cost) AS total_freight,
COUNT(*) AS total_order,
SUM(t.tips) AS total_tips,
SUM(t.premium) AS total_insurance_fee
FROM
t_logistics_order t
WHERE
t.del_flag = 0
<!--可按照线路、物流公司、到达站搜索-->
<if test='logisticsOrderQueryVo.companyId!=null and logisticsOrderQueryVo.companyId.trim() neq ""'>
AND t.company_id = #{logisticsOrderQueryVo.companyId}
</if>
<if test='logisticsOrderQueryVo.circuitId!=null and logisticsOrderQueryVo.circuitId.trim() neq ""'>
AND t.circuit_id = #{logisticsOrderQueryVo.circuitId}
</if>
<if test='logisticsOrderQueryVo.arrivalStationId!=null and logisticsOrderQueryVo.arrivalStationId.trim() neq ""'>
AND t.arrival_station_id = #{logisticsOrderQueryVo.arrivalStationId}
</if>
</select>
<!--获取客户数-->
<select id="getCustomerCount" resultType="java.lang.Integer">
SELECT count(distinct receiver_mobile) FROM t_logistics_order
WHERE del_flag = 0
<!--可按照线路、物流公司、到达站搜索-->
<if test='logisticsOrderQueryVo.companyId!=null and logisticsOrderQueryVo.companyId.trim() neq ""'>
AND company_id = #{logisticsOrderQueryVo.companyId}
</if>
<if test='logisticsOrderQueryVo.circuitId!=null and logisticsOrderQueryVo.circuitId.trim() neq ""'>
AND circuit_id = #{logisticsOrderQueryVo.circuitId}
</if>
<if test='logisticsOrderQueryVo.arrivalStationId!=null and logisticsOrderQueryVo.arrivalStationId.trim() neq ""'>
AND arrival_station_id = #{logisticsOrderQueryVo.arrivalStationId}
</if>
</select>
</mapper> </mapper>

146
hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/customercategory/controller/CustomerCategoryController.java

@ -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("保存失败!");
}
}
}

29
hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/customercategory/entity/CustomerCategory.java

@ -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;
}

34
hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/customercategory/mapper/CustomerCategoryMapper.java

@ -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);
}

31
hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/customercategory/service/CustomerCategoryService.java

@ -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);
}

47
hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/customercategory/service/impl/CustomerCategoryServiceImpl.java

@ -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);
}
}

22
hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/customercategory/vo/CustomerCategoryQueryVo.java

@ -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;
}

8
hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/entity/Customer.java

@ -77,4 +77,12 @@ public class Customer implements Serializable {
@ApiModelProperty(value = "期初欠款") @ApiModelProperty(value = "期初欠款")
private BigDecimal amountOwed; private BigDecimal amountOwed;
// 分类id
@ApiModelProperty(value = "客户分类id")
private String categoryId;
// 分类名称
@ApiModelProperty(value = "客户分类名称")
private String categoryName;
} }

3
hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/entity/Product.java

@ -114,4 +114,7 @@ public class Product implements Serializable {
@ApiModelProperty(value = "入库状态:0:待入库(未维护对应的采购价信息);1:已入库;新增商品时为已入库") @ApiModelProperty(value = "入库状态:0:待入库(未维护对应的采购价信息);1:已入库;新增商品时为已入库")
private Integer inStorageStatus = 1; private Integer inStorageStatus = 1;
@ApiModelProperty(value = "客户分类价格规则")
private String customerCategoryRule;
} }

5
hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/serviceimpl/mybatis/ProductServiceImpl.java

@ -18,6 +18,7 @@ import cc.hiver.mall.productpicture.service.ProductPictureService;
import cc.hiver.mall.service.mybatis.ProductCategoryService; import cc.hiver.mall.service.mybatis.ProductCategoryService;
import cc.hiver.mall.service.mybatis.ProductService; import cc.hiver.mall.service.mybatis.ProductService;
import cc.hiver.mall.service.mybatis.StockService; import cc.hiver.mall.service.mybatis.StockService;
import cc.hiver.mall.utils.DateUtil;
import cn.hutool.json.JSONObject; import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil; import cn.hutool.json.JSONUtil;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
@ -51,6 +52,10 @@ public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> impl
@Override @Override
public IPage<ProductPageVO> getShareList(ProductPageQuery productPageQuery) { public IPage<ProductPageVO> getShareList(ProductPageQuery productPageQuery) {
if(StringUtils.isNotEmpty(productPageQuery.getEndDate())){
// 加一天
productPageQuery.setEndDate(DateUtil.addDay(productPageQuery.getEndDate(), 1));
}
final Page<ProductPageVO> page = new Page<>(productPageQuery.getPageNum(), productPageQuery.getPageSize()); final Page<ProductPageVO> page = new Page<>(productPageQuery.getPageNum(), productPageQuery.getPageSize());
final List<ProductPageVO> list = baseMapper.getShareList(page, productPageQuery); final List<ProductPageVO> list = baseMapper.getShareList(page, productPageQuery);
// 获取商品子图 // 获取商品子图

158
hiver-modules/hiver-mall/src/main/resources/mapper/CustomerCategoryMapper.xml

@ -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>

42
hiver-modules/hiver-mall/src/main/resources/mapper/CustomerMapper.xml

@ -17,6 +17,8 @@
<result column="area" jdbcType="VARCHAR" property="area" /> <result column="area" jdbcType="VARCHAR" property="area" />
<result column="shop_id" jdbcType="VARCHAR" property="shopId" /> <result column="shop_id" jdbcType="VARCHAR" property="shopId" />
<result column="user_id" jdbcType="VARCHAR" property="userId" /> <result column="user_id" jdbcType="VARCHAR" property="userId" />
<result column="category_id" jdbcType="VARCHAR" property="categoryId" />
<result column="category_name" jdbcType="VARCHAR" property="categoryName" />
</resultMap> </resultMap>
<resultMap id="DebtResultMap" type="cc.hiver.mall.pojo.dto.DebtCustomer"> <resultMap id="DebtResultMap" type="cc.hiver.mall.pojo.dto.DebtCustomer">
<result column="user_id" jdbcType="VARCHAR" property="userId" /> <result column="user_id" jdbcType="VARCHAR" property="userId" />
@ -83,7 +85,7 @@
</sql> </sql>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, create_by, create_time, del_flag, update_by, update_time, name, sex, phone, address, id, create_by, create_time, del_flag, update_by, update_time, name, sex, phone, address,
province, city, area, shop_id, user_id province, city, area, shop_id, user_id, category_id, category_name
</sql> </sql>
<select id="selectByExample" parameterType="cc.hiver.mall.entity.CustomerExample" resultMap="BaseResultMap"> <select id="selectByExample" parameterType="cc.hiver.mall.entity.CustomerExample" resultMap="BaseResultMap">
select select
@ -120,12 +122,12 @@
del_flag, update_by, update_time, del_flag, update_by, update_time,
name, sex, phone, address, name, sex, phone, address,
province, city, area, province, city, area,
shop_id, user_id) shop_id, user_id, category_id, category_name)
values (#{id,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, values (#{id,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
#{delFlag,jdbcType=INTEGER}, #{updateBy,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, #{delFlag,jdbcType=INTEGER}, #{updateBy,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP},
#{name,jdbcType=VARCHAR}, #{sex,jdbcType=VARCHAR}, #{phone,jdbcType=VARCHAR}, #{address,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{sex,jdbcType=VARCHAR}, #{phone,jdbcType=VARCHAR}, #{address,jdbcType=VARCHAR},
#{province,jdbcType=VARCHAR}, #{city,jdbcType=VARCHAR}, #{area,jdbcType=VARCHAR}, #{province,jdbcType=VARCHAR}, #{city,jdbcType=VARCHAR}, #{area,jdbcType=VARCHAR},
#{shopId,jdbcType=VARCHAR}, #{userId,jdbcType=VARCHAR}) #{shopId,jdbcType=VARCHAR}, #{userId,jdbcType=VARCHAR}, #{categoryId,jdbcType=VARCHAR}, #{categoryName,jdbcType=VARCHAR})
</insert> </insert>
<insert id="insertSelective" parameterType="cc.hiver.mall.entity.Customer"> <insert id="insertSelective" parameterType="cc.hiver.mall.entity.Customer">
insert into t_customer insert into t_customer
@ -175,6 +177,12 @@
<if test="userId != null"> <if test="userId != null">
user_id, user_id,
</if> </if>
<if test="categoryId != null">
category_id,
</if>
<if test="categoryName != null">
category_name,
</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null"> <if test="id != null">
@ -222,6 +230,12 @@
<if test="userId != null"> <if test="userId != null">
#{userId,jdbcType=VARCHAR}, #{userId,jdbcType=VARCHAR},
</if> </if>
<if test="categoryId != null">
#{categoryId,jdbcType=VARCHAR},
</if>
<if test="categoryName != null">
#{categoryName,jdbcType=VARCHAR},
</if>
</trim> </trim>
</insert> </insert>
<select id="countByExample" parameterType="cc.hiver.mall.entity.CustomerExample" resultType="java.lang.Long"> <select id="countByExample" parameterType="cc.hiver.mall.entity.CustomerExample" resultType="java.lang.Long">
@ -278,6 +292,12 @@
<if test="record.userId != null"> <if test="record.userId != null">
user_id = #{record.userId,jdbcType=VARCHAR}, user_id = #{record.userId,jdbcType=VARCHAR},
</if> </if>
<if test="record.categoryId != null">
category_id = #{record.categoryId,jdbcType=VARCHAR},
</if>
<if test="record.categoryName != null">
category_name = #{record.categoryName,jdbcType=VARCHAR},
</if>
</set> </set>
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause" />
@ -299,7 +319,9 @@
city = #{record.city,jdbcType=VARCHAR}, city = #{record.city,jdbcType=VARCHAR},
area = #{record.area,jdbcType=VARCHAR}, area = #{record.area,jdbcType=VARCHAR},
shop_id = #{record.shopId,jdbcType=VARCHAR}, shop_id = #{record.shopId,jdbcType=VARCHAR},
user_id = #{record.userId,jdbcType=VARCHAR} user_id = #{record.userId,jdbcType=VARCHAR},
category_id = #{record.categoryId,jdbcType=VARCHAR},
category_name = #{record.categoryName,jdbcType=VARCHAR}
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause" />
</if> </if>
@ -349,6 +371,12 @@
<if test="userId != null"> <if test="userId != null">
user_id = #{userId,jdbcType=VARCHAR}, user_id = #{userId,jdbcType=VARCHAR},
</if> </if>
<if test="categoryId != null">
category_id = #{categoryId,jdbcType=VARCHAR},
</if>
<if test="categoryName != null">
category_name = #{categoryName,jdbcType=VARCHAR},
</if>
</set> </set>
where id = #{id,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR}
</update> </update>
@ -367,7 +395,9 @@
city = #{city,jdbcType=VARCHAR}, city = #{city,jdbcType=VARCHAR},
area = #{area,jdbcType=VARCHAR}, area = #{area,jdbcType=VARCHAR},
shop_id = #{shopId,jdbcType=VARCHAR}, shop_id = #{shopId,jdbcType=VARCHAR},
user_id = #{userId,jdbcType=VARCHAR} user_id = #{userId,jdbcType=VARCHAR},
category_id = #{categoryId,jdbcType=VARCHAR},
category_name = #{categoryName,jdbcType=VARCHAR}
where id = #{id,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR}
</update> </update>
@ -388,7 +418,7 @@
<select id="getCustomerList" resultMap="BaseResultMap"> <select id="getCustomerList" resultMap="BaseResultMap">
select select
a.id, a.name, a.sex, a.phone, a.address, a.id, a.name, a.sex, a.phone, a.address,
a.province, a.city, a.area, a.shop_id, a.user_id,s.amount_owed as no_earn,t.not_buy_days a.province, a.city, a.area, a.shop_id, a.user_id, a.category_id, a.category_name,s.amount_owed as no_earn,t.not_buy_days
from t_customer a from t_customer a
left join t_debt s left join t_debt s
on a.id = s.user_id on a.id = s.user_id

33
hiver-modules/hiver-mall/src/main/resources/mapper/ProductMapper.xml

@ -28,6 +28,7 @@
<result column="print_barcode" jdbcType="VARCHAR" property="printBarcode"/> <result column="print_barcode" jdbcType="VARCHAR" property="printBarcode"/>
<result column="tail_warn" jdbcType="INTEGER" property="tailWarn"/> <result column="tail_warn" jdbcType="INTEGER" property="tailWarn"/>
<result column="in_storage_status" jdbcType="INTEGER" property="inStorageStatus"/> <result column="in_storage_status" jdbcType="INTEGER" property="inStorageStatus"/>
<result column="customer_category_rule" jdbcType="VARCHAR" property="customerCategoryRule"/>
</resultMap> </resultMap>
<sql id="Example_Where_Clause"> <sql id="Example_Where_Clause">
<where> <where>
@ -93,7 +94,7 @@
id, create_by, create_time, del_flag, update_by, update_time, product_name, unit, id, create_by, create_time, del_flag, update_by, update_time, product_name, unit,
shop_id, category_id,attr_id, attribute_list, supplier_id,supplier_name, product_sn, barcode, price, purchase_price, shop_id, category_id,attr_id, attribute_list, supplier_id,supplier_name, product_sn, barcode, price, purchase_price,
wholesale_price, product_picture, product_video, product_intro, sales_week, print_barcode, wholesale_price, product_picture, product_video, product_intro, sales_week, print_barcode,
tail_warn,in_storage_status tail_warn,in_storage_status,customer_category_rule
</sql> </sql>
<select id="selectByExample" parameterType="cc.hiver.mall.entity.ProductExample" resultMap="BaseResultMap"> <select id="selectByExample" parameterType="cc.hiver.mall.entity.ProductExample" resultMap="BaseResultMap">
select select
@ -134,7 +135,7 @@
product_sn, barcode, price, product_sn, barcode, price,
purchase_price, wholesale_price, product_picture, purchase_price, wholesale_price, product_picture,
product_video, product_intro, sales_week, product_video, product_intro, sales_week,
print_barcode, tail_warn,in_storage_status) print_barcode, tail_warn,in_storage_status,customer_category_rule)
values (#{id,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, values (#{id,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
#{delFlag,jdbcType=INTEGER}, #{updateBy,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, #{delFlag,jdbcType=INTEGER}, #{updateBy,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP},
#{productName,jdbcType=VARCHAR}, #{unit,jdbcType=VARCHAR}, #{shopId,jdbcType=VARCHAR}, #{productName,jdbcType=VARCHAR}, #{unit,jdbcType=VARCHAR}, #{shopId,jdbcType=VARCHAR},
@ -143,7 +144,8 @@
#{purchasePrice,jdbcType=DECIMAL}, #{wholesalePrice,jdbcType=DECIMAL}, #{purchasePrice,jdbcType=DECIMAL}, #{wholesalePrice,jdbcType=DECIMAL},
#{productPicture,jdbcType=VARCHAR}, #{productPicture,jdbcType=VARCHAR},
#{productVideo,jdbcType=VARCHAR}, #{productIntro,jdbcType=VARCHAR}, #{salesWeek,jdbcType=TIMESTAMP}, #{productVideo,jdbcType=VARCHAR}, #{productIntro,jdbcType=VARCHAR}, #{salesWeek,jdbcType=TIMESTAMP},
#{printBarcode,jdbcType=VARCHAR}, #{tailWarn,jdbcType=INTEGER}, #{inStorageStatus,jdbcType=INTEGER}) #{printBarcode,jdbcType=VARCHAR}, #{tailWarn,jdbcType=INTEGER}, #{inStorageStatus,jdbcType=INTEGER},
#{customerCategoryRule,jdbcType=VARCHAR})
</insert> </insert>
<insert id="insertSelective" parameterType="cc.hiver.mall.entity.Product"> <insert id="insertSelective" parameterType="cc.hiver.mall.entity.Product">
insert into t_product insert into t_product
@ -223,6 +225,9 @@
<if test="inStorageStatus != null"> <if test="inStorageStatus != null">
in_storage_status, in_storage_status,
</if> </if>
<if test="customerCategoryRule != null">
customer_category_rule,
</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null"> <if test="id != null">
@ -300,6 +305,9 @@
<if test="inStorageStatus != null"> <if test="inStorageStatus != null">
#{inStorageStatus,jdbcType=INTEGER}, #{inStorageStatus,jdbcType=INTEGER},
</if> </if>
<if test="customerCategoryRule != null">
#{customerCategoryRule,jdbcType=VARCHAR},
</if>
</trim> </trim>
</insert> </insert>
<select id="countByExample" parameterType="cc.hiver.mall.entity.ProductExample" resultType="java.lang.Long"> <select id="countByExample" parameterType="cc.hiver.mall.entity.ProductExample" resultType="java.lang.Long">
@ -386,6 +394,9 @@
<if test="record.inStorageStatus != null"> <if test="record.inStorageStatus != null">
in_storage_status = #{record.inStorageStatus,jdbcType=INTEGER}, in_storage_status = #{record.inStorageStatus,jdbcType=INTEGER},
</if> </if>
<if test="record.customerCategoryRule != null">
customer_category_rule = #{record.customerCategoryRule,jdbcType=VARCHAR},
</if>
</set> </set>
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause"/> <include refid="Update_By_Example_Where_Clause"/>
@ -417,7 +428,8 @@
sales_week = #{record.salesWeek,jdbcType=TIMESTAMP}, sales_week = #{record.salesWeek,jdbcType=TIMESTAMP},
print_barcode = #{record.printBarcode,jdbcType=VARCHAR}, print_barcode = #{record.printBarcode,jdbcType=VARCHAR},
tail_warn = #{record.tailWarn,jdbcType=INTEGER}, tail_warn = #{record.tailWarn,jdbcType=INTEGER},
in_storage_status = #{record.inStorageStatus,jdbcType=INTEGER} in_storage_status = #{record.inStorageStatus,jdbcType=INTEGER},
customer_category_rule = #{record.customerCategoryRule,jdbcType=VARCHAR}
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause"/> <include refid="Update_By_Example_Where_Clause"/>
</if> </if>
@ -497,6 +509,9 @@
<if test="inStorageStatus != null"> <if test="inStorageStatus != null">
in_storage_status = #{inStorageStatus,jdbcType=INTEGER}, in_storage_status = #{inStorageStatus,jdbcType=INTEGER},
</if> </if>
<if test="customerCategoryRule != null">
customer_category_rule = #{customerCategoryRule,jdbcType=VARCHAR},
</if>
</set> </set>
where id = #{id,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR}
</update> </update>
@ -525,7 +540,8 @@
sales_week = #{salesWeek,jdbcType=TIMESTAMP}, sales_week = #{salesWeek,jdbcType=TIMESTAMP},
print_barcode = #{printBarcode,jdbcType=VARCHAR}, print_barcode = #{printBarcode,jdbcType=VARCHAR},
tail_warn = #{tailWarn,jdbcType=INTEGER}, tail_warn = #{tailWarn,jdbcType=INTEGER},
in_storage_status = #{inStorageStatus,jdbcType=INTEGER} in_storage_status = #{inStorageStatus,jdbcType=INTEGER},
customer_category_rule = #{customerCategoryRule,jdbcType=VARCHAR}
where id = #{id,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR}
</update> </update>
@ -558,8 +574,11 @@
t.print_barcode, t.print_barcode,
t.tail_warn, t.tail_warn,
t.in_storage_status, t.in_storage_status,
COALESCE(ss.stock_count, 0) AS stock_count, t.customer_category_rule,
COALESCE(sd.total_sold, 0) AS total_sold COALESCE(ss.stock_count, 0) AS stock_count
<if test='queryParams.startDate !=null and queryParams.startDate.trim() neq "" and queryParams.endDate !=null and queryParams.endDate.trim() neq ""'>
, COALESCE(sd.total_sold, 0) AS total_sold
</if>
FROM t_product t FROM t_product t
LEFT JOIN ( LEFT JOIN (
SELECT SELECT

Loading…
Cancel
Save