| | |
| | | import com.zy.common.utils.HttpHandler; |
| | | import com.zy.system.entity.Config; |
| | | import com.zy.system.service.ConfigService; |
| | | import com.zy.system.service.impl.ConfigServiceImpl; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | throw new CoolException("请检查目标库位是否闲置中!!"); |
| | | } |
| | | |
| | | String taskType = "M2"; |
| | | if (!params.getIsNewIn().isEmpty()) { |
| | | taskType = "M1"; |
| | | } |
| | | try { |
| | | generateAgvTask("agv", locCache, params.getOrgSite(), params.getBarcode(), userId); |
| | | generateAgvTask("agv", locCache, params.getOrgSite(), params.getBarcode(), userId, taskType); |
| | | } catch (Exception e) { |
| | | throw new CoolException(e.getMessage()); |
| | | } |
| | |
| | | generateCacheOutTask(station, locCache, userId); |
| | | |
| | | /**生成立库出库任务*/ |
| | | generateCRNOutTask(station, locCache, userId); |
| | | // generateCRNOutTask(station, locCache, userId); |
| | | |
| | | return R.ok(); |
| | | } |
| | |
| | | Task task = new Task(); |
| | | task.setWrkNo(workNo) |
| | | .setIoTime(new Date()) |
| | | .setWrkSts(1L) // 工作状态:11.生成出库ID |
| | | .setWrkSts(201L) // 工作状态:11.生成入库库ID |
| | | .setIoType(1) // 入出库状态: 11.库格移载 |
| | | .setTaskType("agv") |
| | | .setIoPri(10D) |
| | |
| | | throw new CoolException("容器编码未维护,请维护后再操作!!"); |
| | | } |
| | | |
| | | Integer whsType = 1; |
| | | Integer whsType = 2; |
| | | Short lcoType = 1; |
| | | //用于判断料箱托盘,料箱,笼框 |
| | | if (container.getType().equals(ContainerType.CONTAINER_TYPE_SALVER.type)) { |
| | | whsType = 3; |
| | | } else if (container.getType().equals(ContainerType.CONTAINER_TYPE_CAGE.type)) { |
| | | if (!container.getType().equals(ContainerType.CONTAINER_TYPE_BOX.type)) { |
| | | whsType = 2; |
| | | if (container.getType().equals(ContainerType.CONTAINER_TYPE_SALVER.type)) { |
| | | lcoType = 2; |
| | | } |
| | | } |
| | | |
| | | WrkMast barcode = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("barcode", param.getBarcode())); |
| | |
| | | throw new CoolException("数据错误,组拖档已不存在!!"); |
| | | } |
| | | |
| | | WrkMast wrkMast = generateCrnInTask(waitPakins, whsType, station, param.getLocType1(), userId); |
| | | WrkMast wrkMast = generateCrnInTask(waitPakins, whsType, station, lcoType, userId); |
| | | |
| | | response.put("taskNo", wrkMast.getWrkNo()); |
| | | response.put("locNo", wrkMast.getLocNo()); |
| | |
| | | * @version 1.0 |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void generateAgvTask(String type, LocCache loc, String orgSite, String barcode, Long userId) { |
| | | public void generateAgvTask(String type, LocCache loc, String orgSite, String barcode, Long userId, String isNewIn) { |
| | | List<Task> tasks = taskService.selectList(new EntityWrapper<Task>().eq("barcode", barcode)); |
| | | if (!tasks.isEmpty()) { |
| | | throw new CoolException("托盘已在任务执行中.."); |
| | |
| | | .setIoType(1) // 入出库状态: 11.库格移载 |
| | | .setTaskType("agv") |
| | | .setIoPri(10D) |
| | | .setIsNewIn(isNewIn) |
| | | .setLocNo(loc.getLocNo()) // 目标库位 |
| | | .setFullPlt("Y") // 满板:Y |
| | | .setPicking("N") // 拣料 |
| | |
| | | |
| | | try { |
| | | //空台车回库 |
| | | generateAgvTask("agv_back", locCache, callAgvBackParam.getOrgSite(), station.getBarcode(), userId); |
| | | generateAgvTask("agv_back", locCache, callAgvBackParam.getOrgSite(), station.getBarcode(), userId, "M2"); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | return R.error(e.getMessage()); |
| | |
| | | } |
| | | |
| | | /** |
| | | * 获取缓存站点信息 |
| | | * @param type |
| | | * @return |
| | | */ |
| | | @Override |
| | | public R getCacheSites(String type) { |
| | | BasAreas areas = basAreasService.selectOne(new EntityWrapper<BasAreas>().eq("whs_type_id", type)); |
| | | if (Objects.isNull(areas)) { |
| | | return R.error("库区不存在!"); |
| | | } |
| | | List<BasStation> stations = basStationService.selectList(new EntityWrapper<BasStation>().eq("area_id", areas.getId())); |
| | | if (Objects.isNull(stations) || stations.isEmpty()) { |
| | | return R.error("站点不存在!"); |
| | | } |
| | | return R.ok("查询成功").add(stations); |
| | | } |
| | | |
| | | /** |
| | | * 生成移库任务 |
| | | * |
| | | * @param result |