package thyyxxk.webserver.controller.medicaladvice.drugmanage;

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 thyyxxk.webserver.entity.ResultVo;
import thyyxxk.webserver.entity.medicaladvice.medicamanage.common.YzYpPageNo;
import thyyxxk.webserver.entity.medicaladvice.medicamanage.drugmanage.DrugSubmitParam;
import thyyxxk.webserver.service.medicaladvice.drugmanage.DrugSubmitService;
import thyyxxk.webserver.utils.ResultVoUtil;

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

/**
 * @Description:提交药品单
 * @Author:lihong
 * @Date: 2023/9/22
 */
@RestController
@RequestMapping("/medicalAdvice/drugSubmit")
public class DrugSubmitController {
    @Autowired
    private DrugSubmitService service;
    /**
     * @description:查询提交药单的所有数据
     * @author: lihong
     * @date: 2023/9/25 14:49
     **/
    @PostMapping("/queryDrugSubmitInfo")
    public ResultVo<Map<String,Object>> queryDrugSubmitInfo(@RequestBody DrugSubmitParam param){
       return ResultVoUtil.success(service.queryDrugSubmitInfo(param));
    }
    /**
     * @description:效验之前是否有未提交的药品单
     * @author: lihong
     * @date: 2023/9/27 17:25
     * @param: param
     * @return: thyyxxk.webserver.entity.ResultVo<java.util.Map<java.lang.String,java.lang.Object>>
     **/
    @PostMapping("/validBeforeDrug")
    public ResultVo<Map<String,Object>> validBeforeDrug(@RequestBody DrugSubmitParam param){
        return ResultVoUtil.success(service.validBeforeDrug(param));
    }
    /**
     * @description:提交药品单
     * @author: lihong
     * @date: 2023/9/27 17:26
     * @param: param
     * @return: thyyxxk.webserver.entity.ResultVo<java.util.Map<java.lang.String,java.lang.Object>>
     **/
    @PostMapping("/saveSubmitDrug")
    public ResultVo<Map<String,Object>> saveSubmitDrug(@RequestBody DrugSubmitParam param){
        return ResultVoUtil.success(service.saveSubmitDrug(param));
    }
    /**
     * @description:删除提交的药单信息
     * @author: lihong
     * @date: 2023/9/28 11:16
     * @param: param
     * @return: thyyxxk.webserver.entity.ResultVo<java.lang.String>
     **/
    @PostMapping("/delSubmitDrug")
    public ResultVo<String> delSubmitDrug(@RequestBody DrugSubmitParam param){
        return service.delSubmitDrug(param);
    }


    /**
     * @description:查询退药信息
     * @author: lihong
     * @date: 2023/10/8 11:00
     * @param: param
     * @return: thyyxxk.webserver.entity.ResultVo<java.util.Map<java.lang.String,java.lang.Object>>
     **/
    @PostMapping("/queryTcInfo")
    public ResultVo<Map<String,Object>> queryTcInfo(@RequestBody DrugSubmitParam param){
        return ResultVoUtil.success(service.queryTcInfo(param));
    }
    /**
     * @description:保存退药数据
     * @author: lihong
     * @date: 2023/10/8 11:03
     * @param: param
     * @return: thyyxxk.webserver.entity.ResultVo<java.util.Map<java.lang.String,java.lang.Object>>
     **/
    @PostMapping("/saveTcData")
    public ResultVo<Map<String,Object>> saveTcdata(@RequestBody DrugSubmitParam param){
        return ResultVoUtil.success(service.saveTcData(param));
    }
    /**
     * @description:删除退药数据
     * @author: lihong
     * @date: 2023/10/8 11:03
     * @param: param
     * @return: thyyxxk.webserver.entity.ResultVo<java.lang.String>
     **/
    @PostMapping("/delTcData")
    public ResultVo<String> delTcData(@RequestBody DrugSubmitParam param){
        return service.delTcData(param);
    }
    /**
     * @description:查询截止时间
     * @author: lihong
     * @date: 2023/10/8 14:28
     * @param: param
     * @return: thyyxxk.webserver.entity.ResultVo<java.util.Map<java.lang.String,java.lang.Object>>
     **/
    @PostMapping("/queryQsTime")
    public ResultVo<Map<String,Object>> queryQsTime(@RequestBody DrugSubmitParam param){
        return ResultVoUtil.success(service.queryQsTime(param));
    }



    /**
     * @description:查询药单列表
     * @author: lihong
     * @date: 2023/10/9 15:19
     * @param: param
     * @return: thyyxxk.webserver.entity.ResultVo<java.util.List<thyyxxk.webserver.entity.medicaladvice.medicamanage.common.YzYpPageNo>>
     **/
    @PostMapping("/queryYpPageNoList")
    public ResultVo<List<YzYpPageNo>> queryYpPageNoList(@RequestBody DrugSubmitParam param){
        return ResultVoUtil.success(service.queryYpPageNoList(param));
    }
    /**
     * @description:查询发药汇总 长期和临时 明细
     * @author: lihong
     * @date: 2023/10/9 15:21
     * @param: param
     * @return: thyyxxk.webserver.entity.ResultVo<java.util.Map<java.lang.String,java.lang.Object>>
     **/
    @PostMapping("/queryDispenseDrugTotalVo")
    public ResultVo<Map<String,Object>> queryDispenseDrugTotalVo(@RequestBody DrugSubmitParam param){
        return ResultVoUtil.success(service.queryDispenseDrugTotalVo(param));
    }


    /**
     * @description:查询发药明细
     * @author: lihong
     * @date: 2023/10/9 15:29
     * @param: param
     * @return: thyyxxk.webserver.entity.ResultVo<java.util.Map<java.lang.String,java.lang.Object>>
     **/
    @PostMapping("/queryDispenseDrugDetail")
    public ResultVo<Map<String,Object>> queryDispenseDrugDetail(@RequestBody DrugSubmitParam param){
        return ResultVoUtil.success(service.queryDispenseDrugDetail(param));
    }

    /**
     * @description:查询发药草药明细
     * @author: lihong
     * @date: 2023/10/9 15:38
     * @param: param
     * @return: thyyxxk.webserver.entity.ResultVo<java.util.Map<java.lang.String,java.lang.Object>>
     **/
    @PostMapping("/queryDispenseCyDetail")
    public ResultVo<Map<String,Object>> queryDispenseCyDetail(@RequestBody DrugSubmitParam param){
        return ResultVoUtil.success(service.queryDispenseCyDetail(param));
    }
    /**
     * @description:查询大输液消耗统计
     * @author: lihong
     * @date: 2023/10/10 16:13
     * @param: param
     * @return: thyyxxk.webserver.entity.ResultVo<java.util.Map<java.lang.String,java.lang.Object>>
     **/
    @PostMapping("/queryDsyDetail")
    public ResultVo<Map<String,Object>> queryDsyDetail(@RequestBody DrugSubmitParam param){
        return ResultVoUtil.success(service.queryDsyDetail(param));
    }

}
