fix: ignore null level prices when updating commodity
This commit is contained in:
@@ -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("请求参数错误,价格格式为空");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user