package com.muchinfo.mtp3century.controller;

import com.muchinfo.mtp3century.service.IBankBusinessService;
import com.muchinfo.mtp3century.utils.AjaxResult;
import com.muchinfo.mtp3common.vo.PageResult;
import com.muchinfo.mtp3pojos.entity.*;
import com.muchinfo.mtp3pojos.vo.bankbusiness.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.math.BigDecimal;

@RestController
@RequestMapping("/bankBusiness")
@Api(value = "银行业务API", description = "银行业务管理")
public class BankBusinessController {
    private final Logger log = LoggerFactory.getLogger(this.getClass());
    @Resource
    private IBankBusinessService iBankBusinessService;

    @ApiOperation("银行业务->银行系统配置-->详情")
    @ApiResponse(code = 200, message = "成功", response = AjaxResult.class)
    @RequestMapping(method = RequestMethod.GET, value = "/banksystemconfig")
    public AjaxResult<BankSystemconfig> banksystemconfig(HttpServletRequest request) {
        return iBankBusinessService.banksystemconfig(request);
    }

    @ApiOperation("银行业务->银行系统配置-->编辑")
    @ApiResponse(code = 200, message = "成功", response = AjaxResult.class)
    @RequestMapping(method = RequestMethod.POST, value = "/saveSystemDetail")
    public AjaxResult saveSystemDetail(@RequestBody BankSystemConfigParam param, HttpServletRequest request) {
        return iBankBusinessService.saveSystemDetail(param, request);
    }

    @ApiOperation("银行业务->托管银行配置-->获取列表")
    @ApiResponse(code = 200, message = "成功", response = AjaxResult.class)
    @RequestMapping(method = RequestMethod.GET, value = "/bankcusquery")
    public AjaxResult<BankCusbankinfo> bankcusquery(HttpServletRequest request) {
        return iBankBusinessService.bankcusquery(request);
    }

    @ApiOperation("银行业务->托管银行配置-->详情")
    @ApiResponse(code = 200, message = "成功", response = AjaxResult.class)
    @RequestMapping(method = RequestMethod.GET, value = "/bankcusdetail")
    public AjaxResult<BankCusbankinfoDetailResult> bankcusdetail(String cusbankid, HttpServletRequest request) {
        return iBankBusinessService.bankcusdetail(cusbankid, request);
    }

    @ApiOperation("银行业务->托管银行配置-->获取平台开户银行")
    @ApiResponse(code = 200, message = "成功", response = AjaxResult.class)
    @RequestMapping(method = RequestMethod.GET, value = "/queryBankInfoSelect")
    public AjaxResult<BankBankinfo> queryBankInfoSelect(String searchcode, HttpServletRequest request) {
        return iBankBusinessService.queryBankInfoSelect(searchcode, request);
    }

    @ApiOperation("银行业务->托管银行配置-->新增/修改")
    @ApiResponse(code = 200, message = "成功", response = AjaxResult.class)
    @RequestMapping(method = RequestMethod.POST, value = "/dealBankInfo")
    public AjaxResult dealBankInfo(@RequestBody BankCusBankInfoParam param, HttpServletRequest request) {
        return iBankBusinessService.dealBankInfo(param, request);
    }

    @ApiOperation("银行业务->托管银行配置-->删除")
    @ApiResponse(code = 200, message = "成功", response = AjaxResult.class)
    @RequestMapping(method = RequestMethod.GET, value = "/deleteBankInfo")
    public AjaxResult deleteBankInfo(String cusbankid, HttpServletRequest request) {
        return iBankBusinessService.deleteBankInfo(cusbankid, request);
    }

    @ApiOperation("银行业务->托管银行配置-->扩展配置-->获取列表")
    @ApiResponse(code = 200, message = "成功", response = AjaxResult.class)
    @RequestMapping(method = RequestMethod.GET, value = "/queryExtendset")
    public AjaxResult<BankCusbankextendconfig> queryExtendset(String cusbankid, HttpServletRequest request) {
        return iBankBusinessService.queryExtendset(cusbankid, request);
    }

