package com.yuchen.saas.park.service.controller.basic;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.yuchen.saas.park.api.dto.park.PmgBatParkCompanyPersonDto;
import com.yuchen.saas.park.api.dto.property.SaasParkPropertyBillArrearsDto;
import com.yuchen.saas.park.api.vo.park.PmgBatParkCompanyPersonVo;
import com.yuchen.saas.park.api.vo.property.SaasParkPropertyBillArrearsVo;
import com.yuchen.saas.park.service.service.IPmgBatParkCompanyPersonService;
import com.yuchen.saas.park.service.service.property.ISaasParkPropertyBillArrearsService;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.nest.springwrap.core.mp.support.Query;
import org.nest.springwrap.core.tool.api.R;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;

/**
 * <p>
 * 人员中心+-企业租客-企业成员 前端控制器
 * </p>
 *
 * @author baichaojie
 * @since 2024-11-05
 */
@Slf4j
@RestController
@RequiredArgsConstructor
@RequestMapping("/pmgBatParkCompanyPerson")
public class PmgBatParkCompanyPersonController {

    private final IPmgBatParkCompanyPersonService baseService;


    /**
     * 人员中心+-企业租客-企业成员 列表查询
     * @param pmgBatParkCompanyPersonDto
     * @param query
     * @return
     */
    @GetMapping("/pageByParam")
    @ApiOperationSupport(order = 1)
    @ApiOperation(value = "人员中心+-企业租客-企业成员  列表查询", notes = "人员中心+-企业租客-企业成员  列表查询")
    public R<IPage<PmgBatParkCompanyPersonVo>> pageByParam(@Valid PmgBatParkCompanyPersonDto pmgBatParkCompanyPersonDto, Query query) {
        R<IPage<PmgBatParkCompanyPersonVo>> pages =baseService.getList(pmgBatParkCompanyPersonDto, query);
        return pages;
    }


    /**
     * 物业-收费-前台收费-收银台-欠费列表 新增或修改
     * @param req
     * @return
     */
    @PostMapping("/saveOrUpdate")
    @ApiOperationSupport(order = 2)
    @ApiOperation(value = "人员中心+-企业租客-企业成员  新增或修改", notes = "人员中心+-企业租客-企业成员  新增或修改")
    public R saveOrUpdate(@Valid @RequestBody PmgBatParkCompanyPersonDto req) {
        return R.data(baseService.saveOrUpdateByParam(req));
    }


    /**
     * 人员中心+-企业租客-企业成员  删除
     * @param pmgBatParkCompanyPersonDto
     * @return
     */
    @PostMapping("/removeId")
    @ApiOperationSupport(order = 3)
    @ApiOperation(value = "人员中心+-企业租客-企业成员  删除", notes = "人员中心+-企业租客-企业成员  删除")
    public R removeId(@RequestBody PmgBatParkCompanyPersonDto pmgBatParkCompanyPersonDto) {
        return R.data(baseService.removeById(pmgBatParkCompanyPersonDto.getId()));
    }



    /**
     * 人员中心+-企业租客-企业成员  导出
     * @param reqDTO
     * @param response
     * @tag
     */
    @PostMapping("/export")
    @ApiOperationSupport(order = 4)
    @ApiOperation(value = "人员中心+-企业租客-企业成员 导出", notes = "人员中心+-企业租客-企业成员 导出")
    public void export(@RequestBody PmgBatParkCompanyPersonDto reqDTO, HttpServletResponse response){
        baseService.export(reqDTO,response);
    }


}
