ServiceAdministerMappingServiceImpl.java 1.71 KB
package com.subsidy.service.impl;

import com.subsidy.mapper.AdministerMapper;
import com.subsidy.mapper.ServiceDictMapper;
import com.subsidy.model.AdministerDO;
import com.subsidy.model.AdministerLaborMappingDO;
import com.subsidy.model.ServiceAdministerMappingDO;
import com.subsidy.mapper.ServiceAdministerMappingMapper;
import com.subsidy.model.ServiceDictDO;
import com.subsidy.service.ServiceAdministerMappingService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.subsidy.vo.administer.AdministerServicesVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

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

    @Autowired
    private AdministerMapper administerMapper;

    @Autowired
    private ServiceDictMapper serviceDictMapper;

    public List<ServiceDictDO> administerServices(AdministerLaborMappingDO administerLaborMappingDO) {
        List<ServiceDictDO> serviceDictDOS = administerMapper.administerServices(administerLaborMappingDO.getAdministerId());
        AdministerDO administerDO = administerMapper.selectById(administerLaborMappingDO.getAdministerId());
        if (administerDO.getRole()==6 || administerDO.getRole() ==7){
            //如果是伙伴账户的话,就把也返回
            ServiceDictDO serviceDictDO = serviceDictMapper.selectById(5);
            serviceDictDOS.add(serviceDictDO);
        }
        return serviceDictDOS;
    }

}