From 401d93b6c7d1fab56cda004fb91a6f88aafb7235 Mon Sep 17 00:00:00 2001 From: memorylkf <312904636@qq.com> Date: Thu, 26 Mar 2026 19:27:55 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20[=E5=A1=AB=E6=8A=A5=E8=A1=A8=E5=8D=95]?= =?UTF-8?q?=20=E5=A2=9E=E5=8A=A0=E6=89=80=E5=B1=9E=E9=83=A8=E9=97=A8?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E3=80=81=E8=AF=95=E5=89=82=E7=9A=84=E9=83=A8?= =?UTF-8?q?=E9=97=A8=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/hxhq/business/domain/StudyFormFill.java | 11 +++++++++++ .../java/com/hxhq/business/domain/Template.java | 12 +++++------- .../java/com/hxhq/business/service/ISjService.java | 9 ++++++--- .../hxhq/business/service/impl/SjServiceImpl.java | 21 +++++++++------------ .../service/impl/StudyFormFillServiceImpl.java | 19 ++++++++++++++++--- .../business/service/impl/TemplateServiceImpl.java | 4 ++-- 6 files changed, 49 insertions(+), 27 deletions(-) diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/StudyFormFill.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/StudyFormFill.java index 48d3c7e..9213999 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/StudyFormFill.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/StudyFormFill.java @@ -27,6 +27,9 @@ public class StudyFormFill extends MpBaseEntity /** 所属试验学科id */ private Long studySubjectId; + /** 所属部门(试验就是学科的部门,非试验和麻精药就是当前人的部门) */ + private Long belongDeptId; + /** 所属试验学科id */ private Long studyFormPreId; @@ -427,6 +430,14 @@ public class StudyFormFill extends MpBaseEntity this.studySubjectId = studySubjectId; } + public Long getBelongDeptId() { + return belongDeptId; + } + + public void setBelongDeptId(Long belongDeptId) { + this.belongDeptId = belongDeptId; + } + public Long getStudyFormPreId() { return studyFormPreId; } diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/Template.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/Template.java index a7888ab..3de9549 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/Template.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/Template.java @@ -32,7 +32,7 @@ public class Template extends MpBaseEntity private String exportMethod; /** 所属部门/学科 */ - private Long deptId; + private String deptId; /** 状态:1:禁用:10:启用 */ private Integer status; @@ -177,14 +177,12 @@ public class Template extends MpBaseEntity return name; } - public void setDeptId(Long deptId) - { - this.deptId = deptId; + public String getDeptId() { + return deptId; } - public Long getDeptId() - { - return deptId; + public void setDeptId(String deptId) { + this.deptId = deptId; } public void setStatus(Integer status) 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 1e0ac3d..90c16b9 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 @@ -27,25 +27,28 @@ public interface ISjService extends IService /** * 开始配置 * @param form + * @param studyFormFill * @return */ - public void startConfiguration(StudyFormConfigurationForm form); + public void startConfiguration(StudyFormConfigurationForm form,StudyFormFill studyFormFill); /** * 配置完成 * @param form + * @param studyFormFill * @return */ - public void configurationCompleted(StudyFormConfigurationForm form); + public void configurationCompleted(StudyFormConfigurationForm form,StudyFormFill studyFormFill); /** * 分装 * @param form + * @param studyFormFill * @return */ - public void subpackage(StudyFormFillSubpackageForm form); + public void subpackage(StudyFormFillSubpackageForm form,StudyFormFill studyFormFill); /** * 查询试剂列表 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 2983bc3..a23a7c0 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 @@ -691,7 +691,7 @@ public class SjServiceImpl extends ServiceImpl implements ISjServi } sj.setStudyId(studyFormFill.getStudyId()); sj.setStudyFormId(studyFormFill.getId()); - sj.setDeptId(template.getDeptId()); + sj.setDeptId(studyFormFill.getBelongDeptId()); sj.setZjzt(ZjztEnum.rk.getValue()); sj.setJyzt(JyztEnum.wjy.getValue()); sj.setMc(studyFormFillResource.getMc()); @@ -771,22 +771,21 @@ public class SjServiceImpl extends ServiceImpl implements ISjServi * @return */ @Override - public void startConfiguration(StudyFormConfigurationForm form) { + public void startConfiguration(StudyFormConfigurationForm form,StudyFormFill studyFormFill) { Sj sj = this.getSjByBh(form.getBh()); - StudySubject studySubject = studySubjectService.getById(form.getStudySubjectId()); if (sj == null) { sj = new Sj(); sj.setBh(form.getBh()); sj.setPzrq(new Date()); sj.setStudyId(form.getStudyId()); sj.setStudyFormId(form.getStudyFormId()); - sj.setDeptId(studySubject.getDeptId()); + sj.setDeptId(studyFormFill.getBelongDeptId()); this.save(sj); } else { sj.setPzrq(new Date()); sj.setStudyId(form.getStudyId()); sj.setStudyFormId(form.getStudyFormId()); - sj.setDeptId(studySubject.getDeptId()); + sj.setDeptId(studyFormFill.getBelongDeptId()); this.updateById(sj); } sjJcgjService.saveJcgj(sj, JcgjlxEnum.lc.getValue(), "开始配置", "Start Configuration", JcmcysEnum.blue.getValue(), null, null); @@ -800,9 +799,8 @@ public class SjServiceImpl extends ServiceImpl implements ISjServi * @return */ @Override - public void configurationCompleted(StudyFormConfigurationForm form) { + public void configurationCompleted(StudyFormConfigurationForm form,StudyFormFill studyFormFill) { Sj sj = this.getSjByBh(form.getBh()); - StudySubject studySubject = studySubjectService.getById(form.getStudySubjectId()); if (sj == null) { sj = new Sj(); @@ -811,7 +809,7 @@ public class SjServiceImpl extends ServiceImpl implements ISjServi sj.setKcdw(form.getKcdw()); sj.setStudyId(form.getStudyId()); sj.setStudyFormId(form.getStudyFormId()); - sj.setDeptId(studySubject.getDeptId()); + sj.setDeptId(studyFormFill.getBelongDeptId()); sj.setNd(form.getNd()); sj.setNddw(form.getNddw()); sj.setZjzt(ZjztEnum.rk.getValue()); @@ -823,7 +821,7 @@ public class SjServiceImpl extends ServiceImpl implements ISjServi sj.setKcdw(form.getKcdw()); sj.setStudyId(form.getStudyId()); sj.setStudyFormId(form.getStudyFormId()); - sj.setDeptId(studySubject.getDeptId()); + sj.setDeptId(studyFormFill.getBelongDeptId()); sj.setNd(form.getNd()); sj.setNddw(form.getNddw()); sj.setZjzt(ZjztEnum.rk.getValue()); @@ -843,7 +841,7 @@ public class SjServiceImpl extends ServiceImpl implements ISjServi * @return */ @Override - public void subpackage(StudyFormFillSubpackageForm form) { + public void subpackage(StudyFormFillSubpackageForm form,StudyFormFill studyFormFill) { Sj sj = this.getSjByBh(form.getBh()); if (sj == null) { sj = new Sj(); @@ -851,7 +849,6 @@ public class SjServiceImpl extends ServiceImpl implements ISjServi this.save(sj); } - StudySubject studySubject = studySubjectService.getById(form.getStudySubjectId()); LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); queryWrapper.eq(Sj::getParentBh, form.getBh()); @@ -869,7 +866,7 @@ public class SjServiceImpl extends ServiceImpl implements ISjServi subpackageSj.setNddw(form.getNddw()); subpackageSj.setStudyId(form.getStudyId()); subpackageSj.setStudyFormId(form.getStudyFormId()); - subpackageSj.setDeptId(studySubject.getDeptId()); + subpackageSj.setDeptId(studyFormFill.getBelongDeptId()); sjList.add(subpackageSj); fz.add(sjSubpackageItemForm.getBh() + "(" + sjSubpackageItemForm.getKc() + sjSubpackageItemForm.getKcdw() + ")"); 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 3728697..ba231bb 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 @@ -117,7 +117,7 @@ public class StudyFormFillServiceImpl extends ServiceImpl formData = new LinkedHashMap<>(); @@ -1187,4 +1192,12 @@ public class StudyFormFillServiceImpl extends ServiceImpl i if(StringUtils.isNoneBlank(template.getName())){ queryWrapper.like("t.name",template.getName()); } - if(template.getDeptId()!=null && template.getDeptId().longValue()>0){ - queryWrapper.eq("t.dept_id",template.getDeptId()); + if(StringUtils.isNoneBlank(template.getDeptId())){ + queryWrapper.and(p -> p.apply("find_in_set( {0},t.dept_id)", template.getDeptId())); } if(template.getStatus()!=null && template.getStatus().intValue()>0){ queryWrapper.eq("t.status",template.getStatus());