package com.dk.mdm.controller.wxapi.basic;


import com.dk.common.model.wxapi.wxResponse.WxCommonResponse;
import com.dk.common.response.ResponseResultVO;
import com.dk.mdm.model.query.wxapi.basic.WxCommonQuery;
import com.dk.mdm.service.wxapi.basic.WxCommonService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author : admin
 * @desc : wx-控件数据源API
 * @date : 2024/2/22 17:21
 */
@Api(tags = "控件数据源API")
@RestController
@RequestMapping("/wxapi/basic/common")
public class WxCommonController {

    @Autowired
    private WxCommonService wxCommonService;

    @ApiOperation(
            value = "获取页面初始加载数据",
            notes = "获取页面初始加载数据"
    )
    @PostMapping("get_wx_init_data")
    public ResponseResultVO<?> getWxInitData(@RequestBody WxCommonQuery wxCommonQuery) {
       return wxCommonService.getWxInitData(wxCommonQuery);
    }
    @PostMapping("get_estate_type")
    public ResponseResultVO<?> getEstate(@RequestBody WxCommonQuery wxCommonQuery) {
        return wxCommonService.getEstate(wxCommonQuery);
    }



    /**
     * @desc : 根据组织机构 查询销售渠道
     * @author : 王英杰
     * @date : 2022/6/14 19:52
     */
    @PostMapping({"select_salechannel_by_org"})
    public ResponseResultVO<WxCommonResponse> selectSaleChannelByOrg(@RequestBody WxCommonQuery wxCommonQuery) {
        return wxCommonService.selectSaleChannelByOrg(wxCommonQuery);
    }

    /**
     * @desc :  查询组织机构下的结算方式
     * @author : 王英杰
     * @date : 2022/6/14 19:52
     */
    @PostMapping({"select_settlement_by_org"})
    public ResponseResultVO<List<WxCommonResponse>> selectSettlementByOrg(@RequestBody WxCommonQuery wxCommonQuery) {
        return wxCommonService.selectSettlementByOrg(wxCommonQuery);
    }

    /**
     * @desc   : 查询供应商与客户
     * @author : 孙超
     * @date   : 2023/09/05 17:17
     */
    @PostMapping({"get_supplier_and_customer"})
    public ResponseResultVO<?> getSupplierAndCustomer(@RequestBody WxCommonQuery wxCommonQuery) {
        return wxCommonService.getSupplierAndCustomer(wxCommonQuery);
    }
}
