MerchantStaffPersonalController.java 11.4 KB
package cn.com.glsx.stoassistant.controller;

import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.com.glsx.framework.rop.response.RopResponse;
import cn.com.glsx.scrm.shopmall.model.ShopmallStaffMotivationOperation;
import cn.com.glsx.stoassistant.model.response.score.MerchantStaffScoreListRpcResponse;
import cn.com.glsx.stoassistant.request.CommonIdRequest;
import cn.com.glsx.stoassistant.request.cusgroup.MerchantIdRopRequest;
import cn.com.glsx.stoassistant.request.cusgroup.WelfareGroupRopRequest;
import cn.com.glsx.stoassistant.request.merchant.MerchantBaseInfoRequest;
import cn.com.glsx.stoassistant.request.withdrawal.MerchantStaffScoreSearchRopRequest;
import cn.com.glsx.stoassistant.request.withdrawal.MerchantStaffWithdrawalBankRequest;
import cn.com.glsx.stoassistant.request.withdrawal.MerchantStaffWithdrawalInsertRopRequest;
import cn.com.glsx.stoassistant.response.custgroup.GameTaskCustomerRopResponse;
import cn.com.glsx.stoassistant.response.custgroup.GroupCountRopResponse;
import cn.com.glsx.stoassistant.response.custgroup.StaffWelfareGroupDetailRopResponse;
import cn.com.glsx.stoassistant.response.score.MerchantStaffScoreDetailRopResponse;
import cn.com.glsx.stoassistant.response.score.MerchantStaffScoreListRopResponse;
import cn.com.glsx.stoassistant.response.score.MerchantStaffWithdrawalBankVO;
import cn.com.glsx.stoassistant.response.withdrawal.MerchantStaffWithdrawalListRopResponse;
import cn.com.glsx.stoassistant.service.MerchantStaffPersonalService;
import cn.com.glsx.stoassistant.service.WechatCloudWelfareGroupService;
import cn.com.glsx.stoassistant.utils.Pagination;
import com.rop.annotation.NeedInSessionType;
import com.rop.annotation.ServiceMethod;
import com.rop.annotation.ServiceMethodBean;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * @ClassName MerchantStaffScoreController
 * @Description
 * @Author lichongyuan
 * @Date 2022/10/15
 */
@Slf4j
@Api("员工个人中心接口")
@ServiceMethodBean(version = "1.0.0", needInSession = NeedInSessionType.YES)
public class MerchantStaffPersonalController {

    @Autowired
    private MerchantStaffPersonalService merchantStaffPersonalService;

