| | |
| | | return mobileService.OutCallAgv(params, getUserId()); |
| | | } |
| | | |
| | | /** |
| | | * 缓存区出库组托上架 |
| | | * @author Ryan |
| | | * @date 2025/12/8 13:45 |
| | | * @param params |
| | | * @return com.core.common.R |
| | | */ |
| | | @ManagerAuth |
| | | @ApiOperation("缓存出库上架") |
| | | @PostMapping("/commb/task/pub") |
| | | public R combPub(@RequestBody AgvCallParams params) { |
| | | if (Objects.isNull(params)) { |
| | | return R.error("参数不能为空!!"); |
| | | } |
| | | return mobileService.combOutPub(params); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 缓存区出库组托上架 |
| | | * @author Ryan |
| | | * @date 2025/12/8 13:45 |
| | | * @param params |
| | | * @return com.core.common.R |
| | | */ |
| | | @ManagerAuth |
| | | @ApiOperation("缓存出库列表") |
| | | @PostMapping("/cache/task/list") |
| | | public R combCacehList(@RequestBody AgvCallParams params) { |
| | | if (Objects.isNull(params)) { |
| | | return R.error("参数不能为空!!"); |
| | | } |
| | | return mobileService.combCacehList(params); |
| | | } |
| | | |
| | | |
| | | |
| | | // 组托 ---------------------------------------------------------------------------------------------------- |
| | | |
| | |
| | | @ApiModelProperty("托盘码") |
| | | private String barcode; |
| | | |
| | | @ApiModelProperty("BS编码") |
| | | private String bsCode; |
| | | |
| | | @ApiModelProperty("操作类型") |
| | | private String type; |
| | | |
| | |
| | | R callEmptyCar(AgvCallParams params, Long userId); |
| | | |
| | | R collectionInCall(AgvCallParams params, Long userId); |
| | | |
| | | |
| | | /** |
| | | * 缓存出库组托上架 |
| | | * @author Ryan |
| | | * @date 2025/12/8 13:46 |
| | | * @param params |
| | | * @return com.core.common.R |
| | | */ |
| | | R combOutPub(AgvCallParams params); |
| | | |
| | | /** |
| | | * 缓存出库组托列表 |
| | | * @author Ryan |
| | | * @date 2025/12/8 15:36 |
| | | * @param params |
| | | * @return com.core.common.R |
| | | */ |
| | | R combCacehList(AgvCallParams params); |
| | | } |
| | |
| | | /**生成缓存区出库任务*/ |
| | | generateCacheOutTask(station, locCaches, userId); |
| | | |
| | | // /**生成立库出库任务*/ |
| | | /**生成立库出库任务*/ |
| | | generateCRNOutTask(station, locCaches, userId); |
| | | |
| | | return R.ok(); |
| | |
| | | |
| | | List<LocCache> locCaches = locCacheService.selectList(new EntityWrapper<LocCache>() |
| | | .in("loc_sts", LocStsType.LOC_STS_TYPE_O.type, LocStsType.LOC_STS_TYPE_D.type) |
| | | .eq("area_id", basAreas.getId()) |
| | | ); |
| | | .eq("area_id", basAreas.getId())); |
| | | if (locCaches.isEmpty()) { |
| | | throw new CoolException("当前暂无空库位!!"); |
| | | } |
| | |
| | | } |
| | | |
| | | /** |
| | | * 缓存出库组托上架 |
| | | * @author Ryan |
| | | * @date 2025/12/8 13:47 |
| | | * @param params |
| | | * @return com.core.common.R |
| | | */ |
| | | @Override |
| | | public R combOutPub(AgvCallParams params) { |
| | | |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 缓存组托数据 |
| | | * @author Ryan |
| | | * @date 2025/12/8 15:37 |
| | | * @param params |
| | | * @return com.core.common.R |
| | | */ |
| | | @Override |
| | | public R combCacehList(AgvCallParams params) { |
| | | if (Objects.isNull(params.getBarcode())) { |
| | | throw new CoolException("托盘码不能为空!!"); |
| | | } |
| | | if (Objects.isNull(params.getBsCode())) { |
| | | throw new CoolException("BS码不能为空!!"); |
| | | } |
| | | Task task = taskService.selectOne(new EntityWrapper<Task>() |
| | | .eq("io_type", TaskIOType.PICK_OUT.type) |
| | | .eq("wrk_sts", 14) |
| | | .eq("barcode", params.getBarcode())); |
| | | if (Objects.isNull(task)) { |
| | | throw new CoolException("数据错误:任务信息存在!!"); |
| | | } |
| | | |
| | | List<TaskDetl> taskDetl = taskDetlService.selectList(new EntityWrapper<TaskDetl>() |
| | | .eq("three_code", params.getBsCode()) |
| | | .eq("zpallet", params.getBarcode())); |
| | | |
| | | if (Objects.isNull(taskDetl) || taskDetl.isEmpty()) { |
| | | throw new CoolException("当前BS编码不存在!!"); |
| | | } |
| | | |
| | | return R.ok().add(taskDetl); |
| | | } |
| | | |
| | | /** |
| | | * 生成立库出库任务 |
| | | * |
| | | * @param locCaches |
| | | * @author Ryan |
| | | * @date 2025/12/3 8:06 |
| | | * @param locCaches |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | |
| | | |
| | | /** |
| | | * 生成堆垛机出库任务 |
| | | * |
| | | * @param locMasts |
| | | * @author Ryan |
| | | * @date 2025/12/6 14:44 |
| | | * @param locMasts |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void generateOutTask(List<LocMast> locMasts, Integer ioType, BasDevp devp, Long userId) { |
| | |
| | | task.setWrkNo(workNo) |
| | | .setIoTime(new Date()) |
| | | .setWrkSts(11L) // 工作状态:11.生成出库ID |
| | | .setIoType(loc.getLocSts().equals("D") ? 110 : 101) // 入出库状态: 11.库格移载 |
| | | .setIoType(loc.getLocSts().equals("D") ? 110 : 103) // 入出库状态: 11.库格移载 |
| | | .setTaskType("agv") |
| | | .setIoPri(10D) |
| | | .setFullPlt(loc.getLocSts().equals("D") ? "N" : "Y") // 满板:Y |
| | |
| | | if (!taskService.insert(task)) { |
| | | throw new CoolException("保存工作档失败"); |
| | | } |
| | | List<LocDetl> detls = locDetlService.selectList(new EntityWrapper<LocDetl>().eq("loc_id", loc.getId())); |
| | | |
| | | List<LocDetl> detls = locDetlService.selectList(new EntityWrapper<LocDetl>() |
| | | .eq("loc_no", loc.getLocNo())); |
| | | if (!detls.isEmpty()) { |
| | | List<TaskDetl> taskDetls = new ArrayList<>(); |
| | | detls.forEach(pakin -> { |
| | |
| | | } |
| | | |
| | | // 修改目标站点信息 |
| | | if (station.getLocSts().equals("O")) { |
| | | station.setLocSts("S"); // S.入库预约 |
| | | if (station.getLocSts().equals(LocStsType.LOC_STS_TYPE_O.type)) { |
| | | station.setLocSts(LocStsType.LOC_STS_TYPE_S.type); // S.入库预约 |
| | | station.setModiTime(new Date()); |
| | | station.setModiUser(userId); |
| | | if (!basStationService.updateById(station)) { |
| | |
| | | throw new CoolException("保存工作档明细失败"); |
| | | } |
| | | |
| | | pakins.forEach(pakin -> {pakin.setIoStatus("Y");}); |
| | | pakins.forEach(pakin -> { |
| | | pakin.setIoStatus("Y"); |
| | | }); |
| | | |
| | | if (!waitPakinService.updateBatchById(pakins)) { |
| | | throw new CoolException("更新组托信息失败"); |
| | |
| | | import java.util.Collections; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.concurrent.TimeUnit; |
| | | |
| | | @Service("taskService") |
| | |
| | | private TaskDetlLogService taskDetlLogService; |
| | | @Autowired |
| | | private BasStationService basStationService; |
| | | @Autowired |
| | | private OrderDetlPakinService orderDetlService; |
| | | @Autowired |
| | | private OrderPakinService orderService; |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | |
| | | List<TaskDetl> wrkDetls = taskDetlService.selectList(new EntityWrapper<TaskDetl>().eq("wrk_no", wrkMast.getWrkNo())); |
| | | for (TaskDetl wrkDetl : wrkDetls) { |
| | | if (!Cools.isEmpty(wrkDetl.getOrderNo())) { |
| | | // if (!orderDetlService.decrease(wrkDetl.getOrderNo(), wrkDetl.getMatnr(), wrkDetl.getBatch(), wrkDetl.getAnfme())) { |
| | | // throw new CoolException("订单数据回滚失败"); |
| | | // } |
| | | OrderInAndOutUtil.decrease(Boolean.FALSE, wrkDetl.getOrderNo(), wrkDetl.getMatnr(), wrkDetl.getBatch(), wrkDetl.getBrand(), |
| | | wrkDetl.getStandby1(), wrkDetl.getStandby2(), wrkDetl.getStandby3(), |
| | | wrkDetl.getBoxType1(), wrkDetl.getBoxType2(), wrkDetl.getBoxType3(), wrkDetl.getAnfme()); |
| | | |
| | | //修改订单主表状态,没有作业数量时才可以修改 |
| | | boolean flag = true; |
| | | // List<OrderDetl> orderDetls = orderDetlService.selectList(new EntityWrapper<OrderDetl>().eq("order_no",wrkDetl.getOrderNo())); |
| | | Order order = OrderInAndOutUtil.selectByNo(Boolean.FALSE, wrkDetl.getOrderNo()); |
| | | List<OrderDetl> orderDetls = OrderInAndOutUtil.selectByOrderId(Boolean.FALSE, order.getId()); |
| | | for (OrderDetl orderDetl : orderDetls) { |
| | | OrderPakin order = orderService.selectByNo(wrkDetl.getOrderNo()); //OrderInAndOutUtil.selectByNo(Boolean.FALSE, wrkDetl.getOrderNo()); |
| | | if (Objects.isNull(order)) { |
| | | throw new CoolException("单据信息不存在!!"); |
| | | } |
| | | List<OrderDetlPakin> orderDetls = orderDetlService.selectByOrderId(order.getId()); //OrderInAndOutUtil.selectByOrderId(Boolean.FALSE, order.getId()); |
| | | for (OrderDetlPakin orderDetl : orderDetls) { |
| | | if (orderDetl.getWorkQty() > 0) { |
| | | flag = false; |
| | | } |
| | | } |
| | | if (flag) { |
| | | // Order order = orderService.selectOne(new EntityWrapper<Order>().eq("order_no",wrkDetl.getOrderNo())); |
| | | if (!Cools.isEmpty(order) && order.getSettle() == 2) { |
| | | order.setSettle(1L); |
| | | order.setUpdateBy(userId); |
| | | order.setUpdateTime(now); |
| | | } |
| | | // if(!orderService.update(order,new EntityWrapper<Order>().eq("order_no",wrkDetl.getOrderNo()))){ |
| | | // throw new CoolException("修改订单状态失败"); |
| | | // } |
| | | OrderInAndOutUtil.updateOrder(Boolean.FALSE, order.getId(), order.getSettle(), userId); |
| | | |
| | | orderService.updateById(order); |
| | | } |
| | | } |
| | | } |
| | |
| | | , {field: 'wrkSts$', align: 'center', title: '工作状态', width: 150} |
| | | , {field: 'ioType$', align: 'center', title: '入出库类型', width: 150} |
| | | , {field: 'ioPri', align: 'center', title: '优先级', width: 80} |
| | | , {field: 'taskType$', align: 'center', title: '任务类型'} |
| | | , {field: 'taskType$', align: 'center', title: '任务类型', width: 120} |
| | | , {field: 'crnNo$', align: 'center', title: '堆垛机', hide: true} |
| | | , {field: 'sourceStaNo$', align: 'center', title: '源站'} |
| | | , {field: 'staNo$', align: 'center', title: '目标站', width: 120} |
| | | , {field: 'sourceStaNo$', align: 'center', title: '源站', width: 120} |
| | | , {field: 'sourceLocNo', align: 'center', title: '源库位', width: 120} |
| | | , {field: 'staNo$', align: 'center', title: '目标站', width: 120} |
| | | , {field: 'locNo', align: 'center', title: '目标库位', width: 120} |
| | | , {field: 'barcode', align: 'center', title: '条码', width: 110} |
| | | , {field: 'preHave', align: 'center', title: '先入品', hide: true} |