From c661653d2940a67bae17cacfbc234bf8499490e0 Mon Sep 17 00:00:00 2001 From: "15881625488@163.com" <15881625488@163.com> Date: Fri, 19 Dec 2025 16:33:50 +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][=E9=92=A5=E5=8C=99=E7=AE=A1=E7=90=86]=E9=92=A5?= =?UTF-8?q?=E5=8C=99=E5=8F=91=E6=94=BE=EF=BC=8C=E9=92=A5=E5=8C=99=E5=BD=92?= =?UTF-8?q?=E8=BF=98=EF=BC=8C=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hxhq/business/controller/ZcgController.java | 11 +++ .../main/java/com/hxhq/business/domain/Zcg.java | 18 ++-- .../java/com/hxhq/business/form/zcg/YsghForm.java | 99 +++++++++++++++++++++- .../com/hxhq/business/service/IZcgService.java | 8 ++ .../hxhq/business/service/impl/ZcgServiceImpl.java | 44 ++++++++-- 5 files changed, 161 insertions(+), 19 deletions(-) diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/ZcgController.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/ZcgController.java index 76bc809..919777c 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/ZcgController.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/ZcgController.java @@ -59,6 +59,17 @@ public class ZcgController extends BaseController return AjaxResult.success("操作成功"); } + + /** + * 批量钥匙归还 + */ + @PostMapping("/ysghBatch") + public AjaxResult ysghBatch(@RequestBody YsghForm form) + { + zcgService.ysghBatch(form); + return AjaxResult.success("操作成功"); + } + /** * 钥匙发放 */ diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/Zcg.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/Zcg.java index 1cfd0f7..ba803ce 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/Zcg.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/Zcg.java @@ -1,5 +1,7 @@ package com.hxhq.business.domain; +import com.baomidou.mybatisplus.annotation.FieldStrategy; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableName; import com.hxhq.common.core.domain.MpBaseEntity; @@ -18,19 +20,19 @@ public class Zcg extends MpBaseEntity /** 暂存柜名称 */ private String mc; - /** 钥匙编号 */ - private String bh; - /** 钥匙1领取人ID */ + @TableField(updateStrategy = FieldStrategy.IGNORED) private Long lqr1Id; /** 钥匙2领取人ID */ + @TableField(updateStrategy = FieldStrategy.IGNORED) private Long lqr2Id; /** 状态:1:未借用;5:借用中 */ private Integer zt; /** 关联药剂 */ + @TableField(updateStrategy = FieldStrategy.IGNORED) private String glyj; public String getGlyj() { @@ -51,16 +53,6 @@ public class Zcg extends MpBaseEntity return mc; } - public void setBh(String bh) - { - this.bh = bh; - } - - public String getBh() - { - return bh; - } - public Long getLqr1Id() { return lqr1Id; } diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/form/zcg/YsghForm.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/form/zcg/YsghForm.java index 2cce477..69672bf 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/form/zcg/YsghForm.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/form/zcg/YsghForm.java @@ -5,6 +5,103 @@ import com.hxhq.business.domain.Zcg; /** * @author 15881 */ -public class YsghForm extends Zcg { +public class YsghForm { + /** 暂存柜id */ + private Long id; + /** 暂存柜ids */ + private String ids; + + /** 签名意义 */ + private String qmyy; + + /** 钥匙1归还人ID */ + private Long ghr1Id; + + /** 钥匙2归还人ID */ + private Long ghr2Id; + + /** 钥匙1归还人密码 */ + private String ghr1mm; + + /** 钥匙2归还人密码 */ + private String ghr2mm; + + /** 接收人id */ + private String jsrId; + + /** 接收人密码 */ + private String jsrmm; + + public String getIds() { + return ids; + } + + public void setIds(String ids) { + this.ids = ids; + } + + public String getJsrId() { + return jsrId; + } + + public void setJsrId(String jsrId) { + this.jsrId = jsrId; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getQmyy() { + return qmyy; + } + + public void setQmyy(String qmyy) { + this.qmyy = qmyy; + } + + public Long getGhr1Id() { + return ghr1Id; + } + + public void setGhr1Id(Long ghr1Id) { + this.ghr1Id = ghr1Id; + } + + public Long getGhr2Id() { + return ghr2Id; + } + + public void setGhr2Id(Long ghr2Id) { + this.ghr2Id = ghr2Id; + } + + public String getGhr1mm() { + return ghr1mm; + } + + public void setGhr1mm(String ghr1mm) { + this.ghr1mm = ghr1mm; + } + + public String getGhr2mm() { + return ghr2mm; + } + + public void setGhr2mm(String ghr2mm) { + this.ghr2mm = ghr2mm; + } + + public String getJsrmm() { + return jsrmm; + } + + public void setJsrmm(String jsrmm) { + this.jsrmm = jsrmm; + } } diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IZcgService.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IZcgService.java index 3d1dd9b..190c2ce 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IZcgService.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IZcgService.java @@ -41,6 +41,14 @@ public interface IZcgService extends IService */ public void ysgh(YsghForm form); + + /** + * 批量钥匙归还 + * + * @param form + */ + public void ysghBatch(YsghForm form); + /** * 钥匙发放 * diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/ZcgServiceImpl.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/ZcgServiceImpl.java index 7b5f59c..97bdb62 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/ZcgServiceImpl.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/ZcgServiceImpl.java @@ -58,6 +58,9 @@ public class ZcgServiceImpl extends ServiceImpl implements IZcgS */ @Override public Zcg queryInfo(Long id){ + if(id==null||id.longValue()<0){ + throw new SecurityException("参数id不正确"); + } return baseMapper.queryInfo(id); } @@ -73,7 +76,7 @@ public class ZcgServiceImpl extends ServiceImpl implements IZcgS if(form.getId()==null||form.getId().longValue()<0){ throw new SecurityException("参数id不正确"); } - Zcg zcgOld=this.getById(form.getId()); + Zcg zcgOld=this.getById(form.getId()); if(zcgOld==null){ throw new SecurityException("暂存柜不存在或已删除"); } @@ -81,14 +84,45 @@ public class ZcgServiceImpl extends ServiceImpl implements IZcgS throw new SecurityException("暂存柜未借用"); } //验证钥匙1领取人密码,钥匙2领取人密码,发放人密码 todo - zcgOld.setLqr2Id(0L); - zcgOld.setLqr2Id(0L); - zcgOld.setGlyj(""); + zcgOld.setLqr1Id(null); + zcgOld.setLqr2Id(null); + zcgOld.setGlyj(null); zcgOld.setZt(zcgJyztEnum.wjy.getValue()); this.updateById(zcgOld); //存台账 } + + + + /** + * 批量钥匙归还 + * + * @param form + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void ysghBatch(YsghForm form){ + if(StringUtils.isBlank(form.getIds())){ + throw new SecurityException("参数ids不正确"); + } + //验证钥匙1领取人密码,钥匙2领取人密码,发放人密码 todo + QueryWrapper queryWrapper = Wrappers.query(); + queryWrapper.in("id",form.getIds()); + List zcgList=this.list(queryWrapper); + for (Zcg zcg:zcgList){ + if(!zcg.getZt().equals(zcgJyztEnum.jyz.getValue())){ + throw new SecurityException("暂存柜"+zcg.getMc()+"未借用"); + } + zcg.setLqr1Id(null); + zcg.setLqr2Id(null); + zcg.setGlyj(null); + zcg.setZt(zcgJyztEnum.wjy.getValue()); + this.updateById(zcg); + //存台账 + } + } + /** * 钥匙发放 * @@ -100,6 +134,7 @@ public class ZcgServiceImpl extends ServiceImpl implements IZcgS if(form.getId()==null||form.getId().longValue()<0){ throw new SecurityException("参数id不正确"); } + //验证钥匙1领取人密码,钥匙2领取人密码,发放人密码 todo Zcg zcgOld=this.getById(form.getId()); if(zcgOld==null){ throw new SecurityException("暂存柜不存在或已删除"); @@ -107,7 +142,6 @@ public class ZcgServiceImpl extends ServiceImpl implements IZcgS if(!zcgOld.getZt().equals(zcgJyztEnum.wjy.getValue())){ throw new SecurityException("暂存柜已借用"); } - //验证钥匙1领取人密码,钥匙2领取人密码,发放人密码 todo zcgOld.setLqr1Id(form.getLqr1Id()); zcgOld.setLqr2Id(form.getLqr2Id()); if(StringUtils.isBlank(zcgOld.getGlyj())){