1.代客下单 会员点单 取消点单
This commit is contained in:
parent
b5fc56c0aa
commit
ea86b42847
|
|
@ -180,4 +180,15 @@ public class TbPlaceController {
|
|||
return ResponseEntity.ok(tbShopTableService.pay(payDTO));
|
||||
}
|
||||
|
||||
@AnonymousAccess
|
||||
|
||||
@PutMapping("/updateVip")
|
||||
@Log("代客下单 查询购物车")
|
||||
@ApiOperation("代客下单 查询购物车 /shop/table")
|
||||
public ResponseEntity<Object> updateVip(
|
||||
@Validated @RequestBody UpdateVipDTO updateVipDTO
|
||||
) {
|
||||
return ResponseEntity.ok(tbShopTableService.updateVip(updateVipDTO));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -57,6 +57,7 @@ import org.apache.commons.lang3.StringUtils;
|
|||
import org.springframework.amqp.rabbit.connection.CorrelationData;
|
||||
import org.springframework.amqp.rabbit.core.RabbitTemplate;
|
||||
import org.springframework.data.redis.core.StringRedisTemplate;
|
||||
import org.springframework.security.core.parameters.P;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.data.domain.Page;
|
||||
|
|
@ -891,12 +892,30 @@ public class TbShopTableServiceImpl implements TbShopTableService {
|
|||
.eq(TbCashierCart::getShopId, shopId)
|
||||
.eq(TbCashierCart::getStatus, "refund"));
|
||||
|
||||
ArrayList<Integer> skuIds = new ArrayList<>();
|
||||
tbCashierCarts.forEach(item -> {
|
||||
skuIds.add(Integer.valueOf(item.getSkuId()));
|
||||
});
|
||||
|
||||
List<TbProductSku> skuList = productSkuRepository.findAllById(skuIds);
|
||||
|
||||
HashMap<String, TbProductSku> skuMap = new HashMap<>();
|
||||
skuList.forEach(item -> {
|
||||
skuMap.put(item.getId().toString(), item);
|
||||
});
|
||||
|
||||
|
||||
cashierCartMapper.selectPending(shopId);
|
||||
|
||||
HashMap<String, List<TbCashierCart>> cashierMap = new HashMap<>();
|
||||
HashMap<String, List<Map<String, Object>>> cashierMap = new HashMap<>();
|
||||
for (TbCashierCart tbCashierCart : tbCashierCarts) {
|
||||
List<TbCashierCart> list = cashierMap.computeIfAbsent(tbCashierCart.getOrderId().toString(), k -> new ArrayList<>());
|
||||
list.add(tbCashierCart);
|
||||
TbProductSku productSku = skuMap.get(tbCashierCart.getSkuId());
|
||||
Map<String, Object> map = BeanUtil.beanToMap(tbCashierCart, false, false);
|
||||
map.put("specSnap", productSku == null ? "" : productSku.getSpecSnap());
|
||||
|
||||
List<Map<String, Object>> list = cashierMap.computeIfAbsent(tbCashierCart.getOrderId().toString(), k -> new ArrayList<>());
|
||||
|
||||
list.add(map);
|
||||
}
|
||||
|
||||
pendingCountVOS.forEach(item -> {
|
||||
|
|
@ -981,4 +1000,20 @@ public class TbShopTableServiceImpl implements TbShopTableService {
|
|||
.eq(TbCashierCart::getOrderId, deleteOrderDTO.getOrderId()));
|
||||
return count1 > 0 && count2 > 0 && count3 > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object updateVip(UpdateVipDTO updateVipDTO) {
|
||||
LambdaUpdateWrapper<TbCashierCart> queryWrapper = new LambdaUpdateWrapper<>();
|
||||
queryWrapper.eq(TbCashierCart::getTableId, updateVipDTO.getTableId())
|
||||
.eq(TbCashierCart::getShopId, updateVipDTO.getShopId())
|
||||
.eq(TbCashierCart::getMasterId, updateVipDTO.getMasterId());
|
||||
|
||||
if (updateVipDTO.getType().equals(0)) {
|
||||
queryWrapper.set(TbCashierCart::getUserId, null);
|
||||
queryWrapper.eq(TbCashierCart::getUserId, updateVipDTO.getVipUserId());
|
||||
}else {
|
||||
queryWrapper.set(TbCashierCart::getUserId, updateVipDTO.getVipUserId());
|
||||
}
|
||||
return cashierCartMapper.update(null, queryWrapper);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -121,4 +121,6 @@ public interface TbShopTableService {
|
|||
Object pay(PayDTO payDTO);
|
||||
|
||||
Object deleteOrder(DeleteOrderDTO deleteOrderDTO);
|
||||
|
||||
Object updateVip(UpdateVipDTO updateVipDTO);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue