Browse Source

feat:[试验管理][饲养间管理]详情

master
HanLong 3 months ago
parent
commit
7dcbe7a805
8 changed files with 326 additions and 5 deletions
  1. +14
    -0
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StudyRoomController.java
  2. +149
    -0
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/StudyRoomJcgj.java
  3. +1
    -1
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/StudySj.java
  4. +14
    -0
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/mapper/StudyRoomJcgjMapper.java
  5. +1
    -1
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/mapper/StudySjMapper.java
  6. +26
    -0
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudyRoomJcgjService.java
  7. +67
    -0
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyRoomJcgjServiceImpl.java
  8. +54
    -3
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyRoomServiceImpl.java

+ 14
- 0
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StudyRoomController.java View File

@ -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<StudyRoomJcgj> list = studyRoomJcgjService.queryList(form);
return getDataTable(list);
}
@GetMapping("/historyList")
@RequiresPermissions("business:studyRoom:ljjl")
public TableDataInfo historyList(StudyRoomHistorySearchForm form)

+ 149
- 0
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/StudyRoomJcgj.java View File

@ -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;
}
}

+ 1
- 1
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/StudySj.java View File

@ -42,4 +42,4 @@ public class StudySj extends MpBaseEntity
return studyId;
}
}
}

+ 14
- 0
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/mapper/StudyRoomJcgjMapper.java View File

@ -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<StudyRoomJcgj>
{
}

+ 1
- 1
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/mapper/StudySjMapper.java View File

@ -11,4 +11,4 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
public interface StudySjMapper extends BaseMapper<StudySj>
{
}
}

+ 26
- 0
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudyRoomJcgjService.java View File

@ -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<StudyRoomJcgj>
{
/**
* 查询试验-饲养间-稽查轨迹列表
*
* @param studyRoomJcgj 试验-饲养间-稽查轨迹
* @return 试验-饲养间-稽查轨迹集合
*/
public List<StudyRoomJcgj> queryList(StudyRoomJcgj studyRoomJcgj);
void saveJcgj(Long studyRoomId, Integer jcgjlx, String jcmc, String jcmcEn, Integer jcmcys,
String jcnr, String jcnrEn, SysUser qmr);
}

+ 67
- 0
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyRoomJcgjServiceImpl.java View File

@ -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<StudyRoomJcgjMapper, StudyRoomJcgj> implements IStudyRoomJcgjService
{
/**
* 查询试验-饲养间-稽查轨迹列表
*
* @param studyRoomJcgj 试验-饲养间-稽查轨迹
* @return 试验-饲养间-稽查轨迹
*/
@Override
public List<StudyRoomJcgj> queryList(StudyRoomJcgj studyRoomJcgj)
{
LambdaQueryWrapper<StudyRoomJcgj> 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);
}
}

+ 54
- 3
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyRoomServiceImpl.java View File

@ -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
@Autowired
private ISysUserService sysUserService;
@Autowired
private IStudyRoomJcgjService studyRoomJcgjService;
@Override
public List<StudyRoom> queryList(StudyRoomSearchForm form) {
@ -66,7 +74,7 @@ public class StudyRoomServiceImpl extends ServiceImpl
@Override
public void add(StudyRoomForm form) {
SysUser qmr = sysUserService.selectUserById(form.getQmrId());
// TODO
sysUserService.checkPassword(qmr, form.getQmrmm(), false);
StudyRoom studyRoom = new StudyRoom();
BeanUtils.copyProperties(form, studyRoom);
studyRoom.setKssj(new Date());
@ -76,12 +84,29 @@ public class StudyRoomServiceImpl extends ServiceImpl
this.save(studyRoom);
studyRoomHistoryService.addStudyRoomHistory(studyRoom, null, qmr);
Map<String, String> formData = new LinkedHashMap<>();
formData.put("试验区域", studyRoom.getSyqy());
formData.put("饲养间号", studyRoom.getSyjh());
formData.put("动物种属", studyRoom.getDwzs());
formData.put("笼具", studyRoom.getLj());
formData.put("开始使用原因", studyRoom.getKssyyl());
Map<String, String> 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
studyRoomHistoryService.addStudyRoomHistory(studyRoom, ljOld, qmr);
Map<String, String> formData = new LinkedHashMap<>();
formData.put("原笼具", ljOld);
formData.put("新笼具", studyRoom.getLj());
Map<String, String> 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
studyRoom.setJsrMc(qmr.getNickName());
studyRoom.setJssj(new Date());
this.updateById(studyRoom);
Map<String, String> formData = new LinkedHashMap<>();
formData.put("试验区域", studyRoom.getSyqy());
formData.put("饲养间号", studyRoom.getSyjh());
formData.put("动物种属", studyRoom.getDwzs());
formData.put("笼具", studyRoom.getLj());
formData.put("结束使用原因", studyRoom.getJssyyl());
Map<String, String> 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);
}
}

Loading…
Cancel
Save