| | |
| | | orderItem.setMemberId(memberId); |
| | | orderItem.setOrderId(orderId); |
| | | orderItem.setType(item.getType()); |
| | | orderItem.setItemCnt(dto.getCnt()); |
| | | if (ClothesOrderItemEnum.CLOTH.getCode() == item.getType()) { |
| | | ClothesCloth cloth = clothesClothMapper.selectById(item.getSkuId()); |
| | | if (ObjectUtil.isNull(cloth)) { |
| | | throw new FebsException("请选择布料"); |
| | | } |
| | | orderItem.setItemId(cloth.getId()); |
| | | orderItem.setName(cloth.getName()); |
| | | orderItem.setPrice(cloth.getPrice()); |
| | | orderItem.setItemCnt(item.getCnt()); |
| | | orderItem.setAmount(cloth.getPrice().multiply(new BigDecimal(item.getCnt())).setScale(2, RoundingMode.DOWN)); |
| | | orderItem.setAmount(cloth.getPrice().multiply(new BigDecimal(orderItem.getItemCnt())).setScale(2, RoundingMode.DOWN)); |
| | | clothesOrderItemMapper.insert(orderItem); |
| | | |
| | | total = total.add(orderItem.getAmount()); |
| | |
| | | if (ObjectUtil.isNull(size)) { |
| | | throw new FebsException("请选择尺寸"); |
| | | } |
| | | orderItem.setItemId(size.getId()); |
| | | orderItem.setName(size.getName()); |
| | | orderItem.setPrice(size.getPrice()); |
| | | orderItem.setItemCnt(item.getCnt()); |
| | |
| | | if (ObjectUtil.isNull(location)) { |
| | | throw new FebsException("请选择图案位置"); |
| | | } |
| | | orderItem.setItemId(location.getId()); |
| | | orderItem.setName(location.getName()); |
| | | orderItem.setPrice(location.getPrice()); |
| | | orderItem.setItemCnt(item.getCnt()); |
| | |
| | | if (ObjectUtil.isNull(pattern)) { |
| | | throw new FebsException("请选择图案"); |
| | | } |
| | | orderItem.setItemId(pattern.getId()); |
| | | orderItem.setRemark(item.getPatternRemark()); |
| | | orderItem.setName(pattern.getName()); |
| | | orderItem.setPrice(pattern.getPrice()); |
| | |
| | | if (ObjectUtil.isNull(art)) { |
| | | throw new FebsException("请选择工艺"); |
| | | } |
| | | orderItem.setItemId(art.getId()); |
| | | orderItem.setName(art.getName()); |
| | | orderItem.setPrice(art.getPrice()); |
| | | orderItem.setItemCnt(item.getCnt()); |
| | |
| | | continue; |
| | | } else if (ClothesOrderItemEnum.CUSTOMIZE.getCode() == item.getType()) { |
| | | ClothesMemberStature clothesMemberStature = clothesMemberStatureMapper.selectById(item.getSkuId()); |
| | | orderItem.setItemId(clothesMemberStature.getId()); |
| | | orderItem.setName(clothesMemberStature.getName()); |
| | | orderItem.setPrice(BigDecimal.ZERO); |
| | | orderItem.setItemCnt(item.getCnt()); |