ServiceAdministerMappingServiceImpl.java
1.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
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;
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-01-11
*/
@Service
public class ServiceAdministerMappingServiceImpl extends ServiceImpl<ServiceAdministerMappingMapper, ServiceAdministerMappingDO> implements ServiceAdministerMappingService {
@Autowired
private AdministerMapper administerMapper;
@Autowired
private ServiceCompanyMappingMapper serviceCompanyMappingMapper;
public List<AdministerServicesVO> administerServices(AdministerCompanyMappingDO administerCompanyMappingDO) {
AdministerDO administerDO = administerMapper.selectById(administerCompanyMappingDO.getAdministerId());
if (3 == administerDO.getRole() || 1 == administerDO.getRole()) {
//返回企业全部的
return serviceCompanyMappingMapper.companyService(administerCompanyMappingDO.getCompanyId());
} else {
//返回企业中授权给这个人的应用
return serviceCompanyMappingMapper.companyAdministerService(administerCompanyMappingDO.getCompanyId(),administerCompanyMappingDO.getAdministerId());
}
}
}