| | |
| | | |
| | | import com.vincent.rsf.framework.common.R; |
| | | import com.vincent.rsf.framework.exception.CoolException; |
| | | import com.vincent.rsf.server.api.controller.params.ReceiptParams; |
| | | import com.vincent.rsf.server.api.entity.dto.ReceiptDetlsDto; |
| | | 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.QlyIsptItem; |
| | | import com.vincent.rsf.server.system.controller.BaseController; |
| | | import com.vincent.rsf.server.system.controller.param.LoginParam; |
| | | import io.swagger.annotations.Api; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | |
| | | |
| | | @Autowired |
| | | private MobileService mobileService; |
| | | |
| | | |
| | | /** |
| | | * PDA用户登录 |
| | | * @param param |
| | | * @param request |
| | | * @return |
| | | */ |
| | | @PostMapping("/login") |
| | | @ApiOperation("PDA用户登录") |
| | | public R login(@RequestBody LoginParam param, HttpServletRequest request) { |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 标准扫码收货信息 |
| | | * @param trackCode |
| | | * @return |
| | | */ |
| | | @PreAuthorize("hasAuthority('manager:asnOrder:list')") |
| | | @GetMapping("/orders/{barcode}") |
| | | @GetMapping("/orders/{trackCode}") |
| | | @ApiOperation("标准扫码收货") |
| | | public R getOrderBybarcode(@PathVariable String barcode) { |
| | | if (StringUtils.isEmpty(barcode)) { |
| | | public R getOrderBybarcode(@PathVariable String trackCode) { |
| | | if (StringUtils.isEmpty(trackCode)) { |
| | | throw new CoolException("条码不能为空!!"); |
| | | } |
| | | return mobileService.getOrderByCode(barcode); |
| | | return mobileService.getOrderByCode(trackCode); |
| | | } |
| | | |
| | | /** |
| | | * 确认收货信息 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | @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") |
| | | @ApiOperation("其它扫码收货") |
| | | public R getOtherReceipt(@RequestBody OtherReceiptParams params) { |
| | | if (Objects.isNull(params)) { |
| | | throw new CoolException("参数不能为空!!"); |
| | | } |
| | | return mobileService.otherReceipt(params); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:warehouseAreas:list')") |
| | | @ApiOperation("获取收货区") |
| | | @GetMapping("/areas/receipt") |
| | | public R getReceiptAreas() { |
| | | return mobileService.getReceiptAreas(); |
| | | } |
| | | |
| | | |
| | | @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("获取订单物料明细") |
| | | @GetMapping("/asnOrderItem/trackCode/{code}") |
| | | public R getItemByTrackCode(@PathVariable String code) { |
| | | if (StringUtils.isBlank(code)) { |
| | | return R.error("编码不能为空!!"); |
| | | } |
| | | return mobileService.getDeltByCode(code); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:waitPakin:update')") |
| | | @ApiOperation("组拖") |
| | | @PostMapping("/waitPakin/merge") |
| | | public R pikinOrder(@RequestBody WaitPakinParam waitPakin) { |
| | | if (Objects.isNull(waitPakin)) { |
| | | return R.error("参数不能为空!!"); |
| | | } |
| | | if (org.apache.commons.lang3.StringUtils.isBlank(waitPakin.getBarcode())) { |
| | | return R.error("托盘码不能为空!!"); |
| | | } |
| | | if (Objects.isNull(waitPakin.getItems()) || waitPakin.getItems().isEmpty()) { |
| | | return R.error("跟踪码不能为空!!"); |
| | | } |
| | | return R.ok(mobileService.mergeItems(waitPakin)); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:waitPakin:update')") |
| | | @ApiOperation("组拖解绑") |
| | | @PostMapping("/waitPakin/unbind") |
| | | public R pakinUnBind(@RequestBody WaitPakinParam param) { |
| | | if (Objects.isNull(param)) { |
| | | return R.error("参数不能为空!!"); |
| | | } |
| | | if (org.apache.commons.lang3.StringUtils.isBlank(param.getBarcode())) { |
| | | return R.error("托盘码不能为空!!"); |
| | | } |
| | | if (Objects.isNull(param.getItems()) || param.getItems().isEmpty()) { |
| | | return R.error("跟踪码不能为空!!"); |
| | | } |
| | | return R.ok(mobileService.unBind(param)); |
| | | } |
| | | |
| | | @ApiOperation("报检") |
| | | @GetMapping("/asnOrder/inspect/{code}") |
| | | @PreAuthorize("hasAuthority('manager:waitPakin:list')") |
| | | public R getAsnOdrers(@PathVariable String code) { |
| | | if (Objects.isNull(code)) { |
| | | throw new CoolException("参数不能为空!!"); |
| | | } |
| | | return mobileService.inspect(code, getLoginUserId()); |
| | | } |
| | | |
| | | @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); |
| | | } |
| | | |
| | | @ApiOperation("快速质检信息") |
| | | @PreAuthorize("hasAuthority('manager:qlyInspect:list')") |
| | | @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 QlyIsptItem params) { |
| | | if (Objects.isNull(params)) { |
| | | 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()); |
| | | } |
| | | |
| | | } |