package com.cool.store.controller.webb;

import com.cool.store.context.CurrentUserHolder;
import com.cool.store.context.LoginUserInfo;
import com.cool.store.dto.InvestmentCountDTO;
import com.cool.store.dto.PendingCountDTO;
import com.cool.store.response.ResponseResult;
import com.cool.store.service.DeskService;
import com.cool.store.vo.desk.*;
import com.github.pagehelper.PageInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Author suzhuhong
 * @Date 2024/3/26 17:49
 * @Version 1.0
 */
@Api(tags = "工作台接口")
@RestController
@RequestMapping("pc/desk")
public class DeskController {


    @Resource
    DeskService deskService;

    @ApiOperation("待处理-加盟申请")
    @GetMapping("/intendPendingList")
    public ResponseResult<PageInfo<IntendPendingVO>> intendPendingList(@RequestParam(value = "pageNumber",required = true,defaultValue = "1")Integer pageNumber,
                                                                     @RequestParam(value = "pageSize",required = true,defaultValue = "10")Integer pageSize) {
        LoginUserInfo userInfo = CurrentUserHolder.getUser();
        return ResponseResult.success(deskService.intendPendingList(pageNumber,pageSize,userInfo.getUserId()));
    }

    @ApiOperation("待处理-邀约面谈")
    @GetMapping("/interviewPendingList")
    public ResponseResult<PageInfo<InterviewPendingVO>> interviewPendingList(@RequestParam(value = "pageNumber",required = true,defaultValue = "1")Integer pageNumber,
                                                                             @RequestParam(value = "pageSize",required = true,defaultValue = "10")Integer pageSize) {
        LoginUserInfo userInfo = CurrentUserHolder.getUser();
        return ResponseResult.success(deskService.interviewPendingList(pageNumber,pageSize,userInfo.getUserId()));
    }

    @ApiOperation("待处理-一审")
    @GetMapping("/firstInterviewPendingList")
    public ResponseResult<PageInfo<InterviewPendingVO>> firstInterviewPendingList(@RequestParam(value = "pageNumber",required = true,defaultValue = "1")Integer pageNumber,
                                                                             @RequestParam(value = "pageSize",required = true,defaultValue = "10")Integer pageSize) {
        LoginUserInfo userInfo = CurrentUserHolder.getUser();
        return ResponseResult.success(deskService.firstInterviewPendingList(pageNumber,pageSize,userInfo));
    }

    @ApiOperation("待处理-二审")
    @GetMapping("/secondInterviewPendingList")
    public ResponseResult<PageInfo<InterviewPendingVO>> secondInterviewPendingList(@RequestParam(value = "pageNumber",required = true,defaultValue = "1")Integer pageNumber,
                                                                             @RequestParam(value = "pageSize",required = true,defaultValue = "10")Integer pageSize) {
        LoginUserInfo userInfo = CurrentUserHolder.getUser();
        return ResponseResult.success(deskService.secondInterviewPendingList(pageNumber,pageSize,userInfo));
    }


    @ApiOperation("待处理-缴纳意向金")
    @GetMapping("/payStagePendingList")
    public ResponseResult<PageInfo<PayStagePendingVO>> payStagePendingList(@RequestParam(value = "pageNumber",required = true,defaultValue = "1")Integer pageNumber,
                                                                           @RequestParam(value = "pageSize",required = true,defaultValue = "10")Integer pageSize) {
        LoginUserInfo userInfo = CurrentUserHolder.getUser();
        return ResponseResult.success(deskService.payStagePendingList(pageNumber,pageSize,userInfo));
    }

    @ApiOperation("待处理-意向协议")
    @GetMapping("/signingPendingList")
    public ResponseResult<PageInfo<SigningPendingVO>> signingPendingList(@RequestParam(value = "pageNumber",required = true,defaultValue = "1")Integer pageNumber,
                                                                         @RequestParam(value = "pageSize",required = true,defaultValue = "10")Integer pageSize) {
        LoginUserInfo userInfo = CurrentUserHolder.getUser();
        return ResponseResult.success(deskService.signingPendingList(pageNumber,pageSize,userInfo));
    }

