EarmarkController.java 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. package com.huimv.manage.controller;
  2. import com.huimv.manage.service.IEarmarkService;
  3. import com.huimv.manage.util.CodeUtil;
  4. import com.huimv.manage.util.Result;
  5. import com.huimv.manage.webservice.task.EarmarkTask;
  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/earmark")
  23. public class EarmarkController {
  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 EarmarkTask earmarkTask;
  32. @Autowired
  33. private IEarmarkService earmarkService;
  34. @RequestMapping(value = "/listEarmark",method = RequestMethod.GET)
  35. public Result listEarmark(@RequestParam(value = "pageSize") int pageSize){
  36. // public Result listEarmark(@RequestParam(value = "accessToken",required = true) String accessToken,
  37. // @RequestParam(value = "applyId",required = true) int applyId,
  38. // @RequestParam(value = "packageId",required = false) int packageId,
  39. // @RequestParam(value = "earMarkId",required = false) int earMarkId,
  40. // @RequestParam(value = "earMarkNumber",required = false) int earMarkNumber,
  41. // @RequestParam(value = "returnState",required = false) int returnState,
  42. // @RequestParam(value = "writeState",required = false) int writeState,
  43. // @RequestParam(value = "printState",required = false) int printState,
  44. // @RequestParam(value = "startDate",required = false) String startDate,
  45. // @RequestParam(value = "endDate",required = false) String endDate,
  46. // @RequestParam(value = "pageSize",required = true) int pageSize){
  47. //
  48. return earmarkService.listEarmark(pageSize);
  49. }
  50. /**
  51. * @Method : getEarmark
  52. * @Description : 下载新耳标号
  53. * @Params : [applyId]
  54. * @Return : com.huimv.manage.util.Result
  55. *
  56. * @Author : ZhuoNing
  57. * @Date : 2021/10/29
  58. * @Time : 22:58
  59. */
  60. @RequestMapping(value = "/getEarmark",method = RequestMethod.GET)
  61. public Result getEarmark(@RequestParam(value = "applyId") int applyId) throws UnsupportedEncodingException {
  62. //
  63. return earmarkService.getEarmark(applyId);
  64. }
  65. /**
  66. * @Method : setUpdateDownState
  67. * @Description : 设置耳标号以下载状态
  68. * @Params : [earmarkIDs]
  69. * @Return : com.huimv.manage.util.Result
  70. *
  71. * @Author : ZhuoNing
  72. * @Date : 2021/10/29
  73. * @Time : 22:59
  74. */
  75. @RequestMapping(value = "/setUpdateDownState",method = RequestMethod.GET)
  76. public Result setUpdateDownState(@RequestParam(value = "earMarkIDs") String earmarkIDs) throws UnsupportedEncodingException {
  77. //
  78. return earmarkService.setUpdateDownState(earmarkIDs);
  79. }
  80. /**
  81. * @Method : setProduceState
  82. * @Description : 设置生产状态
  83. * @Params : [earmarkIDs]
  84. * @Return : com.huimv.manage.util.Result
  85. *
  86. * @Author : ZhuoNing
  87. * @Date : 2021/10/29
  88. * @Time : 23:55
  89. */
  90. @RequestMapping(value = "/setProduceState",method = RequestMethod.GET)
  91. public Result setProduceState(@RequestParam(value = "ids") String ids,@RequestParam(value = "state") int state){
  92. //
  93. return earmarkService.setProduceState(ids,state);
  94. }
  95. /**
  96. * @Method : setWriteState
  97. * @Description : 设置写入状态
  98. * @Params : [ids, state]
  99. * @Return : com.huimv.manage.util.Result
  100. *
  101. * @Author : ZhuoNing
  102. * @Date : 2021/10/30
  103. * @Time : 0:02
  104. */
  105. @RequestMapping(value = "/setWriteState",method = RequestMethod.GET)
  106. public Result setWriteState(@RequestParam(value = "ids") String ids,@RequestParam(value = "state") int state){
  107. //
  108. return earmarkService.setWriteState(ids,state);
  109. }
  110. /**
  111. * @Method : setPrintState
  112. * @Description : 设置打码状态
  113. * @Params : [ids, state]
  114. * @Return : com.huimv.manage.util.Result
  115. *
  116. * @Author : ZhuoNing
  117. * @Date : 2021/10/30
  118. * @Time : 0:03
  119. */
  120. @RequestMapping(value = "/setPrintState",method = RequestMethod.GET)
  121. public Result setPrintState(@RequestParam(value = "ids") String ids,@RequestParam(value = "state") int state){
  122. //
  123. return earmarkService.setPrintState(ids,state);
  124. }
  125. }