...
|
...
|
@@ -10,7 +10,6 @@ import java.util.Map; |
|
|
|
|
|
import org.apache.commons.collections.CollectionUtils;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.apache.ibatis.annotations.Param;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.BeanUtils;
|
...
|
...
|
@@ -471,7 +470,7 @@ public static void main(String[] args) { |
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public ApiResponse<PageResponseBO<ProductResponceBo>> cancelSaleSkup(ProductRequestBo bo) {
|
|
|
public ApiResponse<Void> cancelSaleSkup(ProductRequestBo bo) {
|
|
|
StoragePrice sp = storagePriceMapper.selectBySkup(bo.getSkup());
|
|
|
if (sp == null) {
|
|
|
return new ApiResponse<>(400, "SKUP不存在");
|
...
|
...
|
@@ -487,5 +486,25 @@ public static void main(String[] args) { |
|
|
return new ApiResponse<>(400, "SKUP取消失败,状态已变更!");
|
|
|
}
|
|
|
|
|
|
|
|
|
@Override
|
|
|
public ApiResponse<Void> changeProductStatus(ProductRequestBo bo) {
|
|
|
Product product = productMapper.selectByPrimaryKey(bo.getId());
|
|
|
if (product == null) {
|
|
|
return new ApiResponse<>(400, "商品不存在");
|
|
|
}
|
|
|
if (product.getDelStatus() == null || product.getDelStatus() != 0) {
|
|
|
return new ApiResponse<>(400, "商品已删除");
|
|
|
}
|
|
|
if ((product.getShelveStatus() == null || product.getShelveStatus() == 1) && bo.getStatus()==1) {
|
|
|
return new ApiResponse<>(400, "商品不能上架");
|
|
|
}
|
|
|
if ((product.getShelveStatus() == null || product.getShelveStatus() != 1) && bo.getStatus()==0) {
|
|
|
return new ApiResponse<>(400, "商品不能下架");
|
|
|
}
|
|
|
int n = productMapper.updateStatusByPrimaryKey(bo.getId(), bo.getShelveStatus());
|
|
|
if (n == 1) {
|
|
|
return new ApiResponse<>(400, "操作成功");
|
|
|
}
|
|
|
return new ApiResponse<>(400, "操作失败!");
|
|
|
}
|
|
|
} |
...
|
...
|
|