|
@@ -21,7 +21,7 @@ import java.util.Map;
|
|
|
* @author : Charles
|
|
|
* @date : 2021/6/28
|
|
|
*/
|
|
|
-@Api(tags="协销购物车API")
|
|
|
+@Api(tags = "协销购物车API")
|
|
|
@RestController
|
|
|
@RequiredArgsConstructor
|
|
|
@RequestMapping("/order/seller")
|
|
@@ -29,6 +29,25 @@ public class CartSellerApi {
|
|
|
|
|
|
private final CartSellerService cartSellerService;
|
|
|
|
|
|
+
|
|
|
+ @ApiOperation("协销购物车重选商品sku")
|
|
|
+ @PostMapping("/check/sku")
|
|
|
+ public ResponseJson checkOldCart(SellerCartDto sellerCartDto) {
|
|
|
+ if (null == sellerCartDto.getClubId()) {
|
|
|
+ return ResponseJson.error("机构Id不能为空!", null);
|
|
|
+ }
|
|
|
+ if (null == sellerCartDto.getServiceProviderId()) {
|
|
|
+ return ResponseJson.error("协销Id不能为空!", null);
|
|
|
+ }
|
|
|
+ if (null == sellerCartDto.getProductCount()) {
|
|
|
+ return ResponseJson.error("购买数量不能为空!", null);
|
|
|
+ }
|
|
|
+ if (null == sellerCartDto.getOldSkuId() || null == sellerCartDto.getNewSkuId()) {
|
|
|
+ return ResponseJson.error("skuId不能为空!", null);
|
|
|
+ }
|
|
|
+ return cartSellerService.checkClubSkuId(sellerCartDto);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 协销购物车列表数据
|
|
|
*/
|
|
@@ -41,9 +60,9 @@ public class CartSellerApi {
|
|
|
@ApiImplicitParam(required = false, name = "pageSize", value = "每页数量")
|
|
|
})
|
|
|
@GetMapping("/cart/list")
|
|
|
- public ResponseJson<Map<String,Object>> getShoppingCarts(Integer serviceProviderId, Integer clubId, String againBuyProductIds,
|
|
|
- @RequestParam(value = "pageNum", defaultValue = "1") int pageNum,
|
|
|
- @RequestParam(value = "pageSize", defaultValue = "10") int pageSize) {
|
|
|
+ public ResponseJson<Map<String, Object>> getShoppingCarts(Integer serviceProviderId, Integer clubId, String againBuyProductIds,
|
|
|
+ @RequestParam(value = "pageNum", defaultValue = "1") int pageNum,
|
|
|
+ @RequestParam(value = "pageSize", defaultValue = "10") int pageSize) {
|
|
|
if (null == serviceProviderId) {
|
|
|
return ResponseJson.error("协销Id不能为空!", null);
|
|
|
}
|
|
@@ -82,11 +101,11 @@ public class CartSellerApi {
|
|
|
* skuId 单一商品skuId
|
|
|
* productCount 单一商品数量
|
|
|
* productInfo 组合商品信息:Json字符串格式[{"skuId":4351,"count":1},{}]
|
|
|
- * }
|
|
|
+ * }
|
|
|
*/
|
|
|
@ApiOperation("协销添加购物车(旧:/seller/addCart)(/seller/batchAddCart)")
|
|
|
@PostMapping("/cart/add")
|
|
|
- public ResponseJson<Integer> addSellerCart(SellerCartDto sellerCartDto){
|
|
|
+ public ResponseJson<Integer> addSellerCart(SellerCartDto sellerCartDto) {
|
|
|
if (null == sellerCartDto.getServiceProviderId()) {
|
|
|
return ResponseJson.error("协销Id不能为空!", null);
|
|
|
}
|
|
@@ -124,7 +143,7 @@ public class CartSellerApi {
|
|
|
*/
|
|
|
@ApiOperation("协销更新购物车(旧:/seller/addProductNum)")
|
|
|
@PostMapping("/cart/update")
|
|
|
- public ResponseJson<Integer> updateSellerCart(SellerCartDto sellerCartDto){
|
|
|
+ public ResponseJson<Integer> updateSellerCart(SellerCartDto sellerCartDto) {
|
|
|
if (null == sellerCartDto.getServiceProviderId()) {
|
|
|
return ResponseJson.error("协销Id不能为空!", null);
|
|
|
}
|
|
@@ -143,11 +162,11 @@ public class CartSellerApi {
|
|
|
* @param sellerCartDto {
|
|
|
* serviceProviderId 协销Id
|
|
|
* cartIds 购物车IDs
|
|
|
- * }
|
|
|
+ * }
|
|
|
*/
|
|
|
@ApiOperation("协销删除购物车(旧:/seller/deleteSellerCart)")
|
|
|
@PostMapping("/cart/delete")
|
|
|
- public ResponseJson<Integer> deleteSellerCart(SellerCartDto sellerCartDto){
|
|
|
+ public ResponseJson<Integer> deleteSellerCart(SellerCartDto sellerCartDto) {
|
|
|
if (null == sellerCartDto.getServiceProviderId()) {
|
|
|
return ResponseJson.error("协销Id不能为空!", null);
|
|
|
}
|
|
@@ -191,7 +210,7 @@ public class CartSellerApi {
|
|
|
@ApiImplicitParam(required = false, name = "productCount", value = "商品数量")
|
|
|
})
|
|
|
@GetMapping("/second/settlement")
|
|
|
- public ResponseJson<Map<String, Object>> buyNowProduct(Integer serviceProviderId, Integer clubId, Integer productId, Integer productCount){
|
|
|
+ public ResponseJson<Map<String, Object>> buyNowProduct(Integer serviceProviderId, Integer clubId, Integer productId, Integer productCount) {
|
|
|
if (null == serviceProviderId) {
|
|
|
return ResponseJson.error("协销Id不能为空!", null);
|
|
|
}
|
|
@@ -218,7 +237,7 @@ public class CartSellerApi {
|
|
|
*/
|
|
|
@ApiOperation("协销再来一单(订单商品加入购物车)(旧:/seller/order/again)")
|
|
|
@PostMapping("/cart/again")
|
|
|
- public ResponseJson<Map<String, Object>> addCartBuyAgain(AgainBuyDto againBuyDto){
|
|
|
+ public ResponseJson<Map<String, Object>> addCartBuyAgain(AgainBuyDto againBuyDto) {
|
|
|
if (null == againBuyDto.getServiceProviderId()) {
|
|
|
return ResponseJson.error("协销Id不能为空!", null);
|
|
|
}
|