package com.xxfc.platform.vehicle.rest.admin;

import com.github.wxiaoqi.security.auth.client.annotation.IgnoreClientToken;
import com.github.wxiaoqi.security.auth.client.annotation.IgnoreUserToken;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.util.process.ResultCode;
import com.xxfc.platform.vehicle.biz.BranchCompanyStockApplyInfoBiz;
import com.xxfc.platform.vehicle.biz.CompanyBaseBiz;
import com.xxfc.platform.vehicle.common.BaseController;
import com.xxfc.platform.vehicle.common.RestResponse;
import com.xxfc.platform.vehicle.constant.ResCode.ResCode;
import com.xxfc.platform.vehicle.entity.BranchCompanyStockApplyInfo;
import com.xxfc.platform.vehicle.pojo.BranchCompanyStockApplyVo;
import com.xxfc.platform.vehicle.pojo.BranchCompanyStockSearchVo;
import com.xxfc.platform.vehicle.pojo.vo.BranchCompanyStockInfoRightVo;
import com.xxfc.platform.vehicle.pojo.vo.CompanyVo;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;

@RestController
@IgnoreClientToken
@IgnoreUserToken
@RequestMapping("company/base")
public class CompanyController extends BaseController<CompanyBaseBiz> {


    @ApiOperation("同步分公司信息")
    @PostMapping("synchro")
    public ObjectRestResponse<String> synchro() {
        return baseBiz.synchro();
    }


    @ApiOperation("查询公司列表")
    @RequestMapping(value = "/list", method = RequestMethod.GET)
    public ObjectRestResponse getList(CompanyVo companyVo){
        return  baseBiz.getList(companyVo);
    }

    @ApiOperation("设置基础信息")
    @RequestMapping(value = "/updCompany", method = RequestMethod.POST)
    public ObjectRestResponse updCompany(@RequestBody CompanyVo companyVo){
        return  baseBiz.updCompany(companyVo);
    }

    @ApiOperation("添加分公司")
    @RequestMapping(value = "/addCompany", method = RequestMethod.POST)
    public ObjectRestResponse addCompany(@RequestBody CompanyVo companyVo){
        return  baseBiz.updCompany(companyVo);
    }

    @ApiOperation("获取详情")
    @RequestMapping(value = "/getCompanyDetail", method = RequestMethod.GET)
    public ObjectRestResponse getCompanyDetail(CompanyVo companyVo){
        return  baseBiz.getCompanyDetail(companyVo);
    }

    @ApiOperation("设置股权信息")
    @RequestMapping(value = "/updStockInfo", method = RequestMethod.POST)
    public ObjectRestResponse updStockInfo(CompanyVo companyVo){
        return  baseBiz.updStockInfo(companyVo);
    }
    @ApiOperation("设置详情")
    @RequestMapping(value = "/updCompanyDetail", method = RequestMethod.POST)
    public ObjectRestResponse updCompanyDetail(CompanyVo companyVo){
        return  baseBiz.updCompanyDetail(companyVo);
    }

    @ApiOperation("删除")
    @RequestMapping(value = "/del", method = RequestMethod.POST)
    public ObjectRestResponse del(@RequestParam(value = "id",defaultValue = "0") Integer id){
        return  baseBiz.delCompany(id);
    }




}
