package thyyxxk.webserver.controller.zhuyuanyizheng;

import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import thyyxxk.webserver.config.auth.PassToken;
import thyyxxk.webserver.entity.ResultVo;
import thyyxxk.webserver.entity.datamodify.GetDropdownBox;
import thyyxxk.webserver.entity.datamodify.SelectValueObject;
import thyyxxk.webserver.entity.zhuyuanyisheng.jianyanjiancha.*;
import thyyxxk.webserver.entity.zhuyuanyisheng.query.ChaXunJianChaHeJianYan;
import thyyxxk.webserver.service.zhuyuanyisheng.JianYanJianChaShenQingServer;

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

/**
 * <p>
 * 描述： 检查申请控制器
 * </p>
 *
 * @author xc
 * @date 2022-02-11 09:09
 */
@RequestMapping("/jianYanJianChaShenQing")
@RestController
public class JianYanJianChaController {
    private final JianYanJianChaShenQingServer server;

    public JianYanJianChaController(JianYanJianChaShenQingServer server) {
        this.server = server;
    }

    @GetMapping("/huoQuJianYanJianChaMing")
    public ResultVo<List<Map<String, String>>> huoQuJianYanJianChaMing(@RequestParam("name") String name,
                                                                       @RequestParam("patNo") String patNo,
                                                                       @RequestParam("times") Integer times,
                                                                       @RequestParam("bedNo") String bedNo,
                                                                       @RequestParam("reqType") String reqType) {
        return server.huoQuJianYanJianChaMing(name, patNo, times, bedNo, reqType);
    }

    @PostMapping("/huoQuJianChaShenQing")
    public ResultVo<IPage<YshYjReq>> huoQuJianChaShenQing(@RequestBody @Validated ChaXunJianChaHeJianYan param) {
        return server.huoQuJianChaShenQing(param);
    }

    @GetMapping("/huoQuShengQingXiangQing")
    public ResultVo<Map<String, Object>> huoQuShengQingXiangQing(@RequestParam("reqNo") Integer reqNo) {
        return server.huoQuShengQingXiangQing(reqNo);
    }

    @GetMapping("/jianChaJianYanFenLei")
    public ResultVo<IPage<JcZdClass>> jianChaJianYanFenLei(@RequestParam("total") long total,
                                                           @RequestParam("currentPage") long currentPage,
                                                           @RequestParam("leiXing") Integer leiXing,
                                                           @RequestParam("jianCha") Boolean jianCha) {
        return server.jianChaJianYanFenLei(total, currentPage, leiXing, jianCha);
    }

    @GetMapping("/chaKanFenLeiXiangQing")
    public ResultVo<List<Map<String, String>>> chaKanFenLeiXiangQing(@RequestParam("code") String code,
                                                                     @RequestParam("bwCode") String bwCode,
                                                                     @RequestParam("jianCha") Boolean jianCha) {
        return server.chaKanFenLeiXiangQing(code, bwCode, jianCha);
    }

    @GetMapping("/shanShuJianChaMuBan")
    public ResultVo<String> shanShuJianChaMuBan(@RequestParam("code") String code,
                                                @RequestParam("deptCode") String deptCode) {
        return server.shanShuJianChaMuBan(code, deptCode);
    }

    @GetMapping("/huoMuShuoMingMuBan")
    public ResultVo<IPage<YshZdYjTemplate>> huoMuShuoMingMuBan(@RequestParam("name") String name,
                                                               @RequestParam("fenLei") Integer fenLei,
                                                               @RequestParam("total") long total,
                                                               @RequestParam("currentPage") long currentPage) {
        return server.huoMuShuoMingMuBan(name, fenLei, total, currentPage);
    }

    @PostMapping("/shouMingMuBanChaoZuo")
    public ResultVo<String> shouMingMuBanChaoZuo(@RequestBody YshZdYjTemplate param) {
        return server.shouMingMuBanChaoZuo(param);
    }

    @GetMapping("/huoQuLingChuangZhenDuan")
    public ResultVo<List<GetDropdownBox>> huoQuLingChuangZhenDuan(@RequestParam("name") String name,
                                                                     @RequestParam("laiYuan") Boolean laiYuan) {
        return server.huoQuLinChuangZhenDuan(name, laiYuan);
    }

    @GetMapping("/jianChaJianYanMuBanMing")
    public ResultVo<Boolean> jianChaJianYanMuBanMing(@RequestParam("name") String name,
                                                     @RequestParam("reqType") String reqType) {
        return server.jianChaJianYanMuBanMing(name, reqType);
    }

    @PostMapping("/baoCunJianChaJianYanMuBan")
    public ResultVo<String> baoCunJianChaJianYanMuBan(@RequestBody ZyTcYj param) {
        return server.baoCunJianChaJianYanMuBan(param);
    }

    @PostMapping("/baoCunJianYanJianCha")
    public ResultVo<String> baoCunJianYanJianCha(@RequestBody @Validated TianJiaJianChaJianYan param) {
        return server.baoCunJianYanJianCha(param);
    }

    @PostMapping("/huoQuJianYan")
    public ResultVo<IPage<YshYjReq>> huoQuJianYan(@RequestBody @Validated ChaXunJianChaHeJianYan param) {
        return server.huoQuJianYan(param);
    }

    @GetMapping("/jianYanFenLei")
    public ResultVo<IPage<JcZdClass>> huoQuJianYanMing(@RequestParam("total") long total,
                                                       @RequestParam("currentPage") long currentPage,
                                                       @RequestParam("leiXing") Integer leiXing) {
        return server.huoQuJianYanMing(total, currentPage, leiXing);
    }

    @GetMapping("/biaoBenShuJu")
    public ResultVo<List<GetDropdownBox>> biaoBenShuJu(@RequestParam("name") String name) {
        return server.biaoBenShuJu(name);
    }

    @GetMapping("/viewInspectionItemDetails")
    public ResultVo<List<JianYanFeiYongXiangQing>> viewInspectionItemDetails(@RequestParam("orderCode") String orderCode) {
        return server.viewInspectionItemDetails(orderCode);
    }

    @GetMapping("/shanChuJianChaJianYan")
    public ResultVo<String> shanChuJianChaJianYan(@RequestParam("reqNo") Integer reqNo,
                                                  @RequestParam("patNo") String patNo,
                                                  @RequestParam("times") Integer times) {
        return server.shanChuJianChaJianYan(reqNo, patNo, times);
    }

}
