| | |
| | | import com.vincent.rsf.server.system.constant.GlobalConfigCode; |
| | | import com.vincent.rsf.server.system.constant.SerialRuleCode; |
| | | import com.vincent.rsf.server.system.entity.Config; |
| | | import com.vincent.rsf.server.system.entity.FieldsItem; |
| | | import com.vincent.rsf.server.system.service.ConfigService; |
| | | import com.vincent.rsf.server.system.service.FieldsItemService; |
| | | import com.vincent.rsf.server.system.service.impl.FieldsItemServiceImpl; |
| | | import com.vincent.rsf.server.system.utils.SerialRuleUtils; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | * @description |
| | | * @create 2025/3/3 15:38 |
| | | */ |
| | | @Slf4j |
| | | @Component |
| | | public class ScheduleJobs { |
| | | |
| | |
| | | private TransferService transferService; |
| | | @Autowired |
| | | private OutStockService outStockService; |
| | | @Autowired |
| | | private FieldsItemService fieldsItemService; |
| | | |
| | | /** |
| | | * 自动收货:仅当 DirectWaitPakin 配置为 true 时执行,将未执行入库单直接收货并写入收货区,更新单据状态为收货完成。 |
| | |
| | | .setWeight(matnr.getWeight()) |
| | | .setFieldsIndex(orderItem.getFieldsIndex()) |
| | | .setShipperId(matnr.getShipperId()); |
| | | if (StringUtils.isNotBlank(orderItem.getFieldsIndex())) { |
| | | List<WarehouseAreasItem> warehousList = warehouseAreasItemService.list(new LambdaQueryWrapper<WarehouseAreasItem>().eq(WarehouseAreasItem::getFieldsIndex, orderItem.getFieldsIndex())); |
| | | WarehouseAreasItem warehousItem = warehousList.isEmpty() ? null : warehousList.get(0); |
| | | if (Objects.nonNull(warehousItem)) { |
| | | List<FieldsItem> fieldsList = fieldsItemService.list(new LambdaQueryWrapper<FieldsItem>().eq(FieldsItem::getUuid, orderItem.getFieldsIndex()).last("LIMIT 1")); |
| | | FieldsItem fieldsItem = fieldsList.isEmpty() ? null : fieldsList.get(0); |
| | | if (Objects.nonNull(fieldsItem)) { |
| | | throw new CoolException("票号:" + fieldsItem.getValue() + "已在收货区,不可推送相当票号数据。请联系管理员!!"); |
| | | } |
| | | } |
| | | } |
| | | // 同票号 fields_index 可能对应多条 ASN 明细(不同 plat_item),不得在此处整段 return;否则仅第一条写入收货区,其余数量丢失。合并逻辑见下方 queryWrapper。 |
| | | LambdaQueryWrapper<WarehouseAreasItem> queryWrapper = new LambdaQueryWrapper<WarehouseAreasItem>() |
| | | .eq(WarehouseAreasItem::getMatnrCode, orderItem.getMatnrCode()) |
| | | .eq(!Cools.isEmpty(orderItem.getFieldsIndex()), WarehouseAreasItem::getFieldsIndex, orderItem.getFieldsIndex()) |