商品快捷操作接口 以及 落地记录

This commit is contained in:
2024-09-20 18:17:26 +08:00
parent d8ed96dff7
commit de8199df49
8 changed files with 185 additions and 50 deletions

View File

@@ -2,10 +2,12 @@ package cn.ysk.cashier.controller.product;
import cn.hutool.core.util.StrUtil;
import cn.ysk.cashier.annotation.Log;
import cn.ysk.cashier.annotation.rest.AnonymousPostMapping;
import cn.ysk.cashier.dto.product.StockQueryDto;
import cn.ysk.cashier.exception.BadRequestException;
import cn.ysk.cashier.service.product.StockService;
import cn.ysk.cashier.utils.BeanUtil;
import cn.ysk.cashier.utils.JSONUtil;
import cn.ysk.cashier.vo.StockUpdateValueVO;
import cn.ysk.cashier.vo.StockUpdateWarnLineVO;
import cn.ysk.cashier.vo.StockV2Vo;
@@ -16,11 +18,13 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.data.domain.Page;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
import java.util.Map;
@RestController
@@ -134,10 +138,12 @@ public class StockController {
return new ResponseEntity<>(HttpStatus.OK);
}
@Log("商品库存 修改商品状态")
@PutMapping("productStatus")
public ResponseEntity<Object> updateProductStatus(@RequestBody StockUpdateValueVO updateValueVO) {
stockService.updateProductStatus(updateValueVO);
// @Log("商品库存 修改商品状态")
@PostMapping("updateProductData")
@AnonymousPostMapping
public ResponseEntity<Object> updateProductData(@Validated @RequestBody List<StockUpdateValueVO> updateValueVO) {
log.info(JSONUtil.toJSONString(updateValueVO));
// stockService.updateProductStatus(updateValueVO);
return new ResponseEntity<>("修改成功", HttpStatus.OK);
}