Explorar o código

Merge remote-tracking branch 'origin/20210716' into 20210716

hym %!s(int64=3) %!d(string=hai) anos
pai
achega
b99c182938

+ 4 - 4
zoniot-rmcp/zoniot-rmcp-api/src/main/java/com/zcxk/rmcp/api/dto/device/DeviceInputDto.java

@@ -21,22 +21,22 @@ public class DeviceInputDto {
     @ApiModelProperty(value="编号")
     private Long id;
 
-    @NotNull(message = "companyOrgId cannot be empty")
+    @NotNull(message = "companyOrgId cannot be null")
     @ApiModelProperty(value="公司")
     private Integer companyOrgId;
 
     @ApiModelProperty(value="部门")
     private Integer deptOrgId;
 
-    @NotNull(message = "productId cannot be empty")
+    @NotNull(message = "productId cannot be null")
     @ApiModelProperty(value="产品")
     private Integer productId;
 
-    @NotBlank(message = "deviceNo cannot be empty")
+    @NotBlank(message = "deviceNo cannot be blank")
     @ApiModelProperty(value="设备编号")
     private String deviceNo;
 
-    @NotBlank(message = "meterNo cannot be empty")
+    @NotBlank(message = "meterNo cannot be blank")
     @ApiModelProperty(value="电子号")
     private String meterNo;
 

+ 5 - 0
zoniot-rmcp/zoniot-rmcp-api/src/main/java/com/zcxk/rmcp/api/dto/install/InstallInputDto.java

@@ -3,12 +3,16 @@ package com.zcxk.rmcp.api.dto.install;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+
 /**
  * @author linqingwei
  * @date 2021-07-27 15:32
  */
 @Data
 public class InstallInputDto {
+    @NotNull(message = "id cannot be null")
     @ApiModelProperty(value="编号")
     private Integer id;
 
@@ -18,6 +22,7 @@ public class InstallInputDto {
     @ApiModelProperty(value="设备编号")
     private String deviceNo;
 
+    @NotBlank(message = "meterNo cannot be blank")
     @ApiModelProperty(value="电子号")
     private String meterNo;
 

+ 4 - 0
zoniot-rmcp/zoniot-rmcp-api/src/main/java/com/zcxk/rmcp/api/dto/install/InstallPlanInputDto.java

@@ -3,6 +3,7 @@ package com.zcxk.rmcp.api.dto.install;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
+import javax.validation.constraints.NotNull;
 import java.math.BigDecimal;
 import java.util.List;
 
@@ -18,15 +19,18 @@ public class InstallPlanInputDto {
     @ApiModelProperty(value="计划名称")
     private String planName;
 
+    @NotNull(message = "communityId cannot be null")
     @ApiModelProperty(value="小区")
     private Integer communityId;
 
+    @NotNull(message = "companyOrgId cannot be null")
     @ApiModelProperty(value="公司")
     private Integer companyOrgId;
 
     @ApiModelProperty(value="部门")
     private Integer deptOrgId;
 
+    @NotNull(message = "productId cannot be null")
     @ApiModelProperty(value="产品")
     private Integer productId;
 

+ 1 - 1
zoniot-rmcp/zoniot-rmcp-web/src/main/java/com/zcxk/rmcp/web/controller/DeviceController.java

@@ -117,7 +117,7 @@ public class DeviceController {
     @ApiOperation(value = "下载Execl模板", notes = "下载Execl模板")
     public void downTemplate(
             @ApiParam(value = "分类id", required = true) @RequestParam(required = true) Integer categoryId,
-            @ApiParam(value = "access_token", required = true) @RequestParam(required = true) String accessToken,
+            @ApiParam(value = "access_token", required = true) @RequestParam(required = true) String access_token,
             HttpServletRequest request, HttpServletResponse response
     ) {
         deviceService.downTemplate(categoryId, response);

+ 4 - 4
zoniot-rmcp/zoniot-rmcp-web/src/main/java/com/zcxk/rmcp/web/controller/InstallController.java

@@ -55,14 +55,14 @@ public class InstallController {
 
     @PostMapping("save")
     @ApiOperation(value = "新装水表保存")
-    public AjaxMessage<Void> installSave(@ApiParam(value = "装表", required = true) @RequestBody(required = true) InstallInputDto dto){
+    public AjaxMessage<Void> installSave(@ApiParam(value = "装表", required = true) @RequestBody(required = true) @Valid InstallInputDto dto){
         installListService.installSave(dto);
         return AjaxMessage.success();
     }
 
     @PostMapping("edit")
     @ApiOperation(value = "新装水表编辑")
-    public AjaxMessage<Void> installEdit(@ApiParam(value = "装表", required = true) @RequestBody(required = true)  InstallInputDto dto){
+    public AjaxMessage<Void> installEdit(@ApiParam(value = "装表", required = true) @RequestBody(required = true) @Valid InstallInputDto dto){
         installListService.installEdit(dto);
         return AjaxMessage.success();
     }
@@ -80,7 +80,7 @@ public class InstallController {
     @PostMapping("batchAccept")
     @ApiOperation(value = "批量验收")
     public AjaxMessage<Void> batchAccept(
-            @ApiParam(value = "安装id", required = true) @RequestParam(required = true) List<Integer> ids
+            @ApiParam(value = "安装id", required = true) @RequestBody(required = true) List<Integer> ids
             ){
         installListService.batchAccept(ids);
         return AjaxMessage.success();
@@ -98,7 +98,7 @@ public class InstallController {
     @PostMapping("batchDelete")
     @ApiOperation(value = "批量删除")
     public AjaxMessage<Void> batchDelete(
-            @ApiParam(value = "安装id", required = true) @RequestParam(required = true) List<Integer> ids
+            @ApiParam(value = "安装id", required = true) @RequestBody(required = true) List<Integer> ids
     ){
         installListService.batchDelete(ids);
         return AjaxMessage.success();

+ 3 - 2
zoniot-rmcp/zoniot-rmcp-web/src/main/java/com/zcxk/rmcp/web/controller/InstallPlanController.java

@@ -21,6 +21,7 @@ import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
+import javax.validation.Valid;
 import java.util.List;
 
 /**
@@ -66,7 +67,7 @@ public class InstallPlanController {
     @PostMapping("add")
     @ApiOperation(value = "添加安装计划")
     public AjaxMessage<Void> add(
-            @ApiParam(value = "安装计划", required = true) @RequestBody(required = true) InstallPlanInputDto installPlanInput
+            @ApiParam(value = "安装计划", required = true) @RequestBody(required = true) @Valid InstallPlanInputDto installPlanInput
     ) {
         installPlanService.add(installPlanInput);
         return AjaxMessage.success();
@@ -75,7 +76,7 @@ public class InstallPlanController {
     @PostMapping("batchDel")
     @ApiOperation(value = "批量删除安装计划")
     public AjaxMessage<Void> batchDel(
-            @ApiParam(value = "安装计划id", required = true) @RequestParam(required = true)  List<Integer> ids
+            @ApiParam(value = "安装计划id", required = true) @RequestBody(required = true)  List<Integer> ids
     ) {
         installPlanService.batchDelete(ids);
         return AjaxMessage.success();