|
|
|
@ -55,7 +55,7 @@ public class LogisticsOrderServiceImpl extends ServiceImpl<LogisticsOrderMapper, |
|
|
|
@Override |
|
|
|
public LogisticsOrder getLogisticsOrderByCompanyId(LogisticsOrder logisticsOrder) { |
|
|
|
|
|
|
|
LambdaQueryWrapper<LogisticsOrder> stuQuery = new LambdaQueryWrapper<>(); |
|
|
|
final LambdaQueryWrapper<LogisticsOrder> stuQuery = new LambdaQueryWrapper<>(); |
|
|
|
stuQuery.eq(LogisticsOrder::getCompanyId, logisticsOrder.getCompanyId()) |
|
|
|
.orderByDesc(LogisticsOrder::getCreateTime) |
|
|
|
.between(LogisticsOrder::getCreateTime, DateUtil.COMMON.getDateText(new Date()) + " 00:00:00", DateUtil.COMMON.getDateText(new Date()) + " 23:59:59") |
|
|
|
@ -73,21 +73,22 @@ public class LogisticsOrderServiceImpl extends ServiceImpl<LogisticsOrderMapper, |
|
|
|
|
|
|
|
/** |
|
|
|
* 查询物流订单修改记录 |
|
|
|
* |
|
|
|
* @param orderId |
|
|
|
* @return int |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public List<LogisticsOrderChangeLogVo> getLogisticsOrderChangeLog(String orderId) { |
|
|
|
List<LogisticsOrderChangeLog> list = logisticsOrderMapper.getLogisticsOrderChangeLog(orderId); |
|
|
|
List<LogisticsOrderChangeLogVo> logisticsOrderChangeLogVoList = new ArrayList<>(); |
|
|
|
final List<LogisticsOrderChangeLog> list = logisticsOrderMapper.getLogisticsOrderChangeLog(orderId); |
|
|
|
final List<LogisticsOrderChangeLogVo> logisticsOrderChangeLogVoList = new ArrayList<>(); |
|
|
|
if (CollectionUtils.isNotEmpty(list)) { |
|
|
|
Gson gson = new Gson(); |
|
|
|
final Gson gson = new Gson(); |
|
|
|
for (LogisticsOrderChangeLog logisticsOrderChangeLog : list) { |
|
|
|
LogisticsOrderChangeLogVo logisticsOrderChangeLogVo = new LogisticsOrderChangeLogVo(); |
|
|
|
LogisticsOrder oldData = gson.fromJson(logisticsOrderChangeLog.getOldData(), LogisticsOrder.class); |
|
|
|
LogisticsOrder newData = gson.fromJson(logisticsOrderChangeLog.getNewData(), LogisticsOrder.class); |
|
|
|
CompareObjectUtils<LogisticsOrder> compareObjectUtils = new CompareObjectUtils<>(); |
|
|
|
List<DiffAttr> diffAttrs = compareObjectUtils.CompareObjWithAnnotation(oldData, newData); |
|
|
|
final LogisticsOrderChangeLogVo logisticsOrderChangeLogVo = new LogisticsOrderChangeLogVo(); |
|
|
|
final LogisticsOrder oldData = gson.fromJson(logisticsOrderChangeLog.getOldData(), LogisticsOrder.class); |
|
|
|
final LogisticsOrder newData = gson.fromJson(logisticsOrderChangeLog.getNewData(), LogisticsOrder.class); |
|
|
|
final CompareObjectUtils<LogisticsOrder> compareObjectUtils = new CompareObjectUtils<>(); |
|
|
|
final List<DiffAttr> diffAttrs = compareObjectUtils.CompareObjWithAnnotation(oldData, newData); |
|
|
|
logisticsOrderChangeLogVo.setOrderId(oldData.getId()); |
|
|
|
logisticsOrderChangeLogVo.setCreateBy(logisticsOrderChangeLog.getCreateBy()); |
|
|
|
logisticsOrderChangeLogVo.setCreateByName(logisticsOrderChangeLog.getCreateByName()); |
|
|
|
@ -101,20 +102,26 @@ public class LogisticsOrderServiceImpl extends ServiceImpl<LogisticsOrderMapper, |
|
|
|
|
|
|
|
/** |
|
|
|
* 物流订单数据统计 |
|
|
|
* @author 王富康 |
|
|
|
* @date 2024/9/7 |
|
|
|
* |
|
|
|
* @param logisticsOrderQueryVo |
|
|
|
* @return StatisticsVo |
|
|
|
* @author 王富康 |
|
|
|
* @date 2024/9/7 |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public StatisticsVo getLogisticsOrderStatistics(LogisticsOrderQueryVo logisticsOrderQueryVo) { |
|
|
|
|
|
|
|
// 如果结束时间不为空,加1天
|
|
|
|
if (StringUtils.isNotEmpty(logisticsOrderQueryVo.getEndDate())) { |
|
|
|
logisticsOrderQueryVo.setEndDate(DateUtil.addDay(logisticsOrderQueryVo.getEndDate(), 1)); |
|
|
|
} |
|
|
|
// 从订单表获取客户总运费、运单数、小费、保费
|
|
|
|
StatisticsVo statisticsVo = logisticsOrderMapper.getLogisticsOrderStatistics(logisticsOrderQueryVo); |
|
|
|
final StatisticsVo statisticsVo = logisticsOrderMapper.getLogisticsOrderStatistics(logisticsOrderQueryVo); |
|
|
|
// 从订单表获取客户数
|
|
|
|
int customerCount = logisticsOrderMapper.getCustomerCount(logisticsOrderQueryVo); |
|
|
|
final int customerCount = logisticsOrderMapper.getCustomerCount(logisticsOrderQueryVo); |
|
|
|
statisticsVo.setTotalCustomer(customerCount); |
|
|
|
// 从装车记录获取运输费、装车费
|
|
|
|
StatisticsVo carStatisticsVo = logisticsEntruckingLogService.getCarStatistics(logisticsOrderQueryVo); |
|
|
|
final StatisticsVo carStatisticsVo = logisticsEntruckingLogService.getCarStatistics(logisticsOrderQueryVo); |
|
|
|
statisticsVo.setTotalTransportationFee(carStatisticsVo.getTotalTransportationFee()); |
|
|
|
statisticsVo.setTotalLoadingFee(carStatisticsVo.getTotalLoadingFee()); |
|
|
|
return statisticsVo; |
|
|
|
|