feat(wms): 新增发货计划统计功能
- 在 IWmsDeliveryPlanService 接口中新增 getDeliveryPlanStatistics 方法 - 在 WmsDeliveryPlanController 中添加 /statistics 接口用于获取统计信息 - 在 WmsDeliveryPlanMapper 中新增 selectDeliveryPlanStatistics 查询方法 - 在 WmsDeliveryPlanMapper.xml 中编写对应的 SQL 查询语句 - 在 WmsDeliveryPlanServiceImpl 中实现统计方法调用 Mapper 层 - 新增 WmsDeliveryPlanStatisticsVo 类用于封装统计结果数据 - 引入相关类导入依赖以支持新功能开发
This commit is contained in:
@@ -3,6 +3,7 @@ package com.klp.controller;
|
||||
import java.util.List;
|
||||
import java.util.Arrays;
|
||||
|
||||
import com.klp.domain.vo.WmsDeliveryPlanStatisticsVo;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.constraints.*;
|
||||
@@ -96,4 +97,15 @@ public class WmsDeliveryPlanController extends BaseController {
|
||||
@PathVariable Long[] planIds) {
|
||||
return toAjax(iWmsDeliveryPlanService.deleteWithValidByIds(Arrays.asList(planIds), true));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取发货计划统计信息
|
||||
*
|
||||
* @param planId 计划ID,可选
|
||||
*/
|
||||
@GetMapping("/statistics")
|
||||
public R<List<WmsDeliveryPlanStatisticsVo>> getStatistics(@RequestParam(required = false) Long planId) {
|
||||
List<WmsDeliveryPlanStatisticsVo> statistics = iWmsDeliveryPlanService.getDeliveryPlanStatistics(planId);
|
||||
return R.ok(statistics);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.klp.domain.vo;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 发货计划统计信息VO
|
||||
*/
|
||||
@Data
|
||||
public class WmsDeliveryPlanStatisticsVo {
|
||||
/**
|
||||
* 计划ID
|
||||
*/
|
||||
private Long planId;
|
||||
|
||||
/**
|
||||
* 计划名称
|
||||
*/
|
||||
private String planName;
|
||||
|
||||
/**
|
||||
* 发货单数量
|
||||
*/
|
||||
private Integer waybillCount = 0;
|
||||
|
||||
/**
|
||||
* 总卷数
|
||||
*/
|
||||
private Integer totalCoilCount = 0;
|
||||
|
||||
/**
|
||||
* 总吨数(吨)
|
||||
*/
|
||||
private BigDecimal totalWeight = BigDecimal.ZERO;
|
||||
|
||||
/**
|
||||
* 完成进度(百分比)
|
||||
*/
|
||||
private BigDecimal completionRate = BigDecimal.ZERO;
|
||||
|
||||
/**
|
||||
* 已完成发货单数量
|
||||
*/
|
||||
private Integer completedWaybillCount = 0;
|
||||
}
|
||||
@@ -1,9 +1,12 @@
|
||||
package com.klp.mapper;
|
||||
|
||||
import com.klp.domain.WmsDeliveryPlan;
|
||||
import com.klp.domain.vo.WmsDeliveryPlanStatisticsVo;
|
||||
import com.klp.domain.vo.WmsDeliveryPlanVo;
|
||||
import com.klp.common.core.mapper.BaseMapperPlus;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 发货计划Mapper接口
|
||||
*
|
||||
@@ -12,4 +15,5 @@ import com.klp.common.core.mapper.BaseMapperPlus;
|
||||
*/
|
||||
public interface WmsDeliveryPlanMapper extends BaseMapperPlus<WmsDeliveryPlanMapper, WmsDeliveryPlan, WmsDeliveryPlanVo> {
|
||||
|
||||
List<WmsDeliveryPlanStatisticsVo> selectDeliveryPlanStatistics(Long planId);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.klp.service;
|
||||
|
||||
import com.klp.domain.WmsDeliveryPlan;
|
||||
import com.klp.domain.vo.WmsDeliveryPlanStatisticsVo;
|
||||
import com.klp.domain.vo.WmsDeliveryPlanVo;
|
||||
import com.klp.domain.bo.WmsDeliveryPlanBo;
|
||||
import com.klp.common.core.page.TableDataInfo;
|
||||
@@ -46,4 +47,6 @@ public interface IWmsDeliveryPlanService {
|
||||
* 校验并批量删除发货计划信息
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
|
||||
List<WmsDeliveryPlanStatisticsVo> getDeliveryPlanStatistics(Long planId);
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.klp.common.utils.StringUtils;
|
||||
import com.klp.domain.vo.WmsDeliveryPlanStatisticsVo;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.klp.domain.bo.WmsDeliveryPlanBo;
|
||||
@@ -15,6 +16,7 @@ import com.klp.domain.WmsDeliveryPlan;
|
||||
import com.klp.mapper.WmsDeliveryPlanMapper;
|
||||
import com.klp.service.IWmsDeliveryPlanService;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
@@ -107,4 +109,15 @@ public class WmsDeliveryPlanServiceImpl implements IWmsDeliveryPlanService {
|
||||
}
|
||||
return baseMapper.deleteBatchIds(ids) > 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取发货计划统计信息
|
||||
*
|
||||
* @param planId 计划ID,可选
|
||||
* @return 统计信息列表
|
||||
*/
|
||||
public List<WmsDeliveryPlanStatisticsVo> getDeliveryPlanStatistics(Long planId) {
|
||||
return baseMapper.selectDeliveryPlanStatistics(planId);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user