fix: ignore null level prices when updating commodity

This commit is contained in:
irving
2025-11-08 20:06:15 -05:00
parent eaee5f5aa6
commit 438aef7af7
2 changed files with 38 additions and 1 deletions

View File

@@ -109,9 +109,13 @@ public class PlayCommodityInfoController {
if (!jsonObject.containsKey(playClerkLevelInfoEntity.getId())) {
throw new CustomException("请求参数错误");
}
String rawPrice = jsonObject.getString(playClerkLevelInfoEntity.getId());
if (rawPrice == null || rawPrice.trim().isEmpty()) {
continue;
}
double price = 0.0;
try {
price = Double.parseDouble(jsonObject.getString(playClerkLevelInfoEntity.getId()));
price = Double.parseDouble(rawPrice);
} catch (RuntimeException e) {
throw new CustomException("请求参数错误,价格格式为空");
}