package com.ruoyi.ibs.list.controller;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.http.HttpServletResponse;

import com.ruoyi.ibs.customerselect.domain.RetailExportVo;
import com.ruoyi.ibs.list.domain.*;
import com.ruoyi.ibs.list.service.ICorporateShareholderService;
import com.ruoyi.ibs.list.service.ICustInfoMerchantService;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.ss.util.CellRangeAddress;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;

/**
 * 商户客户基本信息Controller
 * 
 * @author ruoyi
 * @date 2024-10-28
 */
@RestController
@RequestMapping("/system/merchant")
public class CustInfoMerchantController extends BaseController
{
    @Autowired
    private ICustInfoMerchantService custInfoMerchantService;
    @Autowired
    private ICorporateShareholderService corporateShareholderService;


    /**
     * 获取商户客户基本信息详细信息
     */
    //@PreAuthorize("@ss.hasPermi('system:merchant:query')")
    @GetMapping(value = "/getInfoByCustId")
    @Log(title = "客户视图-根据客户号查询商户360客户详情")
    @ApiOperation("根据客户号查询商户360客户详情")
    public AjaxResult getInfo(String custId)
    {
        return success(custInfoMerchantService.selectCustInfoMerchantVoByCustId(custId));
    }

    /**
     * 修改商户客户基本信息
     */
    //@PreAuthorize("@ss.hasPermi('system:merchant:edit')")
    @Log(title = "客户视图-编辑商户客户详情", businessType = BusinessType.UPDATE)
    @PutMapping
    @ApiOperation("编辑商户客户详情")
    public AjaxResult edit( CustInfoMerchant custInfoMerchant)
    {
        return custInfoMerchantService.updateCustInfoMerchant(custInfoMerchant);
    }

}
