Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
farming
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
郑云飞
farming
Commits
04458752
Commit
04458752
authored
Oct 08, 2023
by
zhengyunfei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
二次开发
parent
78db1882
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
57 additions
and
25 deletions
+57
-25
src/main/java/com/yunniu/farming/webadmin/model/OrderMain.java
+2
-1
src/main/java/com/yunniu/farming/webadmin/service/impl/GroupOrderServiceImpl.java
+1
-1
src/main/java/com/yunniu/farming/webadmin/service/impl/OrderMainServiceImpl.java
+23
-5
src/main/java/com/yunniu/farming/webadmin/service/impl/WxServiceImpl.java
+9
-5
src/main/java/com/yunniu/farming/wx/WxConfigUtil.java
+2
-2
src/main/resources/application.properties
+6
-6
src/main/resources/mappings/GroupOrderMapper.xml
+2
-1
src/main/resources/templates/groupBuy/addOrEdit.html
+1
-1
src/main/resources/templates/order/loanList.html
+6
-2
src/main/resources/templates/order/refundList.html
+5
-1
No files found.
src/main/java/com/yunniu/farming/webadmin/model/OrderMain.java
View file @
04458752
...
...
@@ -60,7 +60,7 @@ public class OrderMain {
@JsonInclude
(
JsonInclude
.
Include
.
NON_NULL
)
private
String
endDate
;
//订单状态[10:待付款 20:待发货 30:待收货 90:已完成 99:已拒绝/关闭 100:取消 101退款申请中 102待退货 103待退款 104退款成功 105退款拒绝]
//订单状态[10:待付款 20:待发货 30:待收货 90:已完成 99:已拒绝/关闭 100:取消 101退款申请中 102待退货 103待退款 104退款成功 105退款拒绝
106 仅退款
]
public
static
final
Integer
STATUS_NOPAY
=
10
;
public
static
final
Integer
STATUS_YESPAY
=
20
;
public
static
final
Integer
STATUS_WAITING
=
30
;
...
...
@@ -72,6 +72,7 @@ public class OrderMain {
public
static
final
Integer
STATUS_REFUND
=
103
;
public
static
final
Integer
STATUS_REFUND_SUC
=
104
;
public
static
final
Integer
STATUS_REFUND_REFUSE
=
105
;
public
static
final
Integer
STATUS_REFUND_ONLY
=
106
;
//数据库字段
private
Integer
id
;
// id主键
...
...
src/main/java/com/yunniu/farming/webadmin/service/impl/GroupOrderServiceImpl.java
View file @
04458752
...
...
@@ -146,7 +146,7 @@ public class GroupOrderServiceImpl implements GroupOrderService {
@Override
public
boolean
updateRefundStatus
(
String
outRefundNo
)
{
OrderMain
order
=
orderDao
.
getBySdef1
(
outRefundNo
);
order
.
setIrefundstatus
(
1
);
order
.
setIrefundstatus
(
OrderMain
.
STATUS_REFUND_SUC
);
int
update
=
orderMainDao
.
updateById
(
order
);
if
(
update
>
0
)
{
return
true
;
...
...
src/main/java/com/yunniu/farming/webadmin/service/impl/OrderMainServiceImpl.java
View file @
04458752
...
...
@@ -288,17 +288,23 @@ public class OrderMainServiceImpl {
/**
* 更改订单退款申请通过
*/
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
Result
refundApplicationPass
(
OrderMain
order
)
{
if
(
order
.
getId
()
==
null
){
return
Result
.
error
();
}
order
.
setIrefundstatus
(
OrderMain
.
STATUS_RETURN_GOODS
);
this
.
orderMainDao
.
updateById
(
order
);
OrderMain
orderMain
=
this
.
orderMainDao
.
selectById
(
order
.
getId
());
if
(
orderMain
.
getIrefundstatus
().
equals
(
OrderMain
.
STATUS_REFUND_ONLY
))
{
this
.
refundReceive
(
orderMain
);
}
else
{
orderMain
.
setIrefundstatus
(
OrderMain
.
STATUS_RETURN_GOODS
);
this
.
orderMainDao
.
updateById
(
order
);
}
return
Result
.
success
(
"成功"
);
}
/**
* 更改订单退款申请
通过
* 更改订单退款申请
拒绝
*/
public
Result
refundApplicationRefuse
(
OrderMain
order
)
{
if
(
order
.
getId
()
==
null
){
...
...
@@ -324,7 +330,7 @@ public class OrderMainServiceImpl {
try
{
wxService
.
wxRefund
(
orderMain
.
getCustomerid
(),
orderMain
.
getId
(),
"用户申请退款"
,
null
);
}
catch
(
Exception
e
)
{
throw
new
RuntimeException
(
e
);
throw
new
RuntimeException
(
e
.
getMessage
()
);
}
return
Result
.
success
(
"成功"
);
}
...
...
@@ -539,7 +545,7 @@ public class OrderMainServiceImpl {
OrderMain
orderMain
=
this
.
orderMainDao
.
selectById
(
order
.
getId
());
orderMain
.
setSrefundreason
(
order
.
getSrefundreason
());
orderMain
.
setSrefundpic
(
order
.
getSrefundpic
());
orderMain
.
setIrefundstatus
(
OrderMain
.
STATUS_APPLICATION
);
orderMain
.
setIrefundstatus
(
order
.
getIrefundstatus
()
);
this
.
orderMainDao
.
updateById
(
orderMain
);
return
Result
.
success
(
"成功"
);
}
...
...
@@ -555,4 +561,16 @@ public class OrderMainServiceImpl {
this
.
orderMainDao
.
updateById
(
orderMain
);
return
Result
.
success
(
"成功"
);
}
/**
* 仅退款
* @param order
* @return
*/
public
Result
refundOnly
(
OrderMain
order
)
{
OrderMain
orderMain
=
this
.
orderMainDao
.
selectById
(
order
.
getId
());
orderMain
.
setIrefundstatus
(
OrderMain
.
STATUS_REFUND_ONLY
);
this
.
orderMainDao
.
updateById
(
orderMain
);
return
Result
.
success
(
"成功"
);
}
}
src/main/java/com/yunniu/farming/webadmin/service/impl/WxServiceImpl.java
View file @
04458752
...
...
@@ -239,9 +239,10 @@ public class WxServiceImpl implements WxService {
if
(
order
==
null
||
!
order
.
getCustomerid
().
equals
(
userId
))
{
return
new
Result
(
102
);
}
order
.
setSdef1
(
"R"
+
StringHelper
.
getOrderno
());
// 退款单号
order
.
setSrefundreason
(
srefundreason
);
// 退款理由
order
.
setIrefundstatus
(
0
);
if
(
srefundreason
.
equals
(
"拼团失败"
))
{
order
.
setSrefundreason
(
srefundreason
);
// 退款理由
order
.
setIrefundstatus
(
OrderMain
.
STATUS_CANCEL
);
}
order
.
setTrefundtime
(
new
Date
());
order
.
setRefundorderno
(
StringHelper
.
getOrderno
());
orderMainDao
.
updateById
(
order
);
...
...
@@ -274,7 +275,7 @@ public class WxServiceImpl implements WxService {
System
.
out
.
println
(
result
);
Map
<
String
,
String
>
map
=
XMLUtil
.
doXMLParse
(
result
);
if
(!
"SUCCESS"
.
equals
(
map
.
get
(
"result_code"
))){
throw
new
ServiceException
(
"退款失败:"
+
map
.
get
(
"
return_msg
"
));
throw
new
ServiceException
(
"退款失败:"
+
map
.
get
(
"
err_code_des
"
));
}
return
new
Result
();
}
...
...
@@ -314,13 +315,15 @@ public class WxServiceImpl implements WxService {
}
packageParams
.
put
(
parameter
,
v
);
}
log
.
info
(
"退款回调解密前1:{}"
,
packageParams
);
// 判断签名是否正确
String
resXml
=
""
;
if
(
"SUCCESS"
.
equals
((
String
)
packageParams
.
get
(
"re
sult
_code"
)))
{
if
(
"SUCCESS"
.
equals
((
String
)
packageParams
.
get
(
"re
turn
_code"
)))
{
System
.
out
.
println
(
"退款成功!"
);
// 这里是退款成功
// ////////执行自己的业务逻辑////////////////
String
req_info
=
(
String
)
packageParams
.
get
(
"req_info"
);
// 商户号
log
.
info
(
"退款回调解密前2:{}"
,
req_info
);
resXml
=
this
.
wechatRefund
(
req_info
);
}
else
{
...
...
@@ -385,6 +388,7 @@ public class WxServiceImpl implements WxService {
String
refundRecvAccout
=
map
.
get
(
"refund_recv_accout"
);
String
refundAccount
=
map
.
get
(
"refund_account"
);
String
refundRequestSource
=
map
.
get
(
"refund_request_source"
);
log
.
info
(
"退款回调解密后:{}"
,
JSON
.
toJSONString
(
map
));
groupOrderService
.
updateRefundStatus
(
outRefundNo
);
if
(
null
==
settlementRefundFee
)
{
...
...
src/main/java/com/yunniu/farming/wx/WxConfigUtil.java
View file @
04458752
...
...
@@ -15,9 +15,9 @@ public class WxConfigUtil {
public
final
static
String
UNIFIED_ORDER_URL
=
"https://api.mch.weixin.qq.com/pay/unifiedorder"
;
public
final
static
String
PROFIT_SHARING_URL
=
"https://api.mch.weixin.qq.com/secapi/pay/profitsharing"
;
public
final
static
String
PROFIT_SHARING_ADDRECEIVER
=
"https://api.mch.weixin.qq.com/pay/profitsharingaddreceiver"
;
// public final static String notify_url = "http
://1.15.43.240:8330
/wx/notify"; // 订单回调接口
// public final static String notify_url = "http
s://farming.nyinhong.com
/wx/notify"; // 订单回调接口
public
final
static
String
notify_url
=
"https://qpxdnyy.com/wx/notify"
;
// 订单回调接口
// public final static String refund_notify_url = "http
://1.15.43.240:8330
/wx/wxRefundNotify"; // 订单回调接口
// public final static String refund_notify_url = "http
s://farming.nyinhong.com
/wx/wxRefundNotify"; // 订单回调接口
public
final
static
String
refund_notify_url
=
"https://qpxdnyy.com/wx/wxRefundNotify"
;
// 订单回调接口
public
final
static
String
REFUND_ORDER_URL
=
"https://api.mch.weixin.qq.com/secapi/pay/refund"
;
public
static
String
GET_MINICODE_URL
=
"https://api.weixin.qq.com/wxa/getwxacodeunlimit"
;
...
...
src/main/resources/application.properties
View file @
04458752
#spring.datasource.url=jdbc:mysql://152.136.113.101:3306/farming?autoReconnect=true&useUnicode=true&allowMultiQueries=true&characterEncoding=utf-8&serverTimezone=GMT%2B8
#spring.datasource.username=root
#spring.datasource.password=Root_123456
#
spring.datasource.url=jdbc:mysql://localhost:3306/farming?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowMultiQueries=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai
#
spring.datasource.username=farming
#
spring.datasource.password=PKWB6psxa7FBApZB
spring.datasource.url
=
jdbc:mysql://db1.prd.jianghuxx.com:3317/farming?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowMultiQueries=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai
spring.datasource.username
=
root
spring.datasource.password
=
4f9fa23639242790
spring.datasource.url
=
jdbc:mysql://localhost:3306/farming?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowMultiQueries=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai
spring.datasource.username
=
farming
spring.datasource.password
=
PKWB6psxa7FBApZB
#
spring.datasource.url=jdbc:mysql://db1.prd.jianghuxx.com:3317/farming?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowMultiQueries=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai
#
spring.datasource.username=root
#
spring.datasource.password=4f9fa23639242790
#7LwimZ27FqEnzIPg
##47.101.199.10
spring.datasource.driverClassName
=
com.mysql.cj.jdbc.Driver
...
...
src/main/resources/mappings/GroupOrderMapper.xml
View file @
04458752
...
...
@@ -66,6 +66,6 @@
</update>
<select
id=
"getBySdef1"
resultType=
"com.yunniu.farming.webadmin.model.OrderMain"
>
select * from order_main where
sdef1
= #{outRefundNo,jdbcType=VARCHAR}
select * from order_main where
refundorderno
= #{outRefundNo,jdbcType=VARCHAR}
</select>
</mapper>
\ No newline at end of file
src/main/resources/templates/groupBuy/addOrEdit.html
View file @
04458752
...
...
@@ -423,7 +423,7 @@
groupBuy
.
products
=
products
;
groupBuy
.
goodsImgArr
=
goodsImgArr
;
// groupBuy.groupBuyPic = groupBuyPic;
groupBuy
.
groupBuyPic
=
"https://ns-strategy.cdn.bcebos.com/ns-strategy/upload/fc_big_pic/part-00069-829.jpg"
;
groupBuy
.
groupBuyPic
=
groupBuyPic
;
groupBuy
.
startTime
=
startTime
;
groupBuy
.
endTime
=
endTime
;
$
.
ajax
({
...
...
src/main/resources/templates/order/loanList.html
View file @
04458752
...
...
@@ -82,12 +82,15 @@
<script
type=
"text/html"
id=
"table-handle"
>
<
i
class
=
"layui-icon layui-icon-form"
lay
-
event
=
"orderDetail"
title
=
"订单详情"
><
/i
>
<!--
101
退款申请中
102
待退货
103
待退款
104
退款成功
105
退款拒绝
-->
<!--
101
退款申请中
102
待退货
103
待退款
104
退款成功
105
退款拒绝
106
仅退款
-->
{{
#
if
(
d
.
irefundstatus
==
101
)
{
}}
<
i
class
=
"layui-icon layui-icon-ok"
lay
-
event
=
"pass"
title
=
"退款申请通过"
><
/i
>
<
i
class
=
"layui-icon layui-icon-close"
lay
-
event
=
"refuse"
title
=
"退款申请拒绝"
><
/i
>
{{
#
}
else
if
(
d
.
irefundstatus
==
103
){
}}
<
i
class
=
"layui-icon layui-icon-component"
lay
-
event
=
"receive"
title
=
"退款已收货"
><
/i
>
{{
#
}
else
if
(
d
.
irefundstatus
==
106
){
}}
<
i
class
=
"layui-icon layui-icon-ok"
lay
-
event
=
"pass"
title
=
"仅退款申请通过"
><
/i
>
<
i
class
=
"layui-icon layui-icon-close"
lay
-
event
=
"refuse"
title
=
"仅退款申请拒绝"
><
/i
>
{{
#
}
else
if
(
d
.
istatus
==
0
||
d
.
istatus
==
10
)
{
}}
{{
#
}
else
if
(
d
.
istatus
==
20
){
}}
<
i
class
=
"layui-icon layui-icon-ok-circle"
lay
-
event
=
"deliver"
title
=
"发货"
><
/i
>
...
...
@@ -210,11 +213,12 @@
str
+=
' <span>'
+
status
+
'</span>'
;
// 101退款申请中 102待退货 103待退款 104退款成功
var
refundStatus
=
""
;
if
(
d
.
irefundstatus
==
101
)
refundStatus
=
"<span class='layui-badge layui-bg-red'>退款申请
中
</span>"
;
if
(
d
.
irefundstatus
==
101
)
refundStatus
=
"<span class='layui-badge layui-bg-red'>退款申请</span>"
;
if
(
d
.
irefundstatus
==
102
)
refundStatus
=
"<span class='layui-badge layui-bg-orange'>待退货</span>"
;
if
(
d
.
irefundstatus
==
103
)
refundStatus
=
"<span class='layui-badge layui-bg-orange'>待退款</span>"
;
if
(
d
.
irefundstatus
==
104
)
refundStatus
=
"<span class='layui-badge layui-bg-green'>退款成功</span>"
;
if
(
d
.
irefundstatus
==
105
)
refundStatus
=
"<span class='layui-badge layui-bg-cyan'>退款拒绝</span>"
;
if
(
d
.
irefundstatus
==
106
)
refundStatus
=
"<span class='layui-badge layui-bg-red'>仅退款申请</span>"
;
str
+=
' <span>'
+
refundStatus
+
'</span>'
;
str
+=
'</div>'
;
return
str
?
str
:
""
;
...
...
src/main/resources/templates/order/refundList.html
View file @
04458752
...
...
@@ -88,6 +88,9 @@
<
i
class
=
"layui-icon layui-icon-close"
lay
-
event
=
"refuse"
title
=
"退款申请拒绝"
><
/i
>
{{
#
}
else
if
(
d
.
irefundstatus
==
103
){
}}
<
i
class
=
"layui-icon layui-icon-component"
lay
-
event
=
"receive"
title
=
"退款已收货"
><
/i
>
{{
#
}
else
if
(
d
.
irefundstatus
==
106
){
}}
<
i
class
=
"layui-icon layui-icon-ok"
lay
-
event
=
"pass"
title
=
"仅退款申请通过"
><
/i
>
<
i
class
=
"layui-icon layui-icon-close"
lay
-
event
=
"refuse"
title
=
"仅退款申请拒绝"
><
/i
>
{{
#
}
}}
</script>
...
...
@@ -207,11 +210,12 @@
str
+=
' <span>'
+
status
+
'</span>'
;
// 101退款申请中 102待退货 103待退款 104退款成功
var
refundStatus
=
""
;
if
(
d
.
irefundstatus
==
101
)
refundStatus
=
"<span class='layui-badge layui-bg-red'>退款申请
中
</span>"
;
if
(
d
.
irefundstatus
==
101
)
refundStatus
=
"<span class='layui-badge layui-bg-red'>退款申请</span>"
;
if
(
d
.
irefundstatus
==
102
)
refundStatus
=
"<span class='layui-badge layui-bg-orange'>待退货</span>"
;
if
(
d
.
irefundstatus
==
103
)
refundStatus
=
"<span class='layui-badge layui-bg-orange'>待退款</span>"
;
if
(
d
.
irefundstatus
==
104
)
refundStatus
=
"<span class='layui-badge layui-bg-green'>退款成功</span>"
;
if
(
d
.
irefundstatus
==
105
)
refundStatus
=
"<span class='layui-badge layui-bg-cyan'>退款拒绝</span>"
;
if
(
d
.
irefundstatus
==
106
)
refundStatus
=
"<span class='layui-badge layui-bg-red'>仅退款申请</span>"
;
str
+=
' <span>'
+
refundStatus
+
'</span>'
;
str
+=
'</div>'
;
return
str
?
str
:
""
;
...
...
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