Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Y
yudao-cloud
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
hblj
yudao-cloud
Commits
748fe31c
提交
748fe31c
authored
5月 08, 2020
作者:
fansili
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
- 优化:修改 pom以来
- 删除:systemError 改为 useError
上级
739afb86
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
14 行增加
和
6 行删除
+14
-6
pom.xml
user/user-biz-api/pom.xml
+9
-1
pom.xml
user/user-biz/pom.xml
+1
-1
UserAddressServiceImpl.java
...er/mall/user/biz/service/user/UserAddressServiceImpl.java
+4
-4
没有找到文件。
user/user-biz-api/pom.xml
浏览文件 @
748fe31c
...
@@ -11,5 +11,12 @@
...
@@ -11,5 +11,12 @@
<artifactId>
user-biz-api
</artifactId>
<artifactId>
user-biz-api
</artifactId>
<dependencies>
<!-- Mall 相关 -->
<dependency>
<groupId>
cn.iocoder.mall
</groupId>
<artifactId>
common-framework
</artifactId>
<version>
1.0-SNAPSHOT
</version>
</dependency>
</dependencies>
</project>
</project>
\ No newline at end of file
user/user-biz/pom.xml
浏览文件 @
748fe31c
...
@@ -16,7 +16,7 @@
...
@@ -16,7 +16,7 @@
<!-- Mall 相关 -->
<!-- Mall 相关 -->
<dependency>
<dependency>
<groupId>
cn.iocoder.mall
</groupId>
<groupId>
cn.iocoder.mall
</groupId>
<artifactId>
system
-biz-api
</artifactId>
<artifactId>
user
-biz-api
</artifactId>
<version>
1.0-SNAPSHOT
</version>
<version>
1.0-SNAPSHOT
</version>
</dependency>
</dependency>
...
...
user/user-biz/src/main/java/cn/iocoder/mall/user/biz/service/user/UserAddressServiceImpl.java
浏览文件 @
748fe31c
...
@@ -2,13 +2,13 @@ package cn.iocoder.mall.user.biz.service.user;
...
@@ -2,13 +2,13 @@ package cn.iocoder.mall.user.biz.service.user;
import
cn.iocoder.common.framework.util.ServiceExceptionUtil
;
import
cn.iocoder.common.framework.util.ServiceExceptionUtil
;
import
cn.iocoder.mall.mybatis.enums.DeletedStatusEnum
;
import
cn.iocoder.mall.mybatis.enums.DeletedStatusEnum
;
import
cn.iocoder.mall.system.biz.enums.SystemErrorCodeEnum
;
import
cn.iocoder.mall.user.biz.bo.user.UserAddressBO
;
import
cn.iocoder.mall.user.biz.bo.user.UserAddressBO
;
import
cn.iocoder.mall.user.biz.convert.user.UserAddressConvert
;
import
cn.iocoder.mall.user.biz.convert.user.UserAddressConvert
;
import
cn.iocoder.mall.user.biz.dao.user.UserAddressMapper
;
import
cn.iocoder.mall.user.biz.dao.user.UserAddressMapper
;
import
cn.iocoder.mall.user.biz.dataobject.user.UsersUserAddressDO
;
import
cn.iocoder.mall.user.biz.dataobject.user.UsersUserAddressDO
;
import
cn.iocoder.mall.user.biz.dto.user.UserAddressAddDTO
;
import
cn.iocoder.mall.user.biz.dto.user.UserAddressAddDTO
;
import
cn.iocoder.mall.user.biz.dto.user.UserAddressUpdateDTO
;
import
cn.iocoder.mall.user.biz.dto.user.UserAddressUpdateDTO
;
import
cn.iocoder.mall.user.biz.enums.UserErrorCodeEnum
;
import
cn.iocoder.mall.user.biz.enums.user.UserAddressHasDefaultEnum
;
import
cn.iocoder.mall.user.biz.enums.user.UserAddressHasDefaultEnum
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
...
@@ -62,12 +62,12 @@ public class UserAddressServiceImpl implements UserAddressService {
...
@@ -62,12 +62,12 @@ public class UserAddressServiceImpl implements UserAddressService {
UsersUserAddressDO
userAddress
=
userAddressMapper
.
selectById
(
userAddressAddDTO
.
getId
());
UsersUserAddressDO
userAddress
=
userAddressMapper
.
selectById
(
userAddressAddDTO
.
getId
());
if
(
userAddress
==
null
)
{
if
(
userAddress
==
null
)
{
throw
ServiceExceptionUtil
.
exception
(
System
ErrorCodeEnum
.
USER_ADDRESS_NOT_EXISTENT
.
getCode
());
throw
ServiceExceptionUtil
.
exception
(
User
ErrorCodeEnum
.
USER_ADDRESS_NOT_EXISTENT
.
getCode
());
}
}
// 删除的地址不能更新
// 删除的地址不能更新
if
(
DeletedStatusEnum
.
DELETED_YES
.
getValue
().
equals
(
userAddress
.
getDeleted
()))
{
if
(
DeletedStatusEnum
.
DELETED_YES
.
getValue
().
equals
(
userAddress
.
getDeleted
()))
{
throw
ServiceExceptionUtil
.
exception
(
System
ErrorCodeEnum
.
USER_ADDRESS_IS_DELETED
.
getCode
());
throw
ServiceExceptionUtil
.
exception
(
User
ErrorCodeEnum
.
USER_ADDRESS_IS_DELETED
.
getCode
());
}
}
// 检查是否设置为默认地址
// 检查是否设置为默认地址
...
@@ -95,7 +95,7 @@ public class UserAddressServiceImpl implements UserAddressService {
...
@@ -95,7 +95,7 @@ public class UserAddressServiceImpl implements UserAddressService {
UsersUserAddressDO
userAddress
=
userAddressMapper
.
selectById
(
addressId
);
UsersUserAddressDO
userAddress
=
userAddressMapper
.
selectById
(
addressId
);
if
(
userAddress
==
null
)
{
if
(
userAddress
==
null
)
{
throw
ServiceExceptionUtil
.
exception
(
System
ErrorCodeEnum
.
USER_ADDRESS_NOT_EXISTENT
.
getCode
());
throw
ServiceExceptionUtil
.
exception
(
User
ErrorCodeEnum
.
USER_ADDRESS_NOT_EXISTENT
.
getCode
());
}
}
if
(
DeletedStatusEnum
.
DELETED_YES
.
getValue
().
equals
(
userAddress
.
getDeleted
()))
{
if
(
DeletedStatusEnum
.
DELETED_YES
.
getValue
().
equals
(
userAddress
.
getDeleted
()))
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论