feat:修改updateOrderItemState,queryMyCouponUseByState

This commit is contained in:
lqy 2024-12-14 09:11:28 +08:00
parent 1fe8b15666
commit 4c5568daac
3 changed files with 8 additions and 3 deletions

View file

@ -44,6 +44,7 @@ import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;
import java.util.stream.Stream;
/**
* @ClassName: CouponUseServiceImpl
@ -202,7 +203,11 @@ public class CouponUseServiceImpl extends SkyeyeBusinessServiceImpl<CouponUseDao
// 查询时获取数据
List<CouponUse> list = list(queryWrapper);
couponService.setDataMation(list, CouponUse::getCouponId);
return JSONUtil.toList(JSONUtil.toJsonStr(list), null);
List<CouponUse> collect = list.stream().map(item -> {
item.setUsageCount(item.getUsedCount());
return item;
}).collect(Collectors.toList());
return JSONUtil.toList(JSONUtil.toJsonStr(collect), null);
}
@Override

View file

@ -156,7 +156,7 @@ public class OrderItemServiceImpl extends SkyeyeBusinessServiceImpl<OrderItemDao
@Override
public void UpdateOrderItemState(String orderItemId) {
OrderItem orderItem = selectById(orderItemId);
if (orderItem.getOrderItemState().equals(CommonNumConstants.NUM_TWO)) {
if (orderItem.getOrderItemState()==CommonNumConstants.NUM_TWO) {
throw new CustomException("该订单已收货");
}
UpdateWrapper<OrderItem> updateWrapper = new UpdateWrapper<>();

View file

@ -598,7 +598,7 @@ public class OrderServiceImpl extends SkyeyeBusinessServiceImpl<OrderDao, Order>
boolean allTwo = orderItemList.stream().map(OrderItem::getOrderItemState)
.allMatch(orderItemState -> orderItemState == ShopOrderItemState.FINISHED.getKey());
if (allTwo) {
updateOrderState(orderId, ShopOrderState.COMPLETED.getKey());
updateOrderState(orderId, ShopOrderState.SIGN.getKey());
} else {
updateOrderState(orderId, ShopOrderState.PARTIALLYDONE.getKey());
}