StaffController.java 5.71 KB
package com.glsk.controller2;

import com.glsk.service.BoutiqueService;
import com.glsk.service.BusinessAnalysisService2;
import com.glsk.vo.BusinessType;
import com.glsk.vo.QueryType;
import com.glsk.vo.ReqRet;
import com.glsk.vo.RopResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * @author fangfang
 * @create 2023-07-02 10:46
 */

@CrossOrigin(origins = "*")
@RestController
@RequestMapping("/staff")
@Api(value = "经营分析--员工", tags = {"经营分析--员工"})
public class StaffController {
    protected final Logger logger = LoggerFactory.getLogger(getClass());

    @Autowired
    private BusinessAnalysisService2 businessAnalysisService;

    @Autowired
    private BoutiqueService boutiqueService;


    @GetMapping("/getStaffList")
    @ApiOperation("获取员工列表")
    public RopResponse<ReqRet.StaffListRet> getStaffList(String merchantid,BusinessType business_type,String staffid,String staffname)  {
        logger.info("getStaffList:req=" );

        if(business_type.equals(BusinessType.qinggai)){
            ReqRet.StaffListRet ret = boutiqueService.getStaffList(merchantid,business_type,staffid,staffname);
            return RopResponse.success(ret);
        }else {
            ReqRet.StaffListRet ret = businessAnalysisService.getStaffList(merchantid,business_type,staffid,staffname);
            return RopResponse.success(ret);
        }
    }

    @GetMapping("/getStaffMerchantList")
    @ApiOperation("获取员工所在门店列表")
    public RopResponse<ReqRet.MerchantListRet> getStaffMerchantList(String merchantid,BusinessType business_type,String staffid,String ids)  {
        logger.info("getMerchantList:req=" );

        if(business_type.equals(BusinessType.qinggai)){
            ReqRet.MerchantListRet ret = boutiqueService.getStaffMerchantList(merchantid,business_type,staffid, ids);
            return RopResponse.success(ret);
        }else {
            ReqRet.MerchantListRet ret = businessAnalysisService.getStaffMerchantList(merchantid,business_type,staffid, ids);
            return RopResponse.success(ret);
        }

    }



    @GetMapping("/queryPerformanceFinishStatus")
    @ApiOperation("当前周期绩效完成情况")
    public RopResponse<ReqRet.PerformanceFinishStatusRet> queryPerformanceFinishStatus(String merchantid,String staffid,BusinessType business_type,
                                                                                    QueryType queryType  , String startDay,String endDay)  {
        logger.info("queryPerformanceFinishStatus:req=" );
        if(business_type.equals(BusinessType.qinggai)){
            ReqRet.PerformanceFinishStatusRet ret = boutiqueService.queryPerformanceFinishStatus(merchantid,staffid, business_type,queryType,startDay,endDay);
            return RopResponse.success(ret);
        }else {
            ReqRet.PerformanceFinishStatusRet ret = businessAnalysisService.queryPerformanceFinishStatus(merchantid,staffid, business_type,queryType,startDay,endDay);
            return RopResponse.success(ret);
        }

    }

    @GetMapping("/queryStaffOverview")
    @ApiOperation("员工总览信息")
    public RopResponse<ReqRet.StaffOverviewRet> queryStaffOverview(String merchantid, String staffid, BusinessType business_type,
                                                                   QueryType queryType  , String startDay, String endDay)  {
        logger.info("queryStaffOverview:req=" );

        if(business_type.equals(BusinessType.qinggai)){
            ReqRet.StaffOverviewRet ret = boutiqueService.queryStaffOverview(merchantid,staffid, business_type,queryType,startDay,endDay);
            return RopResponse.success(ret);
        }else {
            ReqRet.StaffOverviewRet ret = businessAnalysisService.queryStaffOverview(merchantid,staffid, business_type,queryType,startDay,endDay);
            return RopResponse.success(ret);
        }

    }


    @GetMapping("/queryStaffOutputTrend")
    @ApiOperation("查询员工产值趋势")
    public RopResponse<ReqRet.OutputTrendRet> queryStaffOutputTrend(String merchantid,String staffid, BusinessType business_type,
                                                                    QueryType queryType  , String startDay,String endDay)  {
        logger.info("queryStaffOutputTrend:req=" );


        if(business_type.equals(BusinessType.qinggai)){
            ReqRet.OutputTrendRet ret = boutiqueService.queryStaffOutputTrend(merchantid,staffid,business_type,queryType,startDay,endDay);
            return RopResponse.success(ret);
        }else {
            ReqRet.OutputTrendRet ret = businessAnalysisService.queryStaffOutputTrend(merchantid,staffid,business_type,queryType,startDay,endDay);
            return RopResponse.success(ret);
        }
    }




    @GetMapping("/getStaffWeekList")
    @ApiOperation("获取员工周列表")
    public RopResponse<ReqRet.WeekListRet> getStaffWeekList(BusinessType business_type, String merchantid, String staffid)  {
        logger.info("getStaffWeekList:req=" );

        if(business_type.equals(BusinessType.qinggai)){
            ReqRet.WeekListRet ret = boutiqueService.getStaffWeekList(business_type,merchantid,staffid);
            return RopResponse.success(ret);
        }else {
            ReqRet.WeekListRet ret = businessAnalysisService.getStaffWeekList(business_type,merchantid,staffid);
            return RopResponse.success(ret);
        }
    }


















}