| | |
| | | import com.vincent.rsf.server.manager.entity.*; |
| | | import com.vincent.rsf.server.manager.enums.*; |
| | | import com.vincent.rsf.server.manager.service.*; |
| | | import com.vincent.rsf.server.manager.service.impl.StockItemServiceImpl; |
| | | import com.vincent.rsf.server.manager.service.impl.StockServiceImpl; |
| | | import com.vincent.rsf.server.system.entity.User; |
| | | import com.vincent.rsf.server.system.service.UserService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | |
| | | private UserService userService; |
| | | @Autowired |
| | | private ReportMsgService reportMsgService; |
| | | @Autowired |
| | | private StockItemService stockItemService; |
| | | @Autowired |
| | | private StockService stockService; |
| | | |
| | | /** |
| | | * @param |
| | |
| | | if (!Objects.isNull(user)) { |
| | | nickName = user.getNickname(); |
| | | } |
| | | |
| | | //获取入库库位信息 |
| | | if (order.getType().equals(OrderType.ORDER_IN.type)) { |
| | | //筛选当前唯一字段所有出入库信息 |
| | | List<StockItem> stockItems = stockItemService.list(new LambdaQueryWrapper<StockItem>() |
| | | .eq(StockItem::getFieldsIndex, orderItem.getFieldsIndex())); |
| | | //获取库存中订单库位 |
| | | if (!stockItems.isEmpty()) { |
| | | Set<Long> stockIds = stockItems.stream().map(StockItem::getStockId).collect(Collectors.toSet()); |
| | | //获取库存库位信息 |
| | | List<Stock> stocks = stockService.list(new LambdaQueryWrapper<Stock>() |
| | | .in(Stock::getId, stockIds) |
| | | .eq(Stock::getType, OrderType.ORDER_IN.type) |
| | | .eq(Stock::getSourceCode, order.getCode())); |
| | | Set<String> locs = stocks.stream().map(Stock::getLocCode).collect(Collectors.toSet()); |
| | | String locCode = StringUtils.join(locs.toArray(), ","); |
| | | param.setZone(locCode); |
| | | } |
| | | } |
| | | //获取索引内容 |
| | | Map<String, String> fields = FieldsUtils.getFields(orderItem.getFieldsIndex()); |
| | | |
| | | //设置通用参数 |