| 
					
				 | 
			
			
				@ -11,9 +11,12 @@ import io.swagger.annotations.ApiOperation; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import io.swagger.annotations.ApiParam; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import net.sf.json.JSONArray; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import net.sf.json.JsonConfig; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import org.apache.commons.collections.CollectionUtils; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import org.springframework.beans.factory.annotation.Autowired; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import org.springframework.http.MediaType; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import org.springframework.jdbc.core.JdbcTemplate; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import org.springframework.web.bind.annotation.RequestMapping; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import org.springframework.web.bind.annotation.RequestMethod; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import org.springframework.web.bind.annotation.RequestParam; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import org.springframework.web.bind.annotation.RestController; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -43,8 +46,10 @@ public class AdapterCenterEndPoint extends BaseController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private AdapterDictService adapterDictService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private AdapterDictEntryService adapterDictEntryService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private JdbcTemplate jdbcTemplate; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @RequestMapping(value="/schema/list",produces = MediaType.APPLICATION_JSON_UTF8_VALUE) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @RequestMapping(value="/schema/list", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @ApiOperation(value = "获取版本号列表",  produces = "application/json", notes = "获取版本号列表") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public String getSchema(@ApiParam(name = "filters", value = "过滤器,为空检索所有条件", defaultValue = "") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                              @RequestParam(value = "filters", required = false) String filters) throws ParseException { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -54,7 +59,7 @@ public class AdapterCenterEndPoint extends BaseController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @RequestMapping(value="/version/list",produces = MediaType.APPLICATION_JSON_UTF8_VALUE) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @RequestMapping(value="/version/list", method = RequestMethod.GET,produces = MediaType.APPLICATION_JSON_UTF8_VALUE) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @ApiOperation(value = "获取版本号列表",  produces = "application/json", notes = "获取版本号列表") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public String getVersions(@ApiParam(name = "filters", value = "过滤器,为空检索所有条件", defaultValue = "") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                              @RequestParam(value = "filters", required = false) String filters) throws ParseException { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -65,7 +70,7 @@ public class AdapterCenterEndPoint extends BaseController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        return json.toString(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @RequestMapping(value="/dataset/list",produces = MediaType.APPLICATION_JSON_UTF8_VALUE) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @RequestMapping(value="/dataset/list", method = RequestMethod.GET,produces = MediaType.APPLICATION_JSON_UTF8_VALUE) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @ApiOperation(value = "获取适配数据集列表",  produces = "application/json", notes = "获取适配数据集列表") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public String getDatasetList(@ApiParam(name = "filters", value = "过滤器,为空检索所有条件", defaultValue = "") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                             @RequestParam(value = "filters", required = false) String filters, 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -76,7 +81,7 @@ public class AdapterCenterEndPoint extends BaseController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        return json.toString(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @RequestMapping(value = "/metadata/list",produces = MediaType.APPLICATION_JSON_UTF8_VALUE) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @RequestMapping(value = "/metadata/list", method = RequestMethod.GET,produces = MediaType.APPLICATION_JSON_UTF8_VALUE) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @ApiOperation(value = "获取适配数据元列表",  produces = "application/json", notes = "获取适配数据元列表") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public String getMetadataList(@ApiParam(name = "filters", value = "过滤器,为空检索所有条件", defaultValue = "") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                          @RequestParam(value = "filters", required = false) String filters, 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -87,7 +92,7 @@ public class AdapterCenterEndPoint extends BaseController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        return json.toString(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @RequestMapping(value = "/dict/list",produces = MediaType.APPLICATION_JSON_UTF8_VALUE) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @RequestMapping(value = "/dict/list", method = RequestMethod.GET,produces = MediaType.APPLICATION_JSON_UTF8_VALUE) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @ApiOperation(value = "获取标准字典列表",  produces = "application/json", notes = "获取标准字典列表") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public String getDictList(@ApiParam(name = "filters", value = "过滤器,为空检索所有条件", defaultValue = "") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                  @RequestParam(value = "filters", required = false) String filters, 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -98,7 +103,7 @@ public class AdapterCenterEndPoint extends BaseController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        return json.toString(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @RequestMapping(value = "/dictItem/list",produces = MediaType.APPLICATION_JSON_UTF8_VALUE) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @RequestMapping(value = "/dictItem/list", method = RequestMethod.GET,produces = MediaType.APPLICATION_JSON_UTF8_VALUE) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @ApiOperation(value = "获取标准字典项列表",  produces = "application/json", notes = "获取标准字典项列表") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public String getDictItemList(@ApiParam(name = "filters", value = "过滤器,为空检索所有条件", defaultValue = "") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                  @RequestParam(value = "filters", required = false) String filters, 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -109,7 +114,7 @@ public class AdapterCenterEndPoint extends BaseController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        return json.toString(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @RequestMapping(value="/dataset/pageList",produces = MediaType.APPLICATION_JSON_UTF8_VALUE) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @RequestMapping(value="/dataset/pageList", method = RequestMethod.GET,produces = MediaType.APPLICATION_JSON_UTF8_VALUE) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @ApiOperation(value = "分页获取适配数据集列表",  produces = "application/json", notes = "分页获取适配数据集列表") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public Collection<AdapterDatasetModel> datasetPageList( 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @ApiParam(name = "version", value = "版本", defaultValue = "") 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -133,7 +138,7 @@ public class AdapterCenterEndPoint extends BaseController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        return convertToModels(ls, new ArrayList<>(ls.size()), AdapterDatasetModel.class, fields); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @RequestMapping(value="/metadata/pageList",produces = MediaType.APPLICATION_JSON_UTF8_VALUE) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @RequestMapping(value="/metadata/pageList", method = RequestMethod.GET,produces = MediaType.APPLICATION_JSON_UTF8_VALUE) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @ApiOperation(value = "分页获取适配数据元列表",  produces = "application/json", notes = "分页获取适配数据元列表") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public Collection<AdapterMetadataModel> metadataPageList( 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @ApiParam(name = "version", value = "版本", defaultValue = "") 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -158,5 +163,29 @@ public class AdapterCenterEndPoint extends BaseController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @RequestMapping(value="/last/adapterVersion" ,method = RequestMethod.GET) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @ApiOperation(value = "获取2家机构适配的最新版本号",  notes = "获取2家机构适配的最新版本号") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public String getLastAdapterVersion( 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            @ApiParam(name = "originOrgCode", value = "源机构编码[eip的机构表]如,jkzl", defaultValue = "") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            @RequestParam(value = "originOrgCode") String originOrgCode, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            @ApiParam(name = "targetOrgCode", value = "目标机构编码[eip的机构表],如上传 江西省平台的机构编码", defaultValue = "") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            @RequestParam(value = "targetOrgCode") String targetOrgCode){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String sql = String.format("select id from adapter_scheme where adapter_publisher_org_code='%s' and std_publisher_org_code='%s'",originOrgCode,targetOrgCode); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        List<Long> idList = jdbcTemplate.queryForList(sql,Long.class); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String version = ""; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if(CollectionUtils.isNotEmpty(idList)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            String ids = ""; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            for(Long id:idList){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                ids+=","+id; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            ids = ids.substring(1,ids.length()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            List<String> versions = jdbcTemplate.queryForList("select version from adapter_scheme_version where scheme_id in ("+ids+") and publish_status=1 order by publish_time desc",String.class); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if(CollectionUtils.isNotEmpty(versions)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                version = versions.get(0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        return version; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				} 
			 |