From 9a440727f905554ce402afa939ec156651afd245 Mon Sep 17 00:00:00 2001 From: dinggang <2498628697@qq.com> Date: Tue, 22 Nov 2022 17:55:23 +0800 Subject: [PATCH] npe --- .../common/controller/AbilityCenterControllerV2.java | 6 +++++- .../common/controller/AbilityCenterControllerV3.java | 8 +++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/renren-admin/src/main/java/io/renren/common/controller/AbilityCenterControllerV2.java b/renren-admin/src/main/java/io/renren/common/controller/AbilityCenterControllerV2.java index e5f75920..607b2e1d 100644 --- a/renren-admin/src/main/java/io/renren/common/controller/AbilityCenterControllerV2.java +++ b/renren-admin/src/main/java/io/renren/common/controller/AbilityCenterControllerV2.java @@ -195,7 +195,11 @@ public class AbilityCenterControllerV2 { tAbilityApplicationDTO.setUserId(abilityBatchApplicationDTO.getUserId()); tAbilityApplicationDTO.setApproveStatus("审核中"); tAbilityApplicationDTO.setDelFlag(0); - tAbilityApplicationDTO.setApplyPrice(BigDecimal.valueOf(Long.valueOf(index.get("price")))); + if (StringUtils.isNotBlank(index.get("price"))) { + tAbilityApplicationDTO.setApplyPrice(BigDecimal.valueOf(Long.valueOf(index.get("price")))); + } else { + tAbilityApplicationDTO.setApplyPrice(BigDecimal.ZERO); + } // v2 新增字段 tAbilityApplicationDTO.setCameraList(index.get("channelId") == null ? null : JSON.toJSONString(index)); tAbilityApplicationDTO.setTitle(abilityBatchApplicationDTO.getTitle()); diff --git a/renren-admin/src/main/java/io/renren/common/controller/AbilityCenterControllerV3.java b/renren-admin/src/main/java/io/renren/common/controller/AbilityCenterControllerV3.java index c4891047..89810e65 100644 --- a/renren-admin/src/main/java/io/renren/common/controller/AbilityCenterControllerV3.java +++ b/renren-admin/src/main/java/io/renren/common/controller/AbilityCenterControllerV3.java @@ -1,6 +1,5 @@ package io.renren.common.controller; - import cn.hutool.core.util.ObjectUtil; import com.alibaba.fastjson.JSON; import io.renren.common.annotation.LogOperation; @@ -257,8 +256,11 @@ public class AbilityCenterControllerV3 { tAbilityApplicationDTO.setUserId(abilityBatchApplicationDTO.getUserId()); tAbilityApplicationDTO.setApproveStatus("审核中"); tAbilityApplicationDTO.setDelFlag(0); - tAbilityApplicationDTO.setApplyPrice(BigDecimal.valueOf(Long.valueOf(index.get("price")))); - // v2 新增字段 + if (StringUtils.isNotBlank(index.get("price"))) { + tAbilityApplicationDTO.setApplyPrice(BigDecimal.valueOf(Long.valueOf(index.get("price")))); + } else { + tAbilityApplicationDTO.setApplyPrice(BigDecimal.ZERO); + } // v2 新增字段 tAbilityApplicationDTO.setCameraList(index.get("channelId") == null ? null : JSON.toJSONString(index)); tAbilityApplicationDTO.setTitle(abilityBatchApplicationDTO.getTitle()); tAbilityApplicationDTO.setApplicationBackground(abilityBatchApplicationDTO.getApplicationBackground());