| | |
| | | import org.apache.commons.collections4.MapUtils; |
| | | import org.apache.commons.lang.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.core.io.ClassPathResource; |
| | | import org.springframework.validation.BindingResult; |
| | | import org.springframework.validation.ObjectError; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response) { |
| | | try { |
| | | InputStream inStream =this.getClass().getResourceAsStream("/static/pages/template/机构导入模板.xlsx"); |
| | | InputStream inStream = null; |
| | | ClassPathResource resource = new ClassPathResource(File.separator + "template" + File.separator + "机构导入模板.xlsx"); |
| | | if (resource.exists()) { |
| | | inStream = resource.getInputStream(); |
| | | } |
| | | // 设置输出的格式 |
| | | response.reset(); |
| | | response.setContentType("bin"); |
| | |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 通过医院ID查询机构列表 |
| | | */ |
| | | @ApiOperation(value = "通过医院ID查询机构列表") |
| | | @PostMapping("/getOrganizationListByHospitalId") |
| | | public ResultBody getOrganizationListByHospitalId(@RequestBody String id) { |
| | | List<ScreeningOrganizationInfo> byHospitalId = organizationInfoService.findByHospitalId(Long.valueOf(id)); |
| | | if (byHospitalId != null && byHospitalId.size() > 0) { |
| | | return ResultBody.ok().data(byHospitalId).msg("查询成功"); |
| | | } |
| | | return ResultBody.failed().msg("查询失败"); |
| | | } |
| | | |
| | | /** |
| | | * 关键字查询列表 |
| | | */ |
| | | @ApiOperation(value = "关键字查询列表") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "page", value = "分页起始位置", required = true, dataType = "Integer"), |
| | | @ApiImplicitParam(name = "limit", value = "分页结束位置", required = true, dataType = "Integer") |
| | | }) |
| | | @PostMapping(value = "/listByKeyWord") |
| | | public PageResult<ScreeningOrganizationInfo> listByKeyWord(@RequestParam Map<String, Object> params) { |
| | | if (params.size() == 0) { |
| | | params.put("page", 1); |
| | | params.put("limit", 10); |
| | | } |
| | | return organizationInfoService.findByKeyWord(params); |
| | | } |
| | | } |