|
@@ -8,7 +8,9 @@ import com.huimv.admin.common.utils.Result;
|
|
import com.huimv.admin.common.utils.ResultCode;
|
|
import com.huimv.admin.common.utils.ResultCode;
|
|
import com.huimv.admin.entity.BreedLeave;
|
|
import com.huimv.admin.entity.BreedLeave;
|
|
import com.huimv.admin.entity.BreedVaccinationRecord;
|
|
import com.huimv.admin.entity.BreedVaccinationRecord;
|
|
|
|
+import com.huimv.admin.entity.ProtSheepInfo;
|
|
import com.huimv.admin.service.IBreedVaccinationRecordService;
|
|
import com.huimv.admin.service.IBreedVaccinationRecordService;
|
|
|
|
+import com.huimv.admin.service.IProtSheepInfoService;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.web.bind.annotation.CrossOrigin;
|
|
import org.springframework.web.bind.annotation.CrossOrigin;
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
@@ -33,6 +35,9 @@ public class BreedVaccinationRecordController {
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private IBreedVaccinationRecordService recordService;
|
|
private IBreedVaccinationRecordService recordService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private IProtSheepInfoService sheepInfoService;
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
@RequestMapping("/listPage")
|
|
@RequestMapping("/listPage")
|
|
@@ -54,4 +59,24 @@ public class BreedVaccinationRecordController {
|
|
.like(StringUtils.isNotBlank(batchNum), "batch_num", batchNum);
|
|
.like(StringUtils.isNotBlank(batchNum), "batch_num", batchNum);
|
|
return new Result(ResultCode.SUCCESS, recordService.page(page, queryWrapper));
|
|
return new Result(ResultCode.SUCCESS, recordService.page(page, queryWrapper));
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ //大屏防疫管理
|
|
|
|
+ @RequestMapping("/listScreen")
|
|
|
|
+ public Result listScreen(@RequestBody Map<String, String> paramsMap) {
|
|
|
|
+ return recordService.listScreen(paramsMap);
|
|
|
|
+ }
|
|
|
|
+ //羊只管理中的免疫记录
|
|
|
|
+ @RequestMapping("/listById")
|
|
|
|
+ public Result listById(@RequestBody Map<String, String> paramsMap) {
|
|
|
|
+ String farmId = paramsMap.get("farmId");
|
|
|
|
+ String sheepId = paramsMap.get("sheepId");
|
|
|
|
+ ProtSheepInfo sheepInfo = sheepInfoService.getOne(new QueryWrapper<ProtSheepInfo>().eq("farm_id", farmId).eq("sheep_id", sheepId));
|
|
|
|
+ QueryWrapper<BreedVaccinationRecord> queryWrapper = new QueryWrapper<>();
|
|
|
|
+ if (sheepInfo.getIsBatch() == 0) {
|
|
|
|
+ queryWrapper.eq("farm_id", farmId).eq("batch_num", sheepInfo.getBatchNum());
|
|
|
|
+ } else {
|
|
|
|
+ queryWrapper.eq("farm_id", farmId).eq("sheep_id", sheepInfo.getSheepId());
|
|
|
|
+ }
|
|
|
|
+ return new Result(ResultCode.SUCCESS, recordService.list(queryWrapper));
|
|
|
|
+ }
|
|
}
|
|
}
|