| | |
| | | import com.core.common.R; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.entity.*; |
| | | import com.zy.asrs.enums.LocStsType; |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.asrs.service.impl.BasDeviceServiceImpl; |
| | | import com.zy.asrs.service.impl.LocAroundBindServiceImpl; |
| | |
| | | import com.zy.common.model.TaskDto; |
| | | import com.zy.common.web.BaseController; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | |
| | | if (issued <= 0.0D) { |
| | | continue; |
| | | } |
| | | if (Objects.isNull(orderDetl.getStandby1())) { |
| | | throw new CoolException("台机号不能为空!!"); |
| | | } |
| | | BasDevice basDevice = basDeviceService.selectOne(new EntityWrapper<BasDevice>().eq("dev_no", orderDetl.getStandby1())); |
| | | if (Objects.isNull(basDevice)) { |
| | | throw new CoolException("台机信息不存在!!"); |
| | | } |
| | | |
| | | List<LocAroundBind> binds = locAroundBindService.selectList(new EntityWrapper<LocAroundBind>().eq("dev_no", basDevice.getDevNo())); |
| | | if (Objects.isNull(binds) || binds.isEmpty()) { |
| | | throw new CoolException("台机未绑定工作站台!!"); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | List<LocDetl> locDetls = locDetlService.queryStockAll(null, exist,orderDetl.getMatnr(), orderDetl.getBatch(), |
| | | orderDetl.getBrand(),orderDetl.getStandby1(),orderDetl.getStandby2(),orderDetl.getStandby3(),orderDetl.getBoxType1(),orderDetl.getBoxType2(),orderDetl.getBoxType3()); |
| | | for (LocDetl locDetl : locDetls) { |
| | |
| | | List<Integer> staNos = staDescService.queryOutStaNosByLocNo(locDetl.getLocNo(), issued >= locDetl.getAnfme() ? 101 : 103); |
| | | locDto.setStaNos(staNos); |
| | | locDto.setBrand(orderDetl.getBrand()); |
| | | |
| | | locDto.setStandby1(orderDetl.getStandby1()); |
| | | locDto.setStandby2(orderDetl.getStandby2()); |
| | | locDto.setStandby3(orderDetl.getStandby3()); |
| | |
| | | |
| | | @PostMapping("/out/pakout/auth") |
| | | @ManagerAuth(memo = "订单出库") |
| | | @Transactional |
| | | public synchronized R pakout(@RequestBody List<LocDto> locDtos) throws InterruptedException { |
| | | if (Cools.isEmpty(locDtos)) { |
| | | return R.parse(BaseRes.PARAM); |
| | |
| | | // 根据 (库位 & 出库站) 分组; 理想状态:一组为一次出库任务 |
| | | for (LocDto locDto : locDtos) { |
| | | if (locDto.isLack()) { continue; } |
| | | TaskDto taskDto = new TaskDto(locDto.getLocNo(), locDto.getStaNo(), locDto); |
| | | TaskDto taskDto = new TaskDto(locDto.getLocNo(), locDto.getStaNo(), locDto, locDto.getStandby1()); |
| | | if (TaskDto.has(taskDtos, taskDto)) { |
| | | TaskDto dto = TaskDto.find(taskDtos, taskDto); |
| | | assert dto != null; |
| | |
| | | // ----------------------------------------------------------------------------------------------- |
| | | for (TaskDto taskDto : taskDtos) { |
| | | BasDevp staNo = basDevpService.checkSiteStatus(taskDto.getStaNo()); |
| | | workService.stockOut(staNo, taskDto, getUserId()); |
| | | if (!Objects.isNull(taskDto.getDeviceNo())) { |
| | | //生成出库任务 |
| | | workService.stockOut(staNo, taskDto, taskDto.getDeviceNo(), getUserId()); |
| | | //生成匹配的入库(出库)任务 |
| | | workService.genInStock(staNo, taskDto, taskDto.getDeviceNo(), getUserId()); |
| | | } else { |
| | | workService.stockOut(staNo, taskDto, null, getUserId()); |
| | | } |
| | | } |
| | | return R.ok(); |
| | | } |