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
af01395a
Commit
af01395a
authored
Oct 08, 2024
by
吕明尚
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加次卡的判断
parent
4c543c47
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
50 additions
and
2 deletions
+50
-2
ConsumerSecondaryCardController.java
...eb/controller/system/ConsumerSecondaryCardController.java
+2
-2
ConsumerSecondaryCardVo.java
.../java/share/system/domain/vo/ConsumerSecondaryCardVo.java
+4
-0
OrderComputedPriceRequest.java
.../java/share/system/request/OrderComputedPriceRequest.java
+8
-0
ConsumerSecondaryCardService.java
...va/share/system/service/ConsumerSecondaryCardService.java
+2
-0
ConsumerSecondaryCardServiceImpl.java
...system/service/impl/ConsumerSecondaryCardServiceImpl.java
+34
-0
No files found.
share-front/src/main/java/share/web/controller/system/ConsumerSecondaryCardController.java
View file @
af01395a
...
@@ -35,8 +35,8 @@ public class ConsumerSecondaryCardController extends BaseController {
...
@@ -35,8 +35,8 @@ public class ConsumerSecondaryCardController extends BaseController {
}
}
@GetMapping
(
"/query"
)
@GetMapping
(
"/query"
)
public
AjaxResult
selectByConsumerId
()
{
public
AjaxResult
selectByConsumerId
(
Long
packId
)
{
return
success
(
consumerSecondaryCardService
.
selectBy
ConsumerId
(
));
return
success
(
consumerSecondaryCardService
.
selectBy
PaclId
(
packId
));
}
}
}
}
share-system/src/main/java/share/system/domain/vo/ConsumerSecondaryCardVo.java
View file @
af01395a
...
@@ -19,4 +19,8 @@ public class ConsumerSecondaryCardVo extends ConsumerSecondaryCard {
...
@@ -19,4 +19,8 @@ public class ConsumerSecondaryCardVo extends ConsumerSecondaryCard {
private
String
confName
;
private
String
confName
;
//次卡金额
//次卡金额
private
BigDecimal
confAmount
;
private
BigDecimal
confAmount
;
//是否适用当前套餐
private
Integer
isUse
;
//原因
private
String
reason
;
}
}
share-system/src/main/java/share/system/request/OrderComputedPriceRequest.java
View file @
af01395a
...
@@ -54,4 +54,12 @@ public class OrderComputedPriceRequest {
...
@@ -54,4 +54,12 @@ public class OrderComputedPriceRequest {
@ApiModelProperty
(
value
=
"标签id"
)
@ApiModelProperty
(
value
=
"标签id"
)
private
Long
roomLabelId
;
private
Long
roomLabelId
;
//次卡ID
@ApiModelProperty
(
value
=
"次卡ID"
)
private
Long
secondaryCardId
;
//月卡ID
@ApiModelProperty
(
value
=
"月卡ID"
)
private
Long
monthlyCardId
;
}
}
share-system/src/main/java/share/system/service/ConsumerSecondaryCardService.java
View file @
af01395a
...
@@ -62,4 +62,6 @@ public interface ConsumerSecondaryCardService extends IService<ConsumerSecondary
...
@@ -62,4 +62,6 @@ public interface ConsumerSecondaryCardService extends IService<ConsumerSecondary
public
int
deleteConsumerSecondaryCardById
(
Long
id
);
public
int
deleteConsumerSecondaryCardById
(
Long
id
);
List
<
ConsumerSecondaryCardVo
>
selectByConsumerId
();
List
<
ConsumerSecondaryCardVo
>
selectByConsumerId
();
List
<
ConsumerSecondaryCardVo
>
selectByPaclId
(
Long
packId
);
}
}
share-system/src/main/java/share/system/service/impl/ConsumerSecondaryCardServiceImpl.java
View file @
af01395a
package
share
.
system
.
service
.
impl
;
package
share
.
system
.
service
.
impl
;
import
cn.hutool.core.util.ObjectUtil
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
share.common.enums.YesNoEnum
;
import
share.common.exception.base.BaseException
;
import
share.common.utils.DateUtils
;
import
share.common.utils.DateUtils
;
import
share.system.domain.ConsumerSecondaryCard
;
import
share.system.domain.ConsumerSecondaryCard
;
import
share.system.domain.SConsumer
;
import
share.system.domain.SConsumer
;
import
share.system.domain.SPack
;
import
share.system.domain.vo.ConsumerSecondaryCardVo
;
import
share.system.domain.vo.ConsumerSecondaryCardVo
;
import
share.system.mapper.ConsumerSecondaryCardMapper
;
import
share.system.mapper.ConsumerSecondaryCardMapper
;
import
share.system.service.ConsumerSecondaryCardService
;
import
share.system.service.ConsumerSecondaryCardService
;
import
share.system.service.IPackService
;
import
share.system.service.SConsumerService
;
import
share.system.service.SConsumerService
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
/**
/**
* 用户次卡Service业务层处理
* 用户次卡Service业务层处理
...
@@ -25,6 +33,8 @@ public class ConsumerSecondaryCardServiceImpl extends ServiceImpl<ConsumerSecond
...
@@ -25,6 +33,8 @@ public class ConsumerSecondaryCardServiceImpl extends ServiceImpl<ConsumerSecond
private
ConsumerSecondaryCardMapper
consumerSecondaryCardMapper
;
private
ConsumerSecondaryCardMapper
consumerSecondaryCardMapper
;
@Autowired
@Autowired
private
SConsumerService
sConsumerService
;
private
SConsumerService
sConsumerService
;
@Autowired
private
IPackService
packService
;
/**
/**
* 查询用户次卡
* 查询用户次卡
...
@@ -97,8 +107,32 @@ public class ConsumerSecondaryCardServiceImpl extends ServiceImpl<ConsumerSecond
...
@@ -97,8 +107,32 @@ public class ConsumerSecondaryCardServiceImpl extends ServiceImpl<ConsumerSecond
@Override
@Override
public
List
<
ConsumerSecondaryCardVo
>
selectByConsumerId
()
{
public
List
<
ConsumerSecondaryCardVo
>
selectByConsumerId
()
{
SConsumer
info
=
sConsumerService
.
getInfo
();
SConsumer
info
=
sConsumerService
.
getInfo
();
if
(
ObjectUtil
.
isNull
(
info
))
{
throw
new
BaseException
(
"您的登录已过期,请先登录"
);
}
ConsumerSecondaryCardVo
vo
=
new
ConsumerSecondaryCardVo
();
ConsumerSecondaryCardVo
vo
=
new
ConsumerSecondaryCardVo
();
vo
.
setConsumerId
(
info
.
getId
());
vo
.
setConsumerId
(
info
.
getId
());
return
consumerSecondaryCardMapper
.
selectByConsumerId
(
vo
);
return
consumerSecondaryCardMapper
.
selectByConsumerId
(
vo
);
}
}
@Override
public
List
<
ConsumerSecondaryCardVo
>
selectByPaclId
(
Long
packId
)
{
SConsumer
info
=
sConsumerService
.
getInfo
();
if
(
ObjectUtil
.
isNull
(
info
))
{
throw
new
BaseException
(
"您的登录已过期,请先登录"
);
}
Map
<
Long
,
SPack
>
packMap
=
packService
.
list
().
stream
().
collect
(
Collectors
.
toMap
(
SPack:
:
getId
,
Function
.
identity
()));
ConsumerSecondaryCardVo
vo
=
new
ConsumerSecondaryCardVo
();
vo
.
setConsumerId
(
info
.
getId
());
List
<
ConsumerSecondaryCardVo
>
consumerSecondaryCardVos
=
consumerSecondaryCardMapper
.
selectByConsumerId
(
vo
);
consumerSecondaryCardVos
.
stream
().
forEach
(
item
->
{
if
(
item
.
getPackId
().
equals
(
packId
))
{
item
.
setIsUse
(
YesNoEnum
.
yes
.
getIndex
());
}
else
{
item
.
setIsUse
(
YesNoEnum
.
no
.
getIndex
());
item
.
setReason
(
"当前次卡适用于"
+
packMap
.
get
(
item
.
getPackId
()).
getName
()
+
"套餐"
+
",不适用于"
+
packMap
.
get
(
packId
).
getName
()
+
"套餐"
);
}
});
return
consumerSecondaryCardVos
;
}
}
}
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