From 6f853e4653c86fd075942d0824c4c8dc0fdd6f3f Mon Sep 17 00:00:00 2001 From: Xusan <1105644308@QQ.COM> Date: Tue, 14 May 2024 17:00:57 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=9A=E8=AE=AF=E5=BD=95=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 1 - .../com/whdc/controller/AddressBookController.java | 14 +++++++++++++- src/main/java/com/whdc/model/dto/CommDto.java | 2 ++ src/main/java/com/whdc/model/entity/AbUdR.java | 4 ++++ .../java/com/whdc/model/entity/AddressBook.java | 1 + 5 files changed, 20 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index affaabb..3e656e9 100644 --- a/pom.xml +++ b/pom.xml @@ -198,7 +198,6 @@ 1.30.0 - diff --git a/src/main/java/com/whdc/controller/AddressBookController.java b/src/main/java/com/whdc/controller/AddressBookController.java index 8c73d7a..329fd4d 100644 --- a/src/main/java/com/whdc/controller/AddressBookController.java +++ b/src/main/java/com/whdc/controller/AddressBookController.java @@ -11,6 +11,7 @@ import com.whdc.model.group.Find; import com.whdc.model.group.Insert; import com.whdc.model.group.Update; import com.whdc.service.IAddressBookService; +import com.whdc.service.IOrganizationService; import com.whdc.service.IUserService; import com.whdc.service.IVersionsService; import com.whdc.utils.ResultJson; @@ -18,6 +19,7 @@ import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -43,6 +45,9 @@ public class AddressBookController { @Autowired private IVersionsService versionsService; + @Autowired + private IOrganizationService organizationsService; + // @ApiOperation(value = "查询所有") @@ -89,7 +94,14 @@ public class AddressBookController { boolean save = service.save(model); if (save){ - userService.register( model.getPhone(), model.getId()); + // 没有手机号用名字注册 + if ("省防指".equals(organizationsService.getById(model.getOrganization()).getName()) + && StringUtils.isBlank(model.getPhone())){ + + userService.register( model.getName(), model.getId()); + }else{ + userService.register( model.getPhone(), model.getId()); + } } return ResultJson.ok(save); diff --git a/src/main/java/com/whdc/model/dto/CommDto.java b/src/main/java/com/whdc/model/dto/CommDto.java index e0fcb6b..6558ab8 100644 --- a/src/main/java/com/whdc/model/dto/CommDto.java +++ b/src/main/java/com/whdc/model/dto/CommDto.java @@ -1,12 +1,14 @@ package com.whdc.model.dto; import io.swagger.annotations.ApiModelProperty; +import lombok.Data; /** * @Author xusan * @Date 2024/5/14 15:17 * @Notes **/ +@Data public class CommDto extends FindPageDto { diff --git a/src/main/java/com/whdc/model/entity/AbUdR.java b/src/main/java/com/whdc/model/entity/AbUdR.java index ba05ecf..082678f 100644 --- a/src/main/java/com/whdc/model/entity/AbUdR.java +++ b/src/main/java/com/whdc/model/entity/AbUdR.java @@ -39,4 +39,8 @@ public class AbUdR extends Model implements Serializable { @TableField("SORT") @ApiModelProperty(value = "序号") private Integer sort; + + @TableField("TYPE") + @ApiModelProperty(value = "0:组织,1:单位") + private String type; } \ No newline at end of file diff --git a/src/main/java/com/whdc/model/entity/AddressBook.java b/src/main/java/com/whdc/model/entity/AddressBook.java index 5206194..9c7b26b 100644 --- a/src/main/java/com/whdc/model/entity/AddressBook.java +++ b/src/main/java/com/whdc/model/entity/AddressBook.java @@ -84,4 +84,5 @@ public class AddressBook extends Model implements Serializable { @TableField(exist = false) @ApiModelProperty(value = "创建人id") private String createId; + } \ No newline at end of file