| | |
| | |
|
| | | import com.moral.entity.*;
|
| | | import com.moral.mapper.DictionaryDataMapper;
|
| | |
|
| | | import org.apache.commons.lang3.StringUtils;
|
| | | import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
| | | import org.springframework.stereotype.Service;
|
| | |
| | | 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);
|
| | | setOrgIdsByAccount(result);
|
| | | }
|
| | | }
|
| | |
| | | result.put("accountId", -1);
|
| | | } else {
|
| | | result = judgeAccountInfo(account);
|
| | | if (!result.get("accountId").equals(-1)){
|
| | | String regionCode = getRegionCodeByAccount(account);
|
| | | if(!ObjectUtils.isEmpty(regionCode))
|
| | | result.put("regionCode",regionCode);
|
| | | }
|
| | |
|
| | | }
|
| | | return 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
|
| | | */
|
| | |
| | | organization.setId(account.getOrganizationId());
|
| | | organization = organizationMapper.selectOne(organization);
|
| | | Map<String, Object> regionCodeAndType = getRegionCodeAndTypeByOrg(organization);
|
| | | if(ObjectUtils.isEmpty(regionCodeAndType))
|
| | | if (ObjectUtils.isEmpty(regionCodeAndType))
|
| | | return null;
|
| | | return (String) regionCodeAndType.get("regionCode");
|
| | | }
|
| | |
|
| | | public static Map<String,Object> getRegionCodeAndTypeByOrg(Organization organization){
|
| | | Map<String,Object> result = new HashMap<>();
|
| | | public Map<String, Object> getRegionCodeAndTypeByOrg(Organization organization) {
|
| | | Map<String, Object> result = new HashMap<>();
|
| | | String regionCode = "";
|
| | | String regionType = "";
|
| | | Long villageCode = organization.getVillageCode();
|
| | |
| | | Integer cityCode = organization.getCityCode();
|
| | | Integer provinceCode = organization.getProvinceCode();
|
| | |
|
| | | if(!ObjectUtils.isEmpty(villageCode)){
|
| | | if (!ObjectUtils.isEmpty(villageCode)) {
|
| | | regionCode = String.valueOf(villageCode);
|
| | | regionType = "village";
|
| | | }else if(!ObjectUtils.isEmpty(townCode)){
|
| | | } else if (!ObjectUtils.isEmpty(townCode)) {
|
| | | regionCode = String.valueOf(townCode);
|
| | | regionType = "town";
|
| | | }else if(!ObjectUtils.isEmpty(areaCode)){
|
| | | } else if (!ObjectUtils.isEmpty(areaCode)) {
|
| | | regionCode = String.valueOf(areaCode);
|
| | | regionType = "area";
|
| | | }else if(!ObjectUtils.isEmpty(cityCode)){
|
| | | } else if (!ObjectUtils.isEmpty(cityCode)) {
|
| | | regionCode = String.valueOf(cityCode);
|
| | | regionType = "city";
|
| | | }else if(!ObjectUtils.isEmpty(provinceCode)){
|
| | | } else if (!ObjectUtils.isEmpty(provinceCode)) {
|
| | | regionCode = String.valueOf(provinceCode);
|
| | | regionType = "province";
|
| | | }else{
|
| | | } else {
|
| | | return null;
|
| | | }
|
| | | result.put("regionCode",regionCode);
|
| | | result.put("regionType",regionType);
|
| | | result.put("regionCode", regionCode);
|
| | | result.put("regionType", regionType);
|
| | | return result;
|
| | | }
|
| | | }
|