diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StudyRoomController.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StudyRoomController.java index f382be4..9350153 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StudyRoomController.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StudyRoomController.java @@ -4,10 +4,12 @@ import java.util.Arrays; import java.util.List; import com.hxhq.business.domain.StudyRoomHistory; +import com.hxhq.business.domain.StudyRoomJcgj; import com.hxhq.business.form.study.StudyRoomForm; import com.hxhq.business.form.study.StudyRoomHistorySearchForm; import com.hxhq.business.form.study.StudyRoomSearchForm; import com.hxhq.business.service.IStudyRoomHistoryService; +import com.hxhq.business.service.IStudyRoomJcgjService; import com.hxhq.common.core.utils.StringUtils; import com.hxhq.common.security.annotation.RequiresPermissions; import com.hxhq.common.security.utils.SecurityUtils; @@ -38,6 +40,9 @@ public class StudyRoomController extends BaseController @Autowired private IStudyRoomHistoryService studyRoomHistoryService; + @Autowired + private IStudyRoomJcgjService studyRoomJcgjService; + /** * 查询试验-饲养间列表 */ @@ -50,6 +55,15 @@ public class StudyRoomController extends BaseController return getDataTable(list); } + @GetMapping("/jcgjList") + public TableDataInfo jcgjList(StudyRoomJcgj form) + { + startPage(); + List list = studyRoomJcgjService.queryList(form); + return getDataTable(list); + } + + @GetMapping("/historyList") @RequiresPermissions("business:studyRoom:ljjl") public TableDataInfo historyList(StudyRoomHistorySearchForm form) diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/StudyRoomJcgj.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/StudyRoomJcgj.java new file mode 100644 index 0000000..648f664 --- /dev/null +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/StudyRoomJcgj.java @@ -0,0 +1,149 @@ +package com.hxhq.business.domain; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.hxhq.common.core.domain.MpBaseEntity; + + +/** + * 试验-饲养间-稽查轨迹对象 t_study_room_jcgj + * + * @author hxhq + * @date 2026-01-15 + */ +@TableName("t_study_room_jcgj") +public class StudyRoomJcgj extends MpBaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 饲养间id */ + private Long studyRoomId; + + /** 稽查轨迹类型:1:流程;3:编辑 */ + private Integer jcgjlx; + + /** 稽查名称 */ + private String jcmc; + + /** 稽查名称-英文 */ + private String jcmcEn; + + /** 稽查名称颜色:1:蓝色;3:红色;5:绿色;7:橙色 */ + private Integer jcmcys; + + /** 稽查内容 */ + private String jcnr; + + /** 稽查内容-英文 */ + private String jcnrEn; + + /** 签名人id */ + private Long qmrId; + + /** 签名人名称 */ + private String qmrMc; + + /** 签名人名称-英文 */ + private String qmrMcEn; + + + public void setStudyRoomId(Long studyRoomId) + { + this.studyRoomId = studyRoomId; + } + + public Long getStudyRoomId() + { + return studyRoomId; + } + + public void setJcgjlx(Integer jcgjlx) + { + this.jcgjlx = jcgjlx; + } + + public Integer getJcgjlx() + { + return jcgjlx; + } + + public void setJcmc(String jcmc) + { + this.jcmc = jcmc; + } + + public String getJcmc() + { + return jcmc; + } + + public void setJcmcEn(String jcmcEn) + { + this.jcmcEn = jcmcEn; + } + + public String getJcmcEn() + { + return jcmcEn; + } + + public void setJcmcys(Integer jcmcys) + { + this.jcmcys = jcmcys; + } + + public Integer getJcmcys() + { + return jcmcys; + } + + public void setJcnr(String jcnr) + { + this.jcnr = jcnr; + } + + public String getJcnr() + { + return jcnr; + } + + public void setJcnrEn(String jcnrEn) + { + this.jcnrEn = jcnrEn; + } + + public String getJcnrEn() + { + return jcnrEn; + } + + public void setQmrId(Long qmrId) + { + this.qmrId = qmrId; + } + + public Long getQmrId() + { + return qmrId; + } + + public void setQmrMc(String qmrMc) + { + this.qmrMc = qmrMc; + } + + public String getQmrMc() + { + return qmrMc; + } + + public void setQmrMcEn(String qmrMcEn) + { + this.qmrMcEn = qmrMcEn; + } + + public String getQmrMcEn() + { + return qmrMcEn; + } + +} diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/StudySj.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/StudySj.java index 417c16f..bd6ccfc 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/StudySj.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/StudySj.java @@ -42,4 +42,4 @@ public class StudySj extends MpBaseEntity return studyId; } -} +} \ No newline at end of file diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/mapper/StudyRoomJcgjMapper.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/mapper/StudyRoomJcgjMapper.java new file mode 100644 index 0000000..2329c2c --- /dev/null +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/mapper/StudyRoomJcgjMapper.java @@ -0,0 +1,14 @@ +package com.hxhq.business.mapper; + +import com.hxhq.business.domain.StudyRoomJcgj; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +/** + * 试验-饲养间-稽查轨迹Mapper接口 + * + * @author hxhq + * @date 2026-01-15 + */ +public interface StudyRoomJcgjMapper extends BaseMapper +{ + +} diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/mapper/StudySjMapper.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/mapper/StudySjMapper.java index 6696248..accde6b 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/mapper/StudySjMapper.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/mapper/StudySjMapper.java @@ -11,4 +11,4 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; public interface StudySjMapper extends BaseMapper { -} +} \ No newline at end of file diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudyRoomJcgjService.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudyRoomJcgjService.java new file mode 100644 index 0000000..1f911f4 --- /dev/null +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudyRoomJcgjService.java @@ -0,0 +1,26 @@ +package com.hxhq.business.service; + +import java.util.List; +import com.hxhq.business.domain.StudyRoomJcgj; +import com.baomidou.mybatisplus.extension.service.IService; +import com.hxhq.system.api.domain.SysUser; + +/** + * 试验-饲养间-稽查轨迹Service接口 + * + * @author hxhq + * @date 2026-01-15 + */ +public interface IStudyRoomJcgjService extends IService +{ + /** + * 查询试验-饲养间-稽查轨迹列表 + * + * @param studyRoomJcgj 试验-饲养间-稽查轨迹 + * @return 试验-饲养间-稽查轨迹集合 + */ + public List queryList(StudyRoomJcgj studyRoomJcgj); + + void saveJcgj(Long studyRoomId, Integer jcgjlx, String jcmc, String jcmcEn, Integer jcmcys, + String jcnr, String jcnrEn, SysUser qmr); +} diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyRoomJcgjServiceImpl.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyRoomJcgjServiceImpl.java new file mode 100644 index 0000000..cdca461 --- /dev/null +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyRoomJcgjServiceImpl.java @@ -0,0 +1,67 @@ +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.Wrappers; +import com.hxhq.common.core.domain.MpBaseEntity; +import com.hxhq.common.core.utils.DateUtils; +import com.hxhq.common.core.utils.StringUtils; +import com.hxhq.system.api.domain.SysUser; +import org.springframework.stereotype.Service; +import com.hxhq.business.mapper.StudyRoomJcgjMapper; +import com.hxhq.business.domain.StudyRoomJcgj; +import com.hxhq.business.service.IStudyRoomJcgjService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; + +/** + * 试验-饲养间-稽查轨迹Service业务层处理 + * + * @author hxhq + * @date 2026-01-15 + */ +@Service +public class StudyRoomJcgjServiceImpl extends ServiceImpl implements IStudyRoomJcgjService +{ + /** + * 查询试验-饲养间-稽查轨迹列表 + * + * @param studyRoomJcgj 试验-饲养间-稽查轨迹 + * @return 试验-饲养间-稽查轨迹 + */ + @Override + public List queryList(StudyRoomJcgj studyRoomJcgj) + { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + if(studyRoomJcgj.getStudyRoomId() != null) { + queryWrapper.eq(StudyRoomJcgj::getStudyRoomId, studyRoomJcgj.getStudyRoomId()); + } + if(studyRoomJcgj.getJcgjlx() != null) { + queryWrapper.eq(StudyRoomJcgj::getJcgjlx, studyRoomJcgj.getJcgjlx()); + } + if(StringUtils.isNotEmpty(studyRoomJcgj.getJcmc())) { + queryWrapper.and(p -> p.like(StudyRoomJcgj::getJcmc, studyRoomJcgj.getJcmc()) + .or().like(StudyRoomJcgj::getQmrMc, studyRoomJcgj.getJcmc())); + } + queryWrapper.orderByDesc(MpBaseEntity::getId); + return this.list(queryWrapper); + } + + @Override + public void saveJcgj(Long studyRoomId, Integer jcgjlx, String jcmc, String jcmcEn, Integer jcmcys, String jcnr, String jcnrEn, SysUser qmr) { + StudyRoomJcgj jcgj = new StudyRoomJcgj(); + jcgj.setStudyRoomId(studyRoomId); + jcgj.setJcgjlx(jcgjlx); + jcgj.setJcmc(jcmc); + jcgj.setJcmcEn(jcmcEn); + jcgj.setJcmcys(jcmcys); + jcgj.setJcnr(jcnr); + jcgj.setJcmcEn(jcmcEn); + jcgj.setQmrId(qmr.getUserId()); + jcgj.setQmrMc(qmr.getNickName()); + jcgj.setQmrMcEn(qmr.getUserName()); + this.save(jcgj); + } + +} diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyRoomServiceImpl.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyRoomServiceImpl.java index a8e7332..4cc0594 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyRoomServiceImpl.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyRoomServiceImpl.java @@ -1,14 +1,20 @@ package com.hxhq.business.service.impl; import java.util.Date; +import java.util.LinkedHashMap; import java.util.List; +import java.util.Map; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.StringUtils; import com.hxhq.business.enums.study.StudyRoomStatusEnum; +import com.hxhq.business.enums.zykgl.JcgjlxEnum; +import com.hxhq.business.enums.zykgl.JcmcysEnum; import com.hxhq.business.form.study.StudyRoomForm; import com.hxhq.business.form.study.StudyRoomSearchForm; import com.hxhq.business.service.IStudyRoomHistoryService; +import com.hxhq.business.service.IStudyRoomJcgjService; +import com.hxhq.business.utils.JctUtil; import com.hxhq.common.core.exception.ServiceException; import com.hxhq.system.api.domain.SysUser; import com.hxhq.system.service.ISysUserService; @@ -36,6 +42,8 @@ public class StudyRoomServiceImpl extends ServiceImpl queryList(StudyRoomSearchForm form) { @@ -66,7 +74,7 @@ public class StudyRoomServiceImpl extends ServiceImpl formData = new LinkedHashMap<>(); + formData.put("试验区域", studyRoom.getSyqy()); + formData.put("饲养间号", studyRoom.getSyjh()); + formData.put("动物种属", studyRoom.getDwzs()); + formData.put("笼具", studyRoom.getLj()); + formData.put("开始使用原因", studyRoom.getKssyyl()); + + Map formDataEn = new LinkedHashMap<>(); + formDataEn.put("Area", studyRoom.getSyqy()); + formDataEn.put("Room ID", studyRoom.getSyjh()); + formDataEn.put("Species", studyRoom.getDwzs()); + formDataEn.put("Cage", studyRoom.getLj()); + formDataEn.put("Start Reason", studyRoom.getKssyyl()); + studyRoomJcgjService.saveJcgj(studyRoom.getId(), JcgjlxEnum.lc.getValue(), "启用饲养间", "Start Usage", JcmcysEnum.blue.getValue(), + JctUtil.formatStr(formData), JctUtil.formatStr(formDataEn), qmr); } @Override public void updateLj(StudyRoomForm form) { SysUser qmr = sysUserService.selectUserById(form.getQmrId()); - // TODO + sysUserService.checkPassword(qmr, form.getQmrmm(), false); + StudyRoom studyRoom = this.getById(form.getId()); if(studyRoom == null) { throw new ServiceException("饲养间不存在或已删除"); @@ -95,12 +120,22 @@ public class StudyRoomServiceImpl extends ServiceImpl formData = new LinkedHashMap<>(); + formData.put("原笼具", ljOld); + formData.put("新笼具", studyRoom.getLj()); + + Map formDataEn = new LinkedHashMap<>(); + formDataEn.put("原笼具", ljOld); + formDataEn.put("新笼具", studyRoom.getLj()); + studyRoomJcgjService.saveJcgj(studyRoom.getId(), JcgjlxEnum.bj.getValue(), "更换笼具", "End Usage", JcmcysEnum.blue.getValue(), + JctUtil.formatStr(formData), JctUtil.formatStr(formDataEn), qmr); } @Override public void js(StudyRoomForm form) { SysUser qmr = sysUserService.selectUserById(form.getQmrId()); - // TODO + sysUserService.checkPassword(qmr, form.getQmrmm(), false); + StudyRoom studyRoom = this.getById(form.getId()); if(studyRoom == null) { throw new ServiceException("饲养间不存在或已删除"); @@ -114,6 +149,22 @@ public class StudyRoomServiceImpl extends ServiceImpl formData = new LinkedHashMap<>(); + formData.put("试验区域", studyRoom.getSyqy()); + formData.put("饲养间号", studyRoom.getSyjh()); + formData.put("动物种属", studyRoom.getDwzs()); + formData.put("笼具", studyRoom.getLj()); + formData.put("结束使用原因", studyRoom.getJssyyl()); + + Map formDataEn = new LinkedHashMap<>(); + formDataEn.put("Area", studyRoom.getSyqy()); + formDataEn.put("Room ID", studyRoom.getSyjh()); + formDataEn.put("Species", studyRoom.getDwzs()); + formDataEn.put("Cage", studyRoom.getLj()); + formDataEn.put("End Reason", studyRoom.getJssyyl()); + studyRoomJcgjService.saveJcgj(studyRoom.getId(), JcgjlxEnum.lc.getValue(), "饲养间使用结束", "End Usage", JcmcysEnum.blue.getValue(), + JctUtil.formatStr(formData), JctUtil.formatStr(formDataEn), qmr); } }