    @ApiOperation("银行业务->托管银行配置-->扩展配置-->新增、修改初始化信息")
    @ApiResponse(code = 200, message = "成功", response = AjaxResult.class)
    @RequestMapping(method = RequestMethod.GET, value = "/extendBizTypeInit")
    public AjaxResult<BankExtendBizTypeResult> extendBizTypeInit(String cusbankid, HttpServletRequest request) {
        return iBankBusinessService.extendBizTypeInit(cusbankid, request);
    }

    @ApiOperation("银行业务->托管银行配置-->扩展配置-->详情")
    @ApiResponse(code = 200, message = "成功", response = AjaxResult.class)
    @RequestMapping(method = RequestMethod.GET, value = "/extendDetail")
    public AjaxResult<BankCusbankextendconfig> extendDetail(String cusbankid, Integer extendbiztype, HttpServletRequest request) {
        return iBankBusinessService.extendDetail(cusbankid, extendbiztype, request);
    }

    @ApiOperation("银行业务-托管银行配置-->扩展配置-->新增/修改")
    @ApiResponse(code = 200, message = "成功", response = AjaxResult.class)
    @RequestMapping(method = RequestMethod.POST, value = "/dealBankExtend")
    public AjaxResult dealBankExtend(@RequestBody BankExtendAddParam param, HttpServletRequest request) {
        return iBankBusinessService.dealBankExtend(param, request);
    }

    @ApiOperation("银行业务->托管银行配置-->扩展配置-->删除")
    @ApiResponse(code = 200, message = "成功", response = AjaxResult.class)
    @RequestMapping(method = RequestMethod.GET, value = "/delExtend")
    public AjaxResult delExtend(String cusbankid, Integer extendbiztype, HttpServletRequest request) {
        return iBankBusinessService.delExtend(cusbankid, extendbiztype, request);
    }

    @ApiOperation("银行业务->托管银行配置-->支持银行-->获取列表")
    @ApiResponse(code = 200, message = "成功", response = AjaxResult.class)
    @RequestMapping(method = RequestMethod.GET, value = "/queryBankSignList")
    public AjaxResult<BankCusbanksignbank> queryBankSignList(String cusbankid, HttpServletRequest request) {
        return iBankBusinessService.queryBankSignList(cusbankid, request);
    }

    @ApiOperation("银行业务->托管银行配置-->支持银行-->获取排除银行列表")
    @ApiResponse(code = 200, message = "成功", response = AjaxResult.class)
    @RequestMapping(method = RequestMethod.GET, value = "/queryBankInfoNotExist")
    public AjaxResult<BankBankinfo> queryBankInfoNotExist(String cusbankid, HttpServletRequest request) {
        return iBankBusinessService.queryBankInfoNotExist(cusbankid, request);
    }

    @ApiOperation("银行业务->托管银行配置-->扩展配置-->删除")
    @ApiResponse(code = 200, message = "成功", response = AjaxResult.class)
    @RequestMapping(method = RequestMethod.GET, value = "/delBankInfo")
    public AjaxResult delBankInfo(String cusbankid, Integer bankid, HttpServletRequest request) {
        return iBankBusinessService.delBankInfo(cusbankid, bankid, request);
    }

    @ApiOperation("银行业务-托管银行配置-->扩展配置-->新增")
    @ApiResponse(code = 200, message = "成功", response = AjaxResult.class)
    @RequestMapping(method = RequestMethod.POST, value = "/dealBankCusBankSign")
    public AjaxResult dealBankCusBankSign(@RequestBody BankCusBankSignAddParam param, HttpServletRequest request) {
        return iBankBusinessService.dealBankCusBankSign(param, request);
    }

    @ApiOperation("银行业务-->签解约查询-->获取列表")
    @ApiResponse(code = 200, message = "成功", response = PageResult.class)
    @RequestMapping(method = RequestMethod.GET, value = "/signLogQuery")
    public PageResult<BankAccountSignLogQueryResult> signLogQuery(BankAccountSignLogQueryParam param, HttpServletRequest request) {
        return iBankBusinessService.signLogQuery(param, request);
    }

