|
|
@ -1,7 +1,10 @@ |
|
|
|
package com.epmet.modules.mine.controller; |
|
|
|
|
|
|
|
import com.epmet.commons.tools.annotation.LoginUser; |
|
|
|
import com.epmet.commons.tools.exception.EpmetErrorCode; |
|
|
|
import com.epmet.commons.tools.exception.EpmetException; |
|
|
|
import com.epmet.commons.tools.security.dto.TokenDto; |
|
|
|
import com.epmet.commons.tools.utils.IdCardRegexUtils; |
|
|
|
import com.epmet.commons.tools.utils.Result; |
|
|
|
import com.epmet.commons.tools.validator.ValidatorUtils; |
|
|
|
import com.epmet.dto.form.EditInfoFormDTO; |
|
|
@ -10,6 +13,7 @@ import com.epmet.dto.form.SendCodeFormDTO; |
|
|
|
import com.epmet.modules.mine.service.PersonalCenterService; |
|
|
|
import com.epmet.resi.mine.dto.result.InitInfoResultDTO; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.web.bind.annotation.PostMapping; |
|
|
|
import org.springframework.web.bind.annotation.RequestBody; |
|
|
@ -55,6 +59,12 @@ public class PersonalCenterController { |
|
|
|
formDTO.setUserId(tokenDto.getUserId()); |
|
|
|
formDTO.setCustomerId(tokenDto.getCustomerId()); |
|
|
|
ValidatorUtils.validateEntity(formDTO,EditInfoFormDTO.AddUserShowGroup.class,EditInfoFormDTO.AddUserInternalGroup.class); |
|
|
|
if (StringUtils.isNotBlank(formDTO.getIdNum())){ |
|
|
|
boolean b = IdCardRegexUtils.validateIdCard(formDTO.getIdNum()); |
|
|
|
if (!b){ |
|
|
|
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"请输入正确的证件号","请输入正确的证件号"); |
|
|
|
} |
|
|
|
} |
|
|
|
personalCenterService.editInfo(tokenDto, formDTO); |
|
|
|
return new Result(); |
|
|
|
} |
|
|
|