Browse Source

feat:[系统管理] [模板管理] 把新增/编辑先放出来

feat:[试验管理] 新增试验基础表
master
memorylkf 2 weeks ago
parent
commit
b15afa1c88
8 changed files with 248 additions and 5 deletions
  1. +65
    -0
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StudyController.java
  2. +18
    -1
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/TemplateController.java
  3. +84
    -0
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/Study.java
  4. +4
    -4
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/enums/NormalEnum.java
  5. +14
    -0
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/mapper/StudyMapper.java
  6. +23
    -0
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStudyService.java
  7. +34
    -0
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyServiceImpl.java
  8. +6
    -0
      hxhq-modules/hxhq-system/src/main/resources/mapper/business/StudyMapper.xml

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

@ -0,0 +1,65 @@
package com.hxhq.business.controller;
import java.util.Arrays;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.hxhq.business.domain.Study;
import com.hxhq.business.service.IStudyService;
import com.hxhq.common.core.web.controller.BaseController;
import com.hxhq.common.core.web.domain.AjaxResult;
import com.hxhq.common.core.web.page.TableDataInfo;
/**
* 试验Controller
*
* @author hxhq
* @date 2025-12-24
*/
@RestController
@RequestMapping("/business/study")
public class StudyController extends BaseController
{
@Autowired
private IStudyService studyService;
/**
* 查询试验列表
*/
@GetMapping("/list")
public TableDataInfo list(Study study)
{
startPage();
List<Study> list = studyService.queryList(study);
return getDataTable(list);
}
/**
* 获取试验详细信息
*/
@GetMapping(value = "/info")
public AjaxResult getInfo(Long id)
{
return AjaxResult.success(studyService.getById(id));
}
/**
* 新增试验信息
*/
@PostMapping("/save")
public AjaxResult save(@RequestBody Study study)
{
return toAjax(studyService.saveOrUpdate(study));
}
/**
* 删除试验信息
*/
@PostMapping("/delete")
public AjaxResult delete(@RequestBody Long[] ids)
{
return toAjax(studyService.removeByIds(Arrays.asList(ids)));
}
}

+ 18
- 1
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/TemplateController.java View File

@ -1,6 +1,5 @@
package com.hxhq.business.controller;
import java.util.Arrays;
import java.util.List;
import com.hxhq.common.security.annotation.RequiresPermissions;
@ -47,4 +46,22 @@ public class TemplateController extends BaseController
{
return AjaxResult.success(templateService.getById(id));
}
/**
* 新增测试信息 todo:后期删除
*/
@PostMapping("/save")
public AjaxResult save(@RequestBody Template template)
{
return toAjax(templateService.saveOrUpdate(template));
}
/**
* 删除测试信息 todo:后期删除
*/
@PostMapping("/delete")
public AjaxResult delete(@RequestBody Template template)
{
return toAjax(templateService.removeById(template.getId()));
}
}

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

@ -0,0 +1,84 @@
package com.hxhq.business.domain;
import com.baomidou.mybatisplus.annotation.TableName;
import com.hxhq.common.core.domain.MpBaseEntity;
/**
* 试验对象 t_study
*
* @author hxhq
* @date 2025-12-24
*/
@TableName("t_study")
public class Study extends MpBaseEntity
{
private static final long serialVersionUID = 1L;
/** 试验编号 */
private String sn;
/** 试验名称 */
private String name;
/** 负责人id */
private Long leader;
/** 试验状态1草稿,3试验中,5已锁定,7待归档,9归档,10待结档 */
private Integer status;
/** 借阅状态1未借阅,5待借阅,10借阅中 */
private Integer borrowStatus;
public void setSn(String sn)
{
this.sn = sn;
}
public String getSn()
{
return sn;
}
public void setName(String name)
{
this.name = name;
}
public String getName()
{
return name;
}
public void setLeader(Long leader)
{
this.leader = leader;
}
public Long getLeader()
{
return leader;
}
public void setStatus(Integer status)
{
this.status = status;
}
public Integer getStatus()
{
return status;
}
public void setBorrowStatus(Integer borrowStatus)
{
this.borrowStatus = borrowStatus;
}
public Integer getBorrowStatus()
{
return borrowStatus;
}
}

+ 4
- 4
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/enums/NormalEnum.java View File

@ -1,7 +1,7 @@
package com.hxhq.business.enums;
/**
* 状态类型1禁用3启用
* 状态类型1禁用10启用
* @author tanfei
*/
public enum NormalEnum {
@ -9,12 +9,12 @@ public enum NormalEnum {
/**
* 1禁用
*/
no(1, "部门"),
no(1, "禁用"),
/**
* 3启用
* 10启用
*/
yes(3, "学科");
yes(10, "启用");
private int value;
private String text;

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

@ -0,0 +1,14 @@
package com.hxhq.business.mapper;
import com.hxhq.business.domain.Study;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* 试验Mapper接口
*
* @author hxhq
* @date 2025-12-24
*/
public interface StudyMapper extends BaseMapper<Study>
{
}

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

@ -0,0 +1,23 @@
package com.hxhq.business.service;
import java.util.List;
import com.hxhq.business.domain.Study;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* 试验Service接口
*
* @author hxhq
* @date 2025-12-24
*/
public interface IStudyService extends IService<Study>
{
/**
* 查询试验列表
*
* @param study 试验
* @return 试验集合
*/
public List<Study> queryList(Study study);
}

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

@ -0,0 +1,34 @@
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.StudyMapper;
import com.hxhq.business.domain.Study;
import com.hxhq.business.service.IStudyService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* 试验Service业务层处理
*
* @author hxhq
* @date 2025-12-24
*/
@Service
public class StudyServiceImpl extends ServiceImpl<StudyMapper, Study> implements IStudyService
{
/**
* 查询试验列表
*
* @param study 试验
* @return 试验
*/
@Override
public List<Study> queryList(Study study)
{
QueryWrapper<Study> queryWrapper = Wrappers.query();
return this.list(queryWrapper);
}
}

+ 6
- 0
hxhq-modules/hxhq-system/src/main/resources/mapper/business/StudyMapper.xml View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hxhq.business.mapper.StudyMapper">
</mapper>

Loading…
Cancel
Save