| | |
| | | import java.util.Set;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | | import javax.management.monitor.Monitor;
|
| | |
|
| | | import com.moral.entity.*;
|
| | | import com.moral.mapper.DictionaryDataMapper;
|
| | |
|
| | | import com.moral.mapper.MonitorPointMapper;
|
| | | import com.moral.service.MonitorPointService;
|
| | | import org.apache.commons.lang3.StringUtils;
|
| | | import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
| | | import org.springframework.stereotype.Service;
|
| | |
| | | @Resource
|
| | | private OrganizationMapper organizationMapper;
|
| | |
|
| | | @Resource
|
| | | private MonitorPointService monitorPointService;
|
| | |
|
| | | @Resource
|
| | | private MonitorPointMapper monitorPointMapper;
|
| | |
|
| | | @Override
|
| | | public Map<String, Object> getAccountInfoById(String accountId) {
|
| | |
| | | result.put("accountId", -1);
|
| | | } else {
|
| | | result = judgeAccountInfo(account);
|
| | | String regionCode = getRegionCodeByAccount(account);
|
| | | if (!String.valueOf(result.get("accountId")).equals("-1")) {
|
| | | List<MonitorPoint> monitorPoints = new ArrayList<>();
|
| | | if (account.getOrganizationId().equals(dictionaryDataMapper.selectSupperOrgId())) {
|
| | | Map<String, Object> paramMap = new HashMap<>();
|
| | | paramMap.put("regionCode", regionCode);
|
| | | paramMap.put("organizationId", account.getOrganizationId());
|
| | | monitorPoints = monitorPointService.getMonitorPointsAndDevicesByRegion(paramMap);
|
| | | } else {
|
| | | Set<Integer> orgIds = organizationService.getChildOrganizationIds(account.getOrganizationId());
|
| | | orgIds.add(account.getOrganizationId());
|
| | | monitorPoints = monitorPointService.getMonitorPointsByOrganizationIds(orgIds);
|
| | | }
|
| | | List<Integer> monitorPointIds = new ArrayList<>();
|
| | | monitorPoints.forEach(value -> {
|
| | | monitorPointIds.add(value.getId());
|
| | | });
|
| | |
|
| | | List<Menu> menuList = accountMapper.getScreenMenuListsByAccountName(account.getAccountName());
|
| | | result.put("msg", "获取成功!");
|
| | | result.put("accountId", account.getId());
|
| | | result.put("orgId", account.getOrganizationId());
|
| | | result.put("data", menuList);
|
| | | String regionCode = getRegionCodeByAccount(account);
|
| | | if (!ObjectUtils.isEmpty(regionCode))
|
| | | result.put("regionCode", regionCode);
|
| | | result.put("regionCode", regionCode);
|
| | | result.put("monitorPointIds", monitorPointIds);
|
| | | setOrgIdsByAccount(result);
|
| | | }
|
| | | }
|
| | |
| | | /**
|
| | | * @Description: 根据id获取默认显示的地区码
|
| | | * @Param: [params]
|
| | | * @return: java.util.Map<java.lang.String , java.lang.Object>
|
| | | * @return: java.util.Map<java.lang.String , java.lang.Object>
|
| | | * @Author: 下雨听风
|
| | | * @Date: 2020/11/25
|
| | | */
|
| | |
| | | return (String) regionCodeAndType.get("regionCode");
|
| | | }
|
| | |
|
| | | public Map<String, Object> getRegionCodeAndTypeByOrg(Organization organization) {
|
| | | public Map<String, Object> getRegionCodeAndTypeByOrg(Organization organization) {
|
| | | Map<String, Object> result = new HashMap<>();
|
| | | String regionCode = "";
|
| | | String regionType = "";
|