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
94f78049
Commit
94f78049
authored
Mar 03, 2022
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
f23c1d88
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
56 additions
and
5 deletions
+56
-5
CustomerModule.cs
Edu.Module.Customer/CustomerModule.cs
+30
-1
B2BCustomerController.cs
Edu.WebApi/Controllers/Customer/B2BCustomerController.cs
+26
-4
No files found.
Edu.Module.Customer/CustomerModule.cs
View file @
94f78049
...
...
@@ -622,7 +622,7 @@ namespace Edu.Module.Customer
{
List
<
WhereHelper
>
list
=
new
List
<
WhereHelper
>
{
new
WhereHelper
(
nameof
(
RB_Customer_Category_Extend
.
CategoryName
),
model
.
CategoryName
),
new
WhereHelper
(
nameof
(
RB_Customer_Category_Extend
.
CategoryName
),
model
.
CategoryName
.
Trim
()
),
new
WhereHelper
(
nameof
(
RB_Customer_Category_Extend
.
Status
),
0
),
new
WhereHelper
(
nameof
(
RB_Customer_Category_Extend
.
Group_Id
),
model
.
Group_Id
)
};
...
...
@@ -666,6 +666,35 @@ namespace Edu.Module.Customer
return
flag
;
}
/// <summary>
/// 同行合并
/// </summary>
/// <param name="CategoryId"></param>
/// <param name="NewCategoryId"></param>
/// <returns></returns>
public
bool
ReplaceCustomerCategoryModule
(
int
CategoryId
,
int
NewCategoryId
)
{
bool
flag
=
false
;
var
list
=
customerRepository
.
GetCustomerListRepository
(
new
RB_Customer_Extend
()
{
CategoryId
=
CategoryId
});
if
(
list
!=
null
&&
list
.
Count
>
0
)
{
foreach
(
var
item
in
list
)
{
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Customer_Extend
.
CategoryId
),
NewCategoryId
}
};
customerRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Customer_Extend
.
CustomerId
),
item
.
CustomerId
));
}
}
Dictionary
<
string
,
object
>
cateFileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Customer_Category_Extend
.
Status
),(
int
)
DateStateEnum
.
Delete
}
};
flag
=
customer_CategoryRepository
.
Update
(
cateFileds
,
new
WhereHelper
(
nameof
(
RB_Customer_Category_Extend
.
CategoryId
),
CategoryId
));
return
flag
;
}
/// <summary>
/// 根据编号获取同行信息
/// </summary>
...
...
Edu.WebApi/Controllers/Customer/B2BCustomerController.cs
View file @
94f78049
...
...
@@ -170,15 +170,37 @@ namespace Edu.WebApi.Controllers.Customer
};
if
(!
string
.
IsNullOrEmpty
(
categoryModel
.
CategoryName
))
{
bool
cflag
=
customerModule
.
SetCustomerCategoryModule
(
categoryModel
);
model
.
CategoryId
=
categoryModel
.
CategoryId
;
if
(
customerModule
.
CheckCustomerCategoryModule
(
categoryModel
))
{
return
ApiResult
.
Failed
(
"已存在此同行,请重新选择!"
);
}
else
{
bool
cflag
=
customerModule
.
SetCustomerCategoryModule
(
categoryModel
);
model
.
CategoryId
=
categoryModel
.
CategoryId
;
}
}
var
flag
=
customerModule
.
SetCustomerModule
(
model
);
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
}
/// <summary>
/// 替换同行
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
ReplaceCategory
()
{
var
CategoryId
=
base
.
ParmJObj
.
GetInt
(
"CategoryId"
);
var
NewCategoryId
=
base
.
ParmJObj
.
GetInt
(
"NewCategoryId"
);
if
(
NewCategoryId
<=
0
)
{
return
ApiResult
.
Failed
(
"请选择目标企业或校代!"
);
}
bool
flag
=
customerModule
.
ReplaceCustomerCategoryModule
(
CategoryId
,
NewCategoryId
);
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
}
/// <summary>
/// 根据编号删除客户
/// </summary>
...
...
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