商品快捷操作接口 以及 落地记录
This commit is contained in:
parent
d8ed96dff7
commit
de8199df49
|
|
@ -53,6 +53,13 @@ public interface LogService {
|
||||||
@Async
|
@Async
|
||||||
void save(String username, String browser, String ip, ProceedingJoinPoint joinPoint, Log log,Integer shopId);
|
void save(String username, String browser, String ip, ProceedingJoinPoint joinPoint, Log log,Integer shopId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param description 描述
|
||||||
|
* @param method 方法
|
||||||
|
* @param param 入参
|
||||||
|
*/
|
||||||
|
void save(String description,String method,String param);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询异常详情
|
* 查询异常详情
|
||||||
* @param id 日志ID
|
* @param id 日志ID
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,7 @@ import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
|
|
@ -120,6 +121,24 @@ public class LogServiceImpl implements LogService {
|
||||||
logRepository.save(log);
|
logRepository.save(log);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void save(String description,String method,String param) {
|
||||||
|
Log log = new Log();
|
||||||
|
HttpServletRequest request = RequestHolder.getHttpServletRequest();
|
||||||
|
log.setUsername(SecurityUtils.getCurrentUsername());
|
||||||
|
log.setLogType("INFO");
|
||||||
|
log.setBrowser(StringUtils.getBrowser(request));
|
||||||
|
log.setRequestIp(StringUtils.getIp(request));
|
||||||
|
log.setAddress(StringUtils.getCityInfo(log.getRequestIp()));
|
||||||
|
|
||||||
|
log.setDescription(description);
|
||||||
|
log.setMethod(method);
|
||||||
|
log.setParams(param);
|
||||||
|
logRepository.save(log);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据方法和传入的参数获取请求参数
|
* 根据方法和传入的参数获取请求参数
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -2,10 +2,12 @@ package cn.ysk.cashier.controller.product;
|
||||||
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import cn.ysk.cashier.annotation.Log;
|
import cn.ysk.cashier.annotation.Log;
|
||||||
|
import cn.ysk.cashier.annotation.rest.AnonymousPostMapping;
|
||||||
import cn.ysk.cashier.dto.product.StockQueryDto;
|
import cn.ysk.cashier.dto.product.StockQueryDto;
|
||||||
import cn.ysk.cashier.exception.BadRequestException;
|
import cn.ysk.cashier.exception.BadRequestException;
|
||||||
import cn.ysk.cashier.service.product.StockService;
|
import cn.ysk.cashier.service.product.StockService;
|
||||||
import cn.ysk.cashier.utils.BeanUtil;
|
import cn.ysk.cashier.utils.BeanUtil;
|
||||||
|
import cn.ysk.cashier.utils.JSONUtil;
|
||||||
import cn.ysk.cashier.vo.StockUpdateValueVO;
|
import cn.ysk.cashier.vo.StockUpdateValueVO;
|
||||||
import cn.ysk.cashier.vo.StockUpdateWarnLineVO;
|
import cn.ysk.cashier.vo.StockUpdateWarnLineVO;
|
||||||
import cn.ysk.cashier.vo.StockV2Vo;
|
import cn.ysk.cashier.vo.StockV2Vo;
|
||||||
|
|
@ -16,11 +18,13 @@ import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.data.domain.Page;
|
import org.springframework.data.domain.Page;
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
|
|
@ -134,10 +138,12 @@ public class StockController {
|
||||||
return new ResponseEntity<>(HttpStatus.OK);
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Log("商品库存 修改商品状态")
|
// @Log("商品库存 修改商品状态")
|
||||||
@PutMapping("productStatus")
|
@PostMapping("updateProductData")
|
||||||
public ResponseEntity<Object> updateProductStatus(@RequestBody StockUpdateValueVO updateValueVO) {
|
@AnonymousPostMapping
|
||||||
stockService.updateProductStatus(updateValueVO);
|
public ResponseEntity<Object> updateProductData(@Validated @RequestBody List<StockUpdateValueVO> updateValueVO) {
|
||||||
|
log.info(JSONUtil.toJSONString(updateValueVO));
|
||||||
|
// stockService.updateProductStatus(updateValueVO);
|
||||||
return new ResponseEntity<>("修改成功", HttpStatus.OK);
|
return new ResponseEntity<>("修改成功", HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ import org.springframework.data.jpa.repository.Modifying;
|
||||||
import org.springframework.data.jpa.repository.Query;
|
import org.springframework.data.jpa.repository.Query;
|
||||||
|
|
||||||
import javax.transaction.Transactional;
|
import javax.transaction.Transactional;
|
||||||
|
import java.math.BigDecimal;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -69,4 +70,8 @@ public interface TbProductRepository extends JpaRepository<TbProduct, Integer>,
|
||||||
@Query(value = "select * from tb_product as a where a.id=:skuId", nativeQuery = true)
|
@Query(value = "select * from tb_product as a where a.id=:skuId", nativeQuery = true)
|
||||||
TbProduct selectById(@Param("skuId") Integer skuId);
|
TbProduct selectById(@Param("skuId") Integer skuId);
|
||||||
|
|
||||||
|
@Modifying
|
||||||
|
@Query("update TbProduct set lowPrice=:lowPrice where id=:id")
|
||||||
|
void upLowPrice(@Param("id") Integer id, @Param("lowPrice") BigDecimal lowPrice);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -160,6 +160,10 @@ public interface TbProductSkuRepository extends JpaRepository<TbProductSku, Inte
|
||||||
List<StockVo> searchProStock(@Param("shopId") String shopId, @Param("proName") String proName, @Param("isStock")Integer isStock,@Param("num")Double num);
|
List<StockVo> searchProStock(@Param("shopId") String shopId, @Param("proName") String proName, @Param("isStock")Integer isStock,@Param("num")Double num);
|
||||||
|
|
||||||
|
|
||||||
|
@Query(value = "SELECT min(sale_price) from tb_product_sku where product_id = ?1 and id != ?2", nativeQuery = true)
|
||||||
|
BigDecimal searchMinSalePrice(@Param("productId") Integer productId, @Param("skuId") Integer skuId);
|
||||||
|
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
@Modifying
|
@Modifying
|
||||||
@Query("update FROM TbProductSku sku set sku.costPrice=:costPrice,sku.coverImg =:coverImg, " +
|
@Query("update FROM TbProductSku sku set sku.costPrice=:costPrice,sku.coverImg =:coverImg, " +
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@ import cn.ysk.cashier.repository.product.TbProductSkuRepository;
|
||||||
import cn.ysk.cashier.repository.product.TbProductStockDetailRepository;
|
import cn.ysk.cashier.repository.product.TbProductStockDetailRepository;
|
||||||
import cn.ysk.cashier.repository.shop.TbShopInfoRepository;
|
import cn.ysk.cashier.repository.shop.TbShopInfoRepository;
|
||||||
import cn.ysk.cashier.repository.shop.TbShopUnitRepository;
|
import cn.ysk.cashier.repository.shop.TbShopUnitRepository;
|
||||||
|
import cn.ysk.cashier.service.LogService;
|
||||||
import cn.ysk.cashier.service.TbProductStockOperateService;
|
import cn.ysk.cashier.service.TbProductStockOperateService;
|
||||||
import cn.ysk.cashier.service.product.StockService;
|
import cn.ysk.cashier.service.product.StockService;
|
||||||
import cn.ysk.cashier.service.product.TbProductService;
|
import cn.ysk.cashier.service.product.TbProductService;
|
||||||
|
|
@ -61,6 +62,7 @@ public class StockServiceImpl implements StockService {
|
||||||
private final TbProductStockDetailRepository tbProductStockDetailRepository;
|
private final TbProductStockDetailRepository tbProductStockDetailRepository;
|
||||||
private final TbProductRepository tbProductRepository;
|
private final TbProductRepository tbProductRepository;
|
||||||
private final WxMsgUtils wxMsgUtils;
|
private final WxMsgUtils wxMsgUtils;
|
||||||
|
private final LogService logService;
|
||||||
|
|
||||||
@PersistenceContext
|
@PersistenceContext
|
||||||
private EntityManager em;
|
private EntityManager em;
|
||||||
|
|
@ -332,69 +334,152 @@ public class StockServiceImpl implements StockService {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public void updateProductStatus(StockUpdateValueVO updateValueVO) {
|
public void updateProductStatus(List<StockUpdateValueVO> updateValueVOs) {
|
||||||
if (!"0".equals(updateValueVO.getUpdateValue()) && !"1".equals(updateValueVO.getUpdateValue())) {
|
TbProduct product = new TbProduct();
|
||||||
throw new BadRequestException("无效值");
|
for (StockUpdateValueVO updateValueVO : updateValueVOs) {
|
||||||
|
if (!updateValueVO.isSku()) {
|
||||||
|
if (!updateValueVO.isSku()) {
|
||||||
|
if (product == null) {
|
||||||
|
product = tbProductRepository.getById(Integer.valueOf(updateValueVO.getId()));
|
||||||
}
|
}
|
||||||
if (StringUtils.isBlank(updateValueVO.getTargetId())) {
|
productUp(updateValueVO, product);
|
||||||
throw new BadRequestException("更新id不能为空");
|
} else {
|
||||||
|
if (product == null) {
|
||||||
|
product = tbProductRepository.selectBySkuId(Integer.valueOf(updateValueVO.getId()));
|
||||||
|
}
|
||||||
|
productSkuUp(updateValueVO, product);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void productUp(StockUpdateValueVO updateValueVO,TbProduct product){
|
||||||
|
if(Objects.isNull(product)){
|
||||||
|
throw new BadRequestException("该商品不存在");
|
||||||
}
|
}
|
||||||
StringBuilder sqlQuery = new StringBuilder("update tb_product ");
|
StringBuilder sqlQuery = new StringBuilder("update tb_product ");
|
||||||
|
StringBuilder description = new StringBuilder("商品" + product.getName());
|
||||||
switch (updateValueVO.getUpdateKey()) {
|
switch (updateValueVO.getKey()) {
|
||||||
case "pauseSaleSku":
|
case "pauseSale"://商品 暂停销售
|
||||||
sqlQuery = new StringBuilder("update tb_product_sku set is_pause_sale = ").
|
if (!"0".equals(updateValueVO.getValue()) && !"1".equals(updateValueVO.getValue())) {
|
||||||
append(updateValueVO.getUpdateValue()).
|
throw new BadRequestException("无效值");
|
||||||
append(" where id = ").
|
|
||||||
append(updateValueVO.getTargetId()).
|
|
||||||
append(";");
|
|
||||||
|
|
||||||
Query nativeQuery = em.createNativeQuery(String.valueOf(sqlQuery));
|
|
||||||
nativeQuery.executeUpdate();
|
|
||||||
|
|
||||||
TbProduct product = tbProductRepository.selectBySkuId(Integer.valueOf(updateValueVO.getTargetId()));
|
|
||||||
TbProductSku tbProductSku = tbProductSkuRepository.findById(Integer.valueOf(updateValueVO.getTargetId())).orElse(null);
|
|
||||||
// 推送微信操作消息
|
|
||||||
if (product != null && tbProductSku != null) {
|
|
||||||
wxMsgUtils.aboardOperationMsg(("0".equals(updateValueVO.getUpdateValue()) ? "关闭售罄: " : "开启售罄: ") + product.getName() + "/"+ tbProductSku.getSpecSnap(), Integer.valueOf(updateValueVO.getShopId()));
|
|
||||||
}else {
|
|
||||||
log.warn("推送微信操作消息失败,未查询到商品信息,skuId: {}", updateValueVO.getTargetId());
|
|
||||||
}
|
}
|
||||||
return;
|
sqlQuery.append(" set is_pause_sale = ").append(updateValueVO.getValue());
|
||||||
case "stock":
|
description.append(" 修改为" + ("0".equals(updateValueVO.getValue()) ? "非售罄" : "已售罄"));
|
||||||
sqlQuery.append(" set is_stock = ").append(updateValueVO.getUpdateValue());
|
|
||||||
break;
|
break;
|
||||||
case "distribute":
|
case "grounding"://上下架
|
||||||
sqlQuery.append(" set is_distribute = ").append(updateValueVO.getUpdateValue());
|
if (!"0".equals(updateValueVO.getValue()) && !"1".equals(updateValueVO.getValue())) {
|
||||||
break;
|
throw new BadRequestException("无效值");
|
||||||
case "pauseSale":
|
|
||||||
sqlQuery.append(" set is_pause_sale = ").append(updateValueVO.getUpdateValue());
|
|
||||||
TbProduct product1 = tbProductRepository.getById(Integer.valueOf(updateValueVO.getTargetId()));
|
|
||||||
|
|
||||||
// 推送微信操作消息
|
|
||||||
if (product1 != null) {
|
|
||||||
wxMsgUtils.aboardOperationMsg(("0".equals(updateValueVO.getUpdateValue()) ? "关闭售罄: " : "开启售罄: ") + product1.getName(), Integer.valueOf(updateValueVO.getShopId()));
|
|
||||||
}else {
|
|
||||||
log.warn("推送微信操作消息失败,未查询到商品信息,skuId: {}", updateValueVO.getTargetId());
|
|
||||||
}
|
}
|
||||||
|
tbProductSkuRepository.updateGroundingByProId(product.getId().toString(), Integer.valueOf(updateValueVO.getValue()));
|
||||||
|
description.append("0".equals(updateValueVO.getValue()) ? "已下架" : "已上架");
|
||||||
|
sqlQuery.append(" set is_grounding = ").append(updateValueVO.getValue());
|
||||||
break;
|
break;
|
||||||
|
case "stockNumber"://库存
|
||||||
|
description.append(" 库存数量修改为:"+updateValueVO.getValue()+" 原库存:"+product.getStockNumber());
|
||||||
|
sqlQuery.append(" set stock_number = ").append(updateValueVO.getValue());
|
||||||
|
break;
|
||||||
|
// case "stock"://库存开关
|
||||||
|
// if (!"0".equals(updateValueVO.getValue()) && !"1".equals(updateValueVO.getValue())) {
|
||||||
|
// throw new BadRequestException("无效值");
|
||||||
|
// }
|
||||||
|
// description.append("库存开关" + ("0".equals(updateValueVO.getValue()) ? "已关闭" : "已开启"));
|
||||||
|
// sqlQuery.append(" set is_stock = ").append(updateValueVO.getValue());
|
||||||
|
// break;
|
||||||
|
// case "distribute"://共享库存
|
||||||
|
// if (!"0".equals(updateValueVO.getValue()) && !"1".equals(updateValueVO.getValue())) {
|
||||||
|
// throw new BadRequestException("无效值");
|
||||||
|
// }
|
||||||
|
// description.append("库存共享 " + ("0".equals(updateValueVO.getValue()) ? "已关闭" : "已开启"));
|
||||||
|
// sqlQuery.append(" set is_distribute = ").append(updateValueVO.getValue());
|
||||||
|
// break;
|
||||||
default:
|
default:
|
||||||
throw new BadRequestException("无效更新类型");
|
throw new BadRequestException("无效更新类型");
|
||||||
}
|
}
|
||||||
|
|
||||||
sqlQuery.append(" where ");
|
sqlQuery.append(" where ");
|
||||||
|
|
||||||
if (StringUtils.isNotBlank(updateValueVO.getShopId())) {
|
if (StringUtils.isNotBlank(updateValueVO.getShopId())) {
|
||||||
sqlQuery.append(" shop_id = ").append(updateValueVO.getShopId());
|
sqlQuery.append(" shop_id = ").append(updateValueVO.getShopId());
|
||||||
sqlQuery.append(" and ");
|
sqlQuery.append(" and ");
|
||||||
}
|
}
|
||||||
sqlQuery.append(" id = ").append(updateValueVO.getTargetId());
|
sqlQuery.append(" id = ").append(updateValueVO.getId());
|
||||||
|
|
||||||
sqlQuery.append(" ;");
|
sqlQuery.append(" ;");
|
||||||
|
|
||||||
Query nativeQuery = em.createNativeQuery(String.valueOf(sqlQuery));
|
Query nativeQuery = em.createNativeQuery(String.valueOf(sqlQuery));
|
||||||
nativeQuery.executeUpdate();
|
nativeQuery.executeUpdate();
|
||||||
|
if("pauseSale".equals(updateValueVO.getKey())){
|
||||||
|
wxMsgUtils.aboardOperationMsg(("0".equals(updateValueVO.getValue()) ? "关闭售罄: " : "开启售罄: ") + product.getName(),
|
||||||
|
Integer.valueOf(updateValueVO.getShopId()));
|
||||||
}
|
}
|
||||||
|
logService.save(description.toString(),
|
||||||
|
"cn.ysk.cashier.controller.product.StockController.updateProductStatus()",
|
||||||
|
JSONUtil.toJSONString(updateValueVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
public void productSkuUp(StockUpdateValueVO updateValueVO, TbProduct product) {
|
||||||
|
if (Objects.isNull(product)) {
|
||||||
|
throw new BadRequestException("该商品不存在");
|
||||||
|
}
|
||||||
|
TbProductSku tbProductSku = tbProductSkuRepository.findById(Integer.valueOf(updateValueVO.getId())).orElse(null);
|
||||||
|
if (Objects.isNull(tbProductSku)) {
|
||||||
|
throw new BadRequestException("该商品规格不存在");
|
||||||
|
}
|
||||||
|
StringBuilder sqlQuery = new StringBuilder("update tb_product_sku ");
|
||||||
|
StringBuilder description = new StringBuilder("商品" + product.getName()+" 规格:" + tbProductSku.getSpecSnap());
|
||||||
|
switch (updateValueVO.getKey()) {
|
||||||
|
case "pauseSale": //sku售罄
|
||||||
|
if (!"0".equals(updateValueVO.getValue()) && !"1".equals(updateValueVO.getValue())) {
|
||||||
|
throw new BadRequestException("无效值");
|
||||||
|
}
|
||||||
|
sqlQuery.append(" set is_pause_sale = ").append(updateValueVO.getValue());
|
||||||
|
description.append(" 修改为" + ("0".equals(updateValueVO.getValue()) ? "非售罄" : "已售罄"));
|
||||||
|
break;
|
||||||
|
case "grounding": //sku上下架
|
||||||
|
if (!"0".equals(updateValueVO.getValue()) && !"1".equals(updateValueVO.getValue())) {
|
||||||
|
throw new BadRequestException("无效值");
|
||||||
|
}
|
||||||
|
sqlQuery.append(" set is_grounding = ").append(updateValueVO.getValue());
|
||||||
|
description.append("0".equals(updateValueVO.getValue()) ? "已下架" : "已上架");
|
||||||
|
break;
|
||||||
|
case "salePrice"://价格
|
||||||
|
description.append("修改价格为" + updateValueVO.getValue());
|
||||||
|
sqlQuery.append(" set sale_price = ").append(updateValueVO.getValue());
|
||||||
|
if(("sku").equals(product.getTypeEnum())){
|
||||||
|
BigDecimal bigDecimal = tbProductSkuRepository.searchMinSalePrice(Integer.valueOf(tbProductSku.getProductId()),tbProductSku.getId());
|
||||||
|
if (bigDecimal.compareTo(new BigDecimal(updateValueVO.getValue())) < 0) {
|
||||||
|
tbProductRepository.upLowPrice(product.getId(),bigDecimal);
|
||||||
|
}else {
|
||||||
|
tbProductRepository.upLowPrice(product.getId(),new BigDecimal(updateValueVO.getValue()));
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
tbProductRepository.upLowPrice(product.getId(),new BigDecimal(updateValueVO.getValue()));
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
throw new BadRequestException("无效更新类型");
|
||||||
|
}
|
||||||
|
sqlQuery.append(" where ");
|
||||||
|
if (StringUtils.isNotBlank(updateValueVO.getShopId())) {
|
||||||
|
sqlQuery.append(" shop_id = ").append(updateValueVO.getShopId());
|
||||||
|
sqlQuery.append(" and ");
|
||||||
|
}
|
||||||
|
sqlQuery.append(" id = ").append(updateValueVO.getId());
|
||||||
|
sqlQuery.append(" ;");
|
||||||
|
|
||||||
|
Query nativeQuery = em.createNativeQuery(String.valueOf(sqlQuery));
|
||||||
|
nativeQuery.executeUpdate();
|
||||||
|
|
||||||
|
if("pauseSale".equals(updateValueVO.getKey())){
|
||||||
|
// 推送微信操作消息
|
||||||
|
wxMsgUtils.aboardOperationMsg(
|
||||||
|
("0".equals(updateValueVO.getValue()) ? "关闭售罄: " : "开启售罄: ") + product.getName() + "/" + tbProductSku.getSpecSnap(),
|
||||||
|
Integer.valueOf(updateValueVO.getShopId()));
|
||||||
|
}
|
||||||
|
logService.save(description.toString(),
|
||||||
|
"cn.ysk.cashier.controller.product.StockController.updateProductStatus()",
|
||||||
|
JSONUtil.toJSONString(updateValueVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateProductWarnLine(StockUpdateWarnLineVO stockUpdateWarnLineVO) {
|
public void updateProductWarnLine(StockUpdateWarnLineVO stockUpdateWarnLineVO) {
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ public interface StockService {
|
||||||
|
|
||||||
void updateIsStock(Integer proId, String shopId,Integer isStock);
|
void updateIsStock(Integer proId, String shopId,Integer isStock);
|
||||||
|
|
||||||
void updateProductStatus(StockUpdateValueVO updateValueVO);
|
void updateProductStatus(List<StockUpdateValueVO> updateValueVO);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 商品库存警戒线设置
|
* 商品库存警戒线设置
|
||||||
|
|
|
||||||
|
|
@ -2,13 +2,22 @@ package cn.ysk.cashier.vo;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author GYJ
|
* @author GYJ
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
public class StockUpdateValueVO {
|
public class StockUpdateValueVO {
|
||||||
private String updateValue;
|
@NotNull(message = "店铺Id不可为空")
|
||||||
private String updateKey;
|
|
||||||
private String targetId;
|
|
||||||
private String shopId;
|
private String shopId;
|
||||||
|
@NotNull
|
||||||
|
private boolean isSku;
|
||||||
|
@NotNull(message = "主键不可为空")
|
||||||
|
private String id;
|
||||||
|
@NotNull(message = "key不可为空")
|
||||||
|
private String key;
|
||||||
|
@NotNull(message = "value不可为空")
|
||||||
|
private String value;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue