BizDeviceRegisteredFlowController.java 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. package com.huimv.center.controller;
  2. import com.huimv.center.service.BizDeviceRegisteredFlowService;
  3. import com.huimv.eartag2.common.utils.Result;
  4. import org.springframework.beans.factory.annotation.Autowired;
  5. import org.springframework.web.bind.annotation.PostMapping;
  6. import org.springframework.web.bind.annotation.RequestMapping;
  7. import org.springframework.web.bind.annotation.RequestParam;
  8. import org.springframework.web.bind.annotation.RestController;
  9. import java.sql.ResultSet;
  10. import java.util.Map;
  11. /**
  12. * <p>
  13. * 前端控制器
  14. * </p>
  15. *
  16. * @author zn
  17. * @since 2022-06-22
  18. */
  19. @RestController
  20. @RequestMapping("/bizDeviceRegisteredFlow")
  21. public class BizDeviceRegisteredFlowController {
  22. @Autowired
  23. private BizDeviceRegisteredFlowService bizDeviceRegisteredFlowService;
  24. @PostMapping("/list")
  25. public Result list(@RequestParam Map<String, Object> paramsMap){
  26. String pageNo = paramsMap.get("pageNo").toString();
  27. if (pageNo == null) {
  28. pageNo = "1";
  29. }
  30. String pageSize = paramsMap.get("pageSize").toString();
  31. if (pageSize == null) {
  32. pageSize = "10";
  33. }
  34. String chipId = "";
  35. if (paramsMap.get("chipId") != null) {
  36. chipId = paramsMap.get("chipId").toString();
  37. }
  38. String deviceCode = "";
  39. if (paramsMap.get("deviceCode") != null) {
  40. deviceCode = paramsMap.get("deviceCode").toString();
  41. }
  42. String farmCode = "";
  43. if (paramsMap.get("farmCode") != null) {
  44. farmCode = paramsMap.get("farmCode").toString();
  45. }
  46. String startDate = "";
  47. if (paramsMap.get("startDate") != null) {
  48. startDate = paramsMap.get("startDate").toString();
  49. }
  50. String endDate = "";
  51. if (paramsMap.get("endDate") != null) {
  52. endDate = paramsMap.get("endDate").toString();
  53. }
  54. return bizDeviceRegisteredFlowService.listDeviceRegisteredFlow(Integer.parseInt(pageNo), Integer.parseInt(pageSize), farmCode, chipId, deviceCode,startDate, endDate);
  55. }
  56. @PostMapping("/remove")
  57. public Result remove(@RequestParam Map<String, Object> paramsMap){
  58. String farmCode = "";
  59. if (paramsMap.get("farmCode") != null) {
  60. farmCode = paramsMap.get("farmCode").toString();
  61. }
  62. String chipId = "";
  63. if (paramsMap.get("chipId") != null) {
  64. chipId = paramsMap.get("chipId").toString();
  65. }
  66. String deviceCode = "";
  67. if (paramsMap.get("deviceCode") != null) {
  68. deviceCode = paramsMap.get("deviceCode").toString();
  69. }
  70. String startDate = "";
  71. if (paramsMap.get("startDate") != null) {
  72. startDate = paramsMap.get("startDate").toString();
  73. }
  74. String endDate = "";
  75. if (paramsMap.get("endDate") != null) {
  76. endDate = paramsMap.get("endDate").toString();
  77. }
  78. return bizDeviceRegisteredFlowService.removeDeviceRegisteredFlow(farmCode,chipId,deviceCode,startDate,endDate);
  79. }
  80. }