From cb6773925091ac6505c9410da794a4bdaeae612d Mon Sep 17 00:00:00 2001 From: HanLong <404402223@qq.com> Date: Mon, 9 Feb 2026 13:46:16 +0800 Subject: [PATCH] =?UTF-8?q?fix:[=E8=B5=84=E6=BA=90=E5=BA=93=E7=AE=A1?= =?UTF-8?q?=E7=90=86][=E4=BE=9B=E8=AF=95=E5=93=81=E5=85=A5=E5=BA=93?= =?UTF-8?q?=E8=AE=B0=E5=BD=95]=E6=9C=89=E6=95=88=E6=9C=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/hxhq/business/controller/YqController.java | 6 +- .../java/com/hxhq/business/domain/GspRkjl.java | 13 +++ .../hxhq/business/dto/gsp/ImportGspRkjlDto.java | 102 +++++++++++++++++++++ .../com/hxhq/business/form/gsp/GspRkjlForm.java | 11 +++ .../java/com/hxhq/business/service/IYqService.java | 7 ++ .../hxhq/business/service/impl/YqServiceImpl.java | 8 ++ 6 files changed, 146 insertions(+), 1 deletion(-) create mode 100644 hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/dto/gsp/ImportGspRkjlDto.java 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 index a545c92..b713c5d 100644 --- 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 @@ -78,11 +78,15 @@ public class YqController extends BaseController { } /** - * 新增、编辑仪器管理信息 + * 新增仪器 */ @PostMapping("/save") @RequiresPermissions("business:resource:yq:xz") public AjaxResult save(@RequestBody @Validated YqForm form) { + Yq yq = yqService.queryByBh(form.getBh()); + if(yq != null) { + return error("仪器编号【" + form.getBh() + "】已存在"); + } form.setQmrId(SecurityUtils.getUserId()); yqService.addYq(form); return success(); diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/GspRkjl.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/GspRkjl.java index 1f7a9af..b96b7da 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/GspRkjl.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/GspRkjl.java @@ -61,6 +61,11 @@ public class GspRkjl extends MpBaseEntity @Compare(name = "注意事项", nameEn = "Notification") private String zysx; + /** 有效日期 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Compare(name = "有效期", nameEn = "Validity Period") + private Date yxq; + /** 归档申请人id */ private Long gdsqrId; @@ -231,4 +236,12 @@ public class GspRkjl extends MpBaseEntity public void setGdsqrMc(String gdsqrMc) { this.gdsqrMc = gdsqrMc; } + + public Date getYxq() { + return yxq; + } + + public void setYxq(Date yxq) { + this.yxq = yxq; + } } diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/dto/gsp/ImportGspRkjlDto.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/dto/gsp/ImportGspRkjlDto.java new file mode 100644 index 0000000..0450e55 --- /dev/null +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/dto/gsp/ImportGspRkjlDto.java @@ -0,0 +1,102 @@ +package com.hxhq.business.dto.gsp; + +import com.hxhq.common.core.annotation.Excel; + +public class ImportGspRkjlDto { + + @Excel(name = "名称") + private String mc; + + @Excel(name = "批号") + private String ph; + + @Excel(name = "规格") + private String gg; + + @Excel(name = "入库时间") + private String rksj; + + @Excel(name = "入库量") + private String rkl; + + @Excel(name = "单位") + private String rkdw; + + private String cctj; + + private String yxq; + + private String zysx; + + public String getMc() { + return mc; + } + + public void setMc(String mc) { + this.mc = mc; + } + + public String getPh() { + return ph; + } + + public void setPh(String ph) { + this.ph = ph; + } + + public String getGg() { + return gg; + } + + public void setGg(String gg) { + this.gg = gg; + } + + public String getRksj() { + return rksj; + } + + public void setRksj(String rksj) { + this.rksj = rksj; + } + + public String getRkl() { + return rkl; + } + + public void setRkl(String rkl) { + this.rkl = rkl; + } + + public String getRkdw() { + return rkdw; + } + + public void setRkdw(String rkdw) { + this.rkdw = rkdw; + } + + public String getCctj() { + return cctj; + } + + public void setCctj(String cctj) { + this.cctj = cctj; + } + + public String getYxq() { + return yxq; + } + + public void setYxq(String yxq) { + this.yxq = yxq; + } + + public String getZysx() { + return zysx; + } + + public void setZysx(String zysx) { + this.zysx = zysx; + } +} diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/form/gsp/GspRkjlForm.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/form/gsp/GspRkjlForm.java index 1dad249..ec1ca39 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/form/gsp/GspRkjlForm.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/form/gsp/GspRkjlForm.java @@ -35,6 +35,9 @@ public class GspRkjlForm { @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date rksj; + @JsonFormat(pattern = "yyyy-MM-dd") + private Date yxq; + /** 存储条件 */ private String cctj; @@ -154,4 +157,12 @@ public class GspRkjlForm { public void setQmrmm(String qmrmm) { this.qmrmm = qmrmm; } + + public Date getYxq() { + return yxq; + } + + public void setYxq(Date yxq) { + this.yxq = yxq; + } } 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 index b031a50..ce91804 100644 --- 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 @@ -29,6 +29,13 @@ public interface IYqService extends IService Yq queryInfo(Long id); /** + * 通过编号获取仪器 + * @param bh 编号 + * @return 仪器信息 + */ + Yq queryByBh(String bh); + + /** * 新增仪器信息 * @param yqForm */ 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 index 82e7be1..17263e8 100644 --- 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 @@ -3,6 +3,7 @@ package com.hxhq.business.service.impl; import java.util.ArrayList; 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.CollectionUtils; import com.baomidou.mybatisplus.core.toolkit.StringUtils; @@ -84,6 +85,13 @@ public class YqServiceImpl extends ServiceImpl implements IYqServi } @Override + public Yq queryByBh(String bh) { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(Yq::getBh, bh); + return getOne(queryWrapper); + } + + @Override public void addYq(YqForm yqForm) { SysUser qmr = sysUserService.selectUserById(yqForm.getQmrId()); sysUserService.checkPassword(qmr, yqForm.getQmrmm(), false);