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
300b1541
Commit
300b1541
authored
Aug 28, 2024
by
吕明尚
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加次卡购买
parent
0046f57c
Show whitespace changes
Inline
Side-by-side
Showing
27 changed files
with
636 additions
and
17 deletions
+636
-17
ConsumerMonthlyCardController.java
.../web/controller/system/ConsumerMonthlyCardController.java
+42
-0
ConsumerSecondaryCardController.java
...eb/controller/system/ConsumerSecondaryCardController.java
+6
-0
MonthlyCardConfController.java
...hare/web/controller/system/MonthlyCardConfController.java
+46
-0
MonthlyCardLogController.java
...share/web/controller/system/MonthlyCardLogController.java
+48
-0
MonthlyCardOrderController.java
...are/web/controller/system/MonthlyCardOrderController.java
+77
-0
SecondaryCardOrderController.java
...e/web/controller/system/SecondaryCardOrderController.java
+7
-0
MonthlyCardOrder.java
...m/src/main/java/share/system/domain/MonthlyCardOrder.java
+2
-2
ConsumerMonthlyCardMapper.java
...n/java/share/system/mapper/ConsumerMonthlyCardMapper.java
+2
-0
ConsumerSecondaryCardMapper.java
...java/share/system/mapper/ConsumerSecondaryCardMapper.java
+2
-0
MonthlyCardOrderMapper.java
...main/java/share/system/mapper/MonthlyCardOrderMapper.java
+2
-0
CreateMonthlyCardRequest.java
...n/java/share/system/request/CreateMonthlyCardRequest.java
+23
-0
EquityMembersResultResponse.java
...va/share/system/response/EquityMembersResultResponse.java
+1
-1
MonthlyyCardPayResultResponse.java
.../share/system/response/MonthlyyCardPayResultResponse.java
+31
-0
ConsumerMonthlyCardService.java
...java/share/system/service/ConsumerMonthlyCardService.java
+2
-0
ConsumerSecondaryCardService.java
...va/share/system/service/ConsumerSecondaryCardService.java
+2
-0
MonthlyCardOrderService.java
...in/java/share/system/service/MonthlyCardOrderService.java
+10
-0
OrderPayService.java
...m/src/main/java/share/system/service/OrderPayService.java
+4
-8
SecondaryCardOrderService.java
.../java/share/system/service/SecondaryCardOrderService.java
+2
-0
CallbackServiceImpl.java
...n/java/share/system/service/impl/CallbackServiceImpl.java
+81
-0
ConsumerMonthlyCardServiceImpl.java
...e/system/service/impl/ConsumerMonthlyCardServiceImpl.java
+12
-0
ConsumerSecondaryCardServiceImpl.java
...system/service/impl/ConsumerSecondaryCardServiceImpl.java
+12
-0
MonthlyCardOrderServiceImpl.java
...hare/system/service/impl/MonthlyCardOrderServiceImpl.java
+86
-1
OrderPayServiceImpl.java
...n/java/share/system/service/impl/OrderPayServiceImpl.java
+79
-5
SecondaryCardOrderServiceImpl.java
...re/system/service/impl/SecondaryCardOrderServiceImpl.java
+11
-0
ConsumerMonthlyCardMapper.xml
...ain/resources/mapper/system/ConsumerMonthlyCardMapper.xml
+21
-0
ConsumerSecondaryCardMapper.xml
...n/resources/mapper/system/ConsumerSecondaryCardMapper.xml
+21
-0
MonthlyCardOrderMapper.xml
...c/main/resources/mapper/system/MonthlyCardOrderMapper.xml
+4
-0
No files found.
share-front/src/main/java/share/web/controller/system/ConsumerMonthlyCardController.java
0 → 100644
View file @
300b1541
package
share
.
web
.
controller
.
system
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
share.common.core.controller.BaseController
;
import
share.common.core.domain.AjaxResult
;
import
share.common.core.page.TableDataInfo
;
import
share.system.domain.vo.ConsumerMonthlyCardVo
;
import
share.system.service.ConsumerMonthlyCardService
;
import
java.util.List
;
/**
* 用户月卡Controller
*
* @author wuwenlong
* @date 2024-08-27
*/
@RestController
@RequestMapping
(
"/consumerMonthlyCard"
)
public
class
ConsumerMonthlyCardController
extends
BaseController
{
@Autowired
private
ConsumerMonthlyCardService
consumerMonthlyCardService
;
/**
* 查询用户月卡列表
*/
@GetMapping
(
"/list"
)
public
TableDataInfo
list
(
ConsumerMonthlyCardVo
consumerMonthlyCard
)
{
startPage
();
List
<
ConsumerMonthlyCardVo
>
list
=
consumerMonthlyCardService
.
selectConsumerMonthlyCardList
(
consumerMonthlyCard
);
return
getDataTable
(
list
);
}
@GetMapping
(
"/query"
)
public
AjaxResult
selectByConsumerId
()
{
return
success
(
consumerMonthlyCardService
.
selectByConsumerId
());
}
}
share-front/src/main/java/share/web/controller/system/ConsumerSecondaryCardController.java
View file @
300b1541
...
...
@@ -5,6 +5,7 @@ import org.springframework.web.bind.annotation.GetMapping;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
share.common.core.controller.BaseController
;
import
share.common.core.domain.AjaxResult
;
import
share.common.core.page.TableDataInfo
;
import
share.system.domain.vo.ConsumerSecondaryCardVo
;
import
share.system.service.ConsumerSecondaryCardService
;
...
...
@@ -33,4 +34,9 @@ public class ConsumerSecondaryCardController extends BaseController {
return
getDataTable
(
list
);
}
@GetMapping
(
"/query"
)
public
AjaxResult
selectByConsumerId
()
{
return
success
(
consumerSecondaryCardService
.
selectByConsumerId
());
}
}
share-front/src/main/java/share/web/controller/system/MonthlyCardConfController.java
0 → 100644
View file @
300b1541
package
share
.
web
.
controller
.
system
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
share.common.core.controller.BaseController
;
import
share.common.core.domain.R
;
import
share.common.core.page.TableDataInfo
;
import
share.system.domain.MonthlyCardConf
;
import
share.system.service.MonthlyCardConfService
;
import
java.util.List
;
/**
* 月卡配置Controller
*
* @author wuwenlong
* @date 2024-08-27
*/
@RestController
@RequestMapping
(
"/monthlyCardConf"
)
public
class
MonthlyCardConfController
extends
BaseController
{
@Autowired
private
MonthlyCardConfService
monthlyCardConfService
;
/**
* 查询月卡配置列表
*/
@GetMapping
(
"/list"
)
public
TableDataInfo
list
(
MonthlyCardConf
monthlyCardConf
)
{
startPage
();
List
<
MonthlyCardConf
>
list
=
monthlyCardConfService
.
selectMonthlyCardConfList
(
monthlyCardConf
);
return
getDataTable
(
list
);
}
/**
* 查询月卡配置列表
*/
@GetMapping
(
"/list"
)
public
R
<
List
<
MonthlyCardConf
>>
query
()
{
return
R
.
ok
(
monthlyCardConfService
.
selectMonthlyCardConfList
(
null
));
}
}
share-front/src/main/java/share/web/controller/system/MonthlyCardLogController.java
0 → 100644
View file @
300b1541
package
share
.
web
.
controller
.
system
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
share.common.core.controller.BaseController
;
import
share.common.core.domain.AjaxResult
;
import
share.common.core.page.TableDataInfo
;
import
share.system.domain.SConsumer
;
import
share.system.domain.vo.FrontTokenComponent
;
import
share.system.domain.vo.MonthlyCardLogVo
;
import
share.system.service.MonthlyCardLogService
;
import
java.util.List
;
/**
* 月卡使用记录Controller
*
* @author wuwenlong
* @date 2024-08-27
*/
@RestController
@RequestMapping
(
"/monthlyCardLog"
)
public
class
MonthlyCardLogController
extends
BaseController
{
@Autowired
private
MonthlyCardLogService
monthlyCardLogService
;
/**
* 查询月卡使用记录列表
*/
@GetMapping
(
"/list"
)
public
TableDataInfo
list
(
MonthlyCardLogVo
monthlyCardLog
)
{
startPage
();
SConsumer
user
=
FrontTokenComponent
.
getWxSConsumerEntry
();
monthlyCardLog
.
setConsumerId
(
user
.
getId
());
List
<
MonthlyCardLogVo
>
list
=
monthlyCardLogService
.
selectMonthlyCardLogList
(
monthlyCardLog
);
return
getDataTable
(
list
);
}
@GetMapping
(
"/query"
)
public
AjaxResult
query
(
MonthlyCardLogVo
monthlyCardLog
)
{
SConsumer
user
=
FrontTokenComponent
.
getWxSConsumerEntry
();
monthlyCardLog
.
setConsumerId
(
user
.
getId
());
return
success
(
monthlyCardLogService
.
selectMonthlyCardLogList
(
monthlyCardLog
));
}
}
share-front/src/main/java/share/web/controller/system/MonthlyCardOrderController.java
0 → 100644
View file @
300b1541
package
share
.
web
.
controller
.
system
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
import
share.common.core.controller.BaseController
;
import
share.common.core.domain.AjaxResult
;
import
share.common.core.domain.R
;
import
share.common.core.page.TableDataInfo
;
import
share.common.core.redis.RedisUtil
;
import
share.common.utils.JsonConvertUtil
;
import
share.system.domain.SConsumer
;
import
share.system.domain.vo.FrontTokenComponent
;
import
share.system.domain.vo.MonthlyCardOrderVo
;
import
share.system.request.CreateMonthlyCardRequest
;
import
share.system.response.MonthlyyCardPayResultResponse
;
import
share.system.service.MonthlyCardOrderService
;
import
java.util.List
;
/**
* 月卡订单Controller
*
* @author wuwenlong
* @date 2024-08-27
*/
@Slf4j
@RestController
@RequestMapping
(
"/monthlyCardOrder"
)
public
class
MonthlyCardOrderController
extends
BaseController
{
@Autowired
private
MonthlyCardOrderService
monthlyCardOrderService
;
@Autowired
private
RedisUtil
redisUtil
;
/**
* 查询月卡订单列表
*/
@GetMapping
(
"/list"
)
public
TableDataInfo
list
(
MonthlyCardOrderVo
monthlyCardOrder
)
{
startPage
();
SConsumer
user
=
FrontTokenComponent
.
getWxSConsumerEntry
();
monthlyCardOrder
.
setConsumerId
(
user
.
getId
());
List
<
MonthlyCardOrderVo
>
list
=
monthlyCardOrderService
.
selectMonthlyCardOrderList
(
monthlyCardOrder
);
return
getDataTable
(
list
);
}
@GetMapping
(
"/query"
)
public
AjaxResult
query
(
MonthlyCardOrderVo
monthlyCardOrder
)
{
SConsumer
user
=
FrontTokenComponent
.
getWxSConsumerEntry
();
monthlyCardOrder
.
setConsumerId
(
user
.
getId
());
List
<
MonthlyCardOrderVo
>
list
=
monthlyCardOrderService
.
selectMonthlyCardOrderList
(
monthlyCardOrder
);
return
success
(
list
);
}
@PostMapping
(
"/createMonthlyCard"
)
public
R
<
MonthlyyCardPayResultResponse
>
createOrder
(
@RequestBody
@Validated
CreateMonthlyCardRequest
request
)
{
if
(
"1"
.
equals
(
redisUtil
.
frontInOutLogSwitch
()))
{
log
.
debug
(
"MonthlyCardOrderController method preOrder 入参 {}"
,
JsonConvertUtil
.
write2JsonStr
(
request
));
}
MonthlyyCardPayResultResponse
response
=
monthlyCardOrderService
.
createMonthlyCard
(
request
);
if
(
"1"
.
equals
(
redisUtil
.
frontInOutLogSwitch
()))
{
log
.
debug
(
"MonthlyCardOrderController method preOrder 出参 {}"
,
JsonConvertUtil
.
write2JsonStr
(
response
));
}
return
R
.
ok
(
response
);
}
@ApiOperation
(
value
=
"通过订单编号查询订单"
)
@GetMapping
(
value
=
"/{monthlyCardNo}"
)
public
R
<
MonthlyCardOrderVo
>
queryMonthlyCardInfoByNo
(
@PathVariable
(
"monthlyCardNo"
)
String
monthlyCardNo
)
{
return
R
.
ok
(
monthlyCardOrderService
.
queryMonthlyCardInfoByNo
(
monthlyCardNo
));
}
}
share-front/src/main/java/share/web/controller/system/SecondaryCardOrderController.java
View file @
300b1541
package
share
.
web
.
controller
.
system
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.validation.annotation.Validated
;
...
...
@@ -53,4 +54,10 @@ public class SecondaryCardOrderController extends BaseController {
}
return
R
.
ok
(
response
);
}
@ApiOperation
(
value
=
"通过订单编号查询订单"
)
@GetMapping
(
value
=
"/{secondaryCardNo}"
)
public
R
<
SecondaryCardOrderVo
>
querySecondaryCardInfoByNo
(
@PathVariable
(
"secondaryCardNo"
)
String
secondaryCardNo
)
{
return
R
.
ok
(
secondaryCardOrderService
.
querySecondaryCardInfoByNo
(
secondaryCardNo
));
}
}
share-system/src/main/java/share/system/domain/MonthlyCardOrder.java
View file @
300b1541
...
...
@@ -73,13 +73,13 @@ public class MonthlyCardOrder extends BaseEntity {
* 支付方式
*/
@Excel
(
name
=
"支付方式"
)
private
Long
payType
;
private
Integer
payType
;
/**
* 状态:0-待支付,1-支付成功,2-退款中,3-退款完成
*/
@Excel
(
name
=
"状态:0-待支付,1-支付成功,2-退款中,3-退款完成"
)
private
Long
payStatus
;
private
Integer
payStatus
;
/**
* 支付时间
...
...
share-system/src/main/java/share/system/mapper/ConsumerMonthlyCardMapper.java
View file @
300b1541
...
...
@@ -60,4 +60,6 @@ public interface ConsumerMonthlyCardMapper extends BaseMapper<ConsumerMonthlyCar
* @return 结果
*/
public
int
deleteConsumerMonthlyCardByIds
(
Long
[]
ids
);
ConsumerMonthlyCardVo
selectByConsumerId
(
ConsumerMonthlyCardVo
consumerMemberVo
);
}
share-system/src/main/java/share/system/mapper/ConsumerSecondaryCardMapper.java
View file @
300b1541
...
...
@@ -60,4 +60,6 @@ public interface ConsumerSecondaryCardMapper extends BaseMapper<ConsumerSecondar
* @return 结果
*/
public
int
deleteConsumerSecondaryCardByIds
(
Long
[]
ids
);
List
<
ConsumerSecondaryCardVo
>
selectByConsumerId
(
ConsumerSecondaryCardVo
vo
);
}
share-system/src/main/java/share/system/mapper/MonthlyCardOrderMapper.java
View file @
300b1541
...
...
@@ -60,4 +60,6 @@ public interface MonthlyCardOrderMapper extends BaseMapper<MonthlyCardOrder> {
* @return 结果
*/
public
int
deleteMonthlyCardOrderByIds
(
Long
[]
ids
);
MonthlyCardOrder
getInfoByEntity
(
MonthlyCardOrder
monthlyCardOrder
);
}
share-system/src/main/java/share/system/request/CreateMonthlyCardRequest.java
0 → 100644
View file @
300b1541
package
share
.
system
.
request
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.experimental.Accessors
;
import
javax.validation.constraints.NotNull
;
@Data
@EqualsAndHashCode
(
callSuper
=
false
)
@Accessors
(
chain
=
true
)
@ApiModel
(
value
=
"CreateMonthlyCardRequest对象"
,
description
=
"下单请求对象"
)
public
class
CreateMonthlyCardRequest
{
@ApiModelProperty
(
value
=
"支付类型(1:微信,2:支付宝)"
,
required
=
true
)
@NotNull
(
message
=
"支付类型不能为空"
)
private
Integer
payType
;
@ApiModelProperty
(
value
=
"充值配置表id"
)
@NotNull
(
message
=
"充值配置表id"
)
private
Long
monthlyCardConfId
;
}
share-system/src/main/java/share/system/response/EquityMembersResultResponse.java
View file @
300b1541
...
...
@@ -27,7 +27,7 @@ public class EquityMembersResultResponse {
private
String
payType
;
@ApiModelProperty
(
value
=
"订单编号"
)
private
String
recharge
No
;
private
String
equityOrder
No
;
@ApiModelProperty
(
value
=
"微信支付回调的url"
)
private
String
notifyUrl
;
...
...
share-system/src/main/java/share/system/response/MonthlyyCardPayResultResponse.java
0 → 100644
View file @
300b1541
package
share
.
system
.
response
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.experimental.Accessors
;
import
share.system.domain.vo.WxPayJsResultVo
;
@Data
@EqualsAndHashCode
(
callSuper
=
false
)
@Accessors
(
chain
=
true
)
@ApiModel
(
value
=
"MonthlyyCardPayResultResponse对象"
,
description
=
"订单支付结果响应对象"
)
public
class
MonthlyyCardPayResultResponse
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"支付状态"
)
private
Boolean
status
;
@ApiModelProperty
(
value
=
"微信调起支付参数对象"
)
private
WxPayJsResultVo
jsConfig
;
@ApiModelProperty
(
value
=
"支付类型"
)
private
String
payType
;
@ApiModelProperty
(
value
=
"订单编号"
)
private
String
monthlyCardNo
;
@ApiModelProperty
(
value
=
"微信支付回调的url"
)
private
String
notifyUrl
;
}
share-system/src/main/java/share/system/service/ConsumerMonthlyCardService.java
View file @
300b1541
...
...
@@ -60,4 +60,6 @@ public interface ConsumerMonthlyCardService extends IService<ConsumerMonthlyCard
* @return 结果
*/
public
int
deleteConsumerMonthlyCardById
(
Long
id
);
ConsumerMonthlyCardVo
selectByConsumerId
();
}
share-system/src/main/java/share/system/service/ConsumerSecondaryCardService.java
View file @
300b1541
...
...
@@ -60,4 +60,6 @@ public interface ConsumerSecondaryCardService extends IService<ConsumerSecondary
* @return 结果
*/
public
int
deleteConsumerSecondaryCardById
(
Long
id
);
List
<
ConsumerSecondaryCardVo
>
selectByConsumerId
();
}
share-system/src/main/java/share/system/service/MonthlyCardOrderService.java
View file @
300b1541
...
...
@@ -3,6 +3,8 @@ package share.system.service;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
share.system.domain.MonthlyCardOrder
;
import
share.system.domain.vo.MonthlyCardOrderVo
;
import
share.system.request.CreateMonthlyCardRequest
;
import
share.system.response.MonthlyyCardPayResultResponse
;
import
java.util.List
;
...
...
@@ -60,4 +62,12 @@ public interface MonthlyCardOrderService extends IService<MonthlyCardOrder> {
* @return 结果
*/
public
int
deleteMonthlyCardOrderById
(
Long
id
);
MonthlyyCardPayResultResponse
createMonthlyCard
(
CreateMonthlyCardRequest
request
);
MonthlyCardOrderVo
queryMonthlyCardInfoByNo
(
String
monthlyCardNo
);
void
paymentSuccessful
(
MonthlyCardOrder
monthlyCardOrder
);
MonthlyCardOrder
getInfoByEntity
(
MonthlyCardOrder
monthlyCardOrder
);
}
share-system/src/main/java/share/system/service/OrderPayService.java
View file @
300b1541
package
share
.
system
.
service
;
import
share.system.domain.EquityMembersOrder
;
import
share.system.domain.Recharge
;
import
share.system.domain.SOrder
;
import
share.system.domain.SecondaryCardOrder
;
import
share.system.response.EquityMembersResultResponse
;
import
share.system.response.OrderPayResultResponse
;
import
share.system.response.RechargePayResultResponse
;
import
share.system.response.SecondaryCardOrderPayResultResponse
;
import
share.system.domain.*
;
import
share.system.response.*
;
/**
* @Author wwl
...
...
@@ -39,4 +33,6 @@ public interface OrderPayService {
EquityMembersResultResponse
saobeiEquityMembersOrderPayment
(
EquityMembersOrder
equityMembersOrder
);
SecondaryCardOrderPayResultResponse
saobeiSecondaryCardOrderPayment
(
SecondaryCardOrder
secondaryCardOrder
);
MonthlyyCardPayResultResponse
saobeiCreateMonthlyCardOrderPayment
(
MonthlyCardOrder
monthlyCardOrder
);
}
share-system/src/main/java/share/system/service/SecondaryCardOrderService.java
View file @
300b1541
...
...
@@ -68,4 +68,6 @@ public interface SecondaryCardOrderService extends IService<SecondaryCardOrder>
void
paymentSuccessful
(
SecondaryCardOrder
secondaryCardOrder
);
SecondaryCardOrder
getInfoByEntity
(
SecondaryCardOrder
secondaryCardOrderParam
);
SecondaryCardOrderVo
querySecondaryCardInfoByNo
(
String
secondaryCardNo
);
}
share-system/src/main/java/share/system/service/impl/CallbackServiceImpl.java
View file @
300b1541
...
...
@@ -76,6 +76,9 @@ public class CallbackServiceImpl implements CallbackService {
@Autowired
private
SecondaryCardOrderService
secondaryCardOrderService
;
@Autowired
private
MonthlyCardOrderService
monthlyCardOrderService
;
/**
* 微信支付回调
*/
...
...
@@ -618,6 +621,84 @@ public class CallbackServiceImpl implements CallbackService {
return
responseVo
;
}
break
;
case
MONTH_CARD:
logger
.
debug
(
"开始月卡订单回调"
);
MonthlyCardOrder
monthlyCardOrderParam
=
new
MonthlyCardOrder
();
monthlyCardOrderParam
.
setTerminalTrace
(
param
.
getTerminal_trace
());
monthlyCardOrderParam
.
setConsumerId
(
attachVo
.
getUserId
());
MonthlyCardOrder
monthlyCardOrder
=
monthlyCardOrderService
.
getInfoByEntity
(
monthlyCardOrderParam
);
if
(
ObjectUtil
.
isNull
(
monthlyCardOrder
))
{
logger
.
error
(
"saobei wechat pay error : 订单信息不存在==》"
+
param
.
getTerminal_trace
());
responseVo
.
setReturn_code
(
SaobeiStatusEnum
.
FAIL
.
getCode
());
responseVo
.
setReturn_msg
(
"订单信息不存在!"
);
// 保存api日志
saobeiApiLog
.
setResponseParams
(
JSONUtil
.
toJsonStr
(
responseVo
));
saobeiApiLog
.
setResult
(
responseVo
.
getReturn_code
());
saobeiApiLog
.
setResultMsg
(
responseVo
.
getReturn_msg
());
saobeiApiLog
.
setOutTradeNo
(
param
.
getOut_trade_no
());
saobeiApiLogService
.
insertSaobeiApiLog
(
saobeiApiLog
);
return
responseVo
;
}
if
(
YesNoEnum
.
yes
.
getIndex
().
equals
(
monthlyCardOrder
.
getPayStatus
()))
{
logger
.
error
(
"saobei wechat pay error : 订单已处理==》"
+
param
.
getTerminal_trace
());
responseVo
.
setReturn_code
(
SaobeiStatusEnum
.
SUCCESS
.
getCode
());
responseVo
.
setReturn_msg
(
"success"
);
// 保存api日志
saobeiApiLog
.
setResponseParams
(
JSONUtil
.
toJsonStr
(
responseVo
));
saobeiApiLog
.
setResult
(
responseVo
.
getReturn_code
());
saobeiApiLog
.
setResultMsg
(
responseVo
.
getReturn_msg
());
saobeiApiLog
.
setOutTradeNo
(
param
.
getOut_trade_no
());
saobeiApiLogService
.
insertSaobeiApiLog
(
saobeiApiLog
);
return
responseVo
;
}
WechatPayInfo
monthlyCardOrderPayInfo
=
wechatPayInfoService
.
getByNo
(
monthlyCardOrder
.
getTerminalTrace
());
if
(
ObjectUtil
.
isNull
(
monthlyCardOrderPayInfo
))
{
logger
.
error
(
"saobei wechat pay error : 微信订单信息不存在==》"
+
param
.
getTerminal_trace
());
responseVo
.
setReturn_code
(
SaobeiStatusEnum
.
FAIL
.
getCode
());
responseVo
.
setReturn_msg
(
"微信订单信息不存在!"
);
// 保存api日志
saobeiApiLog
.
setResponseParams
(
JSONUtil
.
toJsonStr
(
responseVo
));
saobeiApiLog
.
setResult
(
responseVo
.
getReturn_code
());
saobeiApiLog
.
setResultMsg
(
responseVo
.
getReturn_msg
());
saobeiApiLog
.
setOutTradeNo
(
param
.
getOut_trade_no
());
saobeiApiLogService
.
insertSaobeiApiLog
(
saobeiApiLog
);
return
responseVo
;
}
// wechatPayInfo.setIsSubscribe(param.getIsSubscribe());
monthlyCardOrderPayInfo
.
setBankType
(
param
.
getBank_type
());
monthlyCardOrderPayInfo
.
setCashFee
(
Integer
.
valueOf
(
param
.
getTotal_fee
()));
// wechatPayInfo.setTransactionId(param.getOut_trade_no());
monthlyCardOrderPayInfo
.
setTimeEnd
(
param
.
getEnd_time
());
monthlyCardOrderPayInfo
.
setTimeExpire
(
param
.
getEnd_time
());
Boolean
monthlyCardBoolean
=
Boolean
.
FALSE
;
try
{
monthlyCardOrder
.
setPayStatus
(
YesNoEnum
.
yes
.
getIndex
());
monthlyCardOrder
.
setPayTime
(
DateUtils
.
getNowDate
());
monthlyCardOrderService
.
paymentSuccessful
(
monthlyCardOrder
);
monthlyCardOrderPayInfo
.
setTradeState
(
"1"
);
monthlyCardOrderPayInfo
.
setTradeStateDesc
(
"支付成功"
);
wechatPayInfoService
.
updateById
(
monthlyCardOrderPayInfo
);
monthlyCardBoolean
=
Boolean
.
TRUE
;
}
catch
(
Exception
e
)
{
logger
.
error
(
"微信支付回调出错"
);
logger
.
error
(
e
.
toString
());
}
logger
.
debug
(
"结束权益会员订单回调"
);
if
(!
monthlyCardBoolean
)
{
logger
.
error
(
"saobei wechat pay error : 订单更新失败==》"
+
param
.
getTerminal_trace
());
responseVo
.
setReturn_code
(
SaobeiStatusEnum
.
FAIL
.
getCode
());
responseVo
.
setReturn_msg
(
"订单更新失败!"
);
// 保存api日志
saobeiApiLog
.
setResponseParams
(
JSONUtil
.
toJsonStr
(
responseVo
));
saobeiApiLog
.
setResult
(
responseVo
.
getReturn_code
());
saobeiApiLog
.
setResultMsg
(
responseVo
.
getReturn_msg
());
saobeiApiLog
.
setOutTradeNo
(
param
.
getOut_trade_no
());
saobeiApiLogService
.
insertSaobeiApiLog
(
saobeiApiLog
);
return
responseVo
;
}
break
;
default
:
logger
.
error
(
"wechat pay err : 未知的支付类型==》"
+
param
.
getTerminal_trace
());
break
;
...
...
share-system/src/main/java/share/system/service/impl/ConsumerMonthlyCardServiceImpl.java
View file @
300b1541
...
...
@@ -5,9 +5,11 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.stereotype.Service
;
import
share.common.utils.DateUtils
;
import
share.system.domain.ConsumerMonthlyCard
;
import
share.system.domain.SConsumer
;
import
share.system.domain.vo.ConsumerMonthlyCardVo
;
import
share.system.mapper.ConsumerMonthlyCardMapper
;
import
share.system.service.ConsumerMonthlyCardService
;
import
share.system.service.SConsumerService
;
import
java.util.List
;
...
...
@@ -21,6 +23,8 @@ import java.util.List;
public
class
ConsumerMonthlyCardServiceImpl
extends
ServiceImpl
<
ConsumerMonthlyCardMapper
,
ConsumerMonthlyCard
>
implements
ConsumerMonthlyCardService
{
@Autowired
private
ConsumerMonthlyCardMapper
consumerMonthlyCardMapper
;
@Autowired
private
SConsumerService
sConsumerService
;
/**
* 查询用户月卡
...
...
@@ -89,4 +93,12 @@ public class ConsumerMonthlyCardServiceImpl extends ServiceImpl<ConsumerMonthlyC
public
int
deleteConsumerMonthlyCardById
(
Long
id
)
{
return
consumerMonthlyCardMapper
.
deleteConsumerMonthlyCardById
(
id
);
}
@Override
public
ConsumerMonthlyCardVo
selectByConsumerId
()
{
SConsumer
info
=
sConsumerService
.
getInfo
();
ConsumerMonthlyCardVo
vo
=
new
ConsumerMonthlyCardVo
();
vo
.
setConsumerId
(
info
.
getId
());
return
consumerMonthlyCardMapper
.
selectByConsumerId
(
vo
);
}
}
share-system/src/main/java/share/system/service/impl/ConsumerSecondaryCardServiceImpl.java
View file @
300b1541
...
...
@@ -5,9 +5,11 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.stereotype.Service
;
import
share.common.utils.DateUtils
;
import
share.system.domain.ConsumerSecondaryCard
;
import
share.system.domain.SConsumer
;
import
share.system.domain.vo.ConsumerSecondaryCardVo
;
import
share.system.mapper.ConsumerSecondaryCardMapper
;
import
share.system.service.ConsumerSecondaryCardService
;
import
share.system.service.SConsumerService
;
import
java.util.List
;
...
...
@@ -21,6 +23,8 @@ import java.util.List;
public
class
ConsumerSecondaryCardServiceImpl
extends
ServiceImpl
<
ConsumerSecondaryCardMapper
,
ConsumerSecondaryCard
>
implements
ConsumerSecondaryCardService
{
@Autowired
private
ConsumerSecondaryCardMapper
consumerSecondaryCardMapper
;
@Autowired
private
SConsumerService
sConsumerService
;
/**
* 查询用户次卡
...
...
@@ -89,4 +93,12 @@ public class ConsumerSecondaryCardServiceImpl extends ServiceImpl<ConsumerSecond
public
int
deleteConsumerSecondaryCardById
(
Long
id
)
{
return
consumerSecondaryCardMapper
.
deleteConsumerSecondaryCardById
(
id
);
}
@Override
public
List
<
ConsumerSecondaryCardVo
>
selectByConsumerId
()
{
SConsumer
info
=
sConsumerService
.
getInfo
();
ConsumerSecondaryCardVo
vo
=
new
ConsumerSecondaryCardVo
();
vo
.
setConsumerId
(
info
.
getId
());
return
consumerSecondaryCardMapper
.
selectByConsumerId
(
vo
);
}
}
share-system/src/main/java/share/system/service/impl/MonthlyCardOrderServiceImpl.java
View file @
300b1541
package
share
.
system
.
service
.
impl
;
import
cn.hutool.core.util.ObjectUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
share.common.enums.YesNoEnum
;
import
share.common.exception.base.BaseException
;
import
share.common.utils.BaseUtil
;
import
share.common.utils.DateUtils
;
import
share.common.utils.bean.BeanUtils
;
import
share.system.domain.ConsumerMonthlyCard
;
import
share.system.domain.MonthlyCardConf
;
import
share.system.domain.MonthlyCardOrder
;
import
share.system.domain.SConsumer
;
import
share.system.domain.vo.FrontTokenComponent
;
import
share.system.domain.vo.MonthlyCardOrderVo
;
import
share.system.mapper.MonthlyCardOrderMapper
;
import
share.system.service.MonthlyCardOrderService
;
import
share.system.request.CreateMonthlyCardRequest
;
import
share.system.response.MonthlyyCardPayResultResponse
;
import
share.system.service.*
;
import
java.util.Date
;
import
java.util.List
;
/**
...
...
@@ -21,6 +36,14 @@ import java.util.List;
public
class
MonthlyCardOrderServiceImpl
extends
ServiceImpl
<
MonthlyCardOrderMapper
,
MonthlyCardOrder
>
implements
MonthlyCardOrderService
{
@Autowired
private
MonthlyCardOrderMapper
monthlyCardOrderMapper
;
@Autowired
private
SConsumerService
sConsumerService
;
@Autowired
private
OrderPayService
orderPayService
;
@Autowired
private
MonthlyCardConfService
monthlyCardConfService
;
@Autowired
private
ConsumerMonthlyCardService
consumerMonthlyCardService
;
/**
* 查询月卡订单
...
...
@@ -89,4 +112,66 @@ public class MonthlyCardOrderServiceImpl extends ServiceImpl<MonthlyCardOrderMap
public
int
deleteMonthlyCardOrderById
(
Long
id
)
{
return
monthlyCardOrderMapper
.
deleteMonthlyCardOrderById
(
id
);
}
@Override
public
MonthlyyCardPayResultResponse
createMonthlyCard
(
CreateMonthlyCardRequest
request
)
{
SConsumer
user
=
FrontTokenComponent
.
getWxSConsumerEntry
();
if
(
ObjectUtil
.
isNull
(
user
))
{
throw
new
BaseException
(
"您的登录已过期,请先登录"
);
}
if
(
StringUtils
.
isEmpty
(
user
.
getPhone
()))
{
user
=
sConsumerService
.
getById
(
user
.
getId
());
if
(
StringUtils
.
isEmpty
(
user
.
getPhone
()))
{
throw
new
BaseException
(
"请绑定手机号"
);
}
}
MonthlyCardOrder
monthlyCardOrder
=
generatMonthlyCarddOrder
(
request
,
user
);
monthlyCardOrder
.
setCreateTime
(
new
Date
());
save
(
monthlyCardOrder
);
MonthlyyCardPayResultResponse
response
=
orderPayService
.
saobeiCreateMonthlyCardOrderPayment
(
monthlyCardOrder
);
return
response
;
}
private
MonthlyCardOrder
generatMonthlyCarddOrder
(
CreateMonthlyCardRequest
request
,
SConsumer
user
)
{
MonthlyCardOrder
monthlyCardOrder
=
new
MonthlyCardOrder
();
BeanUtils
.
copyProperties
(
request
,
monthlyCardOrder
);
MonthlyCardConf
byId
=
monthlyCardConfService
.
getById
(
request
.
getMonthlyCardConfId
());
if
(
ObjectUtil
.
isEmpty
(
byId
))
{
throw
new
BaseException
(
"月卡配置异常"
);
}
monthlyCardOrder
.
setMonthlyCardNo
(
BaseUtil
.
getOrderNo
(
"YK"
));
monthlyCardOrder
.
setMonthlyCardAmount
(
byId
.
getMonthlyCardAmount
());
monthlyCardOrder
.
setPayStatus
(
YesNoEnum
.
no
.
getIndex
());
monthlyCardOrder
.
setConsumerId
(
user
.
getId
());
monthlyCardOrder
.
setPhone
(
user
.
getPhone
());
return
monthlyCardOrder
;
}
@Override
public
MonthlyCardOrderVo
queryMonthlyCardInfoByNo
(
String
monthlyCardNo
)
{
LambdaQueryWrapper
<
MonthlyCardOrder
>
lqw
=
Wrappers
.
lambdaQuery
();
lqw
.
eq
(
MonthlyCardOrder:
:
getMonthlyCardNo
,
monthlyCardNo
);
MonthlyCardOrder
one
=
getOne
(
lqw
);
MonthlyCardOrderVo
vo
=
new
MonthlyCardOrderVo
();
BeanUtils
.
copyProperties
(
one
,
vo
);
return
vo
;
}
@Override
public
void
paymentSuccessful
(
MonthlyCardOrder
monthlyCardOrder
)
{
ConsumerMonthlyCard
consumerMonthlyCard
=
new
ConsumerMonthlyCard
();
MonthlyCardConf
byId
=
monthlyCardConfService
.
getById
(
monthlyCardOrder
.
getMonthlyCardConfId
());
consumerMonthlyCard
.
setMonthlyCardConfId
(
byId
.
getId
());
consumerMonthlyCard
.
setConsumerId
(
monthlyCardOrder
.
getConsumerId
());
consumerMonthlyCard
.
setPhone
(
monthlyCardOrder
.
getPhone
());
consumerMonthlyCard
.
setExpirationDate
(
DateUtils
.
addYears
(
new
Date
(),
byId
.
getMonthlyCardDays
().
intValue
()));
consumerMonthlyCard
.
setFreeDuration
(
byId
.
getFreeDuration
());
consumerMonthlyCard
.
setMonthlyCardDays
(
byId
.
getMonthlyCardDays
());
consumerMonthlyCardService
.
save
(
consumerMonthlyCard
);
}
@Override
public
MonthlyCardOrder
getInfoByEntity
(
MonthlyCardOrder
monthlyCardOrder
)
{
return
monthlyCardOrderMapper
.
getInfoByEntity
(
monthlyCardOrder
);
}
}
share-system/src/main/java/share/system/service/impl/OrderPayServiceImpl.java
View file @
300b1541
...
...
@@ -22,10 +22,7 @@ import share.common.utils.DateUtil;
import
share.common.utils.JsonConvertUtil
;
import
share.system.domain.*
;
import
share.system.domain.vo.*
;
import
share.system.response.EquityMembersResultResponse
;
import
share.system.response.OrderPayResultResponse
;
import
share.system.response.RechargePayResultResponse
;
import
share.system.response.SecondaryCardOrderPayResultResponse
;
import
share.system.response.*
;
import
share.system.service.*
;
import
share.system.util.WxPayUtil
;
...
...
@@ -64,6 +61,10 @@ public class OrderPayServiceImpl implements OrderPayService {
private
SecondaryCardOrderService
secondaryCardOrderService
;
@Autowired
private
SecondaryCardConfService
secondaryCardConfService
;
@Autowired
private
MonthlyCardOrderService
monthlyCardOrderService
;
@Autowired
private
MonthlyCardConfService
monthlyCardConfService
;
/**
* 获取域名
...
...
@@ -337,7 +338,7 @@ public class OrderPayServiceImpl implements OrderPayService {
@Override
public
EquityMembersResultResponse
saobeiEquityMembersOrderPayment
(
EquityMembersOrder
equityMembersOrder
)
{
EquityMembersResultResponse
response
=
new
EquityMembersResultResponse
();
response
.
set
Recharge
No
(
equityMembersOrder
.
getEquityOrderNo
());
response
.
set
EquityOrder
No
(
equityMembersOrder
.
getEquityOrderNo
());
response
.
setPayType
(
PayTypeEnum
.
getEnumByCode
(
equityMembersOrder
.
getPayType
().
intValue
()).
getValue
());
response
.
setStatus
(
YesNoEnum
.
no
.
getFlag
());
// 扫呗支付
...
...
@@ -480,4 +481,77 @@ public class OrderPayServiceImpl implements OrderPayService {
return
vo
;
}
@Override
public
MonthlyyCardPayResultResponse
saobeiCreateMonthlyCardOrderPayment
(
MonthlyCardOrder
monthlyCardOrder
)
{
MonthlyyCardPayResultResponse
response
=
new
MonthlyyCardPayResultResponse
();
response
.
setMonthlyCardNo
(
monthlyCardOrder
.
getMonthlyCardNo
());
response
.
setPayType
(
PayTypeEnum
.
getEnumByCode
(
monthlyCardOrder
.
getPayType
()).
getValue
());
response
.
setStatus
(
YesNoEnum
.
no
.
getFlag
());
// 扫呗支付
ConcurrentHashMap
<
String
,
String
>
unifiedorder
=
saobeiUnifiedMonthlyCardOrder
(
monthlyCardOrder
);
WxPayJsResultVo
vo
=
new
WxPayJsResultVo
();
vo
.
setAppId
(
unifiedorder
.
get
(
"appId"
));
vo
.
setNonceStr
(
unifiedorder
.
get
(
"nonceStr"
));
vo
.
setPackages
(
unifiedorder
.
get
(
"package"
));
vo
.
setSignType
(
unifiedorder
.
get
(
"signType"
));
vo
.
setTimeStamp
(
unifiedorder
.
get
(
"timeStamp"
));
vo
.
setPaySign
(
unifiedorder
.
get
(
"paySign"
));
// 更新商户订单号
monthlyCardOrder
.
setOutTradeNo
(
unifiedorder
.
get
(
"outTradeNo"
));
monthlyCardOrder
.
setTerminalTrace
(
unifiedorder
.
get
(
"terminalTrace"
));
monthlyCardOrderService
.
updateById
(
monthlyCardOrder
);
response
.
setJsConfig
(
vo
);
return
response
;
}
private
ConcurrentHashMap
<
String
,
String
>
saobeiUnifiedMonthlyCardOrder
(
MonthlyCardOrder
monthlyCardOrder
)
{
// 获取用户openId
SConsumerToken
userToken
=
consumerTokenService
.
getTokenByUserId
(
monthlyCardOrder
.
getConsumerId
());
if
(
ObjectUtil
.
isNull
(
userToken
))
{
throw
new
BaseException
(
"该用户没有openId"
);
}
// 获取appid、mch_id
// 微信签名key
String
appId
=
weChatConfig
.
getAppId
();
String
mchId
=
weChatConfig
.
getMchId
();
String
signKey
=
weChatConfig
.
getSignKey
();
// 获取扫呗微信预下单对象
SaobeiMiniPayRequestVo
unifiedorderVo
=
getSaobeiUnifiedMonthlyCardOrderVo
(
monthlyCardOrder
,
userToken
.
getToken
(),
appId
,
mchId
,
signKey
);
// 预下单(统一下单)
SaobeiMiniPayResponse
response
=
saobeiService
.
wechatMinipay
(
unifiedorderVo
);
logger
.
debug
(
"SaobeiMiniPayResponse :"
,
JsonConvertUtil
.
write2JsonStr
(
response
));
// 组装前端预下单参数
ConcurrentHashMap
<
String
,
String
>
map
=
new
ConcurrentHashMap
<>();
map
.
put
(
"appId"
,
response
.
getAppId
());
map
.
put
(
"nonceStr"
,
response
.
getNonceStr
());
map
.
put
(
"package"
,
response
.
getPackage_str
());
map
.
put
(
"signType"
,
response
.
getSignType
());
map
.
put
(
"timeStamp"
,
response
.
getTimeStamp
());
map
.
put
(
"paySign"
,
response
.
getPaySign
());
map
.
put
(
"prepayTime"
,
DateUtil
.
nowDateTimeStr
());
map
.
put
(
"outTradeNo"
,
response
.
getOut_trade_no
());
map
.
put
(
"terminalTrace"
,
unifiedorderVo
.
getTerminal_trace
());
return
map
;
}
private
SaobeiMiniPayRequestVo
getSaobeiUnifiedMonthlyCardOrderVo
(
MonthlyCardOrder
monthlyCardOrder
,
String
openid
,
String
appId
,
String
mchId
,
String
signKey
)
{
AttachVo
attachVo
=
new
AttachVo
(
OrderTypeEnum
.
MONTH_CARD
.
getValue
(),
monthlyCardOrder
.
getConsumerId
());
MonthlyCardConf
byId
=
monthlyCardConfService
.
getById
(
monthlyCardOrder
.
getMonthlyCardConfId
());
SaobeiMiniPayRequestVo
vo
=
new
SaobeiMiniPayRequestVo
();
vo
.
setSub_appid
(
appId
);
vo
.
setMerchant_no
(
saobeiConfig
.
getMerchantNo
());
vo
.
setTerminal_id
(
saobeiConfig
.
getTerminalId
());
vo
.
setAttach
(
JSONObject
.
toJSONString
(
attachVo
));
vo
.
setTerminal_trace
(
BaseUtil
.
getOrderNo
(
"WXNO"
));
vo
.
setTerminal_time
(
DateUtil
.
nowDate
(
Constants
.
DATE_TIME_FORMAT_NUM
));
vo
.
setOrder_body
(
StrUtil
.
concat
(
true
,
"购买"
+
byId
.
getMonthlyCardAmount
()
+
"元"
+
byId
.
getName
()
+
"月卡"
));
// 订单中使用的是BigDecimal,这里要转为Integer类型
vo
.
setTotal_fee
(
String
.
valueOf
(
monthlyCardOrder
.
getMonthlyCardAmount
().
multiply
(
BigDecimal
.
TEN
).
multiply
(
BigDecimal
.
TEN
).
intValue
()));
vo
.
setNotify_url
(
apiDomain
+
PayConstants
.
SAOBEI_PAY_NOTIFY_API_URI
);
vo
.
setTrade_type
(
PayConstants
.
WX_PAY_TRADE_TYPE_JS
);
vo
.
setOpen_id
(
openid
);
vo
.
setDevice_no
(
"WEB"
);
return
vo
;
}
}
share-system/src/main/java/share/system/service/impl/SecondaryCardOrderServiceImpl.java
View file @
300b1541
package
share
.
system
.
service
.
impl
;
import
cn.hutool.core.util.ObjectUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -163,4 +164,14 @@ public class SecondaryCardOrderServiceImpl extends ServiceImpl<SecondaryCardOrde
public
SecondaryCardOrder
getInfoByEntity
(
SecondaryCardOrder
secondaryCardOrderParam
)
{
return
secondaryCardOrderMapper
.
getInfoByEntity
(
secondaryCardOrderParam
);
}
@Override
public
SecondaryCardOrderVo
querySecondaryCardInfoByNo
(
String
secondaryCardNo
)
{
LambdaQueryWrapper
<
SecondaryCardOrder
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
eq
(
SecondaryCardOrder:
:
getSecondaryCardNo
,
secondaryCardNo
);
SecondaryCardOrder
secondaryCardOrder
=
getOne
(
wrapper
);
SecondaryCardOrderVo
vo
=
new
SecondaryCardOrderVo
();
BeanUtils
.
copyProperties
(
secondaryCardOrder
,
vo
);
return
vo
;
}
}
share-system/src/main/resources/mapper/system/ConsumerMonthlyCardMapper.xml
View file @
300b1541
...
...
@@ -75,6 +75,27 @@
<include
refid=
"selectConsumerMonthlyCardVo"
/>
where id = #{id}
</select>
<select
id=
"selectByConsumerId"
resultMap=
"ConsumerMonthlyCardResult"
>
select c.id,
c.monthly_card_conf_id,
c.consumer_id,
c2.nick_name,
c2.avatar,
c.phone,
c.free_duration,
c.monthly_card_days,
c.expiration_date,
c.is_delete,
c.create_by,
c.create_time,
c.update_by,
c.update_time,
c.remark
from s_consumer_monthly_card c
join s_consumer c2 on c.consumer_id = c2.id
where c.is_delete = 0
and c.consumer_id = #{consumerId}
</select>
<insert
id=
"insertConsumerMonthlyCard"
parameterType=
"ConsumerMonthlyCard"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
insert into s_consumer_monthly_card
...
...
share-system/src/main/resources/mapper/system/ConsumerSecondaryCardMapper.xml
View file @
300b1541
...
...
@@ -80,6 +80,27 @@
<include
refid=
"selectConsumerSecondaryCardVo"
/>
where id = #{id}
</select>
<select
id=
"selectByConsumerId"
resultMap=
"ConsumerSecondaryCardResult"
>
select c.id,
c.secondary_card_conf_id,
c.consumer_id,
c.phone,
m.nick_name,
m.avatar,
c.pack_id,
c.expiration_date,
c.number,
c.is_delete,
c.create_by,
c.create_time,
c.update_by,
c.update_time,
c.remark
from s_consumer_secondary_card c
join s_consumer m on c.consumer_id = m.id
where c.is_delete = 0
and c.consumer_id = #{consumerId}
</select>
<insert
id=
"insertConsumerSecondaryCard"
parameterType=
"ConsumerSecondaryCard"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
...
...
share-system/src/main/resources/mapper/system/MonthlyCardOrderMapper.xml
View file @
300b1541
...
...
@@ -90,6 +90,10 @@
<include
refid=
"selectMonthlyCardOrderVo"
/>
where id = #{id}
</select>
<select
id=
"getInfoByEntity"
resultType=
"share.system.domain.MonthlyCardOrder"
>
<include
refid=
"selectMonthlyCardOrderVo"
/>
where terminal_trace=#{terminalTrace} and consumer_id=#{consumerId}
</select>
<insert
id=
"insertMonthlyCardOrder"
parameterType=
"MonthlyCardOrder"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
insert into s_monthly_card_order
...
...
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