package thyyxxk.webserver.controller.datamodify;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import thyyxxk.webserver.entity.ResultVo;
import thyyxxk.webserver.entity.datamodify.GetDropdownBox;
import thyyxxk.webserver.entity.datamodify.InOrOutOfWarehousePojo;
import thyyxxk.webserver.entity.datamodify.YpInDetl;
import thyyxxk.webserver.entity.datamodify.YpOutDetl;
import thyyxxk.webserver.service.datamodify.InOrOutOfWarehouseService;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 描述： 药品入库或出库查询
 * </p>
 *
 * @author xc
 * @date 2021-06-01 14:05
 */
@RestController
@RequestMapping("/inOrOutOfWarehouse")
public class InOrOutOfWarehouseController {
    private final InOrOutOfWarehouseService service;

    @Autowired
    public InOrOutOfWarehouseController(InOrOutOfWarehouseService service) {
        this.service = service;
    }

    @PostMapping("/queryRuKuXinXi")
    public ResultVo<Map<String, Object>> queryRuKuXinXi(@RequestBody InOrOutOfWarehousePojo param) {
        return service.queryRuKuXinXi(param);
    }

    @GetMapping("/queryCode")
    public ResultVo<List<GetDropdownBox>> queryCode(@RequestParam("pyCode") String pyCode,
                                                    @RequestParam("flag") Integer flag) {
        return service.queryCode(pyCode, flag);
    }

    @PostMapping("/xiuGaiRuKuXinXi")
    public ResultVo<String> xiuGiRuKuXinXi(@RequestBody YpInDetl param) {
        return service.xiuGiRuKuXinXi(param);
    }

    @PostMapping("/queryChuKuXinXi")
    public ResultVo<Map<String, Object>> queryChuKuXinXi(@RequestBody InOrOutOfWarehousePojo param) {
        return service.queryChuKuXinXi(param);
    }

    @GetMapping("/queryDeptCode")
    public ResultVo<Map<String, Object>> queryDeptCode() {
        return service.queryDeptCode();
    }

    @PostMapping("/xiuGaiChuKuXinXi")
    public ResultVo<String> xiuGaiChuKuXinXi(@RequestBody YpOutDetl param) {
        return service.xiuGaiChuKuXinXi(param);
    }

    @GetMapping("/shanChuChuKuXinXi")
    public ResultVo<String> shanChuChuKuXinXi(@RequestParam("drawNo") String drawNo,
                                              @RequestParam("chargeCode") String chargeCode,
                                              @RequestParam("outSeri") Integer outSeri,
                                              @RequestParam("inDrawNo") String inDrawNo) {
        return service.shanChuChuKuXinXi(drawNo, chargeCode, outSeri, inDrawNo);
    }
}
