mirror of
https://github.com/weizhiqiang1995/erp-pro.git
synced 2025-01-30 11:08:28 +08:00
feat:修改updateOrderItemState,queryMyCouponUseByState
This commit is contained in:
parent
1fe8b15666
commit
4c5568daac
3 changed files with 8 additions and 3 deletions
|
@ -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
|
||||
|
|
|
@ -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<>();
|
||||
|
|
|
@ -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());
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue