From 55f3cccf7477e3968a83950f4f821cfa2e8e066b Mon Sep 17 00:00:00 2001 From: HanLong <404402223@qq.com> Date: Wed, 28 Jan 2026 15:54:23 +0800 Subject: [PATCH] =?UTF-8?q?fix:[=E8=AF=95=E9=AA=8C=E7=AE=A1=E7=90=86][?= =?UTF-8?q?=E8=AF=95=E5=89=82=E7=94=9F=E6=88=90]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/hxhq/business/controller/SjController.java | 14 ++++++++++++++ .../com/hxhq/business/dto/study/StudyFormFillResource.java | 6 +++--- .../java/com/hxhq/business/form/sj/SjSubpackageForm.java | 11 +++++++++++ .../java/com/hxhq/business/service/impl/SjServiceImpl.java | 5 ++++- 4 files changed, 32 insertions(+), 4 deletions(-) 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 d7e12f0..e6d9202 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 @@ -4,6 +4,7 @@ import java.util.ArrayList; import java.util.Date; import java.util.List; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.hxhq.business.domain.*; import com.hxhq.business.dto.gsp.GspListDto; import com.hxhq.business.dto.sj.SjListDto; @@ -58,10 +59,17 @@ public class SjController extends BaseController Sj sj = sjService.getSjByBh(form.getBh()); if(sj == null) { sj = new Sj(); + sj.setBh(form.getBh()); sj.setPzrq(new Date()); + sj.setStudyId(form.getStudyId()); + sj.setStudyFormId(form.getStudyFormId()); + sj.setDeptId(form.getDeptId()); sjService.save(sj); } else { sj.setPzrq(new Date()); + sj.setStudyId(form.getStudyId()); + sj.setStudyFormId(form.getStudyFormId()); + sj.setDeptId(form.getDeptId()); sjService.updateById(sj); } @@ -83,6 +91,7 @@ public class SjController extends BaseController sj.setKcdw(form.getKcdw()); sj.setStudyId(form.getStudyId()); sj.setStudyFormId(form.getStudyFormId()); + sj.setDeptId(form.getDeptId()); sj.setNd(form.getNd()); sj.setNddw(form.getNddw()); sj.setZjzt(ZjztEnum.rk.getValue()); @@ -94,6 +103,7 @@ public class SjController extends BaseController sj.setKcdw(form.getKcdw()); sj.setStudyId(form.getStudyId()); sj.setStudyFormId(form.getStudyFormId()); + sj.setDeptId(form.getDeptId()); sj.setNd(form.getNd()); sj.setNddw(form.getNddw()); sj.setZjzt(ZjztEnum.rk.getValue()); @@ -111,6 +121,9 @@ public class SjController extends BaseController */ @PostMapping("/subpackage") public AjaxResult subpackage(@RequestBody SjSubpackageForm form) { + /*LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(Sj::getParentBh, form.getBh()); + sjService.remove(queryWrapper);*/ List list = form.getList(); List sjList = new ArrayList<>(); for (SjSubpackageForm.SjSubpackageItemForm sjSubpackageItemForm : list) { @@ -121,6 +134,7 @@ public class SjController extends BaseController sj.setKcdw(sjSubpackageItemForm.getKcdw()); sj.setStudyId(form.getStudyId()); sj.setStudyFormId(form.getStudyFormId()); + sj.setDeptId(form.getDeptId()); sjList.add(sj); } sjService.saveBatch(sjList); diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/dto/study/StudyFormFillResource.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/dto/study/StudyFormFillResource.java index afbd06d..1019e97 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/dto/study/StudyFormFillResource.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/dto/study/StudyFormFillResource.java @@ -30,7 +30,7 @@ public class StudyFormFillResource { private String sxrq; private int ndz; private String nddw; - private int kc; + private String kc; private String kcdw; private String syl; private String syldw; @@ -108,11 +108,11 @@ public class StudyFormFillResource { this.nddw = nddw; } - public int getKc() { + public String getKc() { return kc; } - public void setKc(int kc) { + public void setKc(String kc) { this.kc = kc; } diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/form/sj/SjSubpackageForm.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/form/sj/SjSubpackageForm.java index cf8607b..78cd86a 100644 --- a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/form/sj/SjSubpackageForm.java +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/form/sj/SjSubpackageForm.java @@ -10,6 +10,9 @@ public class SjSubpackageForm { /** 试验表单id */ private Long studyFormId; + /** 部门id */ + private Long deptId; + /** 母液编号 */ private String bh; @@ -101,4 +104,12 @@ public class SjSubpackageForm { public void setNddw(String nddw) { this.nddw = nddw; } + + public Long getDeptId() { + return deptId; + } + + public void setDeptId(Long deptId) { + this.deptId = deptId; + } } 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 e3e9885..f37d7bf 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 @@ -640,6 +640,8 @@ public class SjServiceImpl extends ServiceImpl implements ISjServi Long studyId = studyFormFill.getStudyId(); Long studyFormId = studyFormFill.getId(); + Long studySubjectId = studyFormFill.getStudySubjectId(); + // 生成/使用 String resource = studyFormFill.getResource(); Map sjMap = new HashMap<>(); @@ -663,6 +665,7 @@ public class SjServiceImpl extends ServiceImpl implements ISjServi sj = new Sj(); sj.setStudyId(studyId); sj.setStudyFormId(studyFormId); + sj.setDeptId(studySubjectId); sj.setZjzt(ZjztEnum.rk.getValue()); sj.setJyzt(JyztEnum.wjy.getValue()); sj.setDeptId(template.getDeptId()); @@ -671,7 +674,7 @@ public class SjServiceImpl extends ServiceImpl implements ISjServi sj.setBh(studyFormFillResource.getBh()); sj.setNd(String.valueOf(studyFormFillResource.getNdz())); sj.setNddw(studyFormFillResource.getNddw()); - sj.setKc(String.valueOf(studyFormFillResource.getKc())); + sj.setKc(studyFormFillResource.getKc()); sj.setKcdw(studyFormFillResource.getKcdw()); sj.setLy(studyFormFillResource.getSource()); sj.setSxr(DateUtils.parseDate(studyFormFillResource.getSxrq()));