| | |
| | | }; |
| | | |
| | | React.useEffect(() => { |
| | | if (record?.areaIds && record.areaIds.length > 0) { |
| | | if (record?.areaIds && record.areaIds.length !== 0 && record.areaIds.length > 0) { |
| | | fetchAreaNames(); |
| | | } |
| | | }, [record]); |
| | | }, [record]); |
| | | |
| | | if (loading) { |
| | | return <CircularProgress size={20} />; |
| | |
| | | if (Cools.isEmpty(param.getLocType1())){ |
| | | return R.error("高低检测信号不能为空"); |
| | | } |
| | | InTaskMsgDto msgDto = wcsService.createInTask(param,getLoginUserId()); |
| | | InTaskMsgDto msgDto = wcsService.createInTask(param); |
| | | return R.ok(msgDto); |
| | | |
| | | |
| | |
| | | if (Cools.isEmpty(param.getBarcode())) { |
| | | return R.error("条码不能为空"); |
| | | } |
| | | if (param.getIoType().equals(TaskType.TASK_TYPE_AGV_IN.type)) { |
| | | if (!param.getIoType().equals(TaskType.TASK_TYPE_IN.type)) { |
| | | return R.error("入库类型有误"); |
| | | } |
| | | wcsService.agvTaskPickUpComplete(param); |
| | |
| | | private Integer sourceStaNo; //作业站点 or 来源站点 |
| | | private String barcode; //容器条码 |
| | | private Integer locType1; //库位类型 |
| | | private Long user; |
| | | // private Integer locType2; //库位类型 |
| | | // private Integer locType3; //库位类型 |
| | | } |
| | |
| | | import com.vincent.rsf.server.api.controller.params.TaskInParam; |
| | | |
| | | public interface WcsService { |
| | | InTaskMsgDto createInTask(TaskInParam param, Long loginUserId); |
| | | InTaskMsgDto createInTask(TaskInParam param); |
| | | |
| | | void agvTaskPickUpComplete(TaskInParam param); |
| | | } |
| | |
| | | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R AGVInTaskStart(Map<String, Object> params,Long loginUserId ) { |
| | | String sta = params.get("sta").toString(); |
| | | String area = params.get("area").toString(); |
| | |
| | | |
| | | taskService.generateAGVTasks(waitPakin,targetLoc,sta,loginUserId); |
| | | |
| | | basStation.setUseStatus(StaUseStatusType.TYPE_R.type); |
| | | if (!basStationService.updateById(basStation)){ |
| | | throw new CoolException("更新站点状态失败"); |
| | | } |
| | | |
| | | |
| | | |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | // List<Short> asList = Arrays.asList(Short.valueOf(PakinIOStatus.PAKIN_IO_STATUS_DONE.val), Short.valueOf(PakinIOStatus.PAKIN_IO_STATUS_DONE.val)); |
| | | |
| | | WaitPakin waitPakin = waitPakinService.getOne(new LambdaQueryWrapper<WaitPakin>() |
| | | .eq(!Cools.isEmpty(params.get("barcode")),WaitPakin::getBarcode, params.get("barcode").toString()) |
| | | .eq(!Cools.isEmpty(params.get("code")),WaitPakin::getCode, params.get("code").toString()) |
| | | .eq(!Cools.isEmpty(params.get("barcode")),WaitPakin::getBarcode, params.get("barcode")) |
| | | .eq(!Cools.isEmpty(params.get("code")),WaitPakin::getCode, params.get("code")) |
| | | .eq(WaitPakin::getIoStatus, PakinIOStatus.PAKIN_IO_STATUS_DONE.val)); |
| | | if (Objects.isNull(waitPakin)) { |
| | | return R.error("未找到该容器码的组托明细,请检查组托状态"); |
| | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public InTaskMsgDto createInTask(TaskInParam param, Long loginUserId) { |
| | | public InTaskMsgDto createInTask(TaskInParam param) { |
| | | // 获取库位号 |
| | | InTaskMsgDto locNo = getLocNo(param); |
| | | |
| | |
| | | |
| | | // 创建并保存任务 |
| | | Task task = createTask(ruleCode, locNo.getLocNo(), waitPakin.getBarcode(), |
| | | deviceSite.getDeviceSite(), param.getSourceStaNo().toString(), loginUserId); |
| | | deviceSite.getDeviceSite(), param.getSourceStaNo().toString(), param.getUser()); |
| | | |
| | | // 更新库位状态 |
| | | updateLocStatus(task.getTargLoc(), waitPakin.getBarcode()); |
| | |
| | | List<WaitPakinItem> waitPakinItems = getWaitPakinItems(waitPakin.getId()); |
| | | |
| | | // 创建并保存任务明细 |
| | | saveTaskItems(task.getId(), waitPakinItems, loginUserId); |
| | | saveTaskItems(task.getId(), waitPakinItems, param.getUser()); |
| | | |
| | | // 更新组托状态 |
| | | updateWaitPakinStatus(param.getBarcode(), loginUserId); |
| | | updateWaitPakinStatus(param.getBarcode(), param.getUser()); |
| | | |
| | | // 设置工作单号并返回 |
| | | locNo.setWorkNo(ruleCode); |
| | |
| | | PageParam<BasStation, BaseParam> pageParam = new PageParam<>(baseParam, BasStation.class); |
| | | PageParam<BasStation, BaseParam> page = basStationService.page(pageParam, pageParam.buildWrapper(true)); |
| | | for (BasStation station : page.getRecords()) { |
| | | String content = station.getCrossZoneArea().substring(1, station.getCrossZoneArea().length() - 1); |
| | | String[] parts = content.split(","); |
| | | Long[] longArray = new Long[parts.length]; |
| | | for (int i = 0; i < parts.length; i++) { |
| | | longArray[i] = Long.parseLong(parts[i].trim()); |
| | | if (!Cools.isEmpty(station.getCrossZoneArea())) { |
| | | String content = station.getCrossZoneArea().substring(1, station.getCrossZoneArea().length() - 1); |
| | | String[] parts = content.split(","); |
| | | Long[] longArray = new Long[parts.length]; |
| | | for (int i = 0; i < parts.length; i++) { |
| | | longArray[i] = Long.parseLong(parts[i].trim()); |
| | | } |
| | | station.setAreaIds(longArray); |
| | | } |
| | | station.setAreaIds(longArray); |
| | | |
| | | } |
| | | return R.ok().add(page); |
| | | } |
| | |
| | | if (!Cools.isEmpty(serviceOne)) { |
| | | return R.error(basStation.getStationName()+"站已被初始化"); |
| | | } |
| | | if (null !=basStation.getAreaIds()){ |
| | | basStation.setCrossZoneArea(Arrays.toString(basStation.getAreaIds())); |
| | | } |
| | | if (!basStationService.save(basStation)) { |
| | | return R.error("保存失败"); |
| | | } |
| | |
| | | import com.vincent.rsf.framework.common.Cools; |
| | | import com.vincent.rsf.framework.common.R; |
| | | import com.vincent.rsf.framework.exception.CoolException; |
| | | import com.vincent.rsf.server.manager.enums.TaskStsType; |
| | | import com.vincent.rsf.server.manager.entity.*; |
| | | import com.vincent.rsf.server.manager.enums.*; |
| | | import com.vincent.rsf.server.common.utils.ExcelUtil; |
| | | import com.vincent.rsf.server.common.annotation.OperationLog; |
| | | import com.vincent.rsf.server.common.domain.BaseParam; |
| | | import com.vincent.rsf.server.common.domain.KeyValVo; |
| | | import com.vincent.rsf.server.common.domain.PageParam; |
| | | import com.vincent.rsf.server.manager.entity.Loc; |
| | | import com.vincent.rsf.server.manager.entity.Task; |
| | | import com.vincent.rsf.server.manager.entity.TaskItem; |
| | | import com.vincent.rsf.server.manager.entity.WaitPakin; |
| | | import com.vincent.rsf.server.manager.enums.PakinIOStatus; |
| | | import com.vincent.rsf.server.manager.service.LocService; |
| | | import com.vincent.rsf.server.manager.service.TaskItemService; |
| | | import com.vincent.rsf.server.manager.service.TaskService; |
| | | import com.vincent.rsf.server.manager.service.WaitPakinService; |
| | | import com.vincent.rsf.server.manager.service.*; |
| | | import com.vincent.rsf.server.manager.service.impl.BasStationServiceImpl; |
| | | import com.vincent.rsf.server.system.controller.BaseController; |
| | | import com.vincent.rsf.server.system.enums.LocStsType; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | |
| | | @Autowired |
| | | private LocService locService; |
| | | @Autowired |
| | | private BasStationService basStationService; |
| | | |
| | | @PreAuthorize("hasAuthority('manager:task:list')") |
| | | @PostMapping("/task/page") |
| | |
| | | if (null != waitPakin) { |
| | | waitPakin.setIoStatus(Short.valueOf(PakinIOStatus.PAKIN_IO_STATUS_DONE.val)); |
| | | if (!waitPakinService.updateById(waitPakin)) { |
| | | return R.error("更新组托状态失败"); |
| | | throw new CoolException("更新组托状态失败!!"); |
| | | |
| | | } |
| | | } |
| | | Loc loc = locService.getOne(new LambdaQueryWrapper<Loc>() |
| | |
| | | |
| | | loc.setUseStatus(LocStsType.LOC_STS_TYPE_O.type); |
| | | if (!locService.updateById(loc)) { |
| | | return R.error("更新库位状态失败"); |
| | | throw new CoolException("更新库位状态失败!!"); |
| | | } |
| | | } |
| | | if (task.getWarehType().equals(WarehType.WAREHOUSE_TYPE_AGV.id)){ |
| | | BasStation basStation = null; |
| | | if (task.getTaskType().equals(TaskType.TASK_TYPE_IN.type) |
| | | || task.getTaskType().equals(TaskType.TASK_TYPE_EMPITY_IN.type) |
| | | ){ |
| | | basStation = basStationService.getOne(new LambdaQueryWrapper<BasStation>() |
| | | .eq(BasStation::getStationName, task.getOrgSite()) |
| | | .eq(BasStation::getUseStatus, StaUseStatusType.TYPE_R.type) |
| | | ); |
| | | |
| | | |
| | | } else if (task.getTaskType().equals(TaskType.TASK_TYPE_OUT.type) |
| | | || task.getTaskType().equals(TaskType.TASK_TYPE_PICK_AGAIN_IN.type) |
| | | || task.getTaskType().equals(TaskType.TASK_TYPE_MERGE_OUT.type) |
| | | || task.getTaskType().equals(TaskType.TASK_TYPE_CHECK_OUT.type) |
| | | || task.getTaskType().equals(TaskType.TASK_TYPE_EMPITY_OUT.type) |
| | | ) { |
| | | basStation = basStationService.getOne(new LambdaQueryWrapper<BasStation>() |
| | | .eq(BasStation::getStationName, task.getTargLoc()) |
| | | .eq(BasStation::getUseStatus, StaUseStatusType.TYPE_R.type) |
| | | ); |
| | | } |
| | | if (null == basStation) { |
| | | throw new CoolException("站点状态错误!!"); |
| | | } |
| | | basStation.setUseStatus(StaUseStatusType.TYPE_F.type); |
| | | if (!basStationService.updateById(basStation)){ |
| | | throw new CoolException("更新站点状态失败!!"); |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | if (!taskService.removeByIds(Arrays.asList(ids))) { |
| | | return R.error("Delete Fail"); |
| | |
| | | //订单类型 |
| | | TYPE_O("O", "空闲"), |
| | | TYPE_F("F", "占用"), |
| | | TYPE_S("S", "预约入站"), |
| | | TYPE_R("R", "预约出站"), |
| | | TYPE_X("X", "禁用"), |
| | | |
| | | ; |
| | |
| | | public enum TaskType { |
| | | |
| | | TASK_TYPE_IN("1", "入库"), |
| | | TASK_TYPE_FLAT_WAREHOUSE_IN("2", "平库上架"), |
| | | TASK_TYPE_AGV_IN("3", "AGV入库"), |
| | | TASK_TYPE_EMPITY_IN("10", "空板入库"), |
| | | TASK_TYPE_LOC_MOVE("11", "库格移载"), |
| | | TASK_TYPE_PICK_IN("53", "拣料再入库"), |
| | | TASK_TYPE_MERGE_IN("54", "并板再入库"), |
| | | TASK_TYPE_CHECK_IN("57", "盘点再入库"), |
| | | TASK_TYPE_OUT("101", "出库"), |
| | | TASK_TYPE_PICK_AGAIN_IN("103", "拣料入库"), |
| | | TASK_TYPE_PICK_AGAIN_IN("103", "拣料出库"), |
| | | TASK_TYPE_MERGE_OUT("104", "并板出库"), |
| | | TASK_TYPE_CHECK_OUT("107", "盘点出库"), |
| | | TASK_TYPE_EMPITY_OUT("110", "空板出库"), |
| | |
| | | * @time 2025/4/2 12:37 |
| | | */ |
| | | // @Scheduled(cron = "0 0/05 * * * ? ") |
| | | @Scheduled(cron = "0/15 * * * * ?") |
| | | @Scheduled(cron = "0/3 * * * * ?") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void completeInStock() throws Exception { |
| | | List<Task> tasks = taskService.list(new LambdaQueryWrapper<Task>().eq(Task::getTaskStatus, TaskStsType.COMPLETE_IN.id)); |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.vincent.rsf.framework.common.Cools; |
| | | import com.vincent.rsf.server.manager.enums.OrderType; |
| | | import com.vincent.rsf.server.manager.enums.TaskStsType; |
| | | import com.vincent.rsf.server.manager.enums.*; |
| | | import com.vincent.rsf.framework.common.R; |
| | | import com.vincent.rsf.framework.exception.CoolException; |
| | | import com.vincent.rsf.server.manager.enums.TaskType; |
| | | import com.vincent.rsf.server.api.utils.LocUtils; |
| | | import com.vincent.rsf.server.manager.controller.params.GenerateTaskParams; |
| | | import com.vincent.rsf.server.manager.entity.*; |
| | | import com.vincent.rsf.server.manager.enums.PakinIOStatus; |
| | | import com.vincent.rsf.server.manager.mapper.TaskMapper; |
| | | import com.vincent.rsf.server.manager.service.*; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | |
| | | Task task = new Task(); |
| | | task.setTaskCode(ruleCode) |
| | | .setTaskStatus(TaskStsType.GENERATE_IN.id.shortValue()) |
| | | .setTaskType(TaskType.TASK_TYPE_AGV_IN.type.shortValue()) |
| | | .setTaskType(TaskType.TASK_TYPE_IN.type.shortValue()) |
| | | .setWarehType(WarehType.WAREHOUSE_TYPE_AGV.id) |
| | | .setTargLoc(targetLoc) |
| | | .setOrgSite(orgSta) |
| | | .setBarcode(pakin.getBarcode()) |
| | |
| | | Task task = new Task(); |
| | | task.setTaskCode(ruleCode) |
| | | .setTaskStatus(TaskStsType.COMPLETE_IN.id.shortValue()) |
| | | .setTaskType(TaskType.TASK_TYPE_FLAT_WAREHOUSE_IN.type.shortValue()) |
| | | .setTaskType(TaskType.TASK_TYPE_IN.type.shortValue()) |
| | | .setWarehType(WarehType.WAREHOUSE_TYPE_PLAT.id) |
| | | .setTargLoc(targetLoc) |
| | | .setBarcode(pakin.getBarcode()) |
| | | .setCreateBy(loginUserId) |