Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mall.oytour.com
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
黄奎
mall.oytour.com
Commits
e2a6a18e
Commit
e2a6a18e
authored
Aug 10, 2020
by
黄奎
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.oytour.com/Kui2/mall.oytour.com
parents
bb8e3c8d
f04a6778
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
94 additions
and
1 deletion
+94
-1
ProductModule.cs
Mall.Module.Product/ProductModule.cs
+55
-0
RB_Goods_CategoryRepository.cs
Mall.Repository/Product/RB_Goods_CategoryRepository.cs
+3
-0
ProductController.cs
Mall.WebApi/Controllers/Product/ProductController.cs
+35
-0
AppletUserController.cs
Mall.WebApi/Controllers/User/AppletUserController.cs
+1
-1
No files found.
Mall.Module.Product/ProductModule.cs
View file @
e2a6a18e
...
...
@@ -64,6 +64,10 @@ namespace Mall.Module.Product
/// </summary>
private
readonly
RB_GoodsRepository
goodsRepository
=
new
RB_GoodsRepository
();
/// <summary>
/// 商品日志
/// </summary>
private
readonly
RB_Goods_LogRepository
goods_LogRepository
=
new
RB_Goods_LogRepository
();
/// <summary>
/// 商品区域
/// </summary>
private
readonly
RB_Goods_AreaRepository
goods_AreaRepository
=
new
RB_Goods_AreaRepository
();
...
...
@@ -5152,6 +5156,57 @@ namespace Mall.Module.Product
return
goods_SpecificationValueRepository
.
GetList
(
model
);
}
/// <summary>
/// 商品分类修改
/// </summary>
/// <param name="categoryId"></param>
/// <param name="newCategoryId"></param>
/// <param name="tenantId"></param>
/// <param name="mallBaseId"></param>
/// <returns></returns>
public
string
SetGoodsCategoryTransfer
(
int
categoryId
,
int
newCategoryId
,
int
tenantId
,
int
mallBaseId
,
int
empId
)
{
var
newModel
=
product_CategoryRepository
.
GetEntity
(
newCategoryId
);
if
(
newModel
==
null
)
{
return
"新分类不存在"
;
}
if
(
newModel
.
Enabled
!=
1
)
{
return
"新分类未启用"
;
}
var
list
=
goods_CategoryRepository
.
GetList
(
new
RB_Goods_Category_Extend
()
{
CategoryId
=
categoryId
,
TenantId
=
tenantId
,
MallBaseId
=
mallBaseId
});
if
(
list
.
Any
())
{
foreach
(
var
item
in
list
)
{
//修改分类
Dictionary
<
string
,
object
>
keyValues
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Goods_Category
.
CategoryId
),
newCategoryId
}
};
List
<
WhereHelper
>
wheres
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(){
FiledName
=
nameof
(
RB_Goods_Category
.
Id
),
FiledValue
=
item
.
Id
,
OperatorEnum
=
OperatorEnum
.
Equal
}
};
bool
flag
=
goods_CategoryRepository
.
Update
(
keyValues
,
wheres
);
if
(
flag
)
{
//记录该商品日志
goods_LogRepository
.
Insert
(
new
RB_Goods_Log
()
{
Id
=
0
,
Type
=
2
,
TenantId
=
tenantId
,
MallBaseId
=
mallBaseId
,
SourceId
=
item
.
GoodsId
,
CreateDate
=
DateTime
.
Now
,
Content
=
"商品分类转移,empId:"
+
empId
+
",由"
+
categoryId
+
"转移至"
+
newCategoryId
});
}
}
return
"转移成功,总计:"
+
list
.
Count
()
+
"商品"
;
}
else
{
return
"该分类下未找到相关商品"
;
}
}
#
endregion
#
region
商品代理
...
...
Mall.Repository/Product/RB_Goods_CategoryRepository.cs
View file @
e2a6a18e
...
...
@@ -36,6 +36,9 @@ namespace Mall.Repository.Product
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
GoodsIds
))
{
where
+=
$@" and gc.
{
nameof
(
RB_Goods_Category
.
GoodsId
)}
in(
{
dmodel
.
GoodsIds
}
)"
;
}
if
(
dmodel
.
CategoryId
>
0
)
{
where
+=
$@" and gc.
{
nameof
(
RB_Goods_Category
.
CategoryId
)}
=
{
dmodel
.
CategoryId
}
"
;
}
string
sql
=
$@"
SELECT gc.*,pc.Name as CategoryName,pc.IsForeignShare,pc.ParentId,pc.Tier
...
...
Mall.WebApi/Controllers/Product/ProductController.cs
View file @
e2a6a18e
...
...
@@ -2111,6 +2111,41 @@ namespace Mall.WebApi.Controllers.MallBase
}
}
/// <summary>
/// 保存商品分类转移
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
SetGoodsCategoryTransfer
()
{
var
req
=
RequestParm
;
JObject
parms
=
JObject
.
Parse
(
req
.
msg
.
ToString
());
int
CategoryId
=
parms
.
GetInt
(
"CategoryId"
,
0
);
int
NewCategoryId
=
parms
.
GetInt
(
"NewCategoryId"
,
0
);
//新分类
if
(
CategoryId
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
"请选择需转移分类id"
);
}
if
(
NewCategoryId
<
0
)
{
return
ApiResult
.
ParamIsNull
(
"请选择转入分类id"
);
}
if
(
CategoryId
==
NewCategoryId
)
{
return
ApiResult
.
ParamIsNull
(
"不能转入同一分类下"
);
}
string
msg
=
productModule
.
SetGoodsCategoryTransfer
(
CategoryId
,
NewCategoryId
,
req
.
TenantId
,
req
.
MallBaseId
,
req
.
EmpId
);
if
(
msg
.
Contains
(
"转移成功"
))
{
return
ApiResult
.
Success
(
msg
);
}
else
{
return
ApiResult
.
Failed
(
msg
);
}
}
#
endregion
#
region
商品代理
...
...
Mall.WebApi/Controllers/User/AppletUserController.cs
View file @
e2a6a18e
...
...
@@ -379,7 +379,7 @@ namespace Mall.WebApi.Controllers.User
demodel
.
AuditStatus
??=
DistributorAuditStatusEnum
.
Auditing
;
demodel
.
Status
=
0
;
demodel
.
HPGradeId
??=
0
;
demodel
.
FXGradeId
??=
0
;
demodel
.
FXGradeId
??=
1
;
demodel
.
CreateDate
=
DateTime
.
Now
;
demodel
.
UpdateDate
=
DateTime
.
Now
;
bool
flag
=
userModule
.
SetUserApplyForBeDistrbutor
(
demodel
);
...
...
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