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 index 7fc086f..cebba5b 100644 --- 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 @@ -1,18 +1,20 @@ package com.hxhq.business.controller; -import java.util.Arrays; import java.util.List; -import com.hxhq.business.form.mjy.CzrqForm; -import com.hxhq.business.form.mjy.XgkcForm; -import com.hxhq.business.form.sj.CzsjForm; -import com.hxhq.business.form.sj.SjXgkcForm; +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.domain.Sjkc; import com.hxhq.business.service.ISjkcService; import com.hxhq.common.core.web.controller.BaseController; import com.hxhq.common.core.web.domain.AjaxResult; @@ -32,6 +34,34 @@ 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); + } + /** * 查询试剂库存列表 */ @@ -74,10 +104,93 @@ public class SjkcController extends BaseController /** 处置 */ @PostMapping("/cz") - public AjaxResult cz(@RequestBody @Validated CzsjForm form) + 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/SjTz.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/SjTz.java index 17e801f..9e14500 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/SjTz.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/SjTz.java @@ -33,4 +33,51 @@ public class SjTz extends MpBaseEntity /** 操作量单位 */ private String czldw; + public Long getSjId() { + return sjId; + } + + public void setSjId(Long sjId) { + this.sjId = sjId; + } + + public Long getQmrId() { + return qmrId; + } + + public void setQmrId(Long qmrId) { + this.qmrId = qmrId; + } + + public String getQmrMc() { + return qmrMc; + } + + public void setQmrMc(String qmrMc) { + this.qmrMc = qmrMc; + } + + public String getQmyy() { + return qmyy; + } + + public void setQmyy(String qmyy) { + this.qmyy = qmyy; + } + + public String getCzl() { + return czl; + } + + public void setCzl(String czl) { + this.czl = czl; + } + + public String getCzldw() { + return czldw; + } + + public void setCzldw(String czldw) { + this.czldw = czldw; + } } 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 index 4767f6c..1195a04 100644 --- 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 @@ -3,6 +3,7 @@ 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; @@ -45,9 +46,11 @@ public class Sjkc extends MpBaseEntity private String nddw; /** 库存数量 */ + @Compare(name = "库存数量") private String kc; /** 库存单位 */ + @Compare(name = "库存单位") private String kcdw; /** 来源 */ @@ -73,6 +76,13 @@ public class Sjkc extends MpBaseEntity @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) { @@ -246,4 +256,20 @@ public class Sjkc extends MpBaseEntity 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/Yq.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/Yq.java index 222a6dd..2e10e4e 100644 --- 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 @@ -4,6 +4,7 @@ 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.annotation.Excel; import com.hxhq.common.core.domain.MpBaseEntity; import org.hibernate.validator.constraints.Length; @@ -28,7 +29,7 @@ public class Yq extends MpBaseEntity { */ @NotEmpty(message = "请输入仪器名称") @Length(max = 50, message = "仪器名称不能超过50字") - @Excel(name = "仪器名称") + @Compare(name = "仪器名称") private String mc; /** @@ -36,7 +37,7 @@ public class Yq extends MpBaseEntity { */ @NotEmpty(message = "请输入仪器编号") @Length(max = 50, message = "仪器编号不能超过50字") - @Excel(name = "仪器编号") + @Compare(name = "仪器编号") private String bh; /** @@ -44,7 +45,7 @@ public class Yq extends MpBaseEntity { */ @NotEmpty(message = "请输入仪器型号") @Length(max = 50, message = "仪器型号不能超过50字") - @Excel(name = "仪器型号") + @Compare(name = "仪器型号") private String xh; /** @@ -52,7 +53,7 @@ public class Yq extends MpBaseEntity { */ @NotEmpty(message = "请输入仪器来源") @Length(max = 50, message = "仪器来源不能超过50字") - @Excel(name = "仪器来源") + @Compare(name = "仪器来源") private String ly; /** @@ -60,7 +61,7 @@ public class Yq extends MpBaseEntity { */ @JsonFormat(pattern = "yyyy-MM-dd") @NotNull(message = "请选择校准日期") - @Excel(name = "下次校准日期") + @Compare(name = "下次校准日期") private Date jzrq; /** @@ -70,7 +71,7 @@ public class Yq extends MpBaseEntity { private Long bmId; /** 部门名称 */ - @Excel(name = "所属部门") + @Compare(name = "所属部门") private String bmMc; @@ -78,7 +79,7 @@ public class Yq extends MpBaseEntity { * 温层 */ @NotNull(message = "请选择所温层") - @Excel(name = "温层") + @Compare(name = "温层") private String wc; diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/form/sj/CzsjForm.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/form/sj/CzSjForm.java similarity index 98% rename from hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/form/sj/CzsjForm.java rename to hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/form/sj/CzSjForm.java index d8f676c..a67555d 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/form/sj/CzsjForm.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/form/sj/CzSjForm.java @@ -6,7 +6,7 @@ import javax.validation.constraints.NotNull; /** * 处置试剂 */ -public class CzsjForm { +public class CzSjForm { /** 试剂id */ @NotNull(message = "请选择处置试剂") diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/form/sj/GdSjForm.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/form/sj/GdSjForm.java new file mode 100644 index 0000000..3f30897 --- /dev/null +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/form/sj/GdSjForm.java @@ -0,0 +1,65 @@ +package com.hxhq.business.form.sj; + +import javax.validation.constraints.NotEmpty; + +/** + * @author 15881 + */ +public class GdSjForm { + + /** 试剂id */ + private Long id; + + /** 试剂ids */ + private Long[] ids; + + /** 备注 */ + private String remark; + + /** 签名人id */ + private Long qmrId; + + /** 签名人密码 */ + @NotEmpty(message = "请输入密码") + private String qmrmm; + + public Long[] getIds() { + return ids; + } + + public void setIds(Long[] ids) { + this.ids = ids; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark; + } + + public Long getQmrId() { + return qmrId; + } + + public void setQmrId(Long qmrId) { + this.qmrId = qmrId; + } + + public String getQmrmm() { + return qmrmm; + } + + public void setQmrmm(String qmrmm) { + this.qmrmm = qmrmm; + } +} diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/form/sj/JdSjForm.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/form/sj/JdSjForm.java new file mode 100644 index 0000000..b9a01fd --- /dev/null +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/form/sj/JdSjForm.java @@ -0,0 +1,57 @@ +package com.hxhq.business.form.sj; + +import javax.validation.constraints.NotEmpty; +import javax.validation.constraints.NotNull; + +/** + * 试剂-解档 + * @author 15881 + */ +public class JdSjForm { + + /** 试剂id */ + @NotNull(message = "请选择操作对象") + private Long id; + + /** 备注 */ + private String remark; + + /** 签名人id */ + private Long qmrId; + + /** 签名人密码 */ + @NotEmpty(message = "请输入密码") + private String qmrmm; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark; + } + + public Long getQmrId() { + return qmrId; + } + + public void setQmrId(Long qmrId) { + this.qmrId = qmrId; + } + + public String getQmrmm() { + return qmrmm; + } + + public void setQmrmm(String qmrmm) { + this.qmrmm = qmrmm; + } +} diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/form/sj/JsSjForm.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/form/sj/JsSjForm.java new file mode 100644 index 0000000..ef80bfc --- /dev/null +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/form/sj/JsSjForm.java @@ -0,0 +1,57 @@ +package com.hxhq.business.form.sj; + +import javax.validation.constraints.NotEmpty; +import javax.validation.constraints.NotNull; + +/** + * 试剂-解锁 + * @author HanLong + */ +public class JsSjForm { + + /** 试剂id */ + @NotNull(message = "请选择操作对象") + private Long id; + + /** 备注 */ + private String remark; + + /** 签名人id */ + private Long qmrId; + + /** 签名人密码 */ + @NotEmpty(message = "请输入密码") + private String qmrmm; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark; + } + + public Long getQmrId() { + return qmrId; + } + + public void setQmrId(Long qmrId) { + this.qmrId = qmrId; + } + + public String getQmrmm() { + return qmrmm; + } + + public void setQmrmm(String qmrmm) { + this.qmrmm = qmrmm; + } +} diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/form/sj/JySjForm.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/form/sj/JySjForm.java new file mode 100644 index 0000000..c331dd0 --- /dev/null +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/form/sj/JySjForm.java @@ -0,0 +1,86 @@ +package com.hxhq.business.form.sj; + +import com.fasterxml.jackson.annotation.JsonFormat; + +import javax.validation.constraints.NotEmpty; +import javax.validation.constraints.NotNull; +import java.util.Date; + +/** + * 试剂-借阅 + * @author HanLong + */ +public class JySjForm { + + /** 试剂id */ + @NotNull(message = "请选择操作对象") + private Long id; + + /** 备注 */ + private String remark; + + /** 签名人id */ + private Long qmrId; + + /** 签名人密码 */ + @NotEmpty(message = "请输入密码") + private String qmrmm; + + /** 日期开始 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @NotNull(message = "借阅日期不能为空") + private Date startDate; + + /** 日期结束 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @NotNull(message = "借阅日期不能为空") + private Date endDate; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark; + } + + public Long getQmrId() { + return qmrId; + } + + public void setQmrId(Long qmrId) { + this.qmrId = qmrId; + } + + public String getQmrmm() { + return qmrmm; + } + + public void setQmrmm(String qmrmm) { + this.qmrmm = qmrmm; + } + + public Date getStartDate() { + return startDate; + } + + public void setStartDate(Date startDate) { + this.startDate = startDate; + } + + public Date getEndDate() { + return endDate; + } + + public void setEndDate(Date endDate) { + this.endDate = endDate; + } +} diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/form/sj/PlczSjForm.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/form/sj/PlczSjForm.java new file mode 100644 index 0000000..63d24df --- /dev/null +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/form/sj/PlczSjForm.java @@ -0,0 +1,48 @@ +package com.hxhq.business.form.sj; + +import javax.validation.constraints.NotEmpty; +import javax.validation.constraints.NotNull; +import java.util.List; + +/** + * 批量处置试剂 + */ +public class PlczSjForm { + + @NotNull(message = "处置对象不能为空") + private List list; + /** + * 签名人id + */ + private Long qmrId; + + /** + * 签名人密码 + */ + @NotEmpty(message = "请输入签名人密码") + private String qmrmm; + + public List getList() { + return list; + } + + public void setList(List list) { + this.list = list; + } + + public Long getQmrId() { + return qmrId; + } + + public void setQmrId(Long qmrId) { + this.qmrId = qmrId; + } + + public String getQmrmm() { + return qmrmm; + } + + public void setQmrmm(String qmrmm) { + this.qmrmm = qmrmm; + } +} diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/form/sj/PlczSjItemForm.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/form/sj/PlczSjItemForm.java new file mode 100644 index 0000000..2b669cf --- /dev/null +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/form/sj/PlczSjItemForm.java @@ -0,0 +1,59 @@ +package com.hxhq.business.form.sj; + +import javax.validation.constraints.NotEmpty; +import javax.validation.constraints.NotNull; + +/** + * 批量处置试剂-对象 + */ +public class PlczSjItemForm { + + /** 试剂id */ + @NotNull(message = "请选择处置试剂") + private Long id; + + /** 处置原因 */ + @NotEmpty(message = "请输入处置原因") + private String remark; + + /** 处置量 */ + @NotEmpty(message = "请输入处置量") + private String czl; + + /** 处置方式 */ + @NotEmpty(message = "请选择处置方式") + private String czfs; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark; + } + + public String getCzl() { + return czl; + } + + public void setCzl(String czl) { + this.czl = czl; + } + + public String getCzfs() { + return czfs; + } + + public void setCzfs(String czfs) { + this.czfs = czfs; + } +} + diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/form/sj/SdSjForm.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/form/sj/SdSjForm.java new file mode 100644 index 0000000..894018c --- /dev/null +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/form/sj/SdSjForm.java @@ -0,0 +1,66 @@ +package com.hxhq.business.form.sj; + +import javax.validation.constraints.NotEmpty; + +/** + * 锁定试剂 + * @author HanLong + */ +public class SdSjForm { + + /** 试剂id */ + private Long id; + + /** 试剂ids */ + private Long[] ids; + + /** 备注 */ + private String remark; + + /** 签名人id */ + private Long qmrId; + + /** 签名人密码 */ + @NotEmpty(message = "密码不能为空") + private String qmrmm; + + public Long[] getIds() { + return ids; + } + + public void setIds(Long[] ids) { + this.ids = ids; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark; + } + + public Long getQmrId() { + return qmrId; + } + + public void setQmrId(Long qmrId) { + this.qmrId = qmrId; + } + + public String getQmrmm() { + return qmrmm; + } + + public void setQmrmm(String qmrmm) { + this.qmrmm = qmrmm; + } +} diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/form/sj/SjXgkcForm.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/form/sj/SjXgkcForm.java index d203bee..40523ff 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/form/sj/SjXgkcForm.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/form/sj/SjXgkcForm.java @@ -1,5 +1,6 @@ package com.hxhq.business.form.sj; +import com.hxhq.common.core.annotation.Compare; import com.hxhq.common.core.annotation.Excel; import org.hibernate.validator.constraints.Length; @@ -16,13 +17,11 @@ public class SjXgkcForm { private Long id; /** 库存 */ - @Excel(name = "库存") @NotEmpty(message = "库存量不能为空") @Length(max = 50, message = "请输入正确的库存量") private String kc;; /** 库存单位 */ - @Excel(name = "库存单位") @NotEmpty(message = "库存单位不能为空") @Length(max = 50, message = "请选择正确的库存单位") private String kcdw; diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/mapper/SjTzMapper.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/mapper/SjTzMapper.java new file mode 100644 index 0000000..d2149e3 --- /dev/null +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/mapper/SjTzMapper.java @@ -0,0 +1,16 @@ +package com.hxhq.business.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.hxhq.business.domain.MjyTz; +import com.hxhq.business.domain.SjTz; + +/** + * 麻精药-台账Mapper接口 + * + * @author hxhq + * @date 2025-12-18 + */ +public interface SjTzMapper extends BaseMapper +{ + +} diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/ISjTzService.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/ISjTzService.java new file mode 100644 index 0000000..b3a4963 --- /dev/null +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/ISjTzService.java @@ -0,0 +1,36 @@ +package com.hxhq.business.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.hxhq.business.domain.MjyTz; +import com.hxhq.business.domain.SjTz; + +import java.util.List; + +/** + * 试剂-台账Service接口 + * + * @author HanLong + * @date 2025-12-18 + */ +public interface ISjTzService extends IService +{ + + /** + * 查询列表 + * @param form + * @return + */ + List queryList(SjTz form); + + /** + * 新增台账 + * @param sjId 试剂id + * @param qmrId 签名人id + * @param qmrMc 签名人名称 + * @param qmyy 签名意义 + * @param czl 操作量 + * @param czldw 操作量单位 + * @param remark 备注 + */ + public void saveTz(Long sjId, Long qmrId,String qmrMc,String qmyy,String czl,String czldw,String remark); +} 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 index 2d93337..27c2036 100644 --- 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 @@ -20,4 +20,13 @@ public interface ISjkcJcgjService extends IService */ 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 index f42332e..bd51f6b 100644 --- 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 @@ -3,8 +3,9 @@ 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.sj.CzsjForm; -import com.hxhq.business.form.sj.SjXgkcForm; +import com.hxhq.business.form.mjy.GdForm; +import com.hxhq.business.form.mjy.JyForm; +import com.hxhq.business.form.sj.*; /** * 试剂库存Service接口 @@ -26,5 +27,29 @@ public interface ISjkcService extends IService void xgkc(SjXgkcForm form); /** 处置 */ - void cz(CzsjForm 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/RoomServiceImpl.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/RoomServiceImpl.java index a450f5c..a4d15d5 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/RoomServiceImpl.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/RoomServiceImpl.java @@ -3,7 +3,6 @@ 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 com.ruoyi.common.utils.DateUtils; import org.springframework.stereotype.Service; import com.hxhq.business.mapper.RoomMapper; import com.hxhq.business.domain.Room; diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/SjTzServiceImpl.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/SjTzServiceImpl.java new file mode 100644 index 0000000..8aefc47 --- /dev/null +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/SjTzServiceImpl.java @@ -0,0 +1,49 @@ +package com.hxhq.business.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.hxhq.business.domain.MjyTz; +import com.hxhq.business.domain.SjTz; +import com.hxhq.business.mapper.MjyTzMapper; +import com.hxhq.business.mapper.SjTzMapper; +import com.hxhq.business.service.IMjyTzService; +import com.hxhq.business.service.ISjTzService; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 试剂-台账Service业务层处理 + * + * @author HanLong + * @date 2025-12-18 + */ +@Service +public class SjTzServiceImpl extends ServiceImpl implements ISjTzService +{ + + @Override + public List queryList(SjTz form) { + QueryWrapper queryWrapper = Wrappers.query(); + if(form.getSjId()==null||form.getSjId().longValue()<0){ + throw new SecurityException("试剂id不能为空"); + } + queryWrapper.eq("sj_id",form.getSjId()); + queryWrapper.orderByDesc("id"); + return this.list(queryWrapper); + } + + @Override + public void saveTz(Long sjId, Long qmrId, String qmrMc, String qmyy, String czl, String czldw, String remark) { + SjTz sjTz = new SjTz(); + sjTz.setSjId(sjId); + sjTz.setQmrId(qmrId); + sjTz.setQmrMc(qmrMc); + sjTz.setQmyy(qmyy); + sjTz.setCzl(czl); + sjTz.setCzldw(czldw); + sjTz.setRemark(remark); + save(sjTz); + } +} 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 index a3b9942..cb59841 100644 --- 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 @@ -1,8 +1,17 @@ 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; @@ -16,8 +25,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; * @date 2025-12-22 */ @Service -public class SjkcJcgjServiceImpl extends ServiceImpl implements ISjkcJcgjService -{ +public class SjkcJcgjServiceImpl extends ServiceImpl implements ISjkcJcgjService { /** * 查询试剂库存-稽查轨迹列表 * @@ -25,10 +33,36 @@ public class SjkcJcgjServiceImpl extends ServiceImpl i * @return 试剂库存-稽查轨迹 */ @Override - public List queryList(SjkcJcgj sjkcJcgj) - { - QueryWrapper queryWrapper = Wrappers.query(); + 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 index c1514e9..f1a413e 100644 --- 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 @@ -1,21 +1,27 @@ package com.hxhq.business.service.impl; import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.LinkedHashMap; -import java.util.List; +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.sj.CzsjForm; -import com.hxhq.business.form.sj.SjXgkcForm; +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; @@ -27,8 +33,6 @@ import com.hxhq.business.service.ISjkcService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.transaction.annotation.Transactional; -import javax.sql.rowset.serial.SerialException; - /** * 试剂库存Service业务层处理 * @@ -44,6 +48,9 @@ public class SjkcServiceImpl extends ServiceImpl implements IS @Autowired private ISjkcJcgjService sjkcJcgjService; + @Autowired + private ISjTzService sjTzService; + /** * 查询试剂库存列表 * @@ -75,6 +82,10 @@ public class SjkcServiceImpl extends ServiceImpl implements IS 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) { @@ -89,47 +100,46 @@ public class SjkcServiceImpl extends ServiceImpl implements IS mjyJcgj.setQmrMc(qmr.getNickName()); sjkcJcgjList.add(mjyJcgj); } + sjkcJcgjService.saveBatch(sjkcJcgjList); //endregion - sjkcOld.setKcdw(form.getKcdw()); - sjkcOld.setKc(form.getKc()); - this.updateById(sjkcOld); - sjkcJcgjService.saveBatch(sjkcJcgjList); + // 台账 + sjTzService.saveTz(sjkcOld.getId(), qmr.getUserId(), qmr.getNickName(), "修改库存", form.getKc(), form.getKcdw(), null); } @Override @Transactional(rollbackFor = Exception.class) - public void cz(CzsjForm form) { + public void cz(CzSjForm form) { SysUser qmr = sysUserService.selectUserById(form.getQmrId()); //验证签名人密码 todo if (form.getId() == null || form.getId() < 0) { throw new SecurityException("参数id不正确"); } - Sjkc sjkc = this.getById(form.getId()); - if (sjkc == null) { + Sjkc sjOld = this.getById(form.getId()); + if (sjOld == null) { throw new SecurityException("试剂不存在或已删除"); } - if (!sjkc.getZjzt().equals(ZjztEnum.rk.getValue())) { - throw new SecurityException("试剂【" + sjkc.getMc() + "】不是入库状态,不能处置"); + 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(sjkc.getKc()); + BigDecimal kc = new BigDecimal(sjOld.getKc()); if(czl.compareTo(kc) > 0) { throw new ServiceException("处置量不应大于库存量"); } kc = kc.subtract(czl); - sjkc.setKc(kc.toString()); - updateById(sjkc); + 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(sjkc.getId()); + sjkcJcgj.setSjkcId(sjOld.getId()); sjkcJcgj.setJcgjlx(JcgjlxEnum.bj.getValue()); sjkcJcgj.setJcmc("处置"); sjkcJcgj.setJcnr(JctUtil.formatStr(jcnrMap)); @@ -139,6 +149,277 @@ public class SjkcServiceImpl extends ServiceImpl implements IS 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/SpeciesServiceImpl.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/SpeciesServiceImpl.java index a25ccd7..9ced125 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/SpeciesServiceImpl.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/SpeciesServiceImpl.java @@ -3,7 +3,6 @@ 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 com.ruoyi.common.utils.DateUtils; import org.springframework.stereotype.Service; import com.hxhq.business.mapper.SpeciesMapper; import com.hxhq.business.domain.Species; diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyFormFillServiceImpl.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyFormFillServiceImpl.java index b7289e6..40f834e 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyFormFillServiceImpl.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyFormFillServiceImpl.java @@ -3,7 +3,6 @@ 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 com.ruoyi.common.utils.DateUtils; import org.springframework.stereotype.Service; import com.hxhq.business.mapper.StudyFormFillMapper; import com.hxhq.business.domain.StudyFormFill; diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyFormPlanServiceImpl.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyFormPlanServiceImpl.java index 9400019..135b9ab 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyFormPlanServiceImpl.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyFormPlanServiceImpl.java @@ -3,7 +3,6 @@ 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 com.ruoyi.common.utils.DateUtils; import org.springframework.stereotype.Service; import com.hxhq.business.mapper.StudyFormPlanMapper; import com.hxhq.business.domain.StudyFormPlan; diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyMethodServiceImpl.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyMethodServiceImpl.java index 32c61f5..273056b 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyMethodServiceImpl.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyMethodServiceImpl.java @@ -3,7 +3,6 @@ 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 com.ruoyi.common.utils.DateUtils; import org.springframework.stereotype.Service; import com.hxhq.business.mapper.StudyMethodMapper; import com.hxhq.business.domain.StudyMethod; diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyRoomServiceImpl.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyRoomServiceImpl.java index 319cdf3..f0be970 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyRoomServiceImpl.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StudyRoomServiceImpl.java @@ -3,7 +3,6 @@ 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 com.ruoyi.common.utils.DateUtils; import org.springframework.stereotype.Service; import com.hxhq.business.mapper.StudyRoomMapper; import com.hxhq.business.domain.StudyRoom; 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 99936d6..14f909a 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 @@ -6,7 +6,9 @@ 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; import com.hxhq.system.api.domain.SysUser; import org.springframework.stereotype.Service; @@ -35,10 +37,18 @@ public class YqJcgjServiceImpl extends ServiceImpl impleme public List queryList(YqJcgj yqJcgj) { LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); - if(yqJcgj.getId() != null) { - queryWrapper.eq(YqJcgj::getYqId, yqJcgj.getId()); + if (yqJcgj.getYqId() == null || yqJcgj.getYqId().longValue() < 0) { + throw new SecurityException("仪器id不能为空"); } - queryWrapper.orderByDesc(MpBaseEntity::getCreateTime); + queryWrapper.eq(YqJcgj::getYqId, yqJcgj.getYqId()); + if (yqJcgj.getJcgjlx() != null && yqJcgj.getJcgjlx().intValue() > 0) { + queryWrapper.eq(YqJcgj::getJcgjlx, yqJcgj.getJcgjlx()); + } + if (StringUtils.isNoneBlank(yqJcgj.getJcmc())) { + queryWrapper.and(p -> p.like(YqJcgj::getJcmc, yqJcgj.getJcmc()) + .or().like(YqJcgj::getJcgjlx, yqJcgj.getJcmc())); + } + queryWrapper.orderByDesc(MpBaseEntity::getId); return this.list(queryWrapper); }