| | |
| | | return resultMap; |
| | | } |
| | | |
| | | //弃用 |
| | | @UserLoginToken |
| | | @RequestMapping("getAccountInfoTest") |
| | | public Map<String, Object> getAccountInfoTest(@RequestBody Map<String, Object> parameters) { |
| | | Map<String, Object> resultMap = new HashMap<String, Object>(); |
| | | System.out.println(parameters); |
| | | if (!(parameters.containsKey("account") && parameters.containsKey("password"))) { |
| | | resultMap.put("msg", "用户名及密码不允许为空!"); |
| | | resultMap.put("accountId", -1); |
| | | } else { |
| | | resultMap = accountService.screenLoginNew(parameters); |
| | | // 添加返回行政区信息字符串操作 |
| | | Object orgId = resultMap.get("orgId"); |
| | | if (resultMap.get("orgId") != null && resultMap.get("orgId") instanceof Integer) { |
| | | StringBuilder areaNamesBuilder = new StringBuilder("中国"); |
| | | //判断是否为本公司开发者 |
| | | if (!((Integer) orgId).equals(dictionaryDataService.querySupperOrgId())) { |
| | | //不是本公司开发者则获取用户所属地区 |
| | | Organization organization = organizationService.getOrganizationById((Integer) orgId); |
| | | if (organization.getAreaNames() != null) { |
| | | Map<String, String> areaNameMap = BeanUtils.beanToMap(organization.getAreaNames()); |
| | | List<String> names = areaNameMap.entrySet().stream().filter(item -> { |
| | | return item.getValue() != null; |
| | | }).map(item -> { |
| | | return item.getValue(); |
| | | }).collect(Collectors.toList()); |
| | | AreaNames areaNames = organization.getAreaNames(); |
| | | areaNamesBuilder.append("/"); |
| | | areaNamesBuilder.append(String.join("/", names)); |
| | | } |
| | | // 企业用户 |
| | | if (organization.getRank() != null && organization.getRank() == 0) { |
| | | resultMap.put("type", "enterprise"); |
| | | } else { |
| | | resultMap.put("type", "government"); |
| | | } |
| | | Number mapAreaCode = null; |
| | | if (organization.getVillageCode() != null) { |
| | | mapAreaCode = organization.getVillageCode(); |
| | | } else if (organization.getTownCode() != null) { |
| | | mapAreaCode = organization.getTownCode(); |
| | | } else if (organization.getAreaCode() != null) { |
| | | mapAreaCode = organization.getAreaCode(); |
| | | } else if (organization.getCityCode() != null) { |
| | | mapAreaCode = organization.getCityCode(); |
| | | } else if (organization.getProvinceCode() != null) { |
| | | mapAreaCode = organization.getProvinceCode(); |
| | | } |
| | | resultMap.put("mapAreaCode", mapAreaCode.toString()); |
| | | } |
| | | resultMap.put("mapPath", areaNamesBuilder.toString()); |
| | | String accountId = String.valueOf(resultMap.get("accountId")); |
| | | resultMap.put("token", webTokenService.getToken(accountId)); |
| | | } |
| | | } |
| | | return resultMap; |
| | | } |
| | | |
| | | |
| | | @UserLoginToken |
| | | @GetMapping("report_avg_datas") |