| | |
| | | import com.vincent.rsf.server.manager.controller.params.LocToTaskParams; |
| | | import com.vincent.rsf.server.manager.entity.*; |
| | | import com.vincent.rsf.server.manager.enums.*; |
| | | import com.vincent.rsf.server.manager.mapper.AsnOrderMapper; |
| | | import com.vincent.rsf.server.manager.mapper.LocItemMapper; |
| | | import com.vincent.rsf.server.manager.mapper.TaskMapper; |
| | | import com.vincent.rsf.server.manager.mapper.WaveMapper; |
| | | import com.vincent.rsf.server.manager.service.*; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.vincent.rsf.server.system.constant.SerialRuleCode; |
| | |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.annotation.Lazy; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | |
| | | @Autowired |
| | | private LocService locService; |
| | | @Autowired |
| | | private TaskService taskService; |
| | | private TaskMapper taskMapper; |
| | | @Autowired |
| | | private TaskItemService taskItemService; |
| | | @Autowired |
| | | private LocItemService locItemService; |
| | | @Autowired |
| | | private DeviceSiteService deviceSiteService; |
| | | @Autowired |
| | | @Lazy |
| | | private WcsService wcsService; |
| | | @Autowired |
| | | private OutStockService outStockService; |
| | | private AsnOrderMapper asnOrderMapper; |
| | | @Autowired |
| | | private WaveService waveService; |
| | | private WaveMapper waveMapper; |
| | | @Autowired |
| | | private BasStationService basStationService; |
| | | @Autowired |
| | |
| | | throw new CoolException("空容器出库!!其他类型无效,进入类型:"+map.getType()); |
| | | } |
| | | |
| | | if (!taskService.save(task)) { |
| | | if (taskMapper.insert(task) <= 0) { |
| | | throw new CoolException("任务创建失败!!"); |
| | | } |
| | | } |
| | |
| | | if (!Objects.isNull(map.getSourceId())) { |
| | | if (map.getType().equals(Constants.TASK_TYPE_WAVE_OUT_STOCK)) { |
| | | order = new WkOrder(); |
| | | wave = waveService.getById(map.getSourceId()); |
| | | wave = waveMapper.selectById(map.getSourceId()); |
| | | } else { |
| | | wave = new Wave(); |
| | | order = outStockService.getById(map.getSourceId()); |
| | | order = asnOrderMapper.selectById(map.getSourceId()); |
| | | } |
| | | } else { |
| | | wave = new Wave(); |
| | |
| | | } |
| | | task.setTaskType(TaskType.TASK_TYPE_PICK_AGAIN_OUT.type).setWarehType(deviceSite.getDevice()); |
| | | } else { |
| | | if (resouce.equals(TaskResouceType.TASK_RESOUCE_STOCK_UP.val)){ |
| | | if (resouce.equals(TaskResouceType.TASK_RESOUCE_STOCK_NOT_OUT.val)){ |
| | | //全板出库 |
| | | DeviceSite deviceSite = deviceSiteService.getOne(new LambdaQueryWrapper<DeviceSite>() |
| | | .eq(DeviceSite::getSite, siteNo).eq(DeviceSite::getType, TaskType.TASK_TYPE_CROSS_DOCKING_OUT.type) |
| | |
| | | task.setTaskType(TaskType.TASK_TYPE_CHECK_OUT.type).setWarehType(deviceSite.getDevice()); |
| | | } |
| | | |
| | | if (!taskService.save(task)) { |
| | | if (taskMapper.insert(task) <= 0) { |
| | | throw new CoolException("任务创建失败!!"); |
| | | } |
| | | |
| | |
| | | |
| | | if (!Objects.isNull(moveTask.getId())) { |
| | | moveTask.setParentId(task.getId()).setSort(moveTask.getSort() + 1); |
| | | if (!taskService.saveOrUpdate(moveTask)) { |
| | | if ((Objects.isNull(moveTask.getId()) ? taskMapper.insert(moveTask) : taskMapper.updateById(moveTask)) <= 0) { |
| | | throw new CoolException("任务信息修改失败!!"); |
| | | } |
| | | task.setParentId(moveTask.getId()); |
| | | if (!taskService.updateById(task)) { |
| | | if (taskMapper.updateById(task) <= 0) { |
| | | throw new CoolException("主任务关联失败!!"); |
| | | } |
| | | } |
| | |
| | | taskItems.add(taskItem); |
| | | |
| | | Double qty = Math.round((item.getWorkQty() + item.getOutQty()) * 10000) / 10000.0; |
| | | LocItem locItem = locItemService.getById(item.getId()); |
| | | LocItem locItem = this.getById(item.getId()); |
| | | if (Objects.isNull(locItem)) { |
| | | throw new CoolException("库存信息不存在!"); |
| | | } |
| | |
| | | } |
| | | item.setUpdateBy(loginUserId).setUpdateTime(new Date()); |
| | | |
| | | if (!locItemService.updateById(item)) { |
| | | if (!this.updateById(item)) { |
| | | throw new CoolException("库存信息修改失败!!"); |
| | | } |
| | | |
| | |
| | | .setBarcode(orgLoc.getBarcode()) |
| | | .setMemo(map.getMemo()); |
| | | |
| | | if (!taskService.save(task)) { |
| | | if (taskMapper.insert(task) <= 0) { |
| | | throw new CoolException("新建移库任务失败!!"); |
| | | } |
| | | |
| | | List<LocItem> locItems = locItemService.list(new LambdaQueryWrapper<LocItem>().eq(LocItem::getLocId, orgLoc.getId())); |
| | | List<LocItem> locItems = this.list(new LambdaQueryWrapper<LocItem>().eq(LocItem::getLocId, orgLoc.getId())); |
| | | if (!locItems.isEmpty()) { |
| | | List<TaskItem> taskItems = new ArrayList<>(); |
| | | for (LocItem item : locItems) { |
| | |
| | | .eq(StringUtils.isNotBlank(matnr.getLocCode()), LocItem::getLocCode, matnr.getLocCode()) |
| | | // .eq(StringUtils.isNotBlank(matnr.getChannel()), LocItem::getChannel, matnr.getChannel()) |
| | | .in(!matnr.getMatnrCode().isEmpty(), LocItem::getMatnrCode, matnr.getMatnrCode()); |
| | | return this.baseMapper.listByMatnr(LocStsType.LOC_STS_TYPE_F.type, matnr.getChannel(), wrapper); |
| | | return this.baseMapper.listByMatnr(LocStsType.LOC_STS_TYPE_F.type, matnr.getChannel(), wrapper); |
| | | } |
| | | } |