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.request.AssignPendingRequest;
import com.cool.store.request.BusinessRemarkRequest;
import com.cool.store.request.DeskRequest;
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.*;

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
                                                                     , @RequestParam(value = "keyword") String keyword) {
        LoginUserInfo userInfo = CurrentUserHolder.getUser();
        return ResponseResult.success(deskService.intendPendingList(pageNumber, pageSize, userInfo.getUserId(),keyword));
    }


    @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
                                                                          , @RequestParam(value = "keyword") String keyword) {
        LoginUserInfo userInfo = CurrentUserHolder.getUser();
        return ResponseResult.success(deskService.payStagePendingList(pageNumber, pageSize, userInfo,keyword));
    }

    @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 , @RequestParam(value = "keyword") String keyword) {
        LoginUserInfo userInfo = CurrentUserHolder.getUser();
        return ResponseResult.success(deskService.signingPendingList(pageNumber, pageSize, userInfo,keyword));
    }


    @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("待处理-支付加盟费保证金")
    @PostMapping("/payFranchiseFeesPendingList")
    public ResponseResult<PageInfo<PreparationCommonPendingVO>> payFranchiseFeesPendingList(@RequestBody DeskRequest deskRequest) {
        LoginUserInfo userInfo = CurrentUserHolder.getUser();
        return ResponseResult.success(deskService.payFranchiseFeesPendingList(   deskRequest, userInfo   ));
    }

    @ApiOperation("待处理-签约加盟合同")
    @PostMapping("/signingOfFranchiseContractPendingList")
    public ResponseResult<PageInfo<PreparationCommonPendingVO>> signingOfFranchiseContractPendingList(@RequestBody DeskRequest deskRequest) {
        LoginUserInfo userInfo = CurrentUserHolder.getUser();
        return ResponseResult.success(deskService.signingOfFranchiseContractPendingList(   deskRequest, userInfo   ));
    }

    @ApiOperation("待处理-店型选配")
    @PostMapping("/standardStorePendingList")
    public ResponseResult<PageInfo<PreparationCommonPendingVO>> standardStorePendingList(@RequestBody DeskRequest deskRequest) {
        LoginUserInfo userInfo = CurrentUserHolder.getUser();
        return ResponseResult.success(deskService.standardStorePendingList(   deskRequest, userInfo   ));
    }

    @ApiOperation("待处理-发票回传")
    @PostMapping("/invoiceReturnPendingList")
    public ResponseResult<PageInfo<PreparationCommonPendingVO>> invoiceReturnPendingList(@RequestBody DeskRequest deskRequest) {
        LoginUserInfo userInfo = CurrentUserHolder.getUser();
        return ResponseResult.success(deskService.invoiceReturnPendingList(   deskRequest, userInfo   ));
    }

    @ApiOperation("待处理-开店运营方案")
    @PostMapping("/openingAndOperationPlanPendingList")
    public ResponseResult<PageInfo<PreparationCommonPendingVO>> openingAndOperationPlanPendingList(@RequestBody DeskRequest deskRequest) {
        LoginUserInfo userInfo = CurrentUserHolder.getUser();
        return ResponseResult.success(deskService.openingAndOperationPlanPendingList(   deskRequest, userInfo   ));
    }

    @ApiOperation("待处理-培训登记")
    @PostMapping("/trainListPendingList")
    public ResponseResult<PageInfo<PreparationCommonPendingVO>> trainListPendingList(@RequestBody DeskRequest deskRequest) {
        LoginUserInfo userInfo = CurrentUserHolder.getUser();
        return ResponseResult.success(deskService.trainListPendingList(   deskRequest, userInfo   ));
    }

    @ApiOperation("待处理-信发系统")
    @PostMapping("/xinFaListPendingList")
    public ResponseResult<PageInfo<PreparationCommonPendingVO>> xinFaListPendingList(@RequestBody DeskRequest deskRequest) {
        LoginUserInfo userInfo = CurrentUserHolder.getUser();
        return ResponseResult.success(deskService.xinFaListPendingList(   deskRequest, userInfo   ));
    }

    @ApiOperation("待处理-pos")
    @PostMapping("/posListPendingList")
    public ResponseResult<PageInfo<PreparationCommonPendingVO>> posListPendingList(@RequestBody DeskRequest deskRequest) {
        LoginUserInfo userInfo = CurrentUserHolder.getUser();
        return ResponseResult.success(deskService.posListPendingList(   deskRequest, userInfo   ));
    }

    @ApiOperation("待处理-pos-进件待办")
    @PostMapping("/posEntryListPendingList")
    public ResponseResult<PageInfo<PreparationCommonPendingVO>> posEntryListPendingList(@RequestBody DeskRequest deskRequest) {
        LoginUserInfo userInfo = CurrentUserHolder.getUser();
        return ResponseResult.success(deskService.posEntryListPendingList(deskRequest, userInfo));
    }

    @ApiOperation("待处理-营帐通")
    @PostMapping("/tentPassListPendingList")
    public ResponseResult<PageInfo<PreparationCommonPendingVO>> tentPassListPendingList(@RequestBody DeskRequest deskRequest) {
        LoginUserInfo userInfo = CurrentUserHolder.getUser();
        return ResponseResult.success(deskService.tentPassListPendingList(   deskRequest, userInfo   ));
    }

    @ApiOperation("待处理-订货系统")
    @PostMapping("/orderSysPendingList")
    public ResponseResult<PageInfo<PreparationCommonPendingVO>> orderSysPendingList(@RequestBody DeskRequest deskRequest) {
        LoginUserInfo userInfo = CurrentUserHolder.getUser();
        return ResponseResult.success(deskService.orderSysPendingList(   deskRequest, userInfo   ));
    }

    @ApiOperation("待处理-设计阶段")
    @PostMapping("/designPendingList")
    public ResponseResult<PageInfo<PreparationCommonPendingVO>> designPendingList(@RequestBody DeskRequest deskRequest) {
        LoginUserInfo userInfo = CurrentUserHolder.getUser();
        return ResponseResult.success(deskService.designPendingList(   deskRequest, userInfo   ));
    }

    @ApiOperation("待处理-施工阶段")
    @PostMapping("/constructionPendingList")
    public ResponseResult<PageInfo<PreparationCommonPendingVO>> constructionPendingList(@RequestBody DeskRequest deskRequest) {
        LoginUserInfo userInfo = CurrentUserHolder.getUser();
        return ResponseResult.success(deskService.constructionPendingList(   deskRequest, userInfo   ));
    }

    @ApiOperation("待处理-装修验收阶段")
    @PostMapping("/fitmentPendingList")
    public ResponseResult<PageInfo<PreparationCommonPendingVO>> fitmentPendingList(@RequestBody DeskRequest deskRequest) {
        LoginUserInfo userInfo = CurrentUserHolder.getUser();
        return ResponseResult.success(deskService.fitmentPendingList(   deskRequest, userInfo   ));
    }

    @ApiOperation("待处理-抖音阶段")
    @PostMapping("/DYPendingList")
    public ResponseResult<PageInfo<PreparationCommonPendingVO>> DYPendingList(@RequestBody DeskRequest deskRequest) {
        LoginUserInfo userInfo = CurrentUserHolder.getUser();
        return ResponseResult.success(deskService.DYPendingList(   deskRequest, userInfo   ));
    }

    @ApiOperation("待处理-快手")
    @PostMapping("/KSPendingList")
    public ResponseResult<PageInfo<PreparationCommonPendingVO>> KSPendingList(@RequestBody DeskRequest deskRequest) {
        LoginUserInfo userInfo = CurrentUserHolder.getUser();
        return ResponseResult.success(deskService.KSPendingList(   deskRequest, userInfo   ));
    }

    @ApiOperation("待处理-美团外卖")
    @PostMapping("/MTPendingList")
    public ResponseResult<PageInfo<PreparationCommonPendingVO>> MTPendingList(@RequestBody DeskRequest deskRequest) {
        LoginUserInfo userInfo = CurrentUserHolder.getUser();
        return ResponseResult.success(deskService.MTPendingList(   deskRequest, userInfo   ));
    }

    @ApiOperation("待处理-美团团购")
    @PostMapping("/MTBuyPendingList")
    public ResponseResult<PageInfo<PreparationCommonPendingVO>> MTButPendingList(@RequestBody DeskRequest deskRequest) {
        LoginUserInfo userInfo = CurrentUserHolder.getUser();
        return ResponseResult.success(deskService.MTBuyPendingList(   deskRequest, userInfo   ));
    }

    @ApiOperation("待处理-饿了么")
    @PostMapping("/ELMEPendingList")
    public ResponseResult<PageInfo<PreparationCommonPendingVO>> ELMEPendingList(@RequestBody DeskRequest deskRequest) {
        LoginUserInfo userInfo = CurrentUserHolder.getUser();
        return ResponseResult.success(deskService.ELMEPendingList(   deskRequest, userInfo   ));
    }

    @ApiOperation("待处理-建店资料")
    @PostMapping("/buildInformationPendingList")
    public ResponseResult<PageInfo<PreparationCommonPendingVO>> buildInformationPendingList(@RequestBody DeskRequest deskRequest) {
        LoginUserInfo userInfo = CurrentUserHolder.getUser();
        return ResponseResult.success(deskService.buildInformationPendingList(   deskRequest, userInfo   ));
    }

    @ApiOperation("待处理-开业验收")
    @PostMapping("/openingAcceptance")
    public ResponseResult<PageInfo<PreparationCommonPendingVO>> openingAcceptance(@RequestBody DeskRequest deskRequest) {
        LoginUserInfo userInfo = CurrentUserHolder.getUser();
        return ResponseResult.success(deskService.openingAcceptance(   deskRequest, userInfo   ));
    }

    @ApiOperation("待处理-开业日期报备代办")
    @PostMapping("/openingConfirmPendingList")
    public ResponseResult<PageInfo<PreparationCommonPendingVO>> openingConfirmPendingList(@RequestBody DeskRequest deskRequest) {
        LoginUserInfo userInfo = CurrentUserHolder.getUser();
        return ResponseResult.success(deskService.openingConfirmPendingList(   deskRequest, userInfo   ));
    }

    @ApiOperation("待处理-测量阶段")
    @PostMapping("/measurePendingList")
    public ResponseResult<PageInfo<PreparationCommonPendingVO>> measurePendingList(@RequestBody DeskRequest deskRequest) {
        LoginUserInfo userInfo = CurrentUserHolder.getUser();
        return ResponseResult.success(deskService.measurePendingList(   deskRequest, userInfo   ));
    }

    @ApiOperation("待处理-营业执照")
    @PostMapping("/businessLicensePendingList")
    public ResponseResult<PageInfo<PreparationCommonPendingVO>> businessLicensePendingList(@RequestBody DeskRequest deskRequest){
        LoginUserInfo userInfo = CurrentUserHolder.getUser();
        return ResponseResult.success(deskService.businessLicensePendingList(deskRequest,userInfo   ));
    }

    @ApiOperation("待处理-食品许可证")
    @PostMapping("/foodLicensePendingList")
    public ResponseResult<PageInfo<PreparationCommonPendingVO>> foodLicensePendingList(@RequestBody DeskRequest deskRequest) {
        LoginUserInfo userInfo = CurrentUserHolder.getUser();
        return ResponseResult.success(deskService.foodLicensePendingList(deskRequest,userInfo   ));
    }
    @ApiOperation("待处理-京东外卖")
    @PostMapping("/JingDongPendingList")
    public ResponseResult<PageInfo<PreparationCommonPendingVO>> JingDongPendingList(@RequestBody DeskRequest deskRequest) {
        LoginUserInfo userInfo = CurrentUserHolder.getUser();
        return ResponseResult.success(deskService.JingDongPendingList(deskRequest,userInfo   ));
    }
    @ApiOperation("提交业务备注")
    @PostMapping("/submitBusinessRemark")
    public ResponseResult<Integer> submitBusinessRemark(@RequestBody BusinessRemarkRequest request) {
        LoginUserInfo userInfo = CurrentUserHolder.getUser();
        return ResponseResult.success(deskService.submitBusinessRemark(request,userInfo));
    }

    @ApiOperation("待处理-查询运营顾问待分配门店信息")
    @PostMapping("/assignPendingList")
    public ResponseResult<PageInfo<OperationsConsultantAssignVO>> assignPendingList(@RequestBody AssignPendingRequest request) {
        LoginUserInfo userInfo = CurrentUserHolder.getUser();
        return ResponseResult.success(deskService.assignPendingList(request, userInfo));
    }

    @ApiOperation("待处理-设备通知")
    @PostMapping("/deliveryPendingList")
    public ResponseResult<PageInfo<DeliveryPendingVO>> deliveryPendingList(@RequestBody AssignPendingRequest request) {
        LoginUserInfo userInfo = CurrentUserHolder.getUser();
        return ResponseResult.success(deskService.deliveryPendingList(request, userInfo));
    }
}
