Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
ashermed_old_push
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
backend
ashermed_old_push
Commits
eaeb888d
Commit
eaeb888d
authored
Jan 12, 2023
by
席世权
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增阿里云短信推送
parent
e1d8ca03
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
109 additions
and
19 deletions
+109
-19
OutProcessTaskBLL.cs
PushApi.Act/BLL/OutProcessTaskBLL.cs
+1
-0
PushValModel.cs
PushApi.Act/Models/Send/PushValModel.cs
+4
-0
ProcessTaskBLL.cs
PushInfo.Core/BLL/ProcessTaskBLL.cs
+13
-3
SmsBLL.cs
PushInfo.Core/BLL/SmsBLL.cs
+7
-6
MapProjectPushDAL.cs
PushInfo.Core/DAL/MySql/MapProjectPushDAL.cs
+1
-1
SendShortMessageParam.cs
PushInfo.Core/Models/Param/SendShortMessageParam.cs
+43
-0
DataMessage.cs
PushInfo.Core/Models/QueryResults/DataMessage.cs
+4
-0
Map_Project_Push.cs
PushInfo.Core/Models/Tables/Map_Project_Push.cs
+4
-0
PushInfo.Core.csproj
PushInfo.Core/PushInfo.Core.csproj
+1
-0
Web.config
PushPf.Api/Web.config
+26
-4
SmsCfgPage.cshtml
...ckground/Areas/BackGround/Views/Project/SmsCfgPage.cshtml
+1
-1
Web.config
PushPlatform.Background/Web.config
+3
-3
App.config
PushTest/App.config
+1
-1
No files found.
PushApi.Act/BLL/OutProcessTaskBLL.cs
View file @
eaeb888d
...
...
@@ -47,6 +47,7 @@ namespace PushApi.Act.BLL
data
.
mobile
=
valModel
.
Mobile
;
data
.
openId
=
valModel
.
OpenId
;
data
.
dicValue
=
valModel
.
DicValue
;
data
.
TemplateParam
=
valModel
.
TemplateParam
;
task
.
Push_Title
=
PushValueHelp
.
TransfOfDataModel
(
StringUtil
.
ExtractNotEmtry
(
valModel
.
PushTitle
,
task
.
Push_Title
),
data
);
task
.
Push_Body
=
PushValueHelp
.
TransfOfDataModel
(
StringUtil
.
ExtractNotEmtry
(
valModel
.
PushBody
,
task
.
Push_Body
),
data
);
task
.
Wx_MsmTemp
=
PushValueHelp
.
TransfOfDataModel
(
StringUtil
.
ExtractNotEmtry
(
valModel
.
WxMsmTemp
,
task
.
Wx_MsmTemp
),
data
);
...
...
PushApi.Act/Models/Send/PushValModel.cs
View file @
eaeb888d
...
...
@@ -73,5 +73,9 @@ namespace PushApi.Act.Models.Send
/// 环境类型1-生产,2-测试
/// </summary>
public
int
?
EnvType
{
get
;
set
;
}
=
1
;
/// <summary>
/// 阿里云短信专用参数
/// </summary>
public
string
TemplateParam
{
get
;
set
;
}
}
}
PushInfo.Core/BLL/ProcessTaskBLL.cs
View file @
eaeb888d
...
...
@@ -16,6 +16,7 @@ using System.Data;
using
PushInfo.Core.Common
;
using
PushPlatform.Common.Model
;
using
PushPlatform.Common.Mq
;
using
PushInfo.Core.Models.Param
;
namespace
PushInfo.Core.BLL
{
...
...
@@ -363,7 +364,16 @@ namespace PushInfo.Core.BLL
{
SmsConfig
smsCfgModel
=
JsonUtil
.
ConvertToObject
<
SmsConfig
>(
smsCfg
.
Config_Info
);
if
(!
string
.
IsNullOrEmpty
(
Data
.
mobile
))
result
=
Send_Message
(
smsCfgModel
.
InfoPformProId
,
Data
.
mobile
,
mapProPush
.
Push_Body
,
smsCfgModel
.
SmsSign
,
smsCfgModel
.
SmsType
);
result
=
Send_Message
(
new
SendShortMessageParam
()
{
ProjectId
=
smsCfgModel
.
InfoPformProId
,
Mobile
=
Data
.
mobile
,
PushBody
=
mapProPush
.
Push_Body
,
SmsMessageSigna
=
smsCfgModel
.
SmsSign
,
SmsType
=
smsCfgModel
.
SmsType
,
TemplateCode
=
mapProPush
.
TemplateCode
,
TemplateParam
=
Data
.
TemplateParam
});
else
{
result
.
Result
=
0
;
...
...
@@ -568,10 +578,10 @@ namespace PushInfo.Core.BLL
/// <param name="mobile">手机号</param>
/// <param name="pushBody">短信内容</param>
/// <returns></returns>
public
APIResult
<
string
>
Send_Message
(
string
projectId
,
string
mobile
,
string
pushBody
,
string
smsMessageSigna
,
int
smsType
)
public
APIResult
<
string
>
Send_Message
(
SendShortMessageParam
param
)
{
SmsBLL
bllSms
=
new
SmsBLL
();
return
bllSms
.
PushMessage
(
p
rojectId
,
mobile
,
pushBody
,
smsMessageSigna
,
smsType
);
return
bllSms
.
PushMessage
(
p
aram
);
}
#
endregion
...
...
PushInfo.Core/BLL/SmsBLL.cs
View file @
eaeb888d
...
...
@@ -13,6 +13,7 @@ using WebSocketSharp;
using
System.Net.Mail
;
using
PushPlatform.Common.Model
;
using
System.Net
;
using
PushInfo.Core.Models.Param
;
namespace
PushInfo.Core.BLL
{
...
...
@@ -58,18 +59,18 @@ namespace PushInfo.Core.BLL
#
endregion
#
region
推送短信
public
APIResult
<
string
>
PushMessage
(
string
smsProjectId
,
string
mobile
,
string
body
,
string
smsMessageSigna
,
int
smsType
)
public
APIResult
<
string
>
PushMessage
(
SendShortMessageParam
param
)
{
APIResult
<
string
>
result
=
new
APIResult
<
string
>();
result
.
Result
=
1
;
try
{
var
smsresult
=
""
;
if
(
s
msType
==
(
int
)
SmsType
.
博士通
)
//607新版短信
if
(
param
.
S
msType
==
(
int
)
SmsType
.
博士通
)
//607新版短信
{
using
(
PushPlatform
.
Common
.
NewSmsService
.
SmsServiceClient
sms
=
new
PushPlatform
.
Common
.
NewSmsService
.
SmsServiceClient
())
{
var
r
=
sms
.
SendMsg
(
smsProjectId
,
mobile
,
string
.
Format
(
smsMessageSigna
,
b
ody
));
var
r
=
sms
.
SendMsg
(
smsProjectId
,
param
.
Mobile
,
string
.
Format
(
param
.
SmsMessageSigna
,
param
.
PushB
ody
));
smsresult
=
r
;
if
(
r
.
Substring
(
0
,
1
)
==
"0"
)
{
...
...
@@ -77,11 +78,11 @@ namespace PushInfo.Core.BLL
}
}
}
else
if
(
s
msType
==
(
int
)
SmsType
.
阿里云
)
else
if
(
param
.
S
msType
==
(
int
)
SmsType
.
阿里云
)
{
using
(
PushPlatform
.
Common
.
NewSmsService
.
SmsServiceClient
sms
=
new
PushPlatform
.
Common
.
NewSmsService
.
SmsServiceClient
())
{
var
r
=
sms
.
AliSendCode
(
smsProjectId
,
smsMessageSigna
,
"SMS_213772733"
,
mobile
,
""
);
var
r
=
sms
.
AliSendCode
(
smsProjectId
,
param
.
SmsMessageSigna
,
param
.
TemplateCode
,
param
.
Mobile
,
(
param
.
TemplateParam
??
""
)
);
smsresult
=
r
;
if
(
r
==
"OK"
)
{
...
...
@@ -93,7 +94,7 @@ namespace PushInfo.Core.BLL
{
using
(
SMSServiceClient
sms
=
new
SMSServiceClient
())
{
smsresult
=
sms
.
SendMessage
(
Guid
.
Parse
(
smsProjectId
),
mobile
,
string
.
Format
(
smsMessageSigna
,
b
ody
),
null
).
ToString
();
smsresult
=
sms
.
SendMessage
(
Guid
.
Parse
(
smsProjectId
),
param
.
Mobile
,
string
.
Format
(
param
.
SmsMessageSigna
,
param
.
PushB
ody
),
null
).
ToString
();
}
}
...
...
PushInfo.Core/DAL/MySql/MapProjectPushDAL.cs
View file @
eaeb888d
...
...
@@ -21,7 +21,7 @@ namespace PushInfo.Core.DAL.MySql
t1.Exec_Time,t1.Exec_Status,t1.Push_Target,t1.Push_Style,t1.Push_TagId,t1.Push_Title,case when t1.Push_Body is null then t2.Push_Body else t1.Push_Body end as Push_Body,
t1.Push_Type,t1.Push_Cycle,t1.Push_Month,t1.Push_Which,t2.Push_Action,t2.Push_ActionType,
t2.Push_IosLink,t2.Push_AndLink,t2.Push_WebLink,t2.Push_WechatLink,t2.Db_ConnectId,
t1.Wx_MsmodelId,t1.Is_Deleted,t1.Trigger_Key,t2.Push_User_Action,t2.Push_User_ActionType,t2.Db_User_ConnectId
t1.Wx_MsmodelId,t1.Is_Deleted,t1.Trigger_Key,t2.Push_User_Action,t2.Push_User_ActionType,t2.Db_User_ConnectId
,t1.TemplateCode
from map_project_push t1 join sys_push t2 on t1.Push_Id = t2.Id and t1.ID = @Id and t1.Is_Deleted = 0 and t2.Is_Deleted = 0 "
;
Dictionary
<
string
,
object
>
param
=
new
Dictionary
<
string
,
object
>();
param
.
Add
(
"@Id"
,
Id
);
...
...
PushInfo.Core/Models/Param/SendShortMessageParam.cs
0 → 100644
View file @
eaeb888d
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
PushInfo.Core.Models.Param
{
/// <summary>
/// 发送短信数据对象
/// </summary>
public
class
SendShortMessageParam
{
/// <summary>
/// 项目Id
/// </summary>
public
string
ProjectId
{
get
;
set
;
}
/// <summary>
/// 手机号
/// </summary>
public
string
Mobile
{
get
;
set
;
}
/// <summary>
/// 推送消息体
/// </summary>
public
string
PushBody
{
get
;
set
;
}
/// <summary>
/// 签名
/// </summary>
public
string
SmsMessageSigna
{
get
;
set
;
}
/// <summary>
/// 短信供应商对应SmsType枚举
/// </summary>
public
int
SmsType
{
get
;
set
;
}
/// <summary>
/// 阿里云短信专用模板编号
/// </summary>
public
string
TemplateCode
{
get
;
set
;
}
/// <summary>
/// 阿里云短信专用参数
/// </summary>
public
string
TemplateParam
{
get
;
set
;
}
}
}
PushInfo.Core/Models/QueryResults/DataMessage.cs
View file @
eaeb888d
...
...
@@ -49,6 +49,10 @@ namespace PushInfo.Core.Models.QueryResults
/// 用户邮箱
/// </summary>
public
string
Email
{
get
;
set
;
}
/// <summary>
/// 阿里云短信专用参数
/// </summary>
public
string
TemplateParam
{
get
;
set
;
}
}
}
PushInfo.Core/Models/Tables/Map_Project_Push.cs
View file @
eaeb888d
...
...
@@ -160,5 +160,9 @@ namespace PushInfo.Core.Models.Tables
/// 环境类型
/// </summary>
public
int
?
EnvType
{
get
;
set
;
}
/// <summary>
/// 阿里云模板编号
/// </summary>
public
string
TemplateCode
{
get
;
set
;
}
}
}
PushInfo.Core/PushInfo.Core.csproj
View file @
eaeb888d
...
...
@@ -112,6 +112,7 @@
<Compile
Include=
"IDAL\ISysPushDAL.cs"
/>
<Compile
Include=
"IDAL\ITableInfoDAL.cs"
/>
<Compile
Include=
"IDAL\IWechatMsgmodelDAL.cs"
/>
<Compile
Include=
"Models\Param\SendShortMessageParam.cs"
/>
<Compile
Include=
"Models\QueryResults\DataMessage.cs"
/>
<Compile
Include=
"Models\QueryResults\ResultHelper.cs"
/>
<Compile
Include=
"Models\Tables\Mappush_User_Role.cs"
/>
...
...
PushPf.Api/Web.config
View file @
eaeb888d
...
...
@@ -5,12 +5,14 @@
-->
<
configuration
>
<
connectionStrings
>
<
add
name
=
"WriteConnStr"
connectionString
=
"Server=192.168.0.49;Database=db_ashermed_push;Uid=user;Pwd=Asher1234;"
/>
<
!--<
add
name
=
"WriteConnStr"
connectionString
=
"Server=192.168.0.49;Database=db_ashermed_push;Uid=user;Pwd=Asher1234;"
/>
<
add
name
=
"ReadConnStr"
connectionString
=
"Server=192.168.0.49;Database=db_ashermed_push;Uid=user;Pwd=Asher1234;"
/>
<
add
name
=
"PushPlatformContext"
connectionString
=
"Server=192.168.0.49;Database=db_ashermed_push;Uid=user;Pwd=Asher1234;"
/>
<
add
name
=
"PushPlatformContext"
connectionString
=
"Server=192.168.0.49;Database=db_ashermed_push;Uid=user;Pwd=Asher1234;"
/>-->
<
add
name
=
"WriteConnStr"
connectionString
=
"Server=101.132.234.102;Database=db_ashermed_push;Uid=iis;Pwd=iis;"
/>
<
add
name
=
"ReadConnStr"
connectionString
=
"Server=101.132.234.102;Database=db_ashermed_push;Uid=iis;Pwd=iis;"
/>
<
add
name
=
"PushPlatformContext"
connectionString
=
"Server=101.132.234.102;Database=db_ashermed_push;Uid=iis;Pwd=iis;"
/>
<
add
name
=
"mongo_edc_log"
connectionString
=
"mongodb://iis_Trialdem:WezpeW1ajDvBGnz@101.132.228.78:3717/ASHermed_91Trialdem_Logs?slaveOk=true"
/>
<!--<
add
name
=
"WriteConnStr"
connectionString
=
"Server=101.132.234.102;Database=db_ashermed_push;Uid=iis;Pwd=iis;"
/>
<
add
name
=
"ReadConnStr"
connectionString
=
"Server=101.132.234.102;Database=db_ashermed_push;Uid=iis;Pwd=iis;"
/>-->
</
connectionStrings
>
<
appSettings
>
<
add
key
=
"DB"
value
=
"MySql"
/>
...
...
@@ -91,4 +93,24 @@
<
compiler
language
=
"vb;vbs;visualbasic;vbscript"
extension
=
".vb"
type
=
"Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
warningLevel
=
"4"
compilerOptions
=
"/langversion:14 /nowarn:41008 /define:_MYTYPE=\"Web\" /optionInfer+"
/>
</
compilers
>
</
system
.
codedom
>
<
system
.
serviceModel
>
<
bindings
>
<
basicHttpBinding
>
<
binding
name
=
"WeChatServiceSoap"
/>
<
binding
name
=
"BasicHttpBinding_ISMSService"
/>
<
binding
name
=
"BasicHttpBinding_ISmsService"
/>
</
basicHttpBinding
>
</
bindings
>
<
client
>
<
endpoint
address
=
"http://tools.ashermed.com/WeChatPlatForm/WeChatService.asmx"
binding
=
"basicHttpBinding"
bindingConfiguration
=
"WeChatServiceSoap"
contract
=
"WeChatService.WeChatServiceSoap"
name
=
"WeChatServiceSoap"
/>
<
endpoint
address
=
"http://localhost:4316/SMSService.svc"
binding
=
"basicHttpBinding"
bindingConfiguration
=
"BasicHttpBinding_ISMSService"
contract
=
"SmsService.ISMSService"
name
=
"BasicHttpBinding_ISMSService"
/>
<
endpoint
address
=
"http://channel.ashermed.com/SmsService.svc"
binding
=
"basicHttpBinding"
bindingConfiguration
=
"BasicHttpBinding_ISmsService"
contract
=
"NewSmsService.ISmsService"
name
=
"BasicHttpBinding_ISmsService"
/>
</
client
>
</
system
.
serviceModel
>
</
configuration
>
PushPlatform.Background/Areas/BackGround/Views/Project/SmsCfgPage.cshtml
View file @
eaeb888d
...
...
@@ -40,7 +40,7 @@
<label for="c5d73547-4abb-435b-92a0-155447440591" class="poradio">互亿</label>
</div>
<div class="radio radio-custom radio-inline phmod1">
<input type="radio" id="
c5d73547-4abb-435b-92a0-155447440591
" name="SmsType" @(smsModel.SmsType == (int)SmsType.阿里云 ? "checked" : "") value="4" onclick="inputctr.cgsel(this)">
<input type="radio" id="
7090920a-a413-4d65-9359-6206b6db5b64
" name="SmsType" @(smsModel.SmsType == (int)SmsType.阿里云 ? "checked" : "") value="4" onclick="inputctr.cgsel(this)">
<label for="c5d73547-4abb-435b-92a0-155447440591" class="poradio">阿里云</label>
</div>
</div>
...
...
PushPlatform.Background/Web.config
View file @
eaeb888d
...
...
@@ -5,9 +5,9 @@
-->
<
configuration
>
<
connectionStrings
>
<
add
name
=
"WriteConnStr"
connectionString
=
"Server=192.168.0.
62
;Database=db_ashermed_push;Uid=user;Pwd=Asher1234;"
/>
<
add
name
=
"ReadConnStr"
connectionString
=
"Server=192.168.0.
62
;Database=db_ashermed_push;Uid=user;Pwd=Asher1234;"
/>
<
add
name
=
"PushPlatformContext"
connectionString
=
"Server=192.168.0.
62
;Database=db_ashermed_push;Uid=user;Pwd=Asher1234;"
/>
<
add
name
=
"WriteConnStr"
connectionString
=
"Server=192.168.0.
49
;Database=db_ashermed_push;Uid=user;Pwd=Asher1234;"
/>
<
add
name
=
"ReadConnStr"
connectionString
=
"Server=192.168.0.
49
;Database=db_ashermed_push;Uid=user;Pwd=Asher1234;"
/>
<
add
name
=
"PushPlatformContext"
connectionString
=
"Server=192.168.0.
49
;Database=db_ashermed_push;Uid=user;Pwd=Asher1234;"
/>
<!--<
add
name
=
"WriteConnStr"
connectionString
=
"Server=101.132.234.102;Database=db_ashermed_push;Uid=iis;Pwd=iis;"
/>
<
add
name
=
"ReadConnStr"
connectionString
=
"Server=101.132.234.102;Database=db_ashermed_push;Uid=iis;Pwd=iis;"
/>
...
...
PushTest/App.config
View file @
eaeb888d
...
...
@@ -117,7 +117,7 @@
<
assemblyBinding
xmlns
=
"urn:schemas-microsoft-com:asm.v1"
>
<
dependentAssembly
>
<
assemblyIdentity
name
=
"Newtonsoft.Json"
publicKeyToken
=
"30ad4fe6b2a6aeed"
culture
=
"neutral"
/>
<
bindingRedirect
oldVersion
=
"0.0.0.0-
6.0.0.0"
newVersion
=
"6
.0.0.0"
/>
<
bindingRedirect
oldVersion
=
"0.0.0.0-
9.0.0.0"
newVersion
=
"9
.0.0.0"
/>
</
dependentAssembly
>
</
assemblyBinding
>
</
runtime
>
...
...
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