renruixin vor 3 Jahren
Ursprung
Commit
ebd0a7ccad

+ 2 - 0
src/main/java/com/metro/entity/ro/Police/DetailPoliceReq.java

@@ -4,6 +4,7 @@ import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
+import javax.validation.constraints.NotNull;
 import java.io.Serializable;
 
 /**
@@ -19,6 +20,7 @@ import java.io.Serializable;
 public class DetailPoliceReq  implements Serializable {
 
     @ApiModelProperty("id")
+    @NotNull(message = "id不能为空")
     private Integer id;
 
 }

+ 2 - 4
src/main/java/com/metro/entity/ro/Police/UpdatePoliceReq.java

@@ -4,6 +4,7 @@ import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
 import javax.validation.constraints.NotEmpty;
+import javax.validation.constraints.NotNull;
 import java.io.Serializable;
 
 /**
@@ -18,7 +19,7 @@ import java.io.Serializable;
 public class UpdatePoliceReq implements Serializable {
 
     @ApiModelProperty(value = "id")
-    @NotEmpty(message = "id不能为空")
+    @NotNull(message = "id不能为空")
     private Integer id;
 
     @ApiModelProperty(value = "账号")
@@ -41,9 +42,6 @@ public class UpdatePoliceReq implements Serializable {
     @ApiModelProperty(value = "密码")
     private String password;
 
-    @ApiModelProperty(value = "用户等级(3:派出所管理员)",hidden = true)
-    private Integer type = 3;
-
     @NotEmpty(message = "详细地址不能为空")
     @ApiModelProperty(value = "详细地址")
     private String address;

+ 2 - 2
src/main/java/com/metro/service/impl/PoliceServiceImpl.java

@@ -120,8 +120,8 @@ public class PoliceServiceImpl extends BaseService implements PoliceService {
         if (getAccountInfo().getType() != 2) throw new BusinessException("非分局管理员不能修改!");
         Company selectOne = companysMapper.selectOne(new LambdaQueryWrapper<Company>().eq(Company::getId, req.getId()));
         if (ObjectUtils.isEmpty(selectOne)) throw new BusinessException("未获取到派出所信息");
-        Police police = mapper.selectList(new LambdaQueryWrapper<Police>().eq(Police::getId, selectOne.getId()).eq(Police::getIsDelete, UserConstant.NOT_DELETE)).stream().findFirst().orElse(null);
-        return MapperManager.mapper(police, DetailPoliceResp.class, p -> p.setBranchName(selectOne.getBranchName()));
+        Police police = mapper.selectList(new LambdaQueryWrapper<Police>().eq(Police::getCompanyId, selectOne.getId()).eq(Police::getIsDelete, UserConstant.NOT_DELETE)).stream().findFirst().orElse(null);
+        return MapperManager.mapper(police, DetailPoliceResp.class, p -> p.setBranchName(ObjectUtil.isEmpty(selectOne.getBranchName()) ? null : selectOne.getBranchName()));
     }
 
     /*