diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/YqController.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/YqController.java new file mode 100644 index 0000000..cd7a3f9 --- /dev/null +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/YqController.java @@ -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 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))); + } +} diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/Yq.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/Yq.java new file mode 100644 index 0000000..bb6f5b7 --- /dev/null +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/Yq.java @@ -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; + } + +} diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/mapper/YqMapper.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/mapper/YqMapper.java new file mode 100644 index 0000000..baefbbc --- /dev/null +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/mapper/YqMapper.java @@ -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 +{ + +} diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IYqService.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IYqService.java new file mode 100644 index 0000000..f950315 --- /dev/null +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IYqService.java @@ -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 +{ + /** + * 查询仪器管理列表 + * + * @param yq 仪器管理 + * @return 仪器管理集合 + */ + public List queryList(Yq yq); + +} diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/YqServiceImpl.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/YqServiceImpl.java new file mode 100644 index 0000000..5883ef8 --- /dev/null +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/YqServiceImpl.java @@ -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 implements IYqService +{ + /** + * 查询仪器管理列表 + * + * @param yq 仪器管理 + * @return 仪器管理 + */ + @Override + public List queryList(Yq yq) + { + QueryWrapper queryWrapper = Wrappers.query(); + return this.list(queryWrapper); + } + +} diff --git a/hxhq-modules/hxhq-system/src/main/resources/mapper/business/YqMapper.xml b/hxhq-modules/hxhq-system/src/main/resources/mapper/business/YqMapper.xml new file mode 100644 index 0000000..26484cf --- /dev/null +++ b/hxhq-modules/hxhq-system/src/main/resources/mapper/business/YqMapper.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file