| | |
| | | import com.vincent.rsf.server.api.controller.erp.params.ManualShelvingParams; |
| | | import com.vincent.rsf.server.api.controller.erp.params.OpStockParams; |
| | | import com.vincent.rsf.server.api.controller.erp.params.OtherReceiptParams; |
| | | import com.vincent.rsf.server.api.service.AgvService; |
| | | import com.vincent.rsf.server.api.service.MobileService; |
| | | import com.vincent.rsf.server.manager.controller.params.WaitPakinParam; |
| | | import com.vincent.rsf.server.manager.entity.QlyIsptItem; |
| | |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.tika.utils.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.scheduling.annotation.Async; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | |
| | | private TaskService taskService; |
| | | @Autowired |
| | | private WaitPakinService waitPakinService; |
| | | @Autowired |
| | | private AgvService agvService; |
| | | |
| | | /** |
| | | * PDA用户登录 |
| | | * |
| | | * @param param |
| | | * @param request |
| | | * @return |
| | |
| | | return mobileService.login(param, request); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 标准扫码收货信息 |
| | | * |
| | | * @param trackCode |
| | | * @return |
| | | */ |
| | | @PreAuthorize("hasAuthority('manager:asnOrder:list')") |
| | | @GetMapping("/orders/{trackCode}") |
| | | @ApiOperation("标准扫码收货") |
| | | public R getOrderBybarcode(@PathVariable String trackCode) { |
| | | public R getOrderBybarcode(@PathVariable String trackCode) { |
| | | if (StringUtils.isEmpty(trackCode)) { |
| | | throw new CoolException("条码不能为空!!"); |
| | | } |
| | |
| | | |
| | | /** |
| | | * 确认收货信息 |
| | | * |
| | | * @param params |
| | | * @return |
| | | */ |
| | | @PreAuthorize("hasAuthority('manager:warehouseAreas:save')") |
| | | @PostMapping("/orders/confirm") |
| | | @ApiOperation("确认收货") |
| | | public R confirmReceipt(@RequestBody Map<String, Object> params) { |
| | | if (Objects.isNull(params)) { |
| | | throw new CoolException("请求参数不能为空!!"); |
| | | } |
| | | if (Objects.isNull(params)) { |
| | | throw new CoolException("请求参数不能为空!!"); |
| | | } |
| | | return mobileService.receiptToWarehouse(params, getLoginUserId()); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:asnOrder:list')") |
| | | @PostMapping("/orders/other") |
| | | @ApiOperation("其它扫码收货") |
| | | public R getOtherReceipt(@RequestBody OtherReceiptParams params) { |
| | |
| | | return mobileService.otherReceipt(params); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:warehouseAreas:list')") |
| | | @ApiOperation("获取收货区") |
| | | @GetMapping("/areas/receipt") |
| | | public R getReceiptAreas() { |
| | | return mobileService.getReceiptAreas(getLoginUser()); |
| | | } |
| | | |
| | | @ApiOperation("获取可用库区") |
| | | @GetMapping("/areas/user/all") |
| | | public R getAreasUserAll() { |
| | | return mobileService.getAreasUserAll(getLoginUser()); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:asnOrder:list')") |
| | | @GetMapping("/orders/asn") |
| | | @ApiOperation("获取通知单") |
| | | public R getAllAsnOrders() { |
| | | return R.ok(mobileService.getAllAsnOrders()); |
| | | } |
| | | |
| | | |
| | | @PreAuthorize("hasAuthority('manager:asnOrder:list')") |
| | | @GetMapping("/dynamic/fields") |
| | | @ApiOperation("获取动态字段") |
| | | public R getDynamicFields() { |
| | | return R.ok(mobileService.getDynamicFields()); |
| | | } |
| | | |
| | | |
| | | @PreAuthorize("hasAuthority('manager:asnOrderItem:list')") |
| | | @ApiOperation("获取订单物料明细") |
| | | @PostMapping("/asnOrderItem/trackCode") |
| | | public R getItemByTrackCode(@RequestBody Map<String, Object> params) { |
| | |
| | | return mobileService.getDeltByCode(params); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:asnOrderItem:list')") |
| | | @ApiOperation("获取拖盘明细") |
| | | @PostMapping("/asnOrderItem/container") |
| | | public R getItemByContainer(@RequestBody Map<String, Object> params) { |
| | |
| | | if (!Objects.isNull(params.get("type")) && params.get("type").equals("unbind")) { |
| | | return mobileService.getUnItemByContainer(params); |
| | | } else { |
| | | return mobileService.getItemByContainer(params); |
| | | return mobileService.getItemByContainer(params, getLoginUser()); |
| | | } |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:waitPakin:update')") |
| | | @ApiOperation("组托") |
| | | @PostMapping("/waitPakin/merge") |
| | | public R pikinOrder(@RequestBody WaitPakinParam waitPakin) { |
| | |
| | | if (Objects.isNull(waitPakin.getItems()) || waitPakin.getItems().isEmpty()) { |
| | | return R.error("跟踪码不能为空!!"); |
| | | } |
| | | // return R.ok(mobileService.mergeItems(waitPakin, userId)); |
| | | try{ |
| | | mobileService.mergeItems(waitPakin, userId); |
| | | if (waitPakin.getAgvSign()==1) { |
| | | asyncProcessAfterValidation(waitPakin,userId); |
| | | } |
| | | } catch (Exception e){ |
| | | try { |
| | | mobileService.mergeItemsWcs(waitPakin, userId); |
| | | } catch (Exception e) { |
| | | return R.error(e.getMessage()); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | @Async |
| | | public void asyncProcessAfterValidation(WaitPakinParam waitPakinPda,Long userId) { |
| | | try { |
| | | Thread.sleep(500); |
| | | WaitPakin waitPakin = waitPakinService.getOne(new LambdaQueryWrapper<WaitPakin>().eq(WaitPakin::getBarcode, waitPakinPda.getBarcode())); |
| | | taskService.generateFlatWarehouseTasks(waitPakin, waitPakinPda.getStaNo(), userId); |
| | | // mobileService.mergeItemsWcs(waitPakin,userId); |
| | | } catch (Exception e) { |
| | | // log.error("异步处理AGV后续逻辑失败", e); |
| | | } |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:waitPakin:update')") |
| | | @ApiOperation("组拖解绑") |
| | | @PostMapping("/waitPakin/unbind") |
| | | public R pakinUnBind(@RequestBody WaitPakinParam param) { |
| | |
| | | |
| | | @ApiOperation("报检") |
| | | @GetMapping("/asnOrder/inspect/{code}") |
| | | @PreAuthorize("hasAuthority('manager:waitPakin:list')") |
| | | |
| | | public R getAsnOdrers(@PathVariable String code) { |
| | | if (Objects.isNull(code)) { |
| | | throw new CoolException("参数不能为空!!"); |
| | |
| | | |
| | | @ApiOperation("提交报检") |
| | | @GetMapping("/inspect/confirm/{id}") |
| | | @PreAuthorize("hasAuthority('manager:waitPakin:list')") |
| | | |
| | | public R confirmInspect(@PathVariable String id) { |
| | | if (Objects.isNull(id)) { |
| | | throw new CoolException("参数不能为空!"); |
| | | } |
| | | return mobileService.confirmIspt(id); |
| | | return mobileService.confirmIspt(id); |
| | | } |
| | | |
| | | @ApiOperation("快速质检信息") |
| | | @PreAuthorize("hasAuthority('manager:qlyInspect:list')") |
| | | // @PostMapping("/inspect/query") |
| | | |
| | | // @PostMapping("/inspect/query") |
| | | public R checkObjs(@RequestBody CheckObjParams params) { |
| | | if (Objects.isNull(params)) { |
| | | return R.error("参数不能为空!!"); |
| | |
| | | return mobileService.checkObjs(params); |
| | | } |
| | | |
| | | |
| | | @ApiOperation("快速质检") |
| | | @PreAuthorize("hasAuthority('manager:qlyInspect:update')") |
| | | |
| | | @PostMapping("/inspect/check/update") |
| | | public R checkUpdate(@RequestBody List<QlyIsptItem> params) { |
| | | if (Objects.isNull(params) || params.isEmpty()) { |
| | |
| | | } |
| | | |
| | | @ApiOperation("获取上架信息") |
| | | @PreAuthorize("hasAuthority('manager:qlyInspect:list')") |
| | | |
| | | @PostMapping("/stock/operate/list") |
| | | public R operateToStock(@RequestBody OpStockParams params) { |
| | | if (Objects.isNull(params)) { |
| | |
| | | } |
| | | |
| | | @ApiOperation("人工上架") |
| | | @PreAuthorize("hasAuthority('manager:qlyInspect:update')") |
| | | |
| | | @PostMapping("/stock/operate") |
| | | public R publicToStock(@RequestBody ManualShelvingParams params) { |
| | | if (Cools.isEmpty(params.getItemList()) || Cools.isEmpty(params.getLocCode()) || Cools.isEmpty(params.getBarcode())) { |
| | | if (Cools.isEmpty(params.getItemList()) || Cools.isEmpty(params.getLocCode()) |
| | | || Cools.isEmpty(params.getBarcode())) { |
| | | return R.error("参数不能为空!!"); |
| | | } |
| | | WaitPakin waitPakin = waitPakinService.getOne(new LambdaQueryWrapper<WaitPakin>().eq(WaitPakin::getBarcode, params.getBarcode())); |
| | | |
| | | WaitPakin waitPakin = waitPakinService |
| | | .getOne(new LambdaQueryWrapper<WaitPakin>().eq(WaitPakin::getBarcode, params.getBarcode())); |
| | | |
| | | return taskService.generateFlatWarehouseTasks(waitPakin, params.getLocCode(), getLoginUserId()); |
| | | // return mobileService.publicToStock(params, getLoginUserId()); |
| | | // return mobileService.publicToStock(params, getLoginUserId()); |
| | | } |
| | | |
| | | @ApiOperation("获取任务信息") |
| | | @PreAuthorize("hasAuthority('manager:qlyInspect:list')") |
| | | |
| | | @PostMapping("/task/stock/{code}") |
| | | public R taskToStock(@PathVariable String code) { |
| | | if (Objects.isNull(code)) { |
| | |
| | | } |
| | | |
| | | @ApiOperation("任务上架") |
| | | @PreAuthorize("hasAuthority('manager:qlyInspect:update')") |
| | | |
| | | @PostMapping("/task/public/{code}") |
| | | public R taskToLocs(@PathVariable String code) throws Exception { |
| | | if (Objects.isNull(code)) { |
| | |
| | | |
| | | @ApiOperation("一键收货") |
| | | @PostMapping("/complete/{id}") |
| | | @PreAuthorize("hasAuthority('manager:asnOrder:update')") |
| | | |
| | | public R completeOrder(@PathVariable Long id) { |
| | | if (Objects.isNull(id)) { |
| | | return R.error("参数不能为空!!"); |
| | |
| | | return mobileService.completeOrder(id, getLoginUserId()); |
| | | } |
| | | |
| | | |
| | | @ApiOperation("获取不良托盘物料") |
| | | @PostMapping("/defect/matnrs") |
| | | @PreAuthorize("hasAuthority('manager:asnOrder:list')") |
| | | |
| | | public R getAsnDefectItemByCode(@RequestBody Map<String, Object> map) { |
| | | if (Objects.isNull(map)) { |
| | | return R.error("参数不能为空!!"); |
| | | } |
| | | return mobileService.getItemByContainer(map); |
| | | return mobileService.getItemByContainer(map, getLoginUser()); |
| | | } |
| | | |
| | | @ApiOperation("获取订单不良物料") |
| | | @PostMapping("/defect/{trackCode}") |
| | | @PreAuthorize("hasAuthority('manager:asnOrder:list')") |
| | | |
| | | public R defectProducts(@PathVariable String trackCode) { |
| | | if (Objects.isNull(trackCode)) { |
| | | return R.error("参数不能为空!!"); |
| | |
| | | |
| | | @ApiOperation("获取组拖入库信息") |
| | | @PostMapping("/pakin/info/{barcode}") |
| | | @PreAuthorize("hasAuthority('manager:waitPakin:list')") |
| | | |
| | | public R getPakinInStock(@PathVariable String barcode) { |
| | | if (Objects.isNull(barcode)) { |
| | | return R.error("参数不能为空!!"); |
| | |
| | | |
| | | @ApiOperation("获取上架站点信息") |
| | | @GetMapping("/inStock/sites") |
| | | @PreAuthorize("hasAuthority('manager:deviceSite:list')") |
| | | |
| | | public R getTarSite() { |
| | | return mobileService.getDeviceSites(); |
| | | } |
| | | |
| | | @ApiOperation("获取推荐库位列表信息") |
| | | @GetMapping("/locs/list") |
| | | @PreAuthorize("hasAuthority('manager:deviceSite:list')") |
| | | |
| | | public R getLocs() { |
| | | return mobileService.getRecommondLocs(); |
| | | } |
| | | |
| | | @ApiOperation("生成任务列表") |
| | | @PostMapping("/pakin/task") |
| | | @PreAuthorize("hasAuthority('manager:deviceSite:list')") |
| | | |
| | | public R pakinToTask(@RequestBody Map<String, Object> map) { |
| | | if (Objects.isNull(map)) { |
| | | return R.error("参数不能为空!!"); |
| | |
| | | return mobileService.generateTask(map, getLoginUserId()); |
| | | } |
| | | } |
| | | |