ArchivesController.java 4.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. package com.yihu.jw.controller.archives;
  2. import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
  3. import com.netflix.hystrix.contrib.javanica.annotation.HystrixProperty;
  4. import com.yihu.jw.commnon.archives.ArchivesContants;
  5. import com.yihu.jw.feign.archives.ArchivesFeign;
  6. import com.yihu.jw.restmodel.archives.PatientArchivesInfoVO;
  7. import com.yihu.jw.restmodel.archives.PatientArchivesVO;
  8. import com.yihu.jw.restmodel.common.Envelop;
  9. import com.yihu.jw.rm.archives.PatientArchivesMapping;
  10. import io.swagger.annotations.Api;
  11. import io.swagger.annotations.ApiOperation;
  12. import org.springframework.beans.factory.annotation.Autowired;
  13. import org.springframework.web.bind.annotation.*;
  14. /**
  15. * Created by Trick on 2018/2/12.
  16. */
  17. @RestController
  18. @RequestMapping(ArchivesContants.Common.archives)
  19. @Api(tags = "居民建档相关操作", description = "居民建档相关操作")
  20. public class ArchivesController {
  21. @Autowired
  22. private ArchivesFeign archivesFeign;
  23. @GetMapping(value = PatientArchivesMapping.Archives.findPatientArchives)
  24. @ApiOperation(value = "分页查找档案列表", notes = "分页查找档案列表")
  25. @HystrixCommand(commandProperties = {
  26. @HystrixProperty(name = "execution.isolation.thread.timeoutInMilliseconds", value = "-1"),//超时时间
  27. @HystrixProperty(name = "execution.timeout.enabled", value = "false") })
  28. public Envelop<PatientArchivesVO> findPatientArchives(@RequestParam(value = "name", required = false)String name,
  29. @RequestParam(value = "status", required = false)String status,
  30. @RequestParam(value = "cancelReseanType", required = false)String cancelReseanType,
  31. @RequestParam(value = "page", required = false)Integer page,
  32. @RequestParam(value = "size", required = false )Integer size){
  33. return archivesFeign.findPatientArchives(name,status,cancelReseanType,page,size);
  34. }
  35. @GetMapping(value = PatientArchivesMapping.Archives.findPatientArchivesInfos)
  36. @ApiOperation(value = "查询健康信息详情列表", notes = "查询健康信息详情列表")
  37. @HystrixCommand(commandProperties = {
  38. @HystrixProperty(name = "execution.isolation.thread.timeoutInMilliseconds", value = "-1"),//超时时间
  39. @HystrixProperty(name = "execution.timeout.enabled", value = "false") })
  40. public Envelop<PatientArchivesInfoVO> queryPatientArchivesInfoPage(@RequestParam(value = "code", required = false)String code){
  41. return archivesFeign.queryPatientArchivesInfoPage(code);
  42. }
  43. @PostMapping(value = PatientArchivesMapping.Archives.createPatientArchives)
  44. @ApiOperation(value = "创建健康信息详情列表")
  45. @HystrixCommand(commandProperties = {
  46. @HystrixProperty(name = "execution.isolation.thread.timeoutInMilliseconds", value = "-1"),//超时时间
  47. @HystrixProperty(name = "execution.timeout.enabled", value = "false") })
  48. public Envelop<Boolean> createPatientArchives(@RequestParam(value = "patientArchives", required = true)String patientArchives,
  49. @RequestParam(value = "list", required = true)String list){
  50. return archivesFeign.createPatientArchives(patientArchives,list);
  51. }
  52. @PutMapping(value = PatientArchivesMapping.Archives.updatePatientArchives)
  53. @ApiOperation(value = "更新健康信息详情列表")
  54. @HystrixCommand(commandProperties = {
  55. @HystrixProperty(name = "execution.isolation.thread.timeoutInMilliseconds", value = "-1"),//超时时间
  56. @HystrixProperty(name = "execution.timeout.enabled", value = "false") })
  57. public Envelop<Boolean> updatePatientArchives(@RequestParam(value = "patientArchives", required = true)String patientArchives,
  58. @RequestParam(value = "list", required = true)String list){
  59. return archivesFeign.updatePatientArchives(patientArchives,list);
  60. }
  61. }