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
e676f110
Commit
e676f110
authored
Oct 15, 2020
by
liudong1993
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'sdzq' of
http://gitlab.oytour.com/Kui2/mall.oytour.com
into sdzq-ld
parents
3b639878
c2376166
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
509 additions
and
49 deletions
+509
-49
WeiXinHelper.cs
Mall.Common/Plugin/WeiXinHelper.cs
+53
-0
MallBaseModule.cs
Mall.Module.BaseSetUp/MallBaseModule.cs
+23
-4
ProductModule.cs
Mall.Module.Product/ProductModule.cs
+1
-1
MiniProgramModule.cs
Mall.Module.User/MiniProgramModule.cs
+30
-0
AppletEducationController.cs
...WebApi/Controllers/Education/AppletEducationController.cs
+1
-0
TenantController.cs
Mall.WebApi/Controllers/User/TenantController.cs
+401
-44
No files found.
Mall.Common/Plugin/WeiXinHelper.cs
View file @
e676f110
...
...
@@ -205,6 +205,59 @@ namespace Mall.Common.Plugin
/// </summary>
public
string
errmsg
{
get
;
set
;
}
}
public
class
templateresult
{
/// <summary>
/// openid
/// </summary>
public
string
openid
{
get
;
set
;
}
/// <summary>
/// session_key
/// </summary>
public
List
<
templateresultModel
>
data
{
get
;
set
;
}
/// <summary>
/// 错误状态码
/// </summary>
public
string
errCode
{
get
;
set
;
}
/// <summary>
/// 错误提示信息
/// </summary>
public
string
errMsg
{
get
;
set
;
}
}
public
class
templateresultModel
{
/// <summary>
/// 添加至帐号下的模板 id,发送小程序订阅消息时所需
/// </summary>
public
string
priTmplId
{
get
;
set
;
}
/// <summary>
/// 模版标题
/// </summary>
public
string
title
{
get
;
set
;
}
/// <summary>
/// 模版内容
/// </summary>
public
string
content
{
get
;
set
;
}
/// <summary>
/// 模板内容示例
/// </summary>
public
string
example
{
get
;
set
;
}
/// <summary>
/// 模版类型,2 为一次性订阅,3 为长期订阅
/// </summary>
public
string
type
{
get
;
set
;
}
}
#
endregion
...
...
Mall.Module.BaseSetUp/MallBaseModule.cs
View file @
e676f110
...
...
@@ -5,6 +5,7 @@ using Mall.Model.Extend.BaseSetUp;
using
Mall.Repository
;
using
Mall.Repository.BaseSetUp
;
using
Mall.Repository.User
;
using
NPOI.SS.Formula.Functions
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
...
...
@@ -926,14 +927,32 @@ namespace Mall.Module.BaseSetUp
/// <returns></returns>
public
bool
AddOrUpdateFileStore
(
RB_File_Store
model
)
{
bool
result
=
false
;
int
id
=
0
;
if
(
model
.
ID
==
0
)
{
return
storeRepository
.
Insert
(
model
)
>
0
;
id
=
storeRepository
.
Insert
(
model
);
result
=
id
>
0
;
}
else
{
return
storeRepository
.
Update
(
model
);
id
=
model
.
ID
;
result
=
storeRepository
.
Update
(
model
);
}
//判断当前的是否设置成默认没有
if
(
model
.
IsDefault
==
1
&&
result
)
//将其他的默认赋值成0
{
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_File_Store
.
IsDefault
),
0
},
};
List
<
WhereHelper
>
whereHelpers
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(){
FiledName
=
nameof
(
RB_File_Store
.
TenantId
),
FiledValue
=
model
.
TenantId
,
OperatorEnum
=
OperatorEnum
.
Equal
},
new
WhereHelper
(){
FiledName
=
nameof
(
RB_File_Store
.
MallBaseId
),
FiledValue
=
model
.
MallBaseId
,
OperatorEnum
=
OperatorEnum
.
Equal
},
new
WhereHelper
(){
FiledName
=
nameof
(
RB_File_Store
.
ID
),
FiledValue
=
id
,
OperatorEnum
=
OperatorEnum
.
NotEqual
},
};
storeRepository
.
Update
(
fileds
,
whereHelpers
);
}
return
result
;
}
#
endregion
...
...
@@ -1279,7 +1298,7 @@ namespace Mall.Module.BaseSetUp
public
object
GetMicroShopBasics
(
RB_MicroShop_Basics
query
)
{
var
model
=
microShopBasicsRepository
.
GetMicroShopBasicsList
(
query
).
FirstOrDefault
();
if
(
model
==
null
)
if
(
model
==
null
)
{
model
=
new
RB_MicroShop_Basics
();
}
...
...
Mall.Module.Product/ProductModule.cs
View file @
e676f110
...
...
@@ -1413,7 +1413,7 @@ namespace Mall.Module.Product
int
IsNormalServer
=
Convert
.
ToInt32
(
Config
.
IsNormalServer
);
if
(
IsNormalServer
!=
1
)
{
token
=
"3
7_0-lYjcCk7K4srJ_SWIumrzRMY4s2UdttdugOEOLBoeQEOUEXga2hutyJrM7PC9QZkK9aXu7g4nE62J7YWfA2T6CKbq1_qPq0njfMvmk2_OZndOv-Rr1BIRhkqa6gFq71zo2Dr73T5tFe5QQ9LWQhAFAEPJ
"
;
token
=
"3
8_LJMrD0ffPj7GXvXxgGMwDMx9Qs_tXYe0HObmYw_2IGQUTRWSk9WbmrROPvEHEGgroSkhOctTFXFO1RAcYKo0uxrTHw5aRz9NXZ_t3Tp4M486c5XkLvPamTfWg_LaegNpvAqfVGWR-IiBbVL9GURgACAUIF
"
;
}
if
(
string
.
IsNullOrEmpty
(
token
))
{
...
...
Mall.Module.User/MiniProgramModule.cs
View file @
e676f110
...
...
@@ -707,6 +707,36 @@ namespace Mall.Module.User
return
flag
;
}
/// <summary>
/// 修改微信小程序商城订阅配置信息
/// </summary>
/// <param name="extModel"></param>
/// <returns></returns>
public
bool
SetAllMiniProgramMallSubscribeModule
(
RB_MiniProgram_Extend
extModel
)
{
bool
flag
=
false
;
if
(
extModel
.
MallBaseId
>
0
)
{
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_MiniProgram_Extend
.
OrderSuccessTpl
),
extModel
.
OrderSuccessTpl
},
{
nameof
(
RB_MiniProgram_Extend
.
OrderCancelTpl
),
extModel
.
OrderCancelTpl
},
{
nameof
(
RB_MiniProgram_Extend
.
OrderDeliverGoodsTpl
),
extModel
.
OrderDeliverGoodsTpl
},
{
nameof
(
RB_MiniProgram_Extend
.
RefundTpl
),
extModel
.
RefundTpl
},
{
nameof
(
RB_MiniProgram_Extend
.
ActiveStateTpl
),
extModel
.
ActiveStateTpl
},
{
nameof
(
RB_MiniProgram_Extend
.
AuditResultTpl
),
extModel
.
AuditResultTpl
},
{
nameof
(
RB_MiniProgram_Extend
.
ReflectSuccessTpl
),
extModel
.
ReflectSuccessTpl
},
{
nameof
(
RB_MiniProgram_Extend
.
ReflectFailTpl
),
extModel
.
ReflectFailTpl
},
{
nameof
(
RB_MiniProgram_Extend
.
MembersLevelChangeTpl
),
extModel
.
MembersLevelChangeTpl
},
};
flag
=
programRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_MiniProgram_Extend
.
MallBaseId
),
extModel
.
MallBaseId
));
}
return
flag
;
}
/// <summary>
/// 修改微信小程序分销订阅配置信息
/// </summary>
...
...
Mall.WebApi/Controllers/Education/AppletEducationController.cs
View file @
e676f110
...
...
@@ -915,6 +915,7 @@ namespace Mall.WebApi.Controllers.Education
x
.
Major
,
x
.
LableNameList
,
x
.
Name
,
x
.
TeacherId
,
CreateDate
=
x
.
CreateDate
.
ToString
(
"yyyy-MM-dd HH:ss:mm"
),
});
...
...
Mall.WebApi/Controllers/User/TenantController.cs
View file @
e676f110
...
...
@@ -182,10 +182,10 @@ namespace Mall.WebApi.Controllers.User
MallBaseId
=
0
,
EmpId
=
model
.
EmpId
,
erptoken
=
erptoken
,
ERPEmpId
=
(
erpUserInfo
?.
EmployeeId
??
0
),
ERPBranchId
=
(
erpUserInfo
?.
RB_Branch_id
??
-
1
),
ERPGroupId
=
(
erpUserInfo
?.
RB_Group_id
??
0
),
IsOpenSchool
=
0
,
ERPEmpId
=
(
erpUserInfo
?.
EmployeeId
??
0
),
ERPBranchId
=
(
erpUserInfo
?.
RB_Branch_id
??
-
1
),
ERPGroupId
=
(
erpUserInfo
?.
RB_Group_id
??
0
),
IsOpenSchool
=
0
,
};
UserReidsCache
.
UserInfoSet
(
UserModuleCacheKeyConfig
.
Mall_Login_Info
+
model
.
TenantId
,
obj
,
Config
.
JwtExpirTime
);
return
ApiResult
.
Success
(
""
,
obj
);
...
...
@@ -442,47 +442,404 @@ namespace Mall.WebApi.Controllers.User
//
public ApiResult GetMiniAllTemplent()
//
{
//
//向微信服务端 使用登录凭证 code 获取 session_key 和 openid
//
var extModel = JsonConvert.DeserializeObject<RB_MiniProgram_Extend>(RequestParm.msg.ToString());
//
extModel.MallBaseId = RequestParm.MallBaseId;
//
extModel.TenantId = RequestParm.TenantId;
//
var newMini = programModule.GetMiniProgramModule(extModel);
//
string token = CacheManager.AppletWeChat.WeiXinReidsCache.Get(newMini.MiniAppId);
//
if (string.IsNullOrEmpty(token))
//
{
//
token = Mall.Common.Pay.WeChatPat.TokenHelper.GetLXYToken(token, newMini.MiniAppId, newMini.MiniAppSecret);
//
System.Threading.Tasks.Task.Run(() => CacheManager.AppletWeChat.WeiXinReidsCache.Set(newMini.MiniAppId, token));
//
}
//
if (string.IsNullOrEmpty(token))
//
{
//
return ApiResult.Failed("");
//
}
public
ApiResult
GetMiniAllTemplent
()
{
//向微信服务端 使用登录凭证 code 获取 session_key 和 openid
var
extModel
=
JsonConvert
.
DeserializeObject
<
RB_MiniProgram_Extend
>(
RequestParm
.
msg
.
ToString
());
extModel
.
MallBaseId
=
RequestParm
.
MallBaseId
;
extModel
.
TenantId
=
RequestParm
.
TenantId
;
var
newMini
=
programModule
.
GetMiniProgramModule
(
extModel
);
string
token
=
CacheManager
.
AppletWeChat
.
WeiXinReidsCache
.
Get
(
newMini
.
MiniAppId
);
if
(
string
.
IsNullOrEmpty
(
token
))
{
token
=
Mall
.
Common
.
Pay
.
WeChatPat
.
TokenHelper
.
GetLXYToken
(
token
,
newMini
.
MiniAppId
,
newMini
.
MiniAppSecret
);
System
.
Threading
.
Tasks
.
Task
.
Run
(()
=>
CacheManager
.
AppletWeChat
.
WeiXinReidsCache
.
Set
(
newMini
.
MiniAppId
,
token
));
}
if
(
string
.
IsNullOrEmpty
(
token
))
{
return
ApiResult
.
Failed
(
""
);
}
// string url = "https://api.weixin.qq.com/cgi-bin/wxopen/template/list?access_token=" + token;
// string type = "utf-8";
// GetUsersHelper GetUsersHelper = new GetUsersHelper();
// string wenXinResult = string.Empty;
// JObject jo = null;
// result res = new result();
// try
// {
// wenXinResult = GetUsersHelper.GetUrltoHtml(url, type);//获取微信服务器返回字符串
// jo = (JObject)JsonConvert.DeserializeObject(wenXinResult);//将字符串转换为json格式
// //微信服务器验证成功
// res.openid = jo["errcode"].ToString();
// }
// catch (Exception ex)
// {
// Common.Plugin.LogHelper.Write(ex, string.Format("GetWx:wenXinResult:{0},code:}", wenXinResult));
// //微信服务器验证失败
// res.errcode = jo["errcode"].ToString();
// res.errmsg = jo["errmsg"].ToString();
// }
string
url
=
"https://api.weixin.qq.com/wxaapi/newtmpl/gettemplate?access_token="
+
token
;
string
type
=
"utf-8"
;
GetUsersHelper
GetUsersHelper
=
new
GetUsersHelper
();
string
wenXinResult
=
string
.
Empty
;
JObject
jo
=
null
;
templateresult
res
=
new
templateresult
();
try
{
wenXinResult
=
GetUsersHelper
.
GetUrltoHtml
(
url
,
type
);
//获取微信服务器返回字符串
jo
=
(
JObject
)
JsonConvert
.
DeserializeObject
(
wenXinResult
);
//将字符串转换为json格式
//微信服务器验证成功
res
.
data
=
JsonConvert
.
DeserializeObject
<
List
<
templateresultModel
>>(
jo
[
"data"
].
ToString
());
}
catch
(
Exception
ex
)
{
Common
.
Plugin
.
LogHelper
.
Write
(
ex
,
string
.
Format
(
"GetWx:wenXinResult:{0},code:}"
,
wenXinResult
));
//微信服务器验证失败
res
.
errCode
=
jo
[
"errcode"
].
ToString
();
res
.
errMsg
=
jo
[
"errmsg"
].
ToString
();
}
return
ApiResult
.
Success
(
""
);
}
public
ApiResult
GetMiniAddTemplent
()
{
//向微信服务端 使用登录凭证 code 获取 session_key 和 openid
var
extModel
=
JsonConvert
.
DeserializeObject
<
RB_MiniProgram_Extend
>(
RequestParm
.
msg
.
ToString
());
extModel
.
MallBaseId
=
RequestParm
.
MallBaseId
;
extModel
.
TenantId
=
RequestParm
.
TenantId
;
var
newMini
=
programModule
.
GetMiniProgramModule
(
extModel
);
string
token
=
CacheManager
.
AppletWeChat
.
WeiXinReidsCache
.
Get
(
newMini
.
MiniAppId
);
if
(
string
.
IsNullOrEmpty
(
token
))
{
token
=
Mall
.
Common
.
Pay
.
WeChatPat
.
TokenHelper
.
GetLXYToken
(
token
,
newMini
.
MiniAppId
,
newMini
.
MiniAppSecret
);
System
.
Threading
.
Tasks
.
Task
.
Run
(()
=>
CacheManager
.
AppletWeChat
.
WeiXinReidsCache
.
Set
(
newMini
.
MiniAppId
,
token
));
}
if
(
string
.
IsNullOrEmpty
(
token
))
{
return
ApiResult
.
Failed
(
""
);
}
string
url
=
"https://api.weixin.qq.com/wxaapi/newtmpl/addtemplate?access_token="
+
token
;
string
wenXinResult
=
string
.
Empty
;
JObject
jo
=
null
;
#
region
获取当前小程序下面所有的模板
id
string
urltemplate
=
"https://api.weixin.qq.com/wxaapi/newtmpl/gettemplate?access_token="
+
token
;
string
type
=
"utf-8"
;
GetUsersHelper
GetUsersHelper
=
new
GetUsersHelper
();
string
wenXinResulttemplate
=
string
.
Empty
;
JObject
jotemplate
=
null
;
templateresult
res
=
new
templateresult
();
try
{
wenXinResulttemplate
=
GetUsersHelper
.
GetUrltoHtml
(
urltemplate
,
type
);
//获取微信服务器返回字符串
jotemplate
=
(
JObject
)
JsonConvert
.
DeserializeObject
(
wenXinResulttemplate
);
//将字符串转换为json格式
//微信服务器验证成功
res
.
data
=
JsonConvert
.
DeserializeObject
<
List
<
templateresultModel
>>(
jotemplate
[
"data"
].
ToString
());
if
(
res
.
data
!=
null
&&
res
.
data
.
Any
())
{
foreach
(
var
item
in
res
.
data
)
{
if
(
item
.
title
==
"提现成功通知"
)
{
newMini
.
ReflectSuccessTpl
=
item
.
priTmplId
;
}
else
if
(
item
.
title
==
"下单成功提醒"
)
{
newMini
.
OrderSuccessTpl
=
item
.
priTmplId
;
}
else
if
(
item
.
title
==
"订单取消通知"
)
{
newMini
.
OrderCancelTpl
=
item
.
priTmplId
;
}
else
if
(
item
.
title
==
"订单发货通知"
)
{
newMini
.
OrderDeliverGoodsTpl
=
item
.
priTmplId
;
}
else
if
(
item
.
title
==
"退款通知"
)
{
newMini
.
RefundTpl
=
item
.
priTmplId
;
}
else
if
(
item
.
title
==
"活动状态通知"
)
{
newMini
.
ReflectSuccessTpl
=
item
.
priTmplId
;
}
else
if
(
item
.
title
==
"审核结果通知"
)
{
newMini
.
AuditResultTpl
=
item
.
priTmplId
;
}
else
if
(
item
.
title
==
"提现失败通知"
)
{
newMini
.
ReflectFailTpl
=
item
.
priTmplId
;
}
else
if
(
item
.
title
==
"会员等级变更通知"
)
{
newMini
.
MembersLevelChangeTpl
=
item
.
priTmplId
;
}
}
}
}
catch
(
Exception
ex
)
{
Common
.
Plugin
.
LogHelper
.
Write
(
ex
,
string
.
Format
(
"GetWx:wenXinResult:{0},code:}"
,
wenXinResulttemplate
));
//微信服务器验证失败
res
.
errCode
=
jotemplate
[
"errcode"
].
ToString
();
res
.
errMsg
=
jotemplate
[
"errmsg"
].
ToString
();
}
#
endregion
#
region
下单成功提醒
(
类目
:
服装
/
鞋
/
箱包
)
if
(
string
.
IsNullOrWhiteSpace
(
newMini
.
OrderSuccessTpl
))
{
try
{
var
kidList
=
new
List
<
int
>
{
6
,
5
,
3
,
1
};
var
resultInfo
=
new
{
tid
=
"434"
,
kidList
,
sceneDesc
=
"用户下单提醒"
};
wenXinResult
=
HttpHelper
.
HttpPost
(
url
,
JsonHelper
.
Serialize
(
resultInfo
),
""
);
// GetUsersHelper.GetUrltoHtml(url, type);//获取微信服务器返回字符串
jo
=
(
JObject
)
JsonConvert
.
DeserializeObject
(
wenXinResult
);
//将字符串转换为json格式
int
errcode
=
Convert
.
ToInt32
(
jo
[
"errcode"
].
ToString
());
if
(
errcode
==
0
)
{
//微信服务器验证成功
// res.priTmplId = jo["priTmplId"].ToString();
newMini
.
OrderSuccessTpl
=
jo
[
"priTmplId"
].
ToString
();
}
}
catch
(
Exception
ex
)
{
Common
.
Plugin
.
LogHelper
.
Write
(
ex
,
string
.
Format
(
"下单成功提醒GetWx:GetMiniAddTemplent:{0},code:}"
,
wenXinResult
));
}
}
#
endregion
#
region
订单取消提醒
(
类目
:
服装
/
鞋
/
箱包
)
if
(
string
.
IsNullOrWhiteSpace
(
newMini
.
OrderCancelTpl
))
{
try
{
var
kidList
=
new
List
<
int
>
{
12
,
1
,
4
,
7
};
var
resultInfo
=
new
{
tid
=
"994"
,
kidList
,
sceneDesc
=
"用于用户取消订单"
};
wenXinResult
=
HttpHelper
.
HttpPost
(
url
,
JsonHelper
.
Serialize
(
resultInfo
),
""
);
// GetUsersHelper.GetUrltoHtml(url, type);//获取微信服务器返回字符串
jo
=
(
JObject
)
JsonConvert
.
DeserializeObject
(
wenXinResult
);
//将字符串转换为json格式
int
errcode
=
Convert
.
ToInt32
(
jo
[
"errcode"
].
ToString
());
if
(
errcode
==
0
)
{
//微信服务器验证成功
// res.priTmplId = jo["priTmplId"].ToString();
newMini
.
OrderCancelTpl
=
jo
[
"priTmplId"
].
ToString
();
}
}
catch
(
Exception
ex
)
{
Common
.
Plugin
.
LogHelper
.
Write
(
ex
,
string
.
Format
(
"订单取消提醒GetWx:GetMiniAddTemplent:{0},code:}"
,
wenXinResult
));
}
}
#
endregion
#
region
订单发货提醒
(
类目
:
服装
/
鞋
/
箱包
)
if
(
string
.
IsNullOrWhiteSpace
(
newMini
.
OrderDeliverGoodsTpl
))
{
try
{
var
kidList
=
new
List
<
int
>
{
2
,
7
,
4
,
8
};
var
resultInfo
=
new
{
tid
=
"855"
,
kidList
,
sceneDesc
=
"用于发货通知用户"
};
wenXinResult
=
HttpHelper
.
HttpPost
(
url
,
JsonHelper
.
Serialize
(
resultInfo
),
""
);
// GetUsersHelper.GetUrltoHtml(url, type);//获取微信服务器返回字符串
jo
=
(
JObject
)
JsonConvert
.
DeserializeObject
(
wenXinResult
);
//将字符串转换为json格式
int
errcode
=
Convert
.
ToInt32
(
jo
[
"errcode"
].
ToString
());
if
(
errcode
==
0
)
{
//微信服务器验证成功
// res.priTmplId = jo["priTmplId"].ToString();
newMini
.
OrderDeliverGoodsTpl
=
jo
[
"priTmplId"
].
ToString
();
}
}
catch
(
Exception
ex
)
{
Common
.
Plugin
.
LogHelper
.
Write
(
ex
,
string
.
Format
(
"订单发货提醒GetWx:GetMiniAddTemplent:{0},code:}"
,
wenXinResult
));
}
}
#
endregion
#
region
退款提醒
(
类目
:
服装
/
鞋
/
箱包
)
if
(
string
.
IsNullOrWhiteSpace
(
newMini
.
RefundTpl
))
{
try
{
var
kidList
=
new
List
<
int
>
{
4
,
5
,
2
,
1
};
var
resultInfo
=
new
{
tid
=
"1435"
,
kidList
,
sceneDesc
=
"用户给用户退款"
};
wenXinResult
=
HttpHelper
.
HttpPost
(
url
,
JsonHelper
.
Serialize
(
resultInfo
),
""
);
// GetUsersHelper.GetUrltoHtml(url, type);//获取微信服务器返回字符串
jo
=
(
JObject
)
JsonConvert
.
DeserializeObject
(
wenXinResult
);
//将字符串转换为json格式
int
errcode
=
Convert
.
ToInt32
(
jo
[
"errcode"
].
ToString
());
if
(
errcode
==
0
)
{
//微信服务器验证成功
// res.priTmplId = jo["priTmplId"].ToString();
newMini
.
RefundTpl
=
jo
[
"priTmplId"
].
ToString
();
}
}
catch
(
Exception
ex
)
{
Common
.
Plugin
.
LogHelper
.
Write
(
ex
,
string
.
Format
(
"退款提醒GetWx:GetMiniAddTemplent:{0},code:}"
,
wenXinResult
));
}
}
#
endregion
#
region
活动状态提醒
(
类目
:
服装
/
鞋
/
箱包
)
if
(
string
.
IsNullOrWhiteSpace
(
newMini
.
ActiveStateTpl
))
{
try
{
var
kidList
=
new
List
<
int
>
{
1
,
2
,
4
};
var
resultInfo
=
new
{
tid
=
"1437"
,
kidList
,
sceneDesc
=
"用于活动进度通知"
};
wenXinResult
=
HttpHelper
.
HttpPost
(
url
,
JsonHelper
.
Serialize
(
resultInfo
),
""
);
// GetUsersHelper.GetUrltoHtml(url, type);//获取微信服务器返回字符串
jo
=
(
JObject
)
JsonConvert
.
DeserializeObject
(
wenXinResult
);
//将字符串转换为json格式
int
errcode
=
Convert
.
ToInt32
(
jo
[
"errcode"
].
ToString
());
if
(
errcode
==
0
)
{
//微信服务器验证成功
// res.priTmplId = jo["priTmplId"].ToString();
newMini
.
ActiveStateTpl
=
jo
[
"priTmplId"
].
ToString
();
}
}
catch
(
Exception
ex
)
{
Common
.
Plugin
.
LogHelper
.
Write
(
ex
,
string
.
Format
(
"活动状态提醒GetWx:GetMiniAddTemplent:{0},code:}"
,
wenXinResult
));
}
}
#
endregion
// return ApiResult.Success("");
//}
#
region
审核结果提醒
(
类目
:
服装
/
鞋
/
箱包
)
if
(
string
.
IsNullOrWhiteSpace
(
newMini
.
AuditResultTpl
))
{
try
{
var
kidList
=
new
List
<
int
>
{
6
,
5
,
3
,
1
};
var
resultInfo
=
new
{
tid
=
"818"
,
kidList
,
sceneDesc
=
"用于分销商审核说明"
};
wenXinResult
=
HttpHelper
.
HttpPost
(
url
,
JsonHelper
.
Serialize
(
resultInfo
),
""
);
// GetUsersHelper.GetUrltoHtml(url, type);//获取微信服务器返回字符串
jo
=
(
JObject
)
JsonConvert
.
DeserializeObject
(
wenXinResult
);
//将字符串转换为json格式
int
errcode
=
Convert
.
ToInt32
(
jo
[
"errcode"
].
ToString
());
if
(
errcode
==
0
)
{
//微信服务器验证成功
// res.priTmplId = jo["priTmplId"].ToString();
newMini
.
AuditResultTpl
=
jo
[
"priTmplId"
].
ToString
();
}
}
catch
(
Exception
ex
)
{
Common
.
Plugin
.
LogHelper
.
Write
(
ex
,
string
.
Format
(
"审核结果提醒GetWx:GetMiniAddTemplent:{0},code:}"
,
wenXinResult
));
}
}
#
endregion
#
region
提现成功通知
(
类目
:
服装
/
鞋
/
箱包
)
if
(
string
.
IsNullOrWhiteSpace
(
newMini
.
ReflectSuccessTpl
))
{
try
{
var
kidList
=
new
List
<
int
>
{
1
,
2
,
3
,
4
};
var
resultInfo
=
new
{
tid
=
"2001"
,
kidList
,
sceneDesc
=
"用于用户提现成功提醒"
};
wenXinResult
=
HttpHelper
.
HttpPost
(
url
,
JsonHelper
.
Serialize
(
resultInfo
),
""
);
// GetUsersHelper.GetUrltoHtml(url, type);//获取微信服务器返回字符串
jo
=
(
JObject
)
JsonConvert
.
DeserializeObject
(
wenXinResult
);
//将字符串转换为json格式
int
errcode
=
Convert
.
ToInt32
(
jo
[
"errcode"
].
ToString
());
if
(
errcode
==
0
)
{
//微信服务器验证成功
// res.priTmplId = jo["priTmplId"].ToString();
newMini
.
ReflectSuccessTpl
=
jo
[
"priTmplId"
].
ToString
();
}
}
catch
(
Exception
ex
)
{
Common
.
Plugin
.
LogHelper
.
Write
(
ex
,
string
.
Format
(
"提现成功通知GetWx:GetMiniAddTemplent:{0},code:}"
,
wenXinResult
));
}
}
#
endregion
#
region
提现失败通知
(
类目
:
服装
/
鞋
/
箱包
)
if
(
string
.
IsNullOrWhiteSpace
(
newMini
.
ReflectFailTpl
))
{
try
{
var
kidList
=
new
List
<
int
>
{
2
,
1
};
var
resultInfo
=
new
{
tid
=
"3173"
,
kidList
,
sceneDesc
=
"用于提现失败发送通知"
};
wenXinResult
=
HttpHelper
.
HttpPost
(
url
,
JsonHelper
.
Serialize
(
resultInfo
),
""
);
// GetUsersHelper.GetUrltoHtml(url, type);//获取微信服务器返回字符串
jo
=
(
JObject
)
JsonConvert
.
DeserializeObject
(
wenXinResult
);
//将字符串转换为json格式
int
errcode
=
Convert
.
ToInt32
(
jo
[
"errcode"
].
ToString
());
if
(
errcode
==
0
)
{
//微信服务器验证成功
// res.priTmplId = jo["priTmplId"].ToString();
newMini
.
ReflectFailTpl
=
jo
[
"priTmplId"
].
ToString
();
}
}
catch
(
Exception
ex
)
{
Common
.
Plugin
.
LogHelper
.
Write
(
ex
,
string
.
Format
(
"提现失败通知GetWx:GetMiniAddTemplent:{0},code:}"
,
wenXinResult
));
}
}
#
endregion
#
region
会员等级变更通知
(
类目
:
服装
/
鞋
/
箱包
)
if
(
string
.
IsNullOrWhiteSpace
(
newMini
.
MembersLevelChangeTpl
))
{
try
{
var
kidList
=
new
List
<
int
>
{
3
,
2
};
var
resultInfo
=
new
{
tid
=
"861"
,
kidList
,
sceneDesc
=
"用于会员等级变更提醒"
};
wenXinResult
=
HttpHelper
.
HttpPost
(
url
,
JsonHelper
.
Serialize
(
resultInfo
),
""
);
// GetUsersHelper.GetUrltoHtml(url, type);//获取微信服务器返回字符串
jo
=
(
JObject
)
JsonConvert
.
DeserializeObject
(
wenXinResult
);
//将字符串转换为json格式
int
errcode
=
Convert
.
ToInt32
(
jo
[
"errcode"
].
ToString
());
if
(
errcode
==
0
)
{
//微信服务器验证成功
// res.priTmplId = jo["priTmplId"].ToString();
newMini
.
MembersLevelChangeTpl
=
jo
[
"priTmplId"
].
ToString
();
}
}
catch
(
Exception
ex
)
{
Common
.
Plugin
.
LogHelper
.
Write
(
ex
,
string
.
Format
(
"会员等级变更通知GetWx:GetMiniAddTemplent:{0},code:}"
,
wenXinResult
));
}
}
#
endregion
var
flag
=
programModule
.
SetAllMiniProgramMallSubscribeModule
(
newMini
);
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
}
...
...
@@ -1754,7 +2111,7 @@ namespace Mall.WebApi.Controllers.User
query
.
MallBaseId
=
RequestParm
.
MallBaseId
;
query
.
TenantId
=
RequestParm
.
TenantId
;
//每日用户统计
var
basicData
=
programModule
.
MallDistributorDayStatisticsModule
(
pageModel
.
pageIndex
,
pageModel
.
pageSize
,
out
long
rowsCount
,
query
);
var
basicData
=
programModule
.
MallDistributorDayStatisticsModule
(
pageModel
.
pageIndex
,
pageModel
.
pageSize
,
out
long
rowsCount
,
query
);
pageModel
.
count
=
Convert
.
ToInt32
(
rowsCount
);
pageModel
.
pageData
=
basicData
;
...
...
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