From 70de176a1b8a3ee3f8a0c4e67da54448d042cbe2 Mon Sep 17 00:00:00 2001 From: HanLong <404402223@qq.com> Date: Fri, 23 Jan 2026 10:38:44 +0800 Subject: [PATCH] =?UTF-8?q?feat:[=E6=A1=A3=E6=A1=88=E7=AE=A1=E7=90=86][?= =?UTF-8?q?=E8=AF=95=E5=89=82=E6=A1=A3=E6=A1=88=E7=AE=A1=E7=90=86]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hxhq/business/controller/GspController.java | 22 ++- .../com/hxhq/business/controller/SjController.java | 86 ++++++++++ .../src/main/java/com/hxhq/business/domain/Sj.java | 12 ++ .../hxhq/business/form/gsp/GspSearchListForm.java | 11 ++ .../java/com/hxhq/business/service/ISjService.java | 23 +++ .../hxhq/business/service/impl/GspServiceImpl.java | 5 +- .../hxhq/business/service/impl/SjServiceImpl.java | 186 +++++++++++++++++++++ 7 files changed, 340 insertions(+), 5 deletions(-) diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/GspController.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/GspController.java index 382fcc6..dc94561 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/GspController.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/GspController.java @@ -4,10 +4,12 @@ import java.util.List; import com.hxhq.business.domain.*; import com.hxhq.business.dto.gsp.GspListDto; +import com.hxhq.business.enums.zykgl.DaztEnum; import com.hxhq.business.form.gsp.*; import com.hxhq.business.form.gyzj.SearchForm; import com.hxhq.business.service.IGspJcgjService; import com.hxhq.business.service.IGspTzService; +import com.hxhq.common.core.constant.Constants; import com.hxhq.common.security.annotation.RequiresPermissions; import com.hxhq.common.security.utils.SecurityUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -60,6 +62,18 @@ public class GspController extends BaseController { } /** + * 供试品-档案列表 + */ + @GetMapping("/archive/list") + @RequiresPermissions("business:archive:gsp:list") + public TableDataInfo archiveList(GspSearchListForm form) { + startPage(); + form.setArchive(DaztEnum.ygd.getValue()); + List list = gspService.queryList(form); + return getDataTable(list); + } + + /** * 稽查轨迹列表 */ @GetMapping("/jcgjList") @@ -302,7 +316,7 @@ public class GspController extends BaseController { * 同意归档 */ @PostMapping("/gd/agree") - @RequiresPermissions("business:resource:gsp:gd") + @RequiresPermissions("business:archive:gsp:tygd") public AjaxResult agreeGd(@RequestBody @Validated GspGdForm form) { form.setQmrId(SecurityUtils.getUserId()); @@ -314,7 +328,7 @@ public class GspController extends BaseController { * 拒绝归档 */ @PostMapping("/gd/refuse") - @RequiresPermissions("business:resource:gsp:gd") + @RequiresPermissions("business:archive:gsp:jjgd") public AjaxResult refuseGd(@RequestBody @Validated GspGdForm form) { form.setQmrId(SecurityUtils.getUserId()); @@ -326,7 +340,7 @@ public class GspController extends BaseController { * 同意解档 */ @PostMapping("/jd/agree") - @RequiresPermissions("business:resource:gsp:gd") + @RequiresPermissions("business:archive:gsp:tyjd") public AjaxResult agreeJd(@RequestBody @Validated GspGdForm form) { form.setQmrId(SecurityUtils.getUserId()); @@ -338,7 +352,7 @@ public class GspController extends BaseController { * 拒绝解档 */ @PostMapping("/jd/refuse") - @RequiresPermissions("business:resource:gsp:gd") + @RequiresPermissions("business:archive:gsp:jjjd") public AjaxResult refuseJd(@RequestBody @Validated GspGdForm form) { form.setQmrId(SecurityUtils.getUserId()); 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 index 2629daf..4eef006 100644 --- 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 @@ -9,6 +9,8 @@ import com.hxhq.business.dto.gsp.GspListDto; import com.hxhq.business.dto.sj.SjListDto; import com.hxhq.business.enums.zykgl.JyztEnum; import com.hxhq.business.enums.zykgl.ZjztEnum; +import com.hxhq.business.form.gsp.GspGdForm; +import com.hxhq.business.form.gsp.GspJyForm; import com.hxhq.business.form.gsp.GspSearchListForm; import com.hxhq.business.form.mjy.GdForm; import com.hxhq.business.form.sj.*; @@ -290,4 +292,88 @@ public class SjController extends BaseController sjService.gd(form); return AjaxResult.success("操作成功"); } + + /** + * 同意归档 + */ + @PostMapping("/gd/agree") + @RequiresPermissions("business:resource:gsp:gd") + public AjaxResult agreeGd(@RequestBody @Validated GspGdForm form) + { + form.setQmrId(SecurityUtils.getUserId()); + sjService.agreeGd(form); + return AjaxResult.success("操作成功"); + } + + /** + * 拒绝归档 + */ + @PostMapping("/gd/refuse") + @RequiresPermissions("business:resource:gsp:gd") + public AjaxResult refuseGd(@RequestBody @Validated GspGdForm form) + { + form.setQmrId(SecurityUtils.getUserId()); + sjService.refuseGd(form); + return AjaxResult.success("操作成功"); + } + + /** + * 同意解档 + */ + @PostMapping("/jd/agree") + @RequiresPermissions("business:resource:gsp:gd") + public AjaxResult agreeJd(@RequestBody @Validated GspGdForm form) + { + form.setQmrId(SecurityUtils.getUserId()); + sjService.agreeJd(form); + return AjaxResult.success("操作成功"); + } + + /** + * 拒绝解档 + */ + @PostMapping("/jd/refuse") + @RequiresPermissions("business:resource:gsp:gd") + public AjaxResult refuseJd(@RequestBody @Validated GspGdForm form) + { + form.setQmrId(SecurityUtils.getUserId()); + sjService.refuseJd(form); + return AjaxResult.success("操作成功"); + } + + /** + * 同意借阅 + */ + @PostMapping("/jy/agree") + @RequiresPermissions("business:resource:gsp:gd") + public AjaxResult agreeJy(@RequestBody @Validated GspJyForm form) + { + form.setQmrId(SecurityUtils.getUserId()); + sjService.agreeJy(form); + return AjaxResult.success("操作成功"); + } + + /** + * 拒绝借阅 + */ + @PostMapping("/jy/refuse") + @RequiresPermissions("business:resource:gsp:gd") + public AjaxResult refuseJy(@RequestBody @Validated GspJyForm form) + { + form.setQmrId(SecurityUtils.getUserId()); + sjService.refuseJy(form); + return AjaxResult.success("操作成功"); + } + + /** + * 档案确认归还 + */ + @PostMapping("/gh/archive") + @RequiresPermissions("business:resource:gsp:gd") + public AjaxResult archiveGh(@RequestBody @Validated GspGdForm form) + { + form.setQmrId(SecurityUtils.getUserId()); + sjService.archiveGh(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 index 149a6b5..dbd37ad 100644 --- 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 @@ -99,6 +99,18 @@ public class Sj extends MpBaseEntity @JsonFormat(pattern = "yyyy-MM-dd") private Date jyjsrq; + /** 归档申请时间 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date gdsqsj; + + public Date getGdsqsj() { + return gdsqsj; + } + + public void setGdsqsj(Date gdsqsj) { + this.gdsqsj = gdsqsj; + } + public Long getStudyId() { return studyId; } diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/form/gsp/GspSearchListForm.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/form/gsp/GspSearchListForm.java index 53380c0..32c929b 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/form/gsp/GspSearchListForm.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/form/gsp/GspSearchListForm.java @@ -39,6 +39,17 @@ public class GspSearchListForm { /** 试验id */ private Long studyId; + /** 是否是档案 1-是 */ + private Integer archive; + + public Integer getArchive() { + return archive; + } + + public void setArchive(Integer archive) { + this.archive = archive; + } + public String getLy() { return ly; } 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 index 14d16f8..a804a2b 100644 --- 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 @@ -7,6 +7,8 @@ import com.hxhq.business.domain.StudyFormFill; import com.hxhq.business.domain.Template; import com.hxhq.business.dto.gsp.GspListDto; import com.hxhq.business.dto.sj.SjListDto; +import com.hxhq.business.form.gsp.GspGdForm; +import com.hxhq.business.form.gsp.GspJyForm; import com.hxhq.business.form.gsp.GspSearchListForm; import com.hxhq.business.form.mjy.GdForm; import com.hxhq.business.form.sj.*; @@ -75,4 +77,25 @@ public interface ISjService extends IService /** 表单生成试剂逻辑处理 */ void genResource(StudyFormFill studyFormFill, Template template); + + /** 同意归档 */ + void agreeGd(GspGdForm form); + + /** 拒绝归档 */ + void refuseGd(GspGdForm form); + + /** 同意解档 */ + void agreeJd(GspGdForm form); + + /** 拒绝解档 */ + void refuseJd(GspGdForm form); + + /** 同意借阅 */ + void agreeJy(GspJyForm form); + + /** 拒绝借阅 */ + void refuseJy(GspJyForm form); + + /** 档案确认归还 */ + void archiveGh(GspGdForm form); } diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/GspServiceImpl.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/GspServiceImpl.java index 5b7c961..98992d7 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/GspServiceImpl.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/GspServiceImpl.java @@ -81,6 +81,9 @@ public class GspServiceImpl extends ServiceImpl implements IGspS if(form.getZjzt() != null) { queryWrapper.eq(Gsp::getZjzt, form.getZjzt()); } + if(form.getArchive() != null && form.getArchive() == DaztEnum.ygd.getValue()) { + queryWrapper.in(Gsp::getZjzt, ZjztEnum.dgd.getValue(), ZjztEnum.gd.getValue(), ZjztEnum.djd.getValue()); + } return this.list(queryWrapper); } @@ -1159,7 +1162,7 @@ public class GspServiceImpl extends ServiceImpl implements IGspS if (gsp == null) { throw new SecurityException("供试品不存在或已删除"); } - if (!gsp.getZjzt().equals(ZjztEnum.gd.getValue())) { + if (!gsp.getZjzt().equals(ZjztEnum.djd.getValue())) { throw new SecurityException("供试品【" + gsp.getMc() + "】不是待解档状态,不能操作"); } gsp.setDasqrMc(gsp.getDasqrMcOld()); 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 index b64c96a..195e82e 100644 --- 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 @@ -18,6 +18,8 @@ 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.gsp.GspGdForm; +import com.hxhq.business.form.gsp.GspJyForm; import com.hxhq.business.form.gsp.GspSearchListForm; import com.hxhq.business.form.mjy.GdForm; import com.hxhq.business.form.sj.*; @@ -761,4 +763,188 @@ public class SjServiceImpl extends ServiceImpl implements ISjServi } + @Override + public void agreeGd(GspGdForm form) { + SysUser qmr = sysUserService.selectUserById(form.getQmrId()); + sysUserService.checkPassword(qmr, form.getQmrmm(), false); + 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.dgd.getValue())) { + throw new SecurityException("试剂【" + sj.getMc() + "】不是待归档状态,不能操作"); + } + sj.setZjzt(ZjztEnum.gd.getValue()); + this.updateById(sj); + //稽查轨迹 + Map formData = new LinkedHashMap<>(); + formData.put("备注", form.getRemark()); + + Map formDataEn = new LinkedHashMap<>(); + formDataEn.put("Comment", form.getRemark()); + sjJcgjService.saveJcgj(sj.getId(), JcgjlxEnum.lc.getValue(), "同意归档", "Approve Archiving", + JcmcysEnum.green.getValue(), JctUtil.formatStr(formData), JctUtil.formatStr(formDataEn)); + } + + @Override + public void refuseGd(GspGdForm form) { + SysUser qmr = sysUserService.selectUserById(form.getQmrId()); + sysUserService.checkPassword(qmr, form.getQmrmm(), false); + 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.dgd.getValue())) { + throw new SecurityException("试剂【" + sj.getMc() + "】不是待归档状态,不能操作"); + } + sj.setZjzt(ZjztEnum.ysd.getValue()); + this.updateById(sj); + //稽查轨迹 + Map formData = new LinkedHashMap<>(); + formData.put("备注", form.getRemark()); + + Map formDataEn = new LinkedHashMap<>(); + formDataEn.put("Comment", form.getRemark()); + sjJcgjService.saveJcgj(sj.getId(), JcgjlxEnum.lc.getValue(), "拒绝归档", "Reject Archiving", + JcmcysEnum.green.getValue(), JctUtil.formatStr(formData), JctUtil.formatStr(formDataEn)); + } + + @Override + public void agreeJd(GspGdForm form) { + SysUser qmr = sysUserService.selectUserById(form.getQmrId()); + sysUserService.checkPassword(qmr, form.getQmrmm(), false); + 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.djd.getValue())) { + throw new SecurityException("试剂【" + sj.getMc() + "】不是待解档状态,不能操作"); + } + sj.setZjzt(ZjztEnum.ysd.getValue()); + this.updateById(sj); + //稽查轨迹 + Map formData = new LinkedHashMap<>(); + formData.put("备注", form.getRemark()); + + Map formDataEn = new LinkedHashMap<>(); + formDataEn.put("Comment", form.getRemark()); + sjJcgjService.saveJcgj(sj.getId(), JcgjlxEnum.lc.getValue(), "同意解档", "Approve De-archiving", + JcmcysEnum.green.getValue(), JctUtil.formatStr(formData), JctUtil.formatStr(formDataEn)); + } + + @Override + public void refuseJd(GspGdForm form) { + SysUser qmr = sysUserService.selectUserById(form.getQmrId()); + sysUserService.checkPassword(qmr, form.getQmrmm(), false); + 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.djd.getValue())) { + throw new SecurityException("试剂【" + sj.getMc() + "】不是待解档状态,不能操作"); + } + sj.setZjzt(ZjztEnum.gd.getValue()); + this.updateById(sj); + //稽查轨迹 + Map formData = new LinkedHashMap<>(); + formData.put("备注", form.getRemark()); + + Map formDataEn = new LinkedHashMap<>(); + formDataEn.put("Comment", form.getRemark()); + sjJcgjService.saveJcgj(sj.getId(), JcgjlxEnum.lc.getValue(), "拒绝解档", "Reject De-archiving", + JcmcysEnum.green.getValue(), JctUtil.formatStr(formData), JctUtil.formatStr(formDataEn)); + } + + @Override + public void agreeJy(GspJyForm form) { + SysUser qmr = sysUserService.selectUserById(form.getQmrId()); + sysUserService.checkPassword(qmr, form.getQmrmm(), false); + 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.getJyzt().equals(JyztEnum.djy.getValue())) { + throw new SecurityException("试剂【" + sj.getMc() + "】不是待借阅状态,不能操作"); + } + sj.setJyzt(JyztEnum.jyz.getValue()); + sj.setJyksrq(form.getStartDate()); + sj.setJyjsrq(form.getEndDate()); + this.updateById(sj); + //稽查轨迹 + Map formData = new LinkedHashMap<>(); + formData.put("备注", form.getRemark()); + + Map formDataEn = new LinkedHashMap<>(); + formDataEn.put("Comment", form.getRemark()); + sjJcgjService.saveJcgj(sj.getId(), JcgjlxEnum.lc.getValue(), "同意借阅", "Approve Check-out", + JcmcysEnum.green.getValue(), JctUtil.formatStr(formData), JctUtil.formatStr(formDataEn)); + } + + @Override + public void refuseJy(GspJyForm form) { + SysUser qmr = sysUserService.selectUserById(form.getQmrId()); + sysUserService.checkPassword(qmr, form.getQmrmm(), false); + 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.getJyzt().equals(JyztEnum.djy.getValue())) { + throw new SecurityException("试剂【" + sj.getMc() + "】不是待借阅状态,不能操作"); + } + sj.setJyzt(JyztEnum.wjy.getValue()); + this.updateById(sj); + //稽查轨迹 + Map formData = new LinkedHashMap<>(); + formData.put("备注", form.getRemark()); + + Map formDataEn = new LinkedHashMap<>(); + formDataEn.put("Comment", form.getRemark()); + sjJcgjService.saveJcgj(sj.getId(), JcgjlxEnum.lc.getValue(), "拒绝借阅", "Reject Check-out", + JcmcysEnum.green.getValue(), JctUtil.formatStr(formData), JctUtil.formatStr(formDataEn)); + } + + @Override + public void archiveGh(GspGdForm form) { + SysUser qmr = sysUserService.selectUserById(form.getQmrId()); + sysUserService.checkPassword(qmr, form.getQmrmm(), false); + 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.getJyzt().equals(JyztEnum.jyz.getValue())) { + throw new SecurityException("试剂【" + sj.getMc() + "】不是借阅中状态,不能操作"); + } + sj.setJyzt(JyztEnum.wjy.getValue()); + this.updateById(sj); + //稽查轨迹 + Map formData = new LinkedHashMap<>(); + formData.put("备注", form.getRemark()); + + Map formDataEn = new LinkedHashMap<>(); + formDataEn.put("Comment", form.getRemark()); + sjJcgjService.saveJcgj(sj.getId(), JcgjlxEnum.lc.getValue(), "确认归还", "Check-out End Confirmation", + JcmcysEnum.green.getValue(), JctUtil.formatStr(formData), JctUtil.formatStr(formDataEn)); + } + }