Browse Source

featch:[资源管理][仪器管理]

master
HanLong 3 weeks ago
parent
commit
4b1cd2a968
6 changed files with 271 additions and 0 deletions
  1. +65
    -0
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/YqController.java
  2. +129
    -0
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/Yq.java
  3. +14
    -0
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/mapper/YqMapper.java
  4. +23
    -0
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IYqService.java
  5. +34
    -0
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/YqServiceImpl.java
  6. +6
    -0
      hxhq-modules/hxhq-system/src/main/resources/mapper/business/YqMapper.xml

+ 65
- 0
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/YqController.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.Yq;
import com.hxhq.business.service.IYqService;
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 HanLong
* @date 2025-12-20
*/
@RestController
@RequestMapping("/business/yq")
public class YqController extends BaseController
{
@Autowired
private IYqService yqService;
/**
* 查询仪器管理列表
*/
@GetMapping("/list")
public TableDataInfo list(Yq yq)
{
startPage();
List<Yq> list = yqService.queryList(yq);
return getDataTable(list);
}
/**
* 获取仪器管理详细信息
*/
@GetMapping(value = "/info")
public AjaxResult getInfo(Long id)
{
return AjaxResult.success(yqService.getById(id));
}
/**
* 新增仪器管理信息
*/
@PostMapping("/save")
public AjaxResult save(@RequestBody Yq yq)
{
return toAjax(yqService.saveOrUpdate(yq));
}
/**
* 删除仪器管理信息
*/
@PostMapping("/delete")
public AjaxResult delete(@RequestBody Long[] ids)
{
return toAjax(yqService.removeByIds(Arrays.asList(ids)));
}
}

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

@ -0,0 +1,129 @@
package com.hxhq.business.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.baomidou.mybatisplus.annotation.TableName;
import com.hxhq.common.core.domain.MpBaseEntity;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.Max;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
/**
* 仪器管理对象 t_yq
*
* @author HanLong
* @date 2025-12-20
*/
@TableName("t_yq")
public class Yq extends MpBaseEntity {
private static final long serialVersionUID = 1L;
/**
* 名称
*/
@NotEmpty(message = "请输入仪器名称")
@Length(max = 50, message = "仪器名称不能超过50字")
private String mc;
/**
* 编号
*/
@NotEmpty(message = "请输入仪器编号")
@Length(max = 50, message = "仪器编号不能超过50字")
private String bh;
/**
* 型号
*/
@NotEmpty(message = "请输入仪器型号")
@Length(max = 50, message = "仪器型号不能超过50字")
private String xh;
/**
* 来源
*/
@NotEmpty(message = "请输入仪器来源")
@Length(max = 50, message = "仪器来源不能超过50字")
private String ly;
/**
* 校准日期
*/
@JsonFormat(pattern = "yyyy-MM-dd")
@NotNull(message = "请选择校准日期")
private Date jzrq;
/**
* 部门id
*/
@NotNull(message = "请选择所属部门")
private Long bmId;
/**
* 温层
*/
@NotNull(message = "请选择所温层")
private Long wc;
public void setMc(String mc) {
this.mc = mc;
}
public String getMc() {
return mc;
}
public void setBh(String bh) {
this.bh = bh;
}
public String getBh() {
return bh;
}
public void setXh(String xh) {
this.xh = xh;
}
public String getXh() {
return xh;
}
public void setLy(String ly) {
this.ly = ly;
}
public String getLy() {
return ly;
}
public void setJzrq(Date jzrq) {
this.jzrq = jzrq;
}
public Date getJzrq() {
return jzrq;
}
public void setBmId(Long bmId) {
this.bmId = bmId;
}
public Long getBmId() {
return bmId;
}
public void setWc(Long wc) {
this.wc = wc;
}
public Long getWc() {
return wc;
}
}

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

@ -0,0 +1,14 @@
package com.hxhq.business.mapper;
import com.hxhq.business.domain.Yq;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* 仪器管理Mapper接口
*
* @author HanLong
* @date 2025-12-20
*/
public interface YqMapper extends BaseMapper<Yq>
{
}

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

@ -0,0 +1,23 @@
package com.hxhq.business.service;
import java.util.List;
import com.hxhq.business.domain.Yq;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* 仪器管理Service接口
*
* @author HanLong
* @date 2025-12-20
*/
public interface IYqService extends IService<Yq>
{
/**
* 查询仪器管理列表
*
* @param yq 仪器管理
* @return 仪器管理集合
*/
public List<Yq> queryList(Yq yq);
}

+ 34
- 0
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/YqServiceImpl.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.YqMapper;
import com.hxhq.business.domain.Yq;
import com.hxhq.business.service.IYqService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* 仪器管理Service业务层处理
*
* @author HanLong
* @date 2025-12-20
*/
@Service
public class YqServiceImpl extends ServiceImpl<YqMapper, Yq> implements IYqService
{
/**
* 查询仪器管理列表
*
* @param yq 仪器管理
* @return 仪器管理
*/
@Override
public List<Yq> queryList(Yq yq)
{
QueryWrapper<Yq> queryWrapper = Wrappers.query();
return this.list(queryWrapper);
}
}

+ 6
- 0
hxhq-modules/hxhq-system/src/main/resources/mapper/business/YqMapper.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.YqMapper">
</mapper>

Loading…
Cancel
Save