package com.vincent.rsf.server.api.controller;
|
|
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.service.MobileService;
|
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.ApiOperation;
|
import org.apache.tika.utils.StringUtils;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.web.bind.annotation.*;
|
|
import javax.servlet.http.HttpServletRequest;
|
import java.util.List;
|
import java.util.Objects;
|
|
/**
|
* @author Ryan
|
* @version 1.0
|
* @title MobileController
|
* @description
|
* @create 2025/3/10 08:05
|
*/
|
@Api(tags = "PDA操作接口")
|
@RequestMapping("/pda")
|
@RestController
|
public class MobileController extends BaseController {
|
|
@Autowired
|
private MobileService mobileService;
|
|
|
@PostMapping("/login")
|
@ApiOperation("PDA用户登录")
|
public R login(@RequestBody LoginParam param, HttpServletRequest request) {
|
if (Objects.isNull(param)) {
|
throw new CoolException("登录信息不能为空!!");
|
}
|
if (Objects.isNull(param.getUsername())) {
|
throw new CoolException("用户名不能为空!!");
|
}
|
if (Objects.isNull(param.getPassword())) {
|
throw new CoolException("密码不能为空!!");
|
}
|
|
return mobileService.login(param, request);
|
}
|
|
|
@PreAuthorize("hasAuthority('manager:asnOrder:list')")
|
@GetMapping("/orders/{barcode}")
|
@ApiOperation("标准扫码收货")
|
public R getOrderBybarcode(@PathVariable String barcode) {
|
if (StringUtils.isEmpty(barcode)) {
|
throw new CoolException("条码不能为空!!");
|
}
|
return mobileService.getOrderByCode(barcode);
|
}
|
|
@PreAuthorize("hasAuthority('manager:warehouseAreas:save')")
|
@PostMapping("/orders/confirm")
|
@ApiOperation("确认收货")
|
public R confirmReceipt(@RequestBody ReceiptParams params) {
|
if (Objects.isNull(params)) {
|
throw new CoolException("请求参数不能为空!!");
|
}
|
return mobileService.receiptToWarehouse(params);
|
}
|
|
|
|
}
|