Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
8
8timerapiv200
Overview
Overview
Details
Activity
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
8timerv2
8timerapiv200
Commits
7d9c6b46
Commit
7d9c6b46
authored
Nov 11, 2020
by
ilal
Committed by
chenzg
Jul 05, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交
parent
32b6d957
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
6 deletions
+30
-6
src/main/java/cn/timer/api/bean/admin/AdminAssoTxjlb.java
+1
-1
src/main/java/cn/timer/api/controller/htzz/atttimer/AlicloudSMS.java
+27
-3
src/main/java/cn/timer/api/controller/htzz/atttimer/NewsTaskTiming.java
+2
-2
No files found.
src/main/java/cn/timer/api/bean/admin/AdminAssoTxjlb.java
View file @
7d9c6b46
...
@@ -53,7 +53,7 @@ public class AdminAssoTxjlb extends Model<AdminAssoTxjlb> {
...
@@ -53,7 +53,7 @@ public class AdminAssoTxjlb extends Model<AdminAssoTxjlb> {
private
Integer
orgCode
;
private
Integer
orgCode
;
@ApiModelProperty
(
value
=
"生成时间 生成时间"
,
example
=
"101"
)
@ApiModelProperty
(
value
=
"生成时间 生成时间"
,
example
=
"101"
)
private
Integer
addtime
;
private
Long
addtime
;
@ApiModelProperty
(
value
=
"状态 0:未读 1:已读"
,
example
=
"101"
)
@ApiModelProperty
(
value
=
"状态 0:未读 1:已读"
,
example
=
"101"
)
private
Integer
txstate
;
private
Integer
txstate
;
...
...
src/main/java/cn/timer/api/controller/htzz/atttimer/AlicloudSMS.java
View file @
7d9c6b46
package
cn
.
timer
.
api
.
controller
.
htzz
.
atttimer
;
package
cn
.
timer
.
api
.
controller
.
htzz
.
atttimer
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map.Entry
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
...
@@ -20,6 +23,7 @@ import com.aliyuncs.profile.DefaultProfile;
...
@@ -20,6 +23,7 @@ import com.aliyuncs.profile.DefaultProfile;
import
com.google.gson.JsonArray
;
import
com.google.gson.JsonArray
;
import
com.google.gson.JsonObject
;
import
com.google.gson.JsonObject
;
import
cn.timer.api.bean.admin.AdminAssoTxjlb
;
import
cn.timer.api.bean.admin.AdminMsgTemplate
;
import
cn.timer.api.bean.admin.AdminMsgTemplate
;
import
cn.timer.api.bean.htzz.HtzzAdminZzda
;
import
cn.timer.api.bean.htzz.HtzzAdminZzda
;
import
cn.timer.api.config.enums.PinType
;
import
cn.timer.api.config.enums.PinType
;
...
@@ -54,7 +58,7 @@ public class AlicloudSMS {
...
@@ -54,7 +58,7 @@ public class AlicloudSMS {
* 提醒功能
* 提醒功能
*/
*/
@SuppressWarnings
(
"deprecation"
)
@SuppressWarnings
(
"deprecation"
)
public
List
<
Object
>
remind
(
HtzzAdminZzda
zzda
,
String
phone
,
String
tzname
)
{
public
List
<
Object
>
remind
(
HtzzAdminZzda
zzda
,
String
phone
,
String
tzname
,
Integer
tzrid
)
{
//短信模板详情
//短信模板详情
AdminMsgTemplate
dxmb
=
AdminMsgTemplate
.
builder
().
id
(
zzda
.
getTemplateId
()).
build
().
selectById
();
AdminMsgTemplate
dxmb
=
AdminMsgTemplate
.
builder
().
id
(
zzda
.
getTemplateId
()).
build
().
selectById
();
...
@@ -110,7 +114,7 @@ public class AlicloudSMS {
...
@@ -110,7 +114,7 @@ public class AlicloudSMS {
String
SMSformat
=
String
.
valueOf
(
array
).
replace
(
"["
,
""
).
replace
(
"]"
,
""
);
String
SMSformat
=
String
.
valueOf
(
array
).
replace
(
"["
,
""
).
replace
(
"]"
,
""
);
System
.
out
.
println
(
SMSformat
);
//
System.out.println(SMSformat);
//短信模板格式
//短信模板格式
request
.
putQueryParameter
(
TEMPLATE_PARAM
,
SMSformat
);
request
.
putQueryParameter
(
TEMPLATE_PARAM
,
SMSformat
);
...
@@ -119,7 +123,7 @@ public class AlicloudSMS {
...
@@ -119,7 +123,7 @@ public class AlicloudSMS {
try
{
try
{
response
=
client
.
getCommonResponse
(
request
);
response
=
client
.
getCommonResponse
(
request
);
a
=
response
.
getData
();
a
=
response
.
getData
();
System
.
err
.
println
(
"response:"
+
a
);
// 短信服务响应内容
//
System.err.println("response:"+a); // 短信服务响应内容
}
catch
(
ServerException
e
)
{
}
catch
(
ServerException
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
}
catch
(
ClientException
e
)
{
}
catch
(
ClientException
e
)
{
...
@@ -127,6 +131,26 @@ public class AlicloudSMS {
...
@@ -127,6 +131,26 @@ public class AlicloudSMS {
}
}
Integer
id
=
null
;
Integer
id
=
null
;
if
(
a
!=
null
&&
a
.
contains
(
"OK"
))
{
if
(
a
!=
null
&&
a
.
contains
(
"OK"
))
{
AdminAssoTxjlb
txs
=
AdminAssoTxjlb
.
builder
().
build
();
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
SMSformat
);
Map
<
String
,
Object
>
jsonToMap
=
JSONObject
.
parseObject
(
jsonObject
.
toJSONString
());
for
(
Entry
<
String
,
Object
>
entry
:
jsonToMap
.
entrySet
()){
String
mapKey
=
entry
.
getKey
();
String
mapValue
=
String
.
valueOf
(
entry
.
getValue
());
str
=
str
.
replace
(
"${"
+
mapKey
+
"}"
,
mapValue
);
}
// System.out.println(str);
txs
.
setContent
(
str
);
//内容
txs
.
setUserName
(
tzname
);
txs
.
setEmpNum
(
tzrid
);
txs
.
setTxType
(
1
);
txs
.
setOrgCode
(
zzda
.
getOrgCode
());
txs
.
setAddtime
(
new
Date
().
getTime
());
txs
.
setTxstate
(
0
);
txs
.
insert
();
List
<
Object
>
list
=
new
ArrayList
<
Object
>();
List
<
Object
>
list
=
new
ArrayList
<
Object
>();
list
.
add
(
id
);
list
.
add
(
id
);
...
...
src/main/java/cn/timer/api/controller/htzz/atttimer/NewsTaskTiming.java
View file @
7d9c6b46
...
@@ -28,7 +28,7 @@ public class NewsTaskTiming {
...
@@ -28,7 +28,7 @@ public class NewsTaskTiming {
@Autowired
@Autowired
private
AlicloudSMS
sms
;
private
AlicloudSMS
sms
;
@Scheduled
(
cron
=
"0
33 14 * * ?"
)
@Scheduled
(
cron
=
"0
0 8 * * ?"
)
//早上八点
public
void
MessageAlert
()
throws
ParseException
{
public
void
MessageAlert
()
throws
ParseException
{
//当前时间
//当前时间
String
nowdate
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
).
format
(
new
Date
()).
toString
();
//
String
nowdate
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
).
format
(
new
Date
()).
toString
();
//
...
@@ -48,7 +48,7 @@ public class NewsTaskTiming {
...
@@ -48,7 +48,7 @@ public class NewsTaskTiming {
List
<
HtzzAssoHtgx
>
txrs
=
HtzzAssoHtgx
.
builder
().
build
().
selectList
(
new
QueryWrapper
<
HtzzAssoHtgx
>().
lambda
().
eq
(
HtzzAssoHtgx:
:
getHtid
,
zz
.
getId
()));
List
<
HtzzAssoHtgx
>
txrs
=
HtzzAssoHtgx
.
builder
().
build
().
selectList
(
new
QueryWrapper
<
HtzzAssoHtgx
>().
lambda
().
eq
(
HtzzAssoHtgx:
:
getHtid
,
zz
.
getId
()));
for
(
HtzzAssoHtgx
rt
:
txrs
)
{
for
(
HtzzAssoHtgx
rt
:
txrs
)
{
//发送短信
//发送短信
List
<
Object
>
list
=
sms
.
remind
(
zz
,
rt
.
getPhone
(),
rt
.
getName
());
List
<
Object
>
list
=
sms
.
remind
(
zz
,
rt
.
getPhone
(),
rt
.
getName
()
,
rt
.
getTzrid
()
);
}
}
}
}
...
...
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