package com.shkj.wms.controller.temp;


import com.shkj.common.annotation.Log;
import com.shkj.common.annotation.RepeatSubmit;
import com.shkj.common.core.controller.BaseController;
import com.shkj.common.core.domain.Result;
import com.shkj.common.enums.BusinessType;
import com.shkj.wms.bo.BusinPickupAddBo;
import com.shkj.wms.bo.BusinPickupQueryBo;
import com.shkj.wms.service.IBusinPickupService;
import com.shkj.wms.vo.BusinPickupVo;
import io.swagger.annotations.Api;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.validation.Valid;
import java.util.List;

@Api("取货相关")
@RequiredArgsConstructor(onConstructor_ =@Autowired)
@RestController
@RequestMapping("/wms/pickup")
public class BusinPickupController extends BaseController {

    @Resource
    IBusinPickupService iBusinPickupService;


    @Log(title = "App取货查询",businessType = BusinessType.UPDATE)
    @GetMapping("/getBusinPickupList")
    @RepeatSubmit
    public Result<BusinPickupVo> getBusinPickupList(BusinPickupQueryBo bo) {

        List<BusinPickupVo> businPickupList = iBusinPickupService.getBusinPickupList(bo);
        return Result.ok().data(businPickupList);

    }


    @Log(title = "App取货-确认取货",businessType = BusinessType.UPDATE)
    @PostMapping("/saveBusinPickupRecord")
    @RepeatSubmit
    public Result<Boolean> saveBusinPickupRecord(@Valid @RequestBody BusinPickupAddBo bo) {
        return iBusinPickupService.saveBusinPickupRecord(bo);
    }
}
