feat(WmsDeliveryWaybillDetailController): 添加已发货钢卷统计数据接口
- 新增 statistics 接口用于统计已发货绑定钢卷的汇总数据 - 支持按时间范围查询已绑定钢卷ID列表 - 实现毛重、净重、数量等指标的数据统计功能 - 添加 startTime 和 endTime 参数支持时间段筛选 - 集成 WmsMaterialCoilService 的 getStatistics 方法 - 返回 Map 结构的统计数据结果
This commit is contained in:
@@ -1,8 +1,11 @@
|
||||
package com.klp.controller;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import com.klp.domain.vo.WmsMaterialCoilBindVo;
|
||||
@@ -147,4 +150,26 @@ public class WmsDeliveryWaybillDetailController extends BaseController {
|
||||
bo.setStatusFirst(true); // 未发货的排在前面
|
||||
return iWmsMaterialCoilService.queryPageListWithBindInfo(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 统计已发货绑定钢卷的汇总数据
|
||||
* 根据coilIds查询条件统计毛重、净重、数量等指标
|
||||
*/
|
||||
@GetMapping("/statistics")
|
||||
public R<java.util.Map<String, java.math.BigDecimal>> getStatistics(
|
||||
WmsMaterialCoilBo bo,
|
||||
@RequestParam(required = false) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date startTime,
|
||||
@RequestParam(required = false) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date endTime) {
|
||||
List<Long> boundCoilIds;
|
||||
if (startTime != null || endTime != null) {
|
||||
boundCoilIds = iWmsDeliveryWaybillDetailService.getBoundCoilIdsByTimeRange(startTime, endTime);
|
||||
} else {
|
||||
boundCoilIds = iWmsDeliveryWaybillDetailService.getBoundCoilIds();
|
||||
}
|
||||
if (boundCoilIds == null || boundCoilIds.isEmpty()) {
|
||||
return R.ok(new HashMap<>());
|
||||
}
|
||||
bo.setCoilIds(boundCoilIds.stream().map(String::valueOf).collect(Collectors.joining(",")));
|
||||
return R.ok(iWmsMaterialCoilService.getStatistics(bo));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user