| | |
| | | import com.zy.asrs.entity.*; |
| | | import com.zy.asrs.enums.LocStsType; |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.asrs.service.impl.BasStationServiceImpl; |
| | | import com.zy.asrs.service.impl.LocCacheServiceImpl; |
| | | import com.zy.asrs.service.impl.OrderPakinServiceImpl; |
| | | import com.zy.asrs.service.impl.TaskDetlServiceImpl; |
| | | import com.zy.asrs.service.impl.*; |
| | | import com.zy.asrs.task.AbstractHandler; |
| | | import com.zy.asrs.task.core.ReturnT; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | private CheckOrderDetlService checkOrderDetlService; |
| | | @Autowired |
| | | private WaitPakinLogService waitPakinLogService; |
| | | @Autowired |
| | | private BasStationDetlService basStationDetlService; |
| | | |
| | | public ReturnT<String> start(WrkMast wrkMast) { |
| | | // 4.入库完成 |
| | |
| | | * @description: AGV出库任务 |
| | | * @version 1.0 |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public ReturnT<String> agvDoOut(Task task) { |
| | | if (task.getIoType().equals(101)) { |
| | | Date now = new Date(); |
| | |
| | | return FAIL.setMsg( |
| | | "全板出库 ===>> 工作明细档为空; [workNo=" + task.getWrkNo() + "],[locNo=" + task.getSourceLocNo() + "]"); |
| | | } |
| | | |
| | | BasStation devNo = basStationService |
| | | .selectOne(new EntityWrapper<BasStation>().eq("dev_no", task.getStaNo())); |
| | | if (Objects.isNull(devNo)) { |
| | | throw new CoolException("站点:" + task.getSourceStaNo() + ", 不存在!!"); |
| | | } |
| | | devNo.setLocSts(LocStsType.LOC_STS_TYPE_F.type); |
| | | devNo.setModiTime(new Date()); |
| | | if (!basStationService.updateById(devNo)) { |
| | | throw new CoolException("站点信息修改失败!!"); |
| | | } |
| | | |
| | | for (TaskDetl wrkDetl : wrkDetls101) { |
| | | // 更新订单完成数量 |
| | | OrderDetlPakout orderDetlPakout = orderDetlPakoutService.selectItem(wrkDetl.getOrderNo(), |
| | |
| | | } |
| | | } |
| | | } catch (Exception ignore) { |
| | | |
| | | } |
| | | |
| | | List<BasStationDetl> detls = basStationDetlService.selectList(new EntityWrapper<BasStationDetl>().eq("dev_no", devNo.getDevNo())); |
| | | if (!Objects.isNull(detls) || !detls.isEmpty()) { |
| | | basStationDetlService.delete(new EntityWrapper<BasStationDetl>().eq("dev_no", devNo.getDevNo())); |
| | | } |
| | | |
| | | BasStationDetl stationDetl = new BasStationDetl(); |
| | | BeanUtils.copyProperties(wrkDetl, stationDetl); |
| | | stationDetl.setDevNo(devNo.getDevNo()) |
| | | .setOrderNo(wrkDetl.getOrderNo()); |
| | | if (!basStationDetlService.insert(stationDetl)) { |
| | | throw new CoolException("站点明细保存失败!!"); |
| | | } |
| | | } |
| | | // 删除工作档源库位的库存明细 |
| | |
| | | throw new CoolException("当前库位状态" + locMast.getLocSts() + ", 无法执行出库操作!!"); |
| | | } |
| | | |
| | | BasStation devNo = basStationService |
| | | .selectOne(new EntityWrapper<BasStation>().eq("dev_no", task.getStaNo())); |
| | | if (Objects.isNull(devNo)) { |
| | | throw new CoolException("站点:" + task.getSourceStaNo() + ", 不存在!!"); |
| | | } |
| | | devNo.setLocSts(LocStsType.LOC_STS_TYPE_F.type); |
| | | devNo.setModiTime(new Date()); |
| | | if (!basStationService.updateById(devNo)) { |
| | | throw new CoolException("站点信息修改失败!!"); |
| | | } |
| | | |
| | | |
| | | task.setWrkSts(15L); |
| | | if (!taskService.updateById(task)) { |
| | | throw new CoolException("任务状态修改失败!!"); |