mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-12 21:02:08 +08:00
新增未排订单的添加小板排除已选排单订单能力,有一种主子都有num的情况无法处理,将主单num=0让前端不把=0的订单id用于查询noplan未排小板
This commit is contained in:
+3
@@ -114,4 +114,7 @@ public class OrderPageReqVOCopy extends PageParam {
|
||||
|
||||
@Schema(description = "厚度")
|
||||
private BigDecimal thickness;
|
||||
|
||||
@Schema(description = "未排订单添加小板时需要排除的已选择订单号列表")
|
||||
private List<Long> excludeOrderIdsWhenUnplanAddBoard;
|
||||
}
|
||||
|
||||
+14
-6
@@ -548,6 +548,8 @@ public class PlanServiceImpl implements PlanService {
|
||||
Long organId = getUserOrganId();
|
||||
|
||||
List<Integer> statusList = new ArrayList<>();
|
||||
// 未排单添加小板被选入排单的订单,在这里不展示了
|
||||
List<Long> excludeOrderIdsWhenUnplanAddBoard = pageReqVO.getExcludeOrderIdsWhenUnplanAddBoard();
|
||||
|
||||
statusList.add(OrderStatusEnum.NEW_ORDER.getStatus());
|
||||
statusList.add(OrderStatusEnum.IN_PRODUCTION.getStatus());
|
||||
@@ -578,7 +580,8 @@ public class PlanServiceImpl implements PlanService {
|
||||
.likeIfPresent(FIELD_CUSTOM_ORDER_NO, pageReqVO.getDefaultId())
|
||||
.likeIfPresent(FIELD_ADDRESS, pageReqVO.getConsigneeAddress())
|
||||
.betweenIfPresent(FIELD_ORDER_DATE, LocalDateTimeUtils.generateTimeSection(pageReqVO.getCreateTime()))
|
||||
.eqIfPresent(FIELD_ORDER_TYPE, pageReqVO.getOrderType());
|
||||
.eqIfPresent(FIELD_ORDER_TYPE, pageReqVO.getOrderType())
|
||||
.notInIfPresent(FIELD_ORDER_ID, excludeOrderIdsWhenUnplanAddBoard);
|
||||
|
||||
Integer pageSize = pageReqVO.getPageSize();
|
||||
PageDTO<OrderRespVOCopy> page = new PageDTO<>(pageReqVO.getPageNo(), pageSize);
|
||||
@@ -586,21 +589,26 @@ public class PlanServiceImpl implements PlanService {
|
||||
// 查询满足未排单条件的顶级订单id
|
||||
IPage<Long> rootOrderIdList = planItemMapper.selectRootOrderIdList(page, queryWrapperX);
|
||||
long rootOrderIdListTotal = rootOrderIdList.getTotal();
|
||||
if (PAGE_SIZE_NONE != pageSize && rootOrderIdListTotal == 0) {
|
||||
return new PageResult<>();
|
||||
}
|
||||
if (PAGE_SIZE_NONE == pageSize && rootOrderIdList.getRecords().isEmpty()) {
|
||||
List<Long> records = rootOrderIdList.getRecords();
|
||||
if (rootOrderIdListTotal == 0 || CollUtil.isEmpty(records)) {
|
||||
return new PageResult<>();
|
||||
}
|
||||
|
||||
// 查询顶级列表的信息,分页在顶级查询做,此处查询全部信息避免分页互相影响
|
||||
PageDTO<OrderRespVOCopy> secondPage = new PageDTO<>(pageReqVO.getPageNo(), PAGE_SIZE_NONE);
|
||||
IPage<OrderRespVOCopy> orderList = planItemMapper.selectOrderList(secondPage, queryWrapperX, type, orderGoodsIds, rootOrderIdList.getRecords());
|
||||
IPage<OrderRespVOCopy> orderList = planItemMapper.selectOrderList(secondPage, queryWrapperX, type, orderGoodsIds, records);
|
||||
|
||||
List<OrderRespVOCopy> mainOrderList = orderList.getRecords();
|
||||
|
||||
// 订单分组查询子单
|
||||
if (CollUtil.isNotEmpty(mainOrderList)) {
|
||||
// 未排单添加小板,当主单列表存在要排除的订单id时,把这个订单的num设置为0不参与后续未排小板查询
|
||||
mainOrderList.forEach(e -> {
|
||||
if (CollUtil.isNotEmpty(excludeOrderIdsWhenUnplanAddBoard) && excludeOrderIdsWhenUnplanAddBoard.contains(e.getOrderId())) {
|
||||
e.setNum(0);
|
||||
}
|
||||
});
|
||||
|
||||
// 主单id列表
|
||||
Long[] mainOrderIds = mainOrderList.stream().map(OrderRespVOCopy::getOrderId).toArray(Long[]::new);
|
||||
List<OrderRespVOCopy> childList = planItemMapper.selectOrderChildList(queryWrapperX, type, orderGoodsIds, mainOrderIds);
|
||||
|
||||
Reference in New Issue
Block a user