PackageController.java 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. package com.huimv.manage.controller;
  2. import com.huimv.manage.service.IPackageService;
  3. import com.huimv.manage.util.Result;
  4. import com.huimv.manage.webservice.Soap;
  5. import com.huimv.manage.webservice.task.PackageTask;
  6. import lombok.extern.slf4j.Slf4j;
  7. import org.springframework.beans.factory.annotation.Autowired;
  8. import org.springframework.beans.factory.annotation.Value;
  9. import org.springframework.web.bind.annotation.*;
  10. import java.io.UnsupportedEncodingException;
  11. /**
  12. * @Project : huimv.shiwan
  13. * @Package : com.huimv.biosafety.uface.controller
  14. * @Description : TODO
  15. * @Version : 1.0
  16. * @Author : ZhuoNing
  17. * @Create : 2020-12-25
  18. **/
  19. @CrossOrigin
  20. @RestController
  21. @Slf4j
  22. @RequestMapping(value = "/eartag/package")
  23. public class PackageController {
  24. @Value("${webservice.url}")
  25. private String webServiceUrl;
  26. @Value("${webservice.producerId}")
  27. private String producerId;
  28. @Autowired
  29. private Soap soap;
  30. @Autowired
  31. private PackageTask packageTask;
  32. @Autowired
  33. private IPackageService packageService;
  34. /**
  35. * @Method : listPackage
  36. * @Description : 展示列表
  37. * @Params : [pageSize]
  38. * @Return : com.huimv.manage.util.Result
  39. *
  40. * @Author : ZhuoNing
  41. * @Date : 2021/10/29
  42. * @Time : 15:37
  43. */
  44. @RequestMapping(value = "/listPackage",method = RequestMethod.GET)
  45. public Result listPackage(@RequestParam(value = "pageSize")int pageSize){
  46. // public Result listPackage(@RequestParam(value = "accessToken",required = true) String accessToken,
  47. // @RequestParam(value = "applyId",required = true) int applyId,
  48. // @RequestParam(value = "packageId",required = false) int packageId,
  49. // @RequestParam(value = "startDate",required = false) String startDate,
  50. // @RequestParam(value = "endDate",required = false) String endDate,
  51. // @RequestParam(value = "returnState",required = false) int returnState,
  52. // @RequestParam(value = "pageSize",required = true) int pageSize){
  53. //
  54. return packageService.listPackage(pageSize);
  55. }
  56. /**
  57. * @Method : getNewPackage
  58. * @Description : 根据任务号下载新批次
  59. * @Params : [applyId]
  60. * @Return : com.huimv.manage.util.Result
  61. *
  62. * @Author : ZhuoNing
  63. * @Date : 2021/10/29
  64. * @Time : 15:42
  65. */
  66. @RequestMapping(value = "/getNewPackage",method = RequestMethod.GET)
  67. public Result getNewPackage(@RequestParam(value = "applyId") int applyId) throws UnsupportedEncodingException {
  68. //
  69. return packageService.getNewPackage(applyId);
  70. }
  71. /**
  72. * @Method : setReturnDownloadState
  73. * @Description : 设置返回批次已下载状态
  74. * @Params : [packageIds, ids]
  75. * @Return : com.huimv.manage.util.Result
  76. *
  77. * @Author : ZhuoNing
  78. * @Date : 2021/10/29
  79. * @Time : 18:51
  80. */
  81. @RequestMapping(value = "/setReturnDownloadState",method = RequestMethod.GET)
  82. public Result setReturnDownloadState(@RequestParam(value = "packageIds") String packageIds,@RequestParam(value = "ids") String ids) throws UnsupportedEncodingException {
  83. //
  84. return packageService.setReturnDownloadState(packageIds,ids);
  85. }
  86. /**
  87. * @Method : setProduceState
  88. * @Description : 设置生产状态
  89. * @Params : []
  90. * @Return : com.huimv.manage.util.Result
  91. *
  92. * @Author : ZhuoNing
  93. * @Date : 2021/10/29
  94. * @Time : 19:22
  95. */
  96. @RequestMapping(value = "/setProduceState",method = RequestMethod.GET)
  97. public Result setProduceState(@RequestParam(value = "ids") String ids,@RequestParam(value = "state") int state){
  98. //
  99. return packageService.setProduceState(ids,state);
  100. }
  101. }