package com.diagbot.web;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.diagbot.annotation.SysLogger;
import com.diagbot.dto.QcCasesAllDTO;
import com.diagbot.dto.QcCasesEntryFindDTO;
import com.diagbot.dto.QcCasesEntryHospitalDTO;
import com.diagbot.dto.RespDTO;
import com.diagbot.facade.QcCasesEntryHospitalFacade;
import com.diagbot.vo.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
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 javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.util.List;

/**
 * <p>
 * 病历条目 前端控制器
 * </p>
 *
 * @author wangfeng
 * @time: 2024-04-13
 */

@RestController
@RequestMapping("/qc/casesEntryHospital")
@SuppressWarnings("unchecked")
@Api(value = "条目数据维护API", tags = { "条目数据维护API-wf" })
public class QcCasesEntryHospitalController {
    @Autowired
    private QcCasesEntryHospitalFacade qcCasesEntryHospitalFacade;

    @ApiOperation(value = "分页获取医院条目数据信息[by:wangfeng]",
            notes = "hospitalId：医院id 必传</br>casesName:类别名称</br>name：条目名" +
                    "isReject：单项否决 1-单项否决 0-非</br>isUsed：是否启用 0-未启用 1-启用")
    @PostMapping("/getQcCasesEntryAll")
    @SysLogger("getQcCasesEntryAll")
    public RespDTO<IPage<List<QcCasesEntryHospitalDTO>>> QcCasesEntryHospital(@RequestBody @Valid QcCasesEntryHospitalVO qcCasesEntryHospitalVO) {
        return RespDTO.onSuc(qcCasesEntryHospitalFacade.QcCasesEntryHospitals(qcCasesEntryHospitalVO));
    }
    @ApiOperation(value = "修改医院条目数据信息[by:wangfeng]",
            notes = "hospitalId：医院id 必传</br>casesName:类别名称</br>name：条目名" +
                    "isReject：单项否决 1-单项否决 0-非</br>isUsed：是否启用 0-未启用 1-启用")
    @PostMapping("/updataQcCasesEntry")
    @SysLogger("updataQcCasesEntry")
    @Transactional
    public RespDTO<Boolean> updataQcCasesEntry(@RequestBody @Valid QcCasesEntryUpdataVO qcCasesEntryUpdataVO) {
        return RespDTO.onSuc(qcCasesEntryHospitalFacade.updataQcCasesEntrys(qcCasesEntryUpdataVO));
    }

    @ApiOperation(value = "获取医院模块数据列表[by:wangfeng]",
            notes = "")
    @PostMapping("/getQcCasesAll")
    @SysLogger("getQcCasesAll")
    public RespDTO<List<QcCasesAllDTO>> getQcCasesAlls(@RequestBody @Valid QcCasesEntryVO qcCasesEntryVO) {
        return RespDTO.onSuc(qcCasesEntryHospitalFacade.getQcCasesAlls(qcCasesEntryVO));
    }

    @ApiOperation(value = "模糊查询医院模块条目列表[by:wangfeng]",
            notes = " modeId;//模块 必传</br>identryName;//条目名；</br>behospitalCode;//病人住院ID 必传</br>")
    @PostMapping("/findQcCasesEntry")
    @SysLogger("findQcCasesEntry")
    public RespDTO<List<QcCasesEntryFindDTO>> findQcCasesEntryAll(@RequestBody @Valid QcCasesEntryFindVO qcCasesEntryFindVO) {
        return RespDTO.onSuc(qcCasesEntryHospitalFacade.findQcCasesEntryAlls(qcCasesEntryFindVO));
    }

}
