修改 不传生日报错的问题
This commit is contained in:
@@ -39,6 +39,7 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.text.ParseException;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@@ -172,10 +173,10 @@ public class AShopUserServiceImpl implements AShopUserService {
|
||||
shopUser.setUserId(userInfo.getId());
|
||||
shopUser.setMainShopId(shopInfoService.getMainIdByShopId(shopId));
|
||||
shopUser.setJoinTime(shopUser.getIsVip() != null && shopUser.getIsVip() == 1 ? DateUtil.date().toLocalDateTime() : null);
|
||||
if (StrUtil.isBlank(shopUserAddDTO.getBirthDay())) {
|
||||
try {
|
||||
DateUtil.parse(shopUserAddDTO.getBirthDay(), "yyyy-MM-dd");
|
||||
} catch (Exception e) {
|
||||
shopUser.setBirthDay(null);
|
||||
} else {
|
||||
shopUser.setBirthDay(shopUserAddDTO.getBirthDay());
|
||||
}
|
||||
return shopUserService.save(shopUser);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user