    @ApiOperation("待处理-实训体验")
    @GetMapping("/storeExperiencePendingList")
    public ResponseResult<PageInfo<StoreExperiencePendingVO>> storeExperiencePendingList(@RequestParam(value = "pageNumber",required = true,defaultValue = "1")Integer pageNumber,
                                                                                         @RequestParam(value = "pageSize",required = true,defaultValue = "10")Integer pageSize) {
        LoginUserInfo userInfo = CurrentUserHolder.getUser();
        return ResponseResult.success(deskService.storeExperiencePendingList(pageNumber,pageSize,userInfo));
    }


    @ApiOperation("待处理-数据")
    @GetMapping("/getPendingCount")
    public ResponseResult<PendingCountDTO> getPendingCount(@RequestParam(value = "pageNumber",required = true,defaultValue = "1")Integer pageNumber,
                                                              @RequestParam(value = "pageSize",required = true,defaultValue = "10")Integer pageSize) {
        LoginUserInfo userInfo = CurrentUserHolder.getUser();
        return ResponseResult.success(deskService.getPendingCount(userInfo));
    }


    @ApiOperation("招商经理-我的数据")
    @GetMapping("/getInvestmentCount")
    public ResponseResult<InvestmentCountDTO> getInvestmentCount() {
        LoginUserInfo userInfo = CurrentUserHolder.getUser();
        return ResponseResult.success(deskService.getInvestmentCount(userInfo));
    }

    @ApiOperation("待处理-系统建店")
    @GetMapping("/systemBuildStorePendingList")
    public ResponseResult<PageInfo<PreparationCommonPendingVO>> systemBuildStorePendingList(@RequestParam(value = "pageNumber",required = true,defaultValue = "1")Integer pageNumber,
                                                                         @RequestParam(value = "pageSize",required = true,defaultValue = "10")Integer pageSize) {
        LoginUserInfo userInfo = CurrentUserHolder.getUser();
        return ResponseResult.success(deskService.systemBuildStorePendingList(pageNumber,pageSize,userInfo));
    }
    @ApiOperation("待处理-支付加盟费保证金")
    @GetMapping("/payFranchiseFeesPendingList")
    public ResponseResult<PageInfo<PreparationCommonPendingVO>> payFranchiseFeesPendingList(@RequestParam(value = "pageNumber",required = true,defaultValue = "1")Integer pageNumber,
                                                                                            @RequestParam(value = "pageSize",required = true,defaultValue = "10")Integer pageSize) {
        LoginUserInfo userInfo = CurrentUserHolder.getUser();
        return ResponseResult.success(deskService.payFranchiseFeesPendingList(pageNumber,pageSize,userInfo));
    }
    @ApiOperation("待处理-签约加盟合同")
    @GetMapping("/signingOfFranchiseContractPendingList")
    public ResponseResult<PageInfo<PreparationCommonPendingVO>> signingOfFranchiseContractPendingList(@RequestParam(value = "pageNumber",required = true,defaultValue = "1")Integer pageNumber,
                                                                                            @RequestParam(value = "pageSize",required = true,defaultValue = "10")Integer pageSize) {
        LoginUserInfo userInfo = CurrentUserHolder.getUser();
        return ResponseResult.success(deskService.signingOfFranchiseContractPendingList(pageNumber,pageSize,userInfo));
    }
    @ApiOperation("待处理-开店运营方案")
    @GetMapping("/openingAndOperationPlanPendingList")
    public ResponseResult<PageInfo<PreparationCommonPendingVO>> openingAndOperationPlanPendingList(@RequestParam(value = "pageNumber",required = true,defaultValue = "1")Integer pageNumber,
                                                                                            @RequestParam(value = "pageSize",required = true,defaultValue = "10")Integer pageSize) {
        LoginUserInfo userInfo = CurrentUserHolder.getUser();
        return ResponseResult.success(deskService.openingAndOperationPlanPendingList(pageNumber,pageSize,userInfo));
    }
    @ApiOperation("待处理-首批订货清单")
    @GetMapping("/firstOrderListPendingList")
    public ResponseResult<PageInfo<PreparationCommonPendingVO>> firstOrderListPendingList(@RequestParam(value = "pageNumber",required = true,defaultValue = "1")Integer pageNumber,
                                                                                            @RequestParam(value = "pageSize",required = true,defaultValue = "10")Integer pageSize) {
        LoginUserInfo userInfo = CurrentUserHolder.getUser();
        return ResponseResult.success(deskService.firstOrderListPendingList(pageNumber,pageSize,userInfo));
    }

