| @ -1,45 +0,0 @@ | |||
| package com.hxhq.business.domain; | |||
| import com.baomidou.mybatisplus.annotation.TableName; | |||
| import com.hxhq.common.core.domain.MpBaseEntity; | |||
| /** | |||
| * 动物种属对象 t_species | |||
| * | |||
| * @author hxhq | |||
| * @date 2025-12-29 | |||
| */ | |||
| @TableName("t_species") | |||
| public class Species extends MpBaseEntity | |||
| { | |||
| private static final long serialVersionUID = 1L; | |||
| /** 笼具 */ | |||
| private String lj; | |||
| /** 动物种属 */ | |||
| private String ddzs; | |||
| public void setLj(String lj) | |||
| { | |||
| this.lj = lj; | |||
| } | |||
| public String getLj() | |||
| { | |||
| return lj; | |||
| } | |||
| public void setDdzs(String ddzs) | |||
| { | |||
| this.ddzs = ddzs; | |||
| } | |||
| public String getDdzs() | |||
| { | |||
| return ddzs; | |||
| } | |||
| } | |||
| @ -0,0 +1,84 @@ | |||
| package com.hxhq.business.domain; | |||
| import com.baomidou.mybatisplus.annotation.TableName; | |||
| import com.hxhq.common.core.domain.MpBaseEntity; | |||
| /** | |||
| * 试验-饲养间更换笼具记录对象 t_study_room_history | |||
| * | |||
| * @author HanLong | |||
| * @date 2026-01-07 | |||
| */ | |||
| @TableName("t_study_room_history") | |||
| public class StudyRoomHistory extends MpBaseEntity | |||
| { | |||
| private static final long serialVersionUID = 1L; | |||
| /** 饲养间id */ | |||
| private Long studyRoomId; | |||
| /** 更换前笼具 */ | |||
| private String ljOld; | |||
| /** 更换后笼具 */ | |||
| private String lj; | |||
| /** 启用人id */ | |||
| private Long qyrId; | |||
| /** 启用人名称 */ | |||
| private String qyrMc; | |||
| public void setStudyRoomId(Long studyRoomId) | |||
| { | |||
| this.studyRoomId = studyRoomId; | |||
| } | |||
| public Long getStudyRoomId() | |||
| { | |||
| return studyRoomId; | |||
| } | |||
| public void setLjOld(String ljOld) | |||
| { | |||
| this.ljOld = ljOld; | |||
| } | |||
| public String getLjOld() | |||
| { | |||
| return ljOld; | |||
| } | |||
| public void setLj(String lj) | |||
| { | |||
| this.lj = lj; | |||
| } | |||
| public String getLj() | |||
| { | |||
| return lj; | |||
| } | |||
| public void setQyrId(Long qyrId) | |||
| { | |||
| this.qyrId = qyrId; | |||
| } | |||
| public Long getQyrId() | |||
| { | |||
| return qyrId; | |||
| } | |||
| public void setQyrMc(String qyrMc) | |||
| { | |||
| this.qyrMc = qyrMc; | |||
| } | |||
| public String getQyrMc() | |||
| { | |||
| return qyrMc; | |||
| } | |||
| } | |||
| @ -0,0 +1,52 @@ | |||
| package com.hxhq.business.enums.study; | |||
| /** | |||
| * 饲养间状态 1使用中 3已结束 | |||
| * @author tanfei | |||
| */ | |||
| public enum StudyRoomStatusEnum { | |||
| /** | |||
| * 1使用中 | |||
| */ | |||
| syz(1, "使用中"), | |||
| /** | |||
| * 3已结束 | |||
| */ | |||
| yjs(3, "已结束"); | |||
| private int value; | |||
| private String text; | |||
| StudyRoomStatusEnum(int value, String text) { | |||
| this.value = value; | |||
| this.text = text; | |||
| } | |||
| public int getValue() { | |||
| return value; | |||
| } | |||
| public void setValue(int value) { | |||
| this.value = value; | |||
| } | |||
| public String getText() { | |||
| return text; | |||
| } | |||
| public void setText(String text) { | |||
| this.text = text; | |||
| } | |||
| public static StudyRoomStatusEnum getEnumByValue(int type) { | |||
| for (StudyRoomStatusEnum bt : values()) { | |||
| if (bt.value == type) { | |||
| return bt; | |||
| } | |||
| } | |||
| return null; | |||
| } | |||
| } | |||
| @ -0,0 +1,128 @@ | |||
| package com.hxhq.business.form.study; | |||
| import javax.validation.constraints.NotEmpty; | |||
| /** | |||
| * 饲养间 | |||
| */ | |||
| public class StudyRoomForm { | |||
| /** 饲养间id */ | |||
| private Long id; | |||
| /** 所属试验 */ | |||
| private Long studyId; | |||
| /** 饲养间号 */ | |||
| @NotEmpty(message = "请选择饲养间号") | |||
| private String syjh; | |||
| /** 试验区域 */ | |||
| @NotEmpty(message = "请选择试验区域") | |||
| private String syqy; | |||
| /** 笼具 */ | |||
| @NotEmpty(message = "请选择笼具") | |||
| private String lj; | |||
| /** 动物种属 */ | |||
| @NotEmpty(message = "请选择动物种属") | |||
| private String dwzs; | |||
| /** 开始使用原因 */ | |||
| @NotEmpty(message = "请输入开始使用原因") | |||
| private String kssyyl; | |||
| /** | |||
| * 签名人id | |||
| */ | |||
| private Long qmrId; | |||
| /** | |||
| * 签名密码 | |||
| */ | |||
| private String qmrmm; | |||
| /** 结束使用原因 */ | |||
| private String jssyyl; | |||
| public Long getId() { | |||
| return id; | |||
| } | |||
| public void setId(Long id) { | |||
| this.id = id; | |||
| } | |||
| public Long getStudyId() { | |||
| return studyId; | |||
| } | |||
| public void setStudyId(Long studyId) { | |||
| this.studyId = studyId; | |||
| } | |||
| public String getSyjh() { | |||
| return syjh; | |||
| } | |||
| public void setSyjh(String syjh) { | |||
| this.syjh = syjh; | |||
| } | |||
| public String getSyqy() { | |||
| return syqy; | |||
| } | |||
| public void setSyqy(String syqy) { | |||
| this.syqy = syqy; | |||
| } | |||
| public String getLj() { | |||
| return lj; | |||
| } | |||
| public void setLj(String lj) { | |||
| this.lj = lj; | |||
| } | |||
| public String getDwzs() { | |||
| return dwzs; | |||
| } | |||
| public void setDwzs(String dwzs) { | |||
| this.dwzs = dwzs; | |||
| } | |||
| public String getKssyyl() { | |||
| return kssyyl; | |||
| } | |||
| public void setKssyyl(String kssyyl) { | |||
| this.kssyyl = kssyyl; | |||
| } | |||
| public Long getQmrId() { | |||
| return qmrId; | |||
| } | |||
| public void setQmrId(Long qmrId) { | |||
| this.qmrId = qmrId; | |||
| } | |||
| public String getQmrmm() { | |||
| return qmrmm; | |||
| } | |||
| public void setQmrmm(String qmrmm) { | |||
| this.qmrmm = qmrmm; | |||
| } | |||
| public String getJssyyl() { | |||
| return jssyyl; | |||
| } | |||
| public void setJssyyl(String jssyyl) { | |||
| this.jssyyl = jssyyl; | |||
| } | |||
| } | |||
| @ -0,0 +1,49 @@ | |||
| package com.hxhq.business.form.study; | |||
| /** | |||
| * 饲养间更换笼具记录列表搜索参数 | |||
| */ | |||
| public class StudyRoomHistorySearchForm { | |||
| /** 饲养间id */ | |||
| private Long studyRoomId; | |||
| /** 更换人名称 */ | |||
| private String qyrMc; | |||
| private String startDate; | |||
| private String endDate; | |||
| public Long getStudyRoomId() { | |||
| return studyRoomId; | |||
| } | |||
| public void setStudyRoomId(Long studyRoomId) { | |||
| this.studyRoomId = studyRoomId; | |||
| } | |||
| public String getQyrMc() { | |||
| return qyrMc; | |||
| } | |||
| public void setQyrMc(String qyrMc) { | |||
| this.qyrMc = qyrMc; | |||
| } | |||
| public String getStartDate() { | |||
| return startDate; | |||
| } | |||
| public void setStartDate(String startDate) { | |||
| this.startDate = startDate; | |||
| } | |||
| public String getEndDate() { | |||
| return endDate; | |||
| } | |||
| public void setEndDate(String endDate) { | |||
| this.endDate = endDate; | |||
| } | |||
| } | |||
| @ -0,0 +1,82 @@ | |||
| package com.hxhq.business.form.study; | |||
| /** | |||
| * 饲养间列表搜索参数 | |||
| */ | |||
| public class StudyRoomSearchForm { | |||
| /** 所属试验 */ | |||
| private Long studyId; | |||
| /** 饲养间号 */ | |||
| private String syjh; | |||
| /** 试验区域 */ | |||
| private String syqy; | |||
| /** 启用人名称 */ | |||
| private String qyrMc; | |||
| /** 结束人名称 */ | |||
| private String jsrMc; | |||
| private String startDate; | |||
| private String endDate; | |||
| public String getStartDate() { | |||
| return startDate; | |||
| } | |||
| public void setStartDate(String startDate) { | |||
| this.startDate = startDate; | |||
| } | |||
| public String getEndDate() { | |||
| return endDate; | |||
| } | |||
| public void setEndDate(String endDate) { | |||
| this.endDate = endDate; | |||
| } | |||
| public Long getStudyId() { | |||
| return studyId; | |||
| } | |||
| public void setStudyId(Long studyId) { | |||
| this.studyId = studyId; | |||
| } | |||
| public String getSyjh() { | |||
| return syjh; | |||
| } | |||
| public void setSyjh(String syjh) { | |||
| this.syjh = syjh; | |||
| } | |||
| public String getSyqy() { | |||
| return syqy; | |||
| } | |||
| public void setSyqy(String syqy) { | |||
| this.syqy = syqy; | |||
| } | |||
| public String getQyrMc() { | |||
| return qyrMc; | |||
| } | |||
| public void setQyrMc(String qyrMc) { | |||
| this.qyrMc = qyrMc; | |||
| } | |||
| public String getJsrMc() { | |||
| return jsrMc; | |||
| } | |||
| public void setJsrMc(String jsrMc) { | |||
| this.jsrMc = jsrMc; | |||
| } | |||
| } | |||
| @ -1,14 +0,0 @@ | |||
| package com.hxhq.business.mapper; | |||
| import com.hxhq.business.domain.Species; | |||
| import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |||
| /** | |||
| * 动物种属Mapper接口 | |||
| * | |||
| * @author hxhq | |||
| * @date 2025-12-29 | |||
| */ | |||
| public interface SpeciesMapper extends BaseMapper<Species> | |||
| { | |||
| } | |||
| @ -0,0 +1,14 @@ | |||
| package com.hxhq.business.mapper; | |||
| import com.hxhq.business.domain.StudyRoomHistory; | |||
| import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |||
| /** | |||
| * 试验-饲养间更换笼具记录Mapper接口 | |||
| * | |||
| * @author HanLong | |||
| * @date 2026-01-07 | |||
| */ | |||
| public interface StudyRoomHistoryMapper extends BaseMapper<StudyRoomHistory> | |||
| { | |||
| } | |||
| @ -1,23 +0,0 @@ | |||
| package com.hxhq.business.service; | |||
| import java.util.List; | |||
| import com.hxhq.business.domain.Species; | |||
| import com.baomidou.mybatisplus.extension.service.IService; | |||
| /** | |||
| * 动物种属Service接口 | |||
| * | |||
| * @author hxhq | |||
| * @date 2025-12-29 | |||
| */ | |||
| public interface ISpeciesService extends IService<Species> | |||
| { | |||
| /** | |||
| * 查询动物种属列表 | |||
| * | |||
| * @param species 动物种属 | |||
| * @return 动物种属集合 | |||
| */ | |||
| public List<Species> queryList(Species species); | |||
| } | |||
| @ -0,0 +1,33 @@ | |||
| package com.hxhq.business.service; | |||
| import java.util.List; | |||
| import com.hxhq.business.domain.StudyRoom; | |||
| import com.hxhq.business.domain.StudyRoomHistory; | |||
| import com.baomidou.mybatisplus.extension.service.IService; | |||
| import com.hxhq.business.form.study.StudyRoomHistorySearchForm; | |||
| import com.hxhq.business.form.study.StudyRoomSearchForm; | |||
| import com.hxhq.system.api.domain.SysUser; | |||
| /** | |||
| * 试验-饲养间更换笼具记录Service接口 | |||
| * | |||
| * @author HanLong | |||
| * @date 2026-01-07 | |||
| */ | |||
| public interface IStudyRoomHistoryService extends IService<StudyRoomHistory> | |||
| { | |||
| /** | |||
| * 查询试验-饲养间更换笼具记录列表 | |||
| * | |||
| * @param form 试验-饲养间更换笼具记录 | |||
| * @return 试验-饲养间更换笼具记录集合 | |||
| */ | |||
| public List<StudyRoomHistory> queryList(StudyRoomHistorySearchForm form); | |||
| /** | |||
| * 添加饲养间更换记录 | |||
| * @param studyRoom | |||
| */ | |||
| void addStudyRoomHistory(StudyRoom studyRoom, String oldLj, SysUser ghr); | |||
| } | |||
| @ -1,34 +0,0 @@ | |||
| package com.hxhq.business.service.impl; | |||
| import java.util.List; | |||
| import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | |||
| import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |||
| import org.springframework.stereotype.Service; | |||
| import com.hxhq.business.mapper.SpeciesMapper; | |||
| import com.hxhq.business.domain.Species; | |||
| import com.hxhq.business.service.ISpeciesService; | |||
| import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |||
| /** | |||
| * 动物种属Service业务层处理 | |||
| * | |||
| * @author hxhq | |||
| * @date 2025-12-29 | |||
| */ | |||
| @Service | |||
| public class SpeciesServiceImpl extends ServiceImpl<SpeciesMapper, Species> implements ISpeciesService | |||
| { | |||
| /** | |||
| * 查询动物种属列表 | |||
| * | |||
| * @param species 动物种属 | |||
| * @return 动物种属 | |||
| */ | |||
| @Override | |||
| public List<Species> queryList(Species species) | |||
| { | |||
| QueryWrapper<Species> queryWrapper = Wrappers.query(); | |||
| return this.list(queryWrapper); | |||
| } | |||
| } | |||
| @ -0,0 +1,66 @@ | |||
| package com.hxhq.business.service.impl; | |||
| import java.util.List; | |||
| import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |||
| import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | |||
| import com.baomidou.mybatisplus.core.toolkit.StringUtils; | |||
| import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |||
| import com.hxhq.business.domain.StudyRoom; | |||
| import com.hxhq.business.form.study.StudyRoomHistorySearchForm; | |||
| import com.hxhq.business.form.study.StudyRoomSearchForm; | |||
| import com.hxhq.common.core.domain.MpBaseEntity; | |||
| import com.hxhq.system.api.domain.SysUser; | |||
| import org.springframework.stereotype.Service; | |||
| import com.hxhq.business.mapper.StudyRoomHistoryMapper; | |||
| import com.hxhq.business.domain.StudyRoomHistory; | |||
| import com.hxhq.business.service.IStudyRoomHistoryService; | |||
| import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |||
| /** | |||
| * 试验-饲养间更换笼具记录Service业务层处理 | |||
| * | |||
| * @author HanLong | |||
| * @date 2026-01-07 | |||
| */ | |||
| @Service | |||
| public class StudyRoomHistoryServiceImpl extends ServiceImpl<StudyRoomHistoryMapper, StudyRoomHistory> implements IStudyRoomHistoryService | |||
| { | |||
| /** | |||
| * 查询试验-饲养间更换笼具记录列表 | |||
| * | |||
| * @param form 试验-饲养间更换笼具记录 | |||
| * @return 试验-饲养间更换笼具记录 | |||
| */ | |||
| @Override | |||
| public List<StudyRoomHistory> queryList(StudyRoomHistorySearchForm form) | |||
| { | |||
| LambdaQueryWrapper<StudyRoomHistory> queryWrapper = new LambdaQueryWrapper<>(); | |||
| if(StringUtils.isNotEmpty(form.getQyrMc())) { | |||
| queryWrapper.like(StudyRoomHistory::getQyrMc, form.getQyrMc()); | |||
| } | |||
| if(form.getStudyRoomId() != null) { | |||
| queryWrapper.eq(StudyRoomHistory::getStudyRoomId, form.getStudyRoomId()); | |||
| } | |||
| if(StringUtils.isNotEmpty(form.getStartDate())) { | |||
| queryWrapper.ge(MpBaseEntity::getCreateTime, form.getStartDate()); | |||
| } | |||
| if(StringUtils.isNotEmpty(form.getEndDate())) { | |||
| queryWrapper.le(MpBaseEntity::getCreateTime, form.getEndDate()); | |||
| } | |||
| queryWrapper.orderByDesc(MpBaseEntity::getId); | |||
| return this.list(queryWrapper); | |||
| } | |||
| @Override | |||
| public void addStudyRoomHistory(StudyRoom studyRoom, String oldLj, SysUser ghr) { | |||
| StudyRoomHistory studyRoomHistory = new StudyRoomHistory(); | |||
| studyRoomHistory.setStudyRoomId(studyRoom.getId()); | |||
| studyRoomHistory.setLj(studyRoom.getLj()); | |||
| studyRoomHistory.setLjOld(oldLj); | |||
| studyRoomHistory.setQyrId(ghr.getUserId()); | |||
| studyRoomHistory.setQyrMc(ghr.getNickName()); | |||
| this.save(studyRoomHistory); | |||
| } | |||
| } | |||