dev-tmp1
luotaiqian 2026-08-17 10:45:58 +08:00
parent 074d985f73
commit 07929fc533
1 changed files with 20 additions and 5 deletions

View File

@ -37,6 +37,7 @@ import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.*;
import java.util.stream.Collectors;
@ -615,9 +616,6 @@ public class QualFilingChangeExecutor implements QualFilingChangeApi {
Long changeId, QualFilingChangeEntity newEntity, AggregationSaveOrEditQualFilingChangeCmd cmd) {
QualFilingDO filingDO = qualFilingMapper.selectOne(
new LambdaQueryWrapper<QualFilingDO>()
.select(QualFilingDO::getLegalRepresentative,
QualFilingDO::getFulltimeEvaluatorCount,
QualFilingDO::getRegisteredEngineerCount)
.eq(QualFilingDO::getId, cmd.getQualFilingChangeAddCmd().getFilingId()));
if (filingDO == null) {
return Collections.emptyList();
@ -840,7 +838,7 @@ public class QualFilingChangeExecutor implements QualFilingChangeApi {
Objects.toString(newEntity.getRegisteredEngineerCount(), "")));
}
// 工作场所建筑面积(平方米)
if (!Objects.equals(exist.getWorkplaceArea(), newEntity.getWorkplaceArea())) {
if (!bigDecimalEquals(exist.getWorkplaceArea(), newEntity.getWorkplaceArea())) {
details.add(fieldDetail(changeId, QualFilingFormStepEnum.BASIC_INFO, "备案基本信息变更",
"工作场所建筑面积(平方米)",
Objects.toString(exist.getWorkplaceArea(), ""),
@ -982,7 +980,7 @@ public class QualFilingChangeExecutor implements QualFilingChangeApi {
private void diffEquipmentField(List<QualFilingChangeDetailDO> details, Long changeId,
String prefix, String fieldName, Object before, Object after) {
if (!Objects.equals(before, after)) {
if (!valueEquals(before, after)) {
details.add(fieldDetail(changeId, QualFilingFormStepEnum.EQUIPMENT, "装备清单变更",
prefix + "-" + fieldName,
Objects.toString(before, ""),
@ -1057,6 +1055,23 @@ public class QualFilingChangeExecutor implements QualFilingChangeApi {
return list == null ? Collections.emptyList() : list;
}
/**
* BigDecimal scale 1.0 1.00
*/
private boolean bigDecimalEquals(BigDecimal before, BigDecimal after) {
return before != null && after != null && before.compareTo(after) == 0;
}
/**
* BigDecimal compareTo scale Objects.equals
*/
private boolean valueEquals(Object before, Object after) {
if (before instanceof BigDecimal && after instanceof BigDecimal) {
return bigDecimalEquals((BigDecimal) before, (BigDecimal) after);
}
return Objects.equals(before, after);
}
private QualFilingChangeDetailDO stepDetail(Long changeId, QualFilingFormStepEnum step,
String content, String before, String after) {
QualFilingChangeDetailDO detail = new QualFilingChangeDetailDO();