| | |
| | | if (CollUtil.isEmpty(permittedClientIds)) { |
| | | return PageResult.empty(); |
| | | } |
| | | wrapper.in(MesProWorkOrderDO::getClientId, permittedClientIds); |
| | | // 允许 client_id 为空的记录(无客户工单对所有有权限用户可见) |
| | | wrapper.and(w -> w.in(MesProWorkOrderDO::getClientId, permittedClientIds) |
| | | .or().isNull(MesProWorkOrderDO::getClientId)); |
| | | } |
| | | return selectPage(reqVO, wrapper); |
| | | } |
| | |
| | | .setSql("quantity_produced = IFNULL(quantity_produced, 0) + " + incrQuantityProduced)); |
| | | } |
| | | |
| | | /** |
| | | * 累加工单的已排产数量 |
| | | * |
| | | * @param id 工单编号 |
| | | * @param incrQuantityScheduled 本次排产数量增量 |
| | | */ |
| | | default void updateScheduledQuantity(Long id, BigDecimal incrQuantityScheduled) { |
| | | update(null, new LambdaUpdateWrapper<MesProWorkOrderDO>() |
| | | .eq(MesProWorkOrderDO::getId, id) |
| | | .setSql("quantity_scheduled = IFNULL(quantity_scheduled, 0) + " + incrQuantityScheduled)); |
| | | } |
| | | |
| | | default Long selectCountByVendorId(Long vendorId) { |
| | | return selectCount(MesProWorkOrderDO::getVendorId, vendorId); |
| | | } |