Commit 8fa694a05c2bdce05e3b8a5f3ef9a5193944df65
1 parent
1dbd344e
init: 47项目迁移
Showing
11 changed files
with
30 additions
and
28 deletions
src/main/java/com/order/erp/common/constant/ServerResult.java
@@ -18,11 +18,11 @@ public class ServerResult<T> implements Serializable { | @@ -18,11 +18,11 @@ public class ServerResult<T> implements Serializable { | ||
18 | /** | 18 | /** |
19 | * 返回的状态码 | 19 | * 返回的状态码 |
20 | */ | 20 | */ |
21 | - private int result = com.canrd.shop.common.constant.ServerResultCode.SUCCESS.getErrorCode(); | 21 | + private int result = ServerResultCode.SUCCESS.getErrorCode(); |
22 | /** | 22 | /** |
23 | * 返回的消息 | 23 | * 返回的消息 |
24 | */ | 24 | */ |
25 | - private String message = com.canrd.shop.common.constant.ServerResultCode.SUCCESS.getErrorDesc(); | 25 | + private String message = ServerResultCode.SUCCESS.getErrorDesc(); |
26 | /** | 26 | /** |
27 | * 返回的数据实体 | 27 | * 返回的数据实体 |
28 | */ | 28 | */ |
@@ -56,7 +56,7 @@ public class ServerResult<T> implements Serializable { | @@ -56,7 +56,7 @@ public class ServerResult<T> implements Serializable { | ||
56 | return this; | 56 | return this; |
57 | } | 57 | } |
58 | 58 | ||
59 | - public ServerResult setResult(com.canrd.shop.common.constant.ServerResultCode serverResultCode) { | 59 | + public ServerResult setResult(ServerResultCode serverResultCode) { |
60 | this.result = serverResultCode.getErrorCode(); | 60 | this.result = serverResultCode.getErrorCode(); |
61 | this.message = serverResultCode.getErrorDesc(); | 61 | this.message = serverResultCode.getErrorDesc(); |
62 | return this; | 62 | return this; |
@@ -88,21 +88,21 @@ public class ServerResult<T> implements Serializable { | @@ -88,21 +88,21 @@ public class ServerResult<T> implements Serializable { | ||
88 | 88 | ||
89 | public static <T> ServerResult<T> success() { | 89 | public static <T> ServerResult<T> success() { |
90 | return new ServerResult() | 90 | return new ServerResult() |
91 | - .setResult(com.canrd.shop.common.constant.ServerResultCode.SUCCESS) | ||
92 | - .setMessage(com.canrd.shop.common.constant.ServerResultCode.SUCCESS.getErrorDesc()) | ||
93 | - .setData(defaultResult(com.canrd.shop.common.constant.ServerResultCode.SUCCESS)); | 91 | + .setResult(ServerResultCode.SUCCESS) |
92 | + .setMessage(ServerResultCode.SUCCESS.getErrorDesc()) | ||
93 | + .setData(defaultResult(ServerResultCode.SUCCESS)); | ||
94 | } | 94 | } |
95 | 95 | ||
96 | public static <T> ServerResult<T> success(T data) { | 96 | public static <T> ServerResult<T> success(T data) { |
97 | return new ServerResult() | 97 | return new ServerResult() |
98 | - .setResult(com.canrd.shop.common.constant.ServerResultCode.SUCCESS) | ||
99 | - .setMessage(com.canrd.shop.common.constant.ServerResultCode.SUCCESS.getErrorDesc()) | 98 | + .setResult(ServerResultCode.SUCCESS) |
99 | + .setMessage(ServerResultCode.SUCCESS.getErrorDesc()) | ||
100 | .setData(data); | 100 | .setData(data); |
101 | } | 101 | } |
102 | 102 | ||
103 | public static <T> ServerResult<T> success(T data, String message) { | 103 | public static <T> ServerResult<T> success(T data, String message) { |
104 | return new ServerResult() | 104 | return new ServerResult() |
105 | - .setResult(com.canrd.shop.common.constant.ServerResultCode.SUCCESS) | 105 | + .setResult(ServerResultCode.SUCCESS) |
106 | .setMessage(message) | 106 | .setMessage(message) |
107 | .setData(data); | 107 | .setData(data); |
108 | } | 108 | } |
@@ -114,7 +114,7 @@ public class ServerResult<T> implements Serializable { | @@ -114,7 +114,7 @@ public class ServerResult<T> implements Serializable { | ||
114 | */ | 114 | */ |
115 | public static <T> ServerResult<T> fail(String message) { | 115 | public static <T> ServerResult<T> fail(String message) { |
116 | return new ServerResult() | 116 | return new ServerResult() |
117 | - .setResult(com.canrd.shop.common.constant.ServerResultCode.FAIL) | 117 | + .setResult(ServerResultCode.FAIL) |
118 | .setMessage(message) | 118 | .setMessage(message) |
119 | .setData(defaultResult(Constant.RESULT_FAIL)); | 119 | .setData(defaultResult(Constant.RESULT_FAIL)); |
120 | } | 120 | } |
@@ -126,7 +126,7 @@ public class ServerResult<T> implements Serializable { | @@ -126,7 +126,7 @@ public class ServerResult<T> implements Serializable { | ||
126 | * @param <T> | 126 | * @param <T> |
127 | * @return | 127 | * @return |
128 | */ | 128 | */ |
129 | - public static <T> ServerResult<T> fail(T data, com.canrd.shop.common.constant.ServerResultCode serverResultCode) { | 129 | + public static <T> ServerResult<T> fail(T data, ServerResultCode serverResultCode) { |
130 | return new ServerResult() | 130 | return new ServerResult() |
131 | .setData(data) | 131 | .setData(data) |
132 | .setResult(serverResultCode) | 132 | .setResult(serverResultCode) |
@@ -152,7 +152,7 @@ public class ServerResult<T> implements Serializable { | @@ -152,7 +152,7 @@ public class ServerResult<T> implements Serializable { | ||
152 | * @author dengbin | 152 | * @author dengbin |
153 | * @date 2020/9/12 | 153 | * @date 2020/9/12 |
154 | */ | 154 | */ |
155 | - public static <T> ServerResult<T> fail(com.canrd.shop.common.constant.ServerResultCode serverResultCode, String msg) { | 155 | + public static <T> ServerResult<T> fail(ServerResultCode serverResultCode, String msg) { |
156 | return new ServerResult() | 156 | return new ServerResult() |
157 | .setResult(serverResultCode) | 157 | .setResult(serverResultCode) |
158 | .setMessage(msg) | 158 | .setMessage(msg) |
@@ -165,7 +165,7 @@ public class ServerResult<T> implements Serializable { | @@ -165,7 +165,7 @@ public class ServerResult<T> implements Serializable { | ||
165 | * @author dengbin | 165 | * @author dengbin |
166 | * @date 2020/9/12 | 166 | * @date 2020/9/12 |
167 | */ | 167 | */ |
168 | - public static <T> ServerResult<T> fail(com.canrd.shop.common.constant.ServerResultCode serverResultCode) { | 168 | + public static <T> ServerResult<T> fail(ServerResultCode serverResultCode) { |
169 | return new ServerResult() | 169 | return new ServerResult() |
170 | .setResult(serverResultCode) | 170 | .setResult(serverResultCode) |
171 | .setMessage(serverResultCode.getErrorDesc()) | 171 | .setMessage(serverResultCode.getErrorDesc()) |
@@ -188,8 +188,8 @@ public class ServerResult<T> implements Serializable { | @@ -188,8 +188,8 @@ public class ServerResult<T> implements Serializable { | ||
188 | 188 | ||
189 | public static <T> ServerResult<T> fail() { | 189 | public static <T> ServerResult<T> fail() { |
190 | return new ServerResult() | 190 | return new ServerResult() |
191 | - .setResult(com.canrd.shop.common.constant.ServerResultCode.FAIL.getErrorCode()) | ||
192 | - .setMessage(com.canrd.shop.common.constant.ServerResultCode.FAIL.getErrorDesc()) | 191 | + .setResult(ServerResultCode.FAIL.getErrorCode()) |
192 | + .setMessage(ServerResultCode.FAIL.getErrorDesc()) | ||
193 | .setData(defaultResult(Constant.RESULT_FAIL)); | 193 | .setData(defaultResult(Constant.RESULT_FAIL)); |
194 | } | 194 | } |
195 | 195 | ||
@@ -199,7 +199,7 @@ public class ServerResult<T> implements Serializable { | @@ -199,7 +199,7 @@ public class ServerResult<T> implements Serializable { | ||
199 | * @author dengbin | 199 | * @author dengbin |
200 | * @date 2020/9/12 | 200 | * @date 2020/9/12 |
201 | */ | 201 | */ |
202 | - public ServerResult failEnum(com.canrd.shop.common.constant.ServerResultCode serverResultCode) { | 202 | + public ServerResult failEnum(ServerResultCode serverResultCode) { |
203 | setResult(serverResultCode); | 203 | setResult(serverResultCode); |
204 | setMessage(serverResultCode.getErrorDesc()); | 204 | setMessage(serverResultCode.getErrorDesc()); |
205 | return this; | 205 | return this; |
@@ -218,7 +218,7 @@ public class ServerResult<T> implements Serializable { | @@ -218,7 +218,7 @@ public class ServerResult<T> implements Serializable { | ||
218 | * @return 结果 ture or false | 218 | * @return 结果 ture or false |
219 | */ | 219 | */ |
220 | public boolean checkSuccess() { | 220 | public boolean checkSuccess() { |
221 | - return result == com.canrd.shop.common.constant.ServerResultCode.SUCCESS.getErrorCode(); | 221 | + return result == ServerResultCode.SUCCESS.getErrorCode(); |
222 | } | 222 | } |
223 | 223 | ||
224 | public boolean checkNotSuccess() { | 224 | public boolean checkNotSuccess() { |
src/main/java/com/order/erp/common/excel4j/ExcelValidator.java
1 | package com.order.erp.common.excel4j; | 1 | package com.order.erp.common.excel4j; |
2 | 2 | ||
3 | import com.order.erp.common.constant.Constant; | 3 | import com.order.erp.common.constant.Constant; |
4 | +import com.order.erp.common.constant.ServerResultCode; | ||
4 | import com.order.erp.common.exception.BusinessException; | 5 | import com.order.erp.common.exception.BusinessException; |
5 | import com.order.erp.common.utils.StringUtils; | 6 | import com.order.erp.common.utils.StringUtils; |
6 | import lombok.extern.slf4j.Slf4j; | 7 | import lombok.extern.slf4j.Slf4j; |
@@ -30,7 +31,7 @@ public class ExcelValidator { | @@ -30,7 +31,7 @@ public class ExcelValidator { | ||
30 | Set<ConstraintViolation<T>> set = validator.validate(obj, Default.class); | 31 | Set<ConstraintViolation<T>> set = validator.validate(obj, Default.class); |
31 | String err = collectError(set); | 32 | String err = collectError(set); |
32 | if (StringUtils.isNotBlank(err)){ | 33 | if (StringUtils.isNotBlank(err)){ |
33 | - throw new BusinessException(com.canrd.shop.common.constant.ServerResultCode.ILLEGAL_ARGUMENT.getErrorCode(),err); | 34 | + throw new BusinessException(ServerResultCode.ILLEGAL_ARGUMENT.getErrorCode(),err); |
34 | } | 35 | } |
35 | } | 36 | } |
36 | 37 |
src/main/java/com/order/erp/common/exception/BusinessException.java
1 | package com.order.erp.common.exception; | 1 | package com.order.erp.common.exception; |
2 | 2 | ||
3 | -import com.canrd.shop.common.constant.ServerResultCode; | ||
4 | import com.order.erp.common.constant.ServerResult; | 3 | import com.order.erp.common.constant.ServerResult; |
4 | +import com.order.erp.common.constant.ServerResultCode; | ||
5 | import lombok.Getter; | 5 | import lombok.Getter; |
6 | import lombok.Setter; | 6 | import lombok.Setter; |
7 | import lombok.extern.slf4j.Slf4j; | 7 | import lombok.extern.slf4j.Slf4j; |
src/main/java/com/order/erp/common/exception/BusinessExceptionHandlerAdvice.java
1 | package com.order.erp.common.exception; | 1 | package com.order.erp.common.exception; |
2 | 2 | ||
3 | -import com.canrd.shop.common.constant.ServerResultCode; | 3 | +import com.order.erp.common.constant.ServerResultCode; |
4 | import com.order.erp.common.constant.ServerResult; | 4 | import com.order.erp.common.constant.ServerResult; |
5 | import org.springframework.core.annotation.Order; | 5 | import org.springframework.core.annotation.Order; |
6 | import org.springframework.http.HttpStatus; | 6 | import org.springframework.http.HttpStatus; |
src/main/java/com/order/erp/common/exception/handler/GlobalExceptionHandler.java
1 | package com.order.erp.common.exception.handler; | 1 | package com.order.erp.common.exception.handler; |
2 | 2 | ||
3 | 3 | ||
4 | -import com.canrd.shop.common.constant.ServerResultCode; | 4 | +import com.order.erp.common.constant.ServerResultCode; |
5 | import com.order.erp.common.constant.ServerResult; | 5 | import com.order.erp.common.constant.ServerResult; |
6 | import com.order.erp.common.exception.BusinessException; | 6 | import com.order.erp.common.exception.BusinessException; |
7 | import com.order.erp.common.exception.EntityExistException; | 7 | import com.order.erp.common.exception.EntityExistException; |
src/main/java/com/order/erp/common/utils/ImgCaptchaUtils.java
1 | package com.order.erp.common.utils; | 1 | package com.order.erp.common.utils; |
2 | 2 | ||
3 | import cn.hutool.core.util.IdUtil; | 3 | import cn.hutool.core.util.IdUtil; |
4 | +import com.order.erp.common.constant.ServerResultCode; | ||
4 | import com.order.erp.common.exception.BusinessException; | 5 | import com.order.erp.common.exception.BusinessException; |
5 | import com.order.erp.security.config.SecurityProperties; | 6 | import com.order.erp.security.config.SecurityProperties; |
6 | import lombok.extern.slf4j.Slf4j; | 7 | import lombok.extern.slf4j.Slf4j; |
@@ -34,10 +35,10 @@ public class ImgCaptchaUtils { | @@ -34,10 +35,10 @@ public class ImgCaptchaUtils { | ||
34 | // 清除验证码 | 35 | // 清除验证码 |
35 | redisUtil.delete(imgCaptchaUuid); | 36 | redisUtil.delete(imgCaptchaUuid); |
36 | if (StringUtils.isBlank(code)) { | 37 | if (StringUtils.isBlank(code)) { |
37 | - throw new BusinessException(com.canrd.shop.common.constant.ServerResultCode.IMG_CAPTCHA_EXPIRE_ERROR); | 38 | + throw new BusinessException(ServerResultCode.IMG_CAPTCHA_EXPIRE_ERROR); |
38 | } | 39 | } |
39 | if (StringUtils.isBlank(imgCaptchaCode) || !imgCaptchaCode.equalsIgnoreCase(code)) { | 40 | if (StringUtils.isBlank(imgCaptchaCode) || !imgCaptchaCode.equalsIgnoreCase(code)) { |
40 | - throw new BusinessException(com.canrd.shop.common.constant.ServerResultCode.IMG_CAPTCHA_ERROR); | 41 | + throw new BusinessException(ServerResultCode.IMG_CAPTCHA_ERROR); |
41 | } | 42 | } |
42 | } | 43 | } |
43 | 44 |
src/main/java/com/order/erp/common/utils/SecurityUtils.java
1 | package com.order.erp.common.utils; | 1 | package com.order.erp.common.utils; |
2 | 2 | ||
3 | import cn.hutool.json.JSONObject; | 3 | import cn.hutool.json.JSONObject; |
4 | -import com.canrd.shop.common.constant.ServerResultCode; | 4 | +import com.order.erp.common.constant.ServerResultCode; |
5 | import com.order.erp.common.exception.BusinessException; | 5 | import com.order.erp.common.exception.BusinessException; |
6 | import org.springframework.security.core.context.SecurityContextHolder; | 6 | import org.springframework.security.core.context.SecurityContextHolder; |
7 | import org.springframework.security.core.userdetails.UserDetails; | 7 | import org.springframework.security.core.userdetails.UserDetails; |
src/main/java/com/order/erp/common/utils/SmsUtils.java
@@ -7,7 +7,7 @@ import com.aliyuncs.DefaultAcsClient; | @@ -7,7 +7,7 @@ import com.aliyuncs.DefaultAcsClient; | ||
7 | import com.aliyuncs.IAcsClient; | 7 | import com.aliyuncs.IAcsClient; |
8 | import com.aliyuncs.http.MethodType; | 8 | import com.aliyuncs.http.MethodType; |
9 | import com.aliyuncs.profile.DefaultProfile; | 9 | import com.aliyuncs.profile.DefaultProfile; |
10 | -import com.canrd.shop.common.constant.ServerResultCode; | 10 | +import com.order.erp.common.constant.ServerResultCode; |
11 | import com.google.common.collect.Maps; | 11 | import com.google.common.collect.Maps; |
12 | import com.order.erp.common.constant.Constant; | 12 | import com.order.erp.common.constant.Constant; |
13 | import com.order.erp.common.constant.ServerResult; | 13 | import com.order.erp.common.constant.ServerResult; |
src/main/java/com/order/erp/service/admin/impl/AdminUserServiceImpl.java
@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; | @@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; | ||
9 | import com.baomidou.mybatisplus.core.toolkit.StringUtils; | 9 | import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
10 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | 10 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
11 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | 11 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
12 | -import com.canrd.shop.common.constant.ServerResultCode; | 12 | +import com.order.erp.common.constant.ServerResultCode; |
13 | import com.order.erp.common.constant.Constant; | 13 | import com.order.erp.common.constant.Constant; |
14 | import com.order.erp.common.constant.ServerResult; | 14 | import com.order.erp.common.constant.ServerResult; |
15 | import com.order.erp.common.exception.BusinessException; | 15 | import com.order.erp.common.exception.BusinessException; |
src/main/java/com/order/erp/service/order/impl/OrderBaseInfoServiceImpl.java
@@ -10,7 +10,7 @@ import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; | @@ -10,7 +10,7 @@ import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; | ||
10 | import com.baomidou.mybatisplus.core.toolkit.StringUtils; | 10 | import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
11 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | 11 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
12 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | 12 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
13 | -import com.canrd.shop.common.constant.ServerResultCode; | 13 | +import com.order.erp.common.constant.ServerResultCode; |
14 | import com.order.erp.common.constant.Constant; | 14 | import com.order.erp.common.constant.Constant; |
15 | import com.order.erp.common.constant.ServerResult; | 15 | import com.order.erp.common.constant.ServerResult; |
16 | import com.order.erp.common.excel4j.ExcelUtils; | 16 | import com.order.erp.common.excel4j.ExcelUtils; |
src/main/java/com/order/erp/service/order/impl/OrderFieldLockApplyServiceImpl.java
@@ -10,7 +10,7 @@ import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; | @@ -10,7 +10,7 @@ import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; | ||
10 | import com.baomidou.mybatisplus.core.toolkit.StringUtils; | 10 | import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
11 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | 11 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
12 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | 12 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
13 | -import com.canrd.shop.common.constant.ServerResultCode; | 13 | +import com.order.erp.common.constant.ServerResultCode; |
14 | import com.order.erp.common.constant.Constant; | 14 | import com.order.erp.common.constant.Constant; |
15 | import com.order.erp.common.constant.ServerResult; | 15 | import com.order.erp.common.constant.ServerResult; |
16 | import com.order.erp.common.exception.BusinessException; | 16 | import com.order.erp.common.exception.BusinessException; |