Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cloud-platform
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
youjj
cloud-platform
Commits
6d50a7f4
Commit
6d50a7f4
authored
Aug 15, 2019
by
jiaorz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加积分补充接口
parent
54bae5c0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
58 additions
and
0 deletions
+58
-0
StringToolsUtil.java
.../github/wxiaoqi/security/common/util/StringToolsUtil.java
+43
-0
ResCode.java
...a/com/xxfc/platform/vehicle/constant/ResCode/ResCode.java
+2
-0
VehicleActiveService.java
...a/com/xxfc/platform/vehicle/biz/VehicleActiveService.java
+13
-0
No files found.
ace-common/src/main/java/com/github/wxiaoqi/security/common/util/StringToolsUtil.java
0 → 100644
View file @
6d50a7f4
package
com
.
github
.
wxiaoqi
.
security
.
common
.
util
;
import
org.apache.commons.lang3.StringUtils
;
import
java.util.regex.Matcher
;
import
java.util.regex.Pattern
;
public
class
StringToolsUtil
{
/**
* 验证手机号码
* @param mobiles
* @return
*/
public
static
boolean
isMobileNO
(
String
mobiles
){
boolean
flag
=
false
;
try
{
if
(
StringUtils
.
isBlank
(
mobiles
))
{
flag
=
false
;
}
Pattern
regex
=
Pattern
.
compile
(
"^((16[0-9])|(13[0-9])|(15[^4,\\D])|(17[0-9])|(18[0-9])|(19[0-9]))\\d{8}$"
);
Matcher
m
=
regex
.
matcher
(
mobiles
);
flag
=
m
.
matches
();
}
catch
(
Exception
e
){
flag
=
false
;
}
return
flag
;
}
/**
* 校验身份证
*
* @param idCard
* @return 校验通过返回true,否则返回false
*/
public
static
boolean
isIDCard
(
String
idCard
)
{
if
(
StringUtils
.
isBlank
(
idCard
))
{
return
false
;
}
String
REGEX_ID_CARD
=
"(^\\d{18}$)|(^\\d{15}$)"
;
return
Pattern
.
matches
(
REGEX_ID_CARD
,
idCard
);
}
}
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/constant/ResCode/ResCode.java
View file @
6d50a7f4
...
...
@@ -24,6 +24,8 @@ public enum ResCode {
VEHICLE_BOOKED_RECORD_STATUS_CHANGED
(
103002
,
"车辆预定申请状态已变更"
),
VEHICLE_BOOKED_RECORD_MILEAGE_CHANGED
(
103003
,
"请输入仪表盘内当前显示的公里数"
),
CHECKUSER_AND_PHONE_NOT_NULL
(
103999
,
"收车或交车人姓名和电话不能为空"
),
USERNAME_AND_TELE_NOT_NULL
(
104000
,
"使用人和电话不能为空"
),
VEHICLE_DEPARTURE_VEHICLE_UNEXIST
(
104001
,
"车辆不存在"
),
VEHICLE_DEPARTURE_VEHICLE_DISABLE
(
104002
,
"车辆不可用"
),
VEHICLE_DEPARTURE_VEHICLE_UNDEPARTURE
(
104003
,
"车辆未出车"
),
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/VehicleActiveService.java
View file @
6d50a7f4
...
...
@@ -10,6 +10,7 @@ import com.xxfc.platform.vehicle.constant.VehicleStatus;
import
com.xxfc.platform.vehicle.entity.*
;
import
com.xxfc.platform.vehicle.mapper.*
;
import
com.xxfc.platform.vehicle.pojo.*
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
...
...
@@ -55,6 +56,14 @@ public class VehicleActiveService {
throw
new
BaseException
(
ResCode
.
VEHICLE_DEPARTURE_VEHICLE_UNEXIST
.
getDesc
(),
ResCode
.
VEHICLE_DEPARTURE_VEHICLE_UNEXIST
.
getCode
());
}
if
(
StringUtils
.
isBlank
(
departureVo
.
getUser
())
||
StringUtils
.
isBlank
(
departureVo
.
getUserTel
()))
{
throw
new
BaseException
(
ResCode
.
USERNAME_AND_TELE_NOT_NULL
.
getDesc
(),
ResCode
.
USERNAME_AND_TELE_NOT_NULL
.
getCode
());
}
if
(
StringUtils
.
isBlank
(
departureVo
.
getCheckMan
())
||
StringUtils
.
isBlank
(
departureVo
.
getCheckManTel
()))
{
throw
new
BaseException
(
ResCode
.
CHECKUSER_AND_PHONE_NOT_NULL
.
getDesc
(),
ResCode
.
CHECKUSER_AND_PHONE_NOT_NULL
.
getCode
());
}
if
(!
vehicle
.
getStatus
().
equals
(
VehicleStatus
.
NORMAL
.
getCode
()))
{
throw
new
BaseException
(
ResCode
.
VEHICLE_DEPARTURE_VEHICLE_DISABLE
.
getDesc
()
+
", 车辆状态是:"
+
getVehicleStatus
(
vehicle
.
getStatus
(),
vehicle
.
getId
()),
ResCode
.
VEHICLE_DEPARTURE_VEHICLE_DISABLE
.
getCode
());
...
...
@@ -155,6 +164,10 @@ public class VehicleActiveService {
throw
new
BaseException
(
ResCode
.
VEHICLE_DEPARTURE_VEHICLE_UNEXIST
.
getDesc
(),
ResCode
.
VEHICLE_DEPARTURE_VEHICLE_UNEXIST
.
getCode
());
}
if
(
StringUtils
.
isBlank
(
arrivalVo
.
getRecycleMan
())
||
StringUtils
.
isBlank
(
arrivalVo
.
getRecycleManTel
()))
{
throw
new
BaseException
(
ResCode
.
CHECKUSER_AND_PHONE_NOT_NULL
.
getDesc
(),
ResCode
.
CHECKUSER_AND_PHONE_NOT_NULL
.
getCode
());
}
if
(!
vehicle
.
getStatus
().
equals
(
VehicleStatus
.
DEPARTURE
.
getCode
()))
{
throw
new
BaseException
(
ResCode
.
VEHICLE_DEPARTURE_VEHICLE_UNDEPARTURE
.
getDesc
()
+
", 车辆状态是:"
+
getVehicleStatus
(
vehicle
.
getStatus
(),
vehicle
.
getId
()),
ResCode
.
VEHICLE_DEPARTURE_VEHICLE_UNDEPARTURE
.
getCode
());
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment