From 300efbd0b73c51310f339ef9a9a2d28e9ebca3ab Mon Sep 17 00:00:00 2001 From: LiWeiJie <3491909454@qq.com> Date: Tue, 9 Jan 2024 17:09:02 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=88=E6=A0=BC=E7=8E=87=E7=A9=BA=E6=8C=87?= =?UTF-8?q?=E9=92=88=E5=BC=82=E5=B8=B8,=E5=B7=B2=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/QcfgjComprehensiveQualityStatisticsServiceImpl.java | 5 +++-- .../impl/QcfgjQualificationRateStatisticsServiceImpl.java | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/God-Vue-master/god-system/src/main/java/com/god/qcfgjIndustrialVision/service/impl/QcfgjComprehensiveQualityStatisticsServiceImpl.java b/God-Vue-master/god-system/src/main/java/com/god/qcfgjIndustrialVision/service/impl/QcfgjComprehensiveQualityStatisticsServiceImpl.java index 50cc519e..60a96375 100644 --- a/God-Vue-master/god-system/src/main/java/com/god/qcfgjIndustrialVision/service/impl/QcfgjComprehensiveQualityStatisticsServiceImpl.java +++ b/God-Vue-master/god-system/src/main/java/com/god/qcfgjIndustrialVision/service/impl/QcfgjComprehensiveQualityStatisticsServiceImpl.java @@ -1,5 +1,6 @@ package com.god.qcfgjIndustrialVision.service.impl; +import com.god.common.utils.StringUtils; import com.god.common.utils.uuid.IdUtils; import com.god.qcfgjIndustrialVision.domain.QcfgjComprehensiveQualityStatistics; import com.god.qcfgjIndustrialVision.domain.QcfgjQualificationRateStatistics; @@ -54,8 +55,8 @@ public class QcfgjComprehensiveQualityStatisticsServiceImpl implements IQcfgjCom @Override public int insertQcfgjComprehensiveQualityStatistics(QcfgjComprehensiveQualityStatistics qcfgjComprehensiveQualityStatistics) { - qcfgjComprehensiveQualityStatistics=computePassRate(qcfgjComprehensiveQualityStatistics); qcfgjComprehensiveQualityStatistics.setId(IdUtils.fastSimpleUUID()); + qcfgjComprehensiveQualityStatistics=computePassRate(qcfgjComprehensiveQualityStatistics); return qcfgjComprehensiveQualityStatisticsMapper.insertQcfgjComprehensiveQualityStatistics(qcfgjComprehensiveQualityStatistics); } @@ -79,7 +80,7 @@ public class QcfgjComprehensiveQualityStatisticsServiceImpl implements IQcfgjCom */ private QcfgjComprehensiveQualityStatistics computePassRate(QcfgjComprehensiveQualityStatistics qcfgjComprehensiveQualityStatistics){ //用于自动填充合格率,并且保存2位小数 - if (!qcfgjComprehensiveQualityStatistics.getTotalTestCount().isEmpty() && !qcfgjComprehensiveQualityStatistics.getUnqualifiedQuantity().isEmpty()){ + if (!StringUtils.isEmpty(qcfgjComprehensiveQualityStatistics.getTotalTestCount()) && !StringUtils.isEmpty(qcfgjComprehensiveQualityStatistics.getUnqualifiedQuantity())){ Double totalTestCount = new Double(qcfgjComprehensiveQualityStatistics.getTotalTestCount()); Double unqualifiedQuantity = new Double(qcfgjComprehensiveQualityStatistics.getUnqualifiedQuantity()); double QualifiedRate = (totalTestCount-unqualifiedQuantity) / totalTestCount * 100; diff --git a/God-Vue-master/god-system/src/main/java/com/god/qcfgjIndustrialVision/service/impl/QcfgjQualificationRateStatisticsServiceImpl.java b/God-Vue-master/god-system/src/main/java/com/god/qcfgjIndustrialVision/service/impl/QcfgjQualificationRateStatisticsServiceImpl.java index b7471605..e8689783 100644 --- a/God-Vue-master/god-system/src/main/java/com/god/qcfgjIndustrialVision/service/impl/QcfgjQualificationRateStatisticsServiceImpl.java +++ b/God-Vue-master/god-system/src/main/java/com/god/qcfgjIndustrialVision/service/impl/QcfgjQualificationRateStatisticsServiceImpl.java @@ -1,5 +1,6 @@ package com.god.qcfgjIndustrialVision.service.impl; +import com.god.common.utils.StringUtils; import com.god.common.utils.uuid.IdUtils; import com.god.qcfgjIndustrialVision.domain.QcfgjQualificationRateStatistics; import com.god.qcfgjIndustrialVision.mapper.QcfgjQualificationRateStatisticsMapper; @@ -53,8 +54,8 @@ public class QcfgjQualificationRateStatisticsServiceImpl implements IQcfgjQualif @Override public int insertQcfgjQualificationRateStatistics(QcfgjQualificationRateStatistics qcfgjQualificationRateStatistics) { - qcfgjQualificationRateStatistics=computePassRate(qcfgjQualificationRateStatistics); qcfgjQualificationRateStatistics.setId(IdUtils.fastSimpleUUID()); + qcfgjQualificationRateStatistics=computePassRate(qcfgjQualificationRateStatistics); return qcfgjQualificationRateStatisticsMapper.insertQcfgjQualificationRateStatistics(qcfgjQualificationRateStatistics); } @@ -78,7 +79,7 @@ public class QcfgjQualificationRateStatisticsServiceImpl implements IQcfgjQualif */ private QcfgjQualificationRateStatistics computePassRate(QcfgjQualificationRateStatistics qcfgjQualificationRateStatistics){ //用于自动填充合格率,并且保存2位小数 - if (!qcfgjQualificationRateStatistics.getInspectionQuantity().isEmpty() && !qcfgjQualificationRateStatistics.getUnqualifiedQuantity().isEmpty()){ + if (!StringUtils.isEmpty(qcfgjQualificationRateStatistics.getInspectionQuantity()) && !StringUtils.isEmpty(qcfgjQualificationRateStatistics.getUnqualifiedQuantity())){ Double inspectionQuantity = new Double(qcfgjQualificationRateStatistics.getInspectionQuantity()); Double unqualifiedQuantity = new Double(qcfgjQualificationRateStatistics.getUnqualifiedQuantity()); double QualifiedRate = (inspectionQuantity-unqualifiedQuantity) / inspectionQuantity * 100;