    @Autowired
    private WechatCloudWelfareGroupService welfareGroupService;
    /**
     * 个人中心-员工积分详情
     *
     * @param request 入参
     * @return
     */
    @ServiceMethod(method = "stoassistant.api.score.detail", needInSession = NeedInSessionType.YES)
    @ApiOperation("个人中心-员工积分详情")
    public RopResponse<MerchantStaffScoreDetailRopResponse> getStaffScoreDetail(MerchantStaffScoreSearchRopRequest request) {
        try {
            MerchantStaffScoreDetailRopResponse response = merchantStaffPersonalService.getStaffScoreDetail(request);
            return RopResponse.success(response);
        } catch (RpcServiceException e) {
            log.info("=======MerchantStaffPersonalController__invoke__getStaffScoreDetail__exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        }
    }

    /**
     * 个人中心-员工提现列表
     *
     * @param request 入参
     * @return
     */
    @ServiceMethod(method = "stoassistant.api.withdrawal.list", needInSession = NeedInSessionType.YES)
    @ApiOperation("个人中心-员工提现列表")
    public RopResponse<List<MerchantStaffWithdrawalListRopResponse>> getWithdrawalList(MerchantStaffScoreSearchRopRequest request) {
        try {
            List<MerchantStaffWithdrawalListRopResponse> response = merchantStaffPersonalService.getWithdrawalList(request);
            return RopResponse.success(response);
        } catch (RpcServiceException e) {
            log.info("=======MerchantStaffPersonalController__invoke__getWithdrawalList__exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        }
    }

    /**
     * 单个提现
     *
     * @param request 入参
     * @return
     */
    @ServiceMethod(method = "stoassistant.api.withdrawal.insert", needInSession = NeedInSessionType.YES)
    @ApiOperation("单个提现")
    public RopResponse<Boolean> insertWithdrawal(MerchantStaffWithdrawalInsertRopRequest request) {
        try {
            merchantStaffPersonalService.insertWithdrawal(request);
            return RopResponse.success(true);
        } catch (RpcServiceException e) {
            log.info("=======MerchantStaffPersonalController__invoke__insertWithdrawal__exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        }
    }

    /**
     * 个人中心-积分列表
     *
     * @param request 入参
     * @return
     */
    @ServiceMethod(method = "stoassistant.api.score.list", needInSession = NeedInSessionType.YES)
    @ApiOperation("个人中心-积分收益列表")
    public RopResponse<Pagination<MerchantStaffScoreListRopResponse>> getStaffScoreList(MerchantStaffScoreSearchRopRequest request) {
        try {
            Pagination<MerchantStaffScoreListRopResponse> staffScoreList = merchantStaffPersonalService.getStaffScoreList(request);
            return RopResponse.success(staffScoreList);
        } catch (RpcServiceException e) {
            log.info("=======MerchantStaffPersonalController__invoke__getStaffScoreList__exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        }
    }

    @ServiceMethod(method = "stoassistant.api.score.list.detail", needInSession = NeedInSessionType.YES)
    @ApiOperation("个人中心-积分收益详情")
    public RopResponse<MerchantStaffScoreListRpcResponse> getStaffScoreDetail(CommonIdRequest request) {
        try {
            return RopResponse.success(merchantStaffPersonalService.getStaffScoreDetailById(request));
        } catch (RpcServiceException e) {
            log.info("=======MerchantStaffPersonalController__invoke__getStaffScoreDetail__exception:{}", e.getMessage());
            return RopResponse.error(e);
        }
    }

    @ApiOperation("客户活跃代运营的看板")
    @ServiceMethod(method = "scrm.api.stoassistant.wechat.cloud.welfare.statics", needInSession = NeedInSessionType.YES)
    public RopResponse<GroupCountRopResponse> selectWelfareStaticCountByStaff(WelfareGroupRopRequest request){
        try {
            GroupCountRopResponse response = welfareGroupService.selectWelfareStaticCountByStaff(request);
            return RopResponse.success(response);
        } catch (RpcServiceException e) {
            log.info("=======MerchantStaffPersonalController__invoke__selectWelfareStatics__exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        }
    }

    @ApiOperation("查询员工与福利官创建的群聊列表")
    @ServiceMethod(method = "scrm.api.stoassistant.wechat.cloud.welfare.group", needInSession = NeedInSessionType.YES)
    public RopResponse<List<StaffWelfareGroupDetailRopResponse>> selectWelfareGroupDetail(WelfareGroupRopRequest request){
        try {
            List<StaffWelfareGroupDetailRopResponse> response = welfareGroupService.selectWelfareGroupDetail(request);
            return RopResponse.success(response);
        } catch (RpcServiceException e) {
            log.info("=======MerchantStaffPersonalController__invoke__selectWelfareGroupDetail__exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        }
    }

    @ApiOperation("查询访客详情")
    @ServiceMethod(method = "scrm.api.stoassistant.wechat.cloud.welfare.customerVisit", needInSession = NeedInSessionType.NO)
    public RopResponse<List<GameTaskCustomerRopResponse>> taskCustomerVisitList(MerchantIdRopRequest request){
        try {
            List<GameTaskCustomerRopResponse> response = welfareGroupService.taskCustomerVisitList(request);
            return RopResponse.success(response);
        } catch (RpcServiceException e) {
            log.info("=======MerchantStaffPersonalController__invoke__customerVisit__exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        }
    }

    @ApiOperation("插入或更新员工银行卡信息")
    @ServiceMethod(method = "scrm.api.stoassistant.withdrawal.staff.bank.insetorupdate", needInSession = NeedInSessionType.YES)
    public RopResponse<Boolean> insertOrUpdateStaffBank(MerchantStaffWithdrawalBankRequest request){
        try {
            Boolean response = merchantStaffPersonalService.insertOrUpdateStaffBank(request);
            return RopResponse.success(response);
        } catch (RpcServiceException e) {
            log.info("=======MerchantStaffPersonalController__invoke__insertOrUpdateStaffBank__exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        }
    }

    @ApiOperation("根据员工id查询员工银行卡列表")
    @ServiceMethod(method = "scrm.api.stoassistant.withdrawal.staff.bank.list", needInSession = NeedInSessionType.YES)
    public RopResponse<List<MerchantStaffWithdrawalBankVO>> staffBankList(MerchantStaffWithdrawalBankRequest request){
        try {
            List<MerchantStaffWithdrawalBankVO> response = merchantStaffPersonalService.staffBankList(request);
            return RopResponse.success(response);
        } catch (RpcServiceException e) {
            log.info("=======MerchantStaffPersonalController__invoke__staffBankList__exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        }
    }

    @ApiOperation("根据id查询银行卡详情")
    @ServiceMethod(method = "scrm.api.stoassistant.withdrawal.staff.bank.detail", needInSession = NeedInSessionType.YES)
    public RopResponse<MerchantStaffWithdrawalBankVO> staffBankDetail(MerchantStaffWithdrawalBankRequest request){
        try {
            MerchantStaffWithdrawalBankVO response = merchantStaffPersonalService.staffBankDetail(request);
            return RopResponse.success(response);
        } catch (RpcServiceException e) {
            log.info("=======MerchantStaffPersonalController__invoke__staffBankDetail__exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        }
    }

    @ApiOperation("查询门店银行卡提现费率")
    @ServiceMethod(method = "scrm.api.stoassistant.withdrawal.staff.rate", needInSession = NeedInSessionType.NO)
    public RopResponse<String> getWithdrawalRate(MerchantBaseInfoRequest request){
        try {
            return RopResponse.success(merchantStaffPersonalService.getWithdrawalRate(request));
        } catch (RpcServiceException e) {
            log.info("=======MerchantStaffPersonalController__invoke__getWithdrawalRate__exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        }
    }

    @ApiOperation("查询指定订单的操作记录")
    @ServiceMethod(method = "scrm.api.stoassistant.staff.motivation.order.operation")
    public RopResponse<List<ShopmallStaffMotivationOperation>> getOrderOperation(MerchantStaffScoreSearchRopRequest request) {
        try {
            return RopResponse.success(merchantStaffPersonalService.getOrderOperation(request));
        } catch (RpcServiceException e) {
            log.info("=======MerchantStaffPersonalController__invoke__getWithdrawalRate__exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        }
    }

}