Browse Source

更新表单允许重新修改获取目标并保存

陈长荣 5 months ago
parent
commit
f6c3920fc2

+ 4 - 2
jfcloud-gene-biz/src/main/java/com/github/jfcloud/gene/form/service/impl/StrainCustomInfoServiceImpl.java

@@ -1,7 +1,6 @@
 package com.github.jfcloud.gene.form.service.impl;
 
 import cn.hutool.core.bean.BeanUtil;
-import cn.hutool.core.lang.Assert;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.github.jfcloud.gene.common.constant.WhetherEnum;
@@ -53,7 +52,10 @@ public class StrainCustomInfoServiceImpl extends ServiceImpl<StrainCustomInfoMap
         StrainCustomInfo info = getOne(new LambdaQueryWrapper<>(StrainCustomInfo.class)
                 .eq(StrainCustomInfo::getFlowId, vo.getFlowId())
                 .eq(StrainCustomInfo::getDeleted, WhetherEnum.NO.getCode()));
-        Assert.notNull(info, "品系定制不存在");
+        if (info == null) {
+            saveForm(vo);
+            return;
+        }
 
         BeanUtil.copyProperties(vo, info);
         info.updateById();

+ 6 - 2
jfcloud-gene-biz/src/main/java/com/github/jfcloud/gene/form/service/impl/StrainPurificationInfoServiceImpl.java

@@ -1,7 +1,6 @@
 package com.github.jfcloud.gene.form.service.impl;
 
 import cn.hutool.core.bean.BeanUtil;
-import cn.hutool.core.lang.Assert;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.github.jfcloud.gene.common.constant.WhetherEnum;
@@ -73,6 +72,7 @@ public class StrainPurificationInfoServiceImpl extends ServiceImpl<StrainPurific
             animalDemandService.saveBatch(cageDemandList);
         }
 
+
         //保存附件
         if (!vo.getTestingFiles().isEmpty()) {
             List<FileInfo> fileList = vo.getTestingFiles().stream()
@@ -91,7 +91,11 @@ public class StrainPurificationInfoServiceImpl extends ServiceImpl<StrainPurific
         StrainPurificationInfo info = getOne(new LambdaQueryWrapper<>(StrainPurificationInfo.class)
                 .eq(StrainPurificationInfo::getFlowId, vo.getFlowId())
                 .eq(StrainPurificationInfo::getDeleted, WhetherEnum.NO.getCode()));
-        Assert.notNull(info, "品系净化扩繁不存在");
+
+        if (info == null) {
+            saveForm(vo);
+            return;
+        }
 
         BeanUtil.copyProperties(vo, info);
         info.updateById();

+ 3 - 3
jfcloud-gene-biz/src/main/resources/ftlTemplate/geneCustom.ftl

@@ -928,7 +928,7 @@
                                             <w:color w:val="000000"/>
                                             <w:kern w:val="0"/>
                                         </w:rPr>
-                                        <#if custom.animalStrainCustom?contains('基因工程动物')>
+                                        <#if custom.animalStrainCustom?? && custom.animalStrainCustom?contains('基因工程动物')>
                                         <w:sym w:font="Wingdings 2" w:char="F052"/>
                                         <#else >
                                         <w:sym w:font="Wingdings 2" w:char="F0A3"/>
@@ -948,7 +948,7 @@
 											<w:color w:val="000000"/>
 
 										</w:rPr>
-                                        <#if custom.animalStrainCustom?contains('打靶载体')>
+                                        <#if custom.animalStrainCustom?? && custom.animalStrainCustom?contains('打靶载体')>
                                             <w:sym w:font="Wingdings 2" w:char="F052"/>
                                         <#else >
                                             <w:sym w:font="Wingdings 2" w:char="F0A3"/>
@@ -969,7 +969,7 @@
 
 											<w:szCs w:val="28"/>
 										</w:rPr>
-                                        <#if custom.animalStrainCustom?contains('基因工程细胞')>
+                                        <#if custom.animalStrainCustom?? && custom.animalStrainCustom?contains('基因工程细胞')>
                                             <w:sym w:font="Wingdings 2" w:char="F052"/>
                                         <#else >
                                             <w:sym w:font="Wingdings 2" w:char="F0A3"/>