调整购物车相关接口
This commit is contained in:
parent
4ea49f82bb
commit
19f64a6b35
@ -23,12 +23,6 @@ import java.util.List;
|
|||||||
@ApiModel(value = "商城预订单对象")
|
@ApiModel(value = "商城预订单对象")
|
||||||
public class AdvanceOrderBo implements Serializable {
|
public class AdvanceOrderBo implements Serializable {
|
||||||
|
|
||||||
/**
|
|
||||||
* 主键
|
|
||||||
*/
|
|
||||||
@ApiModelProperty("主键")
|
|
||||||
private String id;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 总金额
|
* 总金额
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -80,7 +80,7 @@ public class MiniProductController {
|
|||||||
* @param storeIds 校区id列表
|
* @param storeIds 校区id列表
|
||||||
* @return: com.cpop.core.base.R<java.util.List<com.cpop.mall.business.vo.StoreListVo>>
|
* @return: com.cpop.core.base.R<java.util.List<com.cpop.mall.business.vo.StoreListVo>>
|
||||||
*/
|
*/
|
||||||
@PostMapping("/getStoreByIds")
|
@GetMapping("/getStoreByIds")
|
||||||
@ApiOperation("根据校区ids获取校区信息")
|
@ApiOperation("根据校区ids获取校区信息")
|
||||||
public R<List<StoreListVo>> getMiniProductPage(@RequestParam("storeIds") String storeIds) {
|
public R<List<StoreListVo>> getMiniProductPage(@RequestParam("storeIds") String storeIds) {
|
||||||
List<Store> stores = SpringUtils.getBean(StoreService.class).listByIds(Arrays.asList(storeIds.split(",")));
|
List<Store> stores = SpringUtils.getBean(StoreService.class).listByIds(Arrays.asList(storeIds.split(",")));
|
||||||
|
|||||||
@ -48,7 +48,7 @@ public class ShoppingCart extends BaseEntity implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 店铺/校区id
|
* 店铺/校区id
|
||||||
*/
|
*/
|
||||||
private byte[] storeId;
|
private String storeId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 金额
|
* 金额
|
||||||
|
|||||||
@ -5,6 +5,7 @@ import com.cpop.common.utils.StringUtils;
|
|||||||
import com.cpop.common.utils.bean.BeanUtils;
|
import com.cpop.common.utils.bean.BeanUtils;
|
||||||
import com.cpop.core.base.entity.PageDomain;
|
import com.cpop.core.base.entity.PageDomain;
|
||||||
import com.cpop.core.base.enums.SourceType;
|
import com.cpop.core.base.enums.SourceType;
|
||||||
|
import com.cpop.core.service.RedisService;
|
||||||
import com.cpop.core.utils.SecurityUtils;
|
import com.cpop.core.utils.SecurityUtils;
|
||||||
import com.cpop.core.utils.SpringUtils;
|
import com.cpop.core.utils.SpringUtils;
|
||||||
import com.cpop.core.utils.sql.SqlUtils;
|
import com.cpop.core.utils.sql.SqlUtils;
|
||||||
@ -22,6 +23,7 @@ import com.cpop.mall.business.service.ProductRecordService;
|
|||||||
import com.cpop.mall.business.service.ProductService;
|
import com.cpop.mall.business.service.ProductService;
|
||||||
import com.cpop.mall.business.service.ProductSpecificationService;
|
import com.cpop.mall.business.service.ProductSpecificationService;
|
||||||
import com.cpop.mall.business.vo.*;
|
import com.cpop.mall.business.vo.*;
|
||||||
|
import com.cpop.mall.framework.constant.MallRedisConstant;
|
||||||
import com.cpop.system.business.service.StoreService;
|
import com.cpop.system.business.service.StoreService;
|
||||||
import com.mybatisflex.core.datasource.DataSourceKey;
|
import com.mybatisflex.core.datasource.DataSourceKey;
|
||||||
import com.mybatisflex.core.paginate.Page;
|
import com.mybatisflex.core.paginate.Page;
|
||||||
@ -250,10 +252,14 @@ public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> impl
|
|||||||
//存商品记录详情
|
//存商品记录详情
|
||||||
List<ProductRecord> recordList = BeanUtils.mapToList(bo.getRecordList(), ProductRecord.class);
|
List<ProductRecord> recordList = BeanUtils.mapToList(bo.getRecordList(), ProductRecord.class);
|
||||||
ProductRecordService specificationRecordService = SpringUtils.getBean(ProductRecordService.class);
|
ProductRecordService specificationRecordService = SpringUtils.getBean(ProductRecordService.class);
|
||||||
|
RedisService redisService = SpringUtils.getBean(RedisService.class);
|
||||||
recordList.forEach(item -> {
|
recordList.forEach(item -> {
|
||||||
item.setProductId(product.getId());
|
item.setProductId(product.getId());
|
||||||
|
//更新库存
|
||||||
|
redisService.setCacheObject(MallRedisConstant.STOCK_RECORD_NUM + item.getId(), item.getRecordNum());
|
||||||
});
|
});
|
||||||
specificationRecordService.updateBatch(recordList);
|
specificationRecordService.updateBatch(recordList);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -52,7 +52,7 @@ public class ShoppingCartServiceImpl extends ServiceImpl<ShoppingCartMapper, Sho
|
|||||||
//记录
|
//记录
|
||||||
.select(PRODUCT_RECORD.RECORD_NAMES)
|
.select(PRODUCT_RECORD.RECORD_NAMES)
|
||||||
//商品
|
//商品
|
||||||
.select(PRODUCT.PRODUCT_NAME)
|
.select(PRODUCT.PRODUCT_NAME,PRODUCT.ID.as(MiniShoppingCartPageVo::getProductId),PRODUCT.PIC_URL,PRODUCT.PIC_DETAIL_URL,PRODUCT.PAY_TYPE)
|
||||||
//校区
|
//校区
|
||||||
.select(STORE.STORE_NAME)
|
.select(STORE.STORE_NAME)
|
||||||
.from(SHOPPING_CART)
|
.from(SHOPPING_CART)
|
||||||
|
|||||||
@ -42,7 +42,6 @@ public class MiniShoppingCartPageVo implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 规格名
|
* 规格名
|
||||||
*/
|
*/
|
||||||
@StringArrayConvert
|
|
||||||
@ApiModelProperty("规格名")
|
@ApiModelProperty("规格名")
|
||||||
private String recordNames;
|
private String recordNames;
|
||||||
|
|
||||||
@ -88,4 +87,29 @@ public class MiniShoppingCartPageVo implements Serializable {
|
|||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8")
|
||||||
@ApiModelProperty("创建时间")
|
@ApiModelProperty("创建时间")
|
||||||
private LocalDateTime createTime;
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 支付类型
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("支付类型")
|
||||||
|
private Integer payType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*商品id
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("商品id")
|
||||||
|
private String productId;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品图地址
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("商品图地址")
|
||||||
|
private String picUrl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品详情图地址
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("商品详情图地址")
|
||||||
|
private String picDetailUrl;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user