| | |
| | | |
| | | import org.apache.commons.lang3.StringUtils; |
| | | |
| | | import javax.swing.*; |
| | | import java.math.BigDecimal; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | |
| | | LambdaQueryWrapper<LocItem> locItemQueryWrapper = new LambdaQueryWrapper<>(); |
| | | locItemQueryWrapper.eq(LocItem::getMatnrCode, matnrCode); |
| | | locItemQueryWrapper.eq(StringUtils.isNotEmpty(splrBatch), LocItem::getBatch, splrBatch); |
| | | locItemQueryWrapper.orderByAsc(LocItem::getCreateTime); |
| | | //如果批次不为空,按批次先后出库 |
| | | if (StringUtils.isNotBlank(splrBatch)) { |
| | | locItemQueryWrapper.orderByAsc(LocItem::getBatch); |
| | | } else { |
| | | locItemQueryWrapper.orderByAsc(LocItem::getCreateTime); |
| | | } |
| | | String applySql = String.format( |
| | | "EXISTS (SELECT 1 FROM man_loc ml " + |
| | | "WHERE ml.use_status = '%s'" + |
| | |
| | | BasStation basStation = basStationService.getOne(new LambdaQueryWrapper<BasStation>() |
| | | .eq(BasStation::getUseStatus, LocStsType.LOC_STS_TYPE_O.type) |
| | | .in(BasStation::getStationName, stationSet) |
| | | .eq(BasStation::getSType, sType) |
| | | // .eq(BasStation::getSType, sType) |
| | | .notIn(!stas.isEmpty(), BasStation::getStationName, stas) |
| | | .last("LIMIT 1")); |
| | | stations.add(basStation); |
| | |
| | | orderOutItemDto.setSitesNo(basStation.getStationName()); |
| | | } |
| | | } |
| | | |
| | | |
| | | list.add(orderOutItemDto); |
| | | |