Browse Source

新增:定价管理模块。

lym 4 years ago
parent
commit
ea620b8bf5

+ 2 - 0
carbon-back/carbon-back-common/src/main/java/com/hcloud/microserver/system/facade/carbon/entity/ProductTypePrice.java

@@ -1,11 +1,13 @@
 package com.hcloud.microserver.system.facade.carbon.entity;
 
+import javax.validation.constraints.NotNull;
 import java.math.BigDecimal;
 import java.util.Date;
 
 public class ProductTypePrice {
     private String guid;
 
+    @NotNull(message = "定价不能为空!")
     private BigDecimal price;
 
     private String remark;

+ 4 - 0
carbon-back/carbon-back-common/src/main/java/com/hcloud/microserver/system/facade/carbon/entity/ProductTypePriceWithBLOBs.java

@@ -1,8 +1,12 @@
 package com.hcloud.microserver.system.facade.carbon.entity;
 
+import javax.validation.constraints.NotEmpty;
+
 public class ProductTypePriceWithBLOBs extends ProductTypePrice {
+    @NotEmpty(message = "类别id不能为空!")
     private String fkProductType;
 
+    @NotEmpty(message = "类别不能为空!")
     private String typeName;
 
     public String getFkProductType() {

+ 3 - 1
carbon-back/carbon-back-service/src/main/java/com/hcloud/microserver/system/bank/controller/ProductTypePriceController.java

@@ -15,6 +15,8 @@ import io.swagger.annotations.ApiResponse;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
+import javax.validation.Valid;
+
 @RestController
 @RequestMapping("/web/price")
 public class ProductTypePriceController extends BaseController {
@@ -28,7 +30,7 @@ public class ProductTypePriceController extends BaseController {
     })
     @ApiResponse(code = 0, message = "操作成功")
     @PostMapping("/save")
-    private ResponseBase save(@RequestBody ProductTypePriceWithBLOBs productTypePriceWithBLOBs){
+    private ResponseBase save(@RequestBody @Valid ProductTypePriceWithBLOBs productTypePriceWithBLOBs){
         int i = productTypePriceService.saveSelective(productTypePriceWithBLOBs);
         if (i < 1){
             return responseResultFailure();