From 85d6b330fd287e922878f25042c9f31fa2bb78f1 Mon Sep 17 00:00:00 2001 From: "15881625488@163.com" <15881625488@163.com> Date: Fri, 9 Jan 2026 19:32:25 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A[=E8=B5=84=E6=BA=90=E5=BA=93?= =?UTF-8?q?=E7=AE=A1=E7=90=86][=E7=BB=99=E8=8D=AF=E5=88=B6=E5=89=82?= =?UTF-8?q?=E5=BD=92=E8=BF=98]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/hxhq/business/domain/Gyzj.java | 38 +++++++++++++ .../java/com/hxhq/business/form/gyzj/GhForm.java | 66 ---------------------- .../business/service/impl/GyzjFfjlServiceImpl.java | 13 +++-- .../business/service/impl/GyzjServiceImpl.java | 21 +++---- .../main/resources/mapper/business/GyzjMapper.xml | 2 +- 5 files changed, 58 insertions(+), 82 deletions(-) diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/Gyzj.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/Gyzj.java index ee4b3e5..5f4ec6a 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/Gyzj.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/Gyzj.java @@ -217,6 +217,44 @@ public class Gyzj extends MpBaseEntity /** 归还人2名称 */ private String ghr2Mc; + /** 入库位置 */ + @TableField(updateStrategy = FieldStrategy.IGNORED) + private String rkwz; + + /** 入库条件 */ + + @TableField(updateStrategy = FieldStrategy.IGNORED) + private String rktj; + + /** 转移条件 */ + @TableField(updateStrategy = FieldStrategy.IGNORED) + private String ghzytj; + + public String getGhzytj() { + return ghzytj; + } + + public void setGhzytj(String ghzytj) { + this.ghzytj = ghzytj; + } + + public String getRkwz() { + return rkwz; + } + + public void setRkwz(String rkwz) { + this.rkwz = rkwz; + } + + public String getRktj() { + return rktj; + } + + public void setRktj(String rktj) { + this.rktj = rktj; + } + + public String getMdOther() { return mdOther; } diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/form/gyzj/GhForm.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/form/gyzj/GhForm.java index d89c99f..b90b8a6 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/form/gyzj/GhForm.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/form/gyzj/GhForm.java @@ -17,31 +17,12 @@ public class GhForm { /** 归还转移条件 */ private String ghzytj; - - /** 入库毛重 */ - private String rkmz; - - /** 入库毛重单位 */ - private String rkmzdw; - /** 入库量 */ private String rkl; /** 入库单位 */ private String rkldw; - /** 减少量 */ - private String jsl; - - /** 减少量单位 */ - private String jsldw; - - /** 使用量 */ - private String syl; - - /** 使用量单位 */ - private String syldw; - /** 归还人1id */ private Long ghr1Id; @@ -75,21 +56,6 @@ public class GhForm { /** 签名人密码 */ private String qmrmm; - public String getRkmz() { - return rkmz; - } - - public void setRkmz(String rkmz) { - this.rkmz = rkmz; - } - - public String getRkmzdw() { - return rkmzdw; - } - - public void setRkmzdw(String rkmzdw) { - this.rkmzdw = rkmzdw; - } public String getQmrmm() { return qmrmm; @@ -155,38 +121,6 @@ public class GhForm { this.rkldw = rkldw; } - public String getJsl() { - return jsl; - } - - public void setJsl(String jsl) { - this.jsl = jsl; - } - - public String getJsldw() { - return jsldw; - } - - public void setJsldw(String jsldw) { - this.jsldw = jsldw; - } - - public String getSyl() { - return syl; - } - - public void setSyl(String syl) { - this.syl = syl; - } - - public String getSyldw() { - return syldw; - } - - public void setSyldw(String syldw) { - this.syldw = syldw; - } - public Long getGhr1Id() { return ghr1Id; } diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/GyzjFfjlServiceImpl.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/GyzjFfjlServiceImpl.java index d0fc1b3..2d74bb8 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/GyzjFfjlServiceImpl.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/GyzjFfjlServiceImpl.java @@ -1,5 +1,6 @@ package com.hxhq.business.service.impl; +import java.math.BigDecimal; import java.util.*; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; @@ -416,16 +417,18 @@ public class GyzjFfjlServiceImpl extends ServiceImpl i if (gyzjFfjl == null) { throw new ServiceException("发放记录不存在或已删除"); } + BigDecimal syl = new BigDecimal(gyzj.getKc()).subtract(new BigDecimal(form.getRkl())); + gyzjFfjl.setFfzytj(form.getGhzytj()); gyzjFfjl.setRkwz(form.getRkwz()); gyzjFfjl.setRktj(form.getRktj()); gyzjFfjl.setGhzytj(form.getGhzytj()); - gyzjFfjl.setRkmz(form.getRkmz()); + gyzjFfjl.setRkmz(form.getRkl()); gyzjFfjl.setRkmzdw(gyzj.getKcdw()); - gyzjFfjl.setJsl(form.getJsl()); + gyzjFfjl.setJsl(syl.toString()); gyzjFfjl.setJsldw(gyzj.getKcdw()); - gyzjFfjl.setSyl(form.getSyl()); + gyzjFfjl.setSyl(syl.toString()); gyzjFfjl.setSyldw(gyzj.getKcdw()); gyzjFfjl.setGhr1Id(ghr1.getUserId()); gyzjFfjl.setGhr1Mc(ghr1.getNickName()); @@ -443,8 +446,8 @@ public class GyzjFfjlServiceImpl extends ServiceImpl i formData.put("入库位置", form.getRkwz()); formData.put("入库条件", form.getRktj()); formData.put("转移条件", form.getGhzytj()); - formData.put("入库净重", form.getRkmz() + gyzj.getKcdw()); - formData.put("使用量", form.getSyl() + gyzj.getKcdw()); + formData.put("入库净重", form.getRkl() + gyzj.getKcdw()); + formData.put("使用量", syl + gyzj.getKcdw()); formData.put("归还人1", ghr1.getNickName()); formData.put("归还人2", ghr2.getNickName()); formData.put("库管员1", jsr1.getNickName()); diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/GyzjServiceImpl.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/GyzjServiceImpl.java index 39947e1..0fb4f7f 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/GyzjServiceImpl.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/GyzjServiceImpl.java @@ -1192,6 +1192,9 @@ public class GyzjServiceImpl extends ServiceImpl implements IG gyzjJcgjService.saveJcgj(gyzjOld.getId(), JcgjlxEnum.lc.getValue(), "归还", JcmcysEnum.green.getValue(), JctUtil.formatStr(formData), SecurityUtils.getUserId(), SecurityUtils.getNickName()); //endregion + gyzjOld.setGhzytj(form.getGhzytj()); + gyzjOld.setRkwz(form.getRkwz()); + gyzjOld.setRktj(form.getRktj()); gyzjOld.setGhr1Id(SecurityUtils.getUserId()); gyzjOld.setGhr1Mc(SecurityUtils.getNickName()); gyzjOld.setGhr2Id(ghr2.getUserId()); @@ -1230,31 +1233,29 @@ public class GyzjServiceImpl extends ServiceImpl implements IG if (!gyzjOld.getGhzt().equals(GhztEnum.sqgh.getValue())) { throw new ServiceException("给药制剂【" + gyzjOld.getMc() + "】不是申请归还状态,不能归还"); } - BigDecimal kc = new BigDecimal(gyzjOld.getKc()); - BigDecimal syl = new BigDecimal(form.getSyl()); - if (syl.compareTo(kc) > 0) { - throw new ServiceException("使用量不能大于出库量"); - } - BigDecimal leftKc = new BigDecimal(gyzjOld.getKc()).subtract(new BigDecimal(form.getSyl())); + BigDecimal syl = new BigDecimal(gyzjOld.getKc()).subtract(new BigDecimal(form.getRkl())); gyzjFfjlService.gh(form, gyzjOld, ghr1, ghr2, jsr1, jsr2); //region 台账 gyzjTzService.saveTz(gyzjOld.getId(), "", gyzjOld.getGhr1Id() + "," + gyzjOld.getGhr2Id(), "", jsr1.getNickName() + "," + jsr2.getNickName(), null, null, - "确认归还", form.getRkmz(), gyzjOld.getKcdw(), form.getRemark()); + "确认归还", form.getRkl(), gyzjOld.getKcdw(), form.getRemark()); //endregion //region 稽查轨迹 Map formData = new LinkedHashMap<>(); formData.put("入库位置", form.getRkwz()); formData.put("入库条件", form.getRktj()); formData.put("转移条件", form.getGhzytj()); - formData.put("入库净重", form.getRkmz() + gyzjOld.getKcdw()); - formData.put("使用量", form.getSyl() + gyzjOld.getKcdw()); + formData.put("入库净重", form.getRkl() + gyzjOld.getKcdw()); + formData.put("使用量", syl + gyzjOld.getKcdw()); formData.put("库管员1", jsr1.getNickName()); formData.put("库管员2", jsr2.getNickName()); formData.put("备注", form.getRemark()); gyzjJcgjService.saveJcgj(gyzjOld.getId(), JcgjlxEnum.lc.getValue(), "确认归还", JcmcysEnum.green.getValue(), JctUtil.formatStr(formData), SecurityUtils.getUserId(), SecurityUtils.getNickName()); //endregion - gyzjOld.setKc(leftKc.toString()); + gyzjOld.setKc(form.getRkl()); + gyzjOld.setGhzytj(null); + gyzjOld.setRkwz(null); + gyzjOld.setRktj(null); gyzjOld.setZjzt(ZjztEnum.rk.getValue()); gyzjOld.setGhzt(GhztEnum.wsq.getValue()); this.updateById(gyzjOld); diff --git a/hxhq-modules/hxhq-system/src/main/resources/mapper/business/GyzjMapper.xml b/hxhq-modules/hxhq-system/src/main/resources/mapper/business/GyzjMapper.xml index 56a65ba..f9cbd10 100644 --- a/hxhq-modules/hxhq-system/src/main/resources/mapper/business/GyzjMapper.xml +++ b/hxhq-modules/hxhq-system/src/main/resources/mapper/business/GyzjMapper.xml @@ -27,7 +27,7 @@