From ab10efa314c1e665c2f1f57a30c2701cc5b8727d Mon Sep 17 00:00:00 2001 From: HanLong <404402223@qq.com> Date: Tue, 30 Dec 2025 00:14:49 +0800 Subject: [PATCH] =?UTF-8?q?refactor:[=E8=B5=84=E6=BA=90=E5=BA=93=E7=AE=A1?= =?UTF-8?q?=E7=90=86][=E8=AF=95=E5=89=82=E7=AE=A1=E7=90=86]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/hxhq/business/controller/SjController.java | 192 ++++++++++ .../hxhq/business/controller/SjkcController.java | 196 ---------- .../src/main/java/com/hxhq/business/domain/Sj.java | 275 +++++++++++++ .../main/java/com/hxhq/business/domain/SjJcgj.java | 120 ++++++ .../main/java/com/hxhq/business/domain/Sjkc.java | 275 ------------- .../java/com/hxhq/business/domain/SjkcJcgj.java | 120 ------ .../java/com/hxhq/business/mapper/SjMapper.java | 14 + .../com/hxhq/business/mapper/SjkcJcgjMapper.java | 4 +- .../java/com/hxhq/business/mapper/SjkcMapper.java | 14 - .../com/hxhq/business/service/ISjJcgjService.java | 32 ++ .../java/com/hxhq/business/service/ISjService.java | 54 +++ .../hxhq/business/service/ISjkcJcgjService.java | 32 -- .../com/hxhq/business/service/ISjkcService.java | 55 --- .../business/service/impl/SjJcgjServiceImpl.java | 64 ++++ .../hxhq/business/service/impl/SjServiceImpl.java | 423 ++++++++++++++++++++ .../business/service/impl/SjkcJcgjServiceImpl.java | 68 ---- .../business/service/impl/SjkcServiceImpl.java | 426 --------------------- .../business/service/impl/YqJcgjServiceImpl.java | 4 - .../resources/mapper/business/SjJcgjMapper.xml | 6 + .../main/resources/mapper/business/SjMapper.xml | 6 + .../resources/mapper/business/SjkcJcgjMapper.xml | 6 - .../main/resources/mapper/business/SjkcMapper.xml | 6 - 22 files changed, 1188 insertions(+), 1204 deletions(-) create mode 100644 hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/SjController.java delete mode 100644 hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/SjkcController.java create mode 100644 hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/Sj.java create mode 100644 hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/SjJcgj.java delete mode 100644 hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/Sjkc.java delete mode 100644 hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/SjkcJcgj.java create mode 100644 hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/mapper/SjMapper.java delete mode 100644 hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/mapper/SjkcMapper.java create mode 100644 hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/ISjJcgjService.java create mode 100644 hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/ISjService.java delete mode 100644 hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/ISjkcJcgjService.java delete mode 100644 hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/ISjkcService.java create mode 100644 hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/SjJcgjServiceImpl.java create mode 100644 hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/SjServiceImpl.java delete mode 100644 hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/SjkcJcgjServiceImpl.java delete mode 100644 hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/SjkcServiceImpl.java create mode 100644 hxhq-modules/hxhq-system/src/main/resources/mapper/business/SjJcgjMapper.xml create mode 100644 hxhq-modules/hxhq-system/src/main/resources/mapper/business/SjMapper.xml delete mode 100644 hxhq-modules/hxhq-system/src/main/resources/mapper/business/SjkcJcgjMapper.xml delete mode 100644 hxhq-modules/hxhq-system/src/main/resources/mapper/business/SjkcMapper.xml diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/SjController.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/SjController.java new file mode 100644 index 0000000..0d3fad9 --- /dev/null +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/SjController.java @@ -0,0 +1,192 @@ +package com.hxhq.business.controller; + +import java.util.List; + +import com.hxhq.business.domain.*; +import com.hxhq.business.form.mjy.GdForm; +import com.hxhq.business.form.sj.*; +import com.hxhq.business.service.ISjService; +import com.hxhq.business.service.ISjTzService; +import com.hxhq.business.service.ISjJcgjService; +import com.hxhq.common.security.utils.SecurityUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; +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-22 + */ +@RestController +@RequestMapping("/business/sj") +public class SjController extends BaseController +{ + @Autowired + private ISjService sjkcService; + + @Autowired + private ISjJcgjService sjkcJcgjService; + + @Autowired + private ISjTzService sjTzService; + + /** + * 稽查轨迹列表 + */ + @GetMapping("/jcgjList") + public TableDataInfo jcgjList(SjJcgj form) + { + startPage(); + List list = sjkcJcgjService.queryList(form); + return getDataTable(list); + } + + /** + * 台账列表 + */ + @GetMapping("/tzList") + public TableDataInfo tzList(SjTz form) + { + startPage(); + List list = sjTzService.queryList(form); + return getDataTable(list); + } + + /** + * 查询试剂库存列表 + */ + @GetMapping("/list") + public TableDataInfo list(Sj sj) + { + startPage(); + List list = sjkcService.queryList(sj); + return getDataTable(list); + } + + /** + * 获取试剂库存详细信息 + */ + @GetMapping(value = "/info") + public AjaxResult getInfo(Long id) + { + return AjaxResult.success(sjkcService.getById(id)); + } + + /** + * 新增试剂库存信息 + */ + @PostMapping("/save") + public AjaxResult save(@RequestBody Sj sj) + { + return toAjax(sjkcService.saveOrUpdate(sj)); + } + + /** + * 修改库存 + */ + @PostMapping("xgkc") + public AjaxResult xgkc(@RequestBody @Validated SjXgkcForm form) + { + form.setQmrId(SecurityUtils.getUserId()); + sjkcService.xgkc(form); + return AjaxResult.success("操作成功"); + } + + /** 处置 */ + @PostMapping("/cz") + public AjaxResult cz(@RequestBody @Validated CzSjForm form) + { + form.setQmrId(SecurityUtils.getUserId()); + sjkcService.cz(form); + return AjaxResult.success("操作成功"); + } + + /** 批量处置 */ + @PostMapping("/plcz") + public AjaxResult plcz(@RequestBody @Validated PlczSjForm form) + { + form.setQmrId(SecurityUtils.getUserId()); + sjkcService.plcz(form); + return AjaxResult.success("操作成功"); + } + + /** 锁定 */ + @PostMapping("/sd") + public AjaxResult sd(@RequestBody @Validated SdSjForm form) + { + form.setQmrId(SecurityUtils.getUserId()); + sjkcService.sd(form); + return AjaxResult.success("操作成功"); + } + + /** 批量锁定 */ + @PostMapping("/plsd") + public AjaxResult plsd(@RequestBody @Validated SdSjForm form) + { + if(form.getIds() == null || form.getIds().length == 0) { + return error("请选择锁定对象"); + } + form.setQmrId(SecurityUtils.getUserId()); + sjkcService.plsd(form); + return AjaxResult.success("操作成功"); + } + + /** 解锁 */ + @PostMapping("/js") + public AjaxResult js(@RequestBody @Validated JsSjForm form) + { + form.setQmrId(SecurityUtils.getUserId()); + sjkcService.js(form); + return AjaxResult.success("操作成功"); + } + + /** + * 借阅 + */ + @PostMapping("/jy") + public AjaxResult jy(@RequestBody @Validated JySjForm form) + { + form.setQmrId(SecurityUtils.getUserId()); + sjkcService.jy(form); + return AjaxResult.success("操作成功"); + } + + /** + * 解档 + */ + @PostMapping("/jd") + public AjaxResult jd(@RequestBody @Validated JdSjForm form) + { + form.setQmrId(SecurityUtils.getUserId()); + sjkcService.jd(form); + return AjaxResult.success("操作成功"); + } + + /** + * 批量归档 + */ + @PostMapping("/plgd") + public AjaxResult plgd(@RequestBody GdForm form) + { + form.setQmrId(SecurityUtils.getUserId()); + sjkcService.plgd(form); + return AjaxResult.success("操作成功"); + } + + /** + * 归档 + */ + @PostMapping("/gd") + public AjaxResult gd(@RequestBody @Validated GdSjForm form) + { + form.setQmrId(SecurityUtils.getUserId()); + sjkcService.gd(form); + return AjaxResult.success("操作成功"); + } +} diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/SjkcController.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/SjkcController.java deleted file mode 100644 index cebba5b..0000000 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/SjkcController.java +++ /dev/null @@ -1,196 +0,0 @@ -package com.hxhq.business.controller; - -import java.util.List; - -import com.hxhq.business.domain.*; -import com.hxhq.business.form.mjy.GdForm; -import com.hxhq.business.form.mjy.JdForm; -import com.hxhq.business.form.mjy.JyForm; -import com.hxhq.business.form.mjy.SdForm; -import com.hxhq.business.form.sj.*; -import com.hxhq.business.service.ISjTzService; -import com.hxhq.business.service.ISjkcJcgjService; -import com.hxhq.common.security.annotation.RequiresPermissions; -import com.hxhq.common.security.utils.SecurityUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; -import com.hxhq.business.service.ISjkcService; -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-22 - */ -@RestController -@RequestMapping("/business/sjkc") -public class SjkcController extends BaseController -{ - @Autowired - private ISjkcService sjkcService; - - @Autowired - private ISjkcJcgjService sjkcJcgjService; - - @Autowired - private ISjTzService sjTzService; - - /** - * 稽查轨迹列表 - */ - @GetMapping("/jcgjList") - public TableDataInfo jcgjList(SjkcJcgj form) - { - startPage(); - List list = sjkcJcgjService.queryList(form); - return getDataTable(list); - } - - /** - * 台账列表 - */ - @GetMapping("/tzList") - public TableDataInfo tzList(SjTz form) - { - startPage(); - List list = sjTzService.queryList(form); - return getDataTable(list); - } - - /** - * 查询试剂库存列表 - */ - @GetMapping("/list") - public TableDataInfo list(Sjkc sjkc) - { - startPage(); - List list = sjkcService.queryList(sjkc); - return getDataTable(list); - } - - /** - * 获取试剂库存详细信息 - */ - @GetMapping(value = "/info") - public AjaxResult getInfo(Long id) - { - return AjaxResult.success(sjkcService.getById(id)); - } - - /** - * 新增试剂库存信息 - */ - @PostMapping("/save") - public AjaxResult save(@RequestBody Sjkc sjkc) - { - return toAjax(sjkcService.saveOrUpdate(sjkc)); - } - - /** - * 修改库存 - */ - @PostMapping("xgkc") - public AjaxResult xgkc(@RequestBody @Validated SjXgkcForm form) - { - form.setQmrId(SecurityUtils.getUserId()); - sjkcService.xgkc(form); - return AjaxResult.success("操作成功"); - } - - /** 处置 */ - @PostMapping("/cz") - public AjaxResult cz(@RequestBody @Validated CzSjForm form) - { - form.setQmrId(SecurityUtils.getUserId()); - sjkcService.cz(form); - return AjaxResult.success("操作成功"); - } - - /** 批量处置 */ - @PostMapping("/plcz") - public AjaxResult plcz(@RequestBody @Validated PlczSjForm form) - { - form.setQmrId(SecurityUtils.getUserId()); - sjkcService.plcz(form); - return AjaxResult.success("操作成功"); - } - - /** 锁定 */ - @PostMapping("/sd") - public AjaxResult sd(@RequestBody @Validated SdSjForm form) - { - form.setQmrId(SecurityUtils.getUserId()); - sjkcService.sd(form); - return AjaxResult.success("操作成功"); - } - - /** 批量锁定 */ - @PostMapping("/plsd") - public AjaxResult plsd(@RequestBody @Validated SdSjForm form) - { - if(form.getIds() == null || form.getIds().length == 0) { - return error("请选择锁定对象"); - } - form.setQmrId(SecurityUtils.getUserId()); - sjkcService.plsd(form); - return AjaxResult.success("操作成功"); - } - - /** 解锁 */ - @PostMapping("/js") - public AjaxResult js(@RequestBody @Validated JsSjForm form) - { - form.setQmrId(SecurityUtils.getUserId()); - sjkcService.js(form); - return AjaxResult.success("操作成功"); - } - - /** - * 借阅 - */ - @PostMapping("/jy") - public AjaxResult jy(@RequestBody @Validated JySjForm form) - { - form.setQmrId(SecurityUtils.getUserId()); - sjkcService.jy(form); - return AjaxResult.success("操作成功"); - } - - /** - * 解档 - */ - @PostMapping("/jd") - public AjaxResult jd(@RequestBody @Validated JdSjForm form) - { - form.setQmrId(SecurityUtils.getUserId()); - sjkcService.jd(form); - return AjaxResult.success("操作成功"); - } - - /** - * 批量归档 - */ - @PostMapping("/plgd") - public AjaxResult plgd(@RequestBody GdForm form) - { - form.setQmrId(SecurityUtils.getUserId()); - sjkcService.plgd(form); - return AjaxResult.success("操作成功"); - } - - /** - * 归档 - */ - @PostMapping("/gd") - public AjaxResult gd(@RequestBody @Validated GdSjForm form) - { - form.setQmrId(SecurityUtils.getUserId()); - sjkcService.gd(form); - return AjaxResult.success("操作成功"); - } -} diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/Sj.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/Sj.java new file mode 100644 index 0000000..a99422b --- /dev/null +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/Sj.java @@ -0,0 +1,275 @@ +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.annotation.Compare; +import com.hxhq.common.core.domain.MpBaseEntity; + + +/** + * 试剂库存对象 t_sjkc + * + * @author HanLong + * @date 2025-12-22 + */ +@TableName("t_sj") +public class Sj extends MpBaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 制剂状态 1:入库 5:已锁定 7:待归档 9:归档 11:待解档 */ + private Integer zjzt; + + /** 借阅状态 1:未借阅 3:待借阅 5:借阅中 */ + private Integer jyzt; + + /** 所属部门 */ + private String ssbm; + + /** 名称 */ + private String mc; + + /** 编号 */ + private String bh; + + /** 批号 */ + private String ph; + + /** 规格 */ + private String gg; + + /** 浓度/含量/纯度 */ + private String nd; + + /** 浓度单位 */ + private String nddw; + + /** 库存数量 */ + @Compare(name = "库存数量") + private String kc; + + /** 库存单位 */ + @Compare(name = "库存单位") + private String kcdw; + + /** 来源 */ + private String ly; + + /** 存储条件 */ + private String cctj; + + /** 存储位置 */ + private String ccwz; + + /** 有效周期 */ + private String yxzq; + + /** 有效周期单位 */ + private String yxzqdw; + + /** 失效日 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date sxr; + + /** 配置日期 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date pzrq; + + /** 借阅开始日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + private Date jyksrq; + + /** 借阅结束日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + private Date jyjsrq; + + public void setZjzt(Integer zjzt) + { + this.zjzt = zjzt; + } + + public Integer getZjzt() + { + return zjzt; + } + + public void setJyzt(Integer jyzt) + { + this.jyzt = jyzt; + } + + public Integer getJyzt() + { + return jyzt; + } + + 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 setPh(String ph) + { + this.ph = ph; + } + + public String getPh() + { + return ph; + } + + public void setGg(String gg) + { + this.gg = gg; + } + + public String getGg() + { + return gg; + } + + public void setNd(String nd) + { + this.nd = nd; + } + + public String getNd() + { + return nd; + } + + public void setKc(String kc) + { + this.kc = kc; + } + + public String getKc() + { + return kc; + } + + public void setKcdw(String kcdw) + { + this.kcdw = kcdw; + } + + public String getKcdw() + { + return kcdw; + } + + public void setLy(String ly) + { + this.ly = ly; + } + + public String getLy() + { + return ly; + } + + public void setCctj(String cctj) + { + this.cctj = cctj; + } + + public String getCctj() + { + return cctj; + } + + public void setCcwz(String ccwz) + { + this.ccwz = ccwz; + } + + public String getCcwz() + { + return ccwz; + } + + + public void setSxr(Date sxr) + { + this.sxr = sxr; + } + + public Date getSxr() + { + return sxr; + } + + public void setPzrq(Date pzrq) + { + this.pzrq = pzrq; + } + + public Date getPzrq() + { + return pzrq; + } + + public String getNddw() { + return nddw; + } + + public void setNddw(String nddw) { + this.nddw = nddw; + } + + public void setYxzq(String yxzq) { + this.yxzq = yxzq; + } + + public String getYxzqdw() { + return yxzqdw; + } + + public void setYxzqdw(String yxzqdw) { + this.yxzqdw = yxzqdw; + } + + public String getSsbm() { + return ssbm; + } + + public void setSsbm(String ssbm) { + this.ssbm = ssbm; + } + + public String getYxzq() { + return yxzq; + } + + public Date getJyksrq() { + return jyksrq; + } + + public void setJyksrq(Date jyksrq) { + this.jyksrq = jyksrq; + } + + public Date getJyjsrq() { + return jyjsrq; + } + + public void setJyjsrq(Date jyjsrq) { + this.jyjsrq = jyjsrq; + } +} diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/SjJcgj.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/SjJcgj.java new file mode 100644 index 0000000..d227e61 --- /dev/null +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/SjJcgj.java @@ -0,0 +1,120 @@ +package com.hxhq.business.domain; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.hxhq.common.core.domain.MpBaseEntity; + + +/** + * 试剂库存-稽查轨迹对象 t_sjkc_jcgj + * + * @author HanLong + * @date 2025-12-22 + */ +@TableName("t_sj_jcgj") +public class SjJcgj extends MpBaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 试剂id */ + private Long sjId; + + /** 稽查轨迹类型 */ + private Integer jcgjlx; + + /** 稽查名称 */ + private String jcmc; + + /** 稽查名称颜色:1:蓝色;3:红色;5:绿色;7:橙色 */ + private Integer jcmcys; + + /** 稽查内容 */ + private String jcnr; + + /** 签名意义 */ + private String qmyy; + + /** 签名人id */ + private Long qmrId; + + /** 签名人名称 */ + private String qmrMc; + + + public void setSjId(Long sjId) + { + this.sjId = sjId; + } + + public Long getSjId() + { + return sjId; + } + + public void setJcgjlx(Integer jcgjlx) + { + this.jcgjlx = jcgjlx; + } + + public Integer getJcgjlx() + { + return jcgjlx; + } + + public void setJcmc(String jcmc) + { + this.jcmc = jcmc; + } + + public String getJcmc() + { + return jcmc; + } + + public void setJcmcys(Integer jcmcys) + { + this.jcmcys = jcmcys; + } + + public Integer getJcmcys() + { + return jcmcys; + } + + public void setJcnr(String jcnr) + { + this.jcnr = jcnr; + } + + public String getJcnr() + { + return jcnr; + } + + public void setQmyy(String qmyy) + { + this.qmyy = qmyy; + } + + public String getQmyy() + { + return qmyy; + } + + public void setQmrId(Long qmrId) + { + this.qmrId = qmrId; + } + + public Long getQmrId() + { + return qmrId; + } + + public void setQmrMc(String qmrMc) { + this.qmrMc = qmrMc; + } + + public String getQmrMc() { + return qmrMc; + } +} diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/Sjkc.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/Sjkc.java deleted file mode 100644 index 1195a04..0000000 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/Sjkc.java +++ /dev/null @@ -1,275 +0,0 @@ -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.annotation.Compare; -import com.hxhq.common.core.domain.MpBaseEntity; - - -/** - * 试剂库存对象 t_sjkc - * - * @author HanLong - * @date 2025-12-22 - */ -@TableName("t_sjkc") -public class Sjkc extends MpBaseEntity -{ - private static final long serialVersionUID = 1L; - - /** 制剂状态 1:入库 5:已锁定 7:待归档 9:归档 11:待解档 */ - private Integer zjzt; - - /** 借阅状态 1:未借阅 3:待借阅 5:借阅中 */ - private Integer jyzt; - - /** 所属部门 */ - private String ssbm; - - /** 名称 */ - private String mc; - - /** 编号 */ - private String bh; - - /** 批号 */ - private String ph; - - /** 规格 */ - private String gg; - - /** 浓度/含量/纯度 */ - private String nd; - - /** 浓度单位 */ - private String nddw; - - /** 库存数量 */ - @Compare(name = "库存数量") - private String kc; - - /** 库存单位 */ - @Compare(name = "库存单位") - private String kcdw; - - /** 来源 */ - private String ly; - - /** 存储条件 */ - private String cctj; - - /** 存储位置 */ - private String ccwz; - - /** 有效周期 */ - private String yxzq; - - /** 有效周期单位 */ - private String yxzqdw; - - /** 失效日 */ - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private Date sxr; - - /** 配置日期 */ - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private Date pzrq; - - /** 借阅开始日期 */ - @JsonFormat(pattern = "yyyy-MM-dd") - private Date jyksrq; - - /** 借阅结束日期 */ - @JsonFormat(pattern = "yyyy-MM-dd") - private Date jyjsrq; - - public void setZjzt(Integer zjzt) - { - this.zjzt = zjzt; - } - - public Integer getZjzt() - { - return zjzt; - } - - public void setJyzt(Integer jyzt) - { - this.jyzt = jyzt; - } - - public Integer getJyzt() - { - return jyzt; - } - - 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 setPh(String ph) - { - this.ph = ph; - } - - public String getPh() - { - return ph; - } - - public void setGg(String gg) - { - this.gg = gg; - } - - public String getGg() - { - return gg; - } - - public void setNd(String nd) - { - this.nd = nd; - } - - public String getNd() - { - return nd; - } - - public void setKc(String kc) - { - this.kc = kc; - } - - public String getKc() - { - return kc; - } - - public void setKcdw(String kcdw) - { - this.kcdw = kcdw; - } - - public String getKcdw() - { - return kcdw; - } - - public void setLy(String ly) - { - this.ly = ly; - } - - public String getLy() - { - return ly; - } - - public void setCctj(String cctj) - { - this.cctj = cctj; - } - - public String getCctj() - { - return cctj; - } - - public void setCcwz(String ccwz) - { - this.ccwz = ccwz; - } - - public String getCcwz() - { - return ccwz; - } - - - public void setSxr(Date sxr) - { - this.sxr = sxr; - } - - public Date getSxr() - { - return sxr; - } - - public void setPzrq(Date pzrq) - { - this.pzrq = pzrq; - } - - public Date getPzrq() - { - return pzrq; - } - - public String getNddw() { - return nddw; - } - - public void setNddw(String nddw) { - this.nddw = nddw; - } - - public void setYxzq(String yxzq) { - this.yxzq = yxzq; - } - - public String getYxzqdw() { - return yxzqdw; - } - - public void setYxzqdw(String yxzqdw) { - this.yxzqdw = yxzqdw; - } - - public String getSsbm() { - return ssbm; - } - - public void setSsbm(String ssbm) { - this.ssbm = ssbm; - } - - public String getYxzq() { - return yxzq; - } - - public Date getJyksrq() { - return jyksrq; - } - - public void setJyksrq(Date jyksrq) { - this.jyksrq = jyksrq; - } - - public Date getJyjsrq() { - return jyjsrq; - } - - public void setJyjsrq(Date jyjsrq) { - this.jyjsrq = jyjsrq; - } -} diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/SjkcJcgj.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/SjkcJcgj.java deleted file mode 100644 index ab49a15..0000000 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/SjkcJcgj.java +++ /dev/null @@ -1,120 +0,0 @@ -package com.hxhq.business.domain; - -import com.baomidou.mybatisplus.annotation.TableName; -import com.hxhq.common.core.domain.MpBaseEntity; - - -/** - * 试剂库存-稽查轨迹对象 t_sjkc_jcgj - * - * @author HanLong - * @date 2025-12-22 - */ -@TableName("t_sjkc_jcgj") -public class SjkcJcgj extends MpBaseEntity -{ - private static final long serialVersionUID = 1L; - - /** 试剂库存id */ - private Long sjkcId; - - /** 稽查轨迹类型 */ - private Integer jcgjlx; - - /** 稽查名称 */ - private String jcmc; - - /** 稽查名称颜色:1:蓝色;3:红色;5:绿色;7:橙色 */ - private Integer jcmcys; - - /** 稽查内容 */ - private String jcnr; - - /** 签名意义 */ - private String qmyy; - - /** 签名人id */ - private Long qmrId; - - /** 签名人名称 */ - private String qmrMc; - - - public void setSjkcId(Long sjkcId) - { - this.sjkcId = sjkcId; - } - - public Long getSjkcId() - { - return sjkcId; - } - - public void setJcgjlx(Integer jcgjlx) - { - this.jcgjlx = jcgjlx; - } - - public Integer getJcgjlx() - { - return jcgjlx; - } - - public void setJcmc(String jcmc) - { - this.jcmc = jcmc; - } - - public String getJcmc() - { - return jcmc; - } - - public void setJcmcys(Integer jcmcys) - { - this.jcmcys = jcmcys; - } - - public Integer getJcmcys() - { - return jcmcys; - } - - public void setJcnr(String jcnr) - { - this.jcnr = jcnr; - } - - public String getJcnr() - { - return jcnr; - } - - public void setQmyy(String qmyy) - { - this.qmyy = qmyy; - } - - public String getQmyy() - { - return qmyy; - } - - public void setQmrId(Long qmrId) - { - this.qmrId = qmrId; - } - - public Long getQmrId() - { - return qmrId; - } - - public void setQmrMc(String qmrMc) { - this.qmrMc = qmrMc; - } - - public String getQmrMc() { - return qmrMc; - } -} diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/mapper/SjMapper.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/mapper/SjMapper.java new file mode 100644 index 0000000..eee2de6 --- /dev/null +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/mapper/SjMapper.java @@ -0,0 +1,14 @@ +package com.hxhq.business.mapper; + +import com.hxhq.business.domain.Sj; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +/** + * 试剂Mapper接口 + * + * @author HanLong + * @date 2025-12-22 + */ +public interface SjMapper extends BaseMapper +{ + +} diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/mapper/SjkcJcgjMapper.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/mapper/SjkcJcgjMapper.java index 36d5305..374e881 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/mapper/SjkcJcgjMapper.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/mapper/SjkcJcgjMapper.java @@ -1,6 +1,6 @@ package com.hxhq.business.mapper; -import com.hxhq.business.domain.SjkcJcgj; +import com.hxhq.business.domain.SjJcgj; import com.baomidou.mybatisplus.core.mapper.BaseMapper; /** * 试剂库存-稽查轨迹Mapper接口 @@ -8,7 +8,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; * @author HanLong * @date 2025-12-22 */ -public interface SjkcJcgjMapper extends BaseMapper +public interface SjkcJcgjMapper extends BaseMapper { } diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/mapper/SjkcMapper.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/mapper/SjkcMapper.java deleted file mode 100644 index c9c078f..0000000 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/mapper/SjkcMapper.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.hxhq.business.mapper; - -import com.hxhq.business.domain.Sjkc; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -/** - * 试剂库存Mapper接口 - * - * @author HanLong - * @date 2025-12-22 - */ -public interface SjkcMapper extends BaseMapper -{ - -} diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/ISjJcgjService.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/ISjJcgjService.java new file mode 100644 index 0000000..6e9a1b5 --- /dev/null +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/ISjJcgjService.java @@ -0,0 +1,32 @@ +package com.hxhq.business.service; + +import java.util.List; +import com.hxhq.business.domain.SjJcgj; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * 试剂库存-稽查轨迹Service接口 + * + * @author HanLong + * @date 2025-12-22 + */ +public interface ISjJcgjService extends IService +{ + /** + * 查询试剂库存-稽查轨迹列表 + * + * @param sjJcgj 试剂库存-稽查轨迹 + * @return 试剂库存-稽查轨迹集合 + */ + public List queryList(SjJcgj sjJcgj); + + /** + * 新增稽查轨迹 + * @param sjId 试剂id + * @param jcgjlx 稽查轨迹类型:1:流程;3:编辑 + * @param jcmc 稽查名称 + * @param jcmcys 稽查名称颜色:1:蓝色;3:红色;5:绿色;7:橙色 + * @param jcnr 稽查内容 + */ + public void saveJcgj(Long sjId, Integer jcgjlx, String jcmc, Integer jcmcys, String jcnr); +} diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/ISjService.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/ISjService.java new file mode 100644 index 0000000..c995e47 --- /dev/null +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/ISjService.java @@ -0,0 +1,54 @@ +package com.hxhq.business.service; + +import java.util.List; +import com.hxhq.business.domain.Sj; +import com.baomidou.mybatisplus.extension.service.IService; +import com.hxhq.business.form.mjy.GdForm; +import com.hxhq.business.form.sj.*; + +/** + * 试剂Service接口 + * + * @author HanLong + * @date 2025-12-22 + */ +public interface ISjService extends IService +{ + /** + * 查询试剂库存列表 + * + * @param sj 试剂库存 + * @return 试剂库存集合 + */ + public List queryList(Sj sj); + + /** 修改库存 */ + void xgkc(SjXgkcForm form); + + /** 处置 */ + void cz(CzSjForm form); + + /** 批量处置 */ + void plcz(PlczSjForm form); + + /** 锁定 */ + void sd(SdSjForm form); + + /** 批量锁定 */ + void plsd(SdSjForm form); + + /** 解锁 */ + void js(JsSjForm form); + + /** 借阅 */ + void jy(JySjForm form); + + /** 解档 */ + void jd(JdSjForm form); + + /** 归档 */ + void gd(GdSjForm form); + + /** 批量归档 */ + void plgd(GdForm form); +} diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/ISjkcJcgjService.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/ISjkcJcgjService.java deleted file mode 100644 index 27c2036..0000000 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/ISjkcJcgjService.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.hxhq.business.service; - -import java.util.List; -import com.hxhq.business.domain.SjkcJcgj; -import com.baomidou.mybatisplus.extension.service.IService; - -/** - * 试剂库存-稽查轨迹Service接口 - * - * @author HanLong - * @date 2025-12-22 - */ -public interface ISjkcJcgjService extends IService -{ - /** - * 查询试剂库存-稽查轨迹列表 - * - * @param sjkcJcgj 试剂库存-稽查轨迹 - * @return 试剂库存-稽查轨迹集合 - */ - public List queryList(SjkcJcgj sjkcJcgj); - - /** - * 新增稽查轨迹 - * @param sjId 试剂id - * @param jcgjlx 稽查轨迹类型:1:流程;3:编辑 - * @param jcmc 稽查名称 - * @param jcmcys 稽查名称颜色:1:蓝色;3:红色;5:绿色;7:橙色 - * @param jcnr 稽查内容 - */ - public void saveJcgj(Long sjId, Integer jcgjlx, String jcmc, Integer jcmcys, String jcnr); -} diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/ISjkcService.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/ISjkcService.java deleted file mode 100644 index bd51f6b..0000000 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/ISjkcService.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.hxhq.business.service; - -import java.util.List; -import com.hxhq.business.domain.Sjkc; -import com.baomidou.mybatisplus.extension.service.IService; -import com.hxhq.business.form.mjy.GdForm; -import com.hxhq.business.form.mjy.JyForm; -import com.hxhq.business.form.sj.*; - -/** - * 试剂库存Service接口 - * - * @author HanLong - * @date 2025-12-22 - */ -public interface ISjkcService extends IService -{ - /** - * 查询试剂库存列表 - * - * @param sjkc 试剂库存 - * @return 试剂库存集合 - */ - public List queryList(Sjkc sjkc); - - /** 修改库存 */ - void xgkc(SjXgkcForm form); - - /** 处置 */ - void cz(CzSjForm form); - - /** 批量处置 */ - void plcz(PlczSjForm form); - - /** 锁定 */ - void sd(SdSjForm form); - - /** 批量锁定 */ - void plsd(SdSjForm form); - - /** 解锁 */ - void js(JsSjForm form); - - /** 借阅 */ - void jy(JySjForm form); - - /** 解档 */ - void jd(JdSjForm form); - - /** 归档 */ - void gd(GdSjForm form); - - /** 批量归档 */ - void plgd(GdForm form); -} diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/SjJcgjServiceImpl.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/SjJcgjServiceImpl.java new file mode 100644 index 0000000..9862273 --- /dev/null +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/SjJcgjServiceImpl.java @@ -0,0 +1,64 @@ +package com.hxhq.business.service.impl; + +import java.util.List; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.hxhq.common.core.domain.MpBaseEntity; +import com.hxhq.common.core.utils.StringUtils; +import com.hxhq.common.security.utils.SecurityUtils; +import com.hxhq.system.api.domain.SysUser; +import org.springframework.scheduling.annotation.Async; +import org.springframework.stereotype.Service; +import com.hxhq.business.mapper.SjkcJcgjMapper; +import com.hxhq.business.domain.SjJcgj; +import com.hxhq.business.service.ISjJcgjService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; + +/** + * 试剂库存-稽查轨迹Service业务层处理 + * + * @author HanLong + * @date 2025-12-22 + */ +@Service +public class SjJcgjServiceImpl extends ServiceImpl implements ISjJcgjService { + /** + * 查询试剂库存-稽查轨迹列表 + * + * @param sjJcgj 试剂库存-稽查轨迹 + * @return 试剂库存-稽查轨迹 + */ + @Override + public List queryList(SjJcgj sjJcgj) { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + if (sjJcgj.getSjId() == null || sjJcgj.getSjId().longValue() < 0) { + throw new SecurityException("试剂id不能为空"); + } + queryWrapper.eq(SjJcgj::getSjId, sjJcgj.getSjId()); + if (sjJcgj.getJcgjlx() != null && sjJcgj.getJcgjlx().intValue() > 0) { + queryWrapper.eq(SjJcgj::getJcgjlx, sjJcgj.getJcgjlx()); + } + if (StringUtils.isNoneBlank(sjJcgj.getJcmc())) { + queryWrapper.and(p -> p.like(SjJcgj::getJcmc, sjJcgj.getJcmc()) + .or().like(SjJcgj::getJcgjlx, sjJcgj.getJcmc())); + } + queryWrapper.orderByDesc(MpBaseEntity::getId); + return this.list(queryWrapper); + } + + @Override + @Async + public void saveJcgj(Long sjId, Integer jcgjlx, String jcmc, Integer jcmcys, String jcnr) { + SysUser sysUser = SecurityUtils.getLoginUser().getSysUser(); + SjJcgj sjJcgj = new SjJcgj(); + sjJcgj.setSjId(sjId); + sjJcgj.setJcgjlx(jcgjlx); + sjJcgj.setJcmc(jcmc); + sjJcgj.setJcmcys(jcmcys); + sjJcgj.setJcnr(jcnr); + sjJcgj.setQmrId(sysUser.getUserId()); + sjJcgj.setQmrMc(sysUser.getNickName()); + this.save(sjJcgj); + } + +} diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/SjServiceImpl.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/SjServiceImpl.java new file mode 100644 index 0000000..461055d --- /dev/null +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/SjServiceImpl.java @@ -0,0 +1,423 @@ +package com.hxhq.business.service.impl; + +import java.math.BigDecimal; +import java.util.*; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.hxhq.business.domain.Sj; +import com.hxhq.business.domain.SjTz; +import com.hxhq.business.domain.SjJcgj; +import com.hxhq.business.enums.zykgl.JcgjlxEnum; +import com.hxhq.business.enums.zykgl.JcmcysEnum; +import com.hxhq.business.enums.zykgl.JyztEnum; +import com.hxhq.business.enums.zykgl.ZjztEnum; +import com.hxhq.business.form.mjy.GdForm; +import com.hxhq.business.form.sj.*; +import com.hxhq.business.service.ISjTzService; +import com.hxhq.business.service.ISjJcgjService; +import com.hxhq.business.utils.JctUtil; +import com.hxhq.business.utils.ObjectCompareUtil; +import com.hxhq.common.core.exception.ServiceException; +import com.hxhq.common.core.utils.DateUtils; +import com.hxhq.system.api.domain.SysUser; +import com.hxhq.system.service.ISysUserService; +import org.apache.commons.lang3.math.NumberUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.hxhq.business.mapper.SjMapper; +import com.hxhq.business.service.ISjService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.transaction.annotation.Transactional; + +/** + * 试剂库存Service业务层处理 + * + * @author HanLong + * @date 2025-12-22 + */ +@Service +public class SjServiceImpl extends ServiceImpl implements ISjService +{ + @Autowired + private ISysUserService sysUserService; + + @Autowired + private ISjJcgjService sjkcJcgjService; + + @Autowired + private ISjTzService sjTzService; + + /** + * 查询试剂库存列表 + * + * @param sj 试剂库存 + * @return 试剂库存 + */ + @Override + public List queryList(Sj sj) + { + QueryWrapper queryWrapper = Wrappers.query(); + return this.list(queryWrapper); + } + + @Override + public void xgkc(SjXgkcForm form) { + SysUser qmr = sysUserService.selectUserById(form.getQmrId()); + //验证签名人密码 todo + if (form.getId() == null || form.getId().longValue() < 0) { + throw new SecurityException("参数id不正确"); + } + Sj sjOld = this.getById(form.getId()); + if (sjOld == null) { + throw new SecurityException("试剂不存在或已删除"); + } + if (!sjOld.getZjzt().equals(ZjztEnum.rk.getValue())) { + throw new SecurityException("试剂【" + sjOld.getMc() + "】不是入库状态,不能修改库存"); + } + List fieldChanges = ObjectCompareUtil.compareObjects(sjOld, form); + if (fieldChanges.size() == 0) { + throw new SecurityException("你没有修改任何内容"); + } + sjOld.setKcdw(form.getKcdw()); + sjOld.setKc(form.getKc()); + this.updateById(sjOld); + + List sjJcgjList = new ArrayList<>(); + //region 稽查轨迹 + for (ObjectCompareUtil.FieldChange fieldChange : fieldChanges) { + SjJcgj mjyJcgj = new SjJcgj(); + mjyJcgj.setSjId(sjOld.getId()); + mjyJcgj.setJcgjlx(JcgjlxEnum.lc.getValue()); + mjyJcgj.setJcmc("修改库存"); + mjyJcgj.setJcmcys(JcmcysEnum.green.getValue()); + mjyJcgj.setJcnr(fieldChange.toString()); + mjyJcgj.setQmyy("修改库存"); + mjyJcgj.setQmrId(qmr.getUserId()); + mjyJcgj.setQmrMc(qmr.getNickName()); + sjJcgjList.add(mjyJcgj); + } + sjkcJcgjService.saveBatch(sjJcgjList); + //endregion + + // 台账 + sjTzService.saveTz(sjOld.getId(), qmr.getUserId(), qmr.getNickName(), "修改库存", form.getKc(), form.getKcdw(), null); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void cz(CzSjForm form) { + SysUser qmr = sysUserService.selectUserById(form.getQmrId()); + //验证签名人密码 todo + if (form.getId() == null || form.getId() < 0) { + throw new SecurityException("参数id不正确"); + } + Sj sjOld = this.getById(form.getId()); + if (sjOld == null) { + throw new SecurityException("试剂不存在或已删除"); + } + if (!sjOld.getZjzt().equals(ZjztEnum.rk.getValue())) { + throw new SecurityException("试剂【" + sjOld.getMc() + "】不是入库状态,不能处置"); + } + if(!NumberUtils.isParsable(form.getCzl())) { + throw new ServiceException("请输入正确的处置量"); + } + BigDecimal czl = new BigDecimal(form.getCzl()); + BigDecimal kc = new BigDecimal(sjOld.getKc()); + if(czl.compareTo(kc) > 0) { + throw new ServiceException("处置量不应大于库存量"); + } + kc = kc.subtract(czl); + sjOld.setKc(kc.toString()); + updateById(sjOld); + + LinkedHashMap jcnrMap = new LinkedHashMap<>(); + jcnrMap.put("处置方式", form.getCzfs()); + jcnrMap.put("处置量", form.getCzl()); + jcnrMap.put("原因", form.getRemark()); + SjJcgj sjJcgj = new SjJcgj(); + sjJcgj.setSjId(sjOld.getId()); + sjJcgj.setJcgjlx(JcgjlxEnum.bj.getValue()); + sjJcgj.setJcmc("处置"); + sjJcgj.setJcnr(JctUtil.formatStr(jcnrMap)); + sjJcgj.setJcmcys(JcmcysEnum.green.getValue()); + sjJcgj.setQmyy("处置"); + sjJcgj.setQmrId(qmr.getUserId()); + sjJcgj.setQmrMc(qmr.getNickName()); + sjkcJcgjService.save(sjJcgj); + + // 台账 + sjTzService.saveTz(sjOld.getId(), qmr.getUserId(), qmr.getNickName(), "处置", form.getCzl(), sjOld.getKcdw(), form.getRemark()); + + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void plcz(PlczSjForm form) { + SysUser qmr = sysUserService.selectUserById(form.getQmrId()); + //验证签名人密码 todo + + List sjList = new ArrayList<>(); + Map map = new HashMap<>(); + for (PlczSjItemForm itemForm : form.getList()) { + if (itemForm.getId() == null || itemForm.getId() < 0) { + throw new SecurityException("参数id不正确"); + } + Sj sj = this.getById(itemForm.getId()); + if (sj == null) { + throw new SecurityException("试剂不存在或已删除"); + } + if (!sj.getZjzt().equals(ZjztEnum.rk.getValue())) { + throw new SecurityException("试剂【" + sj.getMc() + "】不是入库状态,不能处置"); + } + if(!NumberUtils.isParsable(itemForm.getCzl())) { + throw new ServiceException("请输入正确的处置量"); + } + BigDecimal czl = new BigDecimal(itemForm.getCzl()); + BigDecimal kc = new BigDecimal(sj.getKc()); + if(czl.compareTo(kc) > 0) { + throw new ServiceException("处置量不应大于库存量"); + } + kc = kc.subtract(czl); + sj.setKc(kc.toString()); + sjList.add(sj); + + map.put(sj.getId(), sj); + } + updateBatchById(sjList); + + List sjJcgjList = new ArrayList<>(); + List sjTzList = new ArrayList<>(); + for (PlczSjItemForm itemForm : form.getList()) { + Sj sj = map.get(itemForm.getId()); + + LinkedHashMap jcnrMap = new LinkedHashMap<>(); + jcnrMap.put("处置方式", itemForm.getCzfs()); + jcnrMap.put("处置量", itemForm.getCzl()); + jcnrMap.put("原因", itemForm.getRemark()); + SjJcgj sjJcgj = new SjJcgj(); + sjJcgj.setSjId(itemForm.getId()); + sjJcgj.setJcgjlx(JcgjlxEnum.bj.getValue()); + sjJcgj.setJcmc("处置"); + sjJcgj.setJcnr(JctUtil.formatStr(jcnrMap)); + sjJcgj.setJcmcys(JcmcysEnum.green.getValue()); + sjJcgj.setQmyy("处置"); + sjJcgj.setQmrId(qmr.getUserId()); + sjJcgj.setQmrMc(qmr.getNickName()); + sjJcgjList.add(sjJcgj); + + // 台账 + SjTz sjTz = new SjTz(); + sjTz.setQmrId(qmr.getUserId()); + sjTz.setQmrMc(qmr.getNickName()); + sjTz.setQmyy("处置"); + sjTz.setCzl(itemForm.getCzl()); + sjTz.setCzldw(sj.getKcdw()); + sjTz.setRemark(itemForm.getRemark()); + sjTzList.add(sjTz); + } + sjkcJcgjService.saveBatch(sjJcgjList); + sjTzService.saveBatch(sjTzList); + + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void sd(SdSjForm form) { + SysUser qmr = sysUserService.selectUserById(form.getQmrId()); + //验证签名人密码 todo + if (form.getId() == null || form.getId().longValue() < 0) { + throw new SecurityException("参数id不正确"); + } + Sj sj = this.getById(form.getId()); + if (sj == null) { + throw new SecurityException("试剂不存在或已删除"); + } + if (!sj.getZjzt().equals(ZjztEnum.rk.getValue())) { + throw new SecurityException("试剂【" + sj.getMc() + "】不是入库状态,不能锁定"); + } + sj.setZjzt(ZjztEnum.ysd.getValue()); + this.updateById(sj); + //稽查轨迹 + Map formData = new LinkedHashMap<>(); + formData.put("备注", form.getRemark()); + formData.put("签名意义", "锁定试剂"); + formData.put("签名人", qmr.getNickName()); + sjkcJcgjService.saveJcgj(sj.getId(), JcgjlxEnum.lc.getValue(), "锁定试剂", JcmcysEnum.green.getValue(), JctUtil.formatStr(formData)); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void plsd(SdSjForm form) { + SysUser qmr = sysUserService.selectUserById(form.getQmrId()); + //验证签名人密码 todo + + List sjList = new ArrayList<>(); + for (Long id : form.getIds()) { + if (id == null || id < 0) { + throw new SecurityException("参数id不正确"); + } + Sj sj = this.getById(id); + if (sj == null) { + throw new SecurityException("试剂不存在或已删除"); + } + if (!sj.getZjzt().equals(ZjztEnum.rk.getValue())) { + throw new SecurityException("试剂【" + sj.getMc() + "】不是入库状态,不能锁定"); + } + sj.setZjzt(ZjztEnum.ysd.getValue()); + sjList.add(sj); + } + this.updateBatchById(sjList); + //稽查轨迹 + for (Sj sj : sjList) { + Map formData = new LinkedHashMap<>(); + formData.put("备注", form.getRemark()); + formData.put("签名意义", "锁定试剂"); + formData.put("签名人", qmr.getNickName()); + sjkcJcgjService.saveJcgj(sj.getId(), JcgjlxEnum.lc.getValue(), "锁定试剂", JcmcysEnum.green.getValue(), JctUtil.formatStr(formData)); + } + + } + + @Override + public void js(JsSjForm form) { + SysUser qmr = sysUserService.selectUserById(form.getQmrId()); + //验证签名人密码 todo + if (form.getId() == null || form.getId().longValue() < 0) { + throw new SecurityException("参数id不正确"); + } + Sj sjOld = this.getById(form.getId()); + if (sjOld == null) { + throw new SecurityException("试剂不存在或已删除"); + } + if (!sjOld.getZjzt().equals(ZjztEnum.ysd.getValue())) { + throw new SecurityException("试剂【" + sjOld.getMc() + "】不是已锁定状态,不能解锁"); + } + //点击解锁,状态更新为入库; + sjOld.setZjzt(ZjztEnum.rk.getValue()); + this.updateById(sjOld); + //稽查轨迹 + Map formData = new LinkedHashMap<>(); + formData.put("备注", form.getRemark()); + formData.put("签名意义", "解锁试剂"); + formData.put("签名人", qmr.getNickName()); + sjkcJcgjService.saveJcgj(sjOld.getId(), JcgjlxEnum.lc.getValue(), "解锁试剂", JcmcysEnum.green.getValue(), JctUtil.formatStr(formData)); + } + + @Override + public void jy(JySjForm form) { + SysUser qmr = sysUserService.selectUserById(form.getQmrId()); + //验证签名人密码 todo + if (form.getId() == null || form.getId().longValue() < 0) { + throw new SecurityException("参数id不正确"); + } + Sj sjOld = this.getById(form.getId()); + if (sjOld == null) { + throw new SecurityException("试剂不存在或已删除"); + } + if (!sjOld.getZjzt().equals(ZjztEnum.gd.getValue())) { + throw new SecurityException("试剂【" + sjOld.getMc() + "】不是归档状态,不能借阅"); + } + if (!sjOld.getJyzt().equals(JyztEnum.wjy.getValue())) { + throw new SecurityException("试剂【" + sjOld.getMc() + "】不是未借阅状态,不能借阅"); + } + //申请借阅后,借阅状态更新为待借阅,等待档案员审核期间无法进行其他操作; + sjOld.setJyzt(JyztEnum.djy.getValue()); + sjOld.setJyksrq(form.getStartDate()); + sjOld.setJyjsrq(form.getEndDate()); + this.updateById(sjOld); + //稽查轨迹 + Map formData = new LinkedHashMap<>(); + formData.put("借阅开始时间", DateUtils.dateTime(form.getStartDate())); + formData.put("借阅结束时间", DateUtils.dateTime(form.getEndDate())); + formData.put("备注", form.getRemark()); + formData.put("签名意义", "申请借阅"); + formData.put("签名人", qmr.getNickName()); + sjkcJcgjService.saveJcgj(sjOld.getId(), JcgjlxEnum.lc.getValue(), "申请借阅", JcmcysEnum.orange.getValue(), JctUtil.formatStr(formData)); + } + + @Override + public void jd(JdSjForm form) { + SysUser qmr = sysUserService.selectUserById(form.getQmrId()); + //验证签名人密码 todo + if (form.getId() == null || form.getId().longValue() < 0) { + throw new SecurityException("参数id不正确"); + } + Sj sjOld = this.getById(form.getId()); + if (sjOld == null) { + throw new SecurityException("试剂不存在或已删除"); + } + if (!sjOld.getZjzt().equals(ZjztEnum.gd.getValue())) { + throw new SecurityException("试剂【" + sjOld.getMc() + "】未归档,不能解档"); + } + //申请解档后,制剂状态更新为待解档,等待档案员审核期间无法进行其他操作; + sjOld.setZjzt(ZjztEnum.djd.getValue()); + this.updateById(sjOld); + //稽查轨迹 + Map formData = new LinkedHashMap<>(); + formData.put("备注", form.getRemark()); + formData.put("签名意义", "申请解档"); + formData.put("签名人", qmr.getNickName()); + sjkcJcgjService.saveJcgj(sjOld.getId(), JcgjlxEnum.lc.getValue(), "申请解档", JcmcysEnum.green.getValue(), JctUtil.formatStr(formData)); + } + + @Override + public void gd(GdSjForm form) { + SysUser qmr = sysUserService.selectUserById(form.getQmrId()); + //验证签名人密码 todo + if (form.getId() == null || form.getId().longValue() < 0) { + throw new SecurityException("参数id不正确"); + } + Sj sjOld = this.getById(form.getId()); + if (sjOld == null) { + throw new SecurityException("试剂不存在或已删除"); + } + if (!sjOld.getZjzt().equals(ZjztEnum.ysd.getValue())) { + throw new SecurityException("试剂【" + sjOld.getMc() + "】不是锁定状态,不能归档"); + } + //申请归档,档案员可在档案管理中进行确认归档审核;申请后状态更新成待归档; + sjOld.setZjzt(ZjztEnum.dgd.getValue()); + this.updateById(sjOld); + //稽查轨迹 + Map formData = new LinkedHashMap<>(); + formData.put("备注", form.getRemark()); + formData.put("签名意义", "申请归档"); + formData.put("签名人", qmr.getNickName()); + sjkcJcgjService.saveJcgj(sjOld.getId(), JcgjlxEnum.lc.getValue(), "申请归档", JcmcysEnum.green.getValue(), JctUtil.formatStr(formData)); + } + + @Override + public void plgd(GdForm form) { + SysUser qmr = sysUserService.selectUserById(form.getQmrId()); + //验证签名人密码 todo + + List sjList = new ArrayList<>(); + for (Long id : form.getIds()) { + if (id == null || id < 0) { + throw new SecurityException("参数id不正确"); + } + Sj sjOld = this.getById(id); + if (sjOld == null) { + throw new SecurityException("试剂不存在或已删除"); + } + if (!sjOld.getZjzt().equals(ZjztEnum.ysd.getValue())) { + throw new SecurityException("试剂【" + sjOld.getMc() + "】不是锁定状态,不能归档"); + } + //申请归档,档案员可在档案管理中进行确认归档审核;申请后状态更新成待归档; + sjOld.setZjzt(ZjztEnum.dgd.getValue()); + sjList.add(sjOld); + } + this.updateBatchById(sjList); + + //稽查轨迹 + for (Sj sj : sjList) { + Map formData = new LinkedHashMap<>(); + formData.put("备注", form.getRemark()); + formData.put("签名意义", "申请归档"); + formData.put("签名人", qmr.getNickName()); + sjkcJcgjService.saveJcgj(sj.getId(), JcgjlxEnum.lc.getValue(), "申请归档", JcmcysEnum.green.getValue(), JctUtil.formatStr(formData)); + } + + } + +} diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/SjkcJcgjServiceImpl.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/SjkcJcgjServiceImpl.java deleted file mode 100644 index cb59841..0000000 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/SjkcJcgjServiceImpl.java +++ /dev/null @@ -1,68 +0,0 @@ -package com.hxhq.business.service.impl; - -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.Wrappers; -import com.hxhq.business.domain.MjyJcgj; -import com.hxhq.business.domain.YqJcgj; -import com.hxhq.common.core.domain.MpBaseEntity; -import com.hxhq.common.core.utils.StringUtils; -import com.hxhq.common.security.utils.SecurityUtils; -import com.hxhq.system.api.domain.SysUser; -import org.springframework.scheduling.annotation.Async; -import org.springframework.stereotype.Service; -import com.hxhq.business.mapper.SjkcJcgjMapper; -import com.hxhq.business.domain.SjkcJcgj; -import com.hxhq.business.service.ISjkcJcgjService; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; - -/** - * 试剂库存-稽查轨迹Service业务层处理 - * - * @author HanLong - * @date 2025-12-22 - */ -@Service -public class SjkcJcgjServiceImpl extends ServiceImpl implements ISjkcJcgjService { - /** - * 查询试剂库存-稽查轨迹列表 - * - * @param sjkcJcgj 试剂库存-稽查轨迹 - * @return 试剂库存-稽查轨迹 - */ - @Override - public List queryList(SjkcJcgj sjkcJcgj) { - LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); - if (sjkcJcgj.getSjkcId() == null || sjkcJcgj.getSjkcId().longValue() < 0) { - throw new SecurityException("试剂id不能为空"); - } - queryWrapper.eq(SjkcJcgj::getSjkcId, sjkcJcgj.getSjkcId()); - if (sjkcJcgj.getJcgjlx() != null && sjkcJcgj.getJcgjlx().intValue() > 0) { - queryWrapper.eq(SjkcJcgj::getJcgjlx, sjkcJcgj.getJcgjlx()); - } - if (StringUtils.isNoneBlank(sjkcJcgj.getJcmc())) { - queryWrapper.and(p -> p.like(SjkcJcgj::getJcmc, sjkcJcgj.getJcmc()) - .or().like(SjkcJcgj::getJcgjlx, sjkcJcgj.getJcmc())); - } - queryWrapper.orderByDesc(MpBaseEntity::getId); - return this.list(queryWrapper); - } - - @Override - @Async - public void saveJcgj(Long sjId, Integer jcgjlx, String jcmc, Integer jcmcys, String jcnr) { - SysUser sysUser = SecurityUtils.getLoginUser().getSysUser(); - SjkcJcgj sjkcJcgj = new SjkcJcgj(); - sjkcJcgj.setSjkcId(sjId); - sjkcJcgj.setJcgjlx(jcgjlx); - sjkcJcgj.setJcmc(jcmc); - sjkcJcgj.setJcmcys(jcmcys); - sjkcJcgj.setJcnr(jcnr); - sjkcJcgj.setQmrId(sysUser.getUserId()); - sjkcJcgj.setQmrMc(sysUser.getNickName()); - this.save(sjkcJcgj); - } - -} diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/SjkcServiceImpl.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/SjkcServiceImpl.java deleted file mode 100644 index f1a413e..0000000 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/SjkcServiceImpl.java +++ /dev/null @@ -1,426 +0,0 @@ -package com.hxhq.business.service.impl; - -import java.math.BigDecimal; -import java.util.*; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.toolkit.Wrappers; -import com.hxhq.business.domain.Mjy; -import com.hxhq.business.domain.SjTz; -import com.hxhq.business.domain.SjkcJcgj; -import com.hxhq.business.enums.zykgl.JcgjlxEnum; -import com.hxhq.business.enums.zykgl.JcmcysEnum; -import com.hxhq.business.enums.zykgl.JyztEnum; -import com.hxhq.business.enums.zykgl.ZjztEnum; -import com.hxhq.business.form.mjy.GdForm; -import com.hxhq.business.form.mjy.JyForm; -import com.hxhq.business.form.sj.*; -import com.hxhq.business.service.ISjTzService; -import com.hxhq.business.service.ISjkcJcgjService; -import com.hxhq.business.utils.JctUtil; -import com.hxhq.business.utils.ObjectCompareUtil; -import com.hxhq.common.core.exception.ServiceException; -import com.hxhq.common.core.utils.DateUtils; -import com.hxhq.common.security.utils.SecurityUtils; -import com.hxhq.system.api.domain.SysUser; -import com.hxhq.system.service.ISysUserService; -import org.apache.commons.lang3.math.NumberUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import com.hxhq.business.mapper.SjkcMapper; -import com.hxhq.business.domain.Sjkc; -import com.hxhq.business.service.ISjkcService; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import org.springframework.transaction.annotation.Transactional; - -/** - * 试剂库存Service业务层处理 - * - * @author HanLong - * @date 2025-12-22 - */ -@Service -public class SjkcServiceImpl extends ServiceImpl implements ISjkcService -{ - @Autowired - private ISysUserService sysUserService; - - @Autowired - private ISjkcJcgjService sjkcJcgjService; - - @Autowired - private ISjTzService sjTzService; - - /** - * 查询试剂库存列表 - * - * @param sjkc 试剂库存 - * @return 试剂库存 - */ - @Override - public List queryList(Sjkc sjkc) - { - QueryWrapper queryWrapper = Wrappers.query(); - return this.list(queryWrapper); - } - - @Override - public void xgkc(SjXgkcForm form) { - SysUser qmr = sysUserService.selectUserById(form.getQmrId()); - //验证签名人密码 todo - if (form.getId() == null || form.getId().longValue() < 0) { - throw new SecurityException("参数id不正确"); - } - Sjkc sjkcOld = this.getById(form.getId()); - if (sjkcOld == null) { - throw new SecurityException("试剂不存在或已删除"); - } - if (!sjkcOld.getZjzt().equals(ZjztEnum.rk.getValue())) { - throw new SecurityException("试剂【" + sjkcOld.getMc() + "】不是入库状态,不能修改库存"); - } - List fieldChanges = ObjectCompareUtil.compareObjects(sjkcOld, form); - if (fieldChanges.size() == 0) { - throw new SecurityException("你没有修改任何内容"); - } - sjkcOld.setKcdw(form.getKcdw()); - sjkcOld.setKc(form.getKc()); - this.updateById(sjkcOld); - - List sjkcJcgjList = new ArrayList<>(); - //region 稽查轨迹 - for (ObjectCompareUtil.FieldChange fieldChange : fieldChanges) { - SjkcJcgj mjyJcgj = new SjkcJcgj(); - mjyJcgj.setSjkcId(sjkcOld.getId()); - mjyJcgj.setJcgjlx(JcgjlxEnum.lc.getValue()); - mjyJcgj.setJcmc("修改库存"); - mjyJcgj.setJcmcys(JcmcysEnum.green.getValue()); - mjyJcgj.setJcnr(fieldChange.toString()); - mjyJcgj.setQmyy("修改库存"); - mjyJcgj.setQmrId(qmr.getUserId()); - mjyJcgj.setQmrMc(qmr.getNickName()); - sjkcJcgjList.add(mjyJcgj); - } - sjkcJcgjService.saveBatch(sjkcJcgjList); - //endregion - - // 台账 - sjTzService.saveTz(sjkcOld.getId(), qmr.getUserId(), qmr.getNickName(), "修改库存", form.getKc(), form.getKcdw(), null); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void cz(CzSjForm form) { - SysUser qmr = sysUserService.selectUserById(form.getQmrId()); - //验证签名人密码 todo - if (form.getId() == null || form.getId() < 0) { - throw new SecurityException("参数id不正确"); - } - Sjkc sjOld = this.getById(form.getId()); - if (sjOld == null) { - throw new SecurityException("试剂不存在或已删除"); - } - if (!sjOld.getZjzt().equals(ZjztEnum.rk.getValue())) { - throw new SecurityException("试剂【" + sjOld.getMc() + "】不是入库状态,不能处置"); - } - if(!NumberUtils.isParsable(form.getCzl())) { - throw new ServiceException("请输入正确的处置量"); - } - BigDecimal czl = new BigDecimal(form.getCzl()); - BigDecimal kc = new BigDecimal(sjOld.getKc()); - if(czl.compareTo(kc) > 0) { - throw new ServiceException("处置量不应大于库存量"); - } - kc = kc.subtract(czl); - sjOld.setKc(kc.toString()); - updateById(sjOld); - - LinkedHashMap jcnrMap = new LinkedHashMap<>(); - jcnrMap.put("处置方式", form.getCzfs()); - jcnrMap.put("处置量", form.getCzl()); - jcnrMap.put("原因", form.getRemark()); - SjkcJcgj sjkcJcgj = new SjkcJcgj(); - sjkcJcgj.setSjkcId(sjOld.getId()); - sjkcJcgj.setJcgjlx(JcgjlxEnum.bj.getValue()); - sjkcJcgj.setJcmc("处置"); - sjkcJcgj.setJcnr(JctUtil.formatStr(jcnrMap)); - sjkcJcgj.setJcmcys(JcmcysEnum.green.getValue()); - sjkcJcgj.setQmyy("处置"); - sjkcJcgj.setQmrId(qmr.getUserId()); - sjkcJcgj.setQmrMc(qmr.getNickName()); - sjkcJcgjService.save(sjkcJcgj); - - // 台账 - sjTzService.saveTz(sjOld.getId(), qmr.getUserId(), qmr.getNickName(), "处置", form.getCzl(), sjOld.getKcdw(), form.getRemark()); - - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void plcz(PlczSjForm form) { - SysUser qmr = sysUserService.selectUserById(form.getQmrId()); - //验证签名人密码 todo - - List sjkcList = new ArrayList<>(); - Map map = new HashMap<>(); - for (PlczSjItemForm itemForm : form.getList()) { - if (itemForm.getId() == null || itemForm.getId() < 0) { - throw new SecurityException("参数id不正确"); - } - Sjkc sjkc = this.getById(itemForm.getId()); - if (sjkc == null) { - throw new SecurityException("试剂不存在或已删除"); - } - if (!sjkc.getZjzt().equals(ZjztEnum.rk.getValue())) { - throw new SecurityException("试剂【" + sjkc.getMc() + "】不是入库状态,不能处置"); - } - if(!NumberUtils.isParsable(itemForm.getCzl())) { - throw new ServiceException("请输入正确的处置量"); - } - BigDecimal czl = new BigDecimal(itemForm.getCzl()); - BigDecimal kc = new BigDecimal(sjkc.getKc()); - if(czl.compareTo(kc) > 0) { - throw new ServiceException("处置量不应大于库存量"); - } - kc = kc.subtract(czl); - sjkc.setKc(kc.toString()); - sjkcList.add(sjkc); - - map.put(sjkc.getId(), sjkc); - } - updateBatchById(sjkcList); - - List sjkcJcgjList = new ArrayList<>(); - List sjTzList = new ArrayList<>(); - for (PlczSjItemForm itemForm : form.getList()) { - Sjkc sjkc = map.get(itemForm.getId()); - - LinkedHashMap jcnrMap = new LinkedHashMap<>(); - jcnrMap.put("处置方式", itemForm.getCzfs()); - jcnrMap.put("处置量", itemForm.getCzl()); - jcnrMap.put("原因", itemForm.getRemark()); - SjkcJcgj sjkcJcgj = new SjkcJcgj(); - sjkcJcgj.setSjkcId(itemForm.getId()); - sjkcJcgj.setJcgjlx(JcgjlxEnum.bj.getValue()); - sjkcJcgj.setJcmc("处置"); - sjkcJcgj.setJcnr(JctUtil.formatStr(jcnrMap)); - sjkcJcgj.setJcmcys(JcmcysEnum.green.getValue()); - sjkcJcgj.setQmyy("处置"); - sjkcJcgj.setQmrId(qmr.getUserId()); - sjkcJcgj.setQmrMc(qmr.getNickName()); - sjkcJcgjList.add(sjkcJcgj); - - // 台账 - SjTz sjTz = new SjTz(); - sjTz.setQmrId(qmr.getUserId()); - sjTz.setQmrMc(qmr.getNickName()); - sjTz.setQmyy("处置"); - sjTz.setCzl(itemForm.getCzl()); - sjTz.setCzldw(sjkc.getKcdw()); - sjTz.setRemark(itemForm.getRemark()); - sjTzList.add(sjTz); - } - sjkcJcgjService.saveBatch(sjkcJcgjList); - sjTzService.saveBatch(sjTzList); - - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void sd(SdSjForm form) { - SysUser qmr = sysUserService.selectUserById(form.getQmrId()); - //验证签名人密码 todo - if (form.getId() == null || form.getId().longValue() < 0) { - throw new SecurityException("参数id不正确"); - } - Sjkc sjkc = this.getById(form.getId()); - if (sjkc == null) { - throw new SecurityException("试剂不存在或已删除"); - } - if (!sjkc.getZjzt().equals(ZjztEnum.rk.getValue())) { - throw new SecurityException("试剂【" + sjkc.getMc() + "】不是入库状态,不能锁定"); - } - sjkc.setZjzt(ZjztEnum.ysd.getValue()); - this.updateById(sjkc); - //稽查轨迹 - Map formData = new LinkedHashMap<>(); - formData.put("备注", form.getRemark()); - formData.put("签名意义", "锁定试剂"); - formData.put("签名人", qmr.getNickName()); - sjkcJcgjService.saveJcgj(sjkc.getId(), JcgjlxEnum.lc.getValue(), "锁定试剂", JcmcysEnum.green.getValue(), JctUtil.formatStr(formData)); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void plsd(SdSjForm form) { - SysUser qmr = sysUserService.selectUserById(form.getQmrId()); - //验证签名人密码 todo - - List sjkcList = new ArrayList<>(); - for (Long id : form.getIds()) { - if (id == null || id < 0) { - throw new SecurityException("参数id不正确"); - } - Sjkc sjkc = this.getById(id); - if (sjkc == null) { - throw new SecurityException("试剂不存在或已删除"); - } - if (!sjkc.getZjzt().equals(ZjztEnum.rk.getValue())) { - throw new SecurityException("试剂【" + sjkc.getMc() + "】不是入库状态,不能锁定"); - } - sjkc.setZjzt(ZjztEnum.ysd.getValue()); - sjkcList.add(sjkc); - } - this.updateBatchById(sjkcList); - //稽查轨迹 - for (Sjkc sjkc : sjkcList) { - Map formData = new LinkedHashMap<>(); - formData.put("备注", form.getRemark()); - formData.put("签名意义", "锁定试剂"); - formData.put("签名人", qmr.getNickName()); - sjkcJcgjService.saveJcgj(sjkc.getId(), JcgjlxEnum.lc.getValue(), "锁定试剂", JcmcysEnum.green.getValue(), JctUtil.formatStr(formData)); - } - - } - - @Override - public void js(JsSjForm form) { - SysUser qmr = sysUserService.selectUserById(form.getQmrId()); - //验证签名人密码 todo - if (form.getId() == null || form.getId().longValue() < 0) { - throw new SecurityException("参数id不正确"); - } - Sjkc sjOld = this.getById(form.getId()); - if (sjOld == null) { - throw new SecurityException("试剂不存在或已删除"); - } - if (!sjOld.getZjzt().equals(ZjztEnum.ysd.getValue())) { - throw new SecurityException("试剂【" + sjOld.getMc() + "】不是已锁定状态,不能解锁"); - } - //点击解锁,状态更新为入库; - sjOld.setZjzt(ZjztEnum.rk.getValue()); - this.updateById(sjOld); - //稽查轨迹 - Map formData = new LinkedHashMap<>(); - formData.put("备注", form.getRemark()); - formData.put("签名意义", "解锁试剂"); - formData.put("签名人", qmr.getNickName()); - sjkcJcgjService.saveJcgj(sjOld.getId(), JcgjlxEnum.lc.getValue(), "解锁试剂", JcmcysEnum.green.getValue(), JctUtil.formatStr(formData)); - } - - @Override - public void jy(JySjForm form) { - SysUser qmr = sysUserService.selectUserById(form.getQmrId()); - //验证签名人密码 todo - if (form.getId() == null || form.getId().longValue() < 0) { - throw new SecurityException("参数id不正确"); - } - Sjkc sjOld = this.getById(form.getId()); - if (sjOld == null) { - throw new SecurityException("试剂不存在或已删除"); - } - if (!sjOld.getZjzt().equals(ZjztEnum.gd.getValue())) { - throw new SecurityException("试剂【" + sjOld.getMc() + "】不是归档状态,不能借阅"); - } - if (!sjOld.getJyzt().equals(JyztEnum.wjy.getValue())) { - throw new SecurityException("试剂【" + sjOld.getMc() + "】不是未借阅状态,不能借阅"); - } - //申请借阅后,借阅状态更新为待借阅,等待档案员审核期间无法进行其他操作; - sjOld.setJyzt(JyztEnum.djy.getValue()); - sjOld.setJyksrq(form.getStartDate()); - sjOld.setJyjsrq(form.getEndDate()); - this.updateById(sjOld); - //稽查轨迹 - Map formData = new LinkedHashMap<>(); - formData.put("借阅开始时间", DateUtils.dateTime(form.getStartDate())); - formData.put("借阅结束时间", DateUtils.dateTime(form.getEndDate())); - formData.put("备注", form.getRemark()); - formData.put("签名意义", "申请借阅"); - formData.put("签名人", qmr.getNickName()); - sjkcJcgjService.saveJcgj(sjOld.getId(), JcgjlxEnum.lc.getValue(), "申请借阅", JcmcysEnum.orange.getValue(), JctUtil.formatStr(formData)); - } - - @Override - public void jd(JdSjForm form) { - SysUser qmr = sysUserService.selectUserById(form.getQmrId()); - //验证签名人密码 todo - if (form.getId() == null || form.getId().longValue() < 0) { - throw new SecurityException("参数id不正确"); - } - Sjkc sjOld = this.getById(form.getId()); - if (sjOld == null) { - throw new SecurityException("试剂不存在或已删除"); - } - if (!sjOld.getZjzt().equals(ZjztEnum.gd.getValue())) { - throw new SecurityException("试剂【" + sjOld.getMc() + "】未归档,不能解档"); - } - //申请解档后,制剂状态更新为待解档,等待档案员审核期间无法进行其他操作; - sjOld.setZjzt(ZjztEnum.djd.getValue()); - this.updateById(sjOld); - //稽查轨迹 - Map formData = new LinkedHashMap<>(); - formData.put("备注", form.getRemark()); - formData.put("签名意义", "申请解档"); - formData.put("签名人", qmr.getNickName()); - sjkcJcgjService.saveJcgj(sjOld.getId(), JcgjlxEnum.lc.getValue(), "申请解档", JcmcysEnum.green.getValue(), JctUtil.formatStr(formData)); - } - - @Override - public void gd(GdSjForm form) { - SysUser qmr = sysUserService.selectUserById(form.getQmrId()); - //验证签名人密码 todo - if (form.getId() == null || form.getId().longValue() < 0) { - throw new SecurityException("参数id不正确"); - } - Sjkc sjOld = this.getById(form.getId()); - if (sjOld == null) { - throw new SecurityException("试剂不存在或已删除"); - } - if (!sjOld.getZjzt().equals(ZjztEnum.ysd.getValue())) { - throw new SecurityException("试剂【" + sjOld.getMc() + "】不是锁定状态,不能归档"); - } - //申请归档,档案员可在档案管理中进行确认归档审核;申请后状态更新成待归档; - sjOld.setZjzt(ZjztEnum.dgd.getValue()); - this.updateById(sjOld); - //稽查轨迹 - Map formData = new LinkedHashMap<>(); - formData.put("备注", form.getRemark()); - formData.put("签名意义", "申请归档"); - formData.put("签名人", qmr.getNickName()); - sjkcJcgjService.saveJcgj(sjOld.getId(), JcgjlxEnum.lc.getValue(), "申请归档", JcmcysEnum.green.getValue(), JctUtil.formatStr(formData)); - } - - @Override - public void plgd(GdForm form) { - SysUser qmr = sysUserService.selectUserById(form.getQmrId()); - //验证签名人密码 todo - - List sjkcList = new ArrayList<>(); - for (Long id : form.getIds()) { - if (id == null || id < 0) { - throw new SecurityException("参数id不正确"); - } - Sjkc sjOld = this.getById(id); - if (sjOld == null) { - throw new SecurityException("试剂不存在或已删除"); - } - if (!sjOld.getZjzt().equals(ZjztEnum.ysd.getValue())) { - throw new SecurityException("试剂【" + sjOld.getMc() + "】不是锁定状态,不能归档"); - } - //申请归档,档案员可在档案管理中进行确认归档审核;申请后状态更新成待归档; - sjOld.setZjzt(ZjztEnum.dgd.getValue()); - sjkcList.add(sjOld); - } - this.updateBatchById(sjkcList); - - //稽查轨迹 - for (Sjkc sjkc : sjkcList) { - Map formData = new LinkedHashMap<>(); - formData.put("备注", form.getRemark()); - formData.put("签名意义", "申请归档"); - formData.put("签名人", qmr.getNickName()); - sjkcJcgjService.saveJcgj(sjkc.getId(), JcgjlxEnum.lc.getValue(), "申请归档", JcmcysEnum.green.getValue(), JctUtil.formatStr(formData)); - } - - } - -} diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/YqJcgjServiceImpl.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/YqJcgjServiceImpl.java index 14f909a..1e0c6ca 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/YqJcgjServiceImpl.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/YqJcgjServiceImpl.java @@ -3,10 +3,6 @@ package com.hxhq.business.service.impl; 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.Wrappers; -import com.hxhq.business.domain.MjyJcgj; -import com.hxhq.business.domain.SjkcJcgj; import com.hxhq.common.core.domain.MpBaseEntity; import com.hxhq.common.core.utils.StringUtils; import com.hxhq.common.security.utils.SecurityUtils; diff --git a/hxhq-modules/hxhq-system/src/main/resources/mapper/business/SjJcgjMapper.xml b/hxhq-modules/hxhq-system/src/main/resources/mapper/business/SjJcgjMapper.xml new file mode 100644 index 0000000..6f7f8dc --- /dev/null +++ b/hxhq-modules/hxhq-system/src/main/resources/mapper/business/SjJcgjMapper.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/hxhq-modules/hxhq-system/src/main/resources/mapper/business/SjMapper.xml b/hxhq-modules/hxhq-system/src/main/resources/mapper/business/SjMapper.xml new file mode 100644 index 0000000..52b5666 --- /dev/null +++ b/hxhq-modules/hxhq-system/src/main/resources/mapper/business/SjMapper.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/hxhq-modules/hxhq-system/src/main/resources/mapper/business/SjkcJcgjMapper.xml b/hxhq-modules/hxhq-system/src/main/resources/mapper/business/SjkcJcgjMapper.xml deleted file mode 100644 index 6f7f8dc..0000000 --- a/hxhq-modules/hxhq-system/src/main/resources/mapper/business/SjkcJcgjMapper.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - \ No newline at end of file diff --git a/hxhq-modules/hxhq-system/src/main/resources/mapper/business/SjkcMapper.xml b/hxhq-modules/hxhq-system/src/main/resources/mapper/business/SjkcMapper.xml deleted file mode 100644 index 599ae7a..0000000 --- a/hxhq-modules/hxhq-system/src/main/resources/mapper/business/SjkcMapper.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - \ No newline at end of file