refactor(mall): 优化身材数据选择逻辑
- 修改了 ApiClothesServiceImpl 中处理身材数据的逻辑
- 从原来的必须选择身材数据,改为可选字段
- 如果用户未选择身材数据,订单草稿中将不设置身材 ID
| | |
| | | |
| | | Long statureId = ObjectUtil.defaultIfNull(dto.getStatureId(),0L); |
| | | ClothesMemberStature clothesMemberStature = clothesMemberStatureMapper.selectById(statureId); |
| | | if (ObjectUtil.isNull(clothesMemberStature)){ |
| | | throw new FebsException("请选择身材数据"); |
| | | } |
| | | if (ObjectUtil.isNotNull(clothesMemberStature)){ |
| | | clothesOrderDraft.setStatureId(clothesMemberStature.getId()); |
| | | } |
| | | |
| | | clothesOrderDraftMapper.insert(clothesOrderDraft); |
| | | |