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
6c900a13
Commit
6c900a13
authored
Jul 25, 2022
by
liudong1993
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
5d5b70d5
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
95 additions
and
3 deletions
+95
-3
AssessModule.cs
Mall.Module.Miai/AssessModule.cs
+21
-1
MiniProgramMsgModule.cs
Mall.Module.User/MiniProgramMsgModule.cs
+69
-0
AppletAssessController.cs
Mall.WebApi/Controllers/Miai/AppletAssessController.cs
+4
-1
AssessController.cs
Mall.WebApi/Controllers/Miai/AssessController.cs
+1
-1
No files found.
Mall.Module.Miai/AssessModule.cs
View file @
6c900a13
...
...
@@ -9,6 +9,7 @@ using Mall.Repository.Assess;
using
Mall.Model.Extend.Assess
;
using
Mall.Model.Entity.Assess
;
using
Mall.Repository.User
;
using
Mall.Module.User
;
namespace
Mall.Module.Miai
{
...
...
@@ -35,6 +36,10 @@ namespace Mall.Module.Miai
/// 商品
/// </summary>
private
readonly
RB_Assess_GoodsRepository
assess_GoodsRepository
=
new
RB_Assess_GoodsRepository
();
/// <summary>
/// 消息订阅
/// </summary>
private
readonly
MiniProgramMsgModule
appletWeChatModule
=
new
MiniProgramMsgModule
();
#
region
估价分类
...
...
@@ -306,8 +311,12 @@ namespace Mall.Module.Miai
/// <param name="goodsId"></param>
/// <param name="replyContent"></param>
/// <returns></returns>
public
bool
SetGoodsReply
(
int
goodsId
,
string
replyContent
)
public
bool
SetGoodsReply
(
int
goodsId
,
string
replyContent
,
UserInfo
userInfo
)
{
var
goodsModel
=
assess_GoodsRepository
.
GetEntity
(
goodsId
);
if
(
goodsModel
==
null
)
{
return
false
;
}
Dictionary
<
string
,
object
>
keyValues
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Assess_Goods_Extend
.
ReplyContent
),
replyContent
},
{
nameof
(
RB_Assess_Goods_Extend
.
ReplyDate
),
DateTime
.
Now
}
...
...
@@ -320,6 +329,17 @@ namespace Mall.Module.Miai
}
};
bool
flag
=
assess_GoodsRepository
.
Update
(
keyValues
,
wheres
);
if
(
flag
)
{
//获取用户信息
var
umodel
=
member_UserRepository
.
GetEntity
(
goodsModel
.
UserId
);
var
categoryModel
=
assess_CategoryRepository
.
GetEntity
(
goodsModel
.
CategoryId
);
var
brandModel
=
assess_BrandRepository
.
GetEntity
(
goodsModel
.
BrandId
);
string
Title
=
categoryModel
.
Name
+
"-"
+
brandModel
.
Name
;
string
Remark
=
"您好,您的商品估价已完成、点击可查看估价详情。"
;
//推送订阅消息
appletWeChatModule
.
SendAssessSucceedMsg
(
userInfo
.
TenantId
,
userInfo
.
MallBaseId
,
umodel
.
OpenId
,
Title
,
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd HH:mm"
),
Remark
);
}
return
flag
;
}
...
...
Mall.Module.User/MiniProgramMsgModule.cs
View file @
6c900a13
...
...
@@ -1165,6 +1165,75 @@ namespace Mall.Module.User
return
false
;
}
/// <summary>
/// 估价成功发送订阅消息
/// </summary>
/// <param name="TenantId"></param>
/// <param name="MallBaseId"></param>
/// <param name="OpenId"></param>
/// <param name="Title">标题</param>
/// <param name="AssessCreate">时间</param>
/// <param name="Remark">备注</param>
/// <returns></returns>
public
bool
SendAssessSucceedMsg
(
int
TenantId
,
int
MallBaseId
,
string
OpenId
,
string
Title
,
string
AssessCreate
,
string
Remark
)
{
var
appletWeChatModel
=
programRepository
.
GetListRepository
(
new
RB_MiniProgram_Extend
{
TenantId
=
TenantId
,
MallBaseId
=
MallBaseId
}).
FirstOrDefault
();
string
token
=
WeiXinReidsCache
.
Get
(
appletWeChatModel
.
MiniAppId
);
if
(
string
.
IsNullOrEmpty
(
token
))
{
token
=
Mall
.
Common
.
Pay
.
WeChatPat
.
TokenHelper
.
GetLXYToken
(
token
,
appletWeChatModel
.
MiniAppId
,
appletWeChatModel
.
MiniAppSecret
);
System
.
Threading
.
Tasks
.
Task
.
Run
(()
=>
WeiXinReidsCache
.
Set
(
appletWeChatModel
.
MiniAppId
,
token
));
}
if
(
string
.
IsNullOrEmpty
(
token
))
{
return
false
;
}
string
wenXinResult
=
string
.
Empty
;
if
(!
string
.
IsNullOrWhiteSpace
(
token
))
{
string
Url
=
"https://api.weixin.qq.com/cgi-bin/message/subscribe/send?access_token="
+
token
;
var
postdata
=
new
{
touser
=
OpenId
,
template_id
=
"YPwcM9zygX9Huu44tOOJoY_lA6eqbdSBAxLHSPXbHpg"
,
// appletWeChatModel.CourseOrderTpl,
page
=
"pages/order/index/index"
,
data
=
new
{
thing4
=
new
{
value
=
Title
},
time2
=
new
{
value
=
AssessCreate
},
thing3
=
new
{
value
=
Remark
}
},
miniprogram_state
=
"developer"
};
wenXinResult
=
HttpHelper
.
HttpPost
(
Url
,
JsonHelper
.
Serialize
(
postdata
),
""
);
LogHelper
.
WriteInfo
(
"估价成功发送订阅消息:"
+
wenXinResult
);
JObject
jo
=
(
JObject
)
JsonConvert
.
DeserializeObject
(
wenXinResult
);
int
errcode
=
Convert
.
ToInt32
(
jo
[
"errcode"
].
ToString
());
if
(
errcode
==
0
)
{
//成功
return
true
;
}
else
{
LogHelper
.
WriteInfo
(
string
.
Format
(
"SendAssessSucceedMsg:wenXinResult:{0}"
,
wenXinResult
));
}
}
return
false
;
}
#
endregion
#
region
评论违规检测
...
...
Mall.WebApi/Controllers/Miai/AppletAssessController.cs
View file @
6c900a13
...
...
@@ -106,7 +106,10 @@ namespace Mall.WebApi.Controllers.MallBase
model
.
IsHot
,
model
.
BrandImgList
,
model
.
MoreDesc
,
model
.
RemarkDesc
model
.
RemarkDesc
,
TempIdList
=
new
List
<
string
>()
{
"YPwcM9zygX9Huu44tOOJoY_lA6eqbdSBAxLHSPXbHpg"
}
});
}
...
...
Mall.WebApi/Controllers/Miai/AssessController.cs
View file @
6c900a13
...
...
@@ -316,7 +316,7 @@ namespace Mall.WebApi.Controllers.MallBase
return
ApiResult
.
ParamIsNull
(
"请传递回复内容"
);
}
bool
flag
=
assessModule
.
SetGoodsReply
(
GoodsId
,
ReplyContent
);
bool
flag
=
assessModule
.
SetGoodsReply
(
GoodsId
,
ReplyContent
,
base
.
UserInfo
);
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
}
...
...
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