|  |  |  | 
|---|
|  |  |  | package com.vincent.rsf.server.api.controller; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | 
|---|
|  |  |  | import com.vincent.rsf.framework.common.R; | 
|---|
|  |  |  | import com.vincent.rsf.framework.exception.CoolException; | 
|---|
|  |  |  | import com.vincent.rsf.server.api.controller.params.CheckObjParams; | 
|---|
|  |  |  | import com.vincent.rsf.server.api.controller.params.OtherReceiptParams; | 
|---|
|  |  |  | import com.vincent.rsf.server.api.controller.params.ReceiptParams; | 
|---|
|  |  |  | import com.vincent.rsf.server.api.controller.params.*; | 
|---|
|  |  |  | import com.vincent.rsf.server.api.service.MobileService; | 
|---|
|  |  |  | import com.vincent.rsf.server.manager.controller.params.WaitPakinParam; | 
|---|
|  |  |  | import com.vincent.rsf.server.manager.entity.AsnOrderItem; | 
|---|
|  |  |  | import com.vincent.rsf.server.manager.entity.QlyIsptItem; | 
|---|
|  |  |  | import com.vincent.rsf.server.system.controller.BaseController; | 
|---|
|  |  |  | import com.vincent.rsf.server.system.controller.param.LoginParam; | 
|---|
|  |  |  | 
|---|
|  |  |  | import org.springframework.web.bind.annotation.*; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import javax.servlet.http.HttpServletRequest; | 
|---|
|  |  |  | import java.util.List; | 
|---|
|  |  |  | import java.util.Map; | 
|---|
|  |  |  | import java.util.Objects; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | 
|---|
|  |  |  | @PreAuthorize("hasAuthority('manager:warehouseAreas:save')") | 
|---|
|  |  |  | @PostMapping("/orders/confirm") | 
|---|
|  |  |  | @ApiOperation("确认收货") | 
|---|
|  |  |  | public R confirmReceipt(@RequestBody ReceiptParams params) { | 
|---|
|  |  |  | public R confirmReceipt(@RequestBody Map<String, Object> params) { | 
|---|
|  |  |  | if (Objects.isNull(params)) { | 
|---|
|  |  |  | throw new CoolException("请求参数不能为空!!"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return mobileService.receiptToWarehouse(params); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @PreAuthorize("hasAuthority('manager:asnOrder:list')") | 
|---|
|  |  |  | @PostMapping("/orders/other") | 
|---|
|  |  |  | 
|---|
|  |  |  | return mobileService.getDeltByCode(code); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @PreAuthorize("hasAuthority('manager:asnOrderItem:list')") | 
|---|
|  |  |  | @ApiOperation("获取拖盘明细") | 
|---|
|  |  |  | @PostMapping("/asnOrderItem/container") | 
|---|
|  |  |  | public R getItemByContainer(@RequestBody Map<String, Object> params) { | 
|---|
|  |  |  | if (Objects.isNull(params)) { | 
|---|
|  |  |  | return R.error("参数不能为空!!"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return mobileService.getItemByContainer(params); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @PreAuthorize("hasAuthority('manager:waitPakin:update')") | 
|---|
|  |  |  | @ApiOperation("组拖") | 
|---|
|  |  |  | @PostMapping("/waitPakin/merge") | 
|---|
|  |  |  | public R pikinOrder(@RequestBody WaitPakinParam waitPakin) { | 
|---|
|  |  |  | Long userId = getLoginUserId(); | 
|---|
|  |  |  | if (Objects.isNull(waitPakin)) { | 
|---|
|  |  |  | return R.error("参数不能为空!!"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | if (Objects.isNull(waitPakin.getItems()) || waitPakin.getItems().isEmpty()) { | 
|---|
|  |  |  | return R.error("跟踪码不能为空!!"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return R.ok(mobileService.mergeItems(waitPakin)); | 
|---|
|  |  |  | return R.ok(mobileService.mergeItems(waitPakin, userId)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @PreAuthorize("hasAuthority('manager:waitPakin:update')") | 
|---|
|  |  |  | 
|---|
|  |  |  | return  mobileService.confirmIspt(id); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("快速质检信息") | 
|---|
|  |  |  | @PreAuthorize("hasAuthority('manager:qlyInspect:list')") | 
|---|
|  |  |  | @PostMapping("/inspect/query") | 
|---|
|  |  |  | public R checkObjs(@RequestBody CheckObjParams params) { | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("快速质检") | 
|---|
|  |  |  | @PreAuthorize("hasAuthority('manager:qlyInspect:update')") | 
|---|
|  |  |  | @PostMapping("/inspect/check/update") | 
|---|
|  |  |  | public R checkUpdate(@RequestBody QlyIsptItem params) { | 
|---|
|  |  |  | if (Objects.isNull(params)) { | 
|---|
|  |  |  | throw new CoolException("参数不能为空!!"); | 
|---|
|  |  |  | public R checkUpdate(@RequestBody List<QlyIsptItem> params) { | 
|---|
|  |  |  | if (Objects.isNull(params) || params.isEmpty()) { | 
|---|
|  |  |  | return R.error("参数不能为空!!"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return mobileService.checkUpdate(params); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("获取上架信息") | 
|---|
|  |  |  | @PreAuthorize("hasAuthority('manager:qlyInspect:list')") | 
|---|
|  |  |  | @PostMapping("/stock/operate/list") | 
|---|
|  |  |  | public R operateToStock(@RequestBody OpStockParams params) { | 
|---|
|  |  |  | if (Objects.isNull(params)) { | 
|---|
|  |  |  | return R.error("参数不能为空!!"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return mobileService.operateToStock(params); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("人工上架") | 
|---|
|  |  |  | @PreAuthorize("hasAuthority('manager:qlyInspect:update')") | 
|---|
|  |  |  | @PostMapping("/stock/operate") | 
|---|
|  |  |  | public R publicToStock(@RequestBody PublicToStockParams params) { | 
|---|
|  |  |  | if (Objects.isNull(params)) { | 
|---|
|  |  |  | return R.error("参数不能为空!!"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 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)) { | 
|---|
|  |  |  | return R.error("参数不能为空!!"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return mobileService.taskToStock(code); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("任务上架") | 
|---|
|  |  |  | @PreAuthorize("hasAuthority('manager:qlyInspect:update')") | 
|---|
|  |  |  | @PostMapping("/task/public/{code}") | 
|---|
|  |  |  | public R taskToLocs(@PathVariable String code) throws Exception { | 
|---|
|  |  |  | if (Objects.isNull(code)) { | 
|---|
|  |  |  | return R.error("参数不能为空!!"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return mobileService.taskGetLocs(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); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("获取订单不良物料") | 
|---|
|  |  |  | @PostMapping("/defect/{trackCode}") | 
|---|
|  |  |  | @PreAuthorize("hasAuthority('manager:asnOrder:list')") | 
|---|
|  |  |  | public R defectProducts(@PathVariable String trackCode) { | 
|---|
|  |  |  | if (Objects.isNull(trackCode)) { | 
|---|
|  |  |  | return R.error("参数不能为空!!"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return mobileService.defectProducts(trackCode); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|