|
@@ -1,24 +1,23 @@
|
|
|
package com.huimv.apiservice.service.impl;
|
|
|
|
|
|
-import cn.hutool.core.collection.CollUtil;
|
|
|
+
|
|
|
import cn.hutool.core.collection.CollectionUtil;
|
|
|
import cn.hutool.core.date.DateUtil;
|
|
|
-import cn.hutool.core.util.ObjectUtil;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.huimv.apiservice.dao.PigDao;
|
|
|
-import com.huimv.apiservice.dao.PigstyDao;
|
|
|
import com.huimv.apiservice.dao.YearPigHistoryImgDao;
|
|
|
-import com.huimv.apiservice.dao.YearPigPedigreeDao;
|
|
|
-import com.huimv.apiservice.entity.EmployeeEntity;
|
|
|
-import com.huimv.apiservice.entity.PigstyEntity;
|
|
|
import com.huimv.apiservice.entity.YearPigBaseEntity;
|
|
|
-import com.huimv.apiservice.entity.YearPigPedigreeEntity;
|
|
|
import com.huimv.apiservice.dao.*;
|
|
|
import com.huimv.apiservice.entity.*;
|
|
|
import com.huimv.apiservice.entity.vo.*;
|
|
|
import com.huimv.apiservice.service.PigService;
|
|
|
+import com.huimv.common.exception.RRException;
|
|
|
+import com.huimv.common.utils.PageUtils;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
@@ -26,27 +25,30 @@ import org.springframework.stereotype.Service;
|
|
|
import java.util.*;
|
|
|
|
|
|
/**
|
|
|
- * @Author yinhao
|
|
|
- * @Date 2021/5/8 17:22
|
|
|
- * @Description
|
|
|
+ * <p>
|
|
|
+ * 业务层
|
|
|
+ * </p>
|
|
|
+ *
|
|
|
+ * @author yinhao
|
|
|
+ * @date 2021/5/8 17:22
|
|
|
*/
|
|
|
@Service
|
|
|
public class PigServiceImpl extends ServiceImpl<PigDao, YearPigBaseEntity> implements PigService {
|
|
|
|
|
|
@Autowired
|
|
|
- private PigstyDao pigstyDao;
|
|
|
-
|
|
|
- @Autowired
|
|
|
private AnimalHeatDao animalHeatDao;
|
|
|
|
|
|
@Autowired
|
|
|
private EatTimeDao eatTimeDao;
|
|
|
|
|
|
@Autowired
|
|
|
- private YearPigHistoryImgDao yearPigHistoryImgDao;
|
|
|
+ private IndoorEnvironmentDao indoorEnvironmentDao;
|
|
|
|
|
|
@Autowired
|
|
|
- private YearPigPedigreeDao yearPigPedigreeDao;
|
|
|
+ private OutdoorEnvironmentDao outdoorEnvironmentDao;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private YearPigHistoryImgDao yearPigHistoryImgDao;
|
|
|
|
|
|
@Autowired
|
|
|
private SleepStatusDao sleepStatusDao;
|
|
@@ -57,6 +59,8 @@ public class PigServiceImpl extends ServiceImpl<PigDao, YearPigBaseEntity> imple
|
|
|
@Override
|
|
|
public Map<String, Object> getPigInfoByEarTagNo(String pigEarTagNo) {
|
|
|
|
|
|
+ checkPigEarTagNo(pigEarTagNo);
|
|
|
+
|
|
|
Map<String, Object> result = new LinkedHashMap<>(16);
|
|
|
List<Map<String, Object>> temperature = new ArrayList<>();
|
|
|
// List<Map<String, Object>> healthStatus = new ArrayList<>();
|
|
@@ -72,6 +76,7 @@ public class PigServiceImpl extends ServiceImpl<PigDao, YearPigBaseEntity> imple
|
|
|
//公用时间 -> 当前日期
|
|
|
String today = DateUtil.format(DateUtil.date(), "yyyy-MM-dd");
|
|
|
|
|
|
+
|
|
|
//java代码对集合排序
|
|
|
//CollectionUtil.sort(animalHeatEntityList,(o1, o2) -> o2.getCollectTime().compareTo(o1.getCollectTime()));
|
|
|
|
|
@@ -138,8 +143,8 @@ public class PigServiceImpl extends ServiceImpl<PigDao, YearPigBaseEntity> imple
|
|
|
|
|
|
//运动状态数据sql构建及查询
|
|
|
LambdaQueryWrapper<SportTimeEntity> sportStatusLambdaQuery = Wrappers.lambdaQuery();
|
|
|
- sportStatusLambdaQuery.eq(SportTimeEntity::getEartag,pigEarTagNo)
|
|
|
- .eq(SportTimeEntity::getNowDate,today)
|
|
|
+ sportStatusLambdaQuery.eq(SportTimeEntity::getEartag, pigEarTagNo)
|
|
|
+ .eq(SportTimeEntity::getNowDate, today)
|
|
|
.orderByDesc(SportTimeEntity::getId);
|
|
|
List<SportTimeEntity> sportTimeEntityList = sportTimeDao.selectList(sportStatusLambdaQuery);
|
|
|
|
|
@@ -153,48 +158,15 @@ public class PigServiceImpl extends ServiceImpl<PigDao, YearPigBaseEntity> imple
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-// //构建根据耳标查询的表达式
|
|
|
-// LambdaQueryWrapper<YearPigBaseEntity> yearPigLambdaQuery = Wrappers.lambdaQuery();
|
|
|
-// yearPigLambdaQuery.eq(YearPigBaseEntity::getEartag, pigEarTagNo);
|
|
|
-//
|
|
|
-// //根据耳标查询猪的信息
|
|
|
-// YearPigBaseEntity yearPigBaseEntity = baseMapper.selectOne(yearPigLambdaQuery);
|
|
|
-//
|
|
|
-// //构建返回前端的VO对象
|
|
|
-// PigBaseVo pigBaseVo = new PigBaseVo();
|
|
|
-// if (ObjectUtil.isNotNull(yearPigBaseEntity)) {
|
|
|
-// pigBaseVo.setWeight(yearPigBaseEntity.getWeight());
|
|
|
-// pigBaseVo.setDayAge(yearPigBaseEntity.getDayAge());
|
|
|
-// pigBaseVo.setBreed(yearPigBaseEntity.getBreed());
|
|
|
-// pigBaseVo.setBirthday(yearPigBaseEntity.getBirthday());
|
|
|
-//
|
|
|
-// Integer pigstyId = yearPigBaseEntity.getPigstyId();
|
|
|
-// if (pigstyId != null) {
|
|
|
-// String pastureName = baseMapper.selectPastureNameByPigstyId(pigstyId);
|
|
|
-// if (StringUtils.isNotEmpty(pastureName)) {
|
|
|
-// pigBaseVo.setPasture(pastureName);
|
|
|
-// }
|
|
|
-// }
|
|
|
-//
|
|
|
-// LambdaQueryWrapper<AnimalHeatEntity> animalHeatLambdaQuery = Wrappers.lambdaQuery();
|
|
|
-// animalHeatLambdaQuery.eq(AnimalHeatEntity::getEartag, pigEarTagNo).orderByDesc(AnimalHeatEntity::getCollectTime);
|
|
|
-// animalHeatLambdaQuery.last("limit 1");
|
|
|
-// AnimalHeatEntity animalHeatEntity = animalHeatDao.selectOne(animalHeatLambdaQuery);
|
|
|
-// if (ObjectUtil.isNotNull(animalHeatEntity)) {
|
|
|
-// Double temperature = animalHeatEntity.getTemperature();
|
|
|
-// if (temperature != null) {
|
|
|
-// pigBaseVo.setBodyTemperature(temperature);
|
|
|
-// }
|
|
|
-// }
|
|
|
-//
|
|
|
-// }
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
@Override
|
|
|
public PigImageVo getImageByEarTagNo(String pigEarTagNo) {
|
|
|
|
|
|
+ checkPigEarTagNo(pigEarTagNo);
|
|
|
+
|
|
|
PigImageVo pigImageVo = new PigImageVo();
|
|
|
|
|
|
pigImageVo.setPigEarTagNo(pigEarTagNo);
|
|
@@ -206,137 +178,127 @@ public class PigServiceImpl extends ServiceImpl<PigDao, YearPigBaseEntity> imple
|
|
|
return pigImageVo;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
@Override
|
|
|
- public List<PigBaseVo> getListByBreed(String breedName) {
|
|
|
- LambdaQueryWrapper<YearPigBaseEntity> lambdaQueryWrapper = Wrappers.lambdaQuery();
|
|
|
- lambdaQueryWrapper.eq(YearPigBaseEntity::getBreed, breedName);
|
|
|
- List<YearPigBaseEntity> yearPigBaseEntityList = baseMapper.selectList(lambdaQueryWrapper);
|
|
|
-
|
|
|
- List<PigBaseVo> pigBaseVoList = new ArrayList<>();
|
|
|
- if (CollUtil.isNotEmpty(yearPigBaseEntityList)) {
|
|
|
- for (YearPigBaseEntity yearPigBaseEntity : yearPigBaseEntityList) {
|
|
|
- PigBaseVo pigBaseVo = new PigBaseVo();
|
|
|
- pigBaseVo.setWeight(yearPigBaseEntity.getWeight());
|
|
|
- pigBaseVo.setDayAge(yearPigBaseEntity.getDayAge());
|
|
|
- pigBaseVo.setBreed(yearPigBaseEntity.getBreed());
|
|
|
- //虚拟数据 待填充
|
|
|
- pigBaseVo.setBirthday(new Date());
|
|
|
- Integer unitId = yearPigBaseEntity.getUnitId();
|
|
|
- PigstyEntity pigstyEntity = null;
|
|
|
- if (unitId != null) {
|
|
|
- pigstyEntity = pigstyDao.selectById(unitId);
|
|
|
- }
|
|
|
- if (ObjectUtil.isNotNull(pigstyEntity)) {
|
|
|
- String number = pigstyEntity.getNumber();
|
|
|
- if (StringUtils.isNotEmpty(number)) {
|
|
|
-// pigBaseVo.setPigsty(number);
|
|
|
- }
|
|
|
- }
|
|
|
- //虚拟数据 待填充
|
|
|
- pigBaseVo.setBodyTemperature(100D);
|
|
|
- pigBaseVoList.add(pigBaseVo);
|
|
|
- }
|
|
|
+ public PageUtils getListByBreed(String breedName) {
|
|
|
+
|
|
|
+ if (StringUtils.isEmpty(breedName)) {
|
|
|
+ throw new RRException("品种名称不能为空!",1001);
|
|
|
}
|
|
|
- return pigBaseVoList;
|
|
|
- }
|
|
|
|
|
|
- @Override
|
|
|
- public PigPedigreeVo getPigPedigree(String pigEarTagNo) {
|
|
|
-
|
|
|
- LambdaQueryWrapper<YearPigBaseEntity> lambdaQueryWrapper = Wrappers.lambdaQuery();
|
|
|
- lambdaQueryWrapper.eq(YearPigBaseEntity::getEartag, pigEarTagNo);
|
|
|
-
|
|
|
- YearPigBaseEntity yearPigBaseEntity = baseMapper.selectOne(lambdaQueryWrapper);
|
|
|
- PigPedigreeVo pigPedigreeVo = new PigPedigreeVo();
|
|
|
-
|
|
|
- if (ObjectUtil.isNotNull(yearPigBaseEntity)) {
|
|
|
- pigPedigreeVo.setBreed(yearPigBaseEntity.getBreed());
|
|
|
- //虚拟数据 待填充
|
|
|
- pigPedigreeVo.setBirthday(new Date());
|
|
|
-
|
|
|
- LambdaQueryWrapper<YearPigPedigreeEntity> lambdaQuery = Wrappers.lambdaQuery();
|
|
|
- lambdaQuery.eq(YearPigPedigreeEntity::getPigletEartag, pigEarTagNo);
|
|
|
- YearPigPedigreeEntity yearPigPedigreeEntity = yearPigPedigreeDao.selectOne(lambdaQuery);
|
|
|
-
|
|
|
- String motherEarTag = yearPigPedigreeEntity.getSowEartag();
|
|
|
- String fatherEarTag = yearPigPedigreeEntity.getBoarEartag();
|
|
|
-
|
|
|
- lambdaQueryWrapper.clear();
|
|
|
- lambdaQueryWrapper.eq(YearPigBaseEntity::getEartag, motherEarTag);
|
|
|
- YearPigBaseEntity mother = baseMapper.selectOne(lambdaQueryWrapper);
|
|
|
- PigPedigreeMotherVo pigPedigreeMotherVo = new PigPedigreeMotherVo();
|
|
|
- if (ObjectUtil.isNotNull(mother)) {
|
|
|
- pigPedigreeMotherVo.setBreed(mother.getBreed());
|
|
|
- pigPedigreeMotherVo.setWeight(mother.getWeight());
|
|
|
- //虚拟数据 待填充
|
|
|
- pigPedigreeMotherVo.setPregnancyDate(new Date());
|
|
|
- pigPedigreeMotherVo.setChildCount(10);
|
|
|
- pigPedigreeMotherVo.setOriginPlace("产地信息");
|
|
|
- }
|
|
|
- pigPedigreeVo.setMother(pigPedigreeMotherVo);
|
|
|
-
|
|
|
- lambdaQuery.clear();
|
|
|
- lambdaQueryWrapper.eq(YearPigBaseEntity::getEartag, fatherEarTag);
|
|
|
- PigPedigreeFatherVo pigPedigreeFatherVo = new PigPedigreeFatherVo();
|
|
|
- YearPigBaseEntity father = baseMapper.selectOne(lambdaQueryWrapper);
|
|
|
- if (ObjectUtil.isNotNull(father)) {
|
|
|
- pigPedigreeFatherVo.setBreed(father.getBreed());
|
|
|
- //虚拟数据 待填充
|
|
|
- pigPedigreeFatherVo.setOriginPlace("产地信息");
|
|
|
- }
|
|
|
- pigPedigreeVo.setFather(pigPedigreeFatherVo);
|
|
|
+ Integer count = baseMapper.selectCount(Wrappers.<YearPigBaseEntity>lambdaQuery().eq(YearPigBaseEntity::getBreed, breedName));
|
|
|
+ if (count <= 0) {
|
|
|
+ throw new RRException("品种名称不存在,请检查!",1001);
|
|
|
}
|
|
|
|
|
|
- return pigPedigreeVo;
|
|
|
+ IPage<PigBaseVo> page = new Page<>(1, 10);
|
|
|
+ IPage<PigBaseVo> pigBaseVoList = baseMapper.selectPagePigBaseVoByBreedName(page, breedName);
|
|
|
+
|
|
|
+ return new PageUtils(pigBaseVoList);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public PigKeeperVo getKeeper(String pigEarTagNo) {
|
|
|
-
|
|
|
- PigKeeperVo pigKeeperVo = new PigKeeperVo();
|
|
|
- pigKeeperVo.setPigEarTagNo(pigEarTagNo);
|
|
|
-
|
|
|
- EmployeeEntity employeeEntity = baseMapper.selectFeederInfoByPigEarTagNo(pigEarTagNo);
|
|
|
- FeederVo feederVo = pigKeeperVo.getFeeder();
|
|
|
- if (employeeEntity != null) {
|
|
|
- feederVo.setName(employeeEntity.getName());
|
|
|
- feederVo.setPosition(employeeEntity.getPosition());
|
|
|
- feederVo.setApproachTime(employeeEntity.getApproachTime());
|
|
|
- feederVo.setDepartureTime(employeeEntity.getDepartureTime());
|
|
|
+ public EnvVo getIndoorEnv(String pigEarTagNo) {
|
|
|
+
|
|
|
+ String today = DateUtil.format(DateUtil.date(), "yyyy-MM-dd");
|
|
|
+
|
|
|
+ LambdaQueryWrapper<YearPigBaseEntity> pigBaseLambdaQuery = Wrappers.lambdaQuery();
|
|
|
+ pigBaseLambdaQuery.eq(YearPigBaseEntity::getEartag, pigEarTagNo);
|
|
|
+ YearPigBaseEntity yearPigBaseEntity = baseMapper.selectOne(pigBaseLambdaQuery);
|
|
|
+ if (yearPigBaseEntity == null) {
|
|
|
+ throw new RRException("耳标信息不存在,请检查!", 1001);
|
|
|
}
|
|
|
|
|
|
- return pigKeeperVo;
|
|
|
+ EnvVo envVo = new EnvVo();
|
|
|
+ envVo.setPigEarTagNo(pigEarTagNo);
|
|
|
+ envVo.setDate(today);
|
|
|
+ List<IndoorEnvVo> indoorEnvVoList = new ArrayList<>();
|
|
|
+ envVo.setIndoorEnvList(indoorEnvVoList);
|
|
|
+ List<OutdoorEnvVo> outdoorEnvVoList = new ArrayList<>();
|
|
|
+ envVo.setOutdoorEnvList(outdoorEnvVoList);
|
|
|
+
|
|
|
+ Integer pigstyId = yearPigBaseEntity.getPigstyId();
|
|
|
+ if (pigstyId != null) {
|
|
|
+ LambdaQueryWrapper<IndoorEnvironmentEntity> indoorEnvLambdaQuery = Wrappers.lambdaQuery();
|
|
|
+ indoorEnvLambdaQuery.eq(IndoorEnvironmentEntity::getPigstyId, pigstyId)
|
|
|
+ .eq(IndoorEnvironmentEntity::getDate, today)
|
|
|
+ .orderByDesc(IndoorEnvironmentEntity::getId);
|
|
|
+ List<IndoorEnvironmentEntity> indoorEnvironmentEntityList = indoorEnvironmentDao.selectList(indoorEnvLambdaQuery);
|
|
|
+
|
|
|
+ if (CollectionUtil.isNotEmpty(indoorEnvironmentEntityList)) {
|
|
|
+ for (IndoorEnvironmentEntity indoorEnvironmentEntity : indoorEnvironmentEntityList) {
|
|
|
+ IndoorEnvVo indoorEnvVo = new IndoorEnvVo();
|
|
|
+ indoorEnvVo.setCollectTime(indoorEnvironmentEntity.getCollectTime());
|
|
|
+ indoorEnvVo.setTemperature(indoorEnvironmentEntity.getTemperature());
|
|
|
+ indoorEnvVo.setHumidity(indoorEnvironmentEntity.getHumidity());
|
|
|
+ indoorEnvVo.setGas(indoorEnvironmentEntity.getGas());
|
|
|
+ indoorEnvVoList.add(indoorEnvVo);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ LambdaQueryWrapper<OutdoorEnvironmentEntity> outdoorEnvLambdaQuery = Wrappers.lambdaQuery();
|
|
|
+ outdoorEnvLambdaQuery.eq(OutdoorEnvironmentEntity::getDate, today)
|
|
|
+ .orderByDesc(OutdoorEnvironmentEntity::getId);
|
|
|
+ List<OutdoorEnvironmentEntity> outdoorEnvironmentEntityList = outdoorEnvironmentDao.selectList(outdoorEnvLambdaQuery);
|
|
|
+ if (CollectionUtil.isNotEmpty(outdoorEnvironmentEntityList)) {
|
|
|
+ for (OutdoorEnvironmentEntity outdoorEnvironmentEntity : outdoorEnvironmentEntityList) {
|
|
|
+ OutdoorEnvVo outdoorEnvVo = new OutdoorEnvVo();
|
|
|
+ outdoorEnvVo.setCollectTime(outdoorEnvironmentEntity.getCollectTime());
|
|
|
+ outdoorEnvVo.setTemperature(outdoorEnvironmentEntity.getTemperature());
|
|
|
+ outdoorEnvVo.setHumidity(outdoorEnvironmentEntity.getHumidity());
|
|
|
+ outdoorEnvVo.setGas(outdoorEnvironmentEntity.getGas());
|
|
|
+ outdoorEnvVoList.add(outdoorEnvVo);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return envVo;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public PigSportVo getActivityAmount(String pigEarTagNo) {
|
|
|
- PigSportVo sportVo = new PigSportVo();
|
|
|
+ public void adopt(String pigEarTagNo) {
|
|
|
|
|
|
- LambdaQueryWrapper<SportTimeEntity> lambdaQueryWrapper = Wrappers.lambdaQuery();
|
|
|
+ LambdaQueryWrapper<YearPigBaseEntity> eq = Wrappers.<YearPigBaseEntity>lambdaQuery().eq(YearPigBaseEntity::getEartag, pigEarTagNo);
|
|
|
+ YearPigBaseEntity yearPigBaseEntity = baseMapper.selectOne(eq);
|
|
|
+ if (yearPigBaseEntity == null) {
|
|
|
+ throw new RRException("耳标信息不存在,请检查!", 1001);
|
|
|
+ }
|
|
|
+ if (yearPigBaseEntity.getFosterStatus()) {
|
|
|
+ throw new RRException("本猪已被其他人认养!", 1001);
|
|
|
+ }
|
|
|
+ LambdaUpdateWrapper<YearPigBaseEntity> pigBaseLambdaUpdate = Wrappers.lambdaUpdate();
|
|
|
+ pigBaseLambdaUpdate.eq(YearPigBaseEntity::getEartag, pigEarTagNo)
|
|
|
+ .set(YearPigBaseEntity::getFosterStatus, true);
|
|
|
|
|
|
- //虚假数据
|
|
|
- lambdaQueryWrapper.eq(SportTimeEntity::getEartag, pigEarTagNo);
|
|
|
- SportTimeEntity sportTimeEntity = sportTimeDao.selectOne(lambdaQueryWrapper);
|
|
|
- sportVo.setActivityAmount(sportTimeEntity.getSportCount());
|
|
|
- sportVo.setPigEarTagNo(pigEarTagNo);
|
|
|
- return sportVo;
|
|
|
+ update(pigBaseLambdaUpdate);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public SleepStatusEntity getSleepStatus(String pigEarTagNo) {
|
|
|
+ public void outFence(String pigEarTagNo, Integer status) {
|
|
|
|
|
|
- //虚假数据
|
|
|
- LambdaQueryWrapper<SleepStatusEntity> lambdaQueryWrapper = Wrappers.lambdaQuery();
|
|
|
- lambdaQueryWrapper.eq(SleepStatusEntity::getEartag, pigEarTagNo);
|
|
|
- SleepStatusEntity sleepStatusEntity = sleepStatusDao.selectOne(lambdaQueryWrapper);
|
|
|
+ checkPigEarTagNo(pigEarTagNo);
|
|
|
|
|
|
+ if (!status.equals(1) && !status.equals(2) && !status.equals(3)) {
|
|
|
+ throw new RRException("出栏状态有误,请检查!",1001);
|
|
|
+ }
|
|
|
|
|
|
- return sleepStatusEntity;
|
|
|
- }
|
|
|
+ LambdaUpdateWrapper<YearPigBaseEntity> pigBaseLambdaUpdate = Wrappers.lambdaUpdate();
|
|
|
+ pigBaseLambdaUpdate.eq(YearPigBaseEntity::getEartag, pigEarTagNo)
|
|
|
+ .set(YearPigBaseEntity::getOutFenceStatus, status);
|
|
|
|
|
|
- @Override
|
|
|
- public EnvVo getIndoorEnv(String pigEarTagNo) {
|
|
|
+ update(pigBaseLambdaUpdate);
|
|
|
|
|
|
- return null;
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 公用检查耳标方法
|
|
|
+ *
|
|
|
+ * @param pigEarTagNo 耳标号
|
|
|
+ */
|
|
|
+ private void checkPigEarTagNo(String pigEarTagNo) {
|
|
|
+ Integer count = baseMapper.selectCount(Wrappers.<YearPigBaseEntity>lambdaQuery().eq(YearPigBaseEntity::getEartag, pigEarTagNo));
|
|
|
+ if (count <= 0) {
|
|
|
+ throw new RRException("耳标信息不存在,请检查!", 1001);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
}
|