| 
					
				 | 
			
			
				@ -1,211 +0,0 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				package com.yihu.ehr.standard.controller; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.ehr.framework.constrant.ErrorCode; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.ehr.framework.model.DictItem; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.ehr.framework.model.DictionaryResult; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.ehr.framework.util.controller.BaseController; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.ehr.standard.model.adapter.AdapterSchemeModel; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.ehr.standard.model.standard.StandardModel; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.ehr.standard.model.standard.StandardVersionModel; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.ehr.standard.service.adapter.AdapterSchemeService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.ehr.standard.service.standard.StandardService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.ehr.standard.service.standard.StandardVersionService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.ehr.standard.service.standard.StdPublisherService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.ehr.system.model.SystemOrganization; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import io.swagger.annotations.Api; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import io.swagger.annotations.ApiOperation; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import io.swagger.annotations.ApiParam; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import org.springframework.web.bind.annotation.PathVariable; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import org.springframework.web.bind.annotation.RequestMapping; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import org.springframework.web.bind.annotation.RequestParam; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import org.springframework.web.bind.annotation.RestController; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import javax.annotation.Resource; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import java.util.ArrayList; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import java.util.List; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				@RestController("AdapterController") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				@RequestMapping("/adapter") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				@Api(protocols = "https", value = "AdapterController", description = "适配管理", tags = {"适配"}) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				public class AdapterController extends BaseController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @Resource(name = AdapterSchemeService.BEAN_ID) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private AdapterSchemeService adapterSchemeService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @Resource(name = StandardService.BEAN_ID) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private StandardService standardService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @Resource(name = StandardVersionService.BEAN_ID) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private StandardVersionService standardVersionService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @Resource(name = StdPublisherService.BEAN_ID) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private StdPublisherService stdPublisherService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    /** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * 查询适配方案首页信息(get) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @param condition 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @return 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @throws Exception 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @RequestMapping(value = "/searchSchemesList") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @ApiOperation(value = "获取适配方案列表", response = AdapterSchemeModel.class, responseContainer = "List", produces = "application/json", notes = "获取适配方案列表") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public List<AdapterSchemeModel> getList( 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @ApiParam(name = "condition", value = "Search param,Must be json") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @RequestParam(value = "condition", required = false) String condition, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @ApiParam(name = "order", value = "Order param,Must be json.ascending:asc,descending:desc") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @RequestParam(value = "order", required = false) String order, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @ApiParam(name = "rows", value = "Limit the size of result set. Must be an integer") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @RequestParam(value = "rows", required = false) Integer rows, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @ApiParam(name = "page", value = "Start position of result set. Must be an integer") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @RequestParam(value = "page", required = false) Integer page) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        return adapterSchemeService.getEntityList(AdapterSchemeModel.class, condition, order, rows, page, ErrorCode.GetSchemeListFailed); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    /** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * 根据适配ID获取适配方案信息(get) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @param schemeId 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @return 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @throws Exception 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @RequestMapping(value = "/getForSchemeId") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @ApiOperation(value = "获取适配方案", response = AdapterSchemeModel.class, produces = "application/json", notes = "获取适配方案") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public AdapterSchemeModel get( 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @ApiParam(name = "schemeId", value = "标准版本ID") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @RequestParam(value = "schemeId") Integer schemeId) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        return adapterSchemeService.get(schemeId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    /** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * 修改适配(PUT) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @param scheme 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @return 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @throws Exception 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @RequestMapping("/updateScheme") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @ApiOperation(value = "修改适配方案", response = AdapterSchemeModel.class, produces = "application/json", notes = "修改适配方案") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public AdapterSchemeModel modify( 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @ApiParam(name = "scheme", value = "适配方案") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @RequestParam(value = "scheme") String scheme) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        return adapterSchemeService.update(scheme); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    /** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * 新增适配(POST) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @param scheme 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @return 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @throws Exception 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @RequestMapping(value = "/addScheme") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @ApiOperation(value = "保存适配方案", response = AdapterSchemeModel.class, produces = "application/json", notes = "保存适配方案") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public AdapterSchemeModel add( 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @ApiParam(name = "scheme", value = "适配方案信息") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @RequestParam(value = "scheme") String scheme) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        return adapterSchemeService.add(scheme); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    /** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * 删除适配(DELETE) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @param  schemeId 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @return 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @throws Exception 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @RequestMapping(value = "/deleteScheme") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @ApiOperation(value = "删除适配方案", produces = "application/json", notes = "删除适配方案") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public void delete( 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @ApiParam(name = "schemeId", value = "适配方案ID") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @RequestParam(value = "schemeId") Integer schemeId) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        adapterSchemeService.delete(schemeId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    /** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * 获取平台标准名称/应用标准名称列表 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @param condition 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @return 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @throws Exception 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @RequestMapping(value = "/getStandards") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @ApiOperation(value = "获取标准列表", response = DictionaryResult.class, produces = "application/json", notes = "获取标准列表") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public DictionaryResult getStandardList( 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @ApiParam(name = "condition", value = "Must be Json,其中type为区分集成与应用标准") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @RequestParam(value = "condition", required = false) String condition, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @ApiParam(name = "order", value = "Must be Json") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @RequestParam(value = "order", required = false) String order, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @ApiParam(name = "rows", value = "Limit the size of result set. Must be an integer") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @RequestParam(value = "rows", required = false) Integer rows, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @ApiParam(name = "page", value = "Start position of result set. Must be an integer") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @RequestParam(value = "page", required = false) Integer page) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        List<StandardModel> standardModelList = standardService.getList(condition, order, rows, page); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        DictionaryResult dictionaryResult = new DictionaryResult(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        List<DictItem> detailModelList = new ArrayList<DictItem>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        for(StandardModel standardModel : standardModelList){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            DictItem items = new DictItem(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            Integer id = standardModel.getId(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            items.setCode(id.toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            items.setValue(standardModel.getName()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            detailModelList.add(items); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        dictionaryResult.setDetailModelList(detailModelList); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        return dictionaryResult; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    /** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * 获取平台标准版本/应用标准版本列表 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @param standardId 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @return 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @throws Exception 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @RequestMapping(value = "/getVersions") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @ApiOperation(value = "获取标准版本列表", response = DictionaryResult.class, produces = "application/json", notes = "获取标准版本列表") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public DictionaryResult getVersionList( 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @ApiParam(name = "standardId", value = "标准ID") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @RequestParam(value = "standardId") Integer standardId, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @ApiParam(name = "condition", value = "Must be Json") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @RequestParam(value = "condition", required = false) String condition, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @ApiParam(name = "order", value = "Must be Json") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @RequestParam(value = "order", required = false) String order, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @ApiParam(name = "rows", value = "Limit the size of result set. Must be an integer") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @RequestParam(value = "rows", required = false) Integer rows, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @ApiParam(name = "page", value = "Start position of result set. Must be an integer") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @RequestParam(value = "page", required = false) Integer page) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        List<StandardVersionModel> standardVersionModelList = standardVersionService.getVersionList(standardId, condition, order, rows, page); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        DictionaryResult dictionaryResult = new DictionaryResult(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        List<DictItem> detailModelList = new ArrayList<DictItem>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        for(StandardVersionModel standardVersionModel : standardVersionModelList){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            DictItem items = new DictItem(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            String id = standardVersionModel.getVersion(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            String name = standardVersionModel.getName(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            items.setCode(id.toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            items.setValue(name); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            detailModelList.add(items); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        dictionaryResult.setDetailModelList(detailModelList); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        return dictionaryResult; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    /** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * 获取发布机构名称列表 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @return 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @throws Exception 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @RequestMapping(value = "/getPublishers") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @ApiOperation(value = "获取发布机构列表", response = DictionaryResult.class, produces = "application/json", notes = "获取发布机构列表") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public DictionaryResult getPublishers( 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @ApiParam(name = "condition", value = "Must be Json") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @RequestParam(value = "condition", required = false) String condition, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @ApiParam(name = "order", value = "Must be Json") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @RequestParam(value = "order", required = false) String order, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @ApiParam(name = "rows", value = "Limit the size of result set. Must be an integer") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @RequestParam(value = "rows", required = false) Integer rows, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @ApiParam(name = "page", value = "Start position of result set. Must be an integer") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            @RequestParam(value = "page", required = false) Integer page) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        List<SystemOrganization> stdPublisherModelList = stdPublisherService.getList(condition, order, rows, page); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        DictionaryResult dictionaryResult = new DictionaryResult(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        List<DictItem> detailModelList = new ArrayList<DictItem>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        for(SystemOrganization systemOrganization : stdPublisherModelList){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            DictItem items = new DictItem(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            String id = systemOrganization.getCode(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            String name = systemOrganization.getFullName(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            items.setCode(id.toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            items.setValue(name); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            detailModelList.add(items); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        dictionaryResult.setDetailModelList(detailModelList); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        return dictionaryResult; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				} 
			 |