|  |  |  | 
|---|
|  |  |  | 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.OtherReceiptParams; | 
|---|
|  |  |  | import com.vincent.rsf.server.api.controller.params.ReceiptParams; | 
|---|
|  |  |  | import com.vincent.rsf.server.api.entity.dto.ReceiptDetlsDto; | 
|---|
|  |  |  | 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.system.controller.BaseController; | 
|---|
|  |  |  | import com.vincent.rsf.server.system.controller.param.LoginParam; | 
|---|
|  |  |  | import io.swagger.annotations.Api; | 
|---|
|  |  |  | import io.swagger.annotations.ApiModel; | 
|---|
|  |  |  | import io.swagger.annotations.ApiOperation; | 
|---|
|  |  |  | import org.apache.tika.utils.StringUtils; | 
|---|
|  |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
|---|
|  |  |  | 
|---|
|  |  |  | import org.springframework.web.bind.annotation.*; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import javax.servlet.http.HttpServletRequest; | 
|---|
|  |  |  | import java.util.List; | 
|---|
|  |  |  | import java.util.Objects; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private MobileService mobileService; | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * PDA用户登录 | 
|---|
|  |  |  | * @param param | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 标准扫码收货信息 | 
|---|
|  |  |  | * @param barcode | 
|---|
|  |  |  | * @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:warehouseAreasItem:save')") | 
|---|
|  |  |  | @PreAuthorize("hasAuthority('manager:warehouseAreas:save')") | 
|---|
|  |  |  | @PostMapping("/orders/confirm") | 
|---|
|  |  |  | @ApiOperation("确认收货") | 
|---|
|  |  |  | public R confirmReceipt(@RequestBody ReceiptParams params) { | 
|---|
|  |  |  | 
|---|
|  |  |  | if (Objects.isNull(params)) { | 
|---|
|  |  |  | throw new CoolException("参数不能为空!!"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | return mobileService.otherReceipt(params); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @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)); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|