|
@@ -1,5 +1,7 @@
|
|
|
package com.cyksj.web.controller.manage.goods;
|
|
package com.cyksj.web.controller.manage.goods;
|
|
|
|
|
|
|
|
|
|
+import cn.dev33.satoken.annotation.SaCheckPermission;
|
|
|
|
|
+
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Assert;
|
|
import com.baomidou.mybatisplus.core.toolkit.Assert;
|
|
@@ -73,6 +75,7 @@ public class CmsGoodsDonSkuController {
|
|
|
/**
|
|
/**
|
|
|
* 新增 商品spec & sku
|
|
* 新增 商品spec & sku
|
|
|
*/
|
|
*/
|
|
|
|
|
+ @SaCheckPermission("platform:add")
|
|
|
@PostMapping(value = "/post/spec-sku")
|
|
@PostMapping(value = "/post/spec-sku")
|
|
|
@Log(module = "平台管理/新增商品sku&spec", businessType = BusinessType.POST, isSaveRequestData = true)
|
|
@Log(module = "平台管理/新增商品sku&spec", businessType = BusinessType.POST, isSaveRequestData = true)
|
|
|
public Result<String> skuInsert(@Validated @RequestBody ReqGoodsSkuInsert insert) throws Exception{
|
|
public Result<String> skuInsert(@Validated @RequestBody ReqGoodsSkuInsert insert) throws Exception{
|
|
@@ -84,6 +87,7 @@ public class CmsGoodsDonSkuController {
|
|
|
/**
|
|
/**
|
|
|
* 更新 spec
|
|
* 更新 spec
|
|
|
*/
|
|
*/
|
|
|
|
|
+ @SaCheckPermission("platform:update")
|
|
|
@PutMapping("/update/spec")
|
|
@PutMapping("/update/spec")
|
|
|
public Result<String> updateGoodsSpec(@Validated @RequestBody ReqGoodsSkuInsert insert) throws Exception {
|
|
public Result<String> updateGoodsSpec(@Validated @RequestBody ReqGoodsSkuInsert insert) throws Exception {
|
|
|
goodsDonSpecService.insertOrUpdateSkuSpec(insert, true);
|
|
goodsDonSpecService.insertOrUpdateSkuSpec(insert, true);
|
|
@@ -95,6 +99,7 @@ public class CmsGoodsDonSkuController {
|
|
|
* 追加 商品sku
|
|
* 追加 商品sku
|
|
|
*/
|
|
*/
|
|
|
@Transactional(rollbackFor = Throwable.class)
|
|
@Transactional(rollbackFor = Throwable.class)
|
|
|
|
|
+ @SaCheckPermission("platform:add")
|
|
|
@PostMapping(value = "/post")
|
|
@PostMapping(value = "/post")
|
|
|
@Log(module = "平台管理/新增规格", businessType = BusinessType.POST, isSaveRequestData = true)
|
|
@Log(module = "平台管理/新增规格", businessType = BusinessType.POST, isSaveRequestData = true)
|
|
|
public Result<String> skuAppend(@Validated @RequestBody ReqGoodsSkuInsert insert) throws Exception{
|
|
public Result<String> skuAppend(@Validated @RequestBody ReqGoodsSkuInsert insert) throws Exception{
|
|
@@ -114,6 +119,7 @@ public class CmsGoodsDonSkuController {
|
|
|
* 修改 sku
|
|
* 修改 sku
|
|
|
*/
|
|
*/
|
|
|
@Transactional(rollbackFor = Throwable.class)
|
|
@Transactional(rollbackFor = Throwable.class)
|
|
|
|
|
+ @SaCheckPermission("platform:update")
|
|
|
@PutMapping(value = "/update")
|
|
@PutMapping(value = "/update")
|
|
|
@Log(module = "平台管理/编辑规格", businessType = BusinessType.PUT, isSaveRequestData = true)
|
|
@Log(module = "平台管理/编辑规格", businessType = BusinessType.PUT, isSaveRequestData = true)
|
|
|
public Result<String> skuUpdate(@RequestBody GoodsDonSku sku) throws Exception {
|
|
public Result<String> skuUpdate(@RequestBody GoodsDonSku sku) throws Exception {
|
|
@@ -219,6 +225,7 @@ public class CmsGoodsDonSkuController {
|
|
|
* 删除 sku
|
|
* 删除 sku
|
|
|
*/
|
|
*/
|
|
|
@Transactional(rollbackFor = Throwable.class)
|
|
@Transactional(rollbackFor = Throwable.class)
|
|
|
|
|
+ @SaCheckPermission("platform:delete")
|
|
|
@DeleteMapping("/delete/{skuId}")
|
|
@DeleteMapping("/delete/{skuId}")
|
|
|
@Log(module = "平台管理/删除规格", businessType = BusinessType.DELETE)
|
|
@Log(module = "平台管理/删除规格", businessType = BusinessType.DELETE)
|
|
|
public Result<String> skuDelete(@PathVariable Long skuId) {
|
|
public Result<String> skuDelete(@PathVariable Long skuId) {
|
|
@@ -234,6 +241,7 @@ public class CmsGoodsDonSkuController {
|
|
|
/**
|
|
/**
|
|
|
* 新 生成排列组合规格
|
|
* 新 生成排列组合规格
|
|
|
*/
|
|
*/
|
|
|
|
|
+ @SaCheckPermission("platform:add")
|
|
|
@PostMapping("/post/combination/{goodsId}")
|
|
@PostMapping("/post/combination/{goodsId}")
|
|
|
@Transactional(rollbackFor = Throwable.class)
|
|
@Transactional(rollbackFor = Throwable.class)
|
|
|
public Result<String> postCombinationSku(@PathVariable Long goodsId, @RequestBody List<CombinationSkuReq> combinations) throws Exception {
|
|
public Result<String> postCombinationSku(@PathVariable Long goodsId, @RequestBody List<CombinationSkuReq> combinations) throws Exception {
|
|
@@ -287,6 +295,7 @@ public class CmsGoodsDonSkuController {
|
|
|
/**
|
|
/**
|
|
|
* 批量上架
|
|
* 批量上架
|
|
|
*/
|
|
*/
|
|
|
|
|
+ @SaCheckPermission("platform:updateStatus")
|
|
|
@PutMapping("/batch/update/status/{goodsId}")
|
|
@PutMapping("/batch/update/status/{goodsId}")
|
|
|
public Result<String> batchUpdateStatus(@PathVariable Long goodsId, @RequestBody List<Long> skuIds) {
|
|
public Result<String> batchUpdateStatus(@PathVariable Long goodsId, @RequestBody List<Long> skuIds) {
|
|
|
GoodsDon goodsDon = goodsDonService.getById(goodsId);
|
|
GoodsDon goodsDon = goodsDonService.getById(goodsId);
|
|
@@ -309,6 +318,7 @@ public class CmsGoodsDonSkuController {
|
|
|
/**
|
|
/**
|
|
|
* 规格排序
|
|
* 规格排序
|
|
|
*/
|
|
*/
|
|
|
|
|
+ @SaCheckPermission("platform:update")
|
|
|
@PutMapping("/sorted")
|
|
@PutMapping("/sorted")
|
|
|
public Result<String> sorted(@RequestBody GoodsDonSku sku) {
|
|
public Result<String> sorted(@RequestBody GoodsDonSku sku) {
|
|
|
Long id = sku.getId();
|
|
Long id = sku.getId();
|