|
@@ -1,5 +1,9 @@
|
|
package com.huimv.apiservice.controller;
|
|
package com.huimv.apiservice.controller;
|
|
|
|
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
|
+import com.huimv.apiservice.dao.HealthMedicalRecordDao;
|
|
|
|
+import com.huimv.apiservice.entity.HealthMedicalRecordEntity;
|
|
import com.huimv.apiservice.entity.vo.*;
|
|
import com.huimv.apiservice.entity.vo.*;
|
|
import com.huimv.apiservice.limit.annotation.Limit;
|
|
import com.huimv.apiservice.limit.annotation.Limit;
|
|
import com.huimv.apiservice.service.PigService;
|
|
import com.huimv.apiservice.service.PigService;
|
|
@@ -13,6 +17,8 @@ import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.validation.constraints.NotBlank;
|
|
import javax.validation.constraints.NotBlank;
|
|
import javax.validation.constraints.NotNull;
|
|
import javax.validation.constraints.NotNull;
|
|
|
|
+import java.sql.Wrapper;
|
|
|
|
+import java.util.List;
|
|
import java.util.Objects;
|
|
import java.util.Objects;
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -28,6 +34,9 @@ public class PigController {
|
|
@Autowired
|
|
@Autowired
|
|
private PigService pigService;
|
|
private PigService pigService;
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private HealthMedicalRecordDao healthMedicalRecordDao;
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 获取猪基本信息
|
|
* 获取猪基本信息
|
|
*
|
|
*
|
|
@@ -117,4 +126,32 @@ public class PigController {
|
|
pigService.outFence(pigEarTagNo, status);
|
|
pigService.outFence(pigEarTagNo, status);
|
|
return Objects.requireNonNull(R.ok().put("code", 1000)).put("msg", "出栏成功!");
|
|
return Objects.requireNonNull(R.ok().put("code", 1000)).put("msg", "出栏成功!");
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 弃养
|
|
|
|
+ *
|
|
|
|
+ * @param accessToken token
|
|
|
|
+ * @param pigEarTagNo 耳标号
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @GetMapping("/abandonAdopt")
|
|
|
|
+ public R abandonAdopt(@RequestParam(value = "accessToken") String accessToken,
|
|
|
|
+ @NotBlank(message = "耳标号不能为空!") @RequestParam("pigEarTagNo") String pigEarTagNo) {
|
|
|
|
+ pigService.abandonAdopt(pigEarTagNo);
|
|
|
|
+ return Objects.requireNonNull(R.ok().put("code", 1000)).put("msg", "已解除认养关系!");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 异常状态
|
|
|
|
+ *
|
|
|
|
+ * @param accessToken token
|
|
|
|
+ * @param pigEarTagNo 耳标号
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @GetMapping("/getAbnormalStatus")
|
|
|
|
+ public R getAbnormalStatus(@RequestParam(value = "accessToken") String accessToken,
|
|
|
|
+ @NotBlank(message = "耳标号不能为空!") @RequestParam("pigEarTagNo") String pigEarTagNo) {
|
|
|
|
+ List<HealthMedicalRecordEntity> list = pigService.getAbnormalStatus(pigEarTagNo);
|
|
|
|
+ return Objects.requireNonNull(R.ok().put("code", 1000)).put("data", list);
|
|
|
|
+ }
|
|
}
|
|
}
|