库存记录 增加操作人

This commit is contained in:
2024-09-26 17:03:42 +08:00
parent 4bbc2408bf
commit 657596f619
2 changed files with 8 additions and 2 deletions

View File

@@ -1,12 +1,14 @@
package com.chaozhanggui.system.cashierservice.controller;
import com.alibaba.fastjson.JSONObject;
import com.chaozhanggui.system.cashierservice.entity.dto.ProductStatusDTO;
import com.chaozhanggui.system.cashierservice.entity.dto.ProductStockDTO;
import com.chaozhanggui.system.cashierservice.entity.dto.QuerySpecDTO;
import com.chaozhanggui.system.cashierservice.service.ProductService;
import com.chaozhanggui.system.cashierservice.sign.CodeEnum;
import com.chaozhanggui.system.cashierservice.sign.Result;
import com.chaozhanggui.system.cashierservice.util.TokenUtil;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
@@ -36,9 +38,12 @@ public class ProductController {
@PutMapping("/productStock")
public Result productStock(
@RequestHeader("token") String token,
@Valid @RequestBody ProductStockDTO productStockDTO
) {
productService.updateStock(productStockDTO);
JSONObject jsonObject = TokenUtil.parseParamFromToken(token);
String loginName = jsonObject.getString("loginName");
productService.updateStock(productStockDTO,loginName);
return Result.success(CodeEnum.SUCCESS);
}