| | |
| | | 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()); |
| | | } |
| | |
| | | * @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 |