|  | @ -5,6 +5,7 @@ import com.fasterxml.jackson.databind.node.ObjectNode;
 | 
	
		
			
				|  |  | import com.yihu.ehr.basic.address.service.AddressDictService;
 | 
	
		
			
				|  |  | import com.yihu.ehr.basic.org.model.Organization;
 | 
	
		
			
				|  |  | import com.yihu.ehr.basic.security.service.UserSecurityService;
 | 
	
		
			
				|  |  | import com.yihu.ehr.commons.constants.BasicServiceApi;
 | 
	
		
			
				|  |  | import com.yihu.ehr.constants.ApiVersion;
 | 
	
		
			
				|  |  | import com.yihu.ehr.constants.ServiceApi;
 | 
	
		
			
				|  |  | import com.yihu.ehr.controller.EnvelopRestEndPoint;
 | 
	
	
		
			
				|  | @ -56,7 +57,8 @@ public class OrgEndPoint extends EnvelopRestEndPoint {
 | 
	
		
			
				|  |  |     private OrgDeptService orgDeptService;
 | 
	
		
			
				|  |  |     @Autowired
 | 
	
		
			
				|  |  |     private AddressDictService addressDictService;
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     @Autowired
 | 
	
		
			
				|  |  |     private AddressDictService geographyDictService;
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     @RequestMapping(value = "/organizations/getAllOrgs", method = RequestMethod.GET, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
 | 
	
		
			
				|  |  |     @ApiOperation(value = "查询所有机构列表")
 | 
	
	
		
			
				|  | @ -591,48 +593,48 @@ public class OrgEndPoint extends EnvelopRestEndPoint {
 | 
	
		
			
				|  |  |         Map<String, String> map = new HashMap<>();
 | 
	
		
			
				|  |  |         String[] temp = null;
 | 
	
		
			
				|  |  |         temp = location.split("省");
 | 
	
		
			
				|  |  |         String str ="";
 | 
	
		
			
				|  |  |         for(int i=0;i<temp.length;i++){
 | 
	
		
			
				|  |  |             if(temp[0].indexOf("省")>0){
 | 
	
		
			
				|  |  |         String str = "";
 | 
	
		
			
				|  |  |         for (int i = 0; i < temp.length; i++) {
 | 
	
		
			
				|  |  |             if (temp[0].indexOf("省") > 0) {
 | 
	
		
			
				|  |  |                 //不包括直辖市、自治区
 | 
	
		
			
				|  |  |                 map.put("provinceName", temp[0]+"省");
 | 
	
		
			
				|  |  |                 map.put("provinceName", temp[0] + "省");
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  |             str=temp[temp.length-1];
 | 
	
		
			
				|  |  |             str = temp[temp.length - 1];
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         if (StringUtils.isNotEmpty(str)) {
 | 
	
		
			
				|  |  |             temp = str.split("市");
 | 
	
		
			
				|  |  |             str=temp[temp.length-1];
 | 
	
		
			
				|  |  |             if(temp.length>2){
 | 
	
		
			
				|  |  |                 map.put("cityName", temp[0]+"市");
 | 
	
		
			
				|  |  |                 map.put("district", temp[1]+"市");
 | 
	
		
			
				|  |  |             str = temp[temp.length - 1];
 | 
	
		
			
				|  |  |             if (temp.length > 2) {
 | 
	
		
			
				|  |  |                 map.put("cityName", temp[0] + "市");
 | 
	
		
			
				|  |  |                 map.put("district", temp[1] + "市");
 | 
	
		
			
				|  |  |                 map.put("street", temp[2]);
 | 
	
		
			
				|  |  |             }else if(temp.length>1){
 | 
	
		
			
				|  |  |                 map.put("cityName", temp[0]+"市");
 | 
	
		
			
				|  |  |             } else if (temp.length > 1) {
 | 
	
		
			
				|  |  |                 map.put("cityName", temp[0] + "市");
 | 
	
		
			
				|  |  |                 map.put("district", temp[1]);
 | 
	
		
			
				|  |  |                 temp = str.split("县");
 | 
	
		
			
				|  |  |                 if (temp.length>1) {
 | 
	
		
			
				|  |  |                     map.put("district", temp[0]+"县");
 | 
	
		
			
				|  |  |                 if (temp.length > 1) {
 | 
	
		
			
				|  |  |                     map.put("district", temp[0] + "县");
 | 
	
		
			
				|  |  |                     map.put("street", temp[1]);
 | 
	
		
			
				|  |  |                 }else{
 | 
	
		
			
				|  |  |                 } else {
 | 
	
		
			
				|  |  |                     temp = str.split("区");
 | 
	
		
			
				|  |  |                     if (temp.length>1) {
 | 
	
		
			
				|  |  |                         map.put("district", temp[0]+"区");
 | 
	
		
			
				|  |  |                     if (temp.length > 1) {
 | 
	
		
			
				|  |  |                         map.put("district", temp[0] + "区");
 | 
	
		
			
				|  |  |                         map.put("street", temp[1]);
 | 
	
		
			
				|  |  |                     }else {
 | 
	
		
			
				|  |  |                     } else {
 | 
	
		
			
				|  |  |                         map.put("street", temp[0]);
 | 
	
		
			
				|  |  |                     }
 | 
	
		
			
				|  |  |                 }
 | 
	
		
			
				|  |  |             }else{
 | 
	
		
			
				|  |  |             } else {
 | 
	
		
			
				|  |  |                 temp = str.split("县");
 | 
	
		
			
				|  |  |                 if (temp.length>1) {
 | 
	
		
			
				|  |  |                     map.put("district", temp[0]+"县");
 | 
	
		
			
				|  |  |                 if (temp.length > 1) {
 | 
	
		
			
				|  |  |                     map.put("district", temp[0] + "县");
 | 
	
		
			
				|  |  |                     map.put("street", temp[1]);
 | 
	
		
			
				|  |  |                 }else{
 | 
	
		
			
				|  |  |                 } else {
 | 
	
		
			
				|  |  |                     temp = str.split("区");
 | 
	
		
			
				|  |  |                     if (temp.length>1) {
 | 
	
		
			
				|  |  |                         map.put("district", temp[0]+"区");
 | 
	
		
			
				|  |  |                     if (temp.length > 1) {
 | 
	
		
			
				|  |  |                         map.put("district", temp[0] + "区");
 | 
	
		
			
				|  |  |                         map.put("street", temp[1]);
 | 
	
		
			
				|  |  |                     }else {
 | 
	
		
			
				|  |  |                     } else {
 | 
	
		
			
				|  |  |                         map.put("street", temp[0]);
 | 
	
		
			
				|  |  |                     }
 | 
	
		
			
				|  |  |                 }
 | 
	
	
		
			
				|  | @ -640,4 +642,39 @@ public class OrgEndPoint extends EnvelopRestEndPoint {
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         return map;
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     @RequestMapping(value = BasicServiceApi.Org.getAllOrgByAdministrativeDivision, method = RequestMethod.GET)
 | 
	
		
			
				|  |  |     @ApiOperation(value = "用户修改-按照区域获取机构;查询所有机构列表")
 | 
	
		
			
				|  |  |     public Envelop getAllOrgs(
 | 
	
		
			
				|  |  |             @ApiParam(name = "areaId", value = "区域id")
 | 
	
		
			
				|  |  |             @RequestParam(value = "areaId", required = false) Integer areaId,
 | 
	
		
			
				|  |  |             @ApiParam(name = "fullName", value = "机构名称")
 | 
	
		
			
				|  |  |             @RequestParam(value = "fullName", required = false) String fullName) {
 | 
	
		
			
				|  |  |         Envelop envelop = new Envelop();
 | 
	
		
			
				|  |  |         try {
 | 
	
		
			
				|  |  |             List<Organization> orgList;
 | 
	
		
			
				|  |  |             if (StringUtils.isEmpty(fullName)&&StringUtils.isNotEmpty(String.valueOf(areaId))) {
 | 
	
		
			
				|  |  |                 //区域id存在,机构名称不存在
 | 
	
		
			
				|  |  |                 orgList = orgService.findByOrgArea(areaId.toString());
 | 
	
		
			
				|  |  |             } else if (StringUtils.isNotEmpty(fullName)&&StringUtils.isEmpty(String.valueOf(areaId))) {
 | 
	
		
			
				|  |  |                 //区域id不存在,机构名称存在
 | 
	
		
			
				|  |  |                 String filters="fullName?" +fullName;
 | 
	
		
			
				|  |  |                 orgList =  orgService.search(null, filters, "createDate-", 1, 999);
 | 
	
		
			
				|  |  |             }else if (StringUtils.isNotEmpty(fullName)&&StringUtils.isNotEmpty(String.valueOf(areaId))) {
 | 
	
		
			
				|  |  |                 //区域和机构名称都存在
 | 
	
		
			
				|  |  |                 orgList = orgService.getOrgListByAreaidAndParam(areaId, fullName);
 | 
	
		
			
				|  |  |             }else {
 | 
	
		
			
				|  |  |                 envelop.setSuccessFlg(false);
 | 
	
		
			
				|  |  |                 envelop.setErrorMsg("区域和机构名称不能同时为空!");
 | 
	
		
			
				|  |  |                 return envelop;
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  |             envelop.setSuccessFlg(true);
 | 
	
		
			
				|  |  |             envelop.setDetailModelList(orgList);
 | 
	
		
			
				|  |  |         } catch (Exception e) {
 | 
	
		
			
				|  |  |             e.printStackTrace();
 | 
	
		
			
				|  |  |             envelop.setSuccessFlg(false);
 | 
	
		
			
				|  |  |             envelop.setErrorMsg(e.getMessage());
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         return envelop;
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | }
 |