Bläddra i källkod

试验基础信息保存非空判断

lvy 1 månad sedan
förälder
incheckning
384cffe2b1

+ 8 - 6
blade-service/blade-business/src/main/java/org/springblade/business/service/impl/TrialSelfInspectionRecordServiceImpl.java

@@ -2135,12 +2135,14 @@ public class TrialSelfInspectionRecordServiceImpl extends BaseServiceImpl<TrialS
             String specificationModel = org.apache.commons.lang.StringUtils.join(specificationModels, "、");
 
             //更新
-            this.update(Wrappers.<TrialSelfInspectionRecord>lambdaUpdate()
-                    .set(samplingLocation != null && !samplingLocation.isEmpty(), TrialSelfInspectionRecord::getSamplingLocation, samplingLocation)
-                    .set(calculationUnit != null && !calculationUnit.isEmpty(),TrialSelfInspectionRecord::getCompany, calculationUnit)
-                    .set(specificationNumber != null && !specificationNumber.isEmpty(),TrialSelfInspectionRecord::getSpecificationNumber, specificationNumber)
-                    .set(specificationModel != null && !specificationModel.isEmpty(),TrialSelfInspectionRecord::getSpecificationModel, specificationModel)
-                    .eq(TrialSelfInspectionRecord::getId, record.getId()));
+            if (StringUtils.isNotBlank(samplingLocation) || StringUtils.isNotBlank(calculationUnit) || StringUtils.isNotBlank(specificationNumber) || StringUtils.isNotBlank(specificationModel)) {
+                this.update(Wrappers.<TrialSelfInspectionRecord>lambdaUpdate()
+                        .set(StringUtils.isNotBlank(samplingLocation), TrialSelfInspectionRecord::getSamplingLocation, samplingLocation)
+                        .set(StringUtils.isNotBlank(calculationUnit),TrialSelfInspectionRecord::getCompany, calculationUnit)
+                        .set(StringUtils.isNotBlank(specificationNumber),TrialSelfInspectionRecord::getSpecificationNumber, specificationNumber)
+                        .set(StringUtils.isNotBlank(specificationModel),TrialSelfInspectionRecord::getSpecificationModel, specificationModel)
+                        .eq(TrialSelfInspectionRecord::getId, record.getId()));
+            }
         }
         // ---- 修改样品单号信息 --------
         if(Func.isNotEmpty(dto.getEntrustId())){