package com.prolog.cs.biz.outbound.controller;

import com.prolog.cs.biz.outbound.model.dto.check.LclDTO;
import com.prolog.cs.biz.outbound.model.vo.LcLSecondVO;
import com.prolog.cs.biz.outbound.service.LclService;
import com.prolog.framework.common.message.RestMessage;
import com.prolog.framework.log.aop.annotation.UserLog;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

@Api(tags = "二次拼箱")
@RestController
@RequestMapping("/lcl")
public class LclController {

    @Autowired
    private LclService lclService;


    @UserLog
    @ApiOperation(value = "拼箱查询")
    @PostMapping("/query")
    public RestMessage<List<LcLSecondVO>> query(@RequestBody LclDTO lclDTO) {
        return RestMessage.doSuccess(lclService.query(lclDTO));
    }

/*
    @UserLog
    @ApiOperation(value = "拼箱合并")
    @PostMapping("/merge/query")
    public RestMessage<List<LcLSecondVO>> queryForMerge(@RequestBody  LclDTO lclDTO) {
        return RestMessage.doSuccess(lclService.queryForMerge(billMergeDTO));
    }
*/

    @UserLog
    @ApiOperation(value = "合单")
    @PostMapping("/merge")
    public RestMessage<String> merge(@RequestBody List<String> barcodeIds) {
        return lclService.merge(barcodeIds);
    }
}
