Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gxpt_ht
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
pseer
gxpt_ht
Commits
eec69701
Commit
eec69701
authored
Nov 27, 2023
by
吕明尚
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
退款增加消费记录
parent
097485fb
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
138 additions
and
22 deletions
+138
-22
ConsumeNameEnum.java
...mon/src/main/java/share/common/enums/ConsumeNameEnum.java
+34
-0
SignEnum.java
share-common/src/main/java/share/common/enums/SignEnum.java
+35
-0
SConsumptionRecords.java
...rc/main/java/share/system/domain/SConsumptionRecords.java
+32
-8
CallbackServiceImpl.java
...n/java/share/system/service/impl/CallbackServiceImpl.java
+14
-8
SOrderServiceImpl.java
...ain/java/share/system/service/impl/SOrderServiceImpl.java
+6
-5
SConsumptionRecordsMapper.xml
...ain/resources/mapper/system/SConsumptionRecordsMapper.xml
+17
-1
No files found.
share-common/src/main/java/share/common/enums/ConsumeNameEnum.java
0 → 100644
View file @
eec69701
package
share
.
common
.
enums
;
public
enum
ConsumeNameEnum
{
//消费,消费退款
CONSUME
(
1
,
"消费"
),
REFUND
(
2
,
"消费退款"
),
;
private
Integer
code
;
private
String
value
;
ConsumeNameEnum
()
{
}
ConsumeNameEnum
(
Integer
code
,
String
value
)
{
this
.
code
=
code
;
this
.
value
=
value
;
}
public
Integer
getCode
()
{
return
code
;
}
public
void
setCode
(
Integer
code
)
{
this
.
code
=
code
;
}
public
String
getValue
()
{
return
value
;
}
public
void
setValue
(
String
value
)
{
this
.
value
=
value
;
}
}
share-common/src/main/java/share/common/enums/SignEnum.java
0 → 100644
View file @
eec69701
package
share
.
common
.
enums
;
public
enum
SignEnum
{
//+,-
STRAINHT
(
1
,
"+"
),
BURDEN
(
2
,
"-"
),
;
private
Integer
code
;
private
String
value
;
SignEnum
()
{
}
SignEnum
(
Integer
code
,
String
value
)
{
this
.
code
=
code
;
this
.
value
=
value
;
}
public
Integer
getCode
()
{
return
code
;
}
public
void
setCode
(
Integer
code
)
{
this
.
code
=
code
;
}
public
String
getValue
()
{
return
value
;
}
public
void
setValue
(
String
value
)
{
this
.
value
=
value
;
}
}
share-system/src/main/java/share/system/domain/SConsumptionRecords.java
View file @
eec69701
...
...
@@ -38,6 +38,13 @@ public class SConsumptionRecords extends BaseEntity
@Excel
(
name
=
"实付金额"
)
private
BigDecimal
price
;
/**
* 支付类型
*/
private
String
payType
;
private
String
sign
;
public
void
setId
(
Long
id
)
{
this
.
id
=
id
;
...
...
@@ -84,15 +91,32 @@ public class SConsumptionRecords extends BaseEntity
return
price
;
}
public
String
getPayType
()
{
return
payType
;
}
public
void
setPayType
(
String
payType
)
{
this
.
payType
=
payType
;
}
public
String
getSign
()
{
return
sign
;
}
public
void
setSign
(
String
sign
)
{
this
.
sign
=
sign
;
}
@Override
public
String
toString
()
{
return
new
ToStringBuilder
(
this
,
ToStringStyle
.
MULTI_LINE_STYLE
)
.
append
(
"id"
,
getId
())
.
append
(
"consumerId"
,
getConsumerId
())
.
append
(
"orderId"
,
getOrderId
())
.
append
(
"name"
,
getName
())
.
append
(
"price"
,
getPrice
())
.
append
(
"createTime"
,
getCreateTime
())
.
toString
();
return
"SConsumptionRecords{"
+
"id="
+
id
+
", consumerId="
+
consumerId
+
", orderId="
+
orderId
+
", name='"
+
name
+
'\''
+
", price="
+
price
+
", payType='"
+
payType
+
'\''
+
", sign='"
+
sign
+
'\''
+
'}'
;
}
}
share-system/src/main/java/share/system/service/impl/CallbackServiceImpl.java
View file @
eec69701
...
...
@@ -14,23 +14,18 @@ import share.common.config.WeChatConfig;
import
share.common.constant.Constants
;
import
share.common.constant.WeChatConstants
;
import
share.common.core.redis.RedisUtil
;
import
share.common.enums.OrderStatusEnum
;
import
share.common.enums.OrderTypeEnum
;
import
share.common.enums.RefundStatusEnum
;
import
share.common.enums.YesNoEnum
;
import
share.common.enums.*
;
import
share.common.exception.base.BaseException
;
import
share.common.utils.BaseUtil
;
import
share.common.utils.DateUtils
;
import
share.system.domain.SConsumer
;
import
share.system.domain.SConsumptionRecords
;
import
share.system.domain.SOrder
;
import
share.system.domain.WechatPayInfo
;
import
share.system.domain.vo.AttachVo
;
import
share.system.domain.vo.CallbackVo
;
import
share.system.domain.vo.MyRecord
;
import
share.system.service.CallbackService
;
import
share.system.service.ISOrderService
;
import
share.system.service.SConsumerService
;
import
share.system.service.WechatPayInfoService
;
import
share.system.service.*
;
import
share.system.util.WxPayUtil
;
import
javax.crypto.Cipher
;
...
...
@@ -65,6 +60,9 @@ public class CallbackServiceImpl implements CallbackService {
@Autowired
private
WeChatConfig
weChatConfig
;
@Autowired
private
ISConsumptionRecordsService
sConsumptionRecordsService
;
/**
* 微信支付回调
...
...
@@ -238,6 +236,14 @@ public class CallbackServiceImpl implements CallbackService {
sOrder
.
setStatus
(
OrderStatusEnum
.
CANCEL
.
getCode
());
sOrder
.
setRefundStatus
(
RefundStatusEnum
.
REFUNDED
.
getCode
());
boolean
update
=
sOrderService
.
updateById
(
sOrder
);
SConsumptionRecords
sConsumptionRecords
=
new
SConsumptionRecords
();
sConsumptionRecords
.
setConsumerId
(
sOrder
.
getConsumerId
());
sConsumptionRecords
.
setOrderId
(
sOrder
.
getId
());
sConsumptionRecords
.
setName
(
ConsumeNameEnum
.
REFUND
.
getValue
());
sConsumptionRecords
.
setPrice
(
sOrder
.
getPayPrice
());
sConsumptionRecords
.
setPayType
(
PayTypeEnum
.
WECHAT
.
getName
());
sConsumptionRecords
.
setSign
(
SignEnum
.
STRAINHT
.
getValue
());
sConsumptionRecordsService
.
insertSConsumptionRecords
(
sConsumptionRecords
);
if
(
update
)
{
// 退款task
redisUtil
.
lPush
(
Constants
.
ORDER_TASK_REDIS_KEY_AFTER_REFUND_BY_USER
,
sOrder
.
getId
());
...
...
share-system/src/main/java/share/system/service/impl/SOrderServiceImpl.java
View file @
eec69701
...
...
@@ -321,8 +321,10 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
SConsumptionRecords
sConsumptionRecords
=
new
SConsumptionRecords
();
sConsumptionRecords
.
setConsumerId
(
sOrder
.
getConsumerId
());
sConsumptionRecords
.
setOrderId
(
sOrder
.
getId
());
sConsumptionRecords
.
setName
(
user
.
getNickNam
e
());
sConsumptionRecords
.
setName
(
ConsumeNameEnum
.
CONSUME
.
getValu
e
());
sConsumptionRecords
.
setPrice
(
sOrder
.
getPayPrice
());
sConsumptionRecords
.
setPayType
(
PayTypeEnum
.
WECHAT
.
getName
());
sConsumptionRecords
.
setSign
(
SignEnum
.
BURDEN
.
getValue
());
sConsumptionRecordsService
.
insertSConsumptionRecords
(
sConsumptionRecords
);
}
return
response
;
...
...
@@ -609,11 +611,10 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
SConsumptionRecords
sConsumptionRecords
=
new
SConsumptionRecords
();
sConsumptionRecords
.
setConsumerId
(
sOrder
.
getConsumerId
());
sConsumptionRecords
.
setOrderId
(
sOrder
.
getId
());
if
(
Objects
.
nonNull
(
sOrder
.
getPackId
()))
{
SPack
pack
=
packService
.
getById
(
sOrder
.
getPackId
());
sConsumptionRecords
.
setName
(
Objects
.
nonNull
(
pack
)?
pack
.
getName
():
null
);
}
sConsumptionRecords
.
setName
(
ConsumeNameEnum
.
CONSUME
.
getValue
());
sConsumptionRecords
.
setPrice
(
sOrder
.
getPayPrice
());
sConsumptionRecords
.
setPayType
(
PayTypeEnum
.
WECHAT
.
getName
());
sConsumptionRecords
.
setSign
(
SignEnum
.
BURDEN
.
getValue
());
sConsumptionRecordsService
.
insertSConsumptionRecords
(
sConsumptionRecords
);
}
...
...
share-system/src/main/resources/mapper/system/SConsumptionRecordsMapper.xml
View file @
eec69701
...
...
@@ -10,11 +10,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result
property=
"orderId"
column=
"order_id"
/>
<result
property=
"name"
column=
"name"
/>
<result
property=
"price"
column=
"price"
/>
<result
property=
"payType"
column=
"pay_type"
/>
<result
property=
"sign"
column=
"sign"
/>
<result
property=
"createTime"
column=
"create_time"
/>
</resultMap>
<sql
id=
"selectSConsumptionRecordsVo"
>
select id, consumer_id, order_id, name, price, create_time from s_consumption_records
select id,
consumer_id,
order_id,
name,
price,
pay_type,
sign,
create_time
from s_consumption_records
</sql>
<select
id=
"selectSConsumptionRecordsList"
parameterType=
"SConsumptionRecords"
resultMap=
"SConsumptionRecordsResult"
>
...
...
@@ -35,6 +45,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"orderId != null"
>
order_id,
</if>
<if
test=
"name != null and name != ''"
>
name,
</if>
<if
test=
"price != null"
>
price,
</if>
<if
test=
"pay_type != null"
>
pay_type,
</if>
<if
test=
"sign != null"
>
sign,
</if>
<if
test=
"createTime != null"
>
create_time,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
...
...
@@ -42,6 +54,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"orderId != null"
>
#{orderId},
</if>
<if
test=
"name != null and name != ''"
>
#{name},
</if>
<if
test=
"price != null"
>
#{price},
</if>
<if
test=
"pay_type != null"
>
#{pay_type},
</if>
<if
test=
"sign != null"
>
#{sign},
</if>
<if
test=
"createTime != null"
>
#{createTime},
</if>
</trim>
</insert>
...
...
@@ -53,6 +67,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"orderId != null"
>
order_id = #{orderId},
</if>
<if
test=
"name != null and name != ''"
>
name = #{name},
</if>
<if
test=
"price != null"
>
price = #{price},
</if>
<if
test=
"pay_type != null"
>
pay_type = #{pay_type},
</if>
<if
test=
"sign != null"
>
sign = #{sign},
</if>
<if
test=
"createTime != null"
>
create_time = #{createTime},
</if>
</trim>
where id = #{id}
...
...
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