    @ApiOperation("银行业务-->签解约查询-->详情")
    @ApiResponse(code = 200, message = "成功", response = AjaxResult.class)
    @RequestMapping(method = RequestMethod.GET, value = "/signLogDetail")
    public AjaxResult<BankAccountsignlog> signLogDetail(String cusbankid, Integer exchticket, HttpServletRequest request) {
        return iBankBusinessService.signLogDetail(cusbankid, exchticket, request);
    }

    @RequestMapping(method = RequestMethod.GET, value = "/signLogExport")
    @ApiOperation("银行业务-->签解约查询-->导出")
    @ApiResponse(code = 200, message = "成功", response = AjaxResult.class)
    public AjaxResult signLogExport(BankAccountSignLogQueryParam param, HttpServletRequest request) {
        return iBankBusinessService.signLogExport(param, request);
    }

    @ApiOperation("银行业务->托管银行配置-->出入金银行配置-->获取列表")
    @ApiResponse(code = 200, message = "成功", response = AjaxResult.class)
    @RequestMapping(method = RequestMethod.GET, value = "/querymixbanklist")
    public AjaxResult<HybridChannelConfig> querymixbanklist(HttpServletRequest request) {
        return iBankBusinessService.querymixbanklist(request);
    }

    @ApiOperation("银行业务->托管银行配置-->出入金银行配置-->修改")
    @ApiResponse(code = 200, message = "成功", response = AjaxResult.class)
    @RequestMapping(method = RequestMethod.GET, value = "/mixbankeditsubmit")
    public AjaxResult mixbankeditsubmit(@RequestBody BankMixBankUpdateParam param, HttpServletRequest request) {
        return iBankBusinessService.mixbankeditsubmit(param, request);
    }

    @ApiOperation("银行业务->托管银行配置-->出入金银行配置-->删除")
    @ApiResponse(code = 200, message = "成功", response = AjaxResult.class)
    @RequestMapping(method = RequestMethod.GET, value = "/deletemixbankedit")
    public AjaxResult deletemixbankedit(String channelCode, HttpServletRequest request) {
        return iBankBusinessService.deletemixbankedit(channelCode, request);
    }

    @ApiOperation("银行业务->托管银行配置-->出入金银行配置-->出入金银行流水-->获取列表")
    @ApiResponse(code = 200, message = "成功", response = PageResult.class)
    @RequestMapping(method = RequestMethod.GET, value = "/querychannelbanklist")
    public PageResult<HybridBankinfo> querychannelbanklist(BankChannleBankParam param, HttpServletRequest request) {
        return iBankBusinessService.querychannelbanklist(param, request);
    }

    @ApiOperation("银行业务->银行账号查询")
    @ApiResponse(code = 200, message = "成功", response = AjaxResult.class)
    @RequestMapping(method = RequestMethod.GET, value = "/bankQueryAccInfo")
    public AjaxResult<BankQueryAccInfoResult> bankQueryAccInfo(Integer accountid, HttpServletRequest request) {
        return iBankBusinessService.bankQueryAccInfo(accountid, request);
    }

    @ApiOperation("银行业务->手续费提现-->获取列表")
    @ApiResponse(code = 200, message = "成功", response = PageResult.class)
    @RequestMapping(method = RequestMethod.GET, value = "/queryCommission")
    public PageResult<BankAmounttransfer> queryCommission(BankCommissionParam param, HttpServletRequest request) {
        return iBankBusinessService.queryCommission(param, request);
    }

    @ApiOperation("银行业务->手续费提现-->新增获取手续费金额")
    @ApiResponse(code = 200, message = "成功", response = AjaxResult.class)
    @RequestMapping(method = RequestMethod.GET, value = "/queryMoneyjdjs")
    public AjaxResult<BigDecimal> queryMoneyjdjs(String cusbankid, String acctype, HttpServletRequest request) {
        return iBankBusinessService.queryMoneyjdjs(cusbankid,acctype, request);
    }

    @ApiOperation("银行业务->手续费提现-->新增手续费提现")
    @ApiResponse(code = 200, message = "成功", response = AjaxResult.class)
    @RequestMapping(method = RequestMethod.GET, value = "/addjdjs")
    public AjaxResult addjdjs(BankAmounttransfer param, HttpServletRequest request) {
        return iBankBusinessService.addjdjs(param, request);
    }
}
