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
88c3fb14
Commit
88c3fb14
authored
Dec 06, 2021
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增验证
parent
89c23fc3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
22 deletions
+29
-22
B2BCustomerController.cs
Edu.WebApi/Controllers/Customer/B2BCustomerController.cs
+29
-22
No files found.
Edu.WebApi/Controllers/Customer/B2BCustomerController.cs
View file @
88c3fb14
...
...
@@ -96,6 +96,14 @@ namespace Edu.WebApi.Controllers.Customer
Account
=
base
.
ParmJObj
.
GetStringValue
(
"Account"
),
Remark
=
base
.
ParmJObj
.
GetStringValue
(
"Remark"
),
};
if
(
string
.
IsNullOrEmpty
(
model
.
CustomerName
))
{
return
ApiResult
.
ParamIsNull
(
message
:
"请填写客户名称!"
);
}
if
(
string
.
IsNullOrEmpty
(
model
.
ContactNumber
))
{
return
ApiResult
.
ParamIsNull
(
message
:
"请填写客户联系电话!"
);
}
model
.
Status
=
Common
.
Enum
.
DateStateEnum
.
Normal
;
model
.
CreateBy
=
base
.
UserInfo
.
Id
;
model
.
CreateTime
=
DateTime
.
Now
;
...
...
@@ -208,6 +216,26 @@ namespace Edu.WebApi.Controllers.Customer
ExchangeEndTime
=
base
.
ParmJObj
.
GetDateTime
(
"ExchangeEndTime"
),
TaskFinishType
=
base
.
ParmJObj
.
GetInt
(
"TaskFinishType"
),
};
if
(
string
.
IsNullOrEmpty
(
model
.
TaskName
))
{
return
ApiResult
.
ParamIsNull
(
message
:
"请填写任务名称!"
);
}
if
(
string
.
IsNullOrEmpty
(
base
.
ParmJObj
.
GetStringValue
(
"TaskStartTime"
)))
{
return
ApiResult
.
ParamIsNull
(
message
:
"请选择任务开始时间!"
);
}
if
(
string
.
IsNullOrEmpty
(
base
.
ParmJObj
.
GetStringValue
(
"TaskEndTime"
)))
{
return
ApiResult
.
ParamIsNull
(
message
:
"请选择任务结束时间!"
);
}
if
(
model
.
TaskStartTime
>
model
.
TaskEndTime
)
{
return
ApiResult
.
ParamIsNull
(
message
:
"开始时间不能大于结束时间!"
);
}
if
(
model
.
TaskFinishType
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
message
:
"请选择任务完成类型!"
);
}
string
taskImageList
=
base
.
ParmJObj
.
GetStringValue
(
"TaskImageList"
);
List
<
string
>
imgList
=
new
List
<
string
>();
if
(!
string
.
IsNullOrEmpty
(
taskImageList
))
...
...
@@ -251,7 +279,6 @@ namespace Edu.WebApi.Controllers.Customer
DetailsName
=
jobj
.
GetStringValue
(
"DetailsName"
),
TaskType
=
(
TaskTypeEnum
)
jobj
.
GetInt
(
"TaskType"
),
TargetId
=
string
.
Join
(
","
,
targetIds
),
TaskFinishValue
=
jobj
.
GetDecimal
(
"TaskFinishValue"
),
TaskKudo
=
jobj
.
GetStringValue
(
"TaskKudo"
),
TaskKudoImg
=
JsonHelper
.
Serialize
(
imgKudoList
),
...
...
@@ -262,20 +289,8 @@ namespace Edu.WebApi.Controllers.Customer
}
if
(
model
.
DetailsList
==
null
||
(
model
.
DetailsList
!=
null
&&
model
.
DetailsList
.
Count
()
==
0
))
{
return
ApiResult
.
ParamIsNull
(
message
:
"请添加任务
类型
!"
);
return
ApiResult
.
ParamIsNull
(
message
:
"请添加任务
完成条件
!"
);
}
//if (model.DetailsList != null)
//{
// var groupList = model.DetailsList.GroupBy(qitem => new { qitem.TaskType })
// .Select(qitem => new { qitem.Key.TaskType, TaskTypeCount = qitem.Count() });
// foreach (var item in groupList)
// {
// if (item.TaskTypeCount > 1)
// {
// return ApiResult.ParamIsNull(message: $"已经存在【{item.TaskType.ToName()}】类型,请重新选择!");
// }
// }
//}
foreach
(
var
item
in
model
.
DetailsList
)
{
switch
(
item
.
TaskType
)
...
...
@@ -351,10 +366,6 @@ namespace Edu.WebApi.Controllers.Customer
Description
=
base
.
ParmJObj
.
GetStringValue
(
"Description"
),
};
var
list
=
balanceDetailModule
.
GetCustomerBalanceDetailPageModule
(
pageModel
.
PageIndex
,
pageModel
.
PageSize
,
out
long
rowsCount
,
query
);
foreach
(
var
item
in
list
)
{
}
pageModel
.
PageData
=
list
;
pageModel
.
Count
=
rowsCount
;
return
ApiResult
.
Success
(
data
:
pageModel
);
...
...
@@ -381,10 +392,6 @@ namespace Edu.WebApi.Controllers.Customer
ExchangeStatus
=
base
.
ParmJObj
.
GetInt
(
"ExchangeStatus"
),
};
var
list
=
taskModule
.
GetCustomerFinishtaskPageModule
(
pageModel
.
PageIndex
,
pageModel
.
PageSize
,
out
long
rowsCount
,
query
);
foreach
(
var
item
in
list
)
{
}
pageModel
.
PageData
=
list
;
pageModel
.
Count
=
rowsCount
;
return
ApiResult
.
Success
(
data
:
pageModel
);
...
...
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