Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
Education
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
黄奎
Education
Commits
20d178bc
Commit
20d178bc
authored
Dec 14, 2021
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
9d2c3611
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
22 deletions
+32
-22
StringHelper.cs
Edu.Common/Plugin/StringHelper.cs
+21
-19
CustomerStudentModule.cs
Edu.Module.Customer/CustomerStudentModule.cs
+3
-3
UserController.cs
Edu.WebApi/Controllers/User/UserController.cs
+8
-0
No files found.
Edu.Common/Plugin/StringHelper.cs
View file @
20d178bc
...
...
@@ -1234,31 +1234,22 @@ namespace Edu.Common.Plugin
/// <returns></returns>
public
static
List
<
int
>
StringToListInt
(
string
str
)
{
string
[]
ary
=
str
.
Split
(
','
);
List
<
int
>
val
=
new
List
<
int
>();
for
(
int
i
=
0
;
i
<
ary
.
LongLength
;
i
++)
if
(!
string
.
IsNullOrEmpty
(
str
))
{
val
.
Add
(
Convert
.
ToInt32
(
ary
[
i
]));
string
[]
ary
=
str
.
Split
(
','
);
for
(
int
i
=
0
;
i
<
ary
.
LongLength
;
i
++)
{
Int32
.
TryParse
(
ary
[
i
],
out
int
result
);
if
(
result
>
0
)
{
val
.
Add
(
result
);
}
}
}
return
val
;
}
/// <summary>
/// 将字符串转换为List int
/// </summary>
/// <param name="str">eg: (1,2,3,4)</param>
/// <returns></returns>
public
static
List
<
string
>
StringToListString
(
string
str
)
{
string
[]
ary
=
str
.
Split
(
','
);
List
<
string
>
val
=
new
List
<
string
>();
for
(
int
i
=
0
;
i
<
ary
.
LongLength
;
i
++)
{
val
.
Add
(
ary
[
i
]);
}
return
val
;
}
#
endregion
#
region
验证码
...
...
@@ -1614,5 +1605,16 @@ namespace Edu.Common.Plugin
}
return
new
string
(
array
);
}
/// <summary>
/// 判断输入的字符串是否是一个合法的手机号
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
public
static
bool
IsMobilePhone
(
string
input
)
{
Regex
regex
=
new
Regex
(
"^1[3456789]\\d{9}$"
);
return
regex
.
IsMatch
(
input
);
}
}
}
Edu.Module.Customer/CustomerStudentModule.cs
View file @
20d178bc
...
...
@@ -502,11 +502,11 @@ namespace Edu.Module.Customer
StuId
=
StuId
});
List
<
int
>
ids1
=
new
List
<
int
>();
if
(
AssistList
!=
null
)
if
(
AssistList
!=
null
&&
AssistList
.
Count
>
0
)
{
ids1
=
Common
.
Plugin
.
StringHelper
.
StringToListInt
(
string
.
Join
(
","
,
AssistList
.
Select
(
qitem
=>
qitem
.
AssistId
)));
}
if
(
oldAssistList
!=
null
)
if
(
oldAssistList
!=
null
&&
oldAssistList
.
Count
>
0
)
{
List
<
int
>
ids2
=
Common
.
Plugin
.
StringHelper
.
StringToListInt
(
string
.
Join
(
","
,
oldAssistList
.
Select
(
qitem
=>
qitem
.
AssistId
)));
if
(
ids2
!=
null
&&
ids2
.
Count
>
0
)
...
...
@@ -526,7 +526,7 @@ namespace Edu.Module.Customer
//以前没有协同人员【直接新增】
if
(
oldAssistList
==
null
||
(
oldAssistList
!=
null
&&
oldAssistList
.
Count
==
0
))
{
foreach
(
var
item
in
old
AssistList
)
foreach
(
var
item
in
AssistList
)
{
student_AssistRepository
.
Insert
(
new
Model
.
Entity
.
Customer
.
RB_Student_Assist
()
{
...
...
Edu.WebApi/Controllers/User/UserController.cs
View file @
20d178bc
...
...
@@ -763,6 +763,14 @@ namespace Edu.WebApi.Controllers.User
{
extModel
.
CreateType
=
1
;
}
if
(
string
.
IsNullOrEmpty
(
extModel
.
StuTel
))
{
return
ApiResult
.
Failed
(
"请填写手机号码!"
);
}
if
(!
Common
.
Plugin
.
StringHelper
.
IsMobilePhone
(
extModel
.
StuTel
))
{
return
ApiResult
.
Failed
(
"手机号码不正确,请重新填写!"
);
}
extModel
.
Status
=
DateStateEnum
.
Normal
;
extModel
.
StuStatus
=
1
;
extModel
.
CreateTime
=
DateTime
.
Now
;
...
...
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