| | |
| | | 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"); |