Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
Litemall
Commits
5af77957
"vscode:/vscode.git/clone" did not exist on "2ea394ea8bb953f242153d002457d1d5b4c15de8"
Unverified
Commit
5af77957
authored
Oct 20, 2020
by
端午安康
Committed by
GitHub
Oct 20, 2020
Browse files
Merge pull request #2 from linlinjava/master
update
parents
2f3ef296
9cf58564
Changes
3
Hide whitespace changes
Inline
Side-by-side
litemall-admin-api/src/main/java/org/linlinjava/litemall/admin/job/DbJob.java
View file @
5af77957
...
@@ -38,7 +38,7 @@ public class DbJob {
...
@@ -38,7 +38,7 @@ public class DbJob {
String
db
=
url
.
substring
(
index1
+
5
,
index2
);
String
db
=
url
.
substring
(
index1
+
5
,
index2
);
LocalDate
localDate
=
LocalDate
.
now
();
LocalDate
localDate
=
LocalDate
.
now
();
String
fileName
=
localDate
.
toString
();
String
fileName
=
localDate
.
toString
()
+
".sql"
;
File
file
=
new
File
(
"backup"
,
fileName
);
File
file
=
new
File
(
"backup"
,
fileName
);
file
.
getParentFile
().
mkdirs
();
file
.
getParentFile
().
mkdirs
();
file
.
createNewFile
();
file
.
createNewFile
();
...
@@ -47,8 +47,11 @@ public class DbJob {
...
@@ -47,8 +47,11 @@ public class DbJob {
DbUtil
.
backup
(
file
,
user
,
password
,
db
);
DbUtil
.
backup
(
file
,
user
,
password
,
db
);
// 删除七天前数据库备份文件
// 删除七天前数据库备份文件
LocalDate
before
=
localDate
.
minusDays
(
7
);
LocalDate
before
=
localDate
.
minusDays
(
7
);
File
fileBefore
=
new
File
(
"backup"
,
fileName
);
String
fileBeforeName
=
before
.
toString
()+
".sql"
;
fileBefore
.
deleteOnExit
();
File
fileBefore
=
new
File
(
"backup"
,
fileBeforeName
);
if
(
fileBefore
.
exists
())
{
fileBefore
.
delete
();
}
logger
.
info
(
"系统结束定时任务数据库备份"
);
logger
.
info
(
"系统结束定时任务数据库备份"
);
}
}
...
...
litemall-admin-api/src/main/java/org/linlinjava/litemall/admin/web/AdminAftersaleController.java
View file @
5af77957
...
@@ -183,7 +183,7 @@ public class AdminAftersaleController {
...
@@ -183,7 +183,7 @@ public class AdminAftersaleController {
wxPayRefundRequest
.
setOutRefundNo
(
"refund_"
+
order
.
getOrderSn
());
wxPayRefundRequest
.
setOutRefundNo
(
"refund_"
+
order
.
getOrderSn
());
// 元转成分
// 元转成分
Integer
totalFee
=
aftersaleOne
.
getAmount
().
multiply
(
new
BigDecimal
(
100
)).
intValue
();
Integer
totalFee
=
aftersaleOne
.
getAmount
().
multiply
(
new
BigDecimal
(
100
)).
intValue
();
wxPayRefundRequest
.
setTotalFee
(
totalFee
);
wxPayRefundRequest
.
setTotalFee
(
order
.
getActualPrice
().
multiply
(
new
BigDecimal
(
100
)).
intValue
()
);
wxPayRefundRequest
.
setRefundFee
(
totalFee
);
wxPayRefundRequest
.
setRefundFee
(
totalFee
);
WxPayRefundResult
wxPayRefundResult
;
WxPayRefundResult
wxPayRefundResult
;
...
...
litemall-core/src/main/java/org/linlinjava/litemall/core/notify/AliyunSmsSender.java
View file @
5af77957
...
@@ -8,6 +8,7 @@ import com.aliyuncs.exceptions.ClientException;
...
@@ -8,6 +8,7 @@ import com.aliyuncs.exceptions.ClientException;
import
com.aliyuncs.exceptions.ServerException
;
import
com.aliyuncs.exceptions.ServerException
;
import
com.aliyuncs.http.MethodType
;
import
com.aliyuncs.http.MethodType
;
import
com.aliyuncs.profile.DefaultProfile
;
import
com.aliyuncs.profile.DefaultProfile
;
import
com.qcloud.cos.utils.Jackson
;
import
org.apache.commons.logging.Log
;
import
org.apache.commons.logging.Log
;
import
org.apache.commons.logging.LogFactory
;
import
org.apache.commons.logging.LogFactory
;
import
org.linlinjava.litemall.core.util.JacksonUtil
;
import
org.linlinjava.litemall.core.util.JacksonUtil
;
...
@@ -26,6 +27,8 @@ public class AliyunSmsSender implements SmsSender {
...
@@ -26,6 +27,8 @@ public class AliyunSmsSender implements SmsSender {
private
String
accessKeySecret
;
private
String
accessKeySecret
;
private
String
sign
;
private
String
sign
;
private
final
String
okCode
=
"OK"
;
public
String
getRegionId
()
{
public
String
getRegionId
()
{
return
regionId
;
return
regionId
;
}
}
...
@@ -106,8 +109,15 @@ public class AliyunSmsSender implements SmsSender {
...
@@ -106,8 +109,15 @@ public class AliyunSmsSender implements SmsSender {
try
{
try
{
CommonResponse
response
=
client
.
getCommonResponse
(
request
);
CommonResponse
response
=
client
.
getCommonResponse
(
request
);
SmsResult
smsResult
=
new
SmsResult
();
SmsResult
smsResult
=
new
SmsResult
();
smsResult
.
setSuccessful
(
true
);
smsResult
.
setResult
(
response
);
smsResult
.
setResult
(
response
);
String
code
=
Jackson
.
jsonNodeOf
(
response
.
getData
()).
get
(
"Code"
).
asText
();
if
(
response
.
getHttpResponse
().
isSuccess
()
&&
okCode
.
equals
(
code
)
){
smsResult
.
setSuccessful
(
true
);
}
else
{
smsResult
.
setSuccessful
(
false
);
logger
.
error
(
"短信发送失败:"
+
response
.
getData
());
}
return
smsResult
;
return
smsResult
;
}
catch
(
ServerException
e
)
{
}
catch
(
ServerException
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
...
...
Write
Preview
Supports
Markdown
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