| | |
| | | import javax.servlet.http.HttpServletRequest;
|
| | |
|
| | | import com.alibaba.fastjson.*;
|
| | | import com.moral.common.util.BeanUtils;
|
| | | import com.moral.common.util.ParameterUtils;
|
| | | import com.moral.common.util.StringUtils;
|
| | | import com.moral.entity.*;
|
| | |
| | | import com.moral.entity.layout.RealTimeDeviceLayout;
|
| | | import com.moral.service.*;
|
| | | import org.apache.commons.collections.CollectionUtils;
|
| | | import org.apache.commons.lang.math.NumberUtils;
|
| | | import org.apache.commons.net.ftp.FTPClient;
|
| | | import org.apache.log4j.Logger;
|
| | | import org.dom4j.Document;
|
| | |
| | | StringBuilder areaNamesBuilder = new StringBuilder("中国");
|
| | | if(!((Integer) orgId).equals(dictionaryDataService.querySupperOrgId())) {
|
| | | Organization organization = organizationService.getOrganizationById((Integer) orgId);
|
| | | if(organization.getAreaNames()!=null){
|
| | | AreaNames areaNames = organization.getAreaNames();
|
| | | if(!StringUtils.isNullOrEmpty(areaNames.getProvinceName())){
|
| | | areaNamesBuilder.append("/");
|
| | | areaNamesBuilder.append(areaNames.getProvinceName());
|
| | | if(!StringUtils.isNullOrEmpty(areaNames.getCityName())){
|
| | | areaNamesBuilder.append("/");
|
| | | areaNamesBuilder.append(areaNames.getCityName());
|
| | | if(!StringUtils.isNullOrEmpty(areaNames.getAreaName())){
|
| | | areaNamesBuilder.append("/");
|
| | | areaNamesBuilder.append(areaNames.getAreaName());
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | 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( 0 == organization.getRank()) {
|
| | | 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 );
|
| | | }
|
| | | resultMap.put("mapPath",areaNamesBuilder.toString());
|
| | | }
|