添加超市sku ids查询接口,扣减库存接口

This commit is contained in:
zjf committed 2025-01-06 14:13:30 +08:00
1 parent d2d43f8c24
commit 5db17855c5
4 files changed
+81 -7

No files matched your search

@@ -24,6 +24,7 @@ import com.bsd.pjcloud.common.core.constant.ServiceNameConstants;
import com.bsd.pjcloud.common.core.util.R;
import com.bsd.pjcloud.common.feign.annotation.NoToken;
import com.bsd.pjcloud.supermarket.dto.SupermarketSpuQueryDTO;
import com.bsd.pjcloud.supermarket.dto.SupermarketSpuUpdateStockReqDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
@@ -54,4 +55,13 @@ public interface RemoteSupermarketSpuService {
*/
@GetMapping("/supermarketSpu/ad/SpuDetails")
R getSupermarketSpuDetailById(@RequestParam("id")Long id);
/**
* 更新库存
* @param updateStockReqDTO
* @return
*/
@PostMapping("/supermarketSpu/ad/updateSpuStock")
R getSupermarketSpu(@RequestBody SupermarketSpuUpdateStockReqDTO updateStockReqDTO);
}
@@ -0,0 +1,50 @@
/*
*
* Copyright (c) 2018-2025, pjcloud All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the pig4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: pjcloud
*
*/
package com.bsd.pjcloud.supermarket.api.feign;
import com.bsd.pjcloud.common.core.constant.ServiceNameConstants;
import com.bsd.pjcloud.common.core.util.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import java.util.List;
/**
* @author zjf
* @date 2018/6/22
*/
@FeignClient(contextId = "remoteSupermarketUnitSkuService", value = ServiceNameConstants.SUPERMARKET_SERVICE)
public interface RemoteSupermarketUnitSkuService {
/**
* sku 包装单位
* 根据包装ids查询
* @param ids
* @return
*/
@PostMapping("/supermarketUnit/ad/getSupermarketUnits")
R getSupermarketUnits(@RequestBody List<Long> ids);
}
@@ -143,15 +143,9 @@ public class SupermarketSpuController {
// --------APP-----------------
@PostMapping("/ad/updateSpuStock")
@SysLog("更新商品库存")
public R updateSkuStock(@RequestBody SupermarketSpuUpdateStockReqDTO updateStockReqDTO){
return supermarketSpuService.updateSpuStock(updateStockReqDTO);
}
/**
* 条件查询
* 条件查询spu单表 列表信息
* @param supermarketSpuQueryDTO 商品spu
* @return
*/
@@ -174,4 +168,12 @@ public class SupermarketSpuController {
return R.ok(supermarketSpuService.getSupermarketSpuDetailById(id));
}
@PostMapping("/ad/updateSpuStock")
@SysLog("更新商品库存")
public R updateSkuStock(@RequestBody SupermarketSpuUpdateStockReqDTO updateStockReqDTO){
return supermarketSpuService.updateSpuStock(updateStockReqDTO);
}
}
@@ -121,5 +121,17 @@ public class SupermarketUnitController {
}
// -----------------APP------------------------------
/**
* 通过id查询商品包装单位(sku)
* @param ids
* @return R
*/
@Operation(summary = "通过id查询" , description = "通过id查询" )
@GetMapping("/ad/getSupermarketUnits" )
public R getSupermarketUnits(@RequestBody List<Long> ids) {
return R.ok(supermarketUnitService.list(new LambdaQueryWrapper<SupermarketUnitEntity>().in(SupermarketUnitEntity::getId,ids)));
}
}