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
dff7b061
Commit
dff7b061
authored
Sep 09, 2020
by
吴春
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交代码
parent
25af830c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
97 additions
and
11 deletions
+97
-11
GuideCarModule.cs
Mall.Module.Product/GuideCarModule.cs
+86
-4
GuideCarController.cs
Mall.WebApi/Controllers/Product/GuideCarController.cs
+11
-7
No files found.
Mall.Module.Product/GuideCarModule.cs
View file @
dff7b061
...
...
@@ -1645,7 +1645,7 @@ namespace Mall.Module.Product
string
SiteName
=
SiteRepository
.
GetGuideCarSiteList
(
new
RB_GuideCar_Site_Extend
()
{
ID
=
model
.
SiteId
??
0
}).
FirstOrDefault
()?.
SiteName
??
""
;
var
guideModel
=
GuideRepository
.
GetGuideCarGuideList
(
new
RB_GuideCar_Guide_Extend
()
{
ID
=
model
.
GuideId
??
0
}).
FirstOrDefault
();
model
.
GuideName
=
guideModel
?.
Name
??
""
;
model
.
GuidePhoto
=
guideModel
?.
GuidePhoto
??
""
;
model
.
GuidePhoto
=
guideModel
?.
GuidePhoto
??
""
;
model
.
GuideScore
=
guideModel
?.
Score
??
5
;
model
.
Introduction
=
guideModel
?.
Introduction
??
""
;
model
.
GuideWorkYears
=
guideModel
?.
WorkYears
??
1
;
...
...
@@ -2321,7 +2321,7 @@ namespace Mall.Module.Product
date_enable
=
false
;
}
var
targetModel
=
targetList
.
FirstOrDefault
();
if
(
targetModel
.
ReserveNum
+
(
item
.
Number
??
0
)
>
(
gmodel
.
RideNum
??
0
))
if
(
targetModel
.
ReserveNum
+
(
item
.
Number
??
0
)
>
(
gmodel
.
RideNum
??
0
))
{
date_enable
=
false
;
}
...
...
@@ -3538,6 +3538,88 @@ namespace Mall.Module.Product
return
flag
;
}
/// <summary>
/// 管理新增评论
/// </summary>
/// <param name="demodel"></param>
/// <returns></returns>
public
bool
SetGoodsCommentInfo_V2
(
List
<
RB_Goods_Comment_Extend
>
list
)
{
RB_Goods_OrderDetail
dmodel
=
new
RB_Goods_OrderDetail
();
dmodel
.
CarId
=
list
.
Where
(
x
=>
x
.
CarId
>
0
).
FirstOrDefault
()?.
CarId
;
dmodel
.
GuideId
=
list
.
Where
(
x
=>
x
.
GuideId
>
0
).
FirstOrDefault
()?.
GuideId
;
dmodel
.
TenantId
=
list
.
FirstOrDefault
()?.
TenantId
??
0
;
dmodel
.
MallBaseId
=
list
.
FirstOrDefault
()?.
MallBaseId
??
0
;
bool
flag
=
goods_CommentRepository
.
InsertBatch
(
list
);
if
(
flag
)
{
if
(
list
.
FirstOrDefault
().
OrderDetailId
>
0
)
{
//更新订单对应对应的车辆和导游评分
//先查找已评论的车辆信息
if
(
dmodel
.
CarId
.
HasValue
&&
dmodel
.
CarId
.
Value
>
0
)
{
var
carScoreList
=
goods_CommentRepository
.
GetAppletGoodsCommentscore
(
dmodel
.
CarId
.
Value
,
0
,
dmodel
.
TenantId
,
dmodel
.
MallBaseId
);
decimal
carScore
=
0
;
if
(
carScoreList
!=
null
&&
carScoreList
.
Any
())
{
carScore
=
(
carScoreList
.
FirstOrDefault
().
TotalScore
+
(
Convert
.
ToDecimal
(
list
.
Where
(
x
=>
x
.
CarId
==
dmodel
.
CarId
).
FirstOrDefault
().
CommentScore
??
0
)))
/
(
carScoreList
.
FirstOrDefault
().
CommentNum
+
1
);
}
else
{
carScore
=
Convert
.
ToDecimal
(
list
.
Where
(
x
=>
x
.
CarId
==
dmodel
.
CarId
).
FirstOrDefault
().
CommentScore
);
}
if
(
carScore
>
0
)
//更新车辆的评分
{
//更新订单商品为已评价
Dictionary
<
string
,
object
>
keyValuesCar
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_GuideCar_Car
.
Score
),
Math
.
Round
(
carScore
,
1
,
MidpointRounding
.
AwayFromZero
)}
};
List
<
WhereHelper
>
wheresCar
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(){
FiledName
=
nameof
(
RB_GuideCar_Car
.
ID
),
FiledValue
=
dmodel
.
CarId
,
OperatorEnum
=
OperatorEnum
.
Equal
}
};
GuideCarRepository
.
Update
(
keyValuesCar
,
wheresCar
);
}
}
if
(
dmodel
.
GuideId
.
HasValue
&&
dmodel
.
GuideId
.
Value
>
0
)
{
decimal
guidScore
=
0
;
var
guideScoreList
=
goods_CommentRepository
.
GetAppletGoodsCommentscore
(
0
,
dmodel
.
GuideId
.
Value
,
dmodel
.
TenantId
,
dmodel
.
MallBaseId
);
if
(
guideScoreList
!=
null
&&
guideScoreList
.
Any
())
{
guidScore
=
(
guideScoreList
.
FirstOrDefault
().
TotalScore
+
(
Convert
.
ToDecimal
(
list
.
Where
(
x
=>
x
.
GuideId
==
dmodel
.
GuideId
).
FirstOrDefault
().
CommentScore
??
0
)))
/
(
guideScoreList
.
FirstOrDefault
().
CommentNum
+
1
);
}
else
{
guidScore
=
Convert
.
ToDecimal
(
list
.
Where
(
x
=>
x
.
GuideId
==
dmodel
.
GuideId
).
FirstOrDefault
().
CommentScore
);
}
if
(
guidScore
>
0
)
//更新车辆的评分
{
//更新订单商品为已评价
Dictionary
<
string
,
object
>
keyValuesCar
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_GuideCar_Guide
.
Score
),
Math
.
Round
(
guidScore
,
1
,
MidpointRounding
.
AwayFromZero
)}
};
List
<
WhereHelper
>
wheresCar
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(){
FiledName
=
nameof
(
RB_GuideCar_Guide
.
ID
),
FiledValue
=
dmodel
.
GuideId
,
OperatorEnum
=
OperatorEnum
.
Equal
}
};
GuideRepository
.
Update
(
keyValuesCar
,
wheresCar
);
}
}
}
}
return
flag
;
}
/// <summary>
/// 小程序我的订单列表
/// </summary>
...
...
@@ -3738,7 +3820,7 @@ namespace Mall.Module.Product
List
<
RB_Member_User_Extend
>
userList
=
new
List
<
RB_Member_User_Extend
>();
if
(
list
.
Where
(
x
=>
x
.
UserId
>
0
).
Any
())
{
string
uids
=
string
.
Join
(
","
,
list
.
Where
(
x
=>
x
.
UserId
>
0
).
Select
(
x
=>
x
.
UserId
));
string
uids
=
string
.
Join
(
","
,
list
.
Where
(
x
=>
x
.
UserId
>
0
).
Select
(
x
=>
x
.
UserId
));
userList
=
member_UserRepository
.
GetList
(
new
RB_Member_User_Extend
()
{
UserIds
=
uids
,
TenantId
=
dmodel
.
TenantId
,
MallBaseId
=
dmodel
.
MallBaseId
});
}
foreach
(
var
item
in
list
)
...
...
@@ -3771,7 +3853,7 @@ namespace Mall.Module.Product
}
/// <summary>
/// 获取商品评论统计
...
...
Mall.WebApi/Controllers/Product/GuideCarController.cs
View file @
dff7b061
...
...
@@ -1614,16 +1614,21 @@ namespace Mall.WebApi.Controllers.MallBase
{
return
ApiResult
.
ParamIsNull
(
"请输入评价内容"
);
}
if
(!
demodel
.
CommentGrade
.
HasValue
)
{
return
ApiResult
.
ParamIsNull
(
"请选择评分"
);
}
demodel
.
CommentScore
??=
5
;
demodel
.
CommentImage
=
""
;
if
(
demodel
.
CommentImgList
!=
null
&&
demodel
.
CommentImgList
.
Any
())
{
demodel
.
CommentImage
=
JsonConvert
.
SerializeObject
(
demodel
.
CommentImgList
);
}
demodel
.
CommentGrade
??=
Common
.
Enum
.
Goods
.
GoodsCommentTypeEnum
.
Praise
;
demodel
.
CommentScore
??=
5
;
if
(
demodel
.
CommentScore
==
3
||
demodel
.
CommentScore
==
2
)
{
demodel
.
CommentGrade
=
Common
.
Enum
.
Goods
.
GoodsCommentTypeEnum
.
Medium
;
}
else
if
(
demodel
.
CommentScore
==
1
)
{
demodel
.
CommentGrade
=
Common
.
Enum
.
Goods
.
GoodsCommentTypeEnum
.
Negative
;
}
demodel
.
UserPhoto
??=
0
;
demodel
.
Is_Top
??=
2
;
demodel
.
Is_Show
??=
1
;
...
...
@@ -1634,11 +1639,10 @@ namespace Mall.WebApi.Controllers.MallBase
demodel
.
MallBaseId
=
req
.
MallBaseId
;
demodel
.
Status
=
0
;
demodel
.
UpdateDate
=
DateTime
.
Now
;
demodel
.
CreateDate
=
DateTime
.
Now
;
}
bool
flag
=
guideCarModule
.
SetGoodsCommentInfo
(
list
);
bool
flag
=
guideCarModule
.
SetGoodsCommentInfo
_V2
(
list
);
if
(
flag
)
{
return
ApiResult
.
Success
();
}
else
{
return
ApiResult
.
Failed
();
}
}
#
endregion
...
...
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