|
|
@@ -79,6 +79,11 @@ public class OrderInfoService {
|
|
|
public OrderInfo create(String boxIdStr, Long caseId, String remark, Long userAddressId) {
|
|
|
List<Long> boxIds = Arrays.asList((Long[]) ConvertUtils.convert(boxIdStr.split(","), Long.class));
|
|
|
List<CardBox> cardBoxList = cardBoxRepo.findAllByIdIn(boxIds);
|
|
|
+ cardBoxList.forEach(cardbox -> {
|
|
|
+ if (cardbox.isSold()) {
|
|
|
+ throw new BusinessException("卖完啦,本次选位已被其他用户抢先购买!");
|
|
|
+ }
|
|
|
+ });
|
|
|
User user = SecurityUtils.getAuthenticatedUser();
|
|
|
CardCase cardCase = cardCaseRepo.findById(caseId).orElseThrow(new BusinessException("无信息"));
|
|
|
if (cardCase.isDel()) {
|