package thyyxxk.webserver.controller.reports;

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.querydata.QueryDrugsAndProjects;
import thyyxxk.webserver.entity.reports.illegalchargesanalysis.IllegalChargeData;
import thyyxxk.webserver.entity.reports.illegalchargesanalysis.IllegalChargeTemplate;
import thyyxxk.webserver.service.reports.QueryDrugsAndProjectsService;

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

/**
 * <p>
 * 描述 查询项目 和 药品收费
 * </p>
 *
 * @author xc
 * @date 2021-04-16 16:00
 */
@RestController
@RequestMapping("/queryDrugsAndProjects")
public class QueryDrugsAndProjectsController {
    private final QueryDrugsAndProjectsService service;

    @Autowired
    public QueryDrugsAndProjectsController(QueryDrugsAndProjectsService service) {
        this.service = service;
    }


    @GetMapping("/getSelect")
    public ResultVo<Map<String, List<GetDropdownBox>>> getSelect() {
        return service.getSelect();
    }

    @PostMapping("/queryProjects")
    public ResultVo<List<QueryDrugsAndProjects>> queryProjects(@RequestBody QueryDrugsAndProjects param) {
        return service.queryProjects(param);
    }

    @PostMapping("/queryDrugs")
    public ResultVo<List<QueryDrugsAndProjects>> queryDrugs(@RequestBody QueryDrugsAndProjects param) {
        return service.queryDrugs(param);
    }

    @PostMapping("/chaKanXiangQing")
    public ResultVo<List<QueryDrugsAndProjects>> chaKanXiangQing(@RequestBody QueryDrugsAndProjects param) {
        return service.chaKanXiangQing(param);
    }

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

    @PostMapping("/chaXunJianYanJianCha")
    public ResultVo<List<IllegalChargeData>> chaXunJianYanJianCha(@RequestBody IllegalChargeTemplate param) {
        return service.chaXunJianYanJianCha(param);
    }

}