    @ApiOperation("待处理-培训登记")
    @GetMapping("/trainListPendingList")
    public ResponseResult<PageInfo<PreparationCommonPendingVO>> trainListPendingList(@RequestParam(value = "pageNumber",required = true,defaultValue = "1")Integer pageNumber,
                                                                                     @RequestParam(value = "pageSize",required = true,defaultValue = "10")Integer pageSize) {
        LoginUserInfo userInfo = CurrentUserHolder.getUser();
        return ResponseResult.success(deskService.trainListPendingList(pageNumber,pageSize,userInfo));
    }
    @ApiOperation("待处理-信发系统")
    @GetMapping("/xinFaListPendingList")
    public ResponseResult<PageInfo<PreparationCommonPendingVO>> xinFaListPendingList(@RequestParam(value = "pageNumber",required = true,defaultValue = "1")Integer pageNumber,
                                                                                   @RequestParam(value = "pageSize",required = true,defaultValue = "10")Integer pageSize) {
        LoginUserInfo userInfo = CurrentUserHolder.getUser();
        return ResponseResult.success(deskService.xinFaListPendingList(pageNumber,pageSize,userInfo));
    }
    @ApiOperation("待处理-pos")
    @GetMapping("/posListPendingList")
    public ResponseResult<PageInfo<PreparationCommonPendingVO>> posListPendingList(@RequestParam(value = "pageNumber",required = true,defaultValue = "1")Integer pageNumber,
                                                                                          @RequestParam(value = "pageSize",required = true,defaultValue = "10")Integer pageSize) {
        LoginUserInfo userInfo = CurrentUserHolder.getUser();
        return ResponseResult.success(deskService.posListPendingList(pageNumber,pageSize,userInfo));
    }
    @ApiOperation("待处理-营帐通")
    @GetMapping("/tentPassListPendingList")
    public ResponseResult<PageInfo<PreparationCommonPendingVO>> tentPassListPendingList(@RequestParam(value = "pageNumber",required = true,defaultValue = "1")Integer pageNumber,
                                                                                     @RequestParam(value = "pageSize",required = true,defaultValue = "10")Integer pageSize) {
        LoginUserInfo userInfo = CurrentUserHolder.getUser();
        return ResponseResult.success(deskService.tentPassListPendingList(pageNumber,pageSize,userInfo));
    }
    @ApiOperation("待处理-订货系统")
    @GetMapping("/orderSysPendingList")
    public ResponseResult<PageInfo<PreparationCommonPendingVO>> orderSysPendingList(@RequestParam(value = "pageNumber",required = true,defaultValue = "1")Integer pageNumber,
                                                                                          @RequestParam(value = "pageSize",required = true,defaultValue = "10")Integer pageSize) {
        LoginUserInfo userInfo = CurrentUserHolder.getUser();
        return ResponseResult.success(deskService.orderSysPendingList(pageNumber,pageSize,userInfo));
    }
    @ApiOperation("待处理-设计阶段")
    @GetMapping("/designPendingList")
    public ResponseResult<PageInfo<PreparationCommonPendingVO>> designPendingList(@RequestParam(value = "pageNumber",required = true,defaultValue = "1")Integer pageNumber,
                                                                                    @RequestParam(value = "pageSize",required = true,defaultValue = "10")Integer pageSize) {
        LoginUserInfo userInfo = CurrentUserHolder.getUser();
        return ResponseResult.success(deskService.designPendingList(pageNumber,pageSize,userInfo));
    }
    @ApiOperation("待处理-施工阶段")
    @GetMapping("/constructionPendingList")
    public ResponseResult<PageInfo<PreparationCommonPendingVO>> constructionPendingList(@RequestParam(value = "pageNumber",required = true,defaultValue = "1")Integer pageNumber,
                                                                                    @RequestParam(value = "pageSize",required = true,defaultValue = "10")Integer pageSize) {
        LoginUserInfo userInfo = CurrentUserHolder.getUser();
        return ResponseResult.success(deskService.constructionPendingList(pageNumber,pageSize,userInfo));
    }
    @ApiOperation("待处理-装修验收阶段")
    @GetMapping("/fitmentPendingList")
    public ResponseResult<PageInfo<PreparationCommonPendingVO>> fitmentPendingList(@RequestParam(value = "pageNumber",required = true,defaultValue = "1")Integer pageNumber,
                                                                                    @RequestParam(value = "pageSize",required = true,defaultValue = "10")Integer pageSize) {
        LoginUserInfo userInfo = CurrentUserHolder.getUser();
        return ResponseResult.success(deskService.fitmentPendingList(pageNumber,pageSize,userInfo));
    }
    @ApiOperation("待处理-抖音阶段")
    @GetMapping("/DYPendingList")
    public ResponseResult<PageInfo<PreparationCommonPendingVO>> DYPendingList(@RequestParam(value = "pageNumber",required = true,defaultValue = "1")Integer pageNumber,
                                                                                    @RequestParam(value = "pageSize",required = true,defaultValue = "10")Integer pageSize) {
        LoginUserInfo userInfo = CurrentUserHolder.getUser();
        return ResponseResult.success(deskService.DYPendingList(pageNumber,pageSize,userInfo));
    }
    @ApiOperation("待处理-快手")
    @GetMapping("/KSPendingList")
    public ResponseResult<PageInfo<PreparationCommonPendingVO>> KSPendingList(@RequestParam(value = "pageNumber",required = true,defaultValue = "1")Integer pageNumber,
                                                                                    @RequestParam(value = "pageSize",required = true,defaultValue = "10")Integer pageSize) {
        LoginUserInfo userInfo = CurrentUserHolder.getUser();
        return ResponseResult.success(deskService.KSPendingList(pageNumber,pageSize,userInfo));
    }
    @ApiOperation("待处理-美团外卖")
    @GetMapping("/MTPendingList")
    public ResponseResult<PageInfo<PreparationCommonPendingVO>> MTPendingList(@RequestParam(value = "pageNumber",required = true,defaultValue = "1")Integer pageNumber,
                                                                              @RequestParam(value = "pageSize",required = true,defaultValue = "10")Integer pageSize) {
        LoginUserInfo userInfo = CurrentUserHolder.getUser();
        return ResponseResult.success(deskService.MTPendingList(pageNumber,pageSize,userInfo));
    }
    @ApiOperation("待处理-美团团购")
    @GetMapping("/MTBuyPendingList")
    public ResponseResult<PageInfo<PreparationCommonPendingVO>> MTButPendingList(@RequestParam(value = "pageNumber",required = true,defaultValue = "1")Integer pageNumber,
                                                                              @RequestParam(value = "pageSize",required = true,defaultValue = "10")Integer pageSize) {
        LoginUserInfo userInfo = CurrentUserHolder.getUser();
        return ResponseResult.success(deskService.MTBuyPendingList(pageNumber,pageSize,userInfo));
    }
    @ApiOperation("待处理-饿了么")
    @GetMapping("/ELMEPendingList")
    public ResponseResult<PageInfo<PreparationCommonPendingVO>> ELMEPendingList(@RequestParam(value = "pageNumber",required = true,defaultValue = "1")Integer pageNumber,
                                                                              @RequestParam(value = "pageSize",required = true,defaultValue = "10")Integer pageSize) {
        LoginUserInfo userInfo = CurrentUserHolder.getUser();
        return ResponseResult.success(deskService.ELMEPendingList(pageNumber,pageSize,userInfo));
    }


}
