package thyyxxk.webserver.controller.inpatient.charge;

import org.springframework.web.bind.annotation.*;
import thyyxxk.webserver.entity.ResultVo;
import thyyxxk.webserver.entity.executeItem.ZyLedgerFile;
import thyyxxk.webserver.entity.inpatient.ZyActpatient;
import thyyxxk.webserver.entity.inpatient.charge.PatientParam;
import thyyxxk.webserver.entity.inpatient.charge.ZyReceipt;
import thyyxxk.webserver.service.inpatient.charge.CashierProcessService;
import thyyxxk.webserver.utils.ResultVoUtil;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * @Description:
 * @Author:lihong
 * @Date: 2024/9/9
 */
@RestController
@RequestMapping("/cashierProcess")
public class CashierProcessController {
    @Resource
    private CashierProcessService service;

    @PostMapping("/queryPatientInfoPage")
    public ResultVo<Map<String,Object>> queryPatientInfoPage(@RequestBody PatientParam param){
        Map<String,Object> data =  service.queryPatientInfoPage(param);
        return ResultVoUtil.success(data);
    }

    @PostMapping("/queryCashFlag")
    public ResultVo<Map<String,Object>> queryCashFlag(@RequestBody PatientParam param){
        Map<String,Object> data =  service.queryCashFlag(param);
        return ResultVoUtil.success(data);
    }

    @PostMapping("/queryCashierProcessInfo")
    public ResultVo<Map<String,Object>> queryCashierProcessInfo(@RequestBody PatientParam param){
        Map<String,Object> data =  service.queryCashierProcessInfo(param);
        return ResultVoUtil.success(data);
    }

    /**
     * @description: 查询付款方式字典
     * @author: lihong
     * @date: 2024/9/13 15:02
     * @param: param
     * @return: thyyxxk.webserver.entity.ResultVo<java.util.List<java.util.Map<java.lang.String,java.lang.Object>>>
     **/
    @GetMapping("/queryZdChequeType")
    public ResultVo<List<Map<String,Object>>> queryZdChequeType(){
        return ResultVoUtil.success(service.queryZdChequeType());
    }


    /**
     * @description: 查询住院发票
     * @author: lihong
     * @date: 2024/9/13 11:31
     * @param: param
     * @return: thyyxxk.webserver.entity.ResultVo<java.util.List<thyyxxk.webserver.entity.zysf.ZyReceipt>>
     **/
    @PostMapping("/queryZyReceipt")
    public ResultVo<List<ZyReceipt>> queryZyReceipt(@RequestBody PatientParam param){
        return ResultVoUtil.success(service.queryZyReceipt(param));
    }

    /**
     * @description: 查询预交金
     * @author: lihong
     * @date: 2024/9/13 11:31
     * @param: param
     * @return: thyyxxk.webserver.entity.ResultVo<java.util.Map<java.lang.String,java.lang.Object>>
     **/
    @PostMapping("/queryZyDepositFileList")
    public ResultVo<Map<String,Object>> queryZyDepositFileList(@RequestBody PatientParam param){
        Map<String,Object> data =  service.queryZyDepositFileList(param);
        return ResultVoUtil.success(data);
    }




    @PostMapping("/queryPatientZyLedgerFile")
    public ResultVo<List<ZyLedgerFile>> queryPatientZyLedgerFile(@RequestBody PatientParam param){
        List<ZyLedgerFile> data =  service.queryPatientZyLedgerFile(param);
        return ResultVoUtil.success(data);
    }

    @PostMapping("/checkCashierProcess")
    public ResultVo<Map<String,Object>> checkCashierProcess(@RequestBody PatientParam param){
        Map<String,Object> data =  service.checkCashierProcess(param);
        return ResultVoUtil.success(data);
    }
    /**
     * @description: 查询可出纳列表数据
     * @author: lihong
     * @date: 2024/9/12 9:14
     * @param: param
     * @return: thyyxxk.webserver.entity.ResultVo<java.util.Map<java.lang.String,java.lang.Object>>
     **/
    @PostMapping("/queryKyCashierList")
    public ResultVo<List<Map<String,Object>>> queryKyCashierList(@RequestBody PatientParam param){
        return ResultVoUtil.success(service.queryKyCashierList(param));
    }

    /**
     * @description: 保存出纳数据
     * @author: lihong
     * @date: 2024/9/13 11:27
     * @param: param
     * @return: thyyxxk.webserver.entity.ResultVo<java.lang.String>
     **/
    @PostMapping("/saveCashierData")
    public ResultVo<String> saveCashierData(@RequestBody PatientParam param){
        return service.saveCashierData(param);
    }

    /**
     * @description: 取消出纳
     * @author: lihong
     * @date: 2024/9/13 11:36
     * @param: param
     * @return: thyyxxk.webserver.entity.ResultVo<java.lang.String>
     **/
    @PostMapping("/cancelCashierData")
    public ResultVo<String> cancelCashierData(@RequestBody PatientParam param){
        return service.cancelCashierData(param);
    }
    /**
     * @description: 更新打印住院发票数据
     * @author: lihong
     * @date: 2024/9/14 9:16
     * @param: param
     * @return: thyyxxk.webserver.entity.ResultVo<java.lang.String>
     **/
    @PostMapping("/updatePrintZyFpData")
    public ResultVo<String> updatePrintZyFpData(@RequestBody PatientParam param){
        return service.updatePrintZyFpData(param);
    }

    /**
     * @description:查询需要打印的发票内容
     * @author: lihong
     * @date: 2024/9/14 9:38
     * @param: param
     * @return: thyyxxk.webserver.entity.ResultVo<java.lang.String>
     **/
    @PostMapping("/queryPrintZyFpData")
    public ResultVo<ZyReceipt> queryPrintZyFpData(@RequestBody PatientParam param){
        return ResultVoUtil.success(service.queryPrintZyFpData(param));
    }

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

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

    @GetMapping("/queryFpVersion")
    public ResultVo<String> queryFpVersion(){
        return service.queryFpVersion();
    }

    /**
     * @description: 出纳数据冲销
     * @author: lihong
     * @date: 2024/9/20 15:52
     * @param: param
     * @return: thyyxxk.webserver.entity.ResultVo<thyyxxk.webserver.entity.zysf.ZyReceipt>
     **/
    @PostMapping("/cashierDataTx")
    public ResultVo<String> cashierDataTx(@RequestBody PatientParam param){
        return service.cashierDataTx(param);
    }

    @PostMapping("/queryZyActpatientFeeDetail")
    public ResultVo<ZyActpatient> queryZyActpatientFeeDetail(@RequestBody PatientParam param){
        return service.queryZyActpatientFeeDetail(param);
    }

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

}
