商品模块代码提交
This commit is contained in:
@@ -1,10 +1,13 @@
|
||||
package com.czg.controller;
|
||||
|
||||
import com.czg.enums.CrudEnum;
|
||||
import com.czg.log.annotation.OperationLog;
|
||||
import com.czg.product.dto.ConsInfoDTO;
|
||||
import com.czg.product.param.ConsSubUnitParam;
|
||||
import com.czg.product.service.ConsInfoService;
|
||||
import com.czg.resp.CzgResult;
|
||||
import com.czg.utils.AssertUtil;
|
||||
import com.czg.validator.ValidatorUtil;
|
||||
import com.czg.validator.group.DefaultGroup;
|
||||
import com.czg.validator.group.InsertGroup;
|
||||
import com.czg.validator.group.UpdateGroup;
|
||||
@@ -146,4 +149,19 @@ public class ConsInfoController {
|
||||
consInfoService.onOffConsInfo(id, isStock);
|
||||
return CzgResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑副单位
|
||||
*/
|
||||
@PostMapping("modifySubUnit")
|
||||
@OperationLog("耗材信息-编辑副单位")
|
||||
//@SaAdminCheckPermission("consInfo:update")
|
||||
public CzgResult<Void> modifySubUnit(@RequestBody ConsSubUnitParam param) {
|
||||
ValidatorUtil.validateEntity(param, DefaultGroup.class);
|
||||
if (CrudEnum.ADD.value().equals(param.getModifyFlag())) {
|
||||
ValidatorUtil.validateEntity(param, InsertGroup.class);
|
||||
}
|
||||
consInfoService.modifySubUnit(param);
|
||||
return CzgResult.success();
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,12 @@
|
||||
package com.czg.controller.admin;
|
||||
|
||||
import com.czg.log.annotation.OperationLog;
|
||||
import com.czg.product.dto.ProdConsBindDTO;
|
||||
import com.czg.product.dto.ProdSkuDTO;
|
||||
import com.czg.product.dto.ProductDTO;
|
||||
import com.czg.product.param.ProductIsSaleParam;
|
||||
import com.czg.product.param.ProductIsSoldOutParam;
|
||||
import com.czg.product.service.ProdConsRelationService;
|
||||
import com.czg.product.service.ProductService;
|
||||
import com.czg.resp.CzgResult;
|
||||
import com.czg.utils.AssertUtil;
|
||||
@@ -31,6 +33,7 @@ import java.util.List;
|
||||
@RequestMapping("/admin/product")
|
||||
public class ProductController {
|
||||
private final ProductService productService;
|
||||
private final ProdConsRelationService prodConsRelationService;
|
||||
|
||||
@GetMapping("page")
|
||||
@OperationLog("商品-分页")
|
||||
@@ -90,7 +93,7 @@ public class ProductController {
|
||||
/**
|
||||
* 商品-上下架
|
||||
*/
|
||||
@PostMapping("/on-off")
|
||||
@PostMapping("on-off")
|
||||
@OperationLog("商品-上下架")
|
||||
//@SaAdminCheckPermission("product:on-off")
|
||||
public CzgResult<Void> onOffProduct(@RequestBody @Validated({DefaultGroup.class}) ProductIsSaleParam param) {
|
||||
@@ -101,7 +104,7 @@ public class ProductController {
|
||||
/**
|
||||
* 商品-标记售罄
|
||||
*/
|
||||
@PostMapping("/markIsSoldOut")
|
||||
@PostMapping("markIsSoldOut")
|
||||
@OperationLog("商品-标记售罄")
|
||||
//@SaAdminCheckPermission("product:markIsSoldOut")
|
||||
public CzgResult<Void> markIsSoldOutProduct(@RequestBody @Validated({DefaultGroup.class}) ProductIsSoldOutParam param) {
|
||||
@@ -109,4 +112,15 @@ public class ProductController {
|
||||
return CzgResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品-绑定耗材
|
||||
*/
|
||||
@PostMapping("bind")
|
||||
@OperationLog("商品-绑定耗材")
|
||||
//@SaAdminCheckPermission("product:bind")
|
||||
public CzgResult<Void> bindCons(@RequestBody @Validated({DefaultGroup.class}) ProdConsBindDTO param) {
|
||||
prodConsRelationService.saveProdConsRelation(param);
|
||||
return CzgResult.success();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user