Blame view

ServiceAdministerMappingServiceImpl.java 1.64 KB
涂亚平 committed
1 2 3 4 5 6 7 8
package com.subsidy.service.impl;

import com.subsidy.mapper.AdministerMapper;
import com.subsidy.mapper.ServiceCompanyMappingMapper;
import com.subsidy.model.*;
import com.subsidy.mapper.ServiceAdministerMappingMapper;
import com.subsidy.service.ServiceAdministerMappingService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
9
import com.subsidy.vo.administer.AdministerServicesVO;
涂亚平 committed
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 应用账户-服务映射表 服务实现类
 * </p>
 *
 * @author Tuyp
 * @since 2024-01-11
 */
@Service
public class ServiceAdministerMappingServiceImpl extends ServiceImpl<ServiceAdministerMappingMapper, ServiceAdministerMappingDO> implements ServiceAdministerMappingService {


    @Autowired
    private AdministerMapper administerMapper;

    @Autowired
    private ServiceCompanyMappingMapper serviceCompanyMappingMapper;

33
    public List<AdministerServicesVO> administerServices(AdministerCompanyMappingDO administerCompanyMappingDO) {
涂亚平 committed
34 35 36 37 38 39 40

        AdministerDO administerDO = administerMapper.selectById(administerCompanyMappingDO.getAdministerId());
        if (3 == administerDO.getRole() || 1 == administerDO.getRole()) {
            //返回企业全部的
            return serviceCompanyMappingMapper.companyService(administerCompanyMappingDO.getCompanyId());
        } else {
            //返回企业中授权给这个人的应用
涂亚平 committed
41
            return serviceCompanyMappingMapper.companyAdministerService(administerCompanyMappingDO.getCompanyId(),administerCompanyMappingDO.getAdministerId());
涂亚平 committed
42 43 44 45
        }
